/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):(t="undefined"!=typeof globalThis?globalThis:t||self,n(t.exontrol={}))}(this,function(t){"use strict";function n(t){return null!=t}function i(t){return null==t}function e(t){return t&&W(t.x,t[0])||0}function r(t){return t&&W(t.y,t[1])||0}function o(t){return t instanceof Array}function s(t){return"string"==typeof t}function h(t){return K.N.IsN(t)}function a(t){return K.N.IsInt(t)}function u(t){return t instanceof Map}function c(t){return t instanceof K.Arr}function l(t){return t instanceof Function}function f(t){return t instanceof Date}function g(t){return t instanceof Object}function d(t){return t instanceof HTMLCanvasElement}function v(t){return t instanceof HTMLInputElement}function p(t){return t instanceof HTMLSelectElement}function C(){var t=Date.Now();return t.setUTCHours(0,0,0,0),t}function S(){return Math.max.apply(0,arguments)}function m(){return Math.min.apply(null,arguments)}function E(t){return Math.abs(t)}function A(t){return t.toLowerCase()}function w(t){return t.toLocaleLowerCase()}function R(t){return t.toUpperCase()}function b(t){return t.toLocaleUpperCase()}function T(t,n,i){return t.substr(n,i)}function y(t,n,i){return t.indexOf(n,i)}function O(t){return t.trim()}function D(t){return Math.round(t)}function P(t,n){return K.ToS(t,n)}function W(t,n){return K.ToN(t,n)}function I(t,n){return K.ToI(t,n)}function L(t,n){return K.ToB(t,n)}function M(t,n,e){return i(t)?~~e:K.s2F(t,n)}function G(t,n){return t.measureText(n).width}function H(t,n,i){return K.bin(n.length,function(e){return G(t,T(n,0,e))=r)for(;e&&othis.length)&&(n=this.length),e(T(this,n-t.length,n))==e(t)}function B(t){return t.exontrol=t.exontrol||{}}function z(t){return t.exontrol=t.exontrol||{}}function U(t){return t&&t.exontrol||null}function V(t){var n,i=1;return t?~(n=y("[]*?#",t))&&(i=n+2):i=7,i}var K=K||{version:"3.0"},Q=new Date(2018,0,1,6,0,0),q=new Date(2018,0,1,18,0,0),_=!0,Z="",Y=",",j=" ",J="#",$="/",tt=":",nt=";",it="=",et="<",rt=">",ot=".",st="...",ht="0123456789ABCDEF",at="0",ut="\\",ct="'",lt=Math.PI,ft=2*lt-lt/3600,gt=32768,dt=Date.prototype,vt=String.prototype,pt=Array.prototype,Ct=CanvasRenderingContext2D.prototype;Object.addPrototypeOf=function(t,n){for(var i=t,e=this.getPrototypeOf(i);e!==Object.prototype;e=this.getPrototypeOf(i))i=e;return this.setPrototypeOf(i,n),t},Math.trunc||(Math.trunc=function(t){return t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t}),Math.sign||(Math.sign=function(t){return(t>0)-(t<0)||+t}),vt.sWith=vt.startsWith=function(t,n){return F.call(this,t,n)},vt.sWithI=function(t,n){return F.call(this,t,n,w)},vt.eWith=vt.endsWith=function(t,n){return N.call(this,t,n)},vt.eWithI=function(t,n){return N.call(this,t,n,w)},vt.expTab=function(){return this.replace(/\t/g,_?" ":Z)},vt.countOf=function(t){var n=t.length,i=0,e=-n;if(n)for(;-1!=(e=y(this,t,e+n));)i++;return i},vt.repAll=function(t,n){var i=Z,e=0,r=-1,o=t.length;if(o)for(;~(r=y(this,t,e));)i+=T(this,e,r-e)+n,e=r+o;return i+=T(this,e)},vt.toProper=function(){return b(this.charAt(0))+w(T(this,1))},vt.toReverse=function(){for(var t=Z,n=this.length-1;n>=0;n--)t+=this.charAt(n);return t},vt.ltrim=function(){for(var t=this.length,n=0;n=0;)n++;return T(this,n)},vt.rtrim=function(){for(var t=this.length-1;t>=0&&-1!=y("\t ",this.charAt(t));)t--;return T(this,0,t+1)},vt.splitP=function(t,n,e){function r(t){return i(n)||t.length=0&&(g+=d0?-1:0),u+=a}return r(o)&&o.push(h?u:this),o},Date.Now=function(){return new Date(Date.now())},Date.Today=C,Date.Create=function(t,i,e,r,o,h){var a,u=Date.Now();return n(t)&&(s(t)?u=f(a=K.P(t).getValue())&&a||Date.Parse(t)||u:f(t)?u=Date.Copy(t):(u=new Date(Date.UTC(t,i-1||0,e||1,r||0,o||0,h||0,0)),t<100&&u.setFullYear(t))),u},Date.Parse=function(t){return t=Date.parse(t),!isNaN(t)&&new Date(t)||null},Date.Copy=function(t){return t.copy()},Date.Date=function(t){return f(t)||(t=new Date(t)),(t=Date.Copy(t)).setUTCHours(0,0,0,0),t},Date.SetHObj=function(t){return K.H.SetEObj(function(n,i){return K.HF.Date.Evaluate(t,n,i)},t)},Date.ResHObj=function(t){K.H.SetEObj(t)},Date.IsWknd=function(t,n){var i=!1;return n&&!(i=!t)&&n>1&&!(i=6==t)&&n>2&&(i=t>K.days-n),i},Date.Conv=function(){var t=function(){var t=new Map,n=31536e3;return t.set(0,n),t.set(1,n/2),t.set(2,7884e3),t.set(16,2628e3),t.set(17,876e3),t.set(256,604800),t.set(4096,86400),t.set(65536,3600),t.set(1048576,60),t.set(16777216,1),t}();return function(n,i,e){return n&&i!=e&&(n*=t.get(i)/t.get(e)),n}}(),dt.gH2=function(){return this.getTime()+nt+K.Loc.Get().language},dt.isValid=function(){return!isNaN(this.valueOf())},dt.toString=function(){return this.toUTCString()},dt.toFormat=function(){var t=J;return t+=this.GetMonth(),t+=$,t+=this.GetDay(),t+=$,t+=this.GetYear(),(this.GetHour()||this.GetMinute()||this.GetSecond())&&(t+=j,t+=K.Pad0(this.GetHour(),2),t+=tt,t+=K.Pad0(this.GetMinute(),2),t+=tt,t+=K.Pad0(this.GetSecond(),2)),t+=J},dt.toLocDS=function(t,n){return this.toLocaleDateString(t,n)},dt.toLocTS=function(t,n){return this.toLocaleTimeString(t,n)},dt.copy=function(){return new Date(this.getTime())},dt.yDay=function(){return D((Date.Date(this)-Date.Create(this.GetYear()))/K.msday)},dt.add=function(t){return t&&this.setTime(this.getTime()+t),this},dt.addD=function(t){return this.add((t||0)*K.msday)},dt.SetDate=function(t,n,i,e,r,o){return this.setTime(Date.Create(t,n,i,e,r,o).getTime()),this},dt.GetYear=function(){return this.getUTCFullYear()},dt.SetYear=function(t){return this.setUTCFullYear(t),this},dt.GetHalfYear=function(){return Math.trunc((this.GetMonth()-1)/6)},dt.GetQuarterYear=function(){return Math.trunc((this.GetMonth()-1)/3)},dt.GetMonth=function(){return this.getUTCMonth()+1},dt.SetMonth=function(t){return this.setUTCMonth(t-1),this},dt.GetThirdMonth=function(){return m(2,Math.trunc(S(0,this.GetDay()-1)/10))},dt.GetDay=function(){return this.getUTCDate()},dt.SetDay=function(t){return this.setUTCDate(t),this},dt.GetWeekDay=function(){return this.getUTCDay()},dt.GetYearDay=function(){return 1+this.yDay()},dt.GetHour=function(){return this.getUTCHours()},dt.SetHour=function(t){return this.setUTCHours(t),this},dt.IsAM=function(){return this.GetHour()<12},dt.GetHourAM=function(){var t=this.GetHour();return 0==(t=t<12?t:t-12)?12:t},dt.GetMinute=function(){return this.getUTCMinutes()},dt.SetMinute=function(t){return this.setUTCMinutes(t),this},dt.GetSecond=function(){return this.getUTCSeconds()},dt.SetSecond=function(t){return this.setUTCSeconds(t),this},Date.U2N=function(t){return K.f2S(t,K.UnitEnum)},Date.S2I=function(t){return I(t,1)},dt.CbkN=function(t){return this[Date.U2N(t).replace("ex","Next")]},dt.Next=function(t,n){var i=this.CbkN(t);return i&&i.call(this,n)||this},dt.CbkP=function(t){return this[Date.U2N(t).replace("ex","Prev")]},dt.Prev=function(t,n){var i=this.CbkP(t);return i&&i.call(this,n)||this},dt.GetUnit=function(t){var n=Date.U2N(t).replace("ex","Get");return this[n]&&this[n]()},dt.Reset=function(t){var n=this.GetYear();switch(t){case 0:this.SetDate(n,1,1,0,0,0,0);break;case 1:this.SetDate(n,1+6*this.GetHalfYear(),1,0,0,0,0);break;case 2:this.SetDate(n,1+3*this.GetQuarterYear(),1,0,0,0,0);break;case 16:this.SetDate(n,this.GetMonth(),1,0,0,0,0);break;case 17:this.SetDate(n,this.GetMonth(),10*this.GetThirdMonth()+1,0,0,0,0);break;case 256:this.SetDate(n,this.GetMonth(),this.GetDay(),0,0,0,0),this.PrevDay(this.WeekOff());break;case 4096:this.setUTCHours(0,0,0,0);break;case 65536:this.setUTCMinutes(0,0,0);break;case 1048576:this.setUTCSeconds(0,0);break;case 16777216:this.setUTCMilliseconds(0)}return this},dt.NextYear=function(t){return(t=Date.S2I(t))&&this.SetYear(this.GetYear()+t),this},dt.PrevYear=function(t){return this.NextYear(-Date.S2I(t))},dt.NextHalfYear=function(t){return(t=Date.S2I(t))?this.NextMonth(t*K.months/2):this},dt.PrevHalfYear=function(t){return this.NextHalfYear(-Date.S2I(t))},dt.NextQuarterYear=function(t){return(t=Date.S2I(t))?this.NextMonth(t*K.months/4):this},dt.PrevQuarterYear=function(t){return this.NextQuarterYear(-Date.S2I(t))},dt.NextMonth=function(t){return(t=Date.S2I(t))&&this.SetMonth(this.GetMonth()+t),this},dt.PrevMonth=function(t){return this.NextMonth(-Date.S2I(t))},dt.NextThirdMonth=function(t){return(t=Date.S2I(t))&&(this.NextDay(10*t),31==this.GetDay()&&this.NextDay(Math.sign(t))),this},dt.PrevThirdMonth=function(t){return this.NextThirdMonth(-Date.S2I(t))},dt.NextWeek=function(t){return(t=Date.S2I(t))&&this.NextDay(t*K.days),this},dt.PrevWeek=function(t){return this.NextWeek(-Date.S2I(t))},dt.NextDay=function(t){return(t=Date.S2I(t))&&this.SetDay(this.GetDay()+t),this},dt.PrevDay=function(t){return this.NextDay(-Date.S2I(t))},dt.NextHour=function(t){return(t=Date.S2I(t))&&this.SetHour(this.GetHour()+t),this},dt.PrevHour=function(t){return this.NextHour(-Date.S2I(t))},dt.NextMinute=function(t){return(t=Date.S2I(t))&&this.SetMinute(this.GetMinute()+t),this},dt.PrevMinute=function(t){return this.NextMinute(-Date.S2I(t))},dt.NextSecond=function(t){return(t=Date.S2I(t))&&this.SetSecond(this.GetSecond()+t),this},dt.PrevSecond=function(t){return this.NextSecond(-Date.S2I(t))},dt.Compare=function(t){return Math.trunc((this.getTime()-t.getTime())/1e3)},dt.WeekOff=function(){var t=this.GetWeekDay()-K.Loc.Get().firstWeekDay;return t<0&&(t+=K.days),t},dt.WeekColDay=function(){var t=this.copy().Reset(16),n=this.GetWeekDay()-t.GetWeekDay();return n&&(n<0&&(n=K.days+n),t.NextDay(n)),t},dt.IsWknd=function(){return Date.IsWknd(this.GetWeekDay(),K.Loc.Get().weekend)},dt.Min=function(t){return this-t<0?this:t},dt.Max=function(t){return this-t>0?this:t};var St=0;dt.GetWeekNo=dt.GetWeek=function(t){var n,i=(t=t||K.Loc.Get()||{}).firstWeekDay||0,e=this.GetYear(),r=Date.Date(this),o=K.days;if(t.weekNumberAs){var s=Date.Create(e).GetWeekDay();if((n=1+Math.trunc((this.GetYearDay()+(s>=i?s-i:o-(i-s))-1)/o))>52){var h=Date.Create(e+1);s=h.GetWeekDay();var a=h.copy();a.addD(-(s>=i?s-i:o-(i-s))),r>=a&&(n=1)}}else{var u,c=Date.Create(e,1,4),l=c.GetWeekDay()-i;if(l<0&&(l+=o),u=D((r.getTime()-c.getTime())/K.msday)+l,n=u<0?Date.Create(e-1,12,31).GetWeekNo():1+Math.trunc(u/o),!St&&n>52){St++;var f=1,g=r.copy();for(g.addD(-1);n==g.GetWeekNo();g.addD(-1))f++;for((g=r.copy()).addD(1);n==g.GetWeekNo();g.addD(1))f++;f=0,t.bDisplayAMPM=n),n?this.GetHourAM():this.GetHour()},dt.QHH=function(t){return K.Pad0(this.QH(t),2)},dt.QH12=function(){return this.GetHourAM()},dt.QHH12=function(){return K.Pad0(this.GetHourAM(),2)},dt.QN=function(){return this.GetMinute()},dt.QNN=function(){return K.Pad0(this.GetMinute(),2)},dt.QS=function(){return this.GetSecond()},dt.QSS=function(){return K.Pad0(this.GetSecond(),2)},dt.QAMPM=function(){return K.Loc.Get().ampm[this.IsAM()?0:1]},dt.QL_AMPM=function(){return this.IsAM()?K.GetAM():K.GetPM()},dt.QL_AP=function(){return T(this.QL_AMPM(),0,1)},dt.QL_TIME=function(){return this.toLocTS()},dt.QL_TIME24=function(){return this.toLocTS(void 0,{hour12:!1})},dt.QL_TSEP=function(){return Date.Today().toLocTS(void 0,{hour12:!1,hour:"numeric",minute:"numeric"}).repAll(at,Z)},dt.QL_Y=function(){return this.QL_YY().toString().slice(-1)},dt.QL_YY=function(){return this.toLocDS(void 0,{year:"2-digit"})},dt.QL_YYYY=function(){return this.toLocDS(void 0,{year:"numeric"})},dt.QFMT=function(t){for(var n,i,e,r,o=Z,s=0,h=t.length;s=2*lt)!function(r){var o=.5522847498*i,s=.5522847498*e,h=(t-=i)+2*i,a=(n-=e)+2*e,u=t+i,c=n+e;r.moveTo(t,c),r.bezierCurveTo(t,c-s,u-o,n,u,n),r.bezierCurveTo(u+o,n,h,c-s,h,c),r.bezierCurveTo(h,c+s,u+o,a,u,a),r.bezierCurveTo(u-o,a,t,c+s,t,c)}(this);else{var c,l=s-o;l<0&&(o+=l,l=-l),c=a(o),this.moveTo(c.x,c.y);do{var f=m(lt/2,l);u(this,o,f),o+=f,l-=f}while(l>0)}this.closePath()}),Ct.selClip=function(t,n,i){K.Clip.Select(this,t,n,i)},Ct.locClip=function(t){K.Clip.Local(this,t)},Ct.resClip=function(){K.Clip.Restore(this)},Ct.onReleaseClip=function(t,n){K.Clip.OnReleaseClip(this,t,n)},Ct.gAO=function(){return this.exontrol&&this.exontrol.oAO},Ct.drawArr=function(t,n,i){K.DrawArr(this,t,n,i)},Ct.drawDir=function(t,n,i,e){K.DrawDir(this,t,n,i,e)},pt.forEach||(pt.forEach=function(t,n){n=n||this;for(var i=0,e=this.length;i>1)?r=e:o=e;return r},K.bfn=function(t,n,i,e,r){r=r||0;for(var o=(t+n)/2,s=tr;)(h=s*i.call(e,o=(t+n)/2))&&(h>0?t=o:n=o);return o},K.expO=function(t,n,i,e,r){i=i||n;for(var o in t){var s,h=(r||K).setM(o),a=(r||K).getM(o);h in i&&!(h in n)&&(n[h]=i[h].bind(i)),a in i&&!(a in n)&&(n[a]=i[a].bind(i)),(n[a]||n[h])&&(s=(r||K).getP(o))&&(e||!(s in n))&&Object.defineProperty(n,s,{get:n[a],set:n[h],configurable:!0})}},K.expOL=function(t,n,i,e){K.expO(t,n,i,e,K.expL())},K.expL=function(t,n){return{getM:function(n){return(t||"get")+K.getP(n)},setM:function(t){return(n||"set")+K.getP(t)},getP:function(t){return t}}},K.toU=function(t,n){return 0==t?t:t+(n||"px")},K.f2S=function(){var t=new Map;return function(n,i){var e=function(n,i){var e=t.get(i);if(!e){t.set(i,e=new Map);for(var r in i)e.set(i[r],r)}return e.get(n)||Z}(n,i);if(!e&&i){var r=n,o=[],s=[];for(var h in i)s.push({f:h,v:i[h]});s.sort(function(t,n){return n.v-t.v}),s.forEach(function(t){var i=t.v;i&&i==(i&n)&&(o.push(t.f),n&=~i)}),e=o.reverse().join(),n&&(e&&(e+=" | "),e+="0x"+K.ToH(n)),t.get(i).set(r,e)}return e}}(),K.s2F=function(){var t=new Map,n=new Map;return function(e,r){function o(n){var i,e=0;return!(i=t.get(r))&&t.set(r,i=function(){var t="",n=[];for(var i in r)n.push(i);n.sort();for(var e=0,o=n.length;e1&&((n=O(e[1]))&&(i.width=~~n),r>2&&(n=O(e[2]))&&(i.offset=~~e[2]))),i},K.ToGRA=function(t){var n,i={color:"black",mode:1,blend:0,vRT:null},e=P(t).split(nt),r=e.length;return r&&((n=O(e[0]))&&(i.color=K.ToCLR(n)),r>1&&((n=O(e[1]))&&(i.mode=~~n),r>2&&(n=O(e[2]))&&(i.blend=~~e[2]))),i},K.ToCLR=function(t,n,i){return t=P(t)?function(t,n){var i=!0;n=A(n);for(var e=0,r=t.length;i&&e=0&&(f=T(i,0,d),g=T(i,d+1)),h){for(var v=Z,p=f.length;p>h;p-=h)v+=a,v+=T(f,p-h,h);f=T(f,0,p)+v}if(i=f,c||i!==at||(i=Z),g&&(i+=s,i+=g),i.length||(i=at),t<0)switch(u){case 0:i="("+i+")";break;case 2:i="- "+i;break;case 3:i+="-";break;case 4:i+=" -";break;default:i="-"+i}}else i=K.Def.Intl.formatNumber.format(t);else i=t.toLocaleString();return i},K.Currency=function(t){return t=parseFloat(t)||0,K.Def.Intl.formatCurrency?K.Def.Intl.formatCurrency.format(t):t.toLocaleString()},K.IsDigitCode=function(t){return t>47&&t<58},K.IsDigitChar=function(t){return t&&1==t.length&&K.IsDigitCode(t.charCodeAt(0))},K.IsDigit=function(t,n){return K.IsDigitCode(t.charCodeAt(n))},K.Pad0=function(t,n){var i=t+Z;n=W(n,2);for(var e=i.length;e64&&t<91||t>96&&t<123},K.IsAlphaChar=function(t){return t&&1==t.length&&K.IsAlphaCode(t.charCodeAt(0))},K.IsAlpha=function(t,n){return K.IsAlphaCode(t.charCodeAt(n))},K.IsAlphaNumCode=function(t){return K.IsDigitCode(t)||K.IsAlphaCode(t)},K.IsAlphaNum=function(t,n){return K.IsAlphaNumCode(t.charCodeAt(n))},K.IsPlusCode=function(t){return 43==t},K.IsPlus=function(t,n){return K.IsPlusCode(t.charCodeAt(n))},K.IsMinusCode=function(t){return 45==t},K.IsMinus=function(t,n){return K.IsMinusCode(t.charCodeAt(n))},K.IsPlusChar=function(t){return t&&1==t.length&&K.IsPlusCode(t.charCodeAt(0))},K.IsHexaCode=function(t){return K.IsDigitCode(t)||t>64&&t<71||t>96&&t<103},K.IsHC=function(t){return t&&1==t.length&&K.IsHexaCode(t.charCodeAt(0))},K.parseHex=function(t){t=O(t||Z);for(var n=Z,i=Z,e=0,r=t.length;e=0}).call(i.t,t)?function(t){try{var n=new XMLHttpRequest;i.s=e(t),n.oO=i,i.e&&(n.onerror=i.e.bind(i.t)),n.onreadystatechange=function(){this.readyState==(XMLHttpRequest.DONE||4)&&this.oO.i.call(this.oO.t,n.responseText,this.oO.s)},n.open("GET",t),n.send(null)}catch(t){i.e&&i.e.call(i.t,t)}}(t):t.files instanceof FileList?function(t){try{if(t.files.length){var n=t.files[0],r=new FileReader,o=r.readAsBinaryString||r.readAsText;i.s=e(n.name),r.oO=i,r.onloadend=function(t){t.target.readyState==(FileReader.DONE||2)&&t.target.oO.i.call(t.target.oO.t,t.target.result,t.target.oO.s)},o.call(r,n.slice())}}catch(t){i.e&&i.e.call(i.t,t)}}(t):i.i.call(i.t,t))},K.SEP=function(t){if(t)try{t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation()}catch(t){}},K.tchEv=function(t){return 2&K.rurPE&&t instanceof TouchEvent},K.V2T=function(t){if(null===t)return 2;if(void 0===t)return 1;switch(typeof t){case"string":return 4;case"number":return t===~~t?8:16;case"boolean":return 32;case"object":return o(t)?256:f(t)?512:64;case"function":return 128}return 1},K.GetFont=function(t){var n=new Map;return function(t){var i=t?"string"==typeof t?t:t.font:K.defCanvasFont,e=i,r=n.get(i);if(!r){var o=K.fPX,s=i.search(o);if(-1==s&&(s=(i=K.defCanvasFont).search(K.fPX)),-1!=s){var h,a,u,c=O(T(i,0,s));i=T(i,s),h=parseInt(i),(i=i.replace(o,Z)).length&&("/"==i.charAt(0)&&(i=T(i,1),a=parseInt(i),i=T(i,i.search(/\s/))),u=O(i)),r={style:c,size:h,line:a,family:u},n.set(e,r)}}return r}}(),K.GetFontSize=function(t){return K.GetFont(t).size},K.GetFontHeight=function(t){return K.GetFontSize(t)*K.fR},K.SetFont=function(t,n,i,e){var r=Z;return n&&e&&(t&&(r+=j+t),r+=j+K.toU(n),i&&(r+=$+i),r+=j+e),r=O(r||K.defCanvasFont)},K.WhelInc=function(t){var n=0;if(t)switch(t.type){case"wheel":n=D(t.wheelDelta?t.wheelDelta/120:-t.deltaY/3);break;case"mousewheel":n=D(t.wheelDelta/120);break;case"DOMMouseScroll":n=D(-t.detail/3)}return n},K.setTimeout=function(t,n){var i=this,e=[].slice.call(arguments,2);return setTimeout(function(){t.apply(i,e)},n)},K.setInterval=function(t,n){var i=this,e=[].slice.call(arguments,2);return setInterval(function(){t.apply(i,e)},n)},K.ToString={Quote:function(t,n){function i(t){var n,h=String(t),a=e++0)if(n===i||1==r)for(a=0;a0&&((n=function(t){if(t=O(t))for(var n=0,e=i.length;n1)&&(e={t:S(0,n),rgC:r.slice(n<0?0:1)}),e}function n(n,i,r,o){var s,h=O(P(r));return h&&(!(s=e.get(h))&&e.set(h,s=t(r)),s&&(i=function(t,n,i,e){var r=null;if(e&&n){switch(n.t){case 0:r=t.createLinearGradient(0,e[1],0,K.BOf(e));break;case 1:r=t.createLinearGradient(e[0],0,K.ROf(e),0);break;case 2:r=t.createLinearGradient(e[0],e[1],K.ROf(e),K.BOf(e));break;case 3:var o=e[0],s=K.ROf(e),h=e[1],a=K.BOf(e),u=S(e[2],e[2])/2;r=t.createRadialGradient((o+s)/2,(h+a)/2,0,(o+s)/2,(h+a)/2,u)}if(r)try{r.addColorStop(0,i);var c=n.rgC.length;n.rgC.forEach(function(t,n){r.addColorStop((1+n)/c,t)})}catch(t){}}return r||i}(n,s,i,o))),i}var i=["vertical","horizontal","diagonal","radial"],e=new Map;return{Create:n,XC:function(){e.clear()}}}(),K.Pattern=function(t,n){function i(t,n,i,e,r,o,s){var h=4*(n+i*t.width);t.data[h+0]=e,t.data[h+1]=r,t.data[h+2]=o,t.data[h+3]=s}function e(t,n,e,r,o){for(var s=n;s0;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);for(var l=4,c=8;l<8;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);break;case 7:for(l=0;l<8;l++)i(h,l,l,a.r,a.g,a.b,a.a);for(var l=4,c=0;l<8;l++,c++)i(h,l,c,a.r,a.g,a.b,a.a);for(var l=0,c=4;c<8;l++,c++)i(h,l,c,a.r,a.g,a.b,a.a);for(var l=0,c=8;l<8;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);for(var l=0,c=4;c>0;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);for(var l=4,c=8;l<8;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);break;case 8:for(var f=0,g=4,c=0;c<8;c++)i(h,f,c,a.r,a.g,a.b,a.a),i(h,g,c,a.r,a.g,a.b,a.a);break;case 9:for(var d=0,v=4,l=0;l<8;l++)i(h,l,d,a.r,a.g,a.b,a.a),i(h,l,v,a.r,a.g,a.b,a.a);break;case 10:for(var f=0,g=4,c=0;c<8;c++)i(h,f,c,a.r,a.g,a.b,a.a),i(h,g,c,a.r,a.g,a.b,a.a);for(var d=0,v=4,l=0;l<8;l++)i(h,l,d,a.r,a.g,a.b,a.a),i(h,l,v,a.r,a.g,a.b,a.a);break;case 11:e(h,0,8,0,a),r(h,0,0,4,a),e(h,0,8,4,a),r(h,4,4,8,a);break;case 12:for(l=0;l<8;l++)i(h,l,l,a.r,a.g,a.b,a.a),i(h,l,7-l,a.r,a.g,a.b,a.a)}return t>1&&s.putImageData(h,0,0),o},K.Pattern.Get=function(){var t=new Map;return function(n,i){return function(n,i){var e,r=t.get(n);return!r&&t.set(n,r=new Map),!(e=r.get(i))&&r.set(i,e=new K.Pattern(n,i)),e}(n,i)}}(),K.DrawEdge=function(t,i,e,r){function o(n,i,e,r){s&&s[0]==n&&s[1]==i||t.moveTo(n,i),t.lineTo(e,r),s=[e,r]}e=W(e,15);var s,h=i[0],a=i[1],u=i[2],c=i[3],l=t.strokeStyle;t.beginPath(),n(r)&&(t.strokeStyle=r),-1==e?o(h,a,h+u,a+c):(1&e&&o(h,a,h,a+c),8&e&&o(h,a+c,h+u,a+c),4&e&&o(h+u,a+c,h+u,a),2&e&&o(h+u,a,h,a),15==(15&e)&&t.closePath()),t.stroke(),t.strokeStyle=l},K.DrawArr=function(t,n,i,o){var s,h,a=K.G,u=a.cArr(n,i,W(o&&o.arrowSize,t.lineWidth));u&&(o&&o.arrowShape?(s=a.CC(u[0],u[1],u[2]),h=a.Dist(s,u[0]),t.save(),t.translate(e(s),r(s)),t.rotate(Math.atan((r(i)-r(n))/(e(i)-e(n)))),t.drawShape([-h,-h,2*h,2*h],K.Mrg({fillColor:t.fillStyle},o.arrowShape)),t.restore()):(t.beginPath(),t.moveTo(u[0][0],u[0][1]),t.lineTo(u[1][0],u[1][1]),t.lineTo(u[2][0],u[2][1]),t.closePath(),t.fill()))},K.DrawDir=function(t,n,i,e,r){if(n){var o,s,h,a,u=n.length,c=K.G;if(u>1){switch(i=W(i,2),e=2==u?0:e,a=W(r&&r.arrowSize,t.lineWidth),o=0,s=n[o],h=n[u-1],i&&a&&(1&i&&(s=c.cArrExcl(n[o+1],s,a)),2&i&&(h=c.cArrExcl(n[u-2],h,a))),t.beginPath(),t.moveTo(s[0],s[1]),e){case-1:var l=s,f=s,g=0;for(o;o=0&&t=0&&++n=0)return this.item(n)},a.at=function(t){if(t>=0&&t=0;e--)t.call(n,i[e],e)},a.rforEachU=function(t,n){n=n||this;for(var i,e=this.byO(),r=e.length-1;!i&&r>=0;r--)i=t.call(n,e[r],r);return i},a.forEachI=function(t,n){n=n||this;for(var i=this.byI(),e=0,r=i.length;e=0&&t=0){this.onRemove(t);var i=this.rgE,e=this.mE2I;i.splice(n,1),e.delete(t);for(var r=n,o=e.size;r0){if(1==e)return this.remove(t[0]);i=n.call(this,t,this.rgE,this.mE2I,!0),this.hasOrd()&&n.call(this,t,this.rgOE,this.mOE2P,!1)}return i},a.removeRange=function(t){return this.removeArr(this.include.apply(this,arguments))},a.toRange=function(t,n){return(t=~~t)<0&&(t=this.len()+t),t=S(0,m(this.len(),t)),n=m(this.len()-t,S(0,I(n,1))),{s:t,c:n,r:function(t,n){var i;if(n>1){i=[];for(var e=0;e=0&&(n=S(0,m(~~n,this.len()-1)),i!=n)){if(n0)if(i>1)for(var e=0;e0)if(i>1)for(var e=0;e0)if(i>1)for(var e=0;e1)(e=new t).push.apply(e,arguments);else if(c(n))e=n;else{var r=o(n)?n:[n];(e=new t).push.apply(e,r)}return this.forEach(function(t){e&&e.has(t)||i.push(t)},this),i},a.join=function(t){return this.byO().join(t)},a.map=function(n,i){var e=new t;return this.forEach(function(t,r){e.add(n.call(i,t,r,this))},this),e},a.filter=function(n,i){var e=new t;return this.forEach(function(t,r){n.call(i,t,r,this)&&e.add(t)},this),e},a.reduce=function(t,i){if(!this.isEmpty()){for(var e=this.byO(),r=n(i),o=r?i:e[0],s=r?0:1,h=e.length;s=0;r--)t.call(n,this.get(i=e[r]),i)},g.forEachU=function(t,n){n=n||this;for(var i,e,r=this.toA(),o=0,s=r.length;!i&&o=0;o--)i=t.call(n,this.get(e=r[o]),e);return i},g.at=function(t){return this.rgO.at(t)},g.len=function(){return this.rgO.len()};var d=h.prototype;return Object.addPrototypeOf(d,g),d.set=function(t){return function(n,i,e){var r=this.get(n);!r&&t.call(this,n,r=new Map),r.set(i,e)}}(d.set),d.get=function(t){return function(n,i){var e=t.call(this,n);return void 0!==i&&e&&(e=e.get(i)),e}}(d.get),d.remove=function(t){return function(n,i){if(void 0!==i){var e=this.get(n);e&&e.delete(i)}else t.call(this,n)}}(d.remove),{Arr:t,KAr:e,BiM:r,M1:s,M2:h}}()),K.F=function(t){this.mD=new Map,this.biF=new K.BiM,this.biA=new K.BiM,this.build(t)};var mt=K.F.prototype;mt.build=function(t){K.B.split(t).forEach(function(t){var i,e,r=t.caption,o=t.subText;this.biF.set(A(r),K.F.u1st(o||r)),n(t.flags)&&void 0!==(i=t.flags.get("def"))&&(i=K.P(i).getValue(),this.mD.set(o,i),!0!==i&&!1!==i||void 0!==(e=t.flags.get("alt"))&&this.biA.set(r,e))},this)},mt.default=function(t){var n=this.mD.get(t);return void 0===n&&(n=null),n},K.F.u1st=function(t){return R(t.charAt(0))+T(t,1)},K.F.l1st=function(t){return A(t.charAt(0))+T(t,1)},K.F.toString=function(t){return n(t)&&(!0===t?t=1:!1===t&&(t=0),t=t.toString()),t},K.F.alt=function(t,n){return t+K.B.options.eq+K.F.toString(n)},mt.Save=function(t){var n=null;return this.biF.mK.forEach(function(i,e){var r=t[function(t){return"Get"+t}(i)].call(t);if(void 0!==r&&r!=this.default(i)){var o=this.biA.get(e);void 0!==o&&(e=o,r=null),(n=n||new Map).set(e,K.F.toString(r))}},this),n},mt.toN=function(t){return this.biF.get(this.biA.getKey(t)||t)||t},mt.toV=function(t,e){var r=this.default(this.toN(e)),o=!0===r||!1===r;if(n(t)){var s=t.get(e);void 0!==s&&(r=i(s)&&void 0!==this.biA.getKey(e)?!r:s)}return o&&(r=0!=r),r},mt.isF=function(t){return!!t&&(this.biF.get(t)||this.biA.getKey(t))},mt.f2o=function(t,n,i){t&&n&&(i=i||this,t.forEach(function(e,r){n.call(i,K.F.l1st(this.toN(r)),this.toV(t,r),r)},this))},mt.Load=function(t,n){this.f2o(n,function(n,i,e){void 0!==this.biF.mV.get(K.F.u1st(n))&&t["Set"+K.F.u1st(n)].call(t,i)},this)},K.Ptr=function(){function t(t){return D(t)}function n(n,r){r=r||"page";var o=n,s=null,h=e||n.target;return K.tchEv(n)&&(o=n.changedTouches[0],"offset"==r&&(s=function(n){var i=K.Ert(n.target);return{x:t(n.clientX-i[0]),y:t(n.clientY-i[1])}}(o))),i(s)&&(s={x:t(o[r+"X"]),y:t(o[r+"Y"])}),function(t,n){if(t){var i=K.CSSzom(t);i&&(n.x/=i,n.y/=i)}}(h,s),function(t,n){if(t){var i=K.IBox([0,0,0,0],t,-1,4);n.x-=i[0],n.y-=i[1]}}(h,s),s}var e=null;return{Get:n,SetTargExclPad:function(t){e=K.ToO(t)},ResTargExclPad:function(){e=null}}}(),K.e2B=function(t,i){if(t){if(!i)switch(t.which){case 1:return 1;case 2:return 4;case 3:return 2}if(n(t.buttons))return t.buttons;if(n(t.button))return t.button}return 0},K.eA2P=function(t,n){return K.Ptr.Get(t,n)},K.e2PO=function(t){return K.eA2P(t,"offset")},K.e2PP=function(t){return K.eA2P(t,"page")},K.e2E=function(t){return t||K.win.event},K.e2P=function(t){if(t=K.e2E(t)){var n=K.e2PO(t);if(function(t){return t&&h(t.x)&&h(t.y)}(n))return n.buttons=K.e2B(t),n}return null},K.pS2T=function(t,n,i){if(n&&i&&n!=i){var e=K.Ert(n),r=K.Ert(i);t.x+=e[0]-r[0],t.y+=e[1]-r[1]}return t},K.Key=function(t){return(t=K.e2E(t))&&(t.which||t.keyCode)||0},K.IsModK=function(t){return t&&(t.ctrlKey||t.shiftKey||t.altKey||t.metaKey)},K.ModK=function(t){var n=0;return t&&(t.shiftKey&&(n|=1),t.ctrlKey&&(n|=2),t.altKey&&(n|=4),t.metaKey&&(n|=16)),n},K.IsEsc=function(t){return 27==K.Key(t)},K.Rand=function(){return Math.random()},K.Tick=function(){return Date.now()},K.Lts=function(){this.mTL=new Map},K.Lts.lCBK=function(t,n,i){var e=null,r=null;return n&&(e={callback:null,thisArg:null,lock:0,name:null,equal:function(t){return t&&this.callback==t.callback&&this.thisArg==t.thisArg}},l(n)||(e.thisArg=n,e.name=s(i)&&i||t,n=l(i)&&i||n[e.name]),l(n)&&((r=e).callback=n)),r};var Et=K.Lts.prototype;Et.getOf=function(t,n){var i=this.mTL.get(t);return!i&&L(n,!0)&&(i=function(t){var n=new K.Arr;return n.type=t,n.do=function(t){var n=!1;return this.forEachU(function(i){return i&&(i.lock++||(n=i.callback.call(i.thisArg,t)),--i.lock),n}),n},n}.call(this,t),this.mTL.set(t,i),t&&(this[t]=i)),i},Et.forEach=function(t,n){n=n||this,this.mTL.forEach(function(i,e){t.call(n,e)})},Et.add=Et.Add=function(t,i,e){t=n(t)?O(t):Z;var r=this.getOf(t);if(i){var o=K.Lts.lCBK(t,i,e);o&&r.add(o)}return r},Et.clear=function(){this.mTL.forEach(function(t,n){this.remove(n)},this)},Et.get=function(t,n,i){var e=null,r=K.Lts.lCBK(t.type,n,i);return r&&t.forEachU(function(t){if(t.equal(r))return e=t}),e},Et.remove=function(t,n,i){var e=this.getOf(t,!1);e&&(n||i?e.remove(this.get(e,n,i)):e.clear())},Et.removeAnyOf=function(t){this.mTL.forEach(function(n){var i=[];n.forEach(function(n){n.thisArg===t&&i.push(n)},this),n.removeRange(i)},this)},Et.lock=function(){this.mTL.forEach(function(t){t.forEach(function(t){t.lock++})})},Et.unlock=function(){this.mTL.forEach(function(t){t.forEach(function(t){t.lock--})})},K.RAF=function(t){var n,i={ID:null};if(t){var e=K.win,r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame;if(r){n=t;function o(){n(),null!==i.ID&&(i.ID=r(o))}return i.ID=r(o),i}}return null},K.XAF=function(t){if(t&&t.ID){var n=K.win,i=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||n.oCancelAnimationFrame||n.msCancelAnimationFrame;i&&(i(t.ID),t.ID=null)}},K.pgXOff=function(){return D(K.win.pageXOffset)},K.pgYOff=function(){return D(K.win.pageYOffset)},K.pgrt=function(t){var n=K.doc,i=[0,0,n.documentElement.clientWidth||K.win.innerWidth,n.documentElement.clientHeight||K.win.innerHeight];return L(t,!0)&&(i[0]+=K.pgXOff(),i[1]+=K.pgYOff()),i},K.Ert=function(t){return t&&t.getBoundingClientRect?function(t){return[D(t.left),D(t.top),D(t.right-t.left),D(t.bottom-t.top)]}(t.getBoundingClientRect()):[0,0,0,0]},K.EArt=function(t){var n=K.Ert(t);return n[0]+=K.pgXOff(),n[1]+=K.pgYOff(),n},K.EArtC=function(t){return K.IBox(K.EArt(t),t,-1,6)},K.IBox=function(t,n,i,e){function r(t){if(t)for(var n=0,i=t.length;n=s&&t=o&&n=m(s,a)-o&&c<=S(s,a)+o&&l>=m(h,u)-o&&l<=S(h,u)+o){var f=s-a,g=h-u;return E(E(f)1)for(var o=1,s=n[0],h=null;!e&&oK.ROf(o)?4:2,s|=nK.BOf(o)?64:32),s},K.EyR=function(t){return!t||t[2]<1||t[3]<1},K.EqR=function(t,n){return t===n||t&&n&&t[0]==n[0]&&t[1]==n[1]&&t[2]==n[2]&&t[3]==n[3]},K.EqS=function(t,n){return t===n||t&&n&&t[2]==n[2]&&t[3]==n[3]},K.NRt=function(t,n){var i,e,r,o,s,h,a,u;return t&&n?(e=K.ROf(t))>=n[0]&&(r=K.ROf(n))>=t[0]&&(o=K.BOf(t))>=n[1]&&(s=K.BOf(n))>=t[1]&&(i=[h=S(t[0],n[0]),a=S(t[1],n[1]),m(e,r)-h,m(o,s)-a]):(u=t||n)&&(i=u&&u.slice()),i},K.URt=function(t,n){var i,e,r;return t&&n?i=[e=m(t[0],n[0]),r=m(t[1],n[1]),S(t[0]+t[2],n[0]+n[2])-e,S(t[1]+t[3],n[1]+n[3])-r]:(i=t||n)&&(i=i.slice()),i},K.URts=function(t){function n(t,n){return K.EyR(n)?t:K.EyR(t)?n:K.URt(t,n)}var i=null,e=arguments.length;if(e>0)if(e>1)for(var r=0;r1){var e,r,o,s,h;if(t&&(e=t.length)>2){for(r=[],o=0,s=e;h=~~((s-o)/n);)r.push(t[i?s-1-o:o]),o+=h;for(;oc[0]+c[2]?4:2,r|=nc[1]+c[3]?64:32}return r},Cursor:{Rect:function(t,n){var i=n||"auto";if(256==(256&t))i="pointer";else switch(t){case 17:i="nw-resize";break;case 18:case 16:i="n-resize";break;case 20:i="ne-resize";break;case 33:case 1:i="w-resize";break;case 34:case 2:case 32:i="move";break;case 36:case 4:i="e-resize";break;case 65:i="sw-resize";break;case 66:case 64:i="s-resize";break;case 68:i="se-resize"}return i}},Resize:function(t,n,i,e,r){function o(t,n){var i=n[0]||0,e=n[2]||0;t[2]=S(i,t[2]),e>i&&(t[2]=m(e,t[2]))}function s(t,n){var i=n[1]||0,e=n[3]||0;t[3]=S(i,t[3]),e>i&&(t[3]=m(e,t[3]))}var h;if(e){switch(h=e.slice(),t){case 34:case 2:case 32:h[0]+=n,h[1]+=i;break;default:switch(80&t){case 16:h[1]+=i,h[3]-=i,r&&(s(h,r),h[1]=m(h[1],e[1]+e[3]-h[3]));break;case 64:h[3]+=i,r&&s(h,r)}switch(5&t){case 1:h[0]+=n,h[2]-=n,r&&(o(h,r),h[0]=m(h[0],e[0]+e[2]-h[2]));break;case 4:h[2]+=n,r&&o(h,r)}}r||(h[2]<0&&(h[2]=-h[2],h[0]-=h[2]),h[3]<0&&(h[3]=-h[3],h[1]-=h[3]))}return h}},K.Mrg(K,function(){function t(t){this.bold=this.italic=this.underline=this.strikeout=!1,this.fgColor=this.bgColor=this.fontSize=this.fontName=this.shaColor=this.outColor=this.graColor=null,this.Set(t),this._rgStk=[]}function e(n){var i=r.get(n);return i||(s(n)?r.set(n,i=function(n){var i=new t;return A(n).splitP(j,null,o).forEach(function(t){if(t=O(t)){var n,e,r;t.startsWith(et)&&((t=T(t,1)).endsWith(rt)&&(t=T(t,0,t.length-1)),(t=O(t))&&~(e=y(t,j))&&(n=T(t,e+1),t=T(t,0,e))),(r=function(n){if(t)for(var i=0,e=n.length;i1&&(this.eW=T(t,n+1)))}}function n(n){var e=i.get(n);return!e&&i.set(n,e=new t(n)),e}t.prototype.Match=function(t,n){var i,e,r=n=n||0,o=0;if(this.sW){if(!t.sWith(this.sW,n))return null;r+=o+=this.sW.length}if(i=t.length,this.eW){if((i=y(t,this.eW,n))<0)return null;o+=this.eW.length}return this.bF&&(o+=(e=T(t,r,i-r)).length),{eat:o,field:e}};var i=new Map;return{Match:function(t,i,e){return n(t).Match(i,e)},Tag:function(t){return n(t)}}}(),K.H=function(){function t(t,n){this.text=t,this.start=n||0,this.length=this.text.length}function e(t){this.nMMC=3,this.mMSW=new Map,this.mMEW=new Map,this.oHTags=t;for(var n=0,i=t.rgHTag2,e=i.length;no||f.height>s))&&(t.save(),t.locClip(i)),u.Draw(t,i,e),l&&t.restore()),r&&r.eCTX(t)))),f}function R(t){var n=A(t);return n?n.GetCaption():t}function b(t){lt.clear(),t||(ft.clear(),vt={})}function k(t){return function(t){var n,i=t?"v":"u";return void 0===vt[i]&&(vt[i]=null,(n=K.Def.H[(t?Z:"un")+"visitAnchorFormat"])&&new c(n).Elements(function(t){return!(t.oTFI&&(vt[i]=t.oTFI))})),vt[i]}(function(){function n(n){var i=dt.get(n);return i&&i.Has(t)}var i=n(L);return!i&>.forEach(function(t,e){i||(i=n(e))}),i}())}function I(t,n){b(!0),function(t){var n=dt.get(t);n||dt.set(t,n=new v);return n}(t).AddVA(n)}var L,X=t.prototype;X.continue=function(){return this.start",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("
"),this.Add("\r"),this.Add("\n"),this.Add("",""),this.Add("",""),this.Add(""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("&"),this.Add(""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("<%","%>"),this.lHTag2=this.rgHTag2.length},N.Add=function(t,n){this.rgHTag2.push(new function(t,n,i){this.nIndex=t,this.oSHTag=n?K.HTag.Tag(n):null,this.oEHTag=i?K.HTag.Tag(i):null}(this.rgHTag2.length,t,n))},N.Refresh=function(){this.oHTagsP=new e(this)},N.GetHTMLTagPair=function(t){return t>=0&&t=0){n.name=K.HP.IsValid(T(t,t,i));var e=T(t,i+1),r=e,o=Z,s=y(e,tt);s>=0&&(r=O(T(e,t,s)),o=O(T(e,s+1))),n.width=parseInt(r)||0,n.height=parseInt(o)||0}}return n}(e));break;case 14:if(e=t.field){var s=e,h=0,a=y(e,nt);a>=0&&(s=T(e,0,a),h=parseFloat(T(e,a+1))||0),(s=O(s))&&(this.getTFI().fontName=s),h>0&&(this.getTFI().fontSize=h)}break;case 15:e=t.field,this.oA=function(t){var n,i={id:O(t||Z),options:null};return t&&(n=y(t,nt))>=0&&(i.id=O(T(t,0,n)),i.options=O(T(t,n+1))),i}(e);break;case 18:this.getTFI().graColor=K.ToGRA(t.field);break;case 19:(e=t.field)&&(K.IsHC(e.charAt(0))||(e=T(e,1)),e&&(e=n(e,"#000000"))),e||(e="#000000"),this.getTFI().outColor=e;break;case 20:this.getTFI().shaColor=K.ToSHA(t.field);break;case 21:var u=0;(e=O(P(t.field)))&&(u=parseFloat(e)),this.off+=u}},Y.ApplyTag=function(t){22==t.tag?(this.cap=O(P(t.field)),this.bEF=!!this.cap):this.applyTag(t)};var j=a.prototype;j.Align=function(t){function n(){return this.oAE||(this.oAE={center:-1,right:-1}),this.oAE}11==t?function(){var t=n.call(this);t.right<0&&(t.right=this.rgHE.length)}.call(this):17==t&&function(){var t=n.call(this);t.center<0&&t.right<0&&(t.center=this.rgHE.length)}.call(this)},j.Add=function(t){return this.Elements().push(t),this},j.Elements=function(){return this.rgHE};var J=u.prototype;J.array=function(){return this.rgHTMLLines},J.Add=function(t){return this.array().push(t),this};var $=c.prototype;$.parse=function(){function n(t){return t.forEach(function(t){l.ApplyTag(t)}),l}function i(){!l.isEmpty()&&c.Add(n(S)),C.Add(c)}function e(){return new s(Z,c)}function r(){return new a(C)}function h(t,n){for(var i=t.length-1;i>=0;i--)if(t[i].tag==n)return i;return-1}var c,l,f,g,d,v,p,C=this.oHLs,S=[];if(!C){for(C=this.oHLs=new u(this),c=r(),l=e(),f=new t(this.fll);f.continue();)(g=q.MatchTagPair(f))?(v=o(d=g.tag))==B?l.cap+=g.field:v==z?(l.isEmpty()||(c.Add(n(S)),l=e()),n(S),l.ApplyTag(g),c.Add(l),l=e()):v==U?(l.isEmpty()||(c.Add(n(S)),l=e()),c.Align(d)):v==V?(i(),c=r(),l=e()):g.start?(l.isEmpty()||(c.Add(n(S)),l=e()),S.push(g)):(p=h(S,d))>=0&&(l.isEmpty()||(c.Add(n(S)),l=e()),S.splice(p,1)):(l.cap+=f.current(),f.next());i()}},$.Elements=function(t){if(this.oHLs)for(var n=!0,i=this.oHLs.array(),e=0,r=i.length;n&&e0||r>0)&&(e>0&&r>0?(n.width=e,n.height=r):(e>0&&(n.height*=e/n.width,n.width=e),r>0&&(n.width*=r/n.height,n.height=r)))):(e>0||r>0)&&(n.width=e,n.height=r,n.width=n.width||n.height,n.height=n.height||n.width),n.width=t.scaleOnFont(n.width),n.height=t.scaleOnFont(n.height),n},rt.Draw=function(t,n,i,e,r){this.bCTX(t,e);var o=this.getHTMLPicture();o?o.Draw(t,[n,i,this.size.width,this.size.height]):this.drawImageHolder(t,n,i,e),r&&r.call(this),this.oHE.oA&&ht.AddA(L,n,i,this),this.eCTX(t)},rt.drawImageHolder=function(t,n,i,e){this.bCTX(t),K.HP.DrawPH(this.oImg.name,t,[n,i,this.size.width,this.size.height]),this.eCTX(t)};var ot=g.prototype;ot.mEsW=function(t,n){var e,r,o=0;if((t=t||0)>=0&&(e=this.len(),t0))for(var s=0,h=t;s=0&&t=t.getCaption().length&&(this.index++,this.offset=0)}},Prev:function(){if(this.offset)this.offset--;else{this.index--;var t=this.Element();if(t)switch(t.type){case 1:this.offset=0;break;default:this.offset=t.getCaption().length}}},IsBreak:function(){var t=this.Element();if(t)switch(t.type){case 1:break;default:return K.dtWB.test(t.getCaption().charAt(this.offset))}return!0},IsZero:function(){return 0==this.index&&0==this.offset},Copy:function(){return i.getIterator(this.index,this.offset)}}},ot.indexOf=function(t){for(var n=0,i=this.rgLE.length;n=0)return this.getIterator(n,r)}}return null},ot.lastIndexOf=function(t){for(var n,i,e=null,r=this.rgLE.length-1;!e&&r>=0;r--)(n=this.rgLE[r]).type||(i=n.getCaption().lastIndexOf(t))>=0&&(e=this.getIterator(r,i));return e},ot.draw=function(t,n,i,e,r){function o(t,n,i,e){function o(t){return t.nRT?t.strokeStyle:t.fillStyle}t.save(),t.beginPath();var s,h=S(1,D(K.GetFontSize(t)/K.defScaleFontSize)),a=n[0],u=a+n[2],c=n[1]+(i.position<0?0:n[3]);t.lineWidth=h,t.setLineDash(1==i.type?[]:[h,h]),r?((s=i.color)||(s=e)||(s=o(t)),t.strokeStyle=s):s=o(t),t.strokeStyle=s,t.moveTo(a,c),t.lineTo(u,c),t.stroke(),t.restore()}function s(t){return t.color+"-"+t.type+"-"+t.position}function h(){var t=this.oL;return t&&t.type&&t||null}var a,u=this.size.heightE,c=e,l=this.size.height,f=-1,g=n,d=-1,v=i;this.bT||this.oAE&&((d=this.oAE.right)>=0&&(v-=this.mEsW(d),v=S(n+this.mEsW(0,d),v)),(f=this.oAE.center)>=0&&(g+=this.mEsW(0,f),g=m(g+=S(0,(v-g-this.mEsW(f,d))/2),v))),e+=this.off;for(var p,C,E,A=0,w=this.rgLE.length;A0){switch(n.type){case 1:e=-1,t>0?e=t-1:t+1=0&&(r=this.rgLE[e].size.height)>o&&(s-=S(0,(r-o)/2))}h=s}return h},ot.measure=function(t){this.off=0;var n,i,e,r,o,s=0,h=0,a=!1;if(t=t||0,this.rgLE.length&&(t=0,this.rgLE.forEach(function(i){n=i.size,s+=n.width,t=S(n.height,t),a|=0!=i.off}),h=t),a){i=0,e=t;for(var u=0,c=this.rgLE.length;u0?e=S(e,t+o):i=m(i,this.yAlign(u,r,t)+o));this.off=-i,t=e-i}return this.size={width:s,height:t,heightE:h}},ot.removeAt=function(t,n){var i,e=n.Element(),r=n.index;e&&(e.type||(i=T(i=e.getCaption(),0,n.offset)+T(i,n.offset+1))&&(e.setCaption(t,i),r=-1),r>=0&&this.rgLE.splice(r,1),this.measure(t.fontHeight()),n.Prev())},ot.getCaption=function(){var t=Z;return this.rgLE.forEach(function(n){var i=n.getCaption();i&&(t+=i)},this),t};var ht=d.prototype;ht.doL=function(t,n,i,e){function r(t,n){if(n&&!n.IsZero()){var i,e=n.Element(),r=n.index;return n.offset&&(i=e.getCaption(),e.setCaption(t,T(i,0,n.offset)),r++),r&&(this.rgLE.splice(r),0==n.offset&&(e=this.rgLE[r-1])),this.measure(E),e}}function o(t,n){if(n>0){for(var i,e,r=this.rgLE,o=0,s=0,h=r.length;o<=n&&sn&&(s--,i=this.getIterator(s,0),e=i.Element())){switch(e.type){case 1:i.index++,i.offset=0;break;default:e.bCTX(t,!1),i.offset=S(s?0:1,H(t,e.getCaption(),n-(o-e.size.width))),e.eCTX(t)}if(i.IsValid())return i}}}function s(t,n){if(function(){function t(t){return t.search(K.dtWB)>=0}for(var n,i=0,e=this.rgLE.length;i=0&&(n.center=0&&(n.right=0||e>=0)&&(this.oAE={center:i,right:e})}return this.oAE}.call(t,this.iCLL,n),t.measure(E),this.rgLL.push(t),i==this.oCLL&&(this.iCLL+=t.len())}this.rgLL=[],this.oCLL=null,this.iCLL=0;var a,u=this,c=1024&e||256&e,l=32&e,f=16&e,d=262144&e,v=32768&e,p=16384&e,C=i[2],m=i[3],E=n.fontHeight(),A={x:0,y:0,line:new g,newElement:function(t,n){return this.line.newElement(t,n)},newLine:function(){return h.call(u,this.line),this.y+=this.line.size.height,this.x=0,this.line=new g},breakLine:function(t){var n,i,e,r,o,h,a,u,l=this.line;do{n=!1,(i=s.call(l,t,C))&&!i.IsZero()&&(e=[],r=i.Element(),o=i.index,i.offset&&(a=r.getCaption(),r.setCaption(t,T(a,0,i.offset)),(u=this.newElement(t,r.oHE)).setCaption(t,T(a,i.offset)),e.push(u),o++),h=this.newLine(),o&&(pt.push.apply(e,l.rgLE.splice(o)),l.measure(E)),pt.push.apply(h.rgLE,e),h.measure(E),this.x=h.size.width,n=this.x>C&&(c||this.yC&&A.breakLine(n)):(c||p||(s.setCaption(n,Z),(o=C+8-A.x)>0&&s.setCaption(n,function(t,n,i){this.bCTX(n);var e=T(t,0,1+H(n,t,i));return this.eCTX(n),e}.call(s,r,n,o))),A.line.rgLE.push(s),A.x+=s.size.width))}else!l&&A.newLine();return a}),h.call(u,A.line),function(t,i,e,s,h){if(!i||e||s||h){var a=G(n,st),u=e&&at){var g,d,v,p,C,S=null;if(h&&(S=e.lastIndexOf(ut))){for(g=(C=S.Element()).getCaption(),C.setCaption(n,T(g,0,S.offset)+st+T(g,S.offset)),e.measure(E),S.Prev();S.IsValid()&&e.size.width>t;)e.removeAt(n,S);i||e.size.width>t&&r.call(e,n,o.call(e,n,t))}else d=l,(v=c&&s+1==f)&&(d=t-a),(p=o.call(e,n,d))&&(C=r.call(e,n,p),(u||v)&&C&&0==C.type&&(C.setCaption(n,C.getCaption()+st),e.measure(E)))}})}}.call(this,C,c,d,a&&v,p),this.size=this.measure()},ht.Draw=function(t,n,i){var e,r,o,s=n[0],h=n[2],a=s+h,u=n[1],c=n[3],l=0==(512&i),f=!(256&i),g=1&i?2:2&i?1:0,d=4&i?2:8&i?1:0;return d&&((o=this.size.height)0;o--){(c=t.sizeHTMLDate("<%mmmm%>",r,0)).width>i&&(e=o,i=c.width),r.PrevMonth()}var s=Date.Create(n,e,1);s.NextMonth(),s.PrevDay();for(var h=0,a=s.GetDay(),o=a,u=0;u",s,0);c.width>h&&(a=o,h=c.width),s.PrevDay()}return Date.Create(n,e,a)}return null}var r=new Map;t(0,"yyyy,yy,loc_g,loc_gg,loc_y,loc_yy,loc_yyyy"),t(1,"hy"),t(2,"q"),t(16,"m,mr,mm,m1,m2,m3,mmm,mmmm,loc_m1,loc_m2,loc_m3,loc_mmm,loc_mmmm"),t(17,""),t(256,"w,ww"),t(4096,"y,d,dd,d1,d2,d3,ddd,dddd,i,loc_sdate,loc_ldate,loc_d1,loc_d2,loc_d3,loc_ddd,loc_dddd,loc_dsep"),t(65536,"h,h12,hh,hh12,AM/PM,loc_time,loc_time24,loc_AM/PM,loc_A/P,loc_tsep"),t(1048576,"n,nn"),t(16777216,"s,ss");return{Evaluate:function(t,n,i){if(f(t)){var e=t.toQ(n.repAll($,Z));if(e)return String(e.call(t,i)+Z)}return n},Unit:function(t){var n=0;return t&&t.forEach(function(t){n=S(n,i(t))}),n},UnitOf:i,Fields:function(){var t=[];return r.forEach(function(n,i){t.push(i)}),t},MeasureLabel:function(t,n,i,r){var o={width:0,height:0};if(t){r=r||1971;for(var s=Date.Create(r,12,31,23,59,59),h=0;h=0&&t<1?t:1},s.applyAlpha=function(t,n){if(1!=(n=this.getAlpha(n)))for(var i=t.data,e=3,r=i.length;e0?(clearTimeout(this.hTC),this.hTC=setTimeout(function(){n.onchange(t)},i)):n.onchange(t)},s.onchange=function(t){this.oLts.onchange.do(t)},s.addEventListener=function(t,n,i){this.oLts.add(t,n,i)},s.removeEventListener=function(t,n,i){clearTimeout(this.hTC),this.oLts.remove(t,n,i)},s.Item=s.item=function(n){return n instanceof e?n:(n=t(n))?this.mP.get(n):null},s.Add=s.add=function(n,i){var r=null;return(n=t(n))&&((r=this.item(n))?r.SetSource(i):(this.mP.set(n,r=new e(this,i)),this.onChange(r))),r},s.Remove=s.remove=function(n){if(n=t(n)){var i=this.item(n);i&&(this.mP.delete(n),this.onChange(i))}},s.Clear=s.clear=function(){this.mP.size&&(this.mP.clear(),this.onChange(null))},s.Draw=s.draw=function(n,i,e){if(n=t(n)){var r=this.item(n);if(r)return r.Draw(i,e)}},s.GetSize=s.getSize=function(t){var n=this.item(t);return n?n.GetSize():{width:0,height:0}},s.Count=s.len=function(){return this.mP.size},s.Measure=s.measure=function(t,e,r){var o,s,a,u,c,l,f,g,d,v,p=null;return(t=K.HP.IsValid(t))&&(u=this.item(t),h(e)?(a=(c=W(e))<0,o=s=E(c)):(f=(l=e||[null,null])[0],g=l[1],0!=f&&0!=g&&(d=u?u.GetSize():{width:16,height:16},a=g<0||f<0,o=E(f||d.width),s=E(g||d.height),!a&&n(e)&&(v=i(d,f,g))&&(o=v.width,s=v.height))),o&&s&&(r&&(o=r.scaleOnFont(o),s=r.scaleOnFont(s)),p={width:o,height:s,stretch:a,picture:u})),p},s.DrawS2=s.drawS2=function(t,n,e,r,o){var s,h,u,c,l,f;return n&&e&&(o=o||34,(h=this.measure(n,r))&&(s=e.slice(),u=256&o,void 0!==r&&(c=(u?null:i(h,e[2],e[3]))||h,(l=h.picture)&&!h.stretch&&(f=i(l.GetSize(),c.width,c.height))&&(c=f),s[2]=c.width,s[3]=c.height,17!=(o&=255)&&(s=K.G.C2R(K.G.R2C(e,o),s[2],s[3],o))),h.picture&&h.picture.Draw(t,s)||a.DrawPH(n,t,e))),s},s.forEachU=function(t,n){var i;return n=n||this,this.mP.forEach(function(e,r){!i&&(i=t.call(n,e,r))}),i};var a=new r;return a.IsValid=t,a.DrawPH=function(t,n,i){n.drawShape(i,{frameColor:"#D0D0D0",pattern:6,patternColor:"#F0F0F0"}),n.noFD(function(){n.drawHTMLText(t,i,2085)})},a.Scale=i,a.TTC=750,a.Proto=o,a}(),K.B=function(){function t(t,e){function r(t){function r(){p&&(i(C)&&(C=p),p=Z)}function o(){S=S||new Map;var t=function(t){var n=null;if(t){var i=y(t,e.eq),r=t,o=null;i>=0&&(r=T(t,0,i),o=T(t,i+e.eq.length));var s=r.split(e.sep),a=s.length;n=[];for(var u=0;u=0?(v=!0,g+t+g):null}function h(t){return v&&t?t.repAll(g,Z):t}for(var a=0,u=0,c=0,l=t.length,f=0,d=0,v=!1,p=Z,C=null,S=null,m=null;i(m)&&c=0&&(a=a?0:e.str[w],A=Z)}}A&&(p+=A),f=E}r();return{caption:h(C||Z),flags:S,subText:h(m||Z)}}function o(){var t=!1;return(t=!a&&!u&&!c)&&(s.push(r(f+v+p)),f=Z,v=Z,p=Z),t}var s=[];if(t=P(t)){e=e||d.options||{};for(var h=t.length,a=0,u=0,c=0,l=0,f=Z,v=Z,p=Z,C=0;C=0&&(a=a?0:e.str[E])}}m&&(u?p+=m:c?v+=m:f+=m),l=S}o()}return s}function e(){if(i(f)){f={escC:Z,escFN:Z,escFV:Z};var t=d.options;t.esc&&([t.esc,t.sP,t.eP,t.sO,t.eO,t.sep,t.str].forEach(function(t){f.escC+=t}),[t.esc,t.sO,t.eO,t.eq,t.str,t.escWS].forEach(function(t){f.escFN+=t}),[t.esc,t.sO,t.eO,t.str,t.escWS].forEach(function(t){f.escFV+=t}))}return f}function r(t,i){var e=Z;if(n(t)&&(t=t.toString(),e=t,i)){e=Z;for(var r=0,o=t.length;r=0&&(s=d.options.esc+s),e+=s}}return e}function s(t){return r(t,e().escC)}function h(t,o,s){function h(t,i){var o=Z;return o+=d.options.sO,o+=function(t){return r(t,e().escFN)}(t),n(i)&&(o+=d.options.eq,o+=function(t){return r(t,e().escFV)}(i)),o+=d.options.eO}var a=Z;if(u(t)&&t.size){var c=[];t.forEach(function(t,n){(function(t,n){return!l(o)||o.call(s,t,n)})(n,t)&&(i(t)?c.push(n):a+=h(n,t))}),c.length&&(a=h(c.join(d.options.sep))+a)}return a}function a(t,n){var i=Z;return n&&(i+=d.options.sP),o(t)&&(i+=t.join(d.options.sep)),n&&(i+=d.options.eP),i}function c(t){var n=[];return t.forEach(function(t){var i=s(t.caption);if(i+=h(t.flags),t.subText){var e=[];K.B.split(t.subText).forEach(function(t){e.push(c([t]))}),i+=a(e,!0)}n.push(i)}),a(n)}var f=null,g=String.fromCharCode(0),d={options:{sep:",",sP:"(",eP:")",sO:"[",eO:"]",esc:ut,str:"\"'",eq:it,escWS:" \t",fn:function(t){return A(O(t))},fv:function(t){return O(t)}},split:t,quoteC:s,quoteF:h,quoteS:a,quote:c};return d}(),K.P=function(t,n){function e(t,n,i){return t&&n in t?t[n]:i}var r=e(n,"hexa","0x"),o=e(n,"string","`'\""),s=e(n,"date",J),h=e(n,"arrays","["),a=e(n,"arraye","]"),u=e(n,"arraysep",",");return{expression:t+Z,position:0,result:null,continue:function(){return this.position=0;)this.result=16*this.result+t,this.position++,n++;return n>0&&n<9}},isNumber:function(){return this.isInt()||ot==this.expression.charAt(this.position+this.countSigns())?1:0},getNumber:function(){if(this.result=null,this.isNumber()){var t=1;this.getSign()&&(t=this.result),this.getInt();var n=this.result||0;if(n<0&&(n=-n,t=-1),ot==this.currentChar()&&(this.position++,this.isInt(!1))){var i=this.eatZero();this.getInt();for(var e=0,r=this.result||0;r>0;)e=e/10+r%10/10,r=Math.trunc(r/10);for(var o=0;o=0?1:0},getString:function(){this.result=null;var t=this.isString();if(t){var n=this.currentChar();for(this.position+=t,this.result=Z;this.continue();){var i=this.currentChar();if("\\"==i){var e=this.nextChar();if(e==n||"\\"==e)this.position++,i=this.currentChar();else switch(e){case"r":i="\r",this.position++;break;case"n":i="\n",this.position++}}else if(i==n)break;this.result+=i,this.position++}if(this.continue())return this.position++,!0}},isDate:function(){return this.expression.sWithI(s,this.position)?s.length:0},getDate:function(){this.result=null;var t=this.isDate();if(t){var n=this.currentChar();this.position+=t;for(var i=Date.Today(),e=[i.GetMonth(),i.GetDay(),i.GetYear(),0,0,0],r=e.length,o=0;this.continue()&&o=0){var e=n-this.position;return this.result=T(this.expression,this.position,e),1+e}n++}return 0},searchAnyOf:function(t){function n(t,n,i){for(var e=0,r=!1,o=i.length;!r&&e=0){var o=i-this.position;return this.result=T(this.expression,this.position,o),t[r].length+o}i++}return 0}}},K.PF=function(t,n,i){function e(n){return a.forEachU(function(i){return t.sWith(i.key,n)?i:null})}function r(t,n){return n.l=t.length,y(this,t,n.i)}function o(t,n){var i=-1,e=c=n.i,r=this.length,o=0;if(c=0&&nK.ToV(n)},GREATE:function(t,n){return K.ToV(t)>=K.ToV(n)},SWITH:function(n,i){return t(n).sWith(t(i))},EWITH:function(n,i){return t(n).eWith(t(i))},CONTAINS:function(n,i){return-1!=t(n).search(t(i))},LFIND:function(n,i){return y(t(n),t(i))},RFIND:function(n,i){return t(n).lastIndexOf(t(i))},COUNT:function(n,i){return t(n).countOf(t(i))},LEFT:function(n,i){return T(t(n),0,i)},RIGHT:function(n,i){var e=t(n);return T(e,S(0,e.length-i))},LPAD:function(n,i){var e=t(n),r=t(i),o=r.length-e.length;return o>0?T(r,0,o)+e:n},RPAD:function(n,i){var e=t(n),r=t(i),o=r.length-e.length;return o>0?e+r.slice(-o):n},CONCAT:function(i,e){var r,o=Z,s=S(0,n(e));if(s>0){r=t(i);for(var h=0;h=n[i].toString()})]:n)),i},ARRAY:function(t,n){var i=Z;return void 0!==t&&o(n)&&(t=D(parseFloat(t||0)),isNaN(t)||t>=0&&t=n[i].toString()})])&&(e=i)):e=t==n?t:0,e},SPLIT:function(n,i){return t(n).split(t(i))},CASE:function(t,n){return n instanceof K.E.Case?n.Evaluate(t):t},REPLACE:function(n,i){var e=t(i);return e.length?t(n).repAll(e,"\b"):n},WITH:function(n,i){return t(n).repAll("\b",t(i))},LEN:function(n,i){return o(n)?n.length:t(n).length},TYPE:function(t,n){return K.V2T(t)},LOWER:function(n,i){return w(t(n))},UPPER:function(n,i){return b(t(n))},PROPER:function(n,i){return t(n).toProper()},LTRIM:function(n,i){return t(n).ltrim()},RTRIM:function(n,i){return t(n).rtrim()},TRIM:function(n,i){return O(t(n))},INT:function(t,n){return Math.trunc(i(t))},ROUND:function(t,n){return D(i(t))},FLOOR:function(t,n){return Math.floor(i(t))},ABS:function(t,n){return E(i(t))},STR:function(n,i){return t(n)},CURRENCY:function(t,n){return K.Currency(i(t))},TIME:function(t,n){return e(t).toLocTS()},TIMEF:function(t,n){var i=e(t);return r(i.GetHour())+tt+r(i.GetMinute())+tt+r(i.GetSecond())},SHORTDATE:function(t,n){return e(t).toLocDS()},SHORTDATEF:function(t,n){var i=e(t);return r(i.GetMonth())+$+r(i.GetDay())+$+r(i.GetYear(),4)},LONGDATE:function(t,n){return e(t).toDateString()},DBL:function(t,n){return i(t)},DATE:function(t,n){return e(t)},DATES:function(n,i){for(var e,r=Date.Today(),o=t(n),s=[r.GetMonth(),r.GetDay(),r.GetYear(),0,0,0],h=s.length,c=0,l=0,f=o.length;lc&&(s[l]=parseInt(T(o,c,g-c))),c=g+1}return(e=Date.Create(s[2],s[0],s[1],s[3],s[4],s[5],0)).isValid()||(e=C),e},DATEF:function(t,n){return K.EO.SHORTDATEF(t)+j+K.EO.TIMEF(t)},YEAR:function(t,n){return e(t).GetYear()},MONTH:function(t,n){return e(t).GetMonth()},DAY:function(t,n){return e(t).GetDay()},YEARDAY:function(t,n){return e(t).yDay()},WEEKDAY:function(t,n){return e(t).GetWeekDay()},HOUR:function(t,n){return e(t).GetHour()},MINUTE:function(t,n){return e(t).GetMinute()},SECOND:function(t,n){return e(t).GetSecond()},REVERSE:function(n,i){return t(n).toReverse()},MIN:function(t,n){return K.EO.LESS(t,n)?n:t},MAX:function(t,n){return K.EO.LESS(t,n)?t:n},SQRT:function(t,n){return Math.sqrt(i(t))},SIN:function(t,n){return Math.sin(i(t))},COS:function(t,n){return Math.cos(i(t))},ASIN:function(t,n){return Math.asin(i(t))},ACOS:function(t,n){return Math.acos(i(t))},store:[],STORE:function(t,i){var e=S(0,n(t))%10;return K.EO.store[e]=i},RESTORE:function(t,i){var e=S(0,n(t))%10;return K.EO.store[e]},IIF:function(t,n){return t?n:null},ELSE:function(t,n){return null===t?n:t},MOD:function(t,n){return i(t)%i(n)},LIKE:function(n,i){return K.Like.Match(t(n),t(i))},BITAND:function(t,n){return t&n},BITOR:function(t,n){return t|n},BITXOR:function(t,n){return t^n},BITSHIFT:function(t,i){var e=n(i);return 0===e?t:e<0?n(t)<<-e:n(t)>>e},BITNOT:function(t,n){return~t},HEX:function(t,i){return K.ToH(n(t))}}}}()),K.E=function(){function t(t){var n=o.get(t);return!n&&o.set(t,n=function(t){var n=new K.E.Ops(t);return n.AddType(t),n.Build(),n}(t)),n}function n(t){return P(t)}function i(i,r,o,s){var h=function(t,n,i){return i+tt+t+tt+n}(i=n(i),r=function(t){return P(t)}(r),o=function(t){return I(t,7)}(o)),a=e.get(h);return!a&&e.set(h,a=new K.Expr(i,r,t(o),s)),a}var e=new Map,r=new Map,o=new Map;return{Create:i,EvalCE:function(t,i){if(i){var e=n(i),o=r.get(e);!o&&r.set(e,o=new K.CExpr(e)),t=o.Evaluate(t)}return t},DPI:["dpix","dpiy","dpi"],BIAS:"bias",XC:function(){o.clear(),r.clear(),e.clear()}}}(),K.E.Const=function(t){this.type=17,this.const=t},K.E.Var=function(t){this.type=18,this.var=t};var At=K.E.Var.prototype;At.getVar=function(t){var n={index:t,subName:Z},i=t>>24&127;return i?127!=i&&(n.index=16777215&n.index,n.subName=String.fromCharCode(i)):2147483648&t&&(n.index=16777215&n.index,n.subName=j),n},K.E.Oper=function(t){this.type=32,this.callback=t};K.E.Oper.prototype.isO=function(t){var n=t.getOp(this.callback);return n&&n.Type||0},K.E.Case=function(){this.type=20,this.cbkVar=null,this.oDefE=null,this.mCE=new Map};var wt=K.E.Case.prototype;wt.addCase=function(t,n,i){var e=!1,r=t.GetKeywords(),o=new K.Expr(i,r,t.oOps,t.cNVar);return o.IsValid()&&("default"==A(n)?(this.oDefE=o,e=!0):n.split(",").forEach(function(n){var i=new K.Expr(n,r,t.oOps,t.cNVar);i.IsValid()&&(e=!0,this.mCE.set(K.ToV(i.Evaluate(this.cbkVar)),o))},this)),e},wt.Evaluate=function(t){var n=this.mCE.get(K.ToV(t));return n?n.Evaluate(this.cbkVar):this.oDefE?this.oDefE.Evaluate(this.cbkVar):t},K.E.M1=function(t){this.oOps=t,this.rgStk=[]};var Rt=K.E.M1.prototype;Rt.pushC=function(t){this.rgStk.push(new K.E.Const(t))},Rt.pushV=function(t){this.rgStk.push(new K.E.Var(t))},Rt.pushO=function(t){this.rgStk.push(new K.E.Oper(t))},Rt.pushCase=function(t){this.rgStk.push(t)},Rt.IsEmpty=function(){return!this.rgStk.length},Rt.popE=function(){return this.rgStk.pop()},Rt.getE=function(){return this.IsEmpty()?null:this.rgStk[this.rgStk.length-1]},Rt.isO=function(t){return 32==t.type?t.isO(this.oOps):0},Rt.isC=function(t){return 17==t.type},Rt.isCase=function(t){return 20==t.type},Rt.IsValid=function(){var t=0;return this.rgStk.forEach(function(n){var i=this.isO(n);t++,i&&(t-=i)},this),1==t},Rt.optimize=function(){function t(t){return!this.mUnopt.get(t)}K.debug&&this.Debug&&(this.sUnoptimizedDebug=this.Debug());for(var n=this.rgStk,i=!0;i;){i=!1;for(var e=!0,r=0;e&&r0;a--){var u=r-a;u>=0&&(h&=this.isC(n[u]))}if(h&&r>=s){var c=o.callback;if(t.call(this.oOps,c)){var l,f=1==s,g=Tt.val(n[r-1]);f||(l=g,g=Tt.val(n[r-2]));var d=c(g,l);n.splice(r,1),r--,f||(n.splice(r,1),r--),n[r].const=d,e=!1,i=!0}}}}}},K.E.Op=function(t,n,i,e){this.Name=t,this.Callback=n,this.Priority=i||0,this.Type=W(e,2)},K.E.Ops=function(t){this.type=t,this.rgOp=[],this.mMch=new Map,this.mN=new Map,this.mCBK=new Map,this.mUnopt=new Map};var bt=K.E.Ops.prototype;bt.len=function(){return this.rgOp.length},bt.Add=function(t,n,i,e){t&&n&&this.rgOp.push(new K.E.Op(t,n,i,e))},bt.AddType=function(t){function n(t){var n=K.EO;switch(t){case 1:this.Add("+",n.ADD,10),this.Add("-",n.SUBTRACT,10),this.Add("*",n.MULTIPLY,20),this.Add($,n.DIVIDE,20);break;case 2:this.Add("or",n.OR,0),this.Add("and",n.AND,1),this.Add("not",n.NOT,2,1),this.Add(et,n.LESS,5),this.Add(et+it,n.LESSE,5),this.Add(it,n.EQUAL,5),this.Add("!"+it,n.NEQUAL,5),this.Add(rt,n.GREAT,5),this.Add(rt+it,n.GREATE,5);break;case 4:this.Add("startwith",n.SWITH,5),this.Add("endwith",n.EWITH,5),this.Add("contains",n.CONTAINS,5),this.Add("lfind",n.LFIND,5),this.Add("rfind",n.RFIND,5),this.Add("count",n.COUNT,5),this.Add("left",n.LEFT,5),this.Add("right",n.RIGHT,5),this.Add("lpad",n.LPAD,5),this.Add("rpad",n.RPAD,5),this.Add("concat",n.CONCAT,5),this.Add("mid",n.MID,5),this.Add("format",n.FORMAT,5),this.Add("in",n.INSET,5),this.Add("array",n.ARRAY,5),this.Add("switch",n.SWITCH,5),this.Add("split",n.SPLIT,10),this.Add("case",n.CASE,5),this.Add("replace",n.REPLACE,0),this.Add("with",n.WITH,0),this.Add("len",n.LEN,30,1),this.Add("type",n.TYPE,30,1),this.Add("lower",n.LOWER,30,1),this.Add("upper",n.UPPER,30,1),this.Add("proper",n.PROPER,30,1),this.Add("ltrim",n.LTRIM,30,1),this.Add("rtrim",n.RTRIM,30,1),this.Add("trim",n.TRIM,30,1),this.Add("int",n.INT,30,1),this.Add("round",n.ROUND,30,1),this.Add("floor",n.FLOOR,30,1),this.Add("abs",n.ABS,30,1),this.Add("str",n.STR,30,1),this.Add("currency",n.CURRENCY,30,1),this.Add("time",n.TIME,30,1),this.Add("timeF",n.TIMEF,30,1),this.Add("shortdate",n.SHORTDATE,30,1),this.Add("shortdateF",n.SHORTDATEF,30,1),this.Add("longdate",n.LONGDATE,30,1),this.Add("dbl",n.DBL,30,1),this.Add("date",n.DATE,30,1),this.UOAble(n.DATE),this.Add("dateS",n.DATES,30,1),this.Add("dateF",n.DATEF,30,1),this.Add("year",n.YEAR,30,1),this.Add("month",n.MONTH,30,1),this.Add("day",n.DAY,30,1),this.Add("yearday",n.YEARDAY,30,1),this.Add("weekday",n.WEEKDAY,30,1),this.Add("hour",n.HOUR,30,1),this.Add("min",n.MINUTE,30,1),this.Add("sec",n.SECOND,30,1),this.Add("reverse",n.REVERSE,30,1),this.Add("MIN",n.MIN,5),this.Add("MAX",n.MAX,5),this.Add("sqrt",n.SQRT,30,1),this.Add("sin",n.SIN,30,1),this.Add("cos",n.COS,30,1),this.Add("asin",n.ASIN,30,1),this.Add("acos",n.ACOS,30,1),this.Add(":=",n.STORE,0),this.UOAble(n.STORE),this.Add("=:",n.RESTORE,40,1),this.UOAble(n.RESTORE),this.Add("?",n.IIF,0),this.Add(tt,n.ELSE,0),this.Add("mod",n.MOD,20),this.Add("like",n.LIKE,20),this.Add("bitand",n.BITAND,20),this.Add("bitor",n.BITOR,20),this.Add("bitxor",n.BITXOR,20),this.Add("bitshift",n.BITSHIFT,20),this.Add("bitnot",n.BITNOT,30,1),this.Add("hex",n.HEX,30,1)}}for(var i=1;i<=t;)t&i&&n.call(this,i),i*=2},bt.Build=function(){this.mMch.clear(),this.mN.clear(),this.mCBK.clear(),this.rgOp.forEach(function(t){this.mN.set(t.Name,t),this.mCBK.set(t.Callback,t);for(var n=t.Name,i=t.Callback;n.length;)this.addMatch(n,i),n=T(n,0,n.length-1)},this)},bt.addMatch=function(t,n){var i=this.mMch.get(t);!i&&this.mMch.set(t,i=[]),i.push(n)},bt.getOp=function(t){return this.mCBK.get(t)},bt.cmpPriority=function(t,n){function e(t){var n=this.getOp(t);return n&&n.Priority||0}if(i(t))return 1;if(i(n))return-1;var r=e.call(this,t),o=e.call(this,n);return r==o?0:r=0;h--){var u=s[h],c=this.f2S(u);if(this.OpMatch(c,t,n))return{callback:u,fetched:c.length}}return null},bt.OpMatch=function(t,n,i){for(var e=!1,r=0,o=t.length,s=i,h=n.length;r1&&!this.rgStkOp[t-1]){var n=this.rgStkOp[t-2];return n==K.EO.INSET||n==K.EO.ARRAY||n==K.EO.SWITCH||n==K.EO.CASE}}.call(this))return!1;for(var e=[],r=0;r0))return;n=o[r-1],o[r-1]=e.callback(n,n);break;case 2:if(!((r=o.length)>1))return;i=o.pop(),n=o[--r-1],o[r-1]=e.callback(n,i)}if(1==o.length)return o[0]}},Tt.createCase=function(t){for(;t.currentChar()==j;)t.position++;if("("==t.currentChar()){t.position++;for(var n=new Map,i=!1,e=0,r=Z,o=Z,s=t.position;t.continue()&&!i;){var h=t.currentChar();switch(h){case"'":case"`":case'"':for(t.position++;t.continue();){if("\\"==t.currentChar())t.nextChar()==h&&t.position++;else if(t.currentChar()==h)break;t.position++}}switch(h){case":":0==e&&(o=Z,r=T(t.expression,s,t.position-s),s=t.position+1);break;case";":0==e&&(o=T(t.expression,s,t.position-s),s=t.position+1,n.set(r,o),r=Z,o=Z);break;case"(":e++;break;case")":e>0?e--:(n.set(r,T(t.expression,s,t.position-s)),i=!0)}t.position++}if(i){var a=new K.E.Case,u=!0;if(n.forEach(function(t,n){u&&(u=a.addCase(this,O(n),O(t)))},this),u)return a}}return null},K.CExpr=function(t){this.sCE=O(P(t)),this.bP=!1,this.bV=!1,this.rgoE=[null,null,null,null]};var yt=K.CExpr.prototype;yt.parse=function(){function t(){this.reset();var t,n=this.sCE;if(n.sWith("[")&&n.eWith("]")){n=T(n,1,n.length-2);var i=this.rgoE.length;n.splitP(",",i).forEach(function(n,i){var e=function(t){var n=K.E.Create(t,"x,y,width,height");return n.parse()?n:null}(n);(this.rgoE[i]=e)&&(t=!0)},this)}return t}return this.bP||(this.bP=!0,this.bV=t.call(this)),this.bV},yt.reset=function(){this.rgoE=[null,null,null,null]},yt.Evaluate=function(t){return this.parse(),this.bV&&(t=K.C2R(t),this.rgoE.forEach(function(n,i){n&&(t[i]=n.Evaluate(function(n){return t[-n-1]}))})),t},K.Like=function(){function t(t){var n=i.get(t);return!n&&i.set(t,n=new K.MW(t)),n}var i=new Map;return{Match:function(i,e){return n(t(e).Match(i))},Mask:function(n){return t(n)},XC:function(){i.clear()}}}(),K.MW=function(t,n,e){this.bCS=e,this.cPS=i(n)?j:n.toString(),this.rgPn=[],this.Set(this.sM=t)};var Ot=K.MW.prototype;Ot.Set=function(t){function n(t){if(t){var n=new K.MW.PN(t,this.matchWord);switch(n.len()){case 1:switch(n.at(0).nElT){case 16:n.Match=this.is,n.Mask=n.at(0).E;break;case 1:n.Match=this.endWith,n.Mask=n.at(0).E;break;case 4:n.Match=this.anything,n.Mask=n.at(0).E}break;case 2:if(4==n.at(1).nElT)switch(n.at(0).nElT){case 16:n.Match=this.startWith,n.Mask=n.at(0).E;break;case 1:n.Match=this.has,n.Mask=n.at(0).E}}this.rgPn.push(n)}}t=i(t)?Z:t.toString(),this.sM=t,this.rgPn=[];for(var e=Z,r=ut,o=0,s=t.length,h="\0",a="\0";o=0&&o>=0;s--,o--)if(r(t[s])!=r(e[o]))return!1;if(o<0)return i.FAt=t.length-e.length,i.FLen=e.length,!0},Ot.has=function(t,n){for(var i=n.at(0),e=i.E,r=this.cbkCS(),o=t.length,s=e.length,h=0;hanchor",visitAnchorFormat:"anchor"}}}();var xt="rgba(0,0,0,.1)",Pt="rgba(0,0,0,.15)",Wt="rgba(0,0,0,.3)",It="rgba(0,0,0,.5)",Lt="[x+(width-8)/2,y+(height-8)/2,8,8]";K.Shapes={ScrollBar:{background:{tRange:{normal:{fillColor:"rgba(0,0,0,.25)",pad:-2},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,0.375)"},click:{fillColor:It}},range:{normal:{fillColor:"#F0F0F0",frameColor:"#C0C0C0",opacity:.25},hover:{opacity:1}},button:{normal:{frameColor:xt,fillColor:xt},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.2)"},click:{fillColor:It}},buttonCircle:{normal:{frameColor:xt,fillColor:xt,primitive:"Circle",client:"[x+(width-16)/2, y+(height-16)/2,16,16]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.2)"},click:{fillColor:It}},thumb:{normal:{fillColor:Wt,client:"[x+1,y+1,width-2,height-2]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},hThumb:{normal:{fillColor:Wt,client:"[x,y+2,width,height-4]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},vThumb:{normal:{fillColor:Wt,client:"[x+2,y,width-4,height]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},hThumbLite:{normal:{fillColor:Wt,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x,y+(height-6)/2,width,6]"},disabled:{fillColor:Pt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},vThumbLite:{normal:{fillColor:Wt,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x+(width-6)/2,y,6,height]"},disabled:{fillColor:Pt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},circle:{normal:{fillColor:"#A0A0A0",shadow:{blur:8,color:"black"},primitive:"Circle",client:"[x+(width-16)/2,y+(height-16)/2,16,16]"},disabled:{fillColor:"#C0C0C0",shadow:{blur:0}},hover:{pad:4},click:{fillColor:"#C0C0C0"}},hThumbCircle:{normal:{fillColor:Wt,primitive:"RoundRect",pArg:{x:-8,y:8},client:"[x,y+(height-16)/2,width,16]"},disabled:{fillColor:Pt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},vThumbCircle:{normal:{fillColor:Wt,primitive:"RoundRect",pArg:{x:8,y:-8},client:"[x+(width-16)/2,y,16,height]"},disabled:{fillColor:Pt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:It}},back:{},vBackCircle:{normal:{fillColor:xt,primitive:"RoundRect",pArg:{x:8,y:-8},client:"[x+(width-16)/2,y,16,height]"},hover:{fillColor:"rgba(0,0,0,.2)"}},hBackCircle:{normal:{fillColor:xt,primitive:"RoundRect",pArg:{x:-8,y:8},client:"[x,y+(height-16)/2,width,16]"},hover:{fillColor:"rgba(0,0,0,.2)"}},hProgress:{normal:{fillColor:xt,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x+16,y+(height-6)/2,width-32,6]"}},vProgress:{normal:{fillColor:xt,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x+(width-6)/2,y+16,6,height-32]"}}},foreground:{button:{},thumb:{},back:{}},overlay:{left:{normal:{client:Lt,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3,startAngle:-lt/2}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},right:{normal:{client:Lt,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3,startAngle:lt/2}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},up:{normal:{client:Lt,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},down:{normal:{client:Lt,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3,startAngle:+lt}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},leftLite:{normal:{client:"[x+(width-6)/2,y+(height-10)/2,6,10]",fillColor:Wt,primitive:"EllipticPolygon",pArg:{edges:3,startAngle:-lt/2}},disabled:{fillColor:Pt},hover:{pad:1},click:{fillColor:It}},rightLite:{normal:{client:"[x+(width-6)/2,y+(height-10)/2,6,10]",fillColor:Wt,primitive:"EllipticPolygon",pArg:{edges:3,startAngle:lt/2}},disabled:{fillColor:Pt},hover:{pad:1},click:{fillColor:It}},upLite:{normal:{client:"[x+(width-10)/2,y+(height-6)/2,10,6]",fillColor:Wt,primitive:"EllipticPolygon",pArg:{edges:3}},disabled:{fillColor:Pt},hover:{pad:1},click:{fillColor:It}},downLite:{normal:{client:"[x+(width-10)/2,y+(height-6)/2,10,6]",fillColor:Wt,primitive:"EllipticPolygon",pArg:{edges:3,startAngle:+lt}},disabled:{fillColor:Pt},hover:{pad:1},click:{fillColor:It}}}},Empty:{},FrameSel:{normal:{frameColor:"rgba(64,128,255,.5)",fillColor:"rgba(64,128,255,.25)",primitive:"RoundRect"},disabled:{opacity:.5}},FrameFit:{normal:{frameColor:"gray",fillColor:"white",primitive:"RoundRect",pArg:{x:4,y:4},frameDash:2,opacity:.5}},CheckBox:{normal:{pad:-1,fillColor:"white",frameColor:"gray",primitive:"Rect",draw:function(t,n,i,e){e&&e.state&&K.D.P.fill(t,K.IRt(i.slice(),.2*-i[2],.2*-i[2]),"#666666",this.primitive,this.primitiveArg)}},disabled:{opacity:.5}},Radio:{normal:{pad:-1,fillColor:"white",frameColor:"gray",primitive:"Circle",draw:function(t,n,i,e){e&&e.state&&K.D.P.fill(t,K.IRt(i.slice(),.2*-i[2],.2*-i[2]),"#666666",this.primitive,this.primitiveArg)}},disabled:{opacity:.5}},Button:{normal:{fillColor:"#C0C0C0",frameColor:"gray"},disabled:{opacity:.5},click:{fillColor:"rgb(164,164,164)",frameColor:"rgb(80,80,80)"}},Expand:{normal:{pad:-4,fillColor:"white",frameColor:"rgba(0,0,0,.25)",draw:function(t,n,i,e){var r=K.IRt(i.slice(),.2*-i[2],.2*-i[2]);t.drawHLine([r[0],r[1]+r[3]/2],r[2],"black"),!(e&&e.state)&&t.drawVLine([r[0]+r[2]/2,r[1]],r[3],"black")}},disabled:{opacity:.5}},Border:{normal:{pad:-.5,frameColor:It},disabled:{opacity:.5}},No:{normal:{pattern:6,patternColor:"rgba(0,0,0,.25)"}}},K.Intl=function(){function t(){var t,i,e,o=String(K.Def.Intl.firstWeekDay),s=K.WeekDayEnum;o&&o.splitP(",").forEach(function(o){(o=O(o))&&(t=y(o,"("))>=0&&(e=T(o,0,t))&&(e="ex"+e.toProper())in s&&(o=T(o,t+1),(i=y(o,")"))>=0&&(o=T(o,0,i)),o&&function(t,i){n(i)&&(i=A(String(i)))&&i.split(",").forEach(function(n){(n=O(n))&&r.set(n,t)})}(s[e],o))})}function i(){var t,i,e,r=String(K.Def.Intl.weekNumberAs),s=K.WeekNumberAsEnum;r&&r.splitP(",").forEach(function(r){(r=O(r))&&(t=y(r,"("))>=0&&(e=T(r,0,t))&&(e="ex"+e.toProper()+"WeekNumber")in s&&(r=T(r,t+1),(i=y(r,")"))>=0&&(r=T(r,0,i)),r&&function(t,i){n(i)&&(i=A(String(i)))&&i.split(",").forEach(function(n){(n=O(n))&&o.set(n,t)})}(s[e],r))})}function e(){s=function(){var t=!1;try{(new Date).toLocaleDateString("'i'")}catch(n){t="RangeError"==n.name}return t}(),r.clear(),o.clear(),t(),i()}var r=new Map,o=new Map,s=!0;return e(),{Init:e(),GetFirstWeekDay:function(t){var n,i=(t=t||null)||A(K.Def.Locale.language||K.lang()),e=r.get(i);return void 0==e&&(n=y(i,"-"))>=0&&(i=T(i,0,n))&&(e=r.get(i)),e||0},GetWeekNoAs:function(t){var n,i=(t=t||null)||A(K.Def.Locale.language||K.lang()),e=o.get(i);return void 0==e&&(n=y(i,"-"))>=0&&(i=T(i,0,n))&&(e=o.get(i)),e||0},SupportLocales:s}}(),K.Loc=function(){function t(){s.clear(),a=[],r()}function e(t){t=t||null;var n,e,r,a=s.get(t);if(void 0===a){var u=K.Intl.SupportLocales?t||(K.Def.Locale.language||K.lang()):"en-us";a=K.Cpy(K.Def.Locale);try{a.language=P(u),n=function(t){var n=[];if(K.Intl.SupportLocales)for(var i=0;i=0)return{group:O(T(t,0,n++)),parts:O(T(t,n,i-n))}}}(t);if(i){var e=i.group;e&&i.parts.split(",").forEach(function(t){if(t=O(t)){var i=n.get(t);i?i.indexOf(e)<0&&i.push(e):n.set(t,[e])}})}}),n}function n(n,e){var r=i.get(e=P(e));return!r&&i.set(e,r=t(e)),r.get(n)}var i=new Map;return{Get:function(t,i){var e=n(t,i);if(e)return e[e.length-1]},GetAll:n,XC:function(){i.clear()}}}(),K.S=function(){function t(t,n,i){function o(t){for(var n=K.Shapes,i=O(String(t)).split(ot),e=0,r=i.length;n&&e0&&K.IRt(u,l/2,l/2),!K.EyR(u)||r.draw){t.save(),n(r.opacity)&&(t.globalAlpha=W(r.opacity,1)),l>1&&(t.lineWidth=l),r.frameDash&&t.setLineDash(o(r.frameDash)?r.frameDash:[r.frameDash]),r.frameJoin&&(t.lineJoin=r.frameJoin),r.frameCap&&(t.lineCap=r.frameCap);var g=r.shadow;if(!l&&n(f)&&(n(g)&&i(g.color)&&((g=K.Cpy(g)).color=f),f=null),K.D.P.fillS(t,u,r.fillGradientColor?K.Grad.Create(t,r.fillColor,r.fillGradientColor,u):r.fillColor,f,g,r.primitive,r.pArg||s),r.pattern&&K.D.P.fillP(t,u,M(r.pattern,K.PatternEnum),r.patternColor,r.primitive,r.pArg||s),a=h(s&&s.text,r.text),n(a)){var d=M(h(s&&s.formatText,r.formatText),K.DrawTextFormatEnum,262181),v=h(s&&s.clipText,r.clipText),p=h(s&&s.padText,r.padText),C=h(s&&s.clientText,r.clientText),S=c.slice(),m=r.tfi?K.TFI.bCTX(t,r.tfi):null;v&&t.selClip(u,r.primitive,r.pArg),p&&K.PRt(S,p),C&&(S=K.E.EvalCE(S,C)),t.drawHTMLText(a,S,d),v&&t.resClip(),m&&K.TFI.eCTX(t,m)}r.draw&&r.draw.call(r,t,e,u,s),t.restore()}}return u},Get:t,GetOf:function(n,i,e){var o=n;if(s(n)){var h=Z+e+i+n;if(void 0===(o=r.get(h))){var a,u,c=[];if(n.split(",").forEach(function(n){n&&((u=K.GP.GetAll(n,i))?u.forEach(function(n){(l=t(n,e))&&c.push(l)}):(l=t(n,e,!0))&&c.push(l))}),a=c.length){var l=c[0];if(1==a)o=l;else{o=K.Cpy(l);for(var f=1;f=0&&e>=0?K.Cmp.N(i,e):i<0&&e<0?K.Cmp.N(t,n):i<0?1:-1}return 0}),i.forEach(function(t){n=function(t,n){return n&&(t&&(t+=C),t+=n),t}(n,e(t))})}return n}function u(t){var i=E;return t&&void 0===(i=m.get(t))&&m.set(t,i=function(t){var i=new K.Arr,e=K.Cpy(d);return t.split(C).forEach(function(t){var e=r(t);n(e)&&i.add(e)}),i.forEach(function(t){switch(t){case v.ALT:e.alt=!0;break;case v.CTRL:e.ctrl=!0;break;case v.SHIFT:e.shift=!0;break;case v.META:e.meta=!0;break;default:e.keyCode=t}}),e}(t)),i}function c(t){var n=new K.Arr;return void 0!==t.shift&&t.shift&&n.add(v.SHIFT),void 0!==t.meta&&t.meta&&n.add(v.META),void 0!==t.ctrl&&t.ctrl&&n.add(v.CTRL),void 0!==t.alt&&t.alt&&n.add(v.ALT),void 0!==t.keyCode&&0!=t.keyCode&&n.add(t.keyCode),n}function l(t){var i=t;return n(t)&&(s(t)||a(t))&&(i=u(t+Z)),i}function f(t){var n=l(t);return n&&(c(n).len()||(n=null)),n}function g(t,n,i){if(t){var e=o(n,i);if(e)return function(t,n){return t===n||(t&&n?c(l(t)).equal(c(l(n))):void 0)}(e,l(t))}}var d={alt:!1,ctrl:!1,meta:!1,shift:!1,keyCode:0},v={LButton:1,RButton:2,Cancel:3,MButton:4,XButton1:5,XButton2:6,Backspace:8,Tab:9,Clear:12,Enter:13,Return:13,SHIFT:16,CTRL:17,Control:17,ALT:18,Menu:18,Pause:19,CapsLock:20,Capital:20,Kana:21,Hangeul:21,Hangul:21,Junja:23,Final:24,Hanja:25,Kanji:25,Escape:27,Esc:27,Convert:28,NonConvert:29,Accept:30,ModeChange:31,Space:32,PageUp:33,Prior:33,PageDown:34,Next:34,End:35,Home:36,ArrowLeft:37,Left:37,ArrowUp:38,Up:38,ArrowRight:39,Right:39,ArrowDown:40,Down:40,Select:41,Print:42,Execute:43,PrintScreen:44,PrintScr:44,Snapshot:44,Insert:45,Delete:46,Help:47,META:91,WIN:91,LWin:91,RWin:92,ContextMenu:93,Apps:93,Sleep:95,NumPad0:96,NumPad1:97,NumPad2:98,NumPad3:99,NumPad4:100,NumPad5:101,NumPad6:102,NumPad7:103,NumPad8:104,NumPad9:105,Multiply:106,Add:107,Separator:108,Subtract:109,Decimal:110,Divide:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,F20:131,F21:132,F22:133,F23:134,F24:135,NumLock:144,ScrollLock:145,Scroll:145,OEM_NEC_EQUAL:146,OEM_FJ_JISHO:146,OEM_FJ_MASSHOU:147,OEM_FJ_TOUROKU:148,OEM_FJ_LOYA:149,OEM_FJ_ROYA:150,LSHIFT:160,RSHIFT:161,LCONTROL:162,RCONTROL:163,LMENU:164,RMENU:165,BrowserBack:166,BrowserForward:167,BrowserRefresh:168,BrowserStop:169,BrowserSearch:170,BrowserFavorites:171,BrowserHome:172,VolumeMute:173,VolumeDown:174,VolumeUp:175,MediaNextTrack:176,MediaPrevTrack:177,MediaStop:178,MediaPlayPause:179,LaunchMail:180,LaunchMediaSelect:181,LaunchApplication1:182,LaunchApplication2:183,OEM_1:186,Plus:187,OEM_PLUS:187,Comma:188,OEM_COMMA:188,Minus:189,OEM_MINUS:189,Period:190,OEM_PERIOD:190,Slash:191,OEM_2:191,OEM_3:192,OEM_4:219,Backslash:220,OEM_5:220,OEM_6:221,OEM_7:222,OEM_8:223,OEM_AX:225,OEM_102:226,ICO_HELP:227,ICO_00:228,PROCESSKEY:229,ICO_CLEAR:230,PACKET:231,OEM_RESET:233,OEM_JUMP:234,OEM_PA1:235,OEM_PA2:236,OEM_PA3:237,OEM_WSCTRL:238,OEM_CUSEL:239,OEM_ATTN:240,OEM_FINISH:241,OEM_COPY:242,OEM_AUTO:243,OEM_ENLW:244,OEM_BACKTAB:245,ATTN:246,CRSEL:247,EXSEL:248,EREOF:249,PLAY:250,ZOOM:251,NONAME:252,PA1:253,OEM_CLEAR:254},p=t.prototype;p.add=function(t,n){void 0===this.rgK2N[t]&&(this.rgK2N[t]=n),this.mN2K.set(A(n),t)},p.f2S=function(t){return t>=0&&t<256&&this.rgK2N[t]||null},p.n2C=function(t){return this.mN2K.get(A(O(t)))||null};var C="+",S=new t,m=new Map,E=K.Cpy(d),w=new K.Arr(v.ALT,v.CTRL,v.SHIFT,v.META);return{StEy:f,IsStEv:g,ToSt:o,St2Str:h,Str2St:u,GetSt:l,ModK:function(t){var n=0,i=f(t);return i&&(i.shift&&(n|=1),i.ctrl&&(n|=2),i.alt&&(n|=4),i.meta&&(n|=16)),n},IsModK:function(t){var n=!1,i=f(t);return i&&(n=i.shift||i.meta||i.ctrl||i.alt),n},f2S:e,n2C:r}}(),K.Sts=function(){this.mS=new Map};var Mt=K.Sts.prototype;Mt.toS=function(t){return K.K.StEy(t)},Mt.Has=function(t,n){r=this.toS(t);if(r){var i=this.mS.get(K.K.St2Str(r));if(i){if(!n){var e=[];return i.forEach(function(t){e.push(t)}),e}var r;if(r=i.get(n))return[r]}}},Mt.Add=function(t,i,e,r,o){var s=!1,h=this.toS(t);if(s=!!h){e=e||null;var a=K.K.St2Str(h),u=this.mS.get(a);!u&&this.mS.set(a,u=new Map),u.set(e,{shortcut:a,description:r,callback:i||null,thisArg:e,keyState:n(o)?o:-1})}return s},Mt.Remove=function(t,n){var i=this.toS(t);if(i){var e=K.K.St2Str(i);if(n){var r=this.mS.get(e);r&&(r.delete(n),0==r.size&&this.mS.delete(e))}else this.mS.delete(e)}},Mt.Clear=function(){this.mS.clear()},Mt.RemoveOf=function(t){if(i(t))this.Clear();else{var n=[];this.forEach(function(i){i.thisArg==t&&n.push(i)}),n.forEach(function(t){this.Remove(t.shortcut,t.thisArg)},this)}},Mt.forEach=function(t,n){l(t)&&this.mS.forEach(function(i){i.forEach(function(i){t.call(n,i)})})},Mt.isLocked=function(t,n){var i,e=K.RUR.Rng();return e||(i=this.Has(t))&&i.length>1&&i.forEach(function(t){t.thisArg&&t.thisArg.nAXChg&&(e=t.thisArg!=n)}),e},Mt.onkey=function(t,n){var i=K.K.ToSt(t,n);if(i){if(K.RUR.ModKeys.value)return void(K.IsModK(t)||(K.RUR.ModKeys.value=0));var e=!1,r=K.K.St2Str(i),o=this.mS.get(r);o&&o.forEach(function(t){t.keyState==n&&l(t.callback)&&(this.isLocked(t.shortcut,t.thisArg)||(e=!0,t.callback.call(t.thisArg,t)))},this),e&&K.SEP(t)}},K.D=function(){function t(){var t=K.Cpy(K.Def.Shape);return t.fillColor="white",t.frameColor="black",t.primitive="BevelRect",t}function i(){var t=K.Cpy(K.Def.Shape);return t.fillColor="white",t.frameColor="#808080",t.primitive=Z,t}function e(){var t=K.Cpy(K.Def.Shape);return t.pad=2,t.fillColor=null,t.frameColor="#808080",t.pattern=6,t.patternColor="rgba(128,128,128,0.5)",t}var r=[2,8,1,4];return{WindowSplitColor:"#E0E0E0",WindowSplit:function(t,n,i){X(t,n,K.D.WindowSplitColor)},WindowSplitSize:2,WindowSplitByFrames:!1,AnchorXChgInflate:8,AnchorXChgRect:function(t,n,i){i=Z+i;var e=t.sizeHTMLText(i),r=e.width+K.D.AnchorXChgInflate,o=e.height+K.D.AnchorXChgInflate/2;return[n[0]+n[2]-r-4,n[1]+4,r,o]},AnchorXChgShape:t(),AnchorXChgShapeMin:function(){var n=K.Cpy(t());return n.opacity=.5,n}(),AnchorXChgShapeClick:function(){var n=K.Cpy(t());return n.pad=2,n.fillColor="black",n.tfi={fgColor:"white"},n}(),AnchorXChgDockBorderColor:"#444444",AnchorXChgShapeDock:i(),AnchorXChgShapeParentDock:function(){var t=K.Cpy(K.Def.Shape);return t.fillColor="white",t.frameColor="black",t.shadow.blur=8,t}(),AnchorXChgShapeDockHover:function(){var t=K.Cpy(i());return t.fillColor=t.frameColor,t.tfi={fgColor:"white"},t}(),AnchorXChgDockTimeout:750,AnchorXChg:function(t,n,i,e){t.drawShape(n,i,{text:e})},TargetAnchorXChgShape:e(),TargetAnchorXChgSourceShape:function(){var t=K.Cpy(e());return t.opacity=.5,t.pattern=7,t}(),TargetAnchorXChg:function(t,n,i){t.drawShape(n,i)},AnchorXChgByAlpha:!1,WindowFrameColor:"#E0E0E0",WindowFrame:function(t,i,e,o){o=n(o)?o:K.D.WindowFrameColor,e?5!=e&&K.DrawEdge(t,i,r[e-1],o):K.D.P.fillS(t,i,null,o)},Background:null,Foreground:null,Opacity:null,HoverBackground:null,HoverForeground:null,HoverOpacity:null,HoverDuration:250,HoverOnClient:!1,HoverOverride:!1}}(),K.G=function(){function t(t){this.client=t.slice(),this.x=t[0],this.y=t[1],this.w=t[2],this.h=t[3],this.radiusX=this.w/2,this.radiusY=this.h/2,this.xm=this.x+this.radiusX,this.ym=this.y+this.radiusY}function h(){this.p1={x:0,y:0},this.p2={x:1,y:1},arguments.length&&this.Set.apply(this,arguments)}function a(t,n,i){return((u(n,i)*t+c(n,i))*t+l(n))*t}function u(t,n){return 1-3*n+3*t}function c(t,n){return 3*n-6*t}function l(t){return 3*t}function f(t,n){var i=e(n)-e(t),o=r(n)-r(t);return Math.sqrt(i*i+o*o)}function g(t){return E(Math.sin(lt/t))}function d(){return.5}function v(t,n,i){var o=[],s=e(t),h=r(t),a=e(n),u=r(n),c=E(a-s),l=E(u-h);if(c||l){i=S(1,i||1);for(var f=a-s<0?-1:1,g=u-h<0?-1:1,d=m(c,l),v=S(c,l),p=v,C=2*d-v,A=d<<1,w=d-v<<1,R=1-(b=c>=l?1:0),b=f*b,T=f*(T=1),R=g*R,y=g*(y=1),O=s,k=h,D=0;D=f?1:0,b=1-R,T=1,y=1;R*=g,T*=g,b*=d,y*=d;for(var O=0,k=u,D=c;s.call(h,k,D);O++)a.x=k,a.y=D,C<0?(C+=A,k+=R,D+=b):(C+=w,k+=T,D+=y);if(n(a.x)&&n(a.y))return a}}function C(t,n,i,o,s){var h=[];if(o&&(n||i)){s=S(1,s||1);for(var a=e(t),u=r(t),c=E(n),l=E(i),f=n<0?-1:1,g=i<0?-1:1,d=m(c,l),v=S(c,l),p=2*d-v,C=d<<1,A=d-v<<1,w=1-(R=c>=l?1:0),R=f*R,b=f*(b=1),w=g*w,T=g*(T=1),y=a,O=u,k=null,D=0;o(y,O);D++)k=[y,O],D%s==0&&(h.push(k),k=null),p<0?(p+=C,y+=R,O+=w):(p+=A,y+=b,O+=T);k&&h.push(k)}return h}function A(t,n,i,o){var s,h,a=[0,0,0,0];if(t)switch(n=n||0,i=i||0,s=e(t),h=r(t),M(o,K.CT)){case 17:a=[s,h,n,i];break;case 18:a=[s-n/2,h,n,i];break;case 20:a=[s-n,h,n,i];break;case 33:a=[s,h-i/2,n,i];break;case 36:a=[s-n,h-i/2,n,i];break;case 65:a=[s,h-i,n,i];break;case 66:a=[s-n/2,h-i,n,i];break;case 68:a=[s-n,h-i,n,i];break;default:a=[s-n/2,h-i/2,n,i]}return a}function w(t,n,i){return[e(t)+(e(n)-e(t))*i,r(t)+(r(n)-r(t))*i]}function R(t,n){var i,e,r=[0,0];if(t)switch(i=t[0],e=t[1],M(n,K.CT)){case 17:r=[i,e];break;case 18:r=[i+t[2]/2,e];break;case 20:r=[i+t[2],e];break;case 33:r=[i,e+t[3]/2];break;case 36:r=[i+t[2],e+t[3]/2];break;case 65:r=[i,e+t[3]];break;case 66:r=[i+t[2]/2,e+t[3]];break;case 68:r=[i+t[2],e+t[3]];break;default:r=[i+t[2]/2,e+t[3]/2]}return r}function b(t){return((t+P)%x+x)%x-P}function T(t){return 180*t/lt}function y(t,n){var i=e(t),o=r(t),s=e(n),h=r(n);return[m(i,s),m(o,h),E(s-i),E(h-o)]}function O(t,i,o){function s(t,n){return!(tv||np)}function h(t){return t>=0||E(t)<1e-6?1:-1}var a=null,u=e(i),c=r(i),l=e(o),f=r(o),g=t[0],d=t[1],v=K.ROf(t),p=K.BOf(t),C=s(u,c),S=C?1:-1,m=l-u,A=f-c,w=2147483647;if(m||A){var R=null,b=null,T=function(){var t=S*(l-u);return 0==t?w:S*(c-f)*(t<0?u-g:v-u)/t}();if(m<0?(R=C?g:v,b=c+S*T):(R=C?v:g,b=c+-S*T),!s(R,b)){var y=function(){var t=S*(f-c);return 0==t?w:S*(u-l)*(t<0?c-d:p-c)/t}();A<0?(R=u+S*y,b=C?d:p):(R=u+-S*y,b=C?p:d)}if(n(R)&&n(b)&&s(R,b)){var O=h(m),k=h(A),D=h(R-u),x=h(b-c);(R-u||b-c)&&(O!=D||k!=x)||(a=[R,b])}}return a}var k=t.prototype,x=360,P=180;k.a2P=function(t){return t=K.Def.G.getAngle(t),[this.xm+Math.cos(t)*this.radiusX,this.ym+Math.sin(t)*this.radiusY]},k.p2A=function(t){var n=e(t)-this.xm,i=r(t)-this.ym,o=-Math.atan(n*this.radiusY/(i*this.radiusX));return i>=0&&(o+=lt),o<0&&(o+=2*lt),o-K.Def.G.getAngle(lt/2)||0};var I=h.prototype;I.Set=function(){function t(t){return K.Def.G.Transitions[t]}var n,i,e=arguments,r=e.length;return 4==r?(this.SetP1({x:e[0],y:e[1]}),this.SetP2({x:e[2],y:e[3]})):2==r?(this.SetP1(e[0]),this.SetP2(e[1])):(o(i=o(n=e[0])?n:t(n))&&4==i.length||(i=t("linear")),i&&(this.SetP1({x:i[0],y:i[1]}),this.SetP2({x:i[2],y:i[3]}))),this},I.Get=function(t){function n(t){return function(t,n,i){return 3*u(n,i)*t*t+2*c(n,i)*t+l(n)}(t,this.p1.x,this.p2.x)}function e(t){return a(t,this.p1.x,this.p2.x)}return i(t)?t=this.GetP12():(t=h.adjustX(t),this.isL()||t&&t<1&&(t=function(t){return a(t,this.p1.y,this.p2.y)}.call(this,function(t,i){for(var r=0;r<4;r++){var o=n.call(this,i);if(0===o)return i;i-=(e.call(this,i)-t)/o}return i}.call(this,t,function(t){if(t>0&&t<1){for(var n=0,i=0,r=i;n<2&&t>(r=e.call(this,n));)i=r,n+=1/21;return i==r?t<.5?0:1:n-1/21+1/21*(t-i)/(r-i)}return t}.call(this,t))))),t},h.adjustX=function(t){return S(0,m(1,t))},I.onChange=function(t){this.p1.x=h.adjustX(this.p1.x),this.p2.x=h.adjustX(this.p2.x),this.onchange&&this.onchange.callback.call(this.onchange.thisArg||this,t,this)},I.isL=function(){return this.p1.x==this.p1.y&&this.p2.x==this.p2.y},I.SetP1=function(t){this.p1={x:W(e(t)),y:W(r(t))},this.onChange(1)},I.GetP1=function(){return{x:this.p1.x,y:this.p1.y}},I.SetP2=function(t){this.p2={x:W(e(t)),y:W(r(t))},this.onChange(2)},I.GetP2=function(){return{x:this.p2.x,y:this.p2.y}},I.GetP12=function(){return[this.p1.x,this.p1.y,this.p2.x,this.p2.y]},I.SetP12=function(){return this.Set.apply(this,arguments)},I.GetName=function(){function t(t,n){for(var i=0;i<4;i++)if(E(t[i]-n[i])>5e-4)return!1;return!0}if(this.isL())return"linear";var n=K.Def.G.Transitions,i=this.GetP12();if(n)for(var e in n)if(t(n[e],i))return e},I.Trans=function(t){var n,i,e,r,s=t;if(o(t)&&!this.isL()&&(n=t.length)>1){s=[],r=1/(n-1),i=t[0],e=t[n-1];for(var a,u=0,c=0;u=n?e:t[a])}return s};var L={t:.8284271242805504,w:function(t){return 2*S(1,t||1)+4},h:function(t){return this.w(t)/this.t}},G=function(){function t(t){var n,i=v.get(t);return i||(i=[],t&&34!=t&&(s(t)?t.split(","):[t]).forEach(function(e){if(n=g[e])34!=n&&i.push(n);else for(var r in g)(n=g[r])==(n&t)&&34!=n&&i.push(n)}),!i.length&&(i=d),v.set(t,i)),i}function n(n,i,e,r){var o,s=t(e),h=t(r);return 1==s.length&&1==h.length?o={cS:s[0],cE:h[0]}:s.forEach(function(t){var e=function(t,n,i){var e,r;return(i||d).forEach(function(i){r=~~K.G.Dist(t,K.G.R2C(n,i)),(!e||r=K.BOf(e))&&(!(S(n,i)<=e[0])&&!(m(n,i)>=K.ROf(e)))}function o(t){return 16&t?-17&t|64|15&t:64&t?-65&t|16|15&t:t}function h(t){return 16&t}function a(t){return 64&t}function u(t){return 4&t}function c(t){var n=!1;switch(t){case 17:case 18:case 33:n=!0}return n}function l(t){return W(t,12)}function f(t,n,e,r,s,g,d,v){function C(){var t=function(){var t=N==w;return t&&B==R?0:t?1:2}();if(t){if(t==D){var n=b.length-1;b[n][0]=w=N,b[n][1]=R=B}else b.push([w=N,R=B]);D=t}}function E(){B=k;var u=g,c=v;switch(y>0&&(u=o(g),c=-c),u){case 18:case 20:x&&20==u||(B-=c);break;case 66:case 68:B+=c;break;case 36:if(!x){var l=m(t[1]-r,s[1]-v),f=S(K.BOf(t)+r,K.BOf(s)+v);if(33==n)B=y<0?l:f;else{var d=i(e[1],e[0],e[0]+T,K.IRt(s.slice(),v+.5,v+.5));h(n)?B=d?l:K.BOf(s)+v:a(n)?B=d?f:s[1]-v:d&&(B=y<0?K.BOf(s)+v:s[1]-v)}}}}function A(){N=O,36==g&&(N+=v)}r=l(r),v=l(v);var w,R,b=[],T=~~(d[0]-e[0]),y=~~(d[1]-e[1]),O=d[0],k=d[1],D=0,x=!1;if(T>=0||p){N=e[0],B=e[1],b.push([w=N,R=B]);var P=!0;switch(n){case 33:N-=r,C();break;case 36:!function(){N+=r;var t=g;if(y>0&&(t=o(g)),!c(t)&&(y>0?s[1]-B:B-K.BOf(s))>v)switch(N=O,t){case 20:case 36:x=!0,N+=v}}(),C();break;default:(P=!function(){var i=!1;switch(n){case 68:i=h(g)&&y>v||u(g)&&s[1]-K.BOf(t)>v;break;case 20:i=a(g)&&-y>v||u(g)&&t[1]-K.BOf(s)>v}return i&&(x=36==g||g==n,A(),C(),E(),C()),i}())&&K.EyR(K.NRt(K.IRt(t.slice(),r-.5,r-.5),K.IRt(s.slice(),v-.5,v-.5)))&&function(){var e=r,o=!1,u=!1,l=!1,f=!1,d=!1,p=0,E=36==g;if(a(n)?(o=y<0)&&(o=!function(t){var n=!1;switch(g){case 68:case 66:case 36:n=!0}return n}()||Math.sign(y)!=Math.sign(e))&&(p=S(K.BOf(t)+r,K.BOf(s)+v),u=68!=n,l=18==g,f=36==g||20==g,(d=c(g)||-y0)&&(o=!function(t){var n=!1;switch(g){case 20:case 18:case 36:n=!0}return n}()||Math.sign(y)!=Math.sign(e))&&(p=m(t[1]-r,s[1]-v),u=20!=n,l=66==g,f=36==g||68==g,(d=function(t){var n=!1;switch(g){case 65:case 66:case 33:n=!0}return n}()||ys[0]-v)&&(B=p),C()),d){if(N=K.ROf(t)+r,l){var A=s[0]-v;N>A&&(N=S(N,K.ROf(s)+v))}C()}else x=!0,N=O,f&&(N+=v),C()}()}P&&(E(),C(),A(),C(),B=k,C()),N=O,B=k,C()}else p++,(b=f(s,g,d,v,t,n,e,r)).reverse(),p--;var W=b.length;if(W>2){var I=0,L=b[I][0],M=L,G=L,H=b[I][1],X=H,F=H;for(++I;Io&&(o=u,r=a)}return r}(t,n),o=R(t,r),s=R(n,r),h=t[2],a=t[3],u=n[2]-h,c=n[3]-a,l=f(s,o),g=u/l,d=c/l,p=v(o,s,i);e.push(t.slice());for(var C=1,m=p.length-1;C1&&!function(t){for(var n,i={m:[e(t[0]),r(t[0])],M:[e(t[0]),r(t[0])]},o=1;!n&&ogt;return n}(t)){for(var A,R,b=0;b0||C(l(A)-l(R))>0)&&E.push(R),A=R;if((u=E.length)>1){i=1-(i||0),o=W(o,.5),s?(E.push(E[0]),E.push(E[1]),E.splice(0,0,E[u-1])):(E.push([2*c(E[u-1])-c(E[u-2]),2*l(E[u-1])-l(E[u-2])]),E.splice(0,0,[2*c(E[0])-c(E[1]),2*l(E[0])-l(E[1])])),n&&n.splice(0),a.push([c(E[1]),l(E[1])]);for(var b=1,T=E.length-2;b1){var s=n(r)-1,a=s+2,u=i[s],c=i[a]/(o+1),l=0,f=0;t.sort(function(t,n){var i=t.oL,r=n.oL,o=R(e(t.io)),h=R(e(n.io));return l=S(A.cRut.defW(i["w"+o]),A.cRut.defW(r["w"+h])),i.c["p"+o][s]-r.c["p"+h][s]}),f=(l/=2)/(o-1),t.forEach(function(t,n){var i=t.oL;i.c["p"+R(t.io)][s]=u+c*(n+1),h(i)||(i.c.wS=i.c.wE=l+f*n)})}})})}(),96&C&&function(t){var n=new r(96&C);p.forEach(function(i){(function(t){return!t.nx&&(t.p||!u(t))})(i)&&(l(i,t),n.iCP(i))}),n=null}(t),b.Draw=m,p.forEach(function(n){f(t,n)}),p=m=C=null)}function h(t){return 1==t.t}function a(t){return 2==t.t}function u(t){return 3==t.t}function c(t){if(!t.p&&!t.c){t.c={};var n=A.cRut.cSE(t.s,t.e,t.cS,t.cE);if(t.c.cS=n.cS,t.c.cE=n.cE,t.c.pS=A.R2C(t.s,n.cS),t.c.pE=A.R2C(t.e,n.cE),a(t)){var e=i(t.cS)||34==t.cS,r=i(t.cE)||34==t.cE;if(e||r){var o=e?A.R2C(t.s):t.c.pS,s=r?A.R2C(t.e):t.c.pE;e&&(t.c.cS=34,t.c.pS=A.cL2R(t.s,o,s)||t.c.pS),r&&(t.c.cE=34,t.c.pE=A.cL2R(t.e,s,o)||t.c.pE)}}}}function l(t,i){if(n(t.t)&&(t.t=M(t.t,K.LinkTypeEnum)),c(t),!t.p){var e=i?i.lineWidth-1:0,r=A.cRut.defW(t.c.wS||t.wS)+e,o=A.cRut.defW(t.c.wE||t.wE)+e;if(t.p=a(t)?[t.c.pS,t.c.pE]:A.cRut.rect(t.s,t.c.cS,t.c.pS,r,t.e,t.c.cE,t.c.pE,o),h(t)){var s=t.p.length;s>2&&(t.p=[t.c.pS,A.cRut.direct(t.c.pS,t.p[1],r),A.cRut.direct(t.c.pE,t.p[s-2],o),t.c.pE])}}}function f(t,i){if(i.a&&(t.save(),n(i.a.width)&&(t.lineWidth=i.a.width),n(i.a.color)&&(t.fillStyle=t.strokeStyle=i.a.color),n(i.a.arrow)&&(t.fillStyle=i.a.arrow),n(i.a.style)&&t.setLineDash(o(i.a.style)?i.a.style:[i.a.style])),l(i,t),t.drawDir(i.p,i.d,u(i)?-1:0,i.a,i),n(i.text)){var e=function(t){for(var n,i=0,e=0,r=1,o=t.length;re&&(i=r-1,e=n);return i}(i.p),r=A.R2C(A.Rect(i.p[e],i.p[e+1])),s=t.sizeHTMLText(i.text,261);t.fillStyle=t.strokeStyle,t.drawHTMLText(i.text,A.C2R(r,s.width,s.height),261)}i.a&&t.restore()}var g=t.prototype;g.n=function(){if(this.xF>this.xT){this.dir=!1;var t=this.xF;this.xF=this.xT,this.xT=t}if(this.yF>this.yT){this.dir=!1;var n=this.yF;this.yF=this.yT,this.yT=n}},g.Size=function(){return this.h?this.xT-this.xF:this.yT-this.yF},g.X=function(){return this.xF},g.Y=function(){return this.yF},g.I=function(t){if(this.h){if(!t.h){if((i=t.X())>this.xF&&it.yF&&nthis.yF&&nt.xF&&ithis.xF+n&&tthis.yF+n&&ti){var s=t.I(o);n(s)&&o.ptCB(s[r],i)&&e.push(s[1-r])}})};var v=r.prototype;v.I=function(t,n,i){var e=new K.Arr;return this.mL2I.forEach(function(r,o){o!=t&&r.I(n,i,e)}),e.isEmpty()?null:e},r.P2K=function(t){return t[0]+"x"+t[1]},v.isCP=function(t){return this.rgCP.has(r.P2K(t))},v.addCP=function(t){this.rgCP.push(r.P2K(t))},r.getLinkWidth=function(t){return t.a&&t.a.width||1},v.olt=function(n,i,o){var s;if(E(i[0]-o[0])<1||E(i[1]-o[1])<1){var h=new t(i,o),a=3+r.getLinkWidth(n),u=2*a;if(h.Size()>u){var c,l=32==this.nT,f=h.dir;if(l||64!=this.nT&&(l=h.h),c=this.I(n,h,u)){c.sort(function(t,n){return t-n}),f||(c.reverse(),a=-a);var g=(c=c.byO()).length;if(h.h){for(var d=[0,h.Y()],v=0;v=p+2*a);)p=c[++v];d[0]=l?p+a:(d[0]+p+a)/2,s.push(d.slice()),l||(d[0]=p+a),d[1]+=a,s.push(d.slice())}}else for(var d=[h.X(),0],v=0;v=C+2*a);)C=c[++v];d[1]=l?C+a:(d[1]+C+a)/2,s.push(d.slice()),d[0]+=a,l||(d[1]=C+a),s.push(d.slice())}}var S=this.mL2I.get(n);!S&&this.mL2I.set(n,S=new e),S.add(h)}}return s},v.iCP=function(t){var n,i=[],e=0,r=t.p.length,o=t.p[e],s=o,h=!1;for(++e;e0&&(s=(t=S(0,m(t||0,a)))/a,r&&(s=t<=(h=D(a/2))?t/h:S(0,2-t/(a-h))),e=W(o,1)*(i+(e-i)*s))}return e}var s=new K.Arr,h=new K.Lts,a=K.N.Trans(0,1,100);h.add("sa"),h.add("ea");var u=i.prototype;return u.hasCTX=function(){return this.ctx instanceof CanvasRenderingContext2D},u.gradAlpha=function(){return this.hasCTX()&&this.nAlphaFrom!=this.nAlphaTo},u.LockRun=function(){this.lRun++},u.UnlockRun=function(){this.isRunning()&&0!=--this.lRun||(s.remove(this),this.RestoreAlpha(),this.docbk(-6),h.ea.do(this))},u.isRunning=function(){return 0!=this.lRun},u.docbk=function(t){this.ncTA=S(0,t-this.icTA),this.icTA=t;var i=null;if(this.nTA>0)switch(t){case-1:case-2:case-3:i=this.rgTA[0];break;case-4:case-5:case-6:e=this.rgTA.length;i=this.rgTA[e-1];break;default:var e=this.rgTA.length;i=this.rgTA[S(0,m(t,e-1))]}var r=null;this.hasCTX()&&(r=this.ctx.globalAlpha);var o=this.callback.call(this.thisArg,this.ctx,i,this);n(r)&&(this.ctx.globalAlpha=r),n(o)&&this.rgResults.push(o)},u.startTimeout=function(){if(this.isRunning()||(this.LockRun(),this.docbk(-3)),this.isRunning()){var t=this;this.hRun=setTimeout(function(){t.isRunning()&&t.runTimeout()},this.nDelayTimeout)}},u.runTimeout=function(){var t=S(Math.floor((this.GetEllapsed()-this.ndTA)/this.ndTA),S(0,this.icTA)+1);if(t=0&&this.icTAt.iTA&&(t.iTA=m(i,t.nTA),t.iTA0?(this.docbk(-2),this.hDelay=setTimeout(function(){t.exeRun()},this.delay)):t.exeRun()}},u.xRun=function(){n(this.hRun)&&(K.raf?K.XAF(this.hRun):clearTimeout(this.hRun),this.hRun=null)},u.Cancel=function(){if(this.hDelay&&(clearTimeout(this.hDelay),this.hDelay=null),this.isRunning()&&this.xRun(),this.bOnCancelDoLast){var t=this.nTA-1;this.icTA!=t&&(this.hasCTX()&&(this.ctx.globalAlpha=this.GetAlpha(t)),this.docbk(t))}this.docbk(-4),this.lRun=0,this.UnlockRun()},u.GetEllapsed=function(){return K.Tick()-this.nTime},u.GetRemains=function(){return S(this.duration-this.GetEllapsed())},u.GetCurrent=function(){return this.icTA},u.GetCurrentCount=function(){return this.ncTA},u.GetCurrentReverse=function(){var t=this.nTA;return this.icTA<0?t:this.icTA>=t?-1:t-1-this.icTA},u.GetTA=function(){return this.rgTA},u.SetTA=function(t){switch(this.GetStatus()){case-2:case-3:case-1:this.rgTA=t.slice(),n(this.sTT)&&"linear"!=this.sTT&&(this.rgTA=K.TransA(t,this.sTT)),this.SetTACount(this.rgTA.length),this.ncTA=0,this.hasCTX()&&(this.nga=this.ctx.globalAlpha)}},u.GetTACount=function(){return this.nTA},u.SetTACount=function(t){switch(this.GetStatus()){case-2:case-3:case-1:this.nTA=S(0,~~t),this.ndTA=this.nDelayTimeout=this.nTA?this.duration/this.nTA:0}},u.GetTransition=function(t){var i=this.rgTA.length;if(i>0)return n(t)||this.GetCurrent(),t=S(0,m(t,i-1)),this.rgTA[t]},u.GetStatus=function(){var t=this.GetCurrent();return t<0?t:this.isRunning()?t<0?-3:t>=this.nTA?-5:0:-2},u.GetProgress=function(){var t=this.nTA-1;return t>0?S(0,m(this.GetCurrent(),t))/t:1},u.computeAlpha=function(t,n){return this.gradAlpha()?o(t,n,this.GetAlphaFrom(),this.GetAlphaTo(),this.GetAlphaReturn(),this.GetGlobalAlpha()):this.nAlphaTo},u.GetAlpha=function(t){return this.computeAlpha(n(t)?t:this.GetCurrent(),this.nTA)},u.GetGlobalAlpha=function(){return this.nga},u.RestoreAlpha=function(){this.hasCTX()&&(this.ctx.globalAlpha=this.nga)},u.GetAlphaFrom=function(){return this.nAlphaFrom},u.GetAlphaTo=function(){return this.nAlphaTo},u.GetAlphaReturn=function(){return this.bAlphaReturn},u.GetResults=function(){return this.rgResults&&this.rgResults.length>0&&this.rgResults||null},{Run:function(t,n,i,r){return e(t,n,i,r)},Progress:r,Rng:function(t){var n=null;return s.len()&&(t instanceof i?n=s.has(t)?t:null:(n=s.first(),(t=O(P(t)))&&(n=null,s.forEachU(function(i){if(i.name==t)return n=i,!0})))),n},Cancel:function(t){var n=(t=O(P(t)))&&K.Like.Mask(t);return s.rgE.slice().forEach(function(t){(!n||n.Match(t.name))&&t.Cancel()}),s.len()},ComputeAlpha:o,Listeners:h}}(),K.D.P=function(){function t(t,n){t.rect.apply(t,n)}function o(t,n){var i=new K.G.Ellipse(n),e=K.Def.G.getKappa(i.radiusX),r=K.Def.G.getKappa(i.radiusY),o=i.x+i.w,s=i.y+i.h;t.moveTo(i.x,i.ym),t.bezierCurveTo(i.x,i.ym-r,i.xm-e,i.y,i.xm,i.y),t.bezierCurveTo(i.xm+e,i.y,o,i.ym-r,o,i.ym),t.bezierCurveTo(o,i.ym+r,i.xm+e,s,i.xm,s),t.bezierCurveTo(i.xm-e,s,i.x,i.ym+r,i.x,i.ym),t.lineTo(i.x,i.ym)}function s(n,i,o){if((o=o||this.points)&&o.length){n.moveTo(e(o[0]),r(o[0]));for(var s=1,h=o.length;s0?t=m(t,ft):t<0&&(t=S(t,-ft)),t}var u=new Map;return{Rect:t,RoundRect:function(t,i,e){e=n(e)?e:{x:this.x,y:this.y};var r,o,s=i[2],h=i[3],a=i[0],u=i[1];r=m(r=W(e.x,W(e,4)),s/2),o=m(o=W(e.y,W(e,4)),h/2),t.moveTo(a+r,u),t.lineTo(a+s-r,u),t.quadraticCurveTo(a+s,u,a+s,u+o),t.lineTo(a+s,u+h-o),t.quadraticCurveTo(a+s,u+h,a+s-r,u+h),t.lineTo(a+r,u+h),t.quadraticCurveTo(a,u+h,a,u+h-o),t.lineTo(a,u+o),t.quadraticCurveTo(a,u,a+r,u),t.lineTo(a+r,u)},BevelRect:function(t,i,e){e=n(e)?e:{x:this.x,y:this.y};var r,o,s=i[2],h=i[3],a=i[0],u=i[1];r=m(r=W(e.x,W(e,4)),s/2),o=m(o=W(e.y,W(e,4)),h/2),t.moveTo(a+r,u),t.lineTo(a+s-r,u),t.lineTo(a+s,u+o),t.lineTo(a+s,u+h-o),t.lineTo(a+s-r,u+h),t.lineTo(a+r,u+h),t.lineTo(a,u+h-o),t.lineTo(a,u+o),t.lineTo(a+r,u)},Ellipse:o,Pie:function(t,n,i,e){h.call(this,t,n,i,e),t.lineTo.apply(t,K.G.R2C(n))},Oval:function(t,n){var i=n[2]/2,e=n[3]/2,r=n[0]+i,o=n[1]+e;t.moveTo(r,o-e),t.bezierCurveTo(r+i,o-e,r+i,o+e,r,o+e),t.bezierCurveTo(r-i,o+e,r-i,o-e,r,o-e),t.lineTo(r,o-e)},Circle:function(t,n){var i=n.slice(),e=i[2],r=i[3],s=m(e,r);i[0]+=(e-s)/2,i[1]+=(r-s)/2,i[2]=i[3]=s,o(t,i)},Triangle:function(t,n){var i=n[2],e=n[3],r=n[0],o=n[1];t.moveTo(r,o+e),t.lineTo(r+i/2,o),t.lineTo(r+i,o+e),t.lineTo(r,o+e)},EllipticPolygon:function(t,i,e,r){e=W(n(e)?e:this.edges),r=W(n(r)?r:this.startAngle),e=S(3,~~e);var o=i[2]/2,s=i[3]/2,h=i[0]+o,a=i[1]+s,u=0,c=K.Def.G.getAngle(r),l=2*lt/e,f=h+Math.cos(c)*o,g=a+Math.sin(c)*s;for(t.moveTo(f,g),u++,c+=l;u0&&(n.restore(),t(n,--i))},Local:function(t,n){t.beginPath(),t.rect.apply(t,n),t.closePath(),t.clip()},OnReleaseClip:function(t,i,e){var r=B(t);r.lSC>0?(r.rgClipCbk=r.rgClipCbk||[],r.rgClipCbk.push({callback:i,thisArg:e})):n(t,i,e)}}}(),K.R=function(){function t(t,n,i){if(ni)return i}else{if(tn)return n}return t}function o(t,n){var e=t.from;return i(e)&&i(e=t[0])&&(e=n),e}function h(t,n){var e=t.to;return i(e)&&i(e=t[1])&&(e=n),e}function a(n,i,e){var r=C.Number;if(e){var s=o(i=i||K.ValueRangeDef,0),a=h(i,1),u=a-s,c=W(o(e,r));return u?c+(n=t(n,s,a)-s)/u*(W(h(e,r))-c):c}return r}function u(n,i,e){var r=C.Color;if(e){var s=o(i=i||K.ValueRangeDef,0),a=h(i,1),u=a-s,c=K.C.Convert(o(e,r));if(u){var l=h(e,void 0);if(void 0!==l){var f=K.C.Convert(l);if(c.compare(f)){var g=((n=t(n,s,a))-s)/u,d=D(c.a+g*(f.a-c.a));return c.IsTrans()?K.C.C2S(f.r,f.g,f.b,d):f.IsTrans()?K.C.C2S(c.r,c.g,c.b,d):K.C.C2S(D(c.r+g*(f.r-c.r)),D(c.g+g*(f.g-c.g)),D(c.b+g*(f.b-c.b)),d)}}}return c.ToS()}return r}function c(n,i,s){var a=C.Point;if(s){var u=o(i=i||K.ValueRangeDef,0),c=h(i,1),l=c-u,f=o(s,a);if(l){var g=h(s,a),d=((n=t(n,u,c))-u)/l,v=e(f),p=r(f);return{x:v+d*(e(g)-v),y:p+d*(r(g)-p)}}return f}return a}function l(t,n,i){var s,a,u,l,f,g,d,v,p=C.Rect;return i?(s=K.C2R(o(i,p)),a=K.C2R(h(i,p)),K.EqR(s,a)?s:(u=c(t,n,[s,a]),l=c(t,n,[[K.ROf(s),K.BOf(s)],[K.ROf(a),K.BOf(a)]]),f=e(u),g=r(u),d=e(l),v=r(l),[m(f,d),m(g,v),E(f-d),E(g-v)])):p}function f(t,i,e){function r(t){var n=K.V2T(t);switch(n){case 8:case 16:n=16}return n}var s,f,g,d,v,p=null;if(e&&n(s=o(e))&&n(f=h(e))&&(g=r(s),d=r(f),g==d))switch(g){case 8:case 16:p=a(t,i,{from:s,to:f});break;case 4:K.C.IsColor(s)&&(p=u(t,i,{from:s,to:f}));break;case 256:if(s.length==f.length)switch(s.length){case 2:(v=c(t,i,{from:s,to:f}))&&(p=[v.x,v.y]);break;case 4:p=l(t,i,{from:s,to:f})}}return p}function d(t,i,e){var r=null;if(e){var s=o(e,{}),a=h(e,{});r=K.DfO({},s);(function(t,i){var e=[];if(g(t)&&g(i))for(var r in t)n(t[r])&&n(i[r])&&e.push(r);return e})(r=K.DfO(r,a),a).forEach(function(e){var o=f(t,i,{from:s[e],to:a[e]});n(o)&&(r[e]=o)})}return r}function v(t,n,i){var e=null;if(i){e={};var r=o(i,{}),s=h(i,{});r.blur!=s.blur&&(e.blur=K.R.Number(t,n,{from:r.blur,to:s.blur})),r.x!=s.x&&(e.x=K.R.Number(t,n,{from:r.x,to:s.x})),r.y!=s.y&&(e.y=K.R.Number(t,n,{from:r.y,to:s.y})),r.color!=s.color&&(e.color=K.R.Color(t,n,{from:r.color,to:s.color}))}return e}function p(t,e,r){var s=null;if(r){var c=t<(o(e,0)+h(e,1))/2,l=o(r,{}),f=h(r,{});s=K.DfO(K.DfO({},l),f),l.fontSize!=f.fontSize&&(s.fontSize=a(t,e,{from:l.fontSize,to:f.fontSize})),l.bgColor!=f.bgColor&&(s.bgColor=u(t,e,{from:l.bgColor,to:f.bgColor})),l.fgColor!=f.fgColor&&(i(l.fgColor)?l.fgColor="black":i(f.fgColor)&&(f.fgColor="black"),s.fgColor=u(t,e,{from:l.fgColor,to:f.fgColor})),C.TFIUnRatio.forEach(function(t){l[t]!=f[t]&&(s[t]=c?l[t]:f[t],i(s[t])&&(s[t]=n(l[t])?l[t]:f[t]))})}return s}var C=K.Def.R;return{GetFrom:o,GetTo:h,Number:a,Color:u,Point:c,Rect:l,RectInc:function(t,i,e,r,o){var s=C.Rect;return n(e)?(r=r||0,o=o||r,l(t,i,{from:e,to:K.IRt(e.slice(),r,o)})):s},General:f,Object:d,Shadow:v,TFI:p,Shape:function(t,e,r){function c(t){return t&&(s(t)?K.ToTFI(t):t)||null}var l,f=o(r,{}),g=o(e,0);if(t==g)return f;l=K.DfO(K.DfO({},f),S);var S=h(r,{}),m=t<(g+h(e,1))/2;if(f.pad!=S.pad){var E=K.pad2A(f.pad),A=K.pad2A(S.pad);l.pad=[a(t,e,{from:E[0],to:A[0]}),a(t,e,{from:E[1],to:A[1]})]}if(f.padText!=S.padText){var E=K.pad2A(f.padText),A=K.pad2A(S.padText);l.padText=[a(t,e,{from:E[0],to:A[0]}),a(t,e,{from:E[1],to:A[1]})]}if(f.opacity!=S.opacity){var w=W(f.opacity,1),R=W(S.opacity,1);l.opacity=a(t,e,{from:w,to:R})}return f.frameSize!=S.frameSize&&(l.frameSize=a(t,e,{from:f.frameSize,to:S.frameSize})),f.shadow!=S.shadow&&(l.shadow=v(t,e,{from:f.shadow,to:S.shadow})),f.fillColor!=S.fillColor&&(l.fillColor=u(t,e,{from:f.fillColor,to:S.fillColor})),f.tfi!=S.tfi&&(l.tfi=p(t,e,{from:c(f.tfi),to:c(S.tfi)})),f.frameColor!=S.frameColor&&(l.frameColor=u(t,e,{from:f.frameColor,to:S.frameColor})),f.patternColor!=S.patternColor&&(l.patternColor=u(t,e,{from:f.patternColor,to:S.patternColor})),f.pArg!=S.pArg&&(l.pArg=d(t,e,{from:f.pArg,to:S.pArg})),C.ShapeUnRatio.forEach(function(t){f[t]!=S[t]&&(l[t]=m?f[t]:S[t],i(l[t])&&(l[t]=n(f[t])?f[t]:S[t]))}),l}}}(),K.Mrg(K,function(){function t(t){var n=Z;if(t)for(var i,e,r=0,o=t.length;r=0||K.Like.Match(t,n)}var i;try{var e=K[t("hsg")][t("mpdbujpo")],r=function(i){var e=0;return"f"!=A(i[t("qspupdpm")])[0]?e=n(i[t("iptuobnf")],t("nqecnjquv"))?-1:1:n(i[t("qbuiobnf")],t("I|srxvsp3NW"))||(e=-1),e}(e);if(r){var o=e[t("iptu")].replace(/^www\.|:.*$/gm,"");if(r<0||!n(o,t("h{rqwuro1-"))){var s,h=!0,a=t(w);if(!a&&r<0&&(h=(s=Date[t("Rs{")].call(null)).getHours()%12==s.getDate()%12),h)if(a){var u=function(t){var n=J,i=t.split("\r"),e=i[0],r=i[1];return function(t){for(var n,i=1971,e=0,r=t.length;e0&&r.sWith(n)&&r.eWith(n)&&Date.Create(r).toFormat()==r&&{nbtl:e,tupq:r}}(a);if(!u||r>0&&!n(o,u.nbtl))i={k:-2,m:t("xli$pmgirwi$mw$mrzepmh2")};else{var c,l=Date.Create(u.tupq),f=~~((l-Date[t("Vqfc{")].call())/K.msday);f<0&&(i={k:c=f<-2*K.days?-2:0,m:c?t("xli$pmgirwi$lew$i|tmvih$sr$")+l.toFormat().repAll(J,Z)+ot:t("xli$pmgirwi$mw$i|tmvih2")})}}else i={k:-1,m:t("xli$pmgirwi$mw$qmwwmrk2")}}}}catch(t){i={k:0,m:t}}return i}function u(t,n){var i=n.inv,e=t.get(i);!e&&t.set(i,e=new K.Arr),e.add(n.owner)}function c(t){return t&&t.client&&t.snapshot||0}function f(t){this.canvas=t,this.lU=this.lAO=this.lA=this.lBO=this.lI=this.lE=this.lF=this.lCA=0,this.mO=new Map,this.mBO=new Map,this.uex=null,this.onInit()}function g(t,n){function i(t){return A(O(P(t)))}this.rgA=[],this.rgAA=new K.Arr,t&&((n=i(n))&&(n+=","),K.B.split(t).forEach(function(t){var e,r,o=i(t.caption);(function(t){return t&&(!n||y(n,t+",")>=0)})(o)&&(K.B.split(t.subText).forEach(function(t){var n=K.Keys.GetSt(t.caption);!n||n.keyCode&&1!=n.keyCode&&2!=n.keyCode&&4!=n.keyCode||(e=e||[]).push({button:n.keyCode,modifierKeys:K.Keys.ModK(n),long:function(t){for(var n,i=0,e=A(t).split("+"),r=0,o=e.length;!i&&r1&&e<7&&(i=!(n=a())||!n.k||~~t.timeStamp%3),i})(t)&&it.call(et,t),function(t){t&&((Y=Y||new Map).get(t)||(h(),Y.set(t,t.style.cursor)),t.style.cursor=Z)}(t.target)}function c(){Ct&&clearTimeout(Ct.handler),Ct=null}function f(t,n){if(!Q){var i=1,e=t.drag.status,o=r(t),s=K.Tick();if(Ct){(function(t,n){var i,e=!1;return(t-Ct.timestamplt||(n=S(E(nt.offset.dx),E(nt.offset.dy))>=N))&&(n&&x(),Q=!0,U&=!nt.offset.dx||!nt.offset.dy,u(t),q&&(d(t),L()))}(t)}function m(t){p(t=e(t)),G(t,7)}function A(t){p(t=e(t)),v(t)}function w(t){if(z){var n=z.sE.get(t.pointerId);n&&(z.mE=z.mE||new Map).set(t.pointerId,o(r(t),n)),z.pE&&C(z.pE)}}function R(t){!t.isPrimary&&z&&(z.sE.set(t.pointerId,r(t)),w(t))}function b(t){t.isPrimary?(C(t),z&&(z.pE=g(t))):w(t)}function T(t){t.isPrimary?m(t):z&&(z.sE.delete(t.pointerId),z.mE&&(z.mE.delete(t.pointerId),z.mE.size||(z.mE=null)),w(t),ot.Reset())}function y(t){if(p(t),ot.Reset(),27==K.Key(t))v(t);else{var n=K.ModK(t);n!=St.value&&(St.value=n,k(t))}}function O(t){p(t),ot.Reset();var n=K.ModK(t);n!=St.value&&(St.value=n,k(t))}function k(t){t.drag=nt,t.drag.status=2,u(t)}function D(){!U||Q||V||(V=!0,$.drag=nt=s($,3),u($)),x()}function x(){st&&clearTimeout(st),st=null}function P(){vt&&clearTimeout(vt),vt=null,n(pt)&&(clearInterval(pt),pt=null)}function W(){if(q&&tt){var t=tt.drag||s(tt,2);if(i(at)||(_?K.PInR(t.current.x,t.current.y,at):!K.PInR(t.current.x,t.current.y,at)))return!0}}function L(){P(),W()&&(vt=setTimeout(function(){M(),P(),W()&&(pt=setInterval(function(){M()},ct))},ut))}function M(){tt&&(tt.drag=nt=s(tt,2),u(tt))}function G(t,n){if(x(),q&&(d(t),P()),nt)switch(n){case 0:nt.cancel=!0,nt.status=n,t.drag=nt,u(t),nt.status=7;break;case 7:if(t.drag=nt=s(t,n),U)f(t,4);else{var i,e=ot.IsSwipe();e&&(i=nt.status,nt.status=6,nt.swipe=e,u(t),nt.status=i)}}u(t),4&B?(rt.removeEventListener("pointerdown",R),rt.removeEventListener("pointermove",b),rt.removeEventListener("pointerup",T),rt.removeEventListener("pointercancel",A)):(2&B&&(rt.addEventListener("touchmove",C),rt.addEventListener("touchend",m),rt.addEventListener("touchcancel",A)),1&B&&(rt.removeEventListener("mousemove",C),rt.removeEventListener("mouseup",m))),rt.removeEventListener("keydown",y),rt.removeEventListener("keyup",O),K.usE(K.doc.body,ht),K.Ptr.ResTargExclPad(),h(),--dt,mt.erur.do(t)}function H(){return dt&&1|(V&&!Q&&2)||0}function X(n,i,e,o){!H()&&function(n,i,e,o,h){dt++,n.target.focus(),p(),F=n.pointerType?"mouse"==n.pointerType:n instanceof MouseEvent,N=F?4:16,z=F?null:{sE:new Map},F&&(p=function(){}),ht=K.usE(K.doc.body,"none"),K.Ptr.SetTargExclPad(n.target),ot=new t(!F),$=g(n),j=K.EArt(n.target),J=r(n),Z=n.target.style.cursor,nt=s(n,1),ot.Add(nt.current),it=i,et=e,q=o&&o.contiguously,_=o&&o.contiguouslyClient,at=o&&o.client&&K.C2R(o.client)||null,ut=I(o&&o.contiguouslyTTS,K.Def.RUR.contiguouslyTTS),ct=I(o&&o.contiguouslyTTC,K.Def.RUR.contiguouslyTTC),St.value=K.ModK(n),B=K.rurPE,rt=o&&K.ToO(o.listnerElement)||K.win,4&B?(rt.addEventListener("pointerdown",R),rt.addEventListener("pointermove",b),rt.addEventListener("pointerup",T),rt.addEventListener("pointercancel",A)):(2&B&&(rt.addEventListener("touchmove",C),rt.addEventListener("touchend",m),rt.addEventListener("touchcancel",A)),1&B&&(rt.addEventListener("mousemove",C),rt.addEventListener("mouseup",m))),rt.addEventListener("keydown",y),rt.addEventListener("keyup",O),U=!0,Q=!1,V=!1,n.drag=nt=s(n,h),u(n),J.time=K.Tick(),st=setTimeout(D,gt),q&&(d(n),L()),mt.srur.do(n)}(n,i,e,o,1)}var F,N,B,z,U,V,Q,q,_,Z,Y,j,J,$,tt,nt,it,et,rt,ot,st,ht,at,ut,ct,lt=128,ft=256,gt=512,dt=0,vt=null,pt=null,Ct=null,St={value:0},mt=new K.Lts;mt.add("srur"),mt.add("erur");var Et=t.prototype;return Et.IsSwipe=function(){var t;if(this.tts){var n=this.rgP.length;if(n>1){var i=this.rgP[0],e=this.rgP[n-1],r=e.x-i.x,o=e.y-i.y;S(E(r),E(o))>this.ttl/16&&(t={x:e.x,y:e.y,dx:r,dy:o,time:K.Tick()-this.tts})}}return t},Et.Reset=function(){this.xOut(),this.tts=null,this.rgP.splice(0,this.rgP.length-1)},Et.xOut=function(){clearTimeout(this.lOut)},Et.Add=function(t){var n=K.Tick(),i=this;this.tts=this.tts||n,this.rgP.push(t),this.xOut(),this.lOut=setTimeout(function(){i.Reset()},S(0,this.ttl-(n-this.tts)))},{Do:X,D3:function(t,n){if(n&&n.client){function i(){e||(e=K.EF.Create(K.Inh(n,{class:"exd3",onpaint:o&&function(t,n){t.drawShape(n,o)},relative:s&&(s.canvas||s.GetCanvas&&s.GetCanvas())||s,limitClient:!1,inflateClient:4,thisArg:n})))}var e,r,o=n.shape,s=n.source;o&&(o=K.S.A2S(o),o=o.normal||o),X(t,function(t){switch(t.drag.status){case 1:!n.onclick&&i();break;case 2:n.onmove&&n.onmove.call(s,t),i(),e.SetClient(K.ORt(n.client.slice(),t.drag.offset.dx,t.drag.offset.dy));break;case 4:case 5:n.onclick&&n.onclick.call(s,t);break;case 7:e&&(K.EF.Destroy(e),t.drag.cancel||(l(r=n.ondrop||"ExDrop")||(r=t.target[r]),r&&r.call(t.target,t,n)))}},n)}},Rng:H,Cancel:function(){H()&&G($,0)},Listeners:mt,ModKeys:St}}(),x=function(){function t(t){return t&&"getBoundingClientRect"in t&&t||null}function e(){L&&L.clear(),L=null}function r(){return L||(L=new Map,M.forEach(function(t){L.set(t.getName(),t)})),L}function u(t){if(n(t)){if(o(t))return t;if(h(t)){var i=W(t);if(0!=i)return[i,i,i,i]}}return null}function c(t,n,e){var o,s,h,a;return i(t)?o=M.forEachU(function(t){return n.call(e,t)}):(s=r())&&((h=s.get(t))?o=n.call(e,h):(a=K.Like.Mask(t),s.forEach(function(t,i){!o&&a.Match(i)&&(o=n.call(e,t))}))),o}function f(t){return!D&&(D=!x.Init()),new k(function(t){return t&&t.parent||K.Def.EF.parent()}(t),t)}function g(t){function i(t){var n=t.oHE&&t.opHE;return n&&(t.nM&&function(t){t.nM&&(clearTimeout(t.hMC),w(t,"end"),t.nM=0,t.oHE.removeEventListener(G,b),t.oHE.removeEventListener(H,R),t.oHE.removeEventListener(X,T),t.oHE.removeEventListener(K.wheel,y),t.oAE&&l(t.oAE.focus)&&t.oAE.focus())}(t),d(t.oHE)&&K.CC.Dispose(t.oHE),t.opHE.removeChild(t.oHE),t.opHE=null,function(t){M.remove(t),e()}(t)),n}var r,o=0;return n(t)&&(r=[],t instanceof k?r=[t]:s(t)&&c(t,function(t){r.push(t)}),r.forEach(function(t){i(t)&&o++})),o}function C(t,n){K.EF.Destroy(t),K.SEP(n)}function E(t){var n=W(t.oO.modalTTC,K.Def.EF.modalTTC);return p(t.oHE)&&(n=m(0,n)),n}function A(t){return t&&t.target&&t.target.oE}function w(t,n){var i=t.oO;i&&i.onmodal&&i.onmodal.call(i.thisArg||t,t.oHE,n,t.nM),E(t)>0&&n==F&&(t.nM|=8,t.nM&=-5)}function R(t){var n=A(t);n&&(4&n.nM&&w(n,F),C(n,t))}function b(t){var n,i,e=A(t);e&&(e.nM|=4,(n=E(e))>0?(clearTimeout(e.hMC),2&e.nM||(e.hMC=setTimeout(function(){w(e,F)},n))):(!(i=p(e.oHE))&&n||w(e,F),i&&C(e,t)))}function T(t){var n=K.Key(t),i=A(t);if(i)switch(n){case 13:case 38:case 40:(!v(i)||4&i.nM)&&w(i,F),C(i,t);break;case 27:i.nM|=2,(!v(i)||8&i.nM)&&w(i,"cancel"),C(i,t)}}function y(t){var n=t&&t.target;nWheelStep=K.WhelInc(t),n&&nWheelStep&&h(n.value)&&(n.value=I(n.value)+nWheelStep,b(t),K.SEP(t))}function k(t,i){function r(){if(this.opHE&&!this.oHE){var t=K.doc.createElement(this.getTag());t.className=K.Def.CN.ftEF,t.style.position=this.oO.position||K.Def.EF.position,t.style.pointerEvents=function(t){var i=a();return!K.iL()||i&&i.k?Date.now()%3?"none":Z:t.modal?Z:n(t.pointerEvents)?t.pointerEvents:K.Def.EF.pointerEvents}(this.oO),t.style.zIndex=function(){var t=W(K.Def.EF.zIndex);return M.forEach(function(n){t=S(t,1+W(n.GetZIndex()))}),t}(),K.Apy(t,this.oO.inner),this.opHE.appendChild(t),this.oHE=t,function(t){M.add(t),e()}(this),d(this.oHE)&&new K.CC(this.oHE).onInit(),this.oHE&&this.SetOptions(this.GetOptions()),this.oO.modal&&function(t){if(!t.nM){t.nM=1,t.oAE=K.doc.activeElement,t.oHE.oE=t,t.oHE.tabIndex=-1,t.oHE.addEventListener(G,b),t.oHE.addEventListener(H,R),t.oHE.addEventListener(X,T),t.oHE.addEventListener(K.wheel,y),l(t.oHE.focus)&&t.oHE.focus();var n=K.Ert(t.oHE),i=t.GetClient();K.EqS(i,n)||(K.ORt(i,-(n[2]-i[2])/2,-(n[3]-i[3])/2),t.SetClient(i)),w(t,"start")}}(this)}}this.nM=0,this.oHE=null,this.opHE=t,this.oO=K.Cpy(K.Def.EF.Options),this.SetOptions(i,!0),r.call(this)}var D,x,L,M=new K.Arr,G="input",H="focusout",X="keydown",F="change",N=k.prototype;return N.getTag=function(){return O(P(this.oO.tag))||K.Def.EF.tag},N.getName=function(){return O(P(this.oO.name))},N.GetOptions=function(){return this.oO},N.SetOptions=function(t,i){var e=!1;if(n(t)){var r=[],o=this.GetOptions();for(var s in o){var h=t[s];void 0!==h&&(r.push(s),o[s]!==h&&(o[s]=K.CpV(h)))}if(i)for(var s in t)s in o||(o[s]=K.CpV(t[s]));if(e=r.length&&this.oHE){var a=r.indexOf("client");a>=0&&(r.splice(a,1),r.push("client")),r.forEach(function(t){var n="Set"+t.toProper();n in this&&this[n].call(this,o[t])},this)}}return e},N.GetVisible=function(){return this.oO.visible},N.SetVisible=function(t){this.oHE&&K.EShow(this.oHE,this.oO.visible=t)},N.GetRelative=function(){return t(this.oO.relative)},N.SetRelative=function(t){this.oO.relative=K.ToO(t),this.oHE&&this.SetClient(this.GetClient())},N.gAC=function(){return this.GetRelative()&&K.EArtC(this.GetRelative())},N.GetClipClient=function(){return this.oO.clipClient},N.SetClipClient=function(t){this.oO.clipClient=o(t)?t:null,this.oHE&&this.SetClient(this.GetClient())},N.GetClip=function(){return t(this.oO.clip)},N.SetClip=function(t){this.oO.clip=K.ToO(t),this.oHE&&this.SetClient(this.GetClient())},N.GetAbsolute=function(){var t=this.GetClient(),n=this.gAC();return n&&(t=K.ORt(t.slice(),n[0],n[1])),t},N.SetAbsolute=function(t){var n=K.C2R(t),i=this.gAC();i&&(n=K.ORt(n.slice(),-i[0],-i[1])),this.SetClient(n)},N.GetClient=function(){return K.C2R(this.oO.client)},N.SetClient=function(t){if(this.oO.client=K.C2R(t),this.oHE){var n,i,e,r,o,s,h=K.Inf(this.GetAbsolute(),this.GetInflateClient());if(this.oO.relative&&(this.oHE.style.zoom=K.CSSzom(this.oO.relative)),this.oO.fit){if(r=this.oO.fit.slice(),n=K.IBox([0,0,0,0],this.oHE,-1,1),i=K.IBox([0,0,0,0],this.oHE,-1,2),e=K.IBox([0,0,0,0],this.oHE,-1,4),r[0]-=n[0],r[2]+=i[2]+e[2],r[1]-=n[1],r[3]+=i[3]+e[3],s=parseFloat(this.oHE.style.zoom))for(var a=0;a<4;a++)r[a]/=s;K.FRt(h,r)}this.oO.limitClient&&(o=this.gAC())&&(h=K.NRt(h,K.IRt(o.slice(),4,4))),this.onclient(K.ETo(this.oHE,h)),function(){K.EClipTo(this.oHE,this.GetClip(),this.GetClipClient())}.call(this)}},N.onclient=function(t){var n=this.oO;n.onclient&&n.onclient.call(n.thisArg||this,this.GetClient()),d(this.oHE)&&(t||n.alwaysPaint)&&this.Render()},N.GetZIndex=function(){var t=K.Def.EF.zIndex,n=this.GetStyle();return n&&(t=n.zIndex),W(t)},N.SetZIndex=function(t){var n=this.GetStyle();n&&(n.zIndex=W(t))},N.GetStyle=function(){return this.oHE&&this.oHE.style||null},N.GetInflateClient=function(){return u(this.oO.inflateClient)},N.SetInflateClient=function(t){this.oO.inflateClient=u(t),this.oHE&&this.SetClient(this.GetClient())},N.Render=function(){var t,n,i=d(this.oHE)&&K.iCTX(this.oHE.getContext("2d"));i&&(i.clearRect.apply(i,t=[0,0,this.oHE.width,this.oHE.height]),(n=this.oO).onpaint&&K.pCTX(i,function(){n.onpaint.call(n.thisArg||this,i,K.Inf(t,this.GetInflateClient(),-1))},this))},N.GetClass=function(){return O(P(this.oO.class))},N.SetClass=function(t){var n,i=O(P(t));this.oO.class=i||null,this.oHE&&(n=K.Def.CN.ftEF,i&&(n+=j+i),this.oHE.className!=n&&(this.oHE.className=n))},x={Init:function(){var t="margin:0;border:1px solid gray;padding:2px;outline: 0}";K.aCSS(ot+K.Def.CN.ppEF,"{background:white;box-shadow:2px 2px 2px rgba(0,0,0,0.25);"+t),K.aCSS(ot+K.Def.CN.ttEF,"{background:white;"+t)},Create:f,Item:function(t){return r().get(t)},feM:c,Destroy:g}}(),M=f.prototype;M.onInit=function(){K.RUR.Listeners.add("erur",this),K.A.Listeners.add("ea",this)},M.onTerm=function(){this.lI++,K.RUR.Listeners.removeAnyOf(this),K.A.Listeners.removeAnyOf(this),this.clear(),--this.lI},M.getCanvas=function(){return this.canvas},M.gCtx=function(){return this.getCanvas().getContext("2d")},M.Sn=function(){return K.aoSnap&&K.Sn(this.getCanvas())||null},f.epsilon=.005,M.htAO=function(t,n,i){var e;return n&&n.htAO&&t&&(e=n.htAO(t,i||this.mO.get(n))||K.Arr.empty),e},M.set=function(t){var n;if(!this.lU&&t&&null!==t.id&&(t.blink||1==t.actOn||l(t.hitTest)||l(t.client))&&!this.has(t.owner,t.id)){K.DfO(n={},t),K.DfO(n,K.AODef),l(n.client)||(n.client=null),l(n.inv)||(n.inv=null),t.blink?t.actOn||(n.actOn=1):1==n.actOn&&this.onSt(n,n.range.to);var i=this.mO.get(n.owner);!i&&this.mO.set(n.owner,i=new Map),i.set(n.id,n),function(t){if(t)if(t.toggle&&this.onTgl(t),t.blink){var n=this.mBO.get(t.owner);!n&&this.mBO.set(t.owner,n=new Map),n.set(t.id,{oAODef:t}),this.runB(t,1==t.actOn?null:t.range.from)}else!this.lAO&&this.isAOPtr(t,this.oPtr,this.htAO(this.oPtr,t.owner))&&!this.wRUR().IsFrozen(t)&&t.state!=t.range.to&&this.onSt(t,t.range.to)}.call(this,n)}return n},M.xSn=function(){var t=this.Sn();t&&this.forEach(null,null,function(n){n.snapshot&&t.Remove(n)},this)},M.onDrawAO=function(t,n){var i,e,r=this.Sn(),o=this.gCtx();r&&(i=new Map,this.getOf(n).forEach(function(t){c(t)&&(i.set(t,t.state),t.state=t.range.from)},this),i.size&&(t.call(n,o),i.forEach(function(t,n){(e=c(n))>0&&r.Save(n,K.IRt(this.getClient(n),e,e)),n.state=t},this))),t.call(n,o,this)},M.onTgl=function(t,i,e,r){if(t.toggle)if(i=W(i,t.range.from),e=W(e,t.range.to),r=L(r,t.state>(t.range.from+t.range.to)/2))this.mtSO||(this.mtSO=new Map),this.mtSO.set(t,i),i>(t.range.from+t.range.to)/2&&(this.mtSO.delete(t),this.mtSO.size||(this.mtSO=null));else if(this.mtSO){var o=this.mtSO.get(t);n(o)&&(e=o<(t.range.from+t.range.to)/2?t.range.to:t.range.from)}return e},M.onSt=function(t,n){var i,e;c(t)>0&&((i=this.Sn())?i.Restore(t):(e=this.gCtx()).clearRect.apply(e,this.getClient(t))),t.state=n},M.onRemove=function(t){if(t){this.xB(t);var n=this.mBO.get(t.owner);n&&(n.delete(t.id),!n.size&&this.mBO.delete(t.owner))}},M.isEmpty=function(){return!this.mO.size},M.isBlink=function(t,n){var i=this.get(t,n);return i&&i.blink},M.get=function(t,n){if(!this.isEmpty()){var i=this.mO.get(t);return i&&i.get(n)}},M.has=function(t,n){return!!this.get(t,n)},M.getOf=function(t){var n=[];return!this.isEmpty()&&this.forEach(t,null,function(t){n.push(t)},this),n},M.hasOf=function(t){return!!this.mO.get(t)},M.remOf=function(t,n){var e,r=0;return this.lU||(i(n)?r=this.remove(t,null):(e=[],this.feM(t,n,function(t){e.push(t)}),e.forEach(function(t){r+=this.remove(t.owner,t.id)},this))),r},M.bOf=function(t){var n,i;return t&&(i=this.mBO.get(t.owner))&&(n=i.get(t.id)),n},M.remove=function(t,n){var i,e,r,o=0;return this.lU||this.isEmpty()||(i=[],this.forEach(t,n,function(t){i.push(t)},this),i.length&&i.forEach(function(t){o++,t.snapshot&&(r=this.Sn())&&r.Remove(t),this.mtSO&&this.mtSO.delete(t),this.rgdAO&&this.rgdAO.remove(t),this.rglAO&&this.rglAO.remove(t),this.rgAO&&this.rgAO.remove(t),(e=this.mO.get(t.owner))&&(e.delete(t.id),!e.size&&this.mO.delete(t.owner)),this.onRemove(t)},this)),o},M.clear=function(){this.lU||(this.xA(),this.xBO(),this.xSn(),this.resSt(),this.mtSO=this.rgdAO=this.rglAO=this.rgAO=null,this.mO.clear(),this.mBO.clear())},M.forEach=function(t,n,e,r){var o=this.get(t,n);if(o)e.call(r,o);else if(i(t))this.mO.forEach(function(t){t.forEach(function(t){(i(n)||t.id==n)&&e.call(r,t)},this)},this);else{var s=this.mO.get(t);s&&s.forEach(function(t){e.call(r,t)},this)}},M.feM=function(t,e,r,o){if(n(e)){var s=K.Like.Mask(e);if(i(t))this.mO.forEach(function(t){t.forEach(function(t){n(s.Match(t.id))&&r.call(o,t)},this)},this);else{var h=this.mO.get(t);h&&h.forEach(function(t){n(s.Match(t.id))&&r.call(o,t)},this)}}else this.forEach(t,e,r,o)},M.gPtr=function(t){return K.e2P(t)},"mousedown,mousemove,mouseup,pointerdown,pointermove,pointerup,mouseout,mouseover,touchstart,touchmove,touchend,touchcancel".split(",").forEach(function(t){!function(t,n){n["on"+t]="mouseout"==t?function(t){this.onAOE(null)}:function(t){this.onAOE(t)}}(t,M)}),M.refresh=function(t){t&&this.mBO.forEach(function(t){t.forEach(function(t){var n=t.oAODef;1==n.actOn&&(this.isEnabled(n.owner,n.id)?!t.handle&&this.runB(n):t.handle&&this.xB(n))},this)},this),this.onAOP(this.oPtr,t)},M.inv=function(t,n){if(!this.isEmpty()){var i=new Map;this.feM(t,n,function(t){u(i,t)},this),this.doInv(i)}},M.getClient=function(t){return t.client&&t.client.call(t.owner,t)},M.hitTest=function(t,n,i){return i.hitTest?i.hitTest.call(i.owner,t,n,i):i.client?K.PInR(t,n,this.getClient(i)):void 0},M.lock=function(){if(!this.lAO++&&this.rgAO){var t=!this.rgAO.isEmpty();this.rgAO.clear(),t&&(this.onAOS(),this.refresh())}},M.unlock=function(){!--this.lAO&&this.refresh()},f.tlA=function(t,n){t&&(n||i(n)?!t.lA&&t.lA++:t.lA&&setTimeout(function(){--t.lA}))},M.lockBO=function(){!this.lBO++&&this.xBO()},M.unlockBO=function(){--this.lBO||(this.onAOS(),this.refresh(!0))},M.freeze=function(){!this.lF++&&this.xA()},M.unfreeze=function(){!--this.lF&&this.refresh(!0)},M.wRUR=function(){function t(t){var n=r.rgfRUR;return L(t,!0)&&(r.rgfRUR||(r.rgfRUR=n=new K.Arr)),n}function e(t,e){return n(t)&&(i(e)||"*"==O(String(e)))}var r=this,o="+",s="-";return{FreezeAll:function(){var n=t();n&&(n.clear(),n.push(o))},UnfreezeAll:function(){var n=t();n&&(n.clear(),n.push(s))},Freeze:function(n,i){var s=t();if(s){var h=s.has(o);e(n,i)?h?s.remove(n):s.add(n):r.feM(n,i,function(t){h?s.remove(t):s.add(t)})}},Unfreeze:function(n,i){var o=t();if(o){var h=o.has(s);e(n,i)?h?o.remove(n):o.add(n):r.feM(n,i,function(t){h?o.remove(t):o.add(t)})}},Reset:function(){r.rgfRUR=null},Save:function(){r.rgSavefRUR=r.rgfRUR,r.rgfRUR=null},Restore:function(){void 0!==r.rgSavefRUR&&(r.rgfRUR=r.rgSavefRUR,r.rgSavefRUR=void 0)},IsFrozen:function(n){return K.RUR.Rng()&&function(t,n){if(!t||t.isEmpty())return!0;var i=t.has(o),e=t.has(n)||t.has(n.owner);return i?!e:e}(t(!1),n)}}},M.rur=function(t,i){var e=this.wRUR();n(t)?(e.Save(),e.FreezeAll(),e.Unfreeze(t,i||null)):e.Restore()},M.p2AO=function(t){var n,i;return this.isEmpty()||this.lAO||(n=new K.Arr,this.mO.forEach(function(e,r){i=this.htAO(t,r,e),e.forEach(function(e){this.isAOPtr(e,t,i)&&n.add(e)},this)},this),n.len()||(n=void 0)),n},M.isAO=function(t){return this.rgAO&&(t?this.rgAO.has(t):0!=this.rgAO.len())},M.isAOPtr=function(t,n,o){n=n||this.oPtr;var s=!1;return!t.blink&&this.isLocked(t.owner,t.id)||(s=1==t.actOn)||(s=n&&(o?o.has(t):this.hitTest(e(n),r(n),t)))&&4==t.actOn&&(s=n.actOn==t.actOn)&&(s=n.buttons&&(i(t.buttons)||t.buttons&&t.buttons==(n.buttons&t.buttons))),s},M.cAOP=function(){return!this.lF&&K.CC.cInv(this.getCanvas())},M.onAOP=function(t,n){var i,e=!1;return this.cAOP()&&(i=this.p2AO(t),(e=n||!function(t,n){return t?t.equal(n):!!n&&n.equal(t)}.call(this,i,this.rgAO))&&(this.xA(),this.rgAO=i,this.onAOS())),e},M.onAOE=function(t){var n,i=!1;return this.lE||((this.oPtr=t&&this.gPtr(t)||null)&&(this.oPtr.actOn=2,this.oPtr.buttons=0,(n=K.e2B(t,!0))?(this.oPtr.actOn=4,this.oPtr.buttons=n):K.tchEv(t)&&(this.oPtr.actOn=4,this.oPtr.buttons=1)),i=this.onAOP(this.oPtr)),i},M.ea=function(t){!this.lCA&&this.rgA&&this.rgA.remove(t)&&!this.rgA.len()&&(this.rgA=null)},M.doInv=function(t){if(t&&t.size&&!this.lI){var n=this.gCtx();void 0!==t.get(null)?K.CC.Inv(this.getCanvas()):t.forEach(function(t,i){t.forEach(function(t){i.call(t,n)})})}},M.runB=function(t,e){function r(t,e){var r=this.bOf(t);if(r){r.oA&&r.oA.Cancel(),r.oA=null;var o=t.owner,s=t.id;if(t.delay){var h=t.state<(t.range.to+t.range.from)/2?t.range.to:t.range.from;if(n(e)&&(h=e),E(t.state-h)>f.epsilon){var a=t.state;r.oA=K.A.Progress(function(n){var i=a+(h-a)*n;E(i-t.state)>f.epsilon&&(this.onSt(t,i),this.inv(o,s))},{thisArg:this,duration:t.delay,transition:t.transition,onXDoL:!1})}}else i(e)?this.tglSt(o,s):this.setSt(o,s,e)}}if(!this.lBO&&t){var o=this.bOf(t),s=this;o&&(this.xB(t),o.handle||!i(e)&&t.state==e||(n(e)?r.call(s,t,e):o.handle=setInterval(function(){r.call(s,t,e)},t.duration)))}},M.xB=function(t){var n=this.bOf(t);n&&(n.oA&&n.oA.Cancel(),n.oA=null,n.handle&&clearInterval(n.handle),n.handle=null)},M.xBO=function(){this.mBO.forEach(function(t){t.forEach(function(t){this.xB(t.oAODef)},this)},this)},M.xA=function(){if(this.lCA++,this.rgA&&(this.rgA.forEach(function(t){t.oTrans&&(this.runT(t.oTrans,-.05),t.oTrans=null),t.Cancel()},this),this.rgA=null),function(){var n;return null===this.uex&&(n=(this.uex=a())||(this.uex=K.iL()?void 0:{k:-3,m:t('vjg"nkegpug"ku"pqv"hqwpf0')})),n}.call(this)){var n=U(this.getCanvas());if(n&&n.oCC){var i=n.oCC.onpaint,e=(this.uex.k?"⚠ ":"! ")+(this.uex.m||Z);n.oCC.onpaint=function(t,n){i.call(this,t,n),!this.isErase(n)&&t.drawHTMLText(e,this.getClientRect(),8)}}}this.lCA--},M.aIDOf=function(t){var n=new K.Arr;return this.rgAO&&this.rgAO.forEach(function(i){t==i.owner&&n.push(i.id)}),n.len()?n:null},M.runT=function(t,n){if(n){var i=new Map;t.objects.forEach(function(t){var e=t.oAODef.state,r=!1;n>0?e=t.from+(t.to-t.from)*n:this.isAO(t.oAODef)||(r=!0,e+=(t.to-e)*-n),E(t.to-e)f.epsilon)&&(this.onSt(t.oAODef,e),u(i,t.oAODef))},this),i.size&&t.inv(this,i)}},M.onAOS=function(){var t,n=function(t){if(!this.isEmpty()){var n=new Map;if(this.mO.forEach(function(i){i.forEach(function(i){if(this.isEnabled(i.owner,i.id)){var e,r,o=t&&t.has(i);if(i.blink)1!=i.actOn&&(e=this.mBO.get(i.owner))&&(r=e.get(i.id))&&(o?!r.handle&&this.runB(i):r.handle&&this.runB(i,i.range.from));else if(!this.wRUR().IsFrozen(i)){var s,h,a,c,l=i.state,f=o?i.range.to:i.range.from;i.toggle&&(f=this.onTgl(i,l,f,o)),l!=f&&(s=i.duration,h=o?i.delay:0,!(a=n.get(s))&&n.set(s,a=new Map),(c=a.get(h))||(c={transition:i.transition,duration:s,delay:h,objects:[],qInv:new Map},a.set(h,c)),c.objects.push({oAODef:i,from:l,to:f}),u(c.qInv,i))}}},this)},this),n.size){var i=[];return n.forEach(function(t){t.forEach(function(t){t.objects.sort(function(t,n){return E(t.from-t.to)0&&(r.sort(function(t,n){var i=t.window,e=n.window;return e.IsChildOf(i)?-1:i.IsChildOf(e)?1:K.Cmp.N(i.GetLevel(),e.GetLevel())}),r.forEach(function(t){(function(t,n){for(var i=0,e=n.length;i1&&(i=s)}}return i}var e=null;if(t){var r=this.GetAllowXChg();if(r){var o=this;switch(r){case 1:e=function(t,e){var r=null;if(e)for(;e&&i(r=n(t,e));)e=e.opW;return r}(o,t);break;case 2:e=function(t,n){var i=new K.Arr;return t.feWZ(function(n){n.aXChg()&&function(t,n){var i=t.getChild(n);if(i&&i.length)for(var e=0,r=i.length;e0?i:null}(o);break;case 3:e=function(t,n){var i=new K.Arr;return t.feW(function(n){t.hasW(n)&&n.aXChg()&&n.IsVisible()&&i.push(n)}),i}(o)}e&&e.sort(function(t,n){return K.Cmp.N(o.getZOrd(t),o.getZOrd(n))})}}return e}.call(this,n);g.eqXChg(r,this.rgXChg)||(this.bR(),this.xXChg(),this.rgXChg=r,this.uXChgI(),this.eR()),--this.lRXChg}},k.valXChg=function(t){var n=[];this.rgXChg.forEach(function(i){t!=i&&(i.IsChildOf(t)||t.IsChildOf(i))&&n.push(i)}),n.forEach(function(t){this.rgXChg.remove(t)},this)},k.eqXChgI=function(t,n){if(!t&&!n)return!0;var i=!1;return t&&n&&t.size==n.size&&(i=!0,t.forEach(function(t){if(i){var e=n.get(t.window);(i=void 0!=e)&&(i=t.id==e.id)&&(i=K.EqR(t.client,e.client))}})),i},k.setAOXChg=function(t){if(this.resAOXChg(),this.ctx){var n=this.ctx.gAO();if(n&&this.mXChgI){var i=this.isXChgByAlpha();this.mXChgI.forEach(function(e){var r=t==e;n.set({owner:this,id:"xchg.click."+e.id,hitTest:function(t,n){var i=null;return this.p2DF(t,n)?i=this.getXChgDW():(i=this.p2XChg(t,n))||(i=this.p2XChgW(t,n)),i==e.window},inv:this.Render,duration:r||i?0:250,delay:0,actOn:r?1:4})},this);var e=n.wRUR();e.Save(),e.FreezeAll(),e.Unfreeze(this,"xchg.click.*"),i&&n.lI++}}},k.resAOXChg=function(){if(this.ctx){var t=this.ctx.gAO();t&&(t.wRUR().Restore(),t.remOf(this,"xchg.click.*"),t.lI&&--t.lI)}},k.uXChgI=function(){this.lUXChg++||(this.mXChgI=function(t){var n,i;return t&&(n=new Map,t.forEach(function(t){(i=this.getXChgI(t))&&n.set(t,i)},this),this.layXChgI(n)),n}.call(this,this.rgXChg)),--this.lUXChg},k.layXChgI=function(t){if(t){if(!this.lLXChg++){var n=K.G.R2C(this.GetClientRect()),i=e(n),o=r(n),s=[],h=[],a=new K.Arr,u=new K.Arr,c=0;t.forEach(function(t){var n=t.client;n[0]+n[2]/2o&&u.push(c),s.push(this.fitClient(n,4)),h.push(t.window.GetZOrder()),c++},this);var l=s.length;if(l>1)for(var f=!0;f;){f=!1;for(c=0;cA;f=K.G.C2R(K.G.R2C(f),R?E/2:8,R?8:A/2)}}if(f){if(u){var b={parent:n.opW,dock:n.nDk,client:n.client,restoreClient:n.restoreClient,pos:t.getPos(n)};t.lockURXChg(),t.lRLC++,n.restoreClient=null;var T=null;t.useNextDockPosOf()&&(T=t.nextDockPosOf(n,r,o)),t.dock(n,r,o,f,T),--t.lRLC,t.unlockURXChg();var y=new p(e);e.lSiz++,y.RLC(e.GetClientRect()),f=n.deflateClient(y.w2R(n)),--e.lSiz,y=null,n.opW=b.parent,n.nDk=b.dock,n.client=b.client,n.restoreClient=b.restoreClient,t.setPos(n,b.pos)}h={dock:o,oCW:e,window:r,client:f}}}}}return h},k.nextDockPosOf=function(t,n,i){var e,r=null;return t&&(r=this.getPos(t),(e=this.getChild(n))&&e.forEach(function(t){t.isVisible()&&i==t.GetDock()&&(r=this.getPos(t)+1)},this)),r},k.isSplitByFrames=function(){return K.D.WindowSplitByFrames&&K.D.WindowFrame},k.isXChgByAlpha=function(){return K.D.AnchorXChgByAlpha},k.ondown=function(t){clearTimeout(this.hHT);var n,i=!1;return this.fwdEv()&&((i=this.oLts.ondown.do(t))||((n=this.p2WHT(this.gPtr(t)).Client)&&(function(t,n){if(t&&t.IsNone()){var i,e=this.gAO(),r=e.oPtr||{};this.hHT=setTimeout(function(){if((i=e.oPtr||{}).buttons&&r.x==i.x&&r.y==i.y&&!e.isAO()){var o=K.RUR.Rng();K.RUR.Cancel(),o&&e&&e.clear(),t.oCW.onHT(n)}},1024)}}.call(this,n.rWN(),t),n.isSelectable()&&(i=n.ondown(t))),i||(i=this.onHT(t)))),i},k.onmouseover=function(t){this.setPtr(this.gPtr(t)),this.fwdEv()&&this.onHovI(t)},k.onmouseout=function(t){this.isEvOut(t)&&this.setPtr(null),this.fwdEv()&&this.onHovO(t)},"mousedown,pointerdown,touchstart".split(",").forEach(function(t){!function(t,n){n[t="on"+t]=function(n){var i=!1;if(this.fwdEv()&&!(i=this.oLts[t].do(n))){var e=this.p2WHT(this.gPtr(n)).Client;e&&e.isSelectable()&&(i=e[t].call(e,n)),i||(i=this.ondown(n))}return i}}(t,k)}),k.onmousemove=function(t){var n,i,e,r,o=this.gPtr(t);return this.setPtr(o),this.fwdEv()&&(n=this.oLts.onmousemove.do(t),i=this.p2WHT(o),this.hovWC(t,i),n||((e=i.Client)&&e.isSelectable()&&(n=e.onmousemove(t)),n||(n=0!=i.HitTest,r=K.HitTest.Cursor.Rect(i.HitTest,this.defCursor()),272==i.HitTest?r="move":e&&!i.Window.IsMin()&&(r="auto"),this.setCursor(r)))),n},"mouseup,pointerup,pointermove,pointercancel,touchmove,touchend,touchcancel".split(",").forEach(function(t){!function(t,n){n[t="on"+t]=function(n){if(this.fwdEv()&&!this.oLts[t].do(n)){var i=this.p2WHT(this.gPtr(n)).Client;i&&i.isSelectable()&&i[t].call(this,n)}}}(t,k)}),k.oncontextmenu=function(t){var n=!1;if(this.fwdEv()&&!(n=this.oLts.oncontextmenu.do(t))){var i=this.p2WHT(this.gPtr(t)).Window;i&&(n=i.oncontextmenu(t))}return n},k.onwheel=function(t){var n=!1;return this.fwdEv()&&!(n=this.oLts.onwheel.do(t))&&this.rfeWZU(function(i){return i.isSelectable()&&(n=i.onwheel(t))}),n},k.onkeydown=function(t){this.fwdEv()&&(this.onkey(t,-1),this.isAllowKeys()&&this.oLts.onkeydown.do(t),this.feW(function(n){n.isAllowKeys()&&n.onkeydown(t)}))},k.onkeyup=function(t){this.fwdEv()&&(this.onkey(t,0),this.isAllowKeys()&&this.oLts.onkeyup.do(t),this.feW(function(n){n.isAllowKeys()&&n.onkeyup(t)}))},k.onkeypress=function(t){this.fwdEv()&&(this.onkey(t,1),this.isAllowKeys()&&this.oLts.onkeypress.do(t),this.feW(function(n){n.isAllowKeys()&&n.onkeypress(t)}))},k.onHovI=function(t){this.hovWC(t,this.p2WHT(this.gPtr(t))),this.oLts.onmouseover.do(t)},k.onHovO=function(t){this.setCursor(this.defCursor()),this.hovWC(t,null),this.oLts.onmouseout.do(t)},k.udefSts=function(t){t&&(t.RemoveOf(this),this.oC&&this.oC.udefSts&&this.oC.udefSts(t))},k.defSts=function(t){if(t){var n=K.Def.Keys;t.Add(n.xWToggle,this.tXChg,this,Z,0),t.Add(n.xWUndo,this.unXChg,this),t.Add(n.xWRedo,this.rdXChg,this),this.oC&&this.oC.defSts&&this.oC.defSts(t)}},k.onkey=function(t,n){this.oSts&&this.oSts.onkey(t,n)},k.iCTX=function(){K.iCTX(this.ctx)},k.resRLC=function(){this.lRLC||(this.bRLC=!1)},k.RLC=function(){!this.lRLC&&!this.bRLC&&this.onRLC()},k.rW=function(){return this.W(this.orW)},k.onRLC=function(){function t(t){t.lRLC++,t.bRLC=!0;var n=t.oWL,i=t.rCW();n||(t.oWL=n=new p(t),i.onWLC(t)),n.RLC(t.w2R()),i.onWLD(t),--t.lRLC}this.rgW&&!this.lRLC&&(t(this),this.lQRLC>0&&(this.lQRLC--,t(this)))},k.WL=function(){return this.RLC(),this.oWL},k.onui=function(){!this.dokIn()&&g.WDN.Save(this.rCW())},k.onUI=function(){this.oWsC=null,this.lUI||(this.lRLC?this.lQRLC++:(this.lUI++,this.opZ=(this.oWL||{}).oZ||null,this.oWL=null,this.resRLC(),--this.lUI))},k.WsC=function(){return this.oWsC||(this.oWsC=new v(this))},k.W=function(t){return n(t)?this.WsC().Get(t):null},k.feW=function(t,n){this.rgW&&(n=n||this,this.rgW.forEachI(function(i,e){t.call(n,i,e)}))},k.feWZ=function(t,n){var i=this.WL();if(i){n=n||this;var e=i.visZ();e&&e.forEach(function(i,e){t.call(n,e,i)})}},k.rfeWZU=function(t,n){var i,e=this.WL();e&&(n=n||this,(i=e.visZ())&&i.rforEachU(function(i,e){return t.call(n,e,i)}))},k.feC=function(t,n){this.rgW&&(n=n||this,this.rgW.forEachIU(function(i){return i.oC&&t.call(n,i.oC,i)}))},k.Ws=function(){return this.rgW||(this.rgW=new K.Arr,this.rgW.onRemove=this.onRemove.bind(this)),this.rgW},k.add=function(t,n,i){var e=this.W(t=function(t,n){if(t=P(t),this.bIPN&&t&&n){var i=n.GetName();i&&(t=i+this.sIPNSep+t)}return t}.call(this,t,n));if(!e){var r=this.W(n);this.Ws().push(e=new w(this,t,r,i)),this.onUI(),this.onAdd(e)}return e},k.Add=function(t,n){return this.add(t,null,n)},k.Remove=function(t){if(this.rgW){var n=this.W(t);if(n){var i=this.getChild(n);i&&i.length&&i.forEach(function(t){this.Remove(t)},this);if(-1!=this.getIndexOf(n))return this.rgW.remove(n),this.onUI(),!0}}},k.onAdd=function(t){t.rqbSB()&&(this.rgbSB||(this.rgbSB=[])).push(t),function(){if(this.rgbSB){var t;this.rgbSB.forEach(function(n){!n.bSBs()&&(t||(t=[])).push(n)},this),this.rgbSB=t}}.call(this)},k.onRemove=function(t){var n=this.gAO();n&&!n.isEmpty()&&n.clear(),t?(this.oHovW==t&&(this.oHovW=null),this.oHovC==t&&(this.oHovC=null),this.rgXChg&&(this.rgXChg.remove(t),this.rgXChg.len()||this.xXChg()),t.onRemove()):(this.oHovW=null,this.oHovC=null,this.xXChg())},k.Clear=function(){if(this.rgW&&!this.rgW.isEmpty())return this.rgW.clear(),this.onRemove(null),this.onUI(),!0},k.onSmoothByFrames=function(t){return t&&this.isSplitByFrames()&&(t.cbkR=function(t){t.oEF&&(t.oEF.oO.progressEF=t.progress,t.oEF.Render())},t.cbkI=function(t){this.lE++;var n=this.gAO();n&&(n.lI++,n.lE++);var i=this,e=i.WL().oZ;i.WL().oZ=t.oZ,i.Render(t.oWRend),i.WL().oZ=e,t.oEF=K.EF.Create({name:"frame-w",client:i.GetClientRect(),relative:i.canvas,progressEF:0,onpaint:function(n,e){t.rgWFT.forEach(function(t){n.saveSts("lineWidth"),n.lineWidth=S(1,K.D.WindowSplitSize),K.D.WindowFrame(n,K.R.Rect(this.oO.progressEF,null,t),0,K.D.WindowSplitColor),n.loadSts()},this),i.lLXChg++,i.dXChg(n),i.lLXChg--}})},t.cbkT=function(t){K.EF.Destroy(t.oEF);var n=this.gAO();n&&(--n.lE,--n.lI),--this.lE}),t},k.runAXChgWZ=function(t,n){var i=!1;return t.Smooth(function(){i=this.xchg(t,n)},this.onSmoothByFrames({name:D,thisArg:this})),i},k.canAXChgW=function(t,n){return t&&n&&t!=n&&t.oCW==n.oCW},k.doAXChg=function(t,n){if(this.canAXChg()){var i,e=this.W(t);if(e&&(i=this.W(n))&&this.canAXChgW(i,e))return this.runAXChgWZ(e,i)}},k.DoXChg=function(t,n){this.onui(),!this.doAXChg(t,n)&&this.XChg(t,n)},k.xchg=function(t,n){function i(t){return t.GetClientCanvasRect()}var e,r,o,s,h,a,u,c,l=!1,f=this.W(t);return f&&(e=this.W(n))&&f!=e&&(l=!f.IsChildOf(e)&&!e.IsChildOf(f))&&(this.isURXChgLock()||(r={window:null,from:f,to:e}),f.bClient(),e.bClient(),o=f.GetDock(),s=e.GetDock(),f.opW===e.opW?(o===s?0==o&&(h=i(f),f.client=i(e),e.client=h):(g.visW(f)&&g.visW(e)&&(w.AreDocksEquivalent(o,s)?(f.client=i(f),e.client=i(e)):(h=i(f),f.client=i(e),e.client=h)),f.nDk=s,e.nDk=o,a=f.bRsza,f.bRsza=e.bRsza,e.bRsza=a,u=f.bDWF,f.bDWF=e.bDWF,e.bDWF=u),this.rgW.setPos(f,this.rgW.getPos(e))):(c=f.opW,f.opW=e.opW,e.opW=c,g.visW(f)&&g.visW(e)&&(h=i(f),f.client=i(e),e.client=h),f.nDk=s,e.nDk=o,a=f.bRsza,f.bRsza=e.bRsza,e.bRsza=a,u=f.bDWF,f.bDWF=e.bDWF,e.bDWF=u),f.client=K.C2R(f.client),e.client=K.C2R(e.client),f.eClient(),e.eClient(),r&&this.addURXChg(r)),l},k.XChg=function(t,n){this.xchg(t,n)&&this.Refresh()},k.canAXChg=function(){return!K.A.Rng(D)},k.updDF=function(t){function n(t){return s+ot+t}var i,e,r,o,s="xchg.dock",h=this.rCW().oDF,a=(h?h.getContext("2d"):this.ctx).gAO();if(this.oXChgD=null,a&&a.remOf(this,s+".*"),t){if((i=t.save)&&this==t.oCW&&(e=i.sourceWindow==t),i?r=i.clientAnchorXChg:this.mXChgI&&(o=this.mXChgI.get(t))&&(r=o.client),r){var u=this.GetAllowDock(),c=r[2],l=r[3],f=l,g=r[0],d=K.ROf(r),v=K.NRt(r,this.GetClientRect()),p=K.BOf(v)+4,C=[0,0,0,0];e&&1&u&&(C=[g,p+=2,c,l],p+=l+4,p-=2);var S=[0,0,0,0],m=[0,0,0,0],E=[0,0,0,0],A=[0,0,0,0],R=[0,0,0,0];2&u&&(S=[g,p+=6,c,l],E=[g-f-4,p+=l+4,f,l],R=[g,p,c,l],A=[d+4,p,f,l],m=[g,p+=l+4,c,l],p+=l+4,p+=2);var b=[0,0,0,0];e&&4&u&&(t.IsNone()||(b=[g,p+=2,c,l]));var T=[b,E,A,S,m,R,C],y=K.URts(T);if(!K.EyR(y)){var O,k,D=this.GetClientRect(),x=y.slice(),P=6;if(h){var W=K.pgrt(),I=this.v2C(W);D=[I.x,I.y,W[2],W[3]]}K.FRt(y,D,P),O=y[0]-x[0],k=y[1]-x[1],T.forEach(function(t){!K.EyR(t)&&K.ORt(t,O,k)})}h&&K.ETo(h,this.c2Vrt(K.IRt(K.URts(T),P,P)));var L=[b.slice(),S.slice(),m.slice(),E.slice(),A.slice(),R.slice(),C.slice()];if(this.oXChgD={window:t,frames:L},a){for(var M=!1,G=0;G0){var i=new Map;t.forEach(function(t){i.set(t,function(t){for(var n=new K.Arr;t;)n.add(t),t=t.opW;return n.add(null),n.reverse(),n}(t))});for(var e=i.get(t[0]).byO().slice(),r=1;r0&&(o=e[e.length-1]);var s=new K.Arr;return i.forEach(function(t){var n=t.next(o);n&&s.push(n)}),{parent:o,descendants:s}}}},k.getHovExt=function(t){var n=this.WL();return n?n.getHovExt(t):null},k.getVisExt=function(t){var n=this.WL();return n?n.getVisExt(t):null},k.getSizeExt=function(t){var n=this.WL();return n?n.getSizeExt(t):null},k.getIndexOf=function(t){return this.WsC().getIndexOf(t)},k.isVisible=function(t){return!t||this.WL().isVisible(t)},g.visW=function(t){return t&&t.oCW.isVisible(t)},k.getZOrd=function(t){return this.WL().getZOrd(t)},k.getPos=function(t){return this.rgW?this.rgW.getPos(t):-1},k.setPos=function(t,n){this.rgW&&this.rgW.setPos(t,~~n)},k.getPosAll=function(){return this.rgW&&this.rgW.map(function(t){return t.GetIndex()}).join(",")||Z},k.setPosAll=function(t){if(this.rgW&&n(t)&&(t=P(t))){var i=new K.Arr;t.split(",").forEach(function(t){i.pushnn(this.W(I(t,-1)))},this),this.rgW.sort(function(t,n){return K.Cmp.N(i.getPos(t),i.getPos(n))})}},k.getShortName=function(t){return this.WsC().GetShortName(t)},k.Resize=function(t,i){this.canvas&&(this.lS++||(this.bR(),n(t)&&(this.canvas.width=t),n(i)&&(this.canvas.height=i),this.SetClientRect([0,0,this.canvas.width,this.canvas.height]),this.iCTX(),this.rXChg(),this.refCWN(),this.eR())),--this.lS},k.paintSplit=function(t,n,i){K.D.WindowSplit&&K.D.WindowSplit(t,n,i)},k.erase=function(t,n){n&&t.clearRect.apply(t,n)},k.bR=function(){this.lR++},k.eR=function(){!--this.lR&&this.Render()},k.bU=function(){this.lR++},k.eU=function(){this.lR&&--this.lR||(this.onUI(),this.Render())},k.lRA=function(t){function n(){var n,e=1&t;4&t&&(e?!i.lR&&i.lR++:1==i.lR&&--i.lR),2&t&&(n=i.gAO())&&(e?!n.lU&&n.lU++:1==n.lU&&(--n.lU,16&t&&n.clear())),8&t&&i.Render()}var i=this;32&t?setTimeout(n):n()},k.Render=function(t){if(!this.lR++){var n,i,e,r,o=this.ctx;this.clip=null,o&&!this.isRL(n=this.W(t))&&(i=this.WL())&&((e=i.visZ())?n?(r=i.w2Inv(n))&&(o.selClip(this.clip=r.get(n)||n.GetWindowRect()),r.forEach(function(t){this.erase(o,t)},this),this.renderWZ(o,r),o.resClip()):(this.erase(o,this.GetClientRect()),this.renderWZ(o,e)):this.erase(o,this.GetClientRect()))}this.lR--},k.renderWZ=function(t,n){if(n){this.bInv();var i=this.clip;n.forEach(function(n,i){this.renderW(t,i,n)},this),n.forEach(function(n,i){i.IsNone()&&!this.isRL(i)&&i.dWF(t,n)},this),this.clip=i,this.eInv()}},k.Refresh=function(t){function n(t){t.lRLC||(t.bR(),t.onUI(),t.rXChg(),t.eR())}function i(t){var i;t.dokIn()?n(t):(i=t.CWs())&&i.forEach(function(t){n(t)})}if(!this.lPR++){var e=this,r=e.rCW();clearTimeout(r.hPR),t?r.hPR=setTimeout(function(){i(e)}):i(this)}--this.lPR},k.refCWN=function(){this.rgW&&this.rgW.forEach(function(t){t.refCWN()})},k.bInv=function(){!this.lI++&&this.onbinv()},k.eInv=function(){!--this.lI&&this.oneinv()},k.onbinv=function(){var t=K.CC.c2CC(this.canvas);t&&t.inv({erase:!0,from:0,to:K.CC.GetZOrd(this)}),K.pCTX(this.ctx),this.oLts.onbinv.do(this.ctx)},k.oneinv=function(){var t=this.ctx;t&&(this.hasXChg()&&t.onReleaseClip(function(){this.clip&&(t.save(),t.locClip(this.clip)),function(){var t,n=this.oXChgS;if(n&&(t=n.save)){var i=this.ctx,e=n.oCW,r=t.targetCW,o=t.targetW,s=!0,h=g.getTarget(e,n,r,o,t.targetDock,t.targetCtrl);h&&(s=!K.EyR(h.client))&&h.oCW==this&&this.pTgtXChg(i,h.client),s&&e==this&&this.pTgtXChg(i,n.GetClientRect(),!0)}}.call(this),this.dXChg(),function(){var t,n,i,e=this.oXChgS;e&&(t=e.save)&&(n=t.targetCW,this.allowD()?(this.pXChg(e,this.ctx,t.clientAnchorXChg,!0),this==n&&(function(t){if(l(K.D.AnchorXChg)&&t&&this.mXChgI){var n=this.mXChgI.get(t.opW);if(n){var i=K.D.AnchorXChgShapeParentDock;i&&K.D.AnchorXChg(this.ctx,n.client,i,n.id)}}}.call(this,t.targetHighlightParentWindow),this.drawDF())):(i=this.mXChgI.get(e))&&this.pXChg(e,this.ctx,i.client))}.call(this),this.clip&&t.restore()},this),this.oLts.oneinv.do(t));var n=K.CC.c2CC(this.canvas);n&&n.inv({erase:!1,from:1+K.CC.GetZOrd(this)}),K.pCTX(this.ctx,!0)},k.paintC=function(t,n,i){t.paint(n,i)},k.isRL=function(t){var n=!1;if(this.rgLW&&t)for(var i=t;i&&!(n=this.rgLW.has(i));)i=i.opW;return n},k.renderW=function(t,n,i){t&&(i=i||this.w2R(n))&&(this.isRL(n)||this.paintW(n,t,i))},k.paintW=function(t,n,i){if(!K.EyR(i)){var e=t.rtHT(i);this.paintC(t,n,e.Client),this.paintS(t,n,e.rgSplit)}},k.paintS=function(t,n,i){!t.IsNone()&&i&&i.forEach(function(t){K.EyR(t.Client)||this.paintSplit(n,t.Client,t.HitTest)},this)},k.Inv=function(t){var n,i,e,r=this.W(t);this.lR||(r?this.isRL(r)||(n=this.WL().w2Inv(r))&&(1==n.len()?(i=this.ctx)&&(e=n.get(r)||r.GetWindowRect(),i.selClip(this.clip=e),this.erase(i,e),this.renderWZ(i,n),i.resClip()):this.Render(t)):this.Render())},k.inv=function(t){this.onpaint(t||this.ctx)},k.iHT=function(){return K.Def.HT.inflate},k.p2HTM=function(t,n){var i=K.P2HT(t,n,this.GetClientRect(),this.iHT()[0],this.iHT()[1]);return 34==i?0:i},k.p2W=function(t,n){var i=null,e=null,r=this.WL();return r&&(e=r.visZ())&&e.rforEachU(function(e,r){if(K.PInR(t,n,e)&&(!i&&(i=r),r.oC))return i=r},this),i},k.p2HT=function(t,n){function i(t,n,i){var e=null;if(t){var r=[];t.rforEach(function(e,o){var s=null,h=o.rtHT(e).SplitHT(n,i);!h||!o.IsNone()&&(s=o.opW)&&K.EyR(t.get(s))||r.push(h)},this);var o=r.length;if(o>0)if(1==o)e=r[0];else{var s=null,h=this.iHT()[0],a=this.iHT()[1];r.forEach(function(t){s=s?K.URt(s,t.Client):t.Client}),K.IRt(s,h/2,a/2);var u=this.p2HTM(n,i);u&&(s=function(t,n,i,e){var r=null;if(n&&119&t){switch(i=i||0,e=e||0,r=n.slice(),7&t){case 1:r[2]=i;break;case 4:r[0]=K.ROf(n)-i,r[2]=i;break;default:r[0]+=i,r[2]-=2*i}switch(112&t){case 16:r[3]=e;break;case 64:r[1]=K.BOf(n)-e,r[3]=e;break;default:r[1]+=e,r[3]-=2*e}}return r}(u,this.GetClientRect(),h,a));var c=s[2],l=s[3];if(cK.ROf(s.client)-s.client[3]&&(o=272)}this.aXChg()&&this.allowD()&&e.IsMin()&&e.IsNone()&&e.GetResizable()&&(o=34)}else{e=this.p2W(t,n);var h=null,a=this.WL(),u=null;if(a&&(u=a.visZ())&&(h=i.call(this,u,t,n)),h&&e){var c=h.Window;if(e!=c){if(u.zorderOf(e)>u.zorderOf(c)){var l=this.w2R(e),f=K.NRt(l,this.w2R(c));K.EyR(f)||K.EqR(l,f)||(h=null)}h&&(e=c)}}h?(o=h.HitTest,e=h.Window):e&&!o&&(r=e,e.rWN()&&(o=34))}return{Window:e,HitTest:o,Client:r}},k.p2WHT=function(t){return t?this.p2HT(t.x,t.y):{Window:null,Client:null,HitTest:0}},k.e2W=function(t){var n=null;return this.CWs().rforEachU(function(i){var e=i.gPtr(t);return e&&i.canvas==t.target&&(n=i.p2W(e.x,e.y))}),n},k.gHov=function(){return this.oHovC||this.oHovW},k.sHov=function(){var t,n=null;return this.dokIn()?n=this.oHovW:(t=this.CWs())&&t.forEach(function(t){n||(n=t.oHovW)}),n},k.getBack=function(t){return K.D.Background},k.getFore=function(t){return K.D.Foreground},k.getHovBack=function(t){return K.D.HoverBackground},k.getHovFore=function(t){return K.D.HoverForeground},k.getOpaq=function(t){return K.D.Opacity},k.getHovOpaq=function(t){return K.D.HoverOpacity},k.getHovDur=function(t){return K.D.HoverDuration},k.isHovC=function(t){return K.D.HoverOnClient},k.lockURXChg=function(){this.rCW().lQURXChg++},k.unlockURXChg=function(){--this.rCW().lQURXChg},k.isURXChgLock=function(){return 0!=this.rCW().lQURXChg},k.addURXChg=function(t){if(t){var n=this.rCW();n.rgQURXChg.splice(n.nQURXChg),n.rgQURXChg.push(t),n.nQURXChg=n.rgQURXChg.length}},k.xURXChg=function(){var t=this.rCW();t.rgQURXChg=[],t.nQURXChg=0},k.isURXChgValid=function(t){var n=this.rCW();if(n.rgQURXChg&&t>=0&&t1}.call(n)){var i,e=n.nAXChg,r=n.rgATXChgT.indexOf(e);e=n.rgATXChgT[S(++r%n.rgATXChgT.length)],n.nAXChg=e,this.dokIn()?t(n):(i=this.CWs())&&i.forEach(function(n){t(n)})}},k.onlayout=function(t){function e(){this.feW(function(n){t.pCtx(n.GetIndex()),n.onlayout(t),t.rCtx()})}function r(){return this.rgW?this.rgW.map(function(t){return t.GetIndex()}).join():Z}function o(){return this.WL().toTree()}if(t.IsSave()){var s=o.call(this),h=r.call(this);s&&h&&(t.Add("tree",s),t.Add("order",h)),e.call(this)}else this.bU(),this.dokIn()||(g.WDN.ResetChanges(this.rCW()),this.oWD=null),function(t,e){function s(t){if(n(t))return"null"==(t=O(t))?null:I(t,-1)}if(t&&e&&(t+=Z,e+=Z,t!=o.call(this)||e!=r.call(this))){for(var h=!0,a=new K.Arr,u=e.split(","),c=0,l=u.length;h&&c=0&&tn}});return e.len()>1?e:null}(n,o))&&(s.push(r),r.forEach(function(t){i.set(t,r)}))})}return i&&i.size?i:null},G.doExt=function(t,n){if(t){var i=new Map;if(t.forEach(function(t){var e=n.call(t);e&&i.set(t,new K.Arr(e))}),i.size)return i}return null},G.doWHovExt=function(t){return this.doExtRec(t,F.getHoverExtends)},G.getHovExt=function(t){return this.mWHovExt?this.mWHovExt.get(t):null},G.doWVisExt=function(t){return this.doExt(t,F.getVisibleExtends)},G.getVisExt=function(t){var n=null;return this.mWVisExt&&(n=this.mWVisExt.get(t)),n},G.isVisExt=function(t){function n(t){return t.isVisible()&&!t.IsMinRec()}var i=t.isVisible();if(i){var e=this.getVisExt(t);e&&(e.has(t)?(i=!1,e.forEachU(function(e){if(e!=t)return i|=n(e)})):e.forEachU(function(t){if(!(i=n(t)))return!0}))}return i},G.isVisibleRL=function(t){return this.isVisExt(t)||t.IsMinRec()},G.doWSizeExt=function(t){return this.doExtRec(t,F.getSizeExtends)},G.getSizeExt=function(t){return(this.mWSizeExt?this.mWSizeExt.get(t):null)||null},G.shareWSizeExt=function(t,n){if(n){t.lRLC++;var i=new K.Arr;n.forEach(function(t,n){if(!i.has(n)){var e=n.GetSize();t.forEach(function(t){n!==t&&n.onSizeExtTo(t,e)}),i.push(n,t)}}),--t.lRLC}},G.reqMinSize=function(){for(var t={width:0,height:0},n=this.root(),i=[n],e=this.mWP,r=0;r=n&&K.BOf(r)<=l)&&(o&&((r=K.NRt(r,p))||((r=p.slice())[3]=0)),e.set(t,r),p[1]+=n,p[3]-=n);break;case 2:var n;(r=p.slice())[3]=t.GetSize(),r[1]=p[1]+p[3]-r[3],n=(r=t.inflateClient(r))[3],(o||!s||p[3]>=n)&&(o&&((r=K.NRt(r,p))||((r=p.slice())[1]=K.BOf(p),r[3]=0)),e.set(t,r),p[3]-=r[3]);break;case 3:(r=p.slice())[2]=t.GetSize(),i=(r=t.inflateClient(r))[2],(o||!s||p[2]>=i&&K.ROf(r)<=f)&&(o&&((r=K.NRt(r,p))||((r=p.slice())[2]=0)),e.set(t,r),p[0]+=i,p[2]-=i);break;case 4:var i,r=p.slice();r[2]=t.GetSize(),r[0]=p[0]+p[2]-r[2],i=(r=t.inflateClient(r))[2],(o||!s||p[2]>=i)&&(o&&((r=K.NRt(r,p))||((r=p.slice())[0]=K.ROf(p),r[2]=0)),e.set(t,r),p[2]-=i);break;default:e.set(t,t.GetClient().slice())}p[2]=S(0,p[2]),p[3]=S(0,p[3]),e.get(t)&&c.get(t)&&u.push(t)}},this),r.set(d,p)}}switch(this.nRLCType){case 2:var m=new Map,E=new Map;e.forEach(function(t,n){t[2]>0&&t[3]>0&&K.NRt(i,t)&&m.set(n,t)},this),r.forEach(function(t,n){t[2]>0&&t[3]>0&&E.set(n,t)},this),e=m,r=E;break;case 3:var A=new Map;e.forEach(function(t,n){K.NRt(i,t)&&A.set(n,t)},this),e=A}this.oZ=function(t){var n,i;return this.rgWZOrd&&t.size&&(n=new C,this.rgWZOrd.forEach(function(e){e&&(i=t.get(e))&&n.push(e,i)},this)),n}.call(this,e),n.call(this,this.oZ),function(t){t&&t.forEach(function(n,i){n&&i.onZ(t.rgWData)})}.call(this,this.oZ),this.oPWA=function(t){var n;return t.size&&(n=new C,t.forEach(function(t,i){n.push(i,t)})),n}.call(this,r),this.mInv=null,this.onsize(this.oCW.opZ,this.oZ)}},G.w2Inv=function(t){this.mInv=this.mInv||new Map;var n=this.mInv.get(t);return void 0===n&&this.mInv.set(t,n=function(t){var n,i,e=this.oZ;return e&&!K.EyR(i=e.get(t))&&((n=new C).cbkget=e.cbkget,e.forEach(function(t,e){!K.EyR(K.NRt(i,t))&&n.push(e,t)})),n&&n.len()&&n||null}.call(this,t)),n},G.visZ=function(){return this.oZ},G.hasZ=function(){return this.oZ&&this.oZ.forEachU(function(t){return!K.EyR(t)})},G.sZ=function(){this.osZ=null,this.oZ&&(this.osZ=this.oZ.copy(function(t){return t.slice()},this))},G.lZ=function(){this.onsize(this.osZ,this.oZ),this.osZ=null},G.onsize=function(t,n,i){if(function(t){return!t.lSiz||K.A.Rng(D)}(this.oCW)||i){this.oCW.lR++;var e=[],r=[],o=[];t&&t.forEach(function(t,i){n&&n.has(i)||e.push(i)}),n&&n.forEach(function(n,i){t&&t.has(i)||r.push(i)}),t&&n&&n.forEach(function(n,i){var e=t.get(i);e&&!K.EqR(n,e)&&o.push(i)}),e.forEach(function(n){n.onsize({old:t.get(n)})}),r.forEach(function(t){t.onsize({new:n.get(t)})}),o.forEach(function(i){i.onsize({old:t.get(i),new:n.get(i)})}),--this.oCW.lR}},G.toTree=function(){function t(n,i){var e,r,o=function(t){return t?t.GetIndex():null}(i);return n&&(e=n.get(i))&&(o+="(",r=!0,e.forEach(function(i){r||(o+=","),o+=t(n,i),r=!1}),o+=")"),o}return t(this.mWP,null)};var H=C.prototype;H.clear=function(){this.rgW.splice(0),this.rgWZOrd.clear(),this.rgWData.clear()},H.copy=function(t,n){var i=new C;return i.rgW=K.CpA(this.rgW),i.rgWZOrd=K.CpM(this.rgWZOrd),i.rgWData=K.CpM(this.rgWData,t,n||this),i},H.push=function(t,n){this.has(t)||(this.rgWZOrd.set(t,this.rgW.length),this.rgW.push(t)),this.rgWData.set(t,n)},H.set=function(t,n){this.has(t)&&this.rgWData.set(t,n)},H.indexOf=function(t){var n=this.rgWZOrd.get(t);return void 0!=n?n:-1},H.zorderOf=function(t){return this.indexOf(t)},H.has=function(t){return~this.indexOf(t)},H.get=function(t){var n=this.rgWData.get(t);return this.cbkget&&(n=this.cbkget.call(this,t,n)),n},H.forEach=function(t,n){for(var i,e=0,r=this.rgW.length;e=0;e--)t.call(n,this.get(i=this.rgW[e]),i,this)},H.rforEachU=function(t,n){for(var i,e=this.rgW.length-1;e>=0&&!t.call(n,this.get(i=this.rgW[e]),i,this);e--);},H.W=function(t){return t>=0&&t=0&&r>=0){for(var a,u=[],c=new K.Arr(e,o),s=0;s0&&this.isSplitable()},F.isLocked=function(){for(var t=this.GetLocked(),n=this;!t&&(n=n.opW);)t=n.GetLocked();return t},F.isSelectable=function(){return this.isEnabled()&&!this.isLocked()},F.isEnabled=function(){if(this.oCW.isEnabled()){for(var t=this.GetEnabled(),n=this;t&&(n=n.opW);)t=n.GetEnabled();return t}},F.isAP=function(t,n){return this.isEnabled()&&this==this.oCW.p2W(t,n)&&this.oCW.isAP(t,n)},F.isDisabled=function(){return!this.isEnabled()},F.GetVisible=function(){return this.bVis},F.SetVisible=function(t){this.bVis!=t&&(this.bVis=t,this.onUI())},F.getVisibleExtends=function(){return this.splitExtends(this.GetVisibleExtends(),!1)},F.getVisExt=function(){return this.oCW.getVisExt(this)},F.GetVisibleExtends=function(){return this.sVisExt},F.SetVisibleExtends=function(t){this.GetVisibleExtends()!=t&&(this.sVisExt=t,this.onUI())},F.GetEnabled=function(){return this.bE},F.SetEnabled=function(t){this.bE!=t&&(this.cTB=null,this.cTF=null,this.nTOq=null,this.bE=t)},F.isAllowKeys=function(){return this.isSelectable()&&this.GetAllowKeys()},F.GetAllowKeys=function(){return this.bAK},F.SetAllowKeys=function(t){this.bAK=t},F.GetResizable=function(){return this.bRsza},F.SetResizable=function(t){this.bRsza!=t&&(this.bRsza=t,this.onRLC())},F.GetLocked=function(){return this.bLkd},F.SetLocked=function(t){this.bLkd!=t&&(this.bLkd=t,this.onRLC())},F.GetDrawWindowFrame=function(){return this.bDWF},F.SetDrawWindowFrame=function(t){this.bDWF!=t&&(this.bDWF=t,this.onRLC())},F.GetBackground=function(){return this.cB},F.SetBackground=function(t){this.cB!=t&&(this.cTB=null,this.cB=t)},F.GetForeground=function(){return this.cF},F.SetForeground=function(t){this.cF!=t&&(this.cTF=null,this.cF=t)},F.GetHoverBackground=function(){return this.cHB},F.SetHoverBackground=function(t){this.cHB!=t&&(this.cTB=null,this.cHB=t)},F.GetHoverForeground=function(){return this.cHF},F.SetHoverForeground=function(t){this.cHF!=t&&(this.cTF=null,this.cHF=t)},F.isEmpty=function(){return!this.aXChg()&&!this.isResizable()&&(this.IsDockable()?this.getDockSize()<=0:this.client[2]<=0||this.client[3]<=0)},F.GetChildren=function(){return this.oCW.getChild(this)},F.IsMin=function(){return this.restoreClient&&K.EyR(this.client)&&this||null},F.IsMinRec=function(){return this.IsMin()||this.IsChildOfMin()},F.IsChildOfMin=function(){for(var t=null,n=this;!t&&(n=n.opW)&&!n.IsNone();)t=n.IsMin();return t},F.IsVisible=function(){return this.oCW.isVisible(this)},F.IsNone=function(){return 0==this.GetDock()},F.IsFill=function(){return 5==this.GetDock()},F.IsDockable=function(){return!this.IsNone()&&!this.IsFill()},w.AreDocksEquivalent=function(t,n){if(t!=n){if(0==t||0==n)return!1;if(5!=t&&5!=n)switch(t){case 3:case 4:switch(n){case 1:case 2:return!1}break;case 1:case 2:switch(n){case 3:case 4:return!1}}}return!0},F.rWN=function(){for(var t=this;t&&!t.IsNone();)t=t.opW;return t},F.isCWN=function(){return this.IsNone()&&this.oCW.opCW},w.GetXChgDockToggle=function(){return 6},F.GetDock=function(){return this.nDk},F.SetDock=function(t){if(this.GetDock()!=t){var n=this.GetSize();this.nDk=t,this.SetSize(n),this.onUI()}},F.ensCMin=function(t){if(t){var n=this.getMinSize(),i=S(n.width,t[2]);t[0]=K.ROf(t)-i,t[2]=i,t[3]=S(n.height,t[3])}return t},F.updCWN=function(t){var n,i=!1;return this.isCWN()&&(n=this.oCW.rCW().GetViewRect(),i=function(t,n){this.IsMin()&&(t=this.ensCMin(t));var i=K.ETo(this.oCW.canvas,t);return(i||n)&&this.oCW.Resize(),this.oCW.feC(function(t){t.SetCanvasRect&&t.SetCanvasRect.call(t)}),i}.call(this,K.ORt(this.GetClient(),n[0],n[1]),t)),i},F.refCWN=function(){return this.updCWN(!0)},F.SetClient=function(t){this.setClient(t),this.updCWN()},F.v2WC=function(t){var n,i,e,r,s=this.GetDock(),a=this.GetClient();if(h(t))r=S(0,W(t)),(n=1==s||2==s)?a[3]=r:(n=3==s||4==s)&&(a[2]=r);else if(n=o(t)&&(r=m(4,t.length))){for(var u=0;u=64;e<64&&p!=e&&(p=e,o&&(d.cTB=o[e]),s&&(d.cTF=s[e]),l&&(d.nTOq=l[e]),d.nHov=e/63,r||d.onHovAttr()),r&&(d.nHov=null,d.xHov(),d.onHovAttr())}):this.hHov=setInterval(function(){var n=K.Tick(),i=Math.floor(S(0,n-v)/(t/64)),e=S(0,m(i,63)),r=i>=64;e<64&&p!=e&&(p=e,o&&(d.cTB=o[e]),s&&(d.cTF=s[e]),l&&(d.nTOq=l[e]),d.nHov=e/63,r||d.onHovAttr()),r&&(d.nHov=null,d.xHov(),d.onHovAttr())},t/64)}},F.onHovI=function(){if(this.xHov(),this.hasHov()){var t=this.oCW.rCW().getHovDur(this);t?this.setHov(t,{Background:this.getHovBack(),Foreground:this.getHovFore(),Opacity:this.getHovOpaq(),ClearTransitionColors:!1}):(this.cTB=this.getHovBack(),this.cTF=this.getHovFore(),this.nTOq=this.getHovOpaq(),this.onHovAttr())}},F.onHovO=function(){if(this.xHov(),this.hasHov()){var t=this.oCW.rCW().getHovDur(this);t?this.setHov(t,{Background:this.isHovOver()?this.getBack():null,Foreground:this.getFore(),Opacity:this.getOpaq(),ClearTransitionColors:!0}):(this.cTB=null,this.cTF=null,this.nTOq=null,this.onHovAttr())}},F.GetCanvas=function(){return this.oCW.canvas},F.iLts=function(){var t=new K.Lts;t.add("onerase"),t.add("onpaint"),t.add("ondown"),t.add("onsize"),t.add("onexchange"),t.add("onexchangepos"),t.add("ondock"),t.add("ontoggle"),t.add("oncw"),t.add("onio"),t.add("onmousemove"),t.add("onmousedown"),t.add("onmouseup"),t.add("onmouseout"),t.add("onmouseover"),t.add("onpointermove"),t.add("onpointerdown"),t.add("onpointerup"),t.add("onpointercancel"),t.add("ontouchstart"),t.add("ontouchmove"),t.add("ontouchend"),t.add("ontouchcancel"),t.add("onwheel"),t.add("oncontextmenu"),t.add("onkeydown"),t.add("onkeyup"),t.add("onkeypress"),t.add("onhscroll"),t.add("onhclick"),t.add("onvscroll"),t.add("onvclick"),this.oLts=t},F.SetC=function(t){this.oC!=t&&(this.oC&&(this.oC._setcontrol_&&(this.oC.oW=this.oC._setcontrol_.oW,this.oC.oninv=this.oC._setcontrol_.oninv,this.oC.GetClientRect=this.oC._setcontrol_.GetClientRect,this.oC.GetCanvas=this.oC._setcontrol_.GetCanvas,this.oC._setcontrol_=null),this.oCW.oSts&&this.oC.udefSts&&this.oC.udefSts(this.oCW.oSts),this.oLts.removeAnyOf(this.oC),this.oC.dettach&&this.oC.dettach()),this.oC=t,this.oC&&(this.oC._setcontrol_={oW:this.oC.oW,oninv:this.oC.oninv,GetCanvas:this.oC.GetCanvas,GetClientRect:this.oC.GetClientRect},this.oC.oW=this,this.oC.oninv=function(t){this.oW.Inv()},this.oC.GetCanvas=function(){return this.oW.GetCanvas()},this.oC.GetClientRect=function(){var t=this.oW.GetClientRect();return t||(t=K.C2R(t)),t},this.oCW.oSts&&this.oC.defSts&&this.oC.defSts(this.oCW.oSts),this.oLts.add("onerase",this.oC),this.oLts.add("onpaint",this.oC),this.oLts.add("onsize",this.oC),this.oLts.add("onexchange",this.oC),this.oLts.add("onexchangepos",this.oC),this.oLts.add("ondock",this.oC),this.oLts.add("ontoggle",this.oC),this.oLts.add("oncw",this.oC),this.oLts.add("onio",this.oC),this.oLts.add("ondown",this.oC),this.oLts.add("onmousemove",this.oC),this.oLts.add("onmousedown",this.oC),this.oLts.add("onmouseup",this.oC),this.oLts.add("onmouseout",this.oC),this.oLts.add("onmouseover",this.oC),this.oLts.add("onpointerstart",this.oC),this.oLts.add("onpointermove",this.oC),this.oLts.add("onpointerend",this.oC),this.oLts.add("onpointercancel",this.oC),this.oLts.add("ontouchstart",this.oC),this.oLts.add("ontouchmove",this.oC),this.oLts.add("ontouchend",this.oC),this.oLts.add("ontouchcancel",this.oC),this.oLts.add("onwheel",this.oC),this.oLts.add("oncontextmenu",this.oC),this.oLts.add("onkeydown",this.oC),this.oLts.add("onkeyup",this.oC),this.oLts.add("onkeypress",this.oC),this.oLts.add("onhscroll",this.oC),this.oLts.add("onhclick",this.oC),this.oLts.add("onvscroll",this.oC),this.oLts.add("onvclick",this.oC),this.oC.attach&&this.oC.attach()))},F.GetC=function(){return this.oC},F.onRemove=function(){this.SetSBs(null,null),this.SetC(null)},F.gPtr=function(t){return this.oCW.gPtr(t)},F.onmouseover=function(t){return this.onHovI(),this.oLts.onmouseover.do(t)},F.onmouseout=function(t){return this.onHovO(),this.oLts.onmouseout.do(t)},F.onwheel=function(t){var n=this.oLts.onwheel.do(t);if(!n){var i=this.gPtr(t);if(i&&K.PInR(i.x,i.y,this.GetClientRect())){var e=this.vSBs(),r=e.length;if(r){var o=0;return K.IsModK(t)&&r>1&&o++,e[o].dowheel(t)}}}return n},"contextmenu,down,mousedown,mousemove,mouseup,pointerdown,pointermove,pointerup,pointercancel,touchstart,touchmove,touchend,touchcancel,keydown,keyup,keypress".split(",").forEach(function(t){!function(t,n){n[t="on"+t]=function(n){return this.oLts[t].do(n)}}(t,F)}),F.onsize=function(t){this.oLts.onsize.do(t)},F.onexchange=function(t){return!this.oLts.onexchange.do(t)},F.onexchangepos=function(t){return!this.oLts.onexchangepos.do(t)},F.ondock=function(t,n){return!this.oLts.ondock.do({parent:t,dock:n})},F.ontoggle=function(){return!this.oLts.ontoggle.do()},F.oncw=function(t){this.oLts.oncw.do(t),this.oCW=t},F.onio=function(t){this.oLts.onio.do(!!t)},F.onlayout=function(t){var n;!t.IsSave()&&(this.restoreClient=null),t.Layout(this,w.Options.Layout),(n=this.oC)&&n.onlayout&&(t.pCtx("c"),n.onlayout.call(n,t),t.rCtx())},F.toSB=function(t){if(t){if(!(t instanceof K.SB)){var n=this.oCW.W(t);n&&(t=n.oC)}t=t instanceof K.SB&&t||null}return t},F.GetHS=function(){return this.oHS},F.SetHS=function(t){t=this.toSB(t),this.oHS!=t&&(this.oHS&&(this.oHS.oLts.removeAnyOf(this),this.oHS=null),t&&(this.oHS=t,this.oHS.ResetRange(),this.oHS.oLts.add("onchange",this,"onhscroll"),this.oHS.oLts.add("onclickingpart",this,"onhclick")),this.oCW.onASBs(this))},F.GetVS=function(){return this.oVS},F.SetVS=function(t){t=this.toSB(t),this.oVS!=t&&(this.oVS&&(this.oVS.oLts.removeAnyOf(this),this.oVS=null),t&&(this.oVS=t,this.oVS.ResetRange(),this.oVS.oLts.add("onchange",this,"onvscroll"),this.oVS.oLts.add("onclickingpart",this,"onvclick")),this.oCW.onASBs(this))},F.onExtSBs=function(t){var i=this.sExtSBS;if(n(i)){var e=this.splitExtends(i);e&&e.forEach(function(n){n.SetOpacity(t?0:null),n.SetHoverOpacity(t?1:null)},this),this.SetExtends(t?i:null)}},F.onMinSBs=function(t){this.GetSBs().forEach(function(n){var i,e;t?(i=K.Def.ScrollBar.min,n.oMinSBS||(n.oMinSBS=K.Cpy(n.oO),(e=R(n.oW))&&(n.oMinSBS.size=e.GetSize(),e.SetSize(8)))):n.oMinSBS&&(i=n.oMinSBS,(e=R(n.oW))&&e.SetSize(n.oMinSBS.size),n.oMinSBS=null,n.nHideSBS=null),n.SetOptions(i)})},F.onHidSBs=function(t){this.GetSBs().forEach(function(e){var r;t?i(e.nHideSBS)&&(r=R(e.oW))&&(e.nHideSBS=r.GetSize(),r.SetSize(0)):n(e.nHideSBS)&&((r=R(e.oW))&&r.SetSize(e.nHideSBS),e.oMinSBS=null,e.nHideSBS=null)})},F.rqbSB=function(){return this.sHS||this.sVS},F.bSBs=function(){return this.sHS&&(this.SetHS(this.sHS),this.oHS&&(this.sHS=null)),this.sVS&&(this.SetVS(this.sVS),this.oVS&&(this.sVS=null)),!this.rqbSB()},F.SetSBs=function(t,n){this.SetHS(t),this.SetVS(n)},F.SetSB=function(t,n){this[t?"SetHS":"SetVS"].call(this,n)},F.GetSB=function(t){return t?this.GetHS():this.GetVS()},F.GetSBs=function(){var t,n=[];return(t=this.GetSB(!1))&&n.push(t),(t=this.GetSB(!0))&&n.push(t),n},F.vSBs=function(){function t(t){t&&t.isPsbl()&&t.visW()&&t.isSelectable()&&n.push(t)}var n=[];return t(this.GetSB(!1)),t(this.GetSB(!0)),n},F.GetSP=function(t){var n=this.GetSB(t);return n&&n.visW()&&n.GetPos()||0},F.SetSP=function(t,n){var i=this.GetSB(t);i&&i.SetPos(n)},F.GetScroll=function(){return{x:this.GetSP(!0),y:this.GetSP(!1)}},F.SetScroll=function(t){t&&("x"in t&&this.SetSP(!0,t.x),"y"in t&&this.SetSP(!1,t.y))},F.GetSI=function(t){var n=this.GetSB(t),i=null;return n&&(i=n.GetInfo())&&(i.pos=this.GetSP(t)),i},F.SetSI=function(t,n){function i(t,n){var i=0;return t&&t.isSP()&&(i+=1),n&&n.isSP()&&(i+=2),i}var e,r=this.GetHS(),o=r&&t,s=this.GetVS(),h=s&&n;(o||h)&&(e=i(r,s),o&&r.SetInfo(t),h&&s.SetInfo(n),e!=i(r,s)&&this.oCW.Refresh((o||h)&&!(o&&h)))},F.Scroll=function(t,n){var i,e=K.SB.K2A.get(A(O(P(t))));e&&(1==(i=I(e.m))?[this.oHS]:2==i?[this.oVS]:[this.oHS,this.oVS]).forEach(function(t){t&&t.Scroll(e.a,n)})},F.toEVP=function(t,n,i){var s=null;if(t){n=n||0;var h=K.IRt(this.GetClientRect(),-n,-n),a=o(t),u=0,c=0;if("x"in t||a){var l=e(t),f=h[0];if(lg&&(u=l-g)}}if("y"in t||a){var d=r(t),v=h[1];if(dp&&(c=d-p)}}(u||c)&&(i=i||1,s={},u&&(s.x=this.GetSP(!0)+u/i),c&&(s.y=this.GetSP(!1)+c/i))}return s},F.EVP=function(t,i,e){var r=this.toEVP(t,i,e);return r&&this.SetScroll(r),n(r)},F.toEVR=function(t,n,i,e){var r=null;if(t){var o=n||this.GetClientRect(),s=t[0]-o[0],h=K.ROf(t)-K.ROf(o),a=t[1]-o[1],u=K.BOf(t)-K.BOf(o);e&&t[2]>o[2]&&E(h)0&&(s=h>0?m(s,h):0),e&&t[3]>o[3]&&E(u)0&&(a=u>0?m(a,u):0),(s||a)&&(i=i||1,r={},s&&(r.x=this.GetSP(!0)+s/i),a&&(r.y=this.GetSP(!1)+a/i))}return r},F.SSw=function(t){var n=this.oCW;this.GetSBs().forEach(function(i){i.Swipe(t,!0,n?function(t,i){n.bR(),t.SetPos(i),n.eR()}:null,i)})},F.onhscroll=function(t){this.oLts.onhscroll.do(this.GetSP(!0)),this.Inv()},F.onhclick=function(t){return this.oLts.onhclick.do(t)},F.onvscroll=function(t){this.oLts.onvscroll.do(this.GetSP(!1)),this.Inv()},F.onvclick=function(t){return this.oLts.onvclick.do(t)},F.Smooth=function(t,n){function i(t){o.Render(t.oWRend)}function e(t){s.forEach(function(n){n.lR+=t})}if(t){(n=n||{}).name=n.name||"smth-w"+K.Rand(),n.onXDoL=n.onXDoL||!1,n.thisArg=n.thisArg||this,n.size=L(n.size,!0),n.cbkR=n.cbkR||i;var r,o=this.oCW,s=o.CWs(),h={oW:this,oZ:o.WL().oZ||null,oNewZ:null,rgWFT:new K.M1,oWRend:null,progress:0};o.lR++,o.lRLC++,e(1),t.call(n.thisArg),e(-1),--o.lRLC,o.lPR++,o.onUI(),setTimeout(function(){--o.lPR}),h.oNewZ=o.WL().oZ||null,h.rgWFT=K.M1.prototype.smooth.call(h.oZ,h.oNewZ);var a,u=!(!h.oNewZ||!h.rgWFT.len()),c=u&&n.size;h.oWRend=!u&&this||null,K.A.Cancel(n.name),K.A.Progress(function(t){h.progress=t,(a=1==t)&&u&&(o.onUI(),o.rXChg(),h.oNewZ=o.WL().oZ,c=!0),o.lPR++,c&&o.WL().onsize(h.oZ,h.oNewZ,!0),o.CWs().forEach(function(t){t!=o&&t.Render()}),n.cbkR.call(n.thisArg,h),a&&n.cbkR!=i&&i.call(n.thisArg,h),--o.lPR},n,function(t,i){switch(i){case-1:o.lHovWC(),n.onXDoL&&o.lE++,n.cbkI&&n.cbkI.call(n.thisArg,h),u&&(h.oNewZ.cbkget=function(t,n){var i=h.rgWFT.get(t);return i&&K.R.Rect(h.progress,null,i)||n}),--o.lR;break;case-6:n.cbkT&&n.cbkT.call(n.thisArg,h),n.onXDoL&&--o.lE,o.uHovWC(),(r=o.gAO())&&r.refresh()}})}},{CC:t,CW:g,WS:C,W:w}}()),K.Mrg(K,function(){function t(t){return t?0:1}function o(t){return t?2:3}function s(t){return t?"horizonalOverlayShapes":"verticalOverlayShapes"}function h(t){return t?"horizonalShapes":"verticalShapes"}function a(t,n){return"sb"+(n?"c":"h")+t}function u(t,n){this.lI=this.nV=this.nmV=0,this.nMV=100,this.iLts(),this.oO=K.Cpy(u.Options),this.SetClientRect(t),this.SetOptions(n||l,!0),K.CC.GetCanvas(t)&&this.SetCanvas(t),K.DPR.Reg(this)}var c,l=K.Def.ScrollBar;return c=u.prototype,u.version="3.0",u.type="ScrollBar",u.ModeEnum={exAuto:-1,exVertical:0,exHorizontal:1},u.PartEnum={exLeftB1Part:32768,exLeftB2Part:16384,exLeftB3Part:8192,exLeftB4Part:4096,exLeftB5Part:2048,exLeftBPart:1024,exLowerBackPart:512,exThumbPart:256,exUpperBackPart:128,exBackgroundPart:640,exRightBPart:64,exRightB1Part:32,exRightB2Part:16,exRightB3Part:8,exRightB4Part:4,exRightB5Part:2,exRightB6Part:1,exPartNone:0},u.ActionEnum={exLineUp:0,exLineLeft:0,exLineDown:1,exLineRight:1,exPageUp:2,exPageLeft:2,exPageDown:3,exPageRight:3,exThumbPos:4,exThumbTrack:5,exScrollTop:6,exScrollLeft:6,exScrollHome:6,exScrollBottom:7,exScrollRight:7,exScrollEnd:7},u.K2A=function(){var t=new Map;return K.B.split("home[v](6),end[v](7),prior[v](2),pageup[v](2),next[v](3),pagedown[v](3),up[v](0),arrowup[v](0),down[v](1),arrowdown[v](1),left[h](0),arrowleft[h](0),right[h](1),arrowright[h](1)").forEach(function(n){t.set(n.caption,{a:~~n.subText,m:n.flags?n.flags.has("h")?1:n.flags.has("v")?2:0:0})}),t}(),u.DisableNoScrollEnum={exHideNoScroll:0,exDisableNoScroll:1,exShowNoScroll:2},u.Options={tfi:null,locked:null,readOnly:null,mode:-1,adjustThumbPos:!1,allowKeys:null,allowScrollDirect:null,buttonSize:null,thumbSize:null,ignoreLargeChange:null,disableNoScroll:null,orderParts:null,visibleParts:null,enableParts:null,horizonalShapes:null,verticalShapes:null,horizonalOverlayShapes:null,verticalOverlayShapes:null,cursors:null,smallChange:null,largeChange:null,wheelChange:null,value:0,min:0,max:100},u.Parts=function(){function t(t){var i;return n(t)&&(i=s.get(A(O(t.toString())))),i}function e(r,o){function s(t,i){var e=!1;return n(t)&&(i?e=!0:t&&0==(640&t)&&(e=!0)),e}var h,a=new K.Arr,c=i(o),l=u.PartEnum;if((r||Z).split(",").forEach(function(n){s(h=t(n),c)&&a.add(h)}),!c){e(o).forEach(function(n){s(h=t(n),c)&&a.add(bDefaultPart)});for(var f in l)s(h=l[f],c)&&a.add(h)}return a}function r(t){return s.getKey(t)||Z}function o(t){var n,i=new Map;return(t=O(t||Z))&&t.splitP(",").forEach(function(t){if(n=function(t){var n=null;if(t=O(t)){var i=y(t,"(");if(i>=0){var e=t.length-(i+1);")"==t.charAt(t.length-1)&&e--,n={shape:T(t,0,i),parts:T(t,i+1,e)}}}return n}(t)){var r=n.shape;e(n.parts).forEach(function(t){i.set(t,r)})}}),i}for(var s=new K.BiM,h=u.PartEnum,a=1;a<=5;a++)s.set("l"+a,h["exLeftB"+a+"Part"]);s.set("l",1024),s.set("t",256),s.set("r",64);for(a=1;a<=6;a++)s.set("r"+a,h["exRightB"+a+"Part"]);s.set("lo",512),s.set("b",640),s.set("up",128);return{Str2Part:t,Part2Str:r,ToOrder:e,ToFlags:function(t){var n=0;return e(t).forEach(function(t){n|=t}),n},Flags2Str:function(t){var n=Z;return t&&s.forEach(function(i,e){i==(t&i)&&(n+=(n?",":Z)+e)}),n},Parts2Str:function(t){var n=Z;return t&&t.forEach(function(t){t&&(n&&(n+=","),n+=r(t))}),n},Str2Shp:o}}(),u.addProto=function(t,n,i){n=n||c,P(i,"onsize,onpaint,oninv,oncw,W,gCW,inv,gCtx,gPtr,visW,isVisible,isSelectable,isEnabled,isLocked,isAP,invAO,rfhAO,setAO,resAO,drawAO,visAO,gAO").split(",").forEach(function(i){t[i]=n[i]})},c.GetOptions=function(){return this.oO},c.SetOptions=function(t,n){var i=!1;if(t){var e=[],r=this.GetOptions();if(r){for(var o in r){var s=t[o];void 0!==s&&(e.push(o),r[o]!==s&&(r[o]=K.CpV(s)))}if(n)for(var o in t)o in r||(r[o]=K.CpV(t[o]));(i=e.length)&&(this.bU(),e.forEach(function(t){var n=K.setM(t);n in this&&this[n].call(this,r[t])},this),this.eU())}}return i},c.GetCanvas=function(){return this.canvas},c.SetCanvas=function(){function t(t,n){this.udefSts(this.oSts),this.oSts=null,this.resAO(),t=K.CC.GetCanvas(t),!n&&K.CC.SetCanvas(this,t),this.canvas=t,K.CC.GetCanvas(this.canvas)&&this.defSts(this.Shortcuts=this.oSts=new K.Sts),this.rfhAO()}(K.ComboBox?K.ComboBox.implExHost(t,"onchange"):t).apply(this,arguments)},c.dCBl=function(t,n,i){i.oO.label=this.GetValue()},c.cCB=function(t){return this.isLocked()||this.GetCanvas()!=t.target},c.sCB=function(t){return t&&this.SetValue(this.GetMin()),this.GetValue()},c.SetClientRect=function(t){var n=K.CC.GetCanvas(t);n&&(t=[0,0,n.width,n.height]),this.client=K.C2R(t),!this.visAO()&&this.resAO(),this.onRL(!1)},c.GetClientRect=function(){return this.client.slice()},c.inv=function(t){K.CC.invC(this,t)},c.BeginUpdate=function(){this.lI++||(this.oInfoI=this.GetInfo())},c.bU=c.BeginUpdate,c.EndUpdate=function(){if(!--this.lI){var t,n=this.oInfoI,i=!n;if(i||(t=this.GetInfo(),i=n.pos!=t.pos||n.page!=t.page||n.range!=t.range),i)if(this.oW&&this.oW.oCW.lI){var e=this;clearTimeout(this.hRAO),this.hRAO=setTimeout(function(){e.rfhAO()})}else this.rfhAO();this.oInfoI=null}},c.eU=c.EndUpdate,c.Update=function(t,n){this.bU(),t&&t.call(n||this),this.eU()},c.invAO=function(t){this.resAO(),this.inv(t)},c.rfhAO=function(t){this.inv(t);var n=this.gAO();n&&n.refresh()},c.onpaint=function(t){!this.lI&&K.H.StoreA(this,function(){K.pCTX(t,function(){var n=K.TFI.bCTX(t,this.getTfi()),i=this.isSelectable();!i&&K.H.lA++,this.setAO(t),this.draw(t,this.GetClientRect()),!i&&--K.H.lA,K.TFI.eCTX(t,n)},this)})},c.oninv=function(t){t&&this.onpaint(t)},c.gCtx=function(){var t=this.GetCanvas();return t&&t.getContext("2d")},c.gAO=function(){var t=this.gCtx();return t&&t.gAO()},c.visAO=function(){return this.isVisible()},c.isSelectable=function(){return this.isEnabled()&&!this.isLocked()},c.setAO=function(t){if(this.visAO()){var n,i=!0;this.oEF?n=this.oEF.oAO:(n=t.gAO())&&(i=!1,!n.lU&&this.onSetAO(n),n.hasOf(this)&&n.onDrawAO(this.drawAO,this)),i&&this.drawAO(t,n)}else this.resAO()},c.drawAO=function(t,n){},c.resAO=function(){var t=this.gAO();t&&t.remove(this,null)},c.W=function(){return this.oW||this.oCW},c.gCW=function(){var t=this.W();return t&&t.oCW||t},c.visW=function(){return!this.W()||this.W().isVisible()},c.isVisible=function(){return this.visW()&&!K.EyR(this.GetClientRect())},c.isEnabled=function(){return!this.W()||this.W().isEnabled()},c.isLocked=function(){var t=this.W();return this.getLocked&&this.getLocked()||t&&t.isLocked()},c.isAP=function(t,n){return this.isEnabled()&&!this.W()||this.W().isAP(t,n)},c.gPtr=function(t){return K.e2P(t)},c.onmousemove=function(t){var n,i=this.hitTest(this.gPtr(t));return i&&i.cursor&&(n=this.GetCanvas())&&(n.style.cursor=i.cursor),i},c.onwheel=function(t){if(this.isSelectable()){var n=this.gPtr(t);if(n&&K.PInR(n.x,n.y,this.GetClientRect()))return this.dowheel(t)}},c.dowheel=function(t){var n,i,e=this.getWheelChange();return e>0&&(n=K.WhelInc(t))&&(K.AO.tlA(this.gAO(),!0),i=this.SetValue(this.GetValue()-n*e),K.AO.tlA(this.gAO(),!1)),i},c.ondown=function(t){var n=this.hitTest(this.gPtr(t));if(n)return n.callback&&n.callback.call(n.thisArg,t,n),!0},c.onkeydown=function(t){this.onkey(t,-1)},c.onkeyup=function(t){this.onkey(t,0)},c.onkeypress=function(t){this.onkey(t,1)},c.onkey=function(t,n){this.oSts&&this.oSts.onkey(t,n),function(t,n){if(this.getAllowKeys())switch(n){case-1:var i,e,r=u.ActionEnum,o=K.K.ToSt(t);o&&!K.K.IsModK(o)&&K.Like.Match(e=K.K.St2Str(o),"Arrow* Page* Home End")&&(i="ex"+(i=(i=(i=(i=e).replace("Arrow","Line")).replace("Home","ScrollHome")).replace("End","ScrollEnd")))in r&&this.Scroll(r[i])}}.call(this,t,n)},c.onsize=function(t){this.SetClientRect(t.new)},c.oncw=function(t){this.resAO()},c.udefSts=function(t){t&&t.RemoveOf(this)},c.defSts=function(t){},c.p2Val=function(n){var i,s,h,a=this.cltBk,u=this.GetMinValue();return a&&(i=this.isH(),s=this.getThumbRect(),h=i?e(n):r(n),s&&(h-=s[o(i)]/2),h-=a[t(i)],u=this.off2V(h)),u},c.p2P=function(t){var n=this.getPartsRect();return n&&n.p2O(e(t),r(t))||null},c.hitTest=function(t){var n,i;return t&&this.isSelectable()&&(i=this.p2P(t))&&this.isEnablePart(i)&&(n={cursor:this.getCursorPart(i),code:i,callback:function(t,n){this.onHTDown(n.code,t)},thisArg:this}),n},c.onHTDown=function(t,n){this.onPartDown(t,n)},c.onPartDown=function(n,i){function e(n,i){K.RUC(i,function(i,e){if(this.isEnablePart(n)){if(!this.onClickingPart(n)){switch(n){case 1024:this.Scroll(0);break;case 64:this.Scroll(1);break;case 512:case 128:var r=!0,s=512==n,h=this.getThumbRect(),a=this.gPtr(i);if(a&&h){var u=this.isH(),c=o(u),l=t(u),f=u?a.x:a.y;r=s?h[l]>f:h[l]+h[c]0?S(0,m(t,this.GetRange()-o)):-m(-t,o)),(s=0!=t)&&(e=e||this,!i&&(i=function(t,n){t.SetPos(n)}),(n=n||l.Swipe).duration?K.A.Progress(function(n){i.call(e,this,o+~~(n*t))},{thisArg:this,name:r,duration:n.duration,transition:n.transition,onXDoL:!1}):i.call(e,this,o+t))),s},c.smthTo=function(t,n){return this.smthBy(t-this.GetValue(),n)},c.onClickingPart=function(t){return this.onclickingpart(t)},c.onclickingpart=function(t){return this.oLts.onclickingpart.do(t)},c.onClickPart=function(t){this.onclickpart(t)},c.onclickpart=function(t){this.oLts.onclickpart.do(t)},c.onSetAO=function(t){var n,i=this.getPartsRect();i&&i.forEach(function(i,e){!t.has(this,n=a(e))&&t.set({owner:this,id:n,inv:this.inv,hitTest:function(t,n,i){return this.isAP(t,n)&&this.isEnablePart(i.part)&&K.PInR(t,n,i.owner.p2rt(i.part))},duration:K.Def.A.duration,part:e}),!t.has(this,n=a(e,!0))&&t.set({owner:this,id:n,inv:this.inv,hitTest:function(t,n,i){return this.isAP(t,n)&&this.isEnablePart(i.part)&&K.PInR(t,n,i.owner.p2rt(i.part))},actOn:4,duration:0,part:e})},this)},c.onRL=function(t){(t||i(t))&&this.resAO(),this.cltBk=null,this.rgVisP=null},c.draw=function(t,n,i){var e=this.getPartsRect(),r=t.gAO();e&&e.forEach(function(n,i){this.drawPart(t,i,n,r)},this)},c.getShapePart=function(t){var n,i=this.getShapeParts(this.isH());return i&&(n=i.get(t)),n},c.getOverlayShapePart=function(t){var n,i=this.getOverlayShapeParts(this.isH());return i&&(n=i.get(t)),n},c.getStateShapes=function(t,i){var e,r={normal:{},disabled:{},hover:{},click:{}};if(n(t)&&(e=K.S.Get(i,"ScrollBar"))){for(var o in r){var s,h,a,u=r[o];t&&t in e&&(h=e[t])&&o in h&&(a=h[o])&&(s=a),s&&K.DfO(u,s)}K.DfO(r.disabled,r.normal),K.DfO(r.hover,r.normal),K.DfO(r.click,r.hover)}return r},c.drawPart=function(t,n,i,e){function r(r,o,h,u){var c,l=o.normal;s?l=o.disabled||l:e&&(K.EyO(o.hover)||(c=e.get(r,a(n)))&&(l=K.R.Shape(c.state,c.range,{from:l,to:o.hover})),K.EyO(o.click)||(c=e.get(r,a(n,!0)))&&(l=K.R.Shape(c.state,c.range,{from:l,to:o.click}))),t.drawShape(i,l,{text:h,formatText:u})}var o,s=!(this.isSelectable()&&this.isEnablePart(n));K.EyR(i)||(o=this.getShapePart(n),r(this,this.getStateShapes(o,"background"),this.GetCaptionPart(n),262149),r(this,this.getStateShapes(o,"foreground")),r(this,this.getStateShapes(this.getOverlayShapePart(n),"overlay")))},c.GetOrderParts=function(){return u.Parts.Parts2Str(this.getOrderParts())},c.SetOrderParts=function(t){this.oO.orderParts=t,this.rgOrdP=null,this.onRL()},c.getOrderParts=function(){if(!this.rgOrdP){var t=this.oO.orderParts,i=l.orderParts;this.rgOrdP=u.Parts.ToOrder(n(t)?t:i,i)}return this.rgOrdP},c.GetShapeParts=function(t){return this.oO[h(t)]},c.GetShapePart=function(t,n){var i=Z,e=this.getShapeParts(t);return e&&(i=e.get(n)),i||Z},c.SetShapeParts=function(t,n){this.oO[h(t)]=n,this.setShapeParts(t,null),this.onRL()},c.SetHorizonalShapes=function(t){this.SetShapeParts(!0,t)},c.SetVerticalShapes=function(t){this.SetShapeParts(!1,t)},c.SetShapePart=function(t,n,i){if(n){var e=this.getShapeParts(t)||new Map;e.set(n,i),this.setShapeParts(t,e),this.onRL()}},c.getShapeParts=function(t){var i,e,r=t?this.mHShpP:this.mVShpP;return r||(r=u.Parts.Str2Shp(l[h(t)]),n(i=this.GetShapeParts(t))&&(e=u.Parts.Str2Shp(i),r?e&&e.forEach(function(t,n){r.set(n,t)},this):r=e),this.setShapeParts(t,r)),r},c.setShapeParts=function(t,n){this[t?"mHShpP":"mVShpP"]=n},c.GetOverlayShapeParts=function(t){return this.oO[s(t)]},c.GetOverlayShapePart=function(t,n){var i=Z,e=this.getOverlayShapeParts(t);return e&&(i=e.get(n)),i||Z},c.SetOverlayShapeParts=function(t,n){this.oO[s(t)]=n,this.setOverlayShapeParts(t,null),this.onRL()},c.SetHorizonalOverlayShapes=function(t){this.SetOverlayShapeParts(!0,t)},c.SetVerticalOverlayShapes=function(t){this.SetOverlayShapeParts(!1,t)},c.SetOverlayShapePart=function(t,n,i){if(n){var e=this.getOverlayShapeParts(t)||new Map;e.set(n,i),this.setOverlayShapeParts(t,e),this.onRL()}},c.getOverlayShapeParts=function(t){var i,e,r=t?this.mHOShpP:this.mVOShpP;return r||(r=u.Parts.Str2Shp(l[s(t)]),n(i=this.GetOverlayShapeParts(t))&&(e=u.Parts.Str2Shp(i),r?e&&e.forEach(function(t,n){r.set(n,t)},this):r=e),this.setOverlayShapeParts(t,r)),r},c.setOverlayShapeParts=function(t,n){t?this.mHOShpP=n:this.mVOShpP=n},c.GetVisibleParts=function(){return u.Parts.Flags2Str(this.getVisibleParts())},c.GetVisiblePart=function(t){return(this.getVisibleParts()&t)==t},c.SetVisibleParts=function(t){this.oO.visibleParts=t,this.nVisP=null,this.onRL()},c.SetVisiblePart=function(t,n){if(t){var i=this.getVisibleParts();n?i|=t:i&=~t,this.nVisP=i,this.onRL()}},c.getVisibleParts=function(){if(i(this.nVisP)){var t=this.oO.visibleParts;this.nVisP=u.Parts.ToFlags(n(t)?t:l.visibleParts)}return this.nVisP},c.isVisPart=function(t){var n,i=this.GetVisiblePart(t);if(i){if(1&(n=this.getDisableNoScroll()))switch(t){case 256:i=this.isEnablePart(1024)||this.isEnablePart(64)}if(2&n)switch(t){case 512:case 128:case 640:case 256:i=this.isPsbl()}}return i},c.GetEnableParts=function(){return u.Parts.Flags2Str(this.getEnableParts())},c.GetEnablePart=function(t){return(this.getEnableParts()&t)==t},c.SetEnableParts=function(t){this.oO.enableParts=t,this.nEnbP=null,this.onRL()},c.SetEnablePart=function(t,n){if(t){var i=this.getEnableParts();n?i|=t:i&=~t,this.nEnbP=i,this.onRL()}},c.getEnableParts=function(){if(i(this.nEnbP)){var t=this.oO.enableParts;this.nEnbP=u.Parts.ToFlags(n(t)?t:l.enableParts)}return this.nEnbP},c.isEnablePart=function(t){var n=this.isEnabled()&&this.GetEnablePart(t);if(n&&1&this.getDisableNoScroll())switch(t){case 512:case 128:case 640:return this.isEnablePart(1024)||this.isEnablePart(64);case 1024:n=this.GetValue()>this.GetMinValue();break;case 64:n=this.GetValue()0},c.isSP=function(){return 2&this.getDisableNoScroll()||this.isPsbl()},c.GetRange=function(){return this.GetMaxValue()-this.GetMinValue()},c.SetRange=function(t){this.SetMaxValue(this.GetMinValue()+W(t))},c.ResetRange=function(){this.SetRange(0)},c.GetTfi=function(){return this.oO.tfi},c.SetTfi=function(t){this.bU(),this.oO.tfi=t||null,this.onRL(),this.eU()},c.getTfi=function(){return this.GetTfi()||l.tfi},c.GetLocked=function(){return this.oO.locked},c.SetLocked=function(t){this.GetLocked()!=t&&(this.bU(),this.oO.locked=t,this.onRL(),this.oInfoI=null,this.eU())},c.getLocked=function(){return L(this.GetLocked(),l.locked)},c.GetReadOnly=function(){return this.oO.readOnly},c.SetReadOnly=function(t){this.GetReadOnly()!=t&&(this.bU(),this.oO.readOnly=t,this.onRL(),this.oInfoI=null,this.eU())},c.isReadOnly=function(){return L(this.GetReadOnly(),l.readOnly)},c.adjV=function(t){return m(this.GetMaxRange(),S(this.GetMinValue(),W(t)))},c.updateLargeChange=function(t){return this.getIgnoreLargeChange()?S(0,t):S(0,m(this.GetRange(),t))},c.onChanging=function(t,n){var i={old:t,new:n};return this.onchanging(i),i.new},c.onchanging=function(t){this.oLts.onchanging.do(t)},c.onChange=function(){this.updBk(),this.onchange(this.GetValue())},c.onchange=function(t){this.oLts.onchange.do(t)},c.updBk=function(){var i=this.isH(),e=this.cltBk;if(e){var r=o(i),s=t(i),h=e.slice(),a=this.GetScrollRange();if(a>0){var u=this.GetRange(),c=S(1,m(u,this.GetLargeChange()))/(u+1),l=this.getThumbSize(),f=h[r],g=m(f,l<0?S(8,c*f):l),d=(this.GetValue()-this.GetMinValue())/a,v=this.getThumbPos();n(v)?d=S(0,m(f-g,v)):d*=f-g,h[s]+=d,h[r]=g}if(this.isVisPart(512)){var p=this.cltBk.slice();p[r]=h[s]-this.cltBk[s],this.rgVisP.push(512,p)}if(this.isVisPart(128)){var C=h.slice();C[s]+=h[r],C[r]=this.cltBk[s]+this.cltBk[r]-(h[s]+h[r]),this.rgVisP.push(128,C)}this.isVisPart(256)&&this.rgVisP.push(256,h)}},c.getPartsRect=function(){var n,i,e,r,s,h,a,u,c,l,f=this.rgVisP,g=0;if(!f){if((n=this.getOrderParts())&&(i=this.GetClientRect(),n.forEach(function(t){this.isVisPart(t)&&g++},this),g>0)){f=new K.M1,r=this.isH(),e=this.getButtonSize(),r?(s=i[2],g*ec;v--)if(this.isVisPart(p=n.item(v))){var C=i.slice();i[a]-=e,C[u]=i[u]+i[a],C[a]=e,f.push(p,C)}this.cltBk=i,this.isVisPart(640)&&f.push(640,i)}this.rgVisP=f,this.updBk()}return this.rgVisP},c.p2rt=function(t){var n,i=this.getPartsRect();return i&&(n=i.get(t))&&(n=n.slice()),n},c.Scroll=function(t,n){var i,e=l.SmoothScroll,r=I(n,1);switch(t){case 0:i=this.SetValue(this.GetValue()-r*this.GetSmallChange());break;case 1:i=this.SetValue(this.GetValue()+r*this.GetSmallChange());break;case 2:i=this.smthBy(-this.GetLargeChange(),e);break;case 3:i=this.smthBy(+this.GetLargeChange(),e);break;case 4:i=this.getScrollOnThumbRelease()?this.SetValue(n):this.smthTo(n,e);break;case 5:this.getScrollOnThumbRelease()||(i=this.SetValue(n));break;case 6:i=this.smthTo(this.GetMinValue(),e);break;case 7:i=this.smthTo(this.GetMaxValue(),e)}return!!i},c.GetAllowKeys=function(){return this.oO.allowKeys},c.SetAllowKeys=function(t){this.oO.allowKeys=t,this.bAK=null},c.getAllowKeys=function(){if(this.isSelectable()){if(i(this.bAK)){var t=this.GetAllowKeys();i(t)&&(t=l.allowKeys),this.bAK=L(t)}return this.bAK}},c.GetAllowScrollDirect=function(){return this.oO.allowScrollDirect},c.SetAllowScrollDirect=function(t){this.oO.allowScrollDirect=t,this.nAlwSD=null},c.getAllowScrollDirect=function(){if(i(this.nAlwSD)){var t=this.GetAllowScrollDirect();i(t)&&(t=l.allowScrollDirect),this.nAlwSD=~~t}return this.nAlwSD},c.getThumbRect=function(){return this.p2rt(256)},c.off2V=function(t){var n=this.GetMinValue(),i=n;if(this.cltBk){var e,r=o(this.isH()),s=this.cltBk[r],h=this.GetMaxRange();s&&t>0&&((e=this.getThumbRect())&&(s-=e[r]),i=t0&&(s=setTimeout(function(){t()},c.ttP)),i=K.CC.c2CC(r.GetRelative()))){e={onwheel:i.onwheel,ondown:i.ondown};for(var o in e)i[o]=function(){return t(),e&&e[o].apply(this,arguments)}}}if(u&&c&&c.ttP){var f=n(c.ttO)&&c.ttO==h;f&&a++,t(),f&&a--,h=c.ttO,c.ttD?o=setTimeout(function(){l()},c.ttD):l()}},Hide:t}}(),K.UR=function(){function t(t){return t instanceof Array}function i(t){return t instanceof Function}function e(n){if(t(n))return n.feU=function(t,n,i){i=i||this;var e;if(t)for(r=this.length-1;!e&&r>=0;r--)e=n.call(i,this[r],r);else for(var r=0,o=this.length;!e&&r0&&this.x(this.lQ),this.nC=this.length,this.onundoredo(32))}this.oB=null}},a.cB=function(){this.oB&&(this.oB.c=!0)},a.x=function(t){this.length&&((t=~~t)>0?(t=S(0,this.length-t))&&this.splice(0,t):t<0?(t=this.length-m(-t,this.length))&&this.splice(this.length-t,t):this.splice(0))},a.toCbk=function(t,n){var e,r,o=n||function(){};return this.oH&&(r=this.oH.oC,i(e=this.oH[t])?o=e:r&&i(e=r[e])&&(o=e),r&&(o=o.bind(r))),o},a.cU=function(t,n){this.toCbk("cU",function(t,n){t&&t.call(n)})(t,n)},a.aC=function(){this.nC=S(0,m(this.nC,this.length))},a.onundoredo=function(t){this.toCbk("onUR")(t)},a.Block=function(t,n){this.gUR()&&(this.sB(),t.call(n||this,this),this.eB())},a.New=function(t){var n;return this.oB&&this.oB.rgO.push(n=new o(t)),n},a.GetAllowUndoRedo=function(){return!!this.gUR()},a.SetAllowUndoRedo=function(t){this.aUR=t,this.nC=0,this.x()},a.GetUndoRedoQueueLength=function(){return this.lQ},a.SetUndoRedoQueueLength=function(t){this.lQ=~~t,this.lQ>=0&&this.x(this.lQ),this.aC()},a.CanUndo=function(){return this.gUR()&&this.length&&this.nC>0},a.CanRedo=function(){return this.gUR()&&this.length&&this.nC=0&&s=0&&(n<0||s0&&(t<0||s