text: !function(c,ne,ie){"use strict";function w(o,a){return a=a||Error,function(){var e,t,n=arguments[0],i="["+(o?o+":":"")+n+"] ",r=arguments[1],s=arguments;for(e=(e=i+r.replace(/\{\d+\}/g,function(e){var t=+e.slice(1,-1);return t+2<s.length?Te(s[t+2]):e}))+"\nhttp://errors.angularjs.org/1.3.20/"+(o?o+"/":"")+n,t=2;t<arguments.length;t++)e=e+(2==t?"?":"&")+"p"+(t-2)+"="+encodeURIComponent(Te(arguments[t]));return new a(e)}}var s=/^\/(.+)\/([a-z]*)$/,o="validity",O=function(e){return ce(e)?e.toLowerCase():e},A=Object.prototype.hasOwnProperty,l=function(e){return ce(e)?e.toUpperCase():e};"i"!=="I".toLowerCase()&&(O=function(e){return ce(e)?e.replace(/[A-Z]/g,function(e){return String.fromCharCode(32|e.charCodeAt(0))}):e},l=function(e){return ce(e)?e.replace(/[a-z]/g,function(e){return String.fromCharCode(-33&e.charCodeAt(0))}):e});var q,re,g,p,i=[].slice,n=[].splice,e=[].push,a=Object.prototype.toString,u=w("ng"),y=c.angular||(c.angular={}),t=0;function I(e){if(null==e||x(e))return!1;var t="length"in Object(e)&&e.length;return!(e.nodeType!==Ee||!t)||(ce(e)||ue(e)||0===t||"number"==typeof t&&0<t&&t-1 in e)}function se(e,t,n){var i,r;if(e)if(he(e))for(i in e)"prototype"==i||"length"==i||"name"==i||e.hasOwnProperty&&!e.hasOwnProperty(i)||t.call(n,e[i],i,e);else if(ue(e)||I(e)){var s="object"!=typeof e;for(i=0,r=e.length;i<r;i++)(s||i in e)&&t.call(n,e[i],i,e)}else if(e.forEach&&e.forEach!==se)e.forEach(t,n,e);else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e);return e}function K(e){return Object.keys(e).sort()}function m(n){return function(e,t){n(t,e)}}function h(){return++t}function d(e,t){t?e.$$hashKey=t:delete e.$$hashKey}function F(e){for(var t=e.$$hashKey,n=1,i=arguments.length;n<i;n++){var r=arguments[n];if(r)for(var s=Object.keys(r),o=0,a=s.length;o<a;o++){var l=s[o];e[l]=r[l]}}return d(e,t),e}function f(e){return parseInt(e,10)}function oe(e,t){return F(Object.create(e),t)}function ae(){}function v(e){return e}function $(e){return function(){return e}}function M(e){return void 0===e}function G(e){return void 0!==e}function le(e){return null!==e&&"object"==typeof e}function ce(e){return"string"==typeof e}function b(e){return"number"==typeof e}function S(e){return"[object Date]"===a.call(e)}q=ne.documentMode,ae.$inject=[],v.$inject=[];var ue=Array.isArray;function he(e){return"function"==typeof e}function C(e){return"[object RegExp]"===a.call(e)}function x(e){return e&&e.window===e}function de(e){return e&&e.$evalAsync&&e.$watch}function k(e){return"boolean"==typeof e}function E(e){return e&&he(e.then)}var fe=function(e){return ce(e)?e.trim():e},R=function(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};function _(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}function pe(e){return O(e.nodeName||e[0]&&e[0].nodeName)}function ge(e,t){var n=e.indexOf(t);return 0<=n&&e.splice(n,1),t}function L(e,n,t,i){if(x(e)||de(e))throw u("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");if(n){if(e===n)throw u("cpi","Can't copy! Source and destination are identical.");if(t=t||[],i=i||[],le(e)){var r=t.indexOf(e);if(-1!==r)return i[r];t.push(e),i.push(n)}var s;if(ue(e))for(var o=n.length=0;o<e.length;o++)s=L(e[o],null,t,i),le(e[o])&&(t.push(e[o]),i.push(s)),n.push(s);else{var a=n.$$hashKey;for(var l in ue(n)?n.length=0:se(n,function(e,t){delete n[t]}),e)e.hasOwnProperty(l)&&(s=L(e[l],null,t,i),le(e[l])&&(t.push(e[l]),i.push(s)),n[l]=s);d(n,a)}}else if(n=e)if(ue(e))n=L(e,[],t,i);else if(S(e))n=new Date(e.getTime());else if(C(e))(n=new RegExp(e.source,e.toString().match(/[^\/]*$/)[0])).lastIndex=e.lastIndex;else if(le(e)){var c=Object.create(Object.getPrototypeOf(e));n=L(e,c,t,i)}return n}function T(e,t){if(ue(e)){t=t||[];for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}else if(le(e))for(var r in t=t||{},e)"$"===r.charAt(0)&&"$"===r.charAt(1)||(t[r]=e[r]);return t||e}function me(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!=e&&t!=t)return!0;var n,i,r,s=typeof e;if(s==typeof t&&"object"==s){if(!ue(e)){if(S(e))return!!S(t)&&me(e.getTime(),t.getTime());if(C(e))return!!C(t)&&e.toString()==t.toString();if(de(e)||de(t)||x(e)||x(t)||ue(t)||S(t)||C(t))return!1;for(i in r={},e)if("$"!==i.charAt(0)&&!he(e[i])){if(!me(e[i],t[i]))return!1;r[i]=!0}for(i in t)if(!r.hasOwnProperty(i)&&"$"!==i.charAt(0)&&t[i]!==ie&&!he(t[i]))return!1;return!0}if(!ue(t))return!1;if((n=e.length)==t.length){for(i=0;i<n;i++)if(!me(e[i],t[i]))return!1;return!0}}return!1}var P=function(){if(G(P.isActive_))return P.isActive_;var t=!(!ne.querySelector("[ng-csp]")&&!ne.querySelector("[data-ng-csp]"));if(!t)try{new Function("")}catch(e){t=!0}return P.isActive_=t};function D(e,t,n){return e.concat(i.call(t,n))}function ve(e,t){return i.call(e,t||0)}function N(e,t){var n=2<arguments.length?ve(arguments,2):[];return!he(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,D(n,arguments,0)):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function r(e,t){var n=t;return"string"==typeof e&&"$"===e.charAt(0)&&"$"===e.charAt(1)?n=ie:x(t)?n="$WINDOW":t&&ne===t?n="$DOCUMENT":de(t)&&(n="$SCOPE"),n}function j(e,t){return void 0===e?ie:(b(t)||(t=t?2:null),JSON.stringify(e,r,t))}function B(e){return ce(e)?JSON.parse(e):e}function $e(e){e=re(e).clone();try{e.empty()}catch(e){}var t=re("<div>").append(e).html();try{return e[0].nodeType===Re?O(t):t.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(e,t){return"<"+O(t)})}catch(e){return O(t)}}function H(e){try{return decodeURIComponent(e)}catch(e){}}function U(e){var n,i,r={};return se((e||"").split("&"),function(e){if(e&&(n=e.replace(/\+/g,"%20").split("="),G(i=H(n[0])))){var t=!G(n[1])||H(n[1]);A.call(r,i)?ue(r[i])?r[i].push(t):r[i]=[r[i],t]:r[i]=t}}),r}function W(e){var n=[];return se(e,function(e,t){ue(e)?se(e,function(e){n.push(z(t,!0)+(!0===e?"":"="+z(e,!0)))}):n.push(z(t,!0)+(!0===e?"":"="+z(e,!0)))}),n.length?n.join("&"):""}function V(e){return z(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function z(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}var Q=["ng-","data-ng-","ng:","x-ng-"];function J(i,e){var r,s,t={};se(Q,function(e){var t=e+"app";!r&&i.hasAttribute&&i.hasAttribute(t)&&(s=(r=i).getAttribute(t))}),se(Q,function(e){var t,n=e+"app";!r&&(t=i.querySelector("["+n.replace(":","\\:")+"]"))&&(s=(r=t).getAttribute(n))}),r&&(t.strictDi=null!==function(e,t){var n,i,r=Q.length;for(e=re(e),i=0;i<r;++i)if(n=Q[i]+t,ce(n=e.attr(n)))return n;return null}(r,"strict-di"),e(r,s?[s]:[],t))}function Y(n,i,r){le(r)||(r={});r=F({strictDi:!1},r);var t=function(){if((n=re(n)).injector()){var e=n[0]===ne?"document":$e(n);throw u("btstrpd","App Already Bootstrapped with this Element '{0}'",e.replace(/</,"&lt;").replace(/>/,"&gt;"))}(i=i||[]).unshift(["$provide",function(e){e.value("$rootElement",n)}]),r.debugInfoEnabled&&i.push(["$compileProvider",function(e){e.debugInfoEnabled(!0)}]),i.unshift("ng");var t=kt(i,r.strictDi);return t.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,i){e.$apply(function(){t.data("$injector",i),n(t)(e)})}]),t},e=/^NG_ENABLE_DEBUG_INFO!/,s=/^NG_DEFER_BOOTSTRAP!/;if(c&&e.test(c.name)&&(r.debugInfoEnabled=!0,c.name=c.name.replace(e,"")),c&&!s.test(c.name))return t();c.name=c.name.replace(s,""),y.resumeBootstrap=function(e){return se(e,function(e){i.push(e)}),t()},he(y.resumeDeferredBootstrap)&&y.resumeDeferredBootstrap()}function X(){c.name="NG_ENABLE_DEBUG_INFO!"+c.name,c.location.reload()}function Z(e){var t=y.element(e).injector();if(!t)throw u("test","no injector found for element argument to getTestability");return t.get("$$testability")}var ee=/[A-Z]/g;function be(e,n){return n=n||"_",e.replace(ee,function(e,t){return(t?n:"")+e.toLowerCase()})}var we,te=!1;function ye(e,t,n){if(!e)throw u("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function Se(e,t,n){return n&&ue(e)&&(e=e[e.length-1]),ye(he(e),t,"not a function, got "+(e&&"object"==typeof e?e.constructor.name||"Object":typeof e)),e}function Ce(e,t){if("hasOwnProperty"===e)throw u("badname","hasOwnProperty is not a valid {0} name",t)}function xe(e,t,n){if(!t)return e;for(var i,r=t.split("."),s=e,o=r.length,a=0;a<o;a++)i=r[a],e&&(e=(s=e)[i]);return!n&&he(e)?N(s,e):e}function ke(e){var t=e[0],n=e[e.length-1],i=[t];do{if(!(t=t.nextSibling))break;i.push(t)}while(t!==n);return re(i)}function Ae(){return Object.create(null)}var Ee=1,Re=3,_e=8,Le=9,Me=11;function Te(e){return"function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):void 0===e?"undefined":"string"!=typeof e?(t=e,n=[],JSON.stringify(t,function(e,t){if(le(t=r(e,t))){if(0<=n.indexOf(t))return"<<already seen>>";n.push(t)}return t})):e;var t,n}var Pe={full:"1.3.20",major:1,minor:3,dot:20,codeName:"shallow-translucence"};Ye.expando="ng339";var Ie=Ye.cache={},Oe=1,Fe=function(e,t,n){e.addEventListener(t,n,!1)},De=function(e,t,n){e.removeEventListener(t,n,!1)};Ye._data=function(e){return this.cache[e[this.expando]]||{}};var Ne=/([\:\-\_]+(.))/g,je=/^moz([A-Z])/,Be={mouseleave:"mouseout",mouseenter:"mouseover"},He=w("jqLite");function Ue(e){return e.replace(Ne,function(e,t,n,i){return i?n.toUpperCase():n}).replace(je,"Moz$1")}var We=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Ve=/<|&#?\w+;/,ze=/<([\w:]+)/,qe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ke={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Ge(e){return!Ve.test(e)}function Qe(e){var t=e.nodeType;return t===Ee||!t||t===Le}function Je(e,t){var n,i,r,s,o=t.createDocumentFragment(),a=[];if(Ge(e))a.push(t.createTextNode(e));else{for(n=n||o.appendChild(t.createElement("div")),i=(ze.exec(e)||["",""])[1].toLowerCase(),r=Ke[i]||Ke._default,n.innerHTML=r[1]+e.replace(qe,"<$1></$2>")+r[2],s=r[0];s--;)n=n.lastChild;a=D(a,n.childNodes),(n=o.firstChild).textContent=""}return o.textContent="",o.innerHTML="",se(a,function(e){o.appendChild(e)}),o}function Ye(e){if(e instanceof Ye)return e;var t,n,i,r;if(ce(e)&&(e=fe(e),t=!0),!(this instanceof Ye)){if(t&&"<"!=e.charAt(0))throw He("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Ye(e)}at(this,t?(n=e,i=i||ne,(r=We.exec(n))?[i.createElement(r[1])]:(r=Je(n,i))?r.childNodes:[]):e)}function Xe(e){return e.cloneNode(!0)}function Ze(e,t){if(t||tt(e),e.querySelectorAll)for(var n=e.querySelectorAll("*"),i=0,r=n.length;i<r;i++)tt(n[i])}function et(n,e,i,t){if(G(t))throw He("offargs","jqLite#off() does not support the `selector` argument");var r=nt(n),s=r&&r.events,o=r&&r.handle;if(o)if(e)se(e.split(" "),function(e){if(G(i)){var t=s[e];if(ge(t||[],i),t&&0<t.length)return}De(n,e,o),delete s[e]});else for(e in s)"$destroy"!==e&&De(n,e,o),delete s[e]}function tt(e,t){var n=e.ng339,i=n&&Ie[n];if(i){if(t)return void delete i.data[t];i.handle&&(i.events.$destroy&&i.handle({},"$destroy"),et(e)),delete Ie[n],e.ng339=ie}}function nt(e,t){var n=e.ng339,i=n&&Ie[n];return t&&!i&&(e.ng339=n=++Oe,i=Ie[n]={events:{},data:{},handle:ie}),i}function it(e,t,n){if(Qe(e)){var i=G(n),r=!i&&t&&!le(t),s=!t,o=nt(e,!r),a=o&&o.data;if(i)a[t]=n;else{if(s)return a;if(r)return a&&a[t];F(a,t)}}}function rt(e,t){return!!e.getAttribute&&-1<(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")}function st(t,e){e&&t.setAttribute&&se(e.split(" "),function(e){t.setAttribute("class",fe((" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+fe(e)+" "," ")))})}function ot(e,t){if(t&&e.setAttribute){var n=(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");se(t.split(" "),function(e){e=fe(e),-1===n.indexOf(" "+e+" ")&&(n+=e+" ")}),e.setAttribute("class",fe(n))}}function at(e,t){if(t)if(t.nodeType)e[e.length++]=t;else{var n=t.length;if("number"==typeof n&&t.window!==t){if(n)for(var i=0;i<n;i++)e[e.length++]=t[i]}else e[e.length++]=t}}function lt(e,t){return ct(e,"$"+(t||"ngController")+"Controller")}function ct(e,t,n){e.nodeType==Le&&(e=e.documentElement);for(var i=ue(t)?t:[t];e;){for(var r=0,s=i.length;r<s;r++)if((n=re.data(e,i[r]))!==ie)return n;e=e.parentNode||e.nodeType===Me&&e.host}}function ut(e){for(Ze(e,!0);e.firstChild;)e.removeChild(e.firstChild)}function ht(e,t){t||Ze(e);var n=e.parentNode;n&&n.removeChild(e)}Ke.optgroup=Ke.option,Ke.tbody=Ke.tfoot=Ke.colgroup=Ke.caption=Ke.thead,Ke.th=Ke.td;var dt=Ye.prototype={ready:function(e){var t=!1;function n(){t||(t=!0,e())}"complete"===ne.readyState?setTimeout(n):(this.on("DOMContentLoaded",n),Ye(c).on("load",n))},toString:function(){var t=[];return se(this,function(e){t.push(""+e)}),"["+t.join(", ")+"]"},eq:function(e){return re(0<=e?this[e]:this[this.length+e])},length:0,push:e,sort:[].sort,splice:[].splice},ft={};se("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(e){ft[O(e)]=e});var pt={};se("input,select,option,textarea,button,form,details".split(","),function(e){pt[e]=!0});var gt={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};function mt(e,t){var n=ft[t.toLowerCase()];return n&&pt[pe(e)]&&n}function vt(){this.$get=function(){return F(Ye,{hasClass:function(e,t){return e.attr&&(e=e[0]),rt(e,t)},addClass:function(e,t){return e.attr&&(e=e[0]),ot(e,t)},removeClass:function(e,t){return e.attr&&(e=e[0]),st(e,t)}})}}function $t(e,t){var n=e&&e.$$hashKey;if(n)return"function"==typeof n&&(n=e.$$hashKey()),n;var i=typeof e;return n="function"==i||"object"==i&&null!==e?e.$$hashKey=i+":"+(t||h)():i+":"+e}function bt(e,t){if(t){var n=0;this.nextUid=function(){return++n}}se(e,this.put,this)}se({data:it,removeData:tt},function(e,t){Ye[t]=e}),se({data:it,inheritedData:ct,scope:function(e){return re.data(e,"$scope")||ct(e.parentNode||e,["$isolateScope","$scope"])},isolateScope:function(e){return re.data(e,"$isolateScope")||re.data(e,"$isolateScopeNoTemplate")},controller:lt,injector:function(e){return ct(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:rt,css:function(e,t,n){if(t=Ue(t),!G(n))return e.style[t];e.style[t]=n},attr:function(e,t,n){var i=e.nodeType;if(i!==Re&&2!==i&&i!==_e){var r=O(t);if(ft[r]){if(!G(n))return e[t]||(e.attributes.getNamedItem(t)||ae).specified?r:ie;n?(e[t]=!0,e.setAttribute(t,r)):(e[t]=!1,e.removeAttribute(r))}else if(G(n))e.setAttribute(t,n);else if(e.getAttribute){var s=e.getAttribute(t,2);return null===s?ie:s}}},prop:function(e,t,n){if(!G(n))return e[t];e[t]=n},text:function(){return e.$dv="",e;function e(e,t){if(M(t)){var n=e.nodeType;return n===Ee||n===Re?e.textContent:""}e.textContent=t}}(),val:function(e,t){if(M(t)){if(e.multiple&&"select"===pe(e)){var n=[];return se(e.options,function(e){e.selected&&n.push(e.value||e.text)}),0===n.length?null:n}return e.value}e.value=t},html:function(e,t){if(M(t))return e.innerHTML;Ze(e,!0),e.innerHTML=t},empty:ut},function(c,e){Ye.prototype[e]=function(e,t){var n,i,r=this.length;if(c!==ut&&(2==c.length&&c!==rt&&c!==lt?e:t)===ie){if(le(e)){for(n=0;n<r;n++)if(c===it)c(this[n],e);else for(i in e)c(this[n],i,e[i]);return this}for(var s=c.$dv,o=s===ie?Math.min(r,1):r,a=0;a<o;a++){var l=c(this[a],e,t);s=s?s+l:l}return s}for(n=0;n<r;n++)c(this[n],e,t);return this}}),se({removeData:tt,on:function e(t,n,i,r){if(G(r))throw He("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(Qe(t)){var o,a,s,l=nt(t,!0),c=l.events,u=l.handle;u||(u=l.handle=(a=c,(s=function(e,t){e.isDefaultPrevented=function(){return e.defaultPrevented};var n=a[t||e.type],i=n?n.length:0;if(i){if(M(e.immediatePropagationStopped)){var r=e.stopImmediatePropagation;e.stopImmediatePropagation=function(){e.immediatePropagationStopped=!0,e.stopPropagation&&e.stopPropagation(),r&&r.call(e)}}e.isImmediatePropagationStopped=function(){return!0===e.immediatePropagationStopped},1<i&&(n=T(n));for(var s=0;s<i;s++)e.isImmediatePropagationStopped()||n[s].call(o,e)}}).elem=o=t,s));for(var h=0<=n.indexOf(" ")?n.split(" "):[n],d=h.length;d--;){var f=c[n=h[d]];f||(c[n]=[],"mouseenter"===n||"mouseleave"===n?e(t,Be[n],function(e){var t=e.relatedTarget;t&&(t===this||this.contains(t))||u(e,n)}):"$destroy"!==n&&Fe(t,n,u),f=c[n]),f.push(i)}}},off:et,one:function(t,n,i){(t=re(t)).on(n,function e(){t.off(n,i),t.off(n,e)}),t.on(n,i)},replaceWith:function(t,e){var n,i=t.parentNode;Ze(t),se(new Ye(e),function(e){n?i.insertBefore(e,n.nextSibling):i.replaceChild(e,t),n=e})},children:function(e){var t=[];return se(e.childNodes,function(e){e.nodeType===Ee&&t.push(e)}),t},contents:function(e){return e.contentDocument||e.childNodes||[]},append:function(e,t){var n=e.nodeType;if(n===Ee||n===Me)for(var i=0,r=(t=new Ye(t)).length;i<r;i++){var s=t[i];e.appendChild(s)}},prepend:function(t,e){if(t.nodeType===Ee){var n=t.firstChild;se(new Ye(e),function(e){t.insertBefore(e,n)})}},wrap:function(e,t){t=re(t).eq(0).clone()[0];var n=e.parentNode;n&&n.replaceChild(t,e),t.appendChild(e)},remove:ht,detach:function(e){ht(e,!0)},after:function(e,t){for(var n=e,i=e.parentNode,r=0,s=(t=new Ye(t)).length;r<s;r++){var o=t[r];i.insertBefore(o,n.nextSibling),n=o}},addClass:ot,removeClass:st,toggleClass:function(n,e,i){e&&se(e.split(" "),function(e){var t=i;M(t)&&(t=!rt(n,e)),(t?ot:st)(n,e)})},parent:function(e){var t=e.parentNode;return t&&t.nodeType!==Me?t:null},next:function(e){return e.nextElementSibling},find:function(e,t){return e.getElementsByTagName?e.getElementsByTagName(t):[]},clone:Xe,triggerHandler:function(t,e,n){var i,r,s,o=e.type||e,a=nt(t),l=a&&a.events,c=l&&l[o];c&&(i={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:ae,type:o,target:t},e.type&&(i=F(i,e)),r=T(c),s=n?[i].concat(n):[i],se(r,function(e){i.isImmediatePropagationStopped()||e.apply(t,s)}))}},function(o,e){Ye.prototype[e]=function(e,t,n){for(var i,r=0,s=this.length;r<s;r++)M(i)?G(i=o(this[r],e,t,n))&&(i=re(i)):at(i,o(this[r],e,t,n));return G(i)?i:this},Ye.prototype.bind=Ye.prototype.on,Ye.prototype.unbind=Ye.prototype.off}),bt.prototype={put:function(e,t){this[$t(e,this.nextUid)]=t},get:function(e){return this[$t(e,this.nextUid)]},remove:function(e){var t=this[e=$t(e,this.nextUid)];return delete this[e],t}};var wt=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,yt=/,/,St=/^\s*(_?)(\S+?)\1\s*$/,Ct=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,xt=w("$injector");function kt(e,u){u=!0===u;var r={},o="Provider",a=[],s=new bt([],!0),l={$provide:{provider:t(d),factory:t(i),service:t(function(e,t){return i(e,["$injector",function(e){return e.instantiate(t)}])}),value:t(function(e,t){return i(e,$(t),!1)}),constant:t(function(e,t){Ce(e,"constant"),l[e]=t,n[e]=t}),decorator:function(e,t){var n=c.get(e+o),i=n.$get;n.$get=function(){var e=h.invoke(i,n);return h.invoke(t,null,{$delegate:e})}}}},c=l.$injector=f(l,function(e,t){throw y.isString(t)&&a.push(t),xt("unpr","Unknown provider: {0}",a.join(" <- "))}),n={},h=n.$injector=f(n,function(e,t){var n=c.get(e+o,t);return h.invoke(n.$get,n,ie,e)});return se(function n(e){var i,r=[];se(e,function(t){if(!s.get(t)){s.put(t,!0);try{ce(t)?(i=p(t),r=r.concat(n(i.requires)).concat(i._runBlocks),e(i._invokeQueue),e(i._configBlocks)):he(t)?r.push(c.invoke(t)):ue(t)?r.push(c.invoke(t)):Se(t,"module")}catch(e){throw ue(t)&&(t=t[t.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),xt("modulerr","Failed to instantiate module {0} due to:\n{1}",t,e.stack||e.message||e)}}function e(e){var t,n;for(t=0,n=e.length;t<n;t++){var i=e[t],r=c.get(i[0]);r[i[1]].apply(r,i[2])}}});return r}(e),function(e){h.invoke(e||ae)}),h;function t(n){return function(e,t){if(!le(e))return n(e,t);se(e,m(n))}}function d(e,t){if(Ce(e,"service"),(he(t)||ue(t))&&(t=c.instantiate(t)),!t.$get)throw xt("pget","Provider '{0}' must define $get factory method.",e);return l[e+o]=t}function i(e,t,n){return d(e,{$get:!1!==n?(i=e,r=t,function(){var e=h.invoke(r,this);if(M(e))throw xt("undef","Provider '{0}' must return a value from $get factory method.",i);return e}):t});var i,r}function f(n,i){function c(t,e){if(n.hasOwnProperty(t)){if(n[t]===r)throw xt("cdep","Circular dependency found: {0}",t+" <- "+a.join(" <- "));return n[t]}try{return a.unshift(t),n[t]=r,n[t]=i(t,e)}catch(e){throw n[t]===r&&delete n[t],e}finally{a.shift()}}function s(e,t,n,i){"string"==typeof n&&(i=n,n=null);var r,s,o,a=[],l=kt.$$annotate(e,u,i);for(s=0,r=l.length;s<r;s++){if("string"!=typeof(o=l[s]))throw xt("itkn","Incorrect injection token! Expected service name as string, got {0}",o);a.push(n&&n.hasOwnProperty(o)?n[o]:c(o,i))}return ue(e)&&(e=e[r]),e.apply(t,a)}return{invoke:s,instantiate:function(e,t,n){var i=Object.create((ue(e)?e[e.length-1]:e).prototype||null),r=s(e,i,t,n);return le(r)||he(r)?r:i},get:c,annotate:kt.$$annotate,has:function(e){return l.hasOwnProperty(e+o)||n.hasOwnProperty(e)}}}}function At(){var e=!0;this.disableAutoScrolling=function(){e=!1},this.$get=["$window","$location","$rootScope",function(i,r,s){var o=i.document;function a(e){if(e){e.scrollIntoView();var t=function(){var e=l.yOffset;if(he(e))e=e();else if(_(e)){var t=e[0];e="fixed"!==i.getComputedStyle(t).position?0:t.getBoundingClientRect().bottom}else b(e)||(e=0);return e}();if(t){var n=e.getBoundingClientRect().top;i.scrollBy(0,n-t)}}else i.scrollTo(0,0)}function l(){var e,t,n,i=r.hash();i?(e=o.getElementById(i))?a(e):(t=o.getElementsByName(i),n=null,Array.prototype.some.call(t,function(e){if("a"===pe(e))return n=e,!0}),(e=n)?a(e):"top"===i&&a(null)):a(null)}return e&&s.$watch(function(){return r.hash()},function(e,t){var n,i;e===t&&""===e||(n=function(){s.$evalAsync(l)},"complete"===(i=i||c).document.readyState?i.setTimeout(n):re(i).on("load",n))}),l}]}kt.$$annotate=function(e,t,n){var i,r,s;if("function"==typeof e){if(!(i=e.$inject)){if(i=[],e.length){if(t)throw ce(n)&&n||(n=e.name||((s=e.toString().replace(Ct,"").match(wt))?"function("+(s[1]||"").replace(/[\s\r\n]+/," ")+")":"fn")),xt("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);se(e.toString().replace(Ct,"").match(wt)[1].split(yt),function(e){e.replace(St,function(e,t,n){i.push(n)})})}e.$inject=i}}else ue(e)?(Se(e[r=e.length-1],"fn"),i=e.slice(0,r)):Se(e,"fn",!0);return i};var Et=w("$animate"),Rt=["$provide",function(i){this.$$selectors={},this.register=function(e,t){var n=e+"-animation";if(e&&"."!=e.charAt(0))throw Et("notcsel","Expecting class selector starting with '.' got '{0}'.",e);this.$$selectors[e.substr(1)]=n,i.factory(n,t)},this.classNameFilter=function(e){return 1===arguments.length&&(this.$$classNameFilter=e instanceof RegExp?e:null),this.$$classNameFilter},this.$get=["$$q","$$asyncCallback","$rootScope",function(d,e,f){var t;function p(e,t,n){for(var i=0,r=t.length;i<r;++i){e[t[i]]=n}}function r(){return t||(t=d.defer(),e(function(){t.resolve(),t=null})),t.promise}function s(e,t){if(y.isObject(t)){var n=F(t.from||{},t.to||{});e.css(n)}}return{animate:function(e,t,n){return s(e,{from:t,to:n}),r()},enter:function(e,t,n,i){return s(e,i),n?n.after(e):t.prepend(e),r()},leave:function(e,t){return s(e,t),e.remove(),r()},move:function(e,t,n,i){return this.enter(e,t,n,i)},addClass:function(e,t,n){return this.setClass(e,t,[],n)},$$addClassImmediately:function(e,t,n){return e=re(e),t=ce(t)?t:ue(t)?t.join(" "):"",se(e,function(e){ot(e,t)}),s(e,n),r()},removeClass:function(e,t,n){return this.setClass(e,[],t,n)},$$removeClassImmediately:function(e,t,n){return e=re(e),t=ce(t)?t:ue(t)?t.join(" "):"",se(e,function(e){st(e,t)}),s(e,n),r()},setClass:function(l,e,t,n){var c=this,u="$$animateClasses",i=!1,r=(l=re(l)).data(u);r?n&&r.options&&(r.options=y.extend(r.options||{},n)):(r={classes:{},options:n},i=!0);var s,o,a,h=r.classes;return e=ue(e)?e:e.split(" "),t=ue(t)?t:t.split(" "),p(h,e,!0),p(h,t,!1),i&&(r.promise=(s=function(e){var t,n,i,r,s,o=l.data(u);if(l.removeData(u),o){var a=(t=l,n=o.classes,i=[],r=[],s=Ae(),se((t.attr("class")||"").split(/\s+/),function(e){s[e]=!0}),se(n,function(e,t){var n=s[t];!1===e&&n?r.push(t):!0!==e||n||i.push(t)}),0<i.length+r.length&&[i.length?i:null,r.length?r:null]);a&&c.$$setClassImmediately(l,a[0],a[1],o.options)}e()},(a=d.defer()).promise.$$cancelFn=function(){o&&o()},f.$$postDigest(function(){o=s(function(){a.resolve()})}),a.promise),l.data(u,r)),r.promise},$$setClassImmediately:function(e,t,n,i){return t&&this.$$addClassImmediately(e,t),n&&this.$$removeClassImmediately(e,n),s(e,i),r()},enabled:ae,cancel:ae}}]}];function _t(){this.$get=["$$rAF","$timeout",function(t,n){return t.supported?function(e){return t(e)}:function(e){return n(e,0,!1)}}]}function Lt(a,e,l,c){var u=this,h=e[0],d=a.location,f=a.history,i=a.setTimeout,t=a.clearTimeout,r={};u.isMock=!1;var s=0,n=[];function o(e){try{e.apply(null,ve(arguments,1))}finally{if(0===--s)for(;n.length;)try{n.pop()()}catch(e){l.error(e)}}}u.$$completeOutstandingRequest=o,u.$$incOutstandingRequestCount=function(){s++},u.notifyWhenNoOutstandingRequests=function(e){se(g,function(e){e()}),0===s?e():n.push(e)};var p,g=[];u.addPollFn=function(e){var t,n;return M(p)&&(t=100,n=i,function e(){se(g,function(e){e()}),p=n(e,t)}()),g.push(e),e};var m,v,$=d.href,b=e.find("base"),w=null;k(),v=m,u.url=function(e,t,n){if(M(n)&&(n=null),d!==a.location&&(d=a.location),f!==a.history&&(f=a.history),e){var i=v===n;if($===e&&(!c.history||i))return u;var r=$&&gn($)===gn(e);return $=e,v=n,!c.history||r&&i?(r&&!w||(w=e),t?d.replace(e):r?d.hash=-1===(o=(s=e).indexOf("#"))?"":s.substr(o):d.href=e):(f[t?"replaceState":"pushState"](n,"",e),k(),v=m),u}return w||d.href.replace(/%27/g,"'");var s,o},u.state=function(){return m};var y=[],S=!1;function C(){k(),A()}var x=null;function k(){me(m=M(m=function(){try{return f.state}catch(e){}}())?null:m,x)&&(m=x),x=m}function A(){$===u.url()&&v===m||($=u.url(),v=m,se(y,function(e){e(u.url(),m)}))}u.onUrlChange=function(e){return S||(c.history&&re(a).on("popstate",C),re(a).on("hashchange",C),S=!0),y.push(e),e},u.$$checkUrlChange=A,u.baseHref=function(){var e=b.attr("href");return e?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var E={},R="",_=u.baseHref();function L(t){try{return decodeURIComponent(t)}catch(e){return t}}u.cookies=function(e,t){var n,i,r,s,o;if(!e){if(h.cookie!==R)for(i=(R=h.cookie).split("; "),E={},s=0;s<i.length;s++)0<(o=(r=i[s]).indexOf("="))&&(e=L(r.substring(0,o)),E[e]===ie&&(E[e]=L(r.substring(o+1))));return E}t===ie?h.cookie=encodeURIComponent(e)+"=;path="+_+";expires=Thu, 01 Jan 1970 00:00:00 GMT":ce(t)&&4096<(n=(h.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path="+_).length+1)&&l.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+n+" > 4096 bytes)!")},u.defer=function(e,t){var n;return s++,n=i(function(){delete r[n],o(e)},t||0),r[n]=!0,n},u.defer.cancel=function(e){return!!r[e]&&(delete r[e],t(e),o(ae),!0)}}function Mt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,i){return new Lt(e,i,t,n)}]}function Tt(){this.$get=function(){var h={};function e(e,t){if(e in h)throw w("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var n=0,i=F({},t,{id:e}),r={},s=t&&t.capacity||Number.MAX_VALUE,o={},a=null,l=null;return h[e]={put:function(e,t){s<Number.MAX_VALUE&&c(o[e]||(o[e]={key:e}));if(!M(t))return e in r||n++,r[e]=t,s<n&&this.remove(l.key),t},get:function(e){if(s<Number.MAX_VALUE){var t=o[e];if(!t)return;c(t)}return r[e]},remove:function(e){if(s<Number.MAX_VALUE){var t=o[e];if(!t)return;t==a&&(a=t.p),t==l&&(l=t.n),u(t.n,t.p),delete o[e]}delete r[e],n--},removeAll:function(){r={},n=0,o={},a=l=null},destroy:function(){o=i=r=null,delete h[e]},info:function(){return F({},i,{size:n})}};function c(e){e!=a&&(l?l==e&&(l=e.n):l=e,u(e.n,e.p),u(e,a),(a=e).n=null)}function u(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}}return e.info=function(){var n={};return se(h,function(e,t){n[t]=e.info()}),n},e.get=function(e){return h[e]},e}}function Pt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}var It=w("$compile");function Ot(n,t){var f={},p="Directive",P=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,I=/(([\w\-]+)(?:\:([^;]+))?;?)/,u=function(e){var t,n={},i=e.split(",");for(t=0;t<i.length;t++)n[i[t]]=!0;return n}("ngSrc,ngSrcset,src,srcset"),te=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,h=/^(on[a-z]+|formaction)$/;this.directive=function e(u,t){return Ce(u,"directive"),ce(u)?(ye(t,"directiveFactory"),f.hasOwnProperty(u)||(f[u]=[],n.factory(u+p,["$injector","$exceptionHandler",function(a,l){var c=[];return se(f[u],function(e,t){try{var n=a.invoke(e);he(n)?n={compile:$(n)}:!n.compile&&n.link&&(n.compile=$(n.link)),n.priority=n.priority||0,n.index=t,n.name=n.name||u,n.require=n.require||n.controller&&n.name,n.restrict=n.restrict||"EA",le(n.scope)&&(n.$$isolateBindings=(i=n.scope,r=n.name,s=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,o={},se(i,function(e,t){var n=e.match(s);if(!n)throw It("iscp","Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}",r,t,e);o[t]={mode:n[1][0],collection:"*"===n[2],optional:"?"===n[3],attrName:n[4]||t}}),o)),c.push(n)}catch(e){l(e)}var i,r,s,o}),c}])),f[u].push(t)):se(u,m(e)),this},this.aHrefSanitizationWhitelist=function(e){return G(e)?(t.aHrefSanitizationWhitelist(e),this):t.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(e){return G(e)?(t.imgSrcSanitizationWhitelist(e),this):t.imgSrcSanitizationWhitelist()};var a=!0;this.debugInfoEnabled=function(e){return G(e)?(a=e,this):a},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(d,D,N,e,j,B,s,t,i,r,w){var H=function(e,t){if(t){var n,i,r,s=Object.keys(t);for(n=0,i=s.length;n<i;n++)this[r=s[n]]=t[r]}else this.$attr={};this.$$element=e};function R(e,t){try{e.addClass(t)}catch(e){}}H.prototype={$normalize:Dt,$addClass:function(e){e&&0<e.length&&r.addClass(this.$$element,e)},$removeClass:function(e){e&&0<e.length&&r.removeClass(this.$$element,e)},$updateClass:function(e,t){var n=Nt(e,t);n&&n.length&&r.addClass(this.$$element,n);var i=Nt(t,e);i&&i.length&&r.removeClass(this.$$element,i)},$set:function(e,t,n,i){var r,s,o,a=this.$$element[0],l=mt(a,e),c=(s=e,("INPUT"===(o=a.nodeName)||"TEXTAREA"===o)&&gt[s]),u=e;if(l?(this.$$element.prop(e,t),i=l):c&&(this[c]=t,u=c),this[e]=t,i?this.$attr[e]=i:(i=this.$attr[e])||(this.$attr[e]=i=be(e,"-")),"a"===(r=pe(this.$$element))&&"href"===e||"img"===r&&"src"===e)this[e]=t=w(t,"src"===e);else if("img"===r&&"srcset"===e){for(var h="",d=fe(t),f=/\s/.test(d)?/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/:/(,)/,p=d.split(f),g=Math.floor(p.length/2),m=0;m<g;m++){var v=2*m;h+=w(fe(p[v]),!0),h+=" "+fe(p[v+1])}var $=fe(p[2*m]).split(/\s/);h+=w(fe($[0]),!0),2===$.length&&(h+=" "+fe($[1])),this[e]=t=h}!1!==n&&(null===t||t===ie?this.$$element.removeAttr(i):this.$$element.attr(i,t));var b=this.$$observers;b&&se(b[u],function(e){try{e(t)}catch(e){N(e)}})},$observe:function(e,t){var n=this,i=n.$$observers||(n.$$observers=Ae()),r=i[e]||(i[e]=[]);return r.push(t),s.$evalAsync(function(){!r.$$inter&&n.hasOwnProperty(e)&&t(n[e])}),function(){ge(r,t)}}};var n=D.startSymbol(),o=D.endSymbol(),U="{{"==n||"}}"==o?v:function(e){return e.replace(/\{\{/g,n).replace(/}}/g,o)},x=/^ngAttr[A-Z]/;return W.$$addBindingInfo=a?function(e,t){var n=e.data("$binding")||[];ue(t)?n=n.concat(t):n.push(t),e.data("$binding",n)}:ae,W.$$addBindingClass=a?function(e){R(e,"ng-binding")}:ae,W.$$addScopeInfo=a?function(e,t,n,i){var r=n?i?"$isolateScopeNoTemplate":"$isolateScope":"$scope";e.data(r,t)}:ae,W.$$addScopeClass=a?function(e,t){R(e,t?"ng-isolate-scope":"ng-scope")}:ae,W;function W(u,e,t,n,i){u instanceof re||(u=re(u)),se(u,function(e,t){e.nodeType==Re&&e.nodeValue.match(/\S+/)&&(u[t]=re(e).wrap("<span></span>").parent()[0])});var h=_(u,e,u,t,n,i);W.$$addScopeClass(u);var d=null;return function(e,t,n){ye(e,"scope");var i,r,s,o=(n=n||{}).parentBoundTranscludeFn,a=n.transcludeControllers,l=n.futureParentElement;if(o&&o.$$boundTransclude&&(o=o.$$boundTransclude),d||(r=(i=l)&&i[0],d=r&&"foreignobject"!==pe(r)&&r.toString().match(/SVG/)?"svg":"html"),s="html"!==d?re(Y(d,re("<div>").append(u).html())):t?dt.clone.call(u):u,a)for(var c in a)s.data("$"+c+"Controller",a[c].instance);return W.$$addScopeInfo(s,e),t&&t(s,e),h&&h(e,s,s,o),s}}function _(e,p,t,n,i,r){for(var s,o,a,l,c,u,g,m=[],h=0;h<e.length;h++)s=new H,(a=(o=V(e[h],[],s,0===h?n:ie,i)).length?M(o,e[h],s,p,t,null,[],[],r):null)&&a.scope&&W.$$addScopeClass(s.$$element),c=a&&a.terminal||!(l=e[h].childNodes)||!l.length?null:_(l,a?(a.transcludeOnThisElement||!a.templateOnThisElement)&&a.transclude:p),(a||c)&&(m.push(h,a,c),u=!0,g=g||a),r=null;return u?function(e,t,n,i){var r,s,o,a,l,c,u,h,d;if(g){var f=t.length;for(d=new Array(f),l=0;l<m.length;l+=3)u=m[l],d[u]=t[u]}else d=t;for(l=0,c=m.length;l<c;)o=d[m[l++]],r=m[l++],s=m[l++],r?(r.scope?(a=e.$new(),W.$$addScopeInfo(re(o),a)):a=e,h=r.transcludeOnThisElement?L(e,r.transclude,i,r.elementTranscludeOnThisElement):!r.templateOnThisElement&&i?i:!i&&p?L(e,p):null,r(s,a,o,n,h)):s&&s(e,o.childNodes,ie,i)}:null}function L(s,o,a,e){return function(e,t,n,i,r){return e||((e=s.$new(!1,r)).$$transcluded=!0),o(e,t,{parentBoundTranscludeFn:a,transcludeControllers:n,futureParentElement:i})}}function V(e,t,n,i,r){var s,o,a,l,c,u=e.nodeType,h=n.$attr;switch(u){case Ee:k(t,Dt(pe(e)),"E",i,r);for(var d,f,p,g,m,v,$=e.attributes,b=0,w=$&&$.length;b<w;b++){var y=!1,S=!1;f=(d=$[b]).name,m=fe(d.value),g=Dt(f),(v=x.test(g))&&(f=f.replace(Ft,"").substr(8).replace(/_(.)/g,function(e,t){return t.toUpperCase()}));var C=g.replace(/(Start|End)$/,"");A(C)&&g===C+"Start"&&(S=(y=f).substr(0,f.length-5)+"end",f=f.substr(0,f.length-6)),h[p=Dt(f.toLowerCase())]=f,!v&&n.hasOwnProperty(p)||(n[p]=m,mt(e,p)&&(n[p]=!0)),T(e,t,m,p,v),k(t,p,"A",i,r,y,S)}if(le(o=e.className)&&(o=o.animVal),ce(o)&&""!==o)for(;s=I.exec(o);)k(t,p=Dt(s[2]),"C",i,r)&&(n[p]=fe(s[3])),o=o.substr(s.index+s[0].length);break;case Re:a=t,l=e.nodeValue,(c=D(l,!0))&&a.push({priority:0,compile:function(e){var t=e.parent(),i=!!t.length;return i&&W.$$addBindingClass(t),function(e,t){var n=t.parent();i||W.$$addBindingClass(n),W.$$addBindingInfo(n,c.expressions),e.$watch(c,function(e){t[0].nodeValue=e})}}});break;case _e:try{(s=P.exec(e.nodeValue))&&k(t,p=Dt(s[1]),"M",i,r)&&(n[p]=fe(s[2]))}catch(e){}}return t.sort(E),t}function z(e,t,n){var i=[],r=0;if(t&&e.hasAttribute&&e.hasAttribute(t))do{if(!e)throw It("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",t,n);e.nodeType==Ee&&(e.hasAttribute(t)&&r++,e.hasAttribute(n)&&r--),i.push(e),e=e.nextSibling}while(0<r);else i.push(e);return re(i)}function q(s,o,a){return function(e,t,n,i,r){return t=z(t[0],o,a),s(e,t,n,i,r)}}function M(e,v,$,t,n,i,b,w,r){r=r||{};for(var s,y,o,a,l,c,u,h=-Number.MAX_VALUE,S=r.controllerDirectives,C=r.newIsolateScopeDirective,x=r.templateDirective,d=r.nonTlbTranscludeDirective,f=!1,p=!1,k=r.hasElementTranscludeDirective,g=$.$$element=re(v),m=i,A=t,E=0,R=e.length;E<R;E++){var _=(o=e[E]).$$start,L=o.$$end;if(_&&(g=z(v,_,L)),l=ie,h>o.priority)break;if((u=o.scope)&&(o.templateUrl||(le(u)?(J("new/isolated scope",C||s,o,g),C=o):J("new/isolated scope",C,o,g)),s=s||o),a=o.name,!o.templateUrl&&o.controller&&(u=o.controller,J("'"+a+"' controller",(S=S||{})[a],o,g),S[a]=o),(u=o.transclude)&&(f=!0,o.$$tlb||(J("transclusion",d,o,g),d=o),"element"==u?(k=!0,h=o.priority,l=g,g=$.$$element=re(ne.createComment(" "+a+": "+$[a]+" ")),v=g[0],X(n,ve(l),v),A=W(l,t,h,m&&m.name,{nonTlbTranscludeDirective:d})):(l=re(Xe(v)).contents(),g.empty(),A=W(l,t))),o.template)if(p=!0,J("template",x,o,g),u=he((x=o).template)?o.template(g,$):o.template,u=U(u),o.replace){if(m=o,l=Ge(u)?[]:jt(Y(o.templateNamespace,fe(u))),v=l[0],1!=l.length||v.nodeType!==Ee)throw It("tplrt","Template for directive '{0}' must have exactly one root element. {1}",a,"");X(n,g,v);var M={$attr:{}},T=V(v,[],M),P=e.splice(E+1,e.length-(E+1));C&&K(T),e=e.concat(T).concat(P),G($,M),R=e.length}else g.html(u);if(o.templateUrl)p=!0,J("template",x,o,g),(x=o).replace&&(m=o),F=Q(e.splice(E,e.length-E),g,$,n,f&&A,b,w,{controllerDirectives:S,newIsolateScopeDirective:C,templateDirective:x,nonTlbTranscludeDirective:d}),R=e.length;else if(o.compile)try{he(c=o.compile(g,$,A))?I(null,c,_,L):c&&I(c.pre,c.post,_,L)}catch(e){N(e,$e(g))}o.terminal&&(F.terminal=!0,h=Math.max(h,o.priority))}return F.scope=s&&!0===s.scope,F.transcludeOnThisElement=f,F.elementTranscludeOnThisElement=k,F.templateOnThisElement=p,F.transclude=A,r.hasElementTranscludeDirective=k,F;function I(e,t,n,i){e&&(n&&(e=q(e,n,i)),e.require=o.require,e.directiveName=a,(C===o||o.$$isolateScope)&&(e=Z(e,{isolateScope:!0})),b.push(e)),t&&(n&&(t=q(t,n,i)),t.require=o.require,t.directiveName=a,(C===o||o.$$isolateScope)&&(t=Z(t,{isolateScope:!0})),w.push(t))}function O(t,e,n,i){var r,s,o="data",a=!1,l=n;if(ce(e)){if(s=e.match(te),e=e.substring(s[0].length),s[3]&&(s[1]?s[3]=null:s[1]=s[3]),"^"===s[1]?o="inheritedData":"^^"===s[1]&&(o="inheritedData",l=n.parent()),"?"===s[2]&&(a=!0),r=null,i&&"data"===o&&(r=i[e])&&(r=r.instance),!(r=r||l[o]("$"+e+"Controller"))&&!a)throw It("ctreq","Controller '{0}', required by directive '{1}', can't be found!",e,t);return r||null}return ue(e)&&(r=[],se(e,function(e){r.push(O(t,e,n,i))})),r}function F(e,u,t,n,r){var i,s,o,a,h,l,c,d,f;if(v===t?d=(f=$).$$element:(d=re(t),f=new H(d,$)),C&&(h=u.$new(!0)),r&&((c=function(e,t,n){var i;de(e)||(n=t,t=e,e=ie);k&&(i=l);n||(n=k?d.parent():d);return r(e,t,i,n,m)}).$$boundTransclude=r),S&&(y={},l={},se(S,function(e){var t,n={$scope:e===C||e.$$isolateScope?h:u,$element:d,$attrs:f,$transclude:c};"@"==(a=e.controller)&&(a=f[e.name]),t=B(a,n,!0,e.controllerAs),l[e.name]=t,k||d.data("$"+e.name+"Controller",t.instance),y[e.name]=t})),C){W.$$addScopeInfo(d,h,!0,!(x&&(x===C||x===C.$$originalDirective))),W.$$addScopeClass(d,!0);var p=y&&y[C.name],g=h;p&&p.identifier&&!0===C.bindToController&&(g=p.instance),se(h.$$isolateBindings=C.$$isolateBindings,function(e,t){var n,i,r,s,o=e.attrName,a=e.optional;switch(e.mode){case"@":f.$observe(o,function(e){g[t]=e}),f.$$observers[o].$$scope=u,f[o]&&(g[t]=D(f[o])(u));break;case"=":if(a&&!f[o])return;i=j(f[o]),s=i.literal?me:function(e,t){return e===t||e!=e&&t!=t},r=i.assign||function(){throw n=g[t]=i(u),It("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",f[o],C.name)},n=g[t]=i(u);var l,c=function(e){return s(e,g[t])||(s(e,n)?r(u,e=g[t]):g[t]=e),n=e};c.$stateful=!0,l=e.collection?u.$watchCollection(f[o],c):u.$watch(j(f[o],c),null,i.literal),h.$on("$destroy",l);break;case"&":i=j(f[o]),g[t]=function(e){return i(u,e)}}})}for(y&&(se(y,function(e){e()}),y=null),i=0,s=b.length;i<s;i++)ee(o=b[i],o.isolateScope?h:u,d,f,o.require&&O(o.directiveName,o.require,d,l),c);var m=u;for(C&&(C.template||null===C.templateUrl)&&(m=h),e&&e(m,t.childNodes,ie,r),i=w.length-1;0<=i;i--)ee(o=w[i],o.isolateScope?h:u,d,f,o.require&&O(o.directiveName,o.require,d,l),c)}}function K(e){for(var t=0,n=e.length;t<n;t++)e[t]=oe(e[t],{$$isolateScope:!0})}function k(e,t,n,i,r,s,o){if(t===r)return null;var a=null;if(f.hasOwnProperty(t))for(var l,c=d.get(t+p),u=0,h=c.length;u<h;u++)try{l=c[u],(i===ie||i>l.priority)&&-1!=l.restrict.indexOf(n)&&(s&&(l=oe(l,{$$start:s,$$end:o})),e.push(l),a=l)}catch(e){N(e)}return a}function A(e){if(f.hasOwnProperty(e))for(var t=d.get(e+p),n=0,i=t.length;n<i;n++)if(t[n].multiElement)return!0;return!1}function G(n,i){var r=i.$attr,s=n.$attr,o=n.$$element;se(n,function(e,t){"$"!=t.charAt(0)&&(i[t]&&i[t]!==e&&(e+=("style"===t?";":" ")+i[t]),n.$set(t,e,!0,r[t]))}),se(i,function(e,t){"class"==t?(R(o,e),n.class=(n.class?n.class+" ":"")+e):"style"==t?(o.attr("style",o.attr("style")+";"+e),n.style=(n.style?n.style+";":"")+e):"$"==t.charAt(0)||n.hasOwnProperty(t)||(n[t]=e,s[t]=r[t])})}function Q(d,f,p,g,m,v,$,b){var w,y,S=[],C=f[0],x=d.shift(),k=oe(x,{templateUrl:null,transclude:null,replace:null,$$originalDirective:x}),A=he(x.templateUrl)?x.templateUrl(f,p):x.templateUrl,E=x.templateNamespace;return f.empty(),e(A).then(function(e){var n,t,i,r;if(e=U(e),x.replace){if(i=Ge(e)?[]:jt(Y(E,fe(e))),n=i[0],1!=i.length||n.nodeType!==Ee)throw It("tplrt","Template for directive '{0}' must have exactly one root element. {1}",x.name,A);t={$attr:{}},X(g,f,n);var s=V(n,[],t);le(x.scope)&&K(s),d=s.concat(d),G(p,t)}else n=C,f.html(e);for(d.unshift(k),w=M(d,n,p,m,f,x,v,$,b),se(g,function(e,t){e==n&&(g[t]=f[0])}),y=_(f[0].childNodes,m);S.length;){var o=S.shift(),a=S.shift(),l=S.shift(),c=S.shift(),u=f[0];if(!o.$$destroyed){if(a!==C){var h=a.className;b.hasElementTranscludeDirective&&x.replace||(u=Xe(n)),X(l,re(a),u),R(re(u),h)}r=w.transcludeOnThisElement?L(o,w.transclude,c):c,w(y,o,u,g,r)}}S=null}),function(e,t,n,i,r){var s=r;t.$$destroyed||(S?S.push(t,n,i,s):(w.transcludeOnThisElement&&(s=L(t,w.transclude,r)),w(y,t,n,i,s)))}}function E(e,t){var n=t.priority-e.priority;return 0!==n?n:e.name!==t.name?e.name<t.name?-1:1:e.index-t.index}function J(e,t,n,i){if(t)throw It("multidir","Multiple directives [{0}, {1}] asking for {2} on: {3}",t.name,n.name,e,$e(i))}function Y(e,t){switch(e=O(e||"html")){case"svg":case"math":var n=ne.createElement("div");return n.innerHTML="<"+e+">"+t+"</"+e+">",n.childNodes[0].childNodes;default:return t}}function T(e,t,s,o,a){var l=function(e,t){if("srcdoc"==t)return i.HTML;var n=pe(e);return"xlinkHref"==t||"form"==n&&"action"==t||"img"!=n&&("src"==t||"ngSrc"==t)?i.RESOURCE_URL:void 0}(e,o);a=u[o]||a;var c=D(s,!0,l,a);if(c){if("multiple"===o&&"select"===pe(e))throw It("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",$e(e));t.push({priority:100,compile:function(){return{pre:function(e,t,n){var i=n.$$observers||(n.$$observers={});if(h.test(o))throw It("nodomevents","Interpolations for HTML DOM event attributes are disallowed.  Please use the ng- versions (such as ng-click instead of onclick) instead.");var r=n[o];r!==s&&(c=r&&D(r,!0,l,a),s=r),c&&(n[o]=c(e),(i[o]||(i[o]=[])).$$inter=!0,(n.$$observers&&n.$$observers[o].$$scope||e).$watch(c,function(e,t){"class"===o&&e!=t?n.$updateClass(e,t):n.$set(o,e)}))}}}})}}function X(e,t,n){var i,r,s=t[0],o=t.length,a=s.parentNode;if(e)for(i=0,r=e.length;i<r;i++)if(e[i]==s){e[i++]=n;for(var l=i,c=l+o-1,u=e.length;l<u;l++,c++)c<u?e[l]=e[c]:delete e[l];e.length-=o-1,e.context===s&&(e.context=n);break}a&&a.replaceChild(n,s);var h=ne.createDocumentFragment();h.appendChild(s),re(n).data(re(s).data()),g?(we=!0,g.cleanData([s])):delete re.cache[s[re.expando]];for(var d=1,f=t.length;d<f;d++){var p=t[d];re(p).remove(),h.appendChild(p),delete t[d]}t[0]=n,t.length=1}function Z(e,t){return F(function(){return e.apply(null,arguments)},e,t)}function ee(e,t,n,i,r,s){try{e(t,n,i,r,s)}catch(e){N(e,$e(n))}}}]}Ot.$inject=["$provide","$$sanitizeUriProvider"];var Ft=/^((?:x|data)[\:\-_])/i;function Dt(e){return Ue(e.replace(Ft,""))}function Nt(e,t){var n="",i=e.split(/\s+/),r=t.split(/\s+/);e:for(var s=0;s<i.length;s++){for(var o=i[s],a=0;a<r.length;a++)if(o==r[a])continue e;n+=(0<n.length?" ":"")+o}return n}function jt(e){var t=(e=re(e)).length;if(t<=1)return e;for(;t--;){e[t].nodeType===_e&&n.call(e,t,1)}return e}var Bt=w("$controller");function Ht(){var d={},f=!1,p=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(e,t){Ce(e,"controller"),le(e)?F(d,e):d[e]=t},this.allowGlobals=function(){f=!0},this.$get=["$injector","$window",function(c,u){return function(e,t,n,i){var r,s,o,a;if(n=!0===n,i&&ce(i)&&(a=i),ce(e)){if(!(s=e.match(p)))throw Bt("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",e);o=s[1],a=a||s[3],Se(e=d.hasOwnProperty(o)?d[o]:xe(t.$scope,o,!0)||(f?xe(u,o,!0):ie),o,!0)}if(n){var l=(ue(e)?e[e.length-1]:e).prototype;return r=Object.create(l||null),a&&h(t,a,r,o||e.name),F(function(){return c.invoke(e,r,t,o),r},{instance:r,identifier:a})}return r=c.instantiate(e,t,o),a&&h(t,a,r,o||e.name),r};function h(e,t,n,i){if(!e||!le(e.$scope))throw w("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",i,t);e.$scope[t]=n}}]}function Ut(){this.$get=["$window",function(e){return re(e.document)}]}function Wt(){this.$get=["$log",function(n){return function(e,t){n.error.apply(n,arguments)}}]}var Vt="application/json",zt={"Content-Type":Vt+";charset=utf-8"},qt=/^\[|^\{(?!\{)/,Kt={"[":/]$/,"{":/}$/},Gt=/^\)\]\}',?\n/;function Qt(e,t){if(ce(e)){var n=e.replace(Gt,"").trim();if(n){var i=t("Content-Type");(i&&0===i.indexOf(Vt)||(s=(r=n).match(qt))&&Kt[s[0]].test(r))&&(e=B(n))}}var r,s;return e}function Jt(e){var t,n,i,r=Ae();return e&&se(e.split("\n"),function(e){i=e.indexOf(":"),t=O(fe(e.substr(0,i))),n=fe(e.substr(i+1)),t&&(r[t]=r[t]?r[t]+", "+n:n)}),r}function Yt(n){var i=le(n)?n:ie;return function(e){if(i||(i=Jt(n)),e){var t=i[O(e)];return void 0===t&&(t=null),t}return i}}function Xt(t,n,i,e){return he(e)?e(t,n,i):(se(e,function(e){t=e(t,n,i)}),t)}function Zt(e){return 200<=e&&e<300}function en(){var $=this.defaults={transformResponse:[Qt],transformRequest:[function(e){return le(e)&&(i=e,"[object File]"!==a.call(i))&&(n=e,"[object Blob]"!==a.call(n))&&(t=e,"[object FormData]"!==a.call(t))?j(e):e;var t,n,i}],headers:{common:{Accept:"application/json, text/plain, */*"},post:T(zt),put:T(zt),patch:T(zt)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},b=!1;this.useApplyAsync=function(e){return G(e)?(b=!!e,this):b};var n=this.interceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(d,f,e,p,g,t){var m=e("$http"),a=[];function v(e){if(!y.isObject(e))throw w("$http")("badreq","Http request configuration must be an object.  Received: {0}",e);var n=F({method:"get",transformRequest:$.transformRequest,transformResponse:$.transformResponse},e);n.headers=function(e){var t,n,i,r=$.headers,s=F({},e.headers);r=F({},r.common,r[O(e.method)]);e:for(t in r){for(i in n=O(t),s)if(O(i)===n)continue e;s[t]=r[t]}return o=s,l={},se(o,function(e,t){he(e)?null!=(a=e())&&(l[t]=a):l[t]=e}),l;var o,a,l}(e),n.method=l(n.method);var t=[function(e){var n=e.headers,t=Xt(e.data,Yt(n),ie,e.transformRequest);return M(t)&&se(n,function(e,t){"content-type"===O(t)&&delete n[t]}),M(e.withCredentials)&&!M($.withCredentials)&&(e.withCredentials=$.withCredentials),function(r,e){var s,t,o=g.defer(),n=o.promise,i=r.headers,a=function(e,t){if(!t)return e;var n=[];return function(e,t,n){for(var i=K(e),r=0;r<i.length;r++)t.call(n,e[i[r]],i[r])}(t,function(e,t){null===e||M(e)||(ue(e)||(e=[e]),se(e,function(e){le(e)&&(e=S(e)?e.toISOString():j(e)),n.push(z(t)+"="+z(e))}))}),0<n.length&&(e+=(-1==e.indexOf("?")?"?":"&")+n.join("&")),e}(r.url,r.params);if(v.pendingRequests.push(r),n.then(h,h),!r.cache&&!$.cache||!1===r.cache||"GET"!==r.method&&"JSONP"!==r.method||(s=le(r.cache)?r.cache:le($.cache)?$.cache:m),s&&(G(t=s.get(a))?E(t)?t.then(u,u):ue(t)?c(t[1],t[0],T(t[2]),t[3]):c(t,200,{},"OK"):s.put(a,n)),M(t)){var l=ui(r.url)?f.cookies()[r.xsrfCookieName||$.xsrfCookieName]:ie;l&&(i[r.xsrfHeaderName||$.xsrfHeaderName]=l),d(r.method,a,e,function(e,t,n,i){function r(){c(t,e,n,i)}s&&(Zt(e)?s.put(a,[e,t,Jt(n),i]):s.remove(a)),b?p.$applyAsync(r):(r(),p.$$phase||p.$apply())},i,r.timeout,r.withCredentials,r.responseType)}return n;function c(e,t,n,i){(Zt(t=-1<=t?t:0)?o.resolve:o.reject)({data:e,status:t,headers:Yt(n),config:r,statusText:i})}function u(e){c(e.data,e.status,T(e.headers()),e.statusText)}function h(){var e=v.pendingRequests.indexOf(r);-1!==e&&v.pendingRequests.splice(e,1)}}(e,t).then(o,o)},ie],i=g.when(n);for(se(a,function(e){(e.request||e.requestError)&&t.unshift(e.request,e.requestError),(e.response||e.responseError)&&t.push(e.response,e.responseError)});t.length;){var r=t.shift(),s=t.shift();i=i.then(r,s)}return i.success=function(t){return Se(t,"fn"),i.then(function(e){t(e.data,e.status,e.headers,n)}),i},i.error=function(t){return Se(t,"fn"),i.then(null,function(e){t(e.data,e.status,e.headers,n)}),i},i;function o(e){var t=F({},e);return e.data?t.data=Xt(e.data,e.headers,e.status,n.transformResponse):t.data=e.data,Zt(e.status)?t:g.reject(t)}}return se(n,function(e){a.unshift(ce(e)?t.get(e):t.invoke(e))}),v.pendingRequests=[],function(e){se(arguments,function(n){v[n]=function(e,t){return v(F(t||{},{method:n,url:e}))}})}("get","delete","head","jsonp"),function(e){se(arguments,function(i){v[i]=function(e,t,n){return v(F(n||{},{method:i,url:e,data:t}))}})}("post","put","patch"),v.defaults=$,v}]}function tn(){return new c.XMLHttpRequest}function nn(){this.$get=["$browser","$window","$document",function(e,t,n){return y=tn,S=(w=e).defer,C=t.angular.callbacks,x=n[0],function(e,i,t,r,n,s,o,a){if(w.$$incOutstandingRequestCount(),i=i||w.url(),"jsonp"==O(e)){var l="_"+(C.counter++).toString(36);C[l]=function(e){C[l].data=e,C[l].called=!0};var c=(d=i.replace("JSON_CALLBACK","angular.callbacks."+l),f=l,p=function(e,t){b(r,e,C[l].data,"",t),C[l]=ae},g=x.createElement("script"),m=null,g.type="text/javascript",g.src=d,g.async=!0,Fe(g,"load",m=function(e){De(g,"load",m),De(g,"error",m),x.body.removeChild(g),g=null;var t=-1,n="unknown";e&&("load"!==e.type||C[f].called||(e={type:"error"}),n=e.type,t="error"===e.type?404:200),p&&p(t,n)}),Fe(g,"error",m),x.body.appendChild(g),m)}else{var u=y();u.open(e,i,!0),se(n,function(e,t){G(e)&&u.setRequestHeader(t,e)}),u.onload=function(){var e=u.statusText||"",t="response"in u?u.response:u.responseText,n=1223===u.status?204:u.status;0===n&&(n=t?200:"file"==ci(i).protocol?404:0),b(r,n,t,u.getAllResponseHeaders(),e)};var h=function(){b(r,-1,null,null,"")};if(u.onerror=h,u.onabort=h,o&&(u.withCredentials=!0),a)try{u.responseType=a}catch(e){if("json"!==a)throw e}u.send(t||null)}var d,f,p,g,m;if(0<s)var v=S($,s);else E(s)&&s.then($);function $(){c&&c(),u&&u.abort()}function b(e,t,n,i,r){v!==ie&&S.cancel(v),c=u=null,e(t,n,i,r),w.$$completeOutstandingRequest(ae)}};var w,y,S,C,x}]}var rn=w("$interpolate");function sn(){var k="{{",A="}}";this.startSymbol=function(e){return e?(k=e,this):k},this.endSymbol=function(e){return e?(A=e,this):A},this.$get=["$parse","$exceptionHandler","$sce",function($,b,w){var y=k.length,S=A.length,C=new RegExp(k.replace(/./g,e),"g"),x=new RegExp(A.replace(/./g,e),"g");function e(e){return"\\\\\\"+e}function t(s,e,t,i){i=!!i;for(var n,r,o,a=0,l=[],c=[],u=s.length,h=[],d=[];a<u;){if(-1==(n=s.indexOf(k,a))||-1==(r=s.indexOf(A,n+y))){a!==u&&h.push(m(s.substring(a)));break}a!==n&&h.push(m(s.substring(a,n))),o=s.substring(n+y,r),l.push(o),c.push($(o,v)),a=r+S,d.push(h.length),h.push("")}if(t&&1<h.length)throw rn("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required.  See http://docs.angularjs.org/api/ng.$sce",s);if(!e||l.length){var f=function(e){for(var t=0,n=l.length;t<n;t++){if(i&&M(e[t]))return;h[d[t]]=e[t]}return h.join("")},p=function(e){return t?w.getTrusted(t,e):w.valueOf(e)},g=function(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=j(e)}return e};return F(function(e){var t=0,n=l.length,i=new Array(n);try{for(;t<n;t++)i[t]=c[t](e);return f(i)}catch(e){var r=rn("interr","Can't interpolate: {0}\n{1}",s,e.toString());b(r)}},{exp:s,expressions:l,$$watchDelegate:function(i,r,e){var s;return i.$watchGroup(c,function(e,t){var n=f(e);he(r)&&r.call(this,n,e!==t?s:n,i),s=n},e)}})}function m(e){return e.replace(C,k).replace(x,A)}function v(e){try{return e=p(e),i&&!G(e)?e:g(e)}catch(e){var t=rn("interr","Can't interpolate: {0}\n{1}",s,e.toString());b(t)}}}return t.startSymbol=function(){return k},t.endSymbol=function(){return A},t}]}function on(){this.$get=["$rootScope","$window","$q","$$q",function(u,h,d,f){var p={};function e(e,t,n,i){var r=h.setInterval,s=h.clearInterval,o=0,a=G(i)&&!i,l=(a?f:d).defer(),c=l.promise;return n=G(n)?n:0,c.then(null,null,e),c.$$intervalId=r(function(){l.notify(o++),0<n&&n<=o&&(l.resolve(o),s(c.$$intervalId),delete p[c.$$intervalId]),a||u.$apply()},t),p[c.$$intervalId]=l,c}return e.cancel=function(e){return!!(e&&e.$$intervalId in p)&&(p[e.$$intervalId].reject("canceled"),h.clearInterval(e.$$intervalId),delete p[e.$$intervalId],!0)},e}]}function an(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a",short:"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(e){return 1===e?"one":"other"}}}}var ln=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,cn={http:80,https:443,ftp:21},un=w("$location");function hn(e){for(var t=e.split("/"),n=t.length;n--;)t[n]=V(t[n]);return t.join("/")}function dn(e,t){var n=ci(e);t.$$protocol=n.protocol,t.$$host=n.hostname,t.$$port=f(n.port)||cn[n.protocol]||null}function fn(e,t){var n="/"!==e.charAt(0);n&&(e="/"+e);var i=ci(e);t.$$path=decodeURIComponent(n&&"/"===i.pathname.charAt(0)?i.pathname.substring(1):i.pathname),t.$$search=U(i.search),t.$$hash=decodeURIComponent(i.hash),t.$$path&&"/"!=t.$$path.charAt(0)&&(t.$$path="/"+t.$$path)}function pn(e,t){if(0===t.indexOf(e))return t.substr(e.length)}function gn(e){var t=e.indexOf("#");return-1==t?e:e.substr(0,t)}function mn(e){return e.replace(/(#.+)|#$/,"$1")}function vn(s,o,a){this.$$html5=!0,a=a||"",dn(s,this),this.$$parse=function(e){var t=pn(o,e);if(!ce(t))throw un("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',e,o);fn(t,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var e=W(this.$$search),t=this.$$hash?"#"+V(this.$$hash):"";this.$$url=hn(this.$$path)+(e?"?"+e:"")+t,this.$$absUrl=o+this.$$url.substr(1)},this.$$parseLinkUrl=function(e,t){return t&&"#"===t[0]?(this.hash(t.slice(1)),!0):((n=pn(s,e))!==ie?r=(n=pn(a,i=n))!==ie?o+(pn("/",n)||n):s+i:(n=pn(o,e))!==ie?r=o+n:o==e+"/"&&(r=o),r&&this.$$parse(r),!!r);var n,i,r}}function $n(i,r,s){dn(i,this),this.$$parse=function(e){var t,n=pn(i,e)||pn(r,e);M(n)||"#"!==n.charAt(0)?this.$$html5?t=n:(t="",M(n)&&(i=e,this.replace())):M(t=pn(s,n))&&(t=n),fn(t,this),this.$$path=function(e,t,n){var i,r=/^\/[A-Z]:(\/.*)/;0===t.indexOf(n)&&(t=t.replace(n,""));if(r.exec(t))return e;return(i=r.exec(e))?i[1]:e}(this.$$path,t,i),this.$$compose()},this.$$compose=function(){var e=W(this.$$search),t=this.$$hash?"#"+V(this.$$hash):"";this.$$url=hn(this.$$path)+(e?"?"+e:"")+t,this.$$absUrl=i+(this.$$url?s+this.$$url:"")},this.$$parseLinkUrl=function(e,t){return gn(i)==gn(e)&&(this.$$parse(e),!0)}}function bn(r,s,o){this.$$html5=!0,$n.apply(this,arguments),this.$$parseLinkUrl=function(e,t){return t&&"#"===t[0]?(this.hash(t.slice(1)),!0):(r==gn(e)?n=e:(i=pn(s,e))?n=r+o+i:s===e+"/"&&(n=s),n&&this.$$parse(n),!!n);var n,i},this.$$compose=function(){var e=W(this.$$search),t=this.$$hash?"#"+V(this.$$hash):"";this.$$url=hn(this.$$path)+(e?"?"+e:"")+t,this.$$absUrl=r+o+this.$$url}}var wn={$$html5:!1,$$replace:!1,absUrl:yn("$$absUrl"),url:function(e){if(M(e))return this.$$url;var t=ln.exec(e);return(t[1]||""===e)&&this.path(decodeURIComponent(t[1])),(t[2]||t[1]||""===e)&&this.search(t[3]||""),this.hash(t[5]||""),this},protocol:yn("$$protocol"),host:yn("$$host"),port:yn("$$port"),path:Sn("$$path",function(e){return"/"==(e=null!==e?e.toString():"").charAt(0)?e:"/"+e}),search:function(n,e){switch(arguments.length){case 0:return this.$$search;case 1:if(ce(n)||b(n))n=n.toString(),this.$$search=U(n);else{if(!le(n))throw un("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");se(n=L(n,{}),function(e,t){null==e&&delete n[t]}),this.$$search=n}break;default:M(e)||null===e?delete this.$$search[n]:this.$$search[n]=e}return this.$$compose(),this},hash:Sn("$$hash",function(e){return null!==e?e.toString():""}),replace:function(){return this.$$replace=!0,this}};function yn(e){return function(){return this[e]}}function Sn(t,n){return function(e){return M(e)?this[t]:(this[t]=n(e),this.$$compose(),this)}}function Cn(){var v="",$={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(e){return G(e)?(v=e,this):v},this.html5Mode=function(e){return k(e)?($.enabled=e,this):le(e)?(k(e.enabled)&&($.enabled=e.enabled),k(e.requireBase)&&($.requireBase=e.requireBase),k(e.rewriteLinks)&&($.rewriteLinks=e.rewriteLinks),this):$},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(o,a,t,r,s){var l,e,n,i,c=a.baseHref(),u=a.url();if($.enabled){if(!c&&$.requireBase)throw un("nobase","$location in HTML5 mode requires a <base> tag to be present!");n=(i=u).substring(0,i.indexOf("/",i.indexOf("//")+2))+(c||"/"),e=t.history?vn:bn}else n=gn(u),e=$n;var h,d=(h=n).substr(0,gn(h).lastIndexOf("/")+1);(l=new e(n,d,"#"+v)).$$parseLinkUrl(u,u),l.$$state=a.state();var f=/^\s*(javascript|mailto):/i;function p(e,t,n){var i=l.url(),r=l.$$state;try{a.url(e,t,n),l.$$state=a.state()}catch(e){throw l.url(i),l.$$state=r,e}}r.on("click",function(e){if($.rewriteLinks&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&2!=e.which&&2!=e.button){for(var t=re(e.target);"a"!==pe(t[0]);)if(t[0]===r[0]||!(t=t.parent())[0])return;var n=t.prop("href"),i=t.attr("href")||t.attr("xlink:href");le(n)&&"[object SVGAnimatedString]"===n.toString()&&(n=ci(n.animVal).href),f.test(n)||!n||t.attr("target")||e.isDefaultPrevented()||l.$$parseLinkUrl(n,i)&&(e.preventDefault(),l.absUrl()!=a.url()&&(o.$apply(),s.angular["ff-684208-preventDefault"]=!0))}}),mn(l.absUrl())!=mn(u)&&a.url(l.absUrl(),!0);var g=!0;return a.onUrlChange(function(i,r){M(pn(d,i))?s.location.href=i:(o.$evalAsync(function(){var e,t=l.absUrl(),n=l.$$state;l.$$parse(i),l.$$state=r,e=o.$broadcast("$locationChangeStart",i,t,r,n).defaultPrevented,l.absUrl()===i&&(e?(l.$$parse(t),p(t,!1,l.$$state=n)):(g=!1,m(t,n)))}),o.$$phase||o.$digest())}),o.$watch(function(){var n=mn(a.url()),e=mn(l.absUrl()),i=a.state(),r=l.$$replace,s=n!==e||l.$$html5&&t.history&&i!==l.$$state;(g||s)&&(g=!1,o.$evalAsync(function(){var e=l.absUrl(),t=o.$broadcast("$locationChangeStart",e,n,l.$$state,i).defaultPrevented;l.absUrl()===e&&(t?(l.$$parse(n),l.$$state=i):(s&&p(e,r,i===l.$$state?null:l.$$state),m(n,i)))})),l.$$replace=!1}),l;function m(e,t){o.$broadcast("$locationChangeSuccess",l.absUrl(),e,l.$$state,t)}}]}function xn(){var n=!0,i=this;this.debugEnabled=function(e){return G(e)?(n=e,this):n},this.$get=["$window",function(r){return{log:t("log"),info:t("info"),warn:t("warn"),error:t("error"),debug:(e=t("debug"),function(){n&&e.apply(i,arguments)})};var e;function t(e){var t=r.console||{},i=t[e]||t.log||ae,n=!1;try{n=!!i.apply}catch(e){}return n?function(){var n=[];return se(arguments,function(e){var t;n.push(((t=e)instanceof Error&&(t.stack?t=t.message&&-1===t.stack.indexOf(t.message)?"Error: "+t.message+"\n"+t.stack:t.stack:t.sourceURL&&(t=t.message+"\n"+t.sourceURL+":"+t.line)),t))}),i.apply(t,n)}:function(e,t){i(e,null==t?"":t)}}}]}se([bn,$n,vn],function(t){t.prototype=Object.create(wn),t.prototype.state=function(e){if(!arguments.length)return this.$$state;if(t!==vn||!this.$$html5)throw un("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=M(e)?null:e,this}});var kn=w("$parse");function An(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw kn("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function En(e,t){if(!ce(e+=""))throw kn("iseccst","Cannot convert object to primitive value! Expression: {0}",t);return e}function Rn(e,t){if(e){if(e.constructor===e)throw kn("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw kn("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw kn("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw kn("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}var _n=Function.prototype.call,Ln=Function.prototype.apply,Mn=Function.prototype.bind;var Tn=Ae();se({null:function(){return null},true:function(){return!0},false:function(){return!1},undefined:function(){}},function(e,t){e.constant=e.literal=e.sharedGetter=!0,Tn[t]=e}),Tn.this=function(e){return e},Tn.this.sharedGetter=!0;var Pn=F(Ae(),{"+":function(e,t,n,i){return n=n(e,t),i=i(e,t),G(n)?G(i)?n+i:n:G(i)?i:ie},"-":function(e,t,n,i){return n=n(e,t),i=i(e,t),(G(n)?n:0)-(G(i)?i:0)},"*":function(e,t,n,i){return n(e,t)*i(e,t)},"/":function(e,t,n,i){return n(e,t)/i(e,t)},"%":function(e,t,n,i){return n(e,t)%i(e,t)},"===":function(e,t,n,i){return n(e,t)===i(e,t)},"!==":function(e,t,n,i){return n(e,t)!==i(e,t)},"==":function(e,t,n,i){return n(e,t)==i(e,t)},"!=":function(e,t,n,i){return n(e,t)!=i(e,t)},"<":function(e,t,n,i){return n(e,t)<i(e,t)},">":function(e,t,n,i){return n(e,t)>i(e,t)},"<=":function(e,t,n,i){return n(e,t)<=i(e,t)},">=":function(e,t,n,i){return n(e,t)>=i(e,t)},"&&":function(e,t,n,i){return n(e,t)&&i(e,t)},"||":function(e,t,n,i){return n(e,t)||i(e,t)},"!":function(e,t,n){return!n(e,t)},"=":!0,"|":!0}),In={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},On=function(e){this.options=e};function Fn(e){return e.constant}On.prototype={constructor:On,lex:function(e){for(this.text=e,this.index=0,this.tokens=[];this.index<this.text.length;){var t=this.text.charAt(this.index);if('"'===t||"'"===t)this.readString(t);else if(this.isNumber(t)||"."===t&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(t))this.readIdent();else if(this.is(t,"(){}[].,;:?"))this.tokens.push({index:this.index,text:t}),this.index++;else if(this.isWhitespace(t))this.index++;else{var n=t+this.peek(),i=n+this.peek(2),r=Pn[t],s=Pn[n],o=Pn[i];if(r||s||o){var a=o?i:s?n:t;this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(e,t){return-1!==t.indexOf(e)},peek:function(e){var t=e||1;return this.index+t<this.text.length&&this.text.charAt(this.index+t)},isNumber:function(e){return"0"<=e&&e<="9"&&"string"==typeof e},isWhitespace:function(e){return" "===e||"\r"===e||"\t"===e||"\n"===e||"\v"===e||" "===e},isIdent:function(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"||"_"===e||"$"===e},isExpOperator:function(e){return"-"===e||"+"===e||this.isNumber(e)},throwError:function(e,t,n){n=n||this.index;var i=G(t)?"s "+t+"-"+this.index+" ["+this.text.substring(t,n)+"]":" "+n;throw kn("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",e,i,this.text)},readNumber:function(){for(var e="",t=this.index;this.index<this.text.length;){var n=O(this.text.charAt(this.index));if("."==n||this.isNumber(n))e+=n;else{var i=this.peek();if("e"==n&&this.isExpOperator(i))e+=n;else if(this.isExpOperator(n)&&i&&this.isNumber(i)&&"e"==e.charAt(e.length-1))e+=n;else{if(!this.isExpOperator(n)||i&&this.isNumber(i)||"e"!=e.charAt(e.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:t,text:e,constant:!0,value:Number(e)})},readIdent:function(){for(var e=this.index;this.index<this.text.length;){var t=this.text.charAt(this.index);if(!this.isIdent(t)&&!this.isNumber(t))break;this.index++}this.tokens.push({index:e,text:this.text.slice(e,this.index),identifier:!0})},readString:function(e){var t=this.index;this.index++;for(var n="",i=e,r=!1;this.index<this.text.length;){var s=this.text.charAt(this.index);if(i+=s,r){if("u"===s){var o=this.text.substring(this.index+1,this.index+5);o.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+o+"]"),this.index+=4,n+=String.fromCharCode(parseInt(o,16))}else{n+=In[s]||s}r=!1}else if("\\"===s)r=!0;else{if(s===e)return this.index++,void this.tokens.push({index:t,text:i,constant:!0,value:n});n+=s}this.index++}this.throwError("Unterminated quote",t)}};var Dn=function(e,t,n){this.lexer=e,this.$filter=t,this.options=n};function Nn(e,t,n,i,r){Rn(e,r),Rn(t,r);for(var s,o=n.split("."),a=0;1<o.length;a++){s=An(o.shift(),r);var l=0===a&&t&&t[s]||e[s];l||(l={},e[s]=l),e=Rn(l,r)}return Rn(e[s=An(o.shift(),r)],r),e[s]=i}Dn.ZERO=F(function(){return 0},{sharedGetter:!0,constant:!0}),Dn.prototype={constructor:Dn,parse:function(e){this.text=e,this.tokens=this.lexer.lex(e);var t=this.statements();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),t.literal=!!t.literal,t.constant=!!t.constant,t},primary:function(){var e,t,n;this.expect("(")?(e=this.filterChain(),this.consume(")")):this.expect("[")?e=this.arrayDeclaration():this.expect("{")?e=this.object():this.peek().identifier&&this.peek().text in Tn?e=Tn[this.consume().text]:this.peek().identifier?e=this.identifier():this.peek().constant?e=this.constant():this.throwError("not a primary expression",this.peek());for(;t=this.expect("(","[",".");)"("===t.text?(e=this.functionCall(e,n),n=null):"["===t.text?(n=e,e=this.objectIndex(e)):"."===t.text?(n=e,e=this.fieldAccess(e)):this.throwError("IMPOSSIBLE");return e},throwError:function(e,t){throw kn("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",t.text,e,t.index+1,this.text,this.text.substring(t.index))},peekToken:function(){if(0===this.tokens.length)throw kn("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(e,t,n,i){return this.peekAhead(0,e,t,n,i)},peekAhead:function(e,t,n,i,r){if(this.tokens.length>e){var s=this.tokens[e],o=s.text;if(o===t||o===n||o===i||o===r||!t&&!n&&!i&&!r)return s}return!1},expect:function(e,t,n,i){var r=this.peek(e,t,n,i);return!!r&&(this.tokens.shift(),r)},consume:function(e){if(0===this.tokens.length)throw kn("ueoe","Unexpected end of expression: {0}",this.text);var t=this.expect(e);return t||this.throwError("is unexpected, expecting ["+e+"]",this.peek()),t},unaryFn:function(e,n){var i=Pn[e];return F(function(e,t){return i(e,t,n)},{constant:n.constant,inputs:[n]})},binaryFn:function(n,e,i,t){var r=Pn[e];return F(function(e,t){return r(e,t,n,i)},{constant:n.constant&&i.constant,inputs:!t&&[n,i]})},identifier:function(){for(var e=this.consume().text;this.peek(".")&&this.peekAhead(1).identifier&&!this.peekAhead(2,"(");)e+=this.consume().text+this.consume().text;return function(i,e,r){var s=e.expensiveChecks,t=s?Bn:jn,n=t[i];if(n)return n;var o=i.split("."),a=o.length;if(e.csp)n=a<6?Un(o[0],o[1],o[2],o[3],o[4],r,s):function(e,t){for(var n,i=0;n=Un(o[i++],o[i++],o[i++],o[i++],o[i++],r,s)(e,t),t=ie,e=n,i<a;);return n};else{var l="";s&&(l+="s = eso(s, fe);\nl = eso(l, fe);\n");var c=s;se(o,function(e,t){An(e,r);var n=(t?"s":'((l&&l.hasOwnProperty("'+e+'"))?l:s)')+"."+e;(s||Hn(e))&&(n="eso("+n+", fe)",c=!0),l+="if(s == null) return undefined;\ns="+n+";\n"}),l+="return s;";var u=new Function("s","l","eso","fe",l);u.toString=$(l),c&&(h=u,d=r,u=function(e,t){return h(e,t,Rn,d)}),n=u}var h,d;return n.sharedGetter=!0,n.assign=function(e,t,n){return Nn(e,n,i,t,i)},t[i]=n}(e,this.options,this.text)},constant:function(){var e=this.consume().value;return F(function(){return e},{constant:!0,literal:!0})},statements:function(){for(var s=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&s.push(this.filterChain()),!this.expect(";"))return 1===s.length?s[0]:function(e,t){for(var n,i=0,r=s.length;i<r;i++)n=s[i](e,t);return n}},filterChain:function(){for(var e=this.expression();this.expect("|");)e=this.filter(e);return e},filter:function(r){var s,o,a=this.$filter(this.consume().text);if(this.peek(":"))for(s=[],o=[];this.expect(":");)s.push(this.expression());var e=[r].concat(s||[]);return F(function(e,t){var n=r(e,t);if(o){o[0]=n;for(var i=s.length;i--;)o[i+1]=s[i](e,t);return a.apply(ie,o)}return a(n)},{constant:!a.$stateful&&e.every(Fn),inputs:!a.$stateful&&e})},expression:function(){return this.assignment()},assignment:function(){var n,e,i=this.ternary();return(e=this.expect("="))?(i.assign||this.throwError("implies assignment but ["+this.text.substring(0,e.index)+"] can not be assigned to",e),n=this.ternary(),F(function(e,t){return i.assign(e,n(e,t),t)},{inputs:[i,n]})):i},ternary:function(){var n,i=this.logicalOR();if(this.expect("?")&&(n=this.assignment(),this.consume(":"))){var r=this.assignment();return F(function(e,t){return i(e,t)?n(e,t):r(e,t)},{constant:i.constant&&n.constant&&r.constant})}return i},logicalOR:function(){for(var e,t=this.logicalAND();e=this.expect("||");)t=this.binaryFn(t,e.text,this.logicalAND(),!0);return t},logicalAND:function(){for(var e,t=this.equality();e=this.expect("&&");)t=this.binaryFn(t,e.text,this.equality(),!0);return t},equality:function(){for(var e,t=this.relational();e=this.expect("==","!=","===","!==");)t=this.binaryFn(t,e.text,this.relational());return t},relational:function(){for(var e,t=this.additive();e=this.expect("<",">","<=",">=");)t=this.binaryFn(t,e.text,this.additive());return t},additive:function(){for(var e,t=this.multiplicative();e=this.expect("+","-");)t=this.binaryFn(t,e.text,this.multiplicative());return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t=this.binaryFn(t,e.text,this.unary());return t},unary:function(){var e;return this.expect("+")?this.primary():(e=this.expect("-"))?this.binaryFn(Dn.ZERO,e.text,this.unary()):(e=this.expect("!"))?this.unaryFn(e.text,this.unary()):this.primary()},fieldAccess:function(r){var s=this.identifier();return F(function(e,t,n){var i=n||r(e,t);return null==i?ie:s(i)},{assign:function(e,t,n){var i=r(e,n);return i||r.assign(e,i={},n),s.assign(i,t)}})},objectIndex:function(s){var o=this.text,a=this.expression();return this.consume("]"),F(function(e,t){var n=s(e,t),i=En(a(e,t),o);return An(i,o),n?Rn(n[i],o):ie},{assign:function(e,t,n){var i=An(En(a(e,n),o),o),r=Rn(s(e,n),o);return r||s.assign(e,r={},n),r[i]=t}})},functionCall:function(o,a){var l=[];if(")"!==this.peekToken().text)for(;l.push(this.expression()),this.expect(","););this.consume(")");var c=this.text,u=l.length?[]:null;return function(e,t){var n=a?a(e,t):G(a)?ie:e,i=o(e,t,n)||ae;if(u)for(var r=l.length;r--;)u[r]=Rn(l[r](e,t),c);Rn(n,c),function(e,t){if(e){if(e.constructor===e)throw kn("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===_n||e===Ln||e===Mn)throw kn("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}(i,c);var s=i.apply?i.apply(n,u):i(u[0],u[1],u[2],u[3],u[4]);return u&&(u.length=0),Rn(s,c)}},arrayDeclaration:function(){var s=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;s.push(this.expression())}while(this.expect(","));return this.consume("]"),F(function(e,t){for(var n=[],i=0,r=s.length;i<r;i++)n.push(s[i](e,t));return n},{literal:!0,constant:s.every(Fn),inputs:s})},object:function(){var s=[],o=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;var e=this.consume();e.constant?s.push(e.value):e.identifier?s.push(e.text):this.throwError("invalid key",e),this.consume(":"),o.push(this.expression())}while(this.expect(","));return this.consume("}"),F(function(e,t){for(var n={},i=0,r=o.length;i<r;i++)n[s[i]]=o[i](e,t);return n},{literal:!0,constant:o.every(Fn),inputs:o})}};var jn=Ae(),Bn=Ae();function Hn(e){return"constructor"==e}function Un(i,r,s,o,a,t,e){An(i,t),An(r,t),An(s,t),An(o,t),An(a,t);var n=function(e){return Rn(e,t)},l=e||Hn(i)?n:v,c=e||Hn(r)?n:v,u=e||Hn(s)?n:v,h=e||Hn(o)?n:v,d=e||Hn(a)?n:v;return function(e,t){var n=t&&t.hasOwnProperty(i)?t:e;return null==n?n:(n=l(n[i]),r?null==n?ie:(n=c(n[r]),s?null==n?ie:(n=u(n[s]),o?null==n?ie:(n=h(n[o]),a?null==n?ie:n=d(n[a]):n):n):n):n)}}var Wn=Object.prototype.valueOf;function Vn(e){return he(e.valueOf)?e.valueOf():Wn.call(e)}function zn(){var b=Ae(),w=Ae();this.$get=["$filter","$sniffer",function(h,e){var d={csp:e.csp,expensiveChecks:!1},f={csp:e.csp,expensiveChecks:!0};return function(e,t,n){var i,r,s,o,a;switch(typeof e){case"string":s=e=e.trim();var l=n?w:b;if(!(i=l[s])){":"===e.charAt(0)&&":"===e.charAt(1)&&(r=!0,e=e.substring(2));var c=n?f:d,u=new On(c);(i=new Dn(u,h,c).parse(e)).constant?i.$$watchDelegate=v:r?((a=o=i).sharedGetter&&((a=function(e,t){return o(e,t)}).literal=o.literal,a.constant=o.constant,a.assign=o.assign),(i=a).$$watchDelegate=i.literal?m:g):i.inputs&&(i.$$watchDelegate=p),l[s]=i}return $(i,t);case"function":return $(e,t);default:return $(ae,t)}};function u(e,t){return null==e||null==t?e===t:("object"!=typeof e||"object"!=typeof(e=Vn(e)))&&(e===t||e!=e&&t!=t)}function p(e,t,n,s){var o,a=s.$$inputs||(s.$$inputs=function e(t,n){for(var i=0,r=t.length;i<r;i++){var s=t[i];s.constant||(s.inputs?e(s.inputs,n):-1===n.indexOf(s)&&n.push(s))}return n}(s.inputs,[]));if(1===a.length){var i=u;return a=a[0],e.$watch(function(e){var t=a(e);return u(t,i)||(o=s(e),i=t&&Vn(t)),o},t,n)}for(var l=[],r=0,c=a.length;r<c;r++)l[r]=u;return e.$watch(function(e){for(var t=!1,n=0,i=a.length;n<i;n++){var r=a[n](e);(t||(t=!u(r,l[n])))&&(l[n]=r&&Vn(r))}return t&&(o=s(e)),o},t,n)}function g(e,i,t,n){var r,s;return r=e.$watch(function(e){return n(e)},function(e,t,n){s=e,he(i)&&i.apply(this,arguments),G(e)&&n.$$postDigest(function(){G(s)&&r()})},t)}function m(e,i,t,n){var r,s;return r=e.$watch(function(e){return n(e)},function(e,t,n){s=e,he(i)&&i.call(this,e,t,n),o(e)&&n.$$postDigest(function(){o(s)&&r()})},t);function o(e){var t=!0;return se(e,function(e){G(e)||(t=!1)}),t}}function v(e,i,t,n){var r;return r=e.$watch(function(e){return n(e)},function(e,t,n){he(i)&&i.apply(this,arguments),r()},t)}function $(r,s){if(!s)return r;var e=r.$$watchDelegate,t=e!==m&&e!==g?function(e,t){var n=r(e,t);return s(n,e,t)}:function(e,t){var n=r(e,t),i=s(n,e,t);return G(n)?i:n};return r.$$watchDelegate&&r.$$watchDelegate!==p?t.$$watchDelegate=r.$$watchDelegate:s.$stateful||(t.$$watchDelegate=p,t.inputs=[r]),t}}]}function qn(){this.$get=["$rootScope","$exceptionHandler",function(t,e){return Gn(function(e){t.$evalAsync(e)},e)}]}function Kn(){this.$get=["$browser","$exceptionHandler",function(t,e){return Gn(function(e){t.defer(e)},e)}]}function Gn(t,o){var i=w("$q",TypeError);function e(){this.$$state={status:0}}function n(t,n){return function(e){n.call(t,e)}}function r(e){!e.processScheduled&&e.pending&&(e.processScheduled=!0,t(function(){!function(e){var t,n,i;i=e.pending,e.processScheduled=!1,e.pending=ie;for(var r=0,s=i.length;r<s;++r){n=i[r][0],t=i[r][e.status];try{he(t)?n.resolve(t(e.value)):1===e.status?n.resolve(e.value):n.reject(e.value)}catch(e){n.reject(e),o(e)}}}(e)}))}function s(){this.promise=new e,this.resolve=n(this,this.resolve),this.reject=n(this,this.reject),this.notify=n(this,this.notify)}e.prototype={then:function(e,t,n){var i=new s;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([i,e,t,n]),0<this.$$state.status&&r(this.$$state),i.promise},catch:function(e){return this.then(null,e)},finally:function(t,e){return this.then(function(e){return l(e,!0,t)},function(e){return l(e,!1,t)},e)}},s.prototype={resolve:function(e){this.promise.$$state.status||(e===this.promise?this.$$reject(i("qcycle","Expected promise to be resolved with value other than itself '{0}'",e)):this.$$resolve(e))},$$resolve:function(e){var t,n;n=function(n,e,t){var i=!1;function r(t){return function(e){i||(i=!0,t.call(n,e))}}return[r(e),r(t)]}(this,this.$$resolve,this.$$reject);try{(le(e)||he(e))&&(t=e&&e.then),he(t)?(this.promise.$$state.status=-1,t.call(e,n[0],n[1],this.notify)):(this.promise.$$state.value=e,this.promise.$$state.status=1,r(this.promise.$$state))}catch(e){n[1](e),o(e)}},reject:function(e){this.promise.$$state.status||this.$$reject(e)},$$reject:function(e){this.promise.$$state.value=e,this.promise.$$state.status=2,r(this.promise.$$state)},notify:function(r){var s=this.promise.$$state.pending;this.promise.$$state.status<=0&&s&&s.length&&t(function(){for(var e,t,n=0,i=s.length;n<i;n++){t=s[n][0],e=s[n][3];try{t.notify(he(e)?e(r):r)}catch(e){o(e)}}})}};var a=function(e,t){var n=new s;return t?n.resolve(e):n.reject(e),n.promise},l=function(e,t,n){var i=null;try{he(n)&&(i=n())}catch(e){return a(e,!1)}return E(i)?i.then(function(){return a(e,t)},function(e){return a(e,!1)}):a(e,t)},c=function(e,t,n,i){var r=new s;return r.resolve(e),r.promise.then(t,n,i)};var u=function e(t){if(!he(t))throw i("norslvr","Expected resolverFn, got '{0}'",t);if(!(this instanceof e))return new e(t);var n=new s;return t(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise};return u.defer=function(){return new s},u.reject=function(e){var t=new s;return t.reject(e),t.promise},u.when=c,u.all=function(e){var n=new s,i=0,r=ue(e)?[]:{};return se(e,function(e,t){i++,c(e).then(function(e){r.hasOwnProperty(t)||(r[t]=e,--i||n.resolve(r))},function(e){r.hasOwnProperty(t)||n.reject(e)})}),0===i&&n.resolve(r),n.promise},u}function Qn(){this.$get=["$window","$timeout",function(e,n){var i,r=e.requestAnimationFrame||e.webkitRequestAnimationFrame,s=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame,t=!!r,o=t?function(e){var t=r(e);return function(){s(t)}}:function(e){var t=n(e,16.66,!1);return function(){n.cancel(t)}};u.supported=t;var a=0,l=[];return u;function c(){for(var e=0;e<l.length;e++){var t=l[e];t&&(l[e]=null,t())}a=l.length=0}function u(e){var t=l.length;return a++,l.push(e),0===t&&(i=o(c)),function(){0<=t&&(l[t]=null,t=null,0==--a&&i&&(i(),i=null,l.length=0))}}}]}function Jn(){var S=10,C=w("$rootScope"),x=null,k=null;this.digestTtl=function(e){return arguments.length&&(S=e),S},this.$get=["$injector","$exceptionHandler","$parse","$browser",function(e,d,p,f){function i(e){e.currentScope.$$destroyed=!0}function r(){this.$id=h(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,(this.$root=this).$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$isolateBindings=null}r.prototype={constructor:r,$new:function(e,t){var n;return t=t||this,e?(n=new r).$root=this.$root:(this.$$ChildScope||(this.$$ChildScope=function(e){function t(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$id=h(),this.$$ChildScope=null}return t.prototype=e,t}(this)),n=new this.$$ChildScope),n.$parent=t,n.$$prevSibling=t.$$childTail,t.$$childHead?(t.$$childTail.$$nextSibling=n,t.$$childTail=n):t.$$childHead=t.$$childTail=n,(e||t!=this)&&n.$on("$destroy",i),n},$watch:function(e,t,n){var i=p(e);if(i.$$watchDelegate)return i.$$watchDelegate(this,t,n,i);var r=this.$$watchers,s={fn:t,last:w,get:i,exp:e,eq:!!n};return x=null,he(t)||(s.fn=ae),r||(r=this.$$watchers=[]),r.unshift(s),function(){ge(r,s),x=null}},$watchGroup:function(e,i){var r=new Array(e.length),s=new Array(e.length),o=[],a=this,l=!1,t=!0;if(!e.length){var n=!0;return a.$evalAsync(function(){n&&i(s,s,a)}),function(){n=!1}}if(1===e.length)return this.$watch(e[0],function(e,t,n){s[0]=e,r[0]=t,i(s,e===t?s:r,n)});function c(){l=!1,t?(t=!1,i(s,s,a)):i(s,r,a)}return se(e,function(e,n){var t=a.$watch(e,function(e,t){s[n]=e,r[n]=t,l||(l=!0,a.$evalAsync(c))});o.push(t)}),function(){for(;o.length;)o.shift()()}},$watchCollection:function(e,n){f.$stateful=!0;var o,a,i,r=this,s=1<n.length,l=0,t=p(e,f),c=[],u={},h=!0,d=0;function f(e){var t,n,i,r;if(!M(o=e)){if(le(o))if(I(o)){a!==c&&(d=(a=c).length=0,l++),t=o.length,d!==t&&(l++,a.length=d=t);for(var s=0;s<t;s++)r=a[s],i=o[s],r!=r&&i!=i||r===i||(l++,a[s]=i)}else{for(n in a!==u&&(a=u={},d=0,l++),t=0,o)o.hasOwnProperty(n)&&(t++,i=o[n],r=a[n],n in a?r!=r&&i!=i||r===i||(l++,a[n]=i):(d++,a[n]=i,l++));if(t<d)for(n in l++,a)o.hasOwnProperty(n)||(d--,delete a[n])}else a!==o&&(a=o,l++);return l}}return this.$watch(t,function(){if(h?(h=!1,n(o,o,r)):n(o,i,r),s)if(le(o))if(I(o)){i=new Array(o.length);for(var e=0;e<o.length;e++)i[e]=o[e]}else for(var t in i={},o)A.call(o,t)&&(i[t]=o[t]);else i=o})},$digest:function(){var e,t,n,i,r,s,o,a,l,c,u=S,h=[];$("$digest"),f.$$checkUrlChange(),this===g&&null!==k&&(f.defer.cancel(k),y()),x=null;do{for(s=!1,a=this;m.length;){try{(c=m.shift()).scope.$eval(c.expression,c.locals)}catch(e){d(e)}x=null}e:do{if(i=a.$$watchers)for(r=i.length;r--;)try{if(e=i[r])if((t=e.get(a))===(n=e.last)||(e.eq?me(t,n):"number"==typeof t&&"number"==typeof n&&isNaN(t)&&isNaN(n))){if(e===x){s=!1;break e}}else s=!0,(x=e).last=e.eq?L(t,null):t,e.fn(t,n===w?t:n,a),u<5&&(h[l=4-u]||(h[l]=[]),h[l].push({msg:he(e.exp)?"fn: "+(e.exp.name||e.exp.toString()):e.exp,newVal:t,oldVal:n}))}catch(e){d(e)}if(!(o=a.$$childHead||a!==this&&a.$$nextSibling))for(;a!==this&&!(o=a.$$nextSibling);)a=a.$parent}while(a=o);if((s||m.length)&&!u--)throw b(),C("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",S,h)}while(s||m.length);for(b();v.length;)try{v.shift()()}catch(e){d(e)}},$destroy:function(){if(!this.$$destroyed){var e=this.$parent;if(this.$broadcast("$destroy"),this.$$destroyed=!0,this!==g){for(var t in this.$$listenerCount)s(this,this.$$listenerCount[t],t);e.$$childHead==this&&(e.$$childHead=this.$$nextSibling),e.$$childTail==this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=ae,this.$on=this.$watch=this.$watchGroup=function(){return ae},this.$$listeners={},this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}}},$eval:function(e,t){return p(e)(this,t)},$evalAsync:function(e,t){g.$$phase||m.length||f.defer(function(){m.length&&g.$digest()}),m.push({scope:this,expression:e,locals:t})},$$postDigest:function(e){v.push(e)},$apply:function(e){try{return $("$apply"),this.$eval(e)}catch(e){d(e)}finally{b();try{g.$digest()}catch(e){throw d(e),e}}},$applyAsync:function(e){var t=this;e&&n.push(function(){t.$eval(e)}),null===k&&(k=f.defer(function(){g.$apply(y)}))},$on:function(t,n){var i=this.$$listeners[t];i||(this.$$listeners[t]=i=[]),i.push(n);for(var e=this;e.$$listenerCount[t]||(e.$$listenerCount[t]=0),e.$$listenerCount[t]++,e=e.$parent;);var r=this;return function(){var e=i.indexOf(n);-1!==e&&(i[e]=null,s(r,1,t))}},$emit:function(e,t){var n,i,r,s=[],o=this,a=!1,l={name:e,targetScope:o,stopPropagation:function(){a=!0},preventDefault:function(){l.defaultPrevented=!0},defaultPrevented:!1},c=D([l],arguments,1);do{for(n=o.$$listeners[e]||s,l.currentScope=o,i=0,r=n.length;i<r;i++)if(n[i])try{n[i].apply(null,c)}catch(e){d(e)}else n.splice(i,1),i--,r--;if(a)return l.currentScope=null,l;o=o.$parent}while(o);return l.currentScope=null,l},$broadcast:function(e,t){var n=this,i=n,r=n,s={name:e,targetScope:n,preventDefault:function(){s.defaultPrevented=!0},defaultPrevented:!1};if(!n.$$listenerCount[e])return s;for(var o,a,l,c=D([s],arguments,1);i=r;){for(a=0,l=(o=(s.currentScope=i).$$listeners[e]||[]).length;a<l;a++)if(o[a])try{o[a].apply(null,c)}catch(e){d(e)}else o.splice(a,1),a--,l--;if(!(r=i.$$listenerCount[e]&&i.$$childHead||i!==n&&i.$$nextSibling))for(;i!==n&&!(r=i.$$nextSibling);)i=i.$parent}return s.currentScope=null,s}};var g=new r,m=g.$$asyncQueue=[],v=g.$$postDigestQueue=[],n=g.$$applyAsyncQueue=[];return g;function $(e){if(g.$$phase)throw C("inprog","{0} already in progress",g.$$phase);g.$$phase=e}function b(){g.$$phase=null}function s(e,t,n){for(;e.$$listenerCount[n]-=t,0===e.$$listenerCount[n]&&delete e.$$listenerCount[n],e=e.$parent;);}function w(){}function y(){for(;n.length;)try{n.shift()()}catch(e){d(e)}k=null}}]}function Yn(){var r=/^\s*(https?|ftp|mailto|tel|file):/,s=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(e){return G(e)?(r=e,this):r},this.imgSrcSanitizationWhitelist=function(e){return G(e)?(s=e,this):s},this.$get=function(){return function(e,t){var n,i=t?s:r;return""===(n=ci(e).href)||n.match(i)?e:"unsafe:"+n}}}var Xn=w("$sce"),Zn={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"};function ei(e){var t=[];return G(e)&&se(e,function(e){t.push(function(e){if("self"===e)return e;if(ce(e)){if(-1<e.indexOf("***"))throw Xn("iwcard","Illegal sequence *** in string matcher.  String: {0}",e);return e=R(e).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+e+"$")}if(C(e))return new RegExp("^"+e.source+"$");throw Xn("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}(e))}),t}function ti(){this.SCE_CONTEXTS=Zn;var o=["self"],a=[];this.resourceUrlWhitelist=function(e){return arguments.length&&(o=ei(e)),o},this.resourceUrlBlacklist=function(e){return arguments.length&&(a=ei(e)),a},this.$get=["$injector",function(e){var i=function(e){throw Xn("unsafe","Attempting to use an unsafe value in a safe context.")};function s(e,t){return"self"===e?ui(t):!!e.exec(t.href)}function t(e){var t=function(e){this.$$unwrapTrustedValue=function(){return e}};return e&&(t.prototype=new e),t.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},t.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},t}e.has("$sanitize")&&(i=e.get("$sanitize"));var n=t(),r={};return r[Zn.HTML]=t(n),r[Zn.CSS]=t(n),r[Zn.URL]=t(n),r[Zn.JS]=t(n),r[Zn.RESOURCE_URL]=t(r[Zn.URL]),{trustAs:function(e,t){var n=r.hasOwnProperty(e)?r[e]:null;if(!n)throw Xn("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",e,t);if(null===t||t===ie||""===t)return t;if("string"!=typeof t)throw Xn("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",e);return new n(t)},getTrusted:function(e,t){if(null===t||t===ie||""===t)return t;var n=r.hasOwnProperty(e)?r[e]:null;if(n&&t instanceof n)return t.$$unwrapTrustedValue();if(e===Zn.RESOURCE_URL){if(function(e){var t,n,i=ci(e.toString()),r=!1;for(t=0,n=o.length;t<n;t++)if(s(o[t],i)){r=!0;break}if(r)for(t=0,n=a.length;t<n;t++)if(s(a[t],i)){r=!1;break}return r}(t))return t;throw Xn("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}",t.toString())}if(e===Zn.HTML)return i(t);throw Xn("unsafe","Attempting to use an unsafe value in a safe context.")},valueOf:function(e){return e instanceof n?e.$$unwrapTrustedValue():e}}}]}function ni(){var t=!0;this.enabled=function(e){return arguments.length&&(t=!!e),t},this.$get=["$parse","$sceDelegate",function(i,e){if(t&&q<8)throw Xn("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode.  You can fix this by adding the text <!doctype html> to the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more information.");var r=T(Zn);r.isEnabled=function(){return t},r.trustAs=e.trustAs,r.getTrusted=e.getTrusted,r.valueOf=e.valueOf,t||(r.trustAs=r.getTrusted=function(e,t){return t},r.valueOf=v),r.parseAs=function(t,e){var n=i(e);return n.literal&&n.constant?n:i(e,function(e){return r.getTrusted(t,e)})};var s=r.parseAs,o=r.getTrusted,a=r.trustAs;return se(Zn,function(t,e){var n=O(e);r[Ue("parse_as_"+n)]=function(e){return s(t,e)},r[Ue("get_trusted_"+n)]=function(e){return o(t,e)},r[Ue("trust_as_"+n)]=function(e){return a(t,e)}}),r}]}function ii(){this.$get=["$window","$document",function(e,t){var n,i,r={},s=f((/android (\d+)/.exec(O((e.navigator||{}).userAgent))||[])[1]),o=/Boxee/i.test((e.navigator||{}).userAgent),a=t[0]||{},l=/^(Moz|webkit|ms)(?=[A-Z])/,c=a.body&&a.body.style,u=!1,h=!1;if(c){for(var d in c)if(i=l.exec(d)){n=(n=i[0]).substr(0,1).toUpperCase()+n.substr(1);break}n||(n="WebkitOpacity"in c&&"webkit"),u=!!("transition"in c||n+"Transition"in c),h=!!("animation"in c||n+"Animation"in c),!s||u&&h||(u=ce(a.body.style.webkitTransition),h=ce(a.body.style.webkitAnimation))}return{history:!(!e.history||!e.history.pushState||s<4||o),hasEvent:function(e){if("input"===e&&q<=11)return!1;if(M(r[e])){var t=a.createElement("div");r[e]="on"+e in t}return r[e]},csp:P(),vendorPrefix:n,transitions:u,animations:h,android:s}}]}It=w("$compile");function ri(){this.$get=["$templateCache","$http","$q","$sce",function(r,s,o,a){function l(t,n){l.totalPendingRequests++,ce(t)&&r.get(t)||(t=a.getTrustedResourceUrl(t));var e=s.defaults&&s.defaults.transformResponse;ue(e)?e=e.filter(function(e){return e!==Qt}):e===Qt&&(e=null);var i={cache:r,transformResponse:e};return s.get(t,i).finally(function(){l.totalPendingRequests--}).then(function(e){return e.data},function(e){if(n)return o.reject(e);throw It("tpload","Failed to load template: {0}",t)})}return l.totalPendingRequests=0,l}]}function si(){this.$get=["$rootScope","$browser","$location",function(t,n,i){var e={findBindings:function(e,n,i){var t=e.getElementsByClassName("ng-binding"),r=[];return se(t,function(t){var e=y.element(t).data("$binding");e&&se(e,function(e){i?new RegExp("(^|\\s)"+R(n)+"(\\s|\\||$)").test(e)&&r.push(t):-1!=e.indexOf(n)&&r.push(t)})}),r},findModels:function(e,t,n){for(var i=["ng-","data-ng-","ng\\:"],r=0;r<i.length;++r){var s="["+i[r]+"model"+(n?"=":"*=")+'"'+t+'"]',o=e.querySelectorAll(s);if(o.length)return o}},getLocation:function(){return i.url()},setLocation:function(e){e!==i.url()&&(i.url(e),t.$digest())},whenStable:function(e){n.notifyWhenNoOutstandingRequests(e)}};return e}]}function oi(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,l,c,u,h){var d={};function e(e,t,n){var i,r=G(n)&&!n,s=(r?u:c).defer(),o=s.promise;return i=l.defer(function(){try{s.resolve(e())}catch(e){s.reject(e),h(e)}finally{delete d[o.$$timeoutId]}r||a.$apply()},t),o.$$timeoutId=i,d[i]=s,o}return e.cancel=function(e){return!!(e&&e.$$timeoutId in d)&&(d[e.$$timeoutId].reject("canceled"),delete d[e.$$timeoutId],l.defer.cancel(e.$$timeoutId))},e}]}var ai=ne.createElement("a"),li=ci(c.location.href);function ci(e){var t=e;return q&&(ai.setAttribute("href",t),t=ai.href),ai.setAttribute("href",t),{href:ai.href,protocol:ai.protocol?ai.protocol.replace(/:$/,""):"",host:ai.host,search:ai.search?ai.search.replace(/^\?/,""):"",hash:ai.hash?ai.hash.replace(/^#/,""):"",hostname:ai.hostname,port:ai.port,pathname:"/"===ai.pathname.charAt(0)?ai.pathname:"/"+ai.pathname}}function ui(e){var t=ce(e)?ci(e):e;return t.protocol===li.protocol&&t.host===li.host}function hi(){this.$get=$(c)}function di(i){var r="Filter";function s(e,t){if(le(e)){var n={};return se(e,function(e,t){n[t]=s(t,e)}),n}return i.factory(e+r,t)}this.register=s,this.$get=["$injector",function(t){return function(e){return t.get(e+r)}}],s("currency",gi),s("date",Ri),s("filter",fi),s("json",_i),s("limitTo",Ti),s("lowercase",Li),s("number",mi),s("orderBy",Pi),s("uppercase",Mi)}function fi(){return function(e,t,n){if(!ue(e))return e;var i,r;switch(null!==t?typeof t:"null"){case"function":i=t;break;case"boolean":case"null":case"number":case"string":r=!0;case"object":i=function(t,n,i){var r=le(t)&&"$"in t;!0===n?n=me:he(n)||(n=function(e,t){return!M(e)&&(null===e||null===t?e===t:!le(e)&&!le(t)&&(e=O(""+e),t=O(""+t),-1!==e.indexOf(t)))});return function(e){return r&&!le(e)?pi(e,t.$,n,!1):pi(e,t,n,i)}}(t,n,r);break;default:return e}return e.filter(i)}}function pi(e,t,n,i,r){var s=null!==e?typeof e:"null",o=null!==t?typeof t:"null";if("string"===o&&"!"===t.charAt(0))return!pi(e,t.substring(1),n,i);if(ue(e))return e.some(function(e){return pi(e,t,n,i)});switch(s){case"object":var a;if(i){for(a in e)if("$"!==a.charAt(0)&&pi(e[a],t,n,!0))return!0;return!r&&pi(e,t,n,!1)}if("object"!==o)return n(e,t);for(a in t){var l=t[a];if(!he(l)&&!M(l)){var c="$"===a;if(!pi(c?e:e[a],l,n,c,c))return!1}}return!0;case"function":return!1;default:return n(e,t)}}function gi(e){var i=e.NUMBER_FORMATS;return function(e,t,n){return M(t)&&(t=i.CURRENCY_SYM),M(n)&&(n=i.PATTERNS[1].maxFrac),null==e?e:$i(e,i.PATTERNS[1],i.GROUP_SEP,i.DECIMAL_SEP,n).replace(/\u00A4/g,t)}}function mi(e){var n=e.NUMBER_FORMATS;return function(e,t){return null==e?e:$i(e,n.PATTERNS[0],n.GROUP_SEP,n.DECIMAL_SEP,t)}}di.$inject=["$provide"],gi.$inject=["$locale"],mi.$inject=["$locale"];var vi=".";function $i(e,t,n,i,r){if(!isFinite(e)||le(e))return"";var s=e<0,o=(e=Math.abs(e))+"",a="",l=[],c=!1;if(-1!==o.indexOf("e")){var u=o.match(/([\d\.]+)e(-?)(\d+)/);u&&"-"==u[2]&&u[3]>r+1?e=0:(a=o,c=!0)}if(c)0<r&&e<1&&(a=e.toFixed(r),e=parseFloat(a));else{var h=(o.split(vi)[1]||"").length;M(r)&&(r=Math.min(Math.max(t.minFrac,h),t.maxFrac));var d=(""+(e=+(Math.round(+(e.toString()+"e"+r)).toString()+"e"+-r))).split(vi),f=d[0];d=d[1]||"";var p,g=0,m=t.lgSize,v=t.gSize;if(f.length>=m+v)for(g=f.length-m,p=0;p<g;p++)(g-p)%v==0&&0!==p&&(a+=n),a+=f.charAt(p);for(p=g;p<f.length;p++)(f.length-p)%m==0&&0!==p&&(a+=n),a+=f.charAt(p);for(;d.length<r;)d+="0";r&&"0"!==r&&(a+=i+d.substr(0,r))}return 0===e&&(s=!1),l.push(s?t.negPre:t.posPre,a,s?t.negSuf:t.posSuf),l.join("")}function bi(e,t,n){var i="";for(e<0&&(i="-",e=-e),e=""+e;e.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),i+e}function wi(n,i,r,s){return r=r||0,function(e){var t=e["get"+n]();return(0<r||-r<t)&&(t+=r),0===t&&-12==r&&(t=12),bi(t,i,s)}}function yi(i,r){return function(e,t){var n=e["get"+i]();return t[l(r?"SHORT"+i:i)][n]}}function Si(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(t<=4?5:12)-t)}function Ci(r){return function(e){var t,n=Si(e.getFullYear()),i=+(t=e,new Date(t.getFullYear(),t.getMonth(),t.getDate()+(4-t.getDay())))-+n;return bi(1+Math.round(i/6048e5),r)}}function xi(e,t){return e.getFullYear()<=0?t.ERAS[0]:t.ERAS[1]}var ki={yyyy:wi("FullYear",4),yy:wi("FullYear",2,0,!0),y:wi("FullYear",1),MMMM:yi("Month"),MMM:yi("Month",!0),MM:wi("Month",2,1),M:wi("Month",1,1),dd:wi("Date",2),d:wi("Date",1),HH:wi("Hours",2),H:wi("Hours",1),hh:wi("Hours",2,-12),h:wi("Hours",1,-12),mm:wi("Minutes",2),m:wi("Minutes",1),ss:wi("Seconds",2),s:wi("Seconds",1),sss:wi("Milliseconds",3),EEEE:yi("Day"),EEE:yi("Day",!0),a:function(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]},Z:function(e){var t=-1*e.getTimezoneOffset(),n=0<=t?"+":"";return n+=bi(Math[0<t?"floor":"ceil"](t/60),2)+bi(Math.abs(t%60),2)},ww:Ci(2),w:Ci(1),G:xi,GG:xi,GGG:xi,GGGG:function(e,t){return e.getFullYear()<=0?t.ERANAMES[0]:t.ERANAMES[1]}},Ai=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,Ei=/^\-?\d+$/;function Ri(a){var h=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(t,e,n){var i,r,s="",o=[];if(e=e||"mediumDate",e=a.DATETIME_FORMATS[e]||e,ce(t)&&(t=Ei.test(t)?f(t):function(e){var t;if(t=e.match(h)){var n=new Date(0),i=0,r=0,s=t[8]?n.setUTCFullYear:n.setFullYear,o=t[8]?n.setUTCHours:n.setHours;t[9]&&(i=f(t[9]+t[10]),r=f(t[9]+t[11])),s.call(n,f(t[1]),f(t[2])-1,f(t[3]));var a=f(t[4]||0)-i,l=f(t[5]||0)-r,c=f(t[6]||0),u=Math.round(1e3*parseFloat("0."+(t[7]||0)));return o.call(n,a,l,c,u),n}return e}(t)),b(t)&&(t=new Date(t)),!S(t))return t;for(;e;)(r=Ai.exec(e))?e=(o=D(o,r,1)).pop():(o.push(e),e=null);return n&&"UTC"===n&&(t=new Date(t.getTime())).setMinutes(t.getMinutes()+t.getTimezoneOffset()),se(o,function(e){i=ki[e],s+=i?i(t,a.DATETIME_FORMATS):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),s}}function _i(){return function(e,t){return M(t)&&(t=2),j(e,t)}}Ri.$inject=["$locale"];var Li=$(O),Mi=$(l);function Ti(){return function(e,t){return b(e)&&(e=e.toString()),ue(e)||ce(e)?(t=Math.abs(Number(t))===1/0?Number(t):f(t))?0<t?e.slice(0,t):e.slice(t):ce(e)?"":[]:e}}function Pi(l){return function(e,r,t){return I(e)?(0===(r=ue(r)?r:[r]).length&&(r=["+"]),r=r.map(function(e){var t=!1,n=e||v;if(ce(e)){if("+"!=e.charAt(0)&&"-"!=e.charAt(0)||(t="-"==e.charAt(0),e=e.substring(1)),""===e)return s(a,t);if((n=l(e)).constant){var i=n();return s(function(e,t){return a(e[i],t[i])},t)}}return s(function(e,t){return a(n(e),n(t))},t)}),i.call(e).sort(s(function(e,t){for(var n=0;n<r.length;n++){var i=r[n](e,t);if(0!==i)return i}return 0},t))):e;function s(n,e){return e?function(e,t){return n(t,e)}:n}function n(e){switch(typeof e){case"number":case"boolean":case"string":return!0;default:return!1}}function o(e){return null===e?"null":"function"==typeof e.valueOf&&n(e=e.valueOf())?e:"function"==typeof e.toString&&n(e=e.toString())?e:""}function a(e,t){var n=typeof e,i=typeof t;return n===i&&"object"===n&&(e=o(e),t=o(t)),n===i?("string"===n&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t?0:e<t?-1:1):n<i?-1:1}}}function Ii(e){return he(e)&&(e={link:e}),e.restrict=e.restrict||"AC",$(e)}Pi.$inject=["$parse"];var Oi=$({restrict:"E",compile:function(e,t){if(!t.href&&!t.xlinkHref&&!t.name)return function(e,t){if("a"===t[0].nodeName.toLowerCase()){var n="[object SVGAnimatedString]"===a.call(t.prop("href"))?"xlink:href":"href";t.on("click",function(e){t.attr(n)||e.preventDefault()})}}}}),Fi={};se(ft,function(e,i){if("multiple"!=e){var r=Dt("ng-"+i);Fi[r]=function(){return{restrict:"A",priority:100,link:function(e,t,n){e.$watch(n[r],function(e){n.$set(i,!!e)})}}}}}),se(gt,function(e,r){Fi[r]=function(){return{priority:100,link:function(e,t,n){if("ngPattern"===r&&"/"==n.ngPattern.charAt(0)){var i=n.ngPattern.match(s);if(i)return void n.$set("ngPattern",new RegExp(i[1],i[2]))}e.$watch(n[r],function(e){n.$set(r,e)})}}}}),se(["src","srcset","href"],function(s){var o=Dt("ng-"+s);Fi[o]=function(){return{priority:99,link:function(e,t,n){var i=s,r=s;"href"===s&&"[object SVGAnimatedString]"===a.call(t.prop("href"))&&(r="xlinkHref",n.$attr[r]="xlink:href",i=null),n.$observe(o,function(e){e?(n.$set(r,e),q&&i&&t.prop(i,n[r])):"href"===s&&n.$set(r,null)})}}}});var Di={$addControl:ae,$$renameControl:function(e,t){e.$name=t},$removeControl:ae,$setValidity:ae,$setDirty:ae,$setPristine:ae,$setSubmitted:ae},Ni="ng-submitted";function ji(e,t,n,i,r){var s=this,o=[],a=s.$$parentForm=e.parent().controller("form")||Di;s.$error={},s.$$success={},s.$pending=ie,s.$name=r(t.name||t.ngForm||"")(n),s.$dirty=!1,s.$pristine=!0,s.$valid=!0,s.$invalid=!1,s.$submitted=!1,a.$addControl(s),s.$rollbackViewValue=function(){se(o,function(e){e.$rollbackViewValue()})},s.$commitViewValue=function(){se(o,function(e){e.$commitViewValue()})},s.$addControl=function(e){Ce(e.$name,"input"),o.push(e),e.$name&&(s[e.$name]=e)},s.$$renameControl=function(e,t){var n=e.$name;s[n]===e&&delete s[n],(s[t]=e).$name=t},s.$removeControl=function(n){n.$name&&s[n.$name]===n&&delete s[n.$name],se(s.$pending,function(e,t){s.$setValidity(t,null,n)}),se(s.$error,function(e,t){s.$setValidity(t,null,n)}),se(s.$$success,function(e,t){s.$setValidity(t,null,n)}),ge(o,n)},Dr({ctrl:this,$element:e,set:function(e,t,n){var i=e[t];i?-1===i.indexOf(n)&&i.push(n):e[t]=[n]},unset:function(e,t,n){var i=e[t];i&&(ge(i,n),0===i.length&&delete e[t])},parentForm:a,$animate:i}),s.$setDirty=function(){i.removeClass(e,Er),i.addClass(e,Rr),s.$dirty=!0,s.$pristine=!1,a.$setDirty()},s.$setPristine=function(){i.setClass(e,Er,Rr+" "+Ni),s.$dirty=!1,s.$pristine=!0,s.$submitted=!1,se(o,function(e){e.$setPristine()})},s.$setUntouched=function(){se(o,function(e){e.$setUntouched()})},s.$setSubmitted=function(){i.addClass(e,Ni),s.$submitted=!0,a.$setSubmitted()}}ji.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Bi=function(n){return["$timeout",function(a){return{name:"form",restrict:n?"EAC":"E",controller:ji,compile:function(e,t){e.addClass(Er).addClass(kr);var o=t.name?"name":!(!n||!t.ngForm)&&"ngForm";return{pre:function(t,e,n,i){if(!("action"in n)){var r=function(e){t.$apply(function(){i.$commitViewValue(),i.$setSubmitted()}),e.preventDefault()};Fe(e[0],"submit",r),e.on("$destroy",function(){a(function(){De(e[0],"submit",r)},0,!1)})}var s=i.$$parentForm;o&&(Nn(t,null,i.$name,i,i.$name),n.$observe(o,function(e){i.$name!==e&&(Nn(t,null,i.$name,ie,i.$name),s.$$renameControl(i,e),Nn(t,null,i.$name,i,i.$name))})),e.on("$destroy",function(){s.$removeControl(i),o&&Nn(t,null,n[o],ie,i.$name),F(i,Di)})}}}}}]},Hi=Bi(),Ui=Bi(!0),Wi=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,Vi=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,zi=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,qi=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Ki=/^(\d{4})-(\d{2})-(\d{2})$/,Gi=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Qi=/^(\d{4})-W(\d\d)$/,Ji=/^(\d{4})-(\d\d)$/,Yi=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Xi={text:function(e,t,n,i,r,s){er(e,t,n,i,r,s),Zi(i)},date:nr("date",Ki,tr(Ki,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":nr("datetimelocal",Gi,tr(Gi,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:nr("time",Yi,tr(Yi,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:nr("week",Qi,function(e,t){if(S(e))return e;if(ce(e)){Qi.lastIndex=0;var n=Qi.exec(e);if(n){var i=+n[1],r=+n[2],s=0,o=0,a=0,l=0,c=Si(i),u=7*(r-1);return t&&(s=t.getHours(),o=t.getMinutes(),a=t.getSeconds(),l=t.getMilliseconds()),new Date(i,0,c.getDate()+u,s,o,a,l)}}return NaN},"yyyy-Www"),month:nr("month",Ji,tr(Ji,["yyyy","MM"]),"yyyy-MM"),number:function(e,t,n,i,r,s){if(ir(e,t,n,i),er(e,t,n,i,r,s),i.$$parserName="number",i.$parsers.push(function(e){return i.$isEmpty(e)?null:qi.test(e)?parseFloat(e):ie}),i.$formatters.push(function(e){if(!i.$isEmpty(e)){if(!b(e))throw Tr("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}),G(n.min)||n.ngMin){var o;i.$validators.min=function(e){return i.$isEmpty(e)||M(o)||o<=e},n.$observe("min",function(e){G(e)&&!b(e)&&(e=parseFloat(e,10)),o=b(e)&&!isNaN(e)?e:ie,i.$validate()})}if(G(n.max)||n.ngMax){var a;i.$validators.max=function(e){return i.$isEmpty(e)||M(a)||e<=a},n.$observe("max",function(e){G(e)&&!b(e)&&(e=parseFloat(e,10)),a=b(e)&&!isNaN(e)?e:ie,i.$validate()})}},url:function(e,t,n,i,r,s){er(e,t,n,i,r,s),Zi(i),i.$$parserName="url",i.$validators.url=function(e,t){var n=e||t;return i.$isEmpty(n)||Vi.test(n)}},email:function(e,t,n,i,r,s){er(e,t,n,i,r,s),Zi(i),i.$$parserName="email",i.$validators.email=function(e,t){var n=e||t;return i.$isEmpty(n)||zi.test(n)}},radio:function(e,t,n,i){M(n.name)&&t.attr("name",h());t.on("click",function(e){t[0].checked&&i.$setViewValue(n.value,e&&e.type)}),i.$render=function(){var e=n.value;t[0].checked=e==i.$viewValue},n.$observe("value",i.$render)},checkbox:function(e,t,n,i,r,s,o,a){var l=rr(a,e,"ngTrueValue",n.ngTrueValue,!0),c=rr(a,e,"ngFalseValue",n.ngFalseValue,!1);t.on("click",function(e){i.$setViewValue(t[0].checked,e&&e.type)}),i.$render=function(){t[0].checked=i.$viewValue},i.$isEmpty=function(e){return!1===e},i.$formatters.push(function(e){return me(e,l)}),i.$parsers.push(function(e){return e?l:c})},hidden:ae,button:ae,submit:ae,reset:ae,file:ae};function Zi(t){t.$formatters.push(function(e){return t.$isEmpty(e)?e:e.toString()})}function er(e,i,r,s,t,o){var a=O(i[0].type);if(!t.android){var l=!1;i.on("compositionstart",function(e){l=!0}),i.on("compositionend",function(){l=!1,c()})}var c=function(e){if(u&&(o.defer.cancel(u),u=null),!l){var t=i.val(),n=e&&e.type;"password"===a||r.ngTrim&&"false"===r.ngTrim||(t=fe(t)),(s.$viewValue!==t||""===t&&s.$$hasNativeValidators)&&s.$setViewValue(t,n)}};if(t.hasEvent("input"))i.on("input",c);else{var u,n=function(e,t,n){u||(u=o.defer(function(){u=null,t&&t.value===n||c(e)}))};i.on("keydown",function(e){var t=e.keyCode;91===t||15<t&&t<19||37<=t&&t<=40||n(e,this,this.value)}),t.hasEvent("paste")&&i.on("paste cut",n)}i.on("change",c),s.$render=function(){i.val(s.$isEmpty(s.$viewValue)?"":s.$viewValue)}}function tr(r,s){return function(e,t){var n,i;if(S(e))return e;if(ce(e)){if('"'==e.charAt(0)&&'"'==e.charAt(e.length-1)&&(e=e.substring(1,e.length-1)),Wi.test(e))return new Date(e);if(r.lastIndex=0,n=r.exec(e))return n.shift(),i=t?{yyyy:t.getFullYear(),MM:t.getMonth()+1,dd:t.getDate(),HH:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds(),sss:t.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},se(n,function(e,t){t<s.length&&(i[s[t]]=+e)}),new Date(i.yyyy,i.MM-1,i.dd,i.HH,i.mm,i.ss||0,1e3*i.sss||0)}return NaN}}function nr(f,p,g,m){return function(e,t,n,i,r,s,o){ir(e,t,n,i),er(0,t,n,i,r,s);var a,l,c,u=i&&i.$options&&i.$options.timezone;(i.$$parserName=f,i.$parsers.push(function(e){if(i.$isEmpty(e))return null;if(p.test(e)){var t=g(e,a);return"UTC"===u&&t.setMinutes(t.getMinutes()-t.getTimezoneOffset()),t}return ie}),i.$formatters.push(function(e){if(e&&!S(e))throw Tr("datefmt","Expected `{0}` to be a date",e);if(h(e)){if((a=e)&&"UTC"===u){var t=6e4*a.getTimezoneOffset();a=new Date(a.getTime()+t)}return o("date")(e,m,u)}return a=null,""}),G(n.min)||n.ngMin)&&(i.$validators.min=function(e){return!h(e)||M(l)||g(e)>=l},n.$observe("min",function(e){l=d(e),i.$validate()}));(G(n.max)||n.ngMax)&&(i.$validators.max=function(e){return!h(e)||M(c)||g(e)<=c},n.$observe("max",function(e){c=d(e),i.$validate()}));function h(e){return e&&!(e.getTime&&e.getTime()!=e.getTime())}function d(e){return G(e)?S(e)?e:g(e):ie}}}function ir(e,n,t,i){var r=n[0];(i.$$hasNativeValidators=le(r.validity))&&i.$parsers.push(function(e){var t=n.prop(o)||{};return t.badInput&&!t.typeMismatch?ie:e})}function rr(e,t,n,i,r){var s;if(G(i)){if(!(s=e(i)).constant)throw Tr("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,i);return s(t)}return r}var sr=["$browser","$sniffer","$filter","$parse",function(r,s,o,a){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,t,n,i){i[0]&&(Xi[O(n.type)]||Xi.text)(e,t,n,i[0],s,r,o,a)}}}}],or=/^(true|false|\d+)$/,ar=function(){return{restrict:"A",priority:100,compile:function(e,t){return or.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(e){n.$set("value",e)})}}}},lr=["$compile",function(i){return{restrict:"AC",compile:function(e){return i.$$addBindingClass(e),function(e,t,n){i.$$addBindingInfo(t,n.ngBind),t=t[0],e.$watch(n.ngBind,function(e){t.textContent=e===ie?"":e})}}}}],cr=["$interpolate","$compile",function(r,s){return{compile:function(e){return s.$$addBindingClass(e),function(e,t,n){var i=r(t.attr(n.$attr.ngBindTemplate));s.$$addBindingInfo(t,i.expressions),t=t[0],n.$observe("ngBindTemplate",function(e){t.textContent=e===ie?"":e})}}}}],ur=["$sce","$parse","$compile",function(s,n,o){return{restrict:"A",compile:function(e,t){var i=n(t.ngBindHtml),r=n(t.ngBindHtml,function(e){return(e||"").toString()});return o.$$addBindingClass(e),function(e,t,n){o.$$addBindingInfo(t,n.ngBindHtml),e.$watch(r,function(){t.html(s.getTrustedHtml(i(e))||"")})}}}}],hr=$({restrict:"A",require:"ngModel",link:function(e,t,n,i){i.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}});function dr(o,g){return o="ngClass"+o,["$animate",function(d){return{restrict:"AC",link:function(a,l,s){var c;function u(e){var t=h(e,1);s.$addClass(t)}function h(e,t){var n=l.data("$classCounts")||{},i=[];return se(e,function(e){(0<t||n[e])&&(n[e]=(n[e]||0)+t,n[e]===+(0<t)&&i.push(e))}),l.data("$classCounts",n),i.join(" ")}function t(e){if(!0===g||a.$index%2===g){var t=p(e||[]);if(c){if(!me(e,c)){var n=p(c);s=f(r=t,i=n),o=f(i,r),s=h(s,1),o=h(o,-1),s&&s.length&&d.addClass(l,s),o&&o.length&&d.removeClass(l,o)}}else u(t)}var i,r,s,o;c=T(e)}a.$watch(s[o],t,!0),s.$observe("class",function(e){t(a.$eval(s[o]))}),"ngClass"!==o&&a.$watch("$index",function(e,t){var n,i=1&e;if(i!==(1&t)){var r=p(a.$eval(s[o]));i===g?u(r):(n=h(r,-1),s.$removeClass(n))}})}};function f(e,t){var n=[];e:for(var i=0;i<e.length;i++){for(var r=e[i],s=0;s<t.length;s++)if(r==t[s])continue e;n.push(r)}return n}function p(e){if(ue(e))return e;if(ce(e))return e.split(" ");if(le(e)){var n=[];return se(e,function(e,t){e&&(n=n.concat(t.split(" ")))}),n}return e}}]}var fr=dr("",!0),pr=dr("Odd",0),gr=dr("Even",1),mr=Ii({compile:function(e,t){t.$set("ngCloak",ie),e.removeClass("ng-cloak")}}),vr=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],$r={},br={blur:!0,focus:!0};se("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(s){var o=Dt("ng-"+s);$r[o]=["$parse","$rootScope",function(n,r){return{restrict:"A",compile:function(e,t){var i=n(t[o],null,!0);return function(n,e){e.on(s,function(e){var t=function(){i(n,{$event:e})};br[s]&&r.$$phase?n.$evalAsync(t):n.$apply(t)})}}}}]});var wr=["$animate",function(l){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(e,n,i,t,r){var s,o,a;e.$watch(i.ngIf,function(e){e?o||r(function(e,t){o=t,e[e.length++]=ne.createComment(" end ngIf: "+i.ngIf+" "),s={clone:e},l.enter(e,n.parent(),n)}):(a&&(a.remove(),a=null),o&&(o.$destroy(),o=null),s&&(a=ke(s.clone),l.leave(a).then(function(){a=null}),s=null))})}}}],yr=["$templateRequest","$anchorScroll","$animate",function(m,v,$){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:y.noop,compile:function(e,t){var n=t.ngInclude||t.src,p=t.onload||"",g=t.autoscroll;return function(o,a,e,l,c){var u,t,h,d=0,f=function(){t&&(t.remove(),t=null),u&&(u.$destroy(),u=null),h&&($.leave(h).then(function(){t=null}),t=h,h=null)};o.$watch(n,function(i){var r=function(){!G(g)||g&&!o.$eval(g)||v()},s=++d;i?(m(i,!0).then(function(e){if(s===d){var t=o.$new();l.template=e;var n=c(t,function(e){f(),$.enter(e,null,a).then(r)});h=n,(u=t).$emit("$includeContentLoaded",i),o.$eval(p)}},function(){s===d&&(f(),o.$emit("$includeContentError",i))}),o.$emit("$includeContentRequested",i)):(f(),l.template=null)})}}}}],Sr=["$compile",function(r){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(e,t,n,i){if(/SVG/.test(t[0].toString()))return t.empty(),void r(Je(i.template,ne).childNodes)(e,function(e){t.append(e)},{futureParentElement:t});t.html(i.template),r(t.contents())(e)}}}],Cr=Ii({priority:450,compile:function(){return{pre:function(e,t,n){e.$eval(n.ngInit)}}}}),xr=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,n,i){var r=t.attr(n.$attr.ngList)||", ",s="false"!==n.ngTrim,o=s?fe(r):r;i.$parsers.push(function(e){if(!M(e)){var t=[];return e&&se(e.split(o),function(e){e&&t.push(s?fe(e):e)}),t}}),i.$formatters.push(function(e){return ue(e)?e.join(r):ie}),i.$isEmpty=function(e){return!e||!e.length}}}},kr="ng-valid",Ar="ng-invalid",Er="ng-pristine",Rr="ng-dirty",_r="ng-untouched",Lr="ng-touched",Mr="ng-pending",Tr=w("ngModel"),Pr=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(s,t,r,o,a,e,l,c,u,n){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=ie,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=ie,this.$name=n(r.name||"",!1)(s);var h,d=a(r.ngModel),f=d.assign,p=d,g=f,m=null,v=this;this.$$setOptions=function(e){if((v.$options=e)&&e.getterSetter){var n=a(r.ngModel+"()"),i=a(r.ngModel+"($$$p)");p=function(e){var t=d(e);return he(t)&&(t=n(e)),t},g=function(e,t){he(d(e))?i(e,{$$$p:v.$modelValue}):f(e,v.$modelValue)}}else if(!d.assign)throw Tr("nonassign","Expression '{0}' is non-assignable. Element: {1}",r.ngModel,$e(o))},this.$render=ae,this.$isEmpty=function(e){return M(e)||""===e||null===e||e!=e};var i=o.inheritedData("$formController")||Di,$=0;Dr({ctrl:this,$element:o,set:function(e,t){e[t]=!0},unset:function(e,t){delete e[t]},parentForm:i,$animate:e}),this.$setPristine=function(){v.$dirty=!1,v.$pristine=!0,e.removeClass(o,Rr),e.addClass(o,Er)},this.$setDirty=function(){v.$dirty=!0,v.$pristine=!1,e.removeClass(o,Er),e.addClass(o,Rr),i.$setDirty()},this.$setUntouched=function(){v.$touched=!1,v.$untouched=!0,e.setClass(o,_r,Lr)},this.$setTouched=function(){v.$touched=!0,v.$untouched=!1,e.setClass(o,Lr,_r)},this.$rollbackViewValue=function(){l.cancel(m),v.$viewValue=v.$$lastCommittedViewValue,v.$render()},this.$validate=function(){if(!b(v.$modelValue)||!isNaN(v.$modelValue)){var e=v.$$lastCommittedViewValue,t=v.$$rawModelValue,n=v.$valid,i=v.$modelValue,r=v.$options&&v.$options.allowInvalid;v.$$runValidators(t,e,function(e){r||n===e||(v.$modelValue=e?t:ie,v.$modelValue!==i&&v.$$writeModelToScope())})}},this.$$runValidators=function(i,r,t){var s,o,a,n=++$;(function(){var e=v.$$parserName||"parse";{if(h!==ie)return h||(se(v.$validators,function(e,t){l(t,null)}),se(v.$asyncValidators,function(e,t){l(t,null)})),l(e,h),h;l(e,null)}return!0})()?(s=!0,se(v.$validators,function(e,t){var n=e(i,r);s=s&&n,l(t,n)}),s||(se(v.$asyncValidators,function(e,t){l(t,null)}),0)?(o=[],a=!0,se(v.$asyncValidators,function(e,t){var n=e(i,r);if(!E(n))throw Tr("$asyncValidators","Expected asynchronous validator to return a promise but got '{0}' instead.",n);l(t,ie),o.push(n.then(function(){l(t,!0)},function(e){l(t,a=!1)}))}),o.length?u.all(o).then(function(){e(a)},ae):e(!0)):e(!1)):e(!1);function l(e,t){n===$&&v.$setValidity(e,t)}function e(e){n===$&&t(e)}},this.$commitViewValue=function(){var e=v.$viewValue;l.cancel(m),(v.$$lastCommittedViewValue!==e||""===e&&v.$$hasNativeValidators)&&(v.$$lastCommittedViewValue=e,v.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){var t=v.$$lastCommittedViewValue;if(h=!M(t)||ie)for(var e=0;e<v.$parsers.length;e++)if(M(t=v.$parsers[e](t))){h=!1;break}b(v.$modelValue)&&isNaN(v.$modelValue)&&(v.$modelValue=p(s));var n=v.$modelValue,i=v.$options&&v.$options.allowInvalid;function r(){v.$modelValue!==n&&v.$$writeModelToScope()}v.$$rawModelValue=t,i&&(v.$modelValue=t,r()),v.$$runValidators(t,v.$$lastCommittedViewValue,function(e){i||(v.$modelValue=e?t:ie,r())})},this.$$writeModelToScope=function(){g(s,v.$modelValue),se(v.$viewChangeListeners,function(e){try{e()}catch(e){t(e)}})},this.$setViewValue=function(e,t){v.$viewValue=e,v.$options&&!v.$options.updateOnDefault||v.$$debounceViewValueCommit(t)},this.$$debounceViewValueCommit=function(e){var t,n=0,i=v.$options;i&&G(i.debounce)&&(b(t=i.debounce)?n=t:b(t[e])?n=t[e]:b(t.default)&&(n=t.default)),l.cancel(m),n?m=l(function(){v.$commitViewValue()},n):c.$$phase?v.$commitViewValue():s.$apply(function(){v.$commitViewValue()})},s.$watch(function(){var e=p(s);if(e!==v.$modelValue&&(v.$modelValue==v.$modelValue||e==e)){v.$modelValue=v.$$rawModelValue=e,h=ie;for(var t=v.$formatters,n=t.length,i=e;n--;)i=t[n](i);v.$viewValue!==i&&(v.$viewValue=v.$$lastCommittedViewValue=i,v.$render(),v.$$runValidators(e,i,ae))}return e})}],Ir=["$rootScope",function(s){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Pr,priority:1,compile:function(e){return e.addClass(Er).addClass(_r).addClass(kr),{pre:function(e,t,n,i){var r=i[0],s=i[1]||Di;r.$$setOptions(i[2]&&i[2].$options),s.$addControl(r),n.$observe("name",function(e){r.$name!==e&&s.$$renameControl(r,e)}),e.$on("$destroy",function(){s.$removeControl(r)})},post:function(t,e,n,i){var r=i[0];r.$options&&r.$options.updateOn&&e.on(r.$options.updateOn,function(e){r.$$debounceViewValueCommit(e&&e.type)}),e.on("blur",function(e){r.$touched||(s.$$phase?t.$evalAsync(r.$setTouched):t.$apply(r.$setTouched))})}}}}}],Or=/(\s+|^)default(\s+|$)/,Fr=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var n=this;this.$options=e.$eval(t.ngModelOptions),this.$options.updateOn!==ie?(this.$options.updateOnDefault=!1,this.$options.updateOn=fe(this.$options.updateOn.replace(Or,function(){return n.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}};function Dr(e){var r=e.ctrl,n=e.$element,i={},s=e.set,o=e.unset,a=e.parentForm,l=e.$animate;function c(e,t){t&&!i[e]?(l.addClass(n,e),i[e]=!0):!t&&i[e]&&(l.removeClass(n,e),i[e]=!1)}function u(e,t){e=e?"-"+be(e,"-"):"",c(kr+e,!0===t),c(Ar+e,!1===t)}i[Ar]=!(i[kr]=n.hasClass(kr)),r.$setValidity=function(e,t,n){t===ie?function(e,t,n){r[e]||(r[e]={});s(r[e],t,n)}("$pending",e,n):function(e,t,n){r[e]&&o(r[e],t,n);Nr(r[e])&&(r[e]=ie)}("$pending",e,n);k(t)?t?(o(r.$error,e,n),s(r.$$success,e,n)):(s(r.$error,e,n),o(r.$$success,e,n)):(o(r.$error,e,n),o(r.$$success,e,n));r.$pending?(c(Mr,!0),r.$valid=r.$invalid=ie,u("",null)):(c(Mr,!1),r.$valid=Nr(r.$error),r.$invalid=!r.$valid,u("",r.$valid));var i;i=r.$pending&&r.$pending[e]?ie:!r.$error[e]&&(!!r.$$success[e]||null);u(e,i),a.$setValidity(e,i,r)}}function Nr(e){if(e)for(var t in e)return!1;return!0}var jr,Br=Ii({terminal:!0,priority:1e3}),Hr=["$locale","$interpolate",function(p,g){var m=/{}/g,v=/^when(Minus)?(.+)$/;return{restrict:"EA",link:function(i,r,s){var o,e=s.count,t=s.$attr.when&&r.attr(s.$attr.when),a=s.offset||0,l=i.$eval(t)||{},c={},n=g.startSymbol(),u=g.endSymbol(),h=n+e+"-"+a+u,d=y.noop;function f(e){r.text(e||"")}se(s,function(e,t){var n=v.exec(t);if(n){var i=(n[1]?"-":"")+O(n[2]);l[i]=r.attr(s.$attr[t])}}),se(l,function(e,t){c[t]=g(e.replace(m,h))}),i.$watch(e,function(e){var t=parseFloat(e),n=isNaN(t);n||t in l||(t=p.pluralCat(t-a)),t===o||n&&isNaN(o)||(d(),d=i.$watch(c[t],f),o=t)})}}}],Ur=["$parse","$animate",function(l,L){var M="$$NG_REMOVED",T=w("ngRepeat"),P=function(e,t,n,i,r,s,o){e[n]=i,r&&(e[r]=s),e.$index=t,e.$first=0===t,e.$last=t===o-1,e.$middle=!(e.$first||e.$last),e.$odd=!(e.$even=0==(1&t))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(e,t){var S=t.ngRepeat,C=ne.createComment(" end ngRepeat: "+S+" "),n=S.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!n)throw T("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",S);var i=n[1],r=n[2],x=n[3],s=n[4];if(!(n=i.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/)))throw T("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",i);var o,k,A,E,R=n[3]||n[1],_=n[2];if(x&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(x)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(x)))throw T("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",x);var a={$id:$t};return s?o=l(s):(A=function(e,t){return $t(t)},E=function(e){return e}),function($,b,e,t,w){o&&(k=function(e,t,n){return _&&(a[_]=e),a[R]=t,a.$index=n,o($,a)});var y=Ae();$.$watchCollection(r,function(e){var i,t,n,r,s,o,a,l,c,u,h,d,f,p=b[0],g=Ae();if(x&&($[x]=e),I(e))c=e,l=k||A;else{for(var m in l=k||E,c=[],e)e.hasOwnProperty(m)&&"$"!=m.charAt(0)&&c.push(m);c.sort()}for(r=c.length,h=new Array(r),i=0;i<r;i++)if(s=e===c?i:c[i],o=e[s],a=l(s,o,i),y[a])u=y[a],delete y[a],g[a]=u,h[i]=u;else{if(g[a])throw se(h,function(e){e&&e.scope&&(y[e.id]=e)}),T("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",S,a,o);h[i]={id:a,scope:ie,clone:ie},g[a]=!0}for(var v in y){if(d=ke((u=y[v]).clone),L.leave(d),d[0].parentNode)for(i=0,t=d.length;i<t;i++)d[i][M]=!0;u.scope.$destroy()}for(i=0;i<r;i++)if(s=e===c?i:c[i],o=e[s],(u=h[i]).scope){for(n=p;(n=n.nextSibling)&&n[M];);u.clone[0]!=n&&L.move(ke(u.clone),null,re(p)),p=(f=u).clone[f.clone.length-1],P(u.scope,i,R,o,_,s,r)}else w(function(e,t){u.scope=t;var n=C.cloneNode(!1);e[e.length++]=n,L.enter(e,null,re(p)),p=n,u.clone=e,g[u.id]=u,P(u.scope,i,R,o,_,s,r)});y=g})}}}}],Wr="ng-hide",Vr="ng-hide-animate",zr=["$animate",function(i){return{restrict:"A",multiElement:!0,link:function(e,t,n){e.$watch(n.ngShow,function(e){i[e?"removeClass":"addClass"](t,Wr,{tempClasses:Vr})})}}}],qr=["$animate",function(i){return{restrict:"A",multiElement:!0,link:function(e,t,n){e.$watch(n.ngHide,function(e){i[e?"addClass":"removeClass"](t,Wr,{tempClasses:Vr})})}}}],Kr=Ii(function(e,n,t){e.$watch(t.ngStyle,function(e,t){t&&e!==t&&se(t,function(e,t){n.css(t,"")}),e&&n.css(e)},!0)}),Gr=["$animate",function(u){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(e,t,n,r){var i=n.ngSwitch||n.on,s=[],o=[],a=[],l=[],c=function(e,t){return function(){e.splice(t,1)}};e.$watch(i,function(e){var t,n;for(t=0,n=a.length;t<n;++t)u.cancel(a[t]);for(t=a.length=0,n=l.length;t<n;++t){var i=ke(o[t].clone);l[t].$destroy(),(a[t]=u.leave(i)).then(c(a,t))}o.length=0,l.length=0,(s=r.cases["!"+e]||r.cases["?"])&&se(s,function(r){r.transclude(function(e,t){l.push(t);var n=r.element;e[e.length++]=ne.createComment(" end ngSwitchWhen: ");var i={clone:e};o.push(i),u.enter(e,n.parent(),n)})})})}}}],Qr=Ii({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,i,r){i.cases["!"+n.ngSwitchWhen]=i.cases["!"+n.ngSwitchWhen]||[],i.cases["!"+n.ngSwitchWhen].push({transclude:r,element:t})}}),Jr=Ii({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,i,r){i.cases["?"]=i.cases["?"]||[],i.cases["?"].push({transclude:r,element:t})}}),Yr=Ii({restrict:"EAC",link:function(e,t,n,i,r){if(!r)throw w("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",$e(t));r(function(e){t.empty(),t.append(e)})}}),Xr=["$templateCache",function(r){return{restrict:"E",terminal:!0,compile:function(e,t){if("text/ng-template"==t.type){var n=t.id,i=e[0].text;r.put(n,i)}}}}],Zr=w("ngOptions"),es=$({restrict:"A",terminal:!0}),ts=["$compile","$parse",function(b,w){var y=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,a={$setViewValue:ae};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(n,e,t){var i,r=this,s={},o=a;r.databound=t.ngModel,r.init=function(e,t,n){o=e,t,i=n},r.addOption=function(e,t){Ce(e,'"option value"'),s[e]=!0,o.$viewValue==e&&(n.val(e),i.parent()&&i.remove()),t&&t[0].hasAttribute("selected")&&(t[0].selected=!0)},r.removeOption=function(e){this.hasOption(e)&&(delete s[e],o.$viewValue===e&&this.renderUnknownOption(e))},r.renderUnknownOption=function(e){var t="? "+$t(e)+" ?";i.val(t),n.prepend(i),n.val(t),i.prop("selected",!0)},r.hasOption=function(e){return s.hasOwnProperty(e)},e.$on("$destroy",function(){r.renderUnknownOption=ae})}],link:function(e,t,n,i){if(i[1]){for(var r,s,o,a,l,c,u,h,d,B=i[0],f=i[1],H=n.multiple,p=n.ngOptions,U=!1,W=!1,V=re(ne.createElement("option")),z=re(ne.createElement("optgroup")),g=V.clone(),m=0,v=t.children(),$=v.length;m<$;m++)if(""===v[m].value){r=U=v.eq(m);break}B.init(f,U,g),H&&(f.$isEmpty=function(e){return!e||0===e.length}),p?function(k,A,E){var e;if(!(e=p.match(y)))throw Zr("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",p,$e(A));var R=w(e[2]||e[1]),i=e[4]||e[6],t=/ as /.test(e[0])&&e[1],_=t?w(t):null,L=e[5],M=w(e[3]||""),T=w(e[2]?e[1]:i),P=w(e[7]),I=e[8]?w(e[8]):null,O={},F=[[{element:A,label:""}]],D={};U&&(b(U)(k),U.removeClass("ng-scope"),U.remove());A.empty(),A.on("change",function(){k.$apply(function(){var t,n=P(k)||[];if(H)t=[],se(A.val(),function(e){e=I?O[e]:e,t.push(r(e,n[e]))});else{var e=I?O[A.val()]:A.val();t=r(e,n[e])}E.$setViewValue(t),s()})}),E.$render=s,k.$watchCollection(P,n),k.$watchCollection(function(){var e,t=P(k);if(t&&ue(t)){e=new Array(t.length);for(var n=0,i=t.length;n<i;n++)e[n]=N(R,n,t[n]);return e}if(t)for(var r in e={},t)t.hasOwnProperty(r)&&(e[r]=N(R,r,t[r]));return e},n),H&&k.$watchCollection(function(){return E.$modelValue},n);function N(e,t,n){return D[i]=n,L&&(D[L]=t),e(k,D)}function r(e,t){if("?"===e)return ie;if(""===e)return null;var n=_||T;return N(n,e,t)}function n(){W||(k.$$postDigest(s),W=!0)}function j(e,t,n){e[t]=e[t]||0,e[t]+=n?1:-1}function s(){W=!1;var e,t,n,i,r,s,o,a,l,c,u,h,d,f,p,g,m,v={"":[]},$=[""],b=E.$viewValue,w=P(k)||[],y=L?K(w):w,S={},C=function(i){var r;if(H)if(I&&ue(i)){r=new bt([]);for(var e=0;e<i.length;e++)r.put(N(I,null,i[e]),!0)}else r=new bt(i);else I&&(i=N(I,null,i));return function(e,t){var n;return n=I||(_||T),H?G(r.remove(N(n,e,t))):i===N(n,e,t)}}(b),x=!1;for(O={},h=0;c=y.length,h<c;h++)o=h,L&&"$"===(o=y[h]).charAt(0)||(a=w[o],e=N(M,o,a)||"",(t=v[e])||(t=v[e]=[],$.push(e)),d=C(o,a),x=x||d,g=G(g=N(R,o,a))?g:"",m=I?I(k,D):L?y[h]:h,I&&(O[m]=o),t.push({id:m,label:g,selected:d}));for(H||(U||null===b?v[""].unshift({id:"",label:"",selected:!x}):x||v[""].unshift({id:"?",label:"",selected:!0})),u=0,l=$.length;u<l;u++){for(e=$[u],t=v[e],F.length<=u?(i={element:z.clone().attr("label",e),label:t.label},r=[i],F.push(r),A.append(i.element)):(r=F[u],(i=r[0]).label!=e&&i.element.attr("label",i.label=e)),f=null,h=0,c=t.length;h<c;h++)n=t[h],(s=r[h+1])?(f=s.element,s.label!==n.label&&(j(S,s.label,!1),j(S,n.label,!0),f.text(s.label=n.label),f.prop("label",s.label)),s.id!==n.id&&f.val(s.id=n.id),f[0].selected!==n.selected&&(f.prop("selected",s.selected=n.selected),q&&f.prop("selected",s.selected))):(""===n.id&&U?p=U:(p=V.clone()).val(n.id).prop("selected",n.selected).attr("selected",n.selected).prop("label",n.label).text(n.label),r.push(s={element:p,label:n.label,id:n.id,selected:n.selected}),j(S,n.label,!0),f?f.after(p):i.element.append(p),f=p);for(h++;r.length>h;)n=r.pop(),j(S,n.label,!1),n.element.remove()}for(;F.length>u;){for(t=F.pop(),h=1;h<t.length;++h)j(S,t[h].label,!1);t[0].element.remove()}se(S,function(e,t){0<e?B.addOption(t):e<0&&B.removeOption(t)})}}(e,t,f):H?(c=e,u=t,(h=f).$render=function(){var t=new bt(h.$viewValue);se(u.find("option"),function(e){e.selected=G(t.get(e.value))})},c.$watch(function(){me(d,h.$viewValue)||(d=T(h.$viewValue),h.$render())}),u.on("change",function(){c.$apply(function(){var t=[];se(u.find("option"),function(e){e.selected&&t.push(e.value)}),h.$setViewValue(t)})})):(s=e,o=t,l=B,(a=f).$render=function(){var e=a.$viewValue;l.hasOption(e)?(g.parent()&&g.remove(),o.val(e),""===e&&r.prop("selected",!0)):null==e&&r?o.val(""):l.renderUnknownOption(e)},o.on("change",function(){s.$apply(function(){g.parent()&&g.remove(),a.$setViewValue(o.val())})}))}}}}],ns=["$interpolate",function(n){var a={addOption:ae,removeOption:ae};return{restrict:"E",priority:100,compile:function(e,t){if(M(t.value)){var o=n(e.text(),!0);o||t.$set("value",e.text())}return function(e,n,i){var t="$selectController",r=n.parent(),s=r.data(t)||r.parent().data(t);s&&s.databound||(s=a),o?e.$watch(o,function(e,t){i.$set("value",e),t!==e&&s.removeOption(t),s.addOption(e,n)}):s.addOption(i.value,n),n.on("$destroy",function(){s.removeOption(i.value)})}}}}],is=$({restrict:"E",terminal:!1}),rs=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){i&&(n.required=!0,i.$validators.required=function(e,t){return!n.required||!i.$isEmpty(t)},n.$observe("required",function(){i.$validate()}))}}},ss=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var r,s=n.ngPattern||n.pattern;n.$observe("pattern",function(e){if(ce(e)&&0<e.length&&(e=new RegExp("^"+e+"$")),e&&!e.test)throw w("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",s,e,$e(t));r=e||ie,i.$validate()}),i.$validators.pattern=function(e,t){return i.$isEmpty(t)||M(r)||r.test(t)}}}}},os=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var r=-1;n.$observe("maxlength",function(e){var t=f(e);r=isNaN(t)?-1:t,i.$validate()}),i.$validators.maxlength=function(e,t){return r<0||i.$isEmpty(t)||t.length<=r}}}}},as=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var r=0;n.$observe("minlength",function(e){r=f(e)||0,i.$validate()}),i.$validators.minlength=function(e,t){return i.$isEmpty(t)||t.length>=r}}}}};c.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(te||((g=c.jQuery)&&g.fn.on?(F((re=g).fn,{scope:dt.scope,isolateScope:dt.isolateScope,controller:dt.controller,injector:dt.injector,inheritedData:dt.inheritedData}),jr=g.cleanData,g.cleanData=function(e){var t;if(we)we=!1;else for(var n,i=0;null!=(n=e[i]);i++)(t=g._data(n,"events"))&&t.$destroy&&g(n).triggerHandler("$destroy");jr(e)}):re=Ye,y.element=re,te=!0),function(e){F(e,{bootstrap:Y,copy:L,extend:F,equals:me,element:re,forEach:se,injector:kt,noop:ae,bind:N,toJson:j,fromJson:B,identity:v,isUndefined:M,isDefined:G,isString:ce,isFunction:he,isObject:le,isNumber:b,isElement:_,isArray:ue,version:Pe,isDate:S,lowercase:O,uppercase:l,callbacks:{counter:0},getTestability:Z,$$minErr:w,$$csp:P,reloadWithDebugInfo:X}),p=function(e){var c=w("$injector"),n=w("ng");function t(e,t,n){return e[t]||(e[t]=n())}var i=t(e,"angular",Object);return i.$$minErr=i.$$minErr||w,t(i,"module",function(){var e={};return function(o,a,l){return function(e,t){if("hasOwnProperty"===e)throw n("badname","hasOwnProperty is not a valid {0} name",t)}(o,"module"),a&&e.hasOwnProperty(o)&&(e[o]=null),t(e,o,function(){if(!a)throw c("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",o);var r=[],e=[],t=[],n=i("$injector","invoke","push",e),s={_invokeQueue:r,_configBlocks:e,_runBlocks:t,requires:a,name:o,provider:i("$provide","provider"),factory:i("$provide","factory"),service:i("$provide","service"),value:i("$provide","value"),constant:i("$provide","constant","unshift"),animation:i("$animateProvider","register"),filter:i("$filterProvider","register"),controller:i("$controllerProvider","register"),directive:i("$compileProvider","directive"),config:n,run:function(e){return t.push(e),this}};return l&&n(l),s;function i(e,t,n,i){return i||(i=r),function(){return i[n||"push"]([e,t,arguments]),s}}})}})}(c);try{p("ngLocale")}catch(e){p("ngLocale",[]).provider("$locale",an)}p("ng",["ngLocale"],["$provide",function(e){e.provider({$$sanitizeUri:Yn}),e.provider("$compile",Ot).directive({a:Oi,input:sr,textarea:sr,form:Hi,script:Xr,select:ts,style:is,option:ns,ngBind:lr,ngBindHtml:ur,ngBindTemplate:cr,ngClass:fr,ngClassEven:gr,ngClassOdd:pr,ngCloak:mr,ngController:vr,ngForm:Ui,ngHide:qr,ngIf:wr,ngInclude:yr,ngInit:Cr,ngNonBindable:Br,ngPluralize:Hr,ngRepeat:Ur,ngShow:zr,ngStyle:Kr,ngSwitch:Gr,ngSwitchWhen:Qr,ngSwitchDefault:Jr,ngOptions:es,ngTransclude:Yr,ngModel:Ir,ngList:xr,ngChange:hr,pattern:ss,ngPattern:ss,required:rs,ngRequired:rs,minlength:as,ngMinlength:as,maxlength:os,ngMaxlength:os,ngValue:ar,ngModelOptions:Fr}).directive({ngInclude:Sr}).directive(Fi).directive($r),e.provider({$anchorScroll:At,$animate:Rt,$browser:Mt,$cacheFactory:Tt,$controller:Ht,$document:Ut,$exceptionHandler:Wt,$filter:di,$interpolate:sn,$interval:on,$http:en,$httpBackend:nn,$location:Cn,$log:xn,$parse:zn,$rootScope:Jn,$q:qn,$$q:Kn,$sce:ni,$sceDelegate:ti,$sniffer:ii,$templateCache:Pt,$templateRequest:ri,$$testability:si,$timeout:oi,$window:hi,$$rAF:Qn,$$asyncCallback:_t,$$jqLite:vt})}])}(y),re(ne).ready(function(){J(ne,Y)}))}(window,document),!window.angular.$$csp()&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}</style>'),define("angular",function(e){return function(){return e.angular}}(this)),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,P,I){var O,F=P.isDefined,d=P.isFunction,D=P.isString,N=P.isObject,j=P.isArray,B=P.forEach,H=P.extend,U=P.copy,p=P.toJson;function W(e,t){return H(new(H(function(){},{prototype:e})),t)}function y(n){return B(arguments,function(e){e!==n&&B(e,function(e,t){n.hasOwnProperty(t)||(n[t]=e)})}),n}function V(e){if(Object.keys)return Object.keys(e);var n=[];return B(e,function(e,t){n.push(t)}),n}function z(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var n=e.length>>>0,i=Number(arguments[2])||0;for((i=i<0?Math.ceil(i):Math.floor(i))<0&&(i+=n);i<n;i++)if(i in e&&e[i]===t)return i;return-1}function q(e,t,n,i){var r,s=function(e,t){var n=[];for(var i in e.path){if(e.path[i]!==t.path[i])break;n.push(e.path[i])}return n}(n,i),o={},a=[];for(var l in s)if(s[l]&&s[l].params&&(r=V(s[l].params)).length)for(var c in r)0<=z(a,r[c])||(a.push(r[c]),o[r[c]]=e[r[c]]);return H({},o,t)}function f(e,t,n){if(!n)for(var i in n=[],e)n.push(i);for(var r=0;r<n.length;r++){var s=n[r];if(e[s]!=t[s])return!1}return!0}function K(e,t){var n={};return B(e,function(e){n[e]=t[e]}),n}function G(t){var n={},e=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return B(e,function(e){e in t&&(n[e]=t[e])}),n}function S(e){var t={},n=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var i in e)-1==z(n,i)&&(t[i]=e[i]);return t}function x(e,n){var i=j(e),r=i?[]:{};return B(e,function(e,t){n(e,t)&&(r[i?r.length:t]=e)}),r}function Q(e,n){var i=j(e)?[]:{};return B(e,function(e,t){i[t]=n(e,t)}),i}function t(v,$){var e={},a=[],b=e,w=H(v.when(e),{$$promises:e,$$values:e});this.study=function(r){if(!N(r))throw new Error("'invocables' must be an object");var p=V(r||{}),g=[],s=[],o={};function m(e){return N(e)&&e.then&&e.$$promises}return B(r,function t(e,n){if(2!==o[n]){if(s.push(n),1===o[n])throw s.splice(0,z(s,n)),new Error("Cyclic dependency: "+s.join(" -> "));if(o[n]=1,D(e))g.push(n,[function(){return $.get(e)}],a);else{var i=$.annotate(e);B(i,function(e){e!==n&&r.hasOwnProperty(e)&&t(r[e],e)}),g.push(n,e,i)}s.pop(),o[n]=2}}),r=s=o=null,function(a,e,l){if(m(a)&&l===I&&(l=e,e=a,a=null),a){if(!N(a))throw new Error("'locals' must be an object")}else a=b;if(e){if(!m(e))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else e=w;var t=v.defer(),c=t.promise,u=c.$$promises={},h=H({},a),n=1+g.length/3,i=!1;function d(){--n||(i||y(h,e.$$values),c.$$values=h,c.$$promises=c.$$promises||!0,delete c.$$inheritedValues,t.resolve(h))}function f(e){c.$$failure=e,t.reject(e)}if(F(e.$$failure))return f(e.$$failure),c;e.$$inheritedValues&&y(h,S(e.$$inheritedValues,p)),H(u,e.$$promises),e.$$values?(i=y(h,S(e.$$values,p)),c.$$inheritedValues=S(e.$$values,p),d()):(e.$$inheritedValues&&(c.$$inheritedValues=S(e.$$inheritedValues,p)),e.then(d,f));for(var r=0,s=g.length;r<s;r+=3)a.hasOwnProperty(g[r])?d():o(g[r],g[r+1],g[r+2]);function o(t,e,n){var i=v.defer(),r=0;function s(e){i.reject(e),f(e)}function o(){if(!F(c.$$failure))try{i.resolve($.invoke(e,l,h)),i.promise.then(function(e){h[t]=e,d()},s)}catch(e){s(e)}}B(n,function(t){u.hasOwnProperty(t)&&!a.hasOwnProperty(t)&&(r++,u[t].then(function(e){h[t]=e,--r||o()},s))}),r||o(),u[t]=i.promise}return c}},this.resolve=function(e,t,n,i){return this.study(e)(t,n,i)}}function n(n,i,r){this.fromConfig=function(e,t,n){return F(e.template)?this.fromString(e.template,t):F(e.templateUrl)?this.fromUrl(e.templateUrl,t):F(e.templateProvider)?this.fromProvider(e.templateProvider,t,n):null},this.fromString=function(e,t){return d(e)?e(t):e},this.fromUrl=function(e,t){return d(e)&&(e=e(t)),null==e?null:n.get(e,{cache:i,headers:{Accept:"text/html"}}).then(function(e){return e.data})},this.fromProvider=function(e,t,n){return r.invoke(e,null,n||{params:t})}}function c(a,l,e){l=H({params:{}},N(l)?l:{});var t,n,i,r,s=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,o=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,c="^",u=0,h=this.segments=[],d=e?e.params:{},f=this.params=e?e.params.$$new():new O.ParamSet,p=[];function g(e,t,n,i){if(p.push(e),d[e])return d[e];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(e))throw new Error("Invalid parameter name '"+e+"' in pattern '"+a+"'");if(f[e])throw new Error("Duplicate parameter name '"+e+"' in pattern '"+a+"'");return f[e]=new O.Param(e,t,n,i),f[e]}function m(e,t,n,i){var r=["",""],s=e.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!t)return s;switch(n){case!1:r=["(",")"+(i?"?":"")];break;case!0:s=s.replace(/\/$/,""),r=["(?:/(",")|/)?"];break;default:r=["("+n+"|",")?"]}return s+r[0]+t+r[1]}function v(e,t){var n,i,r,s,o;return n=e[2]||e[3],o=l.params[n],r=a.substring(u,e.index),(i=t?e[4]:e[4]||("*"==e[1]?".*":null))&&(s=O.type(i)||W(O.type("string"),{pattern:new RegExp(i,l.caseInsensitive?"i":I)})),{id:n,regexp:i,segment:r,type:s,cfg:o}}for(this.source=a;(t=s.exec(a))&&!(0<=(n=v(t,!1)).segment.indexOf("?"));)i=g(n.id,n.type,n.cfg,"path"),c+=m(n.segment,i.type.pattern.source,i.squash,i.isOptional),h.push(n.segment),u=s.lastIndex;var $=(r=a.substring(u)).indexOf("?");if(0<=$){var b=this.sourceSearch=r.substring($);if(r=r.substring(0,$),this.sourcePath=a.substring(0,u+$),0<b.length)for(u=0;t=o.exec(b);)i=g((n=v(t,!0)).id,n.type,n.cfg,"search"),u=s.lastIndex}else this.sourcePath=a,this.sourceSearch="";c+=m(r)+(!1===l.strict?"/?":"")+"$",h.push(r),this.regexp=new RegExp(c,l.caseInsensitive?"i":I),this.prefix=h[0],this.$$paramNames=p}function k(e){H(this,e)}function i(f,a){var l,c=[],p=null,g=!1;function u(e,t,n){if(!n)return!1;var i=e.invoke(t,t,{$match:n});return!F(i)||i}function e(u,e,r,t,h){var s,d=t.baseHref(),n=u.url();function i(e){if(!e||!e.defaultPrevented){s&&u.url();s=I;var t,n=c.length;for(t=0;t<n;t++)if(i(c[t]))return;p&&i(p)}function i(e){var t=e(r,u);return!!t&&(D(t)&&u.replace().url(t),!0)}}function o(){return l=l||e.$on("$locationChangeSuccess",i)}return g||o(),{sync:function(){i()},listen:function(){return o()},update:function(e){e?n=u.url():u.url()!==n&&(u.url(n),u.replace())},push:function(e,t,n){var i=e.format(t||{});null!==i&&t&&t["#"]&&(i+="#"+t["#"]),u.url(i),s=n&&n.$$avoidResync?u.url():I,n&&n.replace&&u.replace()},href:function(e,t,n){if(!e.validates(t))return null;var i=f.html5Mode();P.isObject(i)&&(i=i.enabled),i=i&&h.history;var r,s,o,a=e.format(t);if(n=n||{},i||null===a||(a="#"+f.hashPrefix()+a),null!==a&&t&&t["#"]&&(a+="#"+t["#"]),r=a,s=i,o=n.absolute,a="/"===d?r:s?d.slice(0,-1)+r:o?d.slice(1)+r:r,!n.absolute||!a)return a;var l=!i&&a?"/":"",c=u.port();return c=80===c||443===c?"":":"+c,[u.protocol(),"://",u.host(),c,l,a].join("")}}}this.rule=function(e){if(!d(e))throw new Error("'rule' must be a function");return c.push(e),this},this.otherwise=function(e){if(D(e)){var t=e;e=function(){return t}}else if(!d(e))throw new Error("'rule' must be a function");return p=e,this},this.when=function(e,t){var r,s=D(t);if(D(e)&&(e=a.compile(e)),!s&&!d(t)&&!j(t))throw new Error("invalid 'handler' in when()");var n={matcher:function(n,i){return s&&(r=a.compile(i),i=["$match",function(e){return r.format(e)}]),H(function(e,t){return u(e,i,n.exec(t.path(),t.search()))},{prefix:D(n.prefix)?n.prefix:""})},regex:function(n,i){if(n.global||n.sticky)throw new Error("when() RegExp must not be global or sticky");return s&&(r=i,i=["$match",function(e){return n=e,r.replace(/\$(\$|\d{1,2})/,function(e,t){return n["$"===t?0:Number(t)]});var n}]),H(function(e,t){return u(e,i,n.exec(t.path()))},{prefix:(e=n,t=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(e.source),null!=t?t[1].replace(/\\(.)/g,"$1"):"")});var e,t}},i={matcher:a.isMatcher(e),regex:e instanceof RegExp};for(var o in i)if(i[o])return this.rule(n[o](e,t));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(e){e===I&&(e=!0),g=e},(this.$get=e).$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function r(o,i){var _,L,h={},a={},M="abstract",l={parent:function(e){if(F(e.parent)&&e.parent)return T(e.parent);var t=/^(.+)\.[^.]+$/.exec(e.name);return t?T(t[1]):_},data:function(e){return e.parent&&e.parent.data&&(e.data=e.self.data=W(e.parent.data,e.data)),e.data},url:function(e){var t=e.url,n={params:e.params||{}};if(D(t))return"^"==t.charAt(0)?i.compile(t.substring(1),n):(e.parent.navigable||_).url.concat(t,n);if(!t||i.isMatcher(t))return t;throw new Error("Invalid url '"+t+"' in state '"+e+"'")},navigable:function(e){return e.url?e:e.parent?e.parent.navigable:null},ownParams:function(e){var n=e.url&&e.url.params||new O.ParamSet;return B(e.params||{},function(e,t){n[t]||(n[t]=new O.Param(t,null,e,"config"))}),n},params:function(e){var t=G(e.ownParams,e.ownParams.$$keys());return e.parent&&e.parent.params?H(e.parent.params.$$new(),t):new O.ParamSet},views:function(n){var i={};return B(F(n.views)?n.views:{"":n},function(e,t){t.indexOf("@")<0&&(t+="@"+n.parent.name),i[t]=e}),i},path:function(e){return e.parent?e.parent.path.concat(e):[]},includes:function(e){var t=e.parent?H({},e.parent.includes):{};return t[e.name]=!0,t},$delegates:{}};function T(e,t){if(!e)return I;var n,i=D(e),r=i?e:e.name;if(0===(n=r).indexOf(".")||0===n.indexOf("^")){if(!t)throw new Error("No reference point given for path '"+r+"'");t=T(t);for(var s=r.split("."),o=0,a=s.length,l=t;o<a;o++)if(""!==s[o]||0!==o){if("^"!==s[o])break;if(!l.parent)throw new Error("Path '"+r+"' not valid for state '"+t.name+"'");l=l.parent}else l=t;s=s.slice(o).join("."),r=l.name+(l.name&&s?".":"")+s}var c=h[r];return!c||!i&&(i||c!==e&&c.self!==e)?I:c}function c(n){var e=(n=W(n,{self:n,resolve:n.resolve||{},toString:function(){return this.name}})).name;if(!D(e)||0<=e.indexOf("@"))throw new Error("State must have a valid name");if(h.hasOwnProperty(e))throw new Error("State '"+e+"' is already defined");var t,i,r=-1!==e.indexOf(".")?e.substring(0,e.lastIndexOf(".")):D(n.parent)?n.parent:N(n.parent)&&D(n.parent.name)?n.parent.name:"";if(r&&!h[r])return t=r,i=n.self,a[t]||(a[t]=[]),void a[t].push(i);for(var s in l)d(l[s])&&(n[s]=l[s](n,l.$delegates[s]));return!(h[e]=n)[M]&&n.url&&o.when(n.url,["$match","$stateParams",function(e,t){L.$current.navigable==n&&f(e,t)||L.transitionTo(n,e,{inherit:!0,location:!1})}]),function(e){for(var t=a[e]||[];t.length;)c(t.shift())}(e),n}function e(b,w,c,y,u,S,C,e,t){var x=w.reject(new Error("transition superseded")),k=w.reject(new Error("transition prevented")),A=w.reject(new Error("transition aborted")),E=w.reject(new Error("transition failed"));function R(s,e,t,n,o,a){var l=t?e:K(s.params.$$keys(),e),i={$stateParams:l};o.resolve=u.resolve(s.resolve,i,o.resolve,s);var r=[o.resolve.then(function(e){o.globals=e})];return n&&r.push(n),w.all(r).then(function(){var e=[];return B(s.views,function(n,i){var r=n.resolve&&n.resolve!==s.resolve?n.resolve:{};r.$template=[function(){return c.load(i,{view:n,locals:o.globals,params:l,notify:a.notify})||""}],e.push(u.resolve(r,o.globals,o.resolve,s).then(function(e){if(d(n.controllerProvider)||j(n.controllerProvider)){var t=P.extend({},r,o.globals);e.$$controller=y.invoke(n.controllerProvider,null,t)}else e.$$controller=n.controller;e.$$state=s,e.$$controllerAs=n.controllerAs,o[i]=e}))}),w.all(e).then(function(){return o.globals})}).then(function(e){return o})}return _.locals={resolve:null,globals:{$stateParams:{}}},(L={params:{},current:_.self,$current:_,transition:null,reload:function(e){return L.transitionTo(L.current,S,{reload:e||!0,inherit:!1,notify:!0})},go:function(e,t,n){return L.transitionTo(e,t,H({inherit:!0,relative:L.$current},n))}}).transitionTo=function(i,r,s){r=r||{},s=H({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},s||{});var o=L.$current,a=L.params,l=o.path,e=T(i,s.relative),t=r["#"];if(!F(e)){var n={to:i,toParams:r,options:s},c=function(e,t,n,i){var r=b.$broadcast("$stateNotFound",e,t,n);if(r.defaultPrevented)return C.update(),A;if(!r.retry)return null;if(i.$retry)return C.update(),E;var s=L.transition=w.when(r.retry);return s.then(function(){return s!==L.transition?x:(e.options.$retry=!0,L.transitionTo(e.to,e.toParams,e.options))},function(){return A}),C.update(),s}(n,o.self,a,s);if(c)return c;if(r=n.toParams,e=T(i=n.to,(s=n.options).relative),!F(e)){if(!s.relative)throw new Error("No such state '"+i+"'");throw new Error("Could not resolve '"+i+"' from state '"+s.relative+"'")}}if(e[M])throw new Error("Cannot transition to abstract state '"+i+"'");if(s.inherit&&(r=q(S,r||{},L.$current,e)),!e.params.$$validates(r))return E;r=e.params.$$values(r);var u=(i=e).path,h=0,d=u[h],f=_.locals,p=[];if(s.reload){if(D(s.reload)||N(s.reload)){if(N(s.reload)&&!s.reload.name)throw new Error("Invalid reload state object");var g=!0===s.reload?l[0]:T(s.reload);if(s.reload&&!g)throw new Error("No such reload state '"+(D(s.reload)?s.reload:s.reload.name)+"'");for(;d&&d===l[h]&&d!==g;)f=p[h]=d.locals,d=u[++h]}}else for(;d&&d===l[h]&&d.ownParams.$$equals(r,a);)f=p[h]=d.locals,d=u[++h];if(function(e,t,n,i,r,s){if(!s.reload&&e===n&&(r===n.locals||!1===e.self.reloadOnSearch&&(o=n,a=i,l=t,c=o.params.$$keys().filter(function(e){return"search"!=o.params[e].location}),u=G.apply({},[o.params].concat(c)),new O.ParamSet(u).$$equals(a,l))))return!0;var o,a,l,c,u}(i,r,o,a,f,s))return t&&(r["#"]=t),L.params=r,U(L.params,S),U(K(i.params.$$keys(),S),i.locals.globals.$stateParams),s.location&&i.navigable&&i.navigable.url&&(C.push(i.navigable.url,r,{$$avoidResync:!0,replace:"replace"===s.location}),C.update(!0)),L.transition=null,w.when(L.current);if(r=K(i.params.$$keys(),r||{}),t&&(r["#"]=t),s.notify&&b.$broadcast("$stateChangeStart",i.self,r,o.self,a,s).defaultPrevented)return b.$broadcast("$stateChangeCancel",i.self,r,o.self,a),null==L.transition&&C.update(),k;for(var m=w.when(f),v=h;v<u.length;d=u[++v])f=p[v]=W(f),m=R(d,r,d===i,m,f,s);var $=L.transition=m.then(function(){var e,t,n;if(L.transition!==$)return x;for(e=l.length-1;h<=e;e--)(n=l[e]).self.onExit&&y.invoke(n.self.onExit,n.self,n.locals.globals),n.locals=null;for(e=h;e<u.length;e++)(t=u[e]).locals=p[e],t.self.onEnter&&y.invoke(t.self.onEnter,t.self,t.locals.globals);return L.transition!==$?x:(L.$current=i,L.current=i.self,L.params=r,U(L.params,S),L.transition=null,s.location&&i.navigable&&C.push(i.navigable.url,i.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===s.location}),s.notify&&b.$broadcast("$stateChangeSuccess",i.self,r,o.self,a),C.update(!0),L.current)},function(e){return L.transition!==$?x:(L.transition=null,b.$broadcast("$stateChangeError",i.self,r,o.self,a,e).defaultPrevented||C.update(),w.reject(e))});return $},L.is=function(e,t,n){var i=T(e,(n=H({relative:L.$current},n||{})).relative);return F(i)?L.$current===i&&(!t||f(i.params.$$values(t),S)):I},L.includes=function(e,t,n){if(n=H({relative:L.$current},n||{}),D(e)&&-1<e.indexOf("*")){if(!function(e){for(var t=e.split("."),n=L.$current.name.split("."),i=0,r=t.length;i<r;i++)"*"===t[i]&&(n[i]="*");return"**"===t[0]&&(n=n.slice(z(n,t[1]))).unshift("**"),"**"===t[t.length-1]&&(n.splice(z(n,t[t.length-2])+1,Number.MAX_VALUE),n.push("**")),t.length==n.length&&n.join("")===t.join("")}(e))return!1;e=L.$current.name}var i=T(e,n.relative);return F(i)?!!F(L.$current.includes[i.name])&&(!t||f(i.params.$$values(t),S,V(t))):I},L.href=function(e,t,n){var i=T(e,(n=H({lossy:!0,inherit:!0,absolute:!1,relative:L.$current},n||{})).relative);if(!F(i))return null;n.inherit&&(t=q(S,t||{},L.$current,i));var r=i&&n.lossy?i.navigable:i;return r&&r.url!==I&&null!==r.url?C.href(r.url,K(i.params.$$keys().concat("#"),t||{}),{absolute:n.absolute}):null},L.get=function(e,t){if(0===arguments.length)return Q(V(h),function(e){return h[e].self});var n=T(e,t||L.$current);return n&&n.self?n.self:null},L}(_=c({name:"",url:"^",views:null,abstract:!0})).navigable=null,this.decorator=function(e,t){if(D(e)&&!F(t))return l[e];if(!d(t)||!D(e))return this;l[e]&&!l.$delegates[e]&&(l.$delegates[e]=l[e]);return l[e]=t,this},this.state=function(e,t){N(e)?t=e:t.name=e;return c(t),this},(this.$get=e).$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function s(){function e(e,i){return{load:function(e,t){var n;return(t=H({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},t)).view&&(n=i.fromConfig(t.view,t.params,t.locals)),n}}}(this.$get=e).$inject=["$rootScope","$templateFactory"]}P.module("ui.router.util",["ng"]),P.module("ui.router.router",["ui.router.util"]),P.module("ui.router.state",["ui.router.router","ui.router.util"]),P.module("ui.router",["ui.router.state"]),P.module("ui.router.compat",["ui.router"]),t.$inject=["$q","$injector"],P.module("ui.router.util").service("$resolve",t),n.$inject=["$http","$templateCache","$injector"],P.module("ui.router.util").service("$templateFactory",n),c.prototype.concat=function(e,t){var n={caseInsensitive:O.caseInsensitive(),strict:O.strictMode(),squash:O.defaultSquashPolicy()};return new c(this.sourcePath+e+this.sourceSearch,H(n,t),this)},c.prototype.toString=function(){return this.source},c.prototype.exec=function(e,t){var n=this.regexp.exec(e);if(!n)return null;t=t||{};var i,r,s,o,a,l=this.parameters(),c=l.length,u=this.segments.length-1,h={};if(u!==n.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");function d(e){function t(e){return e.split("").reverse().join("")}return Q(Q(t(e).split(/-(?!\\)/),t),function(e){return e.replace(/\\-/g,"-")}).reverse()}for(i=0;i<u;i++){for(s=l[i],o=this.params[s],a=n[i+1],r=0;r<o.replace.length;r++)o.replace[r].from===a&&(a=o.replace[r].to);a&&!0===o.array&&(a=d(a)),F(a)&&(a=o.type.decode(a)),h[s]=o.value(a)}for(;i<c;i++){for(h[s=l[i]]=this.params[s].value(t[s]),o=this.params[s],a=t[s],r=0;r<o.replace.length;r++)o.replace[r].from===a&&(a=o.replace[r].to);F(a)&&(a=o.type.decode(a)),h[s]=o.value(a)}return h},c.prototype.parameters=function(e){return F(e)?this.params[e]||null:this.$$paramNames},c.prototype.validates=function(e){return this.params.$$validates(e)},c.prototype.format=function(e){e=e||{};var t=this.segments,n=this.parameters(),i=this.params;if(!this.validates(e))return null;var r,s=!1,o=t.length-1,a=n.length,l=t[0];function c(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})}for(r=0;r<a;r++){var u=r<o,h=n[r],d=i[h],f=d.value(e[h]),p=d.isOptional&&d.type.equals(d.value(),f),g=!!p&&d.squash,m=d.type.encode(f);if(u){var v=t[r+1],$=r+1===o;if(!1===g)null!=m&&(j(m)?l+=Q(m,c).join("-"):l+=encodeURIComponent(m)),l+=v;else if(!0===g){var b=l.match(/\/$/)?/\/?(.*)/:/(.*)/;l+=v.match(b)[1]}else D(g)&&(l+=g+v);$&&!0===d.squash&&"/"===l.slice(-1)&&(l=l.slice(0,-1))}else{if(null==m||p&&!1!==g)continue;if(j(m)||(m=[m]),0===m.length)continue;l+=(s?"&":"?")+h+"="+(m=Q(m,encodeURIComponent).join("&"+h+"=")),s=!0}}return l},k.prototype.is=function(e,t){return!0},k.prototype.encode=function(e,t){return e},k.prototype.decode=function(e,t){return e},k.prototype.equals=function(e,t){return e==t},k.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},k.prototype.pattern=/.*/,k.prototype.toString=function(){return"{Type:"+this.name+"}"},k.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},k.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new function(e,r){function t(e,t){return function(){return e[t].apply(e,arguments)}}function s(e){return j(e)?e:F(e)?[e]:[]}function o(e){return!e}function n(n,i){return function(e){if(j(e)&&0===e.length)return e;var t=Q(e=s(e),n);return!0===i?0===x(t,o).length:function(e){switch(e.length){case 0:return I;case 1:return"auto"===r?e[0]:e;default:return e}}(t)}}var a;this.encode=n(t(e,"encode")),this.decode=n(t(e,"decode")),this.is=n(t(e,"is"),!0),this.equals=(a=t(e,"equals"),function(e,t){var n=s(e),i=s(t);if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++)if(!a(n[r],i[r]))return!1;return!0}),this.pattern=e.pattern,this.$normalize=n(t(e,"$normalize")),this.name=e.name,this.$arrayMode=r}(this,e)},P.module("ui.router.util").provider("$urlMatcherFactory",function e(){O=this;var n=!1,i=!0,w=!1;function t(e){return null!=e?e.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):e}var y,S={},r=!0,s=[],o={string:{encode:t,decode:function(e){return null!=e?e.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):e},is:function(e){return null==e||!F(e)||"string"==typeof e},pattern:/[^/]*/},int:{encode:t,decode:function(e){return parseInt(e,10)},is:function(e){return F(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return!0===e||!1===e},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):I},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):I},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:P.toJson,decode:P.fromJson,is:P.isObject,equals:P.equals,pattern:/[^/]*/},any:{encode:P.identity,decode:P.identity,equals:P.equals,pattern:/.*/}};function C(e){return d(e)||j(e)&&d(e[e.length-1])}function a(){for(;s.length;){var e=s.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");P.extend(S[e.name],y.invoke(e.def))}}function l(e){H(this,e||{})}e.$$getDefaultValue=function(e){if(!C(e.value))return e.value;if(!y)throw new Error("Injectable functions cannot be called at configuration time");return y.invoke(e.value)},this.caseInsensitive=function(e){return F(e)&&(n=e),n},this.strictMode=function(e){return F(e)&&(i=e),i},this.defaultSquashPolicy=function(e){if(!F(e))return w;if(!0!==e&&!1!==e&&!D(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return w=e},this.compile=function(e,t){return new c(e,H({strict:i,caseInsensitive:n},t))},this.isMatcher=function(n){if(!N(n))return!1;var i=!0;return B(c.prototype,function(e,t){d(e)&&(i=i&&F(n[t])&&d(n[t]))}),i},this.type=function(e,t,n){if(!F(t))return S[e];if(S.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return S[e]=new k(H({name:e},t)),n&&(s.push({name:e,def:n}),r||a()),this},B(o,function(e,t){S[t]=new k(H({name:t},e))}),S=W(S,{}),this.$get=["$injector",function(e){return y=e,r=!1,a(),B(o,function(e,t){S[t]||(S[t]=new k(e))}),this}],this.Param=function(i,e,r,t){var n,s,o=this;-1===z(s=N(n=r)?V(n):[],"value")&&-1===z(s,"type")&&-1===z(s,"squash")&&-1===z(s,"array")&&(n={value:n}),n.$$fn=C(n.value)?n.value:function(){return n.value},e=function(e,t,n){if(e.type&&t)throw new Error("Param '"+i+"' has two type configurations.");return t||(e.type?P.isString(e.type)?S[e.type]:e.type instanceof k?e.type:new k(e.type):"config"===n?S.any:S.string)}(r=n,e,t);var a,l,c=(a={array:"search"===t&&"auto"},l=i.match(/\[\]$/)?{array:!0}:{},H(a,l,r).array);"string"!==(e=c?e.$asArray(c,"search"===t):e).name||c||"path"!==t||r.value!==I||(r.value="");var u,h,d,f,p,g,m,v=r.value!==I,$=function(e,t){var n=e.squash;if(!t||!1===n)return!1;if(!F(n)||null==n)return w;if(!0===n||D(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}(r,v),b=(h=c,f=$,m=[{from:"",to:(d=v)||h?I:""},{from:null,to:d||h?I:""}],p=j((u=r).replace)?u.replace:[],D(f)&&p.push({from:f,to:I}),g=Q(p,function(e){return e.from}),x(m,function(e){return-1===z(g,e.from)}).concat(p));H(this,{id:i,type:e,location:t,array:c,squash:$,replace:b,isOptional:v,value:function(e){var t,n,i;return t=e,e=(i=Q(x(o.replace,(n=t,function(e){return e.from===n})),function(e){return e.to})).length?i[0]:t,F(e)?o.type.$normalize(e):function(){if(!y)throw new Error("Injectable functions cannot be called at configuration time");var e=y.invoke(r.$$fn);if(null!==e&&e!==I&&!o.type.is(e))throw new Error("Default value ("+e+") for parameter '"+o.id+"' is not an instance of Type ("+o.type.name+")");return e}()},dynamic:I,config:r,toString:function(){return"{Param:"+i+" "+e+" squash: '"+$+"' optional: "+v+"}"}})},l.prototype={$$new:function(){return W(this,H(new l,{$$parent:this}))},$$keys:function(){for(var t=[],e=[],n=this,i=V(l.prototype);n;)e.push(n),n=n.$$parent;return e.reverse(),B(e,function(e){B(V(e),function(e){-1===z(t,e)&&-1===z(i,e)&&t.push(e)})}),t},$$values:function(t){var n={},i=this;return B(i.$$keys(),function(e){n[e]=i[e].value(t&&t[e])}),n},$$equals:function(i,r){var s=!0,o=this;return B(o.$$keys(),function(e){var t=i&&i[e],n=r&&r[e];o[e].type.equals(t,n)||(s=!1)}),s},$$validates:function(e){var t,n,i,r,s,o=this.$$keys();for(t=0;t<o.length&&(n=this[o[t]],(i=e[o[t]])!==I&&null!==i||!n.isOptional);t++){if(r=n.type.$normalize(i),!n.type.is(r))return!1;if(s=n.type.encode(r),P.isString(s)&&!n.type.pattern.exec(s))return!1}return!0},$$parent:I},this.ParamSet=l}),P.module("ui.router.util").run(["$urlMatcherFactory",function(e){}]),i.$inject=["$locationProvider","$urlMatcherFactoryProvider"],P.module("ui.router.router").provider("$urlRouter",i),r.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],P.module("ui.router.state").factory("$stateParams",function(){return{}}).provider("$state",r),s.$inject=[],P.module("ui.router.state").provider("$view",s),P.module("ui.router.state").provider("$uiViewScroll",function(){var n=!1;this.useAnchorScroll=function(){n=!0},this.$get=["$anchorScroll","$timeout",function(e,t){return n?e:function(e){return t(function(){e[0].scrollIntoView()},0,!1)}}]});var b=P.version.major,w=P.version.minor;function o(g,t,m,v){var e=t.has?function(e){return t.has(e)?t.get(e):null}:function(e){try{return t.get(e)}catch(e){return null}},n=e("$animator"),$=e("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,t,p){return function(r,s,o){var a,l,c,u,h=o.onload||"",d=o.autoscroll,f=function(e,t){var i={enter:function(e,t,n){t.after(e),n()},leave:function(e,t){e.remove(),t()}};if(e.noanimation)return i;function r(e){return 1===b&&4<=w?!!$.enabled(e):1===b&&2<=w?!!$.enabled():!!n}if($)return{enter:function(e,t,n){r(e)?2<P.version.minor?$.enter(e,null,t).then(n):$.enter(e,null,t,n):i.enter(e,t,n)},leave:function(e,t){r(e)?2<P.version.minor?$.leave(e).then(t):$.leave(e,t):i.leave(e,t)}};if(n){var s=n&&n(t,e);return{enter:function(e,t,n){s.enter(e,null,t),n()},leave:function(e,t){s.leave(e),t()}}}return i}(o,r);function e(e){var t,n=C(r,o,s,v),i=n&&g.$current&&g.$current.locals[n];!e&&i===u||r._willBeDestroyed||(t=r.$new(),u=g.$current.locals[n],t.$emit("$viewContentLoading",n),l=p(t,function(e){f.enter(e,s,function(){c&&c.$emit("$viewContentAnimationEnded"),(P.isDefined(d)&&!d||r.$eval(d))&&m(e)}),function(){var e=a,t=c;function n(){e&&e.remove(),t&&t.$destroy()}t&&(t._willBeDestroyed=!0),l?(f.leave(l,function(){n(),a=null}),a=l):(n(),a=null),c=l=null}()}),(c=t).$emit("$viewContentLoaded",n),c.$eval(h))}r.$on("$stateChangeSuccess",function(){e(!1)}),e(!0)}}}}function a(c,u,h,d){return{restrict:"ECA",priority:-400,compile:function(e){var l=e.html();return function(e,t,n){var i=h.$current,r=C(e,n,t,d),s=i&&i.locals[r];if(s){t.data("$uiView",{name:r,state:s.$$state}),t.html(s.$template?s.$template:l);var o=c(t.contents());if(s.$$controller){s.$scope=e,s.$element=t;var a=u(s.$$controller,s);s.$$controllerAs&&(e[s.$$controllerAs]=a),t.data("$ngControllerController",a),t.children().data("$ngControllerController",a)}o(e)}}}}}function C(e,t,n,i){var r=i(t.uiView||t.name||"")(e),s=n.inheritedData("$uiView");return 0<=r.indexOf("@")?r:r+"@"+(s?s.state.name:"")}function g(e,t){var n,i=e.match(/^\s*({[^}]*})\s*$/);if(i&&(e=t+"("+i[1]+")"),!(n=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==n.length)throw new Error("Invalid state ref '"+e+"'");return{state:n[1],paramExpr:n[3]||null}}function m(e){var t=e.parent().inheritedData("$uiView");if(t&&t.state&&t.state.name)return t.state}function v(e){var t="[object SVGAnimatedString]"===Object.prototype.toString.call(e.prop("href")),n="FORM"===e[0].nodeName;return{attr:n?"action":t?"xlink:href":"href",isAnchor:"A"===e.prop("tagName").toUpperCase(),clickable:!n}}function $(s,o,a,l,c){return function(e){var t=e.which||e.button,n=c();if(!(1<t||e.ctrlKey||e.metaKey||e.shiftKey||s.attr("target"))){var i=a(function(){o.go(n.state,n.params,n.options)});e.preventDefault();var r=l.isAnchor&&!n.href?1:0;e.preventDefault=function(){r--<=0&&a.cancel(i)}}}}function l(u,h){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,t,n,i){var r,s=g(n.uiSref,u.current.name),o={state:s.state,href:null,params:null},a=v(t),l=i[1]||i[0];o.options=H((r=u,{relative:m(t)||r.$current,inherit:!0}),n.uiSrefOpts?e.$eval(n.uiSrefOpts):{});var c=function(e){e&&(o.params=P.copy(e)),o.href=u.href(s.state,o.params,o.options),l&&l.$$addStateInfo(s.state,o.params),null!==o.href&&n.$set(a.attr,o.href)};s.paramExpr&&(e.$watch(s.paramExpr,function(e){e!==o.params&&c(e)},!0),o.params=P.copy(e.$eval(s.paramExpr))),c(),a.clickable&&t.bind("click",$(t,u,h,a,function(){return o}))}}}function u(c,u){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,t,n,i){var r=v(t),s=i[1]||i[0],o="["+[n.uiState,n.uiStateParams||null,n.uiStateOpts||null].map(function(e){return e||"null"}).join(", ")+"]",a={state:null,params:null,options:null,href:null};function l(e){a.state=e[0],a.params=e[1],a.options=e[2],a.href=c.href(a.state,a.params,a.options),s&&s.$$addStateInfo(a.state,a.params),a.href&&n.$set(r.attr,a.href)}e.$watch(o,l,!0),l(e.$eval(o)),r.clickable&&t.bind("click",$(t,c,u,r,function(){return a}))}}}function h(f,e,t){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(s,o,e,n){var a,i,l=[],c={};a=t(e.uiSrefActiveEq||"",!1)(s);try{i=s.$eval(e.uiSrefActive)}catch(e){}function r(e,t,n){var i=f.get(e,m(o)),r=function(e,t){if(!D(e))throw new Error("state should be a string");if(N(t))return e+p(t);if(t=s.$eval(t),N(t))return e+p(t);return e}(e,t);l.push({state:i||{name:e},params:t,hash:r}),c[r]=n}function u(){for(var e=0;e<l.length;e++)i=l[e].state,r=l[e].params,f.includes(i.name,r)?h(o,c[l[e].hash]):d(o,c[l[e].hash]),t=l[e].state,n=l[e].params,f.is(t.name,n)?h(o,a):d(o,a);var t,n,i,r}function h(e,t){n(function(){e.addClass(t)})}function d(e,t){e.removeClass(t)}i=i||t(e.uiSrefActive||"",!1)(s),N(i)&&B(i,function(e,t){if(D(e)){var n=g(e,f.current.name);r(n.state,s.$eval(n.paramExpr),t)}}),this.$$addStateInfo=function(e,t){N(i)&&0<l.length||(r(e,t,i),u())},s.$on("$stateChangeSuccess",u),u()}]}}function A(n){var e=function(e,t){return n.is(e,t)};return e.$stateful=!0,e}function E(i){var e=function(e,t,n){return i.includes(e,t,n)};return e.$stateful=!0,e}o.$inject=["$state","$injector","$uiViewScroll","$interpolate"],a.$inject=["$compile","$controller","$state","$interpolate"],P.module("ui.router.state").directive("uiView",o),P.module("ui.router.state").directive("uiView",a),l.$inject=["$state","$timeout"],u.$inject=["$state","$timeout"],h.$inject=["$state","$stateParams","$interpolate"],P.module("ui.router.state").directive("uiSref",l).directive("uiSrefActive",h).directive("uiSrefActiveEq",h).directive("uiState",u),A.$inject=["$state"],E.$inject=["$state"],P.module("ui.router.state").filter("isState",A).filter("includedByState",E)}(window,window.angular),define("uiRouter",["angular"],function(){}),angular.module("ui.alias",[]).config(["$compileProvider","uiAliasConfig",function(n,e){e=e||{},angular.forEach(e,function(e,t){angular.isString(e)&&(e={replace:!0,template:e}),n.directive(t,function(){return e})})}]),angular.module("ui.event",[]).directive("uiEvent",["$parse",function(s){return function(i,r,e){var t=i.$eval(e.uiEvent);angular.forEach(t,function(e,t){var n=s(e);r.bind(t,function(e){var t=Array.prototype.slice.call(arguments);t=t.splice(1),n(i,{$event:e,$params:t}),i.$$phase||i.$apply()})})}}]),angular.module("ui.format",[]).filter("format",function(){return function(e,n){var i=e;if(angular.isString(i)&&void 0!==n)if(angular.isArray(n)||angular.isObject(n)||(n=[n]),angular.isArray(n)){var r=n.length;i=i.replace(/\$([0-9]+)/g,function(e,t){return 0<=(t=parseInt(t,10))&&t<r?n[t]:e})}else angular.forEach(n,function(e,t){i=i.split(":"+t).join(e)});return i}}),angular.module("ui.highlight",[]).filter("highlight",function(){return function(e,t,n){return t||angular.isNumber(t)?(e=e.toString(),t=t.toString(),n?e.split(t).join('<span class="ui-match">'+t+"</span>"):e.replace(new RegExp(t,"gi"),'<span class="ui-match">$&</span>')):e}}),angular.module("ui.include",[]).directive("uiInclude",["$http","$templateCache","$anchorScroll","$compile",function(d,f,p,g){return{restrict:"ECA",terminal:!0,compile:function(e,t){var l=t.uiInclude||t.src,c=t.fragment||"",u=t.onload||"",h=t.autoscroll;return function(r,s){var o,a=0,t=function(){o&&(o.$destroy(),o=null),s.html("")};function e(){var n=++a,e=r.$eval(l),i=r.$eval(c);e?d.get(e,{cache:f}).success(function(e){var t;n===a&&(o&&o.$destroy(),o=r.$new(),t=i?angular.element("<div/>").html(e).find(i):angular.element("<div/>").html(e).contents(),s.html(t),g(t)(o),!angular.isDefined(h)||h&&!r.$eval(h)||p(),o.$emit("$includeContentLoaded"),r.$eval(u))}).error(function(){n===a&&t()}):t()}r.$watch(c,e),r.$watch(l,e)}}}}]),angular.module("ui.indeterminate",[]).directive("uiIndeterminate",[function(){return{compile:function(e,t){return t.type&&"checkbox"===t.type.toLowerCase()?function(e,t,n){e.$watch(n.uiIndeterminate,function(e){t[0].indeterminate=!!e})}:angular.noop}}}]),angular.module("ui.inflector",[]).filter("inflector",function(){function t(e){return e.replace(/^([a-z])|\s+([a-z])/g,function(e){return e.toUpperCase()})}function n(e,t){return e.replace(/[A-Z]/g,function(e){return t+e})}var i={humanize:function(e){return t(n(e," ").split("_").join(" "))},underscore:function(e){return e.substr(0,1).toLowerCase()+n(e.substr(1),"_").toLowerCase().split(" ").join("_")},variable:function(e){return e=e.substr(0,1).toLowerCase()+t(e.split("_").join(" ")).substr(1).split(" ").join("")}};return function(e,t){return!1!==t&&angular.isString(e)?i[t=t||"humanize"](e):e}}),angular.module("ui.jq",[]).value("uiJqConfig",{}).directive("uiJq",["uiJqConfig","$timeout",function(n,o){return{restrict:"A",compile:function(e,t){if(!angular.isFunction(e[t.uiJq]))throw new Error('ui-jq: The "'+t.uiJq+'" function does not exist');var s=n&&n[t.uiJq];return function(e,t,n){var i=[];function r(){o(function(){t[n.uiJq].apply(t,i)},0,!1)}n.uiOptions?(i=e.$eval("["+n.uiOptions+"]"),angular.isObject(s)&&angular.isObject(i[0])&&(i[0]=angular.extend({},s,i[0]))):s&&(i=[s]),n.ngModel&&t.is("select,input,textarea")&&t.bind("change",function(){t.trigger("input")}),n.uiRefresh&&e.$watch(n.uiRefresh,function(){r()}),r()}}}}]),angular.module("ui.keypress",[]).factory("keypressHelper",["$parse",function(o){var f={8:"backspace",9:"tab",13:"enter",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete"};return function(e,d,t,n){var i,r,s=[];i=d.$eval(n["ui"+(r=e,r.charAt(0).toUpperCase()+r.slice(1))]),angular.forEach(i,function(e,t){var n,i;i=o(e),angular.forEach(t.split(" "),function(e){n={expression:i,keys:{}},angular.forEach(e.split("-"),function(e){n.keys[e]=!0}),s.push(n)})}),t.bind(e,function(o){var a=!(!o.metaKey||o.ctrlKey),l=!!o.altKey,c=!!o.ctrlKey,u=!!o.shiftKey,h=o.keyCode;"keypress"===e&&!u&&97<=h&&h<=122&&(h-=32),angular.forEach(s,function(e){var t=e.keys[f[h]]||e.keys[h.toString()],n=!!e.keys.meta,i=!!e.keys.alt,r=!!e.keys.ctrl,s=!!e.keys.shift;t&&n===a&&i===l&&r===c&&s===u&&d.$apply(function(){e.expression(d,{$event:o})})})})}}]),angular.module("ui.keypress").directive("uiKeydown",["keypressHelper",function(i){return{link:function(e,t,n){i("keydown",e,t,n)}}}]),angular.module("ui.keypress").directive("uiKeypress",["keypressHelper",function(i){return{link:function(e,t,n){i("keypress",e,t,n)}}}]),angular.module("ui.keypress").directive("uiKeyup",["keypressHelper",function(i){return{link:function(e,t,n){i("keyup",e,t,n)}}}]),angular.module("ui.mask",[]).value("uiMaskConfig",{maskDefinitions:{9:/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}}).directive("uiMask",["uiMaskConfig",function(e){return{priority:100,require:"ngModel",restrict:"A",compile:function(){var b=e;return function(x,k,o,A){var E,a,l,c,u,t,n,i,R,_,L,M,h=!1,r=!1,e=o.placeholder,s=o.maxlength;var d={};function f(){return h=!1,function(){if(!r)return;k.unbind("blur",g),k.unbind("mousedown",m),k.unbind("mouseup",m),k.unbind("input",$),k.unbind("keyup",$),k.unbind("click",$),k.unbind("focus",$),r=!1}(),angular.isDefined(e)?k.attr("placeholder",e):k.removeAttr("placeholder"),angular.isDefined(s)?k.attr("maxlength",s):k.removeAttr("maxlength"),k.val(A.$modelValue),A.$viewValue=A.$modelValue,!1}function p(e){return!e.length||e.length>=u}function T(t){var n="",i=a.slice();return t=t.toString(),angular.forEach(c,function(e){t=t.replace(e,"")}),angular.forEach(t.split(""),function(e){i.length&&i[0].test(e)&&(n+=e,i.shift())}),n}function P(n){var i="",r=E.slice();return angular.forEach(l.split(""),function(e,t){n.length&&t===r[0]?(i+=n.charAt(0)||"_",n=n.substr(1),r.shift()):i+=e}),i}function g(){M=L=0,i&&0!==t.length||(n="",k.val(""),x.$apply(function(){A.$setViewValue("")}))}function m(e){"mousedown"===e.type?k.bind("mouseout",v):k.unbind("mouseout",v)}function v(){M=O(this),k.unbind("mouseout",v)}function $(e){var t=(e=e||{}).which,n=e.type;if(16!==t&&91!==t){var i,r=k.val(),s=R,o=T(r),a=_,l=!1,c=function(e){if(!e)return 0;{if(void 0!==e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();return t.moveStart("character",-e.value.length),t.text.length}}return 0}(this)||0,u=L||0,h=c-u,d=E[0],f=E[o.length]||E.slice().shift(),p=M||0,g=0<O(this),m=0<p,v=r.length>s.length||p&&r.length>s.length-p,$=r.length<s.length||p&&r.length===s.length-p,b=37<=t&&t<=40&&e.shiftKey,w=8===t||"keyup"!==n&&$&&-1===h,y=46===t||"keyup"!==n&&$&&0===h&&!m,S=(37===t||w||"click"===n)&&d<c;if(M=O(this),!b&&(!g||"click"!==n&&"keyup"!==n)){if("input"===n&&$&&!m&&o===a){for(;w&&d<c&&!I(c);)c--;for(;y&&c<f&&-1===E.indexOf(c);)c++;var C=E.indexOf(c);o=o.substring(0,C)+o.substring(C+1),l=!0}for(i=P(o),R=i,_=o,k.val(i),l&&x.$apply(function(){A.$setViewValue(o)}),v&&c<=d&&(c=d+1),S&&c--,c=f<c?f:c<d?d:c;!I(c)&&d<c&&c<f;)c+=S?-1:1;(S&&c<f||v&&!I(u))&&c++,function(e,t){if(!e)return;if(0===e.offsetWidth||0===e.offsetHeight)return;if(e.setSelectionRange)e.focus(),e.setSelectionRange(t,t);else if(e.createTextRange){var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select()}}(this,L=c)}}}function I(e){return-1<E.indexOf(e)}function O(e){return e?void 0!==e.selectionStart?e.selectionEnd-e.selectionStart:document.selection?document.selection.createRange().text.length:0:0}o.uiOptions?(d=x.$eval("["+o.uiOptions+"]"),angular.isObject(d[0])&&(d=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]?angular.extend(t[n],e[n]):t[n]=angular.copy(e[n]));return t}(b,d[0]))):d=b,o.$observe("uiMask",function(e){return angular.isDefined(e)?(function(e){var r=0;if(E=[],a=[],l="","string"==typeof e){u=0;var s=!1,t=e.split("");angular.forEach(t,function(e,t){var n,i;d.maskDefinitions[e]?(E.push(r),l+=(n=t,void 0!==(i=o.placeholder)&&i[n]?i[n]:"_"),a.push(d.maskDefinitions[e]),r++,s||u++):"?"===e?s=!0:(l+=e,r++)})}E.push(E.slice().pop()+1),c=l.replace(/[_]+/g,"_").replace(/([^_]+)([a-zA-Z0-9])([^_])/g,"$1$2_$3").split("_"),h=1<E.length}(e),h?(function(){t=_=T(A.$modelValue||""),n=R=P(t);var e=(i=p(t))&&t.length?n:"";o.maxlength&&k.attr("maxlength",2*E[E.length-1]),k.attr("placeholder",l),k.val(e),A.$viewValue=e}(),r||(k.bind("blur",g),k.bind("mousedown mouseup",m),k.bind("input keyup click focus",$),r=!0),!0):f()):f()}),o.$observe("placeholder",function(e){angular.isDefined(e)&&(l=e,h&&$())}),A.$formatters.push(function(e){return h?(t=T(e||""),i=p(t),A.$setValidity("mask",i),i&&t.length?P(t):void 0):e}),A.$parsers.push(function(e){return h?(t=T(e||""),i=p(t),A.$viewValue=t.length?P(t):"",A.$setValidity("mask",i),""===t&&void 0!==A.$error.required&&A.$setValidity("required",!1),i?t:void 0):e}),k.bind("mousedown mouseup",m),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null===this)throw new TypeError;var t=Object(this),n=t.length>>>0;if(0===n)return-1;var i=0;if(1<arguments.length&&((i=Number(arguments[1]))!=i?i=0:0!==i&&i!==1/0&&i!==-1/0&&(i=(0<i||-1)*Math.floor(Math.abs(i)))),n<=i)return-1;for(var r=0<=i?i:Math.max(n-Math.abs(i),0);r<n;r++)if(r in t&&t[r]===e)return r;return-1})}}}}]),angular.module("ui.reset",[]).value("uiResetConfig",null).directive("uiReset",["uiResetConfig",function(e){var s=null;return void 0!==e&&(s=e),{require:"ngModel",link:function(t,e,n,i){var r;r=angular.element('<a class="ui-reset" />'),e.wrap('<span class="ui-resetwrap" />').after(r),r.bind("click",function(e){e.preventDefault(),t.$apply(function(){n.uiReset?i.$setViewValue(t.$eval(n.uiReset)):i.$setViewValue(s),i.$render()})})}}}]),angular.module("ui.route",[]).directive("uiRoute",["$location","$parse",function(l,c){return{restrict:"AC",scope:!0,compile:function(e,t){var a;if(t.uiRoute)a="uiRoute";else if(t.ngHref)a="ngHref";else{if(!t.href)throw new Error("uiRoute missing a route or href property on "+e[0]);a="href"}return function(n,e,t){var i=c(t.ngModel||t.routeModel||"$uiRoute").assign,r=angular.noop;function s(e){var t=e.indexOf("#");-1<t&&(e=e.substr(t+1)),(r=function(){i(n,-1<l.path().indexOf(e))})()}function o(t){var e=t.indexOf("#");-1<e&&(t=t.substr(e+1)),(r=function(){var e=new RegExp("^"+t+"$",["i"]);i(n,e.test(l.path()))})()}switch(a){case"uiRoute":t.uiRoute?o(t.uiRoute):t.$observe("uiRoute",o);break;case"ngHref":t.ngHref?s(t.ngHref):t.$observe("ngHref",s);break;case"href":s(t.href)}n.$on("$routeChangeSuccess",function(){r()}),n.$on("$stateChangeSuccess",function(){r()})}}}}]),angular.module("ui.scroll.jqlite",["ui.scroll"]).service("jqLiteExtras",["$log","$window",function(e,o){return{registerFor:function(n){var f,i,s,p,t,g,r;return i=angular.element.prototype.css,n.prototype.css=function(e,t){var n;if((n=this[0])&&3!==n.nodeType&&8!==n.nodeType&&n.style)return i.call(this,e,t)},g=function(e){return e&&e.document&&e.location&&e.alert&&e.setInterval},r=function(e,t,n){var i,r,s,o,a;return i=e[0],r=(a={top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[t])[0],o=a[1],s=a[2],g(i)?angular.isDefined(n)?i.scrollTo(e[s].call(e),n):o in i?i[o]:i.document.documentElement[r]:angular.isDefined(n)?i[r]=n:i[r]},o.getComputedStyle?(p=function(e){return o.getComputedStyle(e,null)},f=function(e,t){return parseFloat(t)}):(p=function(e){return e.currentStyle},f=function(e,t){var n,i,r,s,o;return new RegExp("^("+/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source+")(?!px)[a-z%]+$","i").test(t)?(n=(o=e.style).left,s=(r=e.runtimeStyle)&&r.left,r&&(r.left=o.left),o.left=t,i=o.pixelLeft,o.left=n,s&&(r.left=s),i):parseFloat(t)}),s=function(e,t){var n,i,r,s,o,a,l,c,u,h,d;return g(e)?{base:n=document.documentElement[{height:"clientHeight",width:"clientWidth"}[t]],padding:0,border:0,margin:0}:(n=(d={width:[e.offsetWidth,"Left","Right"],height:[e.offsetHeight,"Top","Bottom"]}[t])[0],l=d[1],c=d[2],a=p(e),u=f(e,a["padding"+l])||0,h=f(e,a["padding"+c])||0,i=f(e,a["border"+l+"Width"])||0,r=f(e,a["border"+c+"Width"])||0,s=a["margin"+l],o=a["margin"+c],{base:n,padding:u+h,border:i+r,margin:(f(e,s)||0)+(f(e,o)||0)})},t=function(e,t,n){var i,r;return 0<(i=s(e,t)).base?{base:i.base-i.padding-i.border,outer:i.base,outerfull:i.base+i.margin}[n]:(((r=p(e)[t])<0||null===r)&&(r=e.style[t]||0),{base:(r=parseFloat(r)||0)-i.padding-i.border,outer:r,outerfull:r+i.padding+i.border+i.margin}[n])},angular.forEach({before:function(e){var t,n,i,r,s,o;if(n=this[0],(t=(r=this.parent()).contents())[0]===n)return r.prepend(e);for(i=s=1,o=t.length-1;1<=o?s<=o:o<=s;i=1<=o?++s:--s)if(t[i]===n)return void angular.element(t[i-1]).after(e);throw new Error("invalid DOM structure "+n.outerHTML)},height:function(e){return this,angular.isDefined(e)?(angular.isNumber(e)&&(e+="px"),i.call(this,"height",e)):t(this[0],"height","base")},outerHeight:function(e){return t(this[0],"height",e?"outerfull":"outer")},offset:function(e){var t,n,i,r,s;return this,arguments.length?void 0===e?this:e:(t={top:0,left:0},(n=(r=this[0])&&r.ownerDocument)?(i=n.documentElement,r.getBoundingClientRect&&(t=r.getBoundingClientRect()),s=n.defaultView||n.parentWindow,{top:t.top+(s.pageYOffset||i.scrollTop)-(i.clientTop||0),left:t.left+(s.pageXOffset||i.scrollLeft)-(i.clientLeft||0)}):void 0)},scrollTop:function(e){return r(this,"top",e)},scrollLeft:function(e){return r(this,"left",e)}},function(e,t){if(!n.prototype[t])return n.prototype[t]=e})}}}]).run(["$log","$window","jqLiteExtras",function(e,t,n){if(!t.jQuery)return n.registerFor(angular.element)}]),angular.module("ui.scroll",[]).directive("ngScrollViewport",["$log",function(){return{controller:["$scope","$element",function(e,t){return t}]}}]).directive("ngScroll",["$log","$injector","$rootScope","$timeout",function(U,W,V,z){return{require:["?^ngScrollViewport"],transclude:"element",priority:1e3,terminal:!0,compile:function(B,e,H){return function(s,e,t,a){var l,p,o,c,u,g,h,d,f,m,n,i,v,$,r,b,w,y,S,C,x,k,A,E,R,_,L,M,T,P,I,O,F,D,N,j;if(!(E=t.ngScroll.match(/^\s*(\w+)\s+in\s+(\w+)\s*$/)))throw new Error('Expected ngScroll in form of "item_ in _datasource_" but got "'+t.ngScroll+'"');if(k=E[1],i=E[2],!(C=function(e){return angular.isObject(e)&&e.get&&angular.isFunction(e.get)})(n=s[i])&&!C(n=W.get(i)))throw new Error(i+" is not a valid datasource");return d=Math.max(3,+t.bufferSize||10),h=function(){return j.height()*Math.max(.1,+t.padding||.1)},I=function(e){return e[0].scrollHeight||e[0].document.documentElement.scrollHeight},l=null,H(D=s.$new(),function(e){var t,n,i,r,s,o;if("dl"===(r=e[0].localName))throw new Error("ng-scroll directive does not support <"+e[0].localName+"> as a repeating tag: "+e[0].outerHTML);return"li"!==r&&"tr"!==r&&(r="div"),(o=a[0]||angular.element(window)).css({"overflow-y":"auto",display:"block"}),s=(n=function(t,e,n){return e[{top:"before",bottom:"after"}[n]](t),{paddingHeight:function(){return t.paddingHeight.apply(t,arguments)},insert:function(e){return t[{top:"after",bottom:"before"}[n]](e)}}})((i=function(e){var t,n,i;switch(e){case"tr":return i=angular.element("<table><tr><td><div></div></td></tr></table>"),t=i.find("div"),(n=i.find("tr")).paddingHeight=function(){return t.height.apply(t,arguments)},n;default:return(n=angular.element("<"+e+"></"+e+">")).paddingHeight=n.height,n}})(r),B,"top"),t=n(i(r),B,"bottom"),D.$destroy(),l={viewport:o,topPadding:s.paddingHeight,bottomPadding:t.paddingHeight,append:t.insert,prepend:s.insert,bottomDataPos:function(){return I(o)-t.paddingHeight()},topDataPos:function(){return s.paddingHeight()}}}),j=l.viewport,R=y=1,g=[],c=$=!(_=[]),A=n.loading||function(){},x=!1,M=function(e,t){var n,i;for(n=i=e;e<=t?i<t:t<i;n=e<=t?++i:--i)g[n].scope.$destroy(),g[n].element.remove();return g.splice(e,t-e)},L=function(){return R=y=1,M(0,g.length),l.topPadding(0),l.bottomPadding(0),p(c=$=!(_=[]))},u=function(){return j.scrollTop()+j.height()},N=function(){return j.scrollTop()},O=function(){return!$&&l.bottomDataPos()<u()+h()},f=function(){var e,t,n,i,r,s;for(i=e=0,t=r=s=g.length-1;(s<=0?r<=0:0<=r)&&(n=g[t].element.outerHeight(!0),l.bottomDataPos()-e-n>u()+h());t=s<=0?++r:--r)e+=n,i++,$=!1;if(0<i)return l.bottomPadding(l.bottomPadding()+e),M(g.length-i,g.length),R-=i,U.log("clipped off bottom "+i+" bottom padding "+l.bottomPadding())},F=function(){return!c&&l.topDataPos()>N()-h()},m=function(){var e,t,n,i,r;for(i=t=n=0,r=g.length;i<r&&(e=g[i].element.outerHeight(!0),l.topDataPos()+n+e<N()-h());i++)n+=e,t++,c=!1;if(0<t)return l.topPadding(l.topPadding()+n),M(0,t),y+=t,U.log("clipped off top "+t+" top padding "+l.topPadding())},v=function(e,t){if(x||A(x=!0),1===_.push(e))return b(t)},S=function(t,e){var n,i,r;return(n=s.$new())[k]=e,i=y<t,n.$index=t,i&&n.$index--,r={scope:n},H(n,function(e){return r.element=e,i?t===R?(l.append(e),g.push(r)):(g[t-y].element.after(e),g.splice(t-y+1,0,r)):(l.prepend(e),g.unshift(r))}),{appended:i,wrapper:r}},o=function(e,t){var n;return e?l.bottomPadding(Math.max(0,l.bottomPadding()-t.element.outerHeight(!0))):0<=(n=l.topPadding()-t.element.outerHeight(!0))?l.topPadding(n):j.scrollTop(j.scrollTop()+t.element.outerHeight(!0))},p=function(e,i,t){var r;return r=function(){if(U.log("top {actual="+l.topDataPos()+" visible from="+N()+" bottom {visible through="+u()+" actual="+l.bottomDataPos()+"}"),O()?v(!0,e):F()&&v(!1,e),t)return t()},i?z(function(){var e,t,n;for(t=0,n=i.length;t<n;t++)e=i[t],o(e.appended,e.wrapper);return r()}):r()},w=function(e,t){return p(e,t,function(){return _.shift(),0===_.length?A(x=!1):b(e)})},b=function(s){return _[0]?g.length&&!O()?w(s):n.get(R,d,function(e){var t,n,i,r;if(n=[],0===e.length)$=!0,l.bottomPadding(0),U.log("appended: requested "+d+" records starting from "+R+" recieved: eof");else{for(m(),i=0,r=e.length;i<r;i++)t=e[i],n.push(S(++R,t));U.log("appended: requested "+d+" received "+e.length+" buffer size "+g.length+" first "+y+" next "+R)}return w(s,n)}):g.length&&!F()?w(s):n.get(y-d,d,function(e){var t,n,i,r;if(n=[],0===e.length)c=!0,l.topPadding(0),U.log("prepended: requested "+d+" records starting from "+(y-d)+" recieved: bof");else{for(f(),t=i=r=e.length-1;r<=0?i<=0:0<=i;t=r<=0?++i:--i)n.unshift(S(--y,e[t]));U.log("prepended: requested "+d+" received "+e.length+" buffer size "+g.length+" first "+y+" next "+R)}return w(s,n)})},T=function(){if(!V.$$phase&&!x)return p(!1),s.$apply()},j.bind("resize",T),P=function(){if(!V.$$phase&&!x)return p(!0),s.$apply()},j.bind("scroll",P),s.$watch(n.revision,function(){return L()}),r=n.scope?n.scope.$new():s.$new(),s.$on("$destroy",function(){return r.$destroy(),j.unbind("resize",T),j.unbind("scroll",P)}),r.$on("update.items",function(e,t,n){var i,r,s,o;if(angular.isFunction(t))for(i=function(e){return t(e.scope)},r=0,s=g.length;r<s;r++)i(g[r]);else 0<=(o=t-y-1)&&o<g.length&&(g[t-y-1].scope[k]=n);return null}),r.$on("delete.items",function(e,t){var n,i,r,s,o,a,l,c,u,h,d;if(angular.isFunction(t)){for(r=[],o=0,c=g.length;o<c;o++)i=g[o],r.unshift(i);for(s=function(e){if(t(e.scope))return M(r.length-1-n,r.length-n),R--},n=a=0,u=r.length;a<u;n=++a)s(r[n])}else 0<=(d=t-y-1)&&d<g.length&&(M(t-y-1,t-y),R--);for(n=l=0,h=g.length;l<h;n=++l)(i=g[n]).scope.$index=y+n;return p(!1)}),r.$on("insert.item",function(e,o,a){var l,c,t,n,i,r,s,u,h,d,f;if(c=[],angular.isFunction(o)){for(t=[],i=0,u=g.length;i<u;i++)a=g[i],t.unshift(a);for(n=function(e){var t,n,i,r,s;if(n=o(e.scope)){if(S=function(e,t){return S(e,t),R++},angular.isArray(n)){for(s=[],t=i=0,r=n.length;i<r;t=++i)a=n[t],s.push(c.push(S(l+t,a)));return s}return c.push(S(l,n))}},l=r=0,h=t.length;r<h;l=++r)n(t[l])}else 0<=(f=o-y-1)&&f<g.length&&(c.push(S(o,a)),R++);for(l=s=0,d=g.length;s<d;l=++s)(a=g[l]).scope.$index=y+l;return p(!1,c)})}}}}]),angular.module("ui.scrollfix",[]).directive("uiScrollfix",["$window",function(a){return{require:"^?uiScrollfixTarget",link:function(e,t,n,i){var r=t[0].offsetTop,s=i&&i.$element||angular.element(a);function o(){var e;angular.isDefined(a.pageYOffset)?e=a.pageYOffset:e=(document.compatMode&&"BackCompat"!==document.compatMode?document.documentElement:document.body).scrollTop;!t.hasClass("ui-scrollfix")&&e>n.uiScrollfix?t.addClass("ui-scrollfix"):t.hasClass("ui-scrollfix")&&e<n.uiScrollfix&&t.removeClass("ui-scrollfix")}n.uiScrollfix?"string"==typeof n.uiScrollfix&&("-"===n.uiScrollfix.charAt(0)?n.uiScrollfix=r-parseFloat(n.uiScrollfix.substr(1)):"+"===n.uiScrollfix.charAt(0)&&(n.uiScrollfix=r+parseFloat(n.uiScrollfix.substr(1)))):n.uiScrollfix=r,s.on("scroll",o),e.$on("$destroy",function(){s.off("scroll",o)})}}}]).directive("uiScrollfixTarget",[function(){return{controller:["$element",function(e){this.$element=e}]}}]),angular.module("ui.showhide",[]).directive("uiShow",[function(){return function(e,t,n){e.$watch(n.uiShow,function(e){e?t.addClass("ui-show"):t.removeClass("ui-show")})}}]).directive("uiHide",[function(){return function(e,t,n){e.$watch(n.uiHide,function(e){e?t.addClass("ui-hide"):t.removeClass("ui-hide")})}}]).directive("uiToggle",[function(){return function(e,t,n){e.$watch(n.uiToggle,function(e){e?t.removeClass("ui-hide").addClass("ui-show"):t.removeClass("ui-show").addClass("ui-hide")})}}]),angular.module("ui.unique",[]).filter("unique",["$parse",function(s){return function(e,t){if(!1===t)return e;if((t||angular.isUndefined(t))&&angular.isArray(e)){var i=[],n=angular.isString(t)?s(t):function(e){return e},r=function(e){return angular.isObject(e)?n(e):e};angular.forEach(e,function(e){for(var t=!1,n=0;n<i.length;n++)if(angular.equals(r(i[n]),r(e))){t=!0;break}t||i.push(e)}),e=i}return e}}]),angular.module("ui.validate",[]).directive("uiValidate",function(){return{restrict:"A",require:"ngModel",link:function(r,e,t,s){var o,n,a={},i=r.$eval(t.uiValidate);i&&(angular.isString(i)&&(i={validator:i}),angular.forEach(i,function(n,i){o=function(e){var t=r.$eval(n,{$value:e});return angular.isObject(t)&&angular.isFunction(t.then)?t.then(function(){s.$setValidity(i,!0)},function(){s.$setValidity(i,!1)}):t?s.$setValidity(i,!0):s.$setValidity(i,!1),e},a[i]=o,s.$formatters.push(o),s.$parsers.push(o)}),t.uiValidateWatch&&(n=r.$eval(t.uiValidateWatch),angular.isString(n)?r.$watch(n,function(){angular.forEach(a,function(e){e(s.$modelValue)})}):angular.isArray(n)?angular.forEach(n,function(e){r.$watch(e,function(){angular.forEach(a,function(e){e(s.$modelValue)})})}):angular.isObject(n)&&angular.forEach(n,function(e,t){angular.isString(e)&&r.$watch(e,function(){a[t](s.$modelValue)}),angular.isArray(e)&&angular.forEach(e,function(e){r.$watch(e,function(){a[t](s.$modelValue)})})})))}}}),angular.module("ui.utils",["ui.event","ui.format","ui.highlight","ui.include","ui.indeterminate","ui.inflector","ui.jq","ui.keypress","ui.mask","ui.reset","ui.route","ui.scrollfix","ui.scroll","ui.scroll.jqlite","ui.showhide","ui.unique","ui.validate"]),define("uiUtils",["angular"],function(){}),function(){var e=function(){return this}();!e&&"undefined"!=typeof window&&(e=window);var s=function(e,t,n){"string"==typeof e?(2==arguments.length&&(n=t),s.modules[e]||(s.payloads[e]=n,s.modules[e]=null)):s.original?s.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};s.modules={},s.payloads={};var t,n,o=function(e,t,n){if("string"==typeof t){var i=c(e,t);if(null!=i)return n&&n(),i}else if("[object Array]"===Object.prototype.toString.call(t)){for(var r=[],s=0,o=t.length;s<o;++s){var a=c(e,t[s]);if(null==a&&l.original)return;r.push(a)}return n&&n.apply(null,r)||!0}},l=function(e,t){var n=o("",e,t);return null==n&&l.original?l.original.apply(this,arguments):n},a=function(e,t){if(-1!==t.indexOf("!")){var n=t.split("!");return a(e,n[0])+"!"+a(e,n[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},c=function(e,n){n=a(e,n);var t=s.modules[n];if(!t){if("function"==typeof(t=s.payloads[n])){var i={},r={id:n,uri:"",exports:i,packaged:!0};i=t(function(e,t){return o(n,e,t)},i,r)||r.exports,s.modules[n]=i,delete s.payloads[n]}t=s.modules[n]=i||t}return t};n=e,(t="ace")&&(e[t]||(e[t]={}),n=e[t]),n.define&&n.define.packaged||(s.original=n.define,n.define=s,n.define.packaged=!0),n.require&&n.require.packaged||(l.original=n.require,n.require=l,n.require.packaged=!0)}(),ace.define("ace/lib/regexp",["require","exports","module"],function(e,t,n){"use strict";var i,o={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},a=void 0===o.exec.call(/()??/,"")[1],l=(i=/^/g,o.test.call(i,""),!i.lastIndex);l&&a||(RegExp.prototype.exec=function(e){var t,n,i,r=o.exec.apply(this,arguments);if("string"==typeof e&&r){if(!a&&1<r.length&&-1<function(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var i=n||0;i<e.length;i++)if(e[i]===t)return i;return-1}(r,"")&&(n=RegExp(this.source,o.replace.call(((i=this).global?"g":"")+(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),"g","")),o.replace.call(e.slice(r.index),n,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(r[e]=void 0)})),this._xregexp&&this._xregexp.captureNames)for(var s=1;s<r.length;s++)(t=this._xregexp.captureNames[s-1])&&(r[t]=r[s]);!l&&this.global&&!r[0].length&&this.lastIndex>r.index&&this.lastIndex--}return r},l||(RegExp.prototype.test=function(e){var t=o.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function s(){}function i(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function r(e){return(e=+e)!=e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(0<e||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if("function"!=typeof n)throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=p.call(arguments,1),r=function(){if(this instanceof r){var e=n.apply(this,i.concat(p.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(p.call(arguments)))};return n.prototype&&(s.prototype=n.prototype,r.prototype=new s,s.prototype=null),r});var o,a,l,c,u,h=Function.prototype.call,d=Array.prototype,f=Object.prototype,p=d.slice,g=h.bind(f.toString),m=h.bind(f.hasOwnProperty);if((u=m(f,"__defineGetter__"))&&(o=h.bind(f.__defineGetter__),a=h.bind(f.__defineSetter__),l=h.bind(f.__lookupGetter__),c=h.bind(f.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(p.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;0<e?n<e&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var i=this.slice(e,e+t),r=p.call(arguments,2),s=r.length;if(e===n)s&&this.push.apply(this,r);else{var o=Math.min(t,n-e),a=e+o,l=a+s-o,c=n-a,u=n-o;if(l<a)for(var h=0;h<c;++h)this[l+h]=this[a+h];else if(a<l)for(h=c;h--;)this[l+h]=this[a+h];if(s&&e===u)this.length=u,this.push.apply(this,r);else for(this.length=u+s,h=0;h<s;++h)this[e+h]=r[h]}return i};Array.isArray||(Array.isArray=function(e){return"[object Array]"==g(e)});var $,b,w=Object("a"),y="a"!=w[0]||!(0 in w);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=T(this),n=y&&"[object String]"==g(this)?this.split(""):t,i=arguments[1],r=-1,s=n.length>>>0;if("[object Function]"!=g(e))throw new TypeError;for(;++r<s;)r in n&&e.call(i,n[r],r,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=T(this),n=y&&"[object String]"==g(this)?this.split(""):t,i=n.length>>>0,r=Array(i),s=arguments[1];if("[object Function]"!=g(e))throw new TypeError(e+" is not a function");for(var o=0;o<i;o++)o in n&&(r[o]=e.call(s,n[o],o,t));return r}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,n=T(this),i=y&&"[object String]"==g(this)?this.split(""):n,r=i.length>>>0,s=[],o=arguments[1];if("[object Function]"!=g(e))throw new TypeError(e+" is not a function");for(var a=0;a<r;a++)a in i&&(t=i[a],e.call(o,t,a,n)&&s.push(t));return s}),Array.prototype.every||(Array.prototype.every=function(e){var t=T(this),n=y&&"[object String]"==g(this)?this.split(""):t,i=n.length>>>0,r=arguments[1];if("[object Function]"!=g(e))throw new TypeError(e+" is not a function");for(var s=0;s<i;s++)if(s in n&&!e.call(r,n[s],s,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=T(this),n=y&&"[object String]"==g(this)?this.split(""):t,i=n.length>>>0,r=arguments[1];if("[object Function]"!=g(e))throw new TypeError(e+" is not a function");for(var s=0;s<i;s++)if(s in n&&e.call(r,n[s],s,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=T(this),n=y&&"[object String]"==g(this)?this.split(""):t,i=n.length>>>0;if("[object Function]"!=g(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var r,s=0;if(2<=arguments.length)r=arguments[1];else for(;;){if(s in n){r=n[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}for(;s<i;s++)s in n&&(r=e.call(void 0,r,n[s],s,t));return r}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=T(this),n=y&&"[object String]"==g(this)?this.split(""):t,i=n.length>>>0;if("[object Function]"!=g(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var r,s=i-1;if(2<=arguments.length)r=arguments[1];else for(;;){if(s in n){r=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}for(;s in this&&(r=e.call(void 0,r,n[s],s,t)),s--;);return r}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=y&&"[object String]"==g(this)?this.split(""):T(this),n=t.length>>>0;if(!n)return-1;var i=0;for(1<arguments.length&&(i=r(arguments[1])),i=0<=i?i:Math.max(0,n+i);i<n;i++)if(i in t&&t[i]===e)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=y&&"[object String]"==g(this)?this.split(""):T(this),n=t.length>>>0;if(!n)return-1;var i=n-1;for(1<arguments.length&&(i=Math.min(i,r(arguments[1]))),i=0<=i?i:n-Math.abs(i);0<=i;i--)if(i in t&&e===t[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:f)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(m(e,t)){var n;if(n={enumerable:!0,configurable:!0},u){var i=e.__proto__;e.__proto__=f;var r=l(e,t),s=c(e,t);if(e.__proto__=i,r||s)return r&&(n.get=r),s&&(n.set=s),n}return n.value=e[t],n}}}(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create)||($=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=$();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var i=function(){};i.prototype=e,(n=new i).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n});if(Object.defineProperty){var S=i({}),C="undefined"==typeof document||i(document.createElement("div"));if(!S||!C)var x=Object.defineProperty}if(!Object.defineProperty||x){Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(x)try{return x.call(Object,e,t,n)}catch(e){}if(m(n,"value"))if(u&&(l(e,t)||c(e,t))){var i=e.__proto__;e.__proto__=f,delete e[t],e[t]=n.value,e.__proto__=i}else e[t]=n.value;else{if(!u)throw new TypeError("getters & setters can not be defined on this javascript engine");m(n,"get")&&o(e,t,n.get),m(n,"set")&&a(e,t,n.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)m(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(b=Object.freeze,function(e){return"function"==typeof e?e:b(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";m(e,t);)t+="?";e[t]=!0;var n=m(e,t);return delete e[t],n}),!Object.keys){var k=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],E=A.length;for(var R in{toString:null})k=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)m(e,n)&&t.push(n);if(k)for(var i=0,r=E;i<r;i++){var s=A[i];m(e,s)&&t.push(s)}return t}}Date.now||(Date.now=function(){return(new Date).getTime()});var _="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff";if(!String.prototype.trim||_.trim()){_="["+_+"]";var L=new RegExp("^"+_+_+"*"),M=new RegExp(_+_+"*$");String.prototype.trim=function(){return String(this).replace(L,"").replace(M,"")}}var T=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"!=typeof Element&&!Element.prototype.remove&&Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";if(t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS},"object"==typeof navigator){var i=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),r=navigator.userAgent;t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==navigator.appName||0<=navigator.appName.indexOf("MSAppHost")?parseFloat((r.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((r.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=r.match(/ Gecko\/\d+/),t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(r.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(r.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(r.split(" Edge/")[1])||void 0,t.isAIR=0<=r.indexOf("AdobeAIR"),t.isIPad=0<=r.indexOf("iPad"),t.isAndroid=0<=r.indexOf("Android"),t.isChromeOS=0<=r.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIPad||t.isAndroid}}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,a,t){"use strict";var n=e("./useragent");if(a.buildDom=function e(t,n,i){if("string"==typeof t&&t){var r=document.createTextNode(t);return n&&n.appendChild(r),r}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o<t.length;o++){var a=e(t[o],n,i);a&&s.push(a)}return s}var l=document.createElement(t[0]),c=t[1],u=1;c&&"object"==typeof c&&!Array.isArray(c)&&(u=2);for(o=u;o<t.length;o++)e(t[o],l,i);return 2==u&&Object.keys(c).forEach(function(e){var t=c[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e?l[e]=t:"ref"===e?i&&(i[t]=l):null!=t&&l.setAttribute(e,t)}),n&&n.appendChild(l),l},a.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},a.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},a.removeChildren=function(e){e.innerHTML=""},a.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},a.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},a.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},a.addCssClass=function(e,t){a.hasCssClass(e,t)||(e.className+=" "+t)},a.removeCssClass=function(e,t){for(var n=e.className.split(/\s+/g);;){var i=n.indexOf(t);if(-1==i)break;n.splice(i,1)}e.className=n.join(" ")},a.toggleCssClass=function(e,t){for(var n=e.className.split(/\s+/g),i=!0;;){var r=n.indexOf(t);if(-1==r)break;i=!1,n.splice(r,1)}return i&&n.push(t),e.className=n.join(" "),i},a.setCssClass=function(e,t,n){n?a.addCssClass(e,t):a.removeCssClass(e,t)},a.hasCssString=function(e,t){var n,i=0;if(n=(t=t||document).querySelectorAll("style"))for(;i<n.length;)if(n[i++].id===e)return!0},a.importCssString=function(e,t,n){var i=n;n&&n.getRootNode&&(i=n.getRootNode())&&i!=n||(i=document);var r=i.ownerDocument||i;if(t&&a.hasCssString(t,i))return null;t&&(e+="\n/*# sourceURL=ace/css/"+t+" */");var s=a.createElement("style");s.appendChild(r.createTextNode(e)),t&&(s.id=t),i==r&&(i=a.getDocumentHead(r)),i.insertBefore(s,i.firstChild)},a.importCssStylsheet=function(e,t){a.buildDom(["link",{rel:"stylesheet",href:e}],a.getDocumentHead(t))},a.scrollbarWidth=function(e){var t=a.createElement("ace_inner");t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block";var n=a.createElement("ace_outer"),i=n.style;i.position="absolute",i.left="-10000px",i.overflow="hidden",i.width="200px",i.minWidth="0px",i.height="150px",i.display="block",n.appendChild(t);var r=e.documentElement;r.appendChild(n);var s=t.offsetWidth;i.overflow="scroll";var o=t.offsetWidth;return s==o&&(o=n.clientWidth),r.removeChild(n),s-o},"undefined"==typeof document&&(a.importCssString=function(){}),a.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},a.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},a.HAS_CSS_ANIMATION=!1,a.HAS_CSS_TRANSFORMS=!1,a.HI_DPI=!n.isWin||"undefined"!=typeof window&&1.5<=window.devicePixelRatio,"undefined"!=typeof document){var i=document.createElement("div");a.HI_DPI&&void 0!==i.style.transform&&(a.HAS_CSS_TRANSFORMS=!0),!n.isEdge&&void 0!==i.style.animationName&&(a.HAS_CSS_ANIMATION=!0),i=null}a.HAS_CSS_TRANSFORMS?a.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:a.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,n,t){"use strict";n.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},n.implement=function(e,t){n.mixin(e,t)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var i=e("./oop"),r=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(t,r),t.keyCodeToString=function(e){var t=r[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,h,t){"use strict";function s(e,t,n){var i=u(t);if(!d.isMac&&l){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),l.altGr){if(3==(3&i))return;l.altGr=0}if(18===n||17===n){var r="location"in t?t.location:t.keyLocation;if(17===n&&1===r)1==l[n]&&(c=t.timeStamp);else if(18===n&&3===i&&2===r){t.timeStamp-c<50&&(l.altGr=!0)}}}if((n in a.MODIFIER_KEYS&&(n=-1),8&i&&91<=n&&n<=93&&(n=-1),!i&&13===n)&&(3===(r="location"in t?t.location:t.keyLocation)&&(e(t,i,-n),t.defaultPrevented)))return;if(d.isChromeOS&&8&i){if(e(t,i,n),t.defaultPrevented)return;i&=-9}return!!(i||n in a.FUNCTION_KEYS||n in a.PRINTABLE_KEYS)&&e(t,i,n)}function o(){l=Object.create(null)}var a=e("./keys"),d=e("./useragent"),l=null,c=0;h.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var i=function(){n.call(e,window.event)};n._wrapper=i,e.attachEvent("on"+t,i)}},h.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},h.stopEvent=function(e){return h.stopPropagation(e),h.preventDefault(e),!1},h.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},h.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},h.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||d.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},h.capture=function(e,t,n){function i(e){t&&t(e),n&&n(e),h.removeListener(document,"mousemove",t,!0),h.removeListener(document,"mouseup",i,!0),h.removeListener(document,"dragstart",i,!0)}return h.addListener(document,"mousemove",t,!0),h.addListener(document,"mouseup",i,!0),h.addListener(document,"dragstart",i,!0),i},h.addTouchMoveListener=function(e,i){var r,s;h.addListener(e,"touchstart",function(e){var t=e.touches[0];r=t.clientX,s=t.clientY}),h.addListener(e,"touchmove",function(e){var t=e.touches;if(!(1<t.length)){var n=t[0];e.wheelX=r-n.clientX,e.wheelY=s-n.clientY,r=n.clientX,s=n.clientY,i(e)}})},h.addMouseWheelListener=function(e,t){"onmousewheel"in e?h.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)}):"onwheel"in e?h.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)}):h.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)})},h.addMultiMouseDownListener=function(e,n,i,r){function t(e){if(0!==h.getButton(e)?c=0:1<e.detail?4<++c&&(c=1):c=1,d.isIE){var t=5<Math.abs(e.clientX-o)||5<Math.abs(e.clientY-a);l&&!t||(c=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[c-1]||600),1==c&&(o=e.clientX,a=e.clientY)}if(e._clicks=c,i[r]("mousedown",e),4<c)c=0;else if(1<c)return i[r](u[c],e)}function s(e){c=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[c-1]||600),i[r]("mousedown",e),i[r](u[c],e)}var o,a,l,c=0,u={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){h.addListener(e,"mousedown",t),d.isOldIE&&h.addListener(e,"dblclick",s)})};var u=!d.isMac||!d.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(h.getModifierString=function(e){return a.KEY_MODS[u(e)]},h.addCommandKeyListener=function(e,n){var t=h.addListener;if(d.isOldGecko||d.isOpera&&!("KeyboardEvent"in window)){var i=null;t(e,"keydown",function(e){i=e.keyCode}),t(e,"keypress",function(e){return s(n,e,i)})}else{var r=null;t(e,"keydown",function(e){l[e.keyCode]=(l[e.keyCode]||0)+1;var t=s(n,e,e.keyCode);return r=e.defaultPrevented,t}),t(e,"keypress",function(e){r&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(h.stopEvent(e),r=null)}),t(e,"keyup",function(e){l[e.keyCode]=null}),l||(o(),t(window,"focus",o))}},"object"==typeof window&&window.postMessage&&!d.isOldIE){var f=1;h.nextTick=function(t,n){n=n||window;var i="zero-timeout-message-"+f++,r=function(e){e.data==i&&(h.stopPropagation(e),h.removeListener(n,"message",r),t())};h.addListener(n,"message",r),n.postMessage(i,"*")}}h.$idleBlocked=!1,h.onIdle=function(t,e){return setTimeout(function e(){h.$idleBlocked?setTimeout(e,100):t()},e)},h.$idleBlockId=null,h.blockIdle=function(e){h.$idleBlockId&&clearTimeout(h.$idleBlockId),h.$idleBlocked=!0,h.$idleBlockId=setTimeout(function(){h.$idleBlocked=!1},e||100)},h.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),h.nextFrame?h.nextFrame=h.nextFrame.bind(window):h.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var s=function(e,t,n,i){this.start={row:e,column:t},this.end={row:n,column:i}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,i=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(i.row,i.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(i.row,i.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)n={row:e,column:0};if(this.start.row>t)var i={row:t+1,column:0};else if(this.start.row<e)i={row:e,column:0};return s.fromPoints(i||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(0==n)return this;if(-1==n)var i={row:e,column:t};else var r={row:e,column:t};return s.fromPoints(i||this.start,r||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return s.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new s(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new s(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new s(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(s.prototype),s.fromPoints=function(e,t){return new s(e.row,e.column,t.row,t.column)},s.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},s.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=s}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";0<t;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var i=/^\s\s*/,r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(r,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(var i=0;i<t.length;i++)n[i]=e(t[i]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var i in n={},t)n[i]=e(t[i]);return n},t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},i=function(e){return i.cancel(),t=setTimeout(n,e||0),i};return(i.schedule=i).call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(t),t=null,i},i.isPending=function(){return t},i},t.delayedCall=function(e,t){var n=null,i=function(){n=null,e()},r=function(e){null==n&&(n=setTimeout(i,e||t))};return r.delay=function(e){n&&clearTimeout(n),n=setTimeout(i,e||t)},(r.schedule=r).call=function(){this.cancel(),e()},r.cancel=function(){n&&clearTimeout(n),n=null},r.isPending=function(){return n},r}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/lib/keys"],function(e,t,n){"use strict";var M=e("../lib/event"),T=e("../lib/useragent"),P=e("../lib/dom"),I=e("../lib/lang"),O=T.isChrome<18,F=T.isIE,D=63<T.isChrome,N=e("../lib/keys"),j=N.KEY_MODS,B=T.isIOS,H=B?/\s/:/\n/;t.TextInput=function(e,u){function n(){t=!0,h.blur(),h.focus(),t=!1}function l(){clearTimeout(_),_=setTimeout(function(){g&&(h.style.cssText=g,g=""),null==u.renderer.$keepTextAreaAtCursor&&(u.renderer.$keepTextAreaAtCursor=!0,u.renderer.$moveTextAreaToCursor())},0)}var h=P.createElement("textarea");h.className="ace_text-input",h.setAttribute("wrap","off"),h.setAttribute("autocorrect","off"),h.setAttribute("autocapitalize","off"),h.setAttribute("spellcheck",!1),h.style.opacity="0",e.insertBefore(h,e.firstChild);var c=!1,d=!1,f=!1,p=!1,g="";T.isMobile||(h.style.fontSize="1px");var m=!1,t=!1,v="",$=0,b=0;try{var w=document.activeElement===h}catch(e){}M.addListener(h,"blur",function(e){t||(u.onBlur(e),w=!1)}),M.addListener(h,"focus",function(e){if(!t){if(w=!0,T.isEdge)try{if(!document.hasFocus())return}catch(e){}u.onFocus(e),T.isEdge?setTimeout(y):y()}}),this.$focusScroll=!1,this.focus=function(){if(g||D||"browser"==this.$focusScroll)return h.focus({preventScroll:!0});var e=h.style.top;h.style.position="fixed",h.style.top="0px";try{var t=0!=h.getBoundingClientRect().top}catch(e){return}var n=[];if(t)for(var i=h.parentElement;i&&1==i.nodeType;)n.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;h.focus({preventScroll:!0}),t&&n.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){h.style.position="","0px"==h.style.top&&(h.style.top=e)},0)},this.blur=function(){h.blur()},this.isFocused=function(){return w},u.on("beforeEndOperation",function(){u.curOp&&"insertstring"==u.curOp.command.name||(f&&(v=h.value="",E()),y())});var y=B?function(e){if(w&&(!c||e)){e||(e="");var t="\n ab"+e+"cde fg\n";t!=h.value&&(h.value=v=t);var n=4+(e.length||(u.selection.isEmpty()?0:1));(4!=$||b!=n)&&h.setSelectionRange(4,n),$=4,b=n}}:function(){if(!f&&!p&&(w||S)){f=!0;var e=u.selection,t=e.getRange(),n=e.cursor.row,i=t.start.column,r=t.end.column,s=u.session.getLine(n);if(t.start.row!=n){var o=u.session.getLine(n-1);i=t.start.row<n-1?0:i,r+=o.length+1,s=o+"\n"+s}else if(t.end.row!=n){var a=u.session.getLine(n+1);r=t.end.row>n+1?a.length:r,r+=s.length+1,s=s+"\n"+a}400<s.length&&(i<400&&r<400?s=s.slice(0,400):(s="\n",i=0,r=1));var l=s+"\n\n";if(l!=v&&(h.value=v=l,$=b=l.length),S&&($=h.selectionStart,b=h.selectionEnd),b!=r||$!=i||h.selectionEnd!=b)try{h.setSelectionRange(i,r),$=i,b=r}catch(e){}f=!1}};w&&u.onFocus();var i=null;this.setInputHandler=function(e){i=e};var S=(this.getInputHandler=function(){return i},!1),r=function(e,t){if(S&&(S=!1),d)return y(),e&&u.onPaste(e),d=!1,"";for(var n=h.selectionStart,i=h.selectionEnd,r=$,s=v.length-b,o=e,a=e.length-n,l=e.length-i,c=0;0<r&&v[c]==e[c];)c++,r--;for(o=o.slice(c),c=1;0<s&&v.length-c>$-1&&v[v.length-c]==e[e.length-c];)c++,s--;return a-=c-1,l-=c-1,o=o.slice(0,o.length-c+1),t||a!=o.length||r||s||l?(p=!0,o&&!r&&!s&&!a&&!l||m?u.onTextInput(o):u.onTextInput(o,{extendLeft:r,extendRight:s,restoreStart:a,restoreEnd:l}),p=!1,v=e,$=n,b=i,o):""},s=function(e){if(f)return A();var t=h.value,n=r(t,!0);(500<t.length||H.test(n))&&y()},o=function(e,t,n){var i=e.clipboardData||window.clipboardData;if(i&&!O){var r=F||n?"Text":"text/plain";try{return t?!1!==i.setData(r,t):i.getData(r)}catch(e){if(!n)return o(e,t,!0)}}},a=function(e,t){var n=u.getCopyText();if(!n)return M.preventDefault(e);o(e,n)?(B&&(y(n),c=n,setTimeout(function(){c=!1},10)),t?u.onCut():u.onCopy(),M.preventDefault(e)):(c=!0,h.value=n,h.select(),setTimeout(function(){c=!1,y(),t?u.onCut():u.onCopy()}))},C=function(e){a(e,!0)},x=function(e){a(e,!1)},k=function(e){var t=o(e);"string"==typeof t?(t&&u.onPaste(t,e),T.isIE&&setTimeout(y),M.preventDefault(e)):(h.value="",d=!0)};M.addCommandKeyListener(h,u.onCommandKey.bind(u)),M.addListener(h,"select",function(e){var t;f||(c?c=!1:0===(t=h).selectionStart&&t.selectionEnd>=v.length&&t.value===v&&v&&t.selectionEnd!==b&&(u.selectAll(),y()))}),M.addListener(h,"input",s),M.addListener(h,"cut",C),M.addListener(h,"copy",x),M.addListener(h,"paste",k),(!("oncut"in h)||!("oncopy"in h)||!("onpaste"in h))&&M.addListener(e,"keydown",function(e){if((!T.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:x(e);break;case 86:k(e);break;case 88:C(e)}});var A=function(){if(f&&u.onCompositionUpdate&&!u.$readOnly){if(m)return n();if(f.useTextareaForIME)u.onCompositionUpdate(h.value);else{var e=h.value;r(e),f.markerRange&&(f.context&&(f.markerRange.start.column=f.selectionStart=f.context.compositionStartOffset),f.markerRange.end.column=f.markerRange.start.column+b-f.selectionStart)}}},E=function(e){u.onCompositionEnd&&!u.$readOnly&&(f=!1,u.onCompositionEnd(),u.off("mousedown",n),e&&s())},R=I.delayedCall(A,50).schedule.bind(null,null);M.addListener(h,"compositionstart",function(e){if(!f&&u.onCompositionStart&&!u.$readOnly&&(f={},!m)){setTimeout(A,0),u.on("mousedown",n);var t=u.getSelectionRange();t.end.row=t.start.row,t.end.column=t.start.column,f.markerRange=t,f.selectionStart=$,u.onCompositionStart(f),f.useTextareaForIME?(h.value="",v="",b=$=0):(h.msGetInputContext&&(f.context=h.msGetInputContext()),h.getInputContext&&(f.context=h.getInputContext()))}}),M.addListener(h,"compositionupdate",A),M.addListener(h,"keyup",function(e){27==e.keyCode&&h.value.length<h.selectionStart&&(f||(v=h.value),$=b=-1,y()),R()}),M.addListener(h,"keydown",R),M.addListener(h,"compositionend",E),this.getElement=function(){return h},this.setCommandMode=function(e){m=e,h.readOnly=!1},this.setReadOnly=function(e){m||(h.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){S=!0,y(),u._emit("nativecontextmenu",{target:u,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,t){g||(g=h.style.cssText),h.style.cssText=(t?"z-index:100000;":"")+(T.isIE?"opacity:0.1;":"")+"text-indent: -"+($+b)*u.renderer.characterWidth*.5+"px;";var n=u.container.getBoundingClientRect(),i=P.computedStyle(u.container),r=n.top+(parseInt(i.borderTopWidth)||0),s=n.left+(parseInt(n.borderLeftWidth)||0),o=n.bottom-r-h.clientHeight-2,a=function(e){h.style.left=e.clientX-s-2+"px",h.style.top=Math.min(e.clientY-r-2,o)+"px"};a(e),"mousedown"==e.type&&(u.renderer.$keepTextAreaAtCursor&&(u.renderer.$keepTextAreaAtCursor=null),clearTimeout(_),T.isWin&&M.capture(u.container,a,l))},this.onContextMenuClose=l;var _,L=function(e){u.textInput.onContextMenu(e),l()};M.addListener(h,"mouseup",L),M.addListener(h,"mousedown",function(e){e.preventDefault(),l()}),M.addListener(u.renderer.scroller,"contextmenu",L),M.addListener(h,"contextmenu",L),B&&function(e,s,o){var t=null,a=!1;o.addEventListener("keydown",function(e){t&&clearTimeout(t),a=!0},!0),o.addEventListener("keyup",function(e){t=setTimeout(function(){a=!1},100)},!0);var n=function(e){if(document.activeElement===o&&!a&&!f&&!c){var t=o.selectionStart,n=o.selectionEnd,i=null,r=0;console.log(t,n),0==t?i=N.up:1==t?i=N.home:b<n&&"\n"==v[n]?i=N.end:t<$&&" "==v[t-1]?(i=N.left,r=j.option):t<$||t==$&&b!=$&&t==n?i=N.left:b<n&&2<v.slice(0,n).split("\n").length?i=N.down:b<n&&" "==v[n-1]?(i=N.right,r=j.option):(b<n||n==b&&b!=$&&t==n)&&(i=N.right),t!==n&&(r|=j.shift),i&&(s.onCommandKey(null,r,i),$=t,b=n,y(""))}};document.addEventListener("selectionchange",n),s.on("destroy",function(){document.removeEventListener("selectionchange",n)})}(0,u,h)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";function i(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t)),e.setDefaultHandler("touchmove",this.onTouchMove.bind(t));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function l(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else var n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var s=e("../lib/useragent");(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,r=e.getButton();return 0!==r?((i.getSelectionRange().isEmpty()||1==r)&&i.selection.moveToPosition(n),void(2==r&&(i.textInput.onContextMenu(e.domEvent),s.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,1<e.domEvent._clicks),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var r=l(this.$clickSelection,n);n=r.cursor,e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[e](i.row,i.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start),o=this.$clickSelection.comparePoint(r.end);if(-1==s&&o<=0)t=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==o&&0<=s)t=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==s&&1==o)i=r.end,t=r.start;else{var a=l(this.$clickSelection,i);i=a.cursor,t=a.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,i,r=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,i=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))),s=Date.now();(0<r||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=e.domEvent.timeStamp,r=i-n.t,s=r?e.wheelX/r:n.vx,o=r?e.wheelY/r:n.vy;r<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;if(1<=a&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)n.allowed=i;else if(i-n.allowed<550){Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0}return n.t=i,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},this.onTouchMove=function(e){this.editor._emit("mousewheel",e)}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}e("./lib/oop");var r=e("./lib/dom");(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";function i(e){o.call(this,e)}var r=e("../lib/dom"),s=e("../lib/oop"),p=e("../lib/event"),o=e("../tooltip").Tooltip;s.inherits(i,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),s=this.getHeight();n<(e+=15)+r&&(e-=e+r-n),i<(t+=15)+s&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(i.prototype),t.GutterHandler=function(o){function a(){n&&(n=clearTimeout(n)),u&&(f.hide(),u=null,h._signal("hideGutterTooltip",f),h.removeEventListener("mousewheel",a))}function l(e){f.setPosition(e.x,e.y)}var n,c,u,h=o.editor,d=h.renderer.$gutterLayer,f=new i(h.container);o.editor.setDefaultHandler("guttermousedown",function(e){if(h.isFocused()&&0==e.getButton()&&"foldWidgets"!=d.getRegion(e)){var t=e.getDocumentPosition().row,n=h.session.selection;if(e.getShiftKey())n.selectTo(t,0);else{if(2==e.domEvent.detail)return h.selectAll(),e.preventDefault();o.$clickSelection=h.selection.getLineRange(t)}return o.setState("selectByLines"),o.captureMouse(e),e.preventDefault()}}),o.editor.setDefaultHandler("guttermousemove",function(e){var t=e.domEvent.target||e.domEvent.srcElement;if(r.hasCssClass(t,"ace_fold-widget"))return a();u&&o.$tooltipFollowsMouse&&l(e),c=e,n||(n=setTimeout(function(){n=null,c&&!o.isMousePressed?function(){var e=c.getDocumentPosition().row,t=d.$annotations[e];if(!t)return a();if(e==h.session.getLength()){var n=h.renderer.pixelToScreenCoordinates(0,c.y).row,i=c.$pos;if(n>h.session.documentToScreenRow(i.row,i.column))return a()}if(u!=t)if(u=t.text.join("<br/>"),f.setHtml(u),f.show(),h._signal("showGutterTooltip",f),h.on("mousewheel",a),o.$tooltipFollowsMouse)l(c);else{var r=c.domEvent.target.getBoundingClientRect(),s=f.getElement().style;s.left=r.right+"px",s.top=r.bottom+"px"}}():a()},50))}),p.addListener(h.renderer.$gutter,"mouseout",function(e){c=null,u&&!n&&(n=setTimeout(function(){n=null,a()},50))}),h.on("changeSession",a)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var i=e("../lib/event"),r=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function i(t){function e(){var e,t,n,i,r,s=h;h=f.renderer.screenToTextCoordinates(p,g),e=h,t=s,n=Date.now(),i=!t||e.row!=t.row,r=!t||e.column!=t.column,!$||i||r?(f.moveCursorToPosition(e),$=n,b={x:p,y:g}):5<C(b.x,b.y,p,g)?$=null:200<=n-$&&(f.renderer.scrollCursorIntoView(),$=null),function(e,t){var n=Date.now(),i=f.renderer.layerConfig.lineHeight,r=f.renderer.layerConfig.characterWidth,s=f.renderer.scroller.getBoundingClientRect(),o={x:{left:p-s.left,right:s.right-p},y:{top:g-s.top,bottom:s.bottom-g}},a=Math.min(o.x.left,o.x.right),l=Math.min(o.y.top,o.y.bottom),c={row:e.row,column:e.column};a/r<=2&&(c.column+=o.x.left<o.x.right?-3:2),l/i<=1&&(c.row+=o.y.top<o.y.bottom?-1:1);var u=e.row!=c.row,h=e.column!=c.column,d=!t||e.row!=t.row;u||h&&!d?v?200<=n-v&&f.renderer.scrollCursorIntoView(c):v=n:v=null}(h,s)}function n(){u=f.selection.toOrientedRange(),l=f.session.addMarker(u,"ace_selection",f.getSelectionStyle()),f.clearSelection(),f.isFocused()&&f.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),e(),c=setInterval(e,20),y=0,k.addListener(document,"mousemove",r)}function i(){clearInterval(c),f.session.removeMarker(l),l=null,f.selection.fromOrientedRange(u),f.isFocused()&&!m&&f.renderer.$cursorLayer.setBlinking(!f.getReadOnly()),y=0,$=v=h=u=null,k.removeListener(document,"mousemove",r)}function r(){null==S&&(S=setTimeout(function(){null!=S&&l&&i()},20))}function s(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function o(e){var t=["copy","copymove","all","uninitialized"],n=A.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return n&&0<=t.indexOf(i)?r="copy":0<=["move","copymove","linkmove","all","uninitialized"].indexOf(i)?r="move":0<=t.indexOf(i)&&(r="copy"),r}var f=t.editor,a=x.createElement("img");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",A.isOpera&&(a.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),f.addEventListener("mousedown",this.onMouseDown.bind(t));var l,p,g,c,u,h,d,m,v,$,b,w=f.container,y=0;this.onDragStart=function(e){if(this.cancelDrag||!w.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}u=f.getSelectionRange();var n=e.dataTransfer;n.effectAllowed=f.getReadOnly()?"copy":"copyMove",A.isOpera&&(f.container.appendChild(a),a.scrollTop=0),n.setDragImage&&n.setDragImage(a,0,0),A.isOpera&&f.container.removeChild(a),n.clearData(),n.setData("Text",f.session.getTextRange()),m=!0,this.setState("drag")},this.onDragEnd=function(e){if(w.draggable=!1,m=!1,this.setState(null),!f.getReadOnly()){var t=e.dataTransfer.dropEffect;!d&&"move"==t&&f.session.remove(f.getSelectionRange()),f.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!f.getReadOnly()&&s(e.dataTransfer))return p=e.clientX,g=e.clientY,l||n(),y++,e.dataTransfer.dropEffect=d=o(e),k.preventDefault(e)},this.onDragOver=function(e){if(!f.getReadOnly()&&s(e.dataTransfer))return p=e.clientX,g=e.clientY,l||(n(),y++),null!==S&&(S=null),e.dataTransfer.dropEffect=d=o(e),k.preventDefault(e)},this.onDragLeave=function(e){if(--y<=0&&l)return i(),d=null,k.preventDefault(e)},this.onDrop=function(e){if(h){var t=e.dataTransfer;if(m)switch(d){case"move":u=u.contains(h.row,h.column)?{start:h,end:h}:f.moveText(u,h);break;case"copy":u=f.moveText(u,h,!0)}else{var n=t.getData("Text");u={start:h,end:f.session.insert(h,n)},f.focus(),d=null}return i(),k.preventDefault(e)}},k.addListener(w,"dragstart",this.onDragStart.bind(t)),k.addListener(w,"dragend",this.onDragEnd.bind(t)),k.addListener(w,"dragenter",this.onDragEnter.bind(t)),k.addListener(w,"dragover",this.onDragOver.bind(t)),k.addListener(w,"dragleave",this.onDragLeave.bind(t)),k.addListener(w,"drop",this.onDrop.bind(t));var S=null}function C(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}var x=e("../lib/dom"),k=e("../lib/event"),A=e("../lib/useragent");(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=A.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;A.isIE&&"dragReady"==this.state&&(3<C(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&t.dragDrop());"dragWait"===this.state&&(0<C(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition())))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in r&&(r.unselectable="on"),t.getDragDelay()){if(A.isWebKit)this.cancelDrag=!0,t.container.draggable=!0;this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(i.prototype),t.DragdropHandler=i}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,n){var t=r.getDocumentHead(),i=document.createElement("script");i.src=e,t.appendChild(i),i.onload=i.onreadystatechange=function(e,t){!t&&i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(i=i.onload=i.onreadystatechange=null,t||n())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var i={},s=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],i=this._defaultHandlers[e];if(n.length||i){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=o),n=n.slice();for(var r=0;r<n.length&&(n[r](t,this),!t.propagationStopped);r++);return i&&!t.defaultPrevented?i(t,this):void 0}},i._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var i=0;i<n.length;i++)n[i](t,this)}},i.once=function(t,n){var i=this;if(this.addEventListener(t,function e(){i.removeEventListener(t,e),n.apply(null,arguments)}),!n)return new Promise(function(e){n=e})},i.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var i=n[e],r=n._disabled_[e];r||(n._disabled_[e]=r=[]),r.push(i);var s=r.indexOf(t);-1!=s&&r.splice(s,1)}n[e]=t},i.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var i=n._disabled_[e];if(n[e]==t)i&&this.setDefaultHandler(e,i.pop());else if(i){var r=i.indexOf(t);-1!=r&&i.splice(r,1)}}},i.on=i.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];return i||(i=this._eventRegistry[e]=[]),-1==i.indexOf(t)&&i[n?"unshift":"push"](t),t},i.off=i.removeListener=i.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}},i.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=i}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){function i(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function r(e,t){var n=new Error(e);n.data=t,"object"==typeof console&&console.error&&console.error(n),setTimeout(function(){throw n})}var s=e("./oop"),o=e("./event_emitter").EventEmitter,a={setOptions:function(t){Object.keys(t).forEach(function(e){this.setOption(e,t[e])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var n=this.$options;e=Object.keys(n).filter(function(e){return!n[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var n=this.$options[e];return n?n.forwardTo?this[n.forwardTo]&&this[n.forwardTo].setOption(e,t):(n.handlesSet||(this["$"+e]=t),void(n&&n.set&&n.set.call(this,t))):i('misspelled option "'+e+'"')}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:i('misspelled option "'+e+'"')}},l=function(){this.$defaultOptions={}};(function(){s.implement(this,o),this.defineOptions=function(n,e,i){return n.$options||(this.$defaultOptions[e]=n.$options={}),Object.keys(i).forEach(function(e){var t=i[e];"string"==typeof t&&(t={forwardTo:t}),t.name||(t.name=e),"initialValue"in(n.$options[t.name]=t)&&(n["$"+t.name]=t.initialValue)}),s.implement(n,a),this},this.resetOptions=function(n){Object.keys(n.$options).forEach(function(e){var t=n.$options[e];"value"in t&&n.setOption(e,t.value)})},this.setDefaultValue=function(e,t,n){var i=this.$defaultOptions[e]||(this.$defaultOptions[e]={});i[t]&&(i.forwardTo?this.setDefaultValue(i.forwardTo,t,n):i[t].value=n)},this.setDefaultValues=function(t,n){Object.keys(n).forEach(function(e){this.setDefaultValue(t,e,n[e])},this)},this.warn=i,this.reportError=r}).call(l.prototype),t.AppConfig=l}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(g,m,v){var e=g("./lib/lang"),s=(g("./lib/oop"),g("./lib/net")),t=g("./lib/app_config").AppConfig;v.exports=m=new t;var $=function(){return this||"undefined"!=typeof window&&window}(),b={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};m.get=function(e){if(!b.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return b[e]},m.set=function(e,t){if(!b.hasOwnProperty(e))throw new Error("Unknown config key: "+e);b[e]=t},m.all=function(){return e.copyObject(b)},m.$modes={},m.moduleUrl=function(e,t){if(b.$moduleUrls[e])return b.$moduleUrls[e];var n=e.split("/"),i="snippets"==(t=t||n[n.length-2]||"")?"/":"-",r=n[n.length-1];if("worker"==t&&"-"==i){var s=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");r=r.replace(s,"")}(!r||r==t)&&1<n.length&&(r=n[n.length-2]);var o=b[t+"Path"];return null==o?o=b.basePath:"/"==i&&(t=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+i+r+this.get("suffix")},m.setModuleUrl=function(e,t){return b.$moduleUrls[e]=t},m.$loading={},m.loadModule=function(n,e){var t,i;Array.isArray(n)&&(i=n[0],n=n[1]);try{t=g(n)}catch(e){}if(t&&!m.$loading[n])return e&&e(t);if(m.$loading[n]||(m.$loading[n]=[]),m.$loading[n].push(e),!(1<m.$loading[n].length)){var r=function(){g([n],function(t){m._emit("load.module",{name:n,module:t});var e=m.$loading[n];m.$loading[n]=null,e.forEach(function(e){e&&e(t)})})};if(!m.get("packaged"))return r();s.loadScript(m.moduleUrl(n,i),r),o()}};var o=function(){!b.basePath&&!b.workerPath&&!b.modePath&&!b.themePath&&!Object.keys(b.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),o=function(){})};m.init=function(e){if($&&$.document){b.packaged=e||g.packaged||v.packaged||$.define&&define.packaged;for(var t,n={},i="",r=document.currentScript||document._currentScript,s=(r&&r.ownerDocument||document).getElementsByTagName("script"),o=0;o<s.length;o++){var a=s[o],l=a.src||a.getAttribute("src");if(l){for(var c=a.attributes,u=0,h=c.length;u<h;u++){var d=c[u];0===d.name.indexOf("data-ace-")&&(n[(t=d.name.replace(/^data-ace-/,""),t.replace(/-(.)/g,function(e,t){return t.toUpperCase()}))]=d.value)}var f=l.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);f&&(i=f[1])}}for(var p in i&&(n.base=n.base||i,n.packaged=!0),n.basePath=n.base,n.workerPath=n.workerPath||n.base,n.modePath=n.modePath||n.base,n.themePath=n.themePath||n.base,delete n.base,n)void 0!==n[p]&&m.set(p,n[p])}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t,n){"use strict";var u=e("../lib/event"),h=e("../lib/useragent"),i=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,d=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,r=e("../config"),s=function(r){var s=this;this.editor=r,new i(this),new o(this),new a(this);var e=function(e){(!document.hasFocus||!document.hasFocus()||!r.isFocused()&&document.activeElement==(r.textInput&&r.textInput.getElement()))&&window.focus(),r.focus()},t=r.renderer.getMouseEventTarget();u.addListener(t,"click",this.onMouseEvent.bind(this,"click")),u.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove")),u.addMultiMouseDownListener([t,r.renderer.scrollBarV&&r.renderer.scrollBarV.inner,r.renderer.scrollBarH&&r.renderer.scrollBarH.inner,r.textInput&&r.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),u.addMouseWheelListener(r.container,this.onMouseWheel.bind(this,"mousewheel")),u.addTouchMoveListener(r.container,this.onTouchMove.bind(this,"touchmove"));var n=r.renderer.$gutter;u.addListener(n,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),u.addListener(n,"click",this.onMouseEvent.bind(this,"gutterclick")),u.addListener(n,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),u.addListener(n,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),u.addListener(t,"mousedown",e),u.addListener(n,"mousedown",e),h.isIE&&r.renderer.scrollBarV&&(u.addListener(r.renderer.scrollBarV.element,"mousedown",e),u.addListener(r.renderer.scrollBarH.element,"mousedown",e)),r.on("mousemove",function(e){if(!s.state&&!s.$dragDelay&&s.$dragEnabled){var t=r.renderer.screenToTextCoordinates(e.x,e.y),n=r.session.selection.getRange(),i=r.renderer;!n.isEmpty()&&n.insideStart(t.row,t.column)?i.setCursorStyle("default"):i.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new d(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;n&&n.length&&this.editor._emit(e,new d(t,this.editor))},this.onMouseWheel=function(e,t){var n=new d(t,this.editor);n.speed=2*this.$scrollSpeed,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.onTouchMove=function(e,t){var n=new d(t,this.editor);n.speed=1,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,i=this.editor.renderer;i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=null);var r=this,s=function(e){if(e)return h.isWebKit&&!e.which&&r.releaseMouse?r.releaseMouse():(r.x=e.clientX,r.y=e.clientY,t&&t(e),r.mouseEvent=new d(e,r.editor),void(r.$mouseMoved=!0))},o=function(e){n.off("beforeEndOperation",l),clearInterval(c),a(),r[r.state+"End"]&&r[r.state+"End"](e),r.state="",null==i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=!0,i.$moveTextAreaToCursor()),r.isMousePressed=!1,r.$onCaptureMouseMove=r.releaseMouse=null,e&&r.onMouseEvent("mouseup",e),n.endOperation()},a=function(){r[r.state]&&r[r.state](),r.$mouseMoved=!1};if(h.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){o(e)});var l=function(e){r.releaseMouse&&n.curOp.command.name&&n.curOp.selectionChanged&&(r[r.state+"End"]&&r[r.state+"End"](),r.state="",r.releaseMouse())};n.on("beforeEndOperation",l),n.startOperation({command:{name:"mouse"}}),r.$onCaptureMouseMove=s,r.releaseMouse=u.capture(this.editor.container,s,o);var c=setInterval(a,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var t=function(e){e&&e.domEvent&&"contextmenu"!=e.domEvent.type||(this.editor.off("nativecontextmenu",t),e&&e.domEvent&&u.stopEvent(e.domEvent))}.bind(this);setTimeout(t,10),this.editor.on("nativecontextmenu",t)}}).call(s.prototype),r.defineOptions(s.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:h.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=s}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var s=e("../lib/dom");t.FoldHandler=function(o){o.on("click",function(e){var t=e.getDocumentPosition(),n=o.session,i=n.getFoldAt(t.row,t.column,1);i&&(e.getAccelKey()?n.removeFold(i):n.expandFold(i),e.stop());var r=e.domEvent&&e.domEvent.target;r&&s.hasCssClass(r,"ace_inline_button")&&s.hasCssClass(r,"ace_toggle_wrap")&&(n.setOption("wrap",!0),o.renderer.scrollCursorIntoView())}),o.on("gutterclick",function(e){if("foldWidgets"==o.renderer.$gutterLayer.getRegion(e)){var t=e.getDocumentPosition().row,n=o.session;n.foldWidgets&&n.foldWidgets[t]&&o.session.onFoldWidgetClick(t,e),o.isFocused()||o.focus(),e.stop()}}),o.on("gutterdblclick",function(e){if("foldWidgets"==o.renderer.$gutterLayer.getRegion(e)){var t=e.getDocumentPosition().row,n=o.session,i=n.getParentFoldRangeData(t,!0),r=i.range||i.firstRange;if(r){t=r.start.row;var s=n.getFoldAt(t,n.getLine(t).length,1);s?n.removeFold(s):(n.addFold("...",r),o.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}e.stop()}})}}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){"use strict";var r=e("../lib/keys"),l=e("../lib/event"),i=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"==typeof e&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);-1!=n&&this.$handlers.splice(n,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==n&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var t=this.$data,n=t.editor;return this.$handlers.map(function(e){return e.getStatusText&&e.getStatusText(n,t)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,i){for(var r,s=!1,o=this.$editor.commands,a=this.$handlers.length;a--&&!((r=this.$handlers[a].handleKeyboard(this.$data,e,t,n,i))&&r.command&&((s="null"==r.command||o.exec(r.command,this.$editor,r.args,i))&&i&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&l.stopEvent(i),s)););return!s&&-1==e&&(r={command:"insertstring"},s=o.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(i.prototype),t.KeyBinding=i}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,l,t){"use strict";function c(e,t,n){if(!($<e))if(1!=e||1!=v||w)for(var i,r,s,o,a=n.length,l=0;l<a;){if(t[l]>=e){for(i=l+1;i<a&&t[i]>=e;)i++;for(r=l,s=i-1;r<s;r++,s--)o=n[r],n[r]=n[s],n[s]=o;l=i}l++}else n.reverse()}function g(e,t,n,i){var r,s,o,a,l=t[i];switch(l){case h:case d:b=!1;case x:case p:return l;case f:return b?p:f;case E:return b=!0,d;case R:return x;case _:return i<1||i+1>=t.length||(r=n[i-1])!=f&&r!=p||(s=t[i+1])!=f&&s!=p?x:(b&&(s=p),s==r?s:x);case L:return(r=0<i?n[i-1]:k)==f&&i+1<t.length&&t[i+1]==f?f:x;case M:if(0<i&&n[i-1]==f)return f;if(b)return x;for(a=i+1,o=t.length;a<o&&t[a]==M;)a++;return a<o&&t[a]==f?f:x;case T:for(o=t.length,a=i+1;a<o&&t[a]==T;)a++;if(a<o){var c=e[i],u=1425<=c&&c<=2303||64286==c;if(r=t[a],u&&(r==d||r==E))return d}return i<1||(r=t[i-1])==k?x:n[i-1];case k:return w=!(b=!1),v;case A:return y=!0,x;case P:case I:case F:case D:case O:b=!1;case N:return x}}function m(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?191<t?h:i[t]:5==n?/[\u0591-\u05f4]/.test(e)?d:h:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?T:/[\u0660-\u0669\u066b-\u066c]/.test(e)?p:1642==t?M:/[\u06f0-\u06f9]/.test(e)?f:E:32==n&&t<=8287?r[255&t]:254==n&&65136<=t?E:x}var v=0,$=0,b=!1,w=!1,y=!1,S=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],C=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h=0,d=1,f=2,p=3,x=4,k=5,A=6,E=7,R=8,_=9,L=10,M=11,T=12,P=13,I=14,O=15,F=16,D=17,N=18,i=[N,N,N,N,N,N,N,N,N,A,k,A,R,k,N,N,N,N,N,N,N,N,N,N,N,N,N,N,k,k,k,A,R,x,x,M,M,M,x,x,x,x,x,L,_,L,_,_,f,f,f,f,f,f,f,f,f,f,_,x,x,x,x,x,x,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,x,x,x,x,x,x,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,x,x,x,x,N,N,N,N,N,N,k,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,_,x,M,M,M,M,x,x,x,x,h,x,x,N,x,x,M,M,f,f,x,h,x,x,x,f,h,x,x,x,x,x],r=[R,R,R,R,R,R,R,R,R,R,R,N,N,N,h,d,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,R,k,P,I,O,F,D,_,M,M,M,M,M,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,_,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,R];l.L=h,l.R=d,l.EN=f,l.ON_R=3,l.AN=4,l.R_H=5,l.B=6,l.RLE=7,l.DOT="·",l.doBidiReorder=function(e,t,n){if(e.length<2)return{};var i=e.split(""),r=new Array(i.length),s=new Array(i.length),o=[];v=n?1:0,function(e,t,n,i){var r=v?C:S,s=null,o=null,a=null,l=0,c=null,u=-1,h=null,d=null,f=[];if(!i)for(h=0,i=[];h<n;h++)i[h]=m(e[h]);for($=v,y=w=b=!1,d=0;d<n;d++){if(s=l,f[d]=o=g(e,i,f,d),c=240&(l=r[s][o]),l&=15,t[d]=a=r[l][5],0<c)if(16==c){for(h=u;h<d;h++)t[h]=1;u=-1}else u=-1;if(r[l][6])-1==u&&(u=d);else if(-1<u){for(h=u;h<d;h++)t[h]=a;u=-1}i[d]==k&&(t[d]=0),$|=a}if(y)for(h=0;h<n;h++)if(i[h]==A){t[h]=v;for(var p=h-1;0<=p&&i[p]==R;p--)t[p]=v}}(i,o,i.length,t);for(var a=0;a<r.length;r[a]=a,a++);c(2,o,r),c(1,o,r);for(a=0;a<r.length-1;a++)t[a]===p?o[a]=l.AN:o[a]===d&&(t[a]>E&&t[a]<P||t[a]===x||t[a]===N)?o[a]=l.ON_R:0<a&&"ل"===i[a-1]&&/\u0622|\u0623|\u0625|\u0627/.test(i[a])&&(o[a-1]=o[a]=l.R_H,a++);i[i.length-1]===l.DOT&&(o[i.length-1]=l.B),"‫"===i[0]&&(o[0]=l.RLE);for(a=0;a<r.length;a++)s[a]=o[r[a]];return{logicalFromVisual:r,bidiLevels:s}},l.hasBidiCharacters=function(e,t){for(var n=!1,i=0;i<e.length;i++)t[i]=m(e.charAt(i)),!n&&(t[i]==d||t[i]==E||t[i]==p)&&(n=!0);return n},l.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,n){"use strict";var a=e("./lib/bidiutil"),l=e("./lib/lang"),i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,r=function(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=a,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=i.test(e.getValue())};(function(){this.isBidiRow=function(e,t,n){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&i.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n=this.session.$getRowCacheIndex(t,this.currentRow);0<=n&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,i=this.session.$getRowCacheIndex(t,this.currentRow);0<this.currentRow-e&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[e];i&&(void 0===t&&(t=this.getSplitIndex()),0<t&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[a.L],this.line=t<i.length?this.line.substring(i[t-1],i[t]):this.line.substring(i[i.length-1])):this.line=this.line.substring(0,i[t])),t==i.length&&(this.line+=this.showInvisibles?n:a.DOT)}else this.line+=this.showInvisibles?n:a.DOT;var r,s=this.session,o=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){return"\t"===e||s.isFullWidth(e.charCodeAt(0))?(r="\t"===e?s.getScreenTabSize(t+o):2,o+=r-1,l.stringRepeat(a.DOT,r)):e}),this.isRtlDir&&(this.fontMetrics.$main.innerHTML=this.line.charAt(this.line.length-1)==a.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];a.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=a.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,n=e.$measureCharWidth("ה");this.charWidths[a.L]=this.charWidths[a.EN]=this.charWidths[a.ON_R]=t,this.charWidths[a.R]=this.charWidths[a.AN]=n,this.charWidths[a.R_H]=.45*n,this.charWidths[a.B]=this.charWidths[a.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir},this.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),i=e.selection.getSelectionAnchor().row;i<=n.row;i++)t||e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:i},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(i,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,n=t<e?this.session.getOverwrite()?e:e-1:t,i=a.getVisualFromLogicalIdx(n,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[i]%2!=0&&i++;for(var o=0;o<i;o++)s+=this.charWidths[r[o]];return!this.session.getOverwrite()&&t<e&&r[i]%2==0&&(s+=this.charWidths[r[i]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},this.getSelections=function(e,t){var n,i=this.bidiMap,r=i.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,u=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f<r.length;f++)d=i.logicalFromVisual[f],n=r[f],(c=a<=d&&d<l)&&!u?h=o:!c&&u&&s.push({left:h,width:o-h}),o+=this.charWidths[n],u=c;if(c&&f===r.length&&s.push({left:h,width:o-h}),this.isRtlDir)for(var p=0;p<s.length;p++)s[p].left+=this.rtlLineOffset;return s},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,n=(e=Math.max(e,0),0),i=0,r=this.bidiMap.bidiLevels,s=this.charWidths[r[i]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);n+s/2<e;){if(n+=s,i===r.length-1){s=0;break}s=this.charWidths[r[++i]]}return 0<i&&r[i-1]%2!=0&&r[i]%2==0?(e<n&&i--,t=this.bidiMap.logicalFromVisual[i]):0<i&&r[i-1]%2==0&&r[i]%2!=0?t=1+(n<e?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===s&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?t=1+this.bidiMap.logicalFromVisual[i]:(0<i&&r[i-1]%2!=0&&0!==s&&i--,t=this.bidiMap.logicalFromVisual[i]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(r.prototype),t.BidiHandler=r}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/lang"),r=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,s=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){i.implement(this,r),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?a.fromPoints(t,t):this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,i=t?e.start:e.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(e,t,n,i){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,i),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,i="number"==typeof e?e:this.lead.row,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,!0===t?new a(i,0,n,this.session.getLine(n).length):new a(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var i=e.column,r=e.column+t;return n<0&&(i=e.column-t,r=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,r).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)0<t.row&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize();t=this.lead;this.wouldMoveIntoSoftTab(t,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),i=this.session.screenToDocumentPosition(n,0),r=this.session.getDisplayLine(e,null,i.row,i.column).match(/^\s*/);r[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(i.column+=r[0].length),this.moveCursorToPosition(i)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var i=n.search(/\s+$/);0<i&&(t.column=i)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(e,t,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(i)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))this.moveCursorTo(e.start.row,e.start.column);else{var i=this.session.getFoldStringAt(t,n,-1);null==i&&(i=this.doc.getLine(t).substring(0,n));var r=o.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(n-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(0<t&&this.moveCursorWordLeft());this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&i.test(t);)n++;if(n<1)for(r.lastIndex=0;(t=e[n])&&!r.test(t);)if(r.lastIndex=0,n++,i.test(t)){if(2<n){n--;break}for(;(t=e[n])&&i.test(t);)n++;if(2<n)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t),r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==n.length){for(var s=this.doc.getLength();e++,i=this.doc.getLine(e),e<s&&/^\s*$/.test(i););/^\s+/.test(i)||(i=""),t=0}var o=this.$shortWordEndIndex(i);this.moveCursorTo(e,t+o)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))return this.moveCursorTo(e.start.row,e.start.column);var i=this.session.getLine(t).substring(0,n);if(0===n){for(;t--,i=this.doc.getLine(t),0<t&&/^\s*$/.test(i););n=i.length,/\s+$/.test(i)||(i="")}var r=o.stringReverse(i),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,n-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column);var r=this.session.screenToDocumentPosition(i.row+e,i.column,n);0!==e&&0===t&&r.row===this.lead.row&&r.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[r.row]&&(0<r.row||0<e)&&r.row++,this.moveCursorTo(r.row,r.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var i=this.session.getFoldAt(e,t,1);i&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(r.charAt(t))&&r.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var i=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return a.fromPoints(t,n)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=a.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(s.prototype),t.Selection=s}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var i=e("./config"),$=2e3,r=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],i=[],r=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l<n.length;l++){var c=n[l];if(c.defaultToken&&(s.defaultToken=c.defaultToken),c.caseInsensitive&&(o="gi"),null!=c.regex){c.regex instanceof RegExp&&(c.regex=c.regex.toString().slice(1,-1));var u=c.regex,h=new RegExp("(?:("+u+")|(.))").exec("a").length-2;Array.isArray(c.token)?1==c.token.length||1==h?c.token=c.token[0]:h-1!=c.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:h-1}),c.token=c.token[0]):(c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens):"function"==typeof c.token&&!c.onMatch&&(c.onMatch=1<h?this.$applyToken:c.token),1<h&&(/\\\d/.test(c.regex)?u=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+r+1)}):(h=1,u=this.removeCapturingGroups(c.regex)),!c.splitRegex&&"string"!=typeof c.token&&a.push(c)),s[r]=l,r+=h,i.push(u),c.onMatch||(c.onMatch=null)}}i.length||(s[0]=0,i.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){$=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var i=[],r=0,s=n.length;r<s;r++)t[r]&&(i[i.length]={type:n[r],value:t[r]});return i},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var n=[],i=this.tokenArray,r=0,s=i.length;r<s;r++)t[r+1]&&(n[n.length]={type:i[r],value:t[r+1]});return n},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e})},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var o=0,a=!1,l={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,n,i,r,s){return a?a="]"!=r:r?a=!0:i?(o==l.stack&&(l.end=s+1,l.stack=-1),o--):n&&(o++,1!=n.length&&(l.stack=o,l.start=s)),e}),null!=l.end&&/^\)*$/.test(e.substr(l.end))&&(e=e.substring(0,l.start)+e.substr(l.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t)"#tmp"===(t=(n=t.slice(0))[0])&&(n.shift(),t=n.shift());else var n=[];var i=t||"start",r=this.states[i];r||(i="start",r=this.states[i]);for(var s,o=this.matchMappings[i],a=this.regExps[i],l=[],c=a.lastIndex=0,u=0,h={type:null,value:""};s=a.exec(e);){var d=o.defaultToken,f=null,p=s[0],g=a.lastIndex;if(g-p.length>c){var m=e.substring(c,g-p.length);h.type==d?h.value+=m:(h.type&&l.push(h),h={type:d,value:m})}for(var v=0;v<s.length-2;v++)if(void 0!==s[v+1]){d=(f=r[o[v]]).onMatch?f.onMatch(p,i,n,e):f.token,f.next&&(i="string"==typeof f.next?f.next:f.next(i,n),(r=this.states[i])||(this.reportError("state doesn't exist",i),i="start",r=this.states[i]),o=this.matchMappings[i],c=g,(a=this.regExps[i]).lastIndex=g),f.consumeLineEnd&&(c=g);break}if(p)if("string"==typeof d)f&&!1===f.merge||h.type!==d?(h.type&&l.push(h),h={type:d,value:p}):h.value+=p;else if(d){h.type&&l.push(h),h={type:null,value:""};for(v=0;v<d.length;v++)l.push(d[v])}if(c==e.length)break;if(c=g,u++>$){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c<e.length;)h.type&&l.push(h),h={value:e.substring(c,c+=2e3),type:"overflow"};i="start",n=[];break}}return h.type&&l.push(h),1<n.length&&n[0]!==i&&n.unshift("#tmp",i),{tokens:l,state:n.length?n:i}},this.reportError=i.reportError}).call(r.prototype),t.Tokenizer=r}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var c=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var i=e[n],r=0;r<i.length;r++){var s=i[r];(s.next||s.onMatch)&&("string"==typeof s.next&&0!==s.next.indexOf(t)&&(s.next=t+s.next),s.nextState&&0!==s.nextState.indexOf(t)&&(s.nextState=t+s.nextState))}this.$rules[t+n]=i}else for(var n in e)this.$rules[n]=e[n]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,r){var s="function"==typeof e?(new e).getRules():e;if(i)for(var o=0;o<i.length;o++)i[o]=t+i[o];else for(var a in i=[],s)i.push(t+a);if(this.addRules(s,t),n){var l=Array.prototype[r?"push":"unshift"];for(o=0;o<i.length;o++)l.apply(this.$rules[i[o]],c.deepCopy(n))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var f=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},p=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){var h=0,d=this.$rules;Object.keys(d).forEach(function e(t){var n=d[t];n.processed=!0;for(var i=0;i<n.length;i++){var r=n[i],s=null;Array.isArray(r)&&(s=r,r={}),!r.regex&&r.start&&(r.regex=r.start,r.next||(r.next=[]),r.next.push({defaultToken:r.token},{token:r.token+".end",regex:r.end||r.start,next:"pop"}),r.token=r.token+".start",r.push=!0);var o=r.next||r.push;if(o&&Array.isArray(o)){var a=r.stateName;a||("string"!=typeof(a=r.token)&&(a=a[0]||""),d[a]&&(a+=h++)),d[a]=o,e(r.next=a)}else"pop"==o&&(r.next=p);if(r.push&&(r.nextState=r.next||r.push,r.next=f,delete r.push),r.rules)for(var l in r.rules)d[l]?d[l].push&&d[l].push.apply(d[l],r.rules[l]):d[l]=r.rules[l];var c="string"==typeof r?r:r.include;if(c&&(s=Array.isArray(c)?c.map(function(e){return d[e]}):d[c]),s){var u=[i,1].concat(s);r.noEscape&&(u=u.filter(function(e){return!e.next})),n.splice.apply(n,u),i--}r.keywordMap&&(r.token=this.createKeywordMapper(r.keywordMap,r.defaultToken||"text",r.caseInsensitive),delete r.defaultToken)}},this)},this.createKeywordMapper=function(r,t,s,o){var a=Object.create(null);return Object.keys(r).forEach(function(e){var t=r[e];s&&(t=t.toLowerCase());for(var n=t.split(o||"|"),i=n.length;i--;)a[n[i]]=e}),Object.getPrototypeOf(a)&&(a.__proto__=null),this.$keywordList=Object.keys(a),r=null,s?function(e){return a[e.toLowerCase()]||t}:function(e){return a[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,n){"use strict";var i=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var n=(new e).getBehaviours(t);else n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(!e)return this.$behaviours;for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}}).call(i.prototype),t.Behaviour=i}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,n){"use strict";var i=e("./range").Range,r=function(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var i=e.getTokenAt(t,n);this.$tokenIndex=i?i.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;0<t;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new i(this.$row,t,this.$row,t+e.value.length)}}).call(r.prototype),t.TokenIterator=r}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var p,i=e("../../lib/oop"),r=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,g=e("../../lib/lang"),o=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],l={},y={'"':'"',"'":"'"},S=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount})),l[t])return p=l[t];p=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},C=function(e,t,n,i){var r=e.end.row-e.start.row;return{text:n+t+i,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}},m=function(f){this.add("braces","insertion",function(e,t,n,i,r){var s=n.getCursorPosition(),o=i.doc.getLine(s.row);if("{"==r){S(n);var a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(""!==l&&"{"!==l&&n.getWrapBehavioursEnabled())return C(a,l,"{","}");if(m.isSaneInsertion(n,i))return/[\]\}\)]/.test(o[s.column])||n.inMultiSelectMode||f&&f.braces?(m.recordAutoInsert(n,i,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,i,"{"),{text:"{",selection:[1,1]})}else if("}"==r){if(S(n),"}"==o.substring(s.column,s.column+1))if(null!==i.$findOpeningBracket("}",{column:s.column+1,row:s.row})&&m.isAutoInsertedClosing(s,o,r))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==r||"\r\n"==r){S(n);var c="";if(m.isMaybeInsertedClosing(s,o)&&(c=g.stringRepeat("}",p.maybeInsertedBrackets),m.clearMaybeInsertedClosing()),"}"===o.substring(s.column,s.column+1)){var u=i.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!u)return null;var h=this.$getIndent(i.getLine(u.row))}else{if(!c)return void m.clearMaybeInsertedClosing();h=this.$getIndent(o)}var d=h+i.getTabString();return{text:"\n"+d+"\n"+h+c,selection:[1,d.length,1,d.length]}}m.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==s){if(S(n),"}"==i.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;p.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,i,r){if("("==r){S(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return C(s,o,"(",")");if(m.isSaneInsertion(n,i))return m.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==r){S(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1))if(null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&m.isAutoInsertedClosing(a,l,r))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(S(n),")"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("brackets","insertion",function(e,t,n,i,r){if("["==r){S(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return C(s,o,"[","]");if(m.isSaneInsertion(n,i))return m.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){S(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1))if(null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&m.isAutoInsertedClosing(a,l,r))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(S(n),"]"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("string_dquotes","insertion",function(e,t,n,i,r){var s=i.$mode.$quotes||y;if(1==r.length&&s[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;S(n);var o=r,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(""!==l&&(1!=l.length||!s[l])&&n.getWrapBehavioursEnabled())return C(a,l,o,o);if(!l){var c=n.getCursorPosition(),u=i.doc.getLine(c.row),h=u.substring(c.column-1,c.column),d=u.substring(c.column,c.column+1),f=i.getTokenAt(c.row,c.column),p=i.getTokenAt(c.row,c.column+1);if("\\"==h&&f&&/escape/.test(f.type))return null;var g,m=f&&/string|escape/.test(f.type),v=!p||/string|escape/.test(p.type);if(d==o)(g=m!==v)&&/string\.end/.test(p.type)&&(g=!1);else{if(m&&!v)return null;if(m&&v)return null;var $=i.$mode.tokenRe;$.lastIndex=0;var b=$.test(h);$.lastIndex=0;var w=$.test(h);if(b||w)return null;if(d&&!/[\s;,.})\]\\]/.test(d))return null;g=!0}return{text:g?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,i,r){var s=i.$mode.$quotes||y,o=i.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)&&(S(n),i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==o))return r.end.column++,r})};m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),i=new s(t,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",o)){var r=new s(t,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",o))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return-1<t.indexOf(e.type||e)},m.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),r=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,r,p.autoInsertedLineEnd[0])||(p.autoInsertedBrackets=0),p.autoInsertedRow=i.row,p.autoInsertedLineEnd=n+r.substr(i.column),p.autoInsertedBrackets++},m.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),r=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,r)||(p.maybeInsertedBrackets=0),p.maybeInsertedRow=i.row,p.maybeInsertedLineStart=r.substr(0,i.column)+n,p.maybeInsertedLineEnd=r.substr(i.column),p.maybeInsertedBrackets++},m.isAutoInsertedClosing=function(e,t,n){return 0<p.autoInsertedBrackets&&e.row===p.autoInsertedRow&&n===p.autoInsertedLineEnd[0]&&t.substr(e.column)===p.autoInsertedLineEnd},m.isMaybeInsertedClosing=function(e,t){return 0<p.maybeInsertedBrackets&&e.row===p.maybeInsertedRow&&t.substr(e.column)===p.maybeInsertedLineEnd&&t.substr(0,e.column)==p.maybeInsertedLineStart},m.popAutoInsertedClosing=function(){p.autoInsertedLineEnd=p.autoInsertedLineEnd.substr(1),p.autoInsertedBrackets--},m.clearMaybeInsertedClosing=function(){p&&(p.maybeInsertedBrackets=0,p.maybeInsertedRow=-1)},i.inherits(m,r),t.CstyleBehaviour=m}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,s=[],o=0;o<i.length;o+=2)s.push(r+=i[o]),i[o+1]&&s.push(45,r+=i[o+1]);t.wordChars=String.fromCharCode.apply(null,s)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var o=e("../config"),i=e("../tokenizer").Tokenizer,r=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour/cstyle").CstyleBehaviour,a=e("../unicode"),y=e("../lib/lang"),g=e("../token_iterator").TokenIterator,m=e("../range").Range,l=function(){this.HighlightRules=r};(function(){this.$defaultBehaviour=new s,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new i(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,r,n,i){function t(e){for(var t=n;t<=i;t++)e(s.getLine(t),t)}var s=r.doc,o=!0,a=!0,l=1/0,c=r.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))g=this.lineCommentStart.map(y.escapeRegExp).join("|"),f=this.lineCommentStart[0];else g=y.escapeRegExp(this.lineCommentStart),f=this.lineCommentStart;g=new RegExp("^(\\s*)(?:"+g+") ?"),u=r.getUseSoftTabs();$=function(e,t){var n=e.match(g);if(n){var i=n[1].length,r=n[0].length;!d(e,i,r)&&" "==n[0][r-1]&&r--,s.removeInLine(t,i,r)}};var h=f+" ",d=(v=function(e,t){o&&!/\S/.test(e)||(d(e,l,l)?s.insertInLine({row:t,column:l},h):s.insertInLine({row:t,column:l},f))},b=function(e,t){return g.test(e)},function(e,t,n){for(var i=0;t--&&" "==e.charAt(t);)i++;if(i%c!=0)return!1;for(i=0;" "==e.charAt(n++);)i++;return 2<c?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+y.escapeRegExp(f)+")"),m=new RegExp("(?:"+y.escapeRegExp(p)+")\\s*$"),v=function(e,t){b(e,t)||o&&!/\S/.test(e)||(s.insertInLine({row:t,column:e.length},p),s.insertInLine({row:t,column:l},f))},$=function(e,t){var n;(n=e.match(m))&&s.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(g))&&s.removeInLine(t,n[1].length,n[0].length)},b=function(e,t){if(g.test(e))return!0;for(var n=r.getTokens(t),i=0;i<n.length;i++)if("comment"===n[i].type)return!0}}var w=1/0;t(function(e,t){var n=e.search(/\S/);-1!==n?(n<l&&(l=n),a&&!b(e,t)&&(a=!1)):w>e.length&&(w=e.length)}),l==1/0&&(l=w,a=o=!1),u&&l%c!=0&&(l=Math.floor(l/c)*c),t(a?$:v)},this.toggleBlockComment=function(e,t,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var s,o,a=(f=new g(t,i.row,i.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var c,u;a&&/comment/.test(a.type);){if(-1!=(p=a.value.indexOf(r.start))){var h=f.getCurrentTokenRow(),d=f.getCurrentTokenColumn()+p;c=new m(h,d,h,d+r.start.length);break}a=f.stepBackward()}var f;for(a=(f=new g(t,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var p;if(-1!=(p=a.value.indexOf(r.end))){h=f.getCurrentTokenRow(),d=f.getCurrentTokenColumn()+p;u=new m(h,d,h,d+r.end.length);break}a=f.stepForward()}u&&t.remove(u),c&&(t.remove(c),s=c.start.row,o=-r.start.length)}else o=r.start.length,s=n.start.row,t.insert(n.end,r.end),t.insert(n.start,r.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var i in this.$embeds=[],this.$modes={},e)if(e[i]){var t=e[i],n=t.prototype.$id,r=o.$modes[n];r||(o.$modes[n]=r=new t),o.$modes[i]||(o.$modes[i]=r),this.$embeds.push(i),this.$modes[i]=r}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(i=0;i<s.length;i++)!function(e){var t=s[i],n=e[t];e[s[i]]=function(){return this.$delegator(t,arguments,n)}}(this)},this.$delegator=function(e,t,n){var i=t[0];if("string"!=typeof i){if(Array.isArray(i[2])){var r=i[2][i[2].length-1];if(o=this.$modes[r])return o[e].apply(o,[i[1]].concat([].slice.call(t,1)))}i=i[0]}for(var s=0;s<this.$embeds.length;s++)if(this.$modes[this.$embeds[s]]){var o,a=i.split(this.$embeds[s]);if(!a[0]&&a[1])return t[0]=a[1],(o=this.$modes[this.$embeds[s]])[e].apply(o,t)}var l=n.apply(this,t);return n?l:void 0},this.transformAction=function(e,t,n,i,r){if(this.$behaviour){var s=this.$behaviour.getBehaviours();for(var o in s)if(s[o][t]){var a=s[o][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(var i in t)for(var r=t[i],s=0,o=r.length;s<o;s++)if("string"==typeof r[s].token)/keyword|support|storage/.test(r[s].token)&&n.push(r[s].regex);else if("object"==typeof r[s].token)for(var a=0,l=r[s].token.length;a<l;a++)if(/keyword|support|storage/.test(r[s].token[a])){i=r[s].regex.match(/\(.+?\)/g)[a];n.push(i.substr(1,i.length-2))}this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,n,i){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(l.prototype),t.Mode=l}),ace.define("ace/apply_delta",["require","exports","module"],function(e,t,n){"use strict";t.applyDelta=function(e,t,n){var i=t.start.row,r=t.start.column,s=e[i]||"";switch(t.action){case"insert":if(1===t.lines.length)e[i]=s.substring(0,r)+t.lines[0]+s.substring(r);else{var o=[i,1].concat(t.lines);e.splice.apply(e,o),e[i]=s.substring(0,r)+e[i],e[i+t.lines.length-1]+=s.substring(r)}break;case"remove":var a=t.end.column,l=t.end.row;i===l?e[i]=s.substring(0,r)+s.substring(a):e.splice(i,l-i+1,s.substring(0,r)+e[l].substring(a))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function u(e,t,n){var i=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&i}i.implement(this,r),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var t,n,i,r,s,o,a,l,c=(t=e,n={row:this.row,column:this.column},i=this.$insertRight,r="insert"==t.action,s=(r?1:-1)*(t.end.row-t.start.row),o=(r?1:-1)*(t.end.column-t.start.column),a=t.start,l=r?a:t.end,u(n,a,i)?{row:n.row,column:n.column}:u(l,n,!i)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column});this.setPosition(c.row,c.column,!0)}},this.setPosition=function(e,t,n){var i;if(i=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=i.row||this.column!=i.column){var r={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:r,value:i})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,u=e("./range").Range,o=e("./anchor").Anchor,a=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){i.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new u(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),i=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[t]},!0),this.clonePos(i)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:n<=e&&(e=n-1,t=void 0);var i=this.getLine(e);return null==t&&(t=i.length),{row:e,column:t=Math.min(Math.max(t,0),i.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},this.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),i={row:n.row+t.length-1,column:(1==t.length?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:i,action:"insert",lines:t}),this.clonePos(i)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},this.removeInLine=function(e,t,n){var i=this.clippedPos(e,t),r=this.clippedPos(e,n);return this.applyDelta({start:i,end:r,action:"remove",lines:this.getLinesForRange({start:i,end:r})},!0),this.clonePos(i)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var n=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&0<e,i=t<this.getLength()-1,r=n?e-1:e,s=n?this.getLine(r).length:0,o=i?t+1:t,a=i?0:this.getLine(o).length,l=new u(r,s,o,a),c=this.$lines.slice(e,t+1);return this.applyDelta({start:l.start,end:l.end,action:"remove",lines:this.getLinesForRange(l)}),c},this.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof u||(e=u.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!u.comparePoints(e.start,e.end))||(n&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(r(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,i=n.length-t+1,r=e.start.row,s=e.start.column,o=0,a=0;o<i;o=a){a+=t-1;var l=n.slice(o,a);l.push(""),this.applyDelta({start:this.pos(r+o,s),end:this.pos(r+a,s=0),action:e.action,lines:l},!0)}e.lines=n.slice(o),e.start.row=r+o,e.start.column=s,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,r=t||0,s=n.length;r<s;r++)if((e-=n[r].length+i)<0)return{row:r,column:e+n[r].length+i};return{row:s-1,column:e+n[s-1].length+i}},this.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,r=0,s=Math.min(e.row,n.length),o=t||0;o<s;++o)r+=n[o].length+i;return r+e.column}}).call(a.prototype),t.Document=a}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,s=function(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var a=this;this.$worker=function(){if(a.running){for(var e=new Date,t=a.currentLine,n=-1,i=a.doc,r=t;a.lines[t];)t++;var s=i.getLength(),o=0;for(a.running=!1;t<s;){for(a.$tokenizeRow(t),n=t;t++,a.lines[t];);if(++o%5==0&&20<new Date-e){a.running=setTimeout(a.$worker,20);break}}a.currentLine=t,-1==n&&(n=t),r<=n&&a.fireUpdateEvent(r,n)}}};(function(){i.implement(this,r),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],i=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=i.state+""?(this.states[e]=i.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=i.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var c=e("./lib/lang"),u=(e("./lib/oop"),e("./range").Range),i=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,i){if(this.regExp)for(var r=i.firstRow,s=i.lastRow,o=r;o<=s;o++){var a=this.cache[o];null==a&&((a=c.getMatchOffsets(n.getLine(o),this.regExp)).length>this.MAX_RANGES&&(a=a.slice(0,this.MAX_RANGES)),a=a.map(function(e){return new u(o,e.offset,o,e.offset+e.length)}),this.cache[o]=a.length?a:"");for(var l=a.length;l--;)t.drawSingleLineMarker(e,a[l].toScreenRange(n),this.clazz,i)}}}).call(i.prototype),t.SearchHighlight=i}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";function c(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new i(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var i=e("../range").Range;(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),0<this.range.compareEnd(e.start.row,e.start.column)?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var i,r,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l<o.length;l++){if(-1==(r=(i=o[l]).range.compareStart(t,n)))return void e(null,t,n,s,a);if(!e(null,i.start.row,i.start.column,s,a)&&e(i.placeholder,i.start.row,i.start.column,s)||0===r)return;a=!i.sameRow,s=i.end.column}e(null,t,n,s,a)},this.getNextFoldTo=function(e,t){for(var n,i,r=0;r<this.folds.length;r++){if(-1==(i=(n=this.folds[r]).range.compareEnd(e,t)))return{fold:n,kind:"after"};if(0===i)return{fold:n,kind:"inside"}}return null},this.addRemoveChars=function(e,t,n){var i,r,s=this.getNextFoldTo(e,t);if(s)if(i=s.fold,"inside"==s.kind&&i.start.column!=t&&i.start.row!=e)window.console&&window.console.log(e,t,i);else if(i.start.row==e){var o=(r=this.folds).indexOf(i);for(0===o&&(this.start.column+=n);o<r.length;o++){if((i=r[o]).start.column+=n,!i.sameRow)return;i.end.column+=n}this.end.column+=n}},this.split=function(e,t){var n=this.getNextFoldTo(e,t);if(!n||"inside"==n.kind)return null;var i=n.fold,r=this.folds,s=this.foldData,o=r.indexOf(i),a=r[o-1];this.end.row=a.end.row,this.end.column=a.end.column;var l=new c(s,r=r.splice(o,r.length-o));return s.splice(s.indexOf(this)+1,0,l),l},this.merge=function(e){for(var t=e.folds,n=0;n<t.length;n++)this.addFold(t[n]);var i=this.foldData;i.splice(i.indexOf(e),1)},this.toString=function(){var t=[this.range.toString()+": ["];return this.folds.forEach(function(e){t.push("  "+e.toString())}),t.push("]"),t.join("\n")},this.idxToPosition=function(e){for(var t=0,n=0;n<this.folds.length;n++){var i=this.folds[n];if((e-=i.start.column-t)<0)return{row:i.start.row,column:i.start.column+e};if((e-=i.placeholder.length)<0)return i.start;t=i.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(c.prototype),t.FoldLine=c}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,n){"use strict";var l=e("./range").Range.comparePoints,i=function(){this.ranges=[]};(function(){this.comparePoints=l,this.pointIndex=function(e,t,n){for(var i=this.ranges,r=n||0;r<i.length;r++){var s=i[r],o=l(e,s.end);if(!(0<o)){var a=l(e,s.start);return 0===o?t&&0!==a?-r-2:r:0<a||0===a&&!t?r:-r-1}}return-r-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var i=this.pointIndex(e.end,t,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(0<=t)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return l(e.start,t.start)}))[0],r=1;r<n.length;r++){e=i,i=n[r];var s=l(e.end,i.start);s<0||(0!=s||e.isEmpty()||i.isEmpty())&&(l(e.end,i.end)<0&&(e.end.row=i.end.row,e.end.column=i.end.column),n.splice(r,1),t.push(i),i=e,r--)}return this.ranges=n,t},this.contains=function(e,t){return 0<=this.pointIndex({row:e,column:t})},this.containsPoint=function(e){return 0<=this.pointIndex(e)},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(0<=t)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];var i=this.pointIndex({row:e,column:0});i<0&&(i=-i-1);var r=this.pointIndex({row:t,column:0},i);r<0&&(r=-r-1);for(var s=[],o=i;o<r;o++)s.push(n[o]);return s},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,n=e.end,i=t.row,r=n.row,s=this.ranges,o=0,a=s.length;o<a;o++){if((u=s[o]).end.row>=i)break}if("insert"==e.action)for(var l=r-i,c=-t.column+n.column;o<a;o++){if((u=s[o]).start.row>i)break;if(u.start.row==i&&u.start.column>=t.column&&(u.start.column!=t.column||!this.$insertRight)&&(u.start.column+=c,u.start.row+=l),u.end.row==i&&u.end.column>=t.column){if(u.end.column==t.column&&this.$insertRight)continue;u.end.column==t.column&&0<c&&o<a-1&&u.end.column>u.start.column&&u.end.column==s[o+1].start.column&&(u.end.column-=c),u.end.column+=c,u.end.row+=l}}else for(l=i-r,c=t.column-n.column;o<a;o++){if((u=s[o]).start.row>r)break;u.end.row<r&&(i<u.end.row||i==u.end.row&&t.column<u.end.column)?(u.end.row=i,u.end.column=t.column):u.end.row==r?u.end.column<=n.column?(l||u.end.column>t.column)&&(u.end.column=t.column,u.end.row=t.row):(u.end.column+=c,u.end.row+=l):u.end.row>r&&(u.end.row+=l),u.start.row<r&&(i<u.start.row||i==u.start.row&&t.column<u.start.column)?(u.start.row=i,u.start.column=t.column):u.start.row==r?u.start.column<=n.column?(l||u.start.column>t.column)&&(u.start.column=t.column,u.start.row=t.row):(u.start.column+=c,u.start.row+=l):u.start.row>r&&(u.start.row+=l)}if(0!=l&&o<a)for(;o<a;o++){var u;(u=s[o]).start.row+=l,u.end.row+=l}}}).call(i.prototype),t.RangeList=i}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"],function(e,t,n){"use strict";function c(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function i(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}e("../range").Range;var r=e("../range_list").RangeList,s=e("../lib/oop"),o=t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]};s.inherits(o,r),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(t){this.foldLine=t,this.subFolds.forEach(function(e){e.setFoldLine(t)})},this.clone=function(){var e=this.range.clone(),t=new o(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){if(!this.range.containsRange(e))throw new Error("A fold can't intersect already existing fold"+e.range+this.range);var t,n;t=e,n=this.start,c(t.start,n),c(t.end,n);for(var i=e.start.row,r=e.start.column,s=0,o=-1;s<this.subFolds.length&&1==(o=this.subFolds[s].range.compare(i,r));s++);var a=this.subFolds[s];if(0==o)return a.addSubFold(e);i=e.range.end.row,r=e.range.end.column;var l=s;for(o=-1;l<this.subFolds.length&&1==(o=this.subFolds[l].range.compare(i,r));l++);this.subFolds[l];if(0==o)throw new Error("A fold can't intersect already existing fold"+e.range+this.range);this.subFolds.splice(s,l-s,e);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return t=e,n=this.start,i(t.start,n),void i(t.end,n);var t,n}}.call(o.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,n){"use strict";var u=e("../range").Range,g=e("./fold_line").FoldLine,m=e("./fold").Fold,h=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,n){var i=this.getFoldLine(e);if(!i)return null;for(var r=i.folds,s=0;s<r.length;s++){var o=r[s];if(o.range.contains(e,t)){if(1==n&&o.range.isEnd(e,t))continue;if(-1==n&&o.range.isStart(e,t))continue;return o}}},this.getFoldsInRange=function(e){var t=e.start,n=e.end,i=this.$foldData,r=[];t.column+=1,n.column-=1;for(var s=0;s<i.length;s++){var o=i[s].range.compareRange(e);if(2!=o){if(-2==o)break;for(var a=i[s].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(o=c.range.compareRange(e)))break;if(2!=o){if(42==o)break;r.push(c)}}}}return t.column-=1,n.column+=1,r},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,n=0;n<t.length;n++)for(var i=0;i<t[n].folds.length;i++)e.push(t[n].folds[i]);return e},this.getFoldStringAt=function(e,t,n,i){if(!(i=i||this.getFoldLine(e)))return null;for(var r,s,o={end:{column:0}},a=0;a<i.folds.length;a++){var l=(s=i.folds[a]).range.compareEnd(e,t);if(-1==l){r=this.getLine(s.start.row).substring(o.end.column,s.start.column);break}if(0===l)return null;o=s}return r||(r=this.getLine(s.start.row).substring(o.end.column)),-1==n?r.substring(0,t-o.end.column):1==n?r.substring(t-o.end.column):r},this.getFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0);i<n.length;i++){var r=n[i];if(r.start.row<=e&&r.end.row>=e)return r;if(r.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0);i<n.length;i++){var r=n[i];if(r.end.row>=e)return r}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,i=t-e+1,r=0;r<n.length;r++){var s=n[r],o=s.end.row,a=s.start.row;if(t<=o){a<t&&(e<=a?i-=t-a:i=0);break}e<=o&&(i-=e<=a?o-a:o-e+1)}return i},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,i=this.$foldData,r=!1;e instanceof m?n=e:(n=new m(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var s=n.start.row,o=n.start.column,a=n.end.row,l=n.end.column;if(s<a||s==a&&o<=l-2){var c=this.getFoldAt(s,o,1),u=this.getFoldAt(a,l,-1);if(c&&u==c)return c.addSubFold(n);c&&!c.range.isStart(s,o)&&this.removeFold(c),u&&!u.range.isEnd(a,l)&&this.removeFold(u);var h=this.getFoldsInRange(n.range);0<h.length&&(this.removeFolds(h),h.forEach(function(e){n.addSubFold(e)}));for(var d=0;d<i.length;d++){var f=i[d];if(a==f.start.row){f.addFold(n),r=!0;break}if(s==f.end.row){if(f.addFold(n),r=!0,!n.sameRow){var p=i[d+1];if(p&&p.start.row==a){f.merge(p);break}}break}if(a<=f.start.row)break}return r||(f=this.$addFoldLine(new g(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(f.start.row,f.start.row):this.$updateRowLengthCache(f.start.row,f.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n}throw new Error("The range has to be at least 2 characters width")},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,i=t.end.row,r=this.$foldData,s=t.folds;if(1==s.length)r.splice(r.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))s.pop(),t.end.row=s[s.length-1].end.row,t.end.column=s[s.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))s.shift(),t.start.row=s[0].start.row,t.start.column=s[0].start.column;else if(e.sameRow)s.splice(s.indexOf(e),1);else{var o=t.split(e.start.row,e.start.column);(s=o.folds).shift(),o.start.row=s[0].start.row,o.start.column=s[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,i):this.$updateRowLengthCache(n,i)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(t){this.removeFold(t),t.subFolds.forEach(function(e){t.restoreRange(e),this.addFold(e)},this),0<t.collapseChildren&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new u(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new u(e,0,e,this.getLine(e).length):"row"in e?u.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var r=i;r.length;)this.expandFolds(r),r=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,s){null==r&&(r=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var o=this.doc,a="";return e.walk(function(e,t,n,i){if(!(t<r)){if(t==r){if(n<s)return;i=Math.max(s,i)}a+=null!=e?e:o.getLine(t).substring(i,n)}},t,n),a},this.getDisplayLine=function(e,t,n,i){var r,s=this.getFoldLine(e);return s?this.getFoldDisplayLine(s,e,t,n,i):(r=this.doc.getLine(e)).substring(i||0,t||r.length)},this.$cloneFoldData=function(){var n=[];return n=this.$foldData.map(function(e){var t=e.folds.map(function(e){return e.clone()});return new g(n,t)})},this.toggleFold=function(e){var t,n,i=this.selection.getRange();if(i.isEmpty()){var r=i.start;if(t=this.getFoldAt(r.row,r.column))return void this.expandFold(t);(n=this.findMatchingBracket(r))?1==i.comparePoint(n)?i.end=n:(i.start=n,i.start.column++,i.end.column--):(n=this.findMatchingBracket({row:r.row,column:r.column+1}))?(1==i.comparePoint(n)?i.end=n:i.start=n,i.start.column++):i=this.getCommentFoldRange(r.row,r.column)||i}else{var s=this.getFoldsInRange(i);if(e&&s.length)return void this.expandFolds(s);1==s.length&&(t=s[0])}if(t||(t=this.getFoldAt(i.start.row,i.start.column)),t&&t.range.toString()==i.toString())this.expandFold(t);else{var o="...";if(!i.isMultiLine()){if((o=this.getTextRange(i)).length<4)return;o=o.trim().substring(0,2)+".."}this.addFold(o,i)}},this.getCommentFoldRange=function(e,t,n){var i=new h(this,e,t),r=i.getCurrentToken(),s=r.type;if(r&&/^comment|string/.test(s)){"comment"==(s=s.match(/comment|string/)[0])&&(s+="|doc-start");var o=new RegExp(s),a=new u;if(1!=n){for(;(r=i.stepBackward())&&o.test(r.type););i.stepForward()}if(a.start.row=i.getCurrentTokenRow(),a.start.column=i.getCurrentTokenColumn()+2,i=new h(this,e,t),-1!=n){var l=-1;do{if(r=i.stepForward(),-1==l){var c=this.getState(i.$row);o.test(c)||(l=i.$row)}else if(i.$row>l)break}while(r&&o.test(r.type));r=i.stepBackward()}else r=i.getCurrentToken();return a.end.row=i.getCurrentTokenRow(),a.end.column=i.getCurrentTokenColumn()+r.value.length-2,a}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var i=this.foldWidgets;if(i){t=t||this.getLength();for(var r=e=e||0;r<t;r++)if(null==i[r]&&(i[r]=this.getFoldWidget(r)),"start"==i[r]){var s=this.getFoldWidgetRange(r);if(s&&s.isMultiLine()&&s.end.row<=t&&s.start.row>=e){r=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){"manual"==(this.$foldStyle=e)&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var i,r=e-1;0<=r;){var s=n[r];if(null==s&&(s=n[r]=this.getFoldWidget(r)),"start"==s){var o=this.getFoldWidgetRange(r);if(i||(i=o),o&&o.end.row>=e)break}r--}return{range:-1!==r&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),i=this.getLine(e),r="end"===n?-1:1,s=this.getFoldAt(e,-1===r?0:i.length,r);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=o?o.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var i=this.getParentFoldRangeData(t,!0);if(n=i.range||i.firstRange){t=n.start.row;var r=this.getFoldAt(t,this.getLine(t).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var h=e("../token_iterator").TokenIterator,a=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),i=!0,r=n.charAt(e.column-1),s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(s||(r=n.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(/([\(\[\{])|([\)\]\}])/),i=!1),!s)return null;if(s[1]){if(!(o=this.$findClosingBracket(s[1],e)))return null;t=a.fromPoints(e,o),i||(t.end.column++,t.start.column--),t.cursor=t.end}else{var o;if(!(o=this.$findOpeningBracket(s[2],e)))return null;t=a.fromPoints(o,e),i||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],r=1,s=new h(this,t.row,t.column),o=s.getCurrentToken();if(o||(o=s.stepForward()),o){n||(n=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var a=t.column-s.getCurrentTokenColumn()-2,l=o.value;;){for(;0<=a;){var c=l.charAt(a);if(c==i){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}else c==e&&(r+=1);a-=1}for(;(o=s.stepBackward())&&!n.test(o.type););if(null==o)break;a=(l=o.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],r=1,s=new h(this,t.row,t.column),o=s.getCurrentToken();if(o||(o=s.stepForward()),o){n||(n=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var a=t.column-s.getCurrentTokenColumn();;){for(var l=o.value,c=l.length;a<c;){var u=l.charAt(a);if(u==i){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}else u==e&&(r+=1);a+=1}for(;(o=s.stepForward())&&!n.test(o.type););if(null==o)break;a=0}return null}}}}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/lang"),s=e("./bidihandler").BidiHandler,o=e("./config"),l=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,c=e("./mode/text").Mode,u=e("./range").Range,h=e("./document").Document,d=e("./background_tokenizer").BackgroundTokenizer,f=e("./search_highlight").SearchHighlight,p=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++p.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new h(e)),this.setDocument(e),this.selection=new a(this),this.$bidiHandler=new s(this),o.resetOptions(this),this.setMode(t),o._signal("session",this)};p.$uid=0,function(){function a(e){return!(e<4352)&&(4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12288<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510)}i.implement(this,l),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),(this.doc=e).on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;n<t&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,i=e.length-1;n<=i;){var r=n+i>>1,s=e[r];if(s<t)n=r+1;else{if(!(t<s))return r;i=r-1}}return n-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},this.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var n,i=this.bgTokenizer.getTokens(e),r=0;if(null==t){var s=i.length-1;r=this.getLine(e).length}else for(s=0;s<i.length&&!(t<=(r+=i[s].value.length));s++);return(n=i[s])?(n.index=s,n.start=r-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,n,i){var r=this.$markerId++,s={range:e,type:n||"line",renderer:"function"==typeof n?n:null,clazz:t,inFront:!!i,id:r};return i?(this.$frontMarkers[r]=s,this._signal("changeFrontMarker")):(this.$backMarkers[r]=s,this._signal("changeBackMarker")),r},this.addDynamicMarker=function(e,t){if(e.update){var n=this.$markerId++;return e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._signal("changeFrontMarker")):(this.$backMarkers[n]=e,this._signal("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,n,i){"number"!=typeof t&&(n=t,t=e),n||(n="ace_step");var r=new u(e,0,t,1/0);return r.id=this.addMarker(r,n,"fullLine",i),r},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var n=this.getLine(e),i=!1;if(0<t&&(i=!!n.charAt(t-1).match(this.tokenRe)),i||(i=!!n.charAt(t).match(this.tokenRe)),i)var r=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))r=/\s/;else r=this.nonTokenRe;var s=t;if(0<s){for(;0<=--s&&n.charAt(s).match(r););s++}for(var o=t;o<n.length&&n.charAt(o).match(r);)o++;return new u(e,s,e,o)},this.getAWordRange=function(e,t){for(var n=this.getWordRange(e,t),i=this.getLine(n.end.row);i.charAt(n.end.column).match(/[ \t]/);)n.end.column+=1;return n},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=o.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var n=e,i=n.path}else i=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[i]&&!n)return this.$onChangeMode(this.$modes[i]),void(t&&t());this.$modeId=i,o.loadModule(["mode",i],function(e){if(this.$modeId!==i)return t&&t();this.$modes[i]&&!n?this.$onChangeMode(this.$modes[i]):e&&e.Mode&&(e=new e.Mode(n),n||((this.$modes[i]=e).$id=i),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var n=e.getTokenizer();if(void 0!==n.addEventListener){var i=this.onReloadTokenizer.bind(this);n.addEventListener("update",i)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(n);else{this.bgTokenizer=new d(n);var r=this;this.bgTokenizer.addEventListener("update",function(e){r._signal("tokenizerUpdate",e)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode"))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){o.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var t=0;return this.lineWidgets.forEach(function(e){e&&e.screenWidth>t&&(t=e.screenWidth)}),this.lineWidgetWidth=t},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,s=this.$foldData[r],o=s?s.start.row:1/0,a=t.length,l=0;l<a;l++){if(o<l){if(a<=(l=s.end.row+1))break;o=(s=this.$foldData[r++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var i=e[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;n<e.length;n++){var i=e[n];("insert"==i.action||"remove"==i.action)&&this.doc.applyDelta(i)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function n(e){return t?"insert"!==e.action:"insert"===e.action}for(var i,r,s=0;s<e.length;s++){var o=e[s];o.start&&(i?n(o)?(r=o.start,-1==i.compare(r.row,r.column)&&i.setStart(r),r=o.end,1==i.compare(r.row,r.column)&&i.setEnd(r),!0):(r=o.start,-1==i.compare(r.row,r.column)&&(i=u.fromPoints(o.start,o.start)),!1):n(o)?(i=u.fromPoints(o.start,o.end),!0):(i=u.fromPoints(o.start,o.start),!1))}return i},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,n){var i=this.getTextRange(e),r=this.getFoldsInRange(e),s=u.fromPoints(t,t);if(!n){this.remove(e);var o=e.start.row-e.end.row;(c=o?-e.end.column:e.start.column-e.end.column)&&(s.start.row==e.end.row&&s.start.column>e.end.column&&(s.start.column+=c),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=c)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,i),r.length){var a=e.start,l=s.start,c=(o=l.row-a.row,l.column-a.column);this.addFolds(r.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=c),e.end.row==a.row&&(e.end.column+=c),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var i=e;i<=t;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new u(0,0,0,0),i=this.getTabSize(),r=t.start.row;r<=t.end.row;++r){var s=this.getLine(r);n.start.row=r,n.end.row=r;for(var o=0;o<i&&" "==s.charAt(o);++o);o<i&&"\t"==s.charAt(o)?(n.start.column=o,n.end.column=o+1):(n.start.column=0,n.end.column=o),this.remove(n)}},this.$moveLines=function(e,t,n){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),n<0){if((r=this.getRowFoldStart(e+n))<0)return 0;var i=r-e}else if(0<n){var r;if((r=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;i=r-t}else{e=this.$clipRowToDocument(e);i=(t=this.$clipRowToDocument(t))-e+1}var s=new u(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=i,e.end.row+=i,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,a),o.length&&this.addFolds(o),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)t=e=0;else{var n=this.doc.getLength();n<=e?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var i=this.$constrainWrapLimit(e,n.min,n.max);return i!=this.$wrapLimit&&1<i&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,i=e.start,r=e.end,s=i.row,o=r.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var u=0;if(g=this.getFoldLine(r.row)){g.addRemoveChars(r.row,r.column,i.column-r.column),g.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==g&&(h.merge(g),g=h),u=c.indexOf(g)+1}for(;u<c.length;u++){(g=c[u]).start.row>=r.row&&g.shiftRow(-a)}o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;f.splice.apply(f,d);c=this.$foldData,u=0;if(g=this.getFoldLine(s)){var p=g.range.compareInside(i.row,i.column);0==p?(g=g.split(i.row,i.column))&&(g.shiftRow(a),g.addRemoveChars(o,0,r.column-i.column)):-1==p&&(g.addRemoveChars(s,0,r.column-i.column),g.shiftRow(a)),u=c.indexOf(g)+1}for(;u<c.length;u++){var g;(g=c[u]).start.row>=s&&g.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(g=this.getFoldLine(s))&&g.addRemoveChars(s,i.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var o,n,a=this.doc.getAllLines(),i=this.getTabSize(),r=this.$wrapData,s=this.$wrapLimit,l=e;for(t=Math.min(t,a.length-1);l<=t;)(n=this.getFoldLine(l,n))?(o=[],n.walk(function(e,t,n,i){var r;if(null!=e){(r=this.$getDisplayTokens(e,o.length))[0]=p;for(var s=1;s<r.length;s++)r[s]=g}else r=this.$getDisplayTokens(a[t].substring(i,n),o.length);o=o.concat(r)}.bind(this),n.end.row,a[n.end.row].length+1),r[n.start.row]=this.$computeWrapSplits(o,s,i),l=n.end.row+1):(o=this.$getDisplayTokens(a[l]),r[l]=this.$computeWrapSplits(o,s,i),l++)};var p=3,g=4;this.$computeWrapSplits=function(r,e,s){function t(e){for(var t=e-a,n=a;n<e;n++){var i=r[n];12!==i&&2!==i||(t-=1)}o.length||(d=function(){var e=0;if(0===h)return e;if(u)for(var t=0;t<r.length;t++){var n=r[t];if(10==n)e+=1;else{if(11!=n){if(12==n)continue;break}e+=s}}return c&&!1!==u&&(e+=s),Math.min(e,h)}(),o.indent=d),l+=t,o.push(l),a=e}if(0==r.length)return[];for(var o=[],n=r.length,a=0,l=0,c=this.$wrapAsCode,u=this.$indentedSoftWrap,h=e<=Math.max(2*s,8)||!1===u?0:Math.floor(e/2),d=0;e-d<n-a;){var i=a+e-d;if(10<=r[i-1]&&10<=r[i])t(i);else if(r[i]!=p&&r[i]!=g){for(var f=Math.max(i-(e-(e>>2)),a-1);f<i&&r[i]<p;)i--;if(c){for(;f<i&&r[i]<p;)i--;for(;f<i&&9==r[i];)i--}else for(;f<i&&r[i]<10;)i--;f<i?t(++i):(2==r[i=a+e]&&i--,t(i-d))}else{for(;i!=a-1&&r[i]!=p;i--);if(a<i){t(i);continue}for(i=a+e;i<r.length&&r[i]==g;i++);if(i==r.length)break;t(i)}}return o},this.$getDisplayTokens=function(e,t){var n,i=[];t=t||0;for(var r=0;r<e.length;r++){var s=e.charCodeAt(r);if(9==s){n=this.getScreenTabSize(i.length+t),i.push(11);for(var o=1;o<n;o++)i.push(12)}else 32==s?i.push(10):39<s&&s<48||57<s&&s<64?i.push(9):4352<=s&&a(s)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,n){if(0==t)return[0,0];var i,r;for(null==t&&(t=1/0),n=n||0,r=0;r<e.length&&(9==(i=e.charCodeAt(r))?n+=this.getScreenTabSize(n):4352<=i&&a(i)?n+=2:n+=1,!(t<n));r++);return[n,r]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]<t.column?n.indent:0}return 0},this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},this.getDocumentLastRowColumn=function(e,t){var n=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(n)},this.getDocumentLastRowColumnPosition=function(e,t){var n=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(n,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},this.getScreenTabSize=function(e){return this.$tabSize-e%this.$tabSize},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t,n){if(e<0)return{row:0,column:0};var i,r,s=0,o=0,a=0,l=0,c=this.$screenRowCache,u=this.$getRowCacheIndex(c,e),h=c.length;if(h&&0<=u){a=c[u],s=this.$docRowCache[u];var d=e>c[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),g=p?p.start.row:1/0;a<=e&&!(e<a+(l=this.getRowLength(s))||f<=s);)a+=l,g<++s&&(s=p.end.row+1,g=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)i=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||f<s)return{row:f,column:this.getLine(f).length};i=this.getLine(s),p=null}var m=0,v=Math.floor(e-a);if(this.$useWrapMode){var $=this.$wrapData[s];$&&(r=$[v],0<v&&$.length&&(m=$.indent,o=$[v-1]||$[$.length-1],i=i.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,s,v)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(i,t-m)[1],this.$useWrapMode&&r<=o&&(o=r-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var i,r=0,s=null;(i=this.getFoldAt(e,t,1))&&(e=i.start.row,t=i.start.column);var o,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),u=l.length;if(u&&0<=c){a=l[c],r=this.$screenRowCache[c];var h=e>l[u-1]}else h=!u;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a<e;){if(f<=a){if(e<(o=d.end.row+1))break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;r+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(r))}var p="";d&&f<=a?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var g=0;if(this.$useWrapMode){var m=this.$wrapData[s];if(m){for(var v=0;p.length>=m[v];)r++,v++;p=p.substring(m[v-1]||0,p.length),g=0<v?m.indent:0}}return{row:r,column:g+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);i<n;){var s=this.$wrapData[i];e+=s?s.length+1:1,r<++i&&(i=t.end.row+1,r=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;a<o.length;a++)e-=(t=o[a]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(s){this.$enableVarChar&&(this.$getStringScreenWidth=function(e,t,n){if(0===t)return[0,0];var i,r;for(t||(t=1/0),n=n||0,r=0;r<e.length&&!(t<(n+="\t"===(i=e.charAt(r))?this.getScreenTabSize(n):s.getCharacterWidth(i)));r++);return[n,r]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=a}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var w=e("./lib/lang"),i=e("./lib/oop"),y=e("./range").Range,r=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return w.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var r=this.$options,t=this.$matchIterator(e,r);if(!t)return!1;var s=null;return t.forEach(function(e,t,n,i){return s=new y(e,t,n,i),!(t==i&&r.start&&r.start.start&&0!=r.skipCurrent&&s.isEqual(r.start))||(s=null,!1)}),s},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),r=[],s=t.re;if(t.$isMultiLine){var o,a=s.length,l=i.length-a;e:for(var c=s.offset||0;c<=l;c++){for(var u=0;u<a;u++)if(-1==i[c+u].search(s[u]))continue e;var h=i[c],d=i[c+a-1],f=h.length-h.match(s[0])[0].length,p=d.match(s[a-1])[0].length;o&&o.end.row===c&&o.end.column>f||(r.push(o=new y(c,f,c+a-1,p)),2<a&&(c=c+a-2))}}else for(var g=0;g<i.length;g++){var m=w.getMatchOffsets(i[g],s);for(u=0;u<m.length;u++){var v=m[u];r.push(new y(g,v.offset,g,v.offset+v.length))}}if(n){var $=n.start.column,b=n.start.column;for(g=0,u=r.length-1;g<u&&r[g].start.column<$&&r[g].start.row==n.start.row;)g++;for(;g<u&&r[u].end.column>b&&r[u].end.row==n.end.row;)u--;for(r=r.slice(g,u+1),g=0,u=r.length;g<u;g++)r[g].start.row+=n.start.row,r[g].end.row+=n.start.row}return r},this.replace=function(e,t){var n=this.$options,i=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(i){var r=i.exec(e);if(!r||r[0].length!=e.length)return null;if(t=e.replace(i,t),n.preserveCase){t=t.split("");for(var s=Math.min(e.length,e.length);s--;){var o=e[s];o&&o.toLowerCase()!=o?t[s]=t[s].toUpperCase():t[s]=t[s].toLowerCase()}t=t.join("")}return t}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;e.regExp||(n=w.escapeRegExp(n)),e.wholeWord&&(n=function(e,t){function n(e){return/\w/.test(e)||t.regExp?"\\b":""}return n(e[0])+e+n(e[e.length-1])}(n,e));var i=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,i);try{var r=new RegExp(n,i)}catch(e){r=!1}return e.re=r},this.$assembleMultilineRegExp=function(e,t){for(var n=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),i=[],r=0;r<n.length;r++)try{i.push(new RegExp(n[r],t))}catch(e){return!1}return i},this.$matchIterator=function(u,n){var h=this.$assembleRegExp(n);if(!h)return!1;var l=1==n.backwards,e=0!=n.skipCurrent,t=n.range,i=n.start;i||(i=t?t[l?"end":"start"]:u.selection.getRange()),i.start&&(i=i[e!=l?"end":"start"]);var r=t?t.start.row:0,s=t?t.end.row:u.getLength()-1;if(l)var o=function(e){var t=i.row;if(!a(t,i.column,e)){for(t--;r<=t;t--)if(a(t,Number.MAX_VALUE,e))return;if(0!=n.wrap)for(t=s,r=i.row;r<=t;t--)if(a(t,Number.MAX_VALUE,e))return}};else o=function(e){var t=i.row;if(!a(t,i.column,e)){for(t+=1;t<=s;t++)if(a(t,0,e))return;if(0!=n.wrap)for(t=r,s=i.row;t<=s;t++)if(a(t,0,e))return}};if(n.$isMultiLine)var c=h.length,a=function(e,t,n){var i=l?e-c+1:e;if(!(i<0)){var r=u.getLine(i),s=r.search(h[0]);if(!(!l&&s<t||-1===s)){for(var o=1;o<c;o++)if(-1==(r=u.getLine(i+o)).search(h[o]))return;var a=r.match(h[c-1])[0].length;if(!(l&&t<a))return!!n(i,s,i+c-1,a)||void 0}}};else if(l)a=function(e,t,n){var i,r=u.getLine(e),s=[],o=0;for(h.lastIndex=0;i=h.exec(r);){var a=i[0].length;if(o=i.index,!a){if(o>=r.length)break;h.lastIndex=o+=1}if(i.index+a>t)break;s.push(i.index,a)}for(var l=s.length-1;0<=l;l-=2){var c=s[l-1];if(n(e,c,e,c+(a=s[l])))return!0}};else a=function(e,t,n){var i,r,s=u.getLine(e);for(h.lastIndex=t;r=h.exec(s);){var o=r[0].length;if(n(e,i=r.index,e,i+o))return!0;if(!o&&(h.lastIndex=i+=1,i>=s.length))return!1}};return{forEach:o}}}).call(r.prototype),t.Search=r}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function i(e,t){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function r(e,t){i.call(this,e,t),this.$singleCommand=!1}var a=e("../lib/keys"),s=e("../lib/useragent"),l=a.KEY_MODS;r.prototype=i.prototype,function(){function o(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),(this.commands[e.name]=e).bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var i=this.commandKeyBinding;for(var r in i){var s=i[r];if(s==e)delete i[r];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(i[r]=s[0]))}}},this.bindKey=function(e,s,o){if("object"==typeof e&&e&&(null==o&&(o=e.position),e=e[this.platform]),e)return"function"==typeof s?this.addCommand({exec:s,bindKey:e,name:s.name||e}):void e.split("|").forEach(function(e){var i="";if(-1!=e.indexOf(" ")){var t=e.split(/\s+/);e=t.pop(),t.forEach(function(e){var t=this.parseKeys(e),n=l[t.hashId]+t.key;i+=(i?" ":"")+n,this._addCommandToBinding(i,"chainKeys")},this),i+=" "}var n=this.parseKeys(e),r=l[n.hashId]+n.key;this._addCommandToBinding(i+r,s,o)},this)},this._addCommandToBinding=function(e,t,n){var i,r=this.commandKeyBinding;if(t)if(!r[e]||this.$singleCommand)r[e]=t;else{Array.isArray(r[e])?-1!=(i=r[e].indexOf(t))&&r[e].splice(i,1):r[e]=[r[e]],"number"!=typeof n&&(n=o(t));var s=r[e];for(i=0;i<s.length;i++){if(n<o(s[i]))break}s.splice(i,0,t)}else delete r[e]},this.addCommands=function(n){n&&Object.keys(n).forEach(function(e){var t=n[e];if(t){if("string"==typeof t)return this.bindKey(t,e);"function"==typeof t&&(t={exec:t}),"object"==typeof t&&(t.name||(t.name=e),this.addCommand(t))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=a[n];if(a.FUNCTION_KEYS[i])n=a.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var r=0,s=t.length;s--;){var o=a.KEY_MODS[t[s]];if(null==o)return"undefined"!=typeof console&&console.error("invalid modifier "+t[s]+" in "+e),!1;r|=o}return{key:n,hashId:r}},this.findKeyCommand=function(e,t){var n=l[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,i){if(!(i<0)){var r=l[t]+n,s=this.commandKeyBinding[r];return e.$keyChain&&(e.$keyChain+=" "+r,s=this.commandKeyBinding[e.$keyChain]||s),!s||"chainKeys"!=s&&"chainKeys"!=s[s.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||0<i)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-r.length-1)),{command:s}):(e.$keyChain=e.$keyChain||r,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(i.prototype),t.HashHandler=i,t.MultiHashHandler=r}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var i=e("../lib/oop"),r=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){r.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};i.inherits(o,r),function(){i.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var i=e.length;i--;)if(this.exec(e[i],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var r={editor:t,command:e,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";function i(e,t){return{win:e,mac:t}}var c=e("../lib/lang"),r=e("../config"),u=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:i("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:i("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:i("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:i("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:i(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:i("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t&&(t=parseInt(prompt("Enter line number:"),10)),isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:i("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:i("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:i("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:i("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:i(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:i("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:i("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:i("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:i("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:i("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:i("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:i("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:i("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:i("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:i("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:i("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:i("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:i("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:i("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:i("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:i("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:i("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:i("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:i("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:i("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:i("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:i("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:i("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:i("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:i("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:i("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:i("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:i(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:i("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:i(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:i("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:i("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:i("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:i("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:i("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:i("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:i("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:i(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",exec:function(e){},readOnly:!0},{name:"cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",bindKey:i("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:i("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:i("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:i("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:i("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:i("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:i("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:i("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",bindKey:i("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:i("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:i("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:i("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:i("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:i("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:i("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:i("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:i("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:i("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:i("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",bindKey:i("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",bindKey:i("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:i("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:i("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:i("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:i("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:i("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:i("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(c.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:i(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:i("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:i("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:i("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:i("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:i(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(n.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,o=e.session.doc.getLine(n.row),a=n.row+1;a<=i.row+1;a++){var l=c.stringTrimLeft(c.stringTrimRight(e.session.doc.getLine(a)));0!==l.length&&(l=" "+l),o+=l}i.row+1<e.session.doc.getLength()-1&&(o+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new u(n.row,0,i.row+2,0),o),0<s?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+s)):(r=e.session.doc.getLine(n.row).length>r?r+1:r,e.selection.moveCursorTo(n.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:i(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,i=e.selection.rangeList.ranges,r=[];i.length<1&&(i=[e.selection.getRange()]);for(var s=0;s<i.length;s++)s==i.length-1&&(i[s].end.row!==t||i[s].end.column!==n)&&r.push(new u(i[s].end.row,i[s].end.column,t,n)),0===s?(0!==i[s].start.row||0!==i[s].start.column)&&r.push(new u(0,0,i[s].start.row,i[s].start.column)):r.push(new u(i[s-1].end.row,i[s-1].end.column,i[s].start.row,i[s].start.column));e.exitMultiSelectMode(),e.clearSelection();for(s=0;s<r.length;s++)e.selection.addRange(r[s],!1)},readOnly:!0,scrollIntoView:"none"}]}),ace.define("ace/clipboard",["require","exports","module"],function(e,t,n){"use strict";n.exports={lineMode:!1}}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var s=e("./lib/oop"),i=e("./lib/dom"),m=e("./lib/lang"),r=e("./lib/useragent"),o=e("./keyboard/textinput").TextInput,a=e("./mouse/mouse_handler").MouseHandler,l=e("./mouse/fold_handler").FoldHandler,c=e("./keyboard/keybinding").KeyBinding,u=e("./edit_session").EditSession,h=e("./search").Search,g=e("./range").Range,d=e("./lib/event_emitter").EventEmitter,f=e("./commands/command_manager").CommandManager,p=e("./commands/default_commands").commands,v=e("./config"),$=e("./token_iterator").TokenIterator,b=e("./clipboard"),w=function(e,t,n){var i=e.getContainerElement();this.container=i,this.renderer=e,this.id="editor"+ ++w.$uid,this.commands=new f(r.isMac?"mac":"win",p),"object"==typeof document&&(this.textInput=new o(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new a(this),new l(this)),this.keyBinding=new c(this),this.$search=(new h).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=m.delayedCall(function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(t||n&&n.session||new u("")),v.resetOptions(this),n&&this.setOptions(n),v._signal("editor",this)};w.$uid=0,function(){s.implement(this,d),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=m.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(e){if(this.curOp){if(e&&!1===e.returnValue)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case"center-animate":n="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var i=this.selection.getRange(),r=this.renderer.layerConfig;(i.start.row>=r.lastRow||i.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,i=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var r=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&2e3<Date.now()-this.sequenceStartTime&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,n){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var i=this;v.loadModule(["keybinding",t],function(e){i.$keybindingId==t&&i.keyBinding.setKeyboardHandler(e&&e.handler),n&&n()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),n&&n()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}(this.session=e)?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var i=this;this.$highlightPending=!0,setTimeout(function(){i.$highlightPending=!1;var e=i.session;if(e&&e.bgTokenizer){var t=e.findMatchingBracket(i.getCursorPosition());if(t)var n=new g(t.row,t.column,t.row,t.column+1);else if(e.$mode.getMatching)n=e.$mode.getMatching(i.session);n&&(e.$bracketHighlight=e.addMarker(n,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var h=this;this.$highlightTagPending=!0,setTimeout(function(){h.$highlightTagPending=!1;var e=h.session;if(e&&e.bgTokenizer){var t=h.getCursorPosition(),n=new $(h.session,t.row,t.column),i=n.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=n.stepForward())){var r=i.value,s=0,o=n.stepBackward();if("<"==o.value)for(;o=i,(i=n.stepForward())&&i.value===r&&-1!==i.type.indexOf("tag-name")&&("<"===o.value?s++:"</"===o.value&&s--),i&&0<=s;);else{for(;i=o,o=n.stepBackward(),i&&i.value===r&&-1!==i.type.indexOf("tag-name")&&("<"===o.value?s++:"</"===o.value&&s--),o&&s<=0;);n.stepForward()}if(!i)return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);var a=n.getCurrentTokenRow(),l=n.getCurrentTokenColumn(),c=new g(a,l,a,l+i.value.length),u=e.$backMarkers[e.$tagHighlight];e.$tagHighlight&&null!=u&&0!==c.compareRange(u.range)&&(e.removeMarker(e.$tagHighlight),e.$tagHighlight=null),e.$tagHighlight||(e.$tagHighlight=e.addMarker(c,"ace_bracket","text"))}}},50)}},this.focus=function(){var e=this;setTimeout(function(){e.isFocused()||e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal("change",e),this.$cursorChange(),this.$updateHighlightActiveLine()},this.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),this.renderer.$maxLines&&1===this.session.getLength()&&!(1<this.renderer.$minLines)&&(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new g(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",i)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,i=t.end.column,r=e.getLine(t.start.row),s=r.substring(n,i);if(!(5e3<s.length)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=r.substring(n-1,i+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;r<i.length;r++){var s=i[r];r&&i[r-1].start.row==s.start.row||(e+=this.session.getLine(s.start.row)+t)}}var o={text:e};return this._signal("copy",o),b.lineMode=n?o.text:"",o.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){var n={text:e,event:t};this.commands.exec("paste",this,n)},this.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,n=t==b.lineMode,i=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)n?i.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(n)this.selection.rangeList.ranges.forEach(function(e){i.insert({row:e.start.row,column:0},t)});else{var r=t.split(/\r\n|\r|\n/),s=this.selection.rangeList.ranges;if(r.length>s.length||r.length<2||!r[1])return this.commands.exec("insertstring",this,t);for(var o=s.length;o--;){var a=s[o];a.isEmpty()||i.remove(a),i.insert(a.start,r[o])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var n=this.session,i=n.getMode(),r=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var s=i.transformAction(n.getState(r.row),"insertion",this,n,e);s&&(e!==s.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=s.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&-1==e.indexOf("\n")){(o=new g.fromPoints(r,r)).end.column+=e.length,this.session.remove(o)}}else{var o=this.getSelectionRange();r=this.session.remove(o),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=n.getLine(r.row);if(r.column>a.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,u=n.getState(r.row),h=(a=n.getLine(r.row),i.checkOutdent(u,a,e));n.insert(r,e);if(s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new g(r.row,c+s.selection[0],r.row,c+s.selection[1])):this.selection.setSelectionRange(new g(r.row+s.selection[0],s.selection[1],r.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=i.getNextLineIndent(u,a.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},d)}h&&i.autoOutdent(u,n,r.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove());((e||!this.selection.isEmpty())&&this.insert(e,!0),t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(t.start.row),r=n.getMode().transformAction(i,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}r&&(t=r)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,i,r=this.session.getLine(e.row);t<r.length?(n=r.charAt(t)+r.charAt(t-1),i=new g(e.row,t-1,e.row,t+1)):(n=r.charAt(t-1)+r.charAt(t-2),i=new g(e.row,t-2,e.row,t)),this.session.replace(i,n),this.session.selection.moveToPosition(i.end)}}},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var n=e.getTextRange(t);if(!/^\s+$/.test(n)){c=this.$getSelectedRows();return void e.indentRows(c.first,c.last,"\t")}}var i=e.getLine(t.start.row),r=t.start,s=e.getTabSize(),o=e.documentToScreenColumn(r.row,r.column);if(this.session.getUseSoftTabs())var a=s-o%s,l=m.stringRepeat(" ",a);else{for(a=o%s;" "==i[t.start.column-1]&&a;)t.start.column--,a--;this.selection.setSelectionRange(t),l="\t"}return this.insert(l)}var c=this.$getSelectedRows();e.indentRows(c.first,c.last,"\t")},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,n=[],i=e.first;i<=e.last;i++)n.push(t.getLine(i));n.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});var r=new g(0,0,0,0);for(i=e.first;i<=e.last;i++){var s=t.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,t.replace(r,n[i-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(e);n.lastIndex<t;){var r=n.exec(i);if(r.index<=t&&r.index+r[0].length>=t)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new g(t,n-1,t,n),r=this.session.getTextRange(i);if(!isNaN(parseFloat(r))&&isFinite(r)){var s=this.getNumberAt(t,n);if(s){var o=0<=s.value.indexOf(".")?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n<o?e*=Math.pow(10,s.end-n-1):e*=Math.pow(10,s.end-n),l+=e;var c=(l/=Math.pow(10,a)).toFixed(a),u=new g(t,s.start,t,s.end);this.session.replace(u,c),this.moveCursorTo(t,Math.max(s.start+1,n+c.length-s.value.length))}}else this.toggleWord()},this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],this.toggleWord=function(){var n=this.selection.getCursor().row,e=this.selection.getCursor().column;this.selection.selectWord();var i=this.getSelectedText(),r=this.selection.getWordRange().start.column,t=i.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),s=e-r-1;s<0&&(s=0);var o=0,a=0,l=this;i.match(/[A-Za-z0-9_]+/)&&t.forEach(function(e,t){a=o+e.length,o<=s&&s<=a&&(i=e,l.selection.clearSelection(),l.moveCursorTo(n,o+r),l.selection.selectTo(n,a+r)),o=a});for(var c,u=this.$toggleWordPairs,h=0;h<u.length;h++)for(var d=u[h],f=0;f<=1;f++){var p=+!f,g=i.match(new RegExp("^\\s?_?("+m.escapeRegExp(d[f])+")\\s?$","i"));if(g)i.match(new RegExp("([_]|^|\\s)("+m.escapeRegExp(g[1])+")($|\\s)","g"))&&(c=i.replace(new RegExp(m.escapeRegExp(d[f]),"i"),function(e){var t=d[p];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+d[p].charAt(0).toUpperCase()+t.substr(1)),t}),this.insert(c),c="")}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),i=e.isBackwards();if(n.isEmpty()){var r=n.start.row;t.duplicateLines(r,r)}else{var s=i?n.start:n.end,o=t.insert(s,t.getTextRange(n),!1);n.start=s,n.end=o,e.setSelectionRange(n,i)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,n){return this.session.moveText(e,t,n)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var n,i,r=this.selection;if(!r.inMultiSelectMode||this.inVirtualSelectionMode){var s=r.toOrientedRange();n=this.$getSelectedRows(s),i=this.session.$moveLines(n.first,n.last,t?0:e),t&&-1==e&&(i=0),s.moveBy(i,0),r.fromOrientedRange(s)}else{var o=r.rangeList.ranges;r.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,c=o.length,u=0;u<c;u++){var h=u;o[u].moveBy(a,0);for(var d=(n=this.$getSelectedRows(o[u])).first,f=n.last;++u<c;){l&&o[u].moveBy(l,0);var p=this.$getSelectedRows(o[u]);if(t&&p.first!=f)break;if(!t&&p.first>f+1)break;f=p.last}for(u--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=u+1);h<=u;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,i=this.renderer.layerConfig,r=e*Math.floor(i.height/i.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(r,0)}):!1===t&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,r*i.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,i){this.renderer.scrollToLine(e,t,n,i)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),i=new $(this.session,n.row,n.column),r=i.getCurrentToken(),s=r||i.stepForward();if(s){var o,a,l=!1,c={},u=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;u<s.value.length&&!l;u++)if(h[s.value[u]])switch(a=h[s.value[u]]+"."+s.type.replace("rparen","lparen"),isNaN(c[a])&&(c[a]=0),s.value[u]){case"(":case"[":case"{":c[a]++;break;case")":case"]":case"}":c[a]--,-1===c[a]&&(o="bracket",l=!0)}}else-1!==s.type.indexOf("tag-name")&&(isNaN(c[s.value])&&(c[s.value]=0),"<"===r.value?c[s.value]++:"</"===r.value&&c[s.value]--,-1===c[s.value]&&(o="tag",l=!0));l||(r=s,s=i.stepForward(),u=0)}while(s&&!l);if(o){var d,f;if("bracket"===o)(d=this.session.getBracketRange(n))||(f=(d=new g(i.getCurrentTokenRow(),i.getCurrentTokenColumn()+u-1,i.getCurrentTokenRow(),i.getCurrentTokenColumn()+u-1)).start,(t||f.row===n.row&&Math.abs(f.column-n.column)<2)&&(d=this.session.getBracketRange(f)));else if("tag"===o){if(!s||-1===s.type.indexOf("tag-name"))return;var p=s.value;if(0===(d=new g(i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2,i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2)).compare(n.row,n.column))for(l=!1;s=r,(r=i.stepBackward())&&(-1!==r.type.indexOf("tag-close")&&d.setEnd(i.getCurrentTokenRow(),i.getCurrentTokenColumn()+1),s.value===p&&-1!==s.type.indexOf("tag-name")&&("<"===r.value?c[p]++:"</"===r.value&&c[p]--,0===c[p]&&(l=!0))),r&&!l;);s&&s.type.indexOf("tag-name")&&((f=d.start).row==n.row&&Math.abs(f.column-n.column)<2&&(f=d.end))}(f=d&&d.cursor||f)&&(e?d&&t?this.selection.setRange(d):d&&d.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(f.row,f.column):this.selection.moveTo(f.row,f.column))}}},this.gotoLine=function(e,t,n){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,n)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var n=this.$search.find(this.session),i=0;return n&&(this.$tryReplace(n,e)&&(i=1),this.selection.setSelectionRange(n),this.renderer.scrollSelectionIntoView(n.start,n.end)),i},this.replaceAll=function(e,t){t&&this.$search.set(t);var n=this.$search.findAll(this.session),i=0;if(!n.length)return i;var r=this.getSelectionRange();this.selection.moveTo(0,0);for(var s=n.length-1;0<=s;--s)this.$tryReplace(n[s],e)&&i++;return this.selection.setSelectionRange(r),i},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&s.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,n),r):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var r,s=this,o=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var a=this.$scrollAnchor;a.style.cssText="position:absolute",this.container.insertBefore(a,this.container.firstChild);var t=this.on("changeSelection",function(){o=!0}),n=this.renderer.on("beforeRender",function(){o&&(r=s.renderer.container.getBoundingClientRect())}),i=this.renderer.on("afterRender",function(){if(o&&r&&(s.isFocused()||s.searchBox&&s.searchBox.isFocused())){var e=s.renderer,t=e.$cursorLayer.$pixelPos,n=e.layerConfig,i=t.top-n.offset;null!=(o=0<=t.top&&i+r.top<0||!(t.top<n.height&&t.top+r.top+n.lineHeight>window.innerHeight)&&null)&&(a.style.top=i+"px",a.style.left=t.left+"px",a.style.height=n.lineHeight+"px",a.scrollIntoView(o)),o=r=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",t),this.renderer.off("afterRender",i),this.renderer.off("beforeRender",n))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))}}.call(w.prototype),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?y.attach(this):y.detach(this)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=w}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";function a(e){return{row:e.row,column:e.column}}function i(e){if(e=e||this,Array.isArray(e))return e.map(i).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(r).join("\n"):r(e.value)),e.start&&(t+=r(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function r(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function s(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)if(0<=g(t.start,e.end))c(t,e,-1);else{if(!(g(t.start,e.start)<=0))return null;c(e,t,1)}else if(n&&!i)if(0<=g(t.start,e.end))c(t,e,-1);else{if(!(g(t.end,e.start)<=0))return null;c(e,t,-1)}else if(!n&&i)if(0<=g(t.start,e.start))c(t,e,1);else{if(!(g(t.start,e.start)<=0))return null;c(e,t,1)}else if(!n&&!i)if(0<=g(t.start,e.start))c(t,e,1);else{if(!(g(t.end,e.start)<=0))return null;c(e,t,-1)}return[t,e]}function o(e,t){for(var n=e.length;n--;)for(var i=0;i<t.length;i++)if(!s(e[n],t[i])){for(;n<e.length;){for(;i--;)s(t[i],e[n]);i=t.length,n++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function l(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)g(e.start,t.start)<0?c(t,e,1):c(e,t,1);else if(n&&!i)0<=g(e.start,t.end)?c(e,t,-1):(g(e.start,t.start)<=0||c(e,p.fromPoints(t.start,e.start),-1),c(t,e,1));else if(!n&&i)0<=g(t.start,e.end)?c(t,e,-1):(g(t.start,e.start)<=0||c(t,p.fromPoints(e.start,t.start),-1),c(e,t,1));else if(!n&&!i)if(0<=g(t.start,e.end))c(t,e,-1);else{var r,s;if(!(g(t.end,e.start)<=0))return g(e.start,t.start)<0&&(e=h(r=e,t.start)),0<g(e.end,t.end)&&(s=h(e,t.end)),u(t.end,e.start,e.end,-1),s&&!r&&(e.lines=s.lines,e.start=s.start,e.end=s.end,s=e),[t,r,s].filter(Boolean);c(e,t,-1)}return[t,e]}function c(e,t,n){u(e.start,t.start,t.end,n),u(e.end,t.start,t.end,n)}function u(e,t,n,i){e.row==(1==i?t:n).row&&(e.column+=i*(n.column-t.column)),e.row+=i*(n.row-t.row)}function h(e,t){var n=e.lines,i=e.end;e.end=a(t);var r=e.end.row-e.start.row,s=n.splice(r,n.length),o=r?t.column:t.column-e.start.column;return n.push(s[0].substring(0,o)),s[0]=s[0].substr(o),{start:a(t),end:i,lines:s,action:e.action}}function d(e,t){var n;t={start:a((n=t).start),end:a(n.end),action:n.action,lines:n.lines.slice()};for(var i=e.length;i--;){for(var r=e[i],s=0;s<r.length;s++){var o=l(r[s],t);t=o[0],2!=o.length&&(o[2]?(r.splice(s+1,1,o[1],o[2]),s++):o[1]||(r.splice(s,1),s--))}r.length||e.splice(i,1)}return e}var f=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=e)break;r.id<t&&(r.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var n=this.selections,i=n.length;i--;){var r=n[i];if(r.rev<e)return t&&(r=n[i+1]),r}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=null,r=0,s=n.length;s--;){var o=n[s][0];if(o.id<t&&!i&&(i=s+1),o.id<=e){r=s+1;break}}return n.slice(r,i)},this.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},this.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},this.undo=function(e,t){this.lastDeltas=null;var n=this.$undoStack;if(function(e,t){for(var n=t;n--;){var i=e[n];if(i&&!i[0].ignore){for(;n<t-1;){var r=o(e[n],e[n+1]);e[n]=r[0],e[n+1]=r[1],n++}return!0}}}(n,n.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var i=n.pop(),r=null;return i&&i.length&&(r=e.undoChanges(i,t),this.$redoStack.push(i),this.$syncRev()),this.$fromUndo=!1,r}},this.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var n=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);(function(e,t){for(var n=0;n<t.length;n++)for(var i=t[n],r=0;r<i.length;r++)d(e,i[r])})(this.$redoStack,n),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var i=this.$redoStack.pop(),r=null;return i&&(r=e.redoChanges(i,t),this.$undoStack.push(i),this.$syncRev()),this.$fromUndo=!1,r},this.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],n=t&&t[0].id||0;this.$redoStackBaseRev=n,this.$rev=n},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return 0<this.$undoStack.length},this.canRedo=function(){return 0<this.$redoStack.length},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?i(e):i(this.$undoStack)+"\n---\n"+i(this.$redoStack)}}).call(f.prototype);var p=e("./range").Range,g=p.comparePoints;p.comparePoints;t.UndoManager=f}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var o=e("../lib/dom"),i=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){o.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,n){var i=t.firstRowScreen*t.lineHeight,r=Math.floor(i/this.canvasHeight);return n.documentToScreenRow(e,0)*t.lineHeight-r*this.canvasHeight},this.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLength(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=o.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=o.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,n,i){var r=this.cellCache.pop();if(!r){var s=o.createElement("div");i&&i(s),this.element.appendChild(s),r={element:s,text:"",row:e}}return r.row=e,r}}).call(i.prototype),t.Lines=i}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(e,t,n){"use strict";function c(e){var t=document.createTextNode("");e.appendChild(t);var n=$.createElement("span");return e.appendChild(n),e}var $=e("../lib/dom"),i=e("../lib/oop"),a=e("../lib/lang"),r=e("../lib/event_emitter").EventEmitter,s=e("./lines").Lines,o=function(e){this.element=$.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new s(this.element),this.$lines.$offsetCoefficient=1};(function(){i.implement(this,r),this.setSession=function(e){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),(this.session=e)&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var n=e[t],i=n.row,r=this.$annotations[i];r||(r=this.$annotations[i]={text:[]});var s=n.text;s=s?a.escapeHTML(s):n.html||"",-1===r.text.indexOf(s)&&r.text.push(s);var o=n.type;"error"==o?r.className=" ace_error":"warning"==o&&" ace_error"!=r.className?r.className=" ace_warning":"info"==o&&!r.className&&(r.className=" ace_info")}},this.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,n=e.end.row-t;if(0!==n)if("remove"==e.action)this.$annotations.splice(t,n+1,null);else{var i=new Array(n+1);i.unshift(t,1),this.$annotations.splice.apply(this.$annotations,i)}}},this.update=function(e){this.config=e;var t=this.session,n=e.firstRow,i=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=i,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var r=t.getNextFoldLine(n),s=r?r.start.row:1/0,o=null,a=-1,l=n;;){if(s<l&&(l=r.end.row+1,s=(r=t.getNextFoldLine(l,r))?r.start.row:1/0),i<l){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,c),this.$lines.push(o)),this.$renderCell(o,e,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,i=t.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(r=t.getLength()+i-1);var s=n?n.getWidth(t,r,e):r.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)!==this.gutterWidth&&!isNaN(s)&&(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n<t.length;n++){var i=t[n];if(i.row>=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(0<n&&r&&r.start.row==t[n-1].row))break;i=t[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(n<i)for(r=this.session.getFoldedRowCount(n+1,i);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),i<n&&this.$lines.push(this.$renderLines(e,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var i=[],r=t,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;o<r&&(r=s.end.row+1,o=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(n<r);){var a=this.$lines.createCell(r,e,this.session,c);this.$renderCell(a,e,s,r),i.push(a),r++}return i},this.$renderCell=function(e,t,n,i){var r=e.element,s=this.session,o=r.childNodes[0],a=r.childNodes[1],l=s.$firstLineNumber,c=s.$breakpoints,u=s.$decorations,h=s.gutterRenderer||this.$renderer,d=this.$showFoldWidgets&&s.foldWidgets,f=n?n.start.row:Number.MAX_VALUE,p="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i<this.$cursorRow&&f<=i&&this.$cursorRow<=n.end.row)&&(p+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(p+=c[i]),u[i]&&(p+=u[i]),this.$annotations[i]&&(p+=this.$annotations[i].className),r.className!=p&&(r.className=p),d){var g=d[i];null==g&&(g=d[i]=s.getFoldWidget(i))}if(g){p="ace_fold-widget ace_"+g;"start"==g&&i==f&&i<n.end.row?p+=" ace_closed":p+=" ace_open",a.className!=p&&(a.className=p);var m=t.lineHeight+"px";$.setStyle(a.style,"height",m),$.setStyle(a.style,"display","inline-block")}else a&&$.setStyle(a.style,"display","none");var v=(h?h.getText(s,i):i+l).toString();return v!==o.data&&(o.data=v),$.setStyle(e.element.style,"height",this.$lines.computeLineHeight(i,t,s)+"px"),$.setStyle(e.element.style,"top",this.$lines.computeLineTop(i,t,s)+"px"),e.text=v,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?$.addCssClass(this.element,"ace_folding-enabled"):$.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=$.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),n=this.element.getBoundingClientRect();return e.x<t.left+n.left?"markers":this.$showFoldWidgets&&e.x>n.right-t.right?"foldWidgets":void 0}}).call(o.prototype),t.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var f=e("../range").Range,i=e("../lib/dom"),r=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var i=this.markers[n];if(i.range){var r=i.range.clipRows(e.firstRow,e.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),i.renderer){var s=this.$getTop(r.start.row,e),o=this.$padding+r.start.column*e.characterWidth;i.renderer(t,r,o,s,e)}else"fullLine"==i.type?this.drawFullLineMarker(t,r,i.clazz,e):"screenLine"==i.type?this.drawScreenLineMarker(t,r,i.clazz,e):r.isMultiLine()?"text"==i.type?this.drawTextMarker(t,r,i.clazz,e):this.drawMultiLineMarker(t,r,i.clazz,e):this.drawSingleLineMarker(t,r,i.clazz+" ace_start ace_br15",e)}else i.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,n,i,r){for(var s=this.session,o=t.start.row,a=t.end.row,l=o,c=0,u=0,h=s.getScreenLastRowColumn(l),d=new f(l,t.start.column,l,u);l<=a;l++)d.start.row=d.end.row=l,d.start.column=l==o?t.start.column:s.getRowWrapIndent(l),c=u,u=d.end.column=h,h=l+1<a?s.getScreenLastRowColumn(l+1):l==a?0:t.end.column,this.drawSingleLineMarker(e,d,n+(l==o?" ace_start":"")+" ace_br"+((l==o||l==o+1&&t.start.column?1:0)|(c<u?2:0)|(h<u?4:0)|(l==a?8:0)),i,l==a?0:1,r)},this.drawMultiLineMarker=function(e,t,n,i,r){var s=this.$padding,o=i.lineHeight,a=this.$getTop(t.start.row,i),l=s+t.start.column*i.characterWidth;(r=r||"",this.session.$bidiHandler.isBidiRow(t.start.row))?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(r||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,n+" ace_br12",i,null,r)}else{a=this.$getTop(t.end.row,i);var u=t.end.column*i.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+u+"px;top:"+a+"px;left:"+s+"px;"+(r||""))}if(!((o=(t.end.row-t.start.row-1)*i.lineHeight)<=0)){a=this.$getTop(t.start.row+1,i);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(r||""))}},this.drawSingleLineMarker=function(e,t,n,i,r,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,i,r,s);var o=i.lineHeight,a=(t.end.column+(r||0)-t.start.column)*i.characterWidth,l=this.$getTop(t.start.row,i),c=this.$padding+t.start.column*i.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+c+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,i,r,s){var o=i.lineHeight,a=this.$getTop(t.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(r||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,i,r){var s=this.$getTop(t.start.row,i),o=i.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,i)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(e,t,n,i,r){var s=this.$getTop(t.start.row,i),o=i.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))}}).call(r.prototype),t.Marker=r}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var i=e("../lib/oop"),$=e("../lib/dom"),b=e("../lib/lang"),r=e("./lines").Lines,s=e("../lib/event_emitter").EventEmitter,o=function(e){this.dom=$,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new r(this.element)};(function(){i.implement(this,s),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){(this.session=e)&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;n<e+1;n++)if(this.showInvisibles){(i=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",i.textContent=b.stringRepeat(this.TAB_CHAR,n),t.push(i)}else t.push(this.dom.createTextNode(b.stringRepeat(" ",n),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var i,r="ace_indent-guide",s="",o="";if(this.showInvisibles){r+=" ace_invisible",s=" ace_invisible_space",o=" ace_invisible_tab";var a=b.stringRepeat(this.SPACE_CHAR,this.tabSize),l=b.stringRepeat(this.TAB_CHAR,this.tabSize)}else l=a=b.stringRepeat(" ",this.tabSize);(i=this.dom.createElement("span")).className=r+s,i.textContent=a,this.$tabStrings[" "]=i,(i=this.dom.createElement("span")).className=r+o,i.textContent=l,this.$tabStrings["\t"]=i}},this.updateLines=function(e,t,n){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var i=Math.max(t,e.firstRow),r=Math.min(n,e.lastRow),s=this.element.childNodes,o=0,a=e.firstRow;a<i;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(i)){i=l.start.row;break}a=l.end.row}o++}for(var l,c=!1,u=(a=i,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);u<a&&(a=l.end.row+1,u=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(r<a);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==u&&l);var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(c=!0,h.style.height=d)}a++}if(c)for(;o<this.$lines.cells.length;){var f=this.$lines.cells[o++];f.element.style.top=this.$lines.computeLineTop(f.row,e,this.session)+"px"}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=e.lastRow,i=t?t.lastRow:-1;if(!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var i=[],r=t,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;o<r&&(r=s.end.row+1,o=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(n<r);){var a=this.$lines.createCell(r,e,this.session),l=a.element;this.dom.removeChildren(l),$.setStyle(l.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),$.setStyle(l.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(l,r,r==o&&s),this.$useLineGroups()?l.className="ace_line_group":l.className="ace_line",i.push(a),r++}return i},this.update=function(e){this.$lines.moveContainer(e);for(var t=(this.config=e).firstRow,n=e.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,i){for(var r,s=this,o=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,a=this.dom.createFragment(this.element),l=0;r=o.exec(i);){var c=r[1],u=r[2],h=r[3],d=r[4],f=r[5];if(s.showInvisibles||!u){var p=l!=r.index?i.slice(l,r.index):"";if(l=r.index+r[0].length,p&&a.appendChild(this.dom.createTextNode(p,this.element)),c){var g=s.session.getScreenTabSize(t+r.index);a.appendChild(s.$tabStrings[g].cloneNode(!0)),t+=g-1}else if(u)if(s.showInvisibles){(v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=b.stringRepeat(s.SPACE_CHAR,u.length),a.appendChild(v)}else a.appendChild(this.com.createTextNode(u,this.element));else if(h){(v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=b.stringRepeat(s.SPACE_CHAR,h.length),a.appendChild(v)}else if(d){s.showInvisibles&&s.SPACE_CHAR;t+=1,(v=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",v.className=s.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=s.showInvisibles?s.SPACE_CHAR:"",a.appendChild(v)}else if(f){t+=1,(v=$.createElement("span")).style.width=2*s.config.characterWidth+"px",v.className="ace_cjk",v.textContent=f,a.appendChild(v)}}}if(a.appendChild(this.dom.createTextNode(l?i.slice(l):i,this.element)),this.$textToken[n.type])e.appendChild(a);else{var m="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=m,v.appendChild(a),e.appendChild(v)}return t+i.length},this.renderIndentGuide=function(e,t,n){var i=t.search(this.$indentGuideRe);if(i<=0||n<=i)return t;if(" "==t[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,s=0;s<r;s++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return t.substr(i)}if("\t"!=t[0])return t;for(s=0;s<i;s++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return t.substr(i)},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,n){var i=0,r=0,s=n[0],o=0,a=this.$createLineElement();e.appendChild(a);for(var l=0;l<t.length;l++){var c=t[l],u=c.value;if(0==l&&this.displayIndentGuides){if(i=u.length,!(u=this.renderIndentGuide(a,u,s)))continue;i-=u.length}if(i+u.length<s)o=this.$renderToken(a,o,c,u),i+=u.length;else{for(;i+u.length>=s;)o=this.$renderToken(a,o,c,u.substring(0,s-i)),u=u.substring(s-i),i=s,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode(b.stringRepeat(" ",n.indent),this.element)),o=0,s=n[++r]||Number.MAX_VALUE;0!=u.length&&(i+=u.length,o=this.$renderToken(a,o,c,u))}}},this.$renderSimpleLine=function(e,t){var n=0,i=t[0],r=i.value;this.displayIndentGuides&&(r=this.renderIndentGuide(e,r)),r&&(n=this.$renderToken(e,n,i,r));for(var s=1;s<t.length;s++){if(n+(r=(i=t[s]).value).length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,i,r);n=this.$renderToken(e,n,i,r)}},this.$renderOverflowMessage=function(e,t,n,i){this.$renderToken(e,t,n,i.slice(0,this.MAX_LINE_LENGTH-t));var r=this.dom.createElement("span");r.className="ace_inline_button ace_keyword ace_toggle_wrap",r.style.position="absolute",r.style.right="0",r.textContent="<click to see more...>",e.appendChild(r)},this.$renderLine=function(e,t,n){if(!n&&0!=n&&(n=this.session.getFoldLine(t)),n)var i=this.$getFoldLineTokens(t,n);else i=this.session.getTokens(t);var r=e;if(i.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,i,s);r=e.lastChild}else{r=e;this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r)),this.$renderSimpleLine(r,i)}}else this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r));if(this.showInvisibles&&r){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var s=this.session,o=[],a=s.getTokens(e);return t.walk(function(e,t,n,i,r){null!=e?o.push({type:"fold",value:e}):(r&&(a=s.getTokens(t)),a.length&&function(e,t,n){for(var i=0,r=0;r+e[i].value.length<t;)if(r+=e[i].value.length,++i==e.length)return;for(r!=t&&((s=e[i].value.substring(t-r)).length>n-t&&(s=s.substring(0,n-t)),o.push({type:e[i].type,value:s}),r=t+s.length,i+=1);r<n&&i<e.length;){var s;(s=e[i].value).length+r>n?o.push({type:e[i].type,value:s.substring(0,n-r)}):o.push(e[i]),r+=s.length,i+=1}}(a,i,n))},t.end.row,this.session.getLine(t.end.row).length),o},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(o.prototype),t.Text=o}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var c=e("../lib/dom"),i=function(e){this.element=c.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),c.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)c.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){c.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){c.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,c.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=c.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(1<this.cursors.length){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,c.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,c.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&c.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){c.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),c.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return 0<=e.top&&e.top<t.maxHeight},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,n=0,i=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]);n=0;for(var r=t.length;n<r;n++){var s=this.getPixelPosition(t[n].cursor,!0);if(!((s.top>e.height+e.offset||s.top<0)&&1<n)){var o=this.cursors[i++]||this.addCursor(),a=o.style;this.drawCursor?this.drawCursor(o,s,e,t[n],this.session):this.isCursorInView(s,e)?(c.setStyle(a,"display","block"),c.translate(o,s.left,s.top),c.setStyle(a,"width",Math.round(e.characterWidth)+"px"),c.setStyle(a,"height",e.lineHeight+"px")):c.setStyle(a,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=s,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&((this.overwrite=e)?c.addCssClass(this.element,"ace_overwrite-cursors"):c.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=function(e){this.element=r.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=r.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){i.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var l=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=r.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(l,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){32768<(this.scrollHeight=e)?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(l.prototype);var c=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(c,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=c,t.VScrollBar=l,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var i=e("./lib/event"),r=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(i.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(r.prototype),t.RenderLoop=r}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var i=e("../lib/oop"),r=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c="function"==typeof ResizeObserver,u=t.FontMetrics=function(e){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",256),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var n=this;this.$observer=new window.ResizeObserver(function(e){var t=e[0].contentRect;n.checkForSizeChanges({height:t.height,width:t.width/256})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/256};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,256),this.$main.getBoundingClientRect().width/256},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=r.buildDom([e(0,0),e(200,0),e(0,200),e(200,200)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var i=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/i,(+e[1]*n[0]-e[0]*n[1])/i]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function r(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e));this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),c=o(this.els[2]),u=o(this.els[3]),h=n(i(u,l),i(u,c),i(r(l,c),r(u,a))),d=s(1+h[0],i(l,a)),f=s(1+h[1],i(c,a));if(t){var p=t;return r(s(1/(h[0]*p[0]/200+h[1]*p[1]/200+1)/200,r(s(p[0],d),s(p[1],f))),a)}var g=i(e,a);return s(200,n(i(d,s(h[0],g)),i(f,s(h[1],g)),g))}}).call(u.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var i=e("./lib/oop"),c=e("./lib/dom"),s=e("./config"),r=e("./layer/gutter").Gutter,o=e("./layer/marker").Marker,a=e("./layer/text").Text,l=e("./layer/cursor").Cursor,u=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}',m=e("./lib/useragent"),v=m.isIE;c.importCssString(g,"ace_editor.css");var $=function(e,t){var n=this;this.container=e||c.createElement("div"),c.addCssClass(this.container,"ace_editor"),c.HI_DPI&&c.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=c.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=c.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=c.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new r(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new o(this.content);var i=this.$textLayer=new a(this.content);this.canvas=i.element,this.$markerFront=new o(this.content),this.$cursorLayer=new l(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._emit("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),(this.session=e)&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!n)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,i){if(!(2<this.resizing)){0<this.resizing?this.resizing++:this.resizing=e?1:0;var r=this.container;i||(i=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var s=this.$updateCachedSize(e,t,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,i){i-=this.$extraHeight||0;var r=0,s=this.$size,o={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(i&&(e||s.height!=i)&&(s.height=i,r|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),n&&(e||s.width!=n)){r|=this.CHANGE_SIZE,s.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,c.setStyle(this.scrollBarH.element.style,"left",t+"px"),c.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),c.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";c.setStyle(this.scrollBarH.element.style,"right",a),c.setStyle(this.scroller.style,"right",a),c.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL)}return s.$dirty=!n||!i,r&&this._signal("resize",o),r},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=c.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=c.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e=this.textarea.style;if(this.$keepTextAreaAtCursor){var t=this.$cursorLayer.$pixelPos;if(t){var n=this.$composition;n&&n.markerRange&&(t=this.$cursorLayer.getPixelPosition(n.markerRange.start,!0));var i=this.layerConfig,r=t.top,s=t.left;r-=i.offset;var o=n&&n.useTextareaForIME?this.lineHeight:v?0:1;if(r<0||r>i.height-o)c.translate(this.textarea,0,0);else{var a=1;if(n)if(n.useTextareaForIME){var l=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(l)[0],o+=2}else r+=this.lineHeight+2;else r+=this.lineHeight;(s-=this.scrollLeft)>this.$size.scrollerWidth-a&&(s=this.$size.scrollerWidth-a),s+=this.gutterWidth+this.margin.left,c.setStyle(e,"height",o+"px"),c.setStyle(e,"width",a+"px"),c.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-a),Math.min(r,this.$size.height-o))}}}else c.translate(this.textarea,-100,0)},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,i){var r=this.scrollMargin;r.top=0|e,r.bottom=0|t,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(e,t,n,i){var r=this.margin;r.top=0|e,r.bottom=0|t,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;0<i&&(this.scrollTop=i,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),c.translate(this.content,-this.scrollLeft,-n.offset);var r=n.width+2*this.$padding+"px",s=n.minHeight+"px";c.setStyle(this.content.style,"width",r),c.setStyle(this.content.style,"height",s)}return e&this.CHANGE_H_SCROLL&&(c.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor()):e&this.CHANGE_SCROLL?(e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor()):(e&this.CHANGE_TEXT?(this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n)),void this._signal("afterRender")}this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&t<e;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-r-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&1<this.lineHeight&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var u=this.scrollMargin;this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,i-t.scrollerHeight+u.bottom))),this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,r+2*this.$padding-t.scrollerWidth+u.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+c<0||this.scrollTop>u.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),$=v+m,b=this.lineHeight;v=e.screenToDocumentRow(v,0);var w=e.getFoldLine(v);w&&(v=w.start.row),f=e.documentToScreenRow(v,0),p=e.getRowLength(v)*b,$=Math.min(e.screenToDocumentRow($,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength($)*b+p,g=this.scrollTop-f*b;var y=0;return(this.layerConfig.width!=r||o)&&(y=this.CHANGE_H_SCROLL),(o||d)&&(y=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:v,firstRowScreen:f,lastRow:$,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:g,gutterOffset:b?Math.max(0,Math.ceil((g+t.height-t.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),y},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||t<n.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(n),void this.$textLayer.update(n)):(this.$textLayer.updateLines(n,e,t),!0)}},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(e),r=i.left,s=i.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;s<l+o?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-a<s+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<s-this.lineHeight&&(s+=t*this.$size.scrollerHeight),this.session.setScrollTop(s+this.lineHeight+a-this.$size.scrollerHeight));var c=this.scrollLeft;r<c?(r<this.$padding+2*this.layerConfig.characterWidth&&(r=-this.scrollMargin.left),this.session.setScrollLeft(r)):c+this.$size.scrollerWidth<r+this.characterWidth?this.session.setScrollLeft(Math.round(r+this.characterWidth-this.$size.scrollerWidth)):c<=this.$padding&&r-c<this.characterWidth&&this.session.setScrollLeft(0)}},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},this.alignCursor=function(e,t){"number"==typeof e&&(e={row:e,column:0});var n=this.$cursorLayer.getPixelPosition(e),i=this.$size.scrollerHeight-this.lineHeight,r=n.top-i*(t||0);return this.session.setScrollTop(r),r},this.STEPS=8,this.$calcSteps=function(e,t){var n,i,r=0,s=this.STEPS,o=[];for(r=0;r<s;++r)o.push((n=r/this.STEPS,(t-(i=e))*(Math.pow(n-1,3)+1)+i));return o},this.scrollToLine=function(e,t,n,i){var r=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(r-=this.$size.scrollerHeight/2);var s=this.scrollTop;this.session.setScrollTop(r),!1!==n&&this.animateScrolling(s,i)},this.animateScrolling=function(e,t){var n=this.scrollTop;if(this.$animatedScroll){var i=this;if(e!=n){if(this.$scrollAnimation){var r=this.$scrollAnimation.steps;if(r.length&&(e=r[0])==n)return}var s=i.$calcSteps(e,n);this.$scrollAnimation={from:e,to:n,steps:s},clearInterval(this.$timer),i.session.setScrollTop(s.shift()),i.session.$scrollTop=n,this.$timer=setInterval(function(){s.length?(i.session.setScrollTop(s.shift()),i.session.$scrollTop=n):null!=n?(i.session.$scrollTop=-1,i.session.setScrollTop(n),n=null):(i.$timer=clearInterval(i.$timer),i.$scrollAnimation=null,t&&t())},10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(t)},this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},this.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||(0<t&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(0<e&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([e,t]);e=i[1]-this.gutterWidth-this.margin.left,t=i[0]}else n=this.scroller.getBoundingClientRect();var r=e+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:0<s-a?1:-1,offsetX:r}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([e,t]);e=i[1]-this.gutterWidth-this.margin.left,t=i[0]}else n=this.scroller.getBoundingClientRect();var r=e+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),r)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(e,t),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth)),s=i.row*this.lineHeight;return{pageX:n.left+r-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){c.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){c.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){(this.$composition=e).cssText||(e.cssText=this.textarea.style.cssText,e.keepTextAreaAtCursor=this.$keepTextAreaAtCursor),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(this.$keepTextAreaAtCursor=!0,c.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),c.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,i){var r=this.session;r.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=r.getTokens(n);if(null==i)o.push(s);else for(var a=0,l=0;l<o.length;l++){var c=o[l];if(i<=(a+=c.value.length)){var u=c.value.length-(a-i),h=c.value.slice(0,u),d=c.value.slice(u);o.splice(l,1,{type:c.type,value:h},s,{type:c.type,value:d});break}}this.updateLines(n,n)},this.setTheme=function(n,i){function e(e){if(r.$themeId!=n)return i&&i();if(!e||!e.cssClass)throw new Error("couldn't load module "+n+" or it didn't call define");e.$id&&(r.$themeId=e.$id),c.importCssString(e.cssText,e.cssClass,r.container),r.theme&&c.removeCssClass(r.container,r.theme.cssClass);var t="padding"in e?e.padding:"padding"in(r.theme||{})?4:r.$padding;r.$padding&&t!=r.$padding&&r.setPadding(t),r.$theme=e.cssClass,r.theme=e,c.addCssClass(r.container,e.cssClass),c.setCssClass(r.container,"ace_dark",e.isDark),r.$size&&(r.$size.width=0,r.$updateSizeAsync()),r._dispatchEvent("themeLoaded",{theme:e}),i&&i()}var r=this;if(this.$themeId=n,r._dispatchEvent("themeChange",{theme:n}),n&&"string"!=typeof n)e(n);else{var t=n||this.$options.theme.initialValue;s.loadModule(["theme",t],e)}},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){c.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){c.removeCssClass(this.container,e)},this.setCursorStyle=function(e){c.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){c.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){c.importCssString(g,"ace_editor.css",this.container)},this.destroy=function(){this.$fontMetrics.destroy(),this.$cursorLayer.destroy()}}).call($.prototype),s.defineOptions($.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){c.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!m.isMobile&&!m.isIE}}),t.VirtualRenderer=$}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(a,e,t){"use strict";function l(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};var t=function(e){var t="importScripts('"+i.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob("application/javascript")}}(e),n=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(n)}var n=a("../lib/oop"),i=a("../lib/net"),c=a("../lib/event_emitter").EventEmitter,u=a("../config"),r=function(e,t,n,i,r){if(this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),a.nameToUrl&&!a.toUrl&&(a.toUrl=a.nameToUrl),u.get("packaged")||!a.toUrl)i=i||u.moduleUrl(t,"worker");else{var s=this.$normalizePath;i=i||s(a.toUrl("ace/worker/worker.js",null,"_"));var o={};e.forEach(function(e){o[e]=s(a.toUrl(e,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}this.$worker=l(i),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:o,module:t,classname:n}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){n.implement(this,c),this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return i.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var i=this.callbackId++;this.callbacks[i]=n,t.push(i)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,50<e.length&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(r.prototype);var s=function(e,t,n){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var i=null,r=!1,s=Object.create(c),o=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){o.messageBuffer.push(e),i&&(r?setTimeout(a):a())},this.setEmitSync=function(e){r=e};var a=function(){var e=o.messageBuffer.shift();e.command?i[e.command].apply(i,e.args):e.event&&s._signal(e.event,e.data)};s.postMessage=function(e){o.onMessage({data:e})},s.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},s.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},u.loadModule(["worker",t],function(e){for(i=new e[n](s);o.messageBuffer.length;)a()})};s.prototype=r.prototype,e.UIWorkerClient=s,e.WorkerClient=r,e.createWorker=l}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var l=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,r=e("./lib/oop"),s=function(e,t,n,i,r,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){r.implement(this,i),this.setup=function(){var n=this,i=this.doc,e=this.session;this.selectionBefore=e.selection.toJSON(),e.selection.inMultiSelectMode&&e.selection.toSingleRange(),this.pos=i.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=e.addMarker(new l(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var t=i.createAnchor(e.row,e.column);t.$insertRight=!0,t.detach(),n.others.push(t)}),e.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,n=this;this.othersActive=!0,this.others.forEach(function(e){e.markerId=t.addMarker(new l(e.row,e.column,e.row,e.column+n.length),n.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var n="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,i=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;0<=s;s--){var o={row:(a=this.others[s]).row,column:a.column+r};this.doc.insertMergedLines(o,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;0<=s;s--){var a;o={row:(a=this.others[s]).row,column:a.column+r};this.doc.remove(new l(o.row,o.column,o.row,o.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var n=this,i=this.session,e=function(e,t){i.removeMarker(e.markerId),e.markerId=i.addMarker(new l(e.row,e.column,e.row,e.column+n.length),t,null,!1)};e(this.pos,this.mainClass);for(var t=this.others.length;t--;)e(this.others[t],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n<t;n++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(s.prototype),t.PlaceHolder=s}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){function A(e,t){return e.row==t.row&&e.column==t.column}var E=e("../lib/event"),R=e("../lib/useragent");t.onMouseDown=function(e){var t=e.domEvent,n=t.altKey,i=t.shiftKey,r=t.ctrlKey,s=e.getAccelKey(),o=e.getButton();if(r&&R.isMac&&(o=t.button),e.editor.inMultiSelectMode&&2==o)e.editor.textInput.onContextMenu(e.domEvent);else if(r||n||s){if(0===o){var a,l=e.editor,c=l.selection,u=l.inMultiSelectMode,h=e.getDocumentPosition(),d=c.getCursor(),f=e.inSelection()||c.isEmpty()&&A(h,d),p=e.x,g=e.y,m=l.session,v=l.renderer.pixelToScreenCoordinates(p,g),$=v;if(l.$mouseHandler.$enableJumpToDef)r&&n||s&&n?a=i?"block":"add":n&&l.$blockSelectEnabled&&(a="block");else if(s&&!n){if(a="add",!u&&i)return}else n&&l.$blockSelectEnabled&&(a="block");if(a&&R.isMac&&t.ctrlKey&&l.$mouseHandler.cancelContextMenu(),"add"==a){if(!u&&f)return;if(!u){var b=c.toOrientedRange();l.addSelectionMarker(b)}var w=c.rangeList.rangeAtPoint(h);l.inVirtualSelectionMode=!0,i&&(w=null,b=c.ranges[0]||b,l.removeSelectionMarker(b)),l.once("mouseup",function(){var e=c.toOrientedRange();w&&e.isEmpty()&&A(w.cursor,e.cursor)?c.substractPoint(e.cursor):(i?c.substractPoint(b.cursor):b&&(l.removeSelectionMarker(b),c.addRange(b)),c.addRange(e)),l.inVirtualSelectionMode=!1})}else if("block"==a){e.stop(),l.inVirtualSelectionMode=!0;var y,S=[],C=function(){var e=l.renderer.pixelToScreenCoordinates(p,g),t=m.screenToDocumentPosition(e.row,e.column,e.offsetX);A($,e)&&A(t,c.lead)||($=e,l.selection.moveToPosition(t),l.renderer.scrollCursorIntoView(),l.removeSelectionMarkers(S),S=c.rectangularRangeBlock($,v),l.$mouseHandler.$clickSelection&&1==S.length&&S[0].isEmpty()&&(S[0]=l.$mouseHandler.$clickSelection.clone()),S.forEach(l.addSelectionMarker,l),l.updateSelectionMarkers())};u&&!s?c.toSingleRange():!u&&s&&(y=c.toOrientedRange(),l.addSelectionMarker(y)),i?v=m.documentToScreenPosition(c.lead):c.moveToPosition(h),$={row:-1,column:-1};var x=C;E.capture(l.container,function(e){p=e.clientX,g=e.clientY},function(e){C(),clearInterval(k),l.removeSelectionMarkers(S),S.length||(S=[c.toOrientedRange()]),y&&(l.removeSelectionMarker(y),c.toSingleRange(y));for(var t=0;t<S.length;t++)c.addRange(S[t]);l.inVirtualSelectionMode=!1,l.$mouseHandler.$clickSelection=null});var k=setInterval(function(){x()},20);return e.preventDefault()}}}else 0===o&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,n){t.defaultCommands=[{name:"addCursorAbove",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"splitIntoLines",exec:function(e){e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"alignCursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var i=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new i(t.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,n){function i(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",s),e.commands.addCommands(a.defaultCommands),function(n){function i(e){r&&(n.renderer.setMouseCursor(""),r=!1)}var e=n.textInput.getElement(),r=!1;o.addListener(e,"keydown",function(e){var t=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey);n.$blockSelectEnabled&&t?r||(n.renderer.setMouseCursor("crosshair"),r=!0):r&&i()}),o.addListener(e,"keyup",i),o.addListener(e,"blur",i)}(e))}var r=e("./range_list").RangeList,w=e("./range").Range,g=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,o=e("./lib/event"),m=e("./lib/lang"),a=e("./commands/multi_select_commands");t.commands=a.defaultCommands.concat(a.multiSelectCommands);var u=new(e("./search").Search),l=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var i=this.rangeList.add(e);return this.$onAddRange(e),i.length&&this.$onRemoveRange(i),1<this.rangeCount&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var i=this.ranges.indexOf(e[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(1<this.rangeCount){var e=this.rangeList.ranges,t=e[e.length-1],n=w.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var i=this.isBackwards(),r=n.start.row,s=n.end.row;if(r==s){if(i)var o=n.end,a=n.start;else o=n.start,a=n.end;return this.addRange(w.fromPoints(a,a)),void this.addRange(w.fromPoints(o,o))}var l=[],c=this.getLineRange(r,!0);c.start.column=n.start.column,l.push(c);for(var u=r+1;u<s;u++)l.push(this.getLineRange(u,!0));(c=this.getLineRange(s,!0)).end.column=n.end.column,l.push(c),l.forEach(this.addRange,this)}},this.toggleBlockSelection=function(){if(1<this.rangeCount){var e=this.rangeList.ranges,t=e[e.length-1],n=w.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var i=this.session.documentToScreenPosition(this.cursor),r=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,r).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var i=[],r=e.column<t.column;if(r)var s=e.column,o=t.column,a=e.offsetX,l=t.offsetX;else s=t.column,o=e.column,a=t.offsetX,l=e.offsetX;var c,u,h,d=e.row<t.row;if(d)var f=e.row,p=t.row;else f=t.row,p=e.row;s<0&&(s=0),f<0&&(f=0),f==p&&(n=!0);for(var g=f;g<=p;g++){var m=w.fromPoints(this.session.screenToDocumentPosition(g,s,a),this.session.screenToDocumentPosition(g,o,l));if(m.isEmpty()){if(c&&(u=m.end,h=c,u.row==h.row&&u.column==h.column))break;c=m.end}m.cursor=r?m.start:m.end,i.push(m)}if(d&&i.reverse(),!n){for(var v=i.length-1;i[v].isEmpty()&&0<v;)v--;if(0<v)for(var $=0;i[$].isEmpty();)$++;for(var b=v;$<=b;b--)i[b].isEmpty()&&i.splice(b,1)}return i}}.call(g.prototype);var c=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var i=e[n];if(i.marker){this.session.removeMarker(i.marker);var r=t.indexOf(i);-1!=r&&t.splice(r,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(a.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(a.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?i=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?i=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),i=t.exec(n,e.args||{})):i=t.multiSelectAction(n,e.args||{});else{var i=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var i,r=n&&n.keepOrder,s=1==n||n&&n.$byLines,o=this.session,a=this.selection,l=a.rangeList,c=(r?a:l).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var u=a._eventRegistry;a._eventRegistry={};var h=new g(o);this.inVirtualSelectionMode=!0;for(var d=c.length;d--;){if(s)for(;0<d&&c[d].start.row==c[d-1].end.row;)d--;h.fromOrientedRange(c[d]),h.index=d,this.selection=o.selection=h;var f=e.exec?e.exec(this,t||{}):e(this,t||{});!i&&void 0!==f&&(i=f),h.toOrientedRange(c[d])}h.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=u,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var p=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),p&&p.from==p.to&&this.renderer.animateScrolling(p.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],i=0;i<t.length;i++)n.push(this.session.getTextRange(t[i]));var r=this.session.getDocument().getNewLineCharacter();(e=n.join(r)).length==(n.length-1)*r.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var n=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var i=t==this.multiSelect.anchor?n.cursor==n.start?n.end:n.start:n.cursor;i.row!=t.row||this.session.$clipPositionToDocument(i.row,i.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,n){if((t=t||{}).needle=e||t.needle,null==t.needle){var i=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(i)}this.$search.set(t);var r=this.$search.findAll(this.session);if(!r.length)return 0;var s=this.multiSelect;n||s.toSingleRange(r[0]);for(var o=r.length;o--;)s.addRange(r[o],!0);return i&&s.rangeList.rangeAtPoint(i.start)&&s.addRange(i,!0),r.length},this.selectMoreLines=function(e,t){var n=this.selection.toOrientedRange(),i=n.cursor==n.end,r=this.session.documentToScreenPosition(n.cursor);this.selection.$desiredColumn&&(r.column=this.selection.$desiredColumn);var s,o=this.session.screenToDocumentPosition(r.row+e,r.column);if(n.isEmpty())l=o;else var a=this.session.documentToScreenPosition(i?n.end:n.start),l=this.session.screenToDocumentPosition(a.row+e,a.column);i?(s=w.fromPoints(o,l)).cursor=s.start:(s=w.fromPoints(l,o)).cursor=s.end;if(s.desiredColumn=r.column,this.selection.inMultiSelectMode){if(t)var c=n.cursor}else this.selection.addRange(n);this.selection.addRange(s),c&&this.selection.substractPoint(c)},this.transposeSelections=function(e){for(var t=this.session,n=t.multiSelect,i=n.ranges,r=i.length;r--;){if((a=i[r]).isEmpty()){var s=t.getWordRange(a.start.row,a.start.column);a.start.row=s.start.row,a.start.column=s.start.column,a.end.row=s.end.row,a.end.column=s.end.column}}n.mergeOverlappingRanges();var o=[];for(r=i.length;r--;){var a=i[r];o.unshift(t.getTextRange(a))}e<0?o.unshift(o.pop()):o.push(o.shift());for(r=i.length;r--;){s=(a=i[r]).clone();t.replace(a,o[r]),a.start.row=s.start.row,a.start.column=s.start.column}n.fromOrientedRange(n.ranges[0])},this.selectMore=function(e,t,n){var i=this.session,r=i.multiSelect.toOrientedRange();if(!r.isEmpty()||((r=i.getWordRange(r.start.row,r.start.column)).cursor=-1==e?r.start:r.end,this.multiSelect.addRange(r),!n)){var s,o,a,l=i.getTextRange(r),c=(s=i,o=l,a=e,u.$options.wrap=!0,u.$options.needle=o,u.$options.backwards=-1==a,u.find(s));c&&(c.cursor=-1==e?c.start:c.end,this.session.unfold(c),this.multiSelect.addRange(c),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(r.cursor)}},this.alignCursors=function(){var s=this.session,t=s.multiSelect,e=t.ranges,n=-1,i=e.filter(function(e){if(e.cursor.row==n)return!0;n=e.cursor.row});if(e.length&&i.length!=e.length-1){i.forEach(function(e){t.substractPoint(e.cursor)});var o=0,a=1/0,l=e.map(function(e){var t=e.cursor,n=s.getLine(t.row).substr(t.column).search(/\S/g);return-1==n&&(n=0),t.column>o&&(o=t.column),n<a&&(a=n),n});e.forEach(function(e,t){var n=e.cursor,i=o-n.column,r=l[t]-a;r<i?s.insert(n,m.stringRepeat(" ",i-r)):s.remove(new w(n.row,n.column,n.row,n.column-i+r)),e.start.column=e.end.column=o,e.start.row=e.end.row=n.row,e.cursor=e.end}),t.fromOrientedRange(e[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var r=this.selection.getRange(),c=r.start.row,u=r.end.row,h=c==u;if(h){for(var d,f=this.session.getLength();d=this.session.getLine(u),/[=:]/.test(d)&&++u<f;);for(;d=this.session.getLine(c),/[=:]/.test(d)&&0<--c;);c<0&&(c=0),f<=u&&(u=f-1)}var p=this.session.removeFullLines(c,u);p=this.$reAlignText(p,h),this.session.insert({row:c,column:0},p.join("\n")+"\n"),h||(r.start.column=0,r.end.column=p[p.length-1].length),this.selection.setRange(r)}},this.$reAlignText=function(e,t){function n(e){return m.stringRepeat(" ",e)}function i(e){return e[2]?n(r)+e[2]+n(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var r,s,o,a=!0,l=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?(null==r?(r=t[1].length,s=t[2].length,o=t[3].length):(r+s+o!=t[1].length+t[2].length+t[3].length&&(l=!1),r!=t[1].length&&(a=!1),r>t[1].length&&(r=t[1].length),s<t[2].length&&(s=t[2].length),o>t[3].length&&(o=t[3].length)),t):[e]}).map(t?i:a?l?function(e){return e[2]?n(r+s-e[2].length)+e[2]+n(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:i:function(e){return e[2]?n(r)+e[2]+n(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]})}}).call(c.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=i,e("./config").defineOptions(c.prototype,"editor",{enableMultiselect:{set:function(e){i(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",s)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",s))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var d=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,r=e.getLine(t),s=r.search(i);if(-1!=s){for(var o=n||r.length,a=e.getLength(),l=t,c=t;++t<a;){var u=e.getLine(t).search(i);if(-1!=u){if(u<=s)break;c=t}}if(l<c){var h=e.getLine(c).length;return new d(l,o,c,h)}}},this.openingBracketBlock=function(e,t,n,i,r){var s={row:n,column:i+1},o=e.$findClosingBracket(t,s,r);if(o){var a=e.foldWidgets[o.row];return null==a&&(a=e.getFoldWidget(o.row)),"start"==a&&o.row>s.row&&(o.row--,o.column=e.getLine(o.row).length),d.fromPoints(s,o)}},this.closingBracketBlock=function(e,t,n,i,r){var s={row:n,column:i},o=e.$findOpeningBracket(t,s);if(o)return o.column++,s.column--,d.fromPoints(o,s)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function i(e){this.session=e,(this.session.widgetManager=this).session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./lib/oop");var s=e("./lib/dom");e("./range").Range;(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),(this.editor=e)&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var i=e.data,r=i.start.row,s=i.end.row,o="add"==e.action,a=r+1;a<s;a++)n[a]&&(n[a].hidden=o);n[s]&&(o?n[r]?n[s].hidden=o:n[r]=n[s]:(n[r]==n[s]&&(n[r]=void 0),n[s].hidden=o))}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var n=e.start.row,i=e.end.row-n;if(0!==i)if("remove"==e.action){t.splice(n+1,i).forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var r=new Array(i);r.unshift(n,0),t.splice.apply(t,r),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var n=!0;e.forEach(function(e,t){if(e)for(n=!1,e.row=t;e.$oldWidget;)e.$oldWidget.row=t,e=e.$oldWidget}),n&&(this.session.lineWidgets=null)}},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];t&&((e.$oldWidget=t).el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),(this.session.lineWidgets[e.row]=e).session=this.session;var n=this.editor.renderer;e.html&&!e.el&&(e.el=s.createElement("div"),e.el.innerHTML=e.html),e.el&&(s.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,n.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/n.layerConfig.lineHeight);var i=this.session.getFoldAt(e.row,0);if(e.$fold=i){var r=this.session.lineWidgets;e.row!=i.end.row||r[i.start.row]?e.hidden=!0:r[i.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,n),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var n=this.session._changedWidgets,i=t.layerConfig;if(n&&n.length){for(var r=1/0,s=0;s<n.length;s++){var o=n[s];if(o&&o.el&&o.session==this.session){if(!o._inDocument){if(this.session.lineWidgets[o.row]!=o)continue;o._inDocument=!0,t.container.appendChild(o.el)}o.h=o.el.offsetHeight,o.fixedWidth||(o.w=o.el.offsetWidth,o.screenWidth=Math.ceil(o.w/i.characterWidth));var a=o.h/i.lineHeight;o.coverLine&&((a-=this.session.getRowLineCount(o.row))<0&&(a=0)),o.rowCount!=a&&(o.rowCount=a,o.row<r&&(r=o.row))}}r!=1/0&&(this.session._emit("changeFold",{data:{start:{row:r}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var n=t.layerConfig,i=this.session.lineWidgets;if(i){for(var r=Math.min(this.firstRow,n.firstRow),s=Math.max(this.lastRow,n.lastRow,i.length);0<r&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=r;o<=s;o++){var a=i[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(c-=t.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var p=e("../line_widgets").LineWidgets,g=e("../lib/dom"),m=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new p(n),n.widgetManager.attach(e));var i=e.getCursorPosition(),r=i.row,s=n.widgetManager.getWidgetsAtRow(r).filter(function(e){return"errorMarker"==e.type})[0];s?s.destroy():r-=t;var o,a=function(e,t,n){var i=e.getAnnotations().sort(m.comparePoints);if(i.length){var r=function(e,t,n){for(var i=0,r=e.length-1;i<=r;){var s=i+r>>1,o=n(t,e[s]);if(0<o)i=s+1;else{if(!(o<0))return s;r=s-1}}return-(i+1)}(i,{row:t,column:-1},m.comparePoints);r<0&&(r=-r-1),r>=i.length?r=0<n?0:i.length-1:0===r&&n<0&&(r=i.length-1);var s=i[r];if(s&&n){if(s.row===t){for(;(s=i[r+=n])&&s.row===t;);if(!s)return i.slice()}var o=[];for(t=s.row;o[n<0?"unshift":"push"](s),(s=i[r+=n])&&s.row==t;);return o.length&&o}}}(n,r,t);if(a){var l=a[0];i.column=(l.pos&&"number"!=typeof l.column?l.pos.sc:l.column)||0,i.row=l.row,o=e.renderer.$gutterLayer.$annotations[i.row]}else{if(s)return;o={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(i.row),e.selection.moveToPosition(i);var c={row:i.row,fixedWidth:!0,coverGutter:!0,el:g.createElement("div"),type:"errorMarker"},u=c.el.appendChild(g.createElement("div")),h=c.el.appendChild(g.createElement("div"));h.className="error_widget_arrow "+o.className;var d=e.renderer.$cursorLayer.getPixelPosition(i).left;h.style.left=d+e.renderer.gutterWidth-5+"px",c.el.className="error_widget_wrapper",u.className="error_widget "+o.className,u.innerHTML=o.text.join("<br>"),u.appendChild(g.createElement("div"));var f=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return c.destroy(),{command:"null"}};c.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(f),n.widgetManager.removeLineWidget(c),e.off("changeSelection",c.destroy),e.off("changeSession",c.destroy),e.off("mouseup",c.destroy),e.off("change",c.destroy))},e.keyBinding.addKeyboardHandler(f),e.on("changeSelection",c.destroy),e.on("changeSession",c.destroy),e.on("mouseup",c.destroy),e.on("change",c.destroy),e.session.widgetManager.addLineWidget(c),c.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:c.el.offsetHeight})},g.importCssString("    .error_widget_wrapper {        background: inherit;        color: inherit;        border:none    }    .error_widget {        border-top: solid 2px;        border-bottom: solid 2px;        margin: 5px 0;        padding: 10px 40px;        white-space: pre-wrap;    }    .error_widget.ace_error, .error_widget_arrow.ace_error{        border-color: #ff5a5a    }    .error_widget.ace_warning, .error_widget_arrow.ace_warning{        border-color: #F1D817    }    .error_widget.ace_info, .error_widget_arrow.ace_info{        border-color: #5a5a5a    }    .error_widget.ace_ok, .error_widget_arrow.ace_ok{        border-color: #5aaa5a    }    .error_widget_arrow {        position: absolute;        border: solid 5px;        border-top-color: transparent!important;        border-right-color: transparent!important;        border-left-color: transparent!important;        top: -5px;    }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,l,t){"use strict";e("./lib/fixoldbrowsers");var c=e("./lib/dom"),u=e("./lib/event"),n=e("./range").Range,h=e("./editor").Editor,i=e("./edit_session").EditSession,r=e("./undomanager").UndoManager,d=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),l.config=e("./config"),l.require=e,"function"==typeof define&&(l.define=define),l.edit=function(e,t){if("string"==typeof e){var n=e;if(!(e=document.getElementById(n)))throw new Error("ace.edit can't find div #"+n)}if(e&&e.env&&e.env.editor instanceof h)return e.env.editor;var i="";if(e&&/input|textarea/i.test(e.tagName)){var r=e;i=r.value,e=c.createElement("pre"),r.parentNode.replaceChild(e,r)}else e&&(i=e.textContent,e.innerHTML="");var s=l.createEditSession(i),o=new h(new d(e),s,t),a={document:s,editor:o,onResize:o.resize.bind(o,null)};return r&&(a.textarea=r),u.addListener(window,"resize",a.onResize),o.on("destroy",function(){u.removeListener(window,"resize",a.onResize),a.editor.container.env=null}),o.container.env=o.env=a,o},l.createEditSession=function(e,t){var n=new i(e,t);return n.setUndoManager(new r),n},l.Range=n,l.Editor=h,l.EditSession=i,l.UndoManager=r,l.VirtualRenderer=d,l.version="1.4.2"}),ace.require(["ace/ace"],function(e){for(var t in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace.default=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)}),define("ace",function(){}),angular.module("ui.ace",[]).constant("uiAceConfig",{}).directive("uiAce",["uiAceConfig",function(p){if(angular.isUndefined(window.ace))throw new Error("ui-ace need ace to work... (o rly?)");return{restrict:"EA",require:"?ngModel",link:function(i,e,n,r){var s,o,a=p.ace||{},l=angular.extend({},a,i.$eval(n.uiAce)),c=window.ace.edit(e[0]),u=c.getSession(),h=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);angular.isDefined(e)&&i.$apply(function(){if(!angular.isFunction(e))throw new Error("ui-ace use a function as callback.");e(t)})},d=function(n){return function(e){var t=u.getValue();!r||t===r.$viewValue||i.$$phase||i.$root.$$phase||i.$applyAsync(function(){r.$setViewValue(t)}),h(n,e,c)}},f=function(e){return function(){h(e,c)}};n.$observe("readonly",function(e){c.setReadOnly(!!e||""===e)}),r&&(r.$formatters.push(function(e){if(angular.isUndefined(e)||null===e)return"";if(angular.isObject(e)||angular.isArray(e))throw new Error("ui-ace cannot use an object or an array as a model");return e}),r.$render=function(){u.setValue(r.$viewValue)});var t=function(e,t){e!==t&&((l=angular.extend({},a,i.$eval(n.uiAce))).callbacks=[l.onLoad],l.onLoad!==a.onLoad&&l.callbacks.unshift(a.onLoad),u.removeListener("change",s),s=d(l.onChange),u.on("change",s),c.removeListener("blur",o),o=f(l.onBlur),c.on("blur",o),function(t,e,n){var i,r;angular.isDefined(n.workerPath)&&window.ace.require("ace/config").set("workerPath",n.workerPath);if(angular.isDefined(n.require)&&n.require.forEach(function(e){window.ace.require(e)}),angular.isDefined(n.showGutter)&&t.renderer.setShowGutter(n.showGutter),angular.isDefined(n.useWrapMode)&&e.setUseWrapMode(n.useWrapMode),angular.isDefined(n.showInvisibles)&&t.renderer.setShowInvisibles(n.showInvisibles),angular.isDefined(n.showIndentGuides)&&t.renderer.setDisplayIndentGuides(n.showIndentGuides),angular.isDefined(n.useSoftTabs)&&e.setUseSoftTabs(n.useSoftTabs),angular.isDefined(n.showPrintMargin)&&t.setShowPrintMargin(n.showPrintMargin),angular.isDefined(n.disableSearch)&&n.disableSearch&&t.commands.addCommands([{name:"unfind",bindKey:{win:"Ctrl-F",mac:"Command-F"},exec:function(){return!1},readOnly:!0}]),angular.forEach(n.callbacks,function(e){angular.isFunction(e)&&e(t)}),angular.isString(n.theme)&&t.setTheme("ace/theme/"+n.theme),angular.isString(n.mode)&&e.setMode("ace/mode/"+n.mode),angular.isDefined(n.firstLineNumber)&&(angular.isNumber(n.firstLineNumber)?e.setOption("firstLineNumber",n.firstLineNumber):angular.isFunction(n.firstLineNumber)&&e.setOption("firstLineNumber",n.firstLineNumber())),angular.isDefined(n.advanced))for(i in n.advanced)r={name:i,value:n.advanced[i]},t.setOption(r.name,r.value);if(angular.isDefined(n.rendererOptions))for(i in n.rendererOptions)r={name:i,value:n.rendererOptions[i]},t.renderer.setOption(r.name,r.value)}(c,u,l))};i.$watch(n.uiAce,t,!0),t(a),e.on("$destroy",function(){c.session.$stopWorker(),c.destroy()}),i.$watch(function(){return[e[0].offsetWidth,e[0].offsetHeight]},function(){c.resize(),c.renderer.updateFull()},!0)}}}]),define("uiAce",["angular","ace"],function(){}),angular.module("toastr",[]).directive("toast",["$compile","$interval","toastr",function(o,a,l){return{replace:!0,templateUrl:"templates/toastr/toastr.html",link:function(t,e,n){var i;if(t.toastClass=t.options.toastClass,t.titleClass=t.options.titleClass,t.messageClass=t.options.messageClass,t.options.closeHtml){var r=angular.element(t.options.closeHtml);r.addClass("toast-close-button"),r.attr("ng-click","close()"),o(r)(t),e.prepend(r)}function s(e){return a(function(){l.remove(t.toastId)},e,1)}t.init=function(){t.options.timeOut&&(i=s(t.options.timeOut))},e.on("mouseenter",function(){i&&a.cancel(i)}),t.tapToast=function(){t.options.tapToDismiss&&t.close()},t.close=function(){l.remove(t.toastId)},e.on("mouseleave",function(){0===t.options.timeOut&&0===t.options.extendedTimeOut||(i=s(t.options.extendedTimeOut))})}}}]).constant("toastrConfig",{allowHtml:!1,closeButton:!1,closeHtml:"<button>&times;</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},messageClass:"toast-message",newestOnTop:!0,positionClass:"toast-top-right",tapToDismiss:!0,timeOut:5e3,titleClass:"toast-title",toastClass:"toast"}).factory("toastr",["$animate","$compile","$document","$rootScope","$sce","toastrConfig","$q",function(s,o,a,l,c,e,n){var u,h=0,d=[],f=n.defer();return{clear:function(e){if(e)r(e.toastId);else for(var t=0;t<d.length;t++)r(d[t].toastId)},error:function(e,t,n){return i({iconClass:p().iconClasses.error,message:e,optionsOverride:n,title:t})},info:function(e,t,n){return i({iconClass:p().iconClasses.info,message:e,optionsOverride:n,title:t})},remove:r,success:function(e,t,n){return i({iconClass:p().iconClasses.success,message:e,optionsOverride:n,title:t})},warning:function(e,t,n){return i({iconClass:p().iconClasses.warning,message:e,optionsOverride:n,title:t})}};function p(){return angular.extend({},e)}function i(e){var t,n,i=p(),r={toastId:h++,scope:l.$new()};return r.iconClass=e.iconClass,e.optionsOverride&&(i=angular.extend(i,e.optionsOverride),r.iconClass=e.optionsOverride.iconClass||r.iconClass),function(e,t,n){n.allowHtml?(e.scope.allowHtml=!0,e.scope.title=c.trustAsHtml(t.title),e.scope.message=c.trustAsHtml(t.message)):(e.scope.title=t.title,e.scope.message=t.message);e.scope.toastType=e.iconClass,e.scope.toastId=e.toastId,e.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(e.scope.options.closeHtml=n.closeHtml)}(r,e,i),r.el=(t=r.scope,n=angular.element("<div toast></div>"),o(n)(t)),d.push(r),function(e){if(u)return f.promise;(u=angular.element("<div></div>")).attr("id",e.containerId),u.addClass(e.positionClass),u.css({"pointer-events":"auto"});var t=a.find("body").eq(0);return s.enter(u,t).then(function(){f.resolve()}),f.promise}(i).then(function(){i.newestOnTop?s.enter(r.el,u).then(function(){r.scope.init()}):s.enter(r.el,u,u[0].lastChild).then(function(){r.scope.init()})}),r}function r(e){var t=function(e){for(var t=0;t<d.length;t++)if(d[t].toastId===e)return d[t]}(e);t&&s.leave(t.el).then(function(){t.scope.$destroy(),u&&0===u.children().length&&(d=[],u.remove(),u=null,f=n.defer())})}}]),angular.module("toastr").run(["$templateCache",function(e){"use strict";e.put("templates/toastr/toastr.html",'<div class="{{toastClass}} {{toastType}}" ng-click="tapToast()">\n  <div ng-switch on="allowHtml">\n    <div ng-switch-default ng-if="title" class="{{titleClass}}">{{title}}</div>\n    <div ng-switch-default class="{{messageClass}}">{{message}}</div>\n    <div ng-switch-when="true" ng-if="title" class="{{titleClass}}" ng-bind-html="title"></div>\n    <div ng-switch-when="true" class="{{messageClass}}" ng-bind-html="message"></div>\n  </div>\n</div>')}]),define("ngToastr",["angular"],function(e){return function(){return e.ngToastr}}(this)),function(e,t){"function"==typeof define&&define.amd?define("angular-clipboard",["angular"],t):"object"==typeof module&&module.exports?module.exports=t(require("angular")):e.angularClipboard=t(e.angular)}(this,function(r){return r.module("angular-clipboard",[]).factory("clipboard",["$document","$window",function(a,l){return{copyText:function(e,t){var n,i,r=l.pageXOffset||a[0].documentElement.scrollLeft,s=l.pageYOffset||a[0].documentElement.scrollTop,o=(n=e,(i=a[0].createElement("textarea")).style.position="absolute",i.style.fontSize="12pt",i.style.border="0",i.style.padding="0",i.style.margin="0",i.style.left="-10000px",i.style.top=(l.pageYOffset||a[0].documentElement.scrollTop)+"px",i.textContent=n,i);a[0].body.appendChild(o),function(e){try{a[0].body.style.webkitUserSelect="initial";var t=a[0].getSelection();t.removeAllRanges();var n=document.createRange();n.selectNodeContents(e),t.addRange(n),e.select(),e.setSelectionRange(0,999999);try{if(!a[0].execCommand("copy"))throw"failure copy"}finally{t.removeAllRanges()}}finally{a[0].body.style.webkitUserSelect=""}}(o),l.scrollTo(r,s),a[0].body.removeChild(o)},supported:"queryCommandSupported"in a[0]&&a[0].queryCommandSupported("copy")}}]).directive("clipboard",["clipboard",function(i){return{restrict:"A",scope:{onCopied:"&",onError:"&",text:"=",supported:"=?"},link:function(t,n){t.supported=i.supported,n.on("click",function(e){try{i.copyText(t.text,n[0]),r.isFunction(t.onCopied)&&t.$evalAsync(t.onCopied())}catch(e){r.isFunction(t.onError)&&t.$evalAsync(t.onError({err:e}))}})}}}])}),define("modules/projections/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.projections.controllers",["es-ui.projections.services"])}),define("modules/projections/controllers/ProjectionsItemDebugCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsItemDebugCtrl",["$scope","$state","$stateParams","$q","$timeout","$window","ProjectionsService","MessageService",function(s,e,t,r,n,i,o,a){function l(e){e||(e="N/A"),s.statusInfo=e}l(""),s.location=t.location,s.aceConfig={mode:"javascript",useWrapMode:!1,showGutter:!0,theme:"monokai",onChange:function(){s.queryUpdated=!0}},s.aceEventsConfig={mode:"json",useWrapMode:!1,showGutter:!0,theme:"monokai"},s.isRunning=!1,s.isUpdating=!1,s.query="",s.events="",s.state="";var c,u,h,d,f,p,g,m,v={};function $(){o.readEvents(h,d).then(function(e){var t=e.data;s.events=JSON.stringify(t,void 0,4),(c=t.events)&&0<c.length?function(){if(u=c[0],p)return b();l("Running the definition..."),s.$broadcast("load-scripts"),n(b,100)}():(l("No further events are available. Waiting..."),s.isRunning=!0,m=n($,1e3))},function(e){a.failure("Failed to read projection events: "+e.message)})}function b(){var e;(g=document.getElementById("script-placeholder").contentWindow.processor)?(p=!0,l(""),f=null,f=h.byCustomPartitions?g.get_state_partition(u.isJson?angular.toJson(u.data):u.data,u.isJson,u.eventStreamId,u.eventType,u.category,u.eventNumber,u.isJson?angular.toJson(u.metadata):u.metadata):h.byStream?u.eventStreamId:"",e="("+(e=f)+")",s.currentPartition=e,v[f]?w(v[f]):(l("Loading the projection state..."),o.state(s.location,{partition:f}).then(function(e){w(e.data)},function(e){l("Failed to load the projection state: "+e.message)}))):n(b,1e3)}function w(e){var t;l("Ready for debugging!"),s.isRunning=!1,""===e?(g.initialize(),v[f]=g.debugging_get_state()):(e=function(e){try{var t=JSON.parse(e);if(t&&"object"==typeof t&&null!==t)return t}catch(e){}return!1}(e)?e:angular.toJson(e),v[f]=e,g.set_state(e));try{t=angular.fromJson(v[f]),s.state=t}catch(e){s.state=""}}l("Loading definition..."),a.info("The projection will be stopped for debugging"),o.disable(s.location).then(function(){!function(){v={};var e=[],t=o.statistics(s.location),n=o.state(s.location,{timeout:2e3}),i=o.query(s.location);e.push(t),e.push(n),e.push(i),r.allSettled(e).then(function(e){var t,n=e[0],i=e[1],r=e[2];if(-1<n.data.projections[0].status.indexOf("Stopped")&&-1<n.data.projections[0].status.indexOf("Faulted")&&(s.isRunning=!0),t=i.headers()["es-position"],d=angular.fromJson(t),h=r.data.definition,s.query=r.data.query,!d)return a.failure("The projection`s state query did not return an ES-Position header.\nEnsure that the projection is not Completed/Stopped or Faulted.\nWe cannot continue debugging.","Please ensure that the header includes ES-Position."),void(s.isRunning=!0);l(""),$()},function(e){var t=e[0],n=e[1],i=e[2];t&&!t.data&&a.failure("Failed to retrieve projection stats: "+t.message),n&&!n.data&&a.failure("Failed to retrieve projection state: "+n.message),i&&!i.data?a.failure("Failed to retrieve projection query: "+i.message):s.query=i.data.query})}()},function(e){a.failure("Failed to stop projection: "+e.message)}),s.runStep=function(){var e=g.process_event(u.isJson?JSON.stringify(u.data):u.data,u.isJson,u.eventStreamId,u.eventType,u.category,u.eventNumber,u.isJson?JSON.stringify(u.metadata):u.metadata,u.isJson?JSON.stringify(u.linkMetadata):u.linkMetadata,f);v[f]=e,w(v[f]),d=u.readerPosition,$()},s.update=function(){s.isUpdating=!0,o.updateQuery(s.location,null,s.query).then(function(){a.info("Projection Updated"),i.location.reload()},function(e){s.isUpdating=!1,a.failure("Failed to update projection: "+e.message)})},s.stop=function(){m&&(n.cancel(m),m=null),o.disable(s.location).then(function(){a.info("Projection Stopped"),s.isRunning=!1},function(e){a.failure("Failed to stop projection: "+e.message)})},s.goBack=function(){t.fromQueryState?e.go("query",{location:s.location}):e.go("^.details")}}])}),define("modules/projections/controllers/ProjectionsItemDeleteCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsItemDeleteCtrl",["$scope","$state","$stateParams","ProjectionsService","MessageService",function(t,n,e,i,r){function s(e){i.remove(t.location,{deleteCheckpointStream:t.deleteCheckpoint?"yes":"no",deleteStateStream:t.deleteState?"yes":"no",deleteEmittedStreams:t.deleteEmittedStreams?"yes":"no"}).then(function(){r.success("Projection has been removed"),n.go("projections.list")},function(e){r.failure("Failed to remove projection: "+e.message)})}t.location=e.location,t.projection={name:"",source:"",state:""},i.state(t.location).then(function(e){t.projection.state=e.data},function(e){r.failure("Failed to load the projection state: "+e.message)}),i.query(t.location).then(function(e){t.projection.source=e.data.query,t.projection.name=e.data.name},function(e){r.failure("Failed to load projection source: "+e.message)}),t.remove=function(e){e.preventDefault(),e.stopPropagation(),i.disable(t.location).then(function(){s(t.location)},function(e){-1!==e.message.indexOf("Not enabled")?s(t.location):r.failure("Failed to stop projection: "+e.message)})}}])}),define("modules/projections/controllers/ProjectionsItemDetailsCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsItemDetailsCtrl",["$scope","$state","$stateParams","ProjectionsService","ProjectionsMonitor","MessageService",function(n,e,t,i,r,s){var o=null,a=null;n.location=t.location,n.aceConfig={mode:"javascript",useWrapMode:!1,showGutter:!0,theme:"monokai"},r.start(n.location,{partitionProvider:n}).then(null,null,function(e){var t;e.statistics&&e.statistics.projections.length&&(n.stats=e.statistics.projections[0],n.isTransientProjection="Transient"==n.stats.mode,"$by_category"!==n.stats.name&&"$stream_by_category"!==n.stats.name||(n.aceConfig.mode="text"),null!==o&&(n.stats.eventsPerSecond=(1e3*(n.stats.eventsProcessedAfterRestart-o)/(new Date-a)).toFixed(1)),a=new Date,o=n.stats.eventsProcessedAfterRestart,t=n.stats.status,n.isRunning=!(0===t.indexOf("Loaded")||0===t.indexOf("Stopped")||0===t.indexOf("Completed")||0===t.indexOf("Faulted")),n.isStopped=!!~t.indexOf("Stopped")),e.query&&(e.query.definition?n.stream=e.query.definition.resultStreamName:n.stream=void 0,n.query=e.query.query),e.result&&(n.result=e.result),e.state&&(n.state=e.state)}),n.reset=function(){s.confirm("Projection reset is an unsafe operation. Any previously emitted events will be emitted again to the same streams and handled by their subscribers.\n\rAre you sure?")&&i.reset(n.location).then(function(){s.success("Projection has been reset")},function(e){s.failure("Failed to reset projection: "+e.message)})},n.start=function(){i.enable(n.location).then(function(){s.success("Projection started")},function(e){s.failure("Failed to start projection: "+e.message)})},n.stop=function(){i.disable(n.location).then(function(){s.success("Projection has been stopped")},function(e){s.failure("Failed to stop projection: "+e.message)})},n.$on("$destroy",function(){r.stop()}),n.clearState=function(){n.state=void 0}}])}),define("modules/projections/controllers/ProjectionsItemEditCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsItemEditCtrl",["$scope","$state","$stateParams","ProjectionsService","ProjectionsMonitor","MessageService",function(n,e,t,i,r,s){n.location=t.location,n.aceConfig={mode:"javascript",useWrapMode:!1,showGutter:!0,theme:"monokai"},i.query(n.location).then(function(e){var t=e.data;n.query=t.query,t.definition?n.stream=t.definition.resultStreamName:n.stream=void 0,n.emit=t.emitEnabled},function(e){s.failure("Failed to load projection source: "+e.message)}),r.start(n.location,{partitionProvider:n,ignoreQuery:!0}).then(null,null,function(e){var t;e.statistics&&e.statistics.projections.length&&(n.stats=e.statistics.projections[0],"$by_category"!==n.stats.name&&"$stream_by_category"!==n.stats.name||(n.aceConfig.mode="text"),t=n.stats.status,n.isRunning=!(0===t.indexOf("Loaded")||0===t.indexOf("Stopped")||0===t.indexOf("Completed")||0===t.indexOf("Faulted")),n.isStopped=!!~t.indexOf("Stopped")),e.result&&(n.result=e.result),e.state&&(n.state=e.state)}),n.save=function(){i.updateQuery(n.location,n.emit?"yes":"no",n.query).then(function(){s.success("Projection saved")},function(e){s.failure("Failed to save projection: "+e.message)})},n.reset=function(){s.confirm("Projection reset is an unsafe operation. Any previously emitted events will be emitted again to the same streams and handled by their subscribers.\n\rAre you sure?")&&i.reset(n.location).then(function(){s.success("Projection has been reset")},function(e){s.failure("Failed to reset projection: "+e.message)})},n.start=function(){i.enable(n.location).then(function(){s.success("Projection started")},function(e){s.failure("Failed to start projection: "+e.message)})},n.stop=function(){i.disable(n.location).then(function(){s.success("Projection stopped")},function(e){s.failure("Failed to stop projection: "+e.message)})},n.$on("$destroy",function(){r.stop()})}])}),define("modules/projections/controllers/ProjectionsItemConfigCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsItemConfigCtrl",["$scope","$state","$stateParams","ProjectionsService","ProjectionsMonitor","MessageService",function(t,e,n,i,r,s){t.location=n.location,i.configuration(t.location).then(function(e){t.config=e.data},function(e){t.config={},s.failure("Failed to load projection configuration: "+e.message)}),r.start(t.location,{ignoreQuery:!0}).then(null,null,function(e){e.statistics&&e.statistics.projections.length&&(t.stats=e.statistics.projections[0]),e.result&&(t.result=e.result),e.state&&(t.state=e.state)}),t.save=function(){var e={emitEnabled:t.config.emitEnabled,trackEmittedStreams:t.config.trackEmittedStreams,checkpointAfterMs:t.config.checkpointAfterMs,checkpointHandledThreshold:t.config.checkpointHandledThreshold,checkpointUnhandledBytesThreshold:t.config.checkpointUnhandledBytesThreshold,pendingEventsThreshold:t.config.pendingEventsThreshold,maxWriteBatchLength:t.config.maxWriteBatchLength,maxAllowedWritesInFlight:t.config.maxAllowedWritesInFlight};i.updateConfiguration(t.location,e).then(function(){s.success("Projection configuration saved")},function(e){s.failure("Failed to save projection configuration: "+e.message)})},t.$on("$destroy",function(){r.stop()})}])}),define("modules/projections/controllers/ProjectionsListCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsListCtrl",["$rootScope","$scope","$timeout","ProjectionsService","ProjectionsMapper","poller","MessageService","$state",function(t,i,r,s,o,a,l,c){function e(){if(!t.projectionsEnabled)return l.failure("Projections are not enabled on the node"),void c.go("dashboard.list");var n=a.create({interval:2e3,action:s.all,params:[!1]});n.start(),n.promise.then(null,null,function(e){i.projections=o.map(e)}),n.promise.catch(function(e){l.failure("Failed to retrieve list of projections: "+e.message),n.stop()}),i.disableAll=function(e){e.preventDefault(),e.stopPropagation(),l.confirm("Are you sure you want to disable & stop all projections?")&&s.disableAll().then(function(){l.success("All projections have been disabled")},function(e){l.failure("Failed to disable all the projections: "+e)})},i.enableAll=function(e){e.preventDefault(),e.stopPropagation(),l.confirm("Are you sure you want to enable & start all projections?")&&s.enableAll().then(function(){l.success("All projections have been enabled")},function(e){l.failure("Failed to enable all projections: "+e)})},i.includeQueries=!1,i.toggleIncludeQueries=function(){i.includeQueries=!i.includeQueries},i.showCopiedMessage=function(e){e.copied=!0,l.success('Copied "'+e.name+'" to clipboard'),r(function(){e.copied=!1},4e3)};var e=i.$watch("includeQueries",function(e,t){e!==t&&n.update({params:[e]})});i.$on("$destroy",function(){e(),a.clear()})}if(t.initialized)e();else var n=t.$on("initialized",function(){e(),n()})}])}),define("modules/projections/controllers/ProjectionsNewCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsNewCtrl",["$scope","$state","ProjectionsService","MessageService",function(n,i,t,r){function s(e){return e?"yes":"no"}n.aceConfig={mode:"javascript",useWrapMode:!1,showGutter:!0,theme:"monokai"},n.modes=[{value:"onetime",name:"One-Time"},{value:"continuous",name:"Continuous"}],n.mode="onetime",n.enabled=!0,n.checkpointsDisabled=!1,n.checkpoints=!1,n.trackEmittedStreams=!1,n.save=function(){if(n.newProj.$invalid)r.warn("Please fix all validation errors");else{var e={name:n.name,emit:s(n.emit),checkpoints:s(n.checkpoints),enabled:s(n.enabled),trackemittedstreams:s(n.trackemittedstreams)};t.create(n.mode,n.source,e).then(function(e){var t=(0,e.headers)().location;i.go("^.item.details",{location:encodeURIComponent(t)})},function(e){r.failure("Failed to create new projection: "+e.message)})}};var e=n.$watch("mode",function(e,t){e!==t&&("continuous"===e?(n.checkpoints=!0,n.checkpointsDisabled=!0):(n.checkpointsDisabled=!1,n.checkpoints=!0))});n.$on("$destroy",function(){e()})}])}),define("modules/projections/controllers/ProjectionsStandardCtrl",["./_module"],function(e){"use strict";return e.controller("ProjectionsStandardCtrl",["$scope","$state","ProjectionsService","MessageService",function(e,n,t,i){e.types=[{value:"native:EventStore.Projections.Core.Standard.IndexStreams",name:"Index Streams"},{value:"native:EventStore.Projections.Core.Standard.CategorizeStreamByPath",name:"Categorize Stream by Path"},{value:"native:EventStore.Projections.Core.Standard.CategorizeEventsByStreamPath",name:"Categorize Event by Stream Path"},{value:"native:EventStore.Projections.Core.Standard.IndexEventsByEventType",name:"Index Events by Event Type"},{value:"native:EventStore.Projections.Core.Standard.StubHandler",name:"Reading Speed Test Handler"}],e.aceConfig={mode:"javascript",useWrapMode:!1,showGutter:!0,theme:"monokai"},e.type="native:EventStore.Projections.Core.Standard.IndexStreams",e.save=function(){e.newProj.$invalid?i.info("Please fix all validation errors"):t.createStandard(e.name,e.type,e.source).then(function(e){var t=(0,e.headers)().location;n.go("^.item.details",{location:encodeURIComponent(t)})},function(e){i.failure("Failed to create new standard projection: "+e.message)})}}])}),define("modules/projections/controllers/QueryCtrl",["./_module"],function(e){"use strict";return e.controller("QueryCtrl",["$scope","$state","$stateParams","QueryService","ProjectionsMonitor","MessageService","ProjectionsService",function(o,e,t,n,i,r,s){var a;function l(){return i.stop(),n.disable(a)}function c(){o.maximized=!1;n.update(a,o.query).then(function(){var e=n.enable(a);o.state=void 0,i.stop(),i.start(a,{ignoreQuery:!0,ignoreResult:!0}).then(null,null,function(e){var t,n,i,r;if(e.state&&(o.state=e.state,o.isStopped&&l()),e.statistics&&e.statistics.projections.length){n=(t=e.statistics.projections[0]).status,i=t.stateReason,o.status=n;var s=i.match(/[^\r\n]+/g);o.stateReason=null!==s&&0<s.length?s[0]:i,r=!!~n.indexOf("Stopped")&&!~n.indexOf("Preparing")||!!~n.indexOf("Faulted")||!!~n.indexOf("Completed"),o.isStopped=r,o.progress=t.progress}}),e.catch(function(e){r.failure("Failed to start query: "+e.message),i.stop()})},function(e){404===e.statusCode?r.failure("The query was not updated because it was not found. The query probably expired and was deleted."):r.failure("Failed to update the query: "+e.message)})}t.location?(a=t.location,s.query(a).then(function(e){o.query=e.data.query},function(e){r.failure("Failed to load query source: "+e.message)})):t.initStreamId?o.query="fromStream('"+t.initStreamId+"')\n  .when({\n  })":o.query=n.retrieveQuery(),o.aceConfig={mode:"javascript",useWrapMode:!1,showGutter:!0,theme:"monokai",onChange:function(){n.rememberQuery(o.query)}},o.disableStop=function(){return!o.isCreated||!!o.isStopped},o.run=function(){o.isCreated?c():n.create(o.query,{emit:"no",checkpoints:"no",enabled:"no"}).then(function(e){var t=e.headers;a=t().location,o.isCreated=!0,c()},function(e){o.isCreated=!1,r.failure("Failed to create new query: "+e.message)})},o.stop=function(){l().catch(function(e){r.failure("Failed to stop query: "+e.message)})},o.debug=function(){n.disable(a).then(function(){n.reset(a).then(function(){e.go("projections.item.debug",{location:encodeURIComponent(a),fromQueryState:!0},{inherit:!1})},function(e){r.failure("Failed to reset query: "+e.message)})},function(e){r.failure("Failed to stop query: "+e.message)})};var u=o.$watch("query",function(e,t,n){});o.$on("$destroy",function(){u(),i.stop()})}])}),define("modules/projections/controllers/_index",["./ProjectionsItemDebugCtrl","./ProjectionsItemDeleteCtrl","./ProjectionsItemDetailsCtrl","./ProjectionsItemEditCtrl","./ProjectionsItemConfigCtrl","./ProjectionsListCtrl","./ProjectionsNewCtrl","./ProjectionsStandardCtrl","./QueryCtrl"],function(){}),define("modules/projections/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.projections.services",[])}),define("modules/projections/services/ProjectionsService",["./_module"],function(e){"use strict";return e.provider("ProjectionsService",function(){this.$get=["$http","$q","urls","constants","UrlBuilder","uri",function(l,c,s,e,o,a){function t(e,s,o){var t=e(),a=c.defer();return t.then(function(e){var t,n=e.data,i=[],r=[];angular.forEach(n.projections,function(e){t=e.statusUrl+s,e.status!==o&&(i.push(l.post(t)),r.push(e))}),0!==i.length?c.allSettled(i).then(function(e){a.resolve(e)},function(e){for(var t="",n=0,i=0;i<e.length;i++)e[i].data||(0<n&&(t+=", "),t+=r[i].name+": "+e[i].message,n+=1);a.reject(t)}):a.resolve([])},function(e){a.reject("Failed to retrieve projections list: "+e.message)}),a.promise}return{all:function(e){var t;return t=e?o.build(s.projections.any):o.build(s.projections.allNonTransient),l.get(t)},disableAll:function(){return t(this.all,s.projections.disable,e.projectionStatus.stopped)},enableAll:function(){return t(this.all,s.projections.enable,e.projectionStatus.running)},create:function(e,t,n){var i=a.getQuery(n),r=o.build(s.projections.create,e)+i;return l.post(r,t)},createStandard:function(e,t,n,i){var r=o.build(s.projections.createStandard,e,t);return l.post(r,n)},status:function(e,t){return e=o.simpleBuild("%s",e),l.get(e,t)},partitionedState:function(r){return function(e,t,n){var i;return t&&!t.timeout?(r.partition&&(t.partition=r.partition),i="?"+a.getQuery(t)):(i=r.partition?"?"+a.getQuery({partition:r.partition}):"",n=t),e=o.simpleBuild(s.projections.state,e)+i,l.get(e,n)}},state:function(e,t,n){var i;return t&&!t.timeout?(i=a.getQuery(t),e=o.simpleBuild(s.projections.state,e)+"?"+i):(n=t,e=o.simpleBuild(s.projections.state,e)),l.get(e,n)},result:function(e,t){return e=o.simpleBuild(s.projections.result,e),l.get(e,t)},statistics:function(e,t){return e=o.simpleBuild(s.projections.statistics,e),l.get(e,t)},query:function(e,t,n){return e=t&&!t.timeout?o.simpleBuild(s.projections.queryWithoutConfig,e):o.simpleBuild(s.projections.query,e),l.get(e,n)},readEvents:function(e,t,n){var i,r=o.build(s.projections.readEvents);return i={query:e,position:t,maxEvents:n=n||10},l.post(r,JSON.stringify(i))},remove:function(e,t,n){t.timeout&&(t=void 0);var i=a.getQuery(t);return e=o.simpleBuild(s.projections.remove,e)+i,l.delete(e)},reset:function(e){return e=o.simpleBuild(s.projections.commands.reset,e),l.post(e)},enable:function(e){return e=o.simpleBuild(s.projections.commands.enable,e),l.post(e)},disable:function(e){return e=o.simpleBuild(s.projections.commands.disable,e),l.post(e)},updateQuery:function(e,t,n){return e=t?o.simpleBuild(s.projections.updateQuery,e)+t:o.simpleBuild(s.projections.updatePlainQuery,e),l.put(e,n)},configuration:function(e){return e=o.simpleBuild(s.projections.configuration,e),l.get(e)},updateConfiguration:function(e,t){return e=o.simpleBuild(s.projections.configuration,e),l.put(e,t,{headers:{"Content-Type":"application/json"}})}}}]})}),define("modules/projections/services/ProjectionsMapper",["./_module"],function(e){"use strict";return e.provider("ProjectionsMapper",function(){var h,d={};function e(e){var t,n,i,r,s,o=e.projections,a={},l=new Date,c=0,u=o.length;for(o.sort(function(e,t){return e.name.localeCompare(t.name)});c<u;c++)s=(t=o[c]).name,r=d[s],a[s]=t,void 0!==r&&h&&(n=t.eventsProcessedAfterRestart-r.eventsProcessedAfterRestart,i=l-h,t.eventsPerSecond=(1e3*n/i).toFixed(1)),t.location=encodeURIComponent(t.statusUrl),o[c]=t;return d=a,h=l,o}this.$get=[function(){return{map:e}}]})}),define("modules/projections/services/ProjectionsMonitor",["./_module"],function(e){"use strict";return e.factory("ProjectionsMonitor",["$q","poller","ProjectionsService","MessageService",function(n,s,i,r){var o;function a(e,t,n,i){var r=s.create({interval:1e3,action:t,params:[e]});return r.start(),r.promise.then(null,i,n),r}return{start:function(e,t){return t=t||{},o=n.defer(),t.ignoreStats||a(e,i.statistics,function(e){o?o.notify({statistics:e}):console.log("deffered is null")},function(e){r.failure("Failed to fetch projection statistics: "+e.message)}),!t.ignoreState&&t.partitionProvider?a(e,i.partitionedState(t.partitionProvider),function(e){o?o.notify({state:e}):console.log("deffered is null")},function(e){r.failure("Failed to fetch projection partition state: "+e.message)}):t.ignoreState||t.partitionProvider||a(e,i.state,function(e){o?o.notify({state:e}):console.log("deffered is null")},function(e){r.failure("Failed to fetch projection state: "+e.message)}),t.ignoreQuery||a(e,i.query,function(e){o?o.notify({query:e}):console.log("deffered is null")},function(e){r.failure("Failed to fetch projection query: "+e.message)}),t.ignoreResult||a(e,i.result,function(e){o?o.notify({result:e}):console.log("deffered is null")},function(e){r.failure("Failed to fetch projection result: "+e.message)}),o.promise},stop:function(){s.clear(),null,o&&o.resolve()}}}])}),define("modules/projections/services/QueryService",["./_module"],function(e){"use strict";return e.provider("QueryService",function(){this.$get=["$http","$q","urls","UrlBuilder","uri",function(r,e,s,o,a){return{rememberQuery:function(e){localStorage&&localStorage.setItem("latest-query",e)},retrieveQuery:function(){return localStorage&&localStorage.getItem("latest-query")||""},create:function(e,t){var n=a.getQuery(t),i=o.build(s.query.create)+n;return r.post(i,e)},update:function(e,t){return e=o.simpleBuild(s.query.update,e),r.put(e,t)},state:function(e){return e=o.simpleBuild(s.query.state,e),r.get(e)},enable:function(e){return e=o.simpleBuild(s.query.commands.enable,e),r.post(e)},disable:function(e){return e=o.simpleBuild(s.query.commands.disable,e),r.post(e)},reset:function(e){return e=o.simpleBuild(s.query.commands.reset,e),r.post(e)}}}]})}),define("modules/projections/services/AtomEventsReader",["./_module"],function(e){"use strict";return e.factory("AtomEventsReader",["$q","$timeout","StreamsService","uri","poller",function(t,e,o,a,l){var c,n;return{start:function(e){return this.stop(),c=t.defer(),(n=l.create({interval:1e3,action:o.streamEvents,params:[e]})).start(),n.promise.then(null,null,function(e){l.stopAll();var t,n,i,r,s=function(e){var t,n,i,r,s=[],o={};for(t=e.entries,i=e.links.length,n=0;n<i;n++)(r=e.links[n]).fullUri=r.uri,r.uri="#"+a.parse(r.uri).pathname,"previous"===r.relation&&(o={index:n,uri:r.fullUri}),s.push(r);return{headOfStream:e.headOfStream,entries:t,links:s,previous:o}}(e);c.notify(s),t=s.previous,n=e.headOfStream,i=function(){l.resume()},r=function(){l.clear(),c.resolve()},n?(t.uri||i(),o.validateFullUrl(t.uri).then(function(){i()},function(e){console.error("Failed to validate URL: "+t.uri+". Error: "+e.message)})):r()}),n.promise.catch(function(e){l.clear(),c.reject(e)}),c.promise},map:function(e,t){var n,i,r=e.length;for(n=0;n<r;n++)t[(i=e[n]).title]&&(i.showJson=!0),e[n]=i;return e},stop:function(){l.clear(),c=null},pause:function(){l.pauseAll()},resume:function(){l.resume()},resumePaused:function(){l.resumePaused()}}}])}),define("modules/projections/services/_index",["./ProjectionsService","./ProjectionsMapper","./ProjectionsMonitor","./QueryService","./AtomEventsReader"],function(){}),define("modules/projections/directives/_module",["angular"],function(e){"use strict";return e.module("es-ui.projections.directives",[])}),define("modules/projections/directives/EsProjDebugFrame",["./_module"],function(e){"use strict";return e.directive("esProjDebugFrame",["$rootScope",function(t){return{restrict:"A",scope:{esLocation:"="},link:function(e,i){var r='<div id="text"></div><script src="BASE_URI/web/es/js/projections/v8/Prelude/Modules.js"><\/script><script src="BASE_URI/web/es/js/projections/v8/Prelude/Projections.js"><\/script><script src="BASE_URI/web/es/js/projections/es.projections.environment.js"><\/script><script src="BASE_URI/web/es/js/projections/v8/Prelude/1Prelude.js"><\/script><script>window.processor = $initialize_hosted_projections(); processor.set_debugging();<\/script><script src="LOCATION/query"><\/script>';r=(r=r.replace(/BASE_URI/g,t.baseUrl)).replace(/LOCATION/g,decodeURIComponent(e.esLocation)),e.$on("load-scripts",function(){var e;(e=document.getElementById("script-placeholder"))&&e.parentNode.removeChild(e);var t,n=document.createElement("iframe");n.setAttribute("frameborder","0"),n.setAttribute("width","100%"),n.id="script-placeholder",i[0].appendChild(n),t=n.document,n.contentDocument?t=n.contentDocument:n.contentWindow&&(t=n.contentWindow.document),t.open(),t.writeln(r),t.close()})}}}])}),define("modules/projections/directives/_index",["./EsProjDebugFrame"],function(){}),define("modules/projections/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.item.config.tpl.html",'<header class=page-header><h2 class=page-title>Projection Configuration</h2><ul class=page-nav><li class=page-nav__item><button ng-click=save()>Save</button></li><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><h3>{{stats.name}} - {{stats.status}}</h3><p><strong>mode: </strong><span>{{stats.mode}}</span></p><p style="background-color: red; color: white" ng-if=stats.stateReason>{{stats.stateReason}}</p><table><tbody><tr class=table-subheading><td colspan=2>Projection Configuration</td></tr><tr><td>Emit Enabled</td><td><input type=checkbox ng-model=config.emitEnabled required class=form-table name=emit></td></tr><tr><td>Track Emitted Streams</td><td><input type=checkbox ng-model=config.trackEmittedStreams required class=form-table name=trackEmittedStreams></td></tr><tr><td>Checkpoint After (ms)</td><td><input ng-model=config.checkpointAfterMs required class=form-table name=checkpointAfterMs></td></tr><tr><td>Checkpoint Handled Threshold</td><td><input ng-model=config.checkpointHandledThreshold required class=form-table name=checkpointHandledThreshold></td></tr><tr><td>Checkpoint Unhandled Threshold (bytes)</td><td><input ng-model=config.checkpointUnhandledBytesThreshold required class=form-table name=checkpointUnhandledBytesThreshold></td></tr><tr><td>Pending Events Threshold</td><td><input ng-model=config.pendingEventsThreshold required class=form-table name=pendingEventsThreshold></td></tr><tr><td>Max Write Batch Length</td><td><input ng-model=config.maxWriteBatchLength required class=form-table name=maxWriteBatchLength></td></tr><tr><td>Maximum Number Of Allowed Writes In Flight</td><td><input ng-model=config.maxAllowedWritesInFlight required class=form-table name=maxAllowedWritesInFlight></td></tr></tbody></table>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.item.debug.tpl.html",'<header class=page-header><h2 class=page-title>Projection Debug</h2><ul class=page-nav><li class=page-nav__item><button ng-click=runStep() ng-disabled=isRunning>Run Step</button></li><li class=page-nav__item><button ng-click=stop() ng-disabled=!isRunning>Stop</button></li><li class=page-nav__item><button ng-click=update() ng-disabled=isUpdating>Update</button></li><li class=page-nav__item><a ng-click=goBack()>Back</a></li></ul></header><h3>Current Status: <small>{{statusInfo}}</small></h3><div class=container><div class=container-left><h3 class=block-title>Source</h3><div ng-show=queryUpdated><h4>The query has been updated but not saved. Your changes will not take effect until you hit the "Update" button</h4></div><div ui-ace=aceConfig ng-model=query></div></div><div class=container-right><h3 class=block-title>State {{ currentPartition }}</h3><pre>\n{{ state | json }}\n\t\t\t\t</pre><h3 class=block-title>Events</h3><div ui-ace=aceEventsConfig readonly=true ng-model=events></div></div></div><div class=container><div class=container-left><div class=block><h3 class=block-title>Instructions</h3><ol><li>Make sure you use the Google Chrome browser.</li><li>Open a debugger (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>J</kbd> on Windows).</li><li>Check the debugger console for errors (occurred while running the projection definition on while loading state and events).</li><li>Click the ‘Run’ button above.</li><li>Watch for errors in the debugger console</li><li>Check the debugging status on XXXXXXXXX.</li><li>Execution will stop on ‘debugger’ statement immediately before invoking your event handler.</li></ol><p>Any log output and emitted events will appear in the log viewer.</p><p class=note--warning>The projection will be debugged using the browsers javascript engine and may behave differently than when it is running normally</p></div></div><div class=container-right><h3 class=block-title>Log Viewer</h3><div es-proj-debug-frame es-location=location></div></div></div>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.item.delete.tpl.html","<header class=page-header><h2 class=page-title>Delete Projection</h2><ul class=page-nav><li class=page-nav__item><a ng-click=remove($event) href=#>Confirm Delete</a> <a ui-sref=^.details>Back</a></li></ul></header><table><tbody><tr><td>Name</td><td><span>{{ projection.name }}</span></td></tr><tr><td>State</td><td><span>{{ projection.state }}</span></td></tr><tr><td>Source</td><td><pre>\n{{ projection.source }}\n\t\t\t\t</pre></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteCheckpoint> Delete Checkpoint Stream</label></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteState> Delete State Stream</label></td></tr><tr><td></td><td><label><input type=checkbox ng-model=deleteEmittedStreams> Delete Emitted Streams</label></td></tr></tbody></table>")}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.item.details.tpl.html",'<header class=page-header><h2 class=page-title>Projection Details</h2><ul class=page-nav><li class=page-nav__item><button ng-click=start() ng-disabled=isRunning href=#>Start</button></li><li class=page-nav__item><button ng-click=stop() ng-disabled=isStopped>Stop</button></li><li class=page-nav__item><a ui-sref=^.edit>Edit</a></li><li class=page-nav__item><a ui-sref=^.config>Config</a></li><li ng-show=!isTransientProjection class=page-nav__item><a ui-sref=^.debug>Debug</a></li><li class=page-nav__item><a ui-sref=^.delete ng-if=!isRunning>Delete</a> <a title="a Projection must be stopped before it may be deleted." ng-if=isRunning ng-disabled=isRunning>Delete</a></li><li ng-show=!isTransientProjection class=page-nav__item><button ng-click=reset($event)>Reset</button></li><li class=page-nav__item><a ui-sref=^.^.list>Back</a></li></ul></header><h3>{{stats.name}} - {{stats.status}}</h3><p><strong>mode: </strong><span>{{stats.mode}}</span></p><p style="background-color: red; color: white" ng-if=stats.stateReason>{{stats.stateReason}}</p><div class=container><div class=container-left><h3 class=block-title>Source</h3><div readonly=true ui-ace=aceConfig ng-model=query></div></div><div class=container-right><table><thead><tr><th colspan=2>Stats</th></tr></thead><tbody><tr><td>Events/sec</td><td>{{ stats.eventsPerSecond }}</td></tr><tr><td>Buffered events</td><td>{{ stats.bufferedEvents }}</td></tr><tr><td>Events processed</td><td>{{ stats.eventsProcessedAfterRestart }}</td></tr><tr><td>Partitions cached</td><td>{{ stats.partitionsCached }}</td></tr><tr><td>Reads in-progress</td><td>{{ stats.readsInProgress }}</td></tr><tr><td>Writes in-progress</td><td>{{ stats.writesInProgress }}</td></tr><tr><td>Write queue</td><td>{{ stats.writePendingEventsAfterCheckpoint }}</td></tr><tr><td>Write queue (chkp)</td><td>{{ stats.writePendingEventsBeforeCheckpoint }}</td></tr><tr><td>Checkpoint status</td><td>{{ stats.checkpointStatus }}</td></tr><tr><td>Position</td><td>{{ stats.position }}</td></tr><tr><td>Last checkpoint</td><td>{{ stats.lastCheckpoint }}</td></tr></tbody></table><table><thead><tr><th colspan=2>Results <span ng-show=stream>(<a ui-sref="streams.item.events({streamId: stream})">{{ stream }}</a>)</span></th></tr></thead><tbody><tr><td colspan=2><pre>{{result | json}}</pre></td></tr></tbody></table><table><thead><tr><th colspan=2>State</th></tr></thead><tbody><tr><td colspan=2><input ng-model=partition ng-change=clearState() placeholder=partition></td></tr><tr><td colspan=2><pre>{{state | json}}</pre></td></tr></tbody></table></div></div>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.item.edit.tpl.html",'<header class=page-header><h2 class=page-title>Projection Edit</h2><ul class=page-nav><li class=page-nav__item><button ng-click=start() ng-disabled=isRunning href=#>Start</button></li><li class=page-nav__item><button ng-click=stop() ng-disabled=isStopped>Stop</button></li><li class=page-nav__item><button ng-click=save()>Save</button></li><li class=page-nav__item><button ng-click=reset($event)>Reset</button></li><li class=page-nav__item ng-hide=maximized><button ng-click="maximized = true">Maximize</button></li><li class=page-nav__item ng-show=maximized><button ng-click="maximized = false">Minimize</button></li><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><h3>{{stats.name}} - {{stats.status}}</h3><p ng-hide=maximized><strong>mode: </strong><span>{{stats.mode}}</span></p><p style="background-color: red; color: white" ng-if=stats.stateReason>{{stats.stateReason}}</p><div class=container><div class=edit-projection ng-class="{ \'container-left\': !maximized, maximized: maximized }"><h3 class=block-title ng-hide=maximized>Source</h3><div ui-ace=aceConfig ng-model=query></div><label><input type=checkbox ng-model=emit>Emit enabled</label></div><div ng-hide=maximized class=container-right><table><thead><tr><th colspan=2>Results <span ng-show=stream>(<a ui-sref="streams.item.events({streamId: stream})">{{ stream }}</a>)</span></th></tr></thead><tbody><tr><td colspan=2><pre>{{result | json}}</pre></td></tr></tbody><thead><tr><th colspan=2>State</th></tr></thead><tbody><tr><td colspan=2><input ng-model=partition ng-change=clearState() placeholder=partition></td></tr><tr><td colspan=2><pre>{{state | json}}</pre></td></tr></tbody></table></div></div>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.item.tpl.html","<div ui-view></div>")}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.list.tpl.html",'<header class=page-header><h2 class=page-title>Projections</h2><ul class=page-nav><li class=page-nav__item><a ng-click=disableAll($event)>Disable All</a></li><li class=page-nav__item><a ng-click=enableAll($event)>Enable All</a></li><li class=page-nav__item><a ng-if=includeQueries class=highlight ng-click=toggleIncludeQueries()>Don\'t Include Queries</a> <a ng-if=!includeQueries ng-click=toggleIncludeQueries()>Include Queries</a></li><li class=page-nav__item><a ui-sref=^.new>New Projection</a></li></ul></header><table class=table-projections><thead><tr><th>Name</th><th>Status</th><th>Checkpoint Status</th><th>Mode</th><th>Done</th><th>Read / Write in Progress</th><th>Write Queues</th><th>Partitions Cached</th><th>Rate (events/s)</th><th colspan=2>Events</th></tr><tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th class=table-subheading>Processed</th><th class=table-subheading>Buffered</th></tr></thead><tbody ng-repeat="projection in projections"><tr><td><a ui-sref="^.item.details({location: projection.location})">{{ projection.name }}</a><li class="page-nav__item copy-icon-right"><a ui-sref=# clipboard ng-class="{ copied: projection.copied }" text=projection.name on-copied=showCopiedMessage(projection)>⎘</a></li></td><td>{{ projection.status }}</td><td>{{ projection.checkpointStatus == \'\' ? \'-\' : projection.checkpointStatus }}</td><td>{{ projection.mode }}</td><td>{{ projection.progress.toFixed(1) }}%</td><td>{{ projection.readsInProgress }} / {{ projection.writesInProgress }}</td><td>{{ projection.writePendingEventsAfterCheckpoint }} / {{ projection.writePendingEventsBeforeCheckpoint }}</td><td>{{ projection.partitionsCached }}</td><td>{{ projection.eventsPerSecond }}</td><td>{{ projection.eventsProcessedAfterRestart }}</td><td>{{ projection.bufferedEvents }}</td></tr><tr ng-if="projection.status.indexOf(\'Faulted\') !== -1"><td style="background-color: red; color: white; font-size: .9rem; padding-left: 2rem;" colspan=10000>{{ projection.stateReason }}</td></tr><tr ng-hide=projections><td colspan=10><em>No projections</em></td></tr></tbody></table>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.new.tpl.html",'<header class=page-header><h2 class=page-title>New Projection</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><div><a ui-sref=^.standard>You can also post a standard projection</a></div><form novalidate name=newProj ng-submit=save() class=new-projection-form><table><tbody><tr><td>Name</td><td><input ng-model=name required class=form-table name=projName ng-class="{ \'form-table--error\' : newProj.projName.$invalid && !newProj.projName.$pristine }"></td></tr><tr><td>Source</td><td><div ui-ace=aceConfig required ng-model=source></div></td></tr><tr><td>Mode</td><td><select ng-model=mode class=form-table ng-options="obj.value as obj.name for obj in modes"></select></td></tr><tr><td>Checkpoints Enabled</td><td><input type=checkbox ng-model=checkpoints ng-disabled=checkpointsDisabled></td></tr><tr><td>Emit Enabled</td><td><input type=checkbox ng-model=emit></td></tr><tr><td>Track Emitted Streams</td><td><input type=checkbox ng-model=trackemittedstreams ng-disabled=trackEmittedStreamsDisabled></td></tr><tr><td>Enabled</td><td><input type=checkbox ng-model=enabled></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=newProj.$invalid>Create</button></li></ul></form>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.standard.tpl.html",'<header class=page-header><h2 class=page-title>New Standard Projection</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><form novalidate name=newProj ng-submit=save()><table><tbody><tr><td>Name</td><td><input ng-model=name required class=form-table name=projName ng-class="{ \'form-table--error\' : newProj.projName.$invalid && !newProj.projName.$pristine }"></td></tr><tr><td>Source</td><td><div ui-ace=aceConfig required ng-model=source></div></td></tr><tr><td>Select Type</td><td><select ng-model=type required class=form-table ng-options="obj.value as obj.name for obj in types"></select></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=newProj.$invalid>Create</button></li></ul></form>')}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("projections.tpl.html","<div ui-view></div>")}])}(),function(t){try{t=n.module("es-ui.projections.templates")}catch(e){t=n.module("es-ui.projections.templates",[])}t.run(["$templateCache",function(e){e.put("query.tpl.html",'<header class=page-header><h2 class=page-title>Query</h2><ul class=page-nav><li class=page-nav__item><button ng-click=run()>Run</button></li><li class=page-nav__item><button ng-click=stop() ng-disabled=disableStop()>Break</button></li><li class=page-nav__item><button ng-click=debug() ng-disabled=!isCreated>Debug</button></li><li class=page-nav__item ng-hide=maximized><button ng-click="maximized = true">Maximize</button></li><li class=page-nav__item ng-show=maximized><button ng-click="maximized = false">Minimize</button></li></ul></header><h3 ng-visible=status>{{status}} <span ng-if="isStopped === false && progress > 0">({{ progress | number:2 }}%)</span><br></h3><i>{{stateReason}}</i><div class=container><div class=edit-projection ng-class=" { \'container-left\': !maximized, maximized: maximized }"><h3 class=block-title>Source</h3><div ui-ace=aceConfig ng-model=query></div></div><div ng-hide=maximized class=container-right><h3 class=block-title>State</h3><pre ng-if="state !== undefined">\n{{state | json}}\n\t\t</pre></div></div>')}])}()}),define("modules/projections/_index",["angular","uiRouter","./controllers/_index","./services/_index","./directives/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.projections",["ui.router","es-ui.projections.controllers","es-ui.projections.services","es-ui.projections.directives","es-ui.projections.templates"])}),define("modules/projections/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("projections",{url:"projections",parent:"app",abstract:!0,templateUrl:"projections.tpl.html",data:{title:"Projections"}}).state("projections.list",{url:"",templateUrl:"projections.list.tpl.html",controller:"ProjectionsListCtrl",data:{title:"Projections"}}).state("projections.new",{url:"/new",templateUrl:"projections.new.tpl.html",controller:"ProjectionsNewCtrl",data:{title:"New Projection"}}).state("projections.standard",{url:"/standard",templateUrl:"projections.standard.tpl.html",controller:"ProjectionsStandardCtrl",data:{title:"New Standard Projection"}}).state("projections.item",{url:"/{location}",abstract:!0,templateUrl:"projections.item.tpl.html"}).state("projections.item.details",{url:"",templateUrl:"projections.item.details.tpl.html",controller:"ProjectionsItemDetailsCtrl",data:{title:"Projection Details"}}).state("projections.item.delete",{url:"/delete",templateUrl:"projections.item.delete.tpl.html",controller:"ProjectionsItemDeleteCtrl",data:{title:"Projection Delte"}}).state("projections.item.debug",{url:"/debug?fromQueryState",templateUrl:"projections.item.debug.tpl.html",controller:"ProjectionsItemDebugCtrl",data:{title:"Projection Debug"}}).state("projections.item.edit",{url:"/edit",templateUrl:"projections.item.edit.tpl.html",controller:"ProjectionsItemEditCtrl",data:{title:"Projection Edit"}}).state("projections.item.config",{url:"/config",templateUrl:"projections.item.config.tpl.html",controller:"ProjectionsItemConfigCtrl",data:{title:"Projection Configuration"}}).state("query",{url:"query?location&initStreamId",parent:"app",templateUrl:"query.tpl.html",controller:"QueryCtrl",data:{title:"Query"}})}])}),define("modules/admin/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.admin.controllers",["es-ui.admin.services"])}),define("modules/admin/controllers/AdminCtrl",["./_module"],function(e){"use strict";return e.controller("AdminCtrl",["$scope","AdminService","MessageService","poller","$state","ScavengeNotificationService","constants","$timeout",function(c,n,i,e,t,r,s,o){c.subSystems=null,c.scavengeHistory=null,c.noSubSystemsText="No sub systems are running.",c.noScavengeHistoryText="No scavenges have been run.",c.polling=!1,n.getSubsystems().then(function(e){var t=e.data;t&&(c.subSystems=t)},function(e){401===e.statusCode?c.noSubSystemsText="You are not authorized to view enabled sub systems.":i.failure("Failed to retrieve sub systems: "+e.message)});var a=function(e){e.preventDefault(),e.stopPropagation()};function l(e){if(e){for(var t={},n=0;n<e.entries.length;n++){var i=e.entries[n],r=JSON.parse(i.data),s=t[r.scavengeId];s||(s={scavengeId:r.scavengeId,nodeEndpoint:r.nodeEndpoint},t[r.scavengeId]=s),"$scavengeStarted"===i.eventType&&(s.startTime=new Date(i.updated)),"$scavengeCompleted"===i.eventType&&(s.endTime=new Date(i.updated),s.result=r.result)}for(var o=Object.keys(t).map(function(e){return t[e]}),a=[],l=0;l<o.length;l++)o[l].startTime&&a.push(o[l]);c.scavengeHistory=a}}c.shutdown=function(e){a(e),i.confirm("Are you sure you wish to shutdown the node?")&&n.shutdown().then(function(){i.success("Server shutdown initiated")},function(e){i.failure("Shutdown failed: "+e.message)})},c.scavenge=function(e){a(e),n.scavenge().then(function(){d()},function(e){i.failure("Scavenge failed: "+e.message)})},c.stopScavenge=function(e,t){a(e),n.stopScavenge(t.scavengeId).then(null,function(e){i.failure("Stopping scavenge "+t.scavengeId+" failed: "+e.message)})},c.scavengeHistoryButton=function(){t.go("streams.item.events",{streamId:"$scavenges"})};var u,h={};function d(){!0!==c.polling&&(c.polling=!0,(h=e.create({interval:s.scavengeStatus.pollInterval,action:n.scavengeStatus,params:[]})).start(),h.promise.then(null,function(e){return 401===e.statusCode?(c.noScavengeHistoryText="You are not authorized to view the scavenge history",void(c.polling=!1)):404===e.statusCode?(c.noScavengeHistoryText="No scavenges have been run.",void(c.polling=!1)):(u&&(o.cancel(u),u=null),void(u=o(function(){d()},s.scavengeStatus.pollInterval)))},l))}d(),c.$on("$destroy",function(){u&&(o.cancel(u),u=null),h.stop()})}])}),define("modules/admin/controllers/ScavengeCtrl",["./_module"],function(e){"use strict";return e.controller("ScavengeCtrl",["$scope","$state","AdminService","MessageService","poller","constants",function(c,n,e,t,i,r){c.pagination={pageNumber:parseInt(n.params.page),fromEventNumber:parseInt(n.params.from),pageSize:20,canGoForward:function(){return 0<c.pagination.lastEventPos},canGoBackward:function(){return 0<c.pagination.pageNumber}},c.scavengeInfo=[],c.scavengeId=n.params.scavengeId;var s=null;function o(e){if(0<e.length){var t=e[e.length-1],n=e[0];c.nodeEndpoint=JSON.parse(n.data).nodeEndpoint,c.pagination.firstEventPos=n.positionEventNumber,c.pagination.lastEventPos=t.positionEventNumber}!function(e){for(var t=[],n=0;n<e.length;n++){var i,r=e[n];switch(r.eventType){case"$scavengeStarted":t.push({status:"Started",type:r.EventType});break;case"$scavengeChunksCompleted":var s=JSON.parse(r.data);if(i="No chunks scavenged",s.wasScavenged){var o=s.chunkEndNumber-s.chunkStartNumber+1;i=o+" chunk(s) scavenged"}s.errorMessage&&(i="Error: "+s.errorMessage),t.push({status:"Scavenging chunks "+s.chunkStartNumber+" - "+s.chunkEndNumber+" complete",timeTaken:s.timeTaken,spaceSaved:s.spaceSaved,type:r.eventType,result:i});break;case"$scavengeMergeCompleted":var s=JSON.parse(r.data);if(i="No chunks merged",s.wasMerged){var o=s.chunkEndNumber-s.chunkStartNumber+1;i=o+" chunk(s) merged"}s.errorMessage&&(i="Error: "+s.errorMessage),t.push({status:"Merging chunks "+s.chunkStartNumber+" - "+s.chunkEndNumber+" complete",timeTaken:s.timeTaken,spaceSaved:s.spaceSaved,type:r.eventType,result:i});break;case"$scavengeIndexCompleted":var s=JSON.parse(r.data);i="Index table not scavenged",s.wasScavenged&&(i=s.entriesDeleted+" index entries scavenged"),s.errorMessage&&(i="Error: "+s.errorMessage);var a="("+s.level+","+s.index+")";t.push({status:"Scavenging index table "+a+" complete",timeTaken:s.timeTaken,spaceSaved:s.spaceSaved,type:r.eventType,result:i});break;case"$scavengeCompleted":var l=JSON.parse(r.data);i=l.result,"Failed"===l.result&&(i+=": "+l.error),t.push({status:"Completed",timeTaken:l.timeTaken,spaceSaved:l.spaceSaved,type:r.EventType,result:i})}c.scavengeInfo=t}}(e)}c.pageForward=function(){if(c.pagination.canGoForward()){var e=c.pagination.pageNumber+1,t=c.pagination.lastEventPos-1;n.go("scavenge",{scavengeId:c.scavengeId,page:e,from:t})}},c.pageBackward=function(){if(c.pagination.canGoBackward()){var e=c.pagination.pageNumber-1,t=c.pagination.firstEventPos+c.pagination.pageSize;n.go("scavenge",{scavengeId:c.scavengeId,page:e,from:t})}},0===c.pagination.pageNumber?(c.pagination.fromEventNumber="head",(s=i.create({interval:r.scavengeStatus.pollInterval,action:e.scavengeInfo,params:[c.scavengeId,c.pagination.fromEventNumber,c.pagination.pageSize]})).start(),s.promise.then(null,function(e){t.failure("Failed to retrieve scavenge info: "+e.message)},function(e){o(e.entries)})):e.scavengeInfo(c.scavengeId,c.pagination.fromEventNumber,c.pagination.pageSize).then(function(e){o(e.data.entries)},function(e){t.failure("Failed to retrieve scavenge info: "+e.message)}),c.$on("$destroy",function(){s&&s.stop()})}])}),define("modules/admin/controllers/_index",["./AdminCtrl","./ScavengeCtrl"],function(){}),define("modules/admin/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.admin.services",[])}),define("modules/admin/services/AdminService",["./_module"],function(e){"use strict";return e.provider("AdminService",function(){this.$get=["$http","urls","UrlBuilder",function(r,s,o){return{halt:function(){var e=o.build(s.admin.halt);return r.post(e)},shutdown:function(){var e=o.build(s.admin.shutdown);return r.post(e)},scavenge:function(){var e=o.build(s.admin.scavenge);return r.post(e)},stopScavenge:function(e){var t=o.build(s.admin.scavenge+"/"+e);return r.delete(t)},getSubsystems:function(){var e=o.build(s.system.subsystems);return r.get(e)},scavengeStatus:function(){var e=o.build(s.streams.scavenges+"?embed=tryharder");return r.get(e)},scavengeInfo:function(e,t,n){var i=o.build(s.streams.scavenges+"/"+e+"/"+t+"/"+n+"?embed=tryharder");return r.get(i)},lastScavengeStatus:function(){var e=o.build(s.streams.scavenges+"/head/1?embed=tryharder");return r.get(e)}}}]})}),define("modules/admin/services/_index",["./AdminService"],function(){}),define("modules/admin/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.admin.templates")}catch(e){t=n.module("es-ui.admin.templates",[])}t.run(["$templateCache",function(e){e.put("admin.tpl.html",'<header class=page-header><h2 class=page-title>Admin</h2><ul class=page-nav><li class=page-nav__item><a href=# ng-click=shutdown($event)>Shutdown Server</a></li><li class=page-nav__item><a href=# ng-click=scavenge($event)>Scavenge</a></li></ul></header><div class=container><div class=container-left><table><thead><tr><th>Enabled Sub Systems</th></tr></thead><tbody><tr ng-repeat="subSystem in subSystems"><td>{{ subSystem }}</td></tr><tr ng-hide=subSystems><td><em>{{noSubSystemsText}}</em></td></tr></tbody></table></div><div class=container-right><table><thead><tr><th>Scavenge</th><th>Started</th><th>Completed</th><th>Result</th></tr></thead><tbody><tr ng-hide=scavengeHistory><td colspan=4><em>{{noScavengeHistoryText}}</em></td></tr><tr ng-repeat="history in scavengeHistory track by history.scavengeId | orderBy : \'startTime\'"><td><a ui-sref="scavenge({scavengeId: history.scavengeId, page: 0, from: 0})">{{history.nodeEndpoint}}<br>{{history.scavengeId}}</a></td><td>{{history.startTime | date:\'yyyy-MM-dd HH:mm\'}}</td><td><span ng-show=history.endTime>{{history.endTime | date:\'yyyy-MM-dd HH:mm\'}}</span><span ng-hide=history.endTime><em>Not Finished</em></span></td><td><span ng-show=history.result>{{history.result}}</span> <span ng-hide=history.result class=page-nav__item><a ui-sref=# ng-click="stopScavenge($event, history)">Cancel</a></span></td></tr></tbody></table><span class=note--warning>If the progress of your scavenge(s) does not appear to be updating, this might indicate that there was an issue writing the status to disk. Please consult your logs.</span><ul class=page-nav><li class=page-nav__item><a ng-click=scavengeHistoryButton()>Scavenge History</a></li></ul></div></div>')}])}(),function(t){try{t=n.module("es-ui.admin.templates")}catch(e){t=n.module("es-ui.admin.templates",[])}t.run(["$templateCache",function(e){e.put("scavenge.tpl.html",'<header class=page-header><h2 class=page-title>Scavenge {{nodeEndpoint}}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=admin>Back</a></li></ul></header><h3 class=page-title><em>{{scavengeId}}</em></h3><ul style="list-style-type: none; padding:0 0 0.75rem 0 !important"><li class=page-nav__item><a ng-click=pageForward() ng-disabled=!pagination.canGoForward()>Next</a> <a ng-click=pageBackward() ng-disabled=!pagination.canGoBackward()>Previous</a></li></ul><br><div class=container><table><thead><tr><th>Status</th><th>Space Saved (bytes)</th><th>Time Taken</th><th>Result</th></tr></thead><tbody><tr ng-repeat="info in scavengeInfo"><td>{{info.status}}</td><td>{{info.spaceSaved | number}}</td><td>{{info.timeTaken}}</td><td>{{info.result}}</td></tr></tbody></table></div>')}])}()}),define("modules/admin/_index",["angular","uiRouter","./controllers/_index","./services/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.admin",["ui.router","es-ui.admin.controllers","es-ui.admin.services","es-ui.admin.templates"])}),define("modules/admin/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("admin",{url:"admin",parent:"app",templateUrl:"admin.tpl.html",controller:"AdminCtrl",data:{title:"Admin"}}).state("scavenge",{url:"scavenge/{scavengeId}/?page?from",parent:"app",templateUrl:"scavenge.tpl.html",controller:"ScavengeCtrl",data:{title:"Scavenge"}})}])}),define("modules/dashboard/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.dashboard.controllers",["es-ui.dashboard.services"])}),define("modules/dashboard/controllers/DashboardListCtrl",["./_module"],function(e){"use strict";return e.controller("DashboardListCtrl",["$scope","DashboardService","DashboardMapper","poller","MessageService","constants",function(r,e,t,n,i,s){var o=n.create({interval:1e3,action:e.stats,params:[]});r.queues={},r.queues.__tag="queues",o.start(),o.promise.then(null,null,function(e){r.queues=t.map(e,r.queues)}),o.promise.catch(function(e){i.failure("Failed to fetch dashboard stats: "+e.message),r.queues=null,o.stop()}),r.tcpStats=[];var a=n.create({interval:s.tcpStats.pollInterval,action:e.tcpStats,params:[]});function l(e,t){if(!t)return null;for(var n=0;n<t.length;n++)if(t[n].connectionId===e)return t[n];return null}a.start(),a.promise.then(null,null,function(e){for(var t=0;t<e.length;t++){var n=e[t],i=l(n.connectionId,r.tcpStats);n.averageBytesSentPerSecond=i?n.totalBytesSent-i.totalBytesSent:0,n.averageBytesReceivedPerSecond=i?n.totalBytesReceived-i.totalBytesReceived:0}r.tcpStats=e}),a.promise.catch(function(e){i.failure("Failed to fetch TCP connection stats: "+e.message),r.tcpStats=null,a.stop()}),r.tcpStatsPaging={currentPage:0,pageSize:5,canPageNext:function(){return r.tcpStatsPaging.currentPage<r.tcpStats.length/r.tcpStatsPaging.pageSize-1},canPagePrevious:function(){return 0<r.tcpStatsPaging.currentPage},nextPage:function(){r.tcpStatsPaging.canPageNext()&&r.tcpStatsPaging.currentPage++},previousPage:function(){r.tcpStatsPaging.canPagePrevious()&&r.tcpStatsPaging.currentPage--}},r.$on("$destroy",function(){n.clear(),r.queues={},r.tcpStats=[]})}]).filter("startFrom",function(){return function(e,t){if(e)return t=parseInt(t),e.slice(t)}})}),define("modules/dashboard/controllers/DashboardSnapshotCtrl",["./_module"],function(e){"use strict";return e.controller("DashboardSnaphostCtrl",["$scope","DashboardService","SprintfService","MessageService",function(i,e,r,t){e.stats().then(function(e){var t,n;t=e.data,n="Snapshot taken at: "+(new Date).toString(),n+="\n\r",n+=r.format("%-30s  %15s  %15s  %15s  %15s  %45s","Name","Length","Rate (items/s)","Time (ms/item)","Item Processed","Current/Last message"),n+="\n\r",n+=r.format("%-30s  %8s  %5s","","Current","Peak"),n+="\n\r",n+=r.format("%'=30s  %'=8s  %'=5s  %'=15s  %'=15s  %'=15s  %'=45s","=","=","=","=","=","=","="),angular.forEach(t.es.queue,function(e){n+="\n\r",n+=r.format("%-30s  %8s  %5s  %15s  %15s  %15s  %45s",e.queueName,e.lengthCurrentTryPeak,e.lengthLifetimePeak,e.avgItemsPerSecond,e.avgProcessingTime.toFixed(3),e.totalItemsProcessed,e.inProgressMessage+" / "+e.lastProcessedMessage)}),i.snapshot=n},function(e){t.failure("Failed to retrieve dashboard stats: "+e.message)})}])}),define("modules/dashboard/controllers/_index",["./DashboardListCtrl","./DashboardSnapshotCtrl"],function(){}),define("modules/dashboard/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.dashboard.services",[])}),define("modules/dashboard/services/DashboardMapper",["./_module"],function(e){"use strict";return e.provider("DashboardMapper",function(){function e(e,t){var n,i,r,s,o,a={};for(n in e.es.queue)(i=e.es.queue[n]).groupName?(r=a[i.groupName]?a[i.groupName]:{queueName:o=i.groupName,groupName:o,length:0,avgItemsPerSecond:0,avgProcessingTime:0,idleTimePercent:0,lengthCurrentTryPeak:0,lengthLifetimePeak:0,totalItemsProcessed:0,groupQueues:0,queues:[]},s=t[i.groupName],r.show=!!s&&s.show,r.queues.push(i),r.length+=i.length,r.groupQueues+=1,r.avgItemsPerSecond+=i.avgItemsPerSecond,r.totalItemsProcessed+=i.totalItemsProcessed,r.avgProcessingTime=(r.avgProcessingTime+i.avgProcessingTime)/r.groupQueues,r.idleTimePercent=(r.idleTimePercent+i.idleTimePercent)/r.groupQueues,r.lengthCurrentTryPeak=Math.max(r.lengthCurrentTryPeak,i.lengthCurrentTryPeak),r.lengthLifetimePeak=Math.max(r.lengthLifetimePeak,i.lengthLifetimePeak),a[i.groupName]=r):a[i.queueName]=i;return a}this.$get=[function(){return{map:e}}]})}),define("modules/dashboard/services/DashboardService",["./_module"],function(e){"use strict";return e.provider("DashboardService",function(){this.$get=["$http","urls","UrlBuilder",function(t,n,i){return{stats:function(){var e=i.build(n.stats);return t.get(e)},tcpStats:function(){var e=i.build(n.tcpStats);return t.get(e)}}}]})}),define("modules/dashboard/services/_index",["./DashboardMapper","./DashboardService"],function(){}),define("modules/dashboard/directives/_module",["angular"],function(e){"use strict";return e.module("es-ui.dashboard.directives",[])}),define("modules/dashboard/directives/EsQueueRow",["./_module"],function(e){"use strict";return e.directive("esQueueRow",[function(){return{restrict:"A",templateUrl:"dashboard.row.tpl.html",scope:{esQueue:"="},link:function(){}}}])}),define("modules/dashboard/directives/EsQueueRowHeader",["./_module"],function(e){"use strict";return e.directive("esQueueRowHeader",[function(){return{restrict:"A",templateUrl:"dashboard.row.header.tpl.html",scope:{esQueue:"="},link:function(e,t){function n(){e.$apply(function(){e.toggle()})}e.toggle=function(){e.esQueue.show=!e.esQueue.show},t.bind("click",n),e.$on("$destroy",function(){t.unbind("click",n)})}}}])}),define("modules/dashboard/directives/_index",["./EsQueueRow","./EsQueueRowHeader"],function(){}),define("modules/dashboard/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.dashboard.templates")}catch(e){t=n.module("es-ui.dashboard.templates",[])}t.run(["$templateCache",function(e){e.put("dashboard.list.tpl.html","<header class=page-header><h2 class=page-title>Dashboard</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.snapshot>Snapshot</a></li></ul></header><table class=table-queues><thead><tr><th>Queue Name</th><th colspan=2>Length</th><th>Rate (items/s)</th><th>Time (ms/item)</th><th>Items Processed</th><th>Current / Last Message</th></tr><tr><th></th><th class=table-subheading>Current</th><th class=table-subheading>Peak</th><th></th><th></th><th></th><th></th></tr></thead><tbody ng-repeat=\"(key, prop) in queues track by key\"><tr ng-if=prop.queues class=table-subheading style=\"cursor: pointer;\" es-queue-row-header es-queue=prop></tr><tr ng-if=!prop.queues es-queue-row es-queue=prop></tr><tr ng-show=prop.show ng-repeat=\"item in prop.queues\" class=table-indentedrow es-queue-row es-queue=item></tr></tbody><tbody ng-hide=queues><tr><td colspan=8><em>No stats to display</em></td></tr></tbody></table><br><br><header class=page-header><h2 class=page-title>Connections ({{tcpStats.length}})</h2><ul class=page-nav><li class=page-nav__item><button ng-click=tcpStatsPaging.nextPage() ng-disabled=!tcpStatsPaging.canPageNext()>Next</button></li><li class=page-nav__item><button ng-click=tcpStatsPaging.previousPage() ng-disabled=!tcpStatsPaging.canPagePrevious()>Previous</button></li></ul></header><table class=table-subscriptions><thead><tr><th>Connection</th><th>Client Connection Name</th><th>Type</th><th>IP Address</th><th colspan=3>Sent (Bytes)</th><th colspan=3>Received (Bytes)</th></tr><tr><th></th><th></th><th></th><th></th><th class=table-subheading>Rate (Bytes/s)</th><th class=table-subheading>Current</th><th class=table-subheading>Pending</th><th class=table-subheading>Rate (Bytes/s)</th><th class=table-subheading>Current</th><th class=table-subheading>Pending</th></tr></thead><tbody><tr ng-repeat=\"stat in tcpStats | startFrom:tcpStatsPaging.currentPage * tcpStatsPaging.pageSize | limitTo: tcpStatsPaging.pageSize\"><td>{{stat.connectionId}}</td><td>{{stat.clientConnectionName ? stat.clientConnectionName : 'N/A'}}</td><td>{{stat.isExternalConnection ? 'External' : 'Internal'}} {{stat.isSslConnection ? 'SSL' : ''}}</td><td>{{stat.remoteEndPoint}}</td><td>{{stat.averageBytesSentPerSecond | number}}</td><td>{{stat.totalBytesSent | number}}</td><td>{{stat.pendingSendBytes | number}}</td><td>{{stat.averageBytesReceivedPerSecond | number}}</td><td>{{stat.totalBytesReceived | number}}</td><td>{{stat.pendingReceivedBytes | number}}</td></tr></tbody><tbody ng-hide=tcpStats.length><tr><td colspan=10><em>No Connections</em></td></tr></tbody></table>")}])}(),function(t){try{t=n.module("es-ui.dashboard.templates")}catch(e){t=n.module("es-ui.dashboard.templates",[])}t.run(["$templateCache",function(e){e.put("dashboard.row.header.tpl.html",'<td ng-if=esQueue.show>{{ esQueue.queueName }} <a class=table-collapsetoggle>&minus;</a></td><td ng-if=!esQueue.show>{{ esQueue.queueName }} <a class=table-collapsetoggle>&plus;</a></td><td>{{ esQueue.lengthCurrentTryPeak }}</td><td>{{ esQueue.lengthLifetimePeak }}</td><td>{{ esQueue.avgItemsPerSecond }}</td><td>{{ esQueue.avgProcessingTime.toFixed(3)}}</td><td>{{ esQueue.totalItemsProcessed }}</td><td style="text-align: right">n/a</td>')}])}(),function(t){try{t=n.module("es-ui.dashboard.templates")}catch(e){t=n.module("es-ui.dashboard.templates",[])}t.run(["$templateCache",function(e){e.put("dashboard.row.tpl.html",'<td>{{ esQueue.queueName }}</td><td>{{ esQueue.lengthCurrentTryPeak }}</td><td>{{ esQueue.lengthLifetimePeak }}</td><td>{{ esQueue.avgItemsPerSecond }}</td><td>{{ esQueue.avgProcessingTime.toFixed(3)}}</td><td>{{ esQueue.totalItemsProcessed }}</td><td style="text-align: right">{{ esQueue.inProgressMessage }} / {{ esQueue.lastProcessedMessage }}</td>')}])}(),function(t){try{t=n.module("es-ui.dashboard.templates")}catch(e){t=n.module("es-ui.dashboard.templates",[])}t.run(["$templateCache",function(e){e.put("dashboard.snapshot.tpl.html","<header class=page-header><h2 class=page-title>Dashboard Snapshot</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=dashboard.list>Back</a></li></ul></header><pre ng-bind=snapshot>\n\n</pre>")}])}(),function(t){try{t=n.module("es-ui.dashboard.templates")}catch(e){t=n.module("es-ui.dashboard.templates",[])}t.run(["$templateCache",function(e){e.put("dashboard.tpl.html","<div ui-view></div>")}])}()}),define("modules/dashboard/_index",["angular","uiRouter","./controllers/_index","./services/_index","./directives/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.dashboard",["ui.router","es-ui.dashboard.templates","es-ui.dashboard.controllers","es-ui.dashboard.services","es-ui.dashboard.directives"])}),define("modules/dashboard/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("dashboard",{parent:"app",url:"dashboard",templateUrl:"dashboard.tpl.html",abstract:!0,data:{title:"Dashboard"}}).state("dashboard.list",{url:"",templateUrl:"dashboard.list.tpl.html",controller:"DashboardListCtrl",data:{title:"Dashboard"}}).state("dashboard.snapshot",{url:"/snapshot",templateUrl:"dashboard.snapshot.tpl.html",controller:"DashboardSnaphostCtrl",data:{title:"Dashboard Snapshot"}})}])}),define("modules/clusterstatus/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.clusterstatus.controllers",[])}),define("modules/clusterstatus/controllers/ClusterStatusListCtrl",["./_module"],function(e){"use strict";return e.controller("ClusterStatusListCtrl",["$scope","poller","ClusterStatusService","InfoService","constants","MessageService",function(t,n,i,e,r,s){t.replicas=[];function o(){var e=n.create({interval:1e3,action:i.gossip,params:[]});e.start(),e.promise.then(null,function(e){s.failure("Failed to retrieve gossip info: "+e.message)},function(e){t.lastUpdatedTime=new Date,e.error?t.errorMessage="couldn't connect to manager":(t.errorMessage="",t.nodes=e.members)})}e.getOptions().then(function(e){var t=e.data;for(var n in t)"ClusterSize"===t[n].name&&1<t[n].value&&o()},function(e){s.failure("Failed to load options: "+e.message)}),t.$on("$destroy",function(){n.clear()})}])}),define("modules/clusterstatus/controllers/ClusterStatusSnapshotCtrl",["./_module"],function(e){"use strict";return e.controller("ClusterStatusSnapshotCtrl",["$scope","dateFilter","poller","SprintfService","ClusterStatusService","MessageService",function(s,o,e,a,t,n){s.$on("$destroy",function(){e.clear()}),t.gossip().then(function(e){!function(e){var t=e.members,n=a.format("%s\n","Snapshot taken at "+o(new Date,"yyyy-MM-d HH:mm:ss"));n+=a.format("%-31s %-31s %-23s %-7s %-14s %-19s %-10s\n","Internal Tcp","External Tcp","Http","Status","State","Timestamp (UTC)","Checkpoints");for(var i=0;i<t.length;i++){var r=t[i];n+=a.format("%-30s  %-30s  %-22s  %-6s  %-12s  %19s  %-90s\n",r.internalTcpIp+":"+(r.internalSecureTcpPort||r.internalTcpPort),r.externalTcpIp+":"+(r.externalSecureTcpPort||r.externalTcpPort),r.httpEndPointIp+":"+r.httpEndPointPort,r.isAlive?"Alive":"Dead",r.state,o(r.timeStamp,"yyyy-MM-d HH:mm:ss"),"Manager"===r.state?"n/a":a.format("L%d/W%d/C%d/E%d@%d:{%s}",r.lastCommitPosition,r.writerCheckpoint,r.chaserCheckpoint,r.epochNumber,r.epochPosition,r.epochId))}s.snapshot=n}(e.data)},function(e){n.failure("Failed to retrieve gossip info: "+e.message)})}])}),define("modules/clusterstatus/controllers/_index",["./ClusterStatusListCtrl","./ClusterStatusSnapshotCtrl"],function(){}),define("modules/clusterstatus/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.clusterstatus.services",[])}),define("modules/clusterstatus/services/ClusterStatusService",["./_module"],function(e){"use strict";return e.provider("ClusterStatusService",function(){this.$get=["$http","urls","UrlBuilder","$q","$location",function(i,r,t,s,o){return{gossip:function(){var e=t.build(r.gossip);return i.get(e)},replicaStats:function(e){if(!e){var t=s.defer();return t.resolve({}),t.promise}var n=o.protocol()+"://"+e+r.replicationStats;return i.get(n)}}}]})}),define("modules/clusterstatus/services/_index",["./ClusterStatusService"],function(){}),define("modules/clusterstatus/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.clusterstatus.templates")}catch(e){t=n.module("es-ui.clusterstatus.templates",[])}t.run(["$templateCache",function(e){e.put("clusterstatus.list.tpl.html",'<header class=page-header><h2 class=page-title>Cluster Status</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.snapshot>Snapshot</a></li></ul></header><div class=last-updated>Last updated: <span>{{ lastUpdatedTime | date : \'yyyy-MM-d HH:mm:ss\' }}</span></div><div><table class=table-nodes><thead><tr><th>State</th><th>Status</th><th>Timestamp (UTC)</th><th>Checkpoints</th><th>Tcp</th><th>Http</th><th>Actions</th></tr><tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr ng-repeat="node in nodes" ng-class="{dead: !node.isAlive}"><td><text ng-if="node.state == \'Leader\'"><b>{{ node.state }}</b></text><text ng-if="node.state == \'Manager\'" style=color:lightgray>{{ node.state }}</text><text ng-if="node.state != \'Leader\' && node.state != \'Manager\'">{{ node.state }}</text></td><td ng-class="{dead: !node.isAlive}"><text ng-if=node.isAlive>Alive</text><text ng-if=!node.isAlive>Dead</text></td><td>{{ node.timeStamp | date : \'yyyy-MM-d HH:mm:ss\' }}</td><td><text ng-if="node.state == \'Manager\'">n/a</text><text ng-if="node.state != \'Manager\'">L{{ node.lastCommitPosition}} / W {{node.writerCheckpoint}} / C {{node.chaserCheckpoint}}<br>E{{ node.epochNumber }} @ {{ node.epochPosition }} : { {{ node.epochId }} }</text></td><td>Internal : {{ node.internalTcpIp }}:{{ node.internalSecureTcpPort || node.internalTcpPort }}<br>External : {{ node.externalTcpIp }}:{{ node.externalSecureTcpPort || node.externalTcpPort }}</td><td>{{ node.httpEndPointIp }}:{{ node.httpEndPointPort }}</td><td style=text-align:center;><ul class=page-nav><li class=page-nav__item><a ng-href="//{{node.httpEndPointIp}}:{{node.httpEndPointPort}}/ping?format=json" target=_blank>ping</a></li><li class=page-nav__item><a ng-href=//{{node.httpEndPointIp}}:{{node.httpEndPointPort}} target=_blank>show website</a></li><li class=page-nav__item><a ng-href="//{{node.httpEndPointIp}}:{{node.httpEndPointPort}}/gossip?format=json" target=_blank>show gossip</a></li></ul></td></tr><tr ng-hide=nodes><td colspan=9><em>No nodes in the cluster</em></td></tr></tbody></table><br><div ng-show="replicas.length > 0"><br><header class=page-header><h2 class=page-title>Replica Status</h2></header><table class=table-nodes><thead><tr><th>Replica Endpoint</th><th>Total Sent (bytes)</th><th>Total Received (bytes)</th><th>Pending Send (bytes)</th><th>Pending Receive (bytes)</th><th>Send Queue Size</th><th>To Catch Up (bytes)</th><th>Transfer Speed (bytes/second)</th><th>Estimated Time</th></tr></thead><tbody><tr ng-repeat="replica in replicas"><td>{{replica.subscriptionEndpoint}}</td><td>{{replica.totalBytesSent | number}}</td><td>{{replica.totalBytesReceived | number}}</td><td>{{replica.pendingSendBytes | number}}</td><td>{{replica.pendingReceivedBytes | number}}</td><td>{{replica.sendQueueSize | number}}</td><td ng-if=!replica.isCatchingUp colspan=3>Caught Up</td><td ng-if=replica.isCatchingUp>{{replica.bytesToCatchUp | number}}</td><td ng-if=replica.isCatchingUp>{{replica.approxSpeed | number}}</td><td ng-if=replica.isCatchingUp>{{replica.estimatedTime}}</td></tr></tbody></table></div></div><script>function selectText(element) {\n        var doc = document\n          , text = doc.getElementById(element)\n          , range\n          , selection;\n        if (doc.body.createTextRange) { //ms\n            range = doc.body.createTextRange();\n            range.moveToElementText(text);\n            range.select();\n        } else if (window.getSelection) { //all others\n            selection = window.getSelection();\n            range = doc.createRange();\n            range.selectNodeContents(text);\n            selection.removeAllRanges();\n            selection.addRange(range);\n        }\n    }<\/script>')}])}(),function(t){try{t=n.module("es-ui.clusterstatus.templates")}catch(e){t=n.module("es-ui.clusterstatus.templates",[])}t.run(["$templateCache",function(e){e.put("clusterstatus.snapshot.tpl.html","<header class=page-header><h2 class=page-title>Cluster Status Snapshot</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=clusterstatus.list>Back</a></li></ul></header><pre ng-bind=snapshot>\n\n</pre>")}])}(),function(t){try{t=n.module("es-ui.clusterstatus.templates")}catch(e){t=n.module("es-ui.clusterstatus.templates",[])}t.run(["$templateCache",function(e){e.put("clusterstatus.tpl.html","<div ui-view></div>")}])}()}),define("modules/clusterstatus/_index",["angular","uiRouter","./controllers/_index","./services/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.clusterstatus",["ui.router","es-ui.clusterstatus.templates","es-ui.clusterstatus.services","es-ui.clusterstatus.controllers"])}),define("modules/clusterstatus/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("clusterstatus",{parent:"app",url:"clusterstatus",templateUrl:"clusterstatus.tpl.html",abstract:!0,data:{title:"Cluster Status"}}).state("clusterstatus.list",{url:"",templateUrl:"clusterstatus.list.tpl.html",controller:"ClusterStatusListCtrl",data:{title:"Cluster Status"}}).state("clusterstatus.snapshot",{url:"/snapshot",templateUrl:"clusterstatus.snapshot.tpl.html",controller:"ClusterStatusSnapshotCtrl",data:{title:"Cluster Status Snapshot"}})}])}),define("modules/streams/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.streams.controllers",["es-ui.streams.services"])}),define("modules/streams/controllers/StreamsItemEventCtrl",["./_module"],function(e){"use strict";return e.controller("StreamsItemEventCtrl",["$scope","$state","$stateParams","StreamsService","MessageService",function(n,e,t,i,r){n.streamId=t.streamId,n.isMetadata=e.current.data.metadata,n.eventNumber=n.isMetadata?"metadata":t.eventNumber,i.eventContent(n.streamId,n.eventNumber).then(function(e){var t=e.data;n.evt=t,n.isNotTheSame=t.positionStreamId!==t.streamId||t.positionEventNumber!==t.eventNumber,n.links=t.links,n.isMetadata||(i.eventContent(n.streamId,t.positionEventNumber+1).then(function(){n.next=!0},function(e){404!==e.statusCode&&r.failure("Failed to load event content for stream '"+n.streamId+"': "+e.message)}),0<=t.positionEventNumber-1&&i.eventContent(n.streamId,t.positionEventNumber-1).then(function(){n.prev=!0},function(e){404!==e.statusCode&&r.failure("Failed to load event content for stream '"+n.streamId+"': "+e.message)}))},function(e){r.failure("Failed to load event content for stream '"+n.streamId+"': "+e.message)})}])}),define("modules/streams/controllers/StreamsItemEventsCtrl",["./_module"],function(e){"use strict";return e.controller("StreamsItemEventsCtrl",["$scope","$state","$stateParams","AtomEventsReader","MessageService","StreamsService",function(n,e,t,i,r,s){var o={};function a(t){void 0!==t?r.confirm("Are you sure you want to delete the stream: "+t+"?")&&s.deleteStream(t).then(function(){r.info("Stream '"+t+"' deleted")},function(e){r.failure("Failed to delete stream '"+t+"': "+e.message)}):r.info("You cannot delete this stream as the stream ID is empty or undefined")}n.$parent.streams=[],n.$parent.links=[],n.streamId=t.streamId,n.source=t.source,i.start(t).then(null,function(e){r.failure("Failed to read events for stream '"+n.streamId+"': "+e.message)},function(e){n.$parent.headOfStream=e.headOfStream,n.$broadcast("add-link-header",function(e){for(var t=0;t<e.length;t++)if("self"===e[t].relation)return e[t].fullUri}(e.links)),n.$parent.streams=i.map(e.entries,o),n.$parent.links=e.links,"$all"!==n.streamId&&0!==n.streamId.indexOf("$$$")||(n.$parent.links=function(e){for(var t=-1,n=0,i=e.length;n<i;n++)if("metadata"===e[n].relation){t=n;break}-1!==t&&e.splice(t,1);return e}(n.$parent.links))}),n.toggleJson=function(e,t){e.preventDefault(),e.stopPropagation(),t.showJson=!t.showJson,o[t.title]=t.showJson},n.deleteStream=function(e,t){a(n.streamId)},n.$parent.deleteStream=function(){a(n.streamId)},n.$parent.isPolling=!0,n.$parent.togglePause=function(){n.$parent.isPolling?i.pause():i.resumePaused(),n.$parent.isPolling=!n.$parent.isPolling},n.getTextToCopy=function(e){return r.info("The event data for "+e.title+" will be copied to the clipboard","Copied to clipboard"),e.data},n.$on("$destroy",function(){i.stop(),n.$parent.streams=[],n.$parent.links=[],n.$parent.isPolling=null,o={}})}])}),define("modules/streams/controllers/StreamsAddEventCtrl",["./_module"],function(e){"use strict";return e.controller("StreamsAddEventCtrl",["$scope","$state","$q","$stateParams","StreamsService","MessageService",function(t,e,r,n,i,s){if(t.streamId=n.streamId,t.addingToSpecificStream=Boolean(t.streamId),t.eventData="{\n}",t.eventMetadata="{\n}",t.eventId=l(),n.fromEvent){var o=n.fromEvent;t.eventType=o.eventType,t.addingToSpecificStream=!1,t.eventData=o.data,t.eventMetadata=o.metaData}function a(n,i){return r(function(e,t){if(/^\s*$/.test(i))return e(void 0);try{return e(JSON.parse(i))}catch(e){return t({statusText:n+" is not valid JSON."})}})}t.aceConfig={mode:"json",useWrapMode:!1,showGutter:!0,theme:"monokai"},t.addEvent=function(){r.all([a("Event Data",t.eventData),a("Event Metadata",t.eventMetadata)]).then(function(e){return i.addEvent(t.streamId,{eventId:t.eventId,eventType:t.eventType,data:e[0],metadata:e[1]})}).then(function(){s.success("Event "+t.eventId+"("+t.eventType+") created"),t.eventId=l()},function(e){s.failure("Failed to create event: "+e.message)})}}]);function l(){var e=(new Date).getTime().toString();return[e.slice(-9,-1),e.slice(-5,-1),e.slice(-5,-1),e.slice(-5,-1),e.slice(-13,-1)].join("-")}}),define("modules/streams/controllers/StreamsItemAclCtrl",["./_module"],function(e){"use strict";return e.controller("StreamsItemAclCtrl",["$scope","$state","$stateParams","StreamsService","MessageService",function(n,t,e,i,r){var s;n.streamId=e.streamId,i.getAcl(n.streamId).then(function(e){var t=e.data;t&&(s=t).$acl&&(n.reader=t.$acl.$r,n.writer=t.$acl.$w,n.deleter=t.$acl.$d,n.metareader=t.$acl.$mr,n.metawriter=t.$acl.$mw)},function(e){r.failure("Failed to load metadata for stream '"+n.streamId+"': "+e.message),t.go("^.events")}),n.updateAcl=function(){var e=s||{};e.$acl={$r:n.reader,$w:n.writer,$d:n.deleter,$mr:n.metareader,$mw:n.metawriter},i.updateAcl(n.streamId,e).then(function(){r.info("acl updated"),t.go("^.events")},function(e){r.failure("Failed to update metadata for stream '"+n.streamId+"': "+e.message)})}}])}),define("modules/streams/controllers/StreamsListCtrl",["./_module"],function(e){"use strict";return e.controller("StreamsListCtrl",["$rootScope","$scope","$state","StreamsService","MessageService",function(e,t,n,i,r){function s(e){for(var t,n={},i=0,r=e.length,s=[];i<r;i++)e[i].streamId&&(n[(t=e[i]).streamId]=!0);for(t in n)s.push({streamId:t});return s}t.gotoStream=function(e){e.preventDefault(),e.stopPropagation(),i.checkStreamExists(t.search).then(function(){n.go("^.item.events",{streamId:t.search})},function(e){404===e.statusCode?r.warn("The stream '"+t.search+"' does not exist."):r.failure("Failed to read stream '"+t.search+"': "+e.message)})},t.search="$all",t.noChangedStreamsText="No recently changed streams",t.noCreatedStreamsText="No recently created streams",i.recentlyChangedStreams().then(function(e){t.changedStreams=s(e.data.entries)},function(e){401===e.statusCode?t.noChangedStreamsText="You are not authorized to view recently changed streams":404===e.statusCode?t.noChangedStreamsText="No recently changed streams":r.failure("Failed to load recently changed streams: "+e.message)}),i.recentlyCreatedStreams().then(function(e){t.createdStreams=s(e.data.entries)},function(e){401===e.statusCode?t.noCreatedStreamsText="You are not authorized to view recently created streams":404===e.statusCode?t.noCreatedStreamsText="No recently created streams":r.failure("Failed to load recently created streams: "+e.message)})}])}),define("modules/streams/controllers/_index",["./StreamsItemEventCtrl","./StreamsItemEventsCtrl","./StreamsAddEventCtrl","./StreamsItemAclCtrl","./StreamsListCtrl"],function(){}),define("modules/streams/directives/_module",["angular"],function(e){"use strict";return e.module("es-ui.streams.directives",[])}),define("modules/streams/directives/EsLinkHeader",["./_module"],function(e){"use strict";return e.directive("esLinkHeader",[function(){return{restrict:"A",link:function(e){var t=e.$on("add-link-header",function(e,t){var n;(n=document.querySelector('link[type="application/atom+xml"]'))&&document.head.removeChild(n);var i=document.createElement("link");i.rel="alternative",i.type="application/atom+xml",i.href=t,document.head.appendChild(i)});e.$on("$destroy",function(){t()})}}}])}),define("modules/streams/directives/_index",["./EsLinkHeader"],function(){}),define("modules/streams/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.streams.services",[])}),define("modules/streams/services/StreamsService",["./_module"],function(e){"use strict";return e.provider("StreamsService",function(){this.$get=["$http","$q","urls","UrlBuilder",function(i,e,r,s){return{getAcl:function(e){var t=s.build(r.streams.metadata,"$$",e);return i.get(t)},updateAcl:function(e,t){var n=s.build(r.streams.updateAcl,e);return i.post(n,JSON.stringify(t),{headers:{"ES-EventType":"$metadata","Content-Type":"application/json"}})},addEvent:function(e,t){var n=s.build(r.streams.events,e);return i.post(n,JSON.stringify([t]),{headers:{"Content-Type":"application/vnd.eventstore.events+json"}})},validateFullUrl:function(e){var t=s.simpleBuild(r.streams.base,e);return i.get(t)},recentlyChangedStreams:function(){var e=s.build(r.streams.recent);return i.get(e)},recentlyCreatedStreams:function(){var e=s.build(r.streams.created);return i.get(e)},streamEvents:function(e){var t=s.build(r.streams.events,e.streamId);return e.position&&(t+="/"+e.position),e.type&&(t+="/"+e.type),e.count&&(t+="/"+e.count),t+=r.streams.tryharder,i.get(t)},eventContent:function(e,t){var n=s.build(r.streams.eventDetails,e,t);return i.get(n,{headers:{Accept:"application/vnd.eventstore.atom+json"}})},checkStreamExists:function(e){var t=s.build(r.streams.events,e);return i.get(t)},deleteStream:function(e){var t=s.build(r.streams.events,e);return i.delete(t)}}}]})}),define("modules/streams/services/_index",["./StreamsService"],function(){}),define("modules/streams/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.event.new.tpl.html",'<header class=page-header><h2 class=page-title>New Event</h2></header><form novalidate name=newEvent ng-submit=save() class=new-subscription-form><table><tbody><tr><td>Stream ID</td><td><input ng-model=streamId class=form-table name=stream ng-class="{ \'form-table--error\' : newEvent.stream.$invalid && !newEvent.stream.$pristine }" ng-disabled=addingToSpecificStream></td></tr><tr><td>Event ID</td><td><input ng-model=eventId class=form-table name=evnt ng-class="{ \'form-table--error\' : newEvent.evnt.$invalid && !newEvent.evnt.$pristine }"></td></tr><tr><td>Event Type</td><td><input ng-model=eventType class=form-table name=eventType ng-class="{ \'form-table--error\' : newEvent.eventType.$invalid && !newEvent.eventType.$pristine }"></td></tr><tr class=table-subheading><td colspan=2>Data</td></tr><tr><td colspan=2><div ui-ace=aceConfig style="min-height: 350px; max-height: 350px" ng-model=eventData></div></td></tr><tr class=table-subheading><td colspan=2>Metadata</td></tr><tr><td colspan=2><div ui-ace=aceConfig style="min-height: 150px; max-height: 150px" ng-model=eventMetadata></div></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-click=addEvent() ng-disabled=newEvent.$invalid>Add</button></li></ul></form>')}])}(),function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.item.acl.tpl.html","<header class=page-header><h2 class=page-title>Edit ACL for Event Stream '{{ streamId }}'</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.events>Back</a></li></ul></header><form novalidate name=editAcl ng-submit=updateAcl()><table><tbody><tr><td>Reader</td><td><input name=reader class=form-table ng-model=reader></td></tr><tr><td>Writer</td><td><input name=writer class=form-table ng-model=writer></td></tr><tr><td>Deleter</td><td><input name=deleter class=form-table ng-model=deleter></td></tr><tr><td>Meta Reader</td><td><input name=metareader class=form-table ng-model=metareader></td></tr><tr><td>Meta Writer</td><td><input name=metawriter class=form-table ng-model=metawriter></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit>Save</button></li></ul></form>")}])}(),function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.item.event.tpl.html",'<header class=page-header><h2 class=page-title>{{ evt.title }} <small ng-if=isNotTheSame>Link from {{ evt.positionEventNumber + \'@\' + evt.positionStreamId }}</small></h2><ul class=page-nav><li class=page-nav__item><a ng-if=evt ui-sref="^.addStreamEvent({ fromEvent: evt })">Add New Like This</a></li><li class=page-nav__item><a ui-sref=^.events>Back</a></li></ul></header><ul class=page-nav style="padding:0rem 0rem 2rem 0rem !important"><li class=page-nav__item><button ng-disabled=!prev ui-sref=".({streamId: evt.streamId, eventNumber: evt.positionEventNumber - 1})">prev</button></li><li class=page-nav__item><button ng-disabled=!next ui-sref=".({streamId: evt.streamId, eventNumber: evt.positionEventNumber + 1})">next</button></li></ul><br><table><thead><tr><th>No</th><th>Stream</th><th>Type</th><th>Timestamp</th></tr></thead><tbody><tr><td>{{ evt.eventNumber }}</td><td><a ui-sref="^.events({streamId: evt.streamId})">{{ evt.streamId }}</a></td><td>{{ evt.eventType }}</td><td>{{ evt.updated | date:\'yyyy-MM-dd HH:mm:ss\'}}</td></tr><tr ng-if="evt.isJson || evt.isMetaData || evt.isLinkMetaData"><td colspan=4><div ng-if=evt.isJson><strong>Data</strong><pre>\n{{ evt.data }}\n\t\t\t\t</pre></div><div ng-if=evt.isMetaData><strong>Metadata</strong><pre>\n{{ evt.metaData }}\n\t\t\t\t</pre></div><div ng-if=evt.isLinkMetaData><strong>Link metadata</strong><pre>\n{{ evt.content.linkMetaData }}\n\t\t\t\t</pre></div></td></tr></tbody><thead><tr><th colspan=4>Internal data</th></tr></thead><tbody><tr><td>EventId</td><td colspan=3>{{ evt.eventId }}</td></tr></tbody></table>')}])}(),function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.item.events.tpl.html",'<table><thead><tr><th>Event #</th><th>Name</th><th>Type</th><th>Created Date</th><th></th></tr></thead><tbody ng-repeat="event in streams track by $index"><tr ng-class="{ \'invalid\': !event.streamId }"><td><a ng-if=event.streamId ui-sref="^.event({streamId: event.streamId, eventNumber: event.eventNumber})">{{ event.positionEventNumber }}</a><text ng-if=!event.streamId>{{ event.positionEventNumber }}</text></td><td><a ng-if=event.streamId ui-sref="^.event({streamId: event.streamId, eventNumber: event.eventNumber})">{{ event.title }}</a><text ng-if=!event.streamId>{{ event.title }}</text></td><td>{{ event.eventType }}</td><td>{{ event.updated | date:\'yyyy-MM-dd HH:mm:ss\'}}</td><td><a ng-click="toggleJson($event, event)" style="cursor: pointer;" ng-if="event.isJson || event.isLinkMetaData || event.isMetaData">JSON</a></td></tr><tr ng-show=event.showJson><td colspan=5><div ng-if=event.isJson><strong>Data</strong><pre>\n{{ event.data }}\t\t\t\t\t\n\t\t\t\t\t</pre></div><div ng-if=event.metaData><strong>Metadata</strong><pre>\n{{ event.metaData }}\t\t\t\t\t\n\t\t\t\t\t</pre></div><div ng-if=event.isLinkMetaData><strong>Link metadata</strong><pre>\n{{ event.linkMetaData }}\t\t\t\t\t\n\t\t\t\t\t</pre></div></td></tr></tbody><tbody ng-hide=streams><tr><td colspan=5><em>No events for current path: {{ $stateParams | json }}</em></td></tr></tbody></table>')}])}(),function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.item.tpl.html",'<header class=page-header><h2 class=page-title>Event Stream \'{{ streamId }}\'</h2><ul class=page-nav><li class=page-nav__item><a ng-class="{highlight: isPolling == false}" ng-click=togglePause() ng-show=headOfStream>{{ isPolling == true ? \'Pause\' : \'Resume\' }}</a></li><li class=page-nav__item><a ui-sref=.acl ng-show="streamId !== \'$all\'">Edit ACL</a></li><li class=page-nav__item><a ui-sref=.addStreamEvent ng-show="streamId.indexOf(\'$\') !== 0">Add Event</a></li><li class=page-nav__item><a ng-click=deleteStream()>Delete</a></li><li ng-if=projectionsEnabled class=page-nav__item><a ui-sref="query({ initStreamId: streamId })">Query</a></li><li class=page-nav__item><a ui-sref=subscriptions.list ng-show="source == \'persistentSubscriptions\'">Back</a> <a ui-sref=^.list ng-show="source == undefined">Back</a></li></ul></header><ul style="list-style-type: none; padding:0 0 0.75rem 0 !important"><li class=page-nav__item ng-repeat="link in links"><a ng-href={{link.uri}}>{{ link.relation }}</a></li></ul><br><div ui-view es-link-header></div>')}])}(),function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.list.tpl.html",'<header class=page-header><h2 class=page-title>Stream Browser</h2><ul class=page-nav><li class=page-nav__item><form><input ui-keypress="{\'enter\': \'gotoStream($event)\'}" ng-model=search placeholder="Search for stream"></form></li><li class=page-nav__item><a ui-sref=.addStreamEvent>Add Event</a></li></ul></header><div class=container><div class=container-left><table><thead><tr><th>Recently Created Streams</th></tr></thead><tbody><tr ng-repeat="stream in createdStreams"><td><a ui-sref="^.item.events({streamId: stream.streamId})">{{ stream.streamId }}</a></td></tr><tr ng-hide=createdStreams><td><em>{{noCreatedStreamsText}}</em></td></tr></tbody></table></div><div class=container-right><table><thead><tr><th>Recently Changed Streams</th></tr></thead><tbody><tr ng-repeat="stream in changedStreams"><td><a ui-sref="^.item.events({streamId: stream.streamId})">{{ stream.streamId }}</a></td></tr><tr ng-hide=changedStreams><td><em>{{noChangedStreamsText}}</em></td></tr></tbody></table></div></div>')}])}(),function(t){try{t=n.module("es-ui.streams.templates")}catch(e){t=n.module("es-ui.streams.templates",[])}t.run(["$templateCache",function(e){e.put("streams.tpl.html","<div ui-view></div>")}])}()}),define("modules/streams/_index",["angular","uiRouter","./controllers/_index","./directives/_index","./services/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.streams",["ui.router","es-ui.streams.controllers","es-ui.streams.services","es-ui.streams.templates","es-ui.streams.directives"])}),define("modules/streams/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("streams",{url:"streams",parent:"app",templateUrl:"streams.tpl.html",abstract:!0}).state("streams.list",{url:"",templateUrl:"streams.list.tpl.html",controller:"StreamsListCtrl",data:{title:"Stream Browser"}}).state("streams.item",{url:"/{streamId}",templateUrl:"streams.item.tpl.html",abstract:!0,controller:["$scope","$stateParams",function(e,t){e.streamId=t.streamId}],data:{title:"Stream"}}).state("streams.item.events",{url:"",templateUrl:"streams.item.events.tpl.html",controller:"StreamsItemEventsCtrl",data:{title:"Stream"}}).state("streams.item.navigation",{url:"/{position}/{type}/{count:[0-9]{1,99}}",templateUrl:"streams.item.events.tpl.html",controller:"StreamsItemEventsCtrl",data:{title:"Stream"}}).state("streams.item.metadata",{url:"/metadata",views:{"@streams":{templateUrl:"streams.item.event.tpl.html",controller:"StreamsItemEventCtrl"}},data:{metadata:!0,title:"Stream Event"}}).state("streams.item.event",{url:"/{eventNumber:[0-9]{1,99}}",views:{"@streams":{templateUrl:"streams.item.event.tpl.html",controller:"StreamsItemEventCtrl"}},data:{title:"Stream Event"}}).state("streams.item.acl",{url:"/acl",views:{"@streams":{templateUrl:"streams.item.acl.tpl.html",controller:"StreamsItemAclCtrl"}},data:{title:"Edit Stream ACL"}}).state("streams.list.addStreamEvent",{url:"/addEvent",views:{"@streams":{templateUrl:"streams.event.new.tpl.html",controller:"StreamsAddEventCtrl"}},data:{title:"Add Event To Stream"}}).state("streams.item.addStreamEvent",{url:"/addEvent",views:{"@streams":{templateUrl:"streams.event.new.tpl.html",controller:"StreamsAddEventCtrl"}},data:{title:"Add Event To Stream"},params:{fromEvent:null,streamId:""}})}])}),define("modules/security/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.security.controllers",[])}),define("modules/security/controllers/SignInCtrl",["./_module"],function(e){"use strict";return e.controller("SignInCtrl",["$scope","$rootScope","$state","$location","AuthService","MessageService","InfoService",function(e,i,t,n,r,s,o){function a(){if(i.previousUrl&&"/"!==i.previousUrl){var e=i.previousUrl;i.previousUrl=null,n.path(e)}else t.go("dashboard.list")}e.log={username:"",password:""},e.signIn=function(){e.login.$invalid?s.warn("Please fix all validation errors"):r.validate(e.log.username,e.log.password).then(function(){r.setCredentials(e.log.username,e.log.password),o.getOptions().then(function(e){var t=e.data;for(var n in t)"ClusterSize"===t[n].name&&1<t[n].value&&(i.singleNode=!1)},function(e){401!==e.statusCode&&s.failure("Failed to load options: "+e.message)}),a()},function(e){401===e.statusCode?s.warn("Incorrect user credentials supplied."):s.failure("Failed to validate user: "+e.message)})},r.existsAndValid().then(function(){a()})}])}),define("modules/security/controllers/SignOutCtrl",["./_module"],function(e){"use strict";return e.controller("SignOutCtrl",["$scope","$state","AuthService","$rootScope",function(e,t,n,i){n.clearCredentials(),"oauth"===i.authentication.type?i.hideMenuOptions=!0:t.go("signin")}])}),define("modules/security/controllers/_index",["./SignInCtrl","./SignOutCtrl"],function(){}),define("modules/security/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.security.templates")}catch(e){t=n.module("es-ui.security.templates",[])}t.run(["$templateCache",function(e){e.put("signin.tpl.html",'<div class=page-logon es-height><div class=logon-container><h1 class=site-title><a href="javascript:return false;"><img src=images/logo.svg height=29 width=119 alt="Event Store"></a></h1><form novalidate name=login ng-submit=signIn() class=login-form><label for=username>Username</label> <input placeholder=Username autofocus required name=username es-auto-focus ng-class="{ \'form-table--error\' : login.username.$invalid && !login.username.$pristine }" ng-model=log.username> <label for=password>Password</label> <input type=password ng-class="{ \'form-table--error\' : login.password.$invalid && !login.password.$pristine }" name=password class=form-table placeholder=Password ng-model=log.password required> <button type=submit style=cursor:pointer; ng-disabled=login.$invalid>Sign In</button></form></div><footer class=site-footer><p>Event Store</p></footer></div>')}])}()}),define("modules/security/_index",["angular","uiRouter","./controllers/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.security",["ui.router","es-ui.security.controllers","es-ui.security.templates"])}),define("modules/security/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("signin",{url:"signin",templateUrl:"signin.tpl.html",controller:"SignInCtrl",data:{title:"Sign in"}}).state("signout",{url:"signout",parent:"app",template:"<div ui-view>{{logoutText}}</div>",controller:"SignOutCtrl",data:{title:"Sign out"}})}])}),define("modules/users/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.users.controllers",["es-ui.users.services"])}),define("modules/users/controllers/UsersItemDeleteCtrl",["./_module"],function(e){"use strict";return e.controller("UsersItemDeleteCtrl",["$scope","$state","$stateParams","UserService","MessageService",function(n,t,e,i,r){n.disable=!0,n.confirm=function(e){e.preventDefault(),e.stopPropagation(),i.remove(n.user.loginName).then(function(){r.success("User deleted"),t.go("users.list")},function(e){r.failure("Failed to delete user: "+e.message)})},i.get(e.username).then(function(e){var t=e.data;n.user=t.data,n.disable=!1},function(e){404===e.statusCode?r.failure("User does not exist"):r.failure("Failed to get user: "+e.message),t.go("users")})}])}),define("modules/users/controllers/UsersItemDetailsCtrl",["./_module"],function(e){"use strict";return e.controller("UsersItemDetailsCtrl",["$scope","$state","$stateParams","UserService","MessageService",function(n,t,e,i,r){i.get(e.username).then(function(e){var t=e.data;n.user=t.data},function(e){r.failure("Failed to get user: "+e.message),t.go("users")})}])}),define("modules/users/controllers/UsersItemDisableCtrl",["./_module"],function(e){"use strict";return e.controller("UsersItemDisableCtrl",["$scope","$state","$stateParams","UserService","MessageService",function(n,i,e,t,r){n.disable=!0,n.confirm=function(e){e.preventDefault(),e.stopPropagation(),t.disable(n.user.loginName).then(function(){r.success("User disabled"),n.$state.go("^.details")},function(e){r.failure("Failed to disable user: "+e.message)})},t.get(e.username).then(function(e){var t=e.data;n.user=t.data,n.disable=!1,n.user.disabled&&(r.warn("User already disabled"),i.go("^.details"))},function(e){404===e.statusCode?r.failure("User does not exist"):r.failure("Failed to get user: "+e.message),i.go("users")})}])}),define("modules/users/controllers/UsersItemEditCtrl",["./_module"],function(e){"use strict";return e.controller("UsersItemEditCtrl",["$scope","$state","$stateParams","UserService","MessageService",function(n,t,e,i,r){n.confirm=function(){n.editUsr.$invalid?r.warn("Please fix all validation errors"):i.update(n.user.loginName,n.fullName,n.user.role).then(function(){r.success("user updated"),t.go("^.details")},function(e){r.failure("Failed to update user: "+e.message)})},i.get(e.username).then(function(e){var t=e.data;n.user=t.data,n.user.role=t.data.groups[0],n.fullName=n.user.fullName},function(e){404===e.statusCode?r.failure("User does not exist"):r.failure("Failed to get user: "+e.message),t.go("users")})}])}),define("modules/users/controllers/UsersItemEnableCtrl",["./_module"],function(e){"use strict";return e.controller("UsersItemEnableCtrl",["$scope","$state","$stateParams","UserService","MessageService",function(n,i,e,t,r){n.disable=!0,n.confirm=function(e){e.preventDefault(),e.stopPropagation(),t.enable(n.user.loginName).then(function(){r.success("user enabled"),i.go("^.details")},function(e){r.failure("Failed to enable user: "+e.message)})},t.get(e.username).then(function(e){var t=e.data;n.user=t.data,n.disable=!1,n.user.disabled||(r.warn("user already enabled"),i.go("^.details"))},function(e){404===e.statusCode?r.failure("User does not exist"):r.failure("Failed to get user: "+e.message),i.go("users")})}])}),define("modules/users/controllers/UsersItemResetCtrl",["./_module"],function(e){"use strict";return e.controller("UsersItemResetCtrl",["$rootScope","$scope","$state","UserService","MessageService","AuthService",function(e,n,t,i,r,s){n.confirm=function(){n.resetPwd.$invalid?r.warn("Please fix all validation errors"):i.resetPassword(n.user.loginName,n.password).then(function(){r.success("Password has been reset"),s.resetCredentials(n.user.loginName,n.password).then(function(){t.go("^.details")},function(){r.failure("We tried to reset the credentials in the cookie and failed. Please log in again."),t.go("signin")})},function(e){r.failure("Failed to reset password: "+e.message)})},i.get(n.$stateParams.username).then(function(e){var t=e.data;n.user=t.data},function(e){404===e.statusCode?r.failure("User does not exist"):r.failure("Failed to get user: "+e.message),t.go("users")})}])}),define("modules/users/controllers/UsersListCtrl",["./_module"],function(e){"use strict";return e.controller("UsersListCtrl",["$rootScope","$state","$scope","UserService","poller","MessageService",function(e,n,i,r,s,o){function t(){if(!e.userManagementEnabled)return o.failure("User Management is not available"),void n.go("dashboard.list");var t=s.create({interval:1e3,action:r.all,params:[]});t.start(),t.promise.then(null,null,function(e){i.users=e.data}),t.promise.catch(function(e){t.stop(),o.failure("Failed to retrieve list of users: "+e.message)}),i.$on("$destroy",function(){s.clear()})}if(e.initialized)t();else var a=e.$on("initialized",function(){t(),a()})}])}),define("modules/users/controllers/UsersNewCtrl",["./_module"],function(e){"use strict";return e.controller("UsersNewCtrl",["$scope","$state","UserService","MessageService",function(e,t,n,i){e.newUser={},e.confirm=function(){e.newUsr.$invalid?i.warn("Please fix all validation errors"):n.create(e.newUser).then(function(){i.success("User created"),t.go("^.list")},function(e){i.failure("Failed to create user: "+e.message)})}}])}),define("modules/users/controllers/_index",["./UsersItemDeleteCtrl","./UsersItemDetailsCtrl","./UsersItemDisableCtrl","./UsersItemEditCtrl","./UsersItemEnableCtrl","./UsersItemResetCtrl","./UsersListCtrl","./UsersNewCtrl"],function(){}),define("modules/users/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.users.services",[])}),define("modules/users/services/UserService",["./_module"],function(e){"use strict";return e.provider("UserService",function(){this.$get=["$http","urls","UrlBuilder",function(s,o,a){return{all:function(){var e=a.build(o.users.list);return s.get(e)},get:function(e){var t=a.build(o.users.get,e);return s.get(t)},create:function(e){var t=a.build(o.users.create);return e.groups=[],e.role&&e.groups.push(e.role),delete e.confirmPassword,s.post(t,e)},update:function(e,t,n){var i=a.build(o.users.update,e),r=[];return n&&r.push(n),s.put(i,{fullName:t,groups:r})},remove:function(e){var t=a.build(o.users.remove,e);return s.delete(t)},disable:function(e){var t=a.build(o.users.disable,e);return s.post(t)},enable:function(e){var t=a.build(o.users.enable,e);return s.post(t)},resetPassword:function(e,t){var n=a.build(o.users.resetPassword,e);return s.post(n,{newPassword:t})}}}]})}),define("modules/users/services/_index",["./UserService"],function(){}),define("modules/users/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.delete.tpl.html","<header class=page-header><h2 class=page-title>Delete User {{ user.loginName }}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><pre>\n{{ user | json }}\n</pre><ul class=page-nav><li class=page-nav__item><a href=# ng-click=confirm($event) ng-disabled=disable>Delete</a></li></ul>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.details.tpl.html",'<div ui-view><header class=page-header><h2 class=page-title>User Details {{ user.loginName }}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.edit>Edit</a></li><li class=page-nav__item><a ui-sref=^.delete>Delete</a></li><li class=page-nav__item ng-hide=user.disabled><a ui-sref=^.disable>Disable</a></li><li class=page-nav__item ng-show=user.disabled><a ui-sref=^.enable>Enable</a></li><li class=page-nav__item><a ui-sref=^.reset>Password Reset</a></li><li class=page-nav__item><a ui-sref=^.^.list>Back</a></li></ul></header></div><div><table><tr><th>Fields</th><th>Values</th></tr><tr><td>Login Name</td><td>{{ user.loginName }}</td></tr><tr><td>Full Name</td><td>{{ user.fullName }}</td></tr><tr><td>Groups</td><td><ul ng-repeat="group in user.groups"><li>{{ group }}</li></ul></td></tr><tr><td>Disabled</td><td>{{ user.disabled }}</td></tr><tr><td>API Links</td><td><ul ng-repeat="userData in user.links"><li><b>Link</b> - <a href={{userData.href}} target=_blank>{{ userData.href }}</a></li><li><b>Rel</b> - {{userData.rel}}</li></ul></td></tr></table></div>')}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.disable.tpl.html","<header class=page-header><h2 class=page-title>Disable User {{ user.loginName }}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><pre>\n{{ user | json }}\n</pre><ul class=page-nav><li class=page-nav__item><a href=# ng-click=confirm($event) ng-disabled=disable>Disable</a></li></ul>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.edit.tpl.html","<header class=page-header><h2 class=page-title>Edit User {{ user.loginName }}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><form novalidate name=editUsr ng-submit=confirm()><table><tbody><tr><td>Login Name</td><td>{{ user.loginName}}</td></tr><tr><td>Full Name</td><td><input name=fullName class=form-table ng-class=\"{ 'form-table--error' : editUsr.fullName.$invalid && !editUsr.fullName.$pristine }\" ng-model=fullName required></td></tr><tr><td>Groups</td><td><input type=radio name=role ng-model=user.role value=$ops> <label for=isOperations>Is Operations</label> <input type=radio name=role ng-model=user.role value=$admins> <label for=isAdmin>Is Administrator</label> <input type=radio name=role ng-model=user.role> <label for=hasNoRole>None</label></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=editUsr.$invalid>Update</button></li></ul></form>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.enable.tpl.html","<header class=page-header><h2 class=page-title>Enable User {{ user.loginName }}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><pre>\n{{ user | json }}\n</pre><ul class=page-nav><li class=page-nav__item><a href=# ng-click=confirm($event) ng-disabled=disable>Enable</a></li></ul>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.reset.tpl.html","<header class=page-header><h2 class=page-title>Reset User {{ user.loginName }} Password</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.details>Back</a></li></ul></header><form novalidate name=resetPwd ng-submit=confirm()><table><tbody><tr><td>Login Name</td><td>{{ user.loginName}}</td></tr><tr><td>Password</td><td><input type=password name=password class=form-table ng-class=\"{ 'form-table--error' : resetPwd.password.$invalid && !resetPwd.password.$pristine }\" ng-model=password required></td></tr><tr><td>Confirm Password</td><td><input type=password class=form-table name=confirmPassword ng-model=confirmPassword ng-class=\"{ 'form-table--error' : resetPwd.confirmPassword.$invalid && !resetPwd.confirmPassword.$pristine }\" es-validate-equals=password></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=resetPwd.$invalid>Reset password</button></li></ul></form>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.item.tpl.html","<div ui-view></div>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.list.tpl.html","<div ui-view><header class=page-header><h2 class=page-title>Users</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.new>New User</a></li></ul></header><table class=table-queues><thead><tr><th>Login Name</th><th>Full Name</th><th>Groups</th><th>Disabled</th><th>Updated</th></tr></thead><tbody><tr ng-repeat=\"user in users\"><td><a ui-sref=\"^.item.details({username: user.loginName})\">{{ user.loginName }}</a></td><td>{{ user.fullName }}</td><td>{{ user.groups.join(', ') }}</td><td>{{ user.disabled }}</td><td>{{ user.dateLastUpdated | date:'short' }}</td></tr><tr ng-hide=users><td colspan=5><em>No users</em></td></tr></tbody></table></div>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.new.tpl.html","<header class=page-header><h2 class=page-title>New User</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><form novalidate name=newUsr ng-submit=confirm()><table><tbody><tr><td>Login Name</td><td><input class=form-table autofocus required name=loginName ng-class=\"{ 'form-table--error' : newUsr.loginName.$invalid && !newUsr.loginName.$pristine }\" ng-model=newUser.loginName></td></tr><tr><td>Full Name</td><td><input ng-class=\"{ 'form-table--error' : newUsr.fullName.$invalid && !newUsr.fullName.$pristine }\" name=fullName class=form-table required ng-model=newUser.fullName></td></tr><tr><td>Password</td><td><input type=password ng-class=\"{ 'form-table--error' : newUsr.password.$invalid && !newUsr.password.$pristine }\" name=password class=form-table ng-model=newUser.password required></td></tr><tr><td>Confirm Password</td><td><input type=password ng-class=\"{ 'form-table--error' : newUsr.confirmPassword.$invalid && !newUsr.confirmPassword.$pristine }\" name=confirmPassword class=form-table required ng-model=newUser.confirmPassword es-validate-equals=newUser.password></td></tr><tr><td>Groups</td><td><input type=radio name=role ng-model=newUser.role value=$ops> <label for=isOperations>Is Operations</label> <input type=radio name=role ng-model=newUser.role value=$admins> <label for=isAdmin>Is Administrator</label> <input type=radio name=role ng-model=user.role> <label for=hasNoRole>None</label></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=newUsr.$invalid>Create</button></li></ul></form>")}])}(),function(t){try{t=n.module("es-ui.users.templates")}catch(e){t=n.module("es-ui.users.templates",[])}t.run(["$templateCache",function(e){e.put("users.tpl.html","<div ui-view></div>")}])}()}),define("modules/users/_index",["angular","uiRouter","./controllers/_index","./services/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.users",["ui.router","es-ui.users.controllers","es-ui.users.services","es-ui.users.templates"])}),define("modules/users/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("users",{url:"users",parent:"app",templateUrl:"users.tpl.html",abstract:!0,data:{title:"Users"}}).state("users.list",{url:"",templateUrl:"users.list.tpl.html",controller:"UsersListCtrl",data:{title:"Users"}}).state("users.new",{url:"/new",templateUrl:"users.new.tpl.html",controller:"UsersNewCtrl",data:{title:"New User"}}).state("users.item",{url:"/{username}",abstract:!0,templateUrl:"users.item.tpl.html",data:{title:"User Details"}}).state("users.item.details",{url:"",templateUrl:"users.item.details.tpl.html",controller:"UsersItemDetailsCtrl",data:{title:"User Details"}}).state("users.item.edit",{url:"/edit",templateUrl:"users.item.edit.tpl.html",controller:"UsersItemEditCtrl",data:{title:"Edit User"}}).state("users.item.disable",{url:"/disable",templateUrl:"users.item.disable.tpl.html",controller:"UsersItemDisableCtrl",data:{title:"Disable User"}}).state("users.item.enable",{url:"/enable",templateUrl:"users.item.enable.tpl.html",controller:"UsersItemEnableCtrl",data:{title:"Enable User"}}).state("users.item.delete",{url:"/delete",templateUrl:"users.item.delete.tpl.html",controller:"UsersItemDeleteCtrl",data:{title:"Delete User"}}).state("users.item.reset",{url:"/reset",templateUrl:"users.item.reset.tpl.html",controller:"UsersItemResetCtrl",data:{title:"Reset User Password"}})}])}),define("modules/competing/controllers/_module",["angular"],function(e){"use strict";return e.module("es-ui.competing.controllers",["es-ui.competing.services"])}),define("modules/competing/controllers/SubscriptionsListCtrl",["./_module"],function(e){"use strict";return e.controller("SubscriptionsListCtrl",["$scope","CompetingService","SubscriptionsMapper","poller","MessageService","urls","UrlBuilder",function(t,n,i,e,r,s,o){var a=e.create({interval:1e3,action:n.subscriptions,params:[]});t.replayParkedMessages=function(e,t){n.replayParked(e,t).then(function(){r.success("Replaying Parked Messages")},function(e){r.failure("Failed to initiate replaying of parked messages: "+e.message)})},t.subscriptions={},a.start(),a.promise.then(null,null,function(e){t.subscriptions=i.map(e,t.subscriptions)}),a.promise.catch(function(e){r.failure("Failed to retrieve list of subscriptions: "+e.message),t.subscriptions=null,a.stop()}),t.$on("$destroy",function(){e.clear()})}])}),define("modules/competing/controllers/SubscriptionsDetailCtrl",["./_module"],function(e){"use strict";return e.controller("SubscriptionsDetailCtrl",["$scope","$stateParams","CompetingService","MessageService",function(t,e,n,i){t.streamId=e.streamId,t.groupName=e.groupName,n.subscriptionDetail(t.streamId,t.groupName).then(function(e){t.detail=e.data},function(e){i.failure("Failed to retrieve subscription details: "+e.message)})}])}),define("modules/competing/controllers/SubscriptionsNewCtrl",["./_module"],function(e){"use strict";return e.controller("SubscriptionsNewCtrl",["$scope","$state","CompetingService","MessageService",function(t,n,i,r){t.namedConsumerStrategies=[{value:"RoundRobin",name:"Round Robin"},{value:"DispatchToSingle",name:"Dispatch To Single"},{value:"Pinned",name:"Pinned"},{value:"PinnedByCorrelation",name:"Pinned By Correlation"}],t.checkpoints=1e3,t.resolveLinktos=!1,t.startFrom=0,t.messageTimeoutMilliseconds=1e4,t.extraStatistics=!1,t.maxRetryCount=10,t.liveBufferSize=500,t.bufferSize=500,t.readBatchSize=20,t.checkPointAfterMilliseconds=1e3,t.minCheckPointCount=10,t.maxCheckPointCount=500,t.maxSubscriberCount=10,t.namedConsumerStrategy="RoundRobin",t.save=function(){if(t.newSubscription.$invalid)r.warn("Please fix all validation errors");else{var e={checkpoints:t.checkpoints,resolveLinktos:t.resolveLinktos,startFrom:t.startFrom,messageTimeoutMilliseconds:t.messageTimeoutMilliseconds,extraStatistics:t.extraStatistics,maxRetryCount:t.maxRetryCount,liveBufferSize:t.liveBufferSize,bufferSize:t.bufferSize,readBatchSize:t.readBatchSize,checkPointAfterMilliseconds:t.checkPointAfterMilliseconds,minCheckPointCount:t.minCheckPointCount,maxCheckPointCount:t.maxCheckPointCount,maxSubscriberCount:t.maxSubscriberCount,namedConsumerStrategy:t.namedConsumerStrategy};i.create(t.stream,t.subscription,e).then(function(){r.success("Subscription has been created"),n.go("^.list")},function(e){var t=e.message;e.errorData&&e.errorData.reason&&(t=e.errorData.reason),r.failure("Failed to create new subscription: "+t)})}}}])}),define("modules/competing/controllers/SubscriptionsEditCtrl",["./_module"],function(e){"use strict";return e.controller("SubscriptionsEditCtrl",["$scope","$state","CompetingService","MessageService",function(t,n,i,r){t.stream=n.params.streamId,t.subscription=n.params.groupName,t.namedConsumerStrategies=[{value:"RoundRobin",name:"Round Robin"},{value:"DispatchToSingle",name:"Dispatch To Single"},{value:"Pinned",name:"Pinned"},{value:"PinnedByCorrelation",name:"Pinned By Correlation"}],i.subscriptionDetail(t.stream,t.subscription).then(function(e){t.config=e.data.config},function(e){r.failure("Failed to retrieve subscription details: "+e.message)}),t.namedConsumerStrategy="RoundRobin",t.save=function(){if(t.updateSubscription.$invalid)r.warn("Please fix all validation errors");else{var e={checkpoints:t.config.checkpoints,enabled:t.config.enabled,resolveLinktos:t.config.resolveLinktos,startFrom:t.config.startFrom,messageTimeoutMilliseconds:t.config.messageTimeoutMilliseconds,extraStatistics:t.config.extraStatistics,maxRetryCount:t.config.maxRetryCount,liveBufferSize:t.config.liveBufferSize,bufferSize:t.config.bufferSize,readBatchSize:t.config.readBatchSize,checkPointAfterMilliseconds:t.config.checkPointAfterMilliseconds,minCheckPointCount:t.config.minCheckPointCount,maxCheckPointCount:t.config.maxCheckPointCount,maxSubscriberCount:t.config.maxSubscriberCount,namedConsumerStrategy:t.config.namedConsumerStrategy};i.update(t.stream,t.subscription,e).then(function(e){var t=(0,e.headers)().location;r.success("Subscription has been updated"),n.go("subscriptions.list",{location:encodeURIComponent(t)})},function(e){var t=e.message;e.errorData&&e.errorData.reason&&(t=e.errorData.reason),r.failure("Failed to update subscription: "+t)})}}}])}),define("modules/competing/controllers/SubscriptionsDeleteCtrl",["./_module"],function(e){"use strict";return e.controller("SubscriptionsDeleteCtrl",["$scope","$state","CompetingService","MessageService",function(e,t,n,i){e.stream=t.params.streamId,e.subscription=t.params.groupName,e.delete=function(){i.confirm("Are you sure you wish to delete the subscription?")&&n.delete(e.stream,e.subscription).then(function(){i.success("Subscription has been deleted"),t.go("subscriptions.list")},function(e){i.failure("Failed to delete subscription: "+e.message)})}}])}),define("modules/competing/controllers/SubscriptionsViewParkedMessagesCtrl",["./_module"],function(e){"use strict";return e.controller("SubscriptionsViewParkedMessagesCtrl",["$scope","$stateParams","CompetingService","poller","MessageService",function(n,e,i,t,r){n.streamId=e.streamId,n.groupName=e.groupName,n.$parent.showHeader=!1;var s={};i.viewParkedMessagesBackward(n.streamId,n.groupName,"head",20).then(function(e){var t=e.data;null!=t.entries?n.entries=t.entries:n.entries=[]},function(e){r.failure("Failed to read parked messages: "+e.message)}),n.pageForward=function(e){if(null!=e&&0<e.length){var t=e[0].positionEventNumber+1;i.viewParkedMessagesForward(n.streamId,n.groupName,t,20).then(function(e){var t=e.data;void 0!==t&&void 0!==t.entries&&0<t.entries.length&&(n.entries=t.entries)},function(e){r.failure("Failed to read parked messages: "+e.message)})}},n.pageForwardPoll=function(){var e=0;return null!=n.entries&&0<n.entries.length&&(e=n.entries[0].positionEventNumber+1),i.viewParkedMessagesForward(n.streamId,n.groupName,e,20)};var o=t.create({interval:5e3,action:n.pageForwardPoll,params:[]});o.start(),o.promise.then(null,null,function(e){if(void 0!==e&&void 0!==e.entries&&0<e.entries.length)for(var t in e.entries)e.entries[t].positionEventNumber>n.entries[0].positionEventNumber&&n.entries.unshift(e.entries[t])}),o.promise.catch(function(e){r.failure("Failed to read parked messages: "+e.message),o.stop()}),n.pageBackward=function(e){if(o.stop(),null!=e&&0<e.length){var t=e[e.length-1].positionEventNumber-1;i.viewParkedMessagesBackward(n.streamId,n.groupName,t,20).then(function(e){var t=e.data;o.stop(),void 0!==t&&void 0!==t.entries&&0<t.entries.length&&(n.entries=t.entries)},function(e){r.failure("Failed to read parked messages: "+e.message)})}},n.pageFirst=function(){i.viewParkedMessagesBackward(n.streamId,n.groupName,"head",20).then(function(e){var t=e.data;void 0!==t&&void 0!==t.entries&&0<t.entries.length&&(n.entries=t.entries)},function(e){r.failure("Failed to read parked messages: "+e.message)}),o.start()},n.$on("$destroy",function(){o.stop()}),n.toggleJson=function(e,t){e.preventDefault(),e.stopPropagation(),t.showJson=!t.showJson,s[t.title]=t.showJson}}])}),define("modules/competing/controllers/_index",["./SubscriptionsListCtrl","./SubscriptionsDetailCtrl","./SubscriptionsNewCtrl","./SubscriptionsEditCtrl","./SubscriptionsDeleteCtrl","./SubscriptionsViewParkedMessagesCtrl"],function(){}),define("modules/competing/services/_module",["angular"],function(e){"use strict";return e.module("es-ui.competing.services",[])}),define("modules/competing/services/CompetingService",["./_module"],function(e){"use strict";return e.provider("CompetingService",function(){this.$get=["$http","urls","UrlBuilder",function(s,o,a){return{subscriptions:function(){var e=a.build(o.competing.subscriptions);return s.get(e)},subscriptionDetail:function(e,t){var n=a.build(o.competing.subscriptionDetails,e,t);return s.get(n)},create:function(e,t,n){var i=a.build(o.competing.create,e,t);return s.put(i,n,{headers:{"Content-Type":"application/json"}})},update:function(e,t,n){var i=a.build(o.competing.update,e,t);return s.post(i,n,{headers:{"Content-Type":"application/json"}})},delete:function(e,t){var n=a.build(o.competing.delete,e,t);return s.delete(n,{headers:{"Content-Type":"application/json"}})},replayParked:function(e,t){var n=a.build(o.competing.replayParked,e,t);return s.post(n,{},{headers:{"Content-Type":"application/json"}})},viewParkedMessagesBackward:function(e,t,n,i){var r=a.build(o.competing.viewParkedMessagesBackward,e,t,n,i);return s.get(r,{headers:{Accept:"application/vnd.eventstore.competingatom+json"}})},viewParkedMessagesForward:function(e,t,n,i){var r=a.build(o.competing.viewParkedMessagesForward,e,t,n,i);return s.get(r,{headers:{Accept:"application/vnd.eventstore.competingatom+json"}})}}}]})}),define("modules/competing/services/SubscriptionsMapper",["./_module"],function(e){"use strict";return e.provider("SubscriptionsMapper",function(){function h(e,t){for(var n in e)if(e[n].groupName===t)return e[n]}function d(e){for(var t in e.groups)if(0<=e.groups[t].status.indexOf("behind"))return e.groups[t].status;return e.groups[0].status}function s(e){return{commit:parseInt(e.split("/")[0].split("C:")[1]),prepare:parseInt(e.split("/")[1].split("P:")[1])}}function f(e,t,n){if(void 0===e)return t;if(void 0===t)return e;if(null===e)return e;if(null===t)return t;if(n){var i=s(e),r=s(t);return Math.max(i.commit,i.prepare)<=Math.max(r.commit,r.prepare)?e:t}return parseInt(e)<=parseInt(t)?e:t}function e(e,t){var n,i,r,s,o,a=e,l={};for(n in a){var c=(i=a[n]).eventStreamId;c.startsWith("$")&&(c="_"+c);var u=h(t[c]?t[c].groups:[],i.groupName);"$all"===i.eventStreamId?(i.behindByMessages=i.lastKnownEventPosition===i.lastCheckpointedEventPosition?0:void 0,i.behindByTime=void 0,i.behindStatus=""):(i.behindByMessages=i.lastKnownEventPosition-i.lastCheckpointedEventPosition,i.behindByTime=Math.round(i.behindByMessages/i.averageItemsPerSecond*100)/100,i.behindByTime=isFinite(i.behindByTime)?i.behindByTime:0,i.behindStatus=i.behindByMessages+" / "+i.behindByTime),i.averageItemsPerSecond=u?i.totalItemsProcessed-u.totalItemsProcessed:0,i.inFlightMessages=i.totalInFlightMessages,i.status=0!==(o=i).behindByMessages?0<o.averageItemsPerSecond?"subscription-active":"behind-notcatchingup":"subscription-active",c?(r=l[c]?l[c]:{streamName:i.eventStreamId,averageItemsPerSecond:0,totalItemsProcessed:0,connectionCount:0,lastKnownEventPosition:void 0,lastCheckpointedEventPosition:void 0,inFlightMessages:0,status:"Idle",behindByMessages:0,behindByTime:0,groups:[]},s=t[c],r.show=!!s&&s.show,r.groups.push(i),r.inFlightMessages+=i.totalInFlightMessages,r.averageItemsPerSecond+=i.averageItemsPerSecond,r.connectionCount+=i.connectionCount,r.lastKnownEventPosition=f(r.lastKnownEventPosition,i.lastKnownEventPosition,"$all"===i.eventStreamId),r.lastCheckpointedEventPosition=f(r.lastCheckpointedEventPosition,i.lastCheckpointedEventPosition,"$all"===i.eventStreamId),"$all"===i.eventStreamId?(r.behindByMessages=void 0,r.behindByTime=void 0,r.behindStatus=""):(r.behindByMessages+=i.behindByMessages,r.behindByTime+=i.behindByTime,r.behindByTime=Math.round(100*i.behindByTime)/100,r.behindStatus=r.behindByMessages+" / "+r.behindByTime),r.status=d(r),l[c]=r):l[c]=i}return l}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t}),this.$get=[function(){return{map:e}}]})}),define("modules/competing/services/_index",["./CompetingService","./SubscriptionsMapper"],function(){}),define("modules/competing/directives/_module",["angular"],function(e){"use strict";return e.module("es-ui.competing.directives",[])}),define("modules/competing/directives/EsSubscriptionRow",["./_module"],function(e){"use strict";return e.directive("esSubscriptionRow",[function(e){return{restrict:"A",templateUrl:"subscription.row.tpl.html",scope:{esSubscription:"="},link:function(){}}}])}),define("modules/competing/directives/EsSubscriptionRowHeader",["./_module"],function(e){"use strict";return e.directive("esSubscriptionRowHeader",[function(){return{restrict:"A",templateUrl:"subscription.row.header.tpl.html",scope:{esSubscription:"="},link:function(e,t){function n(){e.$apply(function(){e.toggle()})}e.toggle=function(){e.esSubscription.show=!e.esSubscription.show},t.bind("click",n),e.$on("$destroy",function(){t.unbind("click",n)})}}}])}),define("modules/competing/directives/_index",["./EsSubscriptionRow","./EsSubscriptionRowHeader"],function(){}),define("modules/competing/templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscription.row.header.tpl.html",'<td ng-if=esSubscription.show>{{ esSubscription.streamName }} <a class=table-collapsetoggle>&minus;</a></td><td ng-if=!esSubscription.show>{{ esSubscription.streamName }} <a class=table-collapsetoggle>&plus;</a></td><td>{{ esSubscription.averageItemsPerSecond }}</td><td>{{ esSubscription.lastKnownEventPosition }}</td><td>{{ esSubscription.lastCheckpointedEventPosition }}</td><td>{{ esSubscription.inFlightMessages }}</td><td>{{ esSubscription.connectionCount }}</td><td><div class="status {{ esSubscription.status }}"></div>{{ esSubscription.behindStatus }}</td><td></td>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscription.row.tpl.html",'<td>{{ esSubscription.groupName }}</td><td>{{ esSubscription.averageItemsPerSecond }}</td><td>{{ esSubscription.lastKnownEventPosition }}</td><td>{{ esSubscription.lastCheckpointedEventPosition }}</td><td>{{ esSubscription.inFlightMessages }}</td><td>{{ esSubscription.connectionCount }}</td><td><div class="status {{ esSubscription.status }}"></div>{{ esSubscription.behindStatus }}</td><td><ul class=page-nav><li ng-if="esSubscription.eventStreamId !== \'$all\'" class=page-nav__item><a ui-sref="^.item.edit({streamId: esSubscription.eventStreamId, groupName: esSubscription.groupName})">Edit</a></li><li ng-if="esSubscription.eventStreamId !== \'$all\'" class=page-nav__item><a ui-sref="^.item.delete({streamId: esSubscription.eventStreamId, groupName: esSubscription.groupName})">Delete</a></li><li class=page-nav__item><a ui-sref="^.item.detail({streamId: esSubscription.eventStreamId, groupName: esSubscription.groupName})">Detail</a></li><li class=page-nav__item><a ng-click="$parent.replayParkedMessages(esSubscription.eventStreamId, esSubscription.groupName)">Replay Parked Messages</a></li><li class=page-nav__item><a ui-sref="^.item.viewparkedmessages({streamId: esSubscription.eventStreamId, groupName: esSubscription.groupName})">View Parked Messages</a></li></ul></td>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.item.delete.tpl.html","<form novalidate name=deleteSubscription ng-submit=delete() class=delete-subscription-form><table><tbody><tr><td>Group</td><td><input ng-model=subscription required readonly=true class=form-table name=subscription ng-class=\"{ 'form-table--error' : deleteSubscription.subscription.$invalid && !deleteSubscription.subscription.$pristine }\"></td></tr><tr><td>Stream</td><td><input ng-model=stream required readonly=true class=form-table name=stream ng-class=\"{ 'form-table--error' : deleteSubscription.stream.$invalid && !deleteSubscription.stream.$pristine }\"></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=deleteSubscription.$invalid>Delete</button></li></ul></form>")}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.item.detail.tpl.html","<div class=container><table><thead><tr><th>Configuration</th></tr></thead><thead><tr><th>Buffer Size</th><th>Check Point After</th><th>Extra Statistics</th><th>Live Buffer Size</th><th>Max Checkpoint Count</th><th>Max Retry Count</th><th>Message Timeout (ms)</th><th>Min Checkpoint Count</th><th>Consumer Strategy</th><th>Read Batch Size</th><th>Resolve Link tos</th><th>Start From</th></tr></thead><tbody><tr><td>{{ detail.config.bufferSize }}</td><td>{{ detail.config.checkPointAfterMilliseconds }}</td><td>{{ detail.config.extraStatistics }}</td><td>{{ detail.config.liveBufferSize }}</td><td>{{ detail.config.maxCheckPointCount }}</td><td>{{ detail.config.maxRetryCount }}</td><td>{{ detail.config.messageTimeoutMilliseconds }}</td><td>{{ detail.config.minCheckPointCount }}</td><td>{{ detail.config.namedConsumerStrategy }}</td><td>{{ detail.config.readBatchSize }}</td><td>{{ detail.config.resolveLinktos }}</td><td>{{ detail.config.startPosition }}</td></tr></tbody></table></div>")}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.item.edit.tpl.html",'<form novalidate name=updateSubscription ng-submit=save() class=edit-subscription-form><table><tbody><tr class=table-subheading><td colspan=2>Basic Details</td></tr><tr><td>Group</td><td><input ng-model=subscription required class=form-table readonly=true name=subscription></td></tr><tr><td>Stream</td><td><input ng-model=stream required class=form-table readonly=true name=stream></td></tr><tr class=table-subheading><td colspan=2>Configuration</td></tr><tr><td>Resolve Link Tos</td><td><input type=checkbox ng-model=config.resolveLinktos ng-disabled=resolveLinktosDisabled></td></tr><tr><td>Start From</td><td><input ng-model=config.startFrom class=form-table name=startFrom></td></tr><tr><td>Message Timeout (ms)</td><td><input ng-model=config.messageTimeoutMilliseconds class=form-table name=messageTimeoutMilliseconds></td></tr><tr><td>Extra Statistics</td><td><input type=checkbox ng-model=config.extraStatistics ng-disabled=extraStatisticsDisabled></td></tr><tr><td>Max Retry Count</td><td><input ng-model=config.maxRetryCount class=form-table name=maxRetryCount></td></tr><tr><td>Live Buffer Size</td><td><input ng-model=config.liveBufferSize class=form-table name=liveBufferSize></td></tr><tr><td>Buffer Size</td><td><input ng-model=config.bufferSize class=form-table name=bufferSize></td></tr><tr><td>Read Batch Size</td><td><input ng-model=config.readBatchSize class=form-table name=readBatchSize></td></tr><tr><td>CheckPoint After (ms)</td><td><input ng-model=config.checkPointAfterMilliseconds class=form-table name=checkPointAfterMilliseconds></td></tr><tr><td>Min CheckPoint Count</td><td><input ng-model=config.minCheckPointCount class=form-table name=minCheckPointCount></td></tr><tr><td>Max CheckPoint Count</td><td><input ng-model=config.maxCheckPointCount class=form-table name=maxCheckPointCount></td></tr><tr><td>Max Subscriber Count</td><td><input ng-model=config.maxSubscriberCount class=form-table name=maxSubscriberCount></td></tr><tr><td>Named Consumer Strategy</td><td><select ng-model=config.namedConsumerStrategy class=form-table ng-options="obj.value as obj.name for obj in namedConsumerStrategies"></select></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=updateSubscription.$invalid>Update</button></li></ul></form>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.item.tpl.html",'<div ng-if=showHeader><header class=page-header><h2 class=page-title>Subscription - {{ streamId }}/{{ groupName }}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><ul style="list-style-type: none; padding:0 0 0.75rem 0 !important"><li class=page-nav__item ng-repeat="link in links"><a ng-href={{link.uri}}>{{ link.relation }}</a></li></ul></div><div ui-view es-link-header></div>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.item.viewparkedmessages.tpl.html",'<header class=page-header><h2 class=page-title>View Parked Messages - {{streamId}}::{{groupName}}</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.^.list>Back</a></li></ul></header><ul style="list-style-type: none; padding:0 0 0.75rem 0 !important"><li class=page-nav__item><a ng-click=pageFirst(entries)>First</a> <a ng-click=pageBackward(entries)>Next</a> <a ng-click=pageForward(entries)>Previous</a></li></ul><br><table><thead><tr><th>Event #</th><th>Name</th><th>Type</th><th>Created Date</th><th></th></tr></thead><tbody ng-repeat="event in entries track by event.positionEventNumber"><tr ng-class="{ \'invalid\': !event.streamId }"><td>{{ event.positionEventNumber }}</td><td>{{ event.title }}</td><td>{{ event.eventType }}</td><td>{{ event.updated | date:\'yyyy-MM-dd HH:mm:ss\'}}</td><td><a ng-click="toggleJson($event, event)" style="cursor: pointer;" ng-if="event.isJson || event.isLinkMetaData || event.isMetaData">JSON</a></td></tr><tr ng-show=event.showJson><td colspan=5><div ng-if=event.isJson><strong>Data</strong><pre>{{ event.data }}</pre></div><div ng-if=event.metaData><strong>Metadata</strong><pre>{{ event.metaData }}</pre></div><div ng-if=event.isLinkMetaData><strong>Link metadata</strong><pre>{{ event.linkMetaData }}</pre></div></td></tr></tbody></table>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.list.tpl.html",'<header class=page-header><h2 class=page-title>Dashboard</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.new>New Subscription</a></li></ul></header><table class=table-subscriptions><thead><tr><th>Stream/Group(s)</th><th>Rate (messages/s)</th><th colspan=3>Messages</th><th>Connections</th><th>Status<br># of msgs / estimated time to catchup in seconds</th><th></th></tr><tr><th></th><th></th><th class=table-subheading title="Last known event position. The value displayed in the subscription\'s header is the minimum value among all groups.">Last Known</th><th class=table-subheading title="Checkpointed event position. The value displayed in the subscription\'s header is the minimum value among all groups.">Checkpoint</th><th class=table-subheading># in Flight</th><th></th><th></th><th></th></tr></thead><tbody ng-repeat="(key, prop) in subscriptions track by key"><tr ng-if=prop.groups class=table-subheading style="cursor: pointer;" es-subscription-row-header es-subscription=prop></tr><tr ng-if=!prop.groups es-subscription-row es-subscription=prop></tr><tr ng-show=prop.show ng-repeat="item in prop.groups" class=table-indentedrow es-subscription-row es-subscription=item></tr></tbody><tbody ng-hide=subscriptions><tr><td colspan=8><em>No subscriptions</em></td></tr></tbody></table>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.new.tpl.html",'<header class=page-header><h2 class=page-title>New Subscription</h2><ul class=page-nav><li class=page-nav__item><a ui-sref=^.list>Back</a></li></ul></header><form novalidate name=newSubscription ng-submit=save() class=new-subscription-form><table><tbody><tr class=table-subheading><td colspan=2>Basic Details</td></tr><tr><td>Group</td><td><input ng-model=subscription required class=form-table name=subscription ng-class="{ \'form-table--error\' : newSubscription.subscription.$invalid && !newSubscription.subscription.$pristine }"></td></tr><tr><td>Stream</td><td><input ng-model=stream required class=form-table name=stream ng-class="{ \'form-table--error\' : newSubscription.stream.$invalid && !newSubscription.stream.$pristine }"></td></tr><tr class=table-subheading><td colspan=2>Configuration</td></tr><tr><td>Resolve Link Tos</td><td><input type=checkbox ng-model=resolveLinktos ng-disabled=resolveLinktosDisabled></td></tr><tr><td>Start From</td><td><input ng-model=startFrom class=form-table name=startFrom></td></tr><tr><td>Message Timeout (ms)</td><td><input ng-model=messageTimeoutMilliseconds class=form-table name=messageTimeoutMilliseconds></td></tr><tr><td>Extra Statistics</td><td><input type=checkbox ng-model=extraStatistics ng-disabled=extraStatisticsDisabled></td></tr><tr><td>Max Retry Count</td><td><input ng-model=maxRetryCount class=form-table name=maxRetryCount></td></tr><tr><td>Live Buffer Size</td><td><input ng-model=liveBufferSize class=form-table name=liveBufferSize></td></tr><tr><td>Buffer Size</td><td><input ng-model=bufferSize class=form-table name=bufferSize></td></tr><tr><td>Read Batch Size</td><td><input ng-model=readBatchSize class=form-table name=readBatchSize></td></tr><tr><td>CheckPoint After (ms)</td><td><input ng-model=checkPointAfterMilliseconds class=form-table name=checkPointAfterMilliseconds></td></tr><tr><td>Min CheckPoint Count</td><td><input ng-model=minCheckPointCount class=form-table name=minCheckPointCount></td></tr><tr><td>Max CheckPoint Count</td><td><input ng-model=maxCheckPointCount class=form-table name=maxCheckPointCount></td></tr><tr><td>Max Subscriber Count</td><td><input ng-model=maxSubscriberCount class=form-table name=maxSubscriberCount></td></tr><tr><td>Named Consumer Strategy</td><td><select ng-model=namedConsumerStrategy class=form-table ng-options="obj.value as obj.name for obj in namedConsumerStrategies"></select></td></tr></tbody></table><ul class=page-nav><li class=page-nav__item><button type=submit ng-disabled=newSubscription.$invalid>Create</button></li></ul></form>')}])}(),function(t){try{t=n.module("es-ui.competing.templates")}catch(e){t=n.module("es-ui.competing.templates",[])}t.run(["$templateCache",function(e){e.put("subscriptions.tpl.html","<div ui-view></div>")}])}()}),define("modules/competing/_index",["angular","uiRouter","./controllers/_index","./services/_index","./directives/_index","./templates/templates"],function(e){"use strict";return e.module("es-ui.competing",["ui.router","es-ui.competing.templates","es-ui.competing.controllers","es-ui.competing.services","es-ui.competing.directives"])}),define("modules/competing/module",["./_index"],function(e){"use strict";return e.config(["$stateProvider",function(e){e.state("subscriptions",{parent:"app",url:"subscriptions",templateUrl:"subscriptions.tpl.html",abstract:!0,data:{title:"Competing Consumers"}}).state("subscriptions.list",{url:"",templateUrl:"subscriptions.list.tpl.html",controller:"SubscriptionsListCtrl",data:{title:"Subscriptions"}}).state("subscriptions.new",{url:"/new",templateUrl:"subscriptions.new.tpl.html",controller:"SubscriptionsNewCtrl",data:{title:"New Subscription"}}).state("subscriptions.item",{url:"/{streamId}/{groupName}",templateUrl:"subscriptions.item.tpl.html",abstract:!0,controller:["$scope","$stateParams",function(e,t){e.streamId=t.streamId,e.groupName=t.groupName,e.showHeader=!0}],data:{title:"Subscriptions"}}).state("subscriptions.item.detail",{url:"",templateUrl:"subscriptions.item.detail.tpl.html",controller:"SubscriptionsDetailCtrl",data:{title:"Subscription Detail"}}).state("subscriptions.item.edit",{url:"/edit",templateUrl:"subscriptions.item.edit.tpl.html",controller:"SubscriptionsEditCtrl",data:{title:"Edit Subscription"}}).state("subscriptions.item.delete",{url:"/delete",templateUrl:"subscriptions.item.delete.tpl.html",controller:"SubscriptionsDeleteCtrl",data:{title:"Delete Subscription"}}).state("subscriptions.item.viewparkedmessages",{url:"/viewparkedmessages/",templateUrl:"subscriptions.item.viewparkedmessages.tpl.html",controller:"SubscriptionsViewParkedMessagesCtrl",data:{title:"View Parked Messages Subscription"}})}])}),function(e,c,t){"use strict";c.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(t,r){var n,s={},o={},i=!1,a=c.copy,l=c.isUndefined;return r.addPollFn(function(){var e=r.cookies();n!=e&&(a(n=e,o),a(e,s),i&&t.$apply())})(),i=!0,t.$watch(function(){var e,t,n,i;for(e in o)l(s[e])&&(r.cookies(e,void 0),delete o[e]);for(e in s)t=s[e],c.isString(t)||(t=""+t,s[e]=t),t!==o[e]&&(r.cookies(e,t),o[e]=t,i=!0);if(i)for(e in n=r.cookies(),s)s[e]!==n[e]&&(l(n[e])?(delete s[e],delete o[e]):s[e]=o[e]=n[e])}),s}]).factory("$cookieStore",["$cookies",function(n){return{get:function(e){var t=n[e];return t?c.fromJson(t):t},put:function(e,t){n[e]=c.toJson(t)},remove:function(e){delete n[e]}}}])}(window,window.angular),define("ngCookies",["angular"],function(e){return function(){return e.ngCookies}}(this)),define("services/_module",["angular","ngCookies"],function(e){"use strict";return e.module("es-ui.services",["ngCookies"])}),define("services/Uri",["./_module"],function(e){"use strict";return e.factory("uri",function(){var i;return{parse:function(e){return i||(i=document.createElement("a")),i.href=e,{hash:i.hash,host:i.host,hostname:i.hostname,href:e,pathname:i.pathname,port:i.port,protocol:i.protocol,search:i.search,file:i.pathname.split("/").pop(),params:(t=i.search,r={},n=new RegExp("([^?=&]+)(=([^&]*))?","g"),t.replace(n,function(e,t,n,i){r[t]=i}),r)};var t,r,n},getQuery:function(e){var t,n=[];for(t in e)n.push(t+"="+encodeURIComponent(e[t]));return n.join("&")}}})}),define("services/Base64",["./_module"],function(e){"use strict";return e.factory("Base64",["MessageService",function(c){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(e){for(var t,n,i,r,s,o="",a="",l="",c=0;i=(t=e.charCodeAt(c++))>>2,r=(3&t)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(a=e.charCodeAt(c++))>>6,l=63&a,isNaN(n)?s=l=64:isNaN(a)&&(l=64),o=o+u.charAt(i)+u.charAt(r)+u.charAt(s)+u.charAt(l),t=n=a="",i=r=s=l="",c<e.length;);return o},decode:function(e){var t,n,i,r,s="",o="",a="",l=0;for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&c.failure("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=u.indexOf(e.charAt(l++))<<2|(i=u.indexOf(e.charAt(l++)))>>4,n=(15&i)<<4|(r=u.indexOf(e.charAt(l++)))>>2,o=(3&r)<<6|(a=u.indexOf(e.charAt(l++))),s+=String.fromCharCode(t),64!==r&&(s+=String.fromCharCode(n)),64!==a&&(s+=String.fromCharCode(o)),t=n=o="",i=r=a="",l<e.length;);return s}}}])}),define("services/Poller",["./_module"],function(e){"use strict";return e.factory("poller",["$timeout","$q",function(i,t){var n=[];function r(e){this.deferred=t.defer(),this.opts=e,this.canceller=null,this.isPaused=!1}function e(){for(var e=0,t=n.length;e<t;e++)n[e].stop()}return r.prototype={resumePaused:function(){this.isPaused=!1,this.resume()},resume:function(){var n=this;n.isPaused||(n.canceller=t.defer(),function t(){var e=n.opts.params.slice();n.canceller&&(e.push({timeout:n.canceller.promise}),n.opts.action.apply(null,e).then(function(e){n.intervalId=i(t,n.opts.interval),n.deferred.notify(e.data)},function(e){n.deferred.reject(e)}))}())},start:function(){return this.resume(),this.promise=this.deferred.promise,this},pause:function(){this.canceller&&this.canceller.resolve("pausing"),i.cancel(this.intervalId),this.isPaused=!0},stop:function(){i.cancel(this.intervalId),this.canceller&&(this.canceller.resolve("pausing"),this.canceller=null)},update:function(e){e.interval=e.interval||this.opts.interval,e.params=e.params||this.opts.params,e.action=this.opts.action,this.opts=e}},{create:function(e){var t=new r(e);return n.push(t),t},stopAll:e,pauseAll:function(){for(var e=0,t=n.length;e<t;e++)n[e].pause()},resumePaused:function(){for(var e=0,t=n.length;e<t;e++)n[e].resumePaused()},clear:function(){e(),n=[]},resume:function(){for(var e=0,t=n.length;e<t;e++)n[e].resume()}}}])}),define("services/UrlBuilder",["./_module","angular"],function(e,s){"use strict";return e.factory("UrlBuilder",["urls","$rootScope","SprintfService",function(e,i,r){return{simpleBuild:function(e,t){return r.format(e,decodeURIComponent(t))},buildWithoutBaseUrl:function(e){var t=[].slice.call(arguments,1),n=[];return n.push(e),s.forEach(t,function(e){this.push(encodeURIComponent(e))},n),e=r.format.apply(null,n)},build:function(e){var t=[].slice.call(arguments,1),n=[];return n.push(e),s.forEach(t,function(e){this.push(encodeURIComponent(e))},n),e=r.format.apply(null,n),i.baseUrl+e}}}])}),function(e){var m={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function v(){var e=arguments[0],t=v.cache;return t[e]&&t.hasOwnProperty(e)||(t[e]=v.parse(e)),v.format.call(null,t[e],arguments)}v.format=function(e,t){var n,i,r,s,o,a,l,c,u=1,h=e.length,d="",f=[],p=!0,g="";for(i=0;i<h;i++)if("string"===(d=$(e[i])))f[f.length]=e[i];else if("array"===d){if((s=e[i])[2])for(n=t[u],r=0;r<s[2].length;r++){if(!n.hasOwnProperty(s[2][r]))throw new Error(v("[sprintf] property '%s' does not exist",s[2][r]));n=n[s[2][r]]}else n=s[1]?t[s[1]]:t[u++];if("function"==$(n)&&(n=n()),m.not_string.test(s[8])&&m.not_json.test(s[8])&&"number"!=$(n)&&isNaN(n))throw new TypeError(v("[sprintf] expecting number but found %s",$(n)));switch(m.number.test(s[8])&&(p=0<=n),s[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s[6]?parseInt(s[6]):0);break;case"e":n=s[7]?n.toExponential(s[7]):n.toExponential();break;case"f":n=s[7]?parseFloat(n).toFixed(s[7]):parseFloat(n);break;case"g":n=s[7]?parseFloat(n).toPrecision(s[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&s[7]?n.substring(0,s[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}m.json.test(s[8])?f[f.length]=n:(!m.number.test(s[8])||p&&!s[3]?g="":(g=p?"+":"-",n=n.toString().replace(m.sign,"")),a=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",l=s[6]-(g+n).length,o=s[6]&&0<l?(c=a,Array(l+1).join(c)):"",f[f.length]=s[5]?g+n+o:"0"===a?g+o+n:o+g+n)}return f.join("")},v.cache={},v.parse=function(e){for(var t=e,n=[],i=[],r=0;t;){if(null!==(n=m.text.exec(t)))i[i.length]=n[0];else if(null!==(n=m.modulo.exec(t)))i[i.length]="%";else{if(null===(n=m.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){r|=1;var s=[],o=n[2],a=[];if(null===(a=m.key.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s[s.length]=a[1];""!==(o=o.substring(a[0].length));)if(null!==(a=m.key_access.exec(o)))s[s.length]=a[1];else{if(null===(a=m.index_access.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");s[s.length]=a[1]}n[2]=s}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=n}t=t.substring(n[0].length)}return i};var t=function(e,t,n){return(n=(t||[]).slice(0)).splice(0,0,e),v.apply(null,n)};function $(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}"undefined"!=typeof exports?(exports.sprintf=v,exports.vsprintf=t):(e.sprintf=v,e.vsprintf=t,"function"==typeof define&&define.amd&&define("sprintf",[],function(){return{sprintf:v,vsprintf:t}}))}("undefined"==typeof window?this:window),define("services/SprintfService",["./_module","sprintf"],function(e,t){"use strict";return e.factory("SprintfService",[function(){return{format:function(){var e=[].slice.call(arguments);return t.sprintf.apply(null,e)}}}])}),define("services/AuthService",["./_module"],function(e){"use strict";return e.factory("AuthService",["Base64","$q","$cookies","$cookieStore","$http","$rootScope","$location","urls","UrlBuilder",function(o,s,a,l,c,u,e,i,t){function h(){var e=l.get("es-creds");return e?e.credentials:null}var n=h();return n&&(n=n.credentials),{setCredentials:function(e,t){var n,i,r,s=o.encode(e+":"+t);c.defaults.headers.common.Authorization="Basic "+s,n=e,i=t,(r=l.get("es-creds"))||(r={}),r={credentials:o.encode(n+":"+i)},l.put("es-creds",r)},loadCredentials:function(){var e=h();e&&(c.defaults.headers.common.Authorization="Basic "+e)},clearCredentials:function(){document.execCommand("ClearAuthenticationCache"),c.defaults.headers.common.Authorization=void 0,l.remove("es-creds")},existsAndValid:function(){var e,t=s.defer();if("insecure"===u.authentication.type)t.resolve();else if("oauth"===u.authentication.type){(e=a.oauth_id_token)&&(document.cookie="oauth_id_token=;path=/;max-age=-1",c.defaults.headers.common.Authorization="Bearer "+e);var n=c.defaults.headers.common.Authorization;void 0!==n&&n.startsWith("Bearer ")?t.resolve():t.reject("Not authenticated")}else{var i=h();if(i){var r=o.decode(i).split(":");this.validate(r[0],r[1]).success(function(){t.resolve()}).error(function(){t.reject("Wrong credentials")})}else t.reject("Data does not exists")}return t.promise},resetCredentials:function(e,t){var n=s.defer(),i=h();return o.decode(i).split(":")[0]===e?this.validate(e,t).success(function(){n.resolve()}).error(function(){n.reject("Wrong credentials")}):n.resolve(),n.promise},validate:function(e,t){var n=o.encode(e+":"+t);return c.defaults.headers.common.Authorization="Basic "+(n||""),c.get(u.baseUrl+i.system.info,{headers:{Accept:"*/*",Authorization:"Basic "+n}})}}}])}),define("services/InfoService",["./_module"],function(e){"use strict";return e.factory("InfoService",["$http","$rootScope","urls","UrlBuilder",function(t,e,n,i){return{getInfo:function(){var e=i.build(n.system.info);return t.get(e)},getOptions:function(){var e=i.build(n.system.options);return t.get(e)}}}])}),define("services/MessageService",["./_module"],function(e){"use strict";return e.factory("MessageService",["toastr",function(n){function i(e,t){return{closeButton:!!e||"warning"===t,positionClass:e?"toast-container-modal toast-bottom-full-width":"toast-bottom-full-width",timeOut:e?0:"warning"===t?5e3:"info"===t||"success"===t?2e3:0}}function r(e,t){return(e=e||t)+" (tap notification to dismiss)"}return{success:function(e,t){n.success(e,r(t,"Success"),i(!1,"success"))},info:function(e,t){n.info(e,r(t,"Info"),i(!1,"info"))},warn:function(e,t){n.warning(e,r(t,"Warning"),i(!1,"warning"))},failure:function(e,t){n.error(e,r(t,"Failure"),i(!0,"failure"))},confirm:function(e){return confirm(e)}}}])}),define("services/ScavengeNotificationService",["./_module"],function(e){"use strict";return e.factory("ScavengeNotificationService",["$http","$timeout","$rootScope","AdminService","MessageService","constants",function(e,n,t,i,r,s){var o="";return{start:function t(){i.lastScavengeStatus().then(function(e){0<e.data.entries.length&&(o=e.data.entries[0].eventId);var t=function(){i.lastScavengeStatus().then(function(e){!function(e){if(e.data&&0<e.data.entries.length){var t=e.data.entries[0];if(t.eventId!==o){o=t.eventId;var n=JSON.parse(t.data),i="Scavenge "+n.scavengeId;"$scavengeStarted"===t.eventType?(i+=" initiated",r.success(i)):n.error?(i+=" failed",r.failure(i)):("Stopped"===n.result?i+=" stopped":i+=" completed",r.success(i))}}}(e),n(function(){t()},s.scavengeStatus.pollInterval)},function(e){401!==e.statusCode&&r.failure("Failed to retrieve last scavenge status: "+e.message)})};t()},function(e){401!==e.statusCode&&(404===e.statusCode?n(function(){t()},s.scavengeStatus.pollInterval):r.failure("Failed to retrieve last scavenge status: "+e.message))})}}}])}),define("services/_index",["./Uri","./Base64","./Poller","./UrlBuilder","./SprintfService","./AuthService","./InfoService","./MessageService","./ScavengeNotificationService"],function(){}),define("directives/_module",["angular"],function(e){"use strict";return e.module("es-ui.directives",[])}),define("directives/EsValidateEquals",["./_module"],function(e){"use strict";return e.directive("esValidateEquals",[function(){return{restrict:"A",require:"ngModel",link:function(t,e,n,i){function r(e,t){return e===t?(i.$setValidity("equal",!0),e):void i.$setValidity("equal",!1)}t.$watch(n.esValidateEquals,function(e){r(i.$viewValue,e)}),i.$parsers.unshift(function(e){return r(e,t.$eval(n.esValidateEquals))}),i.$formatters.unshift(function(e){return r(e,t.$eval(n.esValidateEquals))})}}}])}),define("directives/EsHeight",["./_module"],function(e){"use strict";return e.directive("esHeight",[function(){return{restrict:"A",link:function(e,t){t.parent().addClass("login-height")}}}])}),define("directives/EsAutoFocus",["./_module"],function(e){"use strict";return e.directive("esAutoFocus",["$timeout",function(n){return{restrict:"AC",link:function(e,t){n(function(){t[0].focus()},0)}}}])}),define("directives/_index",["./EsValidateEquals","./EsHeight","./EsAutoFocus"],function(){}),define("templates/templates",["angular"],function(n){"use strict";!function(t){try{t=n.module("es-ui.templates")}catch(e){t=n.module("es-ui.templates",[])}t.run(["$templateCache",function(e){e.put("es-toggable-row.tpl.html",'<td ng-if=esQueue.show>{{ esQueue.queueName }} <a class=table-collapsetoggle>&minus;</a></td><td ng-if=!esQueue.show>{{ esQueue.queueName }} <a class=table-collapsetoggle>&plus;</a></td><td>{{ esQueue.lengthCurrentTryPeak }}</td><td>{{ esQueue.lengthLifetimePeak }}</td><td>{{ esQueue.avgItemsPerSecond }}</td><td>{{ esQueue.avgProcessingTime.toFixed(3)}}</td><td>{{ esQueue.busy }}</td><td>{{ esQueue.totalItemsProcessed }}</td><td style="text-align: right">n/a</td>')}])}(),function(t){try{t=n.module("es-ui.templates")}catch(e){t=n.module("es-ui.templates",[])}t.run(["$templateCache",function(e){e.put("index.tpl.html","<header class=site-header><h1 class=site-title><a ui-sref=dashboard.list><img src=images/logo.svg height=29 width=119 alt=\"Event Store\"></a></h1><ul class=site-nav ng-hide=hideMenuOptions><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('dashboard') }\"><a ui-sref=dashboard.list>Dashboard</a></li><li ng-if=!singleNode class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('clusterstatus') }\"><a ui-sref=clusterstatus.list>Cluster Status</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('streams') }\" title=\"{{!streamsBrowserEnabled ? atomDisabledMessage : ''}}\"><a ng-class=\"{'disabled':!streamsBrowserEnabled}\" ui-sref=streams.list>Stream Browser</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('projections') }\" title=\"{{!projectionsEnabled ? projectionsNotRunningMessage : ''}}\"><a ng-class=\"{'disabled': !projectionsEnabled}\" ui-sref=projections.list>Projections</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('query') }\" title=\"{{!projectionsEnabled ? projectionsNotRunningMessage : ''}}\"><a ng-class=\"{'disabled':!projectionsEnabled}\" ui-sref=query>Query</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('competing') }\"><a ui-sref=subscriptions.list>Persistent Subscriptions</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('admin') }\"><a ui-sref=admin>Admin</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('users') }\"><a ng-class=\"{'disabled': !userManagementEnabled}\" ui-sref=users.list>Users</a></li><li class=site-nav__item ng-class=\"{'site-nav__item--active': $state.includes('signout') }\"><a ng-class=\"{'disabled': !logoutEnabled}\" ui-sref=signout>{{ logoutButtonText }}</a></li></ul></header><main class=site-main><div ui-view></div></main><footer class=site-footer><p>Event Store {{ esVersion }} &middot; <a href=https://eventstore.com/docs/ target=_blank>Documentation</a> &middot; <a href=https://eventstore.com/support/ target=_blank>Support</a></p></footer>")}])}()}),define("templates/_index",["./templates"],function(){}),define("es-ui",["angular","uiRouter","uiUtils","uiAce","ngToastr","angular-clipboard","./modules/projections/module","./modules/admin/module","./modules/dashboard/module","./modules/clusterstatus/module","./modules/streams/module","./modules/security/module","./modules/users/module","./modules/competing/module","./services/_index","./directives/_index","./templates/_index"],function(e){"use strict";return e.module("es-ui",["es-ui.projections","es-ui.admin","es-ui.dashboard","es-ui.clusterstatus","es-ui.streams","es-ui.users","es-ui.competing","es-ui.security","es-ui.directives","es-ui.services","es-ui.templates","ui.router","ui.utils","ui.ace","toastr","angular-clipboard"])}),define("run",["es-ui"],function(e){"use strict";return e.config(["toastrConfig",function(e){angular.extend(e,{timeOut:0,preventDuplicates:!0})}]),e.run(["$rootScope","$location","$state","$stateParams","AuthService","InfoService","MessageService","$http",function(u,n,i,e,r,s,h,d){u.baseUrl=n.protocol()+"://"+n.host()+":"+n.port(),u.projectionsEnabled=!1,u.userManagementEnabled=!1,u.streamsBrowserEnabled=!1,u.initialized=!1,u.logoutEnabled=!0,u.logoutButtonText="Log Out",u.logoutText="You have been logged out.",u.singleNode=!0,r.loadCredentials(),s.getInfo().then(function(e){var t=e.data;u.esVersion=t.esVersion||"0.0.0.0",u.esVersion="0.0.0.0"===u.esVersion?"development build":u.esVersion,u.projectionsEnabled=!0===t.features.projections,u.userManagementEnabled=!0===t.features.userManagement,u.streamsBrowserEnabled=!0===t.features.atomPub,u.authentication=t.authentication,u.logoutEnabled="insecure"!==t.authentication.type,u.logoutButtonText="oauth"===t.authentication.type?"Disconnect":u.logoutButtonText,u.logoutText="oauth"===t.authentication.type?"You have been disconnected.":u.logoutText,u.previousUrl=n.$$path,u.initialized=!0,u.$broadcast("initialized"),r.existsAndValid().then(function(){s.getOptions().then(function(e){var t=e.data;for(var n in t)"ClusterSize"===t[n].name&&1<t[n].value&&(u.singleNode=!1)},function(e){401!==e.statusCode&&h.failure("Failed to load options: "+e.message)}),function(){if(u.previousUrl&&"/"!==u.previousUrl){var e=u.previousUrl;u.previousUrl=null,n.path(e)}else i.go("dashboard.list")}()},function(){if("oauth"===u.authentication.type){var o=u.authentication.properties.authorization_endpoint,a=encodeURIComponent(u.authentication.properties.client_id),l=encodeURIComponent(u.authentication.properties.response_type),c=encodeURIComponent(u.authentication.properties.scope),e=u.baseUrl+u.authentication.properties.code_challenge_uri;d.get(e).then(function(e){var t=e.data.code_challenge,n=e.data.code_challenge_method,i={code_challenge_correlation_id:e.data.code_challenge_correlation_id};i=btoa(JSON.stringify(i));var r=encodeURIComponent(u.baseUrl+u.authentication.properties.redirect_uri),s=o+"?response_type="+l+"&client_id="+a+"&redirect_uri="+r+"&scope="+c+"&code_challenge="+t+"&code_challenge_method="+n+"&state="+i;window.location.href=s},function(){h.failure("Could not fetch OAuth code challenge")})}else i.go("signin")})},function(e){h.failure("Failed to load /info endpoint: "+e.message),r.clearCredentials()}),u.$state=i,u.$stateParams=e}])}),define("config/constants",["es-ui"],function(e){"use strict";return e.constant("constants",{projectionStatus:{running:"Running",stopped:"Stopped"},scavengeStatus:{pollInterval:2e3},tcpStats:{pollInterval:1e3},clusterStatus:{replicaPollInterval:1e3}})}),define("config/urls",["es-ui"],function(e){"use strict";return e.value("baseUrl",""),e.constant("urls",{base:"https://127.0.0.1:2113",stats:"/stats",tcpStats:"/stats/tcp",replicationStats:"/stats/replication",admin:{shutdown:"/admin/shutdown",scavenge:"/admin/scavenge",login:"/admin/login"},gossip:"/gossip",users:{list:"/users/",get:"/users/%s",current:"/users/$current",create:"/users/",update:"/users/%s",remove:"/users/%s",disable:"/users/%s/command/disable",enable:"/users/%s/command/enable",resetPassword:"/users/%s/command/reset-password"},query:{create:"/projections/transient?",update:"%s/query?emit=no",state:"%s/state",commands:{enable:"%s/command/enable",disable:"%s/command/disable",reset:"%s/command/reset"}},projections:{any:"/projections/any",allNonTransient:"/projections/all-non-transient",disable:"/command/disable",enable:"/command/enable",create:"/projections/%s?",createStandard:"/projections/continuous?emit=yes&checkpoints=yes&enabled=yes&name=%s&type=%s",state:"%s/state",result:"%s/result",statistics:"%s/statistics",remove:"%s?",query:"%s/query?config=yes",updateQuery:"%s/query?emit=",updatePlainQuery:"%s/query",queryWithoutConfig:"%s/query?config=no",readEvents:"/projections/read-events",commands:{reset:"%s/command/reset",enable:"%s/command/enable",disable:"%s/command/disable"},configuration:"%s/config"},streams:{base:"%s",recent:"/streams/$all/head/100?embed=rich",created:"/streams/$streams/head/50?embed=rich",events:"/streams/%s",eventDetails:"/streams/%s/%s?embed=tryharder",tryharder:"?embed=tryharder",metadata:"/streams/%s%s/head",updateAcl:"/streams/$$%s",scavenges:"/streams/$scavenges"},system:{subsystems:"/sys/subsystems",info:"/info",options:"/info/options"},competing:{subscriptions:"/subscriptions",subscriptionDetails:"/subscriptions/%s/%s/info",create:"/subscriptions/%s/%s",update:"/subscriptions/%s/%s",delete:"/subscriptions/%s/%s",replayParked:"/subscriptions/%s/%s/replayParked",parkedQueue:"$persistentsubscription-%s::%s-parked",viewParkedMessagesBackward:"/subscriptions/viewparkedmessages/%s/%s/%s/backward/%s?embed=tryharder",viewParkedMessagesForward:"/subscriptions/viewparkedmessages/%s/%s/%s/forward/%s?embed=tryharder"}})}),define("config/values",["es-ui"],function(e){"use strict";return e.value("baseUrl",{})}),define("config/http",["es-ui"],function(e){"use strict";return e.config(["$httpProvider",function(e){e.defaults.headers.common.Accept="application/json",e.defaults.headers.get={"ES-LongPoll":5},e.interceptors.push(["$q",function(s){return{responseError:function(e){var t=s.defer(),n={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",409:"Conflict",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"},i={message:"Unknown error",statusCode:e.status,errorData:e.data},r=e.headers()["content-type"];return r&&-1!==r.indexOf("text/plain")&&""!==e.data?i.message=e.data:""!==e.statusText?i.message=e.statusText:e.status in n&&(i.message=n[e.status]),t.reject(i),t.promise}}}])}])}),define("config/qDecorator",["es-ui"],function(e){"use strict";return e.config(["$stateProvider","$urlRouterProvider","$httpProvider","$provide",function(e,t,n,i){i.decorator("$q",["$delegate",function(e){var a=e;return a.allSettled=a.allSettled||function(e){var n=a.defer();if(!angular.isArray(e))throw"allSettled can only handle an array of promises (for now)";var i=[],r=[],s=!1;angular.forEach(e,function(e,t){i[t]=!1});var o=function(e,t,n,i){var r=!0;angular.forEach(e,function(e){e||(r=!1)}),r&&(i?n.reject(t):n.resolve(t))};return angular.forEach(e,function(e,t){a.when(e).then(function(e){i[t]=!0,r[t]=e,o(i,r,n,s)},function(e){i[t]=!0,r[t]=e,o(i,r,n,s=!0)})}),n.promise},a}])}])}),define("config/routes",["es-ui"],function(e){"use strict";return e.config(["$stateProvider","$urlRouterProvider",function(e,t){t.otherwise("/"),e.state("app",{url:"/",templateUrl:"index.tpl.html",abstract:!0,controller:["$scope",function(e){e.notAdminMessage="You must be an admin to view this item",e.notAdminOrOpsMessage="You must be in the $admins or $ops group to view this item",e.projectionsNotRunningMessage="Projections are not running on Event Store",e.atomDisabledMessage="AtomPub over HTTP has been disabled on the server"}]})}])}),define("domReady",[],function(){"use strict";var e,t,n,i="undefined"!=typeof window&&window.document,r=!i,s=i?document:null,o=[];function a(){var e=o;r&&e.length&&(o=[],function(e){var t;for(t=0;t<e.length;t+=1)e[t](s)}(e))}function l(){r||(r=!0,n&&clearInterval(n),a())}if(i){if(document.addEventListener)document.addEventListener("DOMContentLoaded",l,!1),window.addEventListener("load",l,!1);else if(window.attachEvent){window.attachEvent("onload",l),t=document.createElement("div");try{e=null===window.frameElement}catch(e){}t.doScroll&&e&&window.external&&(n=setInterval(function(){try{t.doScroll(),l()}catch(e){}},30))}"complete"===document.readyState&&l()}function c(e){return r?e(s):o.push(e),c}return c.version="2.0.1",c.load=function(e,t,n,i){i.isBuild?n(null):c(n)},c}),define("bootstrap",["require","angular","es-ui","run","./config/constants","./config/urls","./config/values","./config/http","./config/qDecorator","./config/routes"],function(e,t){"use strict";e(["domReady!"],function(e){t.bootstrap(e,["es-ui"])})}),define("es-dist-main",["bootstrap","ace"],function(e,t){var n=ace.require("ace/config"),i="js/ace";n.set("packaged",!0),n.set("workerPath",location.href.replace(location.hash,"").replace("index.html","")+i),n.set("modePath",i),n.set("themePath",i),n.set("basePath",i)}),require(["es-dist-main"]);