/**
 * @license
 * Webix UI v.6.1.4
 * This software is can be used only as part of webix.com site
 * You are not allowed to copy this file and use in any other project
 */

!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.webix={})}(this,function(H){"use strict";var M={codebase:"./",cdn:"//cdn.webix.com",top_views:[],i:null,n:null,h:null,o:null,u:null,l:null,_:null,m:null,w:0,S:null,k:null,D:[],destructors:[],securityKey:"",$:null,I:0,F:null,noanimate:!1},S={cdn:"//cdn.webix.com/",codebase:"",zIndexBase:100,scrollSize:17};S.strict=!!window.webix_strict,S.https="https:"===document.location.protocol;var t=navigator.userAgent;if(S.isMac=-1!=t.indexOf("Mac"),-1==t.indexOf("Mobile")&&-1==t.indexOf("Windows Phone")||(S.mobile=!0),(S.mobile||-1!=t.indexOf("iPad")||-1!=t.indexOf("Android"))&&(S.touch=!0),-1!=t.indexOf("Opera"))S.isOpera=!0;else{if(S.isIE=!!document.all||-1!==t.indexOf("Trident"),S.isIE)8==parseFloat(navigator.appVersion.split("MSIE")[1])&&(S.isIE8=!0);S.isEdge=-1!=t.indexOf("Edge"),S.isFF=-1!=t.indexOf("Firefox"),S.isWebKit=-1!=t.indexOf("KHTML"),S.isSafari=S.isWebKit&&S.isMac&&-1==t.indexOf("Chrome"),(S.isIE||S.isEdge||S.isFF)&&(S.maxHTMLElementSize=1e7),S.isSafari&&(S.maxHTMLElementSize=1e8)}-1!=t.toLowerCase().indexOf("android")&&(S.isAndroid=!0,-1!=t.toLowerCase().indexOf("trident")&&(S.isAndroid=!1,S.isIEMobile=!0)),S.transform=!1,S.transition=!1;for(var i=-1,s=["","webkit","Moz","O","ms"],e=document.createElement("DIV"),n=0;n<s.length;n++){var h=s[n]?s[n]+"Transform":"transform";if("undefined"!=typeof e.style[h]){i=n;break}}if(-1<i){S.cssPrefix=["","-webkit-","-Moz-","-o-","-ms-"][i];var r=S.jsPrefix=s[i];S.transform=r?r+"Transform":"transform",S.transition=r?r+"Transition":"transition",S.transitionDuration=r?r+"TransitionDuration":"transitionDuration",e.style[S.transform]="translate3d(0,0,0)",S.translate=e.style[S.transform]?"translate3d":"translate",S.transitionEnd="-Moz-"==S.cssPrefix?"transitionend":r?r+"TransitionEnd":"transitionend"}S.pointerevents=!S.isIE||null!==new RegExp("Trident/.*rv:11").exec(t),S.passiveEventListeners=!1;try{var o=Object.defineProperty({},"passive",{get:function(){S.passiveEventListeners=!0}});window.addEventListener("testPassive",null,o),window.removeEventListener("testPassive",null,o)}catch(Bo){}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}S.svg=document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),S.svganimation=document.implementation.hasFeature("https://www.w3.org/TR/SVG11/feature#SVG-animation","1.1");var a={};function u(t,i){a[t]=i}function d(t){return a[t]}var c={};function f(t){var i=f.T;return i.prototype=t,new i}function B(t){var i,s=!!(window.Map&&window.Set&&window.WeakMap&&window.WeakSet);for(var e in 1<arguments.length?(i=arguments[0],t=arguments[1]):i=b(t)?[]:{},t){var n=t[e];!n||"object"!=k(n)||n instanceof RegExp?i[e]=n:y(n)?i[e]=new Date(n):s&&(n instanceof Map||n instanceof Set||n instanceof WeakMap||n instanceof WeakSet)?i[e]=n:(i[e]=b(n)?[]:{},B(i[e],n))}return i}function C(t,i){return function(){return t.apply(i,arguments)}}function v(t){window.execScript?window.execScript(t):window.eval(t)}function D(t){return void 0===t}function $(i,s,e,t){return window.setTimeout(function(){if(!s||!s.$destructed){var t=i.apply(s,e||[]);return i=s=e=null,t}},t||1)}function l(t){var i=!0;return function(){i&&(i=!1,t.apply(this,arguments))}}f.T=function(){},H.extend=function(t,i,s){if(t.$protoWait)return x.insertAt.call(t.$protoWait,i,1),t;for(var e in i)e in t&&!s||(t[e]=i[e]);return i.defaults&&H.extend(t.defaults,i.defaults),i.$init&&i.$init.call(t),t};var _=(new Date).valueOf();function z(){return++_}function A(t){return"string"==typeof t?document.getElementById(t):t}function p(t){return H.extend(t||[],x,!0)}function m(t,i){if("string"!=typeof t)return t;var s=t.replace("()","");return i&&i[s]?i[s]:window[s]||window.eval(t)}function b(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(
t)}function y(t){return t instanceof Date}var x={removeAt:function(t,i){0<=t&&this.splice(t,i||1)},remove:function(t){this.removeAt(this.find(t))},insertAt:function(t,i){if(i||0===i){var s=this.splice(i,this.length-i);this[i]=t,this.push.apply(this,s)}else this.push(t)},find:function(t){for(var i=0;i<this.length;i++)if(t==this[i])return i;return-1},each:function(t,i){for(var s=0;s<this.length;s++)t.call(i||this,this[s])},map:function(t,i){for(var s=0;s<this.length;s++)this[s]=t.call(i||this,this[s]);return this},filter:function(t,i){for(var s=0;s<this.length;s++)t.call(i||this,this[s])||(this.splice(s,1),s--);return this}},g={$init:function(){this.V||(this.V={},this.H={},this.B={})},blockEvent:function(){this.V.R=!0},unblockEvent:function(){this.V.R=!1},mapEvent:function(t){H.extend(this.B,t,!0)},on_setter:function(t){if(t)for(var i in t){var s=m(t[i],this.$scope),e=i.indexOf("->");-1!==e?this[i.substr(0,e)].attachEvent(i.substr(e+2),C(s,this)):this.attachEvent(i,s)}},callEvent:function(t,i){var s=this.P||this;if(this.V.R)return!0;t=t.toLowerCase();var e=this.V[t.toLowerCase()],n=!0;if(e)for(var h=0;h<e.length;h++)!1===e[h].apply(s,i||[])&&(n=!1);if(this.B[t]){var r=this.B[t];r.$eventSource=this,r.callEvent(t,i)||(n=!1),r.$eventSource=null}return n},attachEvent:function(t,i,s){t=t.toLowerCase(),s=s||z(),i=m(i,this.$scope);var e=this.V[t]||p();return arguments[3]?e.unshift(i):e.push(i),this.V[t]=e,this.H[s]={f:i,t:t},s},detachEvent:function(t){if(this.H[t]){var i=this.H[t].t,s=this.H[t].f;this.V[i].remove(s),delete this.H[t]}else{var e=(t+"").toLowerCase();this.V[e]&&(this.V[e]=p())}},hasEvent:function(t){t=t.toLowerCase();var i=this.V[t];if(i&&i.length)return!0;var s=this.B[t];return!!s&&s.hasEvent(t)}},w={};H.extend(w,g,!0);var I=function(t,i){return w.callEvent(t,i)},F=function(t,i,s,e){return w.attachEvent(t,i,s,e)},T=function(t){return w.detachEvent(t)},V=0,R={},P={};function j(){V||(V=document.onselectstart),document.onselectstart=tt}function N(){0!==V&&(document.onselectstart=V||null),V=0}function E(t){for(var i=0;t=t.previousSibling;)i++;return i}function L(t,i){var s="";for(var e in i=i||"",t)s+=e+":"+t[e]+";";var n=P[s+i];return n||(O("."+(n="s"+z())+(i||"")+"{"+s+"}"),P[s+i]=n),n}function O(t,i){var s=i?R[i]:R["default"];s||((s=document.createElement("style")).setAttribute("type","text/css"),s.setAttribute("media","screen,print"),document.getElementsByTagName("head")[0].appendChild(s),i?R[i]=s:R["default"]=s),s.styleSheet?s.styleSheet.cssText+=t:s.appendChild(document.createTextNode(t))}function U(t){var i=R[t||"default"];i&&(i.innerHTML="")}function Y(t,i,s){i=i||{};var e=document.createElement(t);for(var n in i)e.setAttribute(n,i[n]);return i.style&&(e.style.cssText=i.style),i["class"]&&(e.className=i["class"]),s&&(e.innerHTML=s),e}function W(t){return(t=A(t))?D(t.value)?t.innerHTML:t.value:""}function G(t){if(t instanceof Array)for(var i=0;i<t.length;i++)G(t[i]);else t&&t.parentNode&&t.parentNode.removeChild(t)}function X(t,i,s){t&&(i&&i.parentNode?i.parentNode.insertBefore(t,i):s.appendChild(t))}function J(t,i){var s;for(s=t.tagName?t:(t=t||event).target||t.srcElement;s;){if(s.getAttribute){var e=s.getAttribute(i);if(e)return e}s=s.parentNode}return null}function K(t){if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),s=document.body,e=document.documentElement,n=window.pageYOffset||e.scrollTop||s.scrollTop,h=window.pageXOffset||e.scrollLeft||s.scrollLeft,r=e.clientTop||s.clientTop||0,o=e.clientLeft||s.clientLeft||0,a=i.top+n-r,u=i.left+h-o;return{y:Math.round(a),x:Math.round(u),width:t.offsetWidth,height:t.offsetHeight}}for(var c=0,f=0;t;)c+=parseInt(t.offsetTop,10),f+=parseInt(t.offsetLeft,10),t=t.offsetParent;return{y:c,x:f,width:t.offsetHeight,height:t.offsetWidth}}function q(t){return D((t=t||event).offsetX)?{x:t.layerX,y:t.layerY}:{x:t.offsetX,y:t.offsetY}}function Z(t){if((t=t||event).touches&&t.touches[0]&&(t=t.touches[0]),t.pageX||t.pageY)return{x:t.pageX,y:t.pageY};var i=S.isIE&&"BackCompat"!=document.compatMode?document.documentElement:document.body;return{
x:t.clientX+i.scrollLeft-i.clientLeft,y:t.clientY+i.scrollTop-i.clientTop}}function Q(t){return t&&t.preventDefault&&t.preventDefault(),t&&(t.returnValue=!1),tt(t)}function tt(t){return(t=t||event).stopPropagation&&t.stopPropagation(),!(t.cancelBubble=!0)}function it(t,i,s){if(document.createEventObject){var e=document.createEventObject();t.fireEvent&&t.fireEvent("on"+s,e)}else{var n=document.createEvent(i);n.initEvent(s,!0,!0),t.dispatchEvent&&t.dispatchEvent(n)}}function st(t,i,s){s&&-1!==t.className.indexOf(i)||(t.className+=" "+i)}function et(t,i){t.className=t.className.replace(RegExp(" "+i,"g"),"")}function nt(t,i,s){var e=Y("DIV",{"class":"webix_view webix_measure_size "+(i||"")},"");e.style.cssText="height:auto;visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;"+(s?"width:"+s+"px;":"width:auto;white-space:nowrap;"),document.body.appendChild(e);for(var n="object"!==k(t)?[t]:t,h=0,r=0,o=0;o<n.length;o++)e.innerHTML=n[o],h=Math.max(h,e.offsetWidth),r=Math.max(r,e.offsetHeight);return G(e),{width:h,height:r}}function ht(t,i){var s=!1;if("object"==k(t)){if(window.navigator.msSaveBlob)return window.navigator.msSaveBlob(t,i);t=window.URL.createObjectURL(t),s=!0}var e=document.createElement("a");e.href=t,e.download=i,document.body.appendChild(e),e.click(),$(function(){s&&window.URL.revokeObjectURL(t),document.body.removeChild(e),e.remove()})}function rt(t){if(!t)return"";var i=t.className||"";return i.baseVal&&(i=i.baseVal),i.indexOf||(i=""),i}function ot(t,i,s){if(i=i||0,s=s||i,t.focus(),t.setSelectionRange)t.setSelectionRange(i,s);else{var e=t.createTextRange();e.collapse(!0),e.moveEnd("character",s),e.moveStart("character",i),e.select()}}function at(t){if("selectionStart"in t)return{start:t.selectionStart||0,end:t.selectionEnd||0};t.focus();var i=document.selection.createRange().getBookmark(),s=t.createTextRange();s.moveToBookmark(i);var e=s.text.length;s.collapse(!0),s.moveStart("character",-t.value.length);var n=s.text.length;return{start:n,end:n+e}}function ut(t,i){document.getElementsByTagName("head").item(0).appendChild(Y("meta",{name:t,content:i}))}var ct={parseFormat:"%Y-%m-%d %H:%i",parseTimeFormat:"%H:%i"};function ft(t){var i,s=Date.prototype.toJSON;return Date.prototype.toJSON=function(){return ct.parseFormatStr(this)},i=t instanceof Date?t.toJSON():JSON.stringify(t),Date.prototype.toJSON=s,i}var lt=window,dt=1,vt={},_t=!1;function pt(t){lt.setImmediate?lt.setImmediate(t):lt.importScripts||!lt.addEventListener?setTimeout(t):(vt[++dt]=t,lt.postMessage(dt,"*"))}function mt(t){if("function"!=typeof t&&t!=undefined)throw TypeError();if("object"!=k(this)||this&&this.then)throw TypeError();var i,s,e=this,h=0,r=0,n=[];(e.promise=e).resolve=function(t){return i=e.fn,s=e.er,h||(r=t,h=1,pt(u)),e},e.reject=function(t){return i=e.fn,s=e.er,h||(r=t,h=2,pt(u)),e},e.j=1,e.then=function(t,i){if(1!=this.j)throw TypeError();var s=new mt;return s.fn=t,s.er=i,3==h?s.resolve(r):4==h?s.reject(r):n.push(s),s},e["catch"]=function(t){return e.then(null,t)},e.fail=function(t){return e.then(null,t)};var o=function(t){h=t||4;for(var i=0;i<n.length;i++){var s=n[i];3==h&&s.resolve(r)||s.reject(r)}};try{"function"==typeof t&&t(e.resolve,e.reject)}catch(Bo){e.reject(Bo)}return e;function a(t,i,s,e){if(2==h)return e();if("object"!=k(r)&&"function"!=typeof r||"function"!=typeof t)e();else try{var n=0;t.call(r,function(t){n++||(r=t,i())},function(t){n++||(r=t,s())})}catch(Bo){r=Bo,s()}}function u(){var t;try{t=r&&r.then}catch(Bo){return r=Bo,h=2,u()}a(t,function(){h=1,u()},function(){h=2,u()},function(){try{1==h&&"function"==typeof i?r=i(r):2==h&&"function"==typeof s&&(r=s(r),h=1)}catch(Bo){return r=Bo,o()}r==e?(r=TypeError(),o()):a(t,function(){o(3)},o,function(){o(1==h&&3)})})}}!lt.setImmediate&&lt.addEventListener&&lt.addEventListener("message",function(t){if(t.source==lt)if(_t)pt(vt[t.data]);else{_t=!0;try{vt[t.data]()}catch(t){}delete vt[t.data],_t=!1}}),mt.resolve=function(i){if(1!=this.j)throw TypeError();return i instanceof mt?i:new mt(function(t){t(i)})},mt.reject=function(s){if(1!=this.j)throw TypeError()
;return new mt(function(t,i){i(s)})},mt.all=function(s){if(1!=this.j)throw TypeError();if(!(s instanceof Array))return mt.reject(TypeError());var e=new mt;return function n(t,i){return i?e.resolve(i):t?e.reject(t):(0==s.reduce(function(t,i){return i&&i.then?t+1:t},0)&&e.resolve(s),void s.map(function(t,i){t&&t.then&&t.then(function(t){return s[i]=t,n(),t},n)}))}(),e},mt.race=function(s){if(1!=this.j)throw TypeError();if(!(s instanceof Array))return mt.reject(TypeError());if(0==s.length)return new mt;var e=new mt;return function n(t,i){return i?e.resolve(i):t?e.reject(t):(0==s.reduce(function(t,i){return i&&i.then?t+1:t},0)&&e.resolve(s),void s.map(function(t){t&&t.then&&t.then(function(t){n(null,t)},n)}))}(),e},mt.j=1;var bt={N:function(t){return t&&t.documentElement?t.getElementsByTagName("parsererror").length?null:t:null},toObject:function(t,i){var s=i?i.rawxml?i.rawxml():i:null;return this.N(s)?s:(s="string"==typeof t?this.fromString(t.replace(/^[\s]+/,"")):t,this.N(s)?s:null)},getRecords:function(t){return this.xpath(t,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(t){return this.tagToObject(t,{})},getOptions:function(){return!1},getInfo:function(t){var i=this.xpath(t,this.config);return i=i.length?this.assignTypes(this.tagToObject(i[0],{})):null,{size:t.documentElement.getAttribute("total_count")||0,from:t.documentElement.getAttribute("pos"),parent:t.documentElement.getAttribute("parent")||0,config:i,key:t.documentElement.getAttribute("webix_security")||null}},xpath:function(t,i){if(window.XPathResult){var s=t;-1==t.nodeName.indexOf("document")&&(t=t.ownerDocument);for(var e=[],n=t.evaluate(i,s,null,XPathResult.ANY_TYPE,null),h=n.iterateNext();h;)e.push(h),h=n.iterateNext();return e}var r=!0;try{"undefined"==typeof t.selectNodes&&(r=!1)}catch(Bo){}if(r)return t.selectNodes(i);var o=i.split("/").pop();return t.getElementsByTagName(o)},assignTypes:function(t){for(var i in t){var s=t[i];if("object"==k(s))this.assignTypes(s);else if("string"==typeof s){if(""===s)continue;"true"==s?t[i]=!0:"false"==s?t[i]=!1:s==1*s&&(t[i]=1*t[i])}}return t},tagToObject:function(t,i){var s=0;if(1==t.nodeType&&t.getAttribute("stack")){i=[];for(var e=t.childNodes,n=0;n<e.length;n++)1==e[n].nodeType&&i.push(this.tagToObject(e[n],{}))}else{i=i||{};var h=t.attributes;if(h&&h.length)for(var r=0;r<h.length;r++)i[h[r].name]=h[r].value,s=1;for(var o=t.childNodes,a=0;a<o.length;a++)if(1==o[a].nodeType){var u=o[a].tagName;i[u]?("function"!=typeof i[u].push&&(i[u]=[i[u]]),i[u].push(this.tagToObject(o[a],{}))):i[u]=this.tagToObject(o[a],{}),s=2}if(!s)return this.nodeValue(t);s<2&&(i.value=i.value||this.nodeValue(t))}return i},nodeValue:function(t){return t.firstChild?t.firstChild.wholeText||t.firstChild.data:""},fromString:function(t){try{if(window.DOMParser)return(new DOMParser).parseFromString(t,"text/xml");if(window.ActiveXObject){var i=new ActiveXObject("Microsoft.xmlDOM");return i.loadXML(t),i}}catch(Bo){return null}}},gt={toObject:function(t){if(!t)return null;if("string"==typeof t)try{if(this.parseDates){var s=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1-3})?Z/;t=JSON.parse(t,function(t,i){return"string"==typeof i&&s.test(i)?new Date(i):i})}else t=JSON.parse(t)}catch(Bo){return null}return t},getRecords:function(t){return t&&t.data&&(t=t.data),t&&!b(t)?[t]:t},getDetails:function(t){return"string"==typeof t?{id:t||z(),value:t}:t},getOptions:function(t){return t.collections},getInfo:function(t){return{size:t.total_count||0,from:t.pos,parent:t.parent||0,config:t.config,key:t.webix_security}},child:"data",parseDates:!(mt.defer=function(){return new mt(null)})},wt=p();function xt(t,i,s){return 0!==arguments.length?(new xt).get(t,i,s):this&&this.getXHR?this:new xt}xt.count=0,xt.prototype={master:null,getXHR:function(){return new XMLHttpRequest},stringify:function(t){return ft(t)},O:function(t,i,n,s){var h;i&&(b(i)||"function"==typeof(i.success||i.error||i))&&(h=n,n=i,i=null);var e=mt.defer(),r=this.getXHR();b(n)||(n=[n]),n.push({success:function(t,i){e.resolve(i)},error:function(){e.reject(r)}});var o=this.U||{}
;if(I("onBeforeAjax",[s,t,i,r,o,null,e])){var a=!1;if("GET"!==s){var u=!1;for(var c in o)"content-type"==c.toString().toLowerCase()&&(u=!0,"application/json"==o[c]&&(a=!0));u||window.FormData&&i instanceof window.FormData||(o["Content-Type"]="application/x-www-form-urlencoded")}if("object"==k(i)&&!(window.FormData&&i instanceof window.FormData))if(a)i=this.stringify(i);else{var f=[];for(var l in i){var d=i[l];null!==d&&d!==undefined||(d=""),"object"===k(d)&&(d=this.stringify(d)),f.push(l+"="+encodeURIComponent(d))}i=f.join("&")}i&&"GET"===s&&(t=t+(-1!=t.indexOf("?")?"&":"?")+i,i=null),r.open(s,t,!this.Y);var v=this.W;for(var _ in v&&(r.responseType=v),o)r.setRequestHeader(_,o[_]);var p=this;return this.master=this.master||h,r.onreadystatechange=function(){if(!r.readyState||4==r.readyState){if(xt.count++,n&&p&&!r.aborted){if(-1!=wt.find(r))return wt.remove(r);var t,i,s=p.master||p,e=400<=r.status||0===r.status;i="blob"==r.responseType||"arraybuffer"==r.responseType?(t="",r.response):(t=r.responseText||"",p.G(r)),xt.$callback(s,n,t,i,r,e)}p&&(p.master=null),n=p=h=null}},this.X&&(r.timeout=this.X),this.Y?r.send(i||null):setTimeout(function(){r.aborted||(-1!=wt.find(r)?wt.remove(r):r.send(i||null))},1),this.master&&this.master.J&&this.master.J.push(r),this.Y?r:e}},G:function(t){return{xml:function(){try{return bt.tagToObject(bt.toObject(t.responseText,this))}catch(Bo){t.responseText,Bo.toString()}},rawxml:function(){return window.XPathResult?t.responseXML:bt.fromString(t.responseText)},text:function(){return t.responseText},json:function(){return gt.toObject(t.responseText,!1)}}},get:function(t,i,s){return this.O(t,i,s,"GET")},post:function(t,i,s){return this.O(t,i,s,"POST")},put:function(t,i,s){return this.O(t,i,s,"PUT")},del:function(t,i,s){return this.O(t,i,s,"DELETE")},patch:function(t,i,s){return this.O(t,i,s,"PATCH")},sync:function(){return this.Y=!0,this},timeout:function(t){return this.X=t,this},response:function(t){return this.W=t,this},header:function(t){return this.U=t,this},headers:function(t){return this.U=H.extend(this.U||{},t),this},bind:function(t){return this.master=t,this}},xt.$callback=function(t,i,s,e,n,h){if(!t.$destructed){if(-1===n&&e&&"function"==typeof e.json&&(e=e.json()),h&&I("onAjaxError",[n]),b(i)||(i=[i]),!h)for(var r=0;r<i.length;r++)if(i[r]){var o=i[r].before;o&&o.call(t,s,e,n)}for(var a=0;a<i.length;a++)if(i[a]){var u=i[a].success||i[a];h&&(u=i[a].error),u&&u.call&&u.call(t,s,e,n)}}};var yt={collapseNames:function(t,i,s){if(s=s||{},i=i||"",!t||"object"!=k(t))return null;for(var e in t)!t[e]||"object"!=k(t[e])||y(t[e])||b(t[e])?s[i+e]=t[e]:yt.collapseNames(t[e],i+e+".",s);return s},expandNames:function(t){var i,s,e,n,h,r={};for(h in t){for(s=(e=h.split(".")).length-1,n=r,i=0;i<s;i++)n[e[i]]||(n[e[i]]={}),n=n[e[i]];n[e[s]]=t[h]}return r}},Mt={},St={},kt=new RegExp("(\\r\\n|\\n)","g"),Ct=new RegExp('(\\")',"g"),Dt=new RegExp("(\\\\)","g"),$t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},At=/[&<>"'`]/g,It=function(t){return $t[t]||"&amp;"};function Ft(s){if("function"==typeof s)return s;if(Mt[s])return Mt[s];if(-1!=(s=(s||"").toString()).indexOf("->")){var t=s.split("->");switch(t[0]){case"html":s=W(t[1]);break;case"http":s=(new xt).sync().get(t[1],{uid:z()}).responseText}}if(s=(s||"").toString(),S.strict){if(!St[s]){St[s]=[];var h=[];if(s.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,function(t,i,s,e,n){h.push({pos:n,str:t,fn:function(t){return t[i]?s:e}})}),s.replace(/\{common\.([^}(]*)\}/g,function(t,s,i){h.push({pos:i,str:t,fn:function(t,i){return i[s]||""}})}),s.replace(/\{common\.([^}(]*)\(\)\}/g,function(t,s,i){h.push({pos:i,str:t,fn:function(t,i){return i[s]?i[s].apply(this,arguments):""}})}),s.replace(/\{obj\.([^:}]*)\}/g,function(t,i,s){h.push({pos:s,str:t,fn:function(t){return t[i]}})}),s.replace("{obj}",function(t,i){h.push({pos:i,str:t,fn:function(t){return t}})}),s.replace(/#([^#'";, ]+)#/gi,function(t,i,s){"!"==i.charAt(0)?(i=i.substr(1),h.push({pos:s,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=yt.collapseNames(t)),Ft.escape(t[i])}})):h.push({
pos:s,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=yt.collapseNames(t)),t[i]}})}),h.sort(function(t,i){return t.pos>i.pos?1:-1}),h.length){for(var i=0,e=function(t,i,s){St[t].push(function(){return t.slice(i,s)})},n=0;n<h.length;n++){var r=h[n].pos;e(s,i,r),St[s].push(h[n].fn),i=r+h[n].str.length}e(s,i,s.length)}else St[s].push(function(){return s})}return function(){for(var t="",i=0;i<St[s].length;i++)t+=St[s][i].apply(this,arguments);return t}}var o=!1;s=(s=(s=(s=(s=(s=(s=(s=(s=s.replace(Dt,"\\\\")).replace(kt,"\\n")).replace(Ct,'\\"')).replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"')).replace(/\{common\.([^}(]*)\}/g,"\"+(common.$1||'')+\"")).replace(/\{common\.([^}(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"')).replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"')).replace("{obj}",'"+obj+"')).replace(/#([^#'";, ]+)#/gi,function(t,i){return"!"==i.charAt(0)?(o=!0,'"+template.escape(obj.'+i.substr(1)+')+"'):'"+(obj.'+i+')+"'});try{if(o){var a=Function("obj","common","marks","value","template",'return "'+s+'";');Mt[s]=function(t,i,s,e){return a(t,i,s,e,Ft)}}else Mt[s]=Function("obj","common",'return "'+s+'";')}catch(Bo){}return Mt[s]}function Tt(t,i){if(t.$protoWait)return t.K||(t.K=[]),void t.K.push(i);"function"==typeof t&&(t=t.prototype),t.types||(t.types={"default":t.type},t.type.name="default");var s=i.name,e=t.type;for(var n in s&&(e=t.types[s]=f(i.baseType?t.types[i.baseType]:t.type)),i)0===n.indexOf("template")?e[n]=Ft(i[n]):e[n]=i[n];return s}Ft.escape=function(t){return t===undefined||null===t?"":(t.toString()||"").replace(At,It)},Ft.empty=function(){return""};var zt={};function Vt(t,i,s){var e;M.w++;var n=M.i;M.i=t.$scope||n;try{e=function l(t,i,s){var e,n=b(t),h=A(t.container||i||document.body);h.q&&(s=function f(t,i,s){var e=[t];if(i)e=t.getChildViews();else if(t.Z)e=[t.Z];else{if("number"==typeof s)return s;if(s)return Bt(e=[jt(s)]),e[0].config.id}return Bt(e),s}(h,n,s));var r=!1,o=h==document.body;t.q||h&&n?(e=t,r=!0):(h&&o&&(t.$topView=!0),t.Q||(t.Q={}),i&&i.getParentView&&(M._=s||0===s?i:i.getParentView()),e=Pt(t));!o||e.setPosition||e.$apiOnly||d("_fixHeight")();if(e.q&&e.q.tt&&!h.$view)e.q.it=h;else if(!e.$apiOnly)if(h.appendChild)Ht(h,e,t);else if(h.destructor){var a=h;if(s||0===s||b(e)||(h=(s=h).getParentView()),h&&h.st){if(r&&e.getParentView){var u=e.getParentView();u&&u.et&&u.et(e),e._=h,e.$scope=h.$scope}h.st(e,s)}else{var c=a.$view.parentNode;a.destructor(),Ht(c,e,t)}}else t.container;return e}(t,i,s)}finally{M.w--,M.i=n}return e}function Ht(t,i,s){t.appendChild(i.nt),i.getParentView()||(((!i.setPosition||i.q.fullscreen)&&t==document.body||i.q.position)&&M.top_views.push(i.ht),s.skipResize||i.adjust())}function Bt(t){for(var i=t.length-1;0<=i;i--){var s=t[i];delete zt[s.config.id],s.config.id="x"+z(),(zt[s.config.id]=s).getChildViews&&Bt(s.getChildViews()),s.rt&&Bt(s.rt)}}function Rt(t,i){var s=Vt[t];return!!s&&(s.$protoWait&&(s=s.call(-1)),!!Vt[t].prototype[i])}function Pt(t){if(t.view){var i=t.view;return new Vt[i](t)}if(t.rows||t.cols){for(var s=t.rows||t.cols,e=!1,n=0;n<s.length;n++)!s[n].body||s[n].view||s[n].align||(e=!0);return e?new Vt.headerlayout(t):new Vt.layout(t)}return t.cells?new Vt.multiview(t):t.template||t.content?new Vt.template(t):t.align&&t.body?new Vt.align(t):new Vt.spacer(t)}function jt(t){if(!t)return null;if(zt[t])return zt[t];var i=t;if("object"==k(t)){if(t.q)return t;i=t.target||t.srcElement||t}return zt[J({target:A(i)},"view_id")]}Vt.views=zt,Vt.ot=Pt,"undefined"==typeof window.$$&&(window.$$=jt),H.protoUI=function(){var h=arguments[0].name,r=function(t){if(!r)return Vt[h].prototype;var i=r.$protoWait;if(i){for(var s=[i[0]],e=1;e<i.length;e++)s[e]=i[e],s[e].$protoWait&&(s[e]=s[e].call(-1,s[e].name)),s[e].prototype&&s[e].prototype.name&&(Vt[s[e].prototype.name]=s[e]);if(Vt[h]=H.proto.apply(-1,s),r.K)for(var n=0;n<r.K.length;n++)Tt(Vt[h],r.K[n]);r=i=null}return-1!=this?new Vt[h](t):Vt[h]};return r.$protoWait=Array.prototype.slice.call(arguments,0),Vt[h]=r},H.proto=function(){for(var t=arguments,i=t[0],s=!!i.$init,e=[],
n=t.length-1;0<n;n--){if(t[n],"function"==typeof t[n]&&(t[n]=t[n].prototype),t[n].$init&&e.push(t[n].$init),t[n].defaults){var h=t[n].defaults;for(var r in i.defaults||(i.defaults={}),h)D(i.defaults[r])&&(i.defaults[r]=h[r])}if(t[n].type&&i.type)for(var o in t[n].type)i.type[o]||(i.type[o]=t[n].type[o]);for(var a in t[n])i[a]||!1===i[a]||(i[a]=t[n][a])}s&&e.push(i.$init),i.$init=function(){for(var t=0;t<e.length;t++)e[t].apply(this,arguments)},i.$skin&&i.$skin();var u=function(t){this.$ready=[],this.$init,this.$init(t),this.at&&this.at(t,this.defaults);for(var i=0;i<this.$ready.length;i++)this.$ready[i].call(this)};return u.prototype=i,i=t=null,u},F("onClick",function(t){var i=jt(t);if(i&&i.touchable){d("UIManager").applyChanges(i),i.getNode(t);var s=t.target||t.srcElement;if("webix_disabled"==s.className)return;var e="";if(s.className&&0===s.className.toString().indexOf("webix_view"))return;for(i&&d("UIManager").ut(i);s&&s.parentNode;){if(s.getAttribute){if(s.getAttribute("view_id"))break;if(e=s.className){e=e.toString().split(" ");for(var n=0;n<e.length;n++){if(i.on_click[e[n]])if(!1===i.on_click[e[n]].call(i,t,i.q.id,s))return}}}s=s.parentNode}if(i.q.click){var h=m(i.q.click,i.$scope);h&&h.call&&h.call(i,i.q.id,t)}var r=i.q.popup;i.q.popup&&!i.q.readonly&&("object"!=k(r)||r.name||(r=i.q.popup=Vt(r).q.id),(r=jt(r)).isVisible()||(r.q.master=i.q.id,r.show(i.getInputNode()||i.getNode(),null,!0))),i.callEvent("onItemClick",[i.q.id,t])}});var Nt={};function Et(){for(var t in Nt)Ut(t)}function Lt(t,i,s,e){(e=e||{}).inner=!0,Ot(t,i,s,e)}function Ot(t,i,s,e){e=e||{},t=A(t);var n=e.id||z();e.bind&&(s=C(s,e.bind));var h=[t,i,s,e.capture];e.inner||(Nt[n]=h);var r=!!e.capture;return!D(e.passive)&&S.passiveEventListeners&&(r={passive:e.passive,capture:r}),t.addEventListener?t.addEventListener(i,s,r):t.attachEvent&&t.attachEvent("on"+i,h[2]=function(){return s.apply(t,arguments)}),n}function Ut(t){if(t){Nt[t];var i=Nt[t];i[0].removeEventListener?i[0].removeEventListener(i[1],i[2],!!i[3]):i[0].detachEvent&&i[0].detachEvent("on"+i[1],i[2]),delete Nt[t]}}var Yt={$init:function(t){if(t.activeContent)for(var i in this.$ready.push(this.ct),this.ft={},this.lt={},this.dt={},this.vt={},t.activeContent)if(this[i]=this._t(i),t.activeContent[i].earlyInit){var s=M._;M._=null,this[i].call(this,{},this,t.activeContent),M._=s}},pt:function(){for(var t in this.vt){var i=this.vt[t];i.destructor&&i.destructor()}},ct:function(){if(this.attachEvent("onDestruct",C(this.pt,this)),Lt(this.$view,"blur",function(t){if("BUTTON"!=(t.target||t.srcElement).tagName){var i=jt(t);if(i&&i!==this&&i.getValue&&i.setValue){i.getNode(t);var s=i.getValue();s!=i.q.value&&i.setValue(s)}}},{bind:this,capture:!0}),this.filter){for(var t in this.q.activeContent)this.type[t]=this[t],this[t]=this.mt(t);this.attachEvent("onBeforeRender",function(){this.type.masterUI=this}),this.type.masterUI=this}},mt:function(h){return function(t){for(var i=this.vt[h],s=i.q.id,e=this.getItemNode(t).getElementsByTagName("DIV"),n=0;n<e.length;n++)if(e[n].getAttribute("view_id")==s){i.nt=i.bt=e[n];break}return i}},gt:function(n,h,r){return function(t){if(t)for(var i=t.target||t.srcElement;i;){if(i.getAttribute&&i.getAttribute("view_id")){if(r.wt(n,i),r.locate){var s=r.locate(i.parentNode),e=r.dt[h][s];n.q.value=e,n.q.$masterId=s}return i}i=i.parentNode}return n.nt}},xt:function(e,n){return function(t){var i=n.data;if(n.filter){var s=n.locate(this.nt.parentNode);i=n.getItem(s),this.refresh(),n.lt[e][s]=this.nt.outerHTML||(new XMLSerializer).serializeToString(this.nt),n.dt[e][s]=t}i&&(i[e]=t)}},_t:function(o){return function(t,i,s){var e=i.ft?i:i.masterUI;if(!e.ft[o]){var n=document.createElement("DIV"),h=Vt((s=s||e.q.activeContent)[o],n);S.isIE8?n.firstChild.setAttribute("onclick","event.processed = true; event.srcElement.w_view = '"+h.q.id+"';"):n.firstChild.setAttribute("onclick","event.processed = true; "),h.getNode=e.gt(h,o,e),h.attachEvent("onChange",e.xt(o,e)),e.vt[o]=h,e.ft[o]=n.innerHTML,e.lt[o]={},e.dt[o]={},h.$activeEl=h.$view}if(e.filter&&t[o]!=e.dt[o]&&!D(t[o])){var r=e.vt[o]
;r.blockEvent(),e.wt(r,r.$activeEl),r.$view.firstChild||r.refresh(),r.setValue(t[o]),r.refresh(),r.unblockEvent(),e.dt[o][t.id]=t[o],e.lt[o][t.id]=r.nt.outerHTML||(new XMLSerializer).serializeToString(r.nt)}return e.lt[o][t.id]||e.ft[o]}},wt:function(t,i){t.bt=t.nt=t.$view=i}},Wt={$proxy:!0,load:function(s,e){var n=this.source.split("@"),h=n[0].split(".").pop();return xt().response("arraybuffer").get(n[0]).then(function(t){var i={ext:h,dataurl:n[1]};xt.$callback(s,e,"",{data:t,options:i},-1)})}},Gt={$proxy:!0,connectorName:"!nativeeditor_status",load:function(t,i){xt(this.source,i,t)},saveAll:function(t,i,s,e){for(var n=this.source,h={},r=[],o=0;o<i.length;o++){var a=i[o];for(var u in r.push(a.id),a.data)0!==u.indexOf("$")&&(h[a.id+"_"+u]=a.data[u]);h[a.id+"_"+this.connectorName]=a.operation}h.ids=r.join(","),h.webix_security=M.securityKey,n+=-1==n.indexOf("?")?"?":"&",n+="editing=true",xt().post(n,h,e)},result:function(t,i,s,e,n,h){if(!(n=n.xml()))return s.yt(null,e,n,h);var r=n.data.action;r.length||(r=[r]);for(var o=[],a=0;a<r.length;a++){var u=r[a];o.push(u),u.status=u.type,u.id=u.sid,u.newid=u.tid,s.processResult(u,u,{text:e,data:n,loader:h})}return o}},Xt={$proxy:!0,load:function(){},save:function(t,i,s){$(function(){window.console.log("[DP] "+i.id+" -> "+i.operation,i.data);var t={id:i.data.id,newid:i.data.id,status:i.data.operation};s.processResult(t,t)})}},Jt={$proxy:!0,init:function(){this.clientId=this.clientId||z()},load:function(s){var t=this.clientId;this.client.subscribe(this.source,function(i){i.clientId!=t&&d("dp")(s).ignore(function(){if("delete"==i.operation)s.remove(i.data.id);else if("insert"==i.operation)s.add(i.data);else if("update"==i.operation){var t=s.getItem(i.data.id);t&&(H.extend(t,i.data,!0),s.refresh(t.id))}})})},save:function(t,i){i.clientId=this.clientId,this.client.publish(this.source,i)}},Kt={$proxy:!0,create:function(t,r,i,s){this.source=t+"/",this.Mt(s,i,function(t){var i=t.target.result;for(var s in r)for(var e=r[s],n=i.createObjectStore(s,{keyPath:"id",autoIncrement:!0}),h=0;h<e.length;h++)n.put(e[h])})},Mt:function(i,t,s){if(-1!=this.source.indexOf("/")){var e=this.source.split("/");this.source=e[1],t=t||e[2];var n,h=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB;n=t?h.open(e[0],t):h.open(e[0]),s&&(n.onupgradeneeded=s),n.onerror=function(){},n.onblocked=function(){},n.onsuccess=C(function(t){this.db=t.target.result,i&&i.call(this)},this)}else this.db?i.call(this):$(this.Mt,this,[i],50)},load:function(e,n){this.Mt(function(){var t=this.db.transaction(this.source).objectStore(this.source),s=[];t.openCursor().onsuccess=function(t){var i=t.target.result;i?(s.push(i.value),i["continue"]()):(e.parse(s),xt.$callback(e,n,"[]",s))}})},save:function(t,h,r){this.Mt(function(){var t,s=h.operation,i=h.data,e=h.id,n=this.db.transaction([this.source],"readwrite").objectStore(this.source);"delete"==s?t=n["delete"](e):"update"==s?t=n.put(i):"insert"==s&&(delete i.id,t=n.add(i)),t.onsuccess=function(t){var i={status:s,id:h.id};"insert"==s&&(i.newid=t.target.result),r.processResult(i,i)}})}},qt={$proxy:!0,load:function(t,i){xt(this.source,i,t)},save:function(t,i,s,e){return qt.St.call(this,t,i,s,e,xt())},St:function(t,i,s,e,n){var h=this.source,r="",o=h.indexOf("?");-1!==o&&(r=h.substr(o),h=h.substr(0,o)),h+="/"==h.charAt(h.length-1)?"":"/";var a=i.operation,u=i.data;"insert"==a&&delete u.id,"update"==a?n.put(h+u.id+r,u,e):"delete"==a?n.del(h+u.id+r,u,e):n.post(h+r,u,e)}},Zt={$proxy:!0,load:function(t,i){xt(this.source,i,t)},save:function(t,i,s,e){var n=xt().headers({"Content-Type":"application/json"});return qt.St.call(this,t,i,s,e,n)}},Qt={$proxy:!0,load:function(t,i,s){s=H.extend(s||{},this.params||{},!0),xt().bind(t).post(this.source,s,i)}},ti={$proxy:!0,load:function(t,i){xt().sync().bind(t).get(this.source,null,i)}},ii={toObject:function(t){return"string"==typeof t?JSON.parse(t):t},getRecords:function(t){return t&&t.data&&(t=t.data),t},getDetails:function(t){for(var i={},s=0;s<t.length;s++)i["data"+s]=t[s];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},
getOptions:function(){return!1},getInfo:function(){return{size:0}},idColumn:null},si={toObject:function(t){if("string"!=typeof t)return t;var i=null;return-1==t.indexOf("<")&&(i=A(t)),i||((i=document.createElement("DIV")).innerHTML=t),i.firstChild},getRecords:function(t){return t.getElementsByTagName(this.tag)},getDetails:function(t){return bt.tagToObject(t)},getOptions:function(){return!1},getInfo:function(){return{size:0}},tag:"LI"},ei={toObject:function(t){(t=A(t)).tagName.toLowerCase();var i=t.rows;return G(t),i},getRecords:function(t){for(var i=[],s=t[0]&&t[0].kt?1:0;s<t.length;s++)i.push(t[s]);return i},getDetails:function(t){var i=t.getElementsByTagName("td");t={};for(var s=0;s<i.length;s++)t["data"+s]=i[s].innerHTML;return t},getInfo:function(){return{size:0}},getOptions:function(){},getConfig:function(t){var i=[],s=t[0].getElementsByTagName("th");s.length&&(t[0].kt=!0);for(var e=0;e<s.length;e++){var n={id:"data"+e,header:this.Ct(s[e].innerHTML)},h=this.Dt(s[e]);n=H.extend(n,h),i.push(n)}return i},Ct:function(t){var i=t.indexOf("json://");return-1!=i&&(t=JSON.parse(t.substr(i+7))),t},Dt:function(t){for(var i=t.attributes,s={},e=0;e<i.length;e++)s[i[e].nodeName]=this.Ct(i[e].nodeValue);return s.width=parseInt(s.width,10),s}},ni={};function hi(i,t,s){var e=mt.defer();if(t&&!0!==t&&(e=e.then(function(){t.call(s||this)})),hi.disabled)return e.resolve(),e;if("string"!=typeof i){var n=i.length||0;if(n){var h=function(){n?(n--,hi(i[i.length-n-1],h,s)):e.resolve()};h()}else{for(var r in i)n++;var o=function(){0===--n&&e.resolve()};for(var a in i)hi(a,o,s)}return e}if(!0!==ni[i]){var u=i;if(".css"==i.substr(i.length-4)){var c=Y("LINK",{type:"text/css",rel:"stylesheet",href:u});return document.getElementsByTagName("head")[0].appendChild(c),e.resolve(),e}if(!0===t)v(xt().sync().get(u).responseText),ni[i]=!0;else if(ni[i])ni[i].push(e);else{ni[i]=[e];var f=document.createElement("script"),l=ni[i];f.onerror=function(){ni[i]=!1;for(var t=0;t<l.length;t++)l[t].reject()},f.onload=function(){ni[i]=!0;for(var t=0;t<l.length;t++)l[t].resolve()},document.getElementsByTagName("head")[0].appendChild(f),f.src=u}}else e.resolve();return e}var ri=H.extend({toObject:function(t){if(t.excel)return t;var i=t.options||{};i.dataurl&&H.extend(i,this.$t(i.dataurl)),t=t.data||t;var s=mt.defer();if(t.name){i.ext=t.name.split(".").pop();var e=new FileReader;e.onload=C(function(t){s.resolve(this.parseData(t.target.result,i))},this),e.readAsArrayBuffer(t)}else s.resolve(this.parseData(t,i));return s},parseData:function(t,s){t=new Uint8Array(t);for(var e=[],i=0;i!=t.length;++i)e[i]=String.fromCharCode(t[i]);var n=(s.ext||s).toLowerCase();return"xls"!=n&&(n="xlsx"),hi(S.cdn+"/extras/xlsx.core.styles.min.js").then(C(function(){var t="xls"==n?XLS.read(e.join(""),{type:"binary",cellStyles:!0,cellDates:!0}):XLSX.read(e.join(""),{type:"binary",cellStyles:!0,cellDates:!0}),i={sheets:t.Sheets,names:t.SheetNames,options:s,ranges:t.Workbook&&t.Workbook.Names||[]};return H.extend(this.getSheet(i,s),i)},this))},getSheet:function(t,i){var s=i.name||t.names[0];return t=this.sheetToArray(t.sheets[s],i),i.rows&&i.rows.length&&(t.data=t.data.splice(i.rows[0],Math.min(i.rows[1],t.data.length)-i.rows[0])),t},sheetToArray:function(t,i){var s=[],e=[],n=[],h=[];if(t&&t["!ref"]){var r,o,a,u=XLS.utils.decode_range(t["!ref"]),c=u.s.c,f=u.s.r+(i.rows?i.rows[0]:0);for(r=u.s.r;r<=u.e.r;r++){var l=[];for(o=u.s.c;o<=u.e.c;o++)if(a=t[XLS.utils.encode_cell({r:r,c:o})]){var d="";d=i.math&&a.f?"="==a.f.charAt(0)?a.f:"="+a.f:"d"==a.t&&y(a.v)?ct.dateFormatStr(a.v):a.v,l.push(d),a.s&&n.push([r-f,o-c,a.s])}else l.push("");s.push(l)}if(t["!merges"])for(var v=t["!merges"],_=0;_<v.length;_++){var p=v[_].s,m=v[_].e;(!i.rows||0<=p.r-f&&m.r-f<=i.rows[1])&&e.push([p.r-f,p.c-c,m.c-p.c+1,m.r-p.r+1])}if(t["!cols"])for(var b=t["!cols"],g=0;g<b.length;g++)b[g]&&h.push(["column",g-c,Math.round(b[g].wch/(8.43/70))]);if(t["!rows"])for(var w=t["!rows"],x=0;x<w.length;x++)w[x]&&h.push(["row",x-f,w[x].hpx])}return{data:s,spans:e,styles:n,sizes:h,excel:!0}},$t:function(t){var i=t.split("["),s={};if(
s.name=i[0],i[1]){var e=i[1].split(/[^0-9]+/g);e[0]=1*e[0]||0,e[1]=1*e[1]||9999999,s.rows=e}return s}},ii),oi={json:gt,jsarray:ii,xml:bt,csv:{toObject:function(t){return t},getRecords:function(t){return t.split(this.row)},getDetails:function(t){t=this.stringToArray(t);for(var i={},s=0;s<t.length;s++)i["data"+s]=t[s];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},getOptions:function(){return!1},getInfo:function(){return{size:0}},stringToArray:function(t){t=t.split(this.cell);for(var i=0;i<t.length;i++)t[i]=t[i].replace(/^[ \t\n\r]*("|)/g,"").replace(/("|)[ \t\n\r]*$/g,"");return t},idColumn:null,row:"\n",cell:","},html:si,htmltable:ei,excel:ri},ai={prefix:function(s,e){return s+=".",{put:function(t,i){return e.put(s+t,i)},get:function(t){return e.get(s+t)},remove:function(t){return e.remove(s+t)}}}};ai.local={put:function(t,i){t&&window.JSON&&window.localStorage&&window.localStorage.setItem(t,ft(i))},get:function(t){if(t&&window.JSON&&window.localStorage){var i=window.localStorage.getItem(t);return i?oi.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.localStorage&&window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}},ai.session={put:function(t,i){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.setItem(t,ft(i))},get:function(t){if(t&&window.JSON&&window.sessionStorage){var i=window.sessionStorage.getItem(t);return i?oi.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.removeItem(t)},clear:function(){window.sessionStorage.clear()}},ai.cookie={put:function(t,i,s,e){t&&window.JSON&&(document.cookie=t+"="+escape(ft(i))+(e&&e instanceof Date?";expires="+e.toUTCString():"")+(s?";domain="+s:"")+(S.https?";secure":""))},getRaw:function(t){for(var i=document.cookie.split(";"),s="",e="",n=0;n<i.length;n++){if((s=i[n].split("="))[0].replace(/^\s+|\s+$/g,"")==t)return!0,1<s.length&&(e=unescape(s[1].replace(/^\s+|\s+$/g,""))),e;s=null,""}return null},get:function(t){if(t&&window.JSON){var i=this.getRaw(t);return i?oi.json.toObject(unescape(i)):null}return null},remove:function(t,i){t&&this.getRaw(t)&&(document.cookie=t+"="+(i?";domain="+i:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT")},clear:function(t){for(var i=document.cookie.split(";"),s=0;s<i.length;s++)document.cookie=/^[^=]+/.exec(i[s])[0]+"="+(t?";domain="+t:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};var ui={$proxy:!0,storage:ai.local,cache:!1,local:!1,data:"",At:function(){this.cache||S.offline||(I("onOfflineMode",[]),S.offline=!0)},It:function(){!this.cache&&S.offline&&(S.offline=!1,I("onOnlineMode",[]))},load:function(e,n){var t={error:function(){var t=this.getCache()||this.data,i={responseText:t},s=xt.prototype.G(i);this.At(),xt.$callback(e,n,t,s,i)},success:function(t,i,s){this.It(),xt.$callback(e,n,t,i,s),this.setCache(t)}};this.cache&&this.getCache()?t.error.call(this):this.source.$proxy?this.source.load(this,t):xt(this.source,t,this)},getCache:function(){return this.storage.get(this.Ft())},clearCache:function(){this.storage.remove(this.Ft())},setCache:function(t){this.storage.put(this.Ft(),t)},Ft:function(){return this.source.$proxy?this.source.source+"_$proxy$_data":this.source+"_$proxy$_data"},save:function(t,i,s,e){S.offline||this.cache||(this.source.$proxy?this.source.save(t,i,s,e):xt().post(this.source,i.data,e))},saveAll:function(t,i,s,e){this.setCache(t.serialize()),(this.cache||S.offline)&&xt.$callback(t,e,"",i)},result:function(t,i,s,e,n){for(var h=0;h<n.length;h++)s.processResult({id:n[h].id,status:n[h].operation},{},{})}},ci={init:function(){H.extend(this,ui)},cache:!0},fi={init:function(){H.extend(this,ui)},cache:!0,local:!0,data:[]};var li={$proxy:!0,save:function(t){return this.load(t)},load:function(s,e){var t={query:this.source};return 1===arguments.length&&(t.variables=s,s=this),xt().bind(s).headers({"Content-type":"application/json"}).post(this.url,t).then(function(t){var i=function n(t){if(!t||"object"===!k(t)||Array.isArray(t))return t;var i="",s=0;for(var e in t){if(2==++s)return t;i=e}return t[i]}(
t.json().data);return e&&xt.$callback(s,e,"",i,-1),i})}};function di(t,i,s){var e=B(di[t]);return e.source=i,s&&H.extend(e,s,!0),e.init&&e.init(),e}di.$parse=function(t){if("string"!=typeof t||-1==t.indexOf("->"))return t;var i=t.split("->");return di(i[0],i[1])},di.binary=Wt,di.connector=Gt,di.debug=Xt,di.faye=Jt,di.indexdb=Kt,di.json=Zt,di.post=Qt,di.rest=qt,di.sync=ti,di.offline=ui,di.cache=ci,di.local=di.local=fi,di.GraphQL=li;var vi={$init:function(t){this.data={},this.waitData=mt.defer(),t&&(this.q.datatype=t.datatype||"json"),this.$ready.push(this.Tt)},Tt:function(){this.zt=!0,this.q.url&&this.url_setter(this.q.url),this.q.data&&this.data_setter(this.q.data)},url_setter:function(t){return t=di.$parse(t),this.zt&&this.load(t,this.q.datatype),t},data_setter:function(t){return this.zt?(this.parse(t,this.q.datatype),!0):t},load:function(t,i){var s=arguments[2]||null;if(!this.callEvent("onBeforeLoad",[]))return mt.reject();"string"==typeof i?(this.data.driver=oi[i],i=arguments[2]):this.data.driver||(this.data.driver=oi.json);var e=[{success:this.Vt,error:this.Ht}];return i&&(b(i)?e.push.apply(e,i):e.push(i)),(t=di.$parse(t)).$proxy&&t.load?t.load(this,e,s):"function"==typeof t?t(s).then(C(function(t){xt.$callback(this,e,"",t,-1)},this),C(function(t){xt.$callback(this,e,"",null,t,!0)},this)):xt(t,e,this)},parse:function(t,i){return t&&t.then&&"function"==typeof t.then?t.then(C(function(t){t&&"function"==typeof t.json&&(t=t.json()),this.parse(t,i)},this)):t&&t.sync&&this.sync?this.Bt(t):this.callEvent("onBeforeLoad",[])?(this.data.driver=oi[i||"json"],void this.Vt(t,null)):mt.reject()},Bt:function(t){this.data&&this.data.attachEvent("onSyncApply",C(function(){this.Rt&&this.Rt()},this)),this.sync(t)},Pt:function(t){var i,s,e=this.data.driver;i=(s=e.getRecords(t)[0])?e.getDetails(s):{},this.setValues?this.setValues(i):this.data=i},jt:function(t,i,s,e){t?this.$onLoad&&this.$onLoad(t,this.data.driver)||(this.data&&this.data.Pt?this.data.Pt(t):this.Pt(t)):this.Ht(i,s,e),this.Rt&&this.Rt(),this.callEvent("onAfterLoad",[]),this.waitData.resolve()},Vt:function(t,i,s){var e,n=this.data.driver;(e=-1===s?n.toObject(i):(this.J&&this.J.remove(s),n.toObject(t,i)))&&e.then?e.then&&"function"==typeof e.then&&e.then(C(this.jt,this)):this.jt(e)},Ht:function(t,i,s){this.callEvent("onAfterLoad",[]),this.callEvent("onLoadError",arguments),I("onLoadError",[t,i,s,this])},Nt:function(t){if(!this.q.dataFeed||this.Et||!t)return!0;var i=this.q.dataFeed;return"function"==typeof i?i.call(this,t.id||t,t):(i=i+(-1==i.indexOf("?")?"?":"&")+"action=get&id="+encodeURIComponent(t.id||t),this.callEvent("onBeforeLoad",[])&&xt(i,function(t,i,s){this.Et=!0;var e=oi.json,n=e.toObject(t,i);n?this.setValues(e.getDetails(e.getRecords(n)[0])):this.Ht(t,i,s),this.Et=!1,this.callEvent("onAfterLoad",[])},this),!1)}},_i={Lt:function(t){return t.$empty?"":this.q.template(t,this)},render:function(){var t=this.q;return!!this.isVisible(t.id)&&(this.callEvent&&!this.callEvent("onBeforeRender",[this.data])||(this.data&&!t.content&&(this.bt.innerHTML="",this.bt.innerHTML=this.Lt(this.data)),this.callEvent&&this.callEvent("onAfterRender",[])),!0)},sync:function(i){this.Ot=!1,"DataStore"!=i.name&&(i.data&&"DataStore"==i.name?i=i.data:this.Ot=!0),this.Ot?i.bind("change",C(function(t){t.id==this.data.id&&(this.data=t.attributes,this.refresh())},this)):i.attachEvent("onStoreUpdated",C(function(t){t&&t!=this.data.id||(this.data=i.pull[t],this.refresh())},this))},template_setter:Ft},pi={Ut:function(t){var i=1,s=0,e=this.q.dragscroll;"string"==typeof e&&(s=-1!=e.indexOf("x"),i=-1!=e.indexOf("y"));var n=this.Yt||this.$view,h=K(n),r=h.y,o=r+n.offsetHeight,a=h.x,u=a+n.offsetWidth,c=this.getScrollState(),f=!1,l=Math.max(this.type&&!isNaN(parseFloat(this.type.height))?this.type.height+5:0,40);if(i){var d=this.q;if(d.topSplit){var v=this.Wt(this.getIdByIndex(d.topSplit-1),this.columnId(0));r+=v.top+v.height}t.y<r+l?(this.Gt(c.x,c.y-2*l,t),f=!0):t.y>o-l&&(this.Gt(c.x,c.y+2*l,t),f=!0)}s&&(t.x<a+l?(this.Gt(c.x-2*l,c.y,t),f=!0):t.x>u-l&&(this.Gt(c.x+2*l,c.y,t),f=!0)),f&&(this.Xt=$(this.Ut,
this,[t],100))},Gt:function(t,i,s){this.callEvent("onBeforeAutoScroll",[s])&&this.scrollTo(t,i)}};function mi(t){bi?t.call():gi.push(t)}var bi=!1,gi=[],wi=document.getElementsByTagName("SCRIPT");wi.length,wi.length&&((wi=(wi[wi.length-1].getAttribute("src")||"").split("/")).splice(wi.length-1,1),S.codebase=wi.slice(0,wi.length).join("/")+"/");var xi=function(){S.isIE&&(document.body.className+=" webix_ie"),I("onReady",[])},yi=function(){bi=!0,window.webix_ready&&b(webix_ready)&&(gi=webix_ready.concat(gi));for(var t=0;t<gi.length;t++)gi[t].call();gi=[]};F("onReady",function(t){t?yi():$(yi)}),"complete"==document.readyState?xi():Ot(window,"load",xi),mi(function(){Ot(document.body,"click",function(t){I("onClick",[t||Ot])})});var Mi={config:{longTouchDelay:1e3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500,ellastic:!0,fastClick:!0},limit:function(t){Mi.Jt=!1!==t},disable:function(){Mi.Kt=!0},enable:function(){Mi.Kt=!1},$init:function(){Mi.$init=function(){},Ot(document.body,ki.down,Mi.qt,{passive:!1}),Ot(document.body,ki.move,Mi.Zt,{passive:!1}),Ot(document.body,ki.up,Mi.Qt),Ot(document.body,"dragstart",function(t){if(!Mi.Kt&&!Mi.Jt)return Q(t)}),Ot(document.body,"touchstart",function(t){if(!Mi.Kt&&!Mi.Jt&&Mi.config.fastClick&&S.isSafari){var i=t.srcElement.tagName.toLowerCase();return"input"==i||"textarea"==i||"select"==i||"label"==i||(Mi.ti=!0,Q(t))}},{passive:!1}),Mi.ii(),Mi.si=[null,null],Mi.$active=!0},ii:function(){Mi.ei=Mi.ni=Mi.hi=Mi.ri=null,Mi.oi=Mi.ai=Mi.ci=this.fi=null,Mi.li={di:0,vi:0,_i:0},Mi.pi&&(et(Mi.pi,"webix_touch"),Mi.pi=null),window.clearTimeout(Mi.mi),Mi.bi=!0,Mi.gi=!0,Mi.wi=!0,Mi.xi||Mi.yi()},Qt:function(t){if(Mi.ei){if(Mi.oi){var i=Mi.Mi(Mi.ai),s=i.e,e=i.f,n=Mi.config.finish,h=Mi.Si(t,!0),r=jt(Mi.ai),o=r&&r.$scroll?r.$scroll.gravity:Mi.config.gravity;if(h._i){var a=s+o*h.di/h._i,u=e+o*h.vi/h._i,c=Mi.si[0]?Mi.ki(a,!1,!1,Mi.ci.dx,Mi.ci.px):s,f=Mi.si[1]?Mi.ki(u,!1,!1,Mi.ci.dy,Mi.ci.py):e,l=Math.max(Math.abs(c-s),Math.abs(f-e));l<150&&(n=n*l/150),c==s&&f==e||(n=Math.round(n*Math.max((c-s)/(a-s),(f-e)/(u-e))));var d={e:c,f:f};(r=jt(Mi.ai))&&r.adjustScroll&&r.adjustScroll(d),n=Math.max(100,n),s!=d.e||e!=d.f?(Mi.Ci(Mi.ai,d.e,d.f,n+"ms"),Mi.Di&&Mi.Di.$i(d.e,d.f,n+"ms"),Mi.Ai(d.e,d.f,n+"ms")):Mi.yi()}else Mi.yi()}else if(!this.fi)if(Mi.wi&&!Mi.gi)Mi.Ii("onSwipeX");else if(Mi.gi&&!Mi.wi)Mi.Ii("onSwipeY");else if(S.isSafari&&Mi.ti){Mi.ti=!1;var v=Mi.ei.target;$(function(){var t=document.createEvent("MouseEvents");t.initEvent("click",!0,!0),v.dispatchEvent(t)})}Mi.Ii("onTouchEnd"),Mi.ii()}},Zt:function(t){if(Mi.ri&&Mi.ei){var i=Mi.Si(t);if(Mi.Ii("onTouchMove"),Mi.oi)Mi.Fi(i);else if(Mi.gi=Mi.Ti(i.zi,"x",Mi.gi),Mi.wi=Mi.Ti(i.Vi,"y",Mi.wi),Mi.oi){var s=Mi.Hi("onBeforeScroll",!0);if(s){var e={};s.callEvent("onBeforeScroll",[e]),e.update&&(Mi.config.speed=e.speed,Mi.config.scale=e.scale)}Mi.Bi(i)}return Q(t)}},Fi:function(){if(Mi.ai){var t=Mi.Mi(Mi.ai),i=Mi.hi||Mi.ei,s=jt(Mi.ai),e=s&&s.$scroll?s.$scroll.ellastic:Mi.config.ellastic;Mi.si[0]&&(t.e=Mi.ki(t.e-i.x+Mi.ni.x,e,t.e,Mi.ci.dx,Mi.ci.px)),Mi.si[1]&&(t.f=Mi.ki(t.f-i.y+Mi.ni.y,e,t.f,Mi.ci.dy,Mi.ci.py)),Mi.Ci(Mi.ai,t.e,t.f,"0ms"),Mi.Di&&Mi.Di.$i(t.e,t.f,"0ms"),Mi.Ai(t.e,t.f,"0ms")}},Ai:function(t,i,s){var e=Mi.ci.px/Mi.ci.dx*-t,n=Mi.ci.py/Mi.ci.dy*-i;Mi.si[0]&&Mi.Ci(Mi.si[0],e,0,s),Mi.si[1]&&Mi.Ci(Mi.si[1],0,n,s)},scrollTo:function(t,i,s,e){Mi.Ci(t,i,s,e)},Ci:function(t,i,s,e){if(!Mi.Ri&&window.setAnimationFrame&&window.setAnimationFrame(function(){return Mi.Ri=!0,Mi.Ci(t,i,s,e)}),Mi.Ri=null,Mi.xi=!0,t){var n=Mi.config.translate||S.translate;t.style[S.transform]=n+"("+Math.round(i)+"px, "+Math.round(s)+"px"+("translate3d"==n?", 0":"")+")",t.style[S.transitionDuration]=e}},Mi:function(t){var i,s=window.getComputedStyle(t)[S.transform];if("none"==s)i={e:0,f:0};else if(window.WebKitCSSMatrix)i=new WebKitCSSMatrix(s);else if(window.MSCSSMatrix)i=new MSCSSMatrix(s);else{var e=s.replace(/(matrix\()(.*)(\))/gi,"$2");e=(e=e.replace(/\s/gi,"")).split(","),i={};for(var n=["a","b","c","d","e","f"],h=0;h<n.length;h++)i[n[h]]=parseInt(e[h],10)}
return Mi.Di&&Mi.Di.Pi(i),i},ki:function(t,i,s,e,n){if(t===s)return t;var h=Math.abs(t-s);if(0<t)return i?s+h/(t-s)*Math.sqrt(h):0;var r=e-n;return r+t<0?i?s-Math.sqrt(-(t-s)):-r:t},ji:function(t){if(!t.scroll_enabled){t.scroll_enabled=!0,t.parentNode.style.position="relative";var i=S.cssPrefix;t.style.cssText+=i+"transition: "+i+"transform; "+i+"user-select:none; "+i+"transform-style:flat;",t.addEventListener(S.transitionEnd,Mi.yi,!1)}},Bi:function(){-1!=Mi.oi.indexOf("x")&&(Mi.si[0]=Mi.Ni("x",Mi.ci.dx,Mi.ci.px,"width")),-1!=Mi.oi.indexOf("y")&&(Mi.si[1]=Mi.Ni("y",Mi.ci.dy,Mi.ci.py,"height")),Mi.ji(Mi.ai),window.setTimeout(Mi.Fi,1)},Ni:function(t,i,s,e){if(i-s<2){var n=Mi.Mi(Mi.ai),h="y"==t?n.e:0,r="y"==t?0:n.f;return Mi.Di||Mi.Ci(Mi.ai,h,r,"0ms"),Mi.oi=Mi.oi.replace(t,""),""}var o=Y("DIV",{"class":"webix_scroll_"+t},"");return o.style[e]=Math.max(s*s/i-7,10)+"px",Mi.ci.left&&("x"===t?o.style.left=Mi.ci.left+"px":o.style.right=-Mi.ci.left+"px"),Mi.ci.hidden&&(o.style.visibility="hidden"),Mi.ai.parentNode.appendChild(o),o},Ti:function(t,i,s){return t>Mi.config.deltaStep?(Mi.bi&&(Mi.Ei(i),Mi.Li(i),-1==(Mi.oi||"").indexOf(i)&&(Mi.oi="")),!1):s},yi:function(){var t,i,s;(s=jt(Mi.ai||this))&&(Mi.ai?t=Mi.Mi(Mi.ai):s.getScrollState&&(t={e:(i=s.getScrollState()).x,f:i.y}),I("onAfterScroll",[t]),s.callEvent&&s.callEvent("onAfterScroll",[t])),Mi.oi||(G(Mi.si),Mi.si=[null,null]),Mi.xi=!1},Ei:function(){window.clearTimeout(Mi.mi),Mi.bi=!1},Oi:function(t){if(!Mi.si[0]&&!Mi.si[1])return!0;Mi.Ui(t,Mi.si[0]?"x":"y")},qt:function(t){var i=t.target||Ot.srcElement;if(!(Mi.Kt||i.tagName&&"textarea"==i.tagName.toLowerCase()&&i.offsetHeight<i.scrollHeight)){Mi.fi=null,Mi.ri=Mi.ei=ki.context(t);var s=jt(t);!Mi.Jt||Mi.Yi()||s&&s.$touchCapture||(Mi.ri=null),Mi.Ii("onTouchStart"),Mi.Oi(t)&&(Mi.mi=window.setTimeout(Mi.Wi,Mi.config.longTouchDelay)),!s||!s.touchable||i.className&&0===i.className.indexOf("webix_view")||(Mi.pi=s.getNode(t),st(Mi.pi,"webix_touch"))}},Wi:function(){Mi.ei&&(Mi.Ii("onLongTouch"),I("onClick",[Mi.ei]),Mi.fi=!0)},Ui:function(t,i){Mi.Li(i);var s=Mi.si[0]||Mi.si[1];if(s){var e=Mi.Hi("onBeforeScroll",!0);e&&e.callEvent("onBeforeScroll",[Mi.ei,Mi.ni])}!s||Mi.ai&&s.parentNode==Mi.ai.parentNode||(Mi.ii(),Mi.yi(),Mi.ei=ki.context(t)),Mi.Zt(t)},Si:function(t){return Mi.hi=Mi.ni,Mi.ni=ki.context(t),Mi.li.zi=Math.abs(Mi.ei.x-Mi.ni.x),Mi.li.Vi=Math.abs(Mi.ei.y-Mi.ni.y),Mi.hi&&(Mi.ni.time-Mi.hi.time<Mi.config.scrollDelay?(Mi.li.di=Mi.li.di/1.3+Mi.ni.x-Mi.hi.x,Mi.li.vi=Mi.li.vi/1.3+Mi.ni.y-Mi.hi.y):Mi.li.vi=Mi.li.di=0,Mi.li._i=Mi.li._i/1.3+(Mi.ni.time-Mi.hi.time)),Mi.li},Gi:function(t){Mi.ci={dx:t.offsetWidth,dy:t.offsetHeight,px:t.parentNode.offsetWidth,py:t.parentNode.offsetHeight}},Yi:function(t){var i=Mi.ei.target;if(!S.touch&&!S.transition&&!S.transform)return null;for(;i&&"BODY"!=i.tagName;){if(i.getAttribute){var s=i.getAttribute("touch_scroll");if(s&&(!t||-1!=s.indexOf(t)))return[i,s]}i=i.parentNode}return null},Li:function(t){var i=this.Yi(t);return i&&(Mi.oi=i[1],Mi.ai=i[0],Mi.Gi(i[0])),i},Ii:function(t){I(t,[Mi.ei,Mi.ni]);var i=Mi.Hi(t);i&&i.callEvent(t,[Mi.ei,Mi.ni])},Hi:function(t,i){var s=jt(i?Mi.ai:Mi.ei);if(!s)return null;for(;s;){if(s.hasEvent&&s.hasEvent(t))return s;s=s.getParentView()}return null},Xi:function(t){if(t.touches[0])return{target:t.target,x:t.touches[0].pageX,y:t.touches[0].pageY,time:new Date};var i=Mi.ni;return i.time=new Date,i},Ji:function(t){return{target:t.target||t.srcElement,x:t.pageX,y:t.pageY,time:new Date}}};function Si(t){t.down="touchstart",t.move="touchmove",t.up="touchend",t.context=Mi.Xi}mi(function Ro(){if(S.touch)Mi.$init(),-1==document.body.className.indexOf("webix_full_screen")&&Mi.limit(!0),window.MSCSSMatrix&&O(".webix_view{ -ms-touch-action: none; }");else var e=Ot(document.body,"touchstart",function(t){if(t.touches.length&&4<t.touches[0].radiusX)for(var i in S.touch=!0,Si(ki),Ro(),Vt.views){var s=Vt.views[i];s&&s.$touch&&s.$touch()}Ut(e)},{capture:!0})});var ki=S.mouse={down:"mousedown",up:"mouseup",move:"mousemove",context:Mi.Ji};function Ci(t){return"$"+t+(Di[t]=(Di[t]||0)+1)}
window.navigator.pointerEnabled?(ki.down="pointerdown",ki.move="pointermove",ki.up="pointerup"):window.navigator.msPointerEnabled?(ki.down="MSPointerDown",ki.move="MSPointerMove",ki.up="MSPointerUp"):S.touch&&Si(ki);var Di={},$i=!1;function Ai(t,i){$i=!0;var s=t();return s&&s.then?s=s.then(function(t){return($i=!1)!==i&&Ii(),t}):($i=!1)!==i&&Ii(),s}function Ii(){if(d("UIManager").applyChanges(),I("onClick",[]),M.Ki=!0,!$i)for(var t=M.top_views.length-1;0<=t;t--)M.top_views[t].obj&&M.top_views[t].obj.resize();M.Ki=!1}function Fi(t,i,s,e){if(t)for(var n=e?[t]:t.getChildViews(),h=0;h<n.length;h++)!1!==i.call(s,n[h])&&Fi(n[h],i,s)}function Ti(){return S.zIndexBase++}Ot(window,"resize",function(){S.touch&&M.m&&new Date-M.m<1e3||Ii()});var zi={qi:p(["dummy"]),addDrop:function(t,i,s){(t=A(t)).webix_drop=this.Zi(i),s&&(t.webix_master=!0)},Zi:function(t){t=t||zi;var i=this.qi.find(t);return i<0&&(i=this.qi.length,this.qi.push(t)),i},Qi:function(t){var i=zi,s=this.ts();if(s&&s.ss){i.es||i.createDrag(t);var e=i.ns;i.es.style.left=t.x+i.left+(e.x_offset||0)+"px",i.es.style.top=t.y+i.top+(e.y_offset||0)+"px"}},addDrag:function(t,i){(t=A(t)).webix_drag=this.Zi(i),Lt(t,S.mouse.down,this.hs,{bind:t}),Lt(t,"dragstart",Q)},hs:function(t){if(zi.rs){if(zi.os==t)return;zi.us(),zi.destroyDrag(t)}zi.rs=this;var i=S.mouse.context(t);zi.cs=i,zi.os=t,zi.fs=Ot(document.body,S.mouse.move,zi.ls),zi.ds=Ot(document,S.mouse.up,zi.us),st(document.body,"webix_noselect",1)},us:function(){zi.vs()},ls:function(t){var i=S.mouse.context(t),s=zi.ts();if(!(s&&S.touch&&s.ss&&!Mi.fi||Math.abs(i.x-zi.cs.x)<5&&Math.abs(i.y-zi.cs.y)<5)&&(zi.vs(!0),zi.es||zi.createDrag(zi.os)))return zi.sendSignal("start"),zi.fs=Ot(document.body,S.mouse.move,zi._s),zi.ds=Ot(document,S.mouse.up,zi.ps),zi._s(t),S.touch?Q(t):void 0},ps:function(t){zi.vs(),zi.os=null,zi.ms&&(zi.$drop(zi.rs,zi.ms,t),zi.$dragOut(zi.rs,zi.ms,null,t)),zi.destroyDrag(t),zi.sendSignal("stop")},vs:function(t){this.fs=Ut(this.fs),this.ds=Ut(this.ds),t||et(document.body,"webix_noselect")},_s:function(e){var t=zi,i=Z(e),s=t.$dragPos(i,e),n=t.ns;t.es.style.top=i.y+t.top+(s||!n.y_offset?0:n.y_offset)+"px",t.es.style.left=i.x+t.left+(s||!n.x_offset?0:n.x_offset)+"px";var h=e;if(t.bs)t.bs=!1;else{if(S.touch){var r=S.mouse.context(e),o=document.elementFromPoint(r.x,r.y);h=new Proxy(e,{get:function(t,i){if("target"===i)return o;var s=t[i];return"function"==typeof s?s.bind(e):s}})}t.gs(h.target||h.srcElement,h)}return Q(e)},gs:function(t,i){for(;t&&"BODY"!=t.tagName;){if(t.webix_drop)return this.ms&&(this.ms!=t||t.webix_master)&&this.$dragOut(this.rs,this.ms,t,i),!this.ms||this.ms!=t||t.webix_master?(this.ms=null,this.ws=this.$dragIn(zi.rs,t,i),void(this.ws&&(this.ms=t))):void 0;t=t.parentNode}this.ms&&(this.ms=this.ws=this.$dragOut(this.rs,this.ms,null,i))},sendSignal:function(t){zi.active="start"==t},getMaster:function(t){return this.qi[t.webix_drag||t.webix_drop]},getContext:function(){return this.ns},getNode:function(){return this.es},createDrag:function(t){var i=zi,s=i.rs;i.ns={};var e,n=this.qi[s.webix_drag];if(n.$dragCreate){if(!(e=n.$dragCreate(s,t)))return!1;this.xs(t),e.style.position="absolute"}else{var h=i.$drag(s,t);if(i.xs(t),!h)return!1;(e=document.createElement("DIV")).innerHTML=h,e.className="webix_drag_zone",document.body.appendChild(e);var r=i.ns;r.html&&S.pointerevents&&(r.x_offset=-Math.round(.5*e.offsetWidth),r.y_offset=-Math.round(.75*e.offsetHeight))}return e.style.zIndex=Math.max(e.style.zIndex,Ti()),zi.ys=Ot(e,S.mouse.move,zi.Ms),zi.ns.from||(zi.ns={source:s,from:s}),zi.es=e,!0},Ms:function(){zi.bs=!0},destroyDrag:function(t){var i=zi.rs,s=this.qi[i.webix_drag];s&&s.$dragDestroy?(zi.ys=Ut(zi.ys),zi.es&&s.$dragDestroy(i,zi.es,t)):G(zi.es),zi.ws=zi.rs=zi.ms=zi.es=null},ts:function(){return zi.qi[zi.rs.webix_drag]},top:5,left:5,xs:function(t){var i=zi,s=i.cs,e=i.ns;if("undefined"!=typeof e.x_offset&&"undefined"!=typeof e.y_offset)return null;if(e.x_offset=e.y_offset=0,S.pointerevents){var n=zi.ts();if(n.ss&&n!==this){var h=n.ss(s,t);h&&(e.x_offset=h.x-s.x,e.y_offset=h.y-s.y)}}},$dragPos:function(t,
i){var s=this.qi[zi.rs.webix_drag];if(s.$dragPos&&s!=this)return s.$dragPos(t,i,zi.es),!0},$dragIn:function(t,i,s){var e=this.qi[i.webix_drop];return e.$dragIn&&e!=this?e.$dragIn(t,i,s):(i.className=i.className+" webix_drop_zone",i)},$dragOut:function(t,i,s,e){var n=this.qi[i.webix_drop];return n.$dragOut&&n!=this?n.$dragOut(t,i,s,e):(i.className=i.className.replace("webix_drop_zone",""),null)},$drop:function(t,i,s){var e=this.qi[i.webix_drop];if(zi.ns.from=zi.getMaster(t),e.$drop&&e!=this)return e.$drop(t,i,s);i.appendChild(t)},$drag:function(t,i){var s=this.qi[t.webix_drag];return s.$drag&&s!=this?s.$drag(t,i):"<div style='"+t.style.cssText+"'>"+t.innerHTML+"</div>"}};F("onLongTouch",function(t){zi.rs&&zi.Qi(t)});var Vi={ot:null,Ss:{},m:0,ks:0,Cs:0,Ds:{enter:13,tab:9,esc:27,escape:27,up:38,down:40,left:37,right:39,pgdown:34,pagedown:34,pgup:33,pageup:33,end:35,home:36,insert:45,"delete":46,backspace:8,space:32,meta:91,win:91,mac:91,multiply:106,add:107,subtract:109,decimal:110,divide:111,scrollock:145,pausebreak:19,numlock:144,"5numlocked":12,shift:16,capslock:20},$s:{input:1,button:1,textarea:1,select:1},As:function(){Ot(document.body,"click",C(this.Is,this)),Ot(document,"keydown",C(this.Fs,this)),Lt(document.body,"mousedown",C(function(){this.Cs=new Date},this)),document.body.addEventListener&&Ot(document.body,"focus",this.Ts,{capture:!0,bind:this}),M.destructors.push({obj:this})},destructor:function(){Vi.ot=null},getFocus:function(){return this.ot},ut:function(t){this.zs=this.zs||t.q.id},setFocus:function(t,i,s){return(t=jt(t))&&!t.$view&&(t=null),this.m=M.m=new Date,this.ot===t||(this.ot&&this.ot.callEvent&&this.ot.callEvent("onBlur",[this.ot]),t&&t.callEvent&&(t.callEvent("onFocus",[t,this.ot]),s&&t.callEvent("onTabFocus",[t,this.ot])),I("onFocusChange",[t,this.ot]),this.ot&&this.ot.blur&&!i&&this.ot.blur(),(this.ot=t)&&t.focus&&!i&&t.focus()),!0},applyChanges:function(t){var i=this.getFocus();i&&i!=t&&i.Vs&&i.Vs(t)},hasFocus:function(t){return t===this.ot},Hs:function(t,i){var s=J(t,"view_id")||this.zs;if(s=jt(s),this.zs=null,M.m=new Date,s!=this.ot)return i||(this.zs=null),s?(s=jt(s),this.canFocus(s)&&(s.getNode&&s.getNode(t),this.setFocus(s))):i||this.setFocus(null),!0},Is:function(t){return new Date-this.m<100?(this.zs=null,!1):this.Hs(t)},Ts:function(t){return!!this.$s[t.target.nodeName.toLowerCase()]&&this.Hs(t,!0)},canFocus:function(t){return t.isVisible()&&t.isEnabled()&&!t.queryView({disabled:!0},"parent")},Bs:function(t){var i=this.getFocus();if(t&&!this.Rs(t,i))return!1;this.Ps("getPrev",t)||(this.ot=null)},js:{},Rs:function(t,i){if(!t)return!1;if(!i)return!1;for(;i;){if(i===t)return!0;i=i.getParentView()}return!1},Ns:function(){this&&this.callEvent&&this.callEvent("onTimedKeyPress",[])},Es:function(t){return t<112&&105<t},Fs:function(t){var i=t.which||t.keyCode;95<i&&i<106&&(i-=48),i=this.js[i]||i;var s=t.ctrlKey,e=t.shiftKey,n=t.altKey,h=t.metaKey,r=this.Ls(i,s,e,n,h),o=this.getFocus();o&&o.callEvent&&(!1===o.callEvent("onKeyPress",[i,t])&&Q(t),o.hasEvent("onTimedKeyPress")&&(clearTimeout(o.Os),o.Os=$(this.Ns,o,[],o.q.keyPressTimeout||250))),this.Es(i)||(r=this.Ls(String.fromCharCode(i),s,e,n,h));var a=!s&&!n&&!h&&9!=i&&27!=i&&13!=i;if(!1===this.Us(r,a,t))return Q(t),!1},Ps:function(t){if(!this.getFocus())return null;t=t||"getNext";for(var i=this.getFocus(),s=i,e=z();;){if((i=this[t](i))&&this.canFocus(i))return this.setFocus(i);if(i===s||i.$fmarker==e)return null;i.$fmarker=e}},Ys:function(t,i){var s=!i.shiftKey;if(Vi.ks=new Date,t&&t.Ws&&!t.Ws(s,i))return!1;if(t&&t.Gs){if(t.editNext)return t.editNext(s);if(t.editStop)return t.editStop(),!0}else $(function(){Vi.setFocus(jt(document.activeElement),!0,!0)},1)},getTop:function(t){for(var i,s=jt(t);s&&(i=s.getParentView());)s=i;return s},getNext:function(t,i){var s=t.getChildViews();if(s.length&&!i)return s[0];var e=t.getParentView();if(!e)return t;var n=e.getChildViews();if(n.length)for(var h=x.find.call(n,t)+1;h<n.length;){if(this.canFocus(n[h]))return n[h];h++}return this.getNext(e,!0)},getPrev:function(t,i){var s=t.getChildViews();if(s.length&&i
)return this.getPrev(s[s.length-1],!0);if(i)return t;var e=t.getParentView();if(!e)return this.getPrev(t,!0);var n=e.getChildViews();if(n)for(var h=x.find.call(n,t)-1;0<=h;){if(this.canFocus(n[h]))return this.getPrev(n[h],!0);h--}return e},addHotKey:function(t,i,s){var e=this.Xs(t);e.letter,s||(s=null),e.handler=i,e.view=s;var n=this.Ls(e.letter,e.ctrl,e.shift,e.alt,e.meta);return this.Ss[n]||(this.Ss[n]=[]),this.Ss[n].push(e),t},removeHotKey:function(t,i,s){var e=this.Xs(t),n=this.Ls(e.letter,e.ctrl,e.shift,e.alt,e.meta);if(i||s){var h=this.Ss[n];if(h){for(var r=h.length-1;0<=r;r--)s&&h[r].view!==s||i&&h[r].handler!==i||h.splice(r,1);h.length||delete this.Ss[n]}}else delete this.Ss[n]},Ls:function(t,i,s,e,n){return t+"_"+["",i?"1":"0",s?"1":"0",e?"1":"0",n?"1":"0"].join("")},Us:function(t,i,s){var e=this.getFocus();return this.Ss[t]?this.Js(this.Ss[t],e,s):!i||!this.Ss.ANY_0000||this.Js(this.Ss.ANY_0000,e,s)},Js:function(t,i,s){for(var e=0;e<t.length;e++){var n=t[e];if(null===n.view||i===n.view||"string"==typeof n.view&&i&&i.name===n.view){var h=n.handler(i,s);if(!!h===h)return h}}return!0},Xs:function(t){var i,s,e,n,h=this.Ds,r=t.toLowerCase().split(/[+\-_]/);i=s=e=n=0;for(var o="",a=0;a<r.length;a++)if("ctrl"===r[a])i=1;else if("shift"===r[a])s=1;else if("alt"===r[a])e=1;else if("command"===r[a])n=1;else if(h[r[a]]){var u=h[r[a]];o=this.Es(u)?u.toString():String.fromCharCode(u)}else o=r[a];return{letter:o.toUpperCase(),ctrl:i,shift:s,alt:e,meta:n,debug:t}},getState:function(t,i){i=i||!1;var s={id:(t=jt(t)).config.id,width:t.config.width,height:t.config.height,gravity:t.config.gravity};if(D(t.config.collapsed)||(s.collapsed=t.config.collapsed),"tabs"!==t.name&&"tabbar"!==t.name||(s.activeCell=t.getValue()),i&&(s=[s],t.Ks))for(var e=0;e<t.Ks.length;e++)s=s.concat(this.getState(t.Ks[e],i));return s},setState:function(t){b(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i],e=jt(s.id);e&&(D(s.collapsed)||e.define("collapsed",s.collapsed),D(s.activeCell)||e.setValue(s.activeCell),e.define("width",s.width),e.define("height",s.height),e.define("gravity",s.gravity))}var n=jt(t[0].id);n&&n.resize()}};mi(function(){Vi.As(),Vi.addHotKey("enter",function(t,i){if(t&&t.callEvent&&t.callEvent("onEnter",[i]),t&&t.editStop&&t.Gs)return t.editStop(),!0;if(t&&t.touchable){var s=t.getFormView();s&&!t.qs&&s.callEvent("onSubmit",[t,i])}}),Vi.addHotKey("esc",function(t){if(t){if(t.editCancel&&t.Gs)return t.editCancel(),!0;var i=t.getTopParentView();i&&i.setPosition&&i.Zs()}}),Vi.addHotKey("shift+tab",Vi.Ys),Vi.addHotKey("tab",Vi.Ys)}),u("UIManager",Vi);var Hi={$init:function(){this.q=this.config={}},define:function(t,i){return"object"==k(t)?this.Qs(t):this.te(t,i)},te:function(t,i){var s=this[t+"_setter"];return this.q[t]=s?s.call(this,i,t):i},Qs:function(t){if(t)for(var i in t)this.te(i,t[i])},at:function(t,i){var s={};i&&(s=H.extend(s,i)),"object"!=k(t)||t.tagName||H.extend(s,t,!0),this.Qs(s)},ie:function(t,i){for(var s in i)switch(k(t[s])){case"object":t[s]=this.ie(t[s]||{},i[s]);break;case"undefined":t[s]=i[s]}return t}},Bi={$init:function(){var t=this.ht={obj:this};M.destructors.push(t)},destructor:function(){var t=this.q;if(this.se&&this.editCancel(),this.callEvent&&this.callEvent("onDestruct",[]),this.destructor=function(){},this.ht.obj=null,this.getChildViews){var i=this.getChildViews();if(i)for(var s=0;s<i.length;s++)i[s].destructor();if(this.rt)for(var e=0;e<this.rt.length;e++)this.rt[e].destructor()}if(delete Vt.views[t.id],t.$id){var n=this.getTopParentView();n&&n.ee&&n.ee(t.$id)}this.ne=null,this.he=null,this.es=null,this.re&&(this.re.innerHTML="",this.re.ne=null),this.nt&&this.nt.parentNode&&this.nt.parentNode.removeChild(this.nt),this.data&&this.data.destructor&&this.data.destructor(),this.unbind&&this.unbind(),this.data=null,this.nt=this.$view=this.re=this.bt=null,this.V=this.H={},Vi.ot==this&&(Vi.ot=null);var h=t.url;h&&h.$proxy&&h.release&&h.release(),this.$scope=null,this.$destructed=!0}};Ot(window,"unload",function(){I("unload",[]),M.k=!0;for(var t=0;t<M.destructors.length;t++){var i=M.destructors[t].obj;i&&i.destructor()
}M.destructors=[],M.oe=p(),Et()});var Ri={$init:function(){this.ae=null,this.attachEvent("onSelectChange",function(){var t=this.getSelectedId();this.setCursor(t?t.id||t:null)}),this.attachEvent("onAfterCursorChange",this.ue),this.attachEvent("onAfterDelete",function(t){t==this.getCursor()&&this.setCursor(null)}),this.data.attachEvent("onStoreUpdated",C(function(t,i,s){t&&t==this.getCursor()&&"paint"!=s&&"delete"!=s&&this.ue()},this)),this.data.attachEvent("onClearAll",C(function(){this.ae=null},this)),this.data.attachEvent("onIdChange",C(function(t,i){this.ae==t&&(this.ae=i,this.ue())},this))},refreshCursor:function(){this.ae&&this.callEvent("onAfterCursorChange",[this.ae])},setCursor:function(t){t==this.ae||null!==t&&!this.getItem(t)||(this.callEvent("onBeforeCursorChange",[this.ae]),this.ae=t,this.callEvent("onAfterCursorChange",[t]))},getCursor:function(){return this.ae},ce:function(t,i,s){if("$level"==i&&this.data.getBranch)return(t.data||t).importData(this.data.getBranch(this.getCursor()));var e=this.getItem(this.getCursor())||this.q.defaultData||null;"$data"==i?("function"==typeof s?s.call(t,e,this):t.data.importData(e?e[s]:[]),t.callEvent("onBindApply",[e,i,this])):(s&&(e=s(e)),this.fe(t,i,e))}},Pi={$init:function(){this.attachEvent("onChange",this.ue)},ce:function(t,i,s){i=i||"value";var e=this.getValue()||"";if(s&&(e=s(e)),t.setValue)t.setValue(e);else if(t.filter)t.data.silent(function(){this.filter(i,e)});else{var n={};n[i]=e,t.Nt(e)&&t.setValues(n)}t.callEvent("onBindApply",[e,i,this])}},ji={$init:function(){this.attachEvent("onChange",this.ue)},ce:function(t,i,s){var e=this.getValues()||null;s&&(e=s(e)),this.fe(t,i,e)}},Ni={$init:function(){this.le={},this.de={},this.ve={},this._e(this)},saveBatch:function(t){this.pe=!0,t.call(this),this.pe=!1,this.ue()},setBindData:function(t,i){if(i&&(this.ve[i]=!0),this.setValue)this.setValue(t);else if(this.setValues)this.setValues(t);else{var s=this.getCursor();s?this.updateItem(s,t):this.add(t)}this.callEvent("onBindUpdate",[t,i]),this.save&&this.save(),i&&(this.ve[i]=!1)},getBindData:function(t,i){if(this.de[t])return!1;var s=jt(t);s.isVisible(s.q.id)&&(this.de[t]=!0,this.ce(s,this.le[t][0],this.le[t][1]),i&&s.filter&&s.refresh())},addBind:function(t,i,s){this.le[t]=[i,s]},removeBind:function(t){delete this.le[t],delete this.de[t],delete this.ve[t]},_e:function(t){t.filter?H.extend(this,Ri):t.setValue?H.extend(this,Pi):H.extend(this,ji)},ue:function(){if(!this.pe)for(var t in this.le)this.ve[t]||(this.de[t]=!1,this.getBindData(t,!0))},fe:function(t,i,s){t.setValue?t.setValue(s&&i?s[i]:s):t.filter?t.data.silent(function(){this.filter(i,s)}):!s&&t.clear?t.clear():t.Nt(s)&&t.setValues(f(s)),t.callEvent("onBindApply",[s,i,this])}},Ei={bind:function(t,i,s){this.attachEvent||H.extend(this,g),"string"==typeof t&&(t=jt(t)),t.me&&t.me(),this.me&&this.me(),t.getBindData||H.extend(t,Ni),this.be(),t.addBind(this.q.id,i,s),this.ge=t.q.id;var e=this.q.id;this.we=this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return t.getBindData(e)}),this.refresh&&this.isVisible(this.q.id)&&this.refresh()},unbind:function(){if(this.ge){var t=jt(this.ge);t&&t.removeBind(this.q.id),this.detachEvent(this.we),this.ge=null}},be:function(){var t=this.q;if(this.filter){var i=t.id;this.data.xe=C(function(){jt(this.ge).de[i]=!1},this)}var s=this.render;this.render=function(){if(!this.ye){this.ye=!0;var t=this.callEvent("onBindRequest");return this.ye=!1,s.apply(this,!1===t?arguments:[])}},(this.getValue||this.getValues)&&(this.save=function(t){var i=jt(this.ge);if(t)i.setBindData(t);else{if(this.validate&&!this.validate())return!1;var s=this.getValue?this.getValue:this.getValues();i.setBindData(s,this.q.id),this.setDirty&&this.setDirty(!1)}}),this.be=function(){}}},Li=window.webix_view||{},Oi={name:"baseview",$init:function(t){t.id||(t.id=Ci(this.name)),this._=M._,M._=null,this.$scope=t.$scope||(this._?this._.$scope:M.i),this.nt||(this.re=this.nt=Y("DIV",{"class":"webix_view"}),this.$view=this.nt)},$skin:!1,defaults:{width:0,height:0,gravity:1},getNode:function(){return this.nt},
getParentView:function(){return this._||null},getTopParentView:function(){var t=this.getParentView();return t?t.getTopParentView():this},getFormView:function(){var t=this.getParentView();return!t||t.setValues?t:t.getFormView()},getChildViews:function(){return[]},queryView:function(e,t){var i;if("string"==typeof e&&(e={view:e}),i="object"===k(e)?function(t){var i=t.config;for(var s in e)if(i[s]!=e[s])return!1;return!0}:e,"self"===t&&i(this))return this;var s="all"===t&&[],n="parent"===t?this.Me:this.Se,h=this.ke(i,n,s);return"all"===t?s:h},Se:function(t){return t.getChildViews()},Me:function(t){var i=t.getParentView();return i?[i]:[]},ke:function(t,i,s){for(var e=i(this),n=0;n<e.length;n++){if(t(e[n])){if(!s)return e[n];s.push(e[n])}var h=e[n].ke(t,i,s);if(h&&!s)return h}return null},isVisible:function(t){if(this.q.hidden)return t&&(this.Ce||(this.Ce=[],this.De={}),this.De[t]||(this.De[t]=!0,this.Ce.push(t))),!1;var i=this.getParentView();return!i||i.isVisible(t,this.q.id)},isEnabled:function(){if(this.$e)return!1;var t=this.getParentView();return!t||t.isEnabled()},disable:function(){G(this.$e),this.q.disabled=!0,this.$e=Y("div",{"class":"webix_disabled"}),this.nt.appendChild(this.$e),this.nt.setAttribute("aria-disabled","true"),st(this.nt,"webix_disabled_view",!0),Vi.Bs(this)},enable:function(){this.q.disabled=!1,this.$e&&(G(this.$e),et(this.nt,"webix_disabled_view"),this.nt.removeAttribute("aria-disabled"),this.$e=null)},disabled_setter:function(t){return t?this.disable():this.enable(),t},container_setter:function(t){return A(t),!0},css_setter:function(t){return"object"==k(t)&&(t=L(t)),this.nt.className+=" "+t,t},id_setter:function(t){if(M.n&&(M.n!=this||this.Ae)){var i=this.config.$id=t;t=Ci(((this.Ae||M.n).Ie[t]=this).name),(this.Ae||M.n).Fe[t]=i}return Vt.views[t],(Vt.views[t]=this).nt.setAttribute("view_id",t),t},$setSize:function(t,i){var s=this.Te;return(!s||s[0]!=t||s[1]!=i)&&(this.Te=[t,i],this.$width=this.ze=t-(this.Ve?S.scrollSize:0),this.$height=this.He=i-(this.Be?S.scrollSize:0),this.q.flex||(this.nt.style.width=t+"px",this.nt.style.height=i+"px"),!0)},$getSize:function(t,i){var s=this.q,e=[1*(s.width||s.minWidth||0),1*(s.width||s.maxWidth||1e5),1*(s.height||s.minHeight||0),1*(s.height||s.maxHeight||1e5),s.gravity];return(isNaN(e[0])||isNaN(e[1])||isNaN(e[2])||isNaN(e[3]))&&(this.q.id,s.width=s.height=s.maxWidth=s.maxHeight=s.minWidth=s.minHeight=0,e=[0,0,1e5,1e5,1]),e[0]+=t,e[1]+=t,e[2]+=i,e[3]+=i,e},show:function(t,i){var s=this.getParentView(),e=!arguments[2];s?(!i&&!1!==i&&this.q.animate&&s.q.animate&&(i=H.extend(s.q.animate?H.extend({},s.q.animate):{},this.q.animate,!0)),(e?s.Re:s.Zs)&&(e?s.Re:s.Zs).call(s,this,i),e&&this.Pe(),t&&e&&s.show(!s.$$&&t)):this.q.hidden?e&&(A(this.q.it||document.body).appendChild(this.nt),this.q.hidden=!1,this.adjust(),this.Pe()):e||(this.q.hidden=this.q.tt=!0,this.nt&&(this.q.it=this.nt.parentNode,G(this.nt)))},Pe:function(){if(this.Ce){for(var t=0;t<this.Ce.length;t++){var i=jt(this.Ce[t]);i&&i.render()}this.Ce=[],this.De={}}},je:function(t,i){var s=i.srcElement||i.target,e=s.getAttribute("role");13!==t&&32!==t||"button"!=e&&"tab"!=e||this.q.disabled||(it(s,"MouseEvents","click"),Q(i))},hidden_setter:function(t){return t&&this.hide(),this.q.hidden},hide:function(){this.show(null,null,!0),Vi.Bs(this)},adjust:function(){if(!this.nt.parentNode)return!1;var t=this.nt.parentNode.clientWidth||0,i=this.nt.parentNode.clientHeight||0,s=this.$getSize(0,0),e=this.nt.parentNode==document.body&&!this.setPosition;s[0]>t&&(t=s[0]),s[2]>i&&(i=s[2]),(!e||this.q.width)&&t>s[1]&&(t=s[1]),(!e||this.q.height)&&i>s[3]&&(i=s[3]),this.$setSize(t,i),M.o&&(M.o=!1,this.adjust())},resize:function(){if(!(M.h||M.l||M.u)){var t=this.getParentView();t?t.resizeChildren?t.resizeChildren():t.resize():(this.adjust(),I("onResize",[]))}}},Ui={api:Oi,view:H.protoUI(Oi,Hi,Bi,Ei,Li)},Yi={name:"view",$init:function(t){this.Ne(t)},Ne:function(t){var i=D(t.borderless);i&&!this.setPosition&&t.$topView&&(i=!(t.borderless=!0)),i&&this.defaults.borderless||t.borderless?t.Q={top:!0,left:!0,bottom:!0,right:!0}:(t.Q||(
t.Q={}),this.re.style.borderWidth="1px")},$getSize:function(t,i){var s=this.q.Q;return s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1)),Ui.api.$getSize.call(this,t,i)},$setSize:function(t,i){var s=this.q.Q;return s&&(t-=(s.left?0:1)+(s.right?0:1),i-=(s.top?0:1)+(s.bottom?0:1)),Ui.api.$setSize.call(this,t,i)}},Wi=H.protoUI(Yi,Ui.view),Gi={api:Yi,view:Wi};Wi.call(-1);var Xi=H.proto({template_setter:function(t){this.type.template=Ft(t)},Lt:function(t){var i=this.type;return(i.templateStart?i.templateStart(t,i):"")+i.template(t,i)+(i.templateEnd?i.templateEnd(t,i):"")},customize:function(t){Tt(this,t)}},_i),Ji={name:"tooltip",defaults:{dy:0,dx:20},$init:function(t){"string"==typeof t&&(t={template:t}),this.type=H.extend({},this.type),this.$view=this.nt=this.re=this.bt=Y("DIV",{role:"alert","aria-atomic":"true"}),this.re.className="webix_tooltip",X(this.re,document.body.firstChild,document.body),this.Ee=F("onClick",C(function(t){this.Le&&jt(t)!=this&&this.hide()},this)),this.attachEvent("onDestruct",function(){T(this.Ee)})},adjust:function(){},isVisible:function(){return!0},show:function(t,i){if(!this.Kt){if(this.data!=t&&(this.data=H.extend({},t),this.render(t)),this.bt.firstChild){var s=Math.max(document.documentElement.clientWidth,window.innerWidth||0),e=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=s-i.x,h=e-i.y;this.re.style.display="block",n-this.q.dx>this.re.offsetWidth?n=i.x:(n=i.x-2*this.q.dx-this.re.offsetWidth)<=0&&(n=0),h=h-this.q.dy>this.re.offsetHeight?i.y:i.y-this.q.dy-this.re.offsetHeight,this.re.style.left=n+this.q.dx+"px",this.re.style.top=h+this.q.dy+"px"}this.Le=!0}},hide:function(){this.data=null,this.re.style.display="none",this.Le=!1},disable:function(){this.Kt=!0},enable:function(){this.Kt=!1},type:{template:Ft("{obj.id}"),templateStart:Ft.empty,templateEnd:Ft.empty}},Ki=(H.protoUI(Ji,Xi,Hi,g,Gi.view),{tooltip_setter:function(t){if(t){"function"==typeof t&&(t={template:t}),"object"!==k(t)&&(t={});var r=!t.template,o=new Vt.tooltip(t);this.Oe();var i=this.attachEvent("onMouseMove",function(t,i){if(this.Ue=i.clientX,this.Ye=i.clientY,this.getColumnConfig){var e=o.type.column=this.getColumnConfig(t.column);if(r){if(!e.tooltip&&e.tooltip!=undefined)return;var s=i.target||i.srcElements;if(s.getAttribute("webix_area")&&e.tooltip){var n=s.getAttribute("webix_area");o.type.template=function(t,i){var s=t[i.column.id];return Ft(e.tooltip).call(this,t,i,s[n],n)}}else if(e.tooltip)o.type.template=e.tooltip=Ft(e.tooltip);else{var h=this.getText(t.row,t.column);o.type.template=function(){return h}}}}zi.active||o.show(this.getItem(t.row||t),Z(i))}),s=Ot(document.body,"mousemove",C(function(t){t=t||Ot,this.Ue==t.clientX&&this.Ye==t.clientY||o.hide()},this));return this.attachEvent("onDestruct",function(){this.config.tooltip&&this.config.tooltip.destructor()}),this.attachEvent("onAfterScroll",function(){o.hide()}),o.attachEvent("onDestruct",C(function(){this.detachEvent(i),Ut(s)},this)),o}}}),qi=H.proto({$init:function(t){this.We=[],this.Ge=D(t.series)?t.name:t.series,this.Xe=A(t.container||t);var i=t.width*(window.devicePixelRatio||1),s=t.height*(window.devicePixelRatio||1),e=t.style||"";e+=";width:"+t.width+"px;height:"+t.height+"px;",this.Je(t.name,e,i,s,t.title)},Je:function(t,i,s,e,n){return this.Ke=Y("canvas",{title:n,width:s,height:e,canvas_id:t,style:i||""}),this.Xe.appendChild(this.Ke),this.Ke.getContext||(S.isIE?(hi("legacy/excanvas/excanvas.js",!0),G_vmlCanvasManager.init_(document),G_vmlCanvasManager.initElement(this.Ke)):this.Ke.getContext),this.Ke},getCanvas:function(t){var i=(this.Ke||this.Je(this.re)).getContext(t||"2d");return this.qe||(this.qe=!0,i.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)),i},Ze:function(t,i){this.Ke&&(this.Ke.setAttribute("width",t*(window.devicePixelRatio||1)),this.Ke.setAttribute("height",i*(window.devicePixelRatio||1)),this.Ke.style.width=t+"px",this.Ke.style.height=i+"px",this.qe=!1)},renderText:function(t,i,s,e,n){if(s){n&&(n=Math.max(n,0)),i&&(i=Math.max(i,0));var h=Y("DIV",{"class":"webix_canvas_text"+(e?" "+e:""),
style:"left:"+t+"px; top:"+i+"px;","aria-hidden":"true"},s);return this.Xe.appendChild(h),this.We.push(h),n&&(h.style.width=n+"px"),h}},renderTextAt:function(t,i,s,e,n,h,r){var o=this.renderText.call(this,s,e,n,h,r);return o&&(t&&(o.style.top="middle"==t?parseInt(e-o.offsetHeight/2,10)+"px":e-o.offsetHeight+"px"),i&&(o.style.left="left"==i?s-o.offsetWidth+"px":parseInt(s-o.offsetWidth/2,10)+"px")),o},clearCanvas:function(t){var i=[];if(G(this.We),this.We=[],!t&&this.Xe.ne){for(i=this.Qe();i.length;)i[0].parentNode.removeChild(i[0]),i.splice(0,1);i=null,this.Xe.ne.getElementsByTagName("AREA").length||(this.Xe.ne.parentNode.removeChild(this.Xe.ne),this.Xe.ne=null)}this.getCanvas().clearRect(0,0,this.Ke.offsetWidth||Math.floor(this.Ke.width/(window.devicePixelRatio||1)),this.Ke.offsetHeight||Math.floor(this.Ke.height/(window.devicePixelRatio||1)))},toggleCanvas:function(){this.tn("none"==this.Ke.style.display)},showCanvas:function(){this.tn(!0)},hideCanvas:function(){this.tn(!1)},tn:function(t){var i,s;for(s=0;s<this.We.length;s++)this.We[s].style.display=t?"":"none";if(this.Xe.ne)for(i=this.Qe(),s=0;s<i.length;s++)t?i[s].removeAttribute("disabled"):i[s].setAttribute("disabled","true");this.Ke.style.display=t?"":"none"},Qe:function(){var t,i,s=[];for(t=this.Xe.ne.getElementsByTagName("AREA"),i=0;i<t.length;i++)t[i].getAttribute("userdata")==this.Ge&&s.push(t[i]);return s}}),Zi=function(t,i){var s=i;if(b(t))for(var e=0;e<t.length;e++){if(b(i)&&(s=i[e]),"slide"==s.type){if("out"==s.subtype&&0===e)continue;if("in"==s.subtype&&1==e)continue}if("flip"!=s.type)Zi(t[e],s);else{var n=f(s);0===e&&(n.type="flipback"),1==e&&(n.callback=null),Zi(t[e],n)}}else{var h=A(t);h["in"]?Zi.end(h,s):Zi.start(h,s)}};Zi.end=function(t,i){t.style[S.transitionDuration]="1ms",t["in"]=null,M.F&&window.clearTimeout(M.F),M.F=$(Zi,this,[t,i],10)},Zi.isSupported=function(){return!M.noanimate&&S.transform&&S.transition&&!S.isOpera},Zi.formLine=function(t,i,s){var e=s.direction;i.parentNode&&(i.parentNode.style.position="relative"),i.style.position="absolute",t.style.position="absolute";var n=S.isFF?"top"==e||"left"==e?-1:1:0;return"top"==e||"bottom"==e?(t.style.left="0px",t.style.top=(s.top||n)+("top"==e?1:-1)*i.offsetHeight+"px"):(t.style.top=(s.top||0)+"px",t.style.left=n+("left"==e?1:-1)*i.offsetWidth+"px"),i.parentNode==t.parentNode&&s.keepViews?t.style.display="":X(t,i.nextSibling,i.parentNode),"slide"==s.type&&"out"==s.subtype&&(t.style.left="0px",t.style.top=(s.top||0)+"px",i.parentNode.removeChild(i),X(i,t.nextSibling,t.parentNode)),[t,i]},Zi.breakLine=function(t){arguments[1]?t[1].style.display="none":G(t[1]),Zi.clear(t[0]),Zi.clear(t[1]),t[0].style.position=""},Zi.clear=function(t){t.style[S.transform]="none",t.style[S.transition]="none",t.style.top=t.style.left=""},Zi.defaults={type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0},Zi.start=function(e,t){"string"==typeof t&&(t={type:t}),t=Hi.ie(t,Zi.defaults);var i,s,n=S.cssPrefix,h=e["in"]=t;switch("slide"==h.type&&h.direction){case"right":h.x=e.offsetWidth;break;case"left":h.x=-e.offsetWidth;break;case"top":h.y=-e.offsetHeight;break;case"bottom":default:h.y=h.y||e.offsetHeight}"flip"!=h.type&&"flipback"!=h.type||(i=[0,0],s="scaleX","vertical"==h.subtype?(i[0]=20,s="scaleY"):i[1]=20,"right"!=h.direction&&"bottom"!=h.direction||(i[0]*=-1,i[1]*=-1));var r=h.duration+"ms "+h.timing+" "+h.delay+"ms",o=n+"TransformStyle: preserve-3d;",a="",u="";switch(h.type){case"fade":a="opacity "+r,o="opacity: 0;";break;case"show":a="opacity "+r,o="opacity: 1;";break;case"flip":r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",u="skew("+i[0]+"deg, "+i[1]+"deg) "+s+"(0.00001)",a="all "+r;break;case"flipback":h.delay+=h.duration/2,r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",e.style[S.transform]="skew("+-1*i[0]+"deg, "+-1*i[1]+"deg) "+s+"(0.00001)",e.style.left="0",u="skew(0deg, 0deg) "+s+"(1)",a="all "+r;break;case"slide":var c=h.x+"px",f=h.y+"px";u=S.translate+"("+c+", "+f+("translate3d"==S.translate?", 0":"")+")",a=n+"transform "+r}$(function(){e.style[S.transition]=a,$(function(){o&&(
e.style.cssText+=o),u&&(e.style[S.transform]=u);var i=!1,s=Ot(e,S.transitionEnd,function(t){e["in"]=null,h.callback&&h.callback.call(h.master||window,e,h,t),i=!0,Ut(s)});window.setTimeout(function(){i||(e["in"]=null,h.callback&&h.callback.call(h.master||window,e,h),i=!0,Ut(s))},1.3*(1*h.duration+1*h.delay))})})};var Qi,ts,is={topLayout:"space",barHeight:44,tabbarHeight:42,sidebarTitleHeight:44,rowHeight:36,toolbarHeight:44,listItemHeight:36,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:36,labelTopHeight:22,propertyItemHeight:28,unitHeaderHeight:36,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:2},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:2,form:17,accordion:0},tabMargin:0,tabOffset:0,tabBottomOffset:0,tabTopOffset:0,tabBorder:!0,customCheckbox:!0,customRadio:!0,sidebarMarkAll:!0,popupNoPoint:!0,borderlessPopup:!0,popupPadding:0,calendar:{timepickerHeight:24},calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:32,organogramLineColor:"#CCD7E6"},ss={topLayout:"space",barHeight:36,tabbarHeight:34,sidebarTitleHeight:36,rowHeight:28,toolbarHeight:36,listItemHeight:28,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,propertyItemHeight:24,unitHeaderHeight:28,inputSpacing:4,borderWidth:1,sliderHandleWidth:12,sliderPadding:10,sliderBorder:1,vSliderPadding:13,vSliderHeight:100,switchHeight:20,switchWidth:40,layoutMargin:{space:5,wide:5,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:2},layoutPadding:{space:5,wide:0,clean:0,head:0,line:0,toolbar:2,form:12,accordion:0},tabMargin:0,tabOffset:0,tabBottomOffset:0,tabTopOffset:0,tabBorder:!0,customCheckbox:!0,customRadio:!0,sidebarMarkAll:!0,popupNoPoint:!0,borderlessPopup:!0,popupPadding:0,calendar:{timepickerHeight:24},calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:24,organogramLineColor:"#CCD7E6"},es={topLayout:"space",barHeight:46,tabbarHeight:46,rowHeight:34,toolbarHeight:46,sidebarTitleHeight:45,listItemHeight:34,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:34,labelTopHeight:22,unitHeaderHeight:20,propertyItemHeight:28,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:10},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:4,form:17,accordion:0},tabMargin:4,tabOffset:0,tabBottomOffset:6,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:32},ns={topLayout:"space",barHeight:34,tabbarHeight:34,sidebarTitleHeight:34,rowHeight:24,toolbarHeight:34,listItemHeight:28,unitHeaderHeight:20,propertyItemHeight:24,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,inputSpacing:4,borderWidth:1,sliderHandleWidth:12,sliderPadding:10,sliderBorder:1,vSliderPadding:13,vSliderHeight:100,switchHeight:20,switchWidth:40,layoutMargin:{space:5,wide:5,clean:0,head:4,line:-1,toolbar:4,form:4,accordion:5},layoutPadding:{space:5,wide:0,clean:0,head:0,line:0,toolbar:2,form:12,accordion:0},tabMargin:3,tabOffset:0,tabBottomOffset:3,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:23},hs={topLayout:"space",barHeight:46,tabbarHeight:46,rowHeight:34,toolbarHeight:46,sidebarTitleHeight:45,listItemHeight:34,unitHeaderHeight:20,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:34,labelTopHeight:22,propertyItemHeight:28,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:8,form:8,accordion:10},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:4,form:17,accordion:0},tabMargin:4,tabOffset:0,
tabBottomOffset:6,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:32},rs={material:is,mini:ss,flat:es,compact:ns,contrast:hs};function os(t){if(rs[t],ts!==t)for(var i in Qi=rs[t],ts=t,Vt){var s=Vt[i];s&&s.prototype&&s.prototype.$skin&&s.prototype.$skin(s.prototype)}}os(window.webix_skin||"material");var as={move_setter:function(t){return t&&(this.sn=f(this.sn),this.sn.master=this,zi.addDrag(this.en?this.en:this.$view,this.sn)),t},sn:{$dragCreate:function(t,i){if(this.master.config.move){var s=K(t),e=Z(i);return zi.top=s.y-e.y,zi.left=s.x-e.x,A(this.master.nt)}},$dragDestroy:function(t,i){var s=this.master;s.q&&(s.q.top=parseInt(i.style.top,10),s.q.left=parseInt(i.style.left,10)),zi.top=zi.left=5,this.master.callEvent("onViewMoveEnd",[])},$dragPos:function(t,i){this.master.callEvent("onViewMove",[t,i])}}},us={nn:function(t){if(t){if(!this.hn){this.hn=Y("div",{"class":"webix_modal"});var i=this.q.zIndex||Ti();this.rn=M.I,M.I=i,this.hn.style.zIndex=i-1,this.nt.style.zIndex=i,document.body.appendChild(this.hn),document.body.style.overflow="hidden",Lt(this.hn,"click",C(this.an,this))}}else if(this.hn){G(this.hn),document.body.style.overflow="";var s=this.rn;setTimeout(function(){M.I=s},1),this.hn=null}return t}},cs={resize_setter:function(t){return t&&!this.un&&this.cn(),t},cn:function(){if(!this.ln){var t=this.nt;t.firstChild&&((t=t.firstChild).style.position="relative"),this.ln=Y("DIV",{"class":"webix_resize_handle",webix_disable_drag:"true"}),t.appendChild(this.ln),Lt(this.ln,S.mouse.down,this.dn,{bind:this})}},vn:function(t,i){if(!this._n){this._n=Y("div",{"class":"webix_resize_frame"},""),document.body.appendChild(this._n);var s=K(this.nt);this._n.style.left=s.x+"px",this._n.style.top=s.y+"px",this._n.style.zIndex=Ti()}this._n.style.width=t+"px",this._n.style.height=i+"px"},dn:function(){this.config.resize&&(st(document.body,"webix_noselect webix_resize_cursor"),this.pn=K(this.nt),this.mn=Ot(document.body,S.mouse.move,this.bn,{bind:this}),this.gn=Ot(document.body,S.mouse.up,this.wn,{bind:this}))},bn:function(t){if(!1!==this.pn){var i=Z(t),s={x:i.x-this.pn.x+10,y:i.y-this.pn.y+10};if(this.$resizeMove)this.$resizeMove(s);else if(Math.abs(this.pn.x-i.x)<(this.config.minWidth||100)||Math.abs(this.pn.y-i.y)<(this.config.minHeight||100))return;this.xn=s,this.vn(s.x,s.y)}},wn:function(){this._n&&(this._n=G(this._n)),et(document.body,"webix_resize_cursor"),et(document.body,"webix_noselect"),Ut(this.mn),Ut(this.gn),this.xn&&(this.$resizeEnd?this.$resizeEnd(this.xn):(this.config.width=this.xn.x,this.config.height=this.xn.y,this.resize())),this.pn=this.xn=!1,this.callEvent("onViewResize",[])}};M.oe=p();var fs={name:"window",$init:function(t){this.nt.innerHTML="<div class='webix_win_content'><div class='webix_win_head'></div><div class='webix_win_body'></div></div>",this.re=this.nt.firstChild,this.en=this.re.childNodes[0],this.bt=this.yn=this.re.childNodes[1],this.nt.className+=" webix_window",this.nt.setAttribute("role","dialog"),this.nt.setAttribute("tabindex","0"),this.Mn=this.Z=null,this.q.Q={top:!1,left:!1,right:!1,bottom:!1},t.id||(t.id=z()),Lt(this.re,"click",C(this.an,this)),this.re.addEventListener&&Lt(this.re,"click",function(){!this.q.zIndex&&this.q.toFront&&(this.nt.style.zIndex=Ti())},{bind:this,capture:!0}),t.modal&&(this.Sn=!0),this.attachEvent("onViewMoveEnd",function(){this.q.position&&delete this.q.position})},an:function(t){var i=M.oe,s=i.find(this);-1==s&&(s=i.length-1),t.click_view=s,S.isIE8&&(t.srcElement.click_view=s)},getChildViews:function(){return this.Mn?[this.Mn,this.Z]:[this.Z]},zIndex_setter:function(t){return this.nt.style.zIndex=t},et:function(){this.Z={destructor:function(){}}},st:function(t){this.Z.destructor(),this.Z=t,this.yn.appendChild(this.Z.nt);var i=this.Z.nt.style;i.borderTopWidth=i.borderBottomWidth=i.borderLeftWidth=i.borderRightWidth="1px",this.Z.q.Q=f(this.q.Q),this.resize(!0)},show:function(t,i,s){if(!0===t){if(!this.q.hidden)return;t=null}if(!this.callEvent("onBeforeShow",arguments))return!1;var e,n,h;if(
this.q.hidden=!1,this.nt.style.zIndex=this.q.zIndex||Ti(),(this.q.modal||this.Sn)&&(this.nn(!0),this.Sn=null),(i=i||{}).pos||(i.pos=this.q.relative),t){"object"!=k(t)||t.tagName?e=K(t=A(t)):t.target||t.srcElement?(e=Z(t),n=20,h=5):e=t;var r=Math.max(window.innerWidth||0,document.body.offsetWidth),o=Math.max(window.innerHeight||0,document.body.offsetHeight);n=n||t.offsetWidth||0,h=h||t.offsetHeight||0;var a=this.Te,u=e.x,c=e.y,f=0,l=0,d=0,v=0,_=this.q.autofit;if(_){var p="node"===_,m=6,b=6,g=6;this.q.point||(m=b=g=0),s="top",u=c=0,d=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,r-e.x-n<a[0]&&"right"==i.pos&&!p&&(i.pos="left"),l="right"==i.pos?(u=e.x+m+n,b=-h,s="left",f=Math.round(e.y+h/2),u-g):"left"==i.pos?(u=e.x-m-a[0]-1,b=-h,s="right",f=Math.round(e.y+h/2),u+a[0]+1):(u=e.x<d?d:r+d-e.x>a[0]?e.x:r+d-m-a[0],l=Math.round(e.x+n/2),Math.min(l,u+a[0]-3*g)),v=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,(!a[1]||o+v-h-e.y-b>a[1]||p)&&"top"!=i.pos?(c=h+e.y+b-(this.q.point?4:0),f||(s="top",f=c-g)):(c=e.y-b-a[1])<0?(c=0,"top"==s&&(s=!1)):f||(s="bottom",f=--c+a[1]+1)}var w=i.x||0,x=i.y||0,y=this.kn();y&&(c-=v,f-=v),this.setPosition(u+w,c+x),this.Cn&&(s&&this.q.point?this.Cn(s,l+w,f+x,y):this.Dn())}else this.$n(this.q.left,this.q.top);this.nt.style.display="block",this.An=1,$(function(){this.An=0},this,[],S.touch?400:100),this.Pe(),this.config.autofocus&&(this.In=Vi.getFocus(),Vi.setFocus(this)),-1==M.oe.find(this)&&M.oe.push(this),this.callEvent("onShow",[])},Zs:function(t){if(!(this.q.hidden||this.q.modal||this.An||t&&t.showpopup||M.I&&this.q.zIndex<=M.I)){if(t){var i=S.isIE8?t.srcElement.click_view:t.click_view;if(i||0===i||(i=-1),M.oe.find(this)<=i)return}this.hide()}},hidden_setter:function(t){return t?this.hide():this.show(),!!t},hide:function(t){if(!this.$destructed&&(t||!this.q.hidden)){if(this.q.modal&&this.nn(!1),"top"==this.q.position?Zi(this.nt,{type:"slide",x:0,y:-(this.He+20),duration:300,callback:this.Fn,master:this}):this.Fn(),this.q.autofocus){var i=document.activeElement;i&&this.nt&&(this.nt.contains(i)||i===document.body)&&(Vi.setFocus(this.In),this.In=null)}this.Tn()}},Tn:function(){var t=M.oe,i=t.find(this),s=t.length-1;if(-1<i)for(var e=s;i<e;e--)t[e].Dn&&t[e].hide();t.removeAt(i)},destructor:function(){this.nn(!1),G(this.nt),this.q.autofocus&&(M.k||Vi.setFocus(this.In),this.In=null),this.Tn(),this.Dn&&this.Dn(),Bi.destructor.apply(this,[])},Fn:function(){this.$destructed||(this.nt.style.display="none",this.q.hidden=!0,this.callEvent("onHide",[]))},close:function(){this.destructor()},zn:function(t){"undefined"==typeof t.borderless&&(t.borderless=!0)},body_setter:function(t){return"object"!=k(t)&&(t={template:t}),this.zn(t),(M._=this).Z=Vt.ot(t),this.yn.appendChild(this.Z.nt),t},head_setter:function(t){return!1===t||("object"!=k(t)&&(this.nt.setAttribute("aria-label",t),t={template:t,padding:0}),t.borderless=!0,(M._=this).Mn=Vt.ot(t),this.en.appendChild(this.Mn.nt)),t},getBody:function(){return this.Z},getHead:function(){return this.Mn},adjust:function(){return this.resize()},resizeChildren:function(){this.Z&&this.resize()},resize:function(){Ui.api.adjust.call(this),this.isVisible()&&this.$n(this.q.left,this.q.top)},kn:function(){if(this.q.master){var t=jt(this.q.master).getTopParentView().$view;return t&&"fixed"===t.style.position}return!1},$n:function(t,i){if(this.q.position||this.kn()){this.$view.style.position="fixed";var s=this.ze,e=this.He;if(s<=0||e<=0)return;var n=window.innerWidth||document.documentElement.offsetWidth,h=window.innerHeight||document.documentElement.offsetHeight,r=Math.round((n-s)/2),o=Math.round((h-e)/2);if("function"==typeof this.q.position){var a={left:r,top:o,width:s,height:e,maxWidth:n,maxHeight:h};this.q.position.call(this,a),a.width==s&&a.height==e||this.$setSize(a.width,a.height),this.setPosition(a.left,a.top)}else"top"==this.q.position&&(o=Zi.isSupported()?-1*e:10),this.q.position||(r=this.q.left||r,o=this.q.top||o),this.setPosition(r,o);"top"==this.q.position&&Zi(this.nt,{type:"slide",x:0,y:e-2*(
this.q.padding||0),duration:300,callback:this.Vn,master:this})}else this.setPosition(t,i)},Vn:function(t){Zi.clear(t),this.q.top=-2*(this.q.padding||0),this.setPosition(this.q.left,this.q.top)},setPosition:function(t,i){this.nt.style.top=i+"px",this.nt.style.left=t+"px",this.q.left=t,this.q.top=i},$getSize:function(t,i){var s=this.q.Q;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1)),this.q.head&&(i+=1);var e=this.Z.$getSize(0,0),n=0;if(this.Mn){var h=this.Mn.$getSize(0,0);h[3]==h[2]&&(this.q.headHeight=h[3]),i+=this.q.headHeight,n=h[0]}if(this.q.fullscreen){var r=window.innerWidth||document.body.clientWidth,o=window.innerHeight||document.body.clientHeight;return[r,r,o,o]}var a=Gi.api.$getSize.call(this,0,0);return n&&1e5<e[1]&&(e[0]=Math.max(n,e[0])),a[1]=Math.min(a[1],(1e5<=e[1]&&1e5<=a[1]?Math.max(e[0],a[0]):e[1])+t),a[3]=Math.min(a[3],(1e5<=e[3]&&1e5<=a[3]?Math.max(e[2],a[2]):e[3])+i),a[0]=Math.min(Math.max(a[0],e[0]+t),a[1]),a[2]=Math.min(Math.max(a[2],e[2]+i),a[3]),a},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i),t=this.ze,i=this.He,!1===this.q.head?(this.en.style.display="none",this.Z.$setSize(t,i)):(this.Mn.$setSize(t,this.q.headHeight),this.Z.$setSize(t,i-this.q.headHeight))},$skin:function(){this.defaults.headHeight=Qi.barHeight},defaults:{top:0,left:0,autofit:!0,relative:"bottom",body:"",head:"",hidden:!0,autofocus:!0,minWidth:300,minHeight:200}},ls={api:fs,view:H.protoUI(fs,Gi.view,as,us,g,cs)},ds={defaults:{padding:"4",hidden:!0},body_setter:function(t){return t=ls.api.body_setter.call(this,t),this.Z.nt.style.borderWidth="0px",t},attachTo:function(t){var i;i=t.on_context?t.attachEvent("onAfterContextMenu",C(this.Hn,this)):Ot(t,"contextmenu",this.Bn,{bind:this}),this.attachEvent("onDestruct",function(){t.callEvent?t.detachEvent(i):Ut(i),t=null})},getContext:function(){return this.Rn},setContext:function(t){this.Rn=t},Bn:function(t){return this.Rn=A(t||Ot),this.Pn(t)},Hn:function(t,i){return this.Rn={obj:jt(i),id:t},this.Pn(i)},Pn:function(t){var i=this.show(t,null,!0);return!1===i?i:(I("onClick",[]),Q(t))},jn:!0,master_setter:function(t){return this.attachTo(t),null}},vs={Rn:null,Nn:null,En:0,init:function(){return null!==this.Rn||(M.destructors.push({obj:this}),this.Rn=document.createElement("textarea"),this.Rn.className="webix_clipbuffer",this.Rn.setAttribute("webixignore",1),this.Rn.setAttribute("spellcheck","false"),this.Rn.setAttribute("autocapitalize","off"),this.Rn.setAttribute("autocorrect","off"),this.Rn.setAttribute("autocomplete","off"),document.body.appendChild(this.Rn),Ot(document.body,"keydown",C(function(t){var i=t.keyCode,s=!(!t.ctrlKey&&!t.metaKey);86===i&&s&&(this.Rn.value="",$(this.Ln,this,[t],100))},this))),this.Rn},destructor:function(){this.Rn=null},set:function(t){this.init(),t=""===t?"\n":t,this.Rn.value=t,this.focus()},focus:function(){this.On()||(this.init(),this.Rn.focus(),this.Rn.select())},On:function(){var t="";return"undefined"!=typeof window.getSelection?t=window.getSelection().toString():"undefined"!=typeof document.selection&&"Text"==document.selection.type&&(t=document.selection.createRange().text),!!t},Ln:function(t){if((t.target||t.srcElement)===this.Rn){var i=this.Rn.value,s=Vi.getFocus();!s||s.getEditor&&s.getEditor()||(s.callEvent("onPaste",[i]),this.Rn.select())}}},_s={clipboard_setter:function(t){return!0!==t&&1!==t||(t="modify"),this.attachEvent("onAfterSelect",function(t){var i=this.getItem(t),s=this.type.templateCopy(i);vs.set(s,this),vs.focus(),Vi.setFocus(this)}),this.attachEvent("onPaste",function(t){D(this.Ln[this.q.clipboard])||this.Ln[this.q.clipboard].call(this,t)}),this.attachEvent("onFocus",function(){vs.focus()}),this.attachEvent("onItemClick",function(t){this.Un&&-1===this.Un.find(t)||(vs.focus(),Vi.setFocus(this))}),t},Ln:{insert:function(t){this.add({value:t})},modify:function(t){for(var i=this.getSelectedId(!0),s=0;s<i.length;s++)this.getItem(i[s]).value=t,this.refresh(i[s])},custom:function(){}},templateCopy_setter:function(t){this.type.templateCopy=Ft(t)},type:{templateCopy:function(t){return this.template(t)}}},ps={
$customPrint:function(t,i){if(this.Yn(t,i))return!0;var s=this.Wn(t),e=this.Gn(s,t);if(i)return e;var n=Y("div",{"class":"webix_ui_print"});n.appendChild(e),X(n,t.docFooter,document.body),window.print(),G(n)},Yn:function(t,i){if(!i&&("y"==this.config.layout||t.scroll||this.config.prerender||this.config.autoheight))return!0;"x"==this.config.layout&&H.extend(t||{},{xCount:this.count(),nobreaks:!0},!0)},Xn:function(t){if("page"==t.fit)return Infinity;var i=t.size["portrait"==t.mode?"width":"height"];return Math.min(i*S.printPPI-2*S.printMargin)},Wn:function(t,i,s){var e,n,h=this.Xn(t),r=t.xCount||this.Kn().Jn,o=[],a=[],u=0;s=s||0,i=i||[];for(var c=0;c<this.data.order.length;){var f=this.data.pull[this.data.order[c]];if(n=c-parseInt(c/r)*r,f&&s<=n){if(h<(u+=this.type.width)&&s<n){e=a.length+s,o.push(a),c+=r-a.length,a=[],u=0;continue}var l=this.type.template(f,this.type),d=this.qn,v={display:"table-cell",height:this.type.height+"px",width:this.type.width+"px"};a.push({txt:l,className:d+" "+(f.$css||""),style:v}),(c+1)%r==0&&(o.push(a),a=[],u=0)}c++}return i.push(o),e&&this.Wn(t,i,e),i},Gn:function(n,h){var r=Y("div");return n.forEach(C(function(t,i){var s=Y("table",{"class":"webix_table_print "+this.$view.className,style:"border-collapse:collapse"});if(t.forEach(function(t){var e=Y("tr");t.forEach(function(i){var s=Y("td");(i.txt&&(s.innerHTML=i.txt),i.className&&(s.className=i.className),i.style)&&Object.keys(i.style).forEach(function(t){i.style[t]&&(s.style[t]=i.style[t])});i.span&&(1<i.span.colspan&&(s.colSpan=i.span.colspan),1<i.span.rowspan&&(s.rowSpan=i.span.rowspan)),e.appendChild(s)}),s.appendChild(e)}),r.appendChild(s),!h.nobreaks&&i+1<n.length){var e=Y("DIV",{"class":"webix_print_pagebreak"});r.appendChild(e)}},this)),r}},ms={scrollStep:40,init:function(){this.Zn(),S.$customScroll=!0,S.scrollSize=0,M.destructors.push({obj:{destructor:function(){this.Qn=null}}}),F("onReconstruct",ms.th),F("onResize",ms.th),F("onClick",ms.th)},resize:function(){this.th()},ih:function(t){t.Yt.sh=t.q.id,t.attachEvent("onAfterRender",function(){var t=ms.eh(this),i=Math.max(t.dy-t.py,0),s=Math.max(t.dx-t.px,0);this.nh&&this.hh>i?this.nh.scrollTo(i):this.rh&&this.oh>s&&this.rh.scrollTo(s),ms.Qn==this.Yt&&ms.th()}),Lt(t.Yt,"mouseover",ms.ah),Lt(t.Yt,"mouseout",ms.uh)},enable:function(t,i){if(ms.Zn(),t.mapCells)return this.ih(t);var s=t;t.bt&&(s=t.bt.parentNode),s.ch=i||"xy",Lt(s,"mouseover",ms.ah),Lt(s,"mouseout",ms.uh),Lt(s,"mousewheel",ms.fh,{passive:!1}),Lt(s,"DOMMouseScroll",ms.fh,{passive:!1}),this.lh(t)},th:function(){var t=ms.Qn;t&&t.dh&&(ms.vh.call(t),ms.ah.call(t))},Zn:function(){Ot(document.body,"mousemove",function(t){ms._h&&ms.ph(ms._h,ms._h.mh,Z(t))}),ms.Zn=function(){}},ah:function(t){if(ms.Qn=this,clearTimeout(this.bh),!this.dh&&!ms._h){var i=jt(t);if(!i||i.isEnabled()){var s;if(this.sh){if(!(i=jt(this.sh)))return;s=ms.eh(i)}else(s={dx:this.scrollWidth,dy:this.scrollHeight,px:this.clientWidth,py:this.clientHeight}).Be=s.dx>s.px&&-1!=this.ch.indexOf("x"),s.Ve=s.dy>s.py&&-1!=this.ch.indexOf("y");(this.dh=s).Be&&(s.gh=ms.Ni(this,"x",s.dx,s.px,"width","height"),s.wh=s.px-s.gh.offsetWidth-4,s.xh=s.dx-s.px,ms.trackBar&&(s.yh=ms.Mh(this,"x"))),s.Ve&&(s.Sh=ms.Ni(this,"y",s.dy,s.py,"height","width"),s.kh=s.py-s.Sh.offsetHeight-4,s.Ch=s.dy-s.py,ms.trackBar&&(s.Dh=ms.Mh(this,"y"))),ms.$h(this)}}},Mh:function(t,i){var s=Y("DIV",{webixignore:"1","class":"webix_c_scroll_bar_"+i},"");return t.appendChild(s),s},ph:function(t,i,s){var e=t.dh,n=t.sh;if(n&&(n=jt(n)),e.gh==t.Ah){var h=(s.x-i.x)*e.xh/e.wh;n?n.rh.scrollTo(n.oh+h):ms.Ih(t,"scrollLeft",h)}if(e.Sh==t.Ah){var r=(s.y-i.y)*e.Ch/e.kh;n?n.nh.scrollTo(n.hh+r):ms.Ih(t,"scrollTop",r)}t.mh=s,ms.$h(t)},eh:function(t){var i={};return t.rh&&t.q.scrollX&&(i.dx=t.rh.getSize(),i.px=t.rh.Fh||1,i.Be=1<i.dx-i.px),t.nh&&t.q.scrollY&&(i.dy=t.nh.getSize(),i.py=t.nh.Fh||1,i.Ve=1<i.dy-i.py),i},uh:function(){clearTimeout(this.bh),this.bh=$(ms.vh,this,[],200)},Th:function(t){t&&(G(t),t.zh&&(Ut(t.zh),Ut(t.Vh),Ut(t.Hh)))},vh:function(){if(this.dh){if(this.Ah)return void(this.Bh=!0);var t=this.dh;ms.Th(t.gh),
ms.Th(t.Sh),et(document.body,"webix_noselect"),t.yh&&G(t.yh),t.Dh&&G(t.Dh),this.dh=null}},fh:function(t){var i=this.dh,s=t.wheelDelta/-40,e=!0;if(!s&&t.detail&&D(t.wheelDelta)&&(s=t.detail),i)if(i.gh&&(t.wheelDeltaX||s&&!i.Sh)){var n=t.wheelDeltaX/-40||s;e=ms.Ih(this,"scrollLeft",n*ms.scrollStep)}else s&&i.Sh&&(e=ms.Ih(this,"scrollTop",s*ms.scrollStep));if(ms.$h(this),!1!==e)return Q(t)},Ih:function(t,i,s){var e=t.dh,n="scrollLeft"==i?e.dx-e.px:e.dy-e.py,h=t[i];return n<h+s&&(s=n-h),!(!s||h+s<0&&0===h)&&(S.isIE&&ms.$h(t,i,s+h),t[i]+=s,!0)},Ni:function(t,i,s,e,n){var h=Y("DIV",{webixignore:"1","class":"webix_c_scroll_"+i},"<div></div>");return h.style[n]=Math.max(e*e/s-7,40)+"px",t.style.position="relative",t.appendChild(h),t.zh=Ot(h,"mousedown",ms.Rh(t)),t.Vh=Ot(document.body,"mouseup",C(ms.Ph,t)),t.Hh=Ot(document.body,"mouseleave",C(ms.Ph,t)),h},Rh:function(i){return function(t){st(document.body,"webix_noselect",1),this.className+=" webix_scroll_active",(ms._h=i).Ah=this,i.mh=Z(t)}},Ph:function(){this.Ah&&(et(document.body,"webix_noselect"),this.Ah.className=this.Ah.className.toString().replace(" webix_scroll_active",""),this.Ah=!1,ms._h=0,this.Bh&&(ms.vh.call(this),this.Bh=!1))},$h:function(t,i,s){var e=t.dh;if(e&&(e.gh||e.Sh)){var n=t.sh,h="scrollLeft"==i?s:t.scrollLeft,r=n?jt(n).oh:h,o=n?0:r,a="scrollTop"==i?s:t.scrollTop,u=n?jt(n).hh:a,c=n?0:u;e.gh&&(e.gh.style.bottom=1-c+"px",e.gh.style.left=Math.round(e.wh*r/(e.dx-e.px))+o+1+"px",e.yh&&(e.yh.style.bottom=1-c+"px",e.yh.style.left=o+"px")),e.Sh&&(e.Sh.style.right=0-o+"px",e.Sh.style.top=Math.round(e.kh*u/(e.dy-e.py))+c+1+"px",e.Dh&&(e.Dh.style.right=0-o+"px",e.Dh.style.top=c+"px"))}},lh:function(i){i.data&&i.data.attachEvent&&i.data.attachEvent("onStoreUpdated",function(){var t=ms.Qn;t&&i.$view.contains(t)&&ms.resize()})}},bs={addCss:function(t,i,s){if(!this.addRowCss&&!s&&!this.hasCss(t,i)){var e=this.getItemNode(t);e&&(e.className+=" "+i,s=!0)}return this.data.addMark(t,i,1,1,s)},removeCss:function(t,i,s){if(!this.addRowCss&&!s&&this.hasCss(t,i)){var e=this.getItemNode(t);e&&(e.className=e.className.replace(i,"").replace("  "," "),s=!0)}return this.data.removeMark(t,i,1,s)},hasCss:function(t,i){return this.data.getMark(t,i)},clearCss:function(t,i){return this.data.clearMark(t,1,i)}},gs={copy:function(t,i,s,e){var n=(e=e||{}).newId||t;s=s||this;var h=this.getItem(t);return s&&(h=s.jh(h)),s.data.add(s.jh(h,n),i,e.parent||0)},Nh:function(t,i,s){if(i&&t){var e=this.getIndexById(t);return e+(s==this&&s.getIndexById(i)<e?0:1)}},move:function(t,i,s,e){var n=(e=e||{}).newId||t;if((s=s||this).data,s.data){if(b(t)){3<t.length&&(this.$blockRender=s.$blockRender=!0);for(var h=0;h<t.length;h++){var r=this.move(t[h],i,s,e);i=s.Nh(r,t[h+1],this)}return this.$blockRender=s.$blockRender=!1,void(3<t.length&&(this.refresh(),s!=this&&s.refresh()))}var o=t,a=this.getItem(t);return s&&s!=this?(o=s.data.add(s.jh(a,n),i,e.parent||0),this.data.remove(t)):(i<0&&(i=this.data.order.length-1),this.data.move(this.getIndexById(t),i),this.data.callEvent("onDataMove",[t,i,null,this.data.order[i+1]])),o}},moveUp:function(t,i){return this.move(t,this.getIndexById(t)-(i||1))},moveDown:function(t,i){return this.moveUp(t,-1*(i||1))},moveTop:function(t){return this.move(t,0)},moveBottom:function(t){return this.move(t,this.data.count()-1)},jh:function(t,i){var s=H.extend({},t);return s.id=!i||this.data.pull[i]?z():i,s.$template=null,this.q.externalData&&(s=this.q.externalData.call(this,s,i,t)),s}},ws={isEmail:function(t){return/\S+@[^@\s]+\.[^@\s]+$/.test((t||"").toString())},isNumber:function(t){return parseFloat(t)==t},isChecked:function(t){return!!t||"0"===t},isNotEmpty:function(t){return 0===t||t}},xs={$init:function(){this.D&&this.attachEvent("onChange",this.clearValidation)},clearValidation:function(){if(this.elements)for(var t in this.elements)this.Eh(t)},validate:function(t,i){this.callEvent,this.callEvent("onBeforeValidate",[]);var s=this.Lh={},e=!0,n=this.q.rules,h=this.isVisible&&!this.isVisible(),r=t&&t.hidden,o=t&&t.disabled,a={},u={};for(var c in this.elements){
var f=this.elements[c].config.name;(h||this.elements[c].isVisible()||r)&&(this.elements[c].isEnabled()||o)?a[f]=this.elements[c]:u[f]=!0}if((n||a)&&!i&&this.getValues&&(i=this.getValues()),n){n.$obj&&(e=this.Oh(n.$obj,i,i,"")&&e);var l=n.$all,d=i;if(this.q.complexData&&(d=yt.collapseNames(i)),l)for(var v in i)if(!u[v]){var _=this.Oh(l,d[v],i,v);_||(s[v]=!0),e=_&&e}for(var p in n)if(!u[p]&&0!==p.indexOf("$")&&!s[p]){n[p];var m=this.Oh(n[p],d[p],i,p);m||(s[p]=!0),e=m&&e}}if(a)for(var b in a)if(!s[b]){var g=a[b];if(g.validate){var w=g.validate();e=w&&e,w||(s[b]=!0)}else{var x=g.q;if(x){var y=x.validate;if(!y&&x.required&&(y=n.isNotEmpty),y){var M=this.Oh(y,i[b],i,b);M||(s[b]=!0),e=M&&e}}}}return this.callEvent("onAfterValidation",[e,this.Lh]),e},Oh:function(t,i,s,e){return"string"==typeof t&&(t=ws[t]),t.call(this,i,s,e)?(this.callEvent("onValidationSuccess",[e,s])&&this.Eh&&this.Eh(e),!0):(this.callEvent("onValidationError",[e,s])&&this.Uh&&this.Uh(e),!1)}},ys={};function Ms(t,i){if("object"==k(t)&&t.q&&(t=t.q.id),ys[t]||i)return ys[t];"string"!=typeof t&&"number"!=typeof t||(t={master:jt(t)});var s=new Ss(t),e=s.q.master.q.id;return ys[e]=s,jt(e).attachEvent("onDestruct",function(){ys[this.q.id]=null,delete ys[this.q.id]}),s}u("dp",Ms),Ms.$$=function(t){return ys[t]};var Ss=H.proto({defaults:{autoupdate:!0,updateFromResponse:!1,mode:"post",operationName:"webix_operation",trackMove:!1},$init:function(){this.reset(),this.Yh=!1,this.name="DataProcessor",this.$ready.push(this.Wh)},reset:function(){this.Gh=[]},url_setter:function(t){var i="";if("string"==typeof t){var s=t.split("->");1<s.length&&(t=s[1],i=s[0])}else t&&t.mode&&(i=t.mode,t=t.url);return i?di(i,t):t},master_setter:function(t){var i=t;return"DataStore"!=t.name&&(i=t.data),this.q.store=i,t},Wh:function(){this.q.store,this.q.store.attachEvent("onStoreUpdated",C(this.Xh,this)),this.q.store.attachEvent("onDataMove",C(this.Jh,this))},ignore:function(t,i){var s=this.Yh;this.Yh=!0,t.call(i||this),this.Yh=s},off:function(){this.Yh=!0},on:function(){this.Yh=!1},Kh:function(t){var i={};for(var s in t)0!==s.indexOf("$")&&(i[s]=t[s]);return i},save:function(t,i,s){i=i||"update",this.qh(t,s||this.q.store.getItem(t),i)},qh:function(t,i,s){if("object"==k(t)&&(t=t.toString()),!t||!0===this.Yh||!s||"paint"==s)return!0;var e=this.q.store;e&&e.Zh&&(i=e.Zh(i));var n={id:t,data:this.Kh(i),operation:s};if(D(i.$parent)||(n.data.parent=i.$parent),"delete"!=n.operation){var h=this.q.master;h&&h.data&&h.data.getMark&&h.data.getMark(t,"webix_invalid")&&(n.Qh=!0),this.validate(null,n.data)||(n.Qh=!0)}return this.ir(n)&&this.Gh.push(n),this.q.autoupdate&&this.send(),!0},Jh:function(t,i,s,e){if(this.q.trackMove){var n=B(this.q.store.getItem(t));n.webix_move_index=i,n.webix_move_id=e,n.webix_move_parent=s,this.qh(t,n,"order")}},Xh:function(t,i,s){switch(s){case"save":case"update":s="update";break;case"add":s="insert";break;case"delete":s="delete";break;default:return!0}return this.qh(t,i,s)},ir:function(t){for(var i=0;i<this.Gh.length;i++){var s=this.Gh[i];if(s.id==t.id&&!s.sr)return"delete"==t.operation&&("insert"==s.operation?this.Gh.splice(i,1):s.operation="delete"),s.data=t.data,s.Qh=t.Qh,!1}return!0},send:function(){this.nr()},nr:function(){if(this.q.url){for(var t=this.Gh,i=[],s=this.q.url,e=0;e<t.length;e++){var n=t[e];if(!n.sr&&!n.Qh){var h=n.id,r=n.operation,o="object"!=k(s)||s.$proxy?s:s[r],a=o&&(o.$proxy||"function"==typeof o);if(o&&(this.q.store.hr&&this.q.store.hr(n.data),this.callEvent("onBefore"+r,[h,n]))){if(n.sr=!0,!this.callEvent("onBeforeDataSend",[n]))return;n.data=this.rr(n.data);var u=this.or({id:n.id,status:n.operation});o.$proxy?(o.save&&o.save(this.config.master,n,this,u),i.push(n)):("insert"==r&&delete n.data.id,a?o(n.id,n.operation,n.data).then(function(t){t&&"function"==typeof t.json&&(t=t.json()),u.success("",t,-1)},function(t){u.error("",null,t)}):(n.data[this.q.operationName]=r,this.O(o,n.data,this.q.mode,r,u))),this.callEvent("onAfterDataSend",[n])}}}s.$proxy&&s.saveAll&&i.length&&s.saveAll(this.config.master,i,this,this.or({}))}},rr:function(t){var i={};for(
var s in t)0!==s.indexOf("$")&&(i[s]=t[s]);return i},O:function(t,i,s,e,n){if("function"==typeof t)return t(i,e,n);xt()[s](t,i,n)},or:function(e){var n=this;return{success:function(t,i,s){return n.ar(e,t,i,s)},error:function(t,i,s){return n.yt(e,t,i,s)}}},attachProgress:function(t,i,s){this.attachEvent("onBeforeDataSend",t),this.attachEvent("onAfterSync",i),this.attachEvent("onAfterSaveError",s),this.attachEvent("onLoadError",s)},yt:function(t,i,s,e){t?this.ur(!0,t.id,!1,t.status,!1,{text:i,data:s,loader:e}):(this.callEvent("onLoadError",arguments),I("onLoadError",[i,s,e,this]))},ur:function(t,i,s,e,n,h){var r=this.q.master,o=this.getItemState(i);o.sr=!1,t?this.callEvent("onBeforeSaveError",[i,e,n,h])&&(o.Qh=!0,this.q.undoOnError&&r.q.undo&&(this.ignore(function(){r.undo(i)}),this.setItemState(i,!1)),this.callEvent("onAfterSaveError",[i,e,n,h])):(this.setItemState(i,!1),s&&i!=s&&this.q.store.changeId(i,s),n&&"delete"!=e&&this.q.updateFromResponse&&this.ignore(function(){this.q.store.updateItem(s||i,n)}),this.q.undoOnError&&r.q.undo&&r.removeUndo(s||i),this.callEvent("onAfterSave",[n,i,h]),this.callEvent("onAfter"+e,[n,i,h]))},processResult:function(t,i,s){var e=i&&("error"==i.status||"invalid"==i.status),n=!!i&&(i.newid||i.id);this.ur(e,t.id,n,t.status,i,s)},ar:function(t,i,s,e){if(this.callEvent("onBeforeSync",[t,i,s,e]),-1===e)this.processResult(t,s,{});else{var n,h=this.q.url;if(h.$proxy&&h.result)h.result(t,this.q.master,this,i,s,e);else i&&(n=s.json(),i&&null==n&&(n={status:"error"})),this.processResult(t,n,{text:i,data:s,loader:e})}this.callEvent("onAfterSync",[t,i,s,e])},escape:function(t){return this.q.escape?this.q.escape(t):encodeURIComponent(t)},getState:function(){if(!this.Gh.length)return!1;for(var t=this.Gh.length-1;0<=t;t--)if(this.Gh[t].sr)return"saving";return!0},getItemState:function(t){var i=this.cr(t);return this.Gh[i]||null},setItemState:function(t,i){if(i)this.save(t,i);else{var s=this.cr(t);-1<s&&this.Gh.splice(s,1)}},cr:function(t){for(var i=-1,s=0;s<this.Gh.length;s++)if(this.Gh[s].id==t){i=s;break}return i}},Hi,g,xs);function ks(){this.name="DataStore",H.extend(this,g),this.setDriver("json"),this.pull={},this.order=p(),this.fr={}}ks.prototype={setDriver:function(t){oi[t],this.driver=oi[t]},Pt:function(t){this.callEvent("onParse",[this.driver,t]),this.lr&&this.filter();var i=this.driver.getInfo(t);i.key&&(M.securityKey=i.key),i.config&&this.callEvent("onServerConfig",[i.config]);var s=this.driver.getOptions(t);s&&this.callEvent("onServerOptions",[s]);var e=this.driver.getRecords(t);this.dr(i,e),this.vr&&this._r&&!this.pr&&this._r(this.vr),this.mr&&(this.blockEvent(),this.sort(this.mr),this.unblockEvent()),this.callEvent("onStoreLoad",[this.driver,t]),this.refresh()},dr:function(t,i){var s=t.from,e=!0,n=!1;if(!s&&0!==s&&this.order[0]){if(this.br){n={};for(var h=0;h<this.order.length;h++)n[this.order[h]]=!0}e=!1,s=this.order.length}else s=1*(s||0);for(var r=0,o=0;o<i.length;o++){var a=this.driver.getDetails(i[o]),u=this.id(a);this.pull[u]?e&&this.order[r+s]&&r++:(this.order[r+s]=u,r++),this.pull[u]?(H.extend(this.pull[u],a,!0),this.gr&&this.gr(this.pull[u]),n&&delete n[u]):(this.pull[u]=a,this.wr&&this.wr(a))}if(n){for(var c in this.blockEvent(),n)this.remove(c);this.unblockEvent()}var f=1*t.size;f&&(this.order[f-1]||(this.order[f-1]=undefined),f<this.order.length&&(this.order=this.order.slice(0,f)))},id:function(t){return t.id||(t.id=z())},changeId:function(t,i){t!=i&&(this.pull[t]&&(this.pull[i]=this.pull[t]),this.pull[i].id=i,this.order[this.order.find(t)]=i,this.lr&&(this.lr[this.lr.find(t)]=i),this.fr[t]&&(this.fr[i]=this.fr[t],delete this.fr[t]),this.callEvent("onIdChange",[t,i]),this.xr&&this.xr(t,i),delete this.pull[t])},getItem:function(t){return this.pull[t]},updateItem:function(t,i,s){"object"===k(t)&&(t=t.toString());var e=this.getItem(t),n=null,h=this.hasEvent("onDataUpdate");!i||!i.id||i.id,D(i)||e===i||(h&&(n=B(e)),t=e.id,H.extend(e,i,!0),e.id=t),this.gr&&this.gr(e),this.callEvent("onStoreUpdated",[t,e,s||"update"]),h&&this.callEvent("onDataUpdate",[t,e,n])},refresh:function(t){
this.yr||(t?this.exists(t)&&this.callEvent("onStoreUpdated",[t,this.pull[t],"paint"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(t,i){this.yr=!0,t.call(i||this),this.yr=!1},getRange:function(t,i){if(t=t?this.getIndexById(t):this.$min||this.startOffset||0,i?i=this.getIndexById(i):(i=0===this.$max?0:Math.min(this.$max?this.$max-1:this.endOffset||Infinity,this.count()-1))<0&&(i=0),i<t){var s=i;i=t,t=s}return this.getIndexRange(t,i)},getIndexRange:function(t,i){i=Math.min(0===i?0:i||Infinity,this.count()-1);for(var s=p(),e=t||0;e<=i;e++)s.push(this.getItem(this.order[e]));return s},count:function(){return this.order.length},exists:function(t){return!!this.pull[t]},move:function(t,i){if(t!=i){var s=this.getIdByIndex(t),e=this.getItem(s);this.lr&&this.Mr(this.lr,0,0,this.getIdByIndex(t),this.getIdByIndex(i)),this.Mr(this.order,t,i),this.callEvent("onStoreUpdated",[s,e,"move"])}},Mr:function(t,i,s,e,n){if(e||n){i=s=-1;for(var h=0;h<t.length;h++)t[h]==e&&i<0&&(i=h),t[h]==n&&s<0&&(s=h)}var r=t[i];t.removeAt(i),t.insertAt(r,Math.min(t.length,s))},scheme:function(t){for(var i in this.Sr={},this.hr=t.$save,this.wr=t.$init||t.$change,this.gr=t.$update||t.$change,this.Zh=t.$serialize,this.vr=t.$group,this.mr=t.$sort,t)"$"!=i.substr(0,1)&&(this.Sr[i]=t[i])},importData:function(t,i){var s=t?t.data||t:[];if(this.lr=null,"function"==typeof s.serialize){if(this.order=p([].concat(s.order)),this.kr){this.kr=!1;var e=this.pull;for(var n in this.pull={},s.pull){var h=e[n];this.pull[n]=B(s.pull[n]),h&&h.open&&(this.pull[n].open=!0)}}else this.pull=s.pull;s.branch&&this.branch&&(this.branch=B(s.branch),this.Cr=null)}else{var r,o;if(this.order=p(),this.pull={},b(t))for(var a=0;a<t.length;a++)"object"==k(o=r=t[a])?o.id=o.id||z():o={id:r,value:r},this.order.push(o.id),this.wr&&this.wr(o),this.pull[o.id]=o;else for(var u in s)this.order.push(u),this.pull[u]={id:u,value:s[u]}}if(this.Dr&&!s.branch){this.branch={0:[]},this.Ar||this.Ir("data");for(var c=0;c<this.order.length;c++){var f=this.order[c];this.Dr(this.pull[f],0,0,!1)}}this.callEvent("onStoreLoad",[]),i||this.callEvent("onStoreUpdated",[])},sync:function(e,n,h){this.unsync();var t=k(e);if("string"==t&&(e=jt(e)),"function"!=t&&"object"!=t&&(h=n,n=null),"DataStore"!=e.name){if(!e.data||"DataStore"!==e.data.name&&"TreeStore"!==e.data.name)return this.Fr=e,I("onSyncUnknown",[this,e,n]);e=e.data}var i=C(function(t,i,s){this.Tr||(n&&this.branch&&(this.kr=!0),this.importData(e,!0),n&&this.silent(n),this.xe&&this.xe(),t&&i&&s||(this.fr={}),"delete"==s&&this.fr[t]&&delete this.fr[t],this.callEvent("onSyncApply",[]),h?h=!1:this.refresh())},this);this.zr=[e.attachEvent("onStoreUpdated",i),e.attachEvent("onIdChange",C(function(t,i){this.changeId(t,i),this.refresh(i)},this))],this.Fr=e,this.Vr=this.attachEvent("onStoreUpdated",function(t,i,s){"update"!=s&&"save"!=s||(this.Tr=1,e.updateItem(t,i),this.Tr=0)}),i()},unsync:function(){if(this.Fr){var t=this.Fr;if("DataStore"==t.name||t.data&&"DataStore"==t.data.name){for(var i=0;i<this.zr.length;i++)t.detachEvent(this.zr[i]);this.detachEvent(this.Vr)}else I("onUnSyncUnknown",[this,t]);this.Fr=null}},destructor:function(){this.unsync(),this.pull=this.order=this.fr=null,this.V=this.H={}},add:function(t,i){if(this.Sr)for(var s in this.Sr)D(t[s])&&(t[s]=this.Sr[s]);this.wr&&this.wr(t);var e=this.id(t),n=arguments[2]||this.order,h=n.length;if((D(i)||i<0)&&(i=h),h<i&&(i=Math.min(n.length,i)),!1===this.callEvent("onBeforeAdd",[e,t,i]))return!1;if(this.exists(e),this.pull[e]=t,n.insertAt(e,i),this.lr){var r=this.lr.length;this.order.length&&(r=Math.min(i||0,r)),this.lr.insertAt(e,r)}return this.callEvent("onStoreUpdated",[e,t,"add"]),this.callEvent("onAfterAdd",[e,i]),t.id},remove:function(t){if(b(t))for(var i=0;i<t.length;i++)this.remove(t[i]);else{if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.exists(t);var s=this.getItem(t);this.order.remove(t),this.lr&&this.lr.remove(t),delete this.pull[t],this.fr[t]&&delete this.fr[t],this.callEvent("onStoreUpdated",[t,s,"delete"]),this.callEvent("onAfterDelete",[t])}},clearAll:function(t){
this.pull={},this.fr={},this.order=p(),this.lr=null,t||(this.url=null),this.callEvent("onClearAll",[t]),this.refresh()},getIdByIndex:function(t){return this.order[t]},getIndexById:function(t){return this.pull[t]?this.order.find(t):-1},getNextId:function(t,i){return this.order[this.getIndexById(t)+(i||1)]},getFirstId:function(){return this.order[0]},getLastId:function(){return this.order[this.order.length-1]},getPrevId:function(t,i){return this.order[this.getIndexById(t)-(i||1)]},sort:function(t,i,s){var e=t;"function"==typeof t?e={as:t,dir:i}:"string"==typeof t&&(e={by:t.replace(/#/g,""),dir:i,as:s});var n=[e.by,e.dir,e.as,e];this.callEvent("onBeforeSort",n)&&(this.order=this.Hr(e,this.order),this.lr&&this.lr.length!=this.order.length&&(this.lr=this.Hr(e,this.lr)),this.refresh(),this.callEvent("onAfterSort",n))},Hr:function(t,i){var s=this.sorting.create(t);if(this.order.length){for(var e=i.splice(0,this.$freeze),n=p(),h=i.length-1;0<=h;h--)n[h]=this.pull[i[h]];return n.sort(s),p(e.concat(n.map(function(t){return this.id(t)},this)))}return i},Br:function(t){this.lr&&!t&&(this.order=this.lr,delete this.lr)},Rr:function(t,i,s){for(var e=p(),n=this.$freeze||0,h=0;h<this.order.length;h++){var r=this.order[h];(h<n||t(this.getItem(r),i))&&e.push(r)}s&&this.lr||(this.lr=this.order),this.order=e},find:function(t,i){var s=[];for(var e in this.pull){var n=this.pull[e],h=!0;if("object"==k(t)){for(var r in t)if(n[r]!=t[r]){h=!1;break}}else t(n)||(h=!1);if(h&&s.push(n),i&&s.length)return s[0]}return s},filter:function(s,i,t){if((s||this.lr||this.Cr)&&this.callEvent("onBeforeFilter",[s,i])&&(this.Br(t),this.order.length)){if(s){var e=s;i=i||"","string"==typeof s&&(s=s.replace(/#/g,""),e="function"==typeof i?function(t){return i(t[s])}:(i=i.toString().toLowerCase(),function(t,i){return-1!=(t[s]||"").toString().toLowerCase().indexOf(i)})),this.Rr(e,i,t,this.Pr)}this.refresh(),this.callEvent("onAfterFilter",[])}},jr:function(){for(var t=[],i=this.order.length-1;0<=i;i--)t[i]=this.pull[this.order[i]];return t},each:function(t,i,s){var e=this.order;s&&(e=this.lr||e);for(var n=0;n<e.length;n++)e[n]&&t.call(i||this,this.getItem(e[n]),n)},Nr:function(t,i){return function(){return t[i].apply(t,arguments)}},provideApi:function(t,i){i&&this.mapEvent({onbeforesort:t,onaftersort:t,onbeforeadd:t,onafteradd:t,onbeforedelete:t,onafterdelete:t,ondataupdate:t});for(var s=["sort","add","remove","exists","getIdByIndex","getIndexById","getItem","updateItem","refresh","count","filter","find","getNextId","getPrevId","clearAll","getFirstId","getLastId","serialize","sync"],e=0;e<s.length;e++)t[s[e]]=this.Nr(this,s[e])},addMark:function(t,i,s,e,n){var h=this.fr[t]||{};if(!(this.fr[t]=h)[i]){if(h[i]=e||!0,s){var r=h.$css||"";h.$css=r+" "+i}n||this.refresh(t)}return h[i]},removeMark:function(t,i,s,e){var n=this.fr[t];if(n){if(n[i]&&delete n[i],s){var h=n.$css;h&&(n.$css=h.replace(i,"").replace("  "," "))}e||this.refresh(t)}},getMark:function(t,i){var s=this.fr[t];return!!s&&s[i]},clearMark:function(t,i,s){for(var e in this.fr){var n=this.fr[e];n[t]&&(delete n[t],i&&n.$css&&(n.$css=n.$css.replace(t,"").replace("  "," ")),s||this.refresh(e))}},serialize:function(t){var i=this.order;t&&this.lr&&(i=this.lr);for(var s=[],e=0;e<i.length;e++){var n=this.pull[i[e]];this.Zh&&!1===(n=this.Zh(n))||s.push(n)}return s},sorting:{create:function(t){return this.Er(t.dir,this.Lr(t.by,t.as))},as:{server:function(){return!1},date:function(t,i){return(i-=0)<(t-=0)?1:t<i?-1:0},"int":function(t,i){return(i*=1)<(t*=1)?1:t<i?-1:0},string_strict:function(t,i){return t=t.toString(),(i=i.toString())<t?1:t<i?-1:0},string:function(t,i){return i?t?(t=t.toString().toLowerCase(),(i=i.toString().toLowerCase())<t?1:t<i?-1:0):-1:1},raw:function(t,i){return i<t?1:t<i?-1:0}},Lr:function(s,e){return s?("function"!=typeof e&&(e=this.as[e||"string"]),function(t,i){return e(t[s],i[s])}):e},Er:function(t,s){return"asc"!=t&&t?function(t,i){return-1*s(t,i)}:s}}};var Cs=H.proto({$init:function(t){t=t||"",this.J=p(),this.Or={},this.data=new ks,this.data.attachEvent("onClearAll",C(this.Ur,this)),
this.data.attachEvent("onServerConfig",C(this.Yr,this)),this.attachEvent("onDestruct",this.Ur),this.data.feed=this.Wr,this.data.owner=t.id},Wr:function(t,i,s){if(this.Gr)return this.Gr=[t,i,s];this.Gr=!0,this.Or.from=t,this.Or.count=i,this.Xr.call(this,t,i,s)},Xr:function(t,i,s,e,n){var h=null;e=e||this.data.url;var r=[{success:this.Jr,error:this.Jr},s];if(t<0&&(t=0),n||(n={start:t,count:i}),this.count()&&(n["continue"]="true"),this.getState&&(h=this.getState()),e&&"string"!=typeof e)h&&(h.sort&&(n.sort=h.sort),h.filter&&(n.filter=h.filter)),this.load(e,r,n);else{e+=-1==e.indexOf("?")?"?":"&";var o=[];for(var a in n)o.push(a+"="+n[a]);if(h&&(h.sort&&o.push("sort["+h.sort.id+"]="+encodeURIComponent(h.sort.dir)),h.filter))for(var u in h.filter){var c=h.filter[u];"object"==k(c)&&(c=xt().stringify(c)),o.push("filter["+u+"]="+encodeURIComponent(c))}e+=o.join("&"),this.Or.url!==e?(this.Or.url=e,this.load(e,r)):this.Gr=!1}},Jr:function(){var t=this.Gr;this.Gr=!1,"object"==k(t)&&this.data.feed.apply(this,t)},load:function(t){t=di.$parse(t);var i=vi.load.apply(this,arguments);return this.data.url||(this.data.url=t),i},loadNext:function(t,i,s,e,n){var h=this.q;if(h.datathrottle&&!n)return this.Kr&&window.clearTimeout(this.Kr),void(this.Kr=$(function(){this.loadNext(t,i,s,e,!0)},this,0,h.datathrottle));i||0===i||(i=this.count()),t||(t=h.datafetch||this.count()),this.data.url=this.data.url||e,this.callEvent("onDataRequest",[i,t,s,e])&&this.data.url&&this.data.feed.call(this,i,t,s)},qr:function(t,i){var s=this.Or;return!!(this.Gr&&s.url&&s.from<=i&&s.count+s.from>=t+i)},removeMissed_setter:function(t){return this.data.br=t},Zr:function(){var t=this.q.save;!0===t&&(t=this.q.save=this.q.url);var i={master:this};t&&t.url?H.extend(i,t):i.url=t,Ms(i)},save_setter:function(t){return t&&this.$ready.push(this.Zr),t},scheme_setter:function(t){this.data.scheme(t)},dataFeed_setter:function(t){return t=di.$parse(t),this.data.attachEvent("onBeforeFilter",C(function(t,i){if("function"==typeof t)return!0;if(this.q.dataFeed&&(t||i)){t=t||"id",i&&"object"==k(i)&&(i=i.id),this.clearAll();var s=this.q.dataFeed;if("function"==typeof s){var e={};e[t]=i,s.call(this,i,e)}else if(s.$proxy){if(s.load){var n={};n[t]=i,s.load(this,{success:this.Vt,error:this.Ht},{filter:n})}}else{var h="filter["+t+"]="+encodeURIComponent(i);this.load(s+(s.indexOf("?")<0?"?":"&")+h,this.q.datatype)}return!1}},this)),t},Rt:function(){if(this.q.ready&&!this.Qr){var t=m(this.q.ready,this.$scope);t&&$(t,this,arguments),this.callEvent&&$(this.callEvent,this,["onReady",[]]),this.Qr=!0}},Ur:function(t){for(var i=0;i<this.J.length;i++){var s=this.J[i];try{s.aborted=!0}catch(Bo){wt.push(s)}s.abort()}t||(this.Gr=!1,this.Or={},this.J=p(),this.waitData=mt.defer())},Yr:function(t){this.Qs(t)}},vi),Ds={getState:function(){for(var t=this.config.columns.length,i=this.config.columns,s={ids:[],size:[],select:this.getSelectedId(!0),scroll:this.getScrollState()},e=0;e<t;e++){var n=i[e];s.ids.push(n.id),s.size.push(n.fillspace||n.adjust?-1:n.width)}if(s.order=[].concat(this.io.length?this.io:s.ids),this.so&&(s.sort={id:this.so,dir:this.eo}),this.no&&this.ho){var h={},r=0;for(var o in this.no)if(!this.ro[o]){var a=this.no[o];a[1].value=h[o]=a[2].getValue(a[0]),r=1}r&&(s.filter=h)}for(var u in s.hidden=[],this.ro)s.hidden.push(u);return s},setState:function(t){var i=this.config.columns;if(t){if(this.so=null,this.blockEvent(),t.order&&t.order.length&&(this.io=[].concat(t.order),this.oo=[this.q.leftSplit,t.order.length-this.q.rightSplit]),t.hidden){for(var s={},e=0;e<t.hidden.length;e++)s[t.hidden[e]]=!0,this.io.length||this.hideColumn(t.hidden[e]);if(this.io.length)for(var n=0;n<this.io.length;n++){var h=this.io[n];!!s[h]==!this.ro[h]&&this.hideColumn(h,{},!1,!!s[h])}}if(t.ids){for(var r=!1,o=this.config.columns,a=0;a<o.length;a++)o[a].id!=t.ids[a]&&(r=!0);if(r){for(var u=0;u<t.ids.length;u++)o[u]=this.getColumnConfig(t.ids[u])||o[u];this.refreshColumns()}}if(t.size)for(var c=Math.min(t.size.length,i.length),f=0;f<c;f++){var l=i[f];l&&0<t.size[f]&&l.width!=t.size[f]&&(delete l.fillspace,
delete l.adjust,this.ao(f,t.size[f],!0))}this.unblockEvent();var d=!(this.q.leftSplit||this.q.rightSplit);if(this.uo(d),this.callEvent("onStructureUpdate",[]),t.sort){var v=i[this.getColumnIndex(t.sort.id)];v&&this.co(t.sort.id,t.sort.dir,v.sort)}if(t.filter){var _=this.filterByAll;for(var p in this.filterByAll=function(){},t.filter){var m=t.filter[p];if(m&&this.no[p]){var b=this.no[p];b[2].setValue(b[0],m);var g=b[1].contentId;g&&(this.fo[g].value=m)}}for(var w in this.no)if(!t.filter[w]){var x=this.no[w];x[2].setValue(x[0],"")}this.filterByAll=_,this.filterByAll()}if(t.select&&this.select){var y=t.select;this.unselect();for(var M=0;M<y.length;M++)y[M].row&&!this.exists(y[M].row)||this.lo(y[M],!0)}t.scroll&&this.scrollTo(t.scroll.x,t.scroll.y)}}},$s={"do":function(t,i,s){i||zi.addDrop(t.re,t,!0),s||zi.addDrag(t.re,t),this.attachEvent("onDragOut",function(t,i){this.$dragMark(t,i)}),this.attachEvent("onBeforeAutoScroll",function(){var t=zi.getContext();return!(!zi.rs||!t||t.to!==this&&!this.vo)})},drag_setter:function(t){return t&&(H.extend(this,pi,!0),"order"==t&&H.extend(this,d("DragOrder"),!0),"inner"==t&&(this._o=!0),this["do"](this,"source"==t,"target"==t),delete this.drag_setter),t},$dragIn:function(t,i,s){var e=this.locate(s)||null,n=zi.ns;if((this._o||n.from._o)&&n.from!==this)return!1;var h=zi.getMaster(i),r=this.getItemNode(e,s)||this.bt;return r==zi.ws?r:(n.target=e,n.to=h,this.Xt&&(this.Xt=window.clearTimeout(this.Xt)),this.Xt=$(function(t,i){this.po(i),this.Ut(t,i)},this,[Z(s),e],250),this.$dropAllow(n,s)&&this.callEvent("onBeforeDragIn",[n,s])?(this.$dragMark(n,s),r):(n.to=n.target=null,this.Xt&&(this.Xt=window.clearTimeout(this.Xt)),null))},$dropAllow:function(){return!0},po:function(){},mo:function(t){return t&&"object"===k(t)?t.toString():t},$dragOut:function(t,i,s,e){var n=(this.nt.contains(s)?this.locate(e):null)||null,h=zi.ns;return(h.target||"").toString()==(n||"").toString()||(this.Xt&&(this.vo=null,this.Xt=window.clearTimeout(this.Xt)),h.target=h.to=null,this.callEvent("onDragOut",[h,e])),null},$drop:function(t,i,s){this.Xt&&(this.Xt=window.clearTimeout(this.Xt));var e=zi.ns,n=(e.to=this).mo(e.target);this.getBranchIndex?n&&(e.parent=this.getParentId(n),e.index=this.getBranchIndex(n)):e.index=n?this.getIndexById(n):this.count(),this.$dragMark({},s),e.from&&e.from!=e.to&&e.from.callEvent&&e.from.callEvent("onBeforeDropOut",[e,s]),this.callEvent("onBeforeDrop",[e,s])&&(this.bo(e,s),this.callEvent("onAfterDrop",[e,s]))},bo:function(t){if(t.from,t.from&&t.from.move){var i={parent:t.parent,mode:t.pos};t.from.move(t.source,t.index,t.to,i)}},ss:function(t,i){if(this.getItemNode){var s=this.locate(i,!0),e=s?this.getItemNode(s):null;return e?K(e):e}},$drag:function(t,i){var s=this.locate(i,!0);if(s){var e=[s];if(this.getSelectedId&&!this.go){var n=this.getSelectedId(!0,!0);if(n&&1<n.length&&-1!=x.find.call(n,s)){var h={};e=[];for(var r=0;r<n.length;r++)h[n[r]]=!0;for(var o=0;o<this.data.order.length;o++){var a=this.data.order[o];h[a]&&e.push(a)}}}var u=zi.ns={source:e,start:s};if(u.fragile=this.addRowCss&&S.touch&&(S.isWebKit||S.isFF),(u.from=this).callEvent("onBeforeDrag",[u,i]))return Mi&&(Mi.ei=null),u.html||this.$dragHTML(this.getItem(s),i)}return null},$dragHTML:function(t){return this.Lt(t)},$dragMark:function(t){var i=null;return t.target&&(i=this.mo(t.target)),this.wo&&this.wo!=i&&(t.fragile||this.removeCss(this.wo,"webix_drag_over"),this.wo=null),!this.wo&&i?(this.wo=i,t.fragile||this.addCss(i,"webix_drag_over"),i):!!t.to}},As={go:!0,$drag:function(t,i){var s=$s.$drag.call(this,t,i);if(s){var e=zi.getContext();this.getBranchIndex&&(this.xo=this.yo?16*this.getItem(e.start).$level:0),e.fragile||this.addCss(e.start,"webix_transparent")}return s},ss:function(t,i){return $s.ss(t,i)},$dragPos:function(t,i,s){var e=K(this.$view),n=e.x+(this.yo?1+this.xo:1),h=t.y,r="x"==this.q.layout;r&&(h=e.y+(this.yo?+e.height-S.scrollSize-1:1),n=t.x),s.style.display="none";var o=document.elementFromPoint(n,h);if(o!=this.Mo){var a=jt(o);if(a&&a==this){var u=this.locate(o,!0);!u&&zi.os&&(u=this.locate(zi.os,!0))
;var c=zi.getContext().start;if(this.vo=!0,u){if(u!=this.Mo){var f,l;if(u!=c)l=this.getBranchIndex?(f={parent:this.getParentId(u)},this.getBranchIndex(u)):(f={},this.getIndexById(u)),this.callEvent("onBeforeDropOrder",[c,l,i,f])&&(this.move(c,l,this,f),this.Mo=u);zi.ms=this.re}}else if(u="$webix-last",this.Mo!=u){if(!this.callEvent("onBeforeDropOrder",[c,-1,i,{parent:0}]))return;this.Mo=u}}}if(s.style.display="block",r)if(t.y=e.y,t.x=t.x-18,t.x<e.x)t.x=e.x;else{var d=e.x+this.$view.offsetWidth-60;t.x>d&&(t.x=d)}else if(e.y+=this.So,t.x=this.xo||e.x,t.y=t.y-18,t.y<e.y)t.y=e.y;else{var v=e.y+this.$view.offsetHeight-60;t.y>v&&(t.y=v)}this.Xt&&(this.Xt=window.clearTimeout(this.Xt)),this.Xt=$(this.Ut,this,[Z(i),this.locate(i)||null],250),zi.bs=!0},$dragIn:function(){return!1},$drop:function(t,i,s){this.Xt&&(this.vo=null,this.Xt=window.clearTimeout(this.Xt));var e=zi.getContext(),n=e.start;this.removeCss(n,"webix_transparent");var h=this.getIndexById(n);this.callEvent("onAfterDropOrder",[n,h,s]),e.fragile&&this.refresh()}};u("DragOrder",As);var Is={$init:function(){this.ko=H.extend([],x,!0),this.Co=-1},undo_setter:function(t){return t&&(this.Do(),this.Do=function(){}),t},Do:function(){var n=this;this.attachEvent("onBeforeDrop",function(t){if(t.from==t.to){var i=n.$o=B(this.getItem(t.start));this.data.branch?i.$index=this.getBranchIndex(i.id):i.$index=this.getIndexById(i.id)}}),this.data.attachEvent("onDataMove",function(t){if(n.$o&&n.$o.id==t){var i=n.$o;n.$o=null,n.Ao(t,i,"move")}}),this.data.attachEvent("onBeforeDelete",function(t){if(this.getItem(t)){var i=n.Io=B(this.getItem(t));this.branch?(i.$index=this.getBranchIndex(t),this.branch[t]&&(i.$branch=B(this.serialize(t)))):i.$index=this.getIndexById(t)}}),this.data.attachEvent("onDataUpdate",function(t,i,s){n.Ao(t+"",s,"update")}),this.data.attachEvent("onStoreUpdated",function(t,i,s){var e=null;t&&("add"==s?e=B(i):"delete"==s&&(e=n.Io),e&&n.Ao(t,e,s))}),this.data.attachEvent("onIdChange",function(t,i){"object"==k(t)&&(t=t.row);for(var s=0;s<n.ko.length;s++)n.ko[s].id==t&&(n.ko[s].id=i)})},Ao:function(t,i,s){!this.Fo&&this.q.undo&&(this.ko.push({id:t,action:s,data:i}),20==this.ko.length&&this.ko.splice(0,1),this.To||(this.Co=this.ko.length-1))},ignoreUndo:function(t,i){this.Fo=!0,t.call(i||this),this.Fo=!1},removeUndo:function(t){for(var i=this.ko.length-1;0<=i;i--)this.ko[i].id==t&&("id"==this.ko[i].action&&(t=this.ko[i].data),this.ko.removeAt(i));this.Co=this.ko.length-1},undo:function(s){if(s)this.ignoreUndo(function(){var t,i;for(i=this.ko.length-1;!t&&0<=i;i--)this.ko[i].id==s&&(t=this.ko[i]);t&&(this.zo(t),this.ko.removeAt(i+1),this.Co=this.ko.length-1)});else{var t=this.ko[this.Co];t&&(this.ignoreUndo(function(){this.zo(t),this.ko.removeAt(this.Co)}),this.Co--)}},zo:function(t){if("delete"==t.action){var i=null,s=t.data.$parent;t.data.$branch&&(i={parent:t.id,data:B(t.data.$branch)},delete t.data.$branch,s&&!this.data.branch[s]&&(s=0)),this.add(t.data,t.data.$index,s),i&&this.parse(i)}else"add"==t.action?this.remove(t.id):"update"==t.action?this.updateItem(t.id,t.data):"move"==t.action&&(t.data.$parent?this.getItem(t.data.$parent)&&this.move(t.id,t.data.$index,null,{parent:t.data.$parent}):this.move(t.id,t.data.$index))}};function Fs(t){return"string"==typeof t?t:t.linkInput?t.q.id:("object"==k(t)?(b(t)&&(t={data:t}),t.view=t.view||"suggest"):!0===t&&(t={view:"suggest"}),Vt(t).config.id)}function Ts(t){return((t.header&&t.header[0]?t.header[0].text:t.editValue||t.label)||"").toString().replace(/<[^>]*>/g,"")}var zs={text:{focus:function(){this.getInputNode(this.node).focus(),this.getInputNode(this.node).select()},getValue:function(){return this.getInputNode(this.node).value},setValue:function(t){var i=this.getInputNode(this.node);i.value=t,function n(t,i){var s=t.config.suggest;if(s){var e=jt(t.config.suggest=Fs(s));e&&i&&e.linkInput(i)}}(this,i)},getInputNode:function(){return this.node.firstChild},render:function(){return Y("div",{"class":"webix_dt_editor"},"<input type='text' aria-label='"+Ts(this.config)+"'>")}},"inline-checkbox":{render:function(){return{}},
getValue:function(){return this.node.checked},setValue:function(){},focus:function(){this.node.focus()},getInputNode:function(){},$inline:!0},"inline-text":{render:function(){return{}},getValue:function(){return this.node.value},setValue:function(){},focus:function(){try{this.node.select(),this.node.focus()}catch(Bo){}},getInputNode:function(){},$inline:!0},checkbox:{focus:function(){this.getInputNode().focus()},getValue:function(){return this.getInputNode().checked},setValue:function(t){this.getInputNode().checked=!!t},getInputNode:function(){return this.node.firstChild.firstChild},render:function(){return Y("div",{"class":"webix_dt_editor"},"<div><input type='checkbox' aria-label='"+Ts(this.config)+"'></div>")}},select:{focus:function(){this.getInputNode().focus()},getValue:function(){return this.getInputNode().value},setValue:function(t){this.getInputNode().value=t},getInputNode:function(){return this.node.firstChild},render:function(){var i="",t=this.config.options||this.config.collection;if(t.data&&t.data.each)t.data.each(function(t){i+="<option value='"+t.id+"'>"+t.value+"</option>"});else if(b(t))for(var s=0;s<t.length;s++){var e=t[s],n=D(e.id),h=n?e:e.id,r=n?e:e.value;i+="<option value='"+h+"'>"+r+"</option>"}else for(var o in t)i+="<option value='"+o+"'>"+t[o]+"</option>";return Y("div",{"class":"webix_dt_editor"},"<select aria-label='"+Ts(this.config)+"'>"+i+"</select>")}},popup:{focus:function(){this.getInputNode().focus()},destroy:function(){this.getPopup().hide()},getValue:function(){return this.getInputNode().getValue()||""},setValue:function(t){this.getPopup().show(this.node),this.getInputNode().setValue(t)},getInputNode:function(){return this.getPopup().getChildViews()[0]},getPopup:function(){return this.config.$popup||(this.config.$popup=this.createPopup()),jt(this.config.$popup)},createPopup:function(){var t,i=this.config.popup||this.config.suggest;if(i)return(t="object"!=k(i)||i.name?jt(i):(i.view=i.view||"suggest",Vt(B(i)))).Vo||(t.linkInput?t.linkInput(document.body):this.linkInput&&this.linkInput(document.body),t.Vo=!0),t;var s=zs.$popup[this.popupType];return"string"==typeof s||s.name||(s=zs.$popup[this.popupType]=Vt(s),this.popupInit(s),s.linkInput||this.linkInput(document.body)),s.q.id},linkInput:function(t){Lt(A(t),"keydown",C(function(t){if(this.config.$popup){var i,s=t.which||t.keyCode,e=this.getInputNode();if(e.isVisible())if(e.moveSelection&&s<41&&32<s)33==s&&(i="pgup"),34==s&&(i="pgdown"),35==s&&(i="bottom"),36==s&&(i="top"),37==s&&(i="left"),38==s&&(i="up"),39==s&&(i="right"),40==s&&(i="down"),e.moveSelection(i);else 13!==s||"TEXTAREA"===t.target.nodeName&&t.shiftKey||I("onEditEnd",[])}},this))},popupInit:function(){},popupType:"text",render:function(){return{}},$inline:!0}};zs.color=H.extend({focus:function(){},popupType:"color",popupInit:function(t){t.getChildViews()[0].attachEvent("onItemClick",function(t){I("onEditEnd",[t])})}},zs.popup),zs.date=H.extend({focus:function(){},popupType:"date",setValue:function(t){this.Ho=this.config.stringResult||t&&"string"==typeof t,zs.popup.setValue.call(this,t)},getValue:function(){return this.getInputNode().getValue(this.Ho?ct.parseFormatStr:"")||""},popupInit:function(t){t.getChildViews()[0].attachEvent("onDateSelect",function(t){I("onEditEnd",[t])})}},zs.popup),zs.combo=H.extend({Bo:function(t){return this.config.popup?this.config.popup.config.id:t?Fs(t):this.Ro(t)},Ro:function(){var t=zs.combo;return t.Po=t.Po||this.Bo(!0)},render:function(){var t=Y("div",{"class":"webix_dt_editor"},"<input type='text' role='combobox' aria-label='"+Ts(this.config)+"'>"),i=this.config.suggest=this.Bo(this.config.suggest);return i&&(jt(i).linkInput(t.firstChild,!0),Lt(t.firstChild,"click",C(this.showPopup,this))),t},getPopup:function(){return jt(this.config.suggest)},showPopup:function(){var t=this.getPopup(),i=t.getList(),s=this.getInputNode(),e=this.jo;t.show(s),s.setAttribute("aria-expanded","true"),e?(i.exists(e),i.exists(e)&&(i.select(e),i.showItem(e))):(i.unselect(),i.showItem(i.getFirstId())),t.No=s},afterRender:function(){this.showPopup()},
setValue:function(t){if(this.jo=t,this.config.suggest){var i=jt(this.config.suggest),s=this.config.collection||this.config.options;s&&i.getList().data.importData(s),this.getInputNode(this.node).value=i.getItemText(t)}},getValue:function(){var t=this.getInputNode().value;if(this.config.suggest){var i=jt(this.config.suggest),s=i.getList();(t||s.getSelectedId&&s.getSelectedId())&&(t=i.getSuggestion(t))}return t}},zs.text),zs.richselect=H.extend({focus:function(){},getValue:function(){return this.getPopup().getValue()},setValue:function(t){var i=this.config.collection||this.config.options;this.getInputNode(),i&&this.getPopup().getList().data.importData(i),this.getPopup().show(this.node),this.getPopup().setValue(t)},getInputNode:function(){return this.getPopup().getList()},popupInit:function(t){t.linkInput(document.body)},popupType:"richselect"},zs.popup),zs.password=H.extend({render:function(){return Y("div",{"class":"webix_dt_editor"},"<input type='password' aria-label='"+Ts(this.config)+"'>")}},zs.text),zs.$popup={text:{view:"popup",width:250,height:150,body:{view:"textarea"}},color:{view:"popup",body:{view:"colorboard"}},date:{view:"popup",width:250,height:250,padding:0,body:{view:"calendar",icons:!0,borderless:!0}},richselect:{view:"suggest",body:{view:"list",select:!0}},multiselect:{view:"multisuggest",suggest:{button:!0}}};var Vs={defaults:{editaction:"click"},$init:function(t){this.Eo={},this.Gs=0,this.S=0,this.re.style.position="relative",t&&(t.onDblClick=t.onDblClick||{}),this.attachEvent("onAfterRender",this.Lo),this.q.editable&&this.Oo(),H.extend(this,Is)},Uo:function(t){try{if("number"==typeof t.selectionStart)t.selectionStart=t.selectionEnd=t.value.length;else if("undefined"!=typeof t.createTextRange){var i=t.createTextRange();i.collapse(!1),i.select()}}catch(Bo){}},Lo:function(){var t=this.getEditor();if(t&&t.$inline&&!t.getPopup){var i=this.Yo(t);if(i&&i!=t.node){var s=t.node.value;(t.node=i).value=s,i.focus(),this.Uo(i)}else this.editStop()}},editable_setter:function(t){return t&&this.Oo(),t},Oo:function(){F("onEditEnd",C(function(){this.Gs&&this.editStop()},this)),F("onClick",C(function(t){this.Gs&&200<new Date-this.S&&(this.se&&!this.se.popupType&&t&&this.se.node&&this.se.node.contains(t.target||t.srcElement)||this.editStop())},this)),this.data.attachEvent&&this.data.attachEvent("onIdChange",C(function(t,i){this.Wo(t,i)},this)),this.attachEvent("onItemClick",function(t){this.q.editable&&"click"==this.q.editaction&&this.edit(t)}),this.attachEvent("onItemDblClick",function(t){this.q.editable&&"dblclick"==this.q.editaction&&this.edit(t)}),this.Go=C(function(){this.S=new Date},this),this.Oo=function(){},this.Xo&&this.Xo()},Jo:function(){$(function(){var t=this.getEditor();if(t&&t.config.liveEdit){var i={value:t.getValue(),old:t.value};if(i.value==i.old)return;t.value=i.value,this.Ko(t,i.value,!1),this.callEvent("onLiveEdit",[i,t])}},this)},qo:function(t){var i=this.q.form;"string"!=typeof i&&(this.q.form=i=Vt(i).config.id);var s=(i=jt(i)).setValues?i:i.getChildViews()[0];s.setValues(this.getItem(t.row||t)),i.config.master=this.config.id,i.show(this.getItemNode(t));var e=s.getChildViews()[0];e.focus&&e.focus()},edit:function(t,i,s){if(this.q.editable&&this.callEvent("onBeforeEditStart",[t])){if(this.q.form)return this.qo(t);var e=this.Zo(t);if(e){if(this.getEditor(t))return;i||this.editStop(),zs[e];var n=H.extend({},zs[e]),h=this.Qo(t,n,s);n.config.liveEdit&&(this.ta=this.attachEvent("onKeyPress",this.Jo));var r=n.getPopup?n.getPopup(h).nt:h;return r&&Lt(r,"click",this.Go),h&&Lt(h,"change",this.ia,{bind:{view:this,id:t}}),!1!==s&&n.focus(),this.$fixEditor&&this.$fixEditor(n),this.S=M.edit_open_time=new Date,Vi.setFocus(this,!0),this.callEvent("onAfterEditStart",[t]),n}return null}},getEditor:function(t){return t?this.Eo[t]:this.se},Wo:function(t,i){var s=this.Eo[t];s&&((this.Eo[i]=s).id=i,delete this.Eo[t])},ia:function(){this.view.hasEvent("onEditorChange")&&this.view.callEvent("onEditorChange",[this.id,this.view.getEditorValue(this.id)])},sa:function(){return this.q},Qo:function(t,i,s){i.config=this.sa(t)
;var e=i.render();i.$inline&&(e=this.Yo(t)),i.node=e;var n=this.getItem(t),h=n[this.q.editValue||"value"];return D(h)&&(h=""),i.setValue(h,n),i.value=h,this.ea(t,i),!1!==s&&this.showItem(t),i.$inline||this.na(t,e,!0),i.afterRender&&i.afterRender(),e},ha:function(t){return this.getItemNode(t)},Yo:function(t){var i=this.ha(t);return i&&(i=i.getElementsByTagName("input")[0]||i),i},Zo:function(){return this.q.editor},ea:function(t,i){i.id=t,this.Eo[t]=this.se=i,this.Gs++},ra:function(t){this.se==t&&(this.se=0),t.destroy&&t.destroy(),delete t.popup,delete t.node,delete this.Eo[t.id],this.Gs--},focusEditor:function(){var t=this.getEditor.apply(this,arguments);t&&t.focus&&t.focus()},editCancel:function(){this.editStop(null,null,!0)},Vs:function(t){if(t){var i=this.getEditor();if(i&&i.getPopup&&i.getPopup()==t.getTopParentView())return}this.editStop()},editStop:function(t){if(!this.oa){this.oa=1;var i=arguments[2],s=1;return t?s=this.aa(this.Eo[t],i):this.ua(function(t){s*=this.aa(t,i)}),this.oa=0,s}},Wt:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.re}},na:function(t,i,s){if(i.style){var e=this.Wt(t);i.style.top=e.top+"px",i.style.left=e.left+"px",i.style.width=e.width-1+"px",i.style.height=e.height-1+"px",i.top=e.top,s&&e.parent.appendChild(i)}},ua:function(t){for(var i in this.Eo)t.call(this,this.Eo[i])},aa:function(t,i){if(t&&!M.k){var s={value:this.ca(t),old:t.value};if(this.callEvent("onBeforeEditStop",[s,t,i])){if(!i){var e=s.old;if("string"==typeof s.value&&(e+=""),e!=s.value||t.config.liveEdit){var n=this.Ko(t,s.value,!0);this.updateItem(t.row||t.id,n)}}t.$inline?t.node=null:G(t.node);var h=t.config.suggest;return h&&"string"==typeof h&&jt(h).hide(),this.ra(t),this.ta&&this.detachEvent(this.ta),this.callEvent("onAfterEditStop",[s,t,i]),1}return 0}},validateEditor:function(t){var i=!0;if(this.q.rules){var s=this.getEditor(t),e=s.column||this.q.editValue||"value",n=this.q.rules[e],h=this.q.rules.$all;if(n||h){var r=this.data.getItem(s.row||s.id),o=s.getValue(),a=s.getInputNode();n&&(i=n.call(this,o,r,e)),h&&(i=h.call(this,o,r,e)&&i),i?et(a,"webix_invalid"):st(a,"webix_invalid"),I("onLiveValidation",[s,i,r,o])}}return i},getEditorValue:function(t){var i;if(i=0===arguments.length?this.se:this.getEditor(t))return i.getValue()},getEditState:function(){return this.se||!1},editNext:function(t,i){if(t=!1!==t,1==this.Gs||i){var s=this.fa(this.se||i,function(t){return!!this.Zo(t)},t);if(this.editStop())return s&&(this.edit(s),this.la(s)),!1}},la:function(){},fa:function(t,i,s){var e=this.getIndexById(t.id),n=this.data.order;if(s){for(var h=e+1;h<n.length;h++)if(i.call(this,n[h]))return n[h]}else for(var r=e-1;0<=r;r--)if(i.call(this,n[r]))return n[r];return null},ca:function(t){return t.getValue()},Ko:function(t,i,s){var e=s?{}:this.getItem(t.id);return e[this.q.editValue||"value"]=i,e}},Hs={$init:function(){this.$view.className+=" webix_flexlayout"},da:function(){},va:function(){},_a:function(){},$getSize:function(){var t=0,i=0,s=this.q.gravity;this.pa=[];for(var e=0;e<this.Ks.length;e++){var n=this.Ks[e].$getSize(0,0);this.pa.push(n),t=Math.max(t,n[0]),i=Math.max(i,n[2])}return t+=2*(this.ma||0),i+=2*(this.ba||0),this.q.width&&(t=Math.max(t,this.q.width)),this.q.height&&(i=Math.max(i,this.q.height)),[t,1e5,i,1e5,s]},render:function(){this.resize()},ga:function(){if(this.isVisible(this.q.id)){var t=this.$view.style,i=Math.round(this.wa/2);t.paddingTop=t.paddingBottom=this.ba-i+"px",t.paddingLeft=t.paddingRight=this.ma-i+"px";for(var s=0;s<this.Ks.length;s++)if(!this.Ks[s].q.hidden){var e=this.Ks[s].$view,n=this.pa[s],h=this.Ks[s].q;e&&(e.style.minWidth=n[0]+"px",n[1]<1e5&&n[1]!=n[0]&&(e.style.maxWidth=n[1]+"px"),e.style.flexBasis=h.flexBasis||n[0]+"px",e.style.flexGrow=h.flexGrow||(n[1]!=n[0]?n[4]:0),e.style.height=n[3]!=n[2]?"auto":n[2]+"px",e.style.minHeight=n[2]+"px",n[3]<1e5&&n[3]!=n[2]&&(e.style.maxHeight=n[3]+"px"),e.style.margin=i+"px")}for(var r=[],o=0;o<this.Ks.length;o++)if(!this.Ks[o].q.hidden){var a=this.Ks[o].$view;r[o]=[
a.offsetWidth,a.offsetHeight]}for(var u=0;u<this.Ks.length;u++)if(!this.Ks[u].q.hidden){var c=this.Ks[u];if(c.$view){c.q.flex=!0;var f=this.pa[u],l=f[2]==f[3]?f[2]:r[u][1];c.$setSize(r[u][0],l),c.q.flex=!1}}this.$height=this.He=this.$view.scrollHeight,this.$view.style.height=this.He+"px"}}},Bs={sum:function(t,i){i=i||this;for(var s=0,e=0;e<i.length;e++)s+=1*t(i[e]);return s},min:function(t,i){i=i||this;for(var s=Infinity,e=0;e<i.length;e++)1*t(i[e])<s&&(s=1*t(i[e]));return 1*s},max:function(t,i){i=i||this;for(var s=-Infinity,e=0;e<i.length;e++)1*t(i[e])>s&&(s=1*t(i[e]));return 1*s},count:function(t,i){for(var s=0,e=0;e<i.length;e++){var n=t(i[e]);null!=n&&s++}return s},any:function(t,i){return t(i[0])},string:function(t){return t.$name}},Rs={$init:function(){this.attachEvent("onClearAll",this.xa)},xa:function(){this.pr=this.ya=null,this.Ma=0},ungroup:function(t){if(this.getBranchIndex)return this.Sa.apply(this,arguments);this.pr&&(this.order=this.pr,this.pull=this.ya,this.ya=this.pr=null,t||this.callEvent("onStoreUpdated",[]))},_r:function(t){this.blockEvent(),this.group(t),this.unblockEvent()},ka:function(i){if("function"==typeof i)return i;var t=function(t){return t[i]};return t.$name=i,t},group:function(s){if(this.getBranchIndex)return this.Ca.apply(this,arguments);"string"==typeof s&&(s={by:s,map:{}});var t="function"==typeof s.by?"value":s.by,e=this.ka(s.by);s.map[t]||(s.map[t]=[t,this.Da]);var n={},h=[];for(var i in this.each(function(t){var i=e(t);n[i]||(h.push({id:i,$group:!0,$row:s.row}),n[i]=p()),n[i].push(t)}),s.map){var r=s.map[i][1]||"any",o=this.ka(s.map[i][0]);"function"!=typeof r&&(Bs[r],r=Bs[r]);for(var a=0;a<h.length;a++)h[a][i]=r.call(this,o,n[h[a].id])}this.pr=this.order,this.ya=this.pull,this.order=p(),this.pull={};for(var u=0;u<h.length;u++){var c=this.id(h[u]);this.pull[c]=h[u],this.order.push(c),this.wr&&this.wr(h[u])}this.callEvent("onStoreUpdated",[])},Ca:function(t,i){var s,e;this.Ma=(this.Ma||0)+1,"string"==typeof t?(s={by:this.ka(t),map:{}}).map[t]=[t]:s="function"==typeof t?{by:t,map:{}}:t,e=i?this.getItem(i).$level:i=0;for(var n=this.branch[i],h=this.ka(s.by),r=[],o=[],a=0;a<n.length;a++){var u=this.getItem(n[a]),c=h(u),f=e+"$"+c,l=this.branch[f];if(!l){var d=this.pull[f]={id:f,value:c,$group:!0,$row:s.row};this.wr&&this.wr(d),o.push(d),(l=this.branch[f]=[]).$a=[],r.push(f)}l.push(u.id),l.$a.push(u)}for(var v in this.branch[i]=r,s.map){var _=s.map[v][1]||"any",p=this.ka(s.map[v][0]);"function"!=typeof _&&(Bs[_],_=Bs[_]);for(var m=0;m<o.length;m++)o[m][v]=_.call(this,p,this.branch[o[m].id].$a)}for(var b=0;b<o.length;b++){var g=o[b];if(this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[g.id,g.value,this.branch[g.id].$a]),s.footer){var w="footer$"+g.id,x=this.pull[w]={id:w,$footer:!0,value:g.value,$level:e,$count:0,$parent:g.id,$row:s.footer.row};for(var y in s.footer){var M=s.footer[y][1]||"any",S=this.ka(s.footer[y][0]);"function"!=typeof M&&(Bs[M],M=Bs[M]),x[y]=M.call(this,S,this.branch[o[b].id].$a)}this.branch[g.id].push(x.id),this.callEvent("onGroupFooter",[x.id,x.value,this.branch[g.id].$a])}delete this.branch[g.id].$a}this.Aa(r,i,e+1),this.callEvent("onStoreUpdated",[])},Sa:function(t,i,s){if(s||this.Ma){this.Ma=Math.max(0,this.Ma-1),i=i||0;for(var e=[],n=this.branch[i],h=0;h<n.length;h++){var r=n[h],o=this.branch[r];o&&(e=e.concat(o)),delete this.pull[r],delete this.branch[r]}for(var a=(this.branch[i]=e).length-1;0<=a;a--)this.pull[e[a]].$footer&&e.splice(a,1);this.Aa(e,0,1),t||this.callEvent("onStoreUpdated",[])}},Aa:function(t,i,s){i&&(this.getItem(i).$count=t.length);for(var e=0;e<t.length;e++){var n=this.pull[t[e]];n.$level=s,n.$parent=i;var h=this.branch[n.id];h&&this.Aa(h,n.id,s+1)}}},Ps={$init:function(){H.extend(this.data,Rs),this.data.attachEvent("onClearAll",C(function(){this.data.pr=this.data.ya=null,this.Ma=0},this))},group:function(t){this.data.ungroup(!0),this.data.group(t)},ungroup:function(t){this.data.ungroup(t)}},js={$init:function(){(Qi.customRadio||this.addOption)&&Lt(this.$view,"keydown",this.Ia,{bind:this})},Hs:function(){if(!Vi.canFocus(this)
)return!1;var t=this.Fa();if(t)for(var i=0;i<t.length;i++)"0"==t[i].getAttribute("tabindex")&&t[i].focus()},Ta:function(){var t=this.Fa();if(t)for(var i=0;i<t.length;i++)"0"==t[i].getAttribute("tabindex")&&t[i].blur()},Ia:function(t){var i=t.which||t.keyCode;if((this.addOption?34:36)<i&&i<41){var s;Q(t);var e=this.Fa();if(35==i)s=e.length-1;else if(36===i)s=0;else for(var n=37===i||38===i?-1:1,h=0;h<e.length;h++)if("0"==e[h].getAttribute("tabindex")){(s=h+n)<0?s=e.length-1:s>=e.length&&(s=0);break}if(!D(s)){var r=e[s].getAttribute("button_id");this.setValue(r),e[s].focus()}}}},Ns=H.proto({$init:function(t){this.za="map_"+z(),this.Va=t,this.Ha=[],this.Ba=[]},addRect:function(t,i,s){this.Ra(t,"RECT",i,s)},addPoly:function(t,i,s){this.Ra(t,"POLY",i,s)},Ra:function(t,i,s,e){var n="";4==arguments.length&&(n="userdata='"+e+"'"),this.Ha.push("<area "+this.Va+"='"+t+"' shape='"+i+"' coords='"+s.join()+"' "+n+"></area>"),this.Ba.push({index:e,points:s})},addSector:function(t,i,s,e,n,h,r,o){var a=[];a.push(e),a.push(Math.floor(n*r));for(var u=i;u<s;u+=Math.PI/18)a.push(Math.floor(e+h*Math.cos(u))),a.push(Math.floor((n+h*Math.sin(u))*r));return a.push(Math.floor(e+h*Math.cos(s))),a.push(Math.floor((n+h*Math.sin(s))*r)),a.push(e),a.push(Math.floor(n*r)),this.addPoly(t,a,o)},hide:function(t,i,s){if(t.querySelectorAll)for(var e=t.querySelectorAll('area[userdata="'+i+'"]'),n=0;n<e.length;n++){var h=e[n];s?h.getAttribute("coords")&&(h.coordsdis=h.getAttribute("coords"),h.setAttribute("coords",""),h.coords=""):s||h.coordsdis&&(h.setAttribute("coords",h.coordsdis),h.coords=h.coordsdis,h.coordsdis=""),e[n].style.display=s?"none":""}},render:function(t){var i=Y("DIV");i.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;",t.appendChild(i);var s=S.isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";i.innerHTML="<map id='"+this.za+"' name='"+this.za+"'>"+this.Ha.join("\n")+"</map><img "+s+" class='webix_map_img' usemap='#"+this.za+"'>",t.ne=i,this.Ha=[]}}),Es={$init:function(){this.Ie={},this.Fe={},this.getTopParentView=this.Pa=C(function(){return this},this),this.ja(),this.$ready.push(this.Na)},$$:function(t){return this.Ie[t]},innerId:function(t){return this.Fe[t]},ja:function(){this.Ae=M.n,M.n=this},Na:function(){for(var t in this.Ie){var i=this.Ie[t];this.callEvent&&i.mapEvent&&!i.B.onitemclick&&i.mapEvent({onitemclick:this}),i.getTopParentView=this.Pa}M.n=this.Ae,this.Ae=0},ee:function(t){delete this.Ie[t]},ui:function(){this.ja();var t=Vt.apply(this,arguments);return this.Na(),t}},Ls={$init:function(){this.getSelectedId&&this.attachEvent("onAfterRender",this.Ea),this.moveSelection&&this.attachEvent("onTabFocus",this.La)},La:function(){if(this.getSelectedId){var t=this.getSelectedId(!0);t.length&&this.getItemNode(t[0])||this.moveSelection("down")}},Ea:function(){var t=this.getSelectedId(!0);if(!t.length||!this.getItemNode(t[0])){var i=this.bt.querySelector("["+this.za+"]");i&&i.setAttribute("tabindex","0")}},Oa:function(n){return function(t,i){var s=i.srcElement||i.target;if(!s.getAttribute("webixignore")){var e=s.tagName;if("INPUT"==e||"TEXTAREA"==e||"SELECT"==e)return!0}return!(t&&t.moveSelection&&t.config.navigation&&!t.Gs)||(Q(i),t.moveSelection(n,{shift:i.shiftKey,ctrl:i.ctrlKey}))}},moveSelection:function(t,i,s){var e=this.q;if(!e.disabled){var n=this.getSelectedId(!0),h=this.count&&("x"==e.layout||1<e.xCount);if(("right"==t||"left"==t)&&this.Ua){var r=jt(this.Ua);return r.Ya(!0),void("x"===r.config.layout?r.moveSelection(t):Vi.setFocus(r))}if(!n.length&&this.count()){if("down"==t||"right"==t&&h)t="top";else{if(!("up"==t||"left"==t&&h))return;t="bottom"}n=[this.getFirstId()]}if(1==n.length){var o=n=n[0];if("left"==t&&this.close)return this.close(n);if("right"==t&&this.open)return this.open(n);if("top"==t)n=this.getFirstId();else if("bottom"==t)n=this.getLastId();else if("up"==t||"left"==t||"pgup"==t){var a=this.getIndexById(n),u="pgup"==t?10:1;n=this.getIdByIndex(Math.max(0,a-u))}else{if("down"!=t&&"right"!=t&&"pgdown"!=t)return
;var c=this.getIndexById(n),f="pgdown"==t?10:1;n=this.getIdByIndex(Math.min(this.count()-1,c+f))}if(this.Wa&&(n=this.Wa(n,o,t)),this.showItem(n),this.select(n),this.getSubMenu&&this.getSubMenu(n)&&this.Ga(n,this.getItemNode(n)),!this.config.clipboard&&!1!==s){var l=this.getItemNode(n);l&&l.focus()}}return!1}},navigation_setter:function(t){return t&&!Vi.Xa&&(Vi.Xa=!0,Vi.addHotKey("up",this.Oa("up")),Vi.addHotKey("down",this.Oa("down")),Vi.addHotKey("right",this.Oa("right")),Vi.addHotKey("left",this.Oa("left")),Vi.addHotKey("shift+up",this.Oa("up")),Vi.addHotKey("shift+down",this.Oa("down")),Vi.addHotKey("shift+right",this.Oa("right")),Vi.addHotKey("shift+left",this.Oa("left")),Vi.addHotKey("ctrl+shift+up",this.Oa("up")),Vi.addHotKey("ctrl+shift+down",this.Oa("down")),Vi.addHotKey("ctrl+shift+right",this.Oa("right")),Vi.addHotKey("ctrl+shift+left",this.Oa("left")),Vi.addHotKey("pageup",this.Oa("pgup")),Vi.addHotKey("pagedown",this.Oa("pgdown")),Vi.addHotKey("home",this.Oa("top")),Vi.addHotKey("end",this.Oa("bottom"))),t}},Os={$init:function(){this.$ready.push(this.Ja),this.attachEvent("onStructureUpdate",this.Ja),this.attachEvent("onStructureLoad",function(){this.Ka.length||this.Ja()})},Ja:function(){var s=this.Ka=[],t=this.q;t.columns&&this.qa(t.columns),this.q.map&&this.Za(t.map),s.length&&(this.data.wr=function(t){for(var i=0;i<s.length;i++)s[i](t)})},Za:function(t){for(var i in t)this.Ka.push(this.Qa(i,t[i]))},Qa:function(s,t,i){var e,n=t.replace(/^(\s|)\((date|number)\)/,"");return e=""===n?function(t){return t[s]}:(-1===n.indexOf("#")&&-1===n.indexOf("{")&&(n="#"+n+"#"),Ft(n)),0===t.indexOf("(date)")?(i&&!i.format&&(i.format=ct.dateFormatStr),function(t){var i=(e(t)||"").toString();t[s]=ct.parseFormatDate(i)}):0===t.indexOf("(number)")?function(t){t[s]=1*e(t)}:function(t){t[s]=e(t)||""}},qa:function(t){for(var i=0;i<t.length;i++){var s=t[i].map,e=t[i].id;e||(e=t[i].id="i"+z(),t[i].header||(t[i].header="")),s&&this.Ka.push(this.Qa(e,s,t[i])),this.tu(t[i])}},tu:function(t){var i=t.options||t.collection;if(i)if("string"==typeof i){var s=jt(i);s||(s=new(d("DataCollection"))({url:i}),this.rt.push(s)),s.getBody&&(s=s.getBody()),this.iu(s,t)}else if(i.loadNext)this.iu(i,t);else if(i[0]&&"object"==k(i[0]))i=new(d("DataCollection"))({data:i}),this.iu(i,t),this.rt.push(i);else{if(b(i)){for(var e={},n=0;n<i.length;n++)e[i[n]]=i[n];t.options=i=e}t.template=t.template||this.su(i,t.id,t.optionslist)}},iu:function(t,i){if(i){delete i.options,i.collection=t,i.template=i.template||this.eu(t,i.id,i.optionslist);var s=t.data.attachEvent("onStoreUpdated",C(function(){this.refresh(),this.refreshFilter&&this.refreshFilter(i.id)},this));this.attachEvent("onDestruct",function(){t.$destructed||t.data.detachEvent(s)})}},su:function(n,h,t){if(t){var r="string"==typeof t?t:",";return function(t){var i=t[h]||t.value;if(!i)return"";for(var s=i.split(r),e=0;e<s.length;e++)s[e]=n[s[e]]||"";return s.join(", ")}}return function(t){return n[t[h]]||t.value||""}},eu:function(h,r,t){if(t){var o="string"==typeof t?t:",";return function(t){var i=t[r]||t.value;if(!i)return"";for(var s=i.split(o),e=0;e<s.length;e++){var n=h.data.pull[s[e]];s[e]=n&&n.value||""}return s.join(", ")}}return function(t){var i=t[r]||t.value,s=h.data.pull[i];return s&&(s.value||0===s.value)?s.value:""}}},Us={$init:function(t){t=t||{},this.nu=0,this.hu=300,this.ru=null,this.ou(t.onClick,"on_click"),this.ou(t.onContext,"on_context"),this.ou(t.onDblClick,"on_dblclick"),this.ou(t.onMouseMove,"on_mouse_move"),this.on_click&&(Lt(this.re,"click",this.au,{bind:this}),S.isIE8&&this.on_dblclick&&Lt(this.re,"dblclick",this.uu,{bind:this})),this.on_context&&Lt(this.re,"contextmenu",this.cu,{bind:this}),this.on_mouse_move&&this.Oe()},Oe:function(){this.fu||(this.on_mouse_move=this.on_mouse_move||{},Lt(this.re,"mousemove",this.lu,{bind:this}),Lt(this.re,S.isIE?"mouseleave":"mouseout",this.lu,{bind:this}),this.fu=1,this.attachEvent("onDestruct",function(){this.du&&window.clearTimeout(this.du)}))},ou:function(t,i){if(t){var s=this[i],e=s?H.extend({},s):{};this[i]=H.extend(e,t)}},au:function(t){if(
!this.isEnabled())return!1;if(Vi.ut(this),this.on_dblclick){var i=(new Date).valueOf();if(i-this.nu<=this.hu&&this.locate)if(""+this.locate(t)==""+this.ru)return this.nu=0,this.uu(t);this.nu=i}return this.vu(t,this.on_click,"ItemClick")},uu:function(t){return this.vu(t,this.on_dblclick,"ItemDblClick")},cu:function(t){this.vu(t,this.on_context,"BeforeContextMenu","AfterContextMenu")},lu:function(t){if(!this.$destructed){if(document.createEventObject)t=document.createEventObject(event);else if(!D(t.movementY)&&!t.movementY&&!t.movementX)return;this.du&&window.clearTimeout(this.du),this.callEvent("onMouseMoving",[t]),this.du=window.setTimeout(C(function(){"mousemove"==t.type?this._u(t):this.pu(t)},this),this.q.mouseEventDelay||500)}},_u:function(t){this.vu(t,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[t||event])},pu:function(t){this.callEvent("onMouseOut",[t||event])},vu:function(t,i,s,e){if(!(t=t||event).processed&&this.nt){t.processed=!0;var n=t.target||t.srcElement;if(S.isIE8){var h=this.q.id,r=n.w_view;if(r){if(r!==h)return}else n.w_view=h}for(var o="",a=null,u=!1;n&&n.parentNode&&this.nt&&n!=this.nt.parentNode;){if(!u&&n.getAttribute&&(a=n.getAttribute(this.za))){if(this.ru=a,this.callEvent){if(!this.callEvent("on"+s,[a,t,n]))return;e&&this.callEvent("on"+e,[a,t,n])}u=!0}if(o=rt(n)){o=o.toString().split(" ");for(var c=0;c<o.length;c++){if(i[o[c]])if(!1===m(i[o[c]],this.$scope).call(this,t,a||J(t,this.za),n))return u}}n=n.parentNode}return u}}},Ys={$init:function(){this.$ready.push(function(){this.attachEvent("onKeyPress",this.je)})},mu:function(t,i){if(37===t||39===t){Q(i),this.bu(37===t?-1:1);var s=this.gu.querySelector("[tabindex='0']");s&&s.focus()}},wu:function(){G(this.gu),this.gu=Y("DIV",{"class":"webix_nav_panel webix_nav_panel_"+this.q.navigation.type,role:"tablist"},""),this.nt.appendChild(this.gu),this.xu(),this.yu(),this.Mu()},Mu:function(){var i=[];this.gu&&(i[0]=Ot(this.gu,"click",C(function(t){for(var i=t.srcElement||t.target,s=!1;i!=this.gu&&!s;){var e=i.getAttribute(this.Su);e&&(s=!0,this.ku(e)),i=i.parentNode}},this))),this.Cu&&(i[1]=Ot(this.Cu,"click",C(function(){this.bu(-1)},this))),this.Du&&(i[1]=Ot(this.Du,"click",C(function(){this.bu(1)},this))),this.attachEvent("onDestruct",function(){for(var t=0;t<i.length;t++)this.detachEvent(i[t]);i=null})},bu:function(t){if(this.Ks){var i=this.$u+t;(i>=this.Ks.length||i<0)&&(i=i<0?this.Ks.length-1:0),this.setActiveIndex(i)}},ku:function(t){this.Ks&&jt(t).show()},xu:function(){var t,i;if((i=this.q.navigation).items){this.Su=i.linkAttr||"bind_id",this.gu?this.Au():this.wu();var s=this.Ks?this.Ks:this.data.order;if(1<s.length)for(var e=0;e<s.length;e++){t=Y("DIV",{"class":"webix_nav_item webix_nav_"+(e==this.$u?"active":"inactive"),role:"tab",tabindex:e==this.$u?"0":"-1"});var n=this.Ks?this.Ks[e].q.id:s[e];n&&t.setAttribute(this.Su,n),this.gu.appendChild(t)}}},Au:function(){if(this.gu)for(var t=this.gu.childNodes,i=t.length-1;0<=i;i--)G(t[i])},yu:function(){var t=this.q.navigation;t.buttons&&(this.Cu&&G(this.Cu),this.Cu&&G(this.Du),this.Cu=Y("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_prev "},'<div role="button" tabindex="0" aria-label="'+ct.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.nt.appendChild(this.Cu),this.Du=Y("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_next "},'<div role="button" tabindex="0" aria-label="'+ct.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.nt.appendChild(this.Du))}},Ws={showOverlay:function(t){this.Iu?this.Iu.innerHTML=t:(this.Iu=Y("DIV",{"class":"webix_overlay"},t||""),X(this.Iu,this.nt.firstChild,this.nt),this.nt.style.position="relative")},hideOverlay:function(){this.Iu&&(G(this.Iu),this.Iu=null)}},Gs={pager_setter:function(e){if("string"==typeof e){var t=jt(e);if(!t)return this.$blockRender=!0,$(function(){var t=jt(e);this.q.pager=this.pager_setter(t);var i=t.q;i.count=this.data.Fu(i.level),t.refresh(),this.$blockRender=!1,this.render()},this),null;e=t}return this.attachEvent("onBeforeRender",function n(t){if(e.config.autosize&&this.getVisibleCount){
var i=this.getVisibleCount();isNaN(i)?(e.config.size=1,$(n,this,[!0])):i!=e.config.size&&(e.config.size=i,e.refresh(),!0===t&&this.refresh())}var s=this.q.pager;return-1!=s.page&&(this.data.$min=this.Tu(0,s.page*s.size),this.data.$max=this.Tu(this.data.$min,s.size),this.data.$pagesize=this.data.$max-this.data.$min,!0)}),e.$view||(e.view="pager",e=Vt(e)),((this.zu=e).$master=this).data.attachEvent("onStoreUpdated",function(){var t=e.q;t.count=this.Fu(t.level),e.refresh()}),this.data.Fu=this.Fu,e.q},Fu:function(i){if(i&&0!==i){var s=0;return this.each(function(t){t.$level==i&&s++}),s}return this.count()},Tu:function(t,i){var s=this.q.pager;if(s.level&&0!==s.level){var e=t,n=this.data.order.length;if(i)for(;e<n;){if(this.data.order[e]&&this.data.getItem(this.data.order[e]).$level==s.level){if(0===i)break;i--}e++}return e}return t+i},setPage:function(t){this.zu&&this.zu.select(t)},getPage:function(){return this.zu.q.page},getPager:function(){return this.zu}},Xs={$init:function(){D(this.Vu)&&this.attachEvent&&(this.attachEvent("onBeforeLoad",this.showProgress),this.attachEvent("onAfterLoad",this.hideProgress),this.Vu=null)},showProgress:function(h){if(!this.Vu){var t="icon"==(h=H.extend({position:0,delay:2e3,type:"icon",icon:"wxi-sync",hide:!1},h||{},!0)).type?h.icon+" webix_spin":"";if(this.Vu=Y("DIV",{"class":"webix_progress_"+h.type,role:"progressbar","aria-valuemin":"0","aria-valuemax":"100",tabindex:"0"},"<div class='webix_progress_state "+t+"'></div>"),this.setPosition||(this.nt.style.position="relative"),X(this.Vu,this.nt.firstChild,this.nt),this.nt.setAttribute("aria-busy","true"),!Mi.$active&&this.getScrollState){var i=this.getScrollState();this.nt.scrollWidth!=this.$width&&(this.Vu.style.left=i.x+"px"),this.nt.scrollHeight!=this.$height&&("bottom"!=h.type?this.Vu.style.top=i.y+"px":this.Vu.style.top=i.y+this.$height-this.Vu.offsetHeight+"px")}this.Hu=1}h&&"icon"!=h.type?$(function(){if(this.Vu){var t=h.position||1;if(this.Vu.style[S.transitionDuration]===undefined&&h.delay){var i=0,s=0,e=t/h.delay*30,n=this;this.Bu&&(window.clearInterval(this.Bu),s=this.Vu.firstChild.offsetWidth/this.Vu.offsetWidth*100),this.Bu=window.setInterval(function(){30*i==h.delay?window.clearInterval(n.Bu):(n.Vu&&n.Vu.firstChild&&(n.Vu.firstChild.style.width=s+i*e*t*100+"%"),i++)},30)}else this.Vu.firstChild.style.width=100*t+"%",h.delay&&(this.Vu.firstChild.style[S.transitionDuration]=h.delay+"ms");h.hide&&$(this.hideProgress,this,[1],h.delay)}this.Hu=0},this):h&&"icon"==h.type&&h.hide&&$(this.hideProgress,this,[1],h.delay)},hideProgress:function(t){this.Hu&&(t=!0),this.Vu&&(t?(this.Bu&&window.clearInterval(this.Bu),G(this.Vu),this.Vu=null,this.nt.removeAttribute("aria-busy")):this.showProgress({position:1.1,delay:300,hide:!0}))}},Js={$init:function(){this.data,this.es=document.createElement("DIV"),this.data.attachEvent("onIdChange",C(this.xr,this)),this.attachEvent("onItemClick",this.Ru),this.types||(this.types={"default":this.type},this.type.name="default"),this.type=f(this.type)},customize:function(t){Tt(this,t)},item_setter:function(t){return this.type_setter(t)},type_setter:function(t){return this.types[t]?(this.type=f(this.types[t]),this.type.css&&(this.re.className+=" "+this.type.css)):this.customize(t),this.type.on_click&&H.extend(this.on_click,this.type.on_click),t},template_setter:function(t){this.type.template=Ft(t)},Lt:function(t){var i=this.data.fr[t.id];return!t.$template||this.type["template"+t.$template],t.$template,this.callEvent("onItemRender",[t]),this.type.templateStart(t,this.type,i)+(t.$template?this.type["template"+t.$template]:this.type.template)(t,this.type,i)+this.type.templateEnd(t,this.type,i)},Pu:function(t){return this.es.innerHTML=this.Lt(t),this.es.firstChild},xr:function(t,i){var s=this.getItemNode(t);s&&(s.setAttribute(this.za,i),this.ne[i]=this.ne[t],delete this.ne[t])},Ru:function(){if(this.q.click){var t=m(this.q.click,this.$scope);t&&t.call&&t.apply(this,arguments)}},getItemNode:function(t){if(this.ne)return this.ne[t];this.ne={};for(var i=this.bt.childNodes,s=0;s<i.length;s++){var e=i[s].getAttribute(
this.za);e&&(this.ne[e]=i[s])}return this.getItemNode(t)},locate:function(t){return J(t,this.za)},showItem:function(t){var i=this.getItemNode(t);if(i&&this.scrollTo){var s=i.offsetLeft,e=s+i.offsetWidth,n=i.offsetTop,h=n+i.offsetHeight,r=this.getScrollState(),o=r.x;(s<o||o+this.ze<e)&&(o=s);var a=r.y;(n<a||a+this.He<h)&&(a=n),this.scrollTo(o,a),this.ju&&this.ju(t)}},render:function(t,i,s){if(this.isVisible(this.q.id)&&!this.$blockRender)if(t){var e=this.getItemNode(t);switch(s){case"paint":case"update":if(!e)return;X(this.ne[t]=this.Pu(i),e),G(e);break;case"delete":if(!e)return;G(e),delete this.ne[t];break;case"add":X(this.ne[t]=this.Pu(i),this.getItemNode(this.data.getNextId(t)),this.bt);break;case"move":X(this.getItemNode(t),this.getItemNode(this.data.getNextId(t)),this.bt)}}else this.callEvent("onBeforeRender",[this.data])&&((this.Nu||this.bt).innerHTML=this.data.getRange().map(this.Lt,this).join(""),this.ne=null,this.callEvent("onAfterRender",[]))}},Ks={$init:function(t){if(t&&!t.scroll&&this.Eu)return this.bt=this.bt||this.re;(this.bt||this.re).appendChild(Y("DIV",{"class":"webix_scroll_cont"},"")),this.bt=(this.bt||this.re).firstChild,S.touch&&"native"!==S.touch||Lt(this.nt,"scroll",C(function(){this.callEvent&&$(function(){this.callEvent("onAfterScroll",[])},this)},this))},scroll_setter:function(t){if(!t)return!1;var i="x"==t?"x":"xy"==t?"xy":"a"==t?"xy":"y";if(Mi.$active&&"native"!=S.touch)this.bt.setAttribute("touch_scroll",i),this.attachEvent&&this.attachEvent("onAfterRender",C(this.Lu,this)),this.Ou=!0;else if(S.$customScroll)ms.enable(this,i);else{var s=this.bt.parentNode.style;-1!=t.toString().indexOf("a")?s.overflowX=s.overflowY="auto":(-1!=i.indexOf("x")&&(this.Be=!0,s.overflowX="scroll"),-1!=i.indexOf("y")&&(this.Ve=!0,s.overflowY="scroll"))}return i},Uu:function(t,i){if(!!this.q.scroll!=!!t){if(!S.$customScroll)this.bt.parentNode.style["x"===i?"overflowX":"overflowY"]=t?"auto":"hidden";"x"===i?this.Be=t:this.Ve=t,this.q.scroll=!!t&&i}},getScrollState:function(){if(Mi.$active){var t=Mi.Mi(this.bt);return{x:-t.e,y:-t.f}}return{x:this.bt.parentNode.scrollLeft,y:this.bt.parentNode.scrollTop}},scrollTo:function(t,i){Mi.$active&&"native"!=S.touch?(i=Math.max(0,Math.min(i,this.bt.offsetHeight-this.He)),t=Math.max(0,Math.min(t,this.bt.offsetWidth-this.ze)),Mi.Ci(this.bt,-t,-i,this.q.scrollSpeed||"100ms")):(this.bt.parentNode.scrollLeft=t,this.bt.parentNode.scrollTop=i)},Lu:function(){-1!=this.q.scroll.toString().indexOf("x")&&(this.bt.scrollWidth&&(this.bt.style.width="100%",this.bt.style.width=this.bt.scrollWidth+"px"));if(Mi.$active&&this.Ou){Mi.ii(),Mi.yi();var t=this.getScrollState(),i=this.bt.offsetWidth-this.$width-t.x,s=this.bt.offsetHeight-this.$height-t.y;if(i<0||s<0){var e=i<0?Math.min(-i-t.x,0):-t.x,n=s<0?Math.min(-s-t.y,0):-t.y;Mi.Ci(this.bt,e,n,0)}}}},qs={$init:function(){this.Un=p(),this.data,this.data.attachEvent("onStoreUpdated",C(this.Yu,this)),this.data.attachEvent("onStoreLoad",C(this.Wu,this)),this.data.attachEvent("onAfterFilter",C(this.Gu,this)),this.data.attachEvent("onSyncApply",C(this.Xu,this)),this.data.attachEvent("onIdChange",C(this.Ju,this)),this.$ready.push(this.Ku)},Ku:function(){("multiselect"==this.q.select||this.q.multiselect||"area"==this.q.select)&&Lt(this.$view,"mousedown",function(t){(t||Ot).shiftKey&&st(M.$=this,"webix_noselect",1)})},Ju:function(t,i){for(var s=this.Un.length-1;0<=s;s--)this.Un[s]==t&&(this.Un[s]=i)},Gu:function(){for(var t=this.Un.length-1;0<=t;t--)if(this.data.getIndexById(this.Un[t])<0){var i=this.Un[t];this.removeCss(i,"webix_selected",!0),this.Un.splice(t,1),this.callEvent("onSelectChange",[i])}},Yu:function(t,i,s){"delete"==s?this.loadBranch?this.Xu():this.Un.remove(t):t||this.data.count()||this.data.lr||(this.Un=p())},Wu:function(){this.q.select&&this.data.each(function(t){t&&t.$selected&&this.select(t.id)},this)},Xu:function(){for(var t=this.Un.length-1;0<=t;t--)this.exists(this.Un[t])||this.Un.splice(t,1)},qu:function(t,i,s,e){var n=i?"onBeforeSelect":"onBeforeUnSelect";if(!this.callEvent(n,[t,i]))return!1;e&&(this.Zu=!0,this.unselectAll(),
this.Zu=!1),i?this.addCss(t,"webix_selected",!0):this.removeCss(t,"webix_selected",!0),s?s.push(t):(i?this.Un.push(t):this.Un.remove(t),this.Qu(t));var h=i?"onAfterSelect":"onAfterUnSelect";return this.callEvent(h,[t]),!0},select:function(t,i){var s=arguments[2],e=arguments[3];if(!t)return this.selectAll();if(b(t))for(var n=0;n<t.length;n++)this.select(t[n],n?1:i,s,e);else{if(this.data.exists(t),e&&this.Un.length)return this.selectAll(this.Un[this.Un.length-1],t);var h=!1;s||i||1==this.Un.length&&this.Un[0]==t||(h=!0),h||!this.isSelected(t)?this.qu(t,!0,null,h):s&&this.unselect(t)}},unselect:function(t){if(!t)return this.unselectAll();this.isSelected(t)&&this.qu(t,!1)},selectAll:function(t,i){var s=[];(t||i?this.data.getRange(t||null,i||null):this.data.getRange()).each(function(t){this.data.getMark(t.id,"webix_selected")||(this.Un.push(t.id),this.qu(t.id,!0,s))},this),this.Qu(s)},unselectAll:function(){var i=[];this.Un.each(function(t){this.qu(t,!1,i)},this),this.Un=p(),this.Qu(i)},isSelected:function(t){return-1!=this.Un.find(t)},getSelectedId:function(t){switch(this.Un.length){case 0:return t?[]:"";case 1:return t?[this.Un[0]]:this.Un[0];default:return[].concat(this.Un)}},getSelectedItem:function(t){var i=this.getSelectedId(!0);if(1<i.length||t){for(var s=i.length-1;0<=s;s--)i[s]=this.getItem(i[s]);return i}if(i.length)return this.getItem(i[0])},tc:function(t){return 100<t.length||t.length>this.data.count/2},Qu:function(t){if("object"!=k(t)&&(t=[t]),t.length){if(this.tc(t))this.data.refresh();else for(var i=0;i<t.length;i++)this.render(t[i],this.data.getItem(t[i]),"update");this.Zu||this.callEvent("onSelectChange",[t])}}};mi(function(){Ot(document.body,"mouseup",function(){M.$&&(et(M.$,"webix_noselect"),M.$=null)})});var Zs={ic:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],toHex:function(t,i){t=parseInt(t,10);for(var s="";0<t;)s=this.ic[t%16]+s,t=Math.floor(t/16);for(;s.length<i;)s="0"+s;return s},rgbToHex:function(t){var i=[];return"string"==typeof t?t.replace(/[\d+.]+/g,function(t){i.push(parseFloat(t))}):b(t)&&(i=t),0===i[3]?"":i.slice(0,3).map(function(t){return Zs.toHex(Math.floor(t),2)}).join("")},hexToDec:function(t){return parseInt(t,16)},toRgb:function(t){var i,s,e,n;return e="string"!=typeof t?(i=t[0],s=t[1],t[2]):-1!=t.indexOf("rgb")?(i=(n=t.substr(t.indexOf("(")+1,t.lastIndexOf(")")-t.indexOf("(")-1).split(","))[0],s=n[1],n[2]):("#"==t.substr(0,1)&&(t=t.substr(1)),i=this.hexToDec(t.substr(0,2)),s=this.hexToDec(t.substr(2,2)),this.hexToDec(t.substr(4,2))),((i=parseInt(i,10)||0)<0||255<i)&&(i=0),((s=parseInt(s,10)||0)<0||255<s)&&(s=0),((e=parseInt(e,10)||0)<0||255<e)&&(e=0),[i,s,e]},hsvToRgb:function(t,i,s){var e,n,h,r,o,a,u,c;switch(h=s*(1-i),r=s*(1-(n=t/60-(e=Math.floor(t/60)%6))*i),o=s*(1-(1-n)*i),c=u=a=0,e){case 0:a=s,u=o,c=h;break;case 1:a=r,u=s,c=h;break;case 2:a=h,u=s,c=o;break;case 3:a=h,u=r,c=s;break;case 4:a=o,u=h,c=s;break;case 5:a=s,u=h,c=r}return[a=Math.floor(255*a),u=Math.floor(255*u),c=Math.floor(255*c)]},rgbToHsv:function(t,i,s){var e,n,h,r,o,a,u;return e=t/255,n=i/255,h=s/255,r=Math.min(e,n,h),a=0,(u=o=Math.max(e,n,h))==r?a=0:o==e&&h<=n?a=60*(n-h)/(o-r)+0:o==e&&n<h?a=60*(n-h)/(o-r)+360:o==n?a=60*(h-e)/(o-r)+120:o==h&&(a=60*(e-n)/(o-r)+240),[a,0===o?0:1-r/o,u]}};function Qs(t){var i=" ";if(t)for(var s in t)i+=s+'="'+t[s]+'" ';return i}var te={draw:function(t,i,s,e){return"<svg "+Qs({xmlns:"http://www.w3.org/2000/svg",version:"1.1",height:"100%",width:"100%",viewBox:"0 0 "+i+" "+s,"class":e||""})+">"+t+"</svg>"},styleMap:{lineColor:"stroke",color:"fill"},group:function(t){return"<g>"+t+"</g>"}};te.sc={M:function(t){return" M "+t.x+" "+t.y},L:function(t){return" L "+t.x+" "+t.y},C:function(t,i,s){return" C "+t.x+" "+t.y+" "+i.x+" "+i.y+" "+s.x+" "+s.y},A:function(t,i,s,e){var n=t.x+Math.cos(e)*i,h=t.y+Math.sin(e)*i;return" A "+i+" "+i+" 0 "+(e-s>=Math.PI?1:0)+" 1 "+n+" "+h}},te.definePath=function(t,i){for(var s="",e=0;e<t.length;e++){t[e][0]&&t[e][0];var n=t[e][0].toUpperCase();this.sc[n],s+=this.sc[n].apply(this,t[e].slice(1))}return i&&(s+=" Z"),s},te.ec=function(t){for(
var i=[],s=0;s<t.length;s++)i.push([s?"L":"M",t[s]]);return i},te.setOpacity=function(t,i){var s=Zs.toRgb(t);return s.push(i),"rgba("+s.join(",")+")"},te.nc=function(t){for(var i=[],s=0;s<t.length;s++){var e=t[s];s||i.push(["M",e[0]]),i.push(["C",e[1],e[2],e[3]])}return i},te.getPath=function(t,i,s){return'<path class="'+i+'" vector-effect="non-scaling-stroke" d="'+t+'" '+(s=Qs(s))+"/>"},te.getSector=function(t,i,s,e,n,h){h=Qs(h);var r=[["M",t],["L",{x:t.x+Math.cos(s)*i,y:t.y+Math.sin(s)*i}],["A",t,i,s,e],["L",t]];return'<path class="'+n+'" vector-effect="non-scaling-stroke" d="'+te.definePath(r,!0)+'" '+h+"/>"},te.getCurve=function(t,i,s){return s=Qs(s),'<path fill="none" class="'+i+'" vector-effect="non-scaling-stroke" d="'+this.definePath(this.nc(t))+'" '+s+"/>"},te.getLine=function(t,i,s,e){return this.getPath(this.definePath(this.ec([t,i]),!0),s,e)},te.getCircle=function(t,i,s,e){return e=Qs(e),'<circle class="'+s+'" cx="'+t.x+'" cy="'+t.y+'" r="'+i+'" '+e+"/>"},te.getRect=function(t,i,s,e,n,h){return'<rect class="'+n+'" rx="0" ry="0" x="'+t+'" y="'+i+'" width="'+s+'" height="'+e+'" '+(h=Qs(h))+"/>"};var ie={paddingX:6,paddingY:6,radius:2,minHeight:4,eventRadius:8};function se(t){this.config=H.extend(B(ie),t||{},!0)}se.prototype.draw=function(t,i,s){var e=this.getPoints(t,i,s),n=this.config,h=te,r=n.color?this.hc(h,n.color):null,o=h.definePath(this.rc(e)),a=h.group(h.getPath(o,"webix_sparklines_line"+(r?" "+r.line:"")));a+=this.oc(h,e,n.radius,"webix_sparklines_item"+(r?" "+r.item:""));var u=Math.min(t.length?(i-2*(n.paddingX||0))/t.length:0,n.eventRadius);return a+=this.ac(h,e,u),h.draw(a,i,s,"webix_sparklines_line_chart"+(n.css?" "+n.css:""))},se.prototype.hc=function(t,i){var s={line:{},item:{}},e=t.styleMap;if(i)for(var n in s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},se.prototype.oc=function(t,i,s,e,n){for(var h=[],r=0;r<i.length;r++)h.push(t.getCircle(i[r],s,e,n));return t.group(h.join(""))},se.prototype.ac=function(t,i,s){for(var e=[],n=0;n<i.length;n++)e.push(t.getCircle(i[n],s,"webix_sparklines_event_area",{webix_area:n}));return t.group(e.join(""))},se.prototype.rc=function(t){var i,s,e=[];for(i=0;i<t.length;i++)s=i?"L":"M",e.push([s,t[i]]);return e},se.prototype.getPoints=function(t,i,s){var e=this.config,n=Math.min.apply(null,t);"undefined"!=typeof e.origin&&(n=Math.min(e.origin,n));var h=Math.max.apply(null,t),r=[],o=e.paddingX||0,a=e.paddingY||0;i=(i||100)-2*o;var u=e.minHeight||0;if(s=(s||100)-2*a,t.length)if(1==t.length)r.push({x:i/2+o,y:s/2+o});else{var c=i/(t.length-1),f=e.scale||h-n,l=(s-u)/(f||1);f||(s/=2);for(var d=0;d<t.length;d++)r.push({x:Math.ceil(c*d)+o,y:s-Math.ceil(l*(t[d]-n))+a-u})}return r};var ee={paddingX:3,paddingY:4,radius:1,minHeight:4,eventRadius:8};function ne(t){this.config=H.extend(B(ee),t||{},!0)}ne.prototype.draw=function(t,i,s){var e,n,h,r,o,a=this.config,u=se.prototype,c=te;return r=this.getPoints(t,i,s),h=c.definePath(u.rc(r),!0),a.color&&(o=this.hc(c,a.color)),n=c.group(c.getPath(h,"webix_sparklines_area"+(o?" "+o.area:""))),r.splice(r.length-3,3),h=c.definePath(u.rc(r)),n+=c.group(c.getPath(h,"webix_sparklines_line"+(o?" "+o.line:""))),n+=u.oc(c,r,a.radius,"webix_sparklines_item"+(o?" "+o.item:"")),e=Math.min(t.length?(i-2*(a.paddingX||0))/t.length:0,a.eventRadius),n+=u.ac(c,r,e),c.draw(n,i,s,"webix_sparklines_area_chart"+(a.css?" "+a.css:""))},ne.prototype.hc=function(t,i){var s={area:{},line:{},item:{}},e=t.styleMap;if(i)for(var n in s.area[e.color]=t.setOpacity(i,.2),s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},ne.prototype.getPoints=function(t,i,s){var e=se.prototype.getPoints.call(this,t,i,s),n=this.config.paddingX||0,h=this.config.paddingY||0;return e.push({x:i-n,y:s-h},{x:n,y:s-h},{x:n,y:e[0].y}),e};var he={paddingX:3,paddingY:4,width:20,margin:4,minHeight:4,eventRadius:8,origin:0,itemCss:function(t){return t<(this.config.origin||0)?" webix_sparklines_bar_negative":""}};function re(t){this.config=H.extend(B(he),t||{},!0)}re.prototype.draw=function(t,i,s){var e,n,h,r,o,a=this.config,u="",c=[],f=this.getPoints(t,i,s),l=te
;for(e=0;e<f.length;e++)n="function"==typeof a.itemCss?a.itemCss.call(this,t[e]):a.itemCss||"",a.negativeColor&&t[e]<a.origin?n+=" "+this.hc(l,a.negativeColor):a.color&&(n+=" "+this.hc(l,a.color)),h=f[e],c.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_bar "+n));u+=l.group(c.join("")),r=parseInt(this.uc(t,i,s),10)+.5,o=a.paddingX||0,u+=l.group(l.getLine({x:o,y:r},{x:i-o,y:r},"webix_sparklines_origin"));var d=this.cc(t,i,s),v=[];for(e=0;e<d.length;e++)h=d[e],v.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_event_area ",{webix_area:e}));return u+=l.group(v.join("")),l.draw(u,i,s,"webix_sparklines_bar_chart"+(a.css?" "+a.css:""))},re.prototype.hc=function(t,i){var s={},e=t.styleMap;return i&&(s[e.color]=i),L(s)},re.prototype.uc=function(t,i,s){var e=this.config,n=e.paddingY||0,h=n+(s=(s||100)-2*n);if(!1!==e.origin){var r=Math.min.apply(null,t),o=Math.max.apply(null,t),a=e.origin||-1e-6;if(o<=a)h=n;else if(r<a){h-=s/(o-r)*(a-r)}}return h},re.prototype.cc=function(t,i,s){var e=[],n=this.config.paddingX||0,h=this.config.paddingY||0;if(i=(i||100)-2*n,s=(s||100)-2*h,t.length)for(var r=i/t.length,o=0;o<t.length;o++)e.push({x:Math.ceil(r*o)+n,y:h,height:s,width:r});return e},re.prototype.getPoints=function(t,i,s){var e=this.config,n=Math.min.apply(null,t);e.origin<n&&(n=e.origin);var h=Math.max.apply(null,t),r=[],o=e.paddingX,a=e.paddingY,u=e.margin,c=e.width||20,f=this.uc(t,i,s);if(i=(i||100)-2*o,s=(s||100)-2*a,t.length){var l=i/t.length,d=e.scale||h-n;u=l-(c=Math.min(l-u,c));var v=0,_=n;!1!==e.origin&&e.origin>n?_=e.origin||0:v=e.minHeight;for(var p=(s-v)/(d||1),m=0;m<t.length;m++){var b=Math.ceil(p*(t[m]-_));r.push({x:Math.ceil(l*m)+o+u/2,y:f-(t[m]>=_?b:0)-v,height:Math.abs(b)+v,width:c})}}return r};var oe={paddingY:2};function ae(t){this.config=H.extend(oe,t||{},!0)}ae.prototype.fc=0,ae.prototype.lc=["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],ae.prototype.dc=function(t,i){var s=i.length,e=this.lc.length;return s<e?(t&&(t=t<e-s?this.fc+2:this.fc+1),this.fc=t):t%=e,this.lc[t]},ae.prototype.draw=function(t,i,s){var e,n,h,r,o=this.config,a=o.color||this.dc,u=this.getAngles(t),c=te,f=s/2-(o.paddingY||0),l=i/2,d=s/2;for("function"!=typeof a&&(a=function(){return a}),r="",h=0;h<u.length;h++)(e={})[c.styleMap.color]=a.call(this,h,t,this.vc),r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_sector",e);for(n=c.group(r),r="",h=0;h<u.length;h++)r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_event_area",{webix_area:h});return n+=c.group(r),c.draw(n,i,s,"webix_sparklines_pie_chart"+(o.css?" "+o.css:""))},ae.prototype.getAngles=function(t){var i,s,e=-Math.PI/2,n=[],h=this._c(t);for(s=0;s<t.length;s++)i=-Math.PI/2+h[s]-1e-4,n.push([e,i]),e=i;return n},ae.prototype.pc=function(t){for(var i=0,s=0;s<t.length;s++)i+=1*t[s];return i},ae.prototype._c=function(t){var i,s,e=[],n=0,h=this.pc(t);for(i=0;i<t.length;i++)s=1*t[i],e[i]=2*Math.PI*(h?(s+n)/h:1/t.length),n+=s;return e};var ue={paddingX:3,paddingY:6,radius:2,minHeight:4,eventRadius:8};function ce(t){this.config=H.extend(B(ue),t||{},!0)}ce.prototype.draw=function(t,i,s){var e=this.config,n="",h=se.prototype,r=this.getPoints(t,i,s),o=te,a=e.color?this.hc(o,e.color):null;n+=o.group(o.getCurve(r,"webix_sparklines_line"+(a?" "+a.line:"")));var u=h.getPoints.call(this,t,i,s);n+=h.oc(o,u,e.radius,"webix_sparklines_item"+(a?" "+a.item:""));var c=Math.min(t.length?(i-2*(e.paddingX||0))/t.length:0,e.eventRadius);return n+=h.ac(o,u,c),o.draw(n,i,s,"webix_sparklines_line_chart"+(e.css?" "+e.css:""))},ce.prototype.hc=function(t,i){var s={line:{},item:{}},e=t.styleMap;if(i)for(var n in s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},ce.prototype.getPoints=function(t,i,s){var e,n,h,r,o=[],a=[],u=[];for(n=se.prototype.getPoints.call(this,t,i,s),e=0;e<n.length;e++)a.push(n[e].x),u.push(n[e].y);for(h=this.mc(a),r=this.mc(u),e=0;e<n.length-1;e++)o.push([n[e],{x:h[0][e],y:r[0][e]},{x:h[1][e],y:r[1][e]},n[e+1]]);return o},
ce.prototype.mc=function(t){var i,s,e=[],n=[],h=[],r=[],o=[],a=[],u=t.length-1;for(n[e[0]=0]=2,h[0]=1,r[0]=t[0]+2*t[1],i=1;i<u-1;i++)e[i]=1,n[i]=4,h[i]=1,r[i]=4*t[i]+2*t[i+1];for(e[u-1]=2,n[u-1]=7,h[u-1]=0,r[u-1]=8*t[u-1]+t[u],i=1;i<u;i++)s=e[i]/n[i-1],n[i]=n[i]-s*h[i-1],r[i]=r[i]-s*r[i-1];for(o[u-1]=r[u-1]/n[u-1],i=u-2;0<=i;--i)o[i]=(r[i]-h[i]*o[i+1])/n[i];for(i=0;i<u-1;i++)a[i]=2*t[i+1]-o[i+1];return a[u-1]=.5*(t[u]+o[u-1]),[o,a]};var fe={paddingX:3,paddingY:6,radius:1,minHeight:4,eventRadius:8};function le(t){this.config=H.extend(B(fe),t||{},!0)}function de(){}(le.prototype=B(ce.prototype)).draw=function(t,i,s){var e=this.config,n=se.prototype,h=te,r=e.color?this.hc(h,e.color):null,o=this.getPoints(t,i,s),a=o.splice(o.length-3,3),u=h.ec(a);u[0][0]="L";var c=h.nc(o).concat(u),f=h.group(h.getPath(h.definePath(c),"webix_sparklines_area"+(r?" "+r.area:""),!0));f+=h.group(h.getPath(h.definePath(h.nc(o)),"webix_sparklines_line"+(r?" "+r.line:"")));var l=n.getPoints.call(this,t,i,s);f+=n.oc(h,l,e.radius,"webix_sparklines_item"+(r?" "+r.item:""));var d=Math.min(t.length?(i-2*(e.paddingX||0))/t.length:0,e.eventRadius);return f+=n.ac(h,l,d),h.draw(f,i,s,"webix_sparklines_splinearea_chart"+(e.css?" "+e.css:""))},le.prototype.hc=function(t,i){var s={area:{},line:{},item:{}},e=t.styleMap;if(i)for(var n in s.area[e.color]=t.setOpacity(i,.2),s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},le.prototype.getPoints=function(t,i,s){var e=ce.prototype.getPoints.call(this,t,i,s),n=this.config.paddingX||0,h=this.config.paddingY||0;return e.push({x:i-n,y:s-h},{x:n,y:s-h},{x:n,y:e[0][0].y}),e},de.types={},de.getTemplate=function(t){var i=t||{};"string"==typeof t&&(i={type:t}),H.extend(i,{type:"line"});var s=this.types[i.type];return C(this.bc,new s(i))},de.bc=function(t,i,s,e){return e?this.draw(function n(t){for(var i=[],s=t.length-1;0<=s;s--){var e=t[s];i[s]="object"===k(e)?e.value:e}return i}(s),e.width,33):this.draw(t.data||t,i.width,i.height)},F("onDataTable",function(t){t.type.sparklines=de.getTemplate()}),de.types.area=ne,de.types.bar=re,de.types.line=se,de.types.pie=ae,de.types.spline=ce,de.types.splineArea=le;var ve,_e={escape:!0,delimiter:{rows:"\n",cols:"\t"},parse:function(t,i){if(i=i||this.delimiter,!this.escape)return this.gc(t,i);for(var s=t.replace(/\n$/,"").split(i.rows),e=0;e<s.length-1;)this.wc(s[e],'"')%2==1&&(s[e]+=i.rows+s[e+1],delete s[e+1],e++),e++;var n=[];for(e=0;e<s.length;e++)if("undefined"!=typeof s[e]){for(var h=s[e],r=0,o=[],a=!1,u=0;u<=h.length;u++){if(!a&&h[u]===i.cols||u===h.length){var c=h.substr(r,u-r);c[0]===c[c.length-1]&&'"'===c[0]&&(c=c.substr(1,c.length-2).replace('""','"')),o.push(c),r=u+1}'"'!==h[u]||(a=!a)}n.push(o)}return n},gc:function(t,i){for(var s=t.split(i.rows),e=0;e<s.length;e++)s[e]=s[e].split(i.cols);return s},wc:function(t,i){return t.split(i).length-1},stringify:function(t,i){if(i=i||this.delimiter,!this.escape){for(var s=0;s<t.length;s++)t[s]=t[s].join(i.cols);return t.join(i.rows)}for(var e=/\n|"|;|,/,n=0;n<t.length;n++){for(var h=0;h<t[n].length;h++){var r=t[n][h];r instanceof Date?t[n][h]=ct.parseFormatStr(r):e.test(r)&&(t[n][h]='"'+r.toString().replace(/"/g,'""')+'"')}t[n]=t[n].join(i.cols)}return t=t.join(i.rows)}},pe={clipboard_setter:function(t){return!0!==t&&1!==t||(t="block"),vs.init(),this.attachEvent("onSelectChange",this.xc),this.attachEvent("onItemClick",function(){document.activeElement&&this.$view.contains(document.activeElement)&&(vs.focus(),Vi.setFocus(this))}),this.attachEvent("onPaste",this.yc),t},templateCopy_setter:Ft,xc:function(){var t=this.Mc();vs.set(t),Vi.setFocus(this)},Mc:function(){var h=[],r=this.q.templateCopy;return this.mapSelection(function(t,i,s,e){h[e]||(h[e]=[]);var n=r?r(t,i,s):t;return h[e].push(n),t}),1===h.length&&1===h[0].length?h[0][0]:_e.stringify(h,this.q.delimiter)},yc:function(t){if(!D(this.Ln[this.q.clipboard])){var i=_e.parse(t,this.q.delimiter);this.Ln[this.q.clipboard].call(this,i)}},Ln:{block:function(h){var t=this.mapSelection(null);t&&(this.mapCells(t.row,t.column,h.length,null,function(t,i,s,e,n){
return h[e]&&h[e].length>n?h[e][n]:t}),this.render())},selection:function(h){this.mapSelection(function(t,i,s,e,n){return h[e]&&h[e].length>n?h[e][n]:t}),this.render()},repeat:function(h){this.mapSelection(function(t,i,s,e,n){return(i=h[e%h.length])[n%i.length]}),this.render()},custom:function(){}}},me={open:function(t,i){if(t){var s=this.getItem(t);s.$count&&!s.open&&(this.callEvent("onBeforeOpen",[t])&&(s.open=!0,this.data.callEvent("onStoreUpdated",[t,0,"branch"]),this.callEvent("onAfterOpen",[t])),i&&"0"!=t&&this.open(this.getParentId(t),i))}},close:function(t){if(t){var i=this.getItem(t);i.open&&this.callEvent("onBeforeClose",[t])&&(i.open=!1,this.data.callEvent("onStoreUpdated",[t,0,"branch"]),this.callEvent("onAfterClose",[t]))}},openAll:function(t){this.data.eachSubItem(t||0,function(t,i){i&&(t.open=!0)}),this.data.refresh()},closeAll:function(t){this.data.eachSubItem(t||0,function(t,i){i&&(t.open=!1)}),this.data.refresh()},Sc:function(t,i,s){if(this.q.threeState)return this.kc(t,null!==i?i:"");var e,n=this.getItem(t),h=s?s.target||s.srcElement:null;e=h&&"checkbox"==h.type?!!h.checked:null!==i?i:!n.checked,n.checked=e,this.callEvent("onItemCheck",[t,n.checked,s])},isBranchOpen:function(t){if("0"==t)return!0;var i=this.getItem(t);return!!i.open&&this.isBranchOpen(i.$parent)},getOpenItems:function(){var t=[];for(var i in this.data.branch)this.exists(i)&&this.getItem(i).open&&t.push(i);return t},getState:function(){return{open:this.getOpenItems(),select:this.getSelectedId(!0)}},Cc:function(t,i){var s=this.data.attachEvent("onStoreLoad",function(){t.setState.call(t,i),t.data.detachEvent(s),t=null})},setState:function(t){if(t.open){this.closeAll();for(var i=t.open,s=0;s<i.length;s++){var e=this.getItem(i[s]);if(e&&e.$count&&(e.open=!0,-1==e.$count))return this.Cc(this,t),this.refresh(),0}this.refresh()}if(t.select&&this.select){var n=t.select;this.unselect();for(var h=0;h<n.length;h++)this.exists(n[h])&&this.select(n[h],!0)}return 1}},be={webix_tree_open:function(t,i){return this.close(i),!1},webix_tree_close:function(t,i){return this.open(i),!1},webix_tree_checkbox:function(t,i){return this.Sc(i,null,t),!1}},ge={$init:function(){this.data.attachEvent("onStoreUpdated",C(this.Dc,this),null,!0),this.Xr=this.Ac},Ac:function(t,i,s,e){var n=0===i?{parent:encodeURIComponent(t)}:null;Cs.prototype.Xr.call(this,t,i,s,e,n)},loadBranch:function(t,i,s){t=t||0,this.data.url=s||this.data.url,this.callEvent("onDataRequest",[t,i,this.data.url])&&this.data.url&&this.data.feed.call(this,t,0,i,s)},Dc:function(t,i,s){s&&"add"!=s&&"delete"!=s&&"branch"!=s||this.data.Ic(this)}},we={$init:function(){this.data},copy:function(t,i,s,e){return(e=e||{}).copy=!0,this.move(t,i,s,e)},Nh:function(t,i,s){if(i&&t){var e=this.getBranchIndex(t);return e+(s==this&&s.getBranchIndex(i)<e?0:1)}},Fc:function(t,i){var s=this.data.branch[t];if(s&&s.length)for(var e=0;e<s.length;e++){if(s[e]==i)return!0;if(this.Fc(s[e],i))return!0}return!1},move:function(t,i,s,e){i=i||0;var n=(e=e||{}).newId||t,h=e.parent||0;if((s=s||this).data,s.data){if(!b(t)){if(this!=s||e.copy){if(n=s.data.add(s.jh(this.getItem(t),n),i,h||0),this.data.branch[t]&&s.getBranchIndex){var r=this.data.Zh;this.data.Zh=function(t){var i=B(t);return delete i.$parent,delete i.$level,delete i.$child,s.data.pull[i.id]&&(i.id=z()),i};var o={data:this.serialize(t,!0),parent:n};this.data.Zh=r,s.parse(o)}e.copy||this.data.remove(t)}else{if(t==h||this.Fc(t,h))return;var a=this.getItem(t),u=this.data.branch[h];u||(u=this.data.branch[h]=[]);var c=this.data.branch[a.$parent],f=x.find.call(c,t);if(i<0&&(i=u.length),c===u&&i===f)return;if(x.removeAt.call(c,f),x.insertAt.call(u,t,Math.min(u.length,i)),c.length||delete this.data.branch[a.$parent],a.$parent&&"0"!=a.$parent&&this.getItem(a.$parent).$count--,h&&"0"!=h){var l=s.getItem(h);l.$count++,this.Tc(a,l.$level+1)}else this.Tc(a,1);a.$parent=h,s.data.callEvent("onDataMove",[t,i,h,u[i+1]])}return this.refresh(),n}for(var d=0;d<t.length;d++){var v=this.move(t[d],i,s,e);i=s.Nh(v,t[d+1],this)}}},Tc:function(t,i){t.$level=i;var s=this.data.branch[t.id];if(s)for(
var e=0;e<s.length;e++)this.Tc(this.getItem(s[e]),i+1)},po:function(t){t&&!t.header&&this.open(t)},$dropAllow:function(t){if(t.from!=t.to)return!0;for(var i=0;i<t.source.length;i++)if(t.source==t.target||this.Fc(t.source,t.target))return!1;return!0},jh:function(t,i){var s=gs.jh.call(this,t,i);return delete s.open,s}},xe={$init:function(){this.render},zc:function(t){var i=this.data.fr[t.id];return this.callEvent("onItemRender",[t]),this.type.templateStart(t,this.type,i)+(t.$template?this.type["template"+t.$template](t,this.type,i):this.type.template(t,this.type,i))+this.type.templateEnd()},Vc:function(t){return this.es.innerHTML=this.zc(t),this.es.firstChild},Lt:function(t){!t.$template||this.type["template"+t.$template],t.$template;var i="<div role='presentation' class='webix_tree_branch_"+t.$level+"'>"+this.zc(t);return t.open&&(i+=this.Hc(t.id)),i+="</div>"},Hc:function(t){var i="",s=this.data.branch[t];if(s){i+="<div role='presentation' class='webix_tree_leaves'>";for(var e=s.length-1,n=0;n<=e;n++){var h=this.getItem(s[n]),r=this.type.Bc;0!==r&&(r[h.$level]=n==e),i+=this.Lt(h)}i+="</div>"}return i},render:function(t,i,s){if((xe.Xe=this).isVisible(this.q.id)&&!this.$blockRender){if(t){var e,n,h=this.getItem(t);if("add"!=s&&!(e=this.getItemNode(t)))return;switch(s){case"branch":var r=e.parentNode;X(n=this.Pu(h),r),G(r),this.ne=null;break;case"paint":case"update":X(n=this.ne[t]=this.Vc(h),e),G(e);break;case"delete":G(e.parentNode);break;case"add":var o;if(0==h.$parent)o=this.bt.firstChild;else if(this.getItem(h.$parent).open&&(o=this.getItemNode(h.$parent))){if(!o.nextSibling){var a=Y("DIV",{"class":"webix_tree_leaves"},"");o.parentNode.appendChild(a)}o=o.nextSibling}if(o){var u=this.data.getNextSiblingId(t);(u=this.getItemNode(u))&&(u=u.parentNode),n=this.Pu(h),this.ne[t]=n.firstChild,X(n,u,o)}break;default:return!1}this.callEvent("onPartialRender",[t,i,s])}else this.callEvent("onBeforeRender",[this.data])&&(this.type.Bc=[],this.bt.innerHTML=this.Hc(0),this.ne=null,this.callEvent("onAfterRender",[]));return this.type.Bc=0,!(xe.Xe=null)}},getItemNode:function(t){if(this.ne)return this.ne[t];this.ne={};for(var i=this.bt.getElementsByTagName("DIV"),s=0;s<i.length;s++){var e=i[s].getAttribute(this.za);e&&(this.ne[e]=i[s])}return this.getItemNode(t)},Rc:1},ye={Pc:function(){if(this.Rc){var e=this.render;this.render=function(t,i){var s=e.apply(this,arguments);this.q.threeState&&s&&"checkbox"!=i&&this.jc.apply(this,arguments)},this.Pc=function(){}}},threeState_setter:function(t){return t&&this.Pc(),t},jc:function(t){var i,s,e,n,h;if(e=[],h=this,t&&!h.data.pull[t]&&(t=0),!t||h.data.pull[t].$count)for((s=this.Nc(t)).sort(function(t,i){return h.data.pull[i].$level-h.data.pull[t].$level}),i=0;i<s.length;i++)i&&h.data.pull[s[i]].$parent==h.data.pull[s[i-1]].$parent||(e=e.concat(h.Ec(s[i])));else e=e.concat(h.Ec(t));for(n={},i=0;i<e.length;i++)n[e[i]]||(n[e[i]]=1,this.Lc(e[i]));h=null},Lc:function(t){var i;this.getItemNode(t)&&(this.render(t,"checkbox","update"),this.getItem(t).indeterminate&&(i=this.getItemNode(t).getElementsByTagName("input")[0])&&(i.indeterminate=this.getItem(t).indeterminate))},Ec:function(t){var i,s,e,n,h,r,o;for(n=this.getParentId(t),h=[];n&&"0"!=n;){s=r=0,this.data.eachChild(n,function(t){t.indeterminate?r++:t.checked&&s++}),i=e=o=!1;var a=this.getItem(n);s==a.$count?i=!0:(0<s||0<r)&&(e=!0),(e||e!=a.indeterminate)&&(o=!0),a.indeterminate=e,(i||a.checked!=i)&&(o=!0),a.checked=i,n=o?(h.push(n),this.getParentId(n)):0}return h},getChecked:function(){var i=[],s=this;return this.data.eachSubItem(0,function(t){s.isChecked(t.id)&&i.push(t.id)}),i},kc:function(t,i){var s=this.getItem(t);if(s&&(""===i&&(i=!s.checked),s.checked!=i||s.indeterminate)){s.checked=i,this.Oc(t);var e=this.Ec(t);if(this.Rc&&e.length<5)for(var n=0;n<e.length;n++)this.Lc(e[n]);else this.refresh();this.callEvent("onItemCheck",[t,i])}},checkItem:function(t){this.Sc(t,!0),this.updateItem(t)},uncheckItem:function(t){this.Sc(t,!1),this.updateItem(t)},Uc:function(t,i,s){var e=i?"checkItem":"uncheckItem";t?this[e](t):t=0,
this.q.threeState?t||this.data.eachChild(0,function(t){this[e](t.id)},this,s):this.data.each(function(t){this[e](t.id)},this,s,t)},checkAll:function(t,i){this.Uc(t,!0,i)},uncheckAll:function(t,i){this.Uc(t,!1,i)},Oc:function(t){var i,s=this.getItem(t);s.indeterminate=!1,i=s.checked,this.data.eachSubItem(t,function(t){t.indeterminate=!1,t.checked=i}),this.Rc&&this.isBranchOpen(s.$parent)&&this.render(t,0,"branch")},isChecked:function(t){return this.getItem(t).checked},Nc:function(t){var s=[];return this.data.eachSubItem(t,function(t,i){i||s.push(t.id)}),s}},Me={name:"TreeStore",$init:function(){this.Pr={showSubItems:!0},this.branch={0:[]},this.attachEvent("onParse",function(t){this.Ir(t.child)}),this.attachEvent("onClearAll",C(function(){this.Cr=null},this))},filterMode_setter:function(t){return H.extend(this.Pr,t,!0)},Br:function(t){if(this.Cr&&!t){for(var i in this.branch=this.Cr,this.order=p(B(this.branch[0])),this.branch)"0"!=i&&(this.getItem(i).$count=this.branch[i].length);delete this.Cr}},Rr:function(t,i,s,e){s&&this.Cr||(this.Cr=this.branch,this.branch=f(this.branch)),this.branch[0]=this.Yc(t,i,this.branch[0],1,e||{})},Yc:function(t,i,s,e,n){for(var h=[],r=n.level&&n.level!=e,o=0;o<s.length;o++){var a=s[o],u=this.getItem(a),c=!1,f=this.branch[a];if(r)c=!0;else if(t(this.getItem(a),i)){if(h.push(a),!1!==n.openParents)for(var l=this.getParentId(a);l&&"0"!=l;)this.getItem(l).open=1,l=this.getParentId(l);if(n.level||n.showSubItems)continue}else c=!0;if((r||!n.level)&&f){var d=this.branch[a]=this.Yc(t,i,f,e+1,n);u.$count=d.length,c&&d.length&&h.push(a)}}return h},count:function(){if(this.order.length)return this.order.length;var t=0;return this.eachOpen(function(){t++}),t},Wc:function(t,i,s,e){if(t[s]){for(var n=t[e]=t[s],h=0;h<n.length;h++)this.getItem(n[h]).$parent=e;delete t[s]}if(t[i]){var r=x.find.call(t[i],s);0<=r&&(t[i][r]=e)}},changeId:function(t,i){if(t!=i){var s=this.getItem(t).$parent;return this.Wc(this.branch,s,t,i),this.Cr&&this.Wc(this.Cr,s,t,i),ks.prototype.changeId.call(this,t,i)}},clearAll:function(t){this.branch={0:[]},ks.prototype.clearAll.call(this,t)},getPrevSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],s=x.find.call(i,t)-1;return 0<=s?i[s]:null},getNextSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],s=x.find.call(i,t)+1;return s<i.length?i[s]:null},getParentId:function(t){return this.getItem(t).$parent},getFirstChildId:function(t){var i=this.branch[t];return i&&i.length?i[0]:null},isBranch:function(t){return!!this.branch[t]},getBranchIndex:function(t){var i=this.branch[this.pull[t].$parent];return x.find.call(i,t)},Ir:function(s){this.Ar="string"==typeof s?function(t){var i=t[s];return i&&delete t[s],i}:s},dr:function(t,i){for(var s=t.parent||0,e=0;e<i.length;e++){var n=this.driver.getDetails(i[e]),h=this.id(n),r=!!this.pull[h];r?(n=H.extend(this.pull[h],n,!0),this.gr&&this.gr(n)):(this.wr&&this.wr(n),this.pull[h]=n),this.Dr(n,s,0,r,t.from?1*t.from+e:0)}var o=this.pull[s]||{},a=this.branch[s]||[];o.$count=a.length,delete o.webix_kids,t.size&&t.size!=a.length&&(a[t.size-1]=undefined)},Dr:function(t,i,s,e,n){t.$count=0,t.$parent="0"!=i?i:0,t.$level=s||("0"!=i?this.pull[i].$level+1:1);var h=this.branch[t.$parent];(h||(h=this.branch[t.$parent]=[]),this.Cr&&(this.Cr[t.$parent]=h),e)||(h[n||h.length]=t.id);var r=this.Ar(t);if(t.webix_kids)return t.$count=-1;if(!r)return t.$count=0;b(r)||(r=[r]);for(var o=0;o<r.length;o++){var a=oi.json.getDetails(r[o]),u=this.id(a);(e=!!this.pull[u])?(a=H.extend(this.pull[u],a,!0),this.gr&&this.gr(a)):(this.wr&&this.wr(a),this.pull[u]=a),this.Dr(a,t.id,t.$level+1,e)}var c=this.branch[t.id];c&&(t.$count=c.length)},Ic:function(t){this.order=p(),this.Gc(0,t)},Gc:function(t,i){for(var s=this.branch[t],e=0;e<s.length;e++){var n=s[e];this.order.push(n);var h=this.pull[n];h&&h.open&&(-1==h.$count?i.loadBranch(n):h.$count&&this.Gc(n,i))}},provideApi:function(t,i){for(var s=["getPrevSiblingId","getNextSiblingId","getParentId","getFirstChildId","isBranch","getBranchIndex","filterMode_setter"],e=0;e<s.length;e++)t[s[e]]=this.Nr(this,s[e])
;t.getIndexById||ks.prototype.provideApi.call(this,t,i)},getTopRange:function(){return p([].concat(this.branch[0])).map(function(t){return this.getItem(t)},this)},eachChild:function(t,i,s,e){var n=this.branch;e&&this.Cr&&(n=this.Cr);var h=n[t];if(h)for(var r=0;r<h.length;r++)h[r]&&i.call(s||this,this.getItem(h[r]))},each:function(s,e,n,t){this.eachChild(t||0,function(t){var i=this.branch;s.call(e||this,t),n&&this.Cr&&(i=this.Cr),t&&i[t.id]&&this.each(s,e,n,t.id)},this,n)},eachOpen:function(i,s,t){this.eachChild(t||0,function(t){i.call(s||this,t),this.branch[t.id]&&t.open&&this.eachOpen(i,s,t.id)})},eachSubItem:function(t,i){var s=this.branch[t||0];if(s)for(var e=0;e<s.length;e++){var n=s[e];this.branch[n]?(i.call(this,this.getItem(n),!0),this.eachSubItem(n,i)):i.call(this,this.getItem(n),!1)}},eachLeaf:function(t,i){var s=this.branch[t||0];if(s)for(var e=0;e<s.length;e++){var n=s[e];this.branch[n]?this.eachLeaf(n,i):i.call(this,this.getItem(n),!1)}},Hr:function(t,i){var s=this.sorting.create(t);for(var e in this.branch){for(var n=this.branch[e],h=[],r=0;r<n.length;r++)h.push(this.pull[n[r]]);h.sort(s);for(var o=0;o<n.length;o++)h[o]=h[o].id;this.branch[e]=h}return i},add:function(t,i,s){var e=!1,n=this.getItem(s||0);if(n&&(this.branch[n.id]||(e=!0),n.$count++,n.$count||(n.$count=1)),this.branch[s||0]=this.order=p(this.branch[s||0]),t.$count=t.webix_kids?-1:0,t.$level=n?n.$level+1:1,t.$parent=n?n.id:0,this.Cr){var h=this.Cr[s||0];if(h||(h=this.Cr[s]=this.order),this.order!==h){var r=h.length;!i&&this.branch[s||0].length&&(r=0),h=p(h),t.id=t.id||z(),h.insertAt(t.id,r)}}var o=ks.prototype.add.call(this,t,i);return e&&this.refresh(s),o},Xc:function(t){var i=this.pull[t];if(this.branch[i.id]&&0<this.branch[i.id].length)for(var s=this.branch[t],e=0;e<s.length;e++)this.Xc(s[e],!0);delete this.branch[t],this.Cr&&delete this.Cr[t],delete this.pull[t],this.fr[t]&&delete this.fr[t]},Jc:function(t,i,s){var e=t[i];1==e.length&&e[0]==s&&i?delete t[i]:p(e).remove(s)},remove:function(t){if(b(t))for(var i=0;i<t.length;i++)this.remove(t[i]);else{this.exists(t);var s=this.pull[t],e=s.$parent||0;if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.Xc(t),this.callEvent("onAfterDelete",[t]);var n=this.pull[e];this.Jc(this.branch,e,t),this.Cr&&this.Jc(this.Cr,e,t);var h=0;n&&(n.$count--,n.$count<=0&&(n.$count=0,n.open=0,h=1)),this.callEvent("onStoreUpdated",[t,s,"delete"]),h&&this.refresh(n.id)}},getBranch:function(t){var i=[],s=(this.Cr||this.branch)[t];if(s)for(var e=0;e<s.length;e++)i[e]=this.pull[s[e]];return i},serialize:function(t,i){var s=this.branch;i&&this.Cr&&(s=this.Cr);for(var e=s[t||0],n=[],h=0;h<e.length;h++){var r,o=this.pull[e[h]];if(this.Zh){if(!1===(r=this.Zh(o)))continue}else r=B(o);s[o.id]&&(r.data=this.serialize(o.id,i)),n.push(r)}return n}},Se={insert:function(t){for(var i=this.getSelectedId(!0,!0),s=0;s<t.length;s++){for(var e={},n=0;n<this.q.columns.length;n++)e[this.q.columns[n].id]=t[s][n]||"";!D(e.id)&&this.exists(e.id)&&(e.id=z()),this.add(e,null,i[0])}}},ke={space:function(t){for(var i="",s=1;s<t.$level;s++)i+="<div class='webix_tree_none'></div>";return i},icon:function(t){return t.$count?t.open?"<div class='webix_tree_open'></div>":"<div class='webix_tree_close'></div>":"<div class='webix_tree_none'></div>"},checkbox:function(t){return t.nocheckbox?"":"<input type='checkbox' class='webix_tree_checkbox' "+(t.checked?"checked":"")+(t.disabled?" disabled":"")+">"},folder:function(t){return t.icon?"<div class='webix_tree_file webix_tree_"+t.icon+"'></div>":t.$count?t.open?"<div class='webix_tree_folder_open'></div>":"<div class='webix_tree_folder'></div>":"<div class='webix_tree_file'></div>"}},Ce={flash:{$render:function(){window.swfobject||hi("legacy/swfobject.js",!0);var t=this.q;t.swfId=t.swfId||"webix_swf_"+z(),this.Kc().innerHTML+="<div class='webix_upload_flash'><div id='"+t.swfId+"'></div></div>",this.qc=this.Kc().lastChild,swfobject.embedSWF(S.codebase+"/legacy/uploader.swf",t.swfId,"100%","100%","9",null,{uploaderId:t.id,ID:t.swfId,enableLogs:t.enableLogs?"1":"",paramName:t.inputName,
multiple:t.multiple?"Y":""},{wmode:"transparent"}),Lt(this.nt,"click",C(function(){250<new Date-(this.Zc||0)&&this.fileDialog()},this)),this.files.attachEvent("onBeforeDelete",C(this.Qc,this))},$applyFlash:function(t,i){return this[t].apply(this,i)},getSwfObject:function(){return swfobject.getObjectById(this.q.swfId)},fileDialog:function(){this.getSwfObject()&&this.getSwfObject().showDialog()},send:function(t){if("function"==typeof t&&(this.tf=t,t=0),t){var i=this.files.getItem(t);if("client"!==i.status)return!1;if(i.status="transfer",this.getSwfObject()){var s=this["if"](i),e=this.q.formData||{};"function"==typeof e&&(e=e.call(this));var n=H.extend(i.formData||{},e);this.getSwfObject().upload(t,s,n)}return!0}var h=this.files.data.order,r=!0;if(h.length)for(var o=0;o<h.length;o++)r=this.send(h[o])&&r;r&&this.sf()},$beforeAddFileToQueue:function(t,i,s){var e=i.split(".").pop(),n=this.ef(s);return this.callEvent("onBeforeFileAdd",[{id:t,name:i,size:s,sizetext:n,type:e}])},$addFileToQueue:function(t,i,s){if(this.files.exists(t))return!1;this.q.multiple||this.files.clearAll();var e=i.split(".").pop(),n={name:i,id:t,size:s,sizetext:this.ef(s),type:e,status:"client"};this.files.add(n),this.callEvent("onAfterFileAdd",[n]),t&&this.q.autosend&&this.send(t)},stopUpload:function(t){this.Qc(t)},Qc:function(t){var i=this.files.getItem(t);"transfer"==i.status&&(this.getSwfObject().uploadStop(t),i.status="client")},nf:function(){},$onUploadComplete:function(){this.q.autosend&&this.sf()},$onUploadSuccess:function(t,i,s){var e=this.files.getItem(t);e&&(e.status="server",e.progress=100,s.text&&"string"==typeof s.text&&(oi.json.toObject(s.text),H.extend(e,s,!0)),this.callEvent("onFileUpload",[e,s]),this.callEvent("onChange",[]),this.files.updateItem(t))},$onUploadFail:function(t){var i=this.files.getItem(t);i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,""])}},html5:{$render:function(){if(this.qc)this.re.firstChild.appendChild(this.qc);else{this.files.attachEvent("onBeforeDelete",this.Qc);var t={type:"file","class":"webix_hidden_upload",tabindex:-1};this.q.accept&&(t.accept=this.q.accept),this.q.multiple&&(t.multiple="true"),this.q.directory&&(t.webkitdirectory="true",t.mozdirectory="true",t.directory="true");var i=Y("input",t);this.qc=this.re.firstChild.appendChild(i),Lt(this.nt,"drop",C(function(t){this.nf(t),Q(t)},this)),Lt(i,"change",C(function(){if(this.hf(i.files),S.isIE){var t=document.createElement("form");t.appendChild(this.qc),t.reset(),this.re.firstChild.appendChild(i)}else i.value=""},this)),Lt(this.nt,"click",C(function(){250<new Date-(this.Zc||0)&&this.fileDialog()},this)),Lt(this.nt,"dragenter",Q),Lt(this.nt,"dragexit",Q),Lt(this.nt,"dragover",Q)}},rf:function(t){return t.isDirectory},af:function(s,e,n){if(s.isFile)s.file(function(t){e.addFile(t,null,null,{name:n+"/"+t.name})});else if(s.isDirectory){s.createReader().readEntries(function(t){for(var i=0;i<t.length;i++)e.af(t[i],e,(n?n+"/":"")+s.name)})}},nf:function(t){var i=t.dataTransfer.files,s=t.dataTransfer.items;if(this.callEvent("onBeforeFileDrop",[i,t])){s=s||i;for(var e=0;e<s.length;e++){var n=s[e];n.webkitGetAsEntry&&(n=n.webkitGetAsEntry()).isDirectory?this.af(n,this,""):this.addFile(i[e])}}this.callEvent("onAfterFileDrop",[i,t])},fileDialog:function(t){this.Zc=new Date,this.uf=t;var i=this.nt.getElementsByTagName("INPUT");i[i.length-1].click()},send:function(i){if("function"==typeof i&&(this.tf=i,i=0),i){var t=this.files.getItem(i);if("client"!==t.status)return!1;this.q.upload,t.status="transfer";var s=new FormData;s.append(this.config.inputName,t.file,t.name),s.append(this.config.inputName+"_fullpath",t.name);var e={},n=this.q.formData||{};"function"==typeof n&&(n=n.call(this));var h=H.extend(t.formData||{},n),r=new XMLHttpRequest,o=this["if"](t);if(I("onBeforeAjax",["POST",o,h,r,e,s])){for(var a in h)s.append(a,h[a]);for(var u in(t.xhr=r).upload.addEventListener("progress",C(function(t){this.$updateProgress(i,t.loaded/t.total*100)},this),!1),r.onload=C(function(){r.aborted||this.cf(i)},this),r.open("POST",o,!0),e
)r.setRequestHeader(u,e[u]);r.send(s)}return this.$updateProgress(i,0),!0}var c=this.files.data.order,f=!0;if(c.length)for(var l=0;l<c.length;l++)f=!this.send(c[l])&&f;f&&this.sf()},cf:function(t){var i=this.files.getItem(t);if(i){var s=null;if(i.xhr.status<400){var e=oi[this.q.datatype||"json"];(s=e.toObject(i.xhr.responseText))&&(s=e.getDetails(s))}s&&"error"!=s.status?(!s.status||s.status,this.ff(t,s)):(i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,s])),delete i.xhr}},stopUpload:function(t){C(this.Qc,this.files)(t)},Qc:function(t){var i=this.getItem(t);"undefined"!=typeof i.xhr&&(i.xhr.aborted=!0,i.xhr.abort(),delete i.xhr,i.status="client")}}},De={lf:function(){this.data.attachEvent("onStoreUpdated",C(function(t,i,s){!t||"add"!=s&&"update"!=s||this.validate(t)},this)),this.data.attachEvent("onClearAll",C(this.clearValidation,this)),this.lf=function(){}},rules_setter:function(t){return t&&this.lf(),t},clearValidation:function(){this.data.clearMark("webix_invalid",!0)},validate:function(t){var i=!0;if(t){this.Lh={};var s=this.getItem(t);(i=xs.validate.call(this,null,s))?this.callEvent("onValidationSuccess",[t,s])&&this.Eh(t):this.callEvent("onValidationError",[t,s,this.Lh])&&this.Uh(t,this.Lh)}else for(var e in this.data.pull)i=this.validate(e)&&i;return i},Oh:function(t,i,s,e){"string"==typeof t&&(t=ws[t]);var n=t.call(this,i,s,e);return n||(this.Lh[e]=!0),n},Eh:function(t){this.data.removeMark(t,"webix_invalid",!0)},Uh:function(t){this.data.addMark(t,"webix_invalid",!0)}},$e={$init:function(){this.elements={}},focus:function(t){if(t)this.elements[t],this.Hs(this.elements[t]);else for(var i in this.elements)if(!1!==this.Hs(this.elements[i]))return!0;return!1},Hs:function(t){return!(!t||!t.focus)&&t.focus()},setValues:function(t,i){this.q.complexData&&(t=yt.collapseNames(t)),this.df(t,i)},df:function(t,i){for(var s in this.vf=i,this.blockEvent(),i&&this._f||(this._f={}),t)this.elements[s]||(this._f[s]=t[s]);for(var e in this.elements){var n=this.elements[e];n&&(D(t[e])?!i&&n.$allowsClear&&n.setValue(""):n.setValue(t[e]),this._f[e]=n.getValue())}this.unblockEvent(),this.callEvent("onValues",[])},isDirty:function(){return!!this.vf||1===this.getDirtyValues(1)},setDirty:function(t){(this.vf=t)||(this._f=this.pf())},getDirtyValues:function(){var t={};if(this._f)for(var i in this.elements){var s=this.elements[i].getValue();if(this._f[i]!=s&&(t[i]=s,arguments[0]))return 1}return t},getCleanValues:function(){return this._f},getValues:function(t){var i=this.pf(t);return this.q.complexData&&(i=yt.expandNames(i)),i},pf:function(t){var i,s=null,e=this._f?B(this._f):{};for(var n in this.elements)s=this.elements[n],i=!0,t&&("object"==k(t)?(!1===t.hidden&&(i=s.isVisible()),i&&!1===t.disabled&&(i=s.isEnabled())):i=t.call(this,s)),i?e[n]=s.getValue():delete e[n];return e},clear:function(){this.vf=!1;var t={};for(var i in this.elements)this.elements[i].$allowsClear&&(t[i]="");this.df(t)},markInvalid:function(t,i){if(!1===i)this.Eh(t);else{if("string"==typeof i){var s=this.elements[t];s&&(s.q.invalidMessage=i)}this.Uh(t)}},Uh:function(t){var i=this.elements[t];t&&i&&(this.Eh(t,!0),st(i.nt,"webix_invalid"),i.q.invalid=!0,"string"==typeof i.q.invalidMessage&&i.setBottomText&&i.setBottomText())},Eh:function(t,i){var s=this.elements[t];t&&s&&s.$view&&s.q.invalid&&(et(s.nt,"webix_invalid"),s.q.invalid=!1,"string"==typeof s.q.invalidMessage&&!i&&s.setBottomText&&s.setBottomText())}},Ae={$init:function(){this.render,this.ne={},Lt(this.nt,"scroll",C(this.mf,this)),S.touch&&this.attachEvent("onAfterScroll",C(this.mf,this)),this.bf=[]},getItemNode:function(t){return this.ne[t]},showItem:function(t){var i=this.Kn(),s=this.data.getIndexById(t),e=Math.floor(s/i.Jn)*i.Vi,n=this.getScrollState();(e<n.y||e+this.q.height>=n.y+this.He)&&this.scrollTo(0,e)},render:function(t,i,s){if(this.isVisible(this.q.id)&&!this.$blockRender)if(t){var e=this.getItemNode(t);switch(s){case"update":if(!e)return;X(this.ne[t]=this.Pu(i),e),G(e);break;default:this.gf()}}else this.callEvent("onBeforeRender",[this.data])&&(
this.ne={},this.mf(null,!0),this.wf=!1,this.callEvent("onAfterRender",[]))},gf:function(){this.wf||(this.wf=!0,window.setTimeout(C(function(){this.render()},this),1))},xf:function(t){S.maxHTMLElementSize&&(t=Math.min(S.maxHTMLElementSize,t));var i=document.createElement("DIV");return i.style.cssText="height:"+t+"px; width:100%; overflow:hidden;",i},mf:function(t,i){this.bf=[];var s=this.Kn();this.bt.firstChild&&!i||(this.bt.innerHTML="",this.bt.appendChild(this.xf(s.yf)),this.he=[this.bt.firstChild]);for(var e=s.Mf;e<=s.Sf;){for(;this.he[e]&&this.he[e].kf&&e<=s.Sf;)e++;if(e>s.Sf)break;for(var n=e;!this.he[n];)n--;var h=this.he[n],r=e*s.Jn+(this.data.$min||0);if(r>(this.data.$max||Infinity))break;var o=Math.min(r+s.Jn-1,this.data.$max?this.data.$max-1:Infinity),a=this.xf(s.Vi),u=this.data.getIndexRange(r,o);if(!u.length)break;for(var c={$template:"Loading"},f=0;f<u.length;f++)u[f]||this.bf.push(r+f),u[f]=this.Lt(u[f]||c);a.innerHTML=u.join("");for(var l=0;l<u.length;l++)this.ne[this.data.getIdByIndex(r+l)]=a.childNodes[l];var d=parseFloat(h.style.height,10),v=(e-n)*s.Vi,_=d-v-s.Vi;if(X(a,v?h.nextSibling:h,this.bt),(this.he[e]=a).kf=!0,v<=0&&0<_)h.style.height=_+"px",this.he[e+1]=h;else if(v<0?G(h):h.style.height=v+"px",0<_)X(this.he[e+1]=this.xf(_),a.nextSibling,this.bt);e++}if(this.bf.length){var p=this.bf[0],m=this.bf.pop()+1;if(p<m){var b=m-p;if(this.qr(b,p))return;b=Math.max(b,this.q.datafetch||this.q.loadahead||0),this.loadNext(b,p)}}},Kn:function(){var t=this.getScrollState(),i=Math.max(0,t.y),s=this.ze,e=this.He,n=this.type,h=Math.floor(s/n.width)||1,r=Math.floor(i/n.height),o=Math.ceil((e+i)/n.height)-1,a=this.data.$max?this.data.$max-this.data.$min:this.data.count();return{Mf:r,Sf:o,Cf:i,yf:Math.ceil(a/h)*n.height,Vi:n.height,Jn:h}},Wt:function(t){var i=this.getItemNode(t);return i||(this.showItem(t),this.mf(),i=this.getItemNode(t)),{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.re}}},Ie={$init:function(){this.ne={},Mi.$active?(this.attachEvent("onBeforeScroll",function(){this.Df=!0}),this.attachEvent("onAfterScroll",function(){this.render(null,null,"paint"),this.Df=!1}),this.attachEvent("onTouchMove",function(){this.Df&&(this.blockEvent(),this.render(null,null,"paint"),this.unblockEvent())})):Lt(this.nt,"scroll",C(function(){this.render(null,null,"paint")},this))},$i:function(t,i,s){this.q.footer&&Mi.Ci(this.$f.childNodes[1].firstChild,t,0,s),this.callEvent("onSyncScroll",[t,i,s])},getItemNode:function(t){return this.ne&&this.ne[t]},showItem:function(t){var i=this.data.getIndexById(t);if(-1<i){var s=i*this.type.height,e=s+this.type.height,n=this.getScrollState(),h=K(this.$view);s<n.y?this.scrollTo(0,s):e>n.y+h.height&&this.scrollTo(0,e-h.height)}},render:function(t,i,s){if(this.isVisible(this.q.id)&&!this.$blockRender){var e=this.Nu||this.bt;if(!t||"paint"!=s&&"update"!=s){if("paint"!=s&&(this.ne={},e.innerHTML=""),this.callEvent("onBeforeRender",[this.data])){var n=this.data.count(),h=this.getScrollState(),r=K(this.nt),o=Math.floor(h.y/this.type.height)-2,a=Math.ceil((h.y+r.height)/this.type.height)+2;o=Math.max(0,o),a=Math.min(this.data.count()-1,a);for(var u=[],c=o;c<=a;c++){var f=this.data.order[c];if(this.ne[f])u.push("<div></div>");else{var l=this.data.getItem(f);if(!l){this.Af({count:a-c+(this.q.loadahead||0),start:c});break}u.push(this.Lt(l))}}this.es.innerHTML=u.join(""),e.style.position="relative",e.style.height=n*this.type.height+"px";for(var d=this.es.childNodes,v=d.length-1;0<=v;v--){var _=d[v],p=_.getAttribute(this.za);p&&(_.style.position="absolute",_.style.top=(o+v)*this.type.height+"px",_.style.left=0,_.style.width="100%",e.appendChild(_),this.ne[p]=_)}this.callEvent("onAfterRender",[])}}else{var m=this.getItemNode(t);if(m){var b=this.ne[t]=this.Pu(i);return b.style.top=m.style.top,b.style.position="absolute",b.style.left=0,b.style.width="100%",X(b,m),void G(m)}}}},$setSize:function(){Gi.api.$setSize.apply(this,arguments)&&this.render(null,null,"paint")},Af:function(t){var i=Math.max(t.count,this.q.datafetch||this.q.loadahead||0);this.qr(t.count,t.start
)||this.loadNext(i,t.start)}},Fe="non-existing view for export",Te=function(t,d){(d=d||{}).export_mode="excel",t=b(t)?t:[t];for(var v=[],i=0;i<t.length;i++){var s=jt(t[i]);if(s&&s.$exportView&&(s=s.$exportView(d)),s&&(v=v.concat(s)),d.dataOnly){var e=Ve(s,d);v[i]={scheme:e,exportData:He(s,d,e),spans:d.spans?Be(s,d):[]}}}if(d.dataOnly)return v;var _=mt.defer();return hi(S.cdn+"/extras/xlsx.core.styles.min.js").then(function(){if(!v.length)return _.reject(Fe);for(var t={SheetNames:[],Sheets:{},Workbook:{WBProps:{},Names:[]}},i=b(d.sheets)?d.sheets:[d.name||"Data"],s=0;s<v.length;s++){var e=v[s].scheme||Ve(v[s],d),n=v[s].exportData||He(v[s],d,e),h=v[s].spans?v[s].spans:d.spans?Be(v[s],d):[],r=v[s].ranges||[],o=Ne(n,e,h,v[s].styles||[],d),a=(i[s]||"Data"+s).replace(/[*?:[\]\\/]/g,"").replace(/&/g,"&amp;").substring(0,31);t.SheetNames.push(a),t.Sheets[a]=o,t.Workbook.Names=t.Workbook.Names.concat(r)}var u=XLSX.write(t,{bookType:"xlsx",bookSST:!1,type:"binary"}),c=(d.filename||i.join(","))+".xlsx",f=new Blob([function l(t){for(var i=new ArrayBuffer(t.length),s=new Uint8Array(i),e=0;e!=t.length;++e)s[e]=255&t.charCodeAt(e);return i}(u)],{type:"application/xlsx"});return!1!==d.download&&ht(f,c),_.resolve(f),_})};function ze(i,s,t){return!t&&s.format?function(t){return s.format(t[i])}:function(t){return t[i]}}function Ve(t,i){var s=[],e=0,n=0,h=t.getColumnConfig,r=i.columns,o=!!i.rawValues;if(s.heights={},r){if(!r.length){var a=[];for(var u in r)a.push(H.extend({id:u},H.extend({},r[u])));r=a}}else if(h)r=[].concat(t.If);else{r=[];var c=t.data.pull[t.data.order[0]];for(var f in c)"id"!==f&&"$"!=f[0]&&r.push({id:f})}if(i.ignore)for(var l=r.length-1;0<=l;l--)i.ignore[r[l].id]&&r.splice(l,1);if(i.id&&s.push({id:"id",width:50,header:" ",template:function(t){return t.id}}),i.flatTree){for(var d=i.flatTree.id,v=[].concat(i.flatTree.columns),_=[],p=!!i.flatTree.fill,m=1;m<=v.length;m++)v[m-1].template=function(i){return function(t){return t.$level==i?_[i]=t[d]:p&&i<t.$level?_[i]:""}}(m);for(var b=0,g=r.length-1;0<=g;g--)r[g].id===d&&(b=g);r=[].concat(r.slice(0,b)).concat(v).concat(r.slice(b+1))}for(var w=0;w<r.length;w++){var x=r[w],y=x.id;if(!x.noExport){var M=o&&h;if(h){var S=t.Ff[y];!x.template||S&&S.template==x.template||(M=!1),S&&(x=H.extend(H.extend({},x),S))}var k={id:x.id,template:M||!x.template?ze(y,x,o):x.template,width:(x.width||200)*("excel"===i.export_mode?8.43/70:1),header:!1!==x.header?x.header||y:""};"excel"===i.export_mode&&H.extend(k,{type:x.exportType||"",format:x.exportFormat||""}),"string"==typeof k.header?k.header=[{text:k.header}]:k.header=B(k.header);for(var C=0;C<k.header.length;C++){var D=k.header[C]||{},$=D.contentId?t.getHeaderContent(D.contentId).getValue(!0):D.text;k.header[C]=($||"").toString().replace(/<[^>]*>/gi,"")}if(e=Math.max(e,k.header.length),t.q.footer){var A=x.footer||"";A="string"==typeof A?[{text:A}]:B(A);for(var I=0;I<A.length;I++)A[I]?A[I]=A[I].contentId?t.getHeaderContent(A[I].contentId).getValue():A[I].text:A[I]="";k.footer=A,n=Math.max(n,k.footer.length)}s.push(k)}}for(var F=0;F<s.length;F++){for(var T=e-s[F].header.length,z=0;z<T;z++)s[F].header.push("");if(t.q.footer){T=n-s[F].footer.length;for(var V=0;V<T;V++)s[F].footer.push("")}}return s}function He(r,o,a){var t,i,u=!!o.filterHTML,c=/<[^>]*>/gi,f=[],l=o.export_mode;if("excel"!==l&&"csv"!=l||!o.docHeader||(f=[[(o.docHeader.text||o.docHeader).toString()],[""]],"excel"===l&&o.docHeader.height&&(a.heights[0]=o.docHeader.height)),!1!==o.header&&a.length)for(var s=0;s<a[0].header.length;s++){i=[];for(var e=0;e<a.length;e++)t="",a[e].header[s]&&(t=a[e].header[s],u&&(t=a[e].header[s]=t.replace(c,""))),i.push(t);"excel"!=l||!r.If||!1===o.heights||r.Tf[s]===Qi.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.Tf[s]),"pdf"!==l&&(f[f.length]=i)}o.yCorrection=(o.yCorrection||0)-f.length;var d="TreeStore"==r.data.name,v=o.flatTree||o.plainOutput?"":" - ";if(r.data.each(function(t){if(!o.filter||o.filter(t)){for(var i=[],s=0;s<a.length;s++){var e=a[s],n=null;if(o.math&&t["$"+e.id]&&"="==t["$"+e.id].charAt(0)&&!t["$"+e.id].match(
/^=(image|link|sparkline)\(/i)&&(n=t["$"+e.id]),this.zf){var h=this.getSpan(t.id,e.id);h&&h[4]&&h[0]==t.id&&h[1]==e.id&&(n=h[4],u&&"string"==typeof n&&(n=n.replace(c,"")))}n||((n=e.template(t,r.type,t[e.id],e,s))||0===n||(n=""),u&&"string"==typeof n&&(d&&(n=n.replace(/<div class=.webix_tree_none.><\/div>/,v)),n=n.replace(c,"")),"string"==typeof n&&"csv"===l&&(n=n.trim()),"string"!=typeof n||"excel"!==l&&"csv"!==l||(n=n.replace(/<br\s*\/?>/gm,"\n"))),i.push(n)}"excel"==l&&r.If&&!1!==o.heights&&(t.$height&&t.$height!==Qi.rowHeight||"all"==o.heights)&&(a.heights[f.length]=t.$height||this.config.rowHeight),f.push(i)}},r),!1!==o.footer)for(var n=a[0].footer?a[0].footer.length:0,h=0;h<n;h++){for(var _=[],p=0;p<a.length;p++){var m=a[p].footer[h];u&&(m=a[p].footer[h]=m.toString().replace(c,"")),_.push(m)}"excel"!=l||!r.If||!1===o.heights||r.Vf[h]===Qi.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.Vf[h]),"pdf"!==l&&f.push(_)}return"excel"===l&&o.docFooter&&(f=f.concat([[],[(o.docFooter.text||o.docFooter).toString()]]),o.docFooter.height&&(a.heights[f.length-1]=o.docFooter.height)),f}function Be(t,i){var s=t.getColumnConfig,e=t.zf,n=[];if(s){if(!1!==i.header&&(n=Re(t,i,"header",n)),e){var h=i.xCorrection||0,r=i.yCorrection||0;for(var o in e){var a=e[o];for(var u in a){var c=t.getColumnIndex(u)-h,f=t.getIndexById(o)-r;if(!(c<0||f<0)){var l=c+a[u][0]-1,d=f+(a[u][1]-1);n.push({s:{c:c,r:f},e:{c:l,r:d}})}}}}!1!==i.footer&&(n=Re(t,i,"footer",n))}return n}function Re(t,i,s,e){for(var n=t.config.columns,h=(i.docHeader?2:0)+("header"==s?0:(!1!==i.header?t.Tf.length:0)+t.count()),r=0;r<n.length;r++)for(var o=n[r][s],a=0;a<o.length;a++)o[a]&&(o[a].colspan||o[a].rowspan)&&e.push({s:{c:r,r:a+h},e:{c:r+(o[a].colspan||1)-1,r:a+(o[a].rowspan||1)-1+h}});return e}var Pe={number:"n",date:"n",string:"s","boolean":"b"},je="_table";function Ne(t,i,s,e,n){for(var h,r,o,a,u={},c={s:{c:1e7,r:1e7},e:{c:0,r:0}},f=0;f!=t.length;++f)for(var l=0;l!=t[f].length;++l){c.s.r>f&&(c.s.r=f),c.s.c>l&&(c.s.c=l),c.e.r<f&&(c.e.r=f),c.e.c<l&&(c.e.c=l);var d={v:t[f][l]};if(null!==d.v){var v=XLSX.utils.encode_cell({c:l,r:f}),_=d.v.toString(),p="="===_.charAt(0);if((n.docHeader?2:0)+i[0].header.length<=f&&!p){var m=i[l];m.type&&(d.t=Pe[m.type]||""),m.format&&(d.z=m.format)}d.v instanceof Date?(d.t=d.t||"n",d.z=d.z||XLSX.SSF[je][14],d.v=(a=d.v,Math.round(25569+a/864e5))):d.t||("boolean"==typeof d.v?d.t="b":"number"==typeof d.v||parseFloat(d.v)==d.v?(d.v=1*d.v,d.t="n"):(d.v=_,p?(d.t="n",d.f=d.v,delete d.v):d.t="s")),e&&(d.s=(r=l,(o=e)[h=f]&&o[h][r]?o[h][r]:"")),u[v]=d}}return c.s.c<1e7&&(u["!ref"]=XLSX.utils.encode_range(c)),u["!rows"]=function b(t){for(var i in t)t[i]={hpx:t[i],hpt:.75*t[i]};return t}(i.heights),u["!cols"]=function g(t){for(var i=[],s=0;s<t.length;s++)i.push({wch:t[s].width});return i}(i),s.length&&(u["!merges"]=s),u}function Ee(t,i,n,h){n.header=D(n.header)||!0===n.header?{}:n.header,n.footer=D(n.footer)||!0===n.footer?{}:n.footer,n.table=n.table||{};var s=n.width||595.296,e=n.height||841.896;if(n.orientation&&"landscape"===n.orientation&&(e=[s,s=e][0]),n.autowidth){s=80;for(var r=0;r<t.length;r++)s+=t[r].width}for(var o=new pdfjs.Document({padding:40,font:n.Hf,threshold:256,width:s,height:e}),a=!1===n.header?0:t[0].header.length,u=!1!==n.footer&&t[0].footer?t[0].footer.length:0,c=[],f=0;f<t.length;f++)c[f]=t[f].width;var l=H.extend(n.table,{borderWidth:1,height:20,lineHeight:1.1,borderColor:15658734,backgroundColor:16777215,color:6710886,textAlign:"left",paddingRight:10,paddingLeft:10,headerRows:a,widths:c.length?c:["100%"]}),d=o.table(l);if(a)for(var v=H.extend(n.header,{borderRightColor:11587299,borderBottomColor:11587299,color:4868682,backgroundColor:13820911,height:27,lineHeight:1.2}),_=0;_<a;_++)for(var p=d.tr(v),m=0;m<t.length;m++)p.td(t[m].header[_].toString());for(var b=0;b<i.length;b++)for(var g=d.tr({}),w=0;w<i[b].length;w++)g.td(i[b][w]);if(u)for(var x=H.extend(n.footer,{borderRightColor:15658734,borderBottomColor:15658734,backgroundColor:16448250,color:6710886,height:27,lineHeight:1.2}),y=0;y<u;y++)for(var M=d.tr(x),S=0;S<t.length;S++
)M.td(t[S].footer[y].toString());!1!==n.docFooter&&o.footer().text({color:6710886,textAlign:"center"}).append(ct.dataExport.page||"Page").pageNumber().append("  "+(ct.dataExport.of||"of")+"  ").pageCount();var k={text:0,image:1};if(n.docHeader&&("string"==typeof n.docHeader&&(n.docHeader={text:n.docHeader}),H.extend(n.docHeader,{color:6710886,textAlign:"right",order:0}),k.text=n.docHeader.order),n.docHeaderImage&&("string"==typeof n.docHeaderImage&&(n.docHeaderImage={url:n.docHeaderImage}),H.extend(n.docHeaderImage,{align:"right",order:1}),k.image=n.docHeaderImage.order),n.docHeader&&k.image>k.text&&o.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader),n.docHeaderImage)pdfjs.load(n.docHeaderImage.url,function(t,i){if(!t){var s=new pdfjs.Image(i);o.header({paddingBottom:10}).image(s,n.docHeaderImage),n.docHeader&&k.image<k.text&&o.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader)}var e=o.render();h(e,n)});else{var C=o.render();h(C,n)}}var Le=null;function Oe(t,i){var s=t.callback;Ye(!1),t.box.parentNode.removeChild(t.box),Le=t.box=null,s&&s(i,t.details)}function Ue(t){if(Le){var i=(t=t||Ot).which||Ot.keyCode;if(tn.keyboard)return 13!=i&&32!=i||Oe(Le,!0),27==i&&Oe(Le,!1),t.preventDefault&&t.preventDefault(),!(t.cancelBubble=!0)}}function Ye(t){Ye.cover&&Ye.cover.parentNode||((Ye.cover=document.createElement("DIV")).onkeydown=Ue,Ye.cover.className="webix_modal_cover",document.body.appendChild(Ye.cover)),Ye.cover.style.display=t?"inline-block":"none"}function We(t,i,s){return"<div role='button' tabindex='0' aria-label='"+t+"' class='webix_popup_button"+(s?" "+s:"")+"' result='"+i+"' ><div>"+t+"</div></div>"}function Ge(t,i,s){var e=t.tagName?t:function o(e,t,i){var s=document.createElement("DIV");s.className=" webix_modal_box webix_"+e.type,s.setAttribute("webixbox",1),s.setAttribute("role","alertdialog"),s.setAttribute("aria-label",e.title||""),s.setAttribute("tabindex","0");var n="";if(e.width&&(s.style.width=e.width+(ws.isNumber(e.width)?"px":"")),e.height&&(s.style.height=e.height+(ws.isNumber(e.height)?"px":"")),e.title&&(n+='<div class="webix_popup_title">'+e.title+"</div>"),n+='<div class="webix_popup_text"><span>'+(e.content?"":e.text)+'</span></div><div  class="webix_popup_controls">',(t||e.ok)&&(n+=We(e.ok||ct.message.ok,!0,"confirm")),(i||e.cancel)&&(n+=We(e.cancel||ct.message.cancel,!1)),e.buttons)for(var h=0;h<e.buttons.length;h++)n+=We(e.buttons[h],h);if(n+="</div>",s.innerHTML=n,e.content){var r=e.content;"string"==typeof r&&(r=document.getElementById(r)),"none"==r.style.display&&(r.style.display=""),s.childNodes[e.title?1:0].appendChild(r)}return s.onclick=function(t){var i=(t=t||Ot).target||t.srcElement;if(i.className||(i=i.parentNode),-1!=i.className.indexOf("webix_popup_button")){var s=i.getAttribute("result");Oe(e,s="true"==s||"false"!=s&&s)}t.cancelBubble=!0},e.box=s,(t||i||e.buttons)&&(Le=e),s}(t,i,s);t.hidden||Ye(!0),A(t.container||document.body).appendChild(e);var n=t.left||Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-e.offsetWidth)/2)),h=t.top||Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-e.offsetHeight)/2));return"top"==t.position?e.style.top="-3px":e.style.top=h+"px",e.style.left=n+"px",e.onkeydown=Ue,e.focus(),t.hidden&&Qe.hide(e),e}function Xe(t){return Ge(t,!0,!1)}function Je(t){return Ge(t,!0,!0)}function Ke(t){return Ge(t)}function qe(t,i,s){return"object"!=k(t)&&("function"==typeof i&&(s=i,i=""),t={text:t,type:i,callback:s}),t}function Ze(){var t=qe.apply(this,arguments);return t.type=t.type||"alert",Je(t)}function Qe(){var t=qe.apply(this,arguments);return t.type=t.type||"alert",Ke(t)}function tn(t,i,s,e){switch((t=function n(t,i,s,e){return"object"!=k(t)&&(t={text:t,type:i,expire:s,id:e}),t.id=t.id||sn.uid(),t.expire=t.expire||sn.expire,t}.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return Xe(t);case"confirm":return Je(t);case"modalbox":return Ke(t);default:return function h(t){sn.area||(sn.area=document.createElement("DIV"),sn.area.className="webix_message_area",
sn.area.style[sn.position]="5px",document.body.appendChild(sn.area)),sn.area.setAttribute("role","alert"),sn.area.setAttribute("aria-atomic",!0),sn.hide(t.id);var i=document.createElement("DIV");return i.innerHTML="<div>"+t.text+"</div>",i.className="webix_info webix_"+t.type,i.onclick=function(){sn.hide(t.id),t=null},"bottom"==sn.position&&sn.area.firstChild?sn.area.insertBefore(i,sn.area.firstChild):sn.area.appendChild(i),0<t.expire&&(sn.timers[t.id]=window.setTimeout(function(){sn.hide(t.id)},t.expire)),i.style.height=i.offsetHeight-2+"px",sn.pull[t.id]=i,i=null,t.id}(t)}}Ot(document,"keydown",Ue,{capture:!0}),Qe.hide=function(t){if(t){for(;t&&t.getAttribute&&!t.getAttribute("webixbox");)t=t.parentNode;t&&t.parentNode.removeChild(t)}Ye(!1),Le=null};var sn=tn;sn.seed=(new Date).valueOf(),sn.uid=function(){return sn.seed++},sn.expire=4e3,sn.keyboard=!0,sn.position="top",sn.pull={},sn.timers={},sn.hideAll=function(){for(var t in sn.pull)sn.hide(t)},sn.hide=function(t){var i=sn.pull[t];i&&i.parentNode&&(window.setTimeout(function(){i.parentNode.removeChild(i),i=null},2e3),i.style.height=0,i.className+=" hidden",sn.area.removeAttribute("role"),sn.timers[t]&&window.clearTimeout(sn.timers[t]),delete sn.pull[t])},u("message",tn),S.isIE8&&(Object.defineProperty=function(t,i,s){t[i]=s.value});var en={startOnMonday:!1,toFixed:function(t,i){return t<10&&(t="0"+t),i&&t<100&&(t="0"+t),t},weekStart:function(t){var i=(t=this.copy(t)).getDay();return this.startOnMonday&&(0===i?i=6:i--),this.datePart(this.add(t,-1*i,"day"))},monthStart:function(t){return(t=this.copy(t)).setDate(1),this.datePart(t)},yearStart:function(t){return(t=this.copy(t)).setMonth(0),this.monthStart(t)},dayStart:function(t){return this.datePart(t,!0)},dateToStr:function(h,s){if("function"==typeof h)return h;if(S.strict)return function(i){var e="",n=0;return h.replace(/%[a-zA-Z]/g,function(s,t){e+=h.slice(n,t);e+=function(t){if("%d"==s)return en.toFixed(t.getDate());if("%m"==s)return en.toFixed(t.getMonth()+1);if("%j"==s)return t.getDate();if("%n"==s)return t.getMonth()+1;if("%y"==s)return en.toFixed(t.getFullYear()%100);if("%Y"==s)return t.getFullYear();if("%D"==s)return ct.calendar.dayShort[t.getDay()];if("%l"==s)return ct.calendar.dayFull[t.getDay()];if("%M"==s)return ct.calendar.monthShort[t.getMonth()];if("%F"==s)return ct.calendar.monthFull[t.getMonth()];if("%h"==s)return en.toFixed((t.getHours()+11)%12+1);if("%g"==s)return(t.getHours()+11)%12+1;if("%G"==s)return t.getHours();if("%H"==s)return en.toFixed(t.getHours());if("%i"==s)return en.toFixed(t.getMinutes());if("%a"==s)return 11<t.getHours()?ct.pm[0]:ct.am[0];if("%A"==s)return 11<t.getHours()?ct.pm[1]:ct.am[1];if("%s"==s)return en.toFixed(t.getSeconds());if("%S"==s)return en.toFixed(t.getMilliseconds(),!0);if("%W"==s)return en.toFixed(Date.getISOWeek(t));if("%c"!=s)return s;var i=t.getFullYear();return i+="-"+en.toFixed(t.getMonth()+1),i+="-"+en.toFixed(t.getDate()),i+="T",i+=en.toFixed(t.getHours()),i+=":"+en.toFixed(t.getMinutes()),i+=":"+en.toFixed(t.getSeconds())}(i),n=t+2}),e+=h.slice(n,h.length)};h=h.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+wDate.toFixed(date.getDate())+"';case"%m":return'"+wDate.toFixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+wDate.toFixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+i18n.calendar.dayShort[date.getDay()]+"';case"%l":return'"+i18n.calendar.dayFull[date.getDay()]+"';case"%M":return'"+i18n.calendar.monthShort[date.getMonth()]+"';case"%F":return'"+i18n.calendar.monthFull[date.getMonth()]+"';case"%h":return'"+wDate.toFixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+wDate.toFixed(date.getHours())+"';case"%i":return'"+wDate.toFixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?i18n.pm[0]:i18n.am[0])+"';case"%A":return'"+(date.getHours()>11?i18n.pm[1]:i18n.am[1])+"';case"%s":return'"+wDate.toFixed(date.getSeconds())+"';case"%S":
return'"+wDate.toFixed(date.getMilliseconds(), true)+"';case"%W":return'"+wDate.toFixed(wDate.getISOWeek(date))+"';case"%c":var i='"+date.getFullYear()+"';return i+='-"+wDate.toFixed((date.getMonth()+1))+"',i+='-"+wDate.toFixed(date.getDate())+"',i+="T",i+='"+wDate.toFixed(date.getHours())+"',i+=':"+wDate.toFixed(date.getMinutes())+"',i+=':"+wDate.toFixed(date.getSeconds())+"',!0===s&&(i+="Z"),i;default:return t}}),!0===s&&(h=h.replace(/date\.get/g,"date.getUTC"));var i=new Function("date","i18n","wDate","if (!date) return ''; if (!date.getMonth) date=i18n.parseFormatDate(date);  return \""+h+'";');return function(t){return i(t,ct,en)}},strToDate:function(t,h){if("function"==typeof t)return t;var r,i,s,o=t.match(/%[a-zA-Z]/g),e="var temp=date.split(/[^0-9a-zA-Z]+/g);";if(!ct.calendar.monthShort_hash){for(s=ct.calendar.monthShort,i=ct.calendar.monthShort_hash={},r=0;r<s.length;r++)i[s[r]]=r;for(s=ct.calendar.monthFull,i=ct.calendar.monthFull_hash={},r=0;r<s.length;r++)i[s[r]]=r}if(S.strict)return function(t){if(!t)return"";if("object"==k(t))return t;var i=t.split(/[^0-9a-zA-Z]+/g),s=[0,0,1,0,0,0,0];for(r=0;r<o.length;r++){var e=o[r];if("%y"==e)s[0]=1*i[r]+(30<i[r]?1900:2e3);else if("%Y"==e)s[0]=1*(i[r]||0),s[0]<30&&(s[0]+=2e3);else if("%n"==e||"%m"==e)s[1]=(i[r]||1)-1;else if("%M"==e)s[1]=ct.calendar.monthShort_hash[i[r]]||0;else if("%F"==e)s[1]=ct.calendar.monthFull_hash[i[r]]||0;else if("%j"==e||"%d"==e)s[2]=i[r]||1;else if("%g"==e||"%G"==e||"%h"==e||"%H"==e)s[3]=i[r]||0;else if("%a"==e)s[3]=s[3]%12+((i[r]||"")==ct.am[0]?0:12);else if("%A"==e)s[3]=s[3]%12+((i[r]||"")==ct.am[1]?0:12);else if("%i"==e)s[4]=i[r]||0;else if("%s"==e)s[5]=i[r]||0;else if("%S"==e)s[6]=i[r]||0;else if("%c"==e){var n=/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(\+.*|)/g.exec(t);s[0]=1*(n[1]||0),s[0]<30&&(s[0]+=2e3),s[1]=(n[2]||1)-1,s[2]=n[3]||1,s[3]=n[4]||0,s[4]=n[5]||0,s[5]=n[6]||0}}return h?new Date(Date.UTC(s[0],s[1],s[2],s[3],s[4],s[5],s[6])):new Date(s[0],s[1],s[2],s[3],s[4],s[5],s[6])};for(r=0;r<o.length;r++)switch(o[r]){case"%j":case"%d":e+="set[2]=temp["+r+"]||1;";break;case"%n":case"%m":e+="set[1]=(temp["+r+"]||1)-1;";break;case"%y":e+="set[0]=temp["+r+"]*1+(temp["+r+"]>30?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":e+="set[3]=temp["+r+"]||0;";break;case"%i":e+="set[4]=temp["+r+"]||0;";break;case"%Y":e+="set[0]=(temp["+r+"]||0)*1; if (set[0]<30) set[0]+=2000;";break;case"%a":e+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[0]?0:12);";break;case"%A":e+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[1]?0:12);";break;case"%s":e+="set[5]=temp["+r+"]||0;";break;case"%S":e+="set[6]=temp["+r+"]||0;";break;case"%M":e+="set[1]=i18n.calendar.monthShort_hash[temp["+r+"]]||0;";break;case"%F":e+="set[1]=i18n.calendar.monthFull_hash[temp["+r+"]]||0;";break;case"%c":e+="var res = date.split('T');",e+="if(res[0]){ var d = res[0].split('-');",e+="set[0]= (d[0]||0)*1; if (set[0]<30) set[0]+=2000;",e+="set[1]= (d[1]||1)-1;",e+="set[2]= d[2]||1;}",e+="if(res[1]){ var t = res[1].split(':');",e+="set[3]= t[0]||0;",e+="set[4]= t[1]||0;",e+="set[5]= parseInt(t[2])||0;}"}var n="set[0],set[1],set[2],set[3],set[4],set[5], set[6]";h&&(n=" Date.UTC("+n+")");var a=new Function("date","i18n","if (!date) return ''; if (typeof date == 'object') return date; var set=[0,0,1,0,0,0,0]; "+e+" return new Date("+n+");");return function(t){return a(t,ct)}},getISOWeek:function(t){if(!t)return!1;var i=t.getDay();0===i&&(i=7);var s=new Date(t.valueOf());s.setDate(t.getDate()+(4-i));var e=s.getFullYear(),n=Math.floor((s.getTime()-new Date(e,0,1).getTime())/864e5);return 1+Math.floor(n/7)},getUTCISOWeek:function(t){return this.getISOWeek(t)},Bf:function(t,i,s,e){if(s){var n=e(t,i);if(n)for(var h=0<s?1:-1;n;)t.setHours(t.getHours()+h),n=e(t,i),h+=0<s?1:-1}},add:function(t,i,s,e){e&&(t=this.copy(t));var n=en.copy(t);switch(s){case"day":t.setDate(t.getDate()+i),this.Bf(t,n,i,function(t,i){return en.datePart(i,!0).valueOf()==en.datePart(t,!0).valueOf()});break;case"week":t.setDate(t.getDate()+7*i),this.Bf(t,n,7*i,function(t,i){return en.datePart(i,!0).valueOf()==en.datePart(t,!0).valueOf()})
;break;case"month":t.setMonth(t.getMonth()+i),this.Bf(t,n,i,function(t,i){return i.getMonth()==t.getMonth()&&i.getYear()==t.getYear()});break;case"year":t.setYear(t.getFullYear()+i),this.Bf(t,n,i,function(t,i){return i.getFullYear()==t.getFullYear()});break;case"hour":t.setHours(t.getHours()+i),this.Bf(t,n,i,function(t,i){return i.getHours()==t.getHours()&&Date.datePart(i,!0)==Date.datePart(t,!0)});break;case"minute":t.setMinutes(t.getMinutes()+i);break;default:en.add[s](t,i,s)}return t},datePart:function(t,i){i&&(t=this.copy(t));var s=this.copy(t);return s.setHours(0),s.getDate()!=t.getDate()?t.setHours(1):t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},timePart:function(t,i){return i&&(t=this.copy(t)),(t.valueOf()/1e3-60*t.getTimezoneOffset())%86400},copy:function(t){return new Date(t.valueOf())},equal:function(t,i){return!(!t||!i)&&t.valueOf()===i.valueOf()},isHoliday:function(t){if(0===(t=t.getDay())||6==t)return"webix_cal_event"}},nn={getConfig:function(t){var i={decimalSize:0,groupSize:999,prefix:"",sufix:""},s=t.split(/[0-9].*[0-9]/g);s[0].length&&(i.prefix=s[0]),s[1].length&&(i.sufix=s[1]),(i.prefix||i.sufix)&&(t=t.substr(i.prefix.length,t.length-i.prefix.length-i.sufix.length));var e=t.indexOf("1");0<e&&(i.prefix=t.substr(0,e),t=t.substr(e));var n=t.indexOf("0");0<n&&(i.decimalSize=t.length-n,i.decimalDelimiter=t[n-1],t=t.substr(0,n-1));var h=t.match(/[^0-9]/);return h&&(i.groupSize=t.length-h.index-1,i.groupDelimiter=t[h.index]),i},parse:function(t,i){if(!t||"string"!=typeof t)return t;i.prefix&&(t=t.toLowerCase().replace(i.prefix.toLowerCase()||"","")),i.sufix&&(t=t.toLowerCase().replace(i.sufix.toLowerCase()||"",""));var s="";if(i.decimalDelimiter){var e=t.indexOf(i.decimalDelimiter);-1<e&&(s=(s=t.substr(e+1).replace(/[^0-9]/g,"")).substr(0,Math.min(s.length,i.decimalSize)),t=t.substr(0,e))}var n="-"===t[0]?-1:1;return(t=t.replace(/[^0-9]/g,""))||(t="0"),s&&(t+="."+s),parseFloat(t)*n},format:function(t,i){if(""===t||void 0===t)return t;i=i||ct;var s=(t=parseFloat(t))<0?"-":"";t=Math.abs(t),i.decimalOptional||(t=t.toFixed(i.decimalSize));var e=t.toString();e=e.split(".");var n="";if(i.groupSize){var h=i.groupSize,r=e[0].length;do{n=(0<(r-=h)?e[0].substr(r,h):e[0].substr(0,h+r))+(n?i.groupDelimiter+n:"")}while(0<r)}else n=e[0];return e=i.decimalSize?s+n+(e[1]?i.decimalDelimiter+e[1]:""):s+n,i.prefix||i.sufix?i.prefix+e+i.sufix:e},numToStr:function(i){return function(t){return nn.format(t,i)}}};var hn=["fullDateFormat","timeFormat","dateFormat","longDateFormat","parseFormat","parseTimeFormat"];ct.setLocale=function(t){"string"==typeof t&&(t=ct.locales[t]),t&&(t.priceSettings=B(t.priceSettings||t),function r(t,i){for(var s in i)"object"!=k(i[s])||b(i[s])?t[s]=i[s]:(t[s]||(t[s]={}),r(t[s],i[s]))}(ct,t));for(var i=0;i<hn.length;i++){var s=hn[i],e=ct[s+"UTC"];ct[s+"Str"]=en.dateToStr(ct[s],e),ct[s+"Date"]=en.strToDate(ct[s],e)}var n=Ft(ct.price),h=ct.priceSettings||ct;ct.intFormat=nn.numToStr({groupSize:ct.groupSize,groupDelimiter:ct.groupDelimiter,decimalSize:0}),ct.priceFormat=function(t){return n(nn.format(t,h))},ct.numberFormat=nn.format},ct.locales={"en-US":{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%m/%d/%Y",timeFormat:"%h:%i %A",longDateFormat:"%d %F %Y",fullDateFormat:"%m/%d/%Y %h:%i %A",am:["am","AM"],pm:["pm","PM"],price:"${obj}",priceSettings:{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2},fileSize:["b","Kb","Mb","Gb","Tb","Pb","Eb"],calendar:{monthFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],hours:"Hours",minutes:"Minutes",done:"Done",clear:"Clear",today:"Today"},dataExport:{page:"Page",of:"of"},PDFviewer:{of:"of",automaticZoom:"Automatic Zoom",actualSize:"Actual Size",pageFit:"Page Fit",pageWidth:"Page Width",pageHeight:"Page Height"},aria:{
calendar:"Calendar",increaseValue:"Increase value",decreaseValue:"Decrease value",navMonth:["Previous month","Next month"],navYear:["Previous year","Next year"],navDecade:["Previous decade","Next decade"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Hours: %h %A",minuteFormat:"Minutes: %i",removeItem:"Remove item",pages:["First page","Previous page","Next page","Last page"],page:"Page",headermenu:"Header menu",openGroup:"Open column group",closeGroup:"Close column group",closeTab:"Close tab",showTabs:"Show more tabs",resetTreeMap:"Reset tree map",navTreeMap:"Level up",nextTab:"Next tab",prevTab:"Previous tab",multitextSection:"Add section",multitextextraSection:"Remove section",showChart:"Show chart",hideChart:"Hide chart",resizeChart:"Resize chart"},richtext:{underline:"Underline",bold:"Bold",italic:"Italic"},combo:{select:"Select",selectAll:"Select all",unselectAll:"Unselect all"},message:{ok:"OK",cancel:"Cancel"},comments:{send:"Send",confirmMessage:"The comment will be removed. Are you sure?",edit:"Edit",remove:"Remove",placeholder:"Type here..",moreComments:"More comments"}}},ct.setLocale("en-US");var rn={track:function(t,i){if(this.Rf(t,i),this.Pf&&jt(this.jf).detachEvent(this.Pf),t){var s=jt(this.jf=t),e=function(){rn.Nf||s.getValue&&rn.push(t,s.getValue())};s.getActiveId?this.Pf=s.attachEvent("onViewChange",e):this.Pf=s.attachEvent("onChange",e)}},Ef:function(t,i){rn.Nf=1,(t=jt(t)).callEvent("onBeforeHistoryNav",[i])&&t.setValue&&t.setValue(i),rn.Nf=0},push:function(t,i,s){t=jt(t);var e="";i&&(e="#!/"+i),D(s)&&(s=t.getValue?t.getValue():i),window.history.pushState({webix:!0,id:t.q.id,value:s},"",e)},Rf:function(t,i){Ot(window,"popstate",function(t){t.state&&t.state.webix&&rn.Ef(t.state.id,t.state.value)});var s=window.location.hash;M.noanimate=!0,s&&0===s.indexOf("#!/")?rn.Ef(t,s.replace("#!/","")):i&&(rn.push(t,i),rn.Ef(t,i)),M.noanimate=!1,this.Rf=function(){}}},on={namespace:"x",attribute:"data-",dataTag:"li",Lf:/-([a-z])/g,Of:function(t){return t[1].toUpperCase()},Uf:{width:!0,height:!0,gravity:!0,margin:!0,padding:!0,paddingX:!0,paddingY:!0,minWidth:!0,maxWidth:!0,minHeight:!0,maxHeight:!0,headerRowHeight:!0},Yf:{disabled:!0,hidden:!0},Wf:function(t,i){return Rt(t,i)},init:function(t,i,s){t=t||document.body;for(var e=[],n=this.Gf(t),h=n.html,r=null,o=n.length-1;0<=o;o--)e[o]=n[o];for(var a=0;a<e.length;a++){var u;(u=this.Xf(e[a],h)).$scope=s,r=this.Jf(u,e[a],h,i)}return r},parse:function(t,i){"string"==typeof t&&(t=oi[i||"xml"].toObject(t,t));var s=this.Gf(t,i);return this.Xf(s[0],s.html)},Jf:function(t,i,s,e){return e?t.container=e:(t.container=i.parentNode,G(i)),this.Wf(t.view,"setPosition")&&delete t.container,Vt(t)},Gf:function(t){this.Kf=this.namespace?this.namespace+":":"",this.qf=this.Kf+"ui";var i=t.getElementsByTagName(this.qf);return!i.length&&t.documentElement&&t.documentElement.tagName==this.qf&&(i=[t.documentElement]),!i.length&&this.namespace&&!(i=t.getElementsByTagName("ui")).length&&t.documentElement&&"ui"==t.documentElement.tagName&&(i=[t.documentElement]),i.length||((i=this.Zf(t)).html=!0),i},Zf:function(t){if(t.getAttribute&&t.getAttribute(this.attribute+"view"))return[t];for(var i=t.querySelectorAll("["+this.attribute+"view]"),s=[],e=0;e<i.length;e++)i[e].parentNode.getAttribute(this.attribute+"view")||s.push(i[e]);return s},Xf:function(t,i,s){var e=!1;if(!s){var n=this.Qf(t,i);if("ui"==n)for(var h=t.childNodes,r=0;r<h.length;r++)if(1==h[r].nodeType)return this.Xf(h[r],i);s={view:n},i&&"table"==t.tagName.toLowerCase()&&(s.data=t,s.datatype="htmltable",e=!0)}for(var o="cols"==s.view||"rows"==s.view||this.Wf(s.view,"addView"),a=[],u=0,c=!(i||t.style),f=t.firstChild;f;){if(1==f.nodeType){var l=this.Qf(f,i);if("data"==l){u=1;var d=f;f=f.nextSibling,s.data=this.tl(d,i);continue}if("config"==l){this.il(f,s,i);var v=f;f=f.nextSibling,G(v);continue}if("column"==l){u=1;var _=this.sl(f,i);_.header=_.header||_.value,_.width=1*_.width||"",s.columns=s.columns||[],s.columns.push(_)}else if(l||o&&i){var p=this.Xf(f,i,{view:l})
;"head"==p.view?s.head=p.rows?p.rows[0]:p.template:"body"==p.view?this.Wf(s.view,"addView")?a.push({body:p.rows?p.rows[0]:p.value,header:p.header||""}):s.body=p.rows?1==p.rows.length?p.rows[0]:{rows:p.rows}:p.value:a.push(p)}else if(c){u=1;var m=f.tagName;i&&(m=m.toLowerCase().replace(this.Lf,this.Of)),s[m]=oi.xml.tagToObject(f)}}f=f.nextSibling}if(this.el(t,s,i),a.length)s.stack?s[s.stack]=a:s.subui?s[s.subui]=a[0]:this.Wf(s.view,"setValues")?s.elements=a:"rows"==s.view?(s.view="layout",s.rows=a):"cols"==s.view?(s.view="layout",s.cols=a):this.Wf(s.view,"setValue")?s.cells=a:this.Wf(s.view,"getBody")?s.body=1==a.length?a[0]:{rows:a}:s.rows=a;else if(!e&&!u)if(!i||s.template||s.view&&"template"!=s.view){var b=this.nl(t,i);if(b){var g="template";this.Wf(s.view,"setValue")&&(g="value"),s[g]=s[g]||b}}else s.view="template",s.content=t;return s},hl:function(t){return!(0<t.replace(/\s+/gm,"").length)},rl:{body:1,head:1,data:1,rows:1,cols:1,cells:1,elements:1,ui:1,column:1,config:1},il:function(t,i,s){var e=this.el(t,{});e.name?delete(i[e.name]=e).name:e.stack?i[e.stack]=[]:i=e;for(var n=t.childNodes,h=0;h<n.length;h++){var r=null;1==n[h].nodeType&&"config"==n[h].tagName.toLowerCase()&&n[h].attributes.length?r=this.il(n[h],e,s):1==n[h].nodeType&&"data"==n[h].tagName.toLowerCase()?(r=this.tl(n[h],s),e.stack||(e.data=r)):r=n[h].innerHTML,e.stack&&r&&i[e.stack].push(r)}return i},Qf:function(t,i){if(i)return t.getAttribute(this.attribute+"view")||("config"==t.tagName.toLowerCase()?"config":null);var s=t.tagName.toLowerCase();if(this.namespace){if(0===s.indexOf(this.Kf)||t.scopeName==this.namespace)return s.replace(this.Kf,"")}else if(Vt[s]||this.rl[s])return s;return 0},tl:function(t,i){for(var s=[],e=t.getElementsByTagName(on.dataTag),n=0;n<e.length;n++){var h=e[n];if(h.parentNode.parentNode.tagName!=on.dataTag){var r=this.sl(h,i);h.className&&(r.$css=h.className),s.push(r)}}return G(t),s},nl:function(t){return t.style?t.innerHTML:t.firstChild&&(t.firstChild.wholeText||t.firstChild.data)||""},sl:function(t,i){if(!i)return oi.xml.tagToObject(t);var s=this.el(t,{},i);return!s.value&&t.childNodes.length&&(s.value=this.nl(t,i)),s},el:function(t,i,s){for(var e=t.attributes,n=0;n<e.length;n++){var h=e[n].name;if(s){if(0!==h.indexOf(this.attribute))continue;h=h.replace(this.attribute,"").replace(this.Lf,this.Of)}var r=e[n].value;-1!=r.indexOf("json://")&&(r=JSON.parse(r.replace("json://",""))),this.Uf[h]?r=parseInt(r,10):this.Yf[h]&&(r=r&&"false"!==r&&"0"!=r),i[h]=r}return i}};S.printPPI=96,S.printMargin=.75*S.printPPI;var an=S.printMargin,un={a4:"A4",a3:"A3",letter:"letter"},cn={page:!0,data:!0},fn={portrait:!0,landscape:!0},ln={A3:{width:11.7,height:16.5},A4:{width:8.27,height:11.7},letter:{width:8.5,height:11}};function dn(t,i){var s=Y("div",{"class":"webix_view webix_print_"+t.toLowerCase(),style:"height:0px;visibility:hidden;"},i["doc"+t]);"Header"===t?X(s,document.body.firstChild):document.body.appendChild(s),i["doc"+t]=s}var vn={phone:{mask:"+# (###) ###-####",allow:/[0-9]/g},card:{mask:"#### #### #### ####",allow:/[0-9]/g},date:{mask:"####-##-## ##:##",allow:/[0-9]/g}},_n={denySelect:j,allowSelect:N,index:E,createCss:L,addStyle:O,removeStyle:U,create:Y,getValue:W,remove:G,insertBefore:X,locate:J,offset:K,posRelative:q,pos:Z,preventEvent:Q,stopEvent:tt,triggerEvent:it,addCss:st,removeCss:et,getTextSize:nt,download:ht,ol:rt,setSelectionRange:ot,getSelectionRange:at,addMeta:ut},pn={$active:Qi,set:os,material:is,mini:ss,flat:es,compact:ns,contrast:hs},mn={};function bn(t,i,s,e){var n=mt.defer(),h="webix_jsonp_"+z(),r=document.createElement("script");r.id=h,r.type="text/javascript";var o=document.getElementsByTagName("head")[0];"function"==typeof i&&(e=s,s=i,i={}),i||(i={}),i.jsonp=h,window[h]=function(){s&&s.apply(e||window,arguments),n.resolve(arguments[0]),window.clearTimeout(mn[h]),delete mn[h],r.parentNode.removeChild(r),s=o=e=r=null,delete window[h]},mn[h]=window.setTimeout(function(){n.reject(),delete window[h]},bn.timer);var a=[];for(var u in i)a.push(u+"="+encodeURIComponent(i[u]));return t+=(-1==t.indexOf("?")?"?":"&"
)+a.join("&"),r.src=t,o.appendChild(r),n}bn.timer=3e3;var gn="__webix_remote_error";function wn(t,i){this.al={},this.ul=[],this.cl=t,this.Va="",i?this.fl(i):this.ll=xt(t).then(function(t){return t.text()}).then(C(function(t){return t=t.split("/*api*/")[1],this.fl(JSON.parse(t)),this.al},this))}function xn(t,i){var s=new wn(t,i).dl();for(var e in s)yn[e]=s[e];return s}wn.prototype={fl:function(t){if(t.$key&&(this.Va=t.$key),t.$vars)for(var i in t.$vars)this.al[i]=t.$vars[i];this.Pt(t,this.al,"")},Pt:function(t,i,s){for(var e in t)if("$key"!==e&&"$vars"!==e){var n=t[e];if("object"==k(n)){var h=i[e]={};this.Pt(n,h,s+e+".")}else i[e]=this.vl(this,s+e)}},_l:function(t,i){var s=this.pl(this,t,i);return this.ul.push(s),this.ml(),s},ml:function(){this.bl||(this.bl=setTimeout(C(this.gl,this),1))},gl:function(){for(var t=[],h=this.ul,i=0;i<this.ul.length;i++){var s=this.ul[i];s.$sync?(h.splice(i,1),i--):t.push({name:s.$name,args:s.$args})}if(h.length){var e=xt(),n=this.wl(t);I("onBeforeRemoteCall",[e,n,{}]);var r=e.post(this.cl,n).then(function(t){for(var i=t.json().data,s=0;s<i.length;s++){var e=i[s],n=i[s]&&i[s][gn];n?(I("onRemoteError",[n]),h[s].reject(n)):h[s].resolve(e)}},function(t){for(var i=0;i<h.length;i++)h[i].reject(t);throw t});I("onAfterRemoteCall",[r])}this.ul=[],this.bl=null},Y:function(){var t=null;this.$sync=!0;var i=[{name:this.$name,args:this.$args}];try{var s=xt(),e=this.$context.wl(i);I("onBeforeRemoteCall",[s,e,{sync:!0}]);var n=s.sync().post(this.$context.cl,e);I("onAfterRemoteCall",[null]),(t=JSON.parse(n.responseText).data[0])[gn]&&(t=null)}catch(Bo){}return t},pl:function(t,i,s){var e=mt.defer();return e.sync=t.Y,e.$name=i,e.$args=s,e.$context=this,e},vl:function(t,i){return function(){return t._l(i,[].slice.call(arguments))}},dl:function(){return this.ll||this.al},wl:function(t){return{key:this.Va,payload:t}}};var yn=function(t,i){if("object"!==k(t))return xn(t,i);var s=document.getElementsByTagName("script");return i=t,xn(t=s[s.length-1].src,i)};function Mn(){var t=!!(window.orientation%180);M.orientation!==t&&(M.orientation=t,I("onRotate",[t]))}S.touch&&(M.orientation=!!((D(window.orientation)?90:window.orientation)%180),Ot(window,"onorientationchange"in window?"orientationchange":"resize",Mn));var Sn={textWaitDelay:500,summColumn:{getValue:function(t){return t.firstChild.innerHTML},setValue:function(){},refresh:function(t,i,s){var e=0;t.mapCells(null,s.columnId,null,1,function(t){t*=1,isNaN(t)||(e+=t)},!0),s.format&&(e=s.format(e)),s.template&&(e=s.template({value:e})),i.firstChild.innerHTML=e},trackCells:!0,render:function(t,i){return i.template&&(i.template=Ft(i.template)),""}},masterCheckbox:{getValue:function(){},setValue:function(){},getHelper:function(t,i){return{check:function(){i.checked=!1,t.onclick()},uncheck:function(){i.checked=!0,t.onclick()},isChecked:function(){return i.checked}}},refresh:function(s,t,e){t.onclick=function(){this.getElementsByTagName("input")[0].checked=e.checked=!e.checked;var t=s.getColumnConfig(e.columnId),i=e.checked?t.checkValue:t.uncheckValue;s.data.each(function(t){t[e.columnId]=i,s.callEvent("onCheck",[t.id,e.columnId,i]),this.callEvent("onStoreUpdated",[t.id,t,"save"])}),s.refresh()}},render:function(t,i){return"<input type='checkbox' "+(i.checked?"checked='1'":"")+">"}},textFilter:{getInputNode:function(t){return t.firstChild?t.firstChild.firstChild:{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(t,i,s){i.component=t.q.id,t.registerFilter(i,s,this),i.xl=t.q.id,s.value&&this.getValue(i)!=s.value&&this.setValue(i,s.value),i.onclick=Q,Lt(i,"keydown",this.yl)},render:function(t,i){return this.init&&this.init(i),i.css="webix_ss_filter","<input "+(i.placeholder?'placeholder="'+i.placeholder+'" ':"")+"type='text'>"},yl:function(t){var i=this.xl;9!=(t.which||t.keyCode)&&(this.Ml&&window.clearTimeout(this.Ml),this.Ml=window.setTimeout(function(){var t=jt(i);t&&t.filterByAll()},Sn.textWaitDelay))}},selectFilter:{getInputNode:function(t){
return t.firstChild?t.firstChild.firstChild:{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(i,s,e){var t;e.compare=e.compare||function(t,i){return t==i},s.component=i.q.id,i.registerFilter(s,e,this);var n=e.options;n?"string"==typeof n?(t=e.options=[],xt(n).then(C(function(t){e.options=t.json(),this.refresh(i,s,e)},this))):t=n:(t=i.collectValues(e.columnId,e.collect)).unshift({id:"",value:""});var h=jt(n);h&&h.data&&h.data.getRange&&(t=h.data.getRange());for(var r=document.createElement("select"),o=0;o<t.length;o++){var a=document.createElement("option");a.value=t[o].id,a.text=t[o].value,r.add(a)}s.firstChild.innerHTML="",s.firstChild.appendChild(r),e.value&&this.setValue(s,e.value),s.onclick=Q,r.xl=i.q.id,Lt(r,"change",this.Sl)},render:function(t,i){return this.init&&this.init(i),i.css="webix_ss_filter",""},Sl:function(){jt(this.xl).filterByAll()}}};Sn.serverFilter=H.extend({$server:!0,yl:function(t){var i=this.xl,s=t.which||t.keyCode;9==s||33<=s&&s<=40||(this.Ml&&window.clearTimeout(this.Ml),this.Ml=window.setTimeout(function(){jt(i).filterByAll()},Sn.textWaitDelay))}},Sn.textFilter),Sn.serverSelectFilter=H.extend({$server:!0,Sl:function(){jt(this.xl).filterByAll()}},Sn.selectFilter),Sn.numberFilter=H.extend({init:function(e){e.prepare=function(t){var i=-1!=t.indexOf("=")?1:0,s=this.format(t);return""===s?"":(-1!=t.indexOf(">")?e.compare=this.kl:-1!=t.indexOf("<")?(e.compare=this.Cl,i*=-1):(e.compare=this.Dl,i=0),s-i)}},format:function(t){return t.replace(/[^\-.0-9]/g,"")},kl:function(t,i){return i<1*t},Cl:function(t,i){return""!==t&&1*t<i},Dl:function(t,i){return 1*t==i}},Sn.textFilter),Sn.dateFilter=H.extend({format:function(t){if(""===t)return"";var i=new Date;if(-1!=t.indexOf("today"))i=en.dayStart(i);else if(-1==t.indexOf("now")){var s=t.match(/[0-9]+/g);if(!s||!s.length)return"";i=s.length<3?(s.reverse(),new Date(s[0],(s[1]||1)-1,1)):ct.dateFormatDate(t.replace(/^[>< =]+/,""))}return i.valueOf()}},Sn.numberFilter);var kn={name:"baselayout",restore:function(t,i,s){var e=this.$l(B(t),i);if(s)return e;Vt(e.cols||e.rows,this)},$l:function(t,i){if(!t.$layout)return i.call(this,t);for(var s=t.cols||t.rows,e=0;e<s.length;e++)s[e]=this.$l(s[e],i);return t},serialize:function(t){for(var i=[],s=this.getChildViews(),e=0;e<s.length;e++){var n=s[e];if(n.movePortlet){var h=n.getChildViews();i.push(t.call(this,h[h.length-1]))}else n.serialize?i.push(n.serialize(t,!0)):i.push(t.call(this,n))}var r={$layout:!0,type:this.config.type};return this.config.rows?r.rows=i:r.cols=i,r},$init:function(t){this.$ready.push(this.Al),this.bt=this.re,this.Il=[],this.Fl=[],t.$topView&&(t.borderless=!0,t.Q={top:!0,left:!0,bottom:!0,right:!0}),t.isolate&&H.extend(this,Es)},rows_setter:function(t){return this.Tl=1,this.zl=t,!0},cols_setter:function(t){return this.Tl=0,this.$view.style.whiteSpace="nowrap",this.zl=t,!0},et:function(t){x.removeAt.call(this.Ks,x.find.call(this.Ks,t)),this.resizeChildren(!0)},st:function(t,i){if(D(i)){for(var s=0;s<this.Ks.length;s++)this.Ks[s].destructor();this.zl=t,this.Al()}else{var e;if("number"==typeof i){(i<0||i>this.Ks.length)&&(i=this.Ks.length);var n=(this.Ks[i]||{}).nt;x.insertAt.call(this.Ks,t,i),t.q.hidden||X(t.nt,n,this.bt)}else{e=jt(i),i=x.find.call(this.Ks,e);var h=e.nt.parentNode;h&&!t.q.hidden&&h.insertBefore(t.nt,e.nt),e.destructor(),this.Ks[i]=t}this.Tl||this.da(t)}this.resizeChildren(!0);var r=this.elements?this:this.getFormView();r&&r.Vl(),I("onReconstruct",[this])},da:function(t){t.nt.style.display="inline-block",t.nt.style.verticalAlign="top"},addView:function(t,i){D(i)&&(i=this.Ks.length);var s=this.$$?this:this.getTopParentView();M._=this;var e=s&&s.ui?s.ui(t,this,i):Vt(t,this,i);return M._=null,e.q.id},removeView:function(t){var i;i="object"!=k(t)?jt(t)||(this.$$?this.$$(t):null):t;var s=x.find.call(this.Ks,i);if(0<=s){this.Hl&&this.Hl(s,i);var e=this.elements?this:this.getFormView();this.Ks.splice(s,1),e&&Vt.each(i,function(t){t.name&&delete e.getCleanValues()[t.config.name]},e,!0),i.destructor(),
this.resizeChildren(!0),e&&e.Vl()}I("onReconstruct",[this])},reconstruct:function(){this.Bl=0,this.st(this.zl)},Zs:function(t,i,s){t.q.hidden||(t.q.hidden=!0,G(t.nt),this.Bl++,s||M.w||this.resizeChildren(!0))},Rl:function(t){t.callEvent&&t.callEvent("onViewShow",[])},resizeChildren:function(){if(!M.l&&this.Il){var t=this.getParentView();if(t)return t.resizeChildren?t.resizeChildren():t.resize();var i,s,e,n,h=this.$getSize(0,0);if(e=i=this.Il[0]||0,n=s=this.Il[1]||0,(1e5<=h[1]||1e5<=h[3])&&this.nt.parentNode&&(e=i=Math.max(h[0],this.q.width||this.nt.parentNode.offsetWidth||i||0),n=s=Math.max(h[2],this.q.height||this.nt.parentNode.offsetHeight||s||0)),t)this.ga(i,s);else{h[0]>i&&(e=h[0]),h[2]>s&&(n=h[2]);var r=this.nt.parentNode==document.body&&!this.setPosition;!r&&i>h[1]&&(e=h[1]),!r&&s>h[3]&&(n=h[3]),this.$setSize(e,n)}M.o&&(M.o=!1,this.resizeChildren()),I("onResize",[])}},getChildViews:function(){return this.Ks},index:function(t){t.q&&(t=t.q.id);for(var i=0;i<this.Ks.length;i++)if(this.Ks[i].q.id==t)return i;return-1},Re:function(t,i,s){if(t.q.hidden){t.q.hidden=!1;for(var e=this.index(t)+1;this.Ks[e]&&this.Ks[e].q.hidden;)e++;var n=this.Ks[e]?this.Ks[e].nt:null;X(t.nt,n,this.bt||this.nt),this.Bl--,s||(this.resizeChildren(!0),t.refresh&&t.refresh()),t.callEvent&&(t.callEvent("onViewShow",[]),Vt.each(t,this.Rl))}},showBatch:function(t,i){var s=void 0!==i;if(i=!1!==i,s)this.q.visibleBatch="";else{if(this.q.visibleBatch==t)return;this.q.visibleBatch=t}for(var e=[],n=0;n<this.Ks.length;n++)this.Ks[n].q.batch||this.Ks[n].q.hidden?this.Ks[n].q.batch==t?i?e.push(this.Ks[n]):this.Zs(this.Ks[n],null,!0):s||this.Zs(this.Ks[n],null,!0):e.push(this.Ks[n]);for(var h=0;h<e.length;h++)this.Re(e[h],null,!0),e[h].Pe();this.resizeChildren(!0)},Al:function(t){this.Ks=[],this.name;for(var i=0;i<t.length;i++)M._=this,t[i].Q||(t[i].borderless=!0),this.Ks[i]=Vt.ot(t[i],this),this.Tl||this.da(this.Ks[i]),this.q.visibleBatch&&this.q.visibleBatch!=this.Ks[i].q.batch&&this.Ks[i].q.batch&&(this.Ks[i].q.hidden=!0,this.Bl++),this.Ks[i].q.hidden||((this.bt||this.re).appendChild(this.Ks[i].nt),this.Ks[i].$nospace&&this.Bl++);this.Pl&&this.Pl(t)},jl:function(t,i,s){if(this.Tl!=s)for(var e=0;e<this.Ks.length;e++)this.Ks[e].q[t]=i,this.Ks[e].jl&&this.Ks[e].jl(t,i,s)},$getSize:function(t,i){var s=0,e=1e5,n=1e5,h=0;this.Tl?n=0:e=0;var r=0,o=0,a=0;this.pa=[];for(var u=0;u<this.Ks.length;u++)if(!this.Ks[u].q.hidden){var c=this.pa[u]=this.Ks[u].$getSize(0,0);this.Ks[u].$nospace?o++:this.Tl?(c[0]>s&&(s=c[0]),c[1]<e&&(e=c[1]),h+=c[2],n+=c[3],c[2]==c[3]&&-1!=c[2]?(r+=c[2],o++):a+=c[4]):(c[2]>h&&(h=c[2]),c[3]<n&&(n=c[3]),s+=c[0],e+=c[1],c[0]==c[1]&&-1!=c[0]?(r+=c[0],o++):a+=c[4])}n<h&&(n=h),e<s&&(e=s),this.Nl=[r,this.Ks.length-o,a],this.El=[s+t,h+i];var f=Ui.api.$getSize.call(this,0,0);return 1e5<=f[1]&&(f[1]=0),1e5<=f[3]&&(f[3]=0),f[0]=(f[0]||s)+t,f[1]=Math.max(f[0],(f[1]||e)+t),f[2]=(f[2]||h)+i,f[3]=Math.max(f[2],(f[3]||n)+i),!this.Tl&&this.q.responsive&&(f[0]=0),f},$setSize:function(t,i){this.Il=[t,i],Ui.api.$setSize.call(this,t,i),this.ga(t,i)},Ll:function(t,i,s){var e=i=t[i];if(i!=(s=t[s])){var n=this.Ol*t[4]/this.Ul;if(n<i)e=i,this.Ul-=t[4],this.Ol-=e;else{if(!(s<n))return-1;e=s,this.Ul-=t[4],this.Ol-=e}}return e},Yl:function(t,i){var s=jt(i);"hide"!==s&&s?(s||(s=Vt({view:"popup",body:[{}]})),t.Wl=t.q.width,t.Gl=t.q.height,t.Xl=s.q.id,t.q.width=0,t.q.height||(t.q.autoheight=!0),Vt(t,s,this.Fl.length)):(t.hide(),t.Xl="hide"),this.Fl.push(t)},Jl:function(t){var i=t.Xl;if(t.Xl=0,"hide"!==i&&i){t.q.width=t.Wl,t.q.height=t.Gl,delete t.q.autoheight;for(var s=0;this.Ks[s]&&!1===this.Ks[s].q.responsiveCell;)s++;Vt(t,this,s)}else t.show();this.Fl.pop()},Kl:function(t){if(M.u=!0,t+2*this.ma+this.wa*(this.Ks.length-1)<this.El[0])for(var i=this.Ks.length-1,s=0;s<i;s++){var e=this.Ks[s];if(!e.Xl){if(!1!==e.q.responsiveCell){this.Yl(e,this.q.responsive),I("onResponsiveHide",[e.q.id]),M.o=!0;break}i=this.Ks.length}}else if(this.Fl.length){var n=this.Fl[this.Fl.length-1],h="hide"==n.Xl?0:n.Wl;n.$getSize(h,0)[0]+this.El[0]+this.wa+20<=t&&(this.Jl(n),I("onResponsiveShow",[
n.q.id]),M.o=!0)}M.u=!1},ga:function(t,i){M.h=(M.h||0)+1,!this.Tl&&this.q.responsive&&this.Kl(t,i),this.Ol=(this.Tl?i:t)-this.Nl[0],this.Ul=this.Nl[2];for(var s=t,e=i,n=[],h=0;h<this.Ks.length;h++)if(!this.Ks[h].q.hidden&&this.pa[h]){var r=this.pa[h];if(this.Tl){if((e=this.Ll(r,2,3))<0){n.push(h);continue}}else if((s=this.Ll(r,0,1))<0){n.push(h);continue}this.Ks[h].$setSize(s,e)}for(var o=0;o<n.length;o++){var a=n[o],u=this.pa[a],c=Math.round(this.Ol*u[4]/this.Ul);this.Ol-=c,this.Ul-=u[4],this.Tl?e=c:s=c,this.Ks[a].$setSize(s,e)}M.h-=1},ql:function(t,i){var s=this.index(t);return-1==s?null:this.Ks[s+i]},Zl:function(){return this.Ks[0]}},Cn={api:kn,view:H.protoUI(kn,g,Ui.view)},Dn={name:"layout",$init:function(){this.Bl=0},defaults:{type:"line"},Al:function(){this.Ql&&(t=this.Ql(t)),this.sd||(this.nt.className+=" webix_layout_"+(this.q.type||""),this.sd=1),this.q.margin!==undefined&&(this.wa=this.q.margin),this.q.padding!=undefined&&(this.ma=this.ba=this.q.padding),this.q.paddingX!==undefined&&(this.ma=this.q.paddingX),this.q.paddingY!==undefined&&(this.ba=this.q.paddingY),(this.ba||this.ma)&&(this.ed=!0),this.nd()&&!this.q.borderless&&(this.re.style.borderWidth="1px",this.hd=!0);var t=this.zl;this.q.borderless&&(this.q.Q={top:!0,left:!0,right:!0,bottom:!0}),this.va(t),Cn.api.Al.call(this,t),this._a(t)},$getSize:function(t,i){t=t||0,i=i||0;var s=this.wa*(this.Ks.length-this.Bl-1);if(this.hd||this.nd()){var e=this.q.Q;e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1))}return this.q.height||(i+=2*(this.ba||0)+(this.Tl?s:0)),this.q.width||(t+=2*(this.ma||0)+(this.Tl?0:s)),Cn.api.$getSize.call(this,t,i)},$setSize:function(t,i){this.Il=[t,i],this.nd()||this.hd?Gi.api.$setSize.call(this,t,i):Ui.api.$setSize.call(this,t,i),i=this.He,t=this.ze,this.q.scroll&&(i=Math.max(i,this.El[1]),t=Math.max(t,this.El[0])),this.ga(t,i)},ga:function(t,i){var s=this.wa*(this.Ks.length-this.Bl-1);return this.Tl?(i-=s+2*this.ba,t-=2*this.ma):(t-=s+2*this.ma,i-=2*this.ba),Cn.api.ga.call(this,t,i)},resizeChildren:function(t){if(t){this.Te=null;for(var i=[],s=0;s<this.Ks.length;s++){var e=this.Ks[s];i[s]=e.q;var n=e.Il&&!e.hd||e.q.borderless?"0px":"1px";e.nt.style.borderTopWidth=e.nt.style.borderBottomWidth=e.nt.style.borderLeftWidth=e.nt.style.borderRightWidth=n}this.va(i);for(var h=0;h<i.length;h++)i[h].borderless&&this.Ks[h].Ne&&this.Ks[h].Ne(i[h]);this._a(this.Ks)}M.u||Cn.api.resizeChildren.call(this)},nd:function(){return this.ed&&0<this.wa&&!this.rd},va:function(t){if(!this.nd()||this.q.borderless&&"space"!=this.q.type){for(var i=0;i<t.length;i++)t[i].Q=f(this.q.Q);var s=!1;this.rd&&(s=!0);var e=t.length;if(this.Tl){for(var n=1;n<e-1;n++)t[n].Q.top=t[n].Q.bottom=s;if(1<e){for("head"!=this.q.type&&(t[0].Q.bottom=s);t[e-1].hidden&&1<e;)e--;0<e&&(t[e-1].Q.top=s)}}else{for(var h=1;h<e-1;h++)t[h].Q.left=t[h].Q.right=s;if(1<e){for("head"!=this.q.type&&(t[0].Q.right=s),t[e-1].Q.left=s;1<e&&t[e-1].hidden;)e--;0<e&&(t[e-1].Q.left=s)}}}else for(var r=0;r<t.length;r++)t[r].Q&&t[r].borderless||(t[r].Q={top:!1,left:!1,right:!1,bottom:!1})},od:function(t,i){i.top&&(t.borderTopWidth="0px"),i.left&&(t.borderLeftWidth="0px"),i.right&&(t.borderRightWidth="0px"),i.bottom&&(t.borderBottomWidth="0px")},_a:function(t){for(var i=0,s=0;s<t.length;s++){var e=this.Ks[s],n=e.q.Q;if(e.q.hidden&&this.Ks[s+1]){var h=this.Ks[s+1].q.Q;n.top||(h.top=!1),n.left||(h.left=!1),s==i&&i++}this.od(e.nt.style,e.q.Q)}for(var r=this.Tl?"marginLeft":"marginTop",o=this.Tl?"marginTop":"marginLeft",a=this.Tl?this.ma:this.ba,u=this.Tl?this.ba:this.ma,c=0;c<t.length;c++)this.Ks[c].nt.style[r]=(a||0)+"px";this.Ks.length&&(this.Ks[i].nt.style[o]=(u||0)+"px");for(var f=i+1;f<t.length;f++)this.Ks[f].nt.style[o]=this.wa+"px"},type_setter:function(t){return this.wa="undefined"!=typeof this.ad[t]?this.ad[t]:this.ad.line,this.ma=this.ba="undefined"!=typeof this.ad[t]?this.ud[t]:this.ud.line,this.rd="material"==t||"clean"==t,"material"==t&&(this.q.borderless=!0),t},$skin:function(){this.ad=Qi.layoutMargin,this.ud=Qi.layoutPadding}},$n=H.protoUI(Dn,Cn.view),An={api:Dn,view:$n};$n.call(-1)
;var In={name:"daterange",defaults:{button:!1,icons:!1,calendarCount:2,borderless:!1},$init:function(t){t.calendar=t.calendar||{},t.value=this.cd(t.value),delete t.calendar.type,this.nt.className+=" webix_daterange",this.fd=this.ld[t.calendar.type]||0;for(var i=[],s=Qi.calendar,e=s&&s.height?s.height:250,n=s&&s.width?s.width:250,h=H.extend({view:"calendar",width:n,height:e},t.calendar||{},!0),r=t.calendarCount=0===this.fd&&t.calendarCount||this.defaults.calendarCount,o=(h.css?h.css+" ":"")+"webix_range_",a=t.value.start||new Date,u=0;u<r;u++){var c=en.add(a,this.dd[this.fd]*u,"month",!0);H.extend(h,{events:C(this.vd,this),css:o+(1===r?"":0===u?"0":u+1==r?"N":"1"),timepicker:0===this.fd&&t.timepicker,borderless:!0,date:c},!0),i.push(B(h))}t.rows=[{type:"clean",cols:i},this._d(t,n*r)],t.height=t.height||h.height+(t.icons||t.button?35:0),t.type="line",this.$ready.push(this.pd),Ot(this.$view,"keydown",C(function(t){this.je(t.which||t.keyCode,t)},this))},value_setter:function(t){return this.cd(t)},getValue:function(){return this.q.value},setValue:function(t,i){t=this.cd(t);var s=(this.q.value=t).start||t.end||new Date;if(!i){this.md[0].showCalendar(t.start);for(var e=1;e<this.md.length;e++)this.md[e].q.date=s,this.bd(this.md[e],1,e)}this.callEvent("onChange",[t]),this.refresh()},refresh:function(){for(var t=0;t<this.md.length;t++)if(this.md[t].fd===this.fd){et(this.md[t].$view,"webix_cal_timepicker"),et(this.md[t].$view,"webix_range_timepicker");var i=this.gd(this.md[t].getVisibleDate());if(i.start||i.end){if(this.md[t].q.date=i.start||i.end,this.q.timepicker){var s="webix_"+(i.start&&i.end?"range":"cal")+"_timepicker";st(this.md[t].$view,s)}}else en.datePart(this.md[t].q.date);this.md[t].refresh()}},addToRange:function(t){var i=this.wd(this.xd(t));this.setValue(i)},yd:[{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+ct.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date;this.q.timepicker||(t=en.datePart(t)),this.addToRange(t),this.callEvent("onTodaySet",[this.getValue()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+ct.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue(""),this.callEvent("onDateClear",[])}}}],Md:function(t){if(t){t="object"==k(t)?t:this.yd;for(var i={css:"webix_cal_footer ",borderless:!0,height:30,template:"<div class='webix_cal_icons'>",onClick:{}},s=0;s<t.length;s++){if(t[s].template){var e="function"==typeof t[s].template?t[s].template:Ft(t[s].template);i.template+=e.call(this)}if(t[s].on_click)for(var n in t[s].on_click)i.onClick[n]=C(t[s].on_click[n],this)}return i.template+="</div>",i.width=nt(i.template).width+30,i}return{width:0}},_d:function(t,i){var s={view:"button",value:ct.calendar.done,minWidth:100,maxWidth:230,align:"center",height:30,click:function(){this.getParentView().getParentView().hide()}},e=this.Md(t.icons),n={css:"webix_range_footer",cols:[{width:e.width}]};return(t.button||t.icons)&&2*e.width+s.minWidth>i&&(n.cols[0].width=0),n.cols.push(t.button?s:{}),n.cols.push(e),n},ld:{time:-1,month:1,year:2},dd:{0:1,1:12,2:120},cd:function(t){return t||(t={start:null,end:null}),t.start||t.end||(t={start:t}),t.end=this.xd(t.end)||null,t.start=this.xd(t.start)||null,(t.end&&t.end<t.start||!t.start)&&(t.end=[t.start,t.start=t.end][0]),t},xd:function(t){return"string"==typeof t&&(t=ct.parseFormatDate(t)),isNaN(1*t)?null:t},vd:function(t,i){if(!i){var s=this.q.value,e=s.start?en.datePart(en.copy(s.start)):null,n=s.end?en.datePart(en.copy(s.end)):null,h=en.datePart(t),r=en.add(h,1,"day",!0),o=en.add(h,-1,"day",!0),a="";return e<=h&&n&&h<=n&&(a="webix_cal_range",en.equal(o,e)&&(a+=" webix_cal_range_first"),en.equal(r,n)&&(a+=" webix_cal_range_last")),en.equal(h,e)&&(a="webix_cal_range_start"),en.equal(h,n)&&(a="webix_cal_range_end"),a+" "+(en.isHoliday(t)+" "||"")}},pd:function(){var t=this.md=this.getChildViews()[0].getChildViews(),s=this,i=this.config.id;this.Sd={};for(var e=0;e<t.length;e++)t[e].config.master=i,
t[this.Sd[t[e].config.id]=e].attachEvent("onBeforeDateSelect",function(t){return s.kd(this,t)}),t[e].attachEvent("onBeforeZoom",function(t){return s.Cd(this,t)}),0!==e&&e!==t.length-1||(t[e].attachEvent("onAfterMonthChange",C(this.Dd,this)),t[e].attachEvent("onAfterZoom",function(t,i){s.$d(this,t,i)}));this.q.timepicker&&this.refresh()},Cd:function(t,i){var s=this.Ad(t.config.id);if(0<=i&&0<s&&s!==this.md.length-1)return!1;if(-1===i){var e=this.gd(t.getVisibleDate());e.start&&e.end&&(t.q.date=e[this.Id])}return!0},Dd:function(t,i){var s=i<t?1:-1,e=i<t?this.md[this.md.length-1]:this.md[0],n=e.Td[e.fd].Fd;this.zd(s,n,e),this.refresh()},$d:function(t,i,s){var e=t.Td[t.fd].Fd,n=this.Ad(t.config.id),h=0===n?1:-1;if(this.md[n+h]){var r=this.md[n+h].q.date;if(i<s&&0<=i){var o=0;if(1===i){var a=r.getFullYear();(this.fd||-1===h&&11===r.getMonth()||1===h&&0===r.getMonth())&&(a-=h),o=t.q.date.getFullYear()-a}else if(0===i){var u=r.getMonth()-h;12!==u&&-1!=u||(u=-1===u?11:0),o=t.q.date.getMonth()-u}this.zd(o,e,t),this.refresh()}}},bd:function(t,i,s){t.blockEvent(),0<=t.fd&&t.Vd(i,s),t.unblockEvent()},Ad:function(t){return this.Sd[t]},zd:function(t,i,s){for(var e=0;e<this.md.length;e++){var n=this.md[e];s&&n.config.id===s.config.id||this.bd(n,t,i)}},gd:function(t){var i=this.q.value,s={};return i.start&&i.start.getYear()===t.getYear()&&i.start.getMonth()===t.getMonth()&&(s.start=i.start),i.end&&i.end.getYear()===t.getYear()&&i.end.getMonth()===t.getMonth()&&(s.end=i.end),s},Hd:function(t,i){t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds()),t.setMilliseconds(i.getMilliseconds())},wd:function(t,i){var s=B(this.q.value);0===this.fd||D(i)?s.start&&!s.end?s.end=t:(s.start=t,s.end=null):s[i?"end":"start"]=t;return s},kd:function(t,i){if(this.callEvent("onBeforeDateSelect",[i])){var s=this.q.value;if(t.fd<0){var e,n=B(this.gd(i));(e=n.start&&n.end?n[this.Id]:n.start||n.end)&&this.Hd(e,i),t.fd=0,s=H.extend(B(s),n,!0)}else{var h=t.getVisibleDate(),r=this.Ad(t.config.id);if(i.getMonth()!==h.getMonth()&&(0===r||r===this.md.length-1)){var o=h<i?1:-1;this.zd(o,1)}s=this.wd(i,r)}t.fd!==this.fd&&t.showCalendar(i),this.setValue(s,!0),this.callEvent("onAfterDateSelect",[this.getValue()])}return!1}},Fn={api:In,view:H.protoUI(In,An.view)};Sn.richSelectFilter={getInputNode:function(t){return jt(t.$webix)||null},getValue:function(t,i){var s=this.getInputNode(t);return i&&s.getText?s.getText():s?s.getValue():""},setValue:function(t,i){var s=this.getInputNode(t);return s?s.setValue(i):""},compare:function(t,i){return t==i},refresh:function(s,t,e){if(!s.$destructed){var i,n=jt(e.richselect);if(!n.$view.parentNode)Y("div",{"class":"webix_richfilter"}).appendChild(n.$view);t.$webix=e.richselect,t.style.marginLeft="-10px",e.compare=e.compare||this.compare,e.prepare=e.prepare||this.prepare,s.registerFilter(t,e,this);var h=e.options;h?"string"==typeof h?(i=e.options=[],xt(h).then(C(function(t){e.options=t.json();var i=document.body.contains(i)?i:document.body.querySelector('[active_id="'+e.contentId+'"]');this.refresh(s,i,e)},this))):i=h:i=s.collectValues(e.columnId,e.collect);var r=n.getPopup().getList(),o=jt(h);if(o&&o.data&&o.data.getRange&&(i=o.data.getRange()),t.firstChild.appendChild(n.$view.parentNode),r.parse&&(r.clearAll(),r.parse(i),!this.$noEmptyOption&&!1!==e.emptyOption||e.emptyOption)){var a={id:"",value:e.emptyOption||"",$empty:!0};r.add(a,0)}e.value&&this.setValue(t,e.value),n.render(),$(n.resize,n)}},render:function(t,i){if(!i.richselect){var s={container:Y("div",{"class":"webix_richfilter"}),view:this.inputtype,options:[]},e=H.extend(this.inputConfig||{},i.inputConfig||{},!0);H.extend(s,e),i.separator&&(s.separator=i.separator),i.suggest&&(s.suggest=i.suggest);var n=Vt(s);n.attachEvent("onChange",function(){t.filterByAll()}),i.richselect=n.q.id,t.rt.push(n)}return i.css="webix_div_filter"," "},inputtype:"richselect"},Sn.serverRichSelectFilter=H.extend({$server:!0},Sn.richSelectFilter),Sn.multiSelectFilter=H.extend({$noEmptyOption:!0,inputtype:"multiselect",prepare:function(t,i){if(!t)return t;for(var s={},
e=t.toString().split(i.separator||","),n=0;n<e.length;n++)s[e[n]]=1;return s},compare:function(t,i){return!i||i[t]}},Sn.richSelectFilter),Sn.serverMultiSelectFilter=H.extend({$server:!0,Sl:function(){jt(this.xl).filterByAll()}},Sn.multiSelectFilter),Sn.multiComboFilter=H.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},Sn.multiSelectFilter),Sn.serverMultiComboFilter=H.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},Sn.serverMultiSelectFilter),Sn.datepickerFilter=H.extend({prepare:function(t){return t||""},compare:function(t,i){return 1*t==1*i},inputtype:"datepicker"},Sn.richSelectFilter),Sn.columnGroup={getValue:function(t){return t.innerHTML},setValue:function(){},getHelper:function(t,i){return{open:function(){i.closed=!0,t.onclick()},close:function(){i.closed=!1,t.onclick()},isOpened:function(){return i.closed}}},refresh:function(s,t,e){t.onclick=function(t){tt(t);var i=this.firstChild.firstChild;e.closed?(e.closed=!1,i.className="webix_tree_open"):(e.closed=!0,i.className="webix_tree_close"),$(function(){s.callEvent("onColumnGroupCollapse",[e.columnId,e.batch,!e.closed]),s.showColumnBatch(e.batch,!e.closed)})},e.firstRun||(e.firstRun=1,e.closed&&s.showColumnBatch(e.batch,!1))},render:function(t,i){return"<div role='button' tabindex='0' aria-label='"+ct.aria[i.closed?"openGroup":"closeGroup"]+"' class='"+(i.closed?"webix_tree_close":"webix_tree_open")+"'></div>"+(i.groupText||"")}},Sn.dateRangeFilter=H.extend({prepare:function(t){return t.start||t.end?Fn.api.cd(t):""},compare:function(t,i){return(!i.start||t>=i.start)&&(!i.end||t<=i.end)},inputtype:"daterangepicker"},Sn.richSelectFilter),Sn.serverDateRangeFilter=H.extend({$server:!0},Sn.dateRangeFilter),S.scrollSize=S.touch||S.$customScroll?0:17,mi(function(){var t=function e(){var t=Y("div");t.className="webix_skin_mark",t.style.cssText="position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;min-height:100px;overflow-y:scroll;",document.body.appendChild(t);var i=t.offsetWidth-t.clientWidth,s={200:"flat",210:"compact",230:"contrast",240:"material",250:"mini"}[10*Math.floor(t.offsetHeight/10)];document.body.removeChild(t),s&&os(s);return S.$customScroll?0:i}();S.scrollSize=S.touch?0:t});var Tn=!1;u("_fixHeight",function Po(){Tn||(O("html, body{ height:100%; }"),document.body.className+=" webix_full_screen",Mi.limit(!1),Tn=!0)}),Vt.animate=function jo(t,i,s){var e=jt(i);if(e){var n=s||{type:"slide",direction:"left"},h=e.nt.cloneNode(!0),r=Vt(t,i);r.nt.parentNode.appendChild(h);var o=Zi.formLine(r.nt,h,n);return n.callback=function(){Zi.breakLine(o)},Zi(o,n),r}},Vt.animateView=function No(i,t,s){if(i=jt(i)){s=s||{type:"slide",direction:"left"};for(var e=function(t){var i=t.nt,s=i.className,e=i.innerHTML;return"<div class='"+s+"' style='width:"+i.offsetWidth+"px;height:"+i.offsetHeight+"px;'>"+e+"</div>"},n=[],h=0;h<i.nt.childNodes.length;h++){var r=i.nt.childNodes[h],o=r.currentStyle?r.currentStyle.display:getComputedStyle(r,null).display;n.push(o||"")}var a=e(i);"function"==typeof t&&t.call(this);for(var u=e(i),c=i.nt.insertBefore(Y("DIV",{"class":"webix_view_animate",style:"width:"+i.nt.offsetWidth+"px;height:"+i.nt.offsetHeight+"px;"},u+a),i.nt.firstChild),f=1;f<i.nt.childNodes.length;f++)i.nt.childNodes[f].style.display="none";var l=Zi.formLine(c.childNodes[0],c.childNodes[1],s);return s.callback=function(){if(c){i.nt.removeChild(c),c=null;for(var t=0;t<i.nt.childNodes.length;t++)i.nt.childNodes[t].style.display=n[t]}},Zi(l,s),i}},Vt.freeze=Ai,Vt.resize=Ii,Vt.each=Fi,Vt.hasMethod=Rt,Vt.datafilter=Sn,Vt.fullScreen=function Eo(){if(S.touch){ut("apple-mobile-web-app-capable","yes"),ut("viewport","initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no");var t=function(){var t=window.innerWidth,i=window.innerHeight;i&&(document.body.style.height=i+"px",document.body.style.width=t+"px"),M.l=!1,Ii()},i=function(){M.l=!0,$(t,null,[],500)};F("onRotate",i),Mn(),$(i)}};ct.locales["de-DE"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%n.%Y",timeFormat:"%H:%i",longDateFormat:"%j. %F %Y",
fullDateFormat:"%j. %F %Y %H:%i",am:null,pm:null,price:"{obj} €",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthShort:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayFull:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayShort:["So","Mo","Di","Mi","Do","Fr","Sa"],hours:"Stunden",minutes:"Minuten",done:"Fertig",clear:"Entfernen",today:"Heute"},dataExport:{page:"Seite",of:"aus"},PDFviewer:{of:"aus",automaticZoom:"Automatisch Zoom",actualSize:"Aktuelles Ausmaß",pageFit:"Seite Ausmaß",pageWidth:"Seite Breite",pageHeight:"Seite Höhe"},aria:{calendar:"Kalender",increaseValue:"Wert erhöhen",decreaseValue:"Wert verringern",navMonth:["Vorheriger Monat","Nächsten Monat"],navYear:["Vorheriges Jahr","Nächstes Jahr"],navDecade:["Zurück Jahrzehnt","Als nächstes Jahrzehnt"],dateFormat:"%j. %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Stunden: %H",minuteFormat:"Minuten: %i",removeItem:"Element entfernen",pages:["Erste Seite","Vorherige Seite","Folgeseite","Letzte Seite"],page:"Seite",headermenu:"Titelmenü",openGroup:"Öffnen Spaltengruppe ",closeGroup:"Schließen Spaltengruppe ",closeTab:"Tab schließen",showTabs:"Weitere Tabs",resetTreeMap:"Zurück zur ursprünglichen Ansicht",navTreeMap:"Aufleveln",nextTab:"Weiter tab",prevTab:"Zurück tab",multitextSection:"Element hinzufügen",multitextextraSection:"Element entfernen",showChart:"Chart anzeigen",hideChart:"Chart verstecken",resizeChart:"Chart Größe ändern"},richtext:{underline:"Unterstreichen",bold:"Fettgedruckt",italic:"Kursiv"},combo:{select:"Auswählen",selectAll:"Alles auswählen",unselectAll:"Alles widerrufen"},message:{ok:"OK",cancel:"Abbrechen"},comments:{send:"Absenden",confirmMessage:"Der Kommentar wird entfernt. Sind Sie sicher?",edit:"Redigieren",remove:"Löschen",placeholder:"Geben Sie hier ein..",moreComments:"Mehr Kommentare"}},ct.locales["es-ES"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%n/%Y",timeFormat:"%G:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d %F %Y %G:%i",am:null,pm:null,price:"{obj} €",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayFull:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayShort:["dom","lun","mar","mié","jue","vie","sáb"],hours:"Horas",minutes:"Minutos",done:"Listo",clear:"Reinicio",today:"Hoy"},dataExport:{page:"Página",of:"de"},PDFviewer:{of:"de",automaticZoom:"Zoom automático",actualSize:"Tamaño real",pageFit:"Tamaño de página",pageWidth:"Ancho de página",pageHeight:"Altura de la página"},aria:{calendar:"Сalendario",increaseValue:"Aumentar el valor",decreaseValue:"Disminuye el valor",navMonth:["Mes anterior","Próximo mes"],navYear:["Año anterior","Próximo año"],navDecade:["Década anterior","Próxima década"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Horas: %G",minuteFormat:"Minutos: %i",removeItem:"Retire el elemento",pages:["Primera página","Pagina anterior","Siguiente página","Última página"],page:"Página",headermenu:"Menú de títulos",openGroup:"Grupo de columnas abiertas",closeGroup:"Primer grupo de columnas",closeTab:"Cerrar tab",showTabs:"Mostrar más tabs",resetTreeMap:"Volver a la vista original",navTreeMap:"Elevar a mismo nivel",nextTab:"Siguiente tab",prevTab:"Tab anterior",multitextSection:"Añadir elemento",multitextextraSection:"Retire el elemento",showChart:"Espectáculo chart",hideChart:"Esconder chart",resizeChart:"Cambiar el tamaño el chart"},richtext:{underline:"Subrayar",bold:"Negrita",italic:"Itálico"},combo:{select:"Seleccionar",selectAll:"Seleccionar todo",unselectAll:"Deselecciona todo"},message:{ok:"OK",cancel:"Cancelar"},comments:{send:"Enviar",
confirmMessage:"El comentario será eliminado. Estás seguro?",edit:"Corregir",remove:"Suprimir",placeholder:"Escriba aquí..",moreComments:"Más comentarios"}},ct.locales["fr-FR"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} €",priceSettings:null,calendar:{monthFull:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aôu","Sep","Oct","Nov","Déc"],dayFull:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],hours:"Heures",minutes:"Minutes",done:"Fini",clear:"Effacer",today:"Aujourd'hui"},dataExport:{page:"Page",of:"sur"},PDFviewer:{of:"sur",automaticZoom:"Zoom automatique",actualSize:"Taille actuelle",pageFit:"Taille de la page",pageWidth:"Largeur de la page",pageHeight:"Hauteur de page"},aria:{calendar:"Сalendrier",increaseValue:"Augmenter la valeur",decreaseValue:"Diminution de la valeur",navMonth:["Le mois précédent","Le mois prochain"],navYear:["Année précédente","L'année prochaine"],navDecade:["Décennie précédente","Suivant décennie"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Heures: %H",minuteFormat:"Minutes: %i",removeItem:"Retirer l'élément",pages:["Première page","Page précédente","Page suivante","Dernière page"],page:"Page",headermenu:"Menu de titre",openGroup:"Ouvrir groupe de colonnes ",closeGroup:"Fermer groupe de colonnes",closeTab:"Fermer tab",showTabs:"Montrer plus tabs",resetTreeMap:"Revenir à la vue originale",navTreeMap:"Niveau supérieur",nextTab:"Prochain tab",prevTab:"Précédent tab",multitextSection:"Ajouter l'élément",multitextextraSection:"Retirer l'élément",showChart:"Montrer chart",hideChart:"Cacher chart",resizeChart:"Redimensionner chart"},richtext:{underline:"Souligner",bold:"Gras",italic:"Italique"},combo:{select:"Sélectionner",selectAll:"Tout sélectionner",unselectAll:"Tout déselectionner"},message:{ok:"OK",cancel:"Annuler"},comments:{send:"Envoyer",confirmMessage:"Le commentaire sera supprimé. Êtes-vous sûr?",edit:"Modifier",remove:"Effacer",placeholder:"Écrivez ici..",moreComments:"Plus de commentaires"}},ct.locales["it-IT"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%H:%i",longDateFormat:"%j %F %Y",fullDateFormat:"%j %F %Y %H:%i",am:null,pm:null,price:"€ {obj}",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dayFull:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],dayShort:["dom","lun","mar","mer","gio","ven","sab"],hours:"Orario",minutes:"Minuti",done:"Pronto",clear:"Pulisci",today:"Oggi"},dataExport:{page:"Pagina",of:"di"},PDFviewer:{of:"di",automaticZoom:"Zoom automatico",actualSize:"Dimensione reale",pageFit:"Dimensioni della pagina",pageWidth:"Larghezza della pagina",pageHeight:"Altezza della pagina"},aria:{calendar:"Calendario",increaseValue:"Aumenta il valore",decreaseValue:"Riduci il valore",navMonth:["Il mese scorso","Il prossimo mese"],navYear:["L'anno scorso","L'anno prossimo"],navDecade:["Decennio precedente","Prossimo decennio"],dateFormat:"%j %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Orario: %H",minuteFormat:"Minuti: %i",removeItem:"Rimuovere l'elemento",pages:["Prima pagina","Pagina precedente","Pagina successiva","Ultima pagina"],page:"Pagina",headermenu:"Menu del titolo",openGroup:"Aperto gruppo di colonne",closeGroup:"Chiudi gruppo di colonne",closeTab:"Chiudi tab",showTabs:"Mostra più tabs",resetTreeMap:"Tornare alla vista originale",navTreeMap:"Livello superiore",nextTab:"Tab successivo",prevTab:"Tab precedente",multitextSection:"Aggiungi elemento",
multitextextraSection:"Rimuovere l'elemento",showChart:"Mostrare grafico",hideChart:"Nascondere grafico",resizeChart:"Ridimensionare grafico"},richtext:{underline:"Sottolineare",bold:"Grassetto",italic:"Corsivo"},combo:{select:"Selezionare",selectAll:"Seleziona tutto",unselectAll:"Deseleziona tutto"},message:{ok:"OK",cancel:"Annullare"},comments:{send:"Inviare",confirmMessage:"Il commento verrà rimosso. Sei sicuro?",edit:"Correggere",remove:"Elimina",placeholder:"Digitare qui..",moreComments:"Altri commenti"}},ct.locales["ja-JP"]={groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%Y.%m.%d",timeFormat:"%H:%i",longDateFormat:"%Y年%m月%d日",fullDateFormat:"%Y.%m.%d %H:%i",price:"¥{obj}",priceSettings:{groupSize:3,groupDelimiter:",",decimalDelimiter:"",decimalSize:0},calendar:{monthFull:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayFull:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayShort:["日","月","火","水","木","金","土"],hours:"営業時間",minutes:"分",done:"レディー",clear:"削除する",today:"今日"},dataExport:{page:"ページ",of:"から"},PDFviewer:{of:"から",automaticZoom:"自動ズーム",actualSize:"実サイズ",pageFit:"ページサイズ",pageWidth:"ページ幅",pageHeight:"ページの高さ"},aria:{calendar:"カレンダー",increaseValue:"増加値",decreaseValue:"数字を小さく",navMonth:["前の月","来月"],navYear:["前年","来年"],navDecade:["前の十年","次の10年"],dateFormat:"%Y年%m月%d日",monthFormat:"%Y年%m月",yearFormat:"%Y年",hourFormat:"営業時間: %H",minuteFormat:"分: %i",removeItem:"要素を削除します",pages:["一ページ目","前のページ","次のページ","最後のページ"],page:"ページ",headermenu:"ヘッダメニュー",openGroup:"オープン列グループ",closeGroup:"閉じる列グループ",closeTab:"タブを閉じます",showTabs:"複数のタブを表示します",resetTreeMap:"元の表示に戻ります",navTreeMap:"レベルパック",nextTab:"次のタブ",prevTab:"前のタブ",multitextSection:"要素を追加します。",multitextextraSection:"要素を削除します",showChart:"靴チャート",hideChart:"隠すチャート",resizeChart:"グラフのサイズを変更"},richtext:{underline:"アンダーライン",bold:"大胆な",italic:"イタリック"},combo:{select:"選択する",selectAll:"すべて選択",unselectAll:"すべての選択を解除する"},message:{ok:"OK",cancel:"取り消す"},comments:{send:"送信",confirmMessage:"コメントは削除されます. 本気ですか？",edit:"編集",remove:"削除",placeholder:"ここに入力..",moreComments:"その他のコメント"}},ct.locales["pt-BR"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%G:%i",longDateFormat:"%d de %F de %Y",fullDateFormat:"%d de %F de %Y %G:%i",am:null,pm:null,price:"R$ {obj}",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},fileSize:["b","Kb","Mb","Gb","Tb","Pb","Eb"],calendar:{monthFull:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayFull:["Domingo","Segunda-Feira","Terça-Feira","Quarta-Feira","Quinta-Feira","Sexta-Feira","Sábado"],dayShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],hours:"Horas",minutes:"Minutos",done:"Feito",clear:"Limpar",today:"Hoje"},dataExport:{page:"Página",of:"de"},PDFviewer:{of:"de",automaticZoom:"Zoom automático",actualSize:"Tamanho atual",pageFit:"Tamanho da página",pageWidth:"Largura da página",pageHeight:"Altura da página"},aria:{calendar:"Calendário",increaseValue:"Aumentar o valor",decreaseValue:"Diminuir o valor",navMonth:["Mês anterior","Próximo mês"],navYear:["Ano anterior","Próximo ano"],navDecade:["Década anterior","Próxima década"],dateFormat:"%d de %F de %Y",monthFormat:"%F de %Y",yearFormat:"%Y",hourFormat:"Horas: %G",minuteFormat:"Minutos: %i",removeItem:"Remover elemento",pages:["Primeira página","Página anterior","Próxima página","Última página"],page:"Página",headermenu:"Menu de títulos",openGroup:"Grupo coluna aberta",closeGroup:"Fechar grupo de colunas",closeTab:"Fechar tab",showTabs:"Mostre mais tabs",resetTreeMap:"Мoltar à vista original",navTreeMap:"Upar",nextTab:"Próximo tab",prevTab:"Anterior tab",multitextSection:"Adicionar elemento",multitextextraSection:"Remover elemento",showChart:"Exposição chart",hideChart:"Esconder chart",resizeChart:"Redimensionar chart"},richtext:{underline:"Sublinhado",bold:"Negrito",
italic:"itálico"},combo:{select:"Selecionar",selectAll:"Selecionar tudo",unselectAll:"Desmarque todos"},message:{ok:"OK",cancel:"Cancelar"},comments:{send:"Enviar",confirmMessage:"Comentário será removido. Você tem certeza?",edit:"Editar",remove:"Excluir",placeholder:"Digite aqui..",moreComments:"Mais comentários"}},ct.locales["zh-CN"]={groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%Y/%m/%j",timeFormat:"%G:%i",longDateFormat:"%Y'年'%m'月'%j'日'",fullDateFormat:"%Y'年'%m'月'%j'日' %G:%i",am:["上午","上午"],pm:["下午","下午"],price:"¥{obj}",priceSettings:{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2},calendar:{monthFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayShort:["周日","周一","周二","周三","周四","周五","周六"],hours:"小时",minutes:"分钟",done:"完成",clear:"清除",today:"今天"},dataExport:{page:"页",of:"从"},PDFviewer:{of:"从",automaticZoom:"自动设置页面大小",actualSize:"实际尺寸",pageFit:"页面大小",pageWidth:"页面宽度",pageHeight:"页面高度"},aria:{calendar:"日历",increaseValue:"增加值",decreaseValue:"减少值",navMonth:["上个月","下个月"],navYear:["上年","明年"],navDecade:["过去十年","下个十年"],dateFormat:"%Y'年'%m'月'%j'日'",monthFormat:"%Y'年'%m'月",yearFormat:"%Y'年",hourFormat:"小时: %G",minuteFormat:"分钟: %i",removeItem:"删除元素",pages:["第一页","上一页","下一页","最后一页"],page:"页",headermenu:"标题菜单",openGroup:"打开栏目组",closeGroup:"关闭栏目组",closeTab:"关闭标签",showTabs:"显示更多选项卡",resetTreeMap:"回到原来的视图",navTreeMap:"升级",nextTab:"下一个标签",prevTab:"前一个标签",multitextSection:"加元",multitextextraSection:"删除元素",showChart:"显示图表",hideChart:"隐藏图表",resizeChart:"调整图"},richtext:{underline:"强调",bold:"粗體",italic:"斜体"},combo:{select:"选择",selectAll:"全选",unselectAll:"全部取消选择"},message:{ok:"好",cancel:"取消"},comments:{send:"发送",confirmMessage:"评论将被删除. 你确定吗?",edit:"编辑",remove:"去掉",placeholder:"在此输入..",moreComments:"更多评论"}},ct.locales["ru-RU"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} руб.",priceSettings:null,calendar:{monthFull:["Январь","Февраль","Март","Апрель","Maй","Июнь","Июль","Август","Сентябрь","Oктябрь","Ноябрь","Декабрь"],monthShort:["Янв","Фев","Maр","Aпр","Maй","Июн","Июл","Aвг","Сен","Окт","Ноя","Дек"],dayFull:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],dayShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],hours:"Часы",minutes:"Минуты",done:"Гoтовo",clear:"Очистить",today:"Сегодня"},dataExport:{page:"Страница",of:"из"},PDFviewer:{of:"из",automaticZoom:"Автоматический зум",actualSize:"Настоящий размер",pageFit:"Размер страницы",pageWidth:"Ширина страницы",pageHeight:"Высота страницы"},aria:{calendar:"Календарь",increaseValue:"Увеличить значение",decreaseValue:"Уменьшить значение",navMonth:["Предыдущий месяц","Следующий месяц"],navYear:["Предыдущий год","Следующий год"],navDecade:["Предыдущие десять лет","Следующие десять лет"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Часы: %H",minuteFormat:"Минуты: %i",removeItem:"Удалить элемент",pages:["Первая страница","Предыдущая страница","Следующая страница","Последняя страница"],page:"Страница",headermenu:"Меню шапки таблицы",openGroup:"Развернуть группу столбцов",closeGroup:"Свернуть группу столбцов",closeTab:"Закрыть вкладку",showTabs:"Показать больше вкладок",resetTreeMap:"Вернуться к первоначальному представлению",navTreeMap:"Перейти на уровень выше",nextTab:"Следующая вкладка",prevTab:"Предыдущая вкладка",multitextSection:"Добавить элемент",multitextextraSection:"Удалить элемент",showChart:"Показать чарт",hideChart:"Спрятать чарт",resizeChart:"Изменить размер чарта"},richtext:{underline:"Подчеркивание",bold:"Жирный",italic:"Курсив"},combo:{select:"Выбрать",selectAll:"Выбрать все",unselectAll:"Сброс выбора"},message:{ok:"OK",cancel:"Отмена"},comments:{send:"Отправить",confirmMessage:"Комментарий будет удален. Вы уверены?",edit:"Редактировать",remove:"Удалить",placeholder:"Введите текст..",
moreComments:"Больше комментариев"}},ct.locales["be-BY"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} руб.",priceSettings:{groupSize:3,groupDelimiter:" ",decimalDelimiter:"",decimalSize:0},calendar:{monthFull:["Студзень","Люты","Сакавік","Красавік","Травень","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"],monthShort:["Студз","Лют","Сак","Крас","Трав","Чэр","Ліп","Жнів","Вер","Каст","Ліст","Снеж"],dayFull:["Нядзеля","Панядзелак","Аўторак","Серада","Чацвер","Пятніца","Субота"],dayShort:["Нд","Пн","Аўт","Ср","Чцв","Пт","Сб"],hours:"Гадзіны",minutes:"Хвіліны",done:"Гатова",today:"Cёння",clear:"Ачысціць"},dataExport:{page:"Старонка",of:"з"},PDFviewer:{of:"з",automaticZoom:"Аўтаматычны зум",actualSize:"Сапраўдны памер",pageFit:"Памер старонкі",pageWidth:"Шырыня старонкі",pageHeight:"Вышыня старонкі"},aria:{calendar:"Каляндар",increaseValue:"Павялічыць значэнне",decreaseValue:"Паменшыць значэнне",navMonth:["Папярэдні месяц","Наступны месяц"],navYear:["Папярэдні год","Наступны год"],navDecade:["Папярэднія дзесяць год","Наступныя дзесяць год"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Hours: %h",minuteFormat:"Гадзіны: %i",removeItem:"Прыбраць элемент",pages:["Першая старонка","Папярэдняя старонка","Наступная старонка","Апошняя старонка"],page:"Старонка",headermenu:"Меню загалоўка",openGroup:"Адкрыць групу слупкоў",closeGroup:"Закрыць групу слупкоў",closeTab:"Закрыць укладку",showTabs:"Паказаць больш укладак",resetTreeMap:"Вярнуцца да першапачатковага выгляду",navTreeMap:"Падняцца на ўзровень вышэй",nextTab:"Наступная ўкладка",prevTab:"Папярэдняя ўкладка",multitextSection:"Дадаць элемент",multitextextraSection:"Прыбраць элемент",showChart:"Паказаць графік",hideChart:"Схаваць графік",resizeChart:"Змяніць памер графіка"},richtext:{underline:"Падкрэсліванне",bold:"Паўтлусты",italic:"Курсіў"},combo:{select:"Абраць",selectAll:"Абраць усё",unselectAll:"Ачысціць ўсе"},message:{ok:"ОК",cancel:"Адмена"},comments:{send:"Даслаць",confirmMessage:"Каментарый будзе выдалены. Вы ўпэўнены?",edit:"Рэдагаваць",remove:"Выдаліць",placeholder:"Пішыце тут..",moreComments:"Больш каментарыяў"}};H.protoUI({name:"spacer",defaults:{borderless:!0},$init:function(){this.nt.className+=" webix_spacer"}},Gi.view);var zn={name:"template",$init:function(t){var i=this.Bd[t.type];i&&(H.extend(t,i),t.borderless&&(delete t.Q,this.Ne(t))),this.bt==this.nt?(this.bt=Y("DIV"),this.bt.className=" webix_template",this.nt.appendChild(this.bt)):this.bt.className+=" webix_template",this.attachEvent("onAfterRender",this.Rd)},setValues:function(t,i){this.data=i?H.extend(this.data,t,!0):t,this.render()},getValues:function(){return this.data},$skin:function(){this.Bd.header.height=this.Bd.section.height=Qi.barHeight},Bd:{header:{css:"webix_header"},section:{css:"webix_section",borderless:!0},clean:{css:"webix_clean",borderless:!0}},onClick_setter:function(t){return this.on_click=H.extend(this.on_click||{},t,!0),this.au||H.extend(this,Us),t},defaults:{template:Ft.empty},Pd:function(){this.jd=!1,this.Nd(),this.resize()},Nd:function(){this.jd||(this.jd=!0,this.render())},src_setter:function(t){return this.jd=!0,this.callEvent("onBeforeLoad",[])?(xt(t,C(function(t){this.q.template=Ft(t),this.Pd(),this.callEvent("onAfterLoad",[])},this)),t):""},Rd:function(){this.q.autoheight&&(this.Te=null,this.resize()),this.q.scroll&&-1!=this.q.scroll.indexOf("x")&&(this.bt.style.width=this.bt.scrollWidth+"px")},content_setter:function(t){t&&(this.jd=!0,this.render=function(){},this.bt.appendChild(A(t)),$(this.Rd,this))},refresh:function(){this.render()},setHTML:function(t){this.q.template=function(){return t},this.refresh()},setContent:function(t){this.bt.innerHTML="",this.content_setter(t)},$setSize:function(t,i){if(Gi.api.$setSize.call(this,t,i)){if(this.Nd(),this.q.autoheight){var s=this.getTopParentView();clearTimeout(s.Ed),s.Ed=$(this.resize,this)}return!0}},$getSize:function(t,i){
return!this.q.autoheight||this.q.type&&"clean"!=this.q.type||(this.q.height=this.Ld()),Gi.api.$getSize.call(this,t,i)},Ld:function(){var t,i=Qi.layoutPadding.space;return this.Nd(),this.isVisible()?(this.bt.style.height="auto",t=this.bt.scrollHeight,this.bt.style.height=""):t=nt(this.Lt(this.data)||this.bt.innerHTML,"webix_template",(this.$width||(this.getParentView()?this.getParentView().$width:0))-i).height,t},Eu:!0},Vn={api:zn,view:H.protoUI(zn,Ks,vi,_i,g,Gi.view)},Hn={name:"scrollview",defaults:{scroll:"y",scrollSpeed:"0ms"},$init:function(){this.nt.className+=" webix_scrollview"},body_setter:function(t){t.borderless=!0,(M._=this).Z=Vt.ot(t),this.bt.appendChild(this.Z.nt)},getChildViews:function(){return[this.Z]},getBody:function(){return this.Z},resizeChildren:function(){this.Z&&(this.El=this.Z.$getSize(0,0),this.Od(),I("onResize",[]))},Od:function(){var t=Math.max(this.ze,this.El[0]),i=Math.max(this.He,this.El[2]);if(this.Z.$setSize(t,i),this.bt.style.width=this.Z.ze+"px",this.bt.style.height=this.Z.He+"px",S.touch){var s=this.getScrollState(),e=this.Z.He-this.He;e<s.y&&this.scrollTo(null,e)}M.o&&(M.o=!1,this.El=this.Z.$getSize(0,0),this.Od())},$getSize:function(t,i){var s=this.El=this.Z.$getSize(0,0),e=Gi.api.$getSize.call(this,t,i),n=this.Ud||S.scrollSize;return"x"==this.q.scroll?(e[2]=Math.max(e[2],s[2])+n,e[3]=Math.min(e[3],s[3])+n):"y"==this.q.scroll&&(e[0]=Math.max(e[0],s[0])+n,e[1]=Math.min(e[1],s[1])+n),e},$setSize:function(t,i){var s=S.scrollSize;S.scrollSize=this.Ud||s,(Gi.api.$setSize.call(this,t,i)||M.Ki)&&this.Od(),S.scrollSize=s},scroll_setter:function(t){var i=S.$customScroll;return"string"==typeof t&&0===t.indexOf("native-")&&(this.Ud=17,t=t.replace("native-"),S.$customScroll=!1),t=Ks.scroll_setter.call(this,t),S.$customScroll=i,t},st:function(t){this.Z.destructor(),this.Z=t,this.yn.appendChild(this.Z.nt),this.resize()},showView:function(t){var i=jt(t).$view.offsetTop-jt(t).$view.parentNode.offsetTop;this.scrollTo(0,i)}},Bn=(H.protoUI(Hn,Ks,g,Gi.view),H.protoUI({name:"iframe",$init:function(){this.bt=this.re,this.re.innerHTML="<iframe style='width:100%; height:100%' frameborder='0' onload='var t = $$(this.parentNode.getAttribute(\"view_id\")); if (t) t.callEvent(\"onAfterLoad\",[]);' src='about:blank'></iframe>"},load:function(t){this.src_setter(t)},src_setter:function(t){return this.callEvent("onBeforeLoad",[])?this.getIframe().src=t:""},getIframe:function(){return this.re.getElementsByTagName("iframe")[0]},getWindow:function(){return this.getIframe().contentWindow}},Gi.view,g),{name:"accordion",defaults:{panelClass:"accordionitem",multi:!1,collapsed:!1},$init:function(){this.nt.setAttribute("role","tablist"),this.nt.setAttribute("aria-multiselectable","true")},st:function(t){An.api.st.apply(this,arguments),t.collapsed_setter&&t.refresh&&t.refresh()},Al:function(){for(var t=this.q.panelClass,i=this.zl,s=0;s<i.length;s++)!i[s].body&&!i[s].header||i[s].view||i[s].align||(i[s].view=t),D(i[s].collapsed)&&(i[s].collapsed=this.q.collapsed);this.Yd=!0,An.api.Al.call(this),this.Yd=!1;for(var e=0;e<this.Ks.length;e++)this.Ks[e].name==t&&this.Ks[e].refresh(),this.Ks[e].Wd=!1;for(var n=!1,h=this.Ks.length-1;0<=h&&!n;h--)this.Ks[h].q.hidden||(n=this.Ks[h].Wd=!0)},Gd:function(t){if(!1===this.q.multi&&!0!==this.Yd)for(var i=0;i<this.Ks.length;i++)t!=this.Ks[i]&&!this.Ks[i].q.collapsed&&this.Ks[i].collapse&&this.Ks[i].collapse();t.callEvent&&(t.callEvent("onViewShow",[]),Fi(t,this.Rl))},Xd:function(t){if(!0===this.q.multi||this.Yd)return!0;for(var i=0;i<this.Ks.length;i++)if(t!=this.Ks[i]&&!this.Ks[i].q.collapsed&&this.Ks[i].isVisible()&&!this.Ks[i].$nospace)return!0;return!1},$skin:function(){var t=this.defaults;Qi.accordionType&&(t.type=Qi.accordionType)}}),Rn={api:Bn,view:H.protoUI(Bn,An.view)},Pn=(H.protoUI({name:"headerlayout",defaults:{type:"accordion",multi:"mixed",collapsed:!1}},Rn.view),{name:"accordionitem",$init:function(t){
this.nt.innerHTML="<div tabindex='0' webix_ai_id='"+t.id+"'  class='webix_accordionitem_header'><div class='webix_accordionitem_button' ></div><div class='webix_accordionitem_label' ></div></div><div class='webix_accordionitem_body'></div>",this.re=this.nt,this.en=this.re.childNodes[0],t.header||(this.en.style.display="none"),this.Jd=this.re.childNodes[0].childNodes[1],this.Kd=this.re.childNodes[0].childNodes[0],this.yn=this.re.childNodes[1],this.nt.className+=" webix_accordionitem",this.Mn=this.Z=null,this.Ks=!0,this.yn.setAttribute("role","tabpanel"),this.en.setAttribute("role","tab"),this.attachEvent("onKeyPress",this.je)},et:function(){this.Z={destructor:function(){}}},st:function(t){this.Z.destructor(),this.Z=t,this.yn.appendChild(this.Z.nt),this.resize()},za:"webix_ai_id",getChildViews:function(){return[this.Z]},body_setter:function(t){return"object"!=k(t)&&(t={template:t}),t.Q={top:!0,left:!0,right:!0,bottom:!0},(M._=this).Z=Vt.ot(t),this.yn.appendChild(this.Z.nt),t},header_setter:function(t){return t&&(t=Ft(t)),t},headerAlt_setter:function(t){return t&&(t=Ft(t)),t},$getSize:function(t,i){var s=this.Z.$getSize(0,0),e=this.q.Q;e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1));var n=0,h=Ui.api.$getSize.call(this,0,0);h[0]=(h[0]||s[0])+t,1e5<=h[1]&&(h[1]=s[1]),h[1]+=t,h[2]=(h[2]||s[2])+i;var r=h[3]<1e5;return r||(h[3]=s[3]),h[3]+=i,this.getParentView().Tl?this.q.collapsed?h[2]=h[3]=this.qd():this.q.header&&(n=this.q.headerHeight):(this.q.collapsed&&(h[0]=h[1]=this.qd()),this.q.header&&(n=this.q.headerHeight)),r||(h[2]+=n,h[3]+=n),h},on_click:{webix_accordionitem_header:function(t){return this.Zd(t),!1},webix_accordionitem_header_v:function(t){return this.Zd(t),!1}},Zd:function(){this.define("collapsed",!this.q.collapsed)},collapsed_setter:function(t){if(!1!==this.q.header){var i=this.getParentView();if(i){if(t)if(i.Xd(this))this.Qd();else{var s=0;if(1<i.Ks.length)for(var e=0;e<i.Ks.length;e++){var n=i.Ks[e];if(this!=n&&n.isVisible()&&n.expand){n.expand(),this.Qd(),s=1;break}}if(!s)return}else this.tv();(this.q.collapsed=t)||i.Gd(this),this.refresh(),M.w||this.resize(),i.callEvent("onAfter"+(t?"Collapse":"Expand"),[this.q.id]),this.q.$noresize=t}return t}},collapse:function(){this.define("collapsed",!0),Vi.Bs(this)},expand:function(){this.define("collapsed",!1)},Re:function(){this.show()},Zs:function(){this.hide()},tv:function(){this.yn.style.display="",et(this.$view,"collapsed"),et(this.en,"collapsed"),this.en.setAttribute("aria-expanded","true")},Qd:function(){this.q.headerAlt&&(this.Jd.innerHTML=this.q.headerAlt()),this.yn.style.display="none",st(this.$view,"collapsed"),st(this.en,"collapsed"),this.en.setAttribute("aria-expanded","false")},refresh:function(){var t=this.q[this.q.collapsed?"headerAlt":"header"]||this.q.header;t&&(this.Jd.innerHTML=t(),this.Kd.setAttribute("aria-label",t()));var i=this.getParentView().Tl?"vertical":"horizontal";this.nt.className.indexOf(" "+i)<0&&st(this.nt,i),S.transform||st(this.nt,"webix_ie",!0)},qd:function(){return this.q.collapsed?this.q.headerAltHeight:this.q.headerHeight},$setSize:function(t,i){if(Gi.api.$setSize.call(this,t,i)||this.qd()!=this.iv){t=this.ze,i=this.He;var s=this.iv=this.qd();if(this.q.header)if(this.en.style.height=s+"px",this.en.style.width="auto",this.en.style[S.transform]="",this.en.style.borderBottomWidth=(this.q.collapsed?0:1)+"px",this.getParentView().Tl||!this.q.collapsed)i-=this.qd();else if(this.q.collapsed)if(Zi.isSupported()){this.en.style.width=i+"px",this.en.style.height=t+3+"px";var e=Math.floor(i/2-t/2)+(t-this.q.headerAltHeight)/2;this.en.style[S.transform]="rotate(90deg) translate("+e+"px, "+(e+1)+"px)"}else this.en.style.width=t+"px",this.en.style.height=i+3+"px";this.q.collapsed||(this.Z.$setSize(t,i),this.sv=i)}else if(!this.q.collapsed){var n=this.Z;this.sv&&n.$setSize(this.ze,this.sv)}},$skin:function(){var t=this.defaults;t.headerAltHeight=t.headerHeight=Qi.barHeight,t.headerHeight-=Qi.borderWidth},defaults:{header:!1,headerAlt:!1,body:""}}),jn=(H.protoUI(Pn,Us,g,Gi.view),{name:"resizearea",defaults:{dir:"x"},
$init:function(t){var i=t.dir||"x",s=A(t.container),e="x"==i?"width":"height",n=t.margin?t.margin+"px":0;this.ev="x"==i?"left":"top",this.nt=Y("DIV",{"class":"webix_resize_area webix_dir_"+i}),Lt(this.nt,S.mouse.down,tt),n&&(n="x"==i?n+" 0 "+n:"0 "+n+" 0 "+n),this.nv=Y("DIV",{"class":"webix_resize_handle_"+i,style:n?"padding:"+n:""},"<div class='webix_handle_content'></div>"),this.hv=Y("DIV",{"class":"webix_resize_origin_"+i}),t[e]&&(this.hv.style[e]=t[e]+(t.border?1:0)+"px",this.nv.style[e]=t[e]+"px"),t.cursor&&(this.nv.style.cursor=this.hv.style.cursor=this.nt.style.cursor=t.cursor),this.rv=Ot(s,S.mouse.move,this.ov,{bind:this}),this.av=Ot(document.body,S.mouse.up,this.uv,{bind:this}),this.nv.style[this.ev]=this.hv.style[this.ev]=t.start+"px",s.appendChild(this.nt),s.appendChild(this.nv),s.appendChild(this.hv)},uv:function(){this.callEvent("onResizeEnd",[this.cv]),Ut(this.rv),Ut(this.av),G(this.nt),G(this.nv),G(this.hv),this.nt=this.nv=this.hv=null},ov:function(t){var i=Z(t);this.cv=("x"==this.q.dir?i.x:i.y)+this.q.start-this.q.eventPos,this.nv.style[this.ev]=this.cv+"px",this.callEvent("onResize",[this.cv])}}),Nn=(H.protoUI(jn,g,Hi),{name:"resizer",defaults:{width:7,height:7},$init:function(t){this.getParentView(),this.nt.className+=" webix_resizer";var i=this.getParentView().wa;Lt(this.nt,S.mouse.down,this.fv,{bind:this}),Ot(document.body,S.mouse.up,this.lv,{bind:this});var s=this.dv();this.vv=!1,this._v=s,this.pv="x"==s?"width":"height","x"==s?t.height=0:t.width=0,0<i?(this.nt.className+=" webix_resizer_v"+s,this.nt.style.marginRight="-"+i+"px","x"==s?t.width=i:t.height=i,this.$nospace=!0):this.nt.className+=" webix_resizer_"+s,this.nt.innerHTML="<div class='webix_resizer_content'></div>","y"==s&&0<i&&(this.nt.style.marginBottom="-"+(t.height||this.defaults.height)+"px"),this.nt.setAttribute("tabindex","-1"),this.nt.setAttribute("aria-grabbed","false")},fv:function(t){var i=this.mv();if(i&&!this.q.disabled){t=t||Ot,this.vv=!0,this.bv=Z(t),this.gv=[],this.nt.setAttribute("aria-grabbed","true");for(var s=0;s<2;s++)i[s].$view.setAttribute("aria-dropeffect","move");this.nt.setAttribute("aria-dropeffect","move"),this.wv(t,i[0])}},lv:function(){this.vv=!1,this.bv=!1},wv:function(t,i){var s,e,n,h,r;t=t||Ot,s=this._v,this.getParentView().nt.style.position="relative",n=K(this.nt),h=K(this.getParentView().nt),r=n[s]-h[s],e=K(i.$view)[s]-K(this.getParentView().$view)[s],this.xv=[s,i,r,e],this.yv=new Vt.resizearea({container:this.getParentView().nt,dir:s,eventPos:this.bv[s],start:r-1,height:this.$height,width:this.$width,border:1,margin:this.getParentView()["_padding"+s.toUpperCase()]}),this.yv.attachEvent("onResizeEnd",C(this.Mv,this)),this.yv.attachEvent("onResize",C(this.Sv,this)),st(document.body,"webix_noselect",1)},dv:function(){return this.getParentView().Tl?"y":"x"},Sv:function(){var t,i,s,e,n,h,r,o,a,u;if(this.xv)for(t=this.mv(),n=this.xv[0],e=this.yv.cv-this.xv[2],a=this.kv(t,n,e),u=t[0]["$"+this.pv]+t[1]["$"+this.pv],r="y"==n?["minHeight","maxHeight"]:["minWidth","maxWidth"],h=0;h<2;h++){s=h?-e:e;var c=(i=t[h].q)[r[0]],f=i[r[1]];if(0<s&&f&&f<=a[h]||s<0&&(c||3)>=a[h])return this.gv[h]=0<s?f:c||3,o=this.Cv(t,n),void(this.yv.nv.style["y"==n?"top":"left"]=this.xv[3]+o[0]+"px");a[h]<3?this.yv.nv.style["y"==n?"top":"left"]=this.xv[3]+h*u+1+"px":this.gv[h]=null}},mv:function(){var t,i,s;for(t=this.getParentView().Ks,i=0;i<t.length;i++)if(t[i]==this)return(s=[this.Dv(t,i,1,-1),this.Dv(t,i,1,1)])[0]&&s[1]||(s=null),s},Dv:function(t,i,s,e){var n=t[i+e*s];return n&&n.q.hidden?this.Dv(t,i,s+1,e):n&&n.q.$noresize?null:n},Mv:function(t){if(void 0!==t){var i,s,e,n,h=this.getParentView().Tl;if(this.$v=null,this.xv){if(s=this.xv[0],e=t-this.xv[2],(i=this.mv())[0]&&i[1]){n=this.Av(i,s,e);for(var r=0;r<2;r++){var o=i[r].$getSize(0,0);if(h?o[2]==o[3]:Math.abs(o[1]-o[0])<3)i[r].q[this.pv]=n[r],i[r].jl&&i[r].jl(this.pv,n[r],h);else{var a=i[r].$view[h?"offsetHeight":"offsetWidth"];i[r].q.gravity=n[r]/a*i[r].q.gravity}}i[0].resize();for(var u=0;u<2;u++)i[u].callEvent&&i[u].callEvent("onViewResize",[]),i[u].$view.removeAttribute(
"aria-dropeffect");I("onLayoutResize",[i])}this.xv=!1}this.xv=!1,this.vv=!1,this.gv=null,et(document.body,"webix_noselect"),this.nt.setAttribute("aria-grabbed","false"),this.nt.removeAttribute("aria-dropeffect")}},Cv:function(t){var i,s,e;return e=t[0]["$"+this.pv]+t[1]["$"+this.pv],this.gv[0]?s=e-(i=this.gv[0]):this.gv[1]&&(i=e-(s=this.gv[1])),[i,s]},kv:function(t,i,s){for(var e=[],n="height"==this.pv?"offsetHeight":"offsetWidth",h=0;h<2;h++)e[h]=t[h].$view[n]+(h?-1:1)*s;return e},Av:function(t,i,s){var e,n,h;if(this.gv[0]||this.gv[1])n=this.Cv(t,i);else for(n=this.kv(t,i,s),e=0;e<2;e++)n[e]<0&&(h=n[0]+n[1],n[e]=1,n[1-e]=h-1);return n}}),En=(H.protoUI(Nn,Us,Bi,Gi.view),{name:"align",defaults:{borderless:!0,left:0,top:0,right:0,bottom:0},$init:function(){this.nt.className+=" webix_view_align"},getChildViews:function(){return[this.Z]},body_setter:function(t){return t.Q={top:!1,left:!1,right:!1,bottom:!1},(M._=this).Z=Vt.ot(t),this.nt.appendChild(this.Z.nt),t},align_setter:function(t){"string"==typeof t&&(t=t.split(",")),this.Iv=this.Fv=this.Tv="";for(var i=0;i<t.length;i++){var s=t[i];"center"!==s&&"left"!==s&&"right"!==s||(this.Iv=s),"top"!==s&&"bottom"!==s&&"middle"!==s||(this.Fv=s),"absolute"===s&&(this.Iv=this.Fv=this.Tv="precise")}return t},getBody:function(){return this.Z},$setSize:function(t,i){var s,e;Gi.api.$setSize.call(this,t,i),e=this.Tv?(s=t-this.q.left-this.q.right,i-this.q.top-this.q.bottom):(s=this.El[0]||t,this.El[2]||i),this.Z.$setSize(s,e);var n=this.Z.nt;"center"==this.Iv?n.style.marginLeft=Math.ceil((t-s)/2)+"px":"right"==this.Iv?n.style.marginLeft=t-s+"px":n.style.marginLeft=(this.Tv?this.q.left:0)+"px","middle"==this.Fv?n.style.marginTop=Math.ceil((i-e)/2)+"px":"bottom"==this.Fv?n.style.marginTop=i-e+"px":n.style.marginTop=(this.Tv?this.q.top:0)+"px"},$getSize:function(t,i){var s=this.El=this.Z.$getSize(0,0),e=Ui.api.$getSize.call(this,0,0);return this.Tv&&(t+=this.q.left+this.q.right,i+=this.q.top+this.q.bottom),!this.Iv||this.Tv?(e[0]=s[0]+t,e[1]=s[1]+t):(e[0]=(e[0]||s[0])+i,e[1]+=t),!this.Fv||this.Tv?(e[2]=s[2]+i,e[3]=s[3]+i):(e[2]=(e[2]||s[2])+i,e[3]+=i),e}}),Ln=(H.protoUI(En,Gi.view),{name:"multiview",defaults:{animate:{}},setValue:function(t){jt(t).show()},getValue:function(){return this.getActiveId()},$init:function(){this.$u=0,this.Tl=1,this.nt.style.position="relative",this.nt.className+=" webix_multiview",this.zv=[]},Vv:function(t,i){var s=jt(t);s.Hv||(s.Bv=[],s.Hv={}),s.Hv[i]||(s.Hv[i]=!0,s.Bv.push(i))},Rv:function(t){var i=jt(t);if(this.q.keepViews&&(i.nt.style.display=""),this.zv[this.zv.length-2]!=t?(10==this.zv.length&&this.zv.splice(0,1),this.zv.push(t)):this.zv.splice(this.zv.length-1,1),i.Hv){for(var s=0;s<i.Bv.length;s++){var e=jt(i.Bv[s]);e&&e.render()}i.Bv=[],i.Hv={}}},addView:function(){var t=Cn.api.addView.apply(this,arguments);return this.q.keepViews?jt(t).nt.style.display="none":G(jt(t).nt),t},Hl:function(t){if(t==this.$u){var i=Math.max(t-1,0);this.Ks[i]&&(this.Pv=!1,this.Re(this.Ks[i],!1))}t<this.$u&&this.$u--},Zs:function(){},Al:function(t){t=t||this.zl;for(var i=0;i<t.length;i++)t[i].Q=this.q.borderless?{top:1,left:1,right:1,bottom:1}:this.q.Q||{};Cn.api.Al.call(this,t);for(var s=1;s<this.Ks.length;s++)this.q.keepViews?this.Ks[s].nt.style.display="none":G(this.Ks[s].nt);for(var e=0;e<t.length;e++){var n=this.Ks[e];if(!n.Ks||n.hd){var h=n.q.Q;h.top&&(n.nt.style.borderTopWidth="0px"),h.left&&(n.nt.style.borderLeftWidth="0px"),h.right&&(n.nt.style.borderRightWidth="0px"),h.bottom&&(n.nt.style.borderBottomWidth="0px"),n.nt.setAttribute("role","tabpanel")}}this.Rv(this.getActiveId())},cells_setter:function(t){t&&t.length,this.zl=t},jv:function(t,i){var s=(this.q.animate||{}).direction,e="top"==s||"bottom"==s;return t<i?e?"bottom":"right":e?"top":"left"},Re:function(t,i){var s=this.getParentView();if(s&&s.getTabbar&&s.getTabbar().setValue(t.q.$id||t.q.id),this.Pv)return $(this.Re,this,[t,i],100);for(var e=-1,n=0;n<this.Ks.length;n++)if(this.Ks[n]==t){e=n;break}if(!(e<0||e==this.$u)){var h=this.Ks[this.$u],r=this.Ks[e];if(h.$getSize(0,0),(i||void 0===i)&&Zi.isSupported(
)&&this.q.animate){var o=H.extend({},this.q.animate);this.q.keepViews&&(o.keepViews=!0),o.direction=this.jv(e,this.$u),o=Hi.ie(i||{},o);var a=Zi.formLine(r.nt,h.nt,o);r.$getSize(0,0),r.$setSize(this.ze,this.He);var u=o.callback;o.callback=function(){Zi.breakLine(a,this.q.keepViews),this.Pv=!1,u&&u.call(this),u=o.master=o.callback=null,this.resize()},(o.master=this).$u=e,this.Rv(this.getActiveId()),Zi(a,o),this.Pv=!0}else this.q.keepViews?h.nt.style.display="none":(G(h.nt),this.nt.appendChild(this.Ks[n].nt)),this.$u=e,h.resize(),this.Rv(this.getActiveId());r.callEvent&&(r.callEvent("onViewShow",[]),Fi(r,this.Rl)),this.callEvent("onViewChange",[h.q.id,r.q.id])}},$getSize:function(t,i){if(!this.Ks.length)return Ui.api.$getSize.call(this,0,0);var s=this.Ks[this.$u].$getSize(0,0);if(this.q.fitBiggest)for(var e=0;e<this.Ks.length;e++)if(e!=this.$u)for(var n=this.Ks[e].$getSize(0,0),h=0;h<4;h++)s[h]=Math.max(s[h],n[h]);var r=Ui.api.$getSize.call(this,0,0);return 1e5<=r[1]&&(r[1]=0),1e5<=r[3]&&(r[3]=0),r[0]=(r[0]||s[0])+t,r[1]=(r[1]||s[1])+t,r[2]=(r[2]||s[2])+i,r[3]=(r[3]||s[3])+i,r},$setSize:function(t,i){this.Ks.length&&(this.Il=[t,i],Ui.api.$setSize.call(this,t,i),this.Ks[this.$u].$setSize(t,i))},isVisible:function(t,i){return i&&i!=this.getActiveId()?(t&&this.Vv(i,t),!1):Gi.api.isVisible.call(this,t,this.q.id)},getActiveId:function(){return this.Ks.length?this.Ks[this.$u].q.id:null},back:function(t){if(t=t||1,this.callEvent("onBeforeBack",[this.getActiveId(),t])){if(this.zv.length>t){var i=this.zv[this.zv.length-t-1];return jt(i).show(),i}return null}return null}}),On=(H.protoUI(Ln,Cn.view),{name:"tabview",setValue:function(t){this.Ks[0].setValue(t)},getValue:function(){return this.Ks[0].getValue()},getTabbar:function(){return this.Ks[0]},getMultiview:function(){return this.Ks[1]},addView:function(t){var i=this.getMultiview().addView(t.body);return t.id=i,t.value=t.header,delete t.body,delete t.header,this.getTabbar().addOption(t),i},removeView:function(t){var i=this.getTabbar();i.removeOption(t),i.refresh()},$init:function(t){this.$ready.push(this.Nv);var i=t.cells,s=[];i&&i.length;for(var e=i.length-1;0<=e;e--){var n=i[e].body||i[e];n.id||(n.id="view"+z()),s[e]={value:i[e].header,id:n.id,close:i[e].close,width:i[e].width,hidden:!!i[e].hidden},i[e]=n}var h={view:"tabbar",multiview:!0},r={view:"multiview",cells:i,animate:!!t.animate};t.value&&(h.value=t.value),t.tabbar&&H.extend(h,t.tabbar,!0),t.multiview&&H.extend(r,t.multiview,!0),h.options=h.options||s,t.rows=[h,r],delete t.cells,delete t.tabs},Nv:function(){this.getTabbar().attachEvent("onOptionRemove",function(t){var i=jt(t);if(i){var s=i.getParentView();s&&s.removeView(i)}})}}),Un=(H.protoUI(On,An.view),{name:"carousel",defaults:{scrollSpeed:"300ms",type:"clean",navigation:{},animate:!0},$init:function(){this.nt.className+=" webix_carousel",this.Ev=null,this.bt=null,this.$u=0,this.$ready.unshift(this.Lv),this.$ready.push(this.Wh)},addView:function(t,i){var s=this.Ev.addView(t,i);return this.Ov(),s},removeView:function(t){this.Ev.removeView(t),this.Ov()},st:function(t,i){this.Ev.st(t,i),this.Ov()},Ov:function(){this.Ks=this.Ev.Ks,this.wu(),this.setActiveIndex(Math.min(this.$u,this.Ks.length-1))},Lv:function(){this.Ev&&this.Ev.destructor&&this.Ev.destructor();var t="";this.config.cols?(t="cols",this.Tl=0):(t="rows",this.Tl=1);var i={borderless:!0,type:"clean"};i[t]=B(this.q[t]);for(var s=["type","margin","marginX","marginY","padding","paddingX","paddingY"],e={},n=0;n<s.length;n++)this.q[s[n]]&&(e[s[n]]=this.q[s[n]]);H.extend(i,e,!0),(M._=this).Ev=Vt.ot(i),this.nt.appendChild(this.Ev.nt),this.Ks=this.Ev.Ks,this.Ev.Re=C(Un.Re,this),this.Ev.adjustScroll=C(Un.adjustScroll,this),F("onReconstruct",C(function(t){t==this.Ev&&this.Uv()},this)),this.re=this.nt.firstChild},je:function(t,i){this.q.navigation.items&&"tab"===i.target.getAttribute("role")&&this.mu(t,i),Ui.api.je.call(this,t,i)},getChildViews:function(){return[this.Ev]},getLayout:function(){return this.Ev},Wh:function(){this.re.setAttribute("touch_scroll",this.Tl?"y":"x"),this.Ev.attachEvent("onAfterScroll",C(function(
){this.callEvent("onShow",[this.getActiveId()])},this)),Fi(this.Ev,function(t){t.nt.setAttribute("role","tabpanel")})},adjustScroll:function(t){var i,s=this.Tl?this.He:this.ze;return this.Tl?(i=Math.round(t.f/s),t.f=i*s):(i=Math.round(t.e/s),t.e=i*s),this.$u=-i,this.q.navigation&&this.xu(),!0},Re:function(t){var i,s,e,n,h,r;for(e=-1,s=this.Ev,i=0;i<s.Ks.length;i++)if(s.Ks[i]==t){e=i;break}e<0||e==this.$u||(this.$u=e,n=s.Tl?this.He:this.ze,h=-(s.Tl?0:e*n),r=-(s.Tl?e*n:0),this.scrollTo(h,r),this.callEvent("onShow",[s.Ks[this.$u].q.id]),this.q.navigation&&this.wu())},scrollTo:function(t,i){Mi&&Zi.isSupported()&&this.q.animate?Mi.Ci(this.re,t,i,this.q.scrollSpeed||"100ms"):(this.re.style.marginLeft=t+"px",this.re.style.marginTop=i+"px")},navigation_setter:function(t){return this.ie(t,{type:"corner",buttons:!0,items:!0}),t},showNext:function(){this.$u<this.Ev.Ks.length-1&&this.setActiveIndex(this.$u+1)},showPrev:function(){0<this.$u&&this.setActiveIndex(this.$u-1)},setActiveIndex:function(t){this.Ev.Ks.length,jt(this.Ev.Ks[t].q.id).show()},getActiveIndex:function(){return this.$u},$getSize:function(t,i){var s=this.Ev.$getSize(0,0),e=Gi.api.$getSize.call(this,t,i);return this.Ev.Tl?(e[0]=Math.max(e[0],s[0]),e[1]=Math.min(e[1],s[1])):(e[2]=Math.max(e[2],s[2]),e[3]=Math.min(e[3],s[3])),e},$setSize:function(t,i){var s=this.Ev,e=s.Ks.length,n=Gi.api.$setSize.call(this,t,i),h=this.He*(s.Tl?e:1),r=this.ze*(s.Tl?1:e);n?(this.re.style.height=h+"px",this.re.style.width=r+"px",s.$setSize(r,h),this.Uv()):s.$setSize(r,h)},Uv:function(){var t=this.Ev,i=this.$u||0,s=t.Tl?this.He:this.ze,e=-(t.Tl?0:i*s),n=-(t.Tl?i*s:0);this.scrollTo(e,n),this.q.navigation&&this.wu()},getActiveId:function(){var t=this.Ev.Ks[this.$u];return t?t.q.id:null},setActive:function(t){jt(t).show()}}),Yn=(H.protoUI(Un,g,Ys,Gi.view),{name:"proxy",body_setter:function(t){return(M._=this).Z=Vt.ot(t),this.nt.appendChild(this.Z.nt),t},getChildViews:function(){return[this.Z]},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i),this.Z.$setSize(this.$width,this.$height)},$getSize:function(t,i){var s=Gi.api.$getSize.call(this,t,i),e=this.Z.$getSize(t,i);return e[0]=Math.max(s[0],e[0]),e[1]=Math.min(s[1],e[1]),e[2]=Math.max(s[2],e[2]),e[3]=Math.min(s[3],e[3]),e[4]=Math.max(s[4],e[4]),e},st:function(t){this.Z.destructor(),this.Z=t,this.nt.appendChild(t.nt)}}),Wn=(H.protoUI(Yn,Gi.view),{name:"portlet",defaults:{layoutType:"wide",icon:"wxi-drag"},$init:function(t){this.nt.style.position="relative",t.header&&t.body&&(t.body=[{template:t.header,type:"header"},t.body]),this.$ready.push(this.Yv),F("onAfterPortletMove",this.Wv)},Wv:function(t){Fi(t,function(t){t.Gv&&t.Gv()})},Yv:function(){var t=this.getChildViews();if(1<t.length)zi.addDrag(t[0].$view,this);else if(this.q.icon){var i=Y("div",{"class":"portlet_drag"},"<span class='webix_icon "+this.q.icon+"'></span>");this.nt.appendChild(i),zi.addDrag(i,this)}else zi.addDrag(this.$view,this)},body_setter:function(t){return this.rows_setter(b(t)?t:[t])},markDropArea:function(t,i){if(!t)return G(this.Xv);t=jt(t),this.Xv||(this.Xv=Y("div",null,"&nbsp;")),t.$view.appendChild(this.Xv),this.Xv.className="portlet_marker"+i},movePortlet:function(t,i){var s=t.getParentView(),e=this.getParentView(),n=s.index(t),h=e.index(this);if(I("onBeforePortletMove",[e,s,this,t,i])){M.l=!0;var r=e!=s?1:0,o=s.Tl;"top"==i||"bottom"==i?(1!==o&&(Vt(t,s=Vt({type:t.q.layoutType,rows:[]},s,n+r),0),n=0,r=1),"bottom"==i&&(r+=1)):"left"!=i&&"right"!=i||(0!==o&&(Vt(t,s=Vt({type:t.q.layoutType,cols:[]},s,n+r),0),n=0,r=1),"right"==i&&(r+=1)),h<n&&(r-=1),Vt(this,s,n+r),"replace"==i&&Vt(t,e,h),this.Jv(e),M.l=!1,t.resize(),e.resize(),I("onAfterPortletMove",[e,s,this,t,i])}},Jv:function(t){for(var i,s=0;t.getChildViews().length<=s;)t=(i=t).getParentView(),s=1;s&&t.removeView(i)},$drag:function(t){return st(this.nt,"portlet_in_drag"),zi.ns={source:t,from:t},this.nt.innerHTML},$dragDestroy:function(t,i){et(this.nt,"portlet_in_drag"),G(i),this.Kv&&(this.movePortlet(this.Kv,this.qv),this.markDropArea(),this.Kv=null)},ss:function(){return K(this.$view)},$dragPos:function(t,i,s){
s.style.left="-10000px";var e=S.mouse.context(i),n=document.body.scrollTop||document.documentElement.scrollTop||0,h=document.body.scrollLeft||document.documentElement.scrollLeft||0,r=document.elementFromPoint(e.x-h,e.y-n),o=null;r&&(o=jt(r)),this.Kv=this.Zv(o),this.qv=this.Qv(this.Kv,i),t.x=t.x-this.ze+10,t.y=t.y-20,zi.bs=!0},Qv:function(t,i){var s="",e="";if(i&&t){var n=K(t.$view),h=Z(i),r=h.x-n.x-n.width/2,o=h.y-n.y-n.height/2;(e=t.q.mode)||(e=Math.abs(r)*(n.height/n.width)>Math.abs(o)?"cols":"rows"),"cols"==e?s=0<=r?"right":"left":"rows"==e&&(s=0<=o?"bottom":"top"),this.markDropArea(t,s)}return this.markDropArea(t,s),s||e},Zv:function(t){for(;t;){if(t.movePortlet)return t;t=t.getParentView()}}}),Gn=(H.protoUI(Wn,An.view),{name:"abslayout",$init:function(){this.$view.className+=" webix_abslayout",delete this.rows_setter,delete this.cols_setter,this.zl=[]},cells_setter:function(t){this.zl=t},Al:function(){Cn.api.Al.call(this,this.zl)},$getSize:function(){for(var t=Ui.api.$getSize.call(this,0,0),i=null,s=0;s<this.Ks.length;s++)this.Ks[s].q.relative&&(i=this.Ks[s].$getSize(0,0));return i&&(1e5<=t[1]&&(t[1]=0),1e5<=t[3]&&(t[3]=0),t[0]=Math.max(t[0],i[0]),t[1]=Math.max(t[1],i[1]),t[2]=Math.max(t[2],i[2]),t[3]=Math.max(t[3],i[3])),t},$setSize:function(t,i){this.Il=[t,i],Ui.api.$setSize.call(this,t,i),this.ga(t,i)},ga:function(t,i){for(var s=0;s<this.Ks.length;s++){var e=this.Ks[s],n=e.q,h=e.$getSize(0,0);n.relative?(n.left=n.top=0,e.$setSize(t,i)):e.$setSize(h[0],h[2]);for(var r=e.$view,o=["left","right","top","bottom"],a=0;a<o.length;a++){var u=o[a];u in n&&(r.style[u]=n[u]+"px")}}}}),Xn={api:Gn,view:H.protoUI(Gn,Cn.view)},Jn={name:"gridlayout",defaults:{autoplace:!0,gridColumns:2,gridRows:2,margin:10,padding:10},gridRows_setter:function(t){return this.t_=t},Al:function(){for(var t=0;t<this.zl.length;t++)this.zl[t].Q={};Cn.api.Al.call(this,this.zl)},removeView:function(t){Xn.api.removeView.call(this,t),this.i_(),this.callEvent("onChange",[])},s_:function(t){if(t.dx=t.dx||1,t.dy=t.dy||1,D(t.y)||D(t.x)){for(var i=this.e_(),s=0;s<this.t_;s++)for(var e=0;e<this.q.gridColumns;e++)if(!i[e][s]&&this.n_(i,e,s,e+t.dx,s+t.dy))return t.x=e,void(t.y=s);t.x=0,t.y=this.t_}var n=t.x+t.dx-this.q.gridColumns;0<n&&(t.dx-=n)},st:function(t){this.s_(t.config),this.Ks.push(t),this.$view.appendChild(t.nt),this.h_(t.config,t.config.id),this.i_(!0),this.r_||this.callEvent("onChange",[])},n_:function(t,i,s,e,n){for(var h=i;h<e;h++)for(var r=s;r<n;r++)if(!t[h]||t[h][r])return!1;return!0},o_:function(t,i,s){for(var e=0;e<i.dx;e++)for(var n=0;n<i.dy;n++)t[e+i.x][n+i.y]=s},a_:function(t,i,s){for(var e=this.q.gridColumns,n=i.x+i.dx;n+s.dx<=e;n++)if(this.n_(t,n,s.y,n+s.dx,s.y+s.dy))return n-s.x;return 0},u_:function(t,i,s){for(var e=i.x-s.dx;0<=e;e--)if(this.n_(t,e,s.y,e+s.dx,s.y+s.dy))return s.x-e;return 0},c_:function(t,i,s){for(var e=i.y-s.dy;0<=e;e--)if(this.n_(t,s.x,e,s.x+s.dx,e+s.dy))return s.y-e;return 0},e_:function(t){for(var i=[],s=0;s<this.q.gridColumns;s++)i[s]=[];for(var e=0;e<this.Ks.length;e++){var n=this.Ks[e].config;n.id===t||n.hidden||this.o_(i,n,n.id)}return i},i_:function(t){(this.f_()||t)&&this.l_()},f_:function(){if(!this.q.autoplace)return!1;var t=this.q.gridColumns,i=this.t_,s=this.e_(),e=!1;t:for(var n=i-1;0<=n;n--){for(var h=t-1;0<=h;h--)if(s[h][n])continue t;e=!0;for(var r=0;r<this.Ks.length;r++){var o=this.Ks[r].config;!o.hidden&&o.y>=n&&(o.y-=1)}}return e},h_:function(t,i){if(t.x-=Math.max(0,t.x+t.dx-this.q.gridColumns),this.q.autoplace){for(var s=[],e=this.e_(i),n=0;n<this.Ks.length;n++){var h=this.Ks[n].config;h.id===i||h.hidden||h.y<t.y+t.dy&&h.y+h.dy>t.y&&h.x<t.x+t.dx&&h.x+h.dx>t.x&&s.push(h)}for(var r=[],o=0;o<s.length;o++){var a=s[o];this.o_(e,a,0);var u=this.a_(e,t,a);if(u)a.x+=u;else{var c=this.u_(e,t,a);if(c)a.x-=c;else{var f=this.c_(e,t,a);f?a.y-=f:(a.y=t.y+t.dy,r.push(a))}}this.o_(e,a,a.id)}for(var l=0;l<r.length;l++)this.h_(r[l],r[l].id)}else t.y-=Math.max(0,t.y+t.dy-this.q.gridRows)},l_:function(){for(var t=this.q.gridRows,i=0;i<this.Ks.length;i++){var s=this.Ks[i].config;s.hidden||(t=Math.max(t,s.y+s.dy))}
this.t_!=t&&(this.t_=t,this.resize()),this.ga()},moveView:function(t,i){i=H.extend(jt(t).config,i,!0),this.h_(i,t),this.i_(!0),this.callEvent("onChange",[])},serialize:function(t){for(var i=[],s=0;s<this.Ks.length;s++)if(t)i.push(t.call(this,this.Ks[s]));else{var e=this.Ks[s].config;i.push({id:e.id,name:e.name,x:e.x,y:e.y,dx:e.dx,dy:e.dy})}return i},clearAll:function(){for(var t=0;t<this.Ks.length;t++)this.Ks[t].destructor();this.Ks=[],this.callEvent("onChange",[])},restore:function(t,i){i=i||this.q.factory,t=B(t),this.r_=!0;for(var s={},e=0;e<t.length;e++){var n=t[e],h=jt(n.id);s[h?(H.extend(h.config,n,!0),h.config.id):(h=i.call(this,n),this.addView(h))]=1}for(var r=this.Ks.length-1;0<=r;r--)s[this.Ks[r].config.id]||(this.Ks[r].destructor(),this.Ks.splice(r,1));this.l_(),this.r_=!1},$getSize:function(){for(var t=Ui.api.$getSize.call(this,0,0),i=0;i<this.Ks.length;i++)this.Ks[i].$getSize(0,0);var s=this.q.cellWidth,e=this.q.cellHeight,n=this.d_(0,0,this.q.gridColumns,this.t_);return s&&(t[0]=n.dx+2*n.x),e&&(t[2]=n.dy+2*n.y),t},d_:function(t,i,s,e){var n=this.q.margin,h=this.q.paddingX||this.q.padding,r=this.q.paddingY||this.q.padding,o=this.q.cellWidth;o||(o=(this.$width-2*h+n)/this.q.gridColumns-n);var a=this.q.cellHeight;return a||(a=(this.$height-2*r+n)/this.t_-n),{x:h+(o+n)*t,y:r+(a+n)*i,dx:Math.ceil(o+(o+n)*(s-1)),dy:Math.ceil(a+(a+n)*(e-1))}},ga:function(){for(var t=0;t<this.Ks.length;t++){var i=this.Ks[t],s=i.q,e=this.d_(s.x,s.y,s.dx,s.dy);i.$getSize(0,0),i.$setSize(e.dx,e.dy);var n=i.$view;n.style.left=e.x+"px",n.style.top=e.y+"px"}}},Kn={api:Jn,view:H.protoUI(Jn,Xn.view)},qn={name:"dashboard",$init:function(){zi.addDrag(this.$view,this),zi.addDrop(this.$view,this,!0)},v_:function(t){return!(!t.getAttribute||t.getAttribute("webix_disable_drag")||t.getAttribute("webixignore"))&&(-1!=(t.className||"").toString().indexOf("panel_drag")?t:!(!t.parentNode||t==this.$view)&&this.v_(t.parentNode))},$dragCreate:function(t,i){if(i.target){if(!this.v_(i.target))return!1;var s=jt(i);s.$resizeMove||(s=s.queryView(function(t){return!!t.config.dx},"parent"));var e=K(this.$view),n=Z(i);return zi.ns={source:s,from:this,dashboard:{sx:n.x-e.x-parseInt(s.$view.style.left)+this.q.margin/2,sy:n.y-e.y-parseInt(s.$view.style.top)+this.q.margin/2}},this.__(s.q.dx,s.q.dy),s.$view}},__:function(t,i){var s=this.p_=Y("div",{"class":"panel_target"}),e=this.d_(0,0,t,i);s.style.width=e.dx+"px",s.style.height=e.dy+"px",this.$view.appendChild(this.p_)},$drop:function(){var t=zi.ns,i={x:t.dashboard.x,y:t.dashboard.y};if(t.from===this){var s=t.source.config;this.moveView(s.id,i)}else i.name=t.source[0],i.dx=t.dashboard.dx,i.dy=t.dashboard.dy,i.id=i.name+":"+z(),(i=this.q.factory.call(this,i))&&this.addView(i)},$dragDestroy:function(t,i){i.style.zIndex=1,G(this.p_),this.p_=null,this.l_()},m_:function(t,i){var s=this.q.margin,e=this.q.paddingX||this.q.padding,n=this.q.paddingY||this.q.padding,h=this.q.cellWidth;h||(h=(this.$width-2*e+s)/this.q.gridColumns-s);var r=this.q.cellHeight;return r||(r=(this.$height-2*n+s)/this.t_-s),t=Math.round((t-e)/(h+s/2)-.2),i=Math.round((i-e)/(r+s/2)-.2),{x:t=Math.max(0,Math.min(t,this.q.gridColumns)),y:i=Math.max(0,Math.min(i,this.t_)),width:h,height:r,margin:s,rx:t*h+s*t+e,ry:i*r+s*i+n}},$dragOut:function(){var t=zi.ns;this.p_&&t.external&&(G(this.p_),this.p_=null)},$dragIn:function(t,i,s){var e=zi.ns;if(!this.p_){if(!e.from||!e.from.getItem)return!1;if(!this.q.factory)return!1;e.external=!0;var n=e.from.getItem(e.source);e.dashboard={dx:n.dx,dy:n.dy},this.__(n.dx,n.dy)}if(e.external){var h=this.p_,r=S.mouse.context(s),o=K(this.$view),a=this.m_(r.x-o.x,r.y-o.y);H.extend(e.dashboard,a,!0),h.style.left=a.rx+"px",h.style.top=a.ry+"px"}return!0},$dragPos:function(t,i,s){var e=zi.ns;s.style.left="-10000px";var n=S.mouse.context(i),h=K(this.$view),r=e.dashboard,o=this.m_(n.x-h.x-r.sx,n.y-h.y-r.sy);t.x=n.x-r.sx-h.x,t.y=n.y-r.sy-h.y;var a=this.p_;a.style.left=o.rx+"px",a.style.top=o.ry+"px",H.extend(r,o,!0)}},Zn=(H.protoUI(qn,Kn.view),{name:"panel",$init:function(t){if(t.header&&t.body){var i=t.header;"object"!==k(i)&&(i={
template:t.header,type:"header",css:"webix_header"}),t.body=[i,t.body]}st(this.$view,"panel_drag_view"),this.$ready.push(this.Yv)},Yv:function(){var t=this.getChildViews(),i=1===t.length?this:t[1];if(this.q.icon){var s=Y("div",{"class":"panel_icon"},"<span class='webix_icon "+this.q.icon+" panel_icon_span'></span>");i!=this&&(i.$view.style.position="relative"),i.$view.appendChild(s)}},body_setter:function(t){return this.rows_setter(b(t)?t:[t])},$resizeEnd:function(t){var i=this.getParentView();if(i&&i.m_){var s=i.m_(t.x,t.y),e=Math.max(s.x,1),n=Math.max(s.y,1);i.moveView(this.q.id,{dx:e,dy:n})}},$resizeMove:function(t){var i=this.getParentView();if(i&&i.m_){var s=i.m_(t.x,t.y);t.x=s.width*s.x+s.margin*(s.x-1),t.y=s.height*s.y+s.margin*(s.y-1)}}}),Qn=(H.protoUI(Zn,An.view,cs),{$init:function(){H.extend(this,Hs,!0)},name:"flexlayout"}),th=(H.protoUI(Qn,An.view),{name:"datalayout",$init:function(){this.data.provideApi(this,!0),this.data.attachEvent("onStoreUpdated",C(this.render,this))},Al:function(){return this.b_||(this.b_=this.zl,this.zl=[{}]),An.api.Al.call(this,this.zl)},setValue:function(t){this.parse(t)},getValue:function(){for(var t=this.b_.length,i=0;i<this.Ks.length;i++){var s=this.data.order[Math.floor(i/t)],e=this.data.getItem(s);this.g_(this.Ks[i],e)}return this.data.serialize()},g_:function(t,i){var s=t.q.name;if(s){var e=null;t.getValues?e=t.getValues():t.getValue?e=t.getValue():t.serialize&&(e=t.serialize()),"$value"==s?H.extend(i,e,!0):i[s]=e}else{var n=t.Ks;if(n)for(var h=0;h<n.length;h++)this.g_(n[h],i)}},w_:function(t,i){var s,e=t.q.name;if(e)s="$value"==e?i:i[e],t.setValues?t.setValues(s):t.setValue?t.setValue(s):t.parse&&(t.openAll&&(s=B(s)),t.parse(s));else{var n=t.Ks;if(n)for(var h=0;h<n.length;h++)this.w_(n[h],i)}},render:function(t,i,s){var e=this.b_.length;if(t&&"update"===s)for(var n=this.getItem(t),h=this.getIndexById(t),r=0;r<e;r++)this.w_(this.Ks[h*e+r],n);else{for(var o=this.zl=[],a=this.data.order,u=0;u<a.length;u++)if(e)for(var c=0;c<e;c++)o.push(B(this.b_[c]));else o.push(this.getItem(a[u]));if(o.length||o.push({}),this.reconstruct(),e)for(var f=0;f<a.length;f++)for(var l=this.getItem(a[f]),d=0;d<e;d++){var v=this.Ks[f*e+d];this.w_(v,l)}}}}),ih={api:th,view:H.protoUI(th,Cs,An.view)},sh={$init:function(){H.extend(this,Hs,!0)},name:"flexdatalayout"},eh=(H.protoUI(sh,ih.view),{name:"popup",$init:function(){this.q.head=!1,this.$view.className+=" webix_popup",F("onClick",C(this.Zs,this)),this.attachEvent("onHide",this.Dn)},$skin:function(){this.defaults.headHeight=Qi.barHeight,this.defaults.padding=Qi.popupPadding,this.defaults.point=!Qi.popupNoPoint,this.defaults.borderless=Qi.borderlessPopup},close:function(){G(this.x_),ls.api.close.call(this)},$getSize:function(t,i){return ls.api.$getSize.call(this,t+2*this.q.padding,i+2*this.q.padding)},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i),t=this.ze-2*this.q.padding,i=this.He-2*this.q.padding,this.re.style.padding=this.q.padding+"px",this.en.style.display="none",this.Z.$setSize(t,i)},zn:function(t){"undefined"==typeof t.borderless&&(t.borderless=!1)},head_setter:function(){},Cn:function(t,i,s,e){this.Dn(),document.body.appendChild(this.x_=Y("DIV",{"class":"webix_point_"+t},"")),this.x_.style.zIndex=Ti(),this.x_.style.position=e?"fixed":"absolute",this.x_.style.top=s+"px",this.x_.style.left=i+"px"},Dn:function(){this.x_=G(this.x_)}}),nh={api:eh,view:H.protoUI(eh,ls.view)},hh={name:"toolbar",defaults:{type:"toolbar"},hd:!0,y_:"webix_toolbar",M_:!1,$init:function(t){t.borderless||(this.re.style.borderWidth="1px",this.q.Q={top:!1,left:!1,right:!1,bottom:!1}),this.re.className+=" "+this.y_,this.nt.setAttribute("role","toolbar")},Vl:function(){var i=this;i.elements={},Fi(this,function(t){if(t.q.name&&t.getValue&&t.setValue&&(i.elements[t.q.name]=t).mapEvent&&t.mapEvent({onbeforetabclick:i,onaftertabclick:i,onitemclick:i,onchange:i}),t.setValues)return!1});var t=this._f;if(this.setDirty(!1),t){var s=this._f;for(var e in i.elements)t[e]&&s[e]!=t[e]&&(s[e]=t[e],this.setDirty(!0))}},Pl:function(){this.Vl()},Ql:function(t){var i=this.q
;return i.elements&&!t&&(this.zl=t=i.elements,this.Tl=this.M_,delete i.elements),this.q.elementsConfig&&this.S_(this.zl,i.elementsConfig),t},S_:function(t,i){for(var s=0;s<t.length;s++){var e=t[s];H.extend(e,i);var n,h=i;e.elementsConfig&&(h=H.extend(H.extend({},e.elementsConfig),i)),(n=e.body?[e.body]:e.rows||e.cols||e.cells||e.body)&&this.S_(n,h)}},$getSize:function(t,i){var s=An.api.$getSize.call(this,t,i),e=this.getParentView(),n=this.Tl?3:1;return e&&this.Tl!=e.Tl&&(s[n]+=1e5),s},render:function(){},refresh:function(){this.render()}},rh={api:hh,view:H.protoUI(hh,Ks,vi,$e,An.view,xs)},oh={name:"form",defaults:{type:"form",autoheight:!0},k_:-1,y_:"webix_form",M_:!0,$init:function(){this.nt.setAttribute("role","form")},$getSize:function(t,i){this.Ve&&!this.q.width&&(t+=S.scrollSize);var s=An.api.$getSize.call(this,t,i);return!this.q.scroll&&this.q.autoheight||(s[2]=this.q.height||this.q.minHeight||0,s[3]+=1e5),s}},ah=(H.protoUI(oh,rh.view),{name:"fieldset",defaults:{borderless:!0,$cssName:"webix_fieldset",paddingX:18,paddingY:30},$init:function(t){t.body=t.body||{};var i=this.defaults.$cssName;this.nt.className+=" "+i,this.nt.innerHTML="<fieldset><legend class='"+i+"_label"+(t.required?" webix_required":"")+"'></legend><div class='"+i+"_body'></div></fieldset>"},label_setter:function(t){return this.nt.firstChild.childNodes[0].innerHTML=t},getChildViews:function(){return[this.C_]},body_setter:function(t){return(M._=this).C_=Vt(t,this.nt.firstChild.childNodes[1]),t},getBody:function(){return this.C_},resizeChildren:function(){if(this.C_){var t=this.$width-this.q.paddingX,i=this.$height-this.q.paddingY,s=this.C_.$getSize(0,0);s[0]>t&&(t=s[0]),s[2]>i&&(i=s[2]),this.C_.$setSize(t,i),this.resize()}},$getSize:function(t,i){t+=this.q.paddingX,i+=this.q.paddingY;var s=this.C_.$getSize(t,i),e=this.D_=Gi.api.$getSize.call(this,t,i);return e[0]<s[0]&&(e[0]=s[0]),e[2]<s[2]&&(e[2]=s[2]),e[1]>s[1]&&(e[1]=s[1]),e[3]>s[3]&&(e[3]=s[3]),e[1]<e[0]&&(e[1]=e[0]),e[3]<e[2]&&(e[3]=e[2]),e},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&(t=Math.min(this.D_[1],t),i=Math.min(this.D_[3],i),this.C_.$setSize(t-this.q.paddingX,i-this.q.paddingY))}}),uh={api:ah,view:H.protoUI(ah,Gi.view)},ch={name:"forminput",defaults:{$cssName:"webix_forminput",labelWidth:80,labelAlign:"left",paddingY:0,paddingX:0},setValue:function(t){this.C_.setValue?this.C_.setValue(t):this.C_.setValues&&this.C_.setValues(t)},focus:function(){return!!this.C_.focus&&this.C_.focus()},getValue:function(){return this.C_.getValue?this.C_.getValue():this.C_.getValues?this.C_.getValues():void 0},getBody:function(){return this.C_},$skin:function(){this.A_=Qi.inputPadding,this.I_=Qi.inputSpacing,this.F_=Qi.labelTopHeight||15},$init:function(t){if(this.$ready.push(function(){var t=this.nt.firstChild.childNodes[0];if(!this.q.label||!this.q.labelWidth)return t.style.display="none",void(this.q.paddingX=this.q.paddingY=0);"top"==this.q.labelPosition?(t.style.lineHeight=this.F_-this.A_+"px",t.className+=" "+this.defaults.$cssName+"_label_top"):t.style.width=this.q.paddingX+"px",t.style.textAlign=this.q.labelAlign,this.q.value&&this.setValue(this.q.value)}),"top"!=t.labelPosition){var i=D(t.labelWidth)?this.defaults.labelWidth:t.labelWidth;t.paddingX=i-2*this.A_+2*this.I_}else t.paddingY=this.F_},setBottomText:function(t){var i=this.q;if(void 0!==t){if(i.bottomLabel==t)return;i.bottomLabel=t}var s=(i.invalid?i.invalidMessage:"")||i.bottomLabel;this.T_&&G(this.T_),s&&(this.$view.style.position="relative",this.T_=Y("div",{"class":"webix_inp_bottom_label",role:i.invalid?"alert":"","aria-relevant":"all",style:"position:absolute; bottom:0px; padding:2px; background: white; left:"+this.q.labelWidth+"px; "},s),this.nt.appendChild(this.T_))}};H.protoUI(ch,uh.view);function fh(t){return t.tagName?t.tagName.toLowerCase():null}function lh(t,i){if(!t.getAttribute)return null;var s=t.getAttribute(i);return s?s.toLowerCase():null}function dh(){var t=fh(this);return vh[t]?vh[t](this):vh.other(this)}var vh={radio:function(t){for(var i=0;i<t.length;i++)if(t[i].checked)return t[i].value;return""},
input:function(t){return"checkbox"===lh(t,"type")?t.checked:t.value},textarea:function(t){return t.value},select:function(t){var i=t.selectedIndex;return t.options[i].value},other:function(t){return t.innerHTML}};function _h(t){var i=fh(this);return ph[i]?ph[i](this,t):ph.other(this,t)}var ph={radio:function(t,i){for(var s=0;s<t.length;s++)t[s].checked=t[s].value==i},input:function(t,i){"checkbox"===lh(t,"type")?t.checked=!!i:t.value=i},textarea:function(t,i){t.value=i},select:function(t,i){t.value=i||(t.firstElementChild.value||i)},other:function(t,i){t.innerHTML=i}},mh={name:"htmlform",$init:function(t){this.elements={},this.z_=!1,t.content&&(t.container==t.content||!t.container&&t.content==document.body)&&(this.V_=!0)},content_setter:function(t){if(t=A(t),this.V_)for(;1<t.childNodes.length;)this.nt.childNodes[0].appendChild(t.childNodes[0]);else this.nt.childNodes[0].appendChild(t);return this.H_(),!0},render:function(){Vn.api.render.apply(this,arguments),this.H_()},H_:function(){var t=this.nt.querySelectorAll("[name]");this.elements={};for(var i=0;i<t.length;i++){var s=t[i],e=lh(s,"name");if(e){var n="button"===fh(s),h=lh(s,"type"),r=n||"button"===h||"submit"===h;if("radio"===h){var o=this.elements[e]||[];o.tagName="radio",o.push(s),s=o}(this.elements[e]=s).getValue=dh,s.setValue=_h,s.$allowsClear=!r}}return this.elements},Uh:function(t,i){this.Eh(t,i);var s=this.nt.querySelector('[name="'+t+'"]');s&&st(s,"invalid")},Eh:function(t){var i=this.nt.querySelector('[name="'+t+'"]');i&&et(i,"invalid")}},bh=(H.protoUI(mh,Vn.view,$e),{name:"property",$init:function(){this.re.className+=" webix_property",this.re.setAttribute("role","listbox"),this.rt=[],this.attachEvent("onAfterEditStart",function(t){st(this.getItemNode(t),"webix_focused")}),this.attachEvent("onAfterEditStop",function(t,i){et(this.getItemNode(i.config.id),"webix_focused")})},defaults:{nameWidth:100,editable:!0},on_render:{checkbox:function(t){return"<input type='checkbox' class='webix_property_check' "+(t?"checked":"")+">"},color:function(t){return'<div class="webix_property_col_val"><div class=\'webix_property_col_ind\' style="background-color:'+(t||"#FFFFFF")+';"></div><span>'+t+"</span></div>"}},on_edit:{label:!1},za:"webix_f_id",on_click:{webix_property_check:function(t){var i=this.locate(t);return this.getItem(i).value=!this.getItem(i).value,this.callEvent("onCheck",[i,this.getItem(i).value]),!1}},on_dblclick:{},registerType:function(t,i){if(i.template&&(this.on_render[t]=i.template),i.editor&&(this.on_edit[t]=i.editor),i.click)for(var s in i.click)this.on_click[s]=i.click[s]},elements_setter:function(t){this.B_={};for(var i=0;i<t.length;i++){var s=t[i];"multiselect"==s.type&&(s.optionslist=!0),s.id=s.id||z(),s.label=s.label||"",s.value=s.value||"",this.B_[s.id]=i,this.template=this.tu(t[i])}return t},showItem:function(t){Js.showItem.call(this,t)},locate:function(){return J(arguments[0],this.za)},getItemNode:function(t){return this.bt.childNodes[this.B_[t]]},getItem:function(t){return this.q.elements[this.B_[t]]},Zo:function(t){var i=this.getItem(t).type;if("checkbox"==i)return"inline-checkbox";var s=this.on_edit[i];return!1!==s&&(s||i)},sa:function(t){return this.getItem(t)},fa:function(t,i,s){var e=this.B_[t.id],n=this.q.elements;if(s){for(var h=e+1;h<n.length;h++)if(i.call(this,n[h].id))return n[h].id}else for(var r=e-1;0<=r;r--)if(i.call(this,n[r].id))return n[r].id;return null},updateItem:function(t,i){i=i||{};var s=this.getItem(t);s&&H.extend(s,i,!0),this.refresh()},Wt:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft+this.q.nameWidth,top:i.offsetTop,height:i.firstChild.offsetHeight,width:this.R_,parent:this.re}},P_:function(){for(var t=this.q.elements,i=0;i<t.length;i++)t[i].value=""},clear:function(){this.P_(),this.j_={},this.refresh()},setValues:function(t,i){for(var s in this.q.complexData&&(t=yt.collapseNames(t)),i||this.P_(),t){var e=this.getItem(s);e&&(e.value=t[s])}this.j_=t,this.refresh()},getValues:function(){for(var t=f(this.j_||{}),i=0;i<this.q.elements.length;i++){var s=this.q.elements[i];"label"!=s.type&&(t[s.id]=s.value)
}return this.q.complexData&&(t=yt.expandNames(t)),t},refresh:function(){this.render()},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&(this.R_=this.ze-this.q.nameWidth,this.render())},$getSize:function(t,i){if(this.q.autoheight){var s=this.q.elements.length;this.q.height=Math.max(this.type.height*s,this.q.minHeight||0)}return Gi.api.$getSize.call(this,t,i)},Lt:function(){var t=[],i=this.q.elements;if(i)for(var s=0;s<i.length;s++){var e=i[s];e.css&&"object"==k(e.css)&&(e.css=L(e.css));var n='<div webix_f_id="'+e.id+'"'+("label"!==e.type?'role="option" tabindex="0"':"")+' class="webix_property_line '+(e.css||"")+'">';if("label"==e.type)t[s]=n+"<div class='webix_property_label_line'>"+e.label+"</div></div>";else{var h,r=this.on_render[e.type],o="<div class='webix_property_label' style='width:"+this.q.nameWidth+"px'>"+e.label+"</div><div class='webix_property_value' style='width:"+this.R_+"px'>";h=e.collection||e.options?e.template(e,e.value):e.format?e.format(e.value):e.value,r&&(h=r.call(this,e.value,e)),t[s]=n+o+h+"</div></div>"}}return t.join("")},type:{height:24,templateStart:Ft(""),templateEnd:Ft("</div>")},$skin:function(){this.type.height=Qi.propertyItemHeight}}),gh=(H.protoUI(bh,Ki,Vs,Os,Us,Ks,Xi,vi,g,Gi.view),{name:"calendar",defaults:{date:new Date,select:!1,navigation:!0,monthSelect:!0,weekHeader:!0,weekNumber:!1,skipEmptyWeeks:!1,calendarHeader:"%F %Y",calendarWeekHeader:"W#",events:en.isHoliday,minuteStep:5,timeIcon:"wxi-clock",icons:!1,timepickerHeight:30,headerHeight:70,dayTemplate:function(t){return t.getDate()},width:260,height:250},dayTemplate_setter:Ft,calendarHeader_setter:en.dateToStr,calendarWeekHeader_setter:en.dateToStr,calendarTime_setter:function(t){return this.N_=t,en.dateToStr(t)},date_setter:function(t){return this.xd(t)},maxDate_setter:function(t){return this.xd(t)},minDate_setter:function(t){return this.xd(t)},minTime_setter:function(t){return"string"==typeof t&&(t=[(t=ct.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},maxTime_setter:function(t){return"string"==typeof t&&(t=[(t=ct.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},E_:function(){var t="focus"+(S.isIE?"in":"");S.touch||Lt(this.$view,t,C(function(t){var i=t.target.className,s=-1!==i.indexOf("webix_cal_day")?"webix_cal_day":-1!==i.indexOf("webix_cal_block")?"webix_cal_block":"";if(300<new Date-Vi.ks&&100<new Date-Vi.Cs&&s){var e=t.relatedTarget;if(e&&!D(e.className)){var n="webix_cal_day"==s?this.L_(t.target):this.O_(t.target);this.Ia(n)}}},this),{capture:!S.isIE})},$init:function(){this.nt.className+=" webix_calendar",this.nt.setAttribute("role","region"),this.nt.setAttribute("aria-label",ct.aria.calendar),this.U_={},this.Y_={},this.fd=0,this.E_(),this.attachEvent("onKeyPress",this.je),this.attachEvent("onAfterZoom",function(t){0<=t&&this.$view.querySelector(".webix_cal_month_name").blur()})},type_setter:function(t){return"time"==t?(this.W_=!0,this.fd=-1):"year"==t&&(this.G_=!0),t},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&this.render()},$getSize:function(t,i){if(this.q.cellHeight){var s=this.X_(this.q.date);this.q.height=this.q.cellHeight*s.J_+(Qi.calendarHeight||70)}return Gi.api.$getSize.call(this,t,i)},moveSelection:function(t,i,s){if(!this.config.master){var e=this.getSelectedDate();this.config.multiselect&&(e=e[0]);var n=en.copy(e||this.getVisibleDate());this.Ia(n,t,s)}},Ia:function(t,i,s){var e=this.Td[this.fd].K_(t,i,this);if(!1!==s){var n=this.nt.querySelector("."+e+"[tabindex='0']");n&&n.focus()}},X_:function(t,i){if(!this.q_||i){var s=t.getMonth(),e=t.getFullYear(),n=new Date(e,s+1,1),h=en.weekStart(new Date(e,s,1)),r=Math.round((n.valueOf()-h.valueOf())/864e5),o=this.q.skipEmptyWeeks?Math.ceil(r/7):6;this.q_={Z_:s,Q_:h,ql:n,J_:o}}return this.q_},$skin:function(){Qi.calendar&&(Qi.calendar.width&&(this.defaults.width=Qi.calendar.width),Qi.calendar.height&&(this.defaults.height=Qi.calendar.height),Qi.calendar.headerHeight&&(this.defaults.headerHeight=Qi.calendar.headerHeight),Qi.calendar.timepickerHeight&&(this.defaults.timepickerHeight=Qi.calendar.timepickerHeight))},tp:function(t){for(
var i=this.X_(t),s=this.q,e=[],n=[],h=Infinity,r=this.ze-36,o=this.He-this.q.headerHeight-10-(this.q.timepicker||this.yd?this.q.timepickerHeight:0),a=s.weekNumber?8:7,u=0;u<a;u++)n[u]=Math.ceil(r/(a-u)),r-=n[u],h=Math.min(h,n[u]);for(var c=i.J_,f=0;f<c;f++)e[f]=Math.ceil(o/(c-f)),o-=e[f],h=Math.min(h,e[f]);return[n,e,h]},icons_setter:function(t){t?"object"==k(t)?this.yd=t:this.yd=this.ip:this.yd=null},yd:[],ip:[{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+ct.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date;this.q.timepicker||(t=en.datePart(t)),this.setValue(t),this.callEvent("onTodaySet",[this.getSelectedDate()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+ct.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue(""),this.callEvent("onDateClear",[this.getSelectedDate()])}}}],refresh:function(){this.render()},render:function(){this.fd=0,this.sp=!1;var t=this.q;if(this.isVisible(t.id)){this.ep=en.datePart(new Date),this.callEvent("onBeforeRender",[]);var i=this.q.date,s=this.X_(i,!0),e=this.tp(i),n=e[0],h=e[1],r="<div class='webix_cal_month'><span role='button' tabindex='0' aria-live='assertive' aria-atomic='true' class='webix_cal_month_name"+(this.q.monthSelect?"":" webix_readonly")+"'>"+t.calendarHeader(i)+"</span>";if(t.navigation&&(r+="<div role='button' tabindex='0' aria-label='"+ct.aria.navMonth[0]+"' class='webix_cal_prev_button'></div><div role='button' tabindex='0' aria-label='"+ct.aria.navMonth[1]+"' class='webix_cal_next_button'></div>"),r+="</div>",t.weekHeader&&(r+="<div class='webix_cal_header' aria-hidden='true'>"+this.np(n)+"</div>"),r+="<div class='webix_cal_body'>"+this.hp(n,h,s,e[2])+"</div>",(this.q.timepicker||this.yd)&&(r+="<div class='webix_cal_footer'>",this.q.timepicker&&(r+=this.rp(i)),this.yd&&(r+=this.Md()),r+="</div>"),this.re.innerHTML=r,"time"==this.q.type){var o=this.q.date;o&&("string"==typeof o?i=ct.parseTimeFormatDate(o):b(o)&&(i.setHours(o[0]),i.setMinutes(o[1]))),this.op(-1,i)}else"month"==this.q.type?this.op(1,i):"year"==this.q.type&&this.op(2,i);this.callEvent("onAfterRender",[])}},Md:function(t){for(var i="<div class='webix_cal_icons'>",s=this.yd,e=0;e<s.length;e++){if(s[e].template){var n="function"==typeof s[e].template?s[e].template:n(s[e].template);i+=n.call(this,t)}s[e].on_click&&H.extend(this.on_click,s[e].on_click)}return i+="</div>"},rp:function(t){var i=this.q.calendarTime||ct.timeFormatStr,s=this.q.timeIcon,e="";if(this.q.master){var n=B(jt(this.q.master).q.value);for(var h in en.equal(n.end,t)&&(n.start=n.end),n)e+="<div role='button' tabindex='0' class='webix_range_time_"+h+" webix_cal_time'><span class='webix_icon "+s+"'></span> "+i(n[h])+"</div>"}else e="<div role='button' tabindex='0' class='webix_cal_time"+(this.yd?" webix_cal_time_icons":"")+"'><span class='webix_icon "+s+"'></span> "+i(t)+"</div>";return e},np:function(t){var i=this.q,s="",e=0;i.weekNumber&&(e=1,s+="<div class='webix_cal_week_header' style='width: "+t[0]+"px;' >"+i.calendarWeekHeader()+"</div>");for(var n=en.startOnMonday?1:0,h=0;h<7;h++){var r=(n+h)%7,o=ct.calendar.dayShort[r];s+="<div day='"+r+"' style='width: "+t[h+e]+"px;' >"+o+"</div>"}return s},blockDates_setter:function(t){return m(t,this.$scope)},ap:function(t,i){var s="",e=!1;return en.equal(t,this.ep)&&(s+=" webix_cal_today"),this.cp(t)||(s+=" webix_cal_day_disabled"),t.getMonth()!=i.Z_&&(e=!0,s+=" webix_cal_outside"),!e&&this.fp(t)&&(s+=" webix_cal_select"),this.q.events&&(s+=" "+(this.q.events(t,e)||"")),s+=" webix_cal_day"},hp:function(t,i,s,e){for(var n=this.q,h="",r=en.datePart(en.copy(s.Q_)),o=n.weekNumber?1:0,a=en.getISOWeek(en.add(r,2,"day",!0)),u=0;u<i.length;u++){h+="<div class='webix_cal_row' style='height:"+i[u]+"px;line-height:"+i[u]+"px'>",o&&(!r.getMonth()&&r.getDate()<7&&(a=en.getISOWeek(en.add(r,2,"day",!0))),h+="<div class='webix_cal_week_num' aria-hidden='true' style='width:"+t[0]+"px'>"+a+"</div>");for(var c=o;c<t.length;c++){
var f=this.ap(r,s),l=this.q.dayTemplate.call(this,r),d=this.fp(r),v="",_=r.getMonth()!=s.Z_;"object"==k(l)?(v=l.aria||v,l=l.text):v=en.dateToStr(ct.aria.dateFormat)(r),h+="<div day='"+c+"' role='gridcell' "+(_?"aria-hidden='true'":"")+" aria-label='"+v+"' tabindex='"+(d&&!_?"0":"-1")+"' aria-selected='"+(d&&!_?"true":"false")+"' class='"+f+"' style='text-align:center; width:"+t[c]+"px'><span aria-hidden='true' class='webix_cal_day_inner' style='display:inline-block; "+this.lp(e,e)+"'>"+l+"</span></div>",(r=en.add(r,1,"day")).getHours()&&(r=en.datePart(r))}h+="</div>",a++}return h},Vd:function(t,i){var s=this.q.date;i||(i=this.Td[this.fd].Fd),this.fd||(s=en.copy(s)).setDate(1);var e=en.add(s,t*i,"month",!0);this.vp(s,e)},vp:function(t,i){this.callEvent("onBeforeMonthChange",[t,i])&&(this.fd?this._p(i):this.showCalendar(i),this.callEvent("onAfterMonthChange",[i,t]))},Td:{"-2":{pp:function(t){var i=this.q,s=i.date,e=!1,n=i.minTime?i.minTime[0]:0,h=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24,r=i.minTime&&s.getHours()==n?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&s.getHours()==h-1?i.maxTime[1]:60;if(this.q.blockTime){var a=en.copy(s);a.setMinutes(t),e=this.q.blockTime(a)}return t<r||o<=t||e},mp:function(t,i){t.setMinutes(i)},bp:function(t,i,s){if(!this.pp.call(s,t.getMinutes()))return t;var e=s.q.minuteStep,n=en.add(t,"right"==i?e:-e,"minute",!0);return t.getHours()===n.getHours()?this.bp(n,i,s):void 0}},"-1":{pp:function(t){var i=this.q,s=i.date,e=i.minTime?i.minTime[0]:0,n=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24;if(t<e||n<=t)return!0;if(i.blockTime){var h=en.copy(s);h.setHours(t);for(var r=i.minTime&&t==e?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&t==n-1?i.maxTime[1]:60,a=r;a<o;a+=i.minuteStep)if(h.setMinutes(a),!i.blockTime(h))return!1;return!0}},mp:function(t,i){t.setHours(i)},K_:function(t,i,s){var e,n,h=s.q.minuteStep;return"bottom"===i||"top"===i?(t.setHours("bottom"===i?23:0),t.setMinutes("bottom"===i?55:0),t.setSeconds(0),t.setMilliseconds(0),e=t):"left"===i||"right"===i?(n="right"===i?h:-h,"left"===i&&t.getMinutes()<h&&(n=60-h),"right"===i&&t.getMinutes()>=60-h&&(n=h-60),n-=t.getMinutes()%h,e=s.Td[-2].bp(en.add(t,n,"minute"),i,s)):"up"===i||"down"===i?(n="down"===i?1:-1,"down"===i&&23===t.getHours()&&(n=-23),"up"===i&&0===t.getHours()&&(n=23),e=this.bp(en.add(t,n,"hour"),i,s)):!1===i&&(e=this.bp(t,i,s)),s.selectDate(e,!1),e&&(s._p(e),s.selectDate(e,!1)),"webix_cal_block"+("left"===i||"right"===i?"_min":"")},bp:function(t,i,s){if(!this.pp.call(s,t.getHours()))return t;var e=en.add(t,"down"==i?1:-1,"hour",!0);return t.getDate()===e.getDate()?this.bp(e,i,s):void 0}},0:{Fd:1,K_:function(t,i,s){var e=t;return"pgup"===i||"pgdown"===i?e=en.add(t,"pgdown"===i?1:-1,"month"):"bottom"===i?e=new Date(t.getFullYear(),t.getMonth()+1,0):"top"===i?e=new Date(t.setDate(1)):"left"===i||"right"===i?e=en.add(t,"right"===i?1:-1,"day"):"up"!==i&&"down"!==i||(e=en.add(t,"down"===i?1:-1,"week")),s.cp(e)||(e=s.bp(t,i)),e&&s.selectDate(e,!0),"webix_cal_day"}},1:{pp:function(t,i){var s,e,n=!1,h=i.q.minDate||null,r=i.q.maxDate||null,o=i.q.date.getFullYear();return h&&r&&(s=h.getFullYear(),e=r.getFullYear(),(o<s||o==s&&h.getMonth()>t||e<o||o==e&&r.getMonth()<t)&&(n=!0)),n},Bf:function(t,i){return t<i.q.minDate?t=en.copy(i.q.minDate):t>i.q.maxDate&&(t=en.copy(i.q.maxDate)),t},gp:function(t){return t.getFullYear()},wp:function(t){return ct.calendar.monthShort[t]},mp:function(t,i){i!=t.getMonth()&&t.setDate(1),t.setMonth(i)},Fd:12,K_:function(t,i,s){var e=t;return"pgup"===i||"pgdown"===i?e=en.add(t,"pgdown"===i?1:-1,"year"):"bottom"===i?e=new Date(t.setMonth(11)):"top"===i?e=new Date(t.setMonth(0)):"left"===i||"right"===i?e=en.add(t,"right"===i?1:-1,"month"):"up"!==i&&"down"!==i||(e=en.add(t,"down"===i?4:-4,"month")),s.cp(e)||(e=s.bp(t,i)),e&&(s._p(e),s.selectDate(e,!1)),"webix_cal_block"}},2:{pp:function(t,i){t+=i.xp;var s=!1,e=i.q.minDate,n=i.q.maxDate;return e&&n&&(e.getFullYear()>t||n.getFullYear()<t)&&(s=!0),s},Bf:function(t,i){return t<i.q.minDate?t=en.copy(i.q.minDate):t>i.q.maxDate&&(t=en.copy(i.q.maxDate)),t},gp:function(t,i){
var s=t.getFullYear();return i.xp=s=s-s%10-1,s+" - "+(s+10+1)},wp:function(t,i){return i.xp+t},mp:function(t,i,s){t.setFullYear(s.xp+i)},Fd:120,K_:function(t,i,s){var e=t;return"pgup"===i||"pgdown"===i?e=en.add(t,"pgdown"===i?10:-10,"year"):"bottom"===i?e=new Date(t.setYear(s.xp+10)):"top"===i?e=new Date(t.setYear(s.xp)):"left"===i||"right"===i?e=en.add(t,"right"===i?1:-1,"year"):"up"!==i&&"down"!==i||(e=en.add(t,"down"===i?4:-4,"year")),s.cp(e)||(e=s.bp(t,i)),e&&(s._p(e),s.selectDate(e,!1)),"webix_cal_block"}}},yp:function(){var t;if(this.Td[-1].pp.call(this,this.q.date.getHours()))for(t=0;t<24;t++)if(!this.Td[-1].pp.call(this,t)){this.q.date.setHours(t);break}if(this.Td[-2].pp.call(this,this.q.date.getMinutes()))for(t=0;t<60;t+=this.q.minuteStep)if(!this.Td[-2].pp.call(this,t)){this.q.date.setMinutes(t);break}},_p:function(t){var i,s,e,n,h,r,o,a,u,c,f,l,d="";if(h=(i=this.q).weekHeader?2:1,c=this.Td[this.fd],r=this.re.childNodes,t&&(i.date=t),a=i.type,this.sp||(this.Mp=this.re.offsetHeight-i.headerHeight,"year"!=a&&"month"!=a?this.Mp-=i.timepickerHeight:this.yd&&(this.Mp-=10),this.Sp=r[h].offsetWidth,this.sp=1),this.W_){e=this.Mp/6;var v=6,_=(this.N_||ct.timeFormat).match(/%([a,A])/);for(_&&v++,u=parseInt((this.Sp-3)/v,10),l=Math.min(u,e),d+="<div class='webix_time_header'>"+this.kp(u,_)+"</div>",d+="<div  class='webix_cal_body' style='height:"+this.Mp+"px'>",this.yp(),d+="<div class='webix_hours'>",o=i.date.getHours(),f=en.copy(i.date),n=0;n<24;n++){if(s="",_&&n%4==0){var p=n?12==n?ct.pm[0]:"":ct.am[0];d+="<div class='webix_cal_block_empty"+s+"' style='"+this.lp(u,e)+"clear:both;'>"+p+"</div>"}this.Td[-1].pp.call(this,n)?s+=" webix_cal_day_disabled":o==n&&(s+=" webix_selected"),f.setHours(n),d+="<div aria-label='"+en.dateToStr(ct.aria.hourFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block"+s+"' data-value='"+n+"' style='"+this.lp(u,e)+(n%4!=0||_?"":"clear:both;")+"'><span style='display:inline-block; "+this.lp(l,l)+"'>"+en.toFixed(_?n&&12!=n?n%12:12:n)+"</span></div>"}for(d+="</div>",d+="<div class='webix_minutes'>",o=i.date.getMinutes(),f=en.copy(i.date),n=0;n<60;n+=i.minuteStep)s="",this.Td[-2].pp.call(this,n)?s=" webix_cal_day_disabled":o==n&&(s=" webix_selected"),f.setMinutes(n),d+="<div aria-label='"+en.dateToStr(ct.aria.minuteFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block webix_cal_block_min"+s+"' data-value='"+n+"' style='"+this.lp(u,e)+(n%2==0?"clear:both;":"")+"'><span style='display:inline-block; "+this.lp(l,l)+"'>"+en.toFixed(n)+"</span></div>";d+="</div>",d+="</div>",d+="<div  class='webix_time_footer'>"+this.Cp()+"</div>",this.re.innerHTML=d}else{var m=r[0].childNodes,b=ct.aria["nav"+(1==this.fd?"Year":"Decade")];for(m[0].innerHTML=c.gp(i.date,this),m[1].setAttribute("aria-label",b[0]),m[2].setAttribute("aria-label",b[1]),e=Math.floor(this.Mp/3),u=Math.floor(this.Sp/4),l=Math.min(e,u),this.cp(i.date)&&(o=1==this.fd?i.date.getMonth():i.date.getFullYear()),n=0;n<12;n++){s=o==(1==this.fd?n:c.wp(n,this))?" webix_selected":"",c.pp(n,this)&&(s+=" webix_cal_day_disabled");var g=ct.aria[(1==this.fd?"month":"year")+"Format"];d+="<div role='gridcell' aria-label='"+en.dateToStr(g)(i.date)+"' tabindex='"+(-1!==s.indexOf("selected")?"0":"-1")+"' aria-selected='"+(-1!==s.indexOf("selected")?"true":"false")+"' class='webix_cal_block"+s+"' data-value='"+n+"' style='"+this.lp(u,e)+"'><span style='display:inline-block; "+this.lp(l,l)+"'>"+c.wp(n,this)+"</span></div>"}h-1&&(r[h-1].style.display="none"),r[h].innerHTML=d,"year"!=a&&"month"!=a&&(r[h+1]?r[h+1].innerHTML=this.Cp():this.re.innerHTML+="<div  class='webix_time_footer'>"+this.Cp()+"</div>"),r[h].style.height=this.Mp+"px"}},lp:function(t,i){return"width:"+t+"px; height:"+i+"px; line-height:"+i+"px;"},Cp:function(){return"<input type='button' style='width:100%' class='webix_cal_done' value='"+ct.calendar.done+"'>"},kp:function(t,i){var s=2*t;return"<div class='webix_cal_hours' style='width:"+t*(i?5:4
)+"px'>"+ct.calendar.hours+"</div><div class='webix_cal_minutes' style='width:"+s+"px'>"+ct.calendar.minutes+"</div>"},op:function(t,i){var s=this.fd;this.callEvent("onBeforeZoom",[t,s])&&((this.fd=t)?this._p(i):this.showCalendar(i),this.callEvent("onAfterZoom",[t,s]))},Bf:function(t){return!this.cp(t)&&this.Td[this.fd].Bf&&(t=this.Td[this.fd].Bf(t,this)),t},Dp:function(t){var i=this.O_(t),s=this.fd-(this.G_?0:1);if(i=this.Bf(i),this.cp(i)){this.op(s,i);var e=this.q.type;"month"!=e&&"year"!=e||this.$p(i)}},$p:function(t,i){this.callEvent("onBeforeDateSelect",[t])&&(this.selectDate(t,!0,i),this.callEvent("onDateSelect",[t]),this.callEvent("onAfterDateSelect",[t]))},L_:function(t){var i=E(t)-(this.q.weekNumber?1:0),s=E(t.parentNode),e=en.add(this.X_().Q_,i+7*s,"day",!0);return this.q.timepicker&&(e.setHours(this.q.date.getHours()),e.setMinutes(this.q.date.getMinutes())),e},O_:function(t){var i=1*t.getAttribute("data-value"),s=-1!=t.className.indexOf("webix_cal_block_min")?this.fd-1:this.fd,e=this.q.date,n=en.copy(e);return this.Td[s].mp(n,i,this),n},on_click:{webix_cal_prev_button:function(){this.Vd(-1)},webix_cal_next_button:function(){this.Vd(1)},webix_cal_day_disabled:function(){return!1},webix_cal_outside:function(){if(!this.q.navigation)return!1},webix_cal_day:function(t,i,s){var e=this.L_(s),n="touch"===this.q.multiselect||t.ctrlKey||t.metaKey;this.$p(e,n)},webix_cal_time:function(){if(this.Td[this.fd-1]){this.W_=!0;var t=this.fd-1;this.op(t)}},webix_range_time_start:function(){jt(this.q.master).Id="start"},webix_range_time_end:function(){jt(this.q.master).Id="end"},webix_cal_done:function(){var t=en.copy(this.q.date);t=this.Bf(t),this.$p(t)},webix_cal_month_name:function(){if(this.W_=!1,2!=this.fd&&this.q.monthSelect){var t=Math.max(this.fd,0)+1;this.op(t)}},webix_cal_block:function(t,i,s){if(this.W_){if(-1!==s.className.indexOf("webix_cal_day_disabled"))return!1;var e=this.O_(s);this._p(e)}else-1==s.className.indexOf("webix_cal_day_disabled")&&this.Dp(s)}},xd:function(t,i){return t?("string"==typeof t&&(t=i?en.strToDate(i)(t):ct.parseFormatDate(t)),t):en.datePart(new Date)},cp:function(t){var i=this.q.blockDates&&this.q.blockDates.call(this,t),s=this.q.minDate,e=this.q.maxDate;return!i&&!(t<s||e<t)},bp:function(t,i){var s,e="top"===i||"left"===i||"pgup"===i||"up"===i?-1:1,n=en.add(t,e,"day",!0);return this.cp(n)?n:(0===this.fd?s=t.getMonth()===n.getMonth():1===this.fd?s=t.getFullYear()===n.getFullYear():2===this.fd&&(s=n.getFullYear()>this.xp&&n.getFullYear()<this.xp+10),s?this.bp(n,i):void 0)},showCalendar:function(t){t=this.xd(t),this.q.date=t,this.render(),this.resize()},fp:function(t){return t&&this.Y_[t.valueOf()]},getSelectedDate:function(){var t=[];for(var i in this.Y_)t.push(en.copy(this.Y_[i]));return this.config.multiselect?t:t[0]||null},getVisibleDate:function(){return en.copy(this.q.date)},setValue:function(t){this.selectDate(t,!0)},getValue:function(t){var i=this.getSelectedDate();return t&&(i=en.dateToStr(t)(i)),i},selectDate:function(t,i,s){if(t&&s&&this.config.multiselect||(this.Y_={}),t){b(t)||(t=[t]);for(var e=0;e<t.length;e++){var n=this.xd(t[e]),h=en.datePart(en.copy(n)).valueOf();if(this.Y_[h]&&s?delete this.Y_[h]:this.Y_[h]=n,!this.config.multiselect)break}t.length&&i&&this.showCalendar(t[0])}!1!==i&&this.render(),this.callEvent("onChange",[t])},locate:function(){return null}}),wh=(H.protoUI(gh,Ls,Us,Gi.view,g),{name:"colorboard",defaults:{template:'<div style="width:100%;height:100%;background-color:{obj.val}"></div>',palette:null,height:220,width:220,cols:12,rows:10,minLightness:.15,maxLightness:1,navigation:!0},$init:function(){Lt(this.nt,"click",C(function(t){var i=J(t,"webix_val");this.setValue(i),this.callEvent("onItemClick",[this.q.value,t]),this.callEvent("onSelect",[this.q.value])},this)),this.$view.setAttribute("role","grid"),this.nt.setAttribute("aria-readonly","true")},La:function(){this.getValue()||this.moveSelection("up")},Ap:function(t){var i=this.q.palette;t=(t||"").toUpperCase();for(var s=0,e=i.length;s<e;s++)for(var n=0,h=i[s].length;n<h;n++)if(i[s][n].toUpperCase()==t
)return{row:s,col:n};return null},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.q.value},Kc:function(){return this.nt.firstChild},setValue:function(t){t&&"#"!=t.toString().charAt(0)&&(t="#"+t);var i=this.q.value;return this.q.value=t,this.$setValue(t,i),t},Ip:null,Fp:function(){if(this.Ip&&this.Ip.parentNode)return this.Ip;var t=this.Ip=document.createElement("div");return t.className="webix_color_selector",this.nt.lastChild.appendChild(t),t},$setValue:function(t,i){if(this.isVisible(this.q.id)){var s,e,n,h,r,o=0,a=0;if(i&&(n=this.Ap(i)),n||(n={row:0,col:0}),this.nt.lastChild.childNodes[n.row].childNodes[n.col].setAttribute("tabindex","-1"),(n=this.Ap(t))&&(s=this.nt.lastChild.childNodes[n.row].childNodes[n.col]),!(s&&s.parentNode&&s.parentNode.parentNode))return this.Ip&&(this.Ip.style.left="-100px"),void this.nt.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0");h=s.parentNode,o=s.offsetLeft-h.offsetLeft,a=-(this.$height-(s.offsetTop-h.parentNode.offsetTop)),s.setAttribute("tabindex","0"),s.setAttribute("aria-selected","true"),s.setAttribute("tabindex","0"),s.setAttribute("aria-selected","true"),e=this.Fp(),r=["left:"+o+"px","top:"+a+"px","width:"+s.style.width,"height:"+s.style.height].join(";"),"undefined"!=typeof e.style.cssText?e.style.cssText=r:e.setAttribute("style",r)}},Tp:function(t){function e(t){return Zs.toHex(t,2)}function h(t,i,s){return"#"+e(Math.floor(t))+e(Math.floor(i))+e(Math.floor(s))}function i(t,i,s){var e,n,h;if(i){var r=s<.5?s*(1+i):s+i-s*i,o=2*s-r;e=a(o,r,t+1/3),n=a(o,r,t),h=a(o,r,t-1/3)}else e=n=h=s;return{r:255*e,g:255*n,b:255*h}}function a(t,i,s){return s<0&&(s+=1),1<s&&(s-=1),s<1/6?t+6*(i-t)*s:s<=.5?i:s<2/3?t+(i-t)*(2/3-s)*6:t}var s=[],n=t.rows-1,r=1/t.cols,o=(t.maxLightness-t.minLightness)/n,u=null;s.push(function _(t){for(var i=[],s=255,e=s/t,n=0;n<t;n++)s=Math.round(0<s?s:0),i.push(h(s,s,s)),s-=e;return i[i.length-1]="#000000",i}(t.cols));for(var c=0,f=t.minLightness;c<n;c++){u=[];for(var l=0,d=0;l<t.cols;l++){var v=i(d,1,f);u.push(h(v.r,v.g,v.b)),d+=r}s.push(u),f+=o}this.q.palette=s},moveSelection:function(t,i,s){var e,n,h=this.getValue();if(h&&(e=this.Ap(h)),e||(e={row:0,col:0}),e&&("up"==t||"down"==t?e.row=e.row+("up"==t?-1:1):"right"==t||"left"==t?e.col=e.col+("right"==t?1:-1):"top"==t?e.row=e.col=0:"bottom"==t&&(e.row=this.nt.lastChild.querySelectorAll(".webix_color_row").length-1,e.col=this.nt.lastChild.childNodes[e.row].childNodes.length-1),e.row=Math.max(e.row,0),0<=e.row&&(n=this.nt.lastChild.childNodes[e.row].childNodes[e.col]),n&&(h=n.getAttribute("webix_val"),this.setValue(h),this.callEvent("onSelect",[this.q.value]),!1!==s))){var r=this.nt.querySelector("div[tabindex='0']");r&&r.focus()}},render:function(){if(this.isVisible(this.q.id)){this.q.palette||this.Tp(this.q);var t=this.q.palette;this.callEvent("onBeforeRender",[]);for(var h=Ft('<div role=\'gridcell\' tabindex=\'-1\' aria-label="{obj.val}" style="width:{obj.width}px;height:{obj.height}px;" webix_val="{obj.val}">'+(this.q.template||"")+"</div>"),r={width:0,height:0,val:0},i=this.$width,s=this.$height,e=[],n='<div class="webix_color_palette"role="rowgroup">',o="object"==k(t[0])?t[0]:t,a=0;a<o.length;a++)e[a]=Math.floor(i/(o.length-a)),i-=e[a];if("object"==k(t[0]))for(var u=0;u<t.length;u++){var c=Math.floor(s/(t.length-u));s-=c,n+=f(t[u],e,c)}else n+=f(t,e,s);n+="</div>",this.nt.innerHTML=n,this.Ip=null,this.q.value?this.$setValue(this.q.value):this.nt.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0"),this.callEvent("onAfterRender",[])}function f(t,i,s){for(var e='<div class="webix_color_row" role="row">',n=0;n<t.length;n++)r.width=i[n],r.height=s,r.val=t[n],e+=h(r);return e+="</div>"}},refresh:function(){this.render()}}),xh=(H.protoUI(wh,Ls,Gi.view,g),{name:"button",touchable:!0,$skin:function(){this.defaults.height=Qi.buttonHeight||Qi.inputHeight,this.F_=Qi.labelTopHeight||15,this.zp=Qi.borderWidth},defaults:{template:function(t,i){var s=i.$renderInput(t,i);return t.badge&&(s=s.replace("</button>",
"<span class='webix_badge'>"+t.badge+"</span></button>")),"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+s+"</div>"},label:"",borderless:!0},$renderInput:function(t){var i="class='webixtype_"+(t.type||"base")+"' ";return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+i+">"+Ft.escape(t.label||t.value)+"</button>"},$init:function(){this.nt.className+=" webix_control webix_el_"+(this.$cssName||this.name),this.data=this.q,this.bt=this.nt,this.$ready.push(function(){this.Vp(this.config)})},hotkey_setter:function(t){var s=this;this.Hp(t,function(t,i){s.isVisible()&&(it(s.$view.firstChild,"MouseEvents","click"),Q(i))})},Hp:function(t,i,s){var e=Vi.addHotKey(t,i,s);this.attachEvent("onDestruct",function(){Vi.removeHotKey(e,i,s)})},tooltip_setter:function(t){var i=this.Kc()||this.$view.firstChild;return i&&(i.title=t),t},type_setter:function(t){return this.ld[t]&&(this.$renderInput=Ft(this.ld[t])),this.Bp=("prev"==t||"next"==t)&&this.Rp,t},ld:{htmlbutton:"<button type='button' class='webix_el_htmlbutton webixtype_base'>#label#</button>",prev:"<input type='button' class='webixtype_prev' value='#label#' /><div class='webix_el_arrow webixtype_prev_arrow'></div>",next:"<input type='button' class='webixtype_next' value='#label#' /><div class='webix_el_arrow webixtype_next_arrow'></div>",imageButton:"<button type='button' class='webix_img_btn_abs webixtype_base' style='width:100%; line-height:#cheight#px'><div class='webix_image' style='width:#dheight#px;height:#dheight#px;background-image:url(#image#);'></div>#label#</button>",imageButtonTop:"<button type='button' class='webix_img_btn_abs webix_img_btn_abs_top webixtype_base'><div class='webix_image' style='width:100%;height:100%;background-image:url(#image#);'></div><div class='webix_img_btn_text'>#label#</div></button>",image:"<button type='button' class='webix_img_btn' style='line-height:#cheight#px;'><div class='webix_image' style='width:#cheight#px;height:#cheight#px;background-image:url(#image#);'></div>#label#</button>",imageTop:"<button type='button' class='webix_img_btn_top'><div class='webix_image' style='width:100%;height:100%;background-image:url(#image#);'></div><div class='webix_img_btn_text'>#label#</div></button>",icon:"<button type='button' class='webix_img_btn' style='line-height:#cheight#px;'><span class='webix_icon_btn #icon#' style='max-width:#cheight#px;'></span>#label#</button>",iconButton:"<button type='button' class='webix_img_btn_abs webixtype_base' style='width:100%;'><span class='webix_icon #icon#'></span>#label#</button>",iconTop:"<button type='button' class='webix_img_btn_top' style='width:100%;top:4px;text-align:center;'><span class='webix_icon #icon#'></span><div class='webix_img_btn_text'>#label#</div></button>",iconButtonTop:"<button type='button' class='webix_img_btn_abs webix_img_btn_abs_top webixtype_base' style='width:100%;top:0px;text-align:center;'><span class='webix_icon #icon#'></span><div class='webix_img_btn_text'>#label#</div></button>"},Pp:function(){for(var t=[],i=["input","select","textarea","button"],s=0;s<i.length;s++)for(var e=this.$view.getElementsByTagName(i[s]),n=0;n<e.length;n++)t.push(e[n]);return t},disable:function(){var t,i,s=this.Kc();if(Ui.api.disable.apply(this,arguments),s&&-1==s.className.indexOf(" webix_disabled_box")){s.className+=" webix_disabled_box";var e=this.Pp();for(t=0;t<e.length;t++)e[t].setAttribute("disabled",!0);if((i=this.getInputNode())&&"div"==i.tagName.toLowerCase()&&(this.jp=i.getAttribute("tabIndex"),i.removeAttribute("tabIndex")),"top"==this.q.labelPosition){var n=this.bt.firstChild;n&&(n.className+=" webix_disabled_top_label")}}},enable:function(){Ui.api.enable.apply(this,arguments);var t,i=this.Kc();if(i){i.className=i.className.replace(" webix_disabled_box","");for(var s=this.Pp(),e=0;e<s.length;e++)s[e].removeAttribute("disabled");if((t=this.getInputNode())&&!D(this.jp)&&t.setAttribute("tabIndex",this.jp),"top"==this.q.labelPosition){var n=this.bt.firstChild;n&&(n.className=n.className.replace(" webix_disabled_top_label",""))}}},$setSize:function(t,i
){Gi.api.$setSize.call(this,t,i)&&this.render()},setValue:function(t){t=this.$prepareValue(t);var i=this.q.value;if(this.$compareValue(i,t))return!1;this.q.value=t,this.Np&&this.$setValue(t),this.callEvent("onChange",[t,i])},$compareValue:function(t,i){return"number"==typeof i&&(i=i.toString()),"number"==typeof t&&(t=t.toString()),t==i},$prepareValue:function(t){return this.Ep(t,!1)},Ep:function(t){return 0===t?"0":(t||"").toString()},$setValue:function(t){var i=this.getInputNode();i&&("BUTTON"==i.tagName?i.innerHTML=t:i.value=t)},getValue:function(){var t=this.Np?this.$getValue():this.q.value;return void 0===t?"":t},$getValue:function(){return this.q.value||""},focus:function(){if(!Vi.canFocus(this))return!1;var t=this.getInputNode();t&&t.focus&&t.focus()},blur:function(){var t=this.getInputNode();t&&t.blur&&t.blur()},getInputNode:function(){return this.bt.getElementsByTagName("input")[0]||this.bt.getElementsByTagName("button")[0]},Kc:function(){for(var t=0;t<this.bt.childNodes.length;t++)if(0<=this.bt.childNodes[t].className.indexOf("webix_el_box"))return this.bt.childNodes[t];return null},Lp:Math.sqrt(2),Rp:function(){var t=this.q,i=this.Kc().childNodes[1],s=i.previousSibling,e="next"==t.type?"right":"left",n=t.aheight-2*Qi.inputPadding-2*this.zp,h=n*this.Lp/2;i.style.width=h+"px",i.style.height=h+"px",i.style.top=(n-h)/2+Qi.inputPadding+"px",i.style[e]=(n-h)/2+this.Lp/2+"px",s.style.width=t.awidth-n/2-2+"px",s.style.height=n+2+"px",s.style[e]=n/2+2+"px",s.style.top=Qi.inputPadding+"px"},Vp:function(t){(t=t||this.q).autowidth&&(t.width=nt(t.value||t.label||"","webixbutton").width+(t.badge?16:0)+("iconButton"===t.type||"icon"===t.type?24:0)+("imageButton"===t.type||"image"===t.type?t.height-Qi.inputPadding:0))},Op:function(){this.Up=this.q.inputWidth||(2<this.ze-this.q.width?this.q.width:0)||this.ze,this.Yp=this.q.inputHeight||this.Wp||0},resize:function(){return this.Vp(),Gi.api.resize.apply(this,arguments)},render:function(){if(this.Op(),this.q.awidth=this.Up||this.ze,this.q.aheight=this.Yp||this.He,this.q.bheight=this.q.aheight+2,this.q.cheight=this.q.aheight-2*Qi.inputPadding,this.q.dheight=this.q.cheight-2,_i.render.call(this)){if(this.Np=!0,this.Bp&&this.Bp(),this.q.align){var t=this.bt.firstChild;switch("top"==this.q.labelPosition&&t.nextSibling&&(t=t.nextSibling),this.q.align){case"right":t.style.cssFloat="right";break;case"center":t.style.display="inline-block",t.parentNode.style.textAlign="center";break;case"middle":t.style.marginTop=Math.round((this.He-this.Yp)/2)+"px";break;case"bottom":t.style.marginTop=this.He-this.Yp+"px";break;case"left":t.style.cssFloat="left";break;default:this.q.align}}this.$render&&this.$render(this.data),this.q.disabled&&this.disable(),this.q.tooltip&&this.define("tooltip",this.q.tooltip),this.Zn&&(this.Zn(this.data),this.Zn=0)}},refresh:function(){this.render()},on_click:{Gp:function(t){var i=J(t,"button_id");i&&this.callEvent("onBeforeTabClick",[i,t])&&(this.setValue(i),this.callEvent("onAfterTabClick",[i,t]))},webix_all_segments:function(t,i){this.on_click.Gp.call(this,t,i)},webix_all_tabs:function(t,i){this.on_click.Gp.call(this,t,i)},webix_inp_counter_next:function(){this.q.readonly||this.next()},webix_inp_counter_prev:function(){this.q.readonly||this.prev()},webix_input_icon:function(){this.getInputNode().focus()},webix_inp_checkbox_border:function(t){this.q.disabled||"DIV"==(t.target||t.srcElement).tagName||this.q.readonly||this.toggle()},webix_inp_checkbox_label:function(){this.q.readonly||this.toggle()},webix_inp_radio_border:function(t){var i=J(t,"radio_id");this.setValue(i),this.focus()},webix_inp_radio_label:function(t,i,s){return s=s.parentNode.getElementsByTagName("input")[0],this.on_click.webix_inp_radio_border.call(this,s,i,s)},webix_tab_more_icon:function(t,i,s){this.getPopup().resize(),this.getPopup().show(s,null,!0)},webix_tab_close:function(t){var i=J(t,"button_id");i&&this.callEvent("onBeforeTabClose",[i,t])&&this.removeOption(i)}},Xp:function(t){this.name;for(var i=0;i<t.length;i++)t[i].text,t[i].label,"string"==typeof t[i]?t[i]={id:t[i],value:t[i]}:(D(t[i].id
)&&(t[i].id=t[i].value),D(t[i].value)&&(t[i].value=t[i].id));return t},Jp:function(t){var i=t?t.placeholder:this.q.placeholder;return i?"<span class='webix_placeholder'>"+i+"</span>":""}}),yh={api:xh,view:H.protoUI(xh,Gi.view,_i,Hi,g)},Mh={name:"label",defaults:{template:"<div style='height:100%;line-height:#cheight#px'>#label#</div>"},$skin:function(){this.defaults.height=Qi.inputHeight},focus:function(){return!1},Kc:function(){return this.bt.firstChild},setHTML:function(t){this.q.template=function(){return t},this.refresh()},setValue:function(t){this.q.label=t,yh.api.setValue.apply(this,arguments)},$setValue:function(t){this.bt.firstChild.innerHTML=t},Bp:function(){},Vp:function(t){(t=t||this.q).autowidth&&(t.width=nt(t.value||t.label,"webix_el_label").width)}},Sh=(H.protoUI(Mh,yh.view),{});for(var kh in Vi.Ds)Sh[Vi.Ds[kh]]=kh;var Ch={9:"tab",38:"up",40:"down",37:"left",39:"right"},Dh={$init:function(t){var i=this.defaults.pattern||t.pattern,s=this.defaults.format||t.format;(i||s&&!this.format_setter)&&(this.attachEvent("onKeyPress",function(t,i){i.ctrlKey||i.altKey||this.Kp||(105<t&&t<112&&(t-=64),Sh[t]&&8!==t&&46!==t?Ch[t]||Q(i):(Q(i),this.qp(i,t)))}),this.attachEvent("onAfterRender",this.Zp),this.getText=function(){return this.getInputNode().value},this.Ep=function(t,i){return!1===i?this.Qp(t):this.tm(t)},s&&("object"===k(s)?this.Kp=s:(s=nn.getConfig(s),this.Kp={parse:function(t){return nn.parse(t,s)},edit:function(t){return nn.format(t,s)}})))},pattern_setter:function(t){var i=vn[t]||t;return"string"==typeof i&&(i={mask:i}),i.allow=i.allow||/[A-Za-z0-9]/g,this.im(i),i},sm:function(){this.config.validate=this.config.validate||C(function(){var t=this.getText(),i=t.replace(this.em,"");return(t.toString().match(this.nm)||[]).join("").length==i.length&&t.length==this.q.pattern.mask.length},this)},Zp:function(){var t=S.isIE8?"propertychange":"input";this.Kp||Lt(this.getInputNode(),t,function(){var t=(new Date).valueOf();this.$view.offsetWidth;(!this.hm||100<t-this.hm)&&(this.hm=t,this.$setValue(this.getText()))},{bind:this}),Lt(this.getInputNode(),"blur",function(){this.Vs()},{bind:this})},im:function(t){for(var i=t.mask,s={},e="",n=0,h=0;h<i.length;h++)"#"===i[h]?(s[h]=n,n++):(s[h]=!1,-1===e.indexOf(i[h])&&(e+="\\"+i[h]));this.nm=t.allow,this.em=new RegExp("["+e+"]","g"),this.rm=s,this.sm()},qp:function(t,i){var s=this.getInputNode(),e=s.value,n=at(s),h="";8==i||46==i?n.start==n.end&&(8==i?n.start--:n.end++):(h=String.fromCharCode(i),t.shiftKey||(h=h.toLowerCase())),e=e.substr(0,n.start)+h+e.substr(n.end),n=this.om(h,e.length,n.start,i),this.um=i,this.$setValue(e),ot(s,n)},om:function(t,i,s,e){if(t&&t.match(this.nm)||8==e||46==e)s=t?s+1:s,s=this.cm(s,e);else if(i-1==s&&8!==e&&46!==e){var n=this.q.pattern.mask.indexOf("#",s);0<n&&(s+=n)}return s},cm:function(t,i){var s=t-1*(46!==i);return!1===this.rm[s]?(t+=8==i?-1:1,this.cm(t,i)):!1===this.rm[t]&&8!==i?this.cm(t+1,i)-1:t},Qp:function(t){return this.Kp?this.Kp.parse(t):((t=t||"").toString().match(this.nm)||[]).join("").replace(this.em,"")},tm:function(t){if(this.Kp)return this.Kp.edit(this.Kp.parse(t));var i=this.Qp(t),s=this.q.pattern.mask,e=this.q.pattern.mask,n=this.rm,h=!1,r=0,o=0,a=0;for(var u in n)if(!1!==n[u]){if(!h){r=1*u;var c=i[o=n[u]]||"",f=i[o+1];s=(c?s.substr(0,r):"")+c+(c&&f?s.substr(r+1):""),f||(h=!0)}a++}var l=this.um;if(l&&8!==l||!l&&a-1===o&&s.length<e.length)if(i){var d=r+1;if("#"!==e.charAt(d)&&s.length<e.length){var v=e.indexOf("#",d);v<0&&(v=e.length),s+=e.substr(d,v-d)}}else 46!==l&&(s+=e.substr(0,e.indexOf("#")));return this.um=null,s}},$h={name:"text",$allowsClear:!0,fm:function(){this.$allowsClear&&(this.lm||Lt(this.getInputNode(),"change",this.Vs,{bind:this}),this.q.suggest&&jt(this.q.suggest).linkInput(this))},Vs:function(){var t=this.getValue();t!=this.q.value?this.setValue(t,!0):this.Kp&&this.$setValue(t)},$skin:function(){this.defaults.height=Qi.inputHeight,this.defaults.inputPadding=Qi.inputPadding,this.I_=Qi.inputSpacing},$init:function(t){"top"==t.labelPosition&&D(t.height)&&this.defaults.height&&(t.height=this.defaults.height+(
t.label?this.F_:0)),this.rt=[],this.attachEvent("onAfterRender",this.fm),this.attachEvent("onBlur",function(){this.lm&&this.lm()})},$renderIcon:function(){var t=this.q;if(t.icon){var i=t.aheight-2*t.inputPadding,s=(i-18)/2-1,e=this.addSection?"role='button' tabindex='0' aria-label='"+ct.aria["multitext"+(t.mode||"")+"Section"]+"'":"";return"<span style='height:"+(i-s)+"px;padding-top:"+s+"px;' class='webix_input_icon "+t.icon+"' "+e+"></span>"}return""},relatedView_setter:function(t){return this.attachEvent("onChange",function(){var t=this.getValue(),i=this.q.relatedAction,s=this.q.relatedView,e=jt(s);if(!e){var n=this.getTopParentView();n&&n.$$&&(e=n.$$(s))}"enable"==i?t?e.enable():e.disable():t?e.show():e.hide()}),t},validateEvent_setter:function(t){return"blur"==t&&this.attachEvent("onBlur",this.validate),"key"==t&&this.attachEvent("onTimedKeyPress",this.validate),t},validate:function(){var t=this.q.validate;!t&&this.q.required&&(t=ws.isNotEmpty);var i=this.getFormView(),s=this.q.name,e=this.getValue(),n={};return n[s]=e,!(t&&!i.Oh(t,e,n,s))},bottomLabel_setter:function(t){return this.q.bottomPadding||(this.q.bottomPadding=18),t},dm:function(){var t=this.q.invalidMessage;return"function"==typeof t&&t.call(this),t},setBottomText:function(t,i){var s=this.q;if(void 0!==t){if(s.bottomLabel==t)return;s.bottomLabel=t}var e=(s.invalid?s.invalidMessage:"")||s.bottomLabel;e||s.bottomPadding||(s.inputHeight=0),e&&!s.bottomPadding?(this.vm=1,s.bottomPadding=s.bottomPadding||i||18,this.render(),this.resize()):!e&&this.vm?(s.bottomPadding=this.vm=0,s.height||this.render(),this.resize()):this.render()},$getSize:function(){var t=Gi.api.$getSize.apply(this,arguments),i=this.config.bottomPadding;return i&&(t[2]+=i,t[3]+=i),t},$setSize:function(t,i){var s=this.q;if(Gi.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==s.labelPosition?(s.inputHeight||(this.Wp=this.He-(s.label?this.F_:0)-(this.config.bottomPadding||0)),s.labelWidth=0):s.bottomPadding&&(s.inputHeight=this.He-this.config.bottomPadding),this.render()}},_m:function(t){var i=(this.Up||0)-(t.label?this.q.labelWidth:0)-this.I_-(t.iconWidth||0);return i<0?0:i},mm:function(t,i){var s="x"+z(),e=i._m(t),n=t.inputAlign||"left",h=this.q.aheight-2*Qi.inputPadding-2*this.zp,r=t.text||t.value||this.Jp(t),o="<div class='webix_inp_static' role='combobox' aria-label='"+Ft.escape(t.label)+"' tabindex='0'"+(t.readonly?" aria-readonly='true'":"")+(t.invalid?"aria-invalid='true'":"")+" onclick='' style='line-height:"+h+"px;width: "+e+"px; text-align: "+n+";' >"+r+"</div>";return i.$renderInput(t,o,s)},bm:function(t){var i="<"+t+(this.q.placeholder?" placeholder='"+this.q.placeholder+"' ":" ");this.q.readonly&&(i+="readonly='true' aria-readonly=''"),this.q.required&&(i+="aria-required='true'"),this.q.invalid&&(i+="aria-invalid='true'");var s=this.q.attributes;if(s)for(var e in s)i+=e+"='"+s[e]+"' ";return i},$renderLabel:function(t,i){var s=t.labelAlign||"left",e="top"==this.q.labelPosition,n=e?"display:block;":"width: "+this.q.labelWidth+"px;",h="",r=e?this.F_-this.q.inputPadding:this.q.aheight-2*this.q.inputPadding;return t.label&&(h="<label style='"+n+"text-align: "+s+";line-height:"+r+"px;' onclick='' for='"+i+"' class='webix_inp_"+(e?"top_":"")+"label "+(t.required?"webix_required":"")+"'>"+(t.label||"")+"</label>"),h},$renderInput:function(t,i,s){var e=t.inputAlign||"left",n="top"==t.labelPosition,h=this._m(t);s=s||z();var r=this.$renderLabel(t,s),o="";if(i)o+=i;else{var a=Ft.escape(t.text||this.Ep(t.value));o+=this.bm("input")+"id='"+s+"' type='"+(t.type||this.name)+"'"+(t.editable?" role='combobox'":"")+" value='"+a+"' style='width: "+h+"px; text-align: "+e+";'";var u=t.attributes;if(u)for(var c in u)o+=" "+c+"='"+u[c]+"'";o+=" />"}o+=this.$renderIcon?this.$renderIcon(t):"";var f="";f=n?r+"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+o+"</div>":"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+r+o+"</div>";var l=t.awidth-h-2*Qi.inputPadding,d=(t.invalid?t.invalidMessage:"")||t.bottomLabel;return d&&(
f+="<div class='webix_inp_bottom_label'"+(t.invalid?"role='alert' aria-relevant='all'":"")+" style='width:"+(h||t.awidth)+"px;margin-left:"+Math.max(l,Qi.inputPadding)+"px;'>"+d+"</div>"),f},defaults:{template:function(t,i){return i.$renderInput(t)},label:"",labelWidth:80},type_setter:function(t){return t},Bp:!1,$setValue:function(t){this.getInputNode().value=this.Ep(t)},$getValue:function(){return this.Ep(this.getInputNode().value,!1)},suggest_setter:function(t){if(t){if("string"==typeof t){if(jt(t))return jt(t).q.id;t={body:{url:t,dataFeed:t}}}else t.getItem?t={body:{data:t}}:b(t)?t={body:{data:this.Xp(t)}}:t.body||(t.body={});H.extend(t,{view:"suggest"});var i=Vt(t);return this.rt.push(i),i.q.id}return!1}},Ah={api:$h,view:H.protoUI($h,Dh,yh.view)},Ih=H.proto({name:"DataCollection",isVisible:function(){return!!(this.data.order.length||this.data.lr||this.q.dataFeed)},$init:function(t){this.data.provideApi(this,!0);var i=t&&t.id?t.id:z();this.q.id=i,(Vt.views[i]=this).data.attachEvent("onStoreLoad",C(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},gs,Ri,Ni,De,Cs,Os,g,Ei,Bi,Hi);u("DataCollection",Ih);var Fh={name:"select",defaults:{template:function(i,t){var s=t.Xp(i.options),e="x"+z(),n=t.bm("select")+"id='"+e+"' style='width:"+t._m(i)+"px;'>",h=jt(s);if(h&&h.data&&h.data.each)h.data.each(function(t){n+="<option"+(t.id==i.value?" selected='true'":"")+" value='"+t.id+"'>"+t.value+"</option>"});else for(var r=0;r<s.length;r++)n+="<option"+(s[r].id==i.value?" selected='true'":"")+" value='"+s[r].id+"'>"+s[r].value+"</option>";return n+="</select>",t.$renderInput(i,n,e)}},options_setter:function(t){if(t){if("string"!=typeof t)return t;var i=new Ih({url:t});return i.data.attachEvent("onStoreLoad",C(this.refresh,this)),i}},getInputNode:function(){return this.bt.getElementsByTagName("select")[0]}},Th=(H.protoUI(Fh,Ah.view),{name:"checkbox",defaults:{checkValue:1,uncheckValue:0,template:function(t,i){var s="x"+z(),e="";t.labelRight&&(e="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||"&nbsp;"));var n=t.checkValue==t.value,h=Math.floor((i.q.aheight-16)/2),r=i.bm("input")+"style='margin-top:"+h+"px;"+(t.customCheckbox?"display:none":"")+"' id='"+s+"' type='checkbox' "+(n?"checked='1'":"")+(t.labelRight?" aria-label='"+Ft.escape(t.labelRight)+"'":"")+"/>",o="webix_inp_checkbox_border webix_el_group webix_checkbox_"+(n?"1":"0"),a=t.customCheckbox||"";a&&(a=(a=(a=a.replace(/(aria-checked=')\w*(?=')/,"$1"+(t.value==t.checkValue?"true":"false"))).replace(/(aria-label=')\w*(?=')/,"$1"+Ft.escape(t.labelRight||t.label))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false")));var u="<div style='line-height:"+i.q.cheight+"px' class='"+o+"'>"+r+a+e+"</div>";return i.$renderInput(t,u,s)}},customCheckbox_setter:function(t){return!0===t&&Qi.customCheckbox&&(t="<a role='presentation' onclick='javascript:void(0)'><button role='checkbox' aria-checked='false' aria-label='' type='button' aria-invalid='' class='webix_custom_checkbox'></button></a>"),t},blur:function(){var t=this.getInputNode();t&&t.blur()},Ep:function(t){return t},fm:function(){},$setValue:function(t){var i=t==this.q.checkValue,s=this.$view.getElementsByTagName("input")[0],e=s?s.parentNode:null;if(e&&this.q.customCheckbox){var n=e.getElementsByTagName("BUTTON");n[0]&&n[0].setAttribute("aria-checked",i?"true":"false")}e&&(e.className=e.className.replace(/(webix_checkbox_)\d/,"$1"+(i?1:0))),s.checked=i},toggle:function(){var t=this.getValue()!=this.q.checkValue?this.q.checkValue:this.q.uncheckValue;this.setValue(t)},getValue:function(){return this.q.value==this.q.checkValue?this.q.checkValue:this.q.uncheckValue},getInputNode:function(){return this.$view.getElementsByTagName(this.q.customCheckbox?"button":"input")[0]},$skin:function(){this.defaults.customCheckbox=!!Qi.customCheckbox}}),zh={api:Th,view:H.protoUI(Th,Ah.view)},Vh={name:"radio",defaults:{template:function(t,i){for(var s,e=i.Xp(t.options),n=[],h=0;h<e.length;h++){var r="x"+z();s=s||r,h&&(
e[h].newline||t.vertical)&&n.push("<div class='webix_line_break'></div>");var o=e[h].id==t.value,a=e[h].value||"",u=t.customRadio||"";if(u){var c=(0===h?t.label+" ":"")+a;u=(u=(u=(u=(u=u.replace(/(aria-label=')\w*(?=')/,"$1"+Ft.escape(c))).replace(/(aria-checked=')\w*(?=')/,"$1"+(o?"true":"false"))).replace(/(tabindex=')\w*(?=')/,"$1"+(o||0===h&&!t.value?"0":"-1"))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false"))).replace(/(button_id=')\w*(?=')/,"$1"+e[h].id)}var f=i.bm("input")+" name='"+(t.name||t.id)+"' type='radio' "+(o?"checked='1'":"")+"tabindex="+(o||0===h&&!t.value?"0":"-1")+" value='"+e[h].id+"' id='"+r+"' style='"+(u?"display:none":"")+"' />",l="<div radio_id='"+e[h].id+"' class='webix_inp_radio_border webix_radio_"+(o?"1":"0")+"' role='presentation'>"+f+u+"</div>";a&&(a="<label for='"+r+"' class='webix_label_right'>"+a+"</label>"),n.push("<div class='webix_radio_option' role='presentation'>"+l+a+"</div>")}return n="<div class='webix_el_group' role='radiogroup' style='margin-left:"+(t.label?t.labelWidth:0)+"px;'>"+n.join("")+"</div>",i.$renderInput(t,n,s)}},refresh:function(){this.render(),this.Te&&this.$getSize(0,0)[2]!=this.Te[1]&&this.resize()},$getSize:function(t,i){var s=yh.api.$getSize.call(this,t,i);if(this.q.options){for(var e=this.q.vertical?0:1,n=0;n<this.q.options.length;n++)(this.q.vertical||this.q.options[n].newline)&&e++;s[3]=s[2]=Math.max(s[2],(this.q.optionHeight||25)*e+2*this.q.inputPadding+("top"==this.q.labelPosition?this.F_:0))}var h=this.config.bottomPadding;return h&&(s[2]+=h,s[3]+=h),s},Fa:function(){return this.bt.getElementsByTagName(this.q.customRadio?"button":"input")},$setValue:function(t){for(var i=this.bt.getElementsByTagName("input"),s=0;s<i.length;s++){i[s].parentNode.getAttribute("radio_id")==t?(i[s].checked=!0,i[s].setAttribute("tabindex","0")):(i[s].checked=!1,i[s].setAttribute("tabindex","-1"));var e=i[s]?i[s].parentNode:null;if(e&&(e.className=e.className.replace(/(webix_radio_)\d/,"$1"+(i[s].checked?1:0)),this.q.customRadio)){var n=e.getElementsByTagName("BUTTON");n[0]&&(n[0].setAttribute("aria-checked",i[s].checked?"true":"false"),n[0].setAttribute("tabindex",i[s].checked?"0":"-1"))}}},getValue:function(){return this.q.value},focus:function(){return this.Hs()},blur:function(){this.Ta()},customRadio_setter:function(t){return!0===t&&Qi.customRadio&&(t="<a role='presentation' onclick='javascript:void(0)'><button type='button' class='webix_custom_radio' button_id='' role='radio' aria-checked='false' aria-label='' aria-invalid='' tabindex=''></button></a>"),t},$skin:function(){this.defaults.customRadio=!!Qi.customRadio,Qi.optionHeight&&(this.defaults.optionHeight=Qi.optionHeight)}},Hh=(H.protoUI(Vh,js,Ah.view),{name:"datepicker",$init:function(){this.$ready.push(this.gm)},defaults:{template:function(t,i){"time"==i.q.type&&(i.q.icon=i.q.timeIcon);var s=t.type;t.type="";var e=t.editable?i.$renderInput(t):i.mm(t,i);return t.type=s,e},stringResult:!1,timepicker:!1,icon:"wxi-calendar",icons:!0,timeIcon:"wxi-clock",separator:", "},lm:function(){if(this.q.text!=this.getText()&&(!D(this.q.text)||this.getText())){var t=this.getPopup().getValue();t&&this.setValue(t)}},$skin:function(){this.defaults.inputPadding=Qi.inputPadding,this.defaults.point=!Qi.popupNoPoint},getPopup:function(){return jt(this.q.popup)},gm:function(){var t=this.q;if(t.suggest)t.popup=t.suggest;else if(!t.popup){var i=this.q.timepicker;t.popup=t.suggest=this.suggest_setter({type:"calendar",point:!1!==this.q.point,padding:0,body:{height:240+(i||this.q.icons?30:0),width:250,multiselect:this.q.multiselect,timepicker:i,type:this.q.type,icons:this.q.icons,timeIcon:this.q.timeIcon}})}this.Zn=function(){}},$render:function(t){D(t.value)||(t.value=this.$prepareValue(t.value),this.$setValue(t.value))},$prepareValue:function(t){if(this.q.multiselect){"string"==typeof t?t=t.split(this.q.separator):t instanceof Date?t=[t]:t||(t=[]);for(var i=0;i<t.length;i++)t[i]=this.wm(t[i]);return t}return this.wm(t)},wm:function(t){var i=this.q.type,s="time"==i;if(isNaN(parseFloat(t))||(t=""+t),"string"==typeof t&&t){t=(
"month"!=i&&"year"!=i||!this.xm?s?ct.parseTimeFormatDate:ct.parseFormatDate:this.xm)(t)}if(t){if(s&&b(t)){var e=new Date;e.setHours(t[0]),e.setMinutes(t[1]),t=e}isNaN(t.getTime())&&(t="")}return t},ym:function(t){return this.q.multiselect?[].concat(t).map(function(t){return this.Mm(t)}.bind(this)).join(this.config.separator):this.Mm(t)},Mm:function(t){var i="time"==this.q.type,s=this.config.timepicker;return(this.Sm||(i?ct.timeFormatStr:s?ct.fullDateFormatStr:ct.dateFormatStr))(t)},km:function(){var t=this.getInputNode();t.value==undefined?t.innerHTML=this.q.text||this.Jp():t.value=this.q.text||""},$compareValue:function(t,i){return!t&&!i||en.equal(t,i)},$setValue:function(t){this.q.text=t?this.ym(t):"",this.km()},format_setter:function(t){return t?"function"==typeof t?this.Sm=t:(this.Sm=en.dateToStr(t),this.xm=en.strToDate(t)):this.Sm=this.xm=null,t},getInputNode:function(){return this.q.editable?this.bt.getElementsByTagName("input")[0]:this.bt.getElementsByTagName("DIV")[1]},getValue:function(){if(this.q.multiselect){var t=this.q.value;if(!t)return[];var i=[].concat(t).map(function(t){return this.Cm(t)}.bind(this));return this.q.stringResult?i.join(this.q.separator):i}return this.Cm(this.q.value)},Cm:function(t){var i=this.q.type,s="time"==i,e=this.config.timepicker;if(this.Np){if(this.q.editable){t=(this.xm||(s?ct.timeFormatDate:e?ct.fullDateFormatDate:ct.dateFormatDate))(this.getInputNode().value)}}else t=this.$prepareValue(t)||null;if(this.q.stringResult){var n=ct.parseFormatStr;return s&&(n=ct.parseTimeFormatStr),!this.Sm||"month"!=i&&"year"!=i||(n=this.Sm),this.q.multiselect?[].concat(t).map(function(t){return t?n(t):""}):t?n(t):""}return t||null},getText:function(){var t=this.getInputNode();return t?"undefined"==typeof t.value?this.getValue()?t.innerHTML:"":t.value:""}}),Bh={api:Hh,view:H.protoUI(Hh,Ah.view)},Rh={name:"colorpicker",$init:function(){this.$ready.push(this.gm)},defaults:{icon:!0},gm:function(){var t=this.q;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({type:"colorboard",height:200})),this.Zn=function(){}},$render:function(t){D(t.value)||(t.value=this.$prepareValue(t.value),this.$setValue(t.value))},getValue:function(){return this.Np&&this.q.editable?this.getInputNode().value:this.q.value},$prepareValue:function(t){return t&&t.charAt&&"#"!=t.charAt(0)&&(t="#"+t),t||""},Dm:function(){return this.$view.getElementsByTagName("DIV")[this.q.editable?1:2]},ym:function(t){return t},$setValue:function(t){this.Dm().style.backgroundColor=t,this.q.text=t;var i=this.getInputNode();i.value==undefined?i.innerHTML=t:i.value=t},$renderIcon:function(){return'<div class="webix_input_icon" style="background-color:'+this.config.value+';"> </div>'}},Ph=(H.protoUI(Rh,Bh.view),{name:"richselect",defaults:{template:function(t,i){return i.mm(t,i)},popupWidth:200,icon:"wxi-menu-down"},lm:function(){if(this.q.text!=this.getText()&&(!D(this.q.text)||this.getText())){var t=this.getPopup(),i=this.getInputNode().value,s=t.getSuggestion(i),e=this.getValue();!s||s==e||""===i&&""!==t.getItemText(s)?""===i?this.setValue(""):this.$m&&this.$m():this.setValue(s)}},suggest_setter:function(t){return this.options_setter(t)},options_setter:function(t){t=this.Am?this.Am(t):t;var i=this.q.popup=this.q.suggest=Ah.api.suggest_setter.call(this,t),s=jt(i).getList();return s&&s.attachEvent("onAfterLoad",C(this.Im,this)),i},getList:function(){var t=jt(this.q.suggest);return t.getList()},Ep:function(t){return t},Im:function(){var t=this.q.value;D(t)||this.getPopup().isVisible()||this.q.text||!this.bt.firstChild||this.$setValue(t)},$skin:function(){this.defaults.inputPadding=Qi.inputPadding},$render:function(t){D(t.value)||this.$setValue(t.value)},getInputNode:function(){return this.bt.getElementsByTagName("DIV")[1]},getPopup:function(){return jt(this.q.popup)},getText:function(){var t=this.q.value,i=this.getInputNode();return i?"undefined"==typeof i.value?i.firstChild&&"webix_placeholder"===i.firstChild.className?"":i.innerHTML:i.value:t?this.getPopup().getItemText(t):""},$setValue:function(t){if(this.Np){var i=t;if(
this.getPopup()&&(i=this.getPopup().getItemText(t)),!i&&t&&t.id){var s=this.getPopup(),e=s.getList(),n=e.exists(t.id);n||e.add(t),i=s.getItemText(t.id),e.q.dynamic&&!n&&e.remove(t.id),this.q.value=t.id}var h=this.getInputNode();D(h.value)?h.innerHTML=i||this.Jp():h.value=i=i.replace(/<[^>]*>/g,""),this.q.text=i}},getValue:function(){return this.q.value||""}}),jh={api:Ph,view:H.protoUI(Ph,Ah.view)},Nh={name:"combo",getInputNode:function(){return this.bt.getElementsByTagName("input")[0]},$render:function(t){D(t.value)||this.$setValue(t.value)},$m:function(){if(!this.q.editable){var t=this.getValue();this.$setValue(D(t)?"":t)}},Vs:function(){var t=this.getInputNode(),i="",s=this.getPopup();t.value&&(i=this.q.value,s.getItemText(i)!=this.getText()&&(i=s.getSuggestion()||i)),i!=this.q.value?this.setValue(i,!0):this.$setValue(i)},defaults:{template:function(t,i){return i.$renderInput(t).replace(/(<input)\s*(?=\w)/,"$1 role='combobox'")},icon:"wxi-menu-down"}},Eh=(H.protoUI(Nh,jh.view),{name:"counter",defaults:{template:function(t,i){var s=t.value,e="x"+z(),n="<div role='spinbutton' aria-label='"+Ft.escape(t.label)+"' aria-valuemin='"+t.min+"' aria-valuemax='"+t.max+"' aria-valuenow='"+t.value+"' class='webix_el_group' style='width:"+i._m(t)+"px'>";return n+="<button type='button' class='webix_inp_counter_prev' tabindex='-1' aria-label='"+ct.aria.decreaseValue+"'>-</button>",n+=i.bm("input")+" id='"+e+"' type='text' class='webix_inp_counter_value' aria-live='assertive' value='"+s+"'></input>",n+="<button type='button' class='webix_inp_counter_next' tabindex='-1' aria-label='"+ct.aria.increaseValue+"'>+</button></div>",i.$renderInput(t,n,e)},min:0,max:Infinity,value:0,step:1},$init:function(){Lt(this.$view,"keydown",this.K_,{bind:this})},K_:function(t){var i=t.which||t.keyCode,s=this.q,e=this.getValue();32<i&&i<41&&(36===i?e=s.min:35===i?e=s.max===Infinity?1e6:s.max:33===i?this.next():34===i?this.prev():e+=37===i||40===i?-1:1,34<i&&e>=s.min&&e<=s.max&&this.setValue(e))},$setValue:function(t){this.getInputNode().value=t},$prepareValue:function(t){return t=parseFloat(t),isNaN(t)?0:t},value_setter:function(t){return this.$prepareValue(t)},getInputNode:function(){return this.bt.getElementsByTagName("input")[0]},getValue:function(){return 1*yh.api.getValue.apply(this,arguments)},next:function(t){t=1*(t||this.q.step),this.shift(t)},prev:function(t){t=-1*(t||this.q.step),this.shift(t)},shift:function(t){var i=this.q.min,s=this.q.max,e=this.getValue()+t;i<=e&&e<=s&&this.setValue(e)}}),Lh=(H.protoUI(Eh,Ah.view),{name:"icon",$skin:function(){this.defaults.height=Qi.inputHeight,this.defaults.width=Qi.inputHeight},defaults:{template:function(t,i){var s=Math.min(t.awidth,t.aheight),e=Math.round((i.He-t.aheight)/2),n="<button type='button' style='height:"+s+"px;width:"+s+"px;' class='webix_icon_button'><span class='webix_icon "+t.icon+"'></span></button>";return"<div class='webix_el_box' style='width:"+t.awidth+"px;height:"+t.aheight+"px;line-height:"+t.aheight+"px;margin-top:"+e+"px'>"+n+(t.badge?"<span class='webix_badge'>"+t.badge+"</span>":"")+"</div>"}},Bp:function(){},$setValue:function(){}}),Oh=(H.protoUI(Lh,yh.view),{name:"search",on_click:{webix_input_icon:function(t){this.getInputNode().focus(),this.callEvent("onSearchIconClick",[t])}},$skin:function(){this.defaults.inputPadding=Qi.inputPadding},defaults:{type:"text",icon:"wxi-search"}}),Uh=(H.protoUI(Oh,Ah.view),{name:"segmented",$allowsClear:!1,$init:function(){this.attachEvent("onChange",function(t){this.q.multiview&&this.Fm(t)}),this.attachEvent("onAfterRender",l(function(){this.q.multiview&&this.q.value&&this.Fm(this.q.value)}))},Fm:function(t){var i=this.getTopParentView(),s=null;i&&i.$$&&(s=i.$$(t)),s||(s=jt(t)),s&&s.show&&s.show()},defaults:{template:function(t,i){t.options;var s=t.options;i.Xp(s),s=i.Tm(s);var e=i._m(t),n=z(),h="<div style='width:"+e+"px' class='webix_all_segments' role='tablist' aria-label='"+Ft.escape(t.label)+"'>",r=t.optionWidth||Math.floor(e/s.length);t.value||(t.value=s[0].id);for(var o=0;o<s.length;o++)h+="<button type='button' style='width:"+(
s[o].width||r)+"px' role='tab' aria-selected='"+(t.value==s[o].id?"true":"false")+"' tabindex='"+(t.value==s[o].id?"0":"-1")+"'",h+="class='webix_segment_"+(o==s.length-1?"N":0<o?1:0)+(t.value==s[o].id?" webix_selected ":"")+"' button_id='"+s[o].id+"' "+(s[o].tooltip?"title='"+s[o].tooltip+"'":"")+">",h+=s[o].value+"</button>";return i.$renderInput(t,h+"</div>",n)}},Fa:function(){return this.$view.getElementsByTagName("BUTTON")},focus:function(){return this.Hs()},blur:function(){this.Ta()},$setValue:function(t){for(var i=this.Fa(),s=0;s<i.length;s++){var e=i[s].getAttribute("button_id");i[s].setAttribute("aria-selected",t==e?"true":"false"),i[s].setAttribute("tabindex",t==e?"0":"-1"),t==e?st(i[s],"webix_selected"):et(i[s],"webix_selected")}var n=this.config.tabbarPopup;n&&jt(n)&&jt(n).getBody().exists(t)&&this.refresh()},getValue:function(){return this.q.value},getInputNode:function(){return null},optionIndex:function(t){for(var i=this.q.options,s=0;s<i.length;s++)if(i[s].id==t)return s;return-1},addOption:function(t,i,s,e){var n=t;"object"!=k(t)?n={id:t,value:i=i||t}:(t=n.id,e=s,s=i),this.optionIndex(t)<0&&x.insertAt.call(this.q.options,n,e),this.refresh(),s&&this.setValue(t)},removeOption:function(t){var i=this.optionIndex(t),s=this.q.options;0<=i&&x.removeAt.call(s,i),this.q.value==t&&this.zm(s,i),this.refresh(),this.callEvent("onOptionRemove",[t,this.q.value])},zm:function(t,i){var s=t.length;if(s){for(var e=i=Math.min(i,s-1);e<s;e++)if(!t[e].hidden)return this.setValue(t[e].id);for(var n=i;0<=n;n--)if(!t[n].hidden)return this.setValue(t[n].id)}this.setValue("")},Tm:function(t){for(var i=[],s=0;s<t.length;s++)t[s].hidden||i.push(t[s]);return i},Vm:function(t,i){var s=this.q.options,e=this.optionIndex(t),n=s[e];n&&i==!!n.hidden&&(n.hidden=!i,i||this.q.value!=t?this.refresh():this.zm(s,e))},hideOption:function(t){this.Vm(t,!1)},showOption:function(t){this.Vm(t,!0)},Bp:!1}),Yh={api:Uh,view:H.protoUI(Uh,js,Ah.view)},Wh={name:"textarea",defaults:{template:function(t,i){var s=t.name||t.id,e="x"+z(),n=i.bm("textarea")+"style='width:"+i._m(t)+"px;'";return n+=" id='"+e+"' name='"+s+"' class='webix_inp_textarea'>"+i.Ep(t.value)+"</textarea>",i.$renderInput(t,n,e)},height:0,minHeight:60},$skin:function(){this.defaults.inputPadding=Qi.inputPadding,this.I_=Qi.inputSpacing},qs:!0,getInputNode:function(){return this.bt.getElementsByTagName("textarea")[0]}},Gh=(H.protoUI(Wh,Ah.view),{name:"toggle",$allowsClear:!0,$init:function(){this.attachEvent("onItemClick",function(){this.toggle()})},$setValue:function(t){var i=this.getInputNode(),s=this.q,e=t&&"0"!=t,n=(e?s.onLabel:s.offLabel)||s.label,h=i.lastChild;i.setAttribute("aria-pressed",!!e&&"true"),i.value=n,h&&((h.firstChild||h).nodeValue=n),i.firstChild&&"SPAN"===i.firstChild.nodeName&&s.onIcon&&s.offIcon&&s.onIcon!==s.offIcon&&(i.firstChild.className=i.firstChild.className.replace(e?s.offIcon:s.onIcon,e?s.onIcon:s.offIcon));var r=i.parentNode;e?st(r,"webix_pressed"):et(r,"webix_pressed")},toggle:function(){this.setValue(!this.getValue())},getValue:function(){var t=this.q.value;return t&&"0"!=t?1:0},defaults:{template:function(t,i){var s=t.value&&"0"!=t.value,e=s?" webix_pressed":"";t.label=(s?t.onLabel:t.offLabel)||t.label,t.icon=(s?t.onIcon:t.offIcon)||t.icon;var n="<div class='webix_el_box"+e+"' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+i.$renderInput(t,i)+"</div>";return n=n.replace(/(button)\s*(?=\w)/,"$1 aria-pressed='"+(s?"true":"false")+"' "),t.badge&&(n=n.replace(/<\/div>$/,"<span class='webix_badge'>"+t.badge+"</span></div>")),n}},Bp:!1}),Xh=(H.protoUI(Gh,yh.view),{name:"multitext",$cssName:"text",defaults:{icon:"wxi-plus-circle",iconWidth:25,separator:", "},getValueHere:function(){return Ah.api.getValue.call(this)},setValueHere:function(t){return Ah.api.$setValue.call(this,t)},getValue:function(){if("extra"==this.config.mode)return this.getValueHere();if(this.Hm)return this.Hm;for(var t=[this.getValueHere(this)],i=0;i<this.Bm.length;i++){var s=jt(this.Bm[i]).getValueHere();s&&t.push(s)}return t.join(this.config.separator)},$setValue:function(t){if(t=t||"",
"extra"==this.config.mode)return this.setValueHere(t);var i=(this.Hm=t).split(this.config.separator);if(i.length!=this.Bm.length+1){this.removeSection(),this.setValueHere.call(this,i[0]);for(var s=1;s<i.length;s++)this.addSection(i[s]);this.Hm=""}else{this.setValueHere(i[0]);for(var e=0;e<this.Bm.length;e++)jt(this.Bm[e]).setValueHere(i[e+1]);this.Hm=""}},Rm:function(){var t=this.config.master?jt(this.config.master):this,i=t.getValue(),s=t.q.value;i!==s&&(t.q.value=i,t.callEvent("onChange",[i,s]))},addSection:function(t){var i=this.config,s={labelWidth:i.labelWidth,inputWidth:i.inputWidth,width:i.width,label:i.label?"&nbsp;":"",view:this.name,mode:"extra",value:t||"",icon:"wxi-minus-circle",suggest:i.suggest||null,master:i.id};H.extend(s,i.subConfig||{},!0);var e=this.getParentView().addView(s);return jt(e).attachEvent("onChange",this.Rm),this.Bm.push(e),this.callEvent("onSectionAdd",[e,this.Bm.length]),e},removeSection:function(t){for(var i=this.config.master?jt(this.config.master):this,s=i.Bm.length-1;0<=s;s--){var e=i.Bm[s];t&&e!=t||(i.Bm.removeAt(s),this.getParentView().removeView(e),i.callEvent("onSectionRemove",[e,s+1]))}},on_click:{webix_input_icon:function(){if("extra"==this.config.mode){this.removeSection(this.config.id);var t=this.getParentView().getChildViews();t[t.length-1].focus(),this.Rm()}else jt(this.addSection()).focus();return!1}},$init:function(){this.Bm=p([]),this.attachEvent("onKeyPress",this.je)},$render:function(t){this.$setValue(t.value)}}),Jh=(H.protoUI(Xh,Ah.view),{name:"proto",$init:function(){this.data.provideApi(this,!0),this.bt=this.bt||this.re,this.data.attachEvent("onStoreUpdated",C(function(){this.render.apply(this,arguments)},this))},$setSize:function(){Gi.api.$setSize.apply(this,arguments)&&this.render()},za:"webix_item",on_mouse_move:{},type:{}}),Kh={api:Jh,view:H.protoUI(Jh,Gs,bs,Ki,De,Js,Cs,Gi.view,g,Hi)},qh={name:"list",Pm:"webix_list",qn:"webix_list_item",$init:function(t){st(this.nt,this.Pm+("x"==(t.layout||this.defaults.layout)?"-x":"")),this.data.provideApi(this,!0),this.jm=C(this.jm,this),this.data.attachEvent("onStoreUpdated",this.jm),this.data.attachEvent("onSyncApply",this.jm),this.attachEvent("onAfterRender",this.Rd),this.nt.setAttribute("role","listbox")},dynamic_setter:function(t){return t&&H.extend(this,Ie,!0),t},$dragHTML:function(t){if("y"!=this.q.layout||"auto"!=this.type.width)return this.Lt(t);this.type.width=this.ze;var i=this.Lt(t);return this.type.width="auto",i},defaults:{select:!1,scroll:!0,layout:"y",navigation:!0,datafetch:50},za:"webix_l_id",on_click:{webix_list_item:function(t,i){this.q.select&&(this.Nm=!0,"multiselect"==this.q.select||this.q.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.q.multiselect,t.shiftKey):this.select(i),this.Nm=!1)}},on_dblclick:{},getVisibleCount:function(){return Math.floor(this.He/this.Em())},jm:function(){(this.q.autoheight||this.q.autowidth)&&this.resize()},Lm:function(t){var i=this.data.$pagesize||this.count();this.Uu(t&&t<i,"y"),this.q.autoheight&&i<(t||Infinity)&&(t=i);var s=this.Em()*t+(this.type.margin||0);return this.getUnits&&(s+=this.getUnits().length*this.type.headerHeight),Math.max(s,this.q.minHeight||0)},Em:function(){return this.type.height+(this.type.margin||0)},Om:function(t){var i=this.data.$pagesize||this.count();return this.Uu(t&&t<i,"x"),this.q.autowidth&&i<(t||Infinity)&&(t=i),this.type.width*t},Rd:function(){"x"==this.q.layout&&(this.bt.style.width="auto"!=this.type.width?this.type.width*this.count()+"px":"auto")},$getSize:function(t,i){return"y"==this.q.layout?("auto"!=this.type.width&&(this.q.width=this.type.width+(this.Ve?S.scrollSize:0)),(this.q.yCount||this.q.autoheight)&&(this.q.height=this.Lm(this.q.yCount)||1)):("auto"!=this.type.height&&(this.q.height=this.Em()+(this.Be?S.scrollSize:0)),(this.q.xCount||this.q.autowidth)&&(this.q.width=this.Om(this.q.xCount)||1)),Gi.api.$getSize.call(this,t,i)},$setSize:function(){Gi.api.$setSize.apply(this,arguments)},type:{css:"",widthSize:function(t,i){return i.width+(-1<i.width?"px":"")},heightSize:function(t,i){return i.height+(
-1<i.height?"px":"")},classname:function(t,i,s){var e="webix_list_item";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.$css&&(e+=" "+s.$css),e},aria:function(t,i,s){return'role="option"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count&&t.$template?'aria-expanded="true"':"")},template:function(t){return(t.icon?"<span class='webix_list_icon webix_icon "+t.icon+"'></span>":"")+t.value+(t.badge?"<div class='webix_badge'>"+t.badge+"</div>":"")},width:"auto",templateStart:Ft('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>'),templateEnd:Ft("</div>")},$skin:function(){this.type.height=Qi.listItemHeight}},Zh={api:qh,view:H.protoUI(qh,ps,Ls,gs,$s,Us,qs,Ks,Kh.view,_s)},Qh={name:"multiselect",$cssName:"richselect",defaults:{separator:","},Am:function(t){var i=!b(t)&&"object"==k(t)&&!t.name,s={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button};this.q.optionWidth?s.width=this.q.optionWidth:s.fitMaster=!0,i&&H.extend(s,t,!0);var e=Vt(s),n=e.getList();return"string"==typeof t?n.load(t):i||n.parse(t),e.attachEvent("onShow",function(){e.setValue(jt(e.q.master).config.value)}),e},$setValue:function(t){if(this.Np){var i=this.getPopup(),s="";i&&"object"==k(s=i.setValue(t))&&(s=s.join(this.config.separator+" ")),this.q.text=s,this.getInputNode().innerHTML=s||this.Jp()}},getValue:function(){return this.q.value||""}};zs.multiselect=H.extend({popupType:"multiselect"},zs.richselect),Tt(Zh.view,{name:"multilist",templateStart:Ft('<div webix_l_id="#!id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>')}),Tt(Zh.view,{name:"checklist",templateStart:Ft('<div webix_l_id="#!id#" {common.aria()} class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden; white-space:nowrap;">{common.checkbox()}'),checkbox:function(t){var i=t.$checked?"wxi-checkbox-marked":"wxi-checkbox-blank";return"<span role='checkbox' tabindex='-1' aria-checked='"+(t.$checked?"true":"false")+"' class='webix_icon "+i+"'></span>"},aria:function(t){return"role='option' tabindex='-1' "+(t.$checked?"aria-selected='true'":"")},template:Ft("#value#")});H.protoUI(Qh,jh.view);var tr={name:"multicombo",$cssName:"text",defaults:{keepText:!1,separator:",",icon:!1,iconWidth:0,tagMode:!0,tagTemplate:function(t){return t.length?t.length+" item(s)":""},template:function(t,i){return i.Um(t,i)}},$init:function(){this.$view.className+=" webix_multicombo",this.attachEvent("onBeforeRender",function(){return this.Wp||(this.Wp=Qi.inputHeight),!0}),this.attachEvent("onAfterRender",function(){this.Te=null})},on_click:{webix_multicombo_delete:function(t,i,s){var e;return!this.q.readonly&&s&&(e=s.parentNode.getAttribute("optvalue"))&&this.Ym(e),!1}},lm:function(){var t=this.getInputNode().value;t&&this.q.newValues&&100<new Date-(this.getPopup().Wm||0)&&this.Gm(t),this.q.keepText||(this.Xm=""),this.refresh()},Ym:function(t){var i=this.q.value,s=jt(this.config.suggest);"string"==typeof i&&(i=i.split(this.q.separator)),(i=p(B(i))).remove(t),this.setValue(i.join(this.q.separator)),s&&s.q.selectAll&&s.getBody().Ks[0].setValue(0)},Jm:function(t){var i=jt(this.config.suggest);if(i.getList().getItem(t)){var s=i.getValue();s&&"string"==typeof s&&(s=s.split(i.config.separator)),(s=p(s||[])).find(t)<0&&(s.push(t),i.setValue(s),this.setValue(i.getValue()))}},Gm:function(t){var i,s=jt(this.config.suggest),e=s.getList();if(t=t.replace(/^\s+|\s+$/g,""))for(var n in e.data.pull)s.getItemText(n)==t&&(i=n);!i&&t&&(i=e.add({id:t,value:t})),this.Jm(i)},Am:function(t){var i=!b(t)&&"object"==k(t)&&!t.name,s={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button},e=this;this.q.optionWidth&&(s.width=this.q.optionWidth),i&&H.extend(s,t,!0);var n=Vt(s);this.q.optionWidth||(n.$customWidth=function(){
this.config.width=e._m(e.q)}),n.attachEvent("onBeforeShow",function(t,i,s){if(this.q.master&&(this.setValue(jt(this.q.master).config.value),jt(this.q.master).getInputNode().value||this.isVisible()?(this.getList().refresh(),this.Km=!0):this.getList().filter(),t.tagName&&"input"==t.tagName.toLowerCase()))return nh.api.show.apply(this,[t.parentNode,i,s]),!1});var h=n.getList();return"string"==typeof t?h.load(t):i||h.parse(t),n.qm=function(){},n},Um:function(t,i){var s,e,n,h,r,o,a,u,c,f,l,d,v="",_="top"==this.q.labelPosition;return s="x"+z(),d=i._m(t),e=t.inputAlign||"left",r=this.Wp-2*Qi.inputPadding-2,h=this.Xm||"",u="<ul class='webix_multicombo_listbox' style='line-height:"+r+"px'></ul>",n="width: "+Math.min(d,i.Zm||7)+"px;height:"+r+"px;max-width:"+(d-20)+"px",l=t.readonly?" readonly ":"",o="<div class='webix_inp_static' onclick='' style='line-height:"+r+"px;width: "+d+"px;  text-align: "+e+";height:auto' >"+u+("<input id='"+s+"' role='combobox' aria-multiline='true' aria-label='"+Ft.escape(t.label)+"' tabindex='0' type='text' class='webix_multicombo_input' "+l+" style='"+n+"' value='"+h+"'/>")+"</div>",a=i.$renderLabel(t,s),f=this.q.awidth-d-2*Qi.inputPadding,(c=(t.invalid?t.invalidMessage:"")||t.bottomLabel)&&(v="<div class='webix_inp_bottom_label' style='width:"+d+"px;margin-left:"+Math.max(f,Qi.inputPadding)+"px;'>"+c+"</div>"),_?a+"<div class='webix_el_box' style='width:"+this.q.awidth+"px; '>"+o+v+"</div>":"<div class='webix_el_box' style='width:"+this.q.awidth+"px; min-height:"+this.q.aheight+"px;'>"+a+o+v+"</div>"},Qm:function(){return this.Kc().getElementsByTagName("UL")[0]},Bp:function(){var t=this.getPopup();if(t){var i=t?t.setValue(this.q.value):null;t.tb&&(this.q.value=t.tb(this.q.value));var s="",e=this.Qm(),n=i&&i.length;if(n){var h=this.Wp-2*Qi.inputPadding-8,r=this.q.value;if("string"==typeof r&&(r=r.split(this.q.separator)),this.q.tagMode)for(var o=0;o<i.length;o++){var a="<span>"+i[o]+"</span><span class='webix_multicombo_delete' role='button' aria-label='"+ct.aria.removeItem+"'>x</span>";s+="<li class='webix_multicombo_value' style='line-height:"+h+"px;' optvalue='"+r[o]+"'>"+a+"</li>"}else s+="<li class='webix_multicombo_tag' style='line-height:"+h+"px;'><span>"+this.q.tagTemplate(r)+"</span></li>"}e.innerHTML=s;var u=this.getInputNode();this.q.placeholder&&(n?(u.placeholder="",!u.value&&20<u.offsetWidth&&(u.style.width="20px")):u.value||(u.placeholder=this.q.placeholder,u.style.width=this._m(this.q)+"px")),!this.q.tagMode&&e.firstChild&&(u.style.width=this.ib()+"px")}this.sb()},eb:function(t){if(t=t||this.getInputNode())if(t.value.length){if(t.createTextRange){var i=t.createTextRange();i.moveStart("character",t.value.length),i.collapse(),i.select()}else if(t.selectionStart||"0"==t.selectionStart){var s=t.value.length;t.selectionStart=s,t.selectionEnd=s,t.focus()}}else t.focus()},sb:function(){var t="top"==this.q.labelPosition,i=this.nb(),s=Math.max(i.offsetHeight+2*Qi.inputPadding,this.Wp);if(t&&(s+=this.F_),(s+=this.q.bottomPadding||0)!=this.$getSize(0,0)[2]){var e=i.offsetHeight+(t?this.F_:0),n=this.getTopParentView();clearTimeout(n.Ed),n.Ed=$(function(){var t=e+2*Qi.inputPadding;this.config.height!=t&&(this.config.height=t,this.resize()),this.hb&&(this.eb(this.getInputNode()),this.hb=!1),this.rb&&(this.q.keepText?this.getInputNode().select():this.getInputNode().value="",this.rb=!1),(this.getPopup().isVisible()||this.hb)&&this.getPopup().show(this.nb())},this)}this.rb&&this.getInputNode().select()},nb:function(){for(var t=this.Kc(),i=t.childNodes,s=0;s<i.length;s++)if(i[s].className&&-1!=i[s].className.indexOf("webix_inp_static"))return i[s];return t},getInputNode:function(){return this.Kc().getElementsByTagName("INPUT")[0]},$setValue:function(){this.Np&&this.Bp()},getValue:function(t){if("object"==k(t)&&t.options)return this.ob();var i=this.q.value;return i?"string"!=typeof i?i.join(this.q.separator):i:""},getText:function(){var t=this.q.value;if(!t)return"";"string"==typeof t&&(t=t.split(this.q.separator));for(var i=[],s=0;s<t.length;s++)i.push(this.getPopup().getItemText(t[s]));return i.join(
this.q.separator)},ob:function(){var t,i,s,e=[],n=this.q.value;if(!n)return[];for("string"==typeof n&&(n=n.split(this.q.separator)),s=this.getPopup(),t=0;t<n.length;t++)(i=s.getList().getItem(n[t])||(s.ab?s.ab[n[t]]:null))&&e.push(i);return e},$setSize:function(t,i){var s=this.q;if(Gi.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==s.labelPosition&&(s.labelWidth=0),this.render()}},ub:function(t){var i=document.createElement("span");i.className="webix_multicombo_input",i.style.visibility="visible",i.style.height="0px",i.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),document.body.appendChild(i);var s=i.offsetWidth+10;return document.body.removeChild(i),s},ib:function(){var t=this.Qm();return t.offsetWidth-t.firstChild.offsetWidth-17},fm:function(){Lt(this.Kc(),"click",function(){this.getInputNode().focus()},{bind:this}),Lt(this.getInputNode(),"focus",function(){-1==this.Kc().className.indexOf("webix_focused")&&(this.Kc().className+=" webix_focused")},{bind:this}),Lt(this.getInputNode(),"blur",function(){this.Kc().className=this.Kc().className.replace(" webix_focused","")},{bind:this}),Lt(this.getInputNode(),"input",function(){!this.getInputNode().value&&this.Xm&&(this.getInputNode().style.width="20px",this.Zm=20,this.Xm="",this.hb=!0,this.getPopup().show(this.nb()),this.sb())},{bind:this}),Lt(this.getInputNode(),"keyup",function(t){var i,s,e=this.getInputNode();if(t=t||event,!this.q.placeholder||this.q.value||e.value?(s=i=this.ub(e.value)+10,!this.q.tagMode&&this.Qm().firstChild&&(s=this.ib())):s=this._m(this.q),e.style.width=s+"px",i!=this.Zm?(this.q.keepText||13!=t.keyCode?this.Xm=e.value:this.Xm=!1,this.hb=!0,this.Zm&&this.getPopup().show(this.nb()),this.Zm=i||s,this.sb()):this.cb!=this.getPopup().$height&&this.getPopup().show(this.nb()),-1<e.value.indexOf(this.q.separator)&&this.q.tagMode){var n=e.value.replace(this.q.separator,"");if(n)if(this.q.newValues)this.rb=!0,this.Gm(n);else{var h=this.getPopup().getItemId(n);h&&this.Jm(h)}this.q.keepText?(this.Xm=n,e.value=n,this.rb=!0,this.hb=!0,this.sb()):e.value=""}},{bind:this}),Lt(this.getInputNode(),"keydown",function(t){if(this.rb=!1,this.isVisible()){t=t||event;var i=this.Qm().lastChild;if(this.cb=this.getPopup().$height,8==t.keyCode&&i&&(!this.getInputNode().value&&100<(new Date).valueOf()-(this.fb||0)?(this.hb=!0,this.Ym(i.getAttribute("optvalue"))):this.fb=(new Date).valueOf()),13==t.keyCode||9==t.keyCode){var s=this.getInputNode(),e="",n=jt(this.q.suggest);n.getList().getSelectedId()||(s.value&&(e=n.getSuggestion(s.value)),this.q.newValues?(13==t.keyCode&&(this.rb=!0),this.Gm(s.value),this.q.keepText?this.Xm=s.value:s.value=""):e&&(9==t.keyCode?(this.hb=!1,this.Xm="",this.Zm=10,s.value="",this.Jm(e)):(this.rb=!0,this.Jm(e),this.q.keepText?this.Xm=s.value:s.value=""))),13==t.keyCode&&(this.rb=!0,this.hb=!0,this.q.keepText?this.Xm=s.value:s.value="")}}},{bind:this}),jt(this.q.suggest).linkInput(this)}},ir=(H.protoUI(tr,jh.view),{name:"slider",$touchCapture:!0,defaults:{min:0,max:100,value:50,step:1,title:!1,moveTitle:!0,template:function(t,i){var s=i.lb="x"+z(),e="",n="<div class='webix_slider_title"+(t.moveTitle?" webix_slider_move":"")+"'"+(!t.moveTitle&&t.vertical?" style='line-height:"+(t.aheight-2*t.inputPadding)+"px;'":"")+"></div>",h="<div class='webix_slider_left'>&nbsp;</div>",r="<div class='webix_slider_right'></div>",o="<div class='webix_slider_handle' role='slider' aria-label='"+t.label+(t.title?" "+t.title(t):"")+"' aria-valuemax='"+t.max+"' aria-valuemin='"+t.min+"' aria-valuenow='"+t.value+"' tabindex='0' id='"+s+"'>&nbsp;</div>";return e=t.vertical?"<div class='webix_slider_box'>"+r+h+o+"</div>"+n:n+"<div class='webix_slider_box'>"+h+r+o+"</div>",i.$renderInput(t,e,s)}},type_setter:function(t){this.nt.className+=" webix_slider_"+t},title_setter:function(t){return"string"==typeof t?Ft(t):t},vb:function(){return this.$view.querySelector(".webix_slider_handle")},Bp:function(){var t=this.vb(),i=this.q;if(t){var s=i.vertical?this.He:this._m(i),e=i.value%i.step?Math.round(i.value/i.step)*i.step:i.value,n=i.max-i.min
;e=Math.max(Math.min(e,i.max),i.min),e=i.vertical?n-(e-i.min):e-i.min;var h=Math.ceil((s-2*this._b)*e/n),r=s-2*this._b-h,o=i.vertical?"top":"left",a=i.vertical?"height":"width";t.style[o]=this._b+h-this.pb/2+"px",t.parentNode.style[a]=s+"px",r=Math.min(Math.max(r,2*this.mb),s-2*this._b-2*this.mb),h=Math.min(Math.max(h,2*this.mb),s-2*this._b-2*this.mb);var u=t.previousSibling;u.style[a]=r+"px",u.previousSibling.style[a]=h+"px",this.bb(t,h,r,o)}},bb:function(t,i,s,e){var n=this.q;if(this.q.title){var h=t.parentNode[n.vertical?"nextSibling":"previousSibling"];if(h.innerHTML=this.q.title(this.q,this),this.q.moveTitle){var r=0;if(n.vertical)r=i+2*this.mb-this.pb/2;else{var o=h.clientWidth/2,a=i<o?o-i-2*this.mb:0,u=s<o?o-s-2*this.mb-this.pb/2:0;r=this._b+i-o+a-u}h.style[e]=r+"px"}}},gb:function(){this.vb().setAttribute("aria-valuenow",this.q.value)},refresh:function(){var t=this.vb();t&&(this.gb(),this.q.title&&t.setAttribute("aria-label",this.q.label+" "+this.q.title(this.q,this)),this.Bp())},value_setter:function(t){return this.$prepareValue(t)},$setValue:function(){this.refresh()},$getValue:function(){return this.q.value},$prepareValue:function(t){return t=parseFloat(t),isNaN(t)?0:t},$init:function(t){S.touch?this.attachEvent("onTouchStart",C(this.wb,this)):Lt(this.nt,"mousedown",C(this.wb,this)),Lt(this.$view,"keydown",C(this.xb,this)),t.vertical&&(t.height=t.height||Qi.vSliderHeight,this.nt.className+=" webix_slider_vertical",this._b=Qi.vSliderPadding)},$skin:function(){this.pb=Qi.sliderHandleWidth,this._b=Qi.sliderPadding,this.mb=Qi.sliderBorder},xb:function(t){var i=t.keyCode,s=this.q,e=s.value;if(32<i&&i<41){Q(t);var n=t.target||t.srcElement,h=/webix_slider_handle_(\d)/.exec(n.className);if(this.yb=h?parseInt(h[1],10):-1,h&&(e=s.value[this.yb]),e=e<s.min?s.min:e>s.max?s.max:e,36===i)e=s.min;else if(35===i)e=s.max;else{var r=37===i||40===i||34===i?-1:1;(33===i||34===i||1<s.step)&&(r*=s.step),e=1*e+r}if(h){var o=s.value[this.yb?0:1];e=this.yb&&e<=o||!this.yb&&o<=e?o:e}if(e>=s.min&&e<=s.max){if(h){for(var a=[],u=0;u<s.value.length;u++)a[u]=u===this.yb?e:s.value[u];e=a}this.setValue(e),this.yb=-1}}},wb:function(t){var i=t.target||t.srcElement;this.Mb&&this.Mb(t);var s=this.q.value;if(b(s)&&(s=B(s)),-1!=i.className.indexOf("webix_slider_handle"))return this.Sb=s,this.kb.apply(this,arguments);-1!=i.className.indexOf("webix_slider")&&(this.Sb=s,this.q.value=this.Cb.apply(this,arguments),this.kb(t))},kb:function(){S.touch?this.Db=[this.attachEvent("onTouchMove",C(this.$b,this)),this.attachEvent("onTouchEnd",C(this.Ab,this))]:this.Db=[Ot(document.body,"mousemove",C(this.$b,this)),Ot(window,"mouseup",C(this.Ab,this))],st(document.body,"webix_noselect")},Ab:function(){this.Db&&(S.touch?(this.detachEvent(this.Db[0]),this.detachEvent(this.Db[1])):(Ut(this.Db[0]),Ut(this.Db[1])),this.Db=[]),et(document.body,"webix_noselect");var t=this.q.value;b(t)&&(t=B(t)),this.q.value=this.Sb,this.setValue(t),this.vb(this.yb).focus(),this.yb=-1},$b:function(){this.q.value=this.Cb.apply(this,arguments),this.refresh(),this.callEvent("onSliderDrag",[])},Cb:function(t,i){var s=0,e=this.q.vertical?"y":"x";return s=S.touch?i?i[e]:t[e]:Z(t)[e],this.Ib(s)},Ib:function(t){var i=this.q,s=i.max-i.min,e=i.vertical?"y":"x",n=K(this.vb().parentNode)[e]+this._b,h=(i.vertical?this.He:this._m(i))-2*this._b,r=h?(t-n)*s/h:0;return i.vertical&&(r=s-r),r=Math.round((r+1*i.min)/i.step)*i.step,Math.max(Math.min(r,i.max),i.min)},fm:function(){}}),sr={api:ir,view:H.protoUI(ir,Ah.view)},er={name:"rangeslider",$cssName:"slider webix_rangeslider",defaults:{separator:",",value:[20,80],template:function(t,i){var s="x"+z();i.lb=[s+"_0",s+"_1"];var e="role='slider' aria-label='"+t.label+(t.title?" "+t.title(t):"")+"' aria-valuemax='"+t.max+"' aria-valuemin='"+t.min+"' tabindex='0'",n="<div class='webix_slider_handle webix_slider_handle_0' id='"+i.lb[0]+"' "+e+" aria-valuenow='"+t.value[0]+"'>&nbsp;</div>";n+="<div class='webix_slider_handle webix_slider_handle_1' id='"+i.lb[1]+"' "+e+" aria-valuenow='"+t.value[1]+"'>&nbsp;</div>";var h="<div class='webix_slider_title"+(
t.moveTitle?" webix_slider_move":"")+"'"+(!t.moveTitle&&t.vertical?" style='line-height:"+(t.aheight-i._b-2*t.inputPadding)+"px;'":"")+"></div>";t.moveTitle&&(h="<div class='webix_slider_title_box'>"+(h+h)+"</div>");var r="<div class='webix_slider_right'>&nbsp;</div><div class='webix_slider_left'></div>",o="";return o=t.vertical?"<div class='webix_slider_box'>"+r+n+"</div>"+h:h+"<div class='webix_slider_box'>"+r+n+"</div>",i.$renderInput(t,o,s)}},$prepareValue:function(t){if(b(t)||(t=(t||"").toString().split(this.q.separator)),t[0]=parseFloat(t[0]),t[0]=isNaN(t[0])?0:t[0],t.length<2?t[1]=t[0]:(t[1]=parseFloat(t[1]),t[1]=isNaN(t[1])?0:t[1]),t[0]>t[1]){var i=[t[1],t[0]];t[0]=i[0],t[1]=i[1]}return t},vb:function(t){return t=t&&0<=t?t:0,this.$view.querySelector(".webix_slider_handle_"+(t||0))},Fb:function(t,i){var s,e,n;return e=(s=this.q).max-s.min,n=s.value[i]%s.step?Math.round(s.value[i]/s.step)*s.step:s.value[i],n=Math.max(Math.min(n,s.max),s.min),Math.ceil((t-2*this._b)*(n-s.min)/e)},Tb:function(t,i,s){var e=this._b+i-this.pb/2*(s?-1:1);return(e=s?t-e:e)+"px"},zb:function(t,i,s,e){var n=i+this._b+2*this.mb;return e&&(n=t-n-s),n+"px"},Bp:function(){var t,i,s,e,n,h,r,o,a,u,c;i=this.vb(0),s=this.vb(1),b((t=this.q).value)||this.define("value",t.value),i&&(a=t.vertical?"height":"width",c=t.vertical?"top":"left",h=(u=t.vertical?this.He:this._m(t))-2*this._b-2*this.mb,e=this.Fb(u,0),r=(n=this.Fb(u,1))-e,i.style[c]=this.Tb(u,e,t.vertical),s.style[c]=this.Tb(u,n,t.vertical),(o=i.parentNode).style[a]=u+"px",o.firstChild.style[a]=h+"px",o.childNodes[1].style[a]=r+"px",o.childNodes[1].style[c]=this.zb(u,e,r,t.vertical),this.bb(i,[e,n],h,c))},Vb:0,Hb:function(t,i){D(this.Vb)||(t[this.Vb].style.visibility="visible"),D(i)||(t[i].style.visibility="hidden",this.Vb=i)},bb:function(t,i,s,e){var n=this.q;if(this.q.title){var h=t.parentNode,r=n.vertical?"nextSibling":"previousSibling";if(n.moveTitle){for(var o=h[r].childNodes,a=[],u=0;u<2;u++)a.push(this.Bb(o[u],n.value[u],i[u],s,e,u));var c=n.vertical?a[0]-a[1]-this.pb:a[1]-a[0],f=n.vertical?"clientHeight":"clientWidth";o[0][f]/2+o[1][f]/2>c?this.Hb(o,D(this.yb)?0:this.yb?0:1):this.Hb(o);for(var l=0;l<2;l++)o[l].style[e]=a[l]+"px"}else h[r].innerHTML=this.q.title(this.q,this)}},Bb:function(t,i,s,e,n,h){t.innerHTML=this.q.title({value:i},this);var r=t.clientWidth/2,o=0;return o=this.q.vertical?e-s-this.pb/2-(h?this._b:0)+2*this.mb:(o=s+this.pb/2+2*this.mb-r,o=s<r?r-s+o:o,h&&e<r+s?o-r+(e-s):o)},gb:function(){for(var t=0;t<2;t++)this.vb(t).setAttribute("aria-valuenow",this.q.value[t])},Mb:function(t){var i=t.target||t.srcElement,s=/webix_slider_handle_(\d)/.exec(i.className);this.yb=s?parseInt(s[1],10):-1,s&&this.Rb(this.yb)},$compareValue:function(t,i){return i=this.$prepareValue(i),t[0]===i[0]&&t[1]===i[1]},$getValue:function(){var t=this.q.value;return this.q.stringResult?t.join(this.q.separator):t},Rb:function(t){var i=this.vb(t),s=this.vb(1-t);-1==i.className.indexOf("webix_slider_active")&&(i.className+=" webix_slider_active"),s.className=s.className.replace(" webix_slider_active","")},Ib:function(t){var i=this.q,s=i.value,e=i.max-i.min,n=i.vertical?"y":"x",h=K(this.vb().parentNode)[n],r=Math.ceil((t-h)*e/(i.vertical?this.He:this._m(i)));r=Math.round((r+1*i.min)/i.step)*i.step,i.vertical&&(r=e-r);var o=null,a=K(this.vb(0))[n],u=K(this.vb(1))[n];a!=u||i.value[0]!=i.min&&i.value[0]!=i.max?0<=this.yb?o=this.yb:a==u?o=t<a?0:1:(o=Math.abs(a-t)<Math.abs(u-t)?0:1,this.yb=o):(o=i.value[0]==i.min?1:0,this.Rb(o));return s[o]=o?Math.max(Math.min(r,i.max),s[0]):Math.max(Math.min(r,s[1]),i.min),s}},nr=(H.protoUI(er,sr.view),{name:"switch",defaults:{template:function(t,i){i.Pb();var s=t.name||"x"+z(),e="";t.labelRight&&(e="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||"&nbsp;"));var n=t.checkValue==t.value,h='aria-label="'+(t.label||t.labelRight||"")+'" role="checkbox" tabindex="0" aria-checked="'+(n?"true":"false")+'" '+(t.readonly?"aria-readonly='true'":"")+'"',r='<div class="webix_switch_box '+(n?" webix_switch_on":""
)+'" style="width:'+i.jb+'px"><span class="webix_switch_text">'+((n?t.onLabel:t.offLabel)||"")+'</span><button class="webix_switch_handle" '+h+' style="left:'+(n?i.jb-i.Nb:0)+'px;"><input  id="'+s+'" class="webix_switch_toggle" type="checkbox" '+(n?"checked":"")+"></button></div>"+e;return i.$renderInput(t,r,s)}},$skin:function(){this.Nb=Qi.switchHeight,this.jb=Qi.switchWidth},$setValue:function(t){var i=this.q,s=t==i.checkValue,e=this.$view.querySelector(".webix_switch_box");if(e){var n=e.childNodes[1],h=(s?i.onLabel:i.offLabel)||"";s?st(e,"webix_switch_on"):et(e,"webix_switch_on"),n.style.left=(s?this.jb-this.Nb:0)+"px",n.firstChild.checked=s,n.setAttribute("aria-checked",s?"true":"false"),h&&(e.childNodes[0].innerHTML=h)}},Pb:function(){var t=this.q;if(t.onLabel||t.offLabel){var i=t.onLabel?nt(t.onLabel,"webix_switch_text").width:0,s=t.onLabel?nt(t.offLabel,"webix_switch_text").width:0;this.jb=Math.max(i,s)+this.Nb}},on_click:{webix_switch_box:function(){this.q.readonly||this.toggle()},webix_label_right:function(){this.q.readonly||this.toggle()}}}),hr=(H.protoUI(nr,zh.view),{name:"tabbar",$init:function(){this.attachEvent("onKeyPress",this.je)},$skin:function(){var t=Qi,i=this.defaults;i.topOffset=t.tabTopOffset||0,i.tabOffset="undefined"!=typeof t.tabOffset?t.tabOffset:10,i.bottomOffset=t.tabBottomOffset||0,i.height=t.tabbarHeight,i.tabMargin=t.tabMargin,i.inputPadding=t.inputPadding,i.tabMinWidth=t.tabMinWidth||100,i.tabMoreWidth=t.tabMoreWidth||40,i.borderless=!t.tabBorder},Eb:function(){var t,i,s=this.q,e=this.Lb||s.options,n=this.Up-2*s.tabOffset,h=s.optionWidth||s.tabMinWidth;if(i=e.length,s.tabMinWidth&&n/i<h)return{max:parseInt(n/h,10)||1};if(!s.optionWidth)for(t=0;t<i;t++)e[t].width&&(n-=e[t].width+(t||s.type?0:s.tabMargin),i--);return{width:i?n/i:s.tabMinWidth}},gm:function(){var t=this.q;if(!t.tabbarPopup){var i=Vt({view:"popup",width:t.popupWidth||200,body:{view:"list",borderless:!0,select:!0,css:"webix_tab_list",autoheight:!0,yCount:t.yCount,type:{template:t.popupTemplate}}});i.getBody().attachEvent("onBeforeSelect",C(function(t){if(t&&this.callEvent("onBeforeTabClick",[t]))return this.setValue(t),jt(this.q.tabbarPopup).hide(),this.callEvent("onAfterTabClick",[t]),!0},this)),i.getBody().attachEvent("onAfterSelect",C(function(){this.refresh()},this)),t.tabbarPopup=i.q.id,this.rt.push(i)}this.gm=function(){}},getPopup:function(){return this.gm(),jt(this.q.tabbarPopup)},moreTemplate_setter:Ft,popupTemplate_setter:Ft,defaults:{popupWidth:200,popupTemplate:"#value#",yCount:7,moreTemplate:'<span class="webix_icon wxi-dots"></span>',template:function(t,i){var s,e,n,h,r,o,a,u,c;if(i.Lb=a=i.Tm(t.options),a.length){i.Xp(a),!t.value&&a.length&&(t.value=a[0].id),s="",t.tabOffset&&(s+="<div class='webix_tab_filler' style='width:"+t.tabOffset+"px;'>&nbsp;</div>"),i.Up-2*t.tabOffset-(t.type?0:t.tabMargin*(a.length-1)),u=t.topOffset+t.bottomOffset;var f=i.Eb();if(f.max&&f.max<a.length){var l=i.getPopup();l.hide();var d=l.getBody()||null;if(d)if(f.max){var v=!1;for(e=0;e<a.length&&!v;e++)if(a[e].id==t.value&&(v=!0,e+1>f.max)){var _=a.splice(e,1);a=a.splice(0,f.max-1).concat(_).concat(a)}d.clearAll(),d.parse(a.slice(f.max))}else d.clearAll()}else i.q.tabbarPopup&&jt(i.q.tabbarPopup).hide();o=t.tabOffset;var p=!1;for(e=0;e<a.length&&!p;e++)c=f&&f.max?(f.max==e+1&&(p=!0),(i.Up-2*t.tabOffset-(!t.type&&1<f.max?t.tabMargin*(f.max-1):0)-t.tabMoreWidth)/f.max):f.width,o+=(c=a[e].width||t.optionWidth||c)+(e&&!t.type?t.tabMargin:0),0<t.tabMargin&&e&&!t.type&&(s+="<div class='webix_tab_filler' style='width:"+t.tabMargin+"px;'></div>"),s+=i.Ob(a[e],c),p&&(s+='<div role="button" tabindex="0" aria-label="'+ct.aria.showTabs+'" class="webix_tab_more_icon" style="width:'+t.tabMoreWidth+'px;">'+t.moreTemplate(t,i)+"</div>",o+=t.tabMoreWidth);0<(n=i.ze-o)&&!t.type&&(s+="<div class='webix_tab_filler' style='width:"+n+"px;'>&nbsp;</div>")}else s="<div class='webix_tab_filler' style='width:"+i.Up+"px; border-right:0px;'></div>";return h="",r=u&&!t.type?"height:"+(i.He-u)+"px":"",t.topOffset&&!t.type&&(
h+="<div class='webix_before_all_tabs' style='width:100%;height:"+t.topOffset+"px'></div>"),h+="<div style='"+r+"' role='tablist' class='webix_all_tabs "+(t.type?"webixtype_"+t.type:"")+"'>"+s+"</div>",t.bottomOffset&&!t.type&&(h+="<div class='webix_after_all_tabs' style='width:100%;height:"+t.bottomOffset+"px'></div>"),h}},Fa:function(){return this.$view.querySelectorAll(".webix_item_tab")},Ob:function(t,i){var s,e="",n=this.config;if(t.id==n.value&&(e=" webix_selected"),t.css&&(e+=" "+t.css),i=t.width||i,s='<div class="webix_item_tab'+e+'" button_id="'+t.id+'" role="tab" aria-selected="'+(t.id==n.value?"true":"false")+'" tabindex="'+(t.id==n.value?"0":"-1")+'" style="width:'+i+'px;">',this.Ub){var h=this.He-2*n.inputPadding-2,r=this.He-2,o=H.extend({cheight:h,aheight:r},t);s+=this.Ub(o)}else{s+=(t.icon?"<span class='webix_icon "+t.icon+"'></span> ":"")+t.value}return(t.close||n.close)&&(s+="<span role='button' tabindex='0' aria-label='"+ct.aria.closeTab+"' class='webix_tab_close webix_icon wxi-close'></span>"),s+="</div>"},ld:{image:"<div class='webix_img_btn_top' style='height:#cheight#px;background-image:url(#image#);'><div class='webix_img_btn_text'>#value#</div></div>",icon:"<div class='webix_img_btn' style='line-height:#cheight#px;height:#cheight#px;'><span class='webix_icon_btn #icon#' style='max-width:#cheight#px;max-height:#cheight#px;'></span>#value#</div>",iconTop:"<div class='webix_img_btn_top' style='height:#cheight#px;width:100%;top:0px;text-align:center;'><span class='webix_icon #icon#'></span><div class='webix_img_btn_text'>#value#</div></div>"},type_setter:function(t){return this.q.tabOffset=0,this.ld[t]&&(this.Ub=Ft(this.ld[t])),t}}),rr=(H.protoUI(hr,Yh.view),{name:"richtext",defaults:{label:"",labelWidth:80,labelPosition:"left"},$init:function(){this.nt.className+=" webix_richtext",this.$ready.unshift(this.Yb)},getInputNode:function(){return this.$view.querySelector(".webix_richtext_editor")},Wb:function(t){return{view:"toggle",type:"iconButton",icon:"wxi-"+t,name:t,id:t,label:ct.richtext[t],autowidth:!0,action:t,click:this.Gb}},Yb:function(){var t=this,i={view:"template",css:"webix_richtext_container",borderless:!0,template:"<div class='webix_richtext_editor' contenteditable='true'>"+this.getValue()+"</div>",on:{onAfterRender:function(){t.Np=!0,Lt(t.getInputNode(),"blur",function(){t.Xb(this.innerHTML)}),Lt(t.getInputNode(),"keyup",function(){t.Jb()})}},onClick:{webix_richtext_editor:function(){t.Jb()}}},s={view:"toolbar",id:"toolbar",elements:[this.Wb("underline"),this.Wb("bold"),this.Wb("italic"),{}]},e=[s,i];"top"!==this.config.labelPosition&&this.config.labelWidth?(this.config.borderless=!0,this.cols_setter([{template:this.config.label||" ",css:"webix_richtext_inp_label"+(this.config.required?" webix_required":""),borderless:!0,width:this.config.labelWidth},{rows:e}])):(s.elements.concat([{view:"label",label:this.config.label,align:"right"},{width:4}]),this.rows_setter(e))},Jb:function(){var t;this.$$("toolbar").setValues({italic:!1,underline:!1,bold:!1}),t=window.getSelection?window.getSelection():document.selection.createRange();for(var i=0;i<t.rangeCount;++i)this.$view.contains(this.getInputNode())&&(document.queryCommandState("bold")&&this.$$("bold").setValue(!0),document.queryCommandState("underline")&&this.$$("underline").setValue(!0),document.queryCommandState("italic")&&this.$$("italic").setValue(!0))},refresh:function(){this.Np&&(this.getInputNode().innerHTML=this.config.value)},Kb:function(t,i){var s;if(0<(window.getSelection()?(s=window.getSelection()).toString().length:(s=document.selection.createRange()).text.length))for(var e=0;e<s.rangeCount;++e){var n=s.getRangeAt(e);if(s.isCollapsed){var h=s.focusNode.textContent,r=s.focusNode,o=s.anchorOffset,a=h.substring(0,o).match(/[A-Za-z]*$/)[0],u=h.substring(o).match(/^[A-Za-z]*/)[0],c=o-a.length,f=o+u.length;n.setStart(r,c),n.setEnd(r,f),s.removeAllRanges(),window.getSelection().addRange(n),document.execCommand(i,!1,"")}else document.execCommand(i,!1,"")}},Gb:function(){var t=this.getTopParentView(),i=t.getInputNode();this.$view.contains(
this.getInputNode())&&t.Kb(i,this.config.action)},focus:function(){if(!Vi.canFocus(this))return!1;this.$view.querySelector(".webix_richtext_editor").focus()},Xb:function(t){var i=this.config.value;this.config.value=t||"",i!==t&&this.callEvent("onChange",[t,i])},setValue:function(t){this.Xb(t),this.refresh()},getValue:function(){this.getInputNode()&&(this.config.value=this.getInputNode().innerHTML);var t=this.config.value;return t||(0===t?"0":"")}});H.protoUI(rr,Es,An.view);Tt(Zh.view,{name:"uploader",template:"{common.removeIcon()}{common.percent()}<div style='float:right'>#sizetext#</div>{common.fileName()}",percent:function(t){return"transfer"==t.status?"<div style='width:60px; text-align:center; float:right'>"+t.percent+"%</div>":"<div class='webix_upload_"+t.status+"'><span class='"+("error"==t.status?"error_icon":"webix_icon wxi-check")+"'></span></div>"},removeIcon:function(){return"<div class='webix_remove_upload'><span class='cancel_icon'></span></div>"},fileName:function(t){return"<div style='text-overflow:ellipsis; white-space:nowrap; overflow:hidden; padding-right:8px;'>"+t.name+"</div>"},on_click:{webix_remove_upload:function(t,i){jt(this.config.uploader).files.remove(i)}}});var or={name:"uploader",defaults:{autosend:!0,multiple:!0,inputName:"upload"},$cssName:"button webix_uploader",$allowsClear:!0,on_click:{webix_hidden_upload:function(){return!1}},send:function(){},fileDialog:function(){},stopUpload:function(){},$init:function(){var t=Ce.html5;this.files=new Ih,this.rt=[this.files],(D(XMLHttpRequest)||D((new XMLHttpRequest).upload))&&(t=Ce.flash),H.extend(this,t,!0)},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&this.render()},apiOnly_setter:function(t){return $(this.render,this),this.$apiOnly=t},hf:function(t){for(var i=0;i<t.length;i++)this.addFile(t[i])},link_setter:function(t){return t&&$(function(){var t=jt(this.q.link);if(!t){var i=this.getTopParentView();i.$$&&(t=i.$$(this.q.link))}t.sync&&t.filter?t.sync(this.files):t.setValues&&this.files.data.attachEvent("onStoreUpdated",function(){t.setValues(this)}),t.q.uploader=this.q.id},this),t},addFile:function(t,i,s,e){var n=null;"object"==k(t)&&(t=(n=t).name,i=n.size);var h=this.ef(i);s=s||t.split(".").pop();var r={file:n,name:t,id:z(),size:i,sizetext:h,type:s,context:this.uf,status:"client"};if(n&&n.webkitRelativePath&&(r.name=n.webkitRelativePath),e&&H.extend(r,e,!0),this.callEvent("onBeforeFileAdd",[r])){this.q.multiple||this.files.clearAll();var o=this.files.add(r);this.callEvent("onAfterFileAdd",[r]),o&&this.q.autosend&&this.send(o)}return r},"if":function(t){var i=this.q.upload,s=H.extend(t.urlData||{},this.q.urlData||{});if(i&&s){var e=[];for(var n in s)e.push(encodeURIComponent(n)+"="+encodeURIComponent(s[n]));e.length&&(i+=(-1==i.indexOf("?")?"?":"&")+e.join("&"))}return i},addDropZone:function(t,i){var s=A(t),e="";i&&(e=" "+L({content:'"'+i+'"'},":before"));var n="webix_drop_file"+e,h=null;Lt(s,"dragover",Q),Lt(s,"dragover",function(){st(s,n,!0),h&&(clearTimeout(h),h=null)}),Lt(s,"dragleave",function(){h=setTimeout(function(){et(s,n)},150)}),Lt(s,"drop",C(function(t){return et(s,n),this.nf(t),Q(t)},this))},ef:function(t){for(var i=0;1024<t;)i++,t/=1024;return Math.round(100*t)/100+" "+ct.fileSize[i]},ff:function(t,i){var s=this.files.getItem(t);H.extend(s,i,!0),s.status="server",s.progress=100,this.callEvent("onFileUpload",[s,i]),this.callEvent("onChange",[]),this.files.updateItem(t),this.isUploaded()&&this.sf(i)},sf:function(t){this.callEvent("onUploadComplete",[t]),this.tf&&(this.tf.call(this,t),this.tf=0)},isUploaded:function(){for(var t=this.files.data.order,i=0;i<t.length;i++)if("server"!=this.files.getItem(t[i]).status)return!1;return!0},$onUploadComplete:function(){},$updateProgress:function(t,i){this.files.getItem(t).percent=Math.round(i),this.files.updateItem(t)},setValue:function(t){"string"==typeof t&&t&&(t={value:t,status:"server"}),this.files.clearAll(),t&&this.files.parse(t),this.callEvent("onChange",[])},getValue:function(){var i=[];return this.files.data.each(function(t){"server"==t.status&&i.push(t.value||t.name)}),
i.join(",")}},ar=(H.protoUI(or,yh.view),{name:"suggest",defaults:{autofocus:!1,type:"list",keyPressTimeout:1,body:{yCount:10,autoheight:!0,body:!0,select:!0,borderless:!0,navigation:!0},filter:function(t,i){return 0===t.value.toString().toLowerCase().indexOf(i.toLowerCase())}},template_setter:Ft,filter_setter:function(t){return m(t,this.$scope)},$init:function(t){var i={};H.extend(i,B(this.defaults.body)),i.view=t.type||this.defaults.type;var s=this.qb(i);t.body&&H.extend(s,t.body,!0),t.data&&(s.data=t.data),t.url&&(s.url=t.url),t.datatype&&(s.datatype=t.datatype),t.id&&(i.id=i.id||t.id+"_"+i.view),t.body=i,this.$ready.push(this.Zb),this.attachEvent("onShow",function(){if(this.q.master){var t=jt(this.q.master);if(t)(t.nb?t.nb():t.getInputNode()).setAttribute("aria-expanded","true")}this.Qb()}),this.attachEvent("onHide",function(){if(this.q.master){var t=jt(this.q.master);if(t)(t.nb?t.nb():t.getInputNode()).setAttribute("aria-expanded","false")}}),this.tg={}},qb:function(t){return t},ig:function(t){var i,s,e="";t&&this.q.master&&((s=(i=jt(this.q.master)).getInputNode())&&i.$setValueHere?i.$setValueHere(t.value):s&&(i.options_setter?e=this.getItemText(t.id):t.value&&(e=i.ym?i.ym(t.value):t.value.toString()),D(s.value)?s.innerHTML=e:s.value=e.replace(/<[^>]*>/g,""))),(s=s||this.No)&&s.focus()},setMasterValue:function(t,i){var s=t.id?this.getItemText(t.id):t.text||t.value;if(this.q.master){var e=jt(this.q.master);i&&t.id?e.refresh():e.options_setter?e.setValue(t.$empty?"":t.id):e.setValueHere?e.setValueHere(s):e.setValue(s)}else this.No&&(this.No.value=s);i||(this.hide(!0),this.No&&this.No.focus()),this.callEvent("onValueSuggest",[t,s]),$(function(){I("onEditEnd",[])})},getMasterValue:function(){return this.q.master?jt(this.q.master).getValue():null},getItemId:function(t){var i=this.getList();for(var s in i.data.pull){var e=i.getItem(s);if(this.q.filter.call(this,e,t))return e.id}},getItemText:function(t){var i=this.getList().getItem(t);if(!i)return this.tg[t]||"";if(this.q.template)return this.q.template.call(this,i,this.type);if(this.q.textValue)return""+i[this.q.textValue];var s=this.getList().type,e=s.template.call(s,i,s);return this.tg[t]=e},getSuggestion:function(t){var i,s=this.getList(),e=s.data.order;return s.getSelectedId&&(i=s.getSelectedId()),t&&e.length&&(!i||e.find(i)<0)&&(i=e[0],!s.config.dataFeed&&!this.config.filter.call(this,s.data.pull[i],t))?null:(i&&"object"==k(i)&&(i+=""),i)},getList:function(){return this.Z},Zb:function(){var i=this.getList(),t=this.q.type;i.count?(i.attachEvent("onItemClick",C(function(t){this.setMasterValue(i.getItem(t))},this)),i.data.attachEvent("onstoreupdated",C(function(t,i,s){"delete"==s&&t==this.getMasterValue()?this.setMasterValue({id:"",text:""},1):"update"==s&&t==this.getMasterValue()&&this.setMasterValue(i,1)},this)),i.data.attachEvent("onAfterFilter",C(this.qm,this)),i.data.attachEvent("onStoreLoad",C(this.qm,this)),D(this.q.fitMaster)&&(this.q.fitMaster=!0)):"calendar"==t?(i.attachEvent("onDateSelect",function(){this.getParentView().setMasterValue({value:i.getSelectedDate()},i.config.multiselect)}),i.attachEvent("onTodaySet",function(t){this.getParentView().setMasterValue({value:t})}),i.attachEvent("onDateClear",function(t){this.getParentView().setMasterValue({value:t})})):"colorboard"==t&&i.attachEvent("onItemClick",function(t){this.getParentView().setMasterValue({value:t})})},input_setter:function(t){return this.linkInput(t),0},linkInput:function(i){var s;i.getInputNode?(s=i.getInputNode()).webix_master_id=i.q.id:s=A(i),Lt(s,"keydown",function(t){s==document.body&&!this.isVisible()||(i.config?i.config.readonly:s.getAttribute("readonly"))||this.sg(t)},{bind:this}),i.nb&&(s=i.nb()),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),"DIV"===s.tagName&&(s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true")),this.eg=!0},sg:function(t){t=t||event;var s=this.getList(),e=t.target||t.srcElement;if((e!=document.body||this.isVisible())&&"webix_clipbuffer"!=e.className){this.No=e,this.q.master=e.webix_master_id,
window.clearTimeout(this.ng);var i=t.keyCode;if(16!=i&&17!=i)return 9==i?this.hg(this,s):27==i?this.rg(this,s):13==i?this.$enterKey(this,s):this.og(t)?(Q(t),!1):void(D(e.value)||(clearTimeout(this.ag),this.ag=$(function(){if(this.eg||Vi.getFocus()==jt(this.q.master)){this.ug=!0;var i=e.value;s.config.dataFeed?s.filter("value",i):s.filter&&s.filter(C(function(t){return this.q.filter.call(this,t,i)},this))}},this,[],this.q.keyPressTimeout)))}},qm:function(){if(!this.ug)return!0;this.ug=!1,0<this.getList().count()?(this.adjust(),this.isVisible()||(this.Km=!0),this.show(this.No,null,!0),this.Km=!1):(this.hide(!0),this.No=null)},show:function(t){if(!this.isVisible()){var i=this.getList();i.filter&&!this.Km&&i.filter(""),this.$customWidth&&(this.q.fitMaster||!this.q.width||D(this.q.fitMaster))&&this.$customWidth(t),t.tagName&&this.q.fitMaster&&(this.q.width=t.offsetWidth-2),i.fd&&i.render(),this.adjust(),"INPUT"==t.tagName&&(this.No=t)}nh.api.show.apply(this,arguments)},Qb:function(t){t=t||this.getList();var i=this.getMasterValue();t.select&&t.showItem?i&&t.exists&&t.exists(i)?(t.select(i),t.showItem(i)):(t.unselect(),t.showItem(t.getFirstId())):t.setValue&&(this.q.master&&(i=jt(this.q.master).$prepareValue(i)),t.setValue(i))},$enterKey:function(t,i){var s;t.isVisible()?(i.count&&i.count()?(s=i.getSelectedId(!1,!0),1==i.count()&&i.getFirstId()!=s&&(s=i.getFirstId()),s&&(s=i.getItem(s))):i.getSelectedDate&&i.getSelectedDate()?s={value:i.getSelectedDate()}:i.getValue&&i.getValue()&&(s={value:i.getValue()}),s&&this.setMasterValue(s),t.hide(!0)):t.show(this.No)},rg:function(t){return t.hide(!0)},hg:function(t){return t.hide(!0)},og:function(t){var i,s=this.getList(),e=t.keyCode;if(!(s.moveSelection&&e<41&&32<e)||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return!1;if(40===e){this.isVisible()||this.show(this.No),s.moveSelection("down",!1,!1)}else{if(s.count&&38!==e||!s.count&&!s.isVisible())return!1;var n;33==e&&(n="pgup"),34==e&&(n="pgdown"),35==e&&(n="bottom"),36==e&&(n="top"),37==e&&(n="left"),38==e&&(n="up"),39==e&&(n="right"),s.moveSelection(n,!1,!1)}return s.count?i=s.getSelectedItem():s.getSelectedDate?i={value:s.getVisibleDate()}:s.getValue&&(i={value:s.getValue()}),this.ig(i),!0},getValue:function(){var t=this.getList(),i=(t.getValue?t.getValue():t.getSelectedId())||"";if(i=i.id||i,t.getItem){var s=t.getItem(i);if(s&&s.$empty)return""}return i},setValue:function(t){var i=this.getList();t?i.exists(t)&&(i.select(t),i.showItem(t)):(i.unselect(),i.showItem(i.getFirstId()))}}),ur={api:ar,view:H.protoUI(ar,nh.view)},cr={name:"multisuggest",defaults:{separator:",",type:"layout",button:!0,width:0,filter:function(t,i){return-1<this.getItemText(t.id).toString().toLowerCase().indexOf(i.toLowerCase())},body:{rows:[{view:"list",type:"multilist",borderless:!0,autoheight:!0,yCount:5,multiselect:"touch",select:!0,on:{onItemClick:function(t){var i=this.getParentView().getParentView();$(function(){i.cg(t)})}}},{view:"button",click:function(){var t=this.getParentView().getParentView();t.setMasterValue({id:t.getValue()}),t.hide()}}]}},cg:function(t,i,s){var e=this.getValue(),n=s||p(e?this.getValue().split(this.q.separator):[]),h=jt(this.q.master);if(s||(n.find(t)<0?n.push(t):n.remove(t)),h)h.setValue(n.join(this.q.separator));else{var r=this.setValue(n);this.No&&(this.No.value=r.join(this.q.separator))}if(i){var o=this.getList().getItemNode(t).getElementsByTagName("SPAN");o&&o.length&&o[0].focus()}},qb:function(t){return t.rows[0]},Zb:function(){var t=this.getButton(),i=this.q.button?this.q.buttonText||ct.combo.select:0;if(t&&(i?(t.q.value=i,t.refresh()):t.hide()),this.q.selectAll)return this.getBody().getChildViews()[0].show();this.getList().data.attachEvent("onAfterFilter",C(function(){return this.qm()},this))},Qb:function(){var t=this.getList(),i=this.getMasterValue();if(i&&(i=i.toString().split(this.config.separator))[0])for(var s=0;s<i.length;s++)t.exists(i[s])&&t.select(i[s],!0)},getButton:function(){return this.getBody().getChildViews()[1]},getList:function(){return this.getBody().getChildViews()[0]},setValue:function(t){var i=[],
s=this.getList();if(s.unselect(),t&&(b(t)||(t=t.toString().split(this.config.separator)),t[0]))for(var e=0;e<t.length;e++)s.getItem(t[e])&&(s.exists(t[e])&&s.select(t[e],!0),i.push(this.getItemText(t[e])));return this.q.value=t?t.join(this.config.separator):"",i},getValue:function(){return this.q.value}},fr={api:cr,view:H.protoUI(cr,ur.view)},lr={name:"checksuggest",defaults:{button:!1,selectAll:!1,body:{rows:[{view:"checkbox",hidden:!0,customCheckbox:!1,borderless:!1,css:"webix_checksuggest_select_all",labelRight:ct.combo.selectAll,labelWidth:0,value:0,height:28,inputHeight:20,on:{onItemClick:function(t){for(var i=this.getParentView().getParentView(),s=i.getList(),e=s.data.order,n=0;n<e.length;n++){s.getItem(e[n]).$checked=this.getValue()}var h=this.getValue()?[].concat(e):[];i.cg(e[0],t,h),s.refresh()},onChange:function(){var t=this.$view.querySelector("label"),i=ct.combo;t.textContent=this.getValue()?i.unselectAll:i.selectAll},onAfterRender:function(){var t=this.getParentView().getParentView();this.setValue(1*t.fg())}}},{view:"list",css:"webix_multilist",borderless:!0,autoheight:!0,yCount:5,type:"checklist",on:{onItemClick:function(t,i){var s=this.getItem(t);s.$checked=s.$checked?0:1,this.refresh(t);var e=this.getParentView().getParentView();e.Wm=new Date,e.cg(t,i),e.config.selectAll&&(s.$checked?e.fg()&&e.getBody().Ks[0].setValue(1):e.getBody().Ks[0].setValue(0))}}},{view:"button",click:function(){var t=this.getParentView().getParentView();t.setMasterValue({id:t.getValue()}),t.hide()}}]}},fg:function(){return(this.getValue()||"").split(this.config.separator).length===this.getList().count()},qb:function(t){return t.rows[1]},getButton:function(){return this.getBody().getChildViews()[2]},getList:function(){return this.getBody().getChildViews()[1]},$init:function(){this.ab={},this.$ready.push(this.lg)},lg:function(){var t=this.getList();if(t.config.dataFeed){var i=this;t.attachEvent("onAfterLoad",function(){i.setValue(i.q.value)}),t.getItem=function(t){return this.data.pull[t]||i.ab[t]}}this.config.master&&!this.config.selectAll&&this.getBody().getChildViews()[0].hide()},$enterKey:function(t,i){if(i.count&&i.count())if(t.isVisible()){var s=i.getSelectedId(!1,!0);s&&this.cg(s),t.hide(!0)}else t.show(this.No);else t.isVisible()&&t.hide(!0)},Qb:function(){var t=this.getList();t.select&&t.unselect()},setValue:function(t){var i,s=this.getList(),e=[],n={},h=[];for(b(t=t||[])?s.config.dataFeed&&(t=this.tb(t)):t=t.toString().split(this.config.separator),i=0;i<t.length;i++)n[t[i]]=1,s.getItem(t[i])&&(this.ab&&(this.ab[t[i]]=B(s.getItem(t[i]))),e.push(this.getItemText(t[i])));for(s.data.each(function(t){t.$checked?n[t.id]||(t.$checked=0,h.push(t.id)):n[t.id]&&(t.$checked=1,h.push(t.id))},this,!0),i=0;i<h.length;i++)s.refresh(h[i]);return this.q.value=t.length?t.join(this.config.separator):"",e},getValue:function(){return this.q.value},ig:function(){var t;this.q.master&&(t=jt(this.q.master).getInputNode()),(t=t||this.No)&&t.focus()},tb:function(t){if(t&&b(t)){for(var i=[],s=0;s<t.length;s++)t[s].id?(this.ab[t[s].id]=B(t[s]),i.push(t[s].id)):i.push(t[s]);t=i}return t}},dr=(H.protoUI(lr,fr.view),H.protoUI({name:"datasuggest",defaults:{type:"dataview",fitMaster:!1,width:0,body:{xCount:3,autoheight:!0,select:!0}}},ur.view),{name:"gridsuggest",defaults:{type:"datatable",fitMaster:!1,width:0,body:{navigation:!0,autoheight:!0,autowidth:!0,select:!0},filter:function(t,i){return 0===this.config.template(t).toString().toLowerCase().indexOf(i.toLowerCase())}},$init:function(t){t.body.columns||(t.body.autoConfig=!0),t.template||(t.template=C(this.dg,this))},dg:function(t){var i=this.getBody(),s=this.config.textValue||i.config.columns[0].id;return i.getText(t.id,s)}}),vr=(H.protoUI(dr,ur.view),{name:"daterangesuggest",defaults:{type:"daterange",body:{view:"daterange",icons:!0,button:!0,borderless:!0}},getValue:function(){return this.getRange().getValue()},setValue:function(t){this.getRange().setValue(B(t))},getRange:function(){return this.getBody()},getButton:function(){return this.getBody().getChildViews()[1].getChildViews()[1]},vg:function(t,
i){var s=jt(this.q.master);s?(s.setValue(t),i&&this.hide()):this.setValue(t)},Zb:function(){var t=this.getRange();t.attachEvent("onAfterDateSelect",C(function(t){this.vg(t)},this)),t.attachEvent("onDateClear",C(function(t){this.vg(t)},this)),t.attachEvent("onTodaySet",C(function(t){this.vg(t)},this))}}),_r=(H.protoUI(vr,ur.view),{$cssName:"datepicker",name:"daterangepicker",$init:function(t){this.q.value={},delete t.type},gm:function(){var t=this.q;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({view:"daterangesuggest",body:{timepicker:t.timepicker,calendarCount:t.calendarCount,height:250+(t.button||t.icons?30:0)}})),this.Zn=function(){}},$prepareValue:function(t){return(t=t||{}).start=Bh.api.$prepareValue.call(this,t.start?t.start:null),t.end=Bh.api.$prepareValue.call(this,t.end?t.end:null),B(jt(this.q.popup).getRange().cd(t))},$compareValue:function(t,i){var s=Bh.api.$compareValue,e=s.call(this,t.start,i.start),n=s.call(this,t.end,i.end);return e&&n},$setValue:function(t){t=t||{},this.q.text=(t.start?this.ym(t.start):"")+(t.end?" - "+this.ym(t.end):""),this.km()},$render:function(t){t.value=this.$prepareValue(t.value),this.$setValue(t.value)},getValue:function(){var t=this.q.value;if(this.q.stringResult){var i=ct.parseFormatStr;return this._g(i,t)}return t||null},_g:function(t,i){return i.start&&(i.start=t(i.start)),i.end&&(i.end=t(i.end)),i}}),pr=(H.protoUI(_r,Bh.view),H.protoUI({name:"excelbar",defaults:{padding:0,type:"line"},$init:function(t){t.cols=[{view:"tabbar",options:[""],optionWidth:200,borderless:!0,on:{onaftertabclick:function(){this.getParentView().callEvent("onExcelSheetSelect",[this.getValue()])}}}]},getValue:function(){return this.getInput().getValue()},setValue:function(t){return this.getInput().setValue(t)},getInput:function(){return this.getChildViews()[0]},setSheets:function(t){var i=this.getInput();i.config.options=t,i.refresh()}},rh.view),{name:"vscroll",$apiOnly:!0,defaults:{scroll:"x",scrollStep:40,scrollPos:0,scrollSize:18,scrollVisible:1,zoom:1},$init:function(t){var i=t.scroll||"x",s=this.nt=A(t.container);s.className+=" webix_vscroll_"+i,s.innerHTML="<div class='webix_vscroll_body'></div>",Lt(s,"scroll",this.pg,{bind:this}),this.Fh=0},reset:function(){this.config.scrollPos=0,this.nt["x"==this.config.scroll?"scrollLeft":"scrollTop"]=0},mg:function(t){return 15e5<t?(this.q.zoom=t/1e6,t=1e6):this.q.zoom=1,t},scrollWidth_setter:function(t){return t=this.mg(t),this.nt.firstChild.style.width=t+"px",t},scrollHeight_setter:function(t){return t=this.mg(t),this.nt.firstChild.style.height=t+"px",t},sizeTo:function(t,i,s){t=t-(i||0)-(s||0);var e=this.q.scrollSize;S.isIE&&e&&(e+=1),e||!this.q.scrollVisible||S.$customScroll||(this.nt.style.pointerEvents="none",e=14),e?(this.nt.style.display="block",i&&(this.nt.style.marginTop=i+"px"),this.nt.style["x"==this.q.scroll?"width":"height"]=Math.max(0,t)+"px",this.nt.style["x"==this.q.scroll?"height":"width"]=e+"px"):this.nt.style.display="none",this.Fh=t},getScroll:function(){return Math.round(this.q.scrollPos*this.q.zoom)},getSize:function(){return Math.round((this.q.scrollWidth||this.q.scrollHeight)*this.q.zoom)},scrollTo:function(t){t<0&&(t=0);var i=this.q;if((t/=i.zoom)<0&&(t=0),t!=this.q.scrollPos)return this.nt["x"==i.scroll?"scrollLeft":"scrollTop"]=t,this.gg(t,!0),!0},pg:function(){var t=this.nt["x"==this.q.scroll?"scrollLeft":"scrollTop"];Math.floor(t)!=Math.floor(this.q.scrollPos)&&this.gg(t,!1)},gg:function(t,i){var s=this.q.scrollWidth||this.q.scrollHeight;t>=s-this.Fh/(i?this.q.zoom:1)&&(t=Math.max(0,s-this.Fh/this.q.zoom)),this.q.scrollPos=t||0,this.callEvent("onScroll",[this.getScroll()])},activeArea:function(t,i){this.wg=i,Lt(t,S.isIE8?"mousewheel":"wheel",this.xg,{bind:this,passive:!1}),this.yg(t)},yg:function(t){!S.touch&&window.navigator.pointerEnabled&&(st(t,"webix_scroll_touch_ie",!0),Lt(t,"pointerdown",function(t){"touch"!=t.pointerType&&"pen"!=t.pointerType||(this.ei=Mi.Ji(t),this.Mg=this.getScroll())},{bind:this}),Ot(document.body,"pointermove",function(t){var i;this.ei&&(this.ni=Mi.Ji(t),
"x"==this.q.scroll?i=this.ni.x-this.ei.x:"y"==this.q.scroll&&(i=this.ni.y-this.ei.y),i&&5<Math.abs(i)&&this.scrollTo(this.Mg-i))},{bind:this}),Ot(window,"pointerup",function(){this.ei&&(this.ei=this.ni=null)},{bind:this}))},xg:function(t){var i=0,s=0===t.deltaMode?30:1;if(S.isIE8&&(i=t.detail=-t.wheelDelta/30),t.deltaX&&Math.abs(t.deltaX)>Math.abs(t.deltaY)?this.wg&&this.q.scrollVisible&&(i=t.deltaX/s):!this.wg&&this.q.scrollVisible&&(i=D(t.deltaY)?t.detail:t.deltaY/s),S.isSafari&&(this.Sg=t.target||t.srcElement),i&&this.scrollTo(this.getScroll()+i*this.q.scrollStep))return Q(t)}}),mr=(H.protoUI(pr,g,Hi),{kg:function(){this.Cg=!0,this.Dg={},this.define("select","area"),this.attachEvent("onAfterScroll",function(){this.refreshSelectArea()}),this.attachEvent("onAfterRender",function(){this.refreshSelectArea()}),this.attachEvent("onBeforeColumnHide",function(t){this.$g=this.getColumnIndex(t)}),this.attachEvent("onAfterColumnHide",function(){this.Ag(this.$g)}),this.attachEvent("onAfterRender",function(){this.Ig()}),this.Fg=function(t,i,s,e){if(t.row&&i.row){if(s)return this.addSelectArea(t,i,!0),!(this.Cg=!0);if(!this.callEvent("onAreaDrag",[t,i,e]))return!1;this.Tg||!this.Cg||this.q.multiselect&&e&&e.ctrlKey||(this.removeSelectArea(),this.Cg=!1)}},this.attachEvent("onBeforeAreaAdd",this.zg),Lt(this.Yt,"mousedown",this.Vg,{bind:this})},Hg:!0,Ag:function(t){var i=this.Dg;for(var s in i){var e=i[s];if(this.getColumnIndex(e.start.column)<0)if(e.start.column==e.end.column)this.removeSelectArea(e.name);else{var n=this.columnId(t+1);n&&this.Bg(e.name,{row:e.start.row,column:n},null)}else if(this.getColumnIndex(e.end.column)<0){var h=this.columnId(t-1);h&&this.Bg(e.name,null,{row:e.end.row,column:h})}}},Rg:function(t,i,s,e){var n,h,r,o,a,u,c,f;if(i){n=this.getColumnIndex(i.start.column),h=this.getColumnIndex(i.end.column),r=this.getIndexById(i.start.row),o=this.getIndexById(i.end.row),a=this.getColumnIndex(t.column),u=this.getIndexById(t.row),c=this.getIndexById(i.init.row),f=this.getColumnIndex(i.init.column),a<n||"left"==s?"left"===s&&e.ctrl?(n=this.Pg(c,n,s),h=f):"left"===s&&f<h?h--:n=a:(h<=a||"right"==s)&&("right"==s&&e.ctrl?(h=this.Pg(c,h,s),n=f):"right"==s&&n<f?n++:h=a),u<r||"up"==s?"up"==s&&e.ctrl?(r=this.Pg(r,f,s),o=c):"up"==s&&c<o?o--:r=u:(o<u||"down"==s)&&("down"==s&&e.ctrl?(o=this.Pg(o,f,s),r=c):"down"==s&&r<c?r++:o=u);var l={row:this.getIdByIndex(r),column:this.columnId(n)},d={row:this.getIdByIndex(o),column:this.columnId(h)};this.callEvent("onBeforeBlockSelect",[l,d,!0])&&(this.Bg(i.name,l,d),this.callEvent("onSelectChange",[]),this.callEvent("onAfterBlockSelect",[l,d]))}},Pg:function(t,i,s){var e=this.config.columns,n=this.data.order,h=this.data.pull[n[t]],r=e[i].id,o=0;if("right"==s)for(var a=i+1;a<e.length;a++){if(h[e[a].id]){o=a;break}o=a}else if("left"==s){for(var u=i-1;0<=u;u--)if(h[e[u].id]){o=u;break}}else if("down"==s)for(var c=t+1;c<n.length;c++){if(this.getItem(n[c])[r]){o=c;break}o=c}else if("up"==s)for(var f=t-1;0<=f;f--)if(this.getItem(n[f])[r]){o=f;break}return o},Bg:function(t,i,s,e){var n=this.Dg[t];if(!n)return!1;var h=B(n),r={start:i||n.start,end:s||n.end};this.zg(r),H.extend(n,r,!0),this.refreshSelectArea(),this.Ig(h),e&&this.callEvent("onSelectChange",[])},areaselect_setter:function(t){return t&&(this.kg(),this.kg=function(){}),this.define("blockselect",t),t},addSelectArea:function(t,i,s,e,n,h){var r,o,a,u,c;r=this.getIndexById(t.row),o=this.getIndexById(i.row),a=this.getColumnIndex(t.column),o<r&&(c=r,r=o,o=c),(u=this.getColumnIndex(i.column))<a&&(c=a,a=u,u=c),e=e||this.Tg||z(),this.Tg=null;var f={start:{row:this.getIdByIndex(r),column:this.columnId(a)},end:{row:this.getIdByIndex(o),column:this.columnId(u)}};if(n&&(f.css=n),(h||!1===h)&&(f.handle=h),this.Dg[e])return this.Bg(e,f.start,f.end,!0);f.handle=!0,f.name=e,f.init=f.start,this.callEvent("onBeforeAreaAdd",[f])&&(this.jg=e,s||this.removeSelectArea(),this.Dg[f.name]=f,this.Ng.push(f),this.refreshSelectArea(),this.Ig(),this.callEvent("onAfterAreaAdd",[f]),this.callEvent("onSelectChange",[]))},Eg:function(){var t=Y("DIV")
;return t.className="webix_area_selection_layer",t.style.top=this.Lg+"px",t},refreshSelectArea:function(){var t,i,s,e,n=null,h=null,r=null,o=this.q.prerender;if(this.Og){t=this.Ug(o),i=this.Yg(!0===o),this.Wg||(this.Wg=this.Eg(),this.Yt.childNodes[1].appendChild(this.Wg),this.Gg=this.Eg(),this.Yt.childNodes[0].appendChild(this.Gg),this.Xg=this.Eg(),this.Yt.childNodes[2].appendChild(this.Xg)),this.Wg.innerHTML="",this.Gg.innerHTML="",this.Xg.innerHTML="";var a=this.q.leftSplit,u=this.q.rightSplit;for(s in this.Dg){e=this.Dg[s];var c=this.Jg(e,t,i);if(null!==c){var f=this.getColumnIndex(e.start.column),l=this.getColumnIndex(e.end.column);if(c.r0<=c.r1){if(this.q.topSplit&&this.q.topSplit<=void 0&&void 0<this.Kg)return!1;f<a&&(h=this.qg(c.r0,f,c.r1,Math.min(l,a-1))),c.c0<=c.c1&&(n=this.qg(c.r0,c.c0,c.r1,c.c1)),u&&l>=this.Zg&&(r=this.qg(c.r0,Math.max(f,this.Zg),c.r1,l)),(h||n||r)&&this.Qg(h,n,r,s,e.css,e.handle)}}else this.removeSelectArea(s)}}},Jg:function(t,i,s){var e,n,h=this.getIndexById(t.start.row),r=this.getIndexById(t.end.row),o=this.getColumnIndex(t.start.column),a=this.getColumnIndex(t.end.column);if(-1===o||-1===a)return null;if(-1===h||-1===r)return null;if(n=Math.min(s[1],r),this.q.topSplit){if((e=h)>=this.q.topSplit&&(e=Math.max(s[0]-this.q.topSplit,h)),n>=this.q.topSplit){var u=this.Wt(this.getIdByIndex(r),t.end.column),c=this.Wt(this.getIdByIndex(this.q.topSplit-1),t.end.column);c.top+c.height>u.top+u.height&&(n=this.q.topSplit-1)}}else e=Math.max(s[0],this.getIndexById(t.start.row));return{r0:e,r1:n,c0:Math.max(i[0],o),c1:Math.min(this.Zg?i[1]-1:i[1],a)}},qg:function(t,i,s,e){return[this.Wt(this.getIdByIndex(t),this.columnId(i)),this.Wt(this.getIdByIndex(s),this.columnId(e))]},Qg:function(t,i,s,d,v,e){var n,h,r=this.Dg[d],_=0;this.q.topSplit&&(_=this.tw(r.start,!0));var o=function(t,i,s,e,n){var h,r,o,a,u,c,f={top:1,right:1,bottom:1,left:1};for(h in e&&delete f.left,n&&delete f.right,r=s.top-i.top+s.height-1,o=s.left-i.left+s.width,f){a=i.top+_,"bottom"==h&&(a=s.top+s.height),u=i.left,"right"==h&&(u=s.left+s.width),c="top"==h||"bottom"==h,t.appendChild(Y("DIV",{"class":"webix_area_selection webix_area_selection_"+h+(v?" "+v:""),style:"left:"+u+"px;top:"+a+"px;"+(c?"width:"+o+"px;":"height:"+(r-_)+"px;"),webix_area_name:d},""));var l=t.lastChild;"right"==h&&(l.style.left=u-l.offsetWidth+"px"),"bottom"==h&&(l.style.top=a-l.offsetHeight+"px"),_&&("top"==h&&(l.style.display="none"),s.height==_&&"bottom"==h&&(l.style.display="none"))}};s&&o(this.Xg,s[0],s[1],!!i,!1),i&&o(this.Wg,i[0],i[1],!!t,!!s),t&&o(this.Gg,t[0],t[1],!1,!!i),e&&(h=s?s[1]:i?i[1]:t[1],(n=s?this.Xg:i?this.Wg:this.Gg).appendChild(Y("DIV",{"class":"webix_area_selection_handle"+(v?" "+v:""),style:"left:"+(h.left+h.width)+"px;top:"+(h.top+h.height)+"px;",webix_area_name:d},"")),_&&h.height==_&&(n.lastChild.style.display="none"))},iw:function(e){if(e){var t=function(t){for(var i=t.childNodes,s=i.length-1;0<=s;s--)i[s].getAttribute("webix_area_name")==e&&t.removeChild(i[s])};t(this.Wg),t(this.Gg),t(this.Xg)}},removeSelectArea:function(t){if(t&&this.Dg[t]){if(this.callEvent("onBeforeAreaRemove",[t])){for(var i in this.Ig(B(this.Dg[t]),!0),delete this.Dg[t],this.iw(t),this.Ng=[],this.Dg)this.Ng.push(this.Dg[i]);this.callEvent("onAfterAreaRemove",[t])}}else for(var s in this.Dg)this.removeSelectArea(s)},Vg:function(t){var i=t.target||t.srcElement,s=rt(i);if(s&&-1!=s.indexOf("webix_area_selection_handle")){var e=i.getAttribute("webix_area_name");this.Tg=e;var n=this.Dg[e],h=this.Wt(n.start.row,n.start.column),r=this.Wt(n.end.row,n.end.column),o=this.q.prerender,a=this.getColumnIndex(n.start.column)<this.q.leftSplit?0:this.sw,u=this.getColumnIndex(n.end.column)<this.q.leftSplit?0:this.sw;return this.ew=[h.left+1+a-this.oh,h.top+1-(o?this.hh:0),{row:n.start.row,column:n.start.column}],this.nw=K(this.Yt),this.hw(t),this.rw=[r.left+1+u-this.oh,r.top+1-(o?this.hh:0)],this.ow(!1,!1,t),Q(t)}},getSelectArea:function(t){return this.Dg[t||this.jg]},getAllSelectAreas:function(){return this.Dg},zg:function(t,i){var s,e,n,h,r,o,a,u,c,f,l,d,v,_=!1,p=t.start,m=t.end;for(
f=r=this.getIndexById(p.row),l=n=this.getColumnIndex(p.column),d=o=this.getIndexById(m.row),v=h=this.getColumnIndex(m.column),s=r;s<=o;s++){if(this.getItem(this.getIdByIndex(s)).$row&&!i)_=!0,v=this.If.length-1;else if(this.config.spans)for(e=n;e<=h;e++)(a=this.getSpan(this.getIdByIndex(s),this.columnId(e)))&&((u=this.getIndexById(a[0]))<f&&(f=u,_=!0),(c=this.getColumnIndex(a[1]))<l&&(_=!0,l=c),u+a[3]-1>d&&(_=!0,d=u+a[3]-1),c+a[2]-1>v&&(_=!0,v=c+a[2]-1))}_&&(t.start={row:this.getIdByIndex(f),column:this.columnId(l)},t.end={row:this.getIdByIndex(d),column:this.columnId(v)},this.zg(t,!0))},Ig:function(t,i){var s;if(t&&(s=this.getItemNode({row:t.start.row,column:t.start.column}))&&s.removeAttribute("tabindex"),!i&&this.Ng.length){var e=this.getSelectedId(!0)[0];(s=this.getItemNode(e))&&s.setAttribute("tabindex","1")}}}),br={filterByAll:function(){var r=!1;this.data.silent(function(){this.filter();var t=!1;for(var s in this.no)if(this.isColumnVisible(s)){var i=this.no[s],e=i[2].getValue(i[0]),n=e;i[1].prepare&&(n=i[1].prepare.call(i[2],n,i[1],this)),i[1].value=e;var h=i[1].compare;if(this.callEvent("onBeforeFilter",[s,n,i[1]]))if(i[2].$server||r)r=!0;else{if(""===n)continue;h?(h=this.aw(s,h),this.filter(C(function(t,i){return!!t&&h(t[s],i,t)},this),n,t)):this.filter(s,n,t),t=!0}}r&&this.uw()},this),r||(this.refresh(),this.callEvent("onAfterFilter",[]))},aw:function(t,h){var i=this.getColumnConfig(t),r=i?i.optionslist:null;return r?("string"!=typeof r&&(r=","),function(t,i,s){if(!t)return!0;for(var e=t.split(r),n=0;n<e.length;n++)if(h(e[n],i,s))return!0}):h},filterMode_setter:function(t){return H.extend(this.data.Pr,t,!0)},getFilter:function(t){var i=this.no[t];return i&&i[2].getInputNode?i[2].getInputNode(i[0]):null},registerFilter:function(t,i,s){this.no[i.columnId]=[t,i,s]},collectValues:function(t,i){var s=[],e={"":!0},n=this.getColumnConfig(t),h=i&&i.visible?null:n.options||n.collection;if(h){if("object"==k(h)&&!h.loadNext){if(b(h))for(var r=0;r<h.length;r++)s.push({id:h[r],value:h[r]});else for(var o in h)s.push({id:o,value:h[o]});return s}"string"==typeof h&&(h=jt(h)),h.getBody&&(h=h.getBody()),this.cw.call(h,"id","value",s,e)}else this.cw(n.id,n.id,s,e);var a={values:s};return this.callEvent("onCollectValues",[t,a]),a.values},cw:function(e,n,h,r){if(this.data.each(function(t){var i=t?t[e]:"";if(i!==undefined&&!r[i]){r[i]=!0;var s=t[e];0===s&&(s="0"),h.push({id:s,value:t[n]})}},this,!0),h.length){var t="string"==typeof h[0].value?"string":"raw";h.sort(this.data.sorting.create({as:t,by:"value",dir:"asc"}))}},uw:function(){this.loadNext(0,0,{before:function(){this.editStop&&this.editStop(),this.clearAll(!0)},success:function(){this.callEvent("onAfterFilter",[])}},0,1)}},gr={hover_setter:function(t){return t&&!this.lw&&(this.Oe(),this.config.experimental=!0,this.attachEvent("onMouseMoving",function(){var t=this.locate(arguments[0]);t=t?t.row:null,this.dw!=t&&(this.dw&&this.removeRowCss(this.dw,this.q.hover),this.dw=t,this.dw&&this.addRowCss(this.dw,this.q.hover))}),Ot(this.$view,"mouseout",C(function(t){this.dw&&document.body.contains(t.target)&&(this.removeRowCss(this.dw,this.q.hover),this.dw=null)},this)),this.lw=1),t},select_setter:function(t){return!this.select&&t&&(H.extend(this,this._w.vw,!0),!0===t?t="row":"multiselect"==t&&(t="row",this.q.multiselect=!0),this._w[t],H.extend(this,this._w[t],!0)),t},getSelectedId:function(t){return t?[]:""},getSelectedItem:function(t){return qs.getSelectedItem.call(this,t)},_w:{vw:{pw:" webix_cell_select",$init:function(){this.mw(),this.on_click.webix_cell=C(this.bw,this),this.gw=this.Gu=function(){this.unselect()},this.data.attachEvent("onStoreUpdated",C(this.Yu,this)),this.data.attachEvent("onSyncApply",C(this.ww,this)),this.data.attachEvent("onClearAll",C(this.gw,this)),this.data.attachEvent("onAfterFilter",C(this.Gu,this)),this.data.attachEvent("onIdChange",C(this.Ju,this)),this.$ready.push(qs.Ku)},Ju:function(t,i){for(var s=0;s<this.xw.length;s++)this.xw[s]==t&&(this.xw[s]=i);for(var e=0;e<this.Ng.length;e++){var n=this.Ng[e];n.row==t&&(t=this.yw(n),n.row=i,i=this.yw(n),n.id=i,
delete this.Mw[t],this.Mw[i]=!0)}},Yu:function(t,i,s){"delete"==s&&this.unselect(t)},ww:function(){for(var t=this.Ng.length-1;0<=t;t--){var i=this.Ng[t].row;this.exists(i)||(this.Ng.splice(t,1),delete this.Mw[i])}},mw:function(){this.Ng=[],this.Mw={},this.xw=[]},isSelected:function(t,i){var s;return s=D(i)?"object"===k(t)?this.yw(t):t:this.yw({row:t,column:i}),this.Mw[s]},getSelectedId:function(t,i){var s;if(1<this.Ng.length||t){if(s=[].concat(this.Ng),i)for(var e=0;e<s.length;e++)s[e]=s[e].id}else if(s=this.Ng[0],i&&s)return s.id;return s},Sw:function(){return this.row},lo:function(t,i){var s=this.yw(t);if(null!==s){if(-1===i)return this.kw(t);if(t.id=s,t.toString=this.Sw,!this.callEvent("onBeforeSelect",[t,i]))return!1;if(!this.Mw[s]||!i&&1!=this.Ng.length)return i||this.Cw(),this.Ng.push(t),this.Mw[s]=!0,this.callEvent("onAfterSelect",[t,i]),this.Dw(this.$w(t)),!0}},Cw:function(){if(!this.Ng.length)return!1;for(var t=0;t<this.Ng.length;t++)if(!this.callEvent("onBeforeUnSelect",[this.Ng[t]]))return!1;for(var i=0;i<this.xw.length;i++)this.data.removeMark(this.xw[i],"webix_selected");var s=this.q.columns;if(s)for(var e=0;e<s.length;e++)s[e].$selected=null;var n=this.Ng;this.mw();for(var h=0;h<n.length;h++)this.callEvent("onAfterUnSelect",[n[h]]);return!0},unselectAll:function(){this.clearSelection()},selectAll:function(){this.selectRange()},clearSelection:function(){this.Cw()&&(this.callEvent("onSelectChange",[]),this.render())},kw:function(t){var i=this.yw(t);if(!i&&this.Ng.length&&(this.clearSelection(),this.callEvent("onSelectChange",[])),this.Mw[i]){if(!this.callEvent("onBeforeUnSelect",[t]))return!1;for(var s=0;s<this.Ng.length;s++)if(this.Ng[s].id==i){this.Ng.splice(s,1);break}delete this.Mw[i],this.callEvent("onAfterUnSelect",[t]),this.Dw(0,this.Aw(t))}},Iw:function(t){var i=this.getItem(t);return this.data.addMark(i.id,"webix_selected",0,{$count:0},!0)},Dw:function(t){t&&this.xw.push(t),this.Zu||(this.render(),this.callEvent("onSelectChange",[]))},bw:function(t,i){var s=t.ctrlKey||t.metaKey||"touch"==this.q.multiselect,e=t.shiftKey;if(this.q.multiselect||"multiselect"==this.q.select||"area"==this.q.select||(s=e=!1),e&&this.Ng.length){var n=this.Ng[this.Ng.length-1];this.Fw(i,n)}else s&&this.Mw[this.yw(i)]?this.kw(i):this.lo({row:i.row,column:i.column},s)},Tw:function(t,i,s){var e=this.q.columns;if(i){for(var n=[],h=0;h<e.length;h++)e[h].$selected&&n.push(e[h]);e=n}for(var r=this.data.order,o=0,a=0;a<r.length;a++){var u=this.getItem(r[a]);if(u){var c=this.data.getMark(u.id,"webix_selected");if(c||i){for(var f=0,l=0;l<e.length;l++){var d=e[l].id;if(s||i||c[d]){if(!t)return{row:r[a],column:d};u[d]=t(u[d],r[a],d,o,f),f++}}o++}}}}},row:{pw:" webix_row_select",yw:function(t){return t.row},select:function(t,i){t&&(t=t.toString()),this.data.exists(t),this.lo({row:t},i)},$w:function(t){return this.Iw(t.row).$row=!0,t.row},unselect:function(t){this.kw({row:t})},Aw:function(t){return this.data.removeMark(t.row,"webix_selected",0,1),t.row},mapSelection:function(t){return this.Tw(t,!1,!0)},Fw:function(t,i){return this.selectRange(t.row,i.row)},selectRange:function(t,i,s){D(s)&&(s=!0);var e=t?this.getIndexById(t):0,n=i?this.getIndexById(i):this.data.order.length-1;if(n<e){var h=e;e=n,n=h}this.Zu=!0;for(var r=e;r<=n;r++){var o=this.getIdByIndex(r);if(!o){t&&this.select(t);break}this.select(o,s)}this.Zu=!1,this.Dw()}},cell:{yw:function(t){return t.column?t.row+"_"+t.column:null},select:function(t,i,s){this.data.exists(t),this.lo({row:t,column:i},s)},$w:function(t){var i=this.Iw(t.row);return i.$count++,i[t.column]=!0,t.row},unselect:function(t,i){this.kw({row:t,column:i})},Aw:function(t){var i=this.Iw(t.row);return i.$count--,i[t.column]=!1,i.$count<=0&&this.data.removeMark(t.row,"webix_selected"),t.row},mapSelection:function(t){return this.Tw(t,!1,!1)},Fw:function(t,i){return this.selectRange(t.row,t.column,i.row,i.column)},selectRange:function(t,i,s,e,n){D(n)&&(n=!0);var h=t?this.getIndexById(t):0,r=s?this.getIndexById(s):this.data.order.length-1,o=i?this.getColumnIndex(i):0,a=e?this.getColumnIndex(e):this.If.length-1;if(r<h){
var u=h;h=r,r=u}if(a<o){var c=o;o=a,a=c}this.Zu=!0;for(var f=h;f<=r;f++)for(var l=o;l<=a;l++)this.select(this.getIdByIndex(f),this.columnId(l),n);this.Zu=!1,this.Dw()}},column:{pw:" webix_column_select",yw:function(t){return t.column},Sw:function(){return this.column},select:function(t,i){this.lo({column:t},i)},$w:function(t){this.q.columns[this.getColumnIndex(t.column)].$selected=!0,this.Zu||this.zw()},unselect:function(t){this.kw({column:t})},Aw:function(t){this.q.columns[this.getColumnIndex(t.column)].$selected=null,this.zw()},mapSelection:function(t){return this.Tw(t,!0,!1)},Fw:function(t,i){return this.selectRange(t.column,i.column)},selectRange:function(t,i,s){D(s)&&(s=!0);var e=t?this.getColumnIndex(t):0,n=i?this.getColumnIndex(i):this.If.length-1;if(n<e){var h=e;e=n,n=h}this.Zu=!0;for(var r=e;r<=n;r++)this.select(this.columnId(r),s);this.Zu=!1,this.zw(),this.Dw()},ww:function(){}},area:{yw:function(t){return t.row+"_"+t.column},getSelectedId:function(t){var i=this.getSelectArea(),s=[];if(i)if(!t||i.start.row==i.end.row&&i.start.column==i.end.column)s.push(i.end);else{var e=this.getIndexById(i.start.row),n=this.getIndexById(i.end.row);if(-1==e||-1==n)return s;for(var h=this.getColumnIndex(i.start.column),r=this.getColumnIndex(i.end.column),o=e;o<=n;o++)for(var a=h;a<=r;a++)s.push({row:this.getIdByIndex(o),column:this.columnId(a)})}return t?s:s[0]},unselect:function(){this.kw()},kw:function(){this.removeSelectArea(),this.callEvent("onSelectChange",[])},mapSelection:function(t){var i=this.getSelectArea();if(i)for(var s=this.getColumnIndex(i.start.column),e=this.getColumnIndex(i.end.column),n=this.getIndexById(i.start.row),h=this.getIndexById(i.end.row),r=n;r<=h;r++)for(var o=this.data.order[r],a=this.getItem(o),u=s;u<=e;u++){var c=this.If[u].id;if(!t)return{row:o,column:c};a[c]=t(a[c],o,c,r-n,u-s)}},select:function(t,i,s){this.data.exists(t),this.lo({row:t,column:i},s)},Fw:function(t,i){this.Rg(t,i)},lo:function(t){return this.addSelectArea(t,t,!1),!0},ww:function(){this.Ng.length&&this.refreshSelectArea()}}}},wr={blockselect_setter:function(t){return t&&this.Hg&&(Lt(this.nt,S.mouse.move,this.Vw,{bind:this}),Lt(this.nt,S.mouse.down,this.Hw,{bind:this}),Ot(document.body,S.mouse.up,this.Bw,{bind:this}),this.Hg=this.ew=this.rw=!1,this.attachEvent("onAfterScroll",function(){this.Rw()}),H.extend(this,pi,!0),this.attachEvent("onBeforeAutoScroll",function(){return this.rw})),t},Hg:!0,Pw:function(t,i){for(var s=t.target||t.srcElement;s;){if(s.getAttribute&&s.getAttribute("webixignore"))return!1;if(s==i)return!0;s=s.parentNode}return!1},Hw:function(t){if((!this.q.subview||this==jt(t.target||t.srcElement))&&this.Pw(t,this.Yt)){if(t.target&&"INPUT"==t.target.tagName||this.bv)return;this.nw=K(this.Yt);var i=Z(t);this.ew=[i.x-this.nw.x,i.y-this.nw.y],Q(t)}},Bw:function(t){this.jw&&(this.ow("select",!0,t),this.jw=G(this.jw)),et(document.body,"webix_noselect"),this.ew=this.rw=!1,this.Xt&&(this.Xt=window.clearTimeout(this.Xt))},Rw:function(){this.rw&&this.ow(!1,!1)},ow:function(t,i,s){var e;this.ew[2]||(this.ew[2]=this.Nw.apply(this,this.ew)),e=this.ew[2];var n=this.Nw.apply(this,this.rw);if(this.callEvent("onBeforeBlockSelect",[e,n,i,s])){if((!this.Fg||!1!==this.Fg(e,n,i,s))&&e.row&&n.row)if("select"===t)this.Cw(),this.Fw(e,n);else{var h,r,o,a;if("box"===t)h=Math.min(this.ew[0],this.rw[0]),o=Math.max(this.ew[0],this.rw[0]),r=Math.min(this.ew[1],this.rw[1]),a=Math.max(this.ew[1],this.rw[1]);else{var u=this.Wt(e.row,e.column),c=this.Wt(n.row,n.column),f=this.getScrollState(),l=u.width,d=c.width;this.Ew&&this.ew[0]>this.sw+this.Lw?u.left+=this.sw+this.Lw:this.sw?this.ew[0]>this.sw&&(u.left<f.x?(l-=f.x-u.left,u.left=this.sw):u.left+=this.sw-f.x):u.left-=f.x,this.Ew&&this.rw[0]>this.sw+this.Lw?c.left+=this.sw+this.Lw:this.sw?this.rw[0]>this.sw&&(c.left<f.x?(d-=f.x-c.left,c.left=this.sw):c.left+=this.sw-f.x):c.left-=f.x,this.q.prerender&&(u.top-=this.hh,c.top-=this.hh),h=Math.min(u.left,c.left),o=Math.max(u.left+l,c.left+d),r=Math.min(u.top,c.top),a=Math.max(u.top+u.height,c.top+c.height),this.q.topSplit&&(r+=this.tw(e)),this.Xt&&(
this.Xt=window.clearTimeout(this.Xt)),s&&(this.Xt=$(this.Ut,this,[Z(s)],250))}var v=this.jw.style;v.left=h+"px",v.top=r+"px",v.width=o-h+"px",v.height=a-r+"px"}i&&this.callEvent("onAfterBlockSelect",[e,n])}},hw:function(){this.jw=Y("div",{"class":"webix_block_selection"},""),this.Yt.appendChild(this.jw)},Vw:function(t){if(!1!==this.ew){this.rw||st(document.body,"webix_noselect");var i=Z(t),s=[i.x-this.nw.x,i.y-this.nw.y];if(Math.abs(this.ew[0]-s[0])<5&&Math.abs(this.ew[1]-s[1])<5)return;!1===this.rw&&this.hw(t),this.rw=s,this.ow(this.config.blockselect,!1,t)}},Nw:function(t,i){var s=!1,e=null,n=null;if(this.Ew&&t>this.sw+this.Lw?t+=this.rh.getSize()-this.Lw-this.sw-this.Ew:(!this.sw||t>this.sw)&&(t+=this.rh.getScroll()),this.q.topSplit&&this.Kg>this.q.topSplit){var h=this.Wt(this.getIdByIndex(this.q.topSplit-1),this.columnId(0));h.top+h.height>i&&(s=!0)}s||(i+=this.getScrollState().y),t<0&&(t=0),i<0&&(i=0);for(var r=this.q.columns,o=this.data.order,a=0,u=0;u<r.length;u++)if(t<=(a+=r[u].width)){n=r[u].id;break}n||(n=r[r.length-1].id),a=0;var c=this.data.$min||0;if(this.q.fixedRowHeight)e=o[c+Math.floor(i/this.q.rowHeight)];else for(var f=c;f<o.length;f++)if(i<=(a+=this.Ow(f))){e=o[f];break}return e||(e=o[o.length-1]),{row:e,column:n}},tw:function(t,i){var s=0,e=this.getIndexById(t.row);if(e>=this.q.topSplit){var n=this.Wt(this.getIdByIndex(e),t.column),h=this.Wt(this.getIdByIndex(this.q.topSplit-1),t.column);0<h.top+h.height-n.top&&(s=h.top+h.height-(0<n.top||!i?n.top:0))}return s}},xr={resizeRow_setter:function(t){return this.q.scrollAlignY=!1,this.q.fixedRowHeight=!1,this.resizeColumn_setter(t)},resizeColumn_setter:function(t){return t&&this.Uw&&(Lt(this.nt,"mousemove",this.Yw,{bind:this}),Lt(this.nt,"mousedown",this.Ww,{bind:this}),Lt(this.nt,"mouseup",this.Gw,{bind:this}),this.Uw=!1),t},Uw:!0,Ww:function(t){this.q.subview&&this!=jt(t.target||t.srcElement)||this.Xw&&(this.bv=[Z(t),this.Xw[2]],st(document.body,"webix_noselect"),j())},Gw:function(){this.bv=!1,et(document.body,"webix_noselect"),N()},Jw:function(){if(!this.xv){var t=this.Xw[0],i=this.bv[1],s=this.Li(i);if(s){var e,n=this.bv[0];if("x"==t?(e=K(i).x+this.Xw[1]-K(this.Yt).x,n=n.x,this.Xw[1]||(s.cind-=i.parentNode.colSpan||1)):(e=K(i).y+this.Xw[1]-K(this.Yt).y+this.So,n=n.y,this.Xw[1]||s.rind--),0<=s.cind&&0<=s.rind)this.xv=[t,s,e],new Vt.resizearea({container:this.nt,dir:t,eventPos:n,start:e,cursor:("x"==t?"col":"row")+"-resize"}).attachEvent("onResizeEnd",C(this.Kw,this));this.Ww=this.Xw=!1}}},Kw:function(t){if(this.xv){var i=this.xv[0],s=this.xv[1],e=t-this.xv[2];if("x"==i){this.q.rightSplit&&s.cind+1>=this.Zg&&s.cind!==this.If.length-1&&(s.cind++,e*=-1);var n=this.If[s.cind],h=n.width;delete n.fillspace,delete n.adjust,this.ao(s.cind,h+e,!0,!0),this.uo()}else{var r=this.getIdByIndex(s.rind),o=this.qw(this.getItem(r));this.setRowHeight(r,o+e)}this.Gw()}this.xv=null},Yw:function(t){var i=null,s=this.q;if(this.Xw&&this.bv)return this.Jw(t);var e=(t=t||event).target||t.srcElement,n=!1;if("TD"!=e.tagName&&"TABLE"!=e.tagName){var h=e.className||"",r="string"==typeof h&&-1!=h.indexOf("webix_cell");if(!r||!s.drag){var o="string"==typeof h&&-1!=h.indexOf("webix_hcell");if(this.Xw=!1,r||o){var a=e.offsetWidth,u=e.offsetHeight,c=q(t),f=s.resizeRow;"object"==k(f)&&f.headerOnly&&0<(i=this.Li(e)).cind&&(f=!1),r&&f&&(f="object"==k(f)&&f.size?f.size:3,c.y<f?(i||(i=this.Li(e)),i.rind&&(this.Xw=["y",0,e],n="row-resize")):u-c.y<f+1&&(this.Xw=["y",u,e],n="row-resize"));var l=s.resizeColumn;"object"==k(l)&&l.headerOnly&&r&&(l=!1),l&&(l="object"==k(l)&&l.size?l.size:3,c.x<l?(this.Xw=["x",0,e],n="col-resize"):a-c.x<l+1&&(this.Xw=["x",a,e],n="col-resize"))}this.Zw&&window.clearTimeout(this.Zw),this.Zw=$(this.Qw,this,[n],n?100:0)}}},Qw:function(t){this.tx!=t&&(this.tx=t,this.nt.style.cursor=t||"default")}};F("onDataTable",function(t,i){S.touch&&(Mi.$init(),i.scrollSize=0,Mi.Kt&&Mi.limit(),t.$ready.push(t.$touch))});var yr={$touch:function(){var t=this.q;t.scrollAlignY=!1,H.extend(this,!0===t.prerender?this.ix:this.nx);var i="";t.autowidth||!1===t.scrollX||(i+="x"),
t.autoheight||!1===t.scrollY||(i+="y"),this.Yt.setAttribute("touch_scroll",i),Mi.ji(this.Yt.childNodes[1].firstChild),Mi.Ci(this.Yt.childNodes[1].firstChild,0,0,"0ms"),this.$i(0,0,"0ms")},ix:{hx:function(t,i){Mi.Ci(this.Yt.childNodes[1].firstChild,-t,-i,"0ms"),this.$i(-t,-i,"0ms")},ox:function(){var t=Mi.Mi(this.Yt.childNodes[1].firstChild);return{x:-t.e,y:-t.f}},$init:function(){this.attachEvent("onBeforeScroll",function(){Mi.ai=this.Yt.childNodes[1].firstChild,Mi.Gi(Mi.ai),Mi.Di=this}),this.attachEvent("onTouchEnd",function(){Mi.Di=null})},$i:function(t,i,s){this.q.leftSplit&&Mi.Ci(this.Yt.childNodes[0].firstChild,0,i,s),this.q.rightSplit&&Mi.Ci(this.Yt.childNodes[2].firstChild,0,i,s),this.q.header&&Mi.Ci(this.U.childNodes[1].firstChild,t,0,s),this.q.footer&&Mi.Ci(this.$f.childNodes[1].firstChild,t,0,s),this.callEvent("onSyncScroll",[t,i,s])},Pi:function(){}},nx:{hx:function(t,i){$(function(){this.callEvent("onAfterScroll",[{e:-t,f:-i}])},this)},$scroll:{gravity:0,elastic:!1},$init:function(){this.attachEvent("onAfterColumnHide",function(){this.hx(0,0)}),this.attachEvent("onBeforeScroll",function(){var t=Mi;t.ai=this.Yt.childNodes[1].firstChild,t.Gi(t.ai),t.ci.left=this.oh,t.ci.hidden=this.rh.q.scrollVisible||this.nh.q.scrollVisible,t.ci.dy=this.ax,t.Di=this}),this.attachEvent("onAfterScroll",function(t){if(t){var i=this.oh!=-t.e,s=this.hh!=-t.f;Mi.Di=null,Mi.ux=null,this.hh=0,this.oh=0;var e=Mi.config.translate;return Mi.config.translate="translate",this.$i(this.rh?0:t.e,0,"0ms"),Mi.config.translate=e,this.oh=-t.e,this.hh=-t.f,this.cx(),this.render(),i&&(this.rh&&this.rh.scrollTo(this.oh),this.callEvent("onScrollX",[])),s&&(this.nh&&this.nh.scrollTo(this.hh),this.callEvent("onScrollY",[])),!1}})},$i:function(t,i,s){i+=this.hh,t+=this.oh,Mi.Ci(this.Yt.childNodes[1].firstChild,t,i,s),this.q.leftSplit&&Mi.Ci(this.Yt.childNodes[0].firstChild,0,i,s),this.q.rightSplit&&Mi.Ci(this.Yt.childNodes[2].firstChild,0,i,s),this.q.header&&Mi.Ci(this.U.childNodes[1].firstChild,t,0,s),this.q.footer&&Mi.Ci(this.$f.childNodes[1].firstChild,t,0,s),this.callEvent("onSyncScroll",[t,i,s])},Pi:function(t){t.f-=this.hh,t.e-=this.oh}}},Mr={$init:function(){this.data.attachEvent("onStoreUpdated",C(function(t){t||this.vx()},this)),this.attachEvent("onStructureLoad",this.vx),this.attachEvent("onStructureUpdate",this._x),this.attachEvent("onColumnResize",function(t,i,s,e){e&&this._x()}),this.attachEvent("onResize",this._x)},vx:function(){for(var t=!1,i=this.If,s=0;s<i.length;s++)i[s].adjust&&("header"==i[s].adjust||this.count())&&(t=this.mx(s,i[s].adjust,!0)||t);t&&(this.uo(!0),this._x())},_x:function(){var t=this.q.columns,i=[],s=0;if(t&&!this.q.autowidth)for(var e=0;e<t.length;e++){var n=t[e].fillspace;n&&(s+=1*(i[e]=n)||1)}s&&this.bx(i,s)},bx:function(t,i){var s=this.q.columns;if(s){var e=this.ze-this.gx,n=!1;if(0<e){for(var h=0;h<s.length;h++)t[h]||(e-=s[h].width||this.config.columnWidth);for(var r=0;r<t.length;r++)if(t[r]){var o=Math.min(e,Math.round(e*t[r]/i));n=this.ao(r,o,!0)||n,e-=s[r].width,i-=t[r]}n&&this.uo(!0)}}},wx:function(t,i){var s=this.q.columns[t],e=s.minColumnWidth||10;if("header"!=i){var n=this.data.order.length;s.adjustBatch&&s.adjustBatch<n&&(n=s.adjustBatch);for(var h=this.data.order.slice(0,n),r=0;r<n;r++)h[r]=h[r]?this.xx(this.getItem(h[r]),s,0):"";e=Math.max(e,nt(h,"webix_table_cell webix_cell").width)}if("data"!=i){for(var o=0;o<s.header.length;o++){var a=s.header[o];if(a){var u=0;if(a.rotate)for(var c=0;c<(a.rowspan||1);c++)u+=this.Tf[c];var f="webix_table_cell webix_cell "+(a.css||"")+(a.rotate?"webix_measure_rotate":""),l=nt([a.text],f,u);e=Math.max(e,a.rotate?l.height:l.width)}}s.sort&&(e+=10)}return e+1+(S.isIE?Qi.layoutPadding.space:0)},mx:function(t,i,s){if(0<=t){var e=this.wx(t,i);return this.ao(t,e,s)}},adjustColumn:function(t,i){this.mx(this.getColumnIndex(t),i)},adjustRowHeight:function(t,i){var s=this;if(t){var e,n=this.getColumnConfig(t),h=Y("DIV",{"class":"webix_table_cell webix_measure_size webix_cell"},"")
;h.style.cssText="width:"+n.width+"px; height:1px; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(h),h.offsetHeight<1&&(e=this.$view.cloneNode(!0),document.body.appendChild(e),e.appendChild(h)),this.data.each(function(t){h.innerHTML=this.xx(t,n,0),t.$height=Math.max(h.scrollHeight,this.q.rowHeight)},this),h=G(h),e&&G(e)}else{var r=new Array(this.data.order.length),o=this.config.columns,a=0;for(var u in this.data.pull)r[a]=0,a++;for(var c=function(t){s.adjustRowHeight(o[t].id,!0);var i=0;s.data.each(function(t){t.$height>r[i]&&(r[i]=t.$height),t.$height=r[i],i++})},f=0;f<o.length;f++)c(f)}i||this.refresh()}},Sr={math_setter:function(t){return t&&this.yx(),t},Mx:"$",yx:function(){S.strict||(this.data.attachEvent("onStoreUpdated",C(this.Sx,this)),this.data.attachEvent("onStoreLoad",C(this.kx,this)),this.attachEvent("onStructureLoad",this.kx))},Sx:function(t,i,s){if(t&&"delete"!=s&&"paint"!=s){"add"==s&&this.Cx(i);for(var e=0;e<this.If.length;e++)this.Dx(t,this.If[e].id,"add"!==s);this.$x={}}},Dx:function(t,i,s){var e,n=this.getItem(t);if(!0===s?e=n[this.Mx+i]||n[i]:(e=n[i],this.$x={}),null!=e&&(0<e.length&&"="===e.substr(0,1)?(n[this.Mx+i]&&!0===s||(n[this.Mx+i]=n[i]),n[i]=this.Ax(e,t,i)):("undefined"!=typeof n[this.Mx+i]&&delete n[this.Mx+i],this.Ix(n,i)),"undefined"!=typeof n.depends&&"undefined"!=typeof n.depends[i]))for(var h in n.depends[i]){var r=n.depends[i][h][0]+"__"+n.depends[i][h][1];"undefined"==typeof this.$x[r]&&(this.$x[r]=!0,this.Dx(n.depends[i][h][0],n.depends[i][h][1],!0))}},Fx:function(t,i){var s=this.getItem(t);"undefined"!=typeof s[this.Mx+i]&&(s[i]=s[this.Mx+i])},kx:function(){if(this.If&&this.count()){this.Cx();for(var t=0;t<this.If.length;t++){var i=this.columnId(t);this.data.each(function(t){this.Dx(t.id,i)},this)}this.$x={}}},Cx:function(t){for(var i=0;i<this.If.length;i++)if(this.If[i].math){var s=this.columnId(i),e="="+this.If[i].math;e=e.replace(/\$c/g,"#$c#"),t?(t[s]=this.Tx(e,t.id,s),delete t[this.Mx+s],this.Ix(t,s)):this.data.each(function(t){t[s]=this.Tx(e,t.id,s),delete t[this.Mx+s],this.Ix(t,s)},this)}},Tx:function(t,i,s){return Ft(t)({$r:i,$c:s})},zx:function(t,i){var s;if(!this.exists(t))return"#out_of_range";var e=(s=this.getItem(t))[this.Mx+i]||s[i]||0;return"="!==(e=e.toString()).substring(0,1)?e:("undefined"==typeof s[this.Mx+i]&&(s[this.Mx+i]=s[i]),s[i]=this.Ax(e,t,i,!0),s[i])},Ax:function(t,i,s,e){if(!0===e){if(this.Vx(i,s))return"#selfreference"}else this.Hx();this.Bx(i,s);var n=this.getItem(i);t=t.substring(1);var h=this.Rx(t),r=this.Px(t,i);t=h?(t=this.jx(t,r),this.Nx(t,h)):this.jx(t,r,!0);var o=this.Ex(t);if(!1!==o)return o;this.Lx(i,s),this.Ix(n,s);for(var a=0;a<r.length;a++)this.Ox([i,s],r[a]);return!1!==(o=this.Ex(t))?o:t?(t=this.Ux(t.replace(/\$r/g,n.id)),!1!==(o=this.Ex(t))?o:t):t},Rx:function(t){return t.replace(/\[[^)]*?\]/g,"").match(/(\+|-|\*|\/)/g)},Px:function(t,i){var s=t.match(/\[([^\]]+),([^\]]+)\]/g);null===s&&(s=[]);for(var e=0;e<s.length;e++){var n=s[e],h=n;(n=(n=n.substr(1,n.length-2)).split(","))[0]=this.Yx(n[0]),n[1]=this.Yx(n[1]),":"===n[0].substr(0,1)&&(n[0]=this.getIdByIndex(n[0].substr(1))),"$r"===n[0]&&(n[0]=i),":"===n[1].substr(0,1)&&(n[1]=this.columnId(n[1].substr(1))),n[2]=h,s[e]=n}return s},jx:function(t,i,s){var e="(",n=")";s&&(e=n="");for(var h=0;h<i.length;h++){var r=i[h],o=this.zx(r[0],r[1]);isNaN(o)&&(o='"'+o+'"'),t=t.replace(r[2],e+o+n)}return t},Nx:function(t,i){for(var s=[],e=0;e<i.length;e++){var n=i[e],h=this.Wx(t,n);s.push(h[0]),t=h[1]}s.push(t);for(var r=0;r<s.length;r++){var o=this.Yx(s[r]);s[r]=o}for(var a="",u=0;u<s.length-1;u++)a+=s[u]+i[u];return a+=s[s.length-1]},Ux:function(t){var i;try{i=window.eval(t)}catch(s){i=""}return i.toString()},Wx:function(t,i){var s=t.indexOf(i);return[t.substr(0,s),t.substr(s+1)]},Yx:function(t){return t=(t=t.replace(/^ */g,"")).replace(/ *$/g,"")},Hx:function(){this.Gx=[]},Bx:function(t,i){this.Gx[t+"__"+i]=!0},Lx:function(t,i){"undefined"!=typeof this.Gx[t+"__"+i]&&delete this.Gx[t+"__"+i]},Vx:function(t,i){return"undefined"!=typeof this.Gx[t+"__"+i]
},Ox:function(t,i){var s=this.getItem(i[0]);"undefined"==typeof s.depends&&(s.depends={}),"undefined"==typeof s.depends[i[1]]&&(s.depends[i[1]]={}),s.depends[i[1]][t[0]+"__"+t[1]]=t,"undefined"==typeof(s=this.getItem(t[0])).triggers&&(s.triggers={}),"undefined"==typeof s.triggers[t[1]]&&(s.triggers[t[1]]={}),s.triggers[t[1]][i[0]+"__"+i[1]]=i},Ix:function(t,i){if(t&&"undefined"!=typeof t.triggers)for(var s in t.triggers[i]){var e=t.triggers[i][s],n=this.getItem(e[0]);n&&delete n.depends[e[1]][t.id+"__"+i]}},Ex:function(t){var i=t.match(/#\w+/);return null!==i&&0<i.length&&i[0]}},kr={headermenu_setter:function(t){return t&&(t.data&&(this.Xx=!0),t=this.Jx(t)),t},Jx:function(n){var t={view:"contextmenu",template:"<span class='webix_icon {common.hidden()}'></span> &nbsp; #value#",type:{hidden:function(t){return t.hidden?"wxi-eye-slash":"wxi-eye"}},on:{onMenuItemClick:C(function(t){var i=jt(this.q.headermenu),s=i.getItem(t).hidden;i.getItem(t).hidden=!s,i.refresh(t),i.$blockRender=!0;var e={spans:"object"==k(n)&&n.spans};return s?this.showColumn(t,e):this.hideColumn(t,e),i.$blockRender=!1},this)},data:[]};"object"==k(n)&&H.extend(t,n,!0);var i=Vt(t);return i.attachTo(this.U),this.rt.push(i),this.attachEvent("onStructureLoad",this.Kx),this.attachEvent("onStructureUpdate",this.Kx),this.Jx=function(t){return t},i.q.id},Kx:function(){var t=jt(this.q.headermenu),i=this.ro;if(!t.$blockRender){if(this.Xx)return t.data.each(function(t){t.hidden=!!i[t.id]}),void t.refresh();var s=[],e=this.io;e.length||(e=this.If);for(var n=0;n<e.length;n++){var h=this.getColumnConfig(e[n].id||e[n]),r=h.header[0],o=!!i[h.id];!1!==h.headermenu&&r&&s.push({id:h.id,value:o?r.text:r.groupText||r.text,hidden:o})}s.length&&t.data.importData(s)}}},Cr={Zo:function(t){return this.getColumnConfig(t.column).editor},getEditor:function(t,i){return t?(1==arguments.length&&(i=t.column,t=t.row),(this.Eo[t]||{})[i]):this.se},ua:function(t){for(var i in this.Eo){var s=this.Eo[i];for(var e in s)"$count"!=e&&t.call(this,s[e])}},Qo:function(t,i,s){var e=t.row,n=t.column,h=i.config=this.getColumnConfig(n);!1!==s&&this.showCell(e,n);var r=i.render();i.$inline&&(r=this.Yo(t)),i.node=r;var o,a=this.getItem(e),u=h.editFormat;return this.q.editMath&&(o=a["$"+n]),D(o=o||a[n])&&(o=""),i.setValue(u?u(o):o,a),i.value=a[n],this.ea(t,i),i.$inline||this.na(t,r,!0),i.afterRender&&i.afterRender(),this.q.liveValidation&&(Lt(i.node,"keyup",this.qx(t,this)),this.validateEditor(t)),r},qx:function(t,i){return function(){i.validateEditor(t)}},ca:function(t){var i=this.getColumnConfig(t.column).editParse,s=t.getValue();return i?i(s):s},Ko:function(t,i,s){var e=s?{}:this.getItem(t.row);return e[t.column]=i,this.q.editMath&&(e["$"+t.column]=null),e},ea:function(t,i){var s=this.Eo[t.row]=this.Eo[t.row]||{};s.$count=(s.$count||0)+1,i.row=t.row,i.column=t.column,this.se=s[t.column]=i,this.Gs++,this.Zx=this.getScrollState()},ra:function(t){this.se==t&&(this.se=0),t.destroy&&t.destroy();var i=this.Eo[t.row];delete i[t.column],i.$count--,i.$count||delete this.Eo[t.row],this.Gs--},Wo:function(t,i){var s=this.Eo[t];if(s)for(var e in this.Eo[i]=s,delete this.Eo[t],s)s[e].row=i},ha:function(t){var i,s,e,n,h,r=this.getColumnConfig(t.column),o=0;if(r&&r.node&&r.attached){if(e=this.getIndexById(t.row),this.zf&&this.getSpan(t.row,t.column))for(s=0;s<3;s++)for(i=this.Qx[s],n=0;!o&&n<i.childNodes.length;n++)(h=i.childNodes[n]).getAttribute("row")==e&&h.getAttribute("column")==this.getColumnIndex(t.column)&&(o=h);!o&&e>=r.ty-this.q.topSplit&&e<r.iy&&(o=r.node.childNodes[e-r.ty+this.q.topSplit])}return o},editCell:function(t,i,s,e){return i=i||this.q.columns[0].id,Vs.edit.call(this,{row:t,column:i},s,e)},editRow:function(i){i&&i.row&&(i=i.row);var s=!1;this.eachColumn(function(t){this.edit({row:i,column:t},s,!s),s=!0})},editColumn:function(i){i&&i.column&&(i=i.column);var s=!1;this.eachRow(function(t){this.edit({row:t,column:i},s,!s),s=!0})},eachRow:function(t,i){var s=this.data.order;i&&(s=this.data.lr||s);for(var e=0;e<s.length;e++)t.call(this,s[e])},eachColumn:function(t,i){for(var s in this.Ff){
var e=this.Ff[s];t.call(this,e.id,e)}if(i)for(var n in this.ro){var h=this.ro[n];t.call(this,h.id,h)}},la:function(t){if(this.getSelectedId&&1==this.getSelectedId(!0).length)return this.lo(t),!1},Ws:function(t,i){if(this.q.editable&&!this.Gs){if(i.target&&"INPUT"==i.target.tagName)return!0;var s=this.getSelectedId(!0);if(1==s.length){var e=s[0];return"row"==this.q.select&&(e.column=this.q.columns[i.shiftKey?0:this.q.columns.length-1].id),this.editNext(t,e),!1}}return!0},fa:function(t,i,s){var e=this.getIndexById(t.row),n=this.getColumnIndex(t.column),h=this.data.order,r=this.If;if(s)for(var o=e;o<h.length;o++){for(var a=n+1;a<r.length;a++){var u={row:h[o],column:r[a].id};if(i.call(this,u)&&(!this.ey||!this.ey(t,u)))return u}n=-1}else for(var c=e;0<=c;c--){for(var f=n-1;0<=f;f--){var l={row:h[c],column:r[f].id};if(i.call(this,l))return l}n=r.length}return null},ny:function(){this.Gs&&(this.hy?this.hy=!1:(this.nh.scrollTo(this.getScrollState().y+this.Yt.childNodes[1].firstChild.scrollTop),this.Yt.childNodes[1].firstChild.scrollTop=0,this.hy=!0))},oy:function(){this.Gs&&this.rh.scrollTo(this.Yt.childNodes[1].scrollLeft)},Xo:function(){this.attachEvent("onScrollY",this.ay),this.attachEvent("onScrollX",this.ay),this.attachEvent("onScrollY",this.Lo),this.attachEvent("onColumnResize",function(){this.editStop()}),this.attachEvent("onAfterFilter",function(){this.editStop()}),this.attachEvent("onRowResize",function(){this.editStop()}),this.attachEvent("onAfterScroll",function(){this.q.topSplit&&this.editStop()}),this.Yt.childNodes[1].firstChild.onscroll=C(this.ny,this),this.Yt.childNodes[1].onscroll=C(this.oy,this)},ay:function(){if(this.Gs){var t=this.Zx;this.Zx=this.getScrollState();var s=this.Zx.y-t.y;this.ua(function(t){if(t.getPopup){var i=this.getItemNode(t);i?t.getPopup().show(i):t.getPopup().show({x:-1e4,y:-1e4})}t.linkInput||t.$inline||(t.node.top-=s,t.node.style.top=t.node.top+"px")})}}},Dr={$init:function(){this.uy(),this.attachEvent("onStructureLoad",this.cy)},uy:function(){this.ro={},this.io=p(),this.oo=[0,0]},cy:function(){for(var t=this.If,i=0;i<t.length;i++)t[i].header&&this.fy(t,t[i].header),t[i].footer&&this.fy(t,t[i].footer);for(var s=t.length-1;0<=s;s--)t[s].hidden?this.hideColumn(t[s].id,{},!0,!0):t[s].batch&&this.config.visibleBatch&&t[s].batch!=this.config.visibleBatch&&this.hideColumn(t[s].id,{},!0,!0)},fy:function(t,i){for(var s=0;s<i.length;s++){var e=i[s];e&&e.colspan&&!e.$colspan&&(e.$colspan=e.colspan)}},moveColumn:function(t,i){var s=this.getColumnIndex(t);if(s!=i){var e=this.q.columns,n=e.splice(s,1),h=i-(s<i?1:0);x.insertAt.call(e,n[0],h);var r=this.io;if(r.length){var o=(r=p(r)).find(t);r.removeAt(o),0===h?r.unshift(t):r.insertAt(t,r.find(e[h-1].id)+1)}this.ly()}},vy:function(){var t=this.io,i=this.q.columns;if(!t.length){for(var s=0;s<i.length;s++)t[s]=i[s].id;this.oo=[this.q.leftSplit,this.Zg]}},isColumnVisible:function(t){return!this.ro[t]},hideColumn:function(t,i,s,e){var n,h=this.q.columns,r=this.io,o=this.ro,a=1;if(i=i||{},!1!==e){var u=this.getColumnIndex(t);if(-1===u||!this.callEvent("onBeforeColumnHide",[t]))return;if(-1==u)return;if(this.vy(),i.spans)for(var c=h[u].header,f=0;f<c.length;f++)c[f]&&(c[f].$groupSpan=c[f].colspan||1,a=Math.max(a,c[f].$groupSpan));u<this.q.leftSplit&&(this.q.leftSplit-=a),u>=this.Zg?this.q.rightSplit-=a:this.Zg-=a;for(var l=u+a-1;u<=l;l--)this._y(u),(o[(n=h.splice(u,1)[0]).id]=n).ty=-1,delete this.Ff[n.id];this.callEvent("onAfterColumnHide",[t])}else{if(!(n=o[t])||!this.callEvent("onBeforeColumnShow",[t]))return;for(var d=null,v=0,_=0;v<r.length;v++){if(r[v]==t){_=v;break}o[r[v]]||(d=r[v])}var p=d?this.getColumnIndex(d)+1:0;if(i.spans)for(var m=n.header,b=0;b<m.length;b++)m[b]&&(m[b].colspan=m[b].$groupSpan||m[b].colspan,delete m[b].$groupSpan,a=Math.max(a,m[b].colspan||1));for(var g=_+a-1;_<=g;g--){var w=o[r[g]];w?(x.insertAt.call(h,w,p),delete w.hidden,delete o[w.id],this.Ff[w.id]=w):a--}_<this.oo[0]&&(this.q.leftSplit+=a),_>=this.oo[1]?this.q.rightSplit+=a:this.Zg+=a,this.callEvent("onAfterColumnShow",[t])}n.header&&this.my(n,!1!==e?0:1,"header"),
n.footer&&this.my(n,!1!==e?0:1,"footer"),s||this.ly()},my:function(t,i,s){for(var e=t[s].length-1;0<=e;e--)for(var n,h=this.io,r=!1,o=0,a=0;a<h.length;a++){var u=this.getColumnConfig(h[a]),c=u[s][e];this.isColumnVisible(h[a])?(r&&0<o&&n&&0<n.colspan?n=c=u[s][e]=n:c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,n=c),r=null):(c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,r=n=c),n&&0<o&&n.colspan--),o--}},refreshColumns:function(t,i){(t&&t!=this.config.columns||i)&&(this.uy(),this.no={},t&&(this.Zg=t.length-(this.config.rightSplit||0))),this.Ff={};for(var s=0;s<this.If.length;s++){var e=this.If[s];(this.Ff[e.id]=e).attached=e.node=null}for(var n=0;n<3;n++)this.U.childNodes[n].innerHTML="",this.Yt.childNodes[n].firstChild.innerHTML="";this.If=this.config.columns=t||this.config.columns,this.Zg=this.If.length-this.q.rightSplit,this.ho=0,this.gy(),this.callEvent("onStructureUpdate"),this.$h(),this.render()},ly:function(){this.ho=0,this.callEvent("onStructureUpdate"),this.wy(),this.render()},showColumn:function(t,i,s){return this.hideColumn(t,i,s,!1)},showColumnBatch:function(e,n){var h=void 0!==n;n=!1!==n,this.eachColumn(function(t,i){if(i.batch){var s=this.ro[i.id];n||(s=!s),i.batch==e&&s?this.hideColumn(i.id,{spans:!0},!0,!n):h||i.batch==e||s||this.hideColumn(i.id,{spans:!0},!0,n)}},!0),this.ly()}},$r={$init:function(){this.attachEvent("onAfterScroll",this.Ea),this.attachEvent("onFocus",function(){st(this.$view,"webix_dtable_focused")}),this.attachEvent("onBlur",function(){et(this.$view,"webix_dtable_focused")})},Ea:function(){if(!this.xy()){var t=this.bt.querySelector(".webix_cell");t&&t.setAttribute("tabindex","0")}},xy:function(){for(var t=this.getSelectedId(!0),i=0;i<t.length;i++)if(this.isColumnVisible(t[i].column))return this.getItemNode(t[i]);return null},moveSelection:function(t,i,s){if(!this.q.disabled){i=i||{};var e=this.getSelectedId(!0),n=e.length-1,h=!(!this.q.multiselect&&!this.q.areaselect)&&i.shift;if(1<e.length&&"cell"!==this.q.select&&(e=e.sort(C(function(t,i){return this.getIndexById(t.row)>this.getIndexById(i.row)||this.getColumnIndex(t.column)>this.getColumnIndex(i.column)?1:-1},this)),"up"!=t&&"left"!=t&&"top"!=t&&"pgup"!=t||(n=0)),n<0&&this.count()){if("down"==t||"right"==t)t="top";else{if("up"!=t&&"left"!=t)return;t="bottom"}n=0,e=[{row:1,column:1}]}if(0<=n){var r=e[n].row,o=e[n].column;if("top"==t||"bottom"==t)r&&("top"==t?r=this.data.getFirstId():"bottom"==t&&(r=this.data.getLastId())),o&&(n=0,"bottom"==t&&(n=this.config.columns.length-1),o=this.columnId(n));else if("up"==t||"down"==t||"pgup"==t||"pgdown"==t){if(r){var a=this.getIndexById(r),u=1;"pgup"!=t&&"pgdown"!=t||(u=this.zu?this.zu.config.size:Math.round(this.yy/this.q.rowHeight)),"up"==t||"pgup"==t?a-=u:"down"!=t&&"pgdown"!=t||(a+=u),a<0&&(a=0),a>=this.data.order.length&&(a=this.data.order.length-1),!(r=this.getIdByIndex(a))&&this.q.pager&&this.showItemByIndex(a)}}else{if("right"!=t&&"left"!=t)return;if(o&&"row"!=this.config.select){var c=this.getColumnIndex(o);"right"==t?c++:"left"==t&&c--,c<0&&(c=0),c>=this.config.columns.length&&(c=this.config.columns.length-1),o=this.columnId(c)}else{if((this.open||this.My)&&"right"==t)return this.open?this.open(r):this.openSub(r);if((this.close||this.My)&&"left"==t)return this.close?this.close(r):this.closeSub(r)}}if(r){this.showCell(r,o),this.select||(H.extend(this,this._w.vw,!0),this.q.select=this.open||this.My?"row":"cell",H.extend(this,this._w[this.q.select],!0));var f={row:r,column:o};if(h&&"area"==this.q.select){var l=this.Ng[this.Ng.length-1];this.Rg(f,l,t,i)}else this.lo(f,h);if(!this.q.clipboard&&!1!==s){var d=this.getItemNode(f);d&&d.focus()}}}return!1}}},Ar={drag_setter:function(t){return this.attachEvent("onBeforeDrag",function(t){return this.Sy(t.source)}),this.attachEvent("onBeforeDragIn",function(t){return this.Sy(t.target)}),this.attachEvent("onBeforeDropOrder",function(t,i){return i<0||i>=this.q.topSplit}),$s.drag_setter.call(this,t)},Sy:function(t){var i,s=!1;if(this.q.topSplit&&t)for(b(t)||(t=[t]),i=0;!s&&i<t.length;i++)s=this.getIndexById(t[i])<this.q.topSplit;return!s},$dragHTML:function(
t){for(var i="<div class='webix_dd_drag' style='width:"+(this.ze-this.gx-2)+"px;'>",s=this.q.columns,e=0;e<s.length;e++){var n=this.xx(t,s[e]);i+="<div style='width:"+s[e].width+"px;'>"+n+"</div>"}return i+"</div>"},getHeaderNode:function(t,i){return this.ky(t,i,this.U)},getFooterNode:function(t,i){return this.ky(t,i,this.$f)},ky:function(t,i,s){if(this.isColumnVisible(t)){var e=this.getColumnIndex(t),n=this.q.leftSplit>e?0:this.Zg<=e?2:1;i=i||0;var h=s.childNodes[n].getElementsByTagName("TR");if(h.length)for(var r=h[i+1].childNodes,o=0;o<r.length;o++)if(r[o].getAttribute("column")==e)return r[o].firstChild}return null},getItemNode:function(t){if(t&&!t.header){var i=t.row||t,s=this.getIndexById(i),e=this.Yg(),n=e[0]-this.q.topSplit;if(s<n&&s>e[1])return;var h=this.Ug(),r=this.q.leftSplit?0:h[0];if(t.column&&(r=this.getColumnIndex(t.column))<this.Zg&&r>=this.q.leftSplit&&(r<h[0]||r>h[1]))return;var o=this.q.columns[r];if(o.attached&&o.node){var a=s<this.q.topSplit?s:s-n;return o.node.childNodes[a]}}},dragColumn_setter:function(t){var r;"order"==t?r={$drag:C(function(t,i){var s=this.locate(i);if(this.bv||!s||!this.callEvent("onBeforeColumnDrag",[s.column,i]))return!1;zi.ns={from:r,start:s,custom:"column_dnd"};var e=this.getColumnConfig(s.column);return this.Cy=q(i),this.Dy=e.width,"<div class='webix_dd_drag_column' style='width:"+e.width+"px'>"+(e.header[0].text||"&nbsp;")+"</div>"},this),$dragPos:C(function(t,i,s){var e=zi.getContext(),n=K(this.$view);s.style.display="none";var h=document.elementFromPoint(t.x,n.y+1),r=h?this.locate(h):null,o=zi.getContext().start.column;if(r&&r.column!=o&&(!this.$y||r.column!=this.Mo)&&"column_dnd"==e.custom&&jt(h)==this){if(!this.callEvent("onBeforeColumnDropOrder",[o,r.column,i]))return;var a=this.getColumnIndex(o),u=this.getColumnIndex(r.column);i.touches&&(this.Ay=i.target,this.Ay.style.display="none",this.$view.parentNode.appendChild(this.Ay)),this.moveColumn(o,u+(a<u?1:0)),this.Mo=r.column,this.$y=!0}if(r&&r.column==o&&(this.$y=!1),s.style.display="block",t.x=t.x-this.Cy.x,t.y=n.y,t.x<n.x)t.x=n.x;else{var c=n.x+this.$view.offsetWidth-this.gx-this.Dy;t.x>c&&(t.x=c)}zi.bs=!0},this),$dragDestroy:C(function(t,i){G(i),this.Ay&&G(this.Ay);var s=zi.getContext().start;this.callEvent("onAfterColumnDropOrder",[s.column,this.Mo,t])},this),$drop:function(){}}:t&&(r={_o:!0,$drag:C(function(t,i){var s=this.locate(i);if(this.bv||!s||!this.callEvent("onBeforeColumnDrag",[s.column,i]))return!1;zi.ns={from:r,start:s,custom:"column_dnd"};for(var e=this.getColumnConfig(s.column).header,n="&nbsp;",h=0;h<e.length;h++)if(e[h]){n=e[h].text;break}return"<div class='webix_dd_drag_column'>"+n+"</div>"},this),$drop:C(function(t,i,s){var e=s;s.touches&&this.Iy&&(e=this.Iy);var n=this.locate(e);if(!n)return!1;var h=zi.getContext().start.column;if(h!=n.column){if(!this.callEvent("onBeforeColumnDrop",[h,n.column,s]))return;var r=this.getColumnIndex(h),o=this.getColumnIndex(n.column);this.moveColumn(h,o+(r<o?1:0)),this.callEvent("onAfterColumnDrop",[h,n.column,s])}},this),$dragIn:C(function(t,i,s){var e=zi.getContext();if("column_dnd"!=e.custom||e.from!=r)return!1;for(var n=s.target||s.srcElement;-1==(n.className||"").indexOf("webix_hcell");)if(!(n=n.parentNode))return;return n!=this.Iy&&(this.Iy&&et(this.Iy,"webix_dd_over_column"),st(n,"webix_dd_over_column")),this.Iy=n},this),$dragDestroy:C(function(t,i){this.Iy&&et(this.Iy,"webix_dd_over_column"),G(i)},this)}),t&&(zi.addDrag(this.U,r),zi.addDrop(this.U,r,!0))}},Ir={Yn:function(t,i){if(t.scroll&&!i)return!0;t.header=D(t.header)?!!this.config.header:t.header,t.footer=D(t.footer)?!!this.config.footer:t.footer,t.xCorrection=t.xCorrection||0},Ap:function(t,i){for(var s=-1,e=0;s<0&&e<t.length;e++)i(t[e])&&(s=e);return s},Fy:function(s,c,f){var l={},d=0;return s.forEach(C(function(t,o){var i=t[0],a=[],u=i.length;i.forEach(C(function(t,i){for(var s=c[i+d],e=0;e<s[f].length;e++){var n=s[f][e];if(n||l[o]&&l[o][e]){if(n=B(n||{text:""}),l[o]&&l[o][e]&&0===i&&(n.colspan=l[o][e],l[o][e]=0),n.colspan){var h=Math.min(n.colspan,u-i);l[o+1]=l[o+1]||{},l[o+1][e]=n.colspan-h,
n.colspan=h}n.rowspan&&1===u&&(n.height=(n.height||this.config.headerRowHeight)*n.rowspan,n.rowspan=null);var r={txt:n.rotate?this.getHeaderNode(s.id,e).innerHTML:n.text||(n.contentId?this.getHeaderContent(n.contentId).getValue():""),className:"webix_hcell webix_"+f+"_cell "+(n.css||""),style:{height:(n.height||this.config.headerRowHeight)+"px",width:n.colspan?"auto":s.width+"px"},span:n.colspan||n.rowspan?{colspan:n.colspan||1,rowspan:n.rowspan||1}:null};a[e]=a[e]||[],a[e][i]=r}}},this)),s[o]="header"==f?a.concat(t):t.concat(a),d+=u},this)),s},Wn:function(v,t,_){var p=this.config.columns,m=this.getSelectedId(!0),b=this.Xn(v),g=0,w=0,x=[],y=0;return _=_||0+v.xCorrection,t=t||[],this.eachRow(C(function(i){for(var t=0,s=this.getItem(i),e=this.getIndexById(i),n=[],h=!1,r=_;r<p.length;r++){var o=p[r].id,a=this.getColumnIndex(o)-_;if(p[r]){if(t+=p[r].width,b<t&&_<r){y=r;break}if("selection"!==v.data||"selection"==v.data&&-1!==this.Ap(m,function(t){return t.column==o&&t.row==i})){var u;if(this.getSpan&&(u=this.getSpan(i,o)),u&&this.getColumnIndex(o)===_){var c=this.getColumnIndex(u[1]);c<_&&(u[2]=u[2]-(_-c),u[4]=u[4]?u[4]:s[u[1]]?this.getText(i,u[1]):null,u[1]=o)}if(!u||u&&u[0]==i&&u[1]==o){var f=u&&u[4]?u[4]:this.Ff[o]?this.getText(i,o):"",l=this.getCss(i,o)+" "+(p[r].css||"")+(u?" webix_dtable_span "+(u[5]||""):""),d={height:u&&1<u[3]?"auto":(s.$height||this.config.rowHeight)+"px",width:u&&1<u[2]?"auto":p[r].width+"px"};n.push({txt:f,className:l,style:d,span:u?{colspan:u[2],spanStart:this.getColumnIndex(u[1]),rowspan:u[3]}:null}),f&&(g=Math.max(a+1,g),w=Math.max(e+1,w)),h=h||!!f}else u&&(n.push({$inspan:!0}),g=Math.max(a+1,g),w=Math.max(e+1,w))}}}v.skiprows&&!h||x.push(n)},this)),w&&g&&(v.trim&&(x.length=w,x=x.map(function(t){for(var i=t.length-1;0<=i;i--)if(t[i].span&&t[i].span.colspan){t[i].span.colspan=Math.min(t[i].span.colspan,t.length-i);break}return t.length=g,t})),t.push(x)),y?this.Wn(v,t,y):(v.footer&&(t=this.Fy(t,p,"footer")),v.header&&(t=this.Fy(t,p,"header"))),t},Gn:function(n,h){var r=Y("div");return n.forEach(C(function(t,i){var s=Y("table",{"class":"webix_table_print "+this.$view.className+(h.borderless?" borderless":""),style:"border-collapse:collapse",id:this.$view.getAttribute("id")});if(t.forEach(function(t){var e=Y("tr");t.forEach(function(t){if(!t.$inspan){var i=Y("td");for(var s in i.innerHTML=t.txt,i.className=t.className,t.style)i.style[s]=t.style[s];t.span&&(i.colSpan=t.span.colspan,i.rowSpan=t.span.rowspan),e.appendChild(i)}}),s.appendChild(e)}),r.appendChild(s),i+1<n.length){var e=Y("DIV",{"class":"webix_print_pagebreak"});r.appendChild(e)}},this)),r}},Fr={$exportView:function(t){if(this.isBranchOpen&&H.extend(t,{filterHTML:!0}),"excel"!==t.export_mode||t.dataOnly||!t.styles)return this;t.dataOnly=!0,t.heights=D(t.heights)?"all":t.heights;var i=Te(this,t);return i[0].styles=this.Ty(t),delete t.dataOnly,i},Ty:function(t){var c=this.config.columns,f=[];return this.zy=this.zy||{},t.docHeader&&(f=[{0:this.Vy(t.docHeader.css)},{0:{}}]),!1!==t.header&&(f=this.Hy(t,"header",f)),this.data.each(function(t){for(var i={},s=0;s<c.length;s++){var e=this.getCss(t.id,c[s].id),n=c[s].node.className,h="",r=this.getIndexById(t.id)%2?"even":"odd",o=null,a=null;if(this.zf&&(o=this.getSpan(t.id,c[s].id))?(a=this.getSpanNode({row:o[0],column:o[1]}),h="webix_dtable_span "+(o[5]||"")):a=this.getItemNode({row:t.id,column:c[s].id}),!a){a=Y("div",{"class":e,style:"visibility:hidden"});var u=c[s].node;c[s].attached||(u=Y("div",{"class":n,style:"visibility:hidden"}),this.Yt.appendChild(u)),u.appendChild(a)}i[s]=this.By(a,[e,n,h,r].join(":"))}f[f.length]=i},this),!1!==t.footer&&this.config.footer&&(f=this.Hy(t,"footer",f)),t.docFooter&&(f=f.concat([{0:{}},{0:this.Vy(t.docFooter.css)}])),f},Hy:function(t,i,s){for(var e=this.config.columns,n=[],h=0;h<e[0][i].length;h++){for(var r={},o=0;o<e.length;o++){var a=e[o][i][h];if(a){var u=a.colspan?e[o+a.colspan-1].id:e[o].id,c="header"==i?this.getHeaderNode(u,h):this.getFooterNode(u,h);if(c){var f=[c.parentNode.className,a.css||"","webix_hcell",i];r[o]=this.By(c,f.join(":")),(
a.colspan||a.rowspan)&&n.push([h,o,{colspan:a.colspan-1||0,rowspan:a.rowspan-1||0},r[o]])}}else for(var l=0;l<n.length;l++){var d=n[l][2],v=n[l][1],_=n[l][0];v+d.colspan>=o&&_+d.rowspan>=h&&(r[o]=n[l][3])}}s[s.length]=r}return s},By:function(t,i){if(this.zy[i])return this.zy[i];var s=this.Ry(t),e={font:{},alignment:{},border:{}};e.font.name=s["font-family"].replace(/,.*$/,""),e.font.sz=.75*s["font-size"].replace("px",""),e.font.color={rgb:Zs.rgbToHex(s.color)},"normal"!==s["font-weight"]&&(e.font.bold=!0),"underline"===s["text-decoration-line"]&&(e.font.underline=!0),"italic"===s["font-style"]&&(e.font.italic=!0),"line-through"===s["text-decoration-line"]&&(e.font.strike=!0),e.alignment.horizontal=s["text-align"],e.alignment.vertical=s.height==s["line-height"]?"center":"top","normal"==s["white-space"]&&(e.alignment.wrapText=!0),t.firstChild&&t.firstChild.className&&-1!==t.firstChild.className.indexOf("webix_rotate")&&(e.alignment.textRotation=90);var n=Zs.rgbToHex(s["background-color"])||"FFFFFF";return e.fill={fgColor:{rgb:n}},-1!==s["background-image"].indexOf("gradient")&&(e.fill={fgColor:{rgb:Zs.rgbToHex(s["background-image"].substring(s["background-image"].lastIndexOf("(")))}}),t.parentNode&&"TD"==t.parentNode.nodeName&&(s=this.Ry(t.parentNode)),"0px"!==s["border-right-width"]&&(e.border.right={style:"thin",color:{rgb:Zs.rgbToHex(s["border-right-color"])||n}}),"0px"!==s["border-bottom-width"]&&(e.border.bottom={style:"thin",color:{rgb:Zs.rgbToHex(s["border-bottom-color"])||n}}),"0px"!==s["border-left-width"]&&(e.border.left={style:"thin",color:{rgb:Zs.rgbToHex(s["border-left-color"])||n}}),"0px"!==s["border-top-width"]&&(e.border.top={style:"thin",color:{rgb:Zs.rgbToHex(s["border-top-color"])||n}}),this.zy[i]=e},Vy:function(t){t=H.extend(t||{},{visibility:"hidden","white-space":"nowrap","text-align":"left"});var i="";for(var s in t)i+=s+":"+t[s]+";";var e=Y("div",{style:i});this.Yt.appendChild(e);var n=this.By(e,i);return G(e),n},Ry:function(t){return window.getComputedStyle?window.getComputedStyle(t):t.currentStyle}},Tr={subrow_setter:function(t){return!!t&&(this.Py(),this.q.fixedRowHeight=!1,Ft(t))},subview_setter:function(t){return t&&(this.q.subrow=this.subrow_setter("<div></div>")),t},defaults:{subRowHeight:35},jy:function(){this.data.each(function(t){t&&(t.$sub=this.q.subrow(t,this.type))},this),this.Ny()},Ny:function(t){if("auto"===this.q.subRowHeight&&this.ze&&this.Ey(),t&&this.q.subview)for(var i in this.My){var s=jt(this.My[i]);s.q.hidden||s.adjust()}},Ly:function(t){var i=this.getItem(t);i.$sub=this.q.subrow(i,this.type),"auto"===this.q.subRowHeight&&this.Ey(i.id,i.$sub)},$init:function(){this.Py=l(function(){var t="#"+this.Oy+" .webix_cell.webix_dtable_subview { line-height:normal;}";this.q.fixedRowHeight&&(t+="#"+this.Oy+" .webix_column .webix_cell { white-space: nowrap;}"),O(t),this.My={},this.attachEvent("onSubViewRender",this.Uy),this.data.attachEvent("onStoreUpdated",C(function(t,i,s){t?"update"==s||"add"==s?this.Ly(t):"delete"==s&&i.$subContent&&(jt(i.$subContent).destructor(),delete this.My[i.$subContent]):this.jy()},this)),this.attachEvent("onResize",function(t,i,s){s!=t&&this.Ny(!0)})}),this.type.subrow=function(t){return t.$sub?t.$subopen?"<div class='webix_tree_open webix_sub_open'></div>":"<div class='webix_tree_close webix_sub_close'></div>":"<div class='webix_tree_none'></div>"},this.on_click.webix_sub_open=function(t,i){return this.closeSub(i),!1},this.on_click.webix_sub_close=function(t,i){return this.openSub(i),!1}},openSub:function(t){var i=this.getItem(t);if(!i.$subopen){i.$row=this.q.subrow,i.$subHeight=i.$subHeight||this.q.subRowHeight,i.$subopen=!0;var s=this.My[i.$subContent];s&&(s.repaintMe=!0),this.refresh(t),this.callEvent("onSubViewOpen",[t])}},getSubView:function(t){var i=this.getItem(t);if(i){var s=this.My[i.$subContent];if(s)return jt(s)}return null},resizeSubView:function(t){var i=this.getSubView(t);i&&this.Yy(this.getItem(t),i)},Yy:function(t,i){var s=i.$getSize(0,0)[2],e=t.$subHeight||this.q.subRowHeight;2<Math.abs(s-(e||0))&&(t.$subHeight=s,this.refresh(t.id))},
Wy:function(t){var i=t.$width;if(t.Il){var s=t.Ks.length-t.Bl;t.Tl?i-=2*t.ma+2:i-=t.wa*(s-1)+2*t.ma+2*s}return 0<i},Uy:function(n,t){var i,s=this.My[n.$subContent];if(s)t.firstChild.appendChild(s),i=jt(n.$subContent),this.Wy(i)||i.adjust(),s.repaintMe&&(delete s.repaintMe,i.config.hidden=!1,i.Pe());else{var e,h=this.q.subview;(i="function"==typeof h?h.call(this,n,t.firstChild):((e=B(h)).$scope=this.$scope,Vt(e,t.firstChild))).getMasterView=C(function(){return this},this),n.$subContent=i.config.id,this.My[n.$subContent]=i.$view,this.rt.push(i),i.attachEvent("onResize",C(function(t,i,s,e){i&&i!=e&&this.refresh(n.id)},this)),this.callEvent("onSubViewCreate",[i,n])}this.Yy(n,i||jt(s))},Ey:function(i,s){var e=Y("DIV",{"class":"webix_measure_size webix_cell webix_dtable_subrow"},"");e.style.cssText="width:"+this.ze+"px; height:auto; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(e),this.data.each(function(t){(t&&!i||t.id==i&&t.$sub)&&(e.innerHTML=s||this.q.subrow(t,this.type),t.$subHeight=e.offsetHeight)},this),e=G(e)},closeSub:function(t){var i=this.getItem(t);if(i.$subopen){i.$row=!1,i.$subopen=!1;var s=this.My[i.$subContent];s&&(jt(s).config.hidden=!0),this.refresh(t),this.callEvent("onSubViewClose",[t])}}},zr={spans_setter:function(t){return t&&!this.zf&&this.Gy(),t},Gy:function(){this.zf={},this.Qx=[],this.data.attachEvent("onStoreLoad",C(function(t,i){i&&i.spans&&this.addSpan(i.spans)},this)),this.data.attachEvent("onClearAll",C(function(){this.zf={}},this)),this.attachEvent("onSyncScroll",function(t,i,s){for(var e=0;e<3;e++)Mi.Ci(this.Qx[e],1==e?t:0,i,s)}),this.attachEvent("onScrollY",this.Xy),this.attachEvent("onScrollX",this.Xy),this.attachEvent("onAfterRender",this.Jy),this.attachEvent("onColumnResize",this.Jy),this.attachEvent("onSelectChange",this.Ky)},addSpan:function(t,i,s,e,n,h){if("object"!=k(t))e=e||1,s=s||1,this.zf[t]||(this.zf[t]={}),this.zf[t][i]=[s,e,n,h];else for(var r=0;r<t.length;r++)this.addSpan.apply(this,t[r])},removeSpan:function(t,i){arguments.length||(this.zf={});var s=this.zf[t];s&&delete s[i]},getSpan:function(t,i){if(!t)return this.zf;var s,e,n,h,r,o=this.zf;for(t in s=this.getIndexById(t),n=this.getColumnIndex(i),o)for(i in o[t])if(r=o[t][i],e=this.getIndexById(t),h=this.getColumnIndex(i),!(s>e+r[1]-1||s<e||n>h+r[0]-1||n<h))return[t,i].concat(r);return null},Jy:function(){var t,i,s=this.If.length-this.q.rightSplit;for(G(this.Qx),i=0;i<3;i++)t=this.Qx[i]=Y("DIV",{"class":"webix_span_layer"}),this.Yt.childNodes[i].appendChild(t);this.Xy(),this.q.leftSplit&&this.qy(this.Qx[0],0,this.q.leftSplit),this.q.rightSplit&&this.qy(this.Qx[2],s,this.If.length),this.qy(this.Qx[1],this.q.leftSplit,s),this.q.topSplit&&!S.touch&&this.Zy()},Qy:function(){for(var t,i=0,s=0,e=0,n=0;i<this.q.leftSplit;)s+=this.If[i].width,i++;for(t=(i=this.If.length-1)-this.q.rightSplit;t<=i;)n+=this.If[i].width,i--;for(i=this.q.leftSplit;i<this.If.length-this.q.rightSplit;i++)e+=this.If[i].width;return[s,e,n]},Zy:function(){var t,i,s,e=this.If.length-this.q.rightSplit;for(i=3;i<6;i++)t=this.Qx[i]=Y("DIV",{"class":"webix_span_layer_top"}),this.Yt.childNodes[i-3].appendChild(t);s=this.Qy(),this.q.leftSplit&&(this.Qx[3].style.width=s[0]+"px",this.qy(this.Qx[3],0,this.q.leftSplit,!0)),this.q.rightSplit&&(this.Qx[5].style.width=s[2]+"px",this.qy(this.Qx[5],e,this.If.length,!0)),this.Qx[4].style.width=s[1]+"px",this.qy(this.Qx[4],this.q.leftSplit,e,!0)},qy:function(t,i,s,e){for(var n=0,h=this.data.$min||0,r=this.data.$max||this.data.order.length,o=h;o<r;o++){var a=this.data.order[o];if(a){var u=this.zf[a];if(u&&(!e||o<this.q.topSplit))for(var c=i;c<s;c++){var f=this.If[c].id;u[f]&&this.tM(t,o,c,u,n,i,a,f)}n+=this.qw(this.getItem(a))}}},Ky:function(){for(var t=this.config.select,i="cell"==t||"column"==t,s=this.getSelectedId(!0),e=[],n=this.iM||[],h=z()+"",r=!1,o=0;o<s.length;o++){var a=this.zf[s[o]];!a||i&&!a[s[o].column]||(a.$selected&&a.$selected.id==s[o].id||(r=!0),a.$selected=s[o],a.$time=h,e.push(s[o].id))}for(var u=0;u<n.length;u++){var c=this.zf[n[u]];c&&c.$time!==h&&(
delete c.$selected,r=!0)}this.iM=[].concat(s),r&&this.Jy()},sM:function(t,i){for(var s=0,e=t;e<i;e++){var n=this.If[e];s+=n?n.width:0}return s},eM:function(t,i){for(var s=0,e=t;e<i;e++){var n=this.getItem(this.data.order[e]);s+=n?this.qw(n):this.q.rowHeight}return s},tM:function(t,i,s,e,n,h,r,o){var a=e[o],u=a[2]||this.getText(r,o),c="";!e.$selected||"row"!==this.q.select&&e.$selected.column!==o||(c="webix_selected ");var f={column:s,row:i,"class":c+"webix_cell webix_table_cell webix_dtable_span "+(a[3]||""),"aria-colindex":s+1,"aria-rowindex":i+1};1<a[0]&&(f["aria-colspan"]=a[0]),1<a[1]&&(f["aria-rowspan"]=a[1]);var l=Y("DIV",f,""+u);l.style.top=n+"px",l.style.left=this.sM(h,s)+"px",l.style.width=this.sM(s,s+a[0])+"px",l.style.height=this.eM(i,i+a[1])+"px",t.appendChild(l)},Xy:function(){if(!this.q.prerender)for(var t=this.getScrollState(),i=0;i<3;i++)this.Qx[i].style.top="-"+(t.y||0)+"px"},ey:function(t,i){var s,e,n=!1;return this.zf&&(s=this.getSpan(t.row,t.column),e=this.getSpan(i.row,i.column),s&&e&&s[0]==e[0]&&s[1]==e[1]&&(n=!0)),n},getSpanNode:function(t){for(var i=this.Qx,s=this.getIndexById(t.row),e=this.getColumnIndex(t.column),n=0;n<i.length;n++)for(var h=i[n].childNodes,r=0;r<h.length;r++)if(h[r].getAttribute("row")==s&&h[r].getAttribute("column")==e)return h[r];return null}},Vr={name:"datatable",defaults:{leftSplit:0,rightSplit:0,topSplit:0,columnWidth:100,minColumnWidth:20,minColumnHeight:26,prerender:!(Sn.headerMenu={getValue:function(){},setValue:function(){},refresh:function(t,i){t.q.headermenu||(t.define("headermenu",!0),t.Kx()),i.onclick=function(){jt(t.config.headermenu).show(i)}},render:function(){return"<span class='webix_icon wxi-columns' role='button' tabindex='0' aria-label='"+ct.aria.headermenu+"'>"}}),autoheight:!1,autowidth:!1,header:!0,fixedRowHeight:!0,scrollAlignY:!0,scrollX:!0,scrollY:!0,datafetch:50,navigation:!0},$skin:function(){this.defaults.rowHeight=Qi.rowHeight,this.defaults.headerRowHeight=Qi.barHeight-2*Qi.borderWidth},on_click:{webix_richfilter:function(){return!1},webix_table_checkbox:function(t,i){i=this.locate(t);var s=this.getItem(i.row),e=this.getColumnConfig(i.column),n=t.target||t.srcElement,h=("checkbox"==n.type?n.checked:s[i.column]!=e.checkValue)?e.checkValue:e.uncheckValue,r={};return r[i.column]=h,this.updateItem(i.row,r,this.q.checkboxRefresh?"update":"save"),this.callEvent("onCheck",[i.row,i.column,h]),!1},webix_table_radio:function(t){var s=this.locate(t),i=this.getItem(s.row),e=this.getColumnConfig(s.column);return this.eachRow(function(t){var i=this.data.pull[t];i&&i[s.column]==e.checkValue&&(i[s.column]=e.uncheckValue)}),i[s.column]=e.checkValue,this.callEvent("onCheck",[s.row,s.column,!0]),this.refresh(),!1}},on_dblclick:{webix_table_checkbox:function(){return this.on_click.webix_table_checkbox.apply(this,arguments)}},on_context:{},$init:function(t){this.on_click=H.extend({},this.on_click);this.re.innerHTML="<div class='webix_ss_header'><div class='webix_hs_left'></div><div class='webix_hs_center'></div><div class='webix_hs_right'></div></div><div class='webix_ss_body'><div class='webix_ss_left'><div class='webix_ss_center_scroll'></div></div><div class='webix_ss_center'><div class='webix_ss_center_scroll' role='rowgroup'></div></div><div class='webix_ss_right'><div class='webix_ss_center_scroll'></div></div></div><div class='webix_ss_hscroll' role='scrollbar' aria-orientation='horizontal'></div><div class='webix_ss_footer'><div class='webix_hs_left'></div><div class='webix_hs_center'></div><div class='webix_hs_right'></div></div><div class='webix_ss_vscroll_header'></div><div class='webix_ss_vscroll' role='scrollbar' aria-orientation='vertical'></div><div class='webix_ss_vscroll_footer'></div>",this.Oy=this.re.id=this.name+z(),this.re.className+=" webix_dtable",this.bt=this.re,this.U=this.re.firstChild,this.Yt=this.U.nextSibling,this.$f=this.Yt.nextSibling.nextSibling,this.nt.setAttribute("role","grid"),t.editable||this.nt.setAttribute("aria-readonly","true"),this.data.provideApi(this,!0),this.data.attachEvent("onParse",C(this.nM,this)),this.$ready.push(
this.hM),this.If=[],this.io=[],this.Tf=[],this.Vf=[],this.rM=[],this.fo={},this.no={},this.So=this.oM=0,this.rt=[],this.data.attachEvent("onServerConfig",C(this.aM,this)),this.data.attachEvent("onServerOptions",C(this.uM,this)),this.attachEvent("onViewShow",function(){this.Gv(),this.cM()}),this.data.attachEvent("onClearAll",C(function(t){t||(this.oh=this.hh=0,this.rh&&this.rh.reset(),this.nh&&this.nh.reset(),this.fM(0))},this)),this.attachEvent("onDestruct",this.lM),this.attachEvent("onKeyPress",this.je),this.attachEvent("onScrollY",this.dM),I("onDataTable",[this,t])},vM:function(){this._M=this.gx=S.scrollSize,O("#"+this.Oy+" .webix_cell { height:"+this.q.rowHeight+"px; line-height:"+(this.q.rowLineHeight||this.q.rowHeight)+"px;"+(this.q.fixedRowHeight?"":"white-space:normal;")+" }"),O("#"+this.Oy+" .webix_hcell { height:"+this.q.headerRowHeight+"px; line-height:"+this.q.headerRowHeight+"px;}"),this.vM=function(){}},hM:function(){this.data.attachEvent("onStoreLoad",C(this.cM,this)),this.data.attachEvent("onSyncApply",C(this.cM,this)),this.data.attachEvent("onStoreUpdated",C(function(){return this.render.apply(this,arguments)},this)),this.data.attachEvent("onStoreUpdated",C(this.pM,this)),this.render()},refresh:function(){this.render()},render:function(t,i,s){if("save"!=s){if("move"==s){var e=zi.getContext();if(e&&e.fragile)return}if(!this.If.length){var n=this.q.columns;if(!n||!n.length){if(!this.q.autoConfig||!this.data.order.length||this.io.length)return;this.ho=0,this.mM()}this.gy()}if(!this.isVisible(this.q.id)||this.$blockRender)return this.vM();var h=this.config.experimental&&!this.q.subview;return!t||-1==i||"paint"!=s&&"update"!=s||h?(this.bM&&(clearTimeout(this.bM),this.bM=0),this.callEvent("onBeforeRender",[this.data])?(this.vM(),this.ho||this.wy(),this.ze&&(h&&("paint"==s||"update"==s)&&t?this.gM(t):this.wM(!0,!0)),t&&"update"==s||(this.ax=this.xM(),this.yM()),this.nt.setAttribute("aria-colcount",Math.max(this.io.length,this.If.length)),this.nt.setAttribute("aria-rowcount",this.data.count()),this.callEvent("onAfterRender",[this.data]),!0):void 0):(this.bM&&clearTimeout(this.bM),void(this.bM&&this.MM!=t?(this.MM=null,this.bM=$(function(){this.render()},this)):(this.MM=t,this.bM=$(function(){this.render(t,-1,s)},this))))}},getColumnConfig:function(t){return this.Ff[t]||this.ro[t]},uM:function(t){for(var i in t){var s=this.getColumnConfig(i),e=new Ih({data:t[i]});this.rt.push(e),this.iu(e,s)}},aM:function(t){t.columns&&this.ho&&this.refreshColumns(null,!0)},gy:function(){if(this.q.columns){this.If=this.q.columns,this.Ff={};for(var t=0;t<this.If.length;t++){var i=this.If[t],s=(this.Ff[i.id]=i).cssFormat;if(s&&(i.cssFormat=m(s,this.$scope)),i.width=i.width||this.q.columnWidth,"string"==typeof i.format&&(i.format=ct[i.format]||window[i.format]),i.numberFormat){var e=i.numberFormat;"string"==typeof e&&(i.numberFormat=e=nn.getConfig(e)),i.format=nn.numToStr(e),i.editFormat=i.editFormat||function(t){return nn.format(t,e)},i.editParse=i.editParse||function(t){return nn.parse(t,e)}}D(i.checkValue)&&(i.checkValue=1),D(i.uncheckValue)&&(i.uncheckValue=0),i.css&&"object"==k(i.css)&&(i.css=L(i.css));var n=i.template;n&&("string"==typeof n&&(n=n.replace(/#\$value#/g,"#"+i.id+"#")),i.template=Ft(n))}this.SM("header",this.Tf),this.SM("footer",this.Vf),this.callEvent("onStructureLoad",[])}},kM:function(){this.wy()},lM:function(){for(var t=0;t<this.If.length;t++)delete this.If[t].attached,delete this.If[t].node},wy:function(){this.Zg=this.If.length-this.q.rightSplit;for(var t=this.CM=0;t<this.If.length;t++){if(!this.If[t].node){var i=Y("DIV");i.style.width=this.If[t].width+"px",this.If[t].node=i}t>=this.q.leftSplit&&t<this.Zg&&(this.CM+=this.If[t].width)}var s=[];if(this.q.rightSplit){var e=this.If.length-this.q.rightSplit;s[e]=" webix_first",s[e-1]=" webix_last"}if(this.q.leftSplit){var n=this.q.leftSplit;s[n]=" webix_first",s[n-1]=" webix_last"}s[0]=(s[0]||"")+" webix_first webix_select_mark";var h=this.If.length-1;s[h]=(s[h]||"")+" webix_last";for(var r=0;r<this.If.length;r++){var o=this.If[r].node;o.setAttribute("column",r),
o.className="webix_column "+(this.If[r].css||"")+(s[r]||"")}this.DM(),this.$M(),this.AM(),this.zw(),this.ho=!0},$M:function(){for(var t=0,i=0;i<this.If.length;i++){var s=this.If[i];i!=this.q.leftSplit&&i!=this.Zg||(t=0),s.node&&(s.node.style.left=t+"px",(this.q.leftSplit||this.q.rightSplit)&&(G(s.node),s.attached=!1)),t+=s.width}},zw:function(){this.IM||(this.IM=0),this.So=this.oM=0,this.q.header&&(this.FM(this.U,0,1),this.SM("header",this.Tf),this.So=this.Tf.TM,this.zM(this.U,"header",this.Tf)),this.q.footer&&(this.FM(this.$f,0,1),this.SM("footer",this.Vf),this.oM=this.Vf.TM,this.zM(this.$f,"footer",this.Vf)),this.refreshHeaderContent(!1,!1),this.VM(),this.so&&this.markSorting(this.so,this.eo)},HM:function(t,i,s){var e=0,n=t.colspan||1,h="webix_hcell "+(t.css||"");if(t.rotate)h+=" webix_measure_rotate";else for(var r=0;r<n;r++)e+=this.If[s+r]?this.If[s+r].width:this.config.columnWidth;var o=nt([t.text],h,e);return(t.rotate?o.width:o.height)+1},SM:function(t,i){for(var s=0,e=0;e<this.If.length;e++){var n=this.If[e][t];n&&"object"==k(n)&&n.length||(D(n)&&(n="header"==t?this.If[e].id:""),n=[n]);for(var h=0;h<n.length;h++)"object"!=k(n[h])&&(n[h]={text:n[h]}),n[h]&&n[h].height&&(i[h]=n[h].height),n[h]&&n[h].autoheight&&(i[h]=this.HM(n[h],this.If[e],e));s=Math.max(s,n.length),this.If[e][t]=n}for(var r=(i.TM=s)-1;0<=r;r--)i[r]=i[r]||this.q.headerRowHeight,i.TM+=1*i[r];for(var o=0;o<this.If.length;o++)for(var a=this.If[o][t],u=0;u<a.length;u++){if(a[u]&&a[u].rowspan)for(var c=1;c<a[u].rowspan;c++)a[u+c]=null;if(a[u]&&a[u].colspan)for(var f=1;f<a[u].colspan;f++)this.If[o+f][t][u]=null}for(var l=0;l<this.If.length;l++){var d=this.If[l][t];if(d.length<s){var v=d.length-1;d[v].rowspan=s-d.length+1;for(var _=v+1;_<s;_++)d[_]=null}}return s},BM:function(t,i){for(var s=t.getElementsByTagName("TD"),e=0;e<s.length;e++)if(s[e].getAttribute("active_id")==i)return s[e]},getHeaderContent:function(t){var i=this.BM(this.U,t);if(i||(i=this.BM(this.$f,t)),i){var s=this.fo[t],e=Sn[s.content],n={type:e,getValue:function(t){return e.getValue(i,t)},setValue:function(t){return e.setValue(i,t)}};return e.getHelper&&H.extend(n,e.getHelper(i,s)),n}},RM:function(t,i,s){var e=s?-1:0;for(s+=i;i<s;i++)e+=t[i]+1;return e},PM:function(t,i,s,e,n){if(t==i)return"";var h="<table role='presentation' style='width:"+s+"px' cellspacing='0' cellpadding='0'>";h+="<tr class='webix_size_row'>";for(var r=t;r<i;r++)h+="<td style='width:"+this.If[r].width+"px;'></td>";h+="</tr>";for(var o=this.If[0][e].length,a=0;a<o;a++){h+="<tr section='"+e+"' role='row'>";for(var u=t;u<i;u++){var c=this.If[u][e][a];if(null!==c){c.content&&(c.contentId=c.contentId||z(),c.columnId=this.If[u].id,c.format=this.If[u].format,Sn[c.content],c.content,c.text=Sn[c.content].render(this,c),this.fo[c.contentId]=c,this.jM=!0),h+="<td  role='presentation' column='"+(c.colspan?c.colspan-1+u:u)+"'";var f="";u==t&&(f+="webix_first"),i-1<=u+(c.colspan?c.colspan-1:0)&&(f+=" webix_last"),(c.rowspan&&a+c.rowspan===o||a===o-1)&&(f+=" webix_last_row"),f&&(h+=' class="'+f+'"');var l=n[a],d="";c.contentId&&(h+=" active_id='"+c.contentId+"'"),c.colspan&&(h+=" colspan='"+c.colspan+"'"),c.rowspan&&(h+=" rowspan='"+c.rowspan+"'",l=this.RM(this.Tf,a,c.rowspan)),l!=this.q.headerRowHeight&&(d=" style='line-height:"+l+"px; height:"+l+"px;'");var v="webix_hcell",_=c.css;_&&("object"==k(_)&&(c.css=_=L(_)),v+=" "+_),this.If[u].$selected&&(v+=" webix_sel_hcell"),h+="><div role='columnheader' class='"+v+"'"+d+">";var p=""===c.text?"&nbsp;":c.text;c.rotate&&(p="<div class='webix_rotate' style='width:"+(l-10)+"px; transform-origin:center "+(l-15)/2+"px;-webkit-transform-origin:center "+(l-15)/2+"px;'>"+p+"</div>"),h+=p+"</div></td>"}}h+="</tr>"}return h+="</tr></table>"},showItemByIndex:function(t,i){var s=this.q.pager;if(s){var e=Math.floor(t/s.size);e!=s.page&&jt(s.id).select(e)}var n=this.getScrollState();if(-1!=t){var h=this.Yg();if(t<h[0]+1||t>=h[1]-1){var r=this.NM(s?this.data.$min:0,t);t<h[0]+1?r=Math.max(0,r-1)-this.EM:(r+=this.Ow(t)-this.yy,0<t&&(r+=this.Ow(t-1)-1)),n.y=r}}if(-1!=i){if(i<this.q.leftSplit)return;if(
i>=this.Zg)return;var o=this.Ug();if(i<o[0]+1||i>=o[1]-1){for(var a=0,u=this.q.leftSplit;u<i;u++)a+=this.If[u].width;i<o[0]+1||(a+=this.If[i].width-this.Lw),n.x=a}}this.scrollTo(n.x,n.y)},showCell:function(t,i){if(!i||!t){var s=this.getSelectedId(!0);1==s.length&&(i=i||s[0].column,t=t||s[0].row)}i=i?this.getColumnIndex(i):-1,t=t?this.getIndexById(t):-1,this.showItemByIndex(t,i)},scrollTo:function(t,i){if(this.rh){if(this.hx)return this.hx(t,i);null!==t&&this.rh.scrollTo(t),null!==i&&this.nh.scrollTo(i)}},getScrollState:function(){if(this.ox)return this.ox();var t=this.Lg?0:this.LM||0;return{x:this.oh||0,y:this.hh+t}},showItem:function(t){this.showItemByIndex(this.getIndexById(t),-1)},zM:function(t,i,s){t.childNodes[0].innerHTML=this.PM(0,this.q.leftSplit,this.sw,i,s),t.childNodes[1].innerHTML=this.PM(this.q.leftSplit,this.Zg,this.CM,i,s),t.childNodes[1].onscroll=C(this.OM,this),t.childNodes[2].innerHTML=this.PM(this.Zg,this.If.length,this.Ew,i,s)},OM:function(){var t=this.getScrollState().x,i=this.U.childNodes[1].scrollLeft;i!=t&&this.scrollTo(i,null)},pM:function(){this.refreshHeaderContent(!0,!0)},cM:function(){this.refreshHeaderContent(!1,!0)},refreshHeaderContent:function(t,i,s){this.q.header&&(i&&this.FM(this.U,t,1,s),this.FM(this.U,t,0,s)),this.q.footer&&(i&&this.FM(this.$f,t,1,s),this.FM(this.$f,t,0,s))},refreshFilter:function(t){this.refreshHeaderContent(!1,!0,t)},FM:function(t,i,s,e){if(this.jM&&t)for(var n=t.getElementsByTagName("TD"),h=0;h<n.length;h++)if(n[h].getAttribute("active_id")){var r=this.fo[n[h].getAttribute("active_id")];if(e&&e!=r.columnId)continue;var o=Sn[r.content];s?o.getValue&&(r.value=o.getValue(n[h])):i&&!o.trackCells||o.refresh(this,n[h],r)}},headerContent:[],UM:function(t,i,s){if(this.gx){if(t.style.height=Math.max(i,1)-1+"px",t.style.width=(this.Zg?0:s)+this.gx-1+"px",S.isWebKit)t.offsetWidth}else t.style.display="none"},VM:function(){this.q.header&&this.UM(this.YM,this.So,this.IM),this.q.footer&&this.UM(this.WM,this.oM,this.IM)},$h:function(){var t=!(this.q.autowidth||!1===this.q.scrollX);this._M=t?S.scrollSize:0;var i=!(this.q.autoheight||!1===this.q.scrollY);this.gx=i?S.scrollSize:0,S.touch&&(t=i=!1),this.rh&&(this.rh.q.scrollSize=this._M,this.rh.q.scrollVisible=t),this.nh&&(this.nh.q.scrollSize=this.gx,this.nh.q.scrollVisible=i)},DM:function(){var t,i;if(this.hh=0,this.oh=0,t=i=1,(this.q.autoheight||!1===this.q.scrollY)&&(i=this.gx=0),(this.q.autowidth||!1===this.q.scrollX)&&(t=this._M=0),S.touch&&(t=i=0),this.rh||(this.rh=Vt({view:"vscroll",container:this.$f.previousSibling,scrollWidth:this.CM,scrollSize:this._M,scrollVisible:t}),!t||this._M||S.$customScroll||(this.rh.nt.style.position="absolute"),this.rh.attachEvent("onScroll",C(this.GM,this))),!this.nh){this.YM=this.$f.nextSibling;var s=this.YM.nextSibling;this.WM=s.nextSibling,this.nh=Vt({view:"vscroll",container:s,scrollHeight:100,scroll:"y",scrollSize:this.gx,scrollVisible:i}),this.nh.activeArea(this.Yt),this.rh.activeArea(this.Yt,!0),this.nh.attachEvent("onScroll",C(this.XM,this))}this.ze&&this.callEvent("onResize",[this.ze,this.He]),S.$customScroll&&ms.enable(this),this.DM=function(){}},columnId:function(t){return this.If[t].id},getColumnIndex:function(t){for(var i=0;i<this.If.length;i++)if(this.If[i].id==t)return i;return-1},JM:function(t,i){var s,e=0,n=0,h=0,r=0,o=0;for(s=0;s<this.If.length&&(this.Zg!=s&&this.q.leftSplit!=s||(e=0,o++),this.If[s].id!=i);s++)e+=this.If[s].width;for(n+=this.If[s].width,s=0;s<this.data.order.length&&this.data.order[s]!=t;s++)r+=this.Ow(s);return h+=this.Ow(s),[e,n,r-this.hh,h,this.Yt.childNodes[o]]},Sw:function(){return this.row},locate:function(t,i){if(this.q.subview&&this!=jt(t))return null;for(t=t.target||t.srcElement||t;t&&t.getAttribute&&t!==this.$view;){var s=rt(t).toString(),e=null;if(-1!=s.indexOf("webix_cell")&&(e=this.Li(t))&&(e.row=this.data.order[e.rind]),-1!=s.indexOf("webix_hcell")&&(e=this.Li(t))&&(e.header=!0),e)return i?e.header?null:e.row:(e.column=this.If[e.cind].id,e.toString=this.Sw,e);t=t.parentNode}return null},Li:function(t){var i=t.parentNode;if(!i)return null;var s=1*(
t.getAttribute("column")||i.getAttribute("column")),e=t.getAttribute("row")||0,n=1*(t.getAttribute("colspan")||i.getAttribute("colspan"));if(!e)for(var h=0;h<i.childNodes.length;h++)i.childNodes[h]==t&&(e=h>=this.q.topSplit?h+this.If[s].ty-this.q.topSplit:h);return{rind:e,cind:s,span:n}},cx:function(){for(var t=-this.Lw,i=0;i<this.If.length;i++)t+=this.If[i].width;this.oh=Math.min(this.oh,Math.max(0,t))},uo:function(t){this.ho&&(this.cx(),this.$M(),this.AM(),this.zw(),t||this.wM(!1,!1))},setColumnWidth:function(t,i,s){return this.ao(this.getColumnIndex(t),i,s)},ao:function(t,i,s,e){if(!(isNaN(i)||t<0)){var n=this.If[t];n.minWidth&&i<n.minWidth?i=n.minWidth:i<this.q.minColumnWidth&&(i=this.q.minColumnWidth);var h=n.width;return h!=i&&(t>=this.q.leftSplit&&t<this.Zg&&(this.CM+=i-h),n.width=i,!!n.node&&(n.node.style.width=i+"px",s||this.uo(),this.callEvent("onColumnResize",[n.id,i,h,!!e]),!0))}},qw:function(t){return(t.$height||this.q.rowHeight)+(t.$subopen?t.$subHeight:0)},Ow:function(t){var i=this.data.order[t];return i?this.qw(this.data.pull[i]):this.q.rowHeight},NM:function(t,i){if(this.q.fixedRowHeight)return(i-t)*this.q.rowHeight;for(var s=0;t<i;t++)s+=this.Ow(t);return s},Wt:function(t,i){1==arguments.length&&(i=t.column,t=t.row);for(var s=this.getItem(t),e=this.getColumnConfig(i),n=0,h=0,r=0;r<this.If.length;r++){r!=this.q.leftSplit&&r!=this.Zg||(n=0);var o=this.If[r];if(o.id==i){var a=r<this.q.leftSplit?0:r>=this.Zg?2:1;h=this.Yt.childNodes[a].firstChild;break}n+=o.width}return{parent:h,top:this.getIndexById(t)<this.q.topSplit?this.NM(0,this.getIndexById(t)):this.NM((this.Kg||0)-this.q.topSplit,this.getIndexById(t))+(this.Lg||0),left:n,width:e.width,height:s.$height||this.q.rowHeight}},xM:function(){var t=this.q.pager,i=0,s=this.data.order.length;return t&&(i=t.size*t.page,s=Math.min(s,i+t.size),t.level&&(i=this.data.$min,s=this.data.$max)),this.NM(i,s)},setRowHeight:function(t,i){if(!isNaN(i)){i<this.q.minColumnHeight&&(i=this.q.minColumnHeight);var s=this.getItem(t),e=s.$height||this.q.rowHeight;e!=i&&(s.$height=i,this.config.fixedRowHeight=!1,this.render(),this.callEvent("onRowResize",[t,i,e]))}},XM:function(t){var i=this.hh!==t;if(this.hh=t,this.q.prerender)for(var s=this.Yt.childNodes,e=0;e<s.length;e++)s[e].scrollTop=t;else this.wM();S.$customScroll&&ms.$h(this.Yt),i&&(this.callEvent("onScrollY",[]),this.callEvent("onAfterScroll",[]))},fM:function(t){this.Yt.childNodes[1].scrollLeft=this.oh=t,this.q.header&&(this.U.childNodes[1].scrollLeft=t),this.q.footer&&(this.$f.childNodes[1].scrollLeft=t)},GM:function(t){var i=this.oh!==t;this.fM(t),!1===this.q.prerender&&this.wM(!this.KM),S.$customScroll&&ms.$h(this.Yt),i&&(this.callEvent("onScrollX",[]),this.callEvent("onAfterScroll",[]))},Ug:function(t){if(t)return[0,this.If.length];for(var i=this.oh,s=this.q.leftSplit;0<i&&this.If.length-1>s;)i-=this.If[s].width,s++;var e=s;for(i&&0<s&&s--,i+=this.Lw;0<i&&e<this.Zg;)i-=this.If[e].width,e++;return[s,e]},getVisibleCount:function(){return Math.floor(this.yy/this.config.rowHeight)},Yg:function(t){var i=this.hh,s=0,e=this.count(),n=this.q.pager;if(n&&(s=n.page*n.size,e=Math.min(e,s+n.size),n.level&&(s=this.data.$min,e=this.data.$max)),this.q.autoheight)return[s,e,0];if(t)return[s,e,0];var h=s,r=this.q.topSplit||0;r&&(h+=r);var o=this.q.fixedRowHeight?this.q.rowHeight:0;if(o){var a=Math.ceil(i/o);i-=a*o,h+=a}else for(;0<i;)i-=this.Ow(h),h++;var u=0<h&&i?-(this.Ow(h-1)+i):0,c=h;if(i&&h--,i+=(this.yy||this.He)-(this.EM||0),o){var f=Math.ceil(i/o);i-=f*o,c+=f}else for(;0<i&&c<e;)i-=this.Ow(c),c++;return e<c&&(c=e),[h,c,u]},gM:function(t){var i=this.getItem(t),s=this.getIndexById(t),e=this.Yg(),n=this.config.topSplit,h="";if(n<=s){if(s<e[0]||s>=e[1])return;s-=e[0]-n}else h=s==n-1?" webix_topcell webix_last_topcell":" webix_topcell";for(var r=this.Ug(),o=0;o<this.If.length;o++){var a=this.If[o];if(o<this.Zg&&o>=this.q.leftSplit&&(o<r[0]||o>r[1])&&(a.ty=-999),a.attached&&a.node){var u=a.node.childNodes[s];if(!u)continue;var c=this.xx(i,this.If[o],0);u.innerHTML=c,u.className=this.qM(this.If[o],c,i,t)+h}}},wM:function(t,i){if(
this.If.length){i&&this.ZM();var s=this.Ug(this.q.prerender),e=this.Yg(!0===this.q.prerender);if(t){for(var n=this.q.leftSplit;n<s[0];n++)this._y(n,i);for(var h=s[1];h<this.Zg;h++)this._y(h,i)}this.Og=[];for(var r=0;r<this.q.leftSplit;r++)this.QM(r,e,i);for(var o=s[0];o<s[1];o++)this.QM(o,e,i,o==s[0]);for(var a=this.Zg;a<this.If.length;a++)this.QM(a,e,i);this.tS(e[0],e[1],i),this.iS(e)}},sS:function(t,i){this.eS=t,this.nS=i,G(this.rM),this.rM=[]},dM:function(){if(this.q.prerender&&this.hS){var t=this.getScrollState();this.hS.style.top="-"+(t.y||0)+"px"}},tS:function(t,i,s){if(this.hS&&(this.hS.style.top=this.Lg+"px"),s||t!=this.eS||i!=this.nS){if(this.sS(t,i),this.rS){this.rS=!1;for(var e=0;e<this.Og.length;e++){var n,h=this.Og[e],r=this.getItem(h.id);n="function"==typeof r.$row?r.$row.call(this,r,this.type):this.xx(r,this.getColumnConfig(r.$row),e);var o=this.rM[e]=Y("DIV",null,n);o.className="webix_cell "+(r.$sub?"webix_dtable_sub"+(this.q.subview?"view":"row"):"webix_dtable_colrow"+(r.$row?" webix_topcell"+(this.data.getMark(r.id,"webix_selected")?" webix_selected":""):"")),o.setAttribute("column",0),o.setAttribute("row",h.index);var a=r.$height||this.q.rowHeight;r.$subopen?o.style.height=r.$subHeight+"px":o.style.height=a+"px",o.style.paddingRight=S.scrollSize+"px";var u=this.Og[e].index<this.config.topSplit?-this.Lg:0;o.style.top=u+h.top+(r.$subopen?a-1:0)+"px",this.hS||(this.hS=Y("DIV"),this.hS.style.position="relative",this.hS.style.top=this.Lg+"px",this.Yt.appendChild(this.hS)),this.hS.appendChild(o),this.attachEvent("onSyncScroll",function(t,i,s){Mi.Ci(this.hS,0,i,s)}),this.q.subview&&this.callEvent("onSubViewRender",[r,o])}}}else if(this.config.topSplit)for(var c=0;c<this.Og.length;c++){var f=this.rM[c];this.Og[c].index<this.config.topSplit&&(f.style.top=this.Og[c].top-this.Lg+"px")}},iS:function(t){var i=this.q.pager,s=this.q.datafetch,e=!this.oS||t[0]>=this.oS;if(this.oS=t[0],this.aS){if(i&&(!s||s>=i.size)&&this.uS([0,i.size*i.page],Math.max(s,i.size),!0))return this.aS=null;this.Af(this.aS,e),this.aS=null}else this.q.loadahead&&this.uS(t,this.q.loadahead,e)},uS:function(t,i,s){var e=t[1],n=e+i;s||(e=t[0]-i,n=t[0]),e<0&&(e=0),n=Math.min(n,this.data.order.length-1);for(var h=!1,r=e;r<n;r++)this.data.order[r]||(h?(h.last=r,h.count=r-e):h={start:r,count:n-e});if(h)return this.Af(h,s),!0},Af:function(t,i){var s=Math.max(t.count,this.q.datafetch||this.q.loadahead||0),e=i?t.start:t.last-s+1;this.qr(t.count,t.start)||this.loadNext(s,e)},cS:function(t){if(S.isSafari){var i,s,e,n,h=[this.rh,this.nh];for(i=0;i<2;i++)(n=h[i])&&n.Sg&&n.Sg.parentNode==t&&(s=n.Sg);s&&(this.fS&&G(this.fS),e=(this.fS=s).cloneNode(!0),s.parentNode.insertBefore(e,s),this.fS.style.display="none",this.Yt.appendChild(this.fS))}},_y:function(t){var i=this.If[t];this.cS(i.node),G(i.node),i.attached=!1},ZM:function(){for(var t=0;t<this.If.length;t++)this.If[t].ty=-1;this.rM.length&&(G(this.rM),this.rM=[])},getText:function(t,i){return this.xx(this.getItem(t),this.getColumnConfig(i),0)},getCss:function(t,i){var s=this.getItem(t);return this.qM(this.getColumnConfig(i),s[i],s,t)},qM:function(t,i,s,e){var n="webix_cell";if(t.cssFormat){var h=t.cssFormat(i,s,e,t.id);h&&("object"==k(h)?n+=" "+L(h):n+=" "+h)}var r=s.$css;r&&("object"==k(r)&&(s.$css=r=L(r)),n+=" "+r);var o=this.data.fr[e];if(o&&(o.$css&&(n+=" "+o.$css),o.$cellCss)){var a=o.$cellCss[t.id];a&&(n+=" "+a)}if(s.$cellCss){var u=s.$cellCss[t.id];u&&("object"==k(u)&&(u=L(u)),n+=" "+u)}var c=this.data.getMark(s.id,"webix_selected");return(c&&(c.$row||c[t.id])||t.$selected)&&(n+=this.pw),n},xx:function(t,i,s){return t?((e=t[i.id])!==undefined&&null!==e||(e=""),i.format&&(e=i.format(e)),i.template&&(e=i.template(t,this.type,e,i,s)),e):"";var e},type:{checkbox:function(t,i,s,e){return"<input class='webix_table_checkbox' type='checkbox' "+(s==e.checkValue?'checked="true"':"")+">"},radio:function(t,i,s,e){return"<input class='webix_table_radio' type='radio' "+(s==e.checkValue?'checked="true"':"")+">"},editIcon:function(){return"<span class='webix_icon wxi-pencil'></span>"},trashIcon:function(){
return"<span class='webix_icon wxi-trash'></span>"}},type_setter:function(t){return this.types&&this.types[t]?(this.type=f(this.types[t]),this.type.css&&(this.re.className+=" "+this.type.css)):Tt(this,t),this.type.on_click&&H.extend(this.on_click,this.type.on_click),t},QM:function(t,i,s,e){var n=this.If[t];if(!n.attached){var h=t<this.q.leftSplit?0:t>=this.Zg?2:1;this.Yt.childNodes[h].firstChild.appendChild(n.node),n.attached=!0,n.split=h}if(this.Kg=i[0],this.Lg=0,this.LM=i[2],this.q.scrollAlignY?i[1]==this.data.order.length||this.data.$pagesize&&i[1]%this.data.$pagesize==0?n.node.style.top=(this.Lg=i[2])+"px":n.lS&&(n.node.style.top="0px"):(this.Lg=i[2],n.node.style.top=i[2]+"px"),!(s||n.ty!=i[0]||n.iy!=i[1]||this.q.topSplit&&n.Lg!=this.Lg))return 0;for(var r="",o=this.q.columns[t],a={row:this.q.rowHeight,total:0,single:e},u=0;u<this.q.topSplit;u++)r+=this.dS(u,o,i,a,-this.Lg,t);this.aS=null;for(var c=Math.max(i[0],this.q.topSplit);c<i[1];c++)r+=this.dS(c,o,i,a,-1,t);return this.cS(n.node),n.node.innerHTML=r,n.ty=i[0],n.iy=i[1],n.lS=i[2],n.Lg=this.Lg,1},dS:function(t,i,s,e,n,h){var r=this.data.order[t],o=this.data.getItem(r),a="";if(o){var u=" role='gridcell' aria-rowindex='"+(t+1)+"' aria-colindex='"+(this.getColumnIndex(i.id)+1)+"'"+(o.$count||o.$sub?" aria-expanded='"+(o.open||o.$subopen?"true":"false")+"'":"")+(o.$level?" aria-level='"+o.$level+"'":"");if(e.single&&o.$row&&(this.rS=!0,this.Og.push({top:e.total,id:o.id,index:t}),!o.$sub)){var c=o.$height||e.row;return e.total+=c,"<div"+u+" class='webix_cell' style='height:"+c+"px;'></div>"}var f=this.xx(o,i,t),l=this.qM(i,f,o,r),d=" aria-selected='true' tabindex='0'";if(-1!==l.indexOf("select"))if(-1!==l.indexOf("row"))this.Ug()[0]===h&&(u+=d);else-1!==l.indexOf("col")?t===s[0]&&(u+=d):u+=d;var v=!!o.$subopen,_=v?"margin-bottom:"+o.$subHeight+"px;":"";0<=n&&(0<n&&(_+="top:"+n+"px;'"),l="webix_topcell "+l,t==this.q.topSplit-1&&(l="webix_last_topcell "+l)),o.$height?(a="<div"+u+" class='"+l+"' style='height:"+o.$height+"px;"+_+"'>"+f+"</div>",e.total+=o.$height-e.row):a="<div"+u+" class='"+l+"'"+(_?" style='"+_+"'":"")+">"+f+"</div>",v&&(e.total+=o.$subHeight)}else a="<div role='gridcell' class='webix_cell'></div>",this.aS?this.aS.last=t:this.aS={start:t,count:s[1]-t};return e.total+=e.row,a},yM:function(){if(this.If.length&&!isNaN(1*this.He)){var t=this.ax+(this._M?this._M:0);if(!this.q.autoheight&&!this.q.yCount||!this.resize()){this.nh.sizeTo(this.He,this.So,this.oM),this.nh.define("scrollHeight",t),this.EM=this.q.topSplit?this.NM(0,this.q.topSplit):0,this.yy=Math.max(0,this.He-this._M-this.So-this.oM);for(var i=0;i<3;i++)this.Yt.childNodes[i].style.height=this.yy+"px",this.q.prerender?this.Yt.childNodes[i].firstChild.style.height=this.ax+"px":this.Yt.childNodes[i].firstChild.style.height=this.yy+"px";this.U.style.height=this.So+"px"}}},AM:function(){if(this.If.length){var t=0;for(this.sw=0,this.Ew=0,this.Lw=0;t<this.q.leftSplit;)this.sw+=this.If[t].width,t++;for(t=this.If.length-1;t>=this.Zg;)this.Ew+=this.If[t].width,t--;if(this.ze&&(!this.q.autowidth||!this.resize())){this.Lw=this.ze-this.Ew-this.sw-this.gx,this.Yt.childNodes[1].firstChild.style.width=this.CM+"px",this.Yt.childNodes[0].style.width=this.sw+"px",this.Yt.childNodes[1].style.width=this.Lw+"px",this.Yt.childNodes[2].style.width=this.Ew+"px",this.U.childNodes[0].style.width=this.sw+"px",this.U.childNodes[1].style.width=this.Lw+"px",this.U.childNodes[2].style.width=this.Ew+"px",this.$f.childNodes[0].style.width=this.sw+"px",this.$f.childNodes[1].style.width=this.Lw+"px",this.$f.childNodes[2].style.width=this.Ew+"px";var i=this.Lw-this.CM;if(i<0&&(i=0),i!=this.IM&&(this.IM=i,this.VM()),S.isWebKit){this.Yt.childNodes[0].offsetWidth;this.Yt.childNodes[1].offsetWidth,this.Yt.childNodes[1].firstChild.offsetWidth,this.Yt.childNodes[2].offsetWidth}this.rh.sizeTo(this.ze-this.gx),this.rh.define("scrollWidth",this.CM+this.sw+this.Ew)}}},$getSize:function(t,i){if((this.q.autoheight||this.q.yCount)&&this.q.columns){var s=(this.q.yCount||0)*this.q.rowHeight;s||(s=this.isVisible()?this.ax:this.count(
)*this.q.rowHeight),this.q.height=Math.max(s+(this._M?this._M:0)-1,this.q.minHeight||0)+this.So+this.oM}this.q.autowidth&&this.q.columns&&(this.q.width=Math.max(this.CM+this.sw+this.Ew+this.gx,this.q.minWidth||0));var e=this.sw+this.Ew+this.gx,n=Gi.api.$getSize.call(this,t,i);return n[0]=Math.max(n[0]||e),n},Gv:function(){if(this.rh&&!S.touch){var t=this.getScrollState();this.rh.vS=this.nh.vS=-1,this.scrollTo(t.x,t.y)}},$setSize:function(){var t=this.ze,i=this.He;Gi.api.$setSize.apply(this,arguments)&&(this.ho&&(this.callEvent("onResize",[this.ze,this.He,t,i]),this.AM(),this.yM()),this.render())},_S:function(t){var i=this.getColumnConfig(t);if(i.sort){var s="asc";i.id==this.so&&(s="asc"==this.eo?"desc":"asc"),this.co(i.id,s,i.sort)}},markSorting:function(t,i){this.pS||(this.pS=Y("DIV"));var s=this.pS.parentNode;if(s&&(s.removeAttribute("aria-sort"),s.removeAttribute("tabindex")),G(this.pS),i){var e=this.mS(this.getColumnIndex(t));e&&(this.pS.className="webix_ss_sort_"+i,e.style.position="relative",e.appendChild(this.pS),e.setAttribute("aria-sort",i+"ending"),e.setAttribute("tabindex","0")),this.so=t,this.eo=i}else this.so=this.eo=null},scroll_setter:function(t){return"string"==typeof t?(this.q.scrollX=-1!=t.indexOf("x"),this.q.scrollY=-1!=t.indexOf("y"),t):this.q.scrollX=this.q.scrollY=t},mS:function(t){for(var i=this.U.getElementsByTagName("TD"),s=null,e=0;e<i.length;e++)if(i[e].getAttribute("column")==t&&!i[e].getAttribute("active_id")&&(s=i[e].firstChild,(i[e].colSpan||0)<2))return s;return s},co:function(i,t,s){t=t||"asc",this.markSorting(i,t),"server"==s?(this.callEvent("onBeforeSort",[i,t,s]),this.loadNext(0,0,{before:function(){this.clearAll(!0)},success:function(){this.callEvent("onAfterSort",[i,t,s])}},0,1)):("text"==s&&(this.data.each(function(t){t.$text=this.getText(t.id,i)},this),s="string",i="$text"),"function"==typeof s?this.data.sort(s,t):this.data.sort(i,t,s||"string"))},bS:function(t,i,s,e){var n;if(t.length)for(n=0;n<t.length;n++)if(!1===m(t[n],this.$scope).call(this,i,s,e))return!1},vu:function(t,i,s,e){var n=(t=t||event).target||t.srcElement;if(!this.q.subview||this==jt(n)){for(var h="",r=[],o=!1,a=null;n&&n.parentNode&&n!=this.nt.parentNode;){if(h=rt(n))for(var u=(h=h.toString().split(" ")).length-1;0<=u;u--)i[h[u]]&&r.push(i[h[u]]);if(n.parentNode.getAttribute&&!a){var c=n.parentNode.getAttribute("column")||n.getAttribute("column");if(c){var f="DIV"==n.parentNode.tagName;if(!this.If[c])return;if(o=!0,f){var l=n.parentNode.getAttribute("row")||n.getAttribute("row");if(!l){if(n.getAttribute("column"))return;(l=E(n))>=this.q.topSplit&&(l+=this.If[c].ty-this.q.topSplit)}this.ru=a={row:this.data.order[l],column:this.If[c].id},a.toString=this.Sw}else this.ru=a={column:this.If[c].id};if(!1===this.bS(r,t,a,n))return;if(f)this.callEvent("on"+s,[a,t,n])&&e&&this.callEvent("on"+e,[a,t,n]);else if("ItemClick"==s){"header"==n.parentNode.parentNode.getAttribute("section")&&this.callEvent("onHeaderClick",[a,t,n])&&this._S(a.column)}r=[]}}n=n.parentNode}return this.bS(r,t,a,this.$view),o}},showOverlay:function(t){if(!this.gS){var i=Y("DIV",{"class":"webix_overlay"},"");this.Yt.appendChild(i),this.gS=i}this.gS.innerHTML=t},hideOverlay:function(){this.gS&&(G(this.gS),this.gS=null)},mapCells:function(t,i,s,e,n,h){if(null===t&&0<this.data.order.length&&(t=this.data.order[0]),null===i&&(i=this.columnId(0)),null===s&&(s=this.data.order.length),null===e&&(e=this.q.columns.length),this.exists(t)&&(t=this.getIndexById(t),null!==(i=this.getColumnIndex(i))))for(var r=0;r<s&&t+r<this.data.order.length;r++){var o=t+r,a=this.data.order[o];if(a)for(var u=this.getItem(a),c=0;c<e&&i+c<this.q.columns.length;c++){var f=i+c,l=this.columnId(f),d=n(u[l],a,l,r,c);h||(u[l]=d)}}},nM:function(t,i){!this.q.columns&&t.getConfig&&this.define("columns",t.getConfig(i))},mM:function(){var t=this.getItem(this.getFirstId()),i=this.q.columns=[];for(var s in t)"id"!=s&&"$"!=s[0]&&i.push({id:s,header:s[0].toUpperCase()+s.substr(1),sort:"string",editor:"text"});i.length&&(i[0].fillspace=!0),"undefined"==typeof this.q.select&&this.define("select","row")
}},Hr={api:Vr,view:H.protoUI(Vr,mr,Ds,pe,gs,Vs,Ls,Gs,ps,Ir,De,{clearValidation:function(){for(var t in this.data.fr)this.wS(t);this.data.clearMark("webix_invalid",!0)},Uh:function(t,i){for(var s in this.wS(t),i)this.addCellCss(t,s,"webix_invalid_cell");this.addCss(t,"webix_invalid")},Eh:function(t){this.wS(t),this.removeCss(t,"webix_invalid")},wS:function(t){var i=this.data.getMark(t,"$cellCss");if(i)for(var s in i)i[s]=i[s].replace("webix_invalid_cell","").replace("  "," ")},addRowCss:function(t,i,s){this.addCss(t,i,s)},removeRowCss:function(t,i,s){this.removeCss(t,i,s)},addCellCss:function(t,i,s,e){var n=this.data.getMark(t,"$cellCss"),h=n||{},r=h[i]||"";h[i]=r.replace(s,"").replace("  "," ")+" "+s,n||this.data.addMark(t,"$cellCss",!1,h,!0),e||this.refresh(t)},removeCellCss:function(t,i,s,e){var n=this.data.getMark(t,"$cellCss");if(n){var h=n[i]||"";h&&(n[i]=h.replace(s,"").replace("  "," ")),e||this.refresh(t)}}},Fr,$s,Ar,$r,Dr,Cr,Sr,kr,Mr,yr,xr,Tr,wr,gr,br,{topSplit_setter:function(t){return this.data&&(this.data.$freeze=t),t},freezeRow:function(t,i){var r=this.q.topSplit,s=this.data.order,e=this.data.lr;function n(t,i,s,e,n){var h;if(s&&r<=t){for(n||r++,h=t;r<=h;h--)e[h]=e[h-1];e[r-1]=i}if(!s&&t<r){for(n||r--,h=t;h<r;h++)e[h]=e[h+1];e[r]=i}}t?(n(this.getIndexById(t),t=t.toString(),i,s),e&&n(e.find(t),t,i,e,!0)):i||(r=0),this.define("topSplit",r),this.refresh()}},zr,Ki,Ps,bs,Cs,Us,Os,Gi.view,g,Hi)},Br={name:"excelviewer",$init:function(){this.$ready.push(function(){this.q.toolbar&&jt(this.q.toolbar).attachEvent("onExcelSheetSelect",C(this.showSheet,this))})},defaults:{datatype:"excel"},$onLoad:function(t){if(t.sheets){this.xS=t,this.q.toolbar&&jt(this.q.toolbar).setSheets(t.names);var i=t.names[0];return this.showSheet(i.id||i),!0}return!1},$exportView:function(t){if("excel"!==t.export_mode||t.dataOnly)return this;!0===t.sheets?t.sheets=this.getSheets():t.sheets&&t.sheets.length?"string"==typeof t.sheets&&(t.sheets=[t.sheets]):t.sheets=[this.yS],t.dataOnly=!0,t.heights=D(t.heights)&&t.styles?"all":t.heights;for(var i=[],s=this.yS,e=0;e<t.sheets.length;e++)this.showSheet(t.sheets[e]),i=i.concat(Te(this,t)),t.styles&&(i[e].styles=this.Ty(t));return this.showSheet(s),delete t.dataOnly,i},showSheet:function(t){this.clearAll();var i=this.data.driver.sheetToArray(this.xS.sheets[t],{spans:this.q.spans}),s=this.q.excelHeader,e={},n={};if(i.sizes)for(var h=0;h<i.sizes.length;h++)"column"==i.sizes[h][0]?e[i.sizes[h][1]]=Math.round(i.sizes[h][2]):"row"==i.sizes[h][0]&&(n[i.sizes[h][1]]=Math.round(i.sizes[h][2]));if(s)if(!0===s){s=i.data.splice(0,1)[0];for(var r=0;r<s.length;r++)s[r]={header:s[r],id:"data"+r,width:e[r],adjust:!e[r],editor:"text",sort:"string"}}else s=B(s);else{s=B(i.data[0]);for(var o=0;o<s.length;o++)s[o]={header:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[o],id:"data"+o,width:e[o],adjust:!e[o],editor:"text",sort:"string"}}this.config.columns=s,this.refreshColumns(),this.parse(i,this.q.datatype),this.yS=t;var a=this.MS(i.spans),u=this.SS(n),c=this.kS(i.styles,a);(a||u||c)&&this.refresh()},getSheets:function(){return this.xS.names},CS:function(t,i,s,e){for(var n=!1,h=0;h<t.length;h++)if(t[h][0]===i&&t[h][1]===s){t[h][5]=L(this.DS(e)),this.addSpan(t[h][0],t[h][1],t[h][2],t[h][3],t[h][4],t[h][5]),n=!0;break}return n},kS:function(t,i){var s=0;if(t&&t.length){for(var e=0;e<t.length;e++){var n=t[e][0]-(this.config.excelHeader?1:0);if(0<=n){var h=this.getIdByIndex(n);if(this.exists(h)){var r=this.getItem(h),o=this.columnId(t[e][1]);o&&(i.length&&this.CS(i,h,o,t[e][2])||(r.$cellCss=r.$cellCss||{},r.$cellCss[o]=this.DS(t[e][2])),s++)}}}return s}return!1},$S:function(t){return 8===(t=t||"000000").length&&(t=t.substring(2)),"#"+t},DS:function(t){var i={};if(t.fill&&t.fill.fgColor&&(i["background-color"]=this.$S(t.fill.fgColor.rgb)),t.font){var s=t.font;s.name&&(i["font-family"]=s.name),s.sz&&(i["font-size"]=s.sz/.75+"px"),s.color&&s.color.rgb&&(i.color=this.$S(s.color.rgb)),s.bold&&(i["font-weight"]="bold"),s.underline&&(i["text-decoration"]="underline"),s.italic&&(i["font-style"]="italic"),s.strike&&(i["text-decoration"]="line-through"
)}if(t.alignment){var e=t.alignment;e.vertical&&"center"==e.vertical&&(i.display="flex",i["justify-content"]="flex-start",i["align-items"]="center"),e.vertical&&"bottom"==e.vertical&&(i.display="flex",i["justify-content"]="flex-end",i["align-items"]="flex-end"),e.horizontal&&(!e.vertical||"center"!=e.vertical&&"bottom"!=e.vertical?i["text-align"]=e.horizontal:i["justify-content"]="center"),e.wrapText&&(i["white-space"]="normal")}if(t.border){var n=t.border;n.top&&(i["border-top"]="1px solid "+this.$S(n.top.color.rgb)),n.bottom&&(i["border-bottom"]="1px solid "+this.$S(n.bottom.color.rgb)+" !important"),n.left&&(i["border-left"]="1px solid "+this.$S(n.left.color.rgb)),n.right&&(i["border-right"]="1px solid "+this.$S(n.right.color.rgb)+" !important")}return i},SS:function(t){var i=0;for(var s in t){var e=this.config.excelHeader?s-1:s;if(0<=e){var n=this.getIdByIndex(e);this.exists(n)&&(this.getItem(n).$height=t[s],i++)}}return this.config.fixedRowHeight=!i,i},MS:function(t){var i=[];if(this.q.spans&&t&&t.length){this.zf={};for(var s=0;s<t.length;s++)this.config.excelHeader&&t[s][0]--,0<=t[s][0]&&(t[s][0]=this.getIdByIndex(t[s][0]),t[s][1]="data"+t[s][1],i.push(t[s]));return this.addSpan(i),i}return!1}},Rr=(H.protoUI(Br,Hr.view),{name:"pdfbar",reset:function(){this.setPage(0),this.setValues(0,"auto")},$init:function(t){this.$view.className+=" pdf_bar",t.cols=[{view:"button",type:"icon",icon:"wxi-angle-left",width:35,click:function(){this.getParentView().og("prev")}},{view:"text",width:70,value:"0",on:{onBlur:function(){this.getParentView().og(this.getValue())},onKeyPress:function(t){13===t&&this.getParentView().og(this.getValue())}}},{template:ct.PDFviewer.of+" #limit#",width:70,data:{limit:0},borderless:!0},{view:"button",type:"icon",icon:"wxi-angle-right",width:35,click:function(){this.getParentView().og("next")}},{},{view:"button",type:"icon",icon:"wxi-minus",width:35,click:function(){this.getParentView().zoom("out")}},{view:"richselect",options:[],maxWidth:195,suggest:{padding:0,css:"pdf_opt_list",borderless:!0,body:{type:{height:25},scroll:!1,yCount:13}},on:{onChange:function(){this.getParentView().setMasterScale(this.getValue())}}},{view:"button",type:"icon",icon:"wxi-plus",width:35,click:function(){this.getParentView().zoom("in")}},{view:"button",type:"icon",icon:"wxi-download",width:35,click:function(){this.getParentView().download()}}],this.$ready.push(this.AS)},AS:function(){var t=this.getChildViews()[6].getPopup().getBody();t.clearAll(),t.parse([{id:"auto",value:ct.PDFviewer.automaticZoom},{id:"page-actual",value:ct.PDFviewer.actualSize},{id:"page-fit",value:ct.PDFviewer.pageFit},{id:"page-width",value:ct.PDFviewer.pageWidth},{id:"page-height",value:ct.PDFviewer.pageHeight},{id:"0.5",value:"50%"},{id:"0.75",value:"75%"},{id:"1",value:"100%"},{id:"1.25",value:"125%"},{id:"1.5",value:"150%"},{id:"2",value:"200%"},{id:"3",value:"300%"},{id:"4",value:"400%"}]);var i=0;t.data.each(function(t){i=Math.max(nt(t.value,"webixbutton").width,i)}),this.getChildViews()[6].define("width",i+20),this.getChildViews()[6].resize()},og:function(t){this.setMasterPage(t),this.setPage(this.$master.$pageNum)},setScale:function(t){var i=this.getChildViews()[6];i.blockEvent(),i.getPopup().getList().exists(t)?i.setValue(t):(i.setValue(""),i.getInputNode().innerHTML=(100*t).toFixed(0)+"%"),i.unblockEvent()},setMasterScale:function(t){this.$master&&this.$master.setScale(t)},setMasterPage:function(t){this.$master&&("prev"===t?this.$master.prevPage():"next"===t?this.$master.nextPage():isNaN(parseInt(t))||this.$master.renderPage(parseInt(t)))},zoom:function(t){this.$master&&("out"===t?this.$master.zoomOut():"in"===t&&this.$master.zoomIn())},setPage:function(t){this.getChildViews()[1].setValue(t)},setValues:function(t,i){this.getChildViews()[2].data.limit=t,this.getChildViews()[2].refresh(),this.setScale(i)},download:function(){this.$master&&this.$master.download()}}),Pr=(H.protoUI(Rr,rh.view),{name:"pdfviewer",defaults:{scale:"auto"},$init:function(t){this.$view.className+=" webix_pdf";var i=document.createElement("DIV")
;i.className="canvas_wrapper";var s=document.createElement("canvas");this.IS=this.$view,this.it=this.$view.appendChild(i),this.Ke=this.it.appendChild(s),this.$pdfDoc=null,this.$pageNum=0,this.$numPages=0,this.FS=!1,this.TS=null,this.zS=this.Ke.getContext("2d"),this.VS=.1,this.HS=t.scaleDelta||1.1,this.BS=t.minScale||.25,this.RS=t.maxScale||10,this.PS=1.25,this.jS=40,this.NS=10,this.$ready.push(this.ES)},toolbar_setter:function(t){if("string"==typeof t){var i=jt(t);return i&&(i.$master=this,i.refresh()),this.attachEvent("onDocumentReady",function(){i?(i.setPage(this.$pageNum),i.setValues(this.$numPages,this.q.scale)):this.toolbar_setter(t)}),t}},ES:function(){if(delete this.q.datatype,this.attachEvent("onScaleChange",function(t,i){i&&this.q.toolbar&&jt(this.q.toolbar).setScale&&jt(this.q.toolbar).setScale(t)}),S.touch)this.LS=!1,Lt(this.nt,"touchstart",C(function(t){var i=t.targetTouches;2===i.length&&(Q(t),this.LS=Math.abs(i[0].pageY-i[1].pageY))},this)),Lt(this.$view,"touchmove",C(function(t){var i=t.targetTouches;2===i.length&&!1!==this.LS&&(Q(t),Math.abs(i[0].pageY-i[1].pageY)>this.LS?this.zoomIn():this.zoomOut(),this.LS=!1)},this)),this.attachEvent("onSwipeX",function(t,i){this.$view.scrollLeft=this.$view.scrollLeft-(i.x-t.x)}),this.attachEvent("onSwipeY",function(t,i){var s=this.$view.clientHeight,e=this.$view.scrollHeight,n=this.$view.offsetHeight,h=this.$view.scrollTop,r=i.y-t.y;if(s===e||r<0&&e-n<h||0<r&&0===h){var o=this.$pageNum+(0<r?-1:1);0<o&&o<=this.$numPages&&(this.$pageNum=o,this.OS(this.$pageNum),this.$view.scrollTop=0<r?e:0)}else this.$view.scrollTop=h-r});else{var t=S.isFF?"DOMMouseScroll":"mousewheel";Ot(window,t,function(t){var i=("DOMMouseScroll"===t.type?-t.detail:t.wheelDelta)<0?"out":"in";t.ctrlKey&&(Q(t),"in"==i?this.zoomIn():this.zoomOut())},{bind:this,passive:!1})}},US:function(t){if(t.name){var i=new FileReader;i.onload=C(function(t){this.US({data:t.target.result})},this),i.readAsArrayBuffer(t)}else PDFJS.getDocument({data:t.data}).then(C(function(t){this.clear(),this.$pdfDoc=t,this.$numPages=this.$pdfDoc.numPages,this.$pageNum=1,this.YS(this.$pageNum).then(C(function(){this.callEvent("onDocumentReady")},this))},this))},$onLoad:function(t){return window.PDFJS?this.US(t):hi([S.cdn+"/extras/pdfjs/compatibility.min.js",S.cdn+"/extras/pdfjs/pdf.min.js"],function(){PDFJS.workerSrc=S.cdn+"/extras/pdfjs/pdf.worker.min.js",this.US(t)},this),!0},WS:function(t,i){var s=t.getViewport(i);return this.Ke.height=s.height,this.Ke.width=s.width,this.it.style.width=s.width+"px",this.it.style.height=s.height+"px",s},YS:function(t){var n=this;return n.FS=!0,this.$pdfDoc.getPage(t).then(function(t){var i=isNaN(parseFloat(n.q.scale))?n.VS:n.q.scale,s=n.WS(t,i);i!==n.q.scale&&(i=n.GS(n.q.scale),s=n.WS(t,i),n.q.scale=i);var e={canvasContext:n.zS,viewport:s};return t.cleanupAfterRender=!0,t.render(e).promise.then(function(){n.callEvent("onPageRender",[n.$pageNum]),n.FS=!1,null!==n.TS&&(n.YS(n.TS),n.TS=null)})})},OS:function(t){this.FS?this.TS=t:this.YS(t)},renderPage:function(t){!this.$pdfDoc||t<0||t>this.$numPages||(this.$pageNum=t,this.OS(this.$pageNum))},prevPage:function(){this.$pageNum<=1||(this.$pageNum--,this.OS(this.$pageNum))},nextPage:function(){this.$pageNum>=this.$numPages||(this.$pageNum++,this.OS(this.$pageNum))},zoomIn:function(){var t=this.q.scale;t=(t*this.HS).toFixed(2),t=Math.ceil(10*t)/10,t=Math.min(this.RS,t),this.setScale(t,!0)},zoomOut:function(){var t=this.q.scale;t=(t/this.HS).toFixed(2),t=Math.floor(10*t)/10,t=Math.max(this.BS,t),this.setScale(t,!0)},GS:function(t){if(!isNaN(parseFloat(t)))return t;isNaN(parseFloat(this.q.scale))&&(this.q.scale=this.VS);var i=1,s=((this.IS.clientWidth-this.jS)*this.q.scale/this.Ke.clientWidth).toFixed(2),e=((this.IS.clientHeight-this.NS)*this.q.scale/this.Ke.clientHeight).toFixed(2);switch(t){case"page-actual":i=1;break;case"page-width":i=s;break;case"page-height":i=e;break;case"page-fit":i=Math.min(s,e);break;case"auto":var n=this.IS.clientWidth>this.IS.clientHeight?Math.min(e,s):s;i=Math.min(this.PS,n)}return i},setScale:function(t,i){if(isNaN(parseFloat(t)
)){var s=this.GS(t);this.XS(s,i)}else this.XS(t,i)},XS:function(t,i){this.q.scale=t,this.renderPage(this.$pageNum),this.callEvent("onScaleChange",[t,i])},download:function(){if(this.$pdfDoc){var i=(this.q.downloadName||"document")+".pdf";this.$pdfDoc.getData().then(function(t){ht(PDFJS.createBlob(t,"application/pdf"),i)})}},clear:function(){this.$pdfDoc&&(this.zS.clearRect(0,0,this.Ke.width,this.Ke.height),this.it.style.height=this.it.style.width=this.Ke.width=this.Ke.height=0,this.q.scale="auto",this.$pageNum=this.$numPages=0,this.$pdfDoc.transport.startCleanup(),this.$pdfDoc.destroy(),this.$pdfDoc=null,this.q.toolbar&&jt(this.q.toolbar)&&jt(this.q.toolbar).reset())}}),jr=(H.protoUI(Pr,g,vi,Gi.view),{name:"video",$init:function(t){t.id||(t.id=z()),this.$ready.push(this.JS)},JS:function(){var t=this.q;if(this.re=Y("video",{"class":"webix_view_video",style:"width:100%;height:100%;",autobuffer:"autobuffer"},""),t.poster&&(this.re.poster=t.poster),t.src){"object"!=k(t.src)&&(t.src=[t.src]);for(var i=0;i<t.src.length;i++)this.re.innerHTML+=' <source src="'+t.src[i]+'">'}t.controls&&(this.re.controls=!0),t.autoplay&&(this.re.autoplay=!0),this.nt.appendChild(this.re)},getVideo:function(){return this.re},defaults:{src:"",controls:!0}}),Nr=(H.protoUI(jr,Gi.view),{name:"gage",defaults:{value:0,minRange:0,maxRange:100,minWidth:250,minHeight:200,smoothFlow:!0,scale:3,stroke:7},$init:function(){this.$ready.push(C(this.KS,this)),this.attachEvent("onDestruct",function(){this.qS=this.ZS=this.QS=null})},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&this.tk()},tk:function(){this.ik=this.config.value;var t=this.$view.querySelector(".webix_gage_curves"),i=this.$view.querySelector(".webix_gage_info"),s=this.config.scale,e=this.$width;t.setAttribute("r",e/s),t.setAttribute("strokeDasharray",Math.round(Math.PI*e/s)),t.style.r=e/s,t.style.strokeDasharray=Math.round(Math.PI*e/s),i.setAttribute("style","width: "+Math.round(e/s*2)+"px;"),this.QS.setAttribute("style","height: "+(e/s+20)+"px;"),this.qS.setAttribute("r",e/s),this.qS.setAttribute("style","stroke-dasharray: "+Math.round(this.gradientLength*Math.PI*e/s)+", 1900;"),this.sk(t.style.r),this.ek()},nk:function(t){return Math.min(Math.max(t,this.q.minRange),this.q.maxRange)},sk:function(t){var i=this.$width,s=this.config.value,e=(s=this.nk(s))-this.config.minRange,n=Math.round(180*e/(this.config.maxRange-this.config.minRange));0!==n&&180!==n||(this.QS.style.paddingTop="3px"),this.ZS.style.transformOrigin=i/2-.55+"px 0 0",this.ZS.setAttribute("y1","0"),this.ZS.setAttribute("x1",Math.round(.55*i)),this.ZS.setAttribute("y2",0),this.ZS.setAttribute("x2",Math.round(.525*i+parseInt(t)))},ek:function(){var t=this.config.value,i=this.$view.querySelector(".webix_gage-value"),s=this.nk(t)-this.config.minRange,e=Math.round(180*s/(this.config.maxRange-this.config.minRange)),n=this.$width;n=Math.floor(n/10),this.$view.style.fontSize=n+"px",i.innerHTML=t,this.qS.style.stroke=this.color,this.qS.setAttribute("stroke",this.color),this.ZS.setAttribute("transform","rotate("+e+" "+this.$width/2+" 0)"),this.ZS.style.transform="rotate("+e+"deg)"},hk:function(){this.config.minRange,this.config.maxRange,this.gradientLength=(this.nk(this.config.value)-this.config.minRange)/(this.config.maxRange-this.config.minRange);var t=this.config.color;this.color=t?"function"==typeof t?t.call(this,this.config.value):t:"hsl("+(120-Math.round(120*this.gradientLength))+", 100%, 50%)",!0===this.config.animation?this.defaultColor="hsl(125, 100%, 50%)":this.defaultColor="hsl("+(120-Math.round(120*this.gradientLength))+", 100%, 50%)"},KS:function(){this.gradientLength=0,this.hk(),this.$view.innerHTML='<div class="webix_gage_label"><span>'+(this.config.label||""
)+'</span></div><svg class="webix_gage" style="height:300px; position: relative;"><circle class="webix_gage_curves" r="0" cx="50%" cy="0" stroke="#EEEEEE" stroke-width="'+this.config.stroke+'%" fill="none"></circle><circle class="webix_gage_gradient" r="0" stroke="'+this.defaultColor+'" cx="50%" cy="0" stroke-width="'+this.config.stroke+'%" fill="none" style="stroke-dasharray: 0, 1900;"></circle><line class="webix_gage_gradient_point" x1="0" x2="0" y1="0" y2="0" style="stroke:#B0B0B0; stroke-width:4;"></line></svg><div class="webix_gage_info"><div class="webix_gage_min_range">'+this.config.minRange+'</div><div class="webix_gage_max_range">'+this.config.maxRange+'</div><div class="webix_gage_placeholder"><div class="webix_gage-value">'+this.config.value+'</div><div class="webix_gage_range_info">'+(this.config.placeholder||"")+"</div></div></div>",this.qS=this.$view.querySelector(".webix_gage_gradient"),this.ZS=this.$view.querySelector(".webix_gage_gradient_point"),this.QS=this.$view.querySelector(".webix_gage"),!0===this.isVisible()&&!0===this.config.smoothFlow&&S.svganimation&&!S.isEdge&&(this.qS.setAttribute("class","webix_gage_gradient webix_gage_animated"),this.ZS.setAttribute("class","webix_gage_gradient_point webix_gage_gradient_point_animated"))},refresh:function(){var t=this.config.value;this.config.smoothFlow&&t!=this.ik&&(this.config.value=this.ik),this.KS(),this.tk(),this.ik!=t&&this.nt.parentNode.clientHeight&&this.setValue(t)},setValue:function(t){this.config.value=t,this.hk(),this.tk()},getValue:function(){return this.config.value}}),Er=(H.protoUI(Nr,g,Gi.view),{name:"barcode",defaults:{type:"ean13",height:160,width:220,paddingY:10,paddingX:20,textHeight:20,color:"#000",ariaLabel:"bars"},$init:function(){this.$view.className+=" webix_barcode",this.types||(this.types={"default":this.type},this.type.name="default")},type:{},render:function(){this.isVisible(this.q.id)&&(this.canvas&&this.canvas.clearCanvas(!0),this.$view.innerHTML="",this.rk())},rk:function(){this.canvas=new qi({container:this.$view,name:this.name,title:this.q.ariaLabel,width:this.$width,height:this.$height}),this.ak()},ak:function(){var t,i,s,e,n=this.q.value,h=this.q.type;if(!h||!this.types[h]||!n)return!1;if(e=(t=this.type.encode(n)).length,i=this.canvas.getCanvas(),e){var r=(this.$width-2*this.config.paddingX)/e,o=0;for(s=0;s<e;s++){parseInt(t.charAt(s),10)?(o++,s==e-1&&this.uk(i,s+1,r,o,e)):o&&(this.uk(i,s,r,o,e),o=0)}this.ck(n,r)}},uk:function(t,i,s,e,n){var h,r,o,a;r=parseInt(i*s+this.config.paddingX,10),h=parseInt(r-e*s,10),o=this.config.paddingY,a=this.$height-this.config.paddingY-this.config.textHeight,this.fk()&&(i<4||n-4<i||i<n/2+2&&n/2-2<i)&&(a+=this.config.textHeight/2),t.fillStyle=this.config.color,t.beginPath(),t.moveTo(h,o),t.lineTo(r,o),t.lineTo(r,a),t.lineTo(h,a),t.lineTo(h,o),t.fill()},ck:function(t,i){var s,e,n;if(this.type.template&&(t=this.type.template(t)),this.fk()){if(this.type.firstDigit&&(this.canvas.renderTextAt(!0,"left",this.config.paddingX,this.$height-this.config.paddingY,t.charAt(0)),t=t.slice(1)),e=t.length,this.type.lastDigit&&e--,e){var h=(this.$width-2*this.config.paddingX-11*i)/e;for(s=0;s<e;s++)n=this.config.paddingX+s*h+(s<e/2?3:8)*i+h/2,this.canvas.renderTextAt(!0,!0,n,this.$height-this.config.paddingY,t.charAt(s));this.type.lastDigit&&(n=this.config.paddingX+e*h+11*i,this.canvas.renderTextAt(!0,!1,n,this.$height-this.config.paddingY,t.charAt(e)))}}else this.canvas.renderTextAt(!0,!0,this.$width/2,this.$height-this.config.paddingY,t)},setValue:function(t){return this.q.value=t,this.render(),t},getValue:function(){var t=this.q.value;return this.type.template?this.type.template(t):t},type_setter:function(t){return this.types[t]?(this.type=f(this.types[t]),this.type.css&&(this.re.className+=" "+this.type.css)):this.customize(t),t},fk:function(){var t=this.config.type;return 0===t.indexOf("ean")||-1!=t.indexOf("upcA")},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&this.render()}}),Lr=H.protoUI(Er,Gi.view);Tt(Lr,{name:"upcA",firstDigit:!0,lastDigit:!0,encode:function(t){return t.length<12&&(t="0"+t)
,Or.encode(t)},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,11)+this.checksum(t)},checksum:function(t){return t.length<12&&(t="0"+t),Or.checksum(t)}}),Tt(Lr,{name:"ean8",encodings:[["0001101","1110010"],["0011001","1100110"],["0010011","1101100"],["0111101","1000010"],["0100011","1011100"],["0110001","1001110"],["0101111","1010000"],["0111011","1000100"],["0110111","1001000"],["0001011","1110100"]],encode:function(t){var i,s;if(7!=(t=t.replace(/[^0-9]/g,"").substring(0,7)).length)return"";for(t+=this.checksum(t),i="101",s=0;s<4;s++)i+=this.encodings[parseInt(t.charAt(s),10)][0];for(i+="01010",s=4;s<8;s++)i+=this.encodings[parseInt(t.charAt(s),10)][1];return i+="101"},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,7)+this.checksum(t)},checksum:function(t){t=t.substring(0,7);var i,s=!0,e=0;for(i=0;i<7;i++)e+=(s?3:1)*parseInt(t.charAt(i),10),s=!s;return((10-e%10)%10).toString()}});var Or={name:"ean13",firstDigit:!0,encodings:[["0001101","0100111","1110010","000000"],["0011001","0110011","1100110","001011"],["0010011","0011011","1101100","001101"],["0111101","0100001","1000010","001110"],["0100011","0011101","1011100","010011"],["0110001","0111001","1001110","011001"],["0101111","0000101","1010000","011100"],["0111011","0010001","1000100","010101"],["0110111","0001001","1001000","010110"],["0001011","0010111","1110100","011010"]],encode:function(t){var i,s,e;if(12!=(t=t.replace(/[^0-9]/g,"").substring(0,12)).length)return"";for(t+=this.checksum(t),i="101",s=this.encodings[parseInt(t.charAt(0),10)][3],e=1;e<7;e++)i+=this.encodings[parseInt(t.charAt(e),10)][parseInt(s.charAt(e-1),10)];for(i+="01010",e=7;e<13;e++)i+=this.encodings[parseInt(t.charAt(e),10)][2];return i+="101"},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,12)+this.checksum(t)},checksum:function(t){var i,s=!1,e=0;for(t=t.substring(0,12),i=0;i<12;i++)e+=(s?3:1)*parseInt(t.charAt(i),10),s=!s;return((10-e%10)%10).toString()}};Tt(Lr,Or);var Ur,Yr,Wr,Gr,Xr={name:"bullet",defaults:{color:"#394646",marker:!1,layout:"x",barWidth:40,flowTime:500,labelWidth:150,minRange:0,maxRange:100,stroke:8,value:0,smoothFlow:!0,tickSize:10,bands:[{value:100,color:"#5be5d6"},{value:80,color:"#fff07e"},{value:60,color:"#fd8b8c"}],scale:{step:10}},label_setter:Ft,placeholder_setter:Ft,$init:function(t){var i="undefined"!=typeof t.tickSize?t.tickSize:this.defaults.tickSize;t&&(t.layout&&"x"!==t.layout||t.height||(t.height=!1===t.scale?60:i?76+i:74),"y"!==t.layout||t.width||(t.width=!1===t.scale?60:i?87+i:87))},scale_setter:function(t){return t&&(t.step=t.step||10,t.template=Ft(t.template||"#value#")),t},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&(this.KS("y"===this.q.layout?i:t),(this.q.value||0===this.q.value)&&this.ek(0,this.q.value))},nk:function(t){return Math.min(Math.max(t,this.q.minRange),this.q.maxRange)-this.q.minRange},lk:function(t){var i;this.dk=t-(this._i||t),this._i=t,(1e3<(i=this.q.flowTime>this.dk?this.q.flowTime/this.dk:this.q.flowTime)||i<5)&&(i=30);var s=(this.q.value-this.vk)/i;this._k+=s,Math.abs(this._k-this.q.value)<Math.abs(s)&&(this._k=this.q.value),this._k!=this.q.value?this.pk=requestAnimationFrame(this.lk.bind(this)):(cancelAnimationFrame(this.pk),this.pk=null),this.mk.setAttribute("width",Math.floor(this.nk(this._k)*this.bk)),this.mk.style.fill=this.dc()},ek:function(t,i){this.vk=this._k=t,this.q.value=this.ik=i,!0===this.isVisible()&&!0===this.q.smoothFlow&&window.requestAnimationFrame?this.pk||(this.pk=requestAnimationFrame(this.lk.bind(this))):(this.mk.setAttribute("width",Math.floor(this.nk(i)*this.bk)),this.mk.style.fill=this.dc())},dc:function(){var t=this.q.color;return"function"==typeof t?t(this.ik):t},gk:function(t,i,s){for(var e=0;e<i.length;e++)t.setAttribute(i[e],s[e])},wk:function(t,i,s){var e=document.createElementNS("http://www.w3.org/2000/svg",t);return i&&this.gk(e,i,s),e},xk:function(t){var i=this.wk(t[0],t[1],t[2]),s=t[3];if(s)for(var e=0;e<s.length;e++)i.appendChild(this.xk(s[e]));return i},yk:function(){var t="d"+z(),i=this.wk("svg",["class"],["webix_bullet_graph_svg"]),
s=this.wk("g"),e=this.wk("g"),n=this.wk("rect",["x","y","width","height","class","style"],[this.Mk,this.Sk,100,this.q.stroke,"webix_bullet_value","filter:url(#"+t+");fill:"+this.dc()]),h=this.wk("rect",["x","y","width","height","fill"],[0,5,3,this.q.barWidth-10,"rgba(0,0,0,0.5)"]),r=this.wk("g",["stroke","stroke-width","fill"],["#8b94ac","2","none"]),o=this.wk("text",["text-anchor","stroke","fill"],["end","none","#8b94ac"]),a="y"==this.q.layout?"50%":this.Mk-10,u="y"==this.q.layout?11:17,c=this.wk("tspan",["x","y","class"],[a,u,"webix_bullet_header"]),f=this.wk("tspan",["x","y","class"],[a,u+17,"webix_bullet_subheader"]),l=this.wk("text",["text-anchor","stroke","class","fill"],["middle","none","webix_bullet_scale","#8b94ac"]),d=this.xk(["filter",["id","x","y","width","height"],[t,"0","-150%","110%","400%"],[["feOffset",["in","dx","dy"],["SourceAlpha",0,0]],["feGaussianBlur",["stdDeviation"],["2"]],["feComponentTransfer",0,0,[["feFuncA",["type","slope"],["linear","0.5"]]]],["feMerge",0,0,[["feMergeNode"],["feMergeNode",["in"],["SourceGraphic"]]]]]]);i.appendChild(d);var v=document.createElement("div");s.appendChild(e),!1!==this.q.marker&&(h.setAttribute("x",this.Mk+this.nk(this.q.marker)*this.bk-2),s.appendChild(h)),s.appendChild(n),o.appendChild(c),o.appendChild(f),i.appendChild(o);var _="y"===this.q.layout,p=this.q.tickSize;if(this.q.scale){for(var m=this.Mk,b=this.q.minRange;b<=this.q.maxRange;b+=this.q.scale.step){var g=Math.max(b-this.q.minRange,0),w=Math.floor(g*this.bk-(g?.1:-1)),x=_?(this.$width-this.q.barWidth)/2+(p?2-p:4):w+m,y=_?this.kk+m-w+6:this.q.barWidth+(p?16+p:14),M=_?-4:this.q.barWidth+3+p,S=_?"end":"middle",k=this.wk("tspan",["x","y","text-anchor"],[x,y,S]),C=this.wk("line",["x1","y1","x2","y2","stroke-width"],[w+m,M,w+m,M-p,1]);v.innerHTML=this.q.scale.template({value:b}),k.appendChild(v.childNodes[0]),l.appendChild(k),r.appendChild(C)}s.appendChild(r),i.appendChild(l)}for(var D=0;D<this.q.bands.length;D++){var $=this.q.bands[D],A=this.wk("path"),I=this.nk($.value)*this.bk;A.setAttribute("d","M "+this.Mk+",0 l "+I+",0 l 0,"+this.q.barWidth+" l -"+I+",0 z"),A.setAttribute("fill",$.color),e.appendChild(A)}if(i.appendChild(s),"y"===this.q.layout){var F=this.q.scale?this.$width/2-10:0,T=this.$height+this.Mk-28;s.setAttribute("transform","translate("+F+", "+T+") rotate(270)"),o.setAttribute("text-anchor","middle"),o.childNodes[0].setAttribute("x","55%"),o.childNodes[1].setAttribute("x","55%"),l.setAttribute("text-anchor","right")}return i.setAttribute("viewBox","0 0 "+this.$width+" "+this.$height),i},KS:function(t){this.config.minRange,this.config.maxRange,t=t||("x"==this.q.layout?this.$width:this.$height);var i=this.$view;i.innerHTML="";var s=this.q,e=s.label&&s.label(s)||s.placeholder&&s.placeholder(s);this.Mk=e?s.labelHeight||s.labelWidth:7,this.Sk=Math.floor((this.q.barWidth-this.q.stroke)/2),this.kk=t-this.Mk-30,this.bk=this.kk/(this.q.maxRange-this.q.minRange);var n=this.yk();n.setAttribute("height",this.$height),n.setAttribute("width",this.$width),i.appendChild(n),this.mk=i.querySelector(".webix_bullet_value");var h=this.q.label;h&&(this.$view.querySelector(".webix_bullet_header").textContent=h(this.q));var r=this.q.placeholder;r&&(this.$view.querySelector(".webix_bullet_subheader").textContent=r(this.q))},refresh:function(){this.KS(),this.ek(this.ik,this.q.value)},setValue:function(t){this.q.value!=t&&this.ek(this.q.value,t)},getValue:function(){return this.q.value}},Jr=(H.protoUI(Xr,Gi.view),{name:"geochart",defaults:{chart:{displayMode:"auto",region:"world",resolution:"countries"}},$init:function(t){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.re=this.$view.firstChild,this.Ck=mt.defer(),t.chart=H.extend(t.chart||{},this.defaults.chart),this.data.provideApi(this,!0),this.$ready.push(this.render),this.data.attachEvent("onClearAll",C(this.Dk,this)),this.data.attachEvent("onStoreUpdated",C(this.$k,this))},getMap:function(t){return t?this.Ck:this.Ha},Ak:function(t){return C(function(){"function"==typeof t&&t(),Ur=Ur||window.google,this.Ik()},this)},
render:function(){"undefined"==typeof window.google||"undefined"==typeof window.google.charts?(Yr||((Yr=document.createElement("script")).type="text/javascript",Yr.src="//www.gstatic.com/charts/loader.js",document.getElementsByTagName("head")[0].appendChild(Yr)),Yr.onload=this.Ak(Yr.onload)):this.Ak()()},Ik:function(){Ur.visualization&&Ur.visualization.GeoChart?(this.Ha=new Ur.visualization.GeoChart(this.re),this.Fk(),this.Ck.resolve(this.Ha)):(Ur.charts.load("current",{packages:["geochart"],mapsApiKey:this.q.key}),Ur.charts.setOnLoadCallback(C(function(){this.Ik()},this)))},$onLoad:function(t){return!this.Ha&&(this.Ck.then(C(function(){this.parse(t,this.q.datatype)},this)),!0)},$k:function(){if(this.Ha){var n=this.If&&this.If.length?this.If:this.Tk(),h=[];if(this.data.each(function(t){for(var i=[],s=0;s<n.length;s++){var e=t[n[s].label];"number"==n[s].type?e*=1:"tooltip"==n[s].role&&(e=this.q.tooltip(t)),i.push(e)}h.push(i)},this),n.length){for(var t=new Ur.visualization.DataTable,i=0;i<n.length;i++)t.addColumn(n[i]);t.addRows(h);var s=new Ur.visualization.DataView(t);this.Ha.draw(s,this.q.chart)}else this.Ha.draw(Ur.visualization.arrayToDataTable([["",""]]),{})}else this.Ha||this.Ck.then(C(this.$k,this))},setDisplayMode:function(t){this.q.chart.displayMode=t,this.refresh()},setRegion:function(t){this.q.chart.region=t,this.refresh()},refresh:function(){this.Ha.clearChart(),this.$k()},tooltip_setter:function(t){var i=this.q.chart.tooltip;return this.q.chart.tooltip=H.extend(i||{},{isHtml:!0}),Ft(t)},$setSize:function(t,i){Gi.api.$setSize.apply(this,arguments)&&this.Ha&&(H.extend(this.q,{width:t,height:i}),this.refresh())},Dk:function(){this.If=null,this.$k()},zk:function(t,i){if(!t||D(t[i]))return"string";var s=k(t[i]);return"string"!=s||isNaN(1*t[i])||(s="number"),s},Tk:function(){var t=this.q.columns||[],i=this.data.pull[this.data.order[0]];if(!t.length&&i)for(var s in i)"id"!==s&&t.push(s);for(var e=0;e<t.length;e++)"object"!==k(t[e])&&(t[e]={type:this.zk(i,t[e]),label:t[e]});return this.q.tooltip&&t.push({type:"string",role:"tooltip",p:{html:!0}}),this.If=t},Fk:function(){Ur.visualization.events.addListener(this.Ha,"error",C(function(){this.callEvent("onMapError",arguments)},this)),Ur.visualization.events.addListener(this.Ha,"ready",C(function(){this.callEvent("onMapReady",arguments)},this)),Ur.visualization.events.addListener(this.Ha,"regionClick",C(function(){this.callEvent("onRegionClick",arguments)},this)),Ur.visualization.events.addListener(this.Ha,"select",C(function(){var t=this.Ha.getSelection()[0],i=t||this.Vk;if(i){var s=this.data.order[i.row];this.Vk=i,this.callEvent("onItemClick",[s,!!t])}},this))}}),Kr=(H.protoUI(Jr,Cs,g,Gi.view),{name:"google-map",$init:function(){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.re=this.$view.firstChild,this.Ck=mt.defer(),this.data.provideApi(this,!0),this.$ready.push(this.render)},getMap:function(t){return t?this.Ck:this.Ha},Ak:function(t){return C(function(){"function"==typeof t&&t(),Wr=Wr||window.google,this.Ik.call(this)},this)},render:function(){if("undefined"==typeof window.google||"undefined"==typeof window.google.maps){if(!Gr){(Gr=document.createElement("script")).type="text/javascript";var t=this.q,i=t.src||"//maps.google.com/maps/api/js";i+=-1===i.indexOf("?")?"?":"&",t.key&&(i+="&key="+t.key),t.libraries&&(i+="&libraries="+t.libraries),Gr.src=i,document.getElementsByTagName("head")[0].appendChild(Gr)}Gr.onload=this.Ak(Gr.onload)}else this.Ak()()},Ik:function(){var t=this.config;this.isVisible(t.id)&&(this.Ha=new Wr.maps.Map(this.re,{zoom:t.zoom,center:new Wr.maps.LatLng(t.center[0],t.center[1]),mapTypeId:Wr.maps.MapTypeId[t.mapType]}),this.Ck.resolve(this.Ha))},center_setter:function(t){return this.Ha&&this.Ha.setCenter(new Wr.maps.LatLng(t[0],t[1])),t},mapType_setter:function(t){return this.Ha&&this.Ha.setMapTypeId(Wr.maps.MapTypeId[t]),t},zoom_setter:function(t){return this.Ha&&this.Ha.setZoom(t),t},layerType_setter:function(t){return"heatmap"==t&&(this.config.libraries="visualization"),this.Hk[t]&&(H.extend(
this,this.Hk[t],!0),this.data.attachEvent("onStoreUpdated",C(function(){this.Ck.then(C(function(){this.drawData.call(this,arguments)},this))},this))),t},defaults:{zoom:5,center:[39.5,-98.5],mapType:"ROADMAP",layerType:"marker"},$setSize:function(){Gi.api.$setSize.apply(this,arguments),this.Ha&&Wr.maps.event.trigger(this.Ha,"resize")},$onLoad:function(t){return!this.Ha&&(this.Ck.then(C(function(){this.parse(t)},this)),!0)},Hk:{marker:{drawData:function(t,i,s){switch(s){case"add":case"update":i.$marker=this.Bk(i);break;case"delete":i.$marker.setMap(null);break;default:this.data.each(function(t){t.$marker=this.Bk(t)},this)}},clearAll:function(t){this.data.each(function(t){t.$marker.setMap(null)}),this.data.clearAll(t)},showItem:function(t){var i=this.getItem(t);this.Ha.setCenter(new Wr.maps.LatLng(i.lat,i.lng))},Bk:function(t){var i={};for(var s in t)i[s]=t[s];i.position=new Wr.maps.LatLng(t.lat,t.lng),i.map=t.hidden?null:this.Ha;var e=t.$marker;return e?t.$marker.setMap(i.map):(e=new Wr.maps.Marker(i),this.D(e)),this.callEvent("onItemRender",[t]),e},D:function(t){var i=this;t.addListener("click",function(){i.callEvent("onItemClick",[this.id,this])}),t.getDraggable()&&(t.addListener("dragend",function(){i.Rk(this,!0)}),t.addListener("drag",function(){i.Rk(this)}))},Rk:function(t,i){var s=this.getItem(t.id),e=t.getPosition(),n=i?"onAfterDrop":"onDrag";s.lat=e.lat(),s.lng=e.lng(),this.callEvent(n,[s.id,s])}},heatmap:{heatmapConfig_setter:function(t){return t=t||{}},drawData:function(){this.Pk&&(this.Pk.setMap(null),this.Pk=null);var i=[];if(this.data.each(function(t){i.push(this.jk(t))},this),i.length){var t=H.extend(this.config.heatmapConfig,{data:i,map:this.Ha},!0);this.Pk=new Wr.maps.visualization.HeatmapLayer(t),this.callEvent("onHeatMapRender",[this.Pk])}},getHeatmap:function(){return this.Pk},jk:function(t){var i={};for(var s in t)i[s]=t[s];return i.location=new Wr.maps.LatLng(t.lat,t.lng),i}}}}),qr=(H.protoUI(Kr,Cs,g,Gi.view),{name:"organogram",defaults:{scroll:"auto",ariaLabel:"lines"},$init:function(){this.nt.className+=" webix_organogram",this.es=document.createElement("DIV"),this.$ready.push(this.Nk),H.extend(this.data,Me,!0),this.data.provideApi(this,!0)},za:"webix_dg_id",on_click:{webix_organogram_item:function(t,i){this.q.select&&("multiselect"==this.q.select||this.q.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.q.multiselect,t.shiftKey):this.select(i),this.Nm=!1)}},on_context:{},on_dblclick:{},Nk:function(){this.bt.style.position="relative",this.data.attachEvent("onStoreUpdated",C(this.render,this))},zc:function(t){var i=this.data.fr[t.id];return this.callEvent("onItemRender",[t]),this.type.templateStart.call(this,t,this.type,i)+(t.$template?this.type["template"+t.$template].call(this,t,this.type,i):this.type.template.call(this,t,this.type,i))+this.type.templateEnd.call(this)},Lt:function(t){var i=this.zc(t);return this.data.branch[t.id]&&(i+=this.Ek(t.id)),i},Lk:function(){return this.type.listMarginX||this.type.listMarginY},Ek:function(t,i){var s,e,n,h,r="",o=this.data.branch[t],a=this.data.fr[t],u=this.getItem(t),c=!!u&&u.$type;if(i=i||0,"list"===c&&(i+=this.type.listMarginX),t||(this.Ok=[],this.$xy={},h=this.$width-2*this.type.padding,this.$xy[0]={totalWidth:h,start:this.type.padding,width:0,height:0,left:h/2,top:this.type.padding||0}),o){n=this.$xy[t],"list"!=c||this.Lk()||(r+=this.type.templateListStart.call(this,u,this.type,a));var f=0,l=0;for(s=0;s<o.length;s++){e=o[s],h=this.Uk[e];var d=this.getItem(e);d.open==undefined&&(d.open=!0),"list"==c&&this.data.addMark(e,"list_item","",1,!0);var v=this.Yk(e);if("list"==c){var _=0;this.Lk()?_=this.type.listMarginY:s||(_=this.type.marginY),this.$xy[e]={totalWidth:h,start:n.start,width:this.type.width,height:v,left:n.start+h/2-this.type.width/2+i,top:s?this.$xy[o[s-1]].top+this.$xy[o[s-1]].height+_+l:n.top+n.height+_},l=this.data.branch[e]?this.Wk(e):0}else this.$xy[e]={totalWidth:h,start:n.start+f,width:this.type.width,height:v,left:n.start+f+h/2-this.type.width/2,top:n.top+n.height+(t?this.type.marginY:0)};r+=this.zc(d),f+=h}for(
s=0;s<o.length;s++)e=o[s],this.data.branch[e]&&this.getItem(e).open?r+=this.Ek(e,i):u&&("list"!=u.$type?this.Ok.push(this.$xy[e].top+this.$xy[e].height):s==o.length-1&&this.Ok.push(this.$xy[e].top+this.$xy[e].height));var p=0;for(var m in this.$xy){var b=this.$xy[m];p=Math.max(b.left+b.width,p)}this.bt.style.width=p+this.type.padding+this.type.marginX/2+"px","list"!=c||this.Lk()||(r+=this.type.templateListEnd(u,this.type,a))}return r},Wk:function(t){for(var i=this.data.branch[t],s=0,e=0;e<i.length;e++)s+=this.Yk(i[e])+this.type.listMarginY,this.data.branch[i[e]]&&(s+=this.Wk(i[e]));return s+this.type.marginY},Yk:function(t){var i=this.getItem(t),s=this.type.height;return"function"==typeof s&&(s=s.call(i,this.type,this.data.fr[t])),this.Gk||(this.Gk=Y("div"),this.bt.appendChild(this.Gk)),this.Gk.className=this.type.classname(i,this.type,this.data.fr[t]),this.Gk.style.cssText="width:"+this.type.width+"px;height:"+s+("auto"==s?"":"px")+";",this.Gk.innerHTML=this.type.template.call(this,i,this.type,this.data.fr[t]),this.Gk.scrollHeight},Xk:function(){var n={},h=this.type.width,r=this.type.marginX;return this.data.each(function(t){n[t.id]=h+r;var i=this.getParentId(t.id);if(i&&"list"!=this.getItem(i).$type)for(;i;){for(var s=this.branch[i],e=n[i]=0;e<s.length;e++)n[i]+=n[s[e]]||0;i=this.getParentId(i)}}),this.Uk=n},getItemNode:function(t){if(this.ne)return this.ne[t];this.ne={};for(var i=this.bt.childNodes,s=0;s<i.length;s++){var e=i[s].getAttribute(this.za);if(e&&(this.ne[e]=i[s]),-1!=i[s].className.indexOf("webix_organogram_list")&&!this.Lk())for(var n=i[s].childNodes,h=0;h<n.length;h++)(e=n[h].getAttribute(this.za))&&(this.ne[e]=n[h])}return this.getItemNode(t)},Pu:function(t){return this.es.innerHTML=this.zc(t),this.es.firstChild},render:function(t,i,s){if(this.isVisible(this.q.id)&&!this.$blockRender){if("update"!=s)return this.callEvent("onBeforeRender",[this.data])&&(this.Xk(),this.ne=null,this.bt.innerHTML=this.Ek(0),this.Gk=null,this.bt.style.height=Math.max.apply(Math,this.Ok)+this.type.padding+"px",this.rk(),this.resize(),this.callEvent("onAfterRender",[])),!0;var e=this.getItemNode(t);return X(this.ne[t]=this.Pu(i),e),G(e),!0}},rk:function(){this.canvas&&this.canvas.clearCanvas(!0),this.canvas=new qi({container:this.bt,name:this.name,title:this.q.ariaLabel,width:this.bt.offsetWidth,height:this.bt.offsetHeight}),this.Jk(0)},Kk:function(t,i,s,e,n,h,r){t.strokeStyle=h,t.lineCap="square",t.lineWidth=r,t.beginPath(),t.moveTo(i,s),t.lineTo(e,n),t.stroke(),t.lineWidth=1},Jk:function(t,i){var s,e,n,h,r,o,a,u,c,f;if(i||(i=this.canvas.getCanvas()),this.$xy&&(t=t||0,n=this.data.branch[t],e=this.getItem(t),n&&n.length)){if(h=this.$xy[t],t)if(o=parseInt(h.left+h.width/2,10)+.5,a=parseInt(h.top+h.height,10),u=parseInt(h.top+h.height+this.type.marginY/2,10),"list"==e.$type){if(!this.Lk())return u=parseInt(h.top+h.height+this.type.marginY,10),void this.Kk(i,o,a,o,u,this.type.lineColor)}else this.Kk(i,o,a,o,u,this.type.lineColor);for(a=parseInt(h.top+h.height+this.type.marginY/2,10)+.5,s=0;s<n.length;s++)t&&(r=this.$xy[n[s]],"list"==e.$type&&this.Lk()?(o=parseInt(h.left+this.type.listMarginX/2,10)+.5,s?s==n.length-1&&(f=o):c=o,u=parseInt(r.top+r.height/2,10),this.Kk(i,o,a-this.type.marginY/2,o,u,this.type.lineColor),this.Kk(i,o,u,o+this.type.listMarginX/2,u,this.type.lineColor)):(o=parseInt(r.left+r.width/2,10)+.5,s?s==n.length-1&&(f=o):c=o,u=parseInt(r.top,10),this.Kk(i,o,a,o,u,this.type.lineColor))),this.getItem(n[s]).open&&this.Jk(n[s],i);t&&this.Kk(i,c,a,f,a,this.type.lineColor)}},$getSize:function(t,i){var s=this.q.autowidth,e=this.q.autoheight;return s&&(t=this.bt.offsetWidth+(this.bt.offsetHeight>i&&!e?S.scrollSize:0)),e&&(i=this.bt.offsetHeight+(this.bt.offsetWidth>t&&!s?S.scrollSize:0)),Gi.api.$getSize.call(this,t,i)},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i)&&(this.bt.style.width=this.$width+"px",this.bt.style.height=this.$height+"px",this.render())},type:{width:120,height:"auto",padding:20,marginX:20,marginY:20,listMarginX:0,listMarginY:0,lineColor:Qi.organogramLineColor||"#90caf9",classname:function(t,i,s){
var e="webix_organogram_item ";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.list_item&&(e+=" webix_organogram_list_item "),s&&s.$css&&(e+=s.$css),e+=" webix_organogram_level_"+t.$level},listClassName:function(t){var i="webix_organogram_list webix_organogram_list_"+t.$level;return t.$listCss&&("object"==k(t.$listCss)&&(t.$listCss=L(t.$listCss)),i+=" "+t.$listCss),i},template:Ft("#value#"),templateStart:function(t,i,s){var e="";if((!s||!s.list_item||i.listMarginX||i.listMarginY)&&this.$xy){var n=this.$xy[t.id];e+="width: "+n.width+"px; height: "+n.height+"px;",e+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div webix_dg_id="'+t.id+'" class="'+i.classname.call(this,t,i,s)+'"'+(e?'style="'+e+'"':"")+'">'},templateEnd:Ft("</div>"),templateListStart:function(t,i,s){var e="";if(this.$xy){var n=this.$xy[t.id];e+="width: "+n.width+"px;",e+="top: "+(n.top+n.height+i.marginY)+"px; left: "+n.left+"px;"}return'<div class="'+i.listClassName.call(this,t,i,s)+'"'+(e?'style="'+e+'"':"")+'">'},templateListEnd:Ft("</div>")}}),Zr=(H.protoUI(qr,Ki,Ps,me,bs,qs,Us,Ks,Js,ge,Cs,Gi.view,g),{$render_pie:function(t,i,s,e,n,h){this.qk(t,i,s,e,1,h,n)},qk:function(t,i,s,e,n,h,r){if(i.length){var o=this.Zk(s,e),a=this.q.radius?this.q.radius:o.radius;if(!(a<0)){var u=this.Qk(i),c=this.pc(u),f=this._c(u,c),l=this.q.x?this.q.x:o.x,d=this.q.y?this.q.y:o.y;1==n&&this.q.shadow&&this.tC(t,l,d,a),d/=n;var v,_=-Math.PI/2,p=[];if(t.scale(1,n),this.q.gradient){var m=1!=n?l+a/3:l,b=1!=n?d+a/3:d;this.iC(t,l,d,a,m,b)}for(var g=0;g<i.length;g++)if(u[g]){t.strokeStyle=this.q.lineColor.call(this,i[g]),t.beginPath(),t.moveTo(l,d),p.push(_);var w=-Math.PI/2+f[g]-1e-4;t.arc(l,d,a,_,w,!1),t.lineTo(l,d);var x=this.q.color.call(this,i[g]);t.fillStyle=x,t.fill(),this.q.pieInnerText&&this.sC(l,d,5*a/6,_,w,n,this.q.pieInnerText(i[g],c),!0),this.q.label&&this.sC(l,d,a+this.q.labelOffset,_,w,n,this.q.label(i[g])),1!=n&&(this.eC(t,l,d,_,w,a,!0),t.fillStyle="#000000",t.globalAlpha=.2,this.eC(t,l,d,_,w,a,!1),t.globalAlpha=1,t.fillStyle=x),h.addSector(i[g].id,_,w,l-s.x,d-s.y/n,a,n,r),_=w}for(t.globalAlpha=.8,g=0;g<p.length;g++)v=this.nC(p[g],l,d,a),this.Kk(t,l,d,v.x,v.y,this.q.lineColor.call(this,i[g]),2);1==n&&(t.lineWidth=2,t.strokeStyle="#ffffff",t.beginPath(),t.arc(l,d,a+1,0,2*Math.PI,!1),t.stroke()),t.globalAlpha=1,t.scale(1,1/n)}}},Qk:function(t){for(var i=[],s=0;s<t.length;s++)i.push(Math.abs(parseFloat(this.q.value(t[s])||0)));return i},pc:function(t){for(var i=0,s=0;s<t.length;s++)i+=t[s];return i},_c:function(t,i){var s,e=[],n=0;i=i||this.pc(t);for(var h=0;h<t.length;h++)s=t[h],e[h]=2*Math.PI*(i?(s+n)/i:1/t.length),n+=s;return e},Zk:function(t,i){var s=i.x-t.x,e=i.y-t.y;return{x:t.x+s/2,y:t.y+e/2,radius:Math.min(s/2,e/2)}},eC:function(t,i,s,e,n,h,r){if(t.lineWidth=1,e<=0&&0<=n||0<=e&&n<=Math.PI||.003<Math.abs(e-Math.PI)&&e<=Math.PI&&n>=Math.PI){e<=0&&0<=n&&(e=0,r=!1,this.hC(t,i,s,h,e,n)),e<=Math.PI&&n>=Math.PI&&(n=Math.PI,r=!1,this.hC(t,i,s,h,e,n));var o=(this.q.pieHeight||Math.floor(h/4))/this.q.cant;t.beginPath(),t.arc(i,s,h,e,n,!1),t.lineTo(i+h*Math.cos(n),s+h*Math.sin(n)+o),t.arc(i,s+o,h,n,e,!0),t.lineTo(i+h*Math.cos(e),s+h*Math.sin(e)),t.fill(),r&&t.stroke()}},hC:function(t,i,s,e,n,h){t.beginPath(),t.arc(i,s,e,n,h,!1),t.stroke()},tC:function(t,i,s,e){t.globalAlpha=.5;for(var n=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"],h=n.length-1;-1<h;h--)t.beginPath(),t.fillStyle=n[h],t.arc(i+1,s+1,e+h,0,2*Math.PI,!0),t.fill();t.globalAlpha=1},rC:function(t){return t.addColorStop(0,"#ffffff"),t.addColorStop(.7,"#7a7a7a"),t.addColorStop(1,"#000000"),t},iC:function(t,i,s,e,n,h){var r;t.beginPath(),r="function"!=typeof this.q.gradient?(r=t.createRadialGradient(n,h,e/4,i,s,e),this.rC(r)):this.q.gradient(r),t.fillStyle=r,t.arc(i,s,e,0,2*Math.PI,!0),t.fill(),t.globalAlpha=.7},sC:function(t,i,s,e,n,h,r,o){var a=this.canvases[0].renderText(0,0,r,0,1);if(a){var u=a.scrollWidth;a.style.width=u+"px",t<u&&(u=t);var c=n-e<.2?4:8;o&&(c=u/1.8);var f=e+(n-e)/2;s-=(c-8)/2;var l=-c,d="right";(
f>=Math.PI/2&&f<Math.PI||f<=3*Math.PI/2&&f>=Math.PI)&&(l=-u-l+1,d="left");var v=0;!o&&h<1&&0<f&&f<Math.PI&&(v=(this.q.height||Math.floor(s/4))/h);var _=(i+Math.floor((s+v)*Math.sin(f)))*h-8,p=t+Math.floor((s+c/2)*Math.cos(f))+l,m=n<Math.PI/2+.01,b=e<Math.PI/2;b&&m?p=Math.max(p,t+3):b||m?!o&&(f>=Math.PI/2&&f<Math.PI||f<=3*Math.PI/2&&f>=Math.PI)&&(p+=u/3):p=Math.min(p,t-u),a.style.top=_+"px",a.style.left=p+"px",a.style.width=u+"px",a.style.textAlign=d,a.style.whiteSpace="nowrap"}},$render_pie3D:function(t,i,s,e,n,h){this.qk(t,i,s,e,this.q.cant,h)},$render_donut:function(t,i,s,e,n,h){if(i.length){this.qk(t,i,s,e,1,h,n);var r=this.q,o=this.Zk(s,e),a=r.radius?r.radius:o.radius,u=r.innerRadius&&r.innerRadius<a?r.innerRadius:a/3,c=r.x?r.x:o.x,f=r.y?r.y:o.y;t.fillStyle="#ffffff",t.beginPath(),t.arc(c,f,u,0,2*Math.PI,!0),t.fill()}}}),Qr={$render_bar:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g=e.y-s.y;b=!!this.q.yAxis,m=!!this.q.xAxis,c=(u=this.oC()).max,f=u.min,o=(e.x-s.x)/i.length,n||"auto"!=this.q.origin&&!b||this.aC(i,s,e,f,c,o),b&&(c=parseFloat(this.q.yAxis.end),f=parseFloat(this.q.yAxis.start)),l=(v=this.uC(f,c))[0],d=v[1],p=l?g/l:l,b||"auto"!=this.q.origin&&m||(_=10,p=l?(g-_)/l:_),!n&&"auto"!=this.q.origin&&!b&&this.q.origin>f&&this.cC(t,i,s,e,o,e.y-p*(this.q.origin-f)),r=parseInt(this.q.barWidth,10);var w=0,x=0;for(a=0;a<this.fC.length;a++)a==n&&(x=w),"bar"==this.fC[a].type&&w++;this.fC&&o<r*w+4&&(r=parseInt(o/w-4,10));var y=(o-r*w)/2,M="undefined"!=typeof this.q.radius?parseInt(this.q.radius,10):Math.round(r/5),S=!1,k=this.q.gradient;for(k&&"function"!=typeof k?(S=k,k=!1):k&&(k=t.createLinearGradient(0,e.y,0,s.y),this.q.gradient(k)),m||this.Kk(t,s.x,e.y+.5,e.x,e.y+.5,"#edeff0",1),a=0;a<i.length;a++){var C=parseFloat(this.q.value(i[a])||0);this.lC&&(C=this.dC(C)),c<C&&(C=c),C-=f,C*=d;var D=s.x+y+a*o+(r+1)*x,$=e.y,A=k||this.q.color.call(this,i[a]),I=this.q.border?1:0,F=this.q.label(i[a]);C==this.q.origin||"auto"==this.q.origin&&this.q.value(i[a])==f?(I=0,F=""):C<0||this.q.yAxis&&0===C&&!("auto"!=this.q.origin&&this.q.origin>f)?(C=I=0,F=""):b||"auto"!=this.q.origin&&m||(C+=_/p),t.globalAlpha=this.q.alpha.call(this,i[a]);var T=this.uk(t,s,D,$,r,f,M,p,C,A,k,S,I);S&&this.vC(t,D,$,r,f,M,p,C,A,S,I),I&&this._C(t,D,$,r,f,M,p,C,A),t.globalAlpha=1,T[0]!=D?this.canvases[n].renderTextAt(!1,!0,D+Math.floor(r/2),T[1],F):this.canvases[n].renderTextAt(!0,!0,D+Math.floor(r/2),T[3],F),h.addRect(i[a].id,[D-s.x,T[3]-s.y,T[2]-s.x,T[1]-s.y],n)}},pC:function(t,i,s,e,n,h,r){var o=s;return this.q.xAxis&&"auto"!=this.q.origin&&this.q.origin>r&&(o=s-=(this.q.origin-r)*n,(e-=this.q.origin-r)<0&&(e*=-1,t.translate(i+h,s),t.rotate(Math.PI),s=i=0),s-=.5),{value:e,x0:i,y0:s,start:o}},uk:function(t,i,s,e,n,h,r,o,a,u,c,f,l){t.save(),t.fillStyle=u;var d=this.pC(t,s,e,a,o,n,h),v=this.mC(t,d.x0,d.y0,n,r,o,d.value,l);c&&!f&&t.lineTo(d.x0+l,i.y),t.fill(),t.restore();var _=d.x0,p=d.x0!=s?s+v[0]:v[0];return[_,d.x0!=s?d.start-v[1]-d.y0:d.y0,p,d.x0!=s?d.start-d.y0:v[1]]},bC:function(t,i){var s,e;e=Zs.toRgb(i),(s=Zs.rgbToHsv(e[0],e[1],e[2]))[2]/=1.4;var n="rgb("+Zs.hsvToRgb(s[0],s[1],s[2])+")";t.strokeStyle=n,1==t.globalAlpha&&(t.globalAlpha=.9)},_C:function(t,i,s,e,n,h,r,o,a){var u;t.save(),u=this.pC(t,i,s,o,r,e,n),this.bC(t,a),this.mC(t,u.x0,u.y0,e,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},vC:function(t,i,s,e,n,h,r,o,a,u,c){t.save();var f=this.pC(t,i,s,o,r,e,n),l=this.gC(t,f.x0,f.y0,f.x0+e,f.y0-r*f.value+2,u,a,"y");t.fillStyle=l.gradient,this.mC(t,f.x0+l.offset,f.y0,e-2*l.offset,h,r,f.value,l.offset+c),t.fill(),t.restore()},mC:function(t,i,s,e,n,h,r,o,a){t.beginPath();var u=0;if(h*r<n){var c=(n-h*r)/n;c<=1&&-1<=c&&(u=-Math.acos(c)+Math.PI/2)}t.moveTo(i+o,s);var f=s-Math.floor(h*r)+n+(n?0:o);n<h*r&&t.lineTo(i+o,f);var l=i+n;n&&0<n&&t.arc(l,f,Math.max(n-o,0),-Math.PI+u,-Math.PI/2,!1);var d=i+e-n-o,v=f-n+(n?o:0);t.lineTo(d,v),n&&0<n&&t.arc(d+o,f,Math.max(n-o,0),-Math.PI/2,0-u,!1);var _=i+e-o;return t.lineTo(_,s),a||t.lineTo(i+o,s),[_,v]}},to={$render_line:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m;if(u=this.wC(t,i,s,e,n),r=this.q,i.length){
for(c=r.offset?s.x+.5*u.cellWidth:s.x,a=[],o=0;o<i.length;o++)if((m=this.xC(i[o],s,e,u))||"0"==m){if(l=o?u.cellWidth*o-.5+c:c,v="object"==k(m)?m.y0:m,o&&this.q.fixOverflow){if((p=this.xC(i[o-1],s,e,u)).out&&p.out==m.out)continue;f=u.cellWidth*(o-1)-.5+c,d="object"==k(p)?p.y0:p,p.out&&(_="min"==p.out?e.y:s.y,a.push({x:this.yC(f,l,d,v,_),y:_})),m.out&&(_="min"==m.out?e.y:s.y,a.push({x:this.yC(f,l,d,v,_),y:_}))}m.out||a.push({x:l,y:m,index:o})}for(this.MC=s,o=1;o<=a.length;o++)f=a[o-1].x,d=a[o-1].y,o<a.length&&(l=a[o].x,v=a[o].y,this.Kk(t,f,d,l,v,r.line.color.call(this,i[o-1]),r.line.width),r.line&&r.line.shadow&&(t.globalAlpha=.3,this.Kk(t,f+2,d+r.line.width+8,l+2,v+r.line.width+8,"#eeeeee",r.line.width+3),t.globalAlpha=1)),"undefined"!=typeof a[o-1].index&&this.SC(t,f,d,i[a[o-1].index],r.label(i[a[o-1].index]),n,h,s)}},yC:function(t,i,s,e,n){return t+(n-s)*(i-t)/(e-s)},SC:function(t,i,s,e,n,h,r){var o=this.q.item,a=parseInt(o.radius.call(this,e),10)||0,u=this.MC,c=o.type.call(this,e);if(a){if(t.save(),o.shadow){t.lineWidth=1,t.strokeStyle="#bdbdbd",t.fillStyle="#bdbdbd";for(var f=[.1,.2,.3],l=f.length-1;0<=l;l--)t.globalAlpha=f[l],t.strokeStyle="#d0d0d0",t.beginPath(),this.kC(t,i,s+2*a/3,a+l+1,c),t.stroke();t.beginPath(),t.globalAlpha=.3,t.fillStyle="#bdbdbd",this.kC(t,i,s+2*a/3,a+1,c),t.fill()}t.restore(),t.lineWidth=o.borderWidth,t.fillStyle=o.color.call(this,e),t.strokeStyle=o.borderColor.call(this,e),t.globalAlpha=o.alpha.call(this,e),t.beginPath(),this.kC(t,i,s,a+1,c),t.fill(),t.stroke(),t.globalAlpha=1}if(n&&this.canvases[h].renderTextAt(!1,!0,i,s-a-this.q.labelOffset,this.q.label.call(this,e)),r){var d=this.q.eventRadius||a+1;r.addRect(e.id,[i-d-u.x,s-d-u.y,i+d-u.x,s+d-u.y],h)}},kC:function(t,i,s,e,n){var h=[];if(!n||"square"!=n&&"s"!=n)if(!n||"diamond"!=n&&"d"!=n)h=!n||"triangle"!=n&&"t"!=n?[[i,s,e,0,2*Math.PI,!0]]:[[i,s-e],[i+Math.sqrt(3)*e/2,s+e/2],[i-Math.sqrt(3)*e/2,s+e/2],[i,s-e]];else{var r=1<t.lineWidth?t.lineWidth*Math.sqrt(2)/4:0;h=[[i,s-e],[i+e,s],[i,s+e],[i-e,s],[i+r,s-e-r]]}else h=[[i-(e*=Math.sqrt(2)/2)-t.lineWidth/2,s-e],[i+e,s-e],[i+e,s+e],[i-e,s+e],[i-e,s-e]];this.CC(t,h)},xC:function(t,i,s,e){var n=e.minValue,h=e.maxValue,r=e.unit,o=e.valueFactor,a=this.q.value(t);this.lC&&(a=this.dC(a));var u=(parseFloat(a||0)-n)*o;this.q.yAxis||(u+=e.startValue/r);var c=s.y-r*u;return!this.q.fixOverflow||"line"!=this.q.type&&"area"!=this.q.type?(h<a&&(c=i.y),(u<0||a<n)&&(c=s.y)):h<a?c={y:i.y,y0:c,out:"max"}:(u<0||a<n)&&(c={y:s.y,y0:c,out:"min"}),c},wC:function(t,i,s,e,n){var h,r={};r.totalHeight=e.y-s.y,this.q.cellWidth?r.cellWidth=Math.min(e.x-s.x,this.q.cellWidth):r.cellWidth=(e.x-s.x)/(this.q.offset?i.length:i.length-1);var o=!!this.q.yAxis,a=-1!=this.q.type.indexOf("stacked")?this.DC(i):this.oC();r.maxValue=a.max,r.minValue=a.min,n||this.aC(i,s,e,r.minValue,r.maxValue,r.cellWidth),o&&(r.maxValue=parseFloat(this.q.yAxis.end),r.minValue=parseFloat(this.q.yAxis.start));var u=this.uC(r.minValue,r.maxValue);return h=u[0],r.valueFactor=u[1],r.unit=h?r.totalHeight/h:10,r.startValue=0,o||(r.startValue=10,r.unit!=r.totalHeight&&(r.unit=h?(r.totalHeight-r.startValue)/h:10)),r}},io={$render_barH:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w,x,y,M,S,k,C;for(a=(e.y-s.y)/i.length,d=(l=this.oC("h")).max,v=l.min,x=e.x-s.x,C=!!this.q.xAxis,n||this.$C(t,i,s,e,v,d,a),C&&(d=parseFloat(this.q.xAxis.end),v=parseFloat(this.q.xAxis.start)),m=(g=this.uC(v,d))[0],p=g[1],M=m?x/m:10,C||(w=10,M=m?(x-w)/m:10),(o=parseInt(this.q.barWidth,10))*this.fC.length+4>a&&(o=a/this.fC.length-4),r=Math.floor((a-o*this.fC.length)/2),b="undefined"!=typeof this.q.radius?parseInt(this.q.radius,10):Math.round(o/5),_=!1,(c=this.q.gradient)&&"function"!=typeof c?(_=c,c=!1):c&&(c=t.createLinearGradient(s.x,s.y,e.x,s.y),this.q.gradient(c)),C||this.Kk(t,s.x-.5,s.y,s.x-.5,e.y,"#edeff0",1),f=0;f<i.length;f++)if(y=parseFloat(this.q.value(i[f]||0)),this.lC&&(y=this.dC(y)),y&&!isNaN(y))if(d<y&&(y=d),y-=v,y*=p,S=s.x,k=s.y+r+f*a+(o+1)*n,y<0&&"auto"==this.q.origin||this.q.xAxis&&0===y&&!("auto"!=this.q.origin&&this.q.origin>v))this.canvases[n].renderTextAt(
"middle","right",S+10,k+o/2+r,this.q.label(i[f]));else{y<0&&"auto"!=this.q.origin&&this.q.origin>v&&(y=0),C||(y+=w/M),u=c||this.q.color.call(this,i[f]),this.q.border&&this.AC(t,S,k,o,v,b,M,y,u),t.globalAlpha=this.q.alpha.call(this,i[f]);var D=this.IC(t,e,S,k,o,v,b,M,y,u,c,_);_&&this.FC(t,S,k,o,v,b,M,y,u,_),t.globalAlpha=1,D[3]==k?(this.canvases[n].renderTextAt("middle","left",D[0]-5,D[3]+Math.floor(o/2),this.q.label(i[f])),h.addRect(i[f].id,[D[0]-s.x,D[3]-s.y,D[2]-s.x,D[3]+o-s.y],n)):(this.canvases[n].renderTextAt("middle",!1,D[2]+5,D[1]+Math.floor(o/2),this.q.label(i[f])),h.addRect(i[f].id,[D[0]-s.x,k-s.y,D[2]-s.x,D[3]-s.y],n))}},TC:function(t,i,s,e,n,h,r,o,a){var u=0;if(h*r<n){var c=(n-h*r)/n;u=-Math.asin(c)+Math.PI/2}t.moveTo(i,s+o);var f=i+h*r-n-(n?0:o);f=Math.max(i,f),n<h*r&&t.lineTo(f,s+o);var l=s+n;n&&0<n&&t.arc(f,l,n-o,-Math.PI/2+u,0,!1);var d=s+e-n-(n?0:o),v=f+n-(n?o:0);t.lineTo(v,d),n&&0<n&&t.arc(f,d,n-o,0,Math.PI/2-u,!1);var _=s+e-o;return t.lineTo(i,_),a||t.lineTo(i,s+o),[v,_]},$C:function(t,i,s,e,n,h,r){var o=0;this.q.xAxis&&(this.canvases.x||(this.canvases.x=this.zC("axis_x")),o=this.VC(this.canvases.x.getCanvas(),i,s,e,n,h)),this.q.yAxis&&(this.canvases.y||(this.canvases.y=this.zC("axis_y")),this.HC(this.canvases.y.getCanvas(),i,s,e,r,o))},HC:function(t,i,s,e,n,h){if(this.q.yAxis){var r,o=parseInt(h||s.x,10)-.5,a=e.y+.5,u=s.y;this.Kk(t,o,a,o,u,this.q.yAxis.color,1);for(var c=0;c<i.length;c++){var f="auto"!=this.q.origin&&"barH"==this.q.type&&parseFloat(this.q.value(i[c]))<this.q.origin;r=u+n/2+c*n,this.canvases.y.renderTextAt("middle",!f&&"left",f?o+5:o-5,r,this.q.yAxis.template(i[c]),"webix_axis_item_y",f?0:o-10),this.q.yAxis.lines.call(this,i[c])&&this.Kk(t,s.x,r,e.x,r,this.q.yAxis.lineColor.call(this,i[c]),1)}this.q.yAxis.lines.call(this,{})&&this.Kk(t,s.x+.5,u+.5,e.x,u+.5,this.q.yAxis.lineColor.call(this,{}),1),this.BC(s,e)}},VC:function(t,i,s,e,n,h){var r,o={},a=this.q.xAxis;if(a){var u=e.y+.5,c=s.x-.5,f=e.x-.5,l=s.x;if(this.Kk(t,c,u,f,u,a.color,1),a.step&&(r=parseFloat(a.step)),"undefined"!=typeof this.RC.step&&"undefined"!=typeof this.RC.start&&"undefined"!=typeof this.RC.end||(n=(o=this.PC(n,h)).start,h=o.end,r=o.step,this.q.xAxis.end=h,this.q.xAxis.start=n,this.q.xAxis.step=r),0!==r){for(var d=(f-c)*r/(h-n),v=0,_=n;_<=h;_+=r){var p=this.lC?Math.pow(10,_):_;o.fixNum&&(p=parseFloat(p).toFixed(o.fixNum));var m=Math.floor(c+v*d)+.5;if(_==n&&"auto"==this.q.origin||!a.lines.call(this,_)||this.Kk(t,m,u,m,s.y,this.q.xAxis.lineColor.call(this,_),1),_==this.q.origin&&(l=m+1),r<1&&!this.lC){var b=Math.min(Math.floor(this.dC(r)),n<=0?0:Math.floor(this.dC(n))),g=Math.pow(10,-b);_=p=Math.round(p*g)/g}this.canvases.x.renderTextAt(!1,!0,m,u+2,a.template(p.toString()),"webix_axis_item_x"),v++}return this.canvases.x.renderTextAt(!0,!1,c,e.y+this.q.padding.bottom-3,this.q.xAxis.title,"webix_axis_title_x",e.x-s.x),l}}},jC:function(t,i,s,e,n,h,r){var o=i;return this.q.yAxis&&"auto"!=this.q.origin&&this.q.origin>r&&(o=i+=(this.q.origin-r)*n,(e-=this.q.origin-r)<0&&(e*=-1,t.translate(i,s+h),t.rotate(Math.PI),i=.5,s=0),i+=.5),{value:e,x0:i,y0:s,start:o}},IC:function(t,i,s,e,n,h,r,o,a,u,c,f){t.save();var l=this.jC(t,s,e,a,o,n,h);t.fillStyle=u,t.beginPath();var d=this.TC(t,l.x0,l.y0,n,r,o,l.value,this.q.border?1:0);c&&!f&&t.lineTo(i.x,l.y0+(this.q.border?1:0)),t.fill(),t.restore();var v=l.y0,_=l.y0!=e?e:d[1];return[l.y0!=e?l.start-d[0]:l.start,v,l.y0!=e?l.start:d[0],_]},AC:function(t,i,s,e,n,h,r,o,a){t.save();var u=this.jC(t,i,s,o,r,e,n);t.beginPath(),this.bC(t,a),t.globalAlpha=.9,this.TC(t,u.x0,u.y0,e,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},FC:function(t,i,s,e,n,h,r,o,a,u){t.save();var c=this.jC(t,i,s,o,r,e,n),f=this.gC(t,c.x0,c.y0+e,c.x0+r*c.value,c.y0,u,a,"x");t.fillStyle=f.gradient,t.beginPath(),this.TC(t,c.x0,c.y0+f.offset,e-2*f.offset,h,r,c.value,f.offset),t.fill(),t.globalAlpha=1,t.restore()}},so={$render_stackedBar:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d=this.q,v=e.y-s.y,_=!!d.yAxis,p=!!d.xAxis,m=this.DC(i),b=0===d.origin;r=m.max,o=m.min;var g=Math.floor((e.x-s.x)/i.length);n||(a=this.aC(i,s,e,o,r,g)
),_&&(r=parseFloat(d.yAxis.end),o=parseFloat(d.yAxis.start));var w=this.uC(o,r);l=w[0],f=w[1];var x=l?v/l:10,y=parseInt(d.barWidth,10);g<y+4&&(y=g-4);var M=Math.floor((g-y)/2),S=!!d.gradient&&d.gradient;p||this.Kk(t,s.x,e.y+.5,e.x,e.y+.5,"#edeff0",1);for(var k=0;k<i.length;k++){var C=Math.abs(parseFloat(d.value(i[k]||0)));this.lC&&(C=this.dC(C)),u=s.x+M+k*g;var D=b&&C<0;if(n?c=D?i[k].$startYN:i[k].$startY:(c=a-1,i[k].$startY=c,b&&(D&&(c=a+1),i[k].$startYN=a+1)),C&&!isNaN(C)&&(n||b||(C-=o),C*=f,!(c<s.y+1))){var $=this.q.color.call(this,i[k]),A=Math.abs(c-(b?e.y+o*x:e.y))<3;t.globalAlpha=d.alpha.call(this,i[k]),t.fillStyle=t.strokeStyle=d.color.call(this,i[k]),t.beginPath();var I=c-x*C+(A?D?-1:1:0),F=this.NC(t,u-(d.border?.5:0),c,y+(d.border?.5:0),I,0,s.y);if(t.fill(),t.stroke(),S){t.save();var T=this.gC(t,u,c,u+y,F[1],S,$,"y");t.fillStyle=T.gradient,t.beginPath(),F=this.NC(t,u+T.offset,c,y-2*T.offset,I,d.border?1:0,s.y),t.fill(),t.restore()}d.border&&(t.save(),"string"==typeof d.border?t.strokeStyle=d.border:this.bC(t,$),t.beginPath(),this.NC(t,u-.5,parseInt(c,10)+.5,y+1,parseInt(I,10)+.5,0,s.y,A),t.stroke(),t.restore()),t.globalAlpha=1,this.canvases[n].renderTextAt(!1,!0,u+Math.floor(y/2),F[1]+(c-F[1])/2-7,this.q.label(i[k])),h.addRect(i[k].id,[u-s.x,F[1]-s.y,F[0]-s.x,i[k][D?"$startYN":"$startY"]-s.y],n),i[k][D?"$startYN":"$startY"]=F[1]}}},NC:function(t,i,s,e,n,h,r,o){t.moveTo(i,s),n<r&&(n=r),t.lineTo(i,n);var a=i+e,u=n;t.lineTo(a,u);var c=i+e;return t.lineTo(c,s),o||t.lineTo(i,s),[c,u]}},eo={$render_stackedBarH:function(t,i,s,e,n,h){var r,o,a,u,c=e.x-s.x,f=!!this.q.yAxis,l=this.DC(i);r=l.max,o=l.min;var d=Math.floor((e.y-s.y)/i.length);n||this.$C(t,i,s,e,o,r,d),f&&(r=parseFloat(this.q.xAxis.end),o=parseFloat(this.q.xAxis.start));var v=this.uC(o,r);u=v[0],a=v[1];var _=u?c/u:10,p=0;f||(p=10,_=u?(c-p)/u:10);var m=parseInt(this.q.barWidth,10);d<m+4&&(m=d-4);var b=(d-m)/2,g=!1,w=this.q.gradient;w&&(g=!0),f||this.Kk(t,s.x-.5,s.y,s.x-.5,e.y,"#edeff0",1);var x=0,y=0;for(M=0;M<this.fC.length;M++)M==n&&(y=x),"stackedBarH"==this.fC[M].type&&x++;for(var M=0;M<i.length;M++){y||(i[M].$startX=s.x);var S=Math.abs(parseFloat(this.q.value(i[M]||0)));r<S&&(S=r),S-=o,S*=a;var k=s.x,C=s.y+b+M*d;if(y?k=i[M].$startX:i[M].$startX=k,S&&!isNaN(S)){f||(S+=p/_);var D=this.q.color.call(this,i[M]);t.globalAlpha=this.q.alpha.call(this,i[M]),t.fillStyle=this.q.color.call(this,i[M]),t.beginPath();var $=this.TC(t,k,C,m,0,_,S,0);if(w&&!g&&t.lineTo(s.x+c,C+(this.q.border?1:0)),t.fill(),g){var A=this.gC(t,k,C+m,k,C,g,D,"x");t.fillStyle=A.gradient,t.beginPath(),$=this.TC(t,k,C,m,0,_,S,0),t.fill()}this.q.border&&this.AC(t,k,C,m,o,0,_,S,D),t.globalAlpha=1,this.canvases[n].renderTextAt("middle",!0,i[M].$startX+($[0]-i[M].$startX)/2-1,C+($[1]-C)/2,this.q.label(i[M])),h.addRect(i[M].id,[i[M].$startX-s.x,C-s.y,$[0]-s.x,$[1]-s.y],n),i[M].$startX=$[0]}}}},no={$render_area:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w;if(f=this.wC(t,i,s,e,n),u=(o=this.q).eventRadius||Math.floor(f.cellWidth/2),i.length){for(l=[],_=o.offset?s.x+.5*f.cellWidth:s.x,a=0;a<i.length;a++)if(c=i[a],v=this.xC(c,s,e,f),b=_+f.cellWidth*a,v){if(g="object"==k(v)?v.y0:v,a&&this.q.fixOverflow){if((d=this.xC(i[a-1],s,e,f)).out&&d.out==v.out)continue;p=f.cellWidth*(a-1)-.5+_,m="object"==k(d)?d.y0:d,d.out&&(w="min"==d.out?e.y:s.y,l.push([this.yC(p,b,m,g,w),w])),v.out&&(w="min"==v.out?e.y:s.y,l.push([this.yC(p,b,m,g,w),w]),a==i.length-1&&w==s.y&&l.push([b,s.y]))}v.out||(l.push([b,g]),h.addRect(c.id,[b-u-s.x,g-u-s.y,b+u-s.x,g+u-s.y],n)),o.yAxis||(r=o.offset||a!=i.length-1?"center":"left",this.canvases[n].renderTextAt(!1,r,b,g-o.labelOffset,o.label(c)))}l.length&&(l.push([b,e.y]),l.push([l[0][0],e.y])),t.globalAlpha=this.q.alpha.call(this,i[0]),t.fillStyle=this.q.color.call(this,i[0]),t.beginPath(),this.CC(t,l),t.fill(),t.lineWidth=1,t.globalAlpha=1,o.border&&(t.lineWidth=o.borderWidth||1,o.borderColor?t.strokeStyle=o.borderColor.call(this,i[0]):this.bC(t,t.fillStyle),t.beginPath(),this.CC(t,l),t.stroke())}},$render_stackedArea:function(t,s,i,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w,x,y;if(
v=this.wC(t,s,i,e,n),l=(u=this.q).eventRadius||Math.floor(v.cellWidth/2),s.length){_=[],b=[],p=u.offset?i.x+.5*v.cellWidth:i.x;var M=function(t,i){return n?s[t].$startY?i-e.y+s[t].$startY:0:i};for(c=0;c<s.length;c++)d=s[c],c?p+=v.cellWidth:(m=M(c,e.y),_.push([p,m])),m=M(c,this.xC(d,i,e,v)),b.push(isNaN(m)&&!c?s[c].$startY||e.y:m),m&&(_.push([p,m]),h.addRect(d.id,[p-l-i.x,m-l-i.y,p+l-i.x,m+l-i.y],n),u.yAxis||(u.offset,a="center",this.canvases[n].renderTextAt(!1,a,p,m-u.labelOffset,u.label(d))));if(_.push([p,M(c-1,e.y)]),n)for(c=s.length-2;0<c;c--)p-=v.cellWidth,(m=s[c].$startY)&&_.push([p,m]);for(_.push([_[0][0],_[0][1]]),t.globalAlpha=this.q.alpha.call(this,s[0]),t.fillStyle=this.q.color.call(this,s[0]),t.beginPath(),this.CC(t,_),t.fill(),c=0;c<s.length;c++){if(!(m=b[c]))for(c==s.length-1&&(m=s[c].$startY),f=c+1;f<s.length;f++)if(b[f]){r={x:i.x,y:b[0]},o={x:i.x+v.cellWidth*f,y:b[f]},g=i.x+v.cellWidth*c,void 0,m=(y=((x=o).y-(w=r).y)/(x.x-w.x))*g+w.y-y*w.x;break}s[c].$startY=m}}}},ho={$render_radar:function(t,i,s,e,n,h){this.EC(t,i,s,e,n,h)},EC:function(t,i,s,e,n,h){if(i.length){for(var r=this.Zk(s,e),o=this.q.radius?this.q.radius:r.radius,a=this.q.x?this.q.x:r.x,u=this.q.y?this.q.y:r.y,c=[],f=0;f<i.length;f++)c.push(1);var l=this._c(c,i.length);this.MC=s,n||this.LC(l,a,u,o,i),this.OC(t,l,a,u,o,i,n,h)}},OC:function(t,i,s,e,n,h,r,o){var a,u,c,f,l,d,v,_,p,m,b,g,w,x,y,M,S,k,C;for(l=(c=this.q).yAxis.start,d=c.yAxis.end,k=(g=(C=this.uC(l,d))[0])?n/g:n/2,S=C[1],a=u=w=-Math.PI/2,p=[],f=_=0;f<h.length;f++)y=M||(x=c.value(h[f]),this.lC&&(x=this.dC(x)),(parseFloat(x||0)-l)*S),m=Math.floor(k*y),x=c.value(f!=h.length-1?h[f+1]:h[0]),this.lC&&(x=this.dC(x)),M=(parseFloat(x||0)-l)*S,b=Math.floor(k*M),a=u,u=f!=h.length-1?w+i[f]-1e-4:w,v=_||this.nC(a,s,e,m),_=this.nC(u,s,e,b),p.push(v);c.fill&&this.UC(t,p,h),!c.disableLines&&2<h.length&&this.YC(t,p,h),(!c.disableItems||h.length<3)&&this.WC(t,p,h,r,o),p=null},WC:function(t,i,s,e,n){for(var h=0;h<i.length;h++)this.SC(t,i[h].x,i[h].y,s[h],this.q.label.call(this,s),e,n)},UC:function(t,i,s){var e,n;t.globalAlpha=this.q.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.q.fill.call(this,s[h]),e=i[h],n=i[h+1]||i[0],h||t.moveTo(e.x,e.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},YC:function(t,i,s){for(var e,n,h=0;h<i.length;h++)e=i[h],n=i[h+1]||i[0],this.Kk(t,e.x,e.y,n.x,n.y,this.q.line.color.call(this,s[h]),this.q.line.width)},LC:function(t,i,s,e,n){var h=this.q.yAxis,r=this.q.xAxis,o=h.start,a=h.end,u=h.step,c={},f=this.GC;if("undefined"==typeof f.step||"undefined"==typeof f.start||"undefined"==typeof f.end){var l=this.oC();o=(c=this.PC(l.min,l.max)).start,a=c.end,u=c.step,h.end=a,h.start=o}var d,v,_,p,m,b=[],g=0,w=e*u/(a-o);u<1&&(p=Math.min(this.dC(u),o<=0?0:this.dC(o)),m=Math.pow(10,-p));var x=[];this.canvases.scale||(this.canvases.scale=this.zC("radar_scale"));var y=this.canvases.scale.getCanvas();for(d=a;o<=d;d-=u){var M=this.lC?Math.pow(10,d):d;c.fixNum&&(M=parseFloat(d).toFixed(c.fixNum)),b.push(Math.floor(g*w)+.5),m&&!this.lC&&(d=M=Math.round(M*m)/m);var S=s-e+b[b.length-1];if(this.canvases.scale.renderTextAt("middle","left",i,S,h.template(M.toString()),"webix_axis_item_y webix_radar"),t.length<2)return void this.XC(y,"arc",i,s,e-b[b.length-1],-Math.PI/2,3*Math.PI/2,d);var k,C=-Math.PI/2,D=C;for(v=0;v<t.length;v++)g||x.push(D),k=C+t[v]-1e-4,this.XC(y,2<t.length?f.lineShape||"line":"arc",i,s,e-b[b.length-1],D,k,d,v,n[d]),D=k;g++}for(d=0;d<x.length;d++)_=this.nC(x[d],i,s,e),r.lines.call(this,n[d],d)&&this.Kk(y,i,s,_.x,_.y,r?r.lineColor.call(this,n[d]):"#cfcfcf",1),this.JC(y,i,s,e,x[d],r?r.template.call(this,n[d]):"&nbsp;")},XC:function(t,i,s,e,n,h,r,o,a){var u,c;if(n<0)return!1;u=this.nC(h,s,e,n),c=this.nC(r,s,e,n);var f=this.q.yAxis;f.bg&&(t.beginPath(),t.moveTo(s,e),"arc"==i?t.arc(s,e,n,h,r,!1):(t.lineTo(u.x,u.y),t.lineTo(c.x,c.y)),t.fillStyle=f.bg(o,a),t.moveTo(s,e),t.fill(),t.closePath()),f.lines.call(this,o)&&(t.lineWidth=1,t.beginPath(),"arc"==i?t.arc(s,e,n,h,r,!1):(t.moveTo(u.x,u.y),t.lineTo(c.x,c.y)),t.strokeStyle=f.lineColor.call(this,o),t.stroke())},
JC:function(t,i,s,e,n,h){if(!h)return!1;var r=this.canvases.scale.renderText(0,0,h,"webix_axis_radar_title",1),o=r.scrollWidth,a=r.offsetHeight,u=this.nC(n,i,s,e+5),c=0,f=0;(n<0||n>Math.PI)&&(f=-a),n>Math.PI/2&&(c=-o),Math.abs(n+Math.PI/2)<.001||Math.abs(n-Math.PI/2)<.001?c=-o/2:(Math.abs(n)<.001||Math.abs(n-Math.PI)<.001)&&(f=-a/2),r.style.top=u.y+f+"px",r.style.left=u.x+c+"px",r.style.width=o+"px",r.style.whiteSpace="nowrap"}},ro={$render_scatter:function(t,i,s,e,n,h){if(this.q.xValue){var r=this.q,o=!(r.disableLines||"undefined"==typeof r.disableLines),a=this.oC(),u=this.oC("h","xValue");n||(this.canvases.x||(this.canvases.x=this.zC("axis_x")),this.canvases.y||(this.canvases.y=this.zC("axis_y")),this.KC(this.canvases.y.getCanvas(),i,s,e,a.min,a.max),this.VC(this.canvases.x.getCanvas(),i,s,e,u.min,u.max)),a={min:r.yAxis.start,max:r.yAxis.end},u={min:r.xAxis.start,max:r.xAxis.end};var c=this.qC(t,i,s,e,u,a);this.MC=s;for(var f,l,d,v,_,p=[],m=0;m<i.length;m++){var b=this.ZC(c,e,s,u,i[m],"X"),g=this.ZC(c,s,e,a,i[m],"Y");isNaN(b)||isNaN(g)||p.push({x:b,y:g,index:m})}for(var w=0;w<p.length;w++){if(_=p[w].index,o){var x=r.line.color.call(this,i[_]);f=p[w].x,l=p[w].y,w==p.length-1?r.shape&&2<p.length&&(this.Kk(t,d,v,p[0].x,p[0].y,x,r.line.width),r.disableItems||this.QC(t,h,p[0],i[0],n),r.fill&&this.tD(t,p,i)):(d=p[w+1].x,v=p[w+1].y,this.Kk(t,f,l,d,v,x,r.line.width))}!r.disableItems&&p[w]&&this.QC(t,h,p[w],i[_],n)}}},tD:function(t,i,s){var e,n;t.globalAlpha=this.q.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.q.fill.call(this,s[h]),e=i[h],n=i[h+1]||i[0],h||t.moveTo(e.x,e.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},qC:function(t,i,s,e,n,h){var r={};return r.totalHeight=e.y-s.y,r.totalWidth=e.x-s.x,this.iD(r,n.min,n.max,r.totalWidth,"X"),this.iD(r,h.min,h.max,r.totalHeight,"Y"),r},QC:function(t,i,s,e,n){this.SC(t,s.x,s.y,e,this.q.label.call(this,e),n,i)},ZC:function(t,i,s,e,n,h){var r=this.q["X"==h?"xValue":"value"].call(this,n),o=t["valueFactor"+h],a=(parseFloat(r||0)-e.min)*o,u=t["unit"+h],c=s[h.toLowerCase()]-("X"==h?-1:1)*Math.floor(u*a);return a<0&&(c=s[h.toLowerCase()]),r>e.max&&(c=i[h.toLowerCase()]),r<e.min&&(c=s[h.toLowerCase()]),c},iD:function(t,i,s,e,n){var h=this.uC(i,s);t["relValue"+(n=n||"")]=h[0],t["valueFactor"+n]=h[1],t["unit"+n]=t["relValue"+n]?e/t["relValue"+n]:10}},oo={$render_splineArea:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g=this.q,w=[];if(f=this.wC(t,i,s,e,n),c=g.eventRadius||Math.floor(f.cellWidth/2),a=[],i.length){for(v=s.x,o=0;o<i.length;o++)((m=this.xC(i[o],s,e,f))||"0"==m)&&(d=o?f.cellWidth*o-.5+v:v,a.push({x:d,y:m,index:o}),h.addRect(i[o].id,[d-c-s.x,m-c-s.y,d+c-s.x,m+c-s.y],n));for(l=this.sD(a),o=0;o<a.length;o++)if(_=a[o].x,o<a.length-1){for(p=a[o+1].x,b=a[o+1].y,u=_;u<p;u++){var x=this.eD(u,_,o,l.a,l.b,l.c,l.d);x<s.y&&(x=s.y),x>e.y&&(x=e.y);var y=this.eD(u+1,_,o,l.a,l.b,l.c,l.d);y<s.y&&(y=s.y),y>e.y&&(y=e.y),w.push([u,x]),w.push([u+1,y])}w.push([p,b])}r=this.q.color.call(this,i[0]),w.length&&(w.push([p,e.y]),w.push([w[0][0],e.y])),t.globalAlpha=this.q.alpha.call(this,i[0]),t.fillStyle=r,t.beginPath(),this.CC(t,w),t.fill(),t.lineWidth=1,t.globalAlpha=1,g.border&&(t.lineWidth=g.borderWidth||1,g.borderColor?t.strokeStyle=g.borderColor.call(this,i[0]):this.bC(t,r),t.beginPath(),w.splice(w.length-3),this.CC(t,w),t.stroke())}}},ao={dynamic_setter:function(t){return t&&function i(r){if(r.nD)return;var o=r.q;o.cellWidth||(o.cellWidth=30);o.animateDuration||(o.animateDuration=400);o.offset=!1,r.nD=r.attachEvent("onBeforeRender",function(t,i){var s=r.hD(r.ze,r.He);!function e(s){co(s,function(t,i){i.Ze(s.ze+2*s.q.cellWidth,s.He)})}(r),function h(t,i,s,e){if(e&&t.length){var n=Math.ceil((s.x-i.x)/e);t.length>n+1&&t.splice(0,t.length-n-1)}}(t,s.start,s.end,o.cellWidth),"add"==i&&function n(i){var t=i.q.cellWidth;i.rD!=t&&(i.rD=t,i.render());i.rD=0,i.oD=null,window.requestAnimationFrame&&!document.hidden&&window.requestAnimationFrame(function(t){!function h(i,t){var s,e=i.q.animateDuration,n=i.q.cellWidth;n&&1<i.count()&&(i.oD||(i.oD=t),s=t-i.oD,i.rD=Math.min(
Math.max(s/e*n,1),n),i.render(),s<e&&window.requestAnimationFrame(function(t){h(i,t)}))}(i,t)});i.aD||(i.aD=i.attachEvent("onAfterRender",function(t){!function h(t,c){var f=t.count(),s=t.hD(t.ze,t.He),l=t.q.cellWidth,d=t.rD||0,i=c.length<f||(c.length-1)*l>s.end.x-s.start.x;function e(t,i,s,e){var n=t.getCanvas(),h=t.Ke,r=t.We,o=t.Ge;if(d&&(c.length<f||(c.length-1)*l>s-i)?(h.style.left=-d+"px",1<c.length&&(!function u(t,i,s){if(t.length){G(t[0]);for(var e=1;e<t.length;e++)uo(s,t[e])||(t[e].style.left=t[e].offsetLeft-i+"px")}}(r,d,o),n.clearRect(0,0,i+d,h.offsetHeight),n.clearRect(s+d,0,h.offsetWidth,h.offsetHeight))):(h.style.left="0px",e||d==l||n.clearRect(i+(c.length-1)*l-l+d,0,h.offsetWidth,h.offsetHeight)),1<r.length&&d&&d!=l){var a=r.length-1;uo(o,r[a])&&(a-=1),r[a].style.display="none"}}co(t,function(t,i){e(i,s.start.x,s.end.x,"x"==t)}),function n(t,i,s){t.re.ne.style.left=i.start.x-s+"px",t.re.ne.style.width=i.end.x-i.start.x+s+"px"}(t,s,i?d:0)}(i,t)}))}(r)}),r.uD=r.attachEvent("onBeforeXAxis",function(t,i,s,e,n,h){return function _(t,i,s,e,n,h,r){var o,a,u,c,f=t.q,l=e.x-.5,d=parseInt(r||n.y,10)+.5,v=n.x;if(!f.dynamic)return!1;for(u=(s.length-1)*h>v-l||s.length<t.count(),a=0;a<s.length;a++)c=l+a*h,o=u?1<a:!!a,c=Math.ceil(c)-.5,t.cD(c,d,s[a],o),a&&f.xAxis.lines.call(t,s[a])&&t.fD(i,c,n.y,e.y,s[a]);t.canvases.x.renderTextAt(!0,!1,l,n.y+f.padding.bottom-3,f.xAxis.title,"webix_axis_title_x",n.x-e.x),t.Kk(i,l,d,v+(u?t.rD:0),d,f.xAxis.color,1)}(r,t,i,s,e,n,h),!1})}(this),t}};function uo(t,i){return"axis_x"===t&&-1!==i.className.indexOf("webix_axis_title_x")}function co(t,i){if(t.canvases){for(var s=0;s<t.fC.length;s++)t.canvases[s]&&i(s,t.canvases[s]);t.canvases.x&&i("x",t.canvases.x)}}var fo={name:"chart",$init:function(t){if(this.fC=[this.q],this.lD=[],this.re.className+=" webix_chart",this.$ready.push(this.Wh),t.preset&&this.dD(t),t.series){var i=t.series;delete t.series,t.series=i}this.attachEvent("onMouseMove",this.vD),this.data.provideApi(this,!0)},Wh:function(){this.data.attachEvent("onStoreUpdated",C(function(){this.render.apply(this,arguments)},this))},defaults:{ariaLabel:"chart",color:"default",alpha:"1",radius:0,label:!1,value:"{obj.value}",padding:{},type:"pie",lineColor:"#ffffff",cant:.5,barWidth:30,line:{width:2,color:"#1ca1c1"},item:{radius:3,borderColor:"#1ca1c1",borderWidth:2,color:"#ffffff",alpha:1,type:"r",shadow:!1},shadow:!1,gradient:!1,border:!1,labelOffset:20,origin:"auto",scale:"linear"},za:"webix_area_id",on_click:{webix_chart_legend_item:function(t,i,s){var e=s.getAttribute("series_id");if(this.callEvent("onLegendClick",[t,e,s])&&void 0!==e&&1<this.fC.length){var n=this.q,h=n.legend.values;(h&&h[e].toggle||n.legend.toggle)&&(-1!=s.className.indexOf("hidden")?this.showSeries(e):this.hideSeries(e))}}},on_dblclick:{},on_mouse_move:{},locate:function(t){return J(t,this.za)},$setSize:function(t,i){var s=Gi.api.$setSize.call(this,t,i);if(s){for(var e in this.canvases)this.canvases[e].Ze(this.ze,this.He);this.render()}return s},type_setter:function(t){return this["$render_"+t],"undefined"==typeof this.q.offset&&(this.q.offset=!(-1!=t.toLowerCase().indexOf("area"))),"radar"!=t||this.q.yAxis||this.define("yAxis",{}),"scatter"==t&&(this.q.yAxis||this.define("yAxis",{}),this.q.xAxis||this.define("xAxis",{})),t},destructor:function(){this.removeAllSeries(),Bi.destructor.apply(this,arguments)},removeAllSeries:function(){this.clearCanvas(),this._D&&(this._D.innerHTML="",this._D.parentNode.removeChild(this._D),this._D=null),this.canvases&&(this.canvases={}),this.re.innerHTML="";for(var t=0;t<this.fC.length;t++)this.fC[t].tooltip&&this.fC[t].tooltip.destructor();this.fC=[]},clearCanvas:function(){if(this.canvases&&"object"==k(this.canvases))for(var t in this.canvases)this.canvases[t].clearCanvas()},render:function(t,i,s){var e,n,h,r;if(this.isVisible(this.q.id)&&(n=this.pD(),this.callEvent("onBeforeRender",[n,s]))){if(this.canvases&&"object"==k(this.canvases))for(var o in this.canvases)this.canvases[o].clearCanvas();else this.canvases={};if(this.q.legend&&(this.canvases.legend||(this.canvases.legend=this.zC(
"legend")),this.mD(this.data.getRange(),this.ze,this.He)),this.Ha=h=new Ns(this.za),r=this.q,e=this.hD(this.ze,this.He),this.fC)for(var a=0;a<this.fC.length;a++)this.q=this.fC[a],this.canvases[a]||(this.canvases[a]=this.zC(this.name+" "+a,"z-index:"+(2+a),null,a,this.q.ariaLabel)),this["$render_"+this.q.type](this.canvases[a].getCanvas(),n,e.start,e.end,a,h);if(h.render(this.re),this.re.lastChild.style.zIndex=100,this.bD(this.re.lastChild,e),this.callEvent("onAfterRender",[n]),this.q=r,this.q.legend&&this.q.legend.values)for(var u=this.q.legend.values,c=0;c<u.length;c++)u[c].$hidden&&this.hideSeries(c)}},bD:function(t,i){var s={};for(var e in s.left=i.start.x,s.top=i.start.y,s.width=i.end.x-i.start.x,s.height=i.end.y-i.start.y,s)t.style[e]=s[e]+"px"},pD:function(){var t,i,s,e,n,h,r,o,a,u;if(e=this.data.getRange(),t=-1!=this.q.type.toLowerCase().indexOf("barh")?"yAxis":"xAxis",(i=this.q[t])&&i.units&&"object"==k(i.units)){if(o=[],"undefined"!=typeof(s=i.units).start&&"undefined"!=typeof s.end&&"undefined"!=typeof s.next)for(r=s.start;r<=s.end;)o.push(r),r=s.next.call(this,r);else"[object Array]"===Object.prototype.toString.call(s)&&(o=s);if(h=[],o.length){for(a=i.value,u={},n=0;n<e.length;n++)u[a(e[n])]=n;for(n=0;n<o.length;n++)"undefined"!=typeof u[o[n]]?(e[u[o[n]]].$unit=o[n],h.push(e[u[o[n]]])):h.push({$unit:o[n]})}return h}return e},series_setter:function(t){if("object"!=k(t));else{this.at(t.length?t[0]:t),this.fC=[this.q];for(var i=1;i<t.length;i++)this.addSeries(t[i])}return t},value_setter:Ft,xValue_setter:Ft,yValue_setter:function(t){this.define("value",t)},alpha_setter:Ft,label_setter:Ft,lineColor_setter:Ft,borderColor_setter:Ft,pieInnerText_setter:Ft,gradient_setter:function(t){return"function"!=typeof t&&t&&!0===t&&(t="light"),t},colormap:{RAINBOW:function(t){var i=Math.floor(this.getIndexById(t.id)/this.count()*1536);return 1536==i&&(i-=1),this.gD[Math.floor(i/256)](i%256)},"default":function(t){var i=this.count(),s=this.lc.length,e=this.getIndexById(t.id);return i<s?(e&&(e=e<s-i?this.fc+2:this.fc+1),this.fc=e):e%=s,this.lc[e]}},color_setter:function(t){return this.colormap[t]||Ft(t)},fill_setter:function(t){return!(!t||"0"==t)&&Ft(t)},dD:function(t){this.define("preset",t.preset),delete t.preset},preset_setter:function(t){var i,s,e;if(this.defaults=H.extend({},this.defaults),"object"!=k(e=this.presets[t]))return!1;for(i in e)if("object"==k(e[i]))if(this.defaults[i]&&"object"==k(this.defaults[i]))for(s in this.defaults[i]=H.extend({},this.defaults[i]),e[i])this.defaults[i][s]=e[i][s];else this.defaults[i]=H.extend({},e[i]);else this.defaults[i]=e[i];return t},legend_setter:function(t){return t?("object"!=k(t)&&(t={template:t}),this.ie(t,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:-1!=this.q.type.toLowerCase().indexOf("stacked")?"":"hide",marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3}),t.template=Ft(t.template),t):(this._D&&(this._D.innerHTML="",this._D=null),!1)},item_setter:function(t){"object"!=k(t)&&(t={color:t,borderColor:t}),this.ie(t,H.extend({},this.defaults.item));return this.wD(["alpha","borderColor","color","radius","type"],t),t},line_setter:function(t){return"object"!=k(t)&&(t={color:t}),(t=H.extend(t,this.defaults.line)).color=Ft(t.color),t},padding_setter:function(t){return"object"!=k(t)&&(t={left:t,right:t,top:t,bottom:t}),this.ie(t,{left:50,right:20,top:35,bottom:40}),t},xAxis_setter:function(t){if(!t)return!1;"object"!=k(t)&&(t={template:t}),this.ie(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0});return this.wD(["lineColor","template","lines"],t),this.RC=H.extend({},t),t},yAxis_setter:function(t){this.ie(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0,bg:"#ffffff"});return this.wD(["lineColor","template","lines","bg"],t),this.GC=H.extend({},t),t},wD:function(t,i){for(var s=0;s<t.length;s++)i[t[s]]=Ft(i[t[s]])},zC:function(t,i,s,e,n){var h={container:s||this.re,name:t,title:D(n)?t:n||"",series:e,style:i||"",width:this.ze,height:this.He};return new qi(h)},aC:function(t,i,s,e,n,h){
var r,o=0;return this.q.yAxis&&(this.canvases.y||(this.canvases.y=this.zC("axis_y")),o=this.KC(this.canvases.y.getCanvas(),t,i,s,e,n)),this.q.xAxis&&(this.canvases.x||(this.canvases.x=this.zC("axis_x")),r=this.canvases.x.getCanvas(),this.callEvent("onBeforeXAxis",[r,t,i,s,h,o])&&this.cC(r,t,i,s,h,o)),o},cC:function(t,i,s,e,n,h){var r,o,a=this.q,u=s.x-.5,c=parseInt(h||e.y,10)+.5,f=e.x,l=!0,d="stackedBar"==a.type?e.y+.5:c;for(r=0;r<i.length;r++){!0===a.offset?o=u+n/2+r*n:(o=r!=i.length-1||a.cellWidth?u+r*n:e.x,l=!!r),o=Math.ceil(o)-.5;var v="auto"!=a.origin&&"bar"==a.type&&parseFloat(a.value(i[r]))<a.origin;this.cD(o,d,i[r],l,v),(a.offset||r||a.cellWidth)&&a.xAxis.lines.call(this,i[r])&&this.fD(t,o,e.y,s.y,i[r])}this.canvases.x.renderTextAt(!0,!1,u,e.y+a.padding.bottom-3,a.xAxis.title,"webix_axis_title_x",e.x-s.x),this.Kk(t,u,c,f,c,a.xAxis.color,1),a.xAxis.lines.call(this,{})&&a.offset&&this.Kk(t,f+.5,e.y,f+.5,s.y+.5,a.xAxis.lineColor.call(this,{}),1)},KC:function(t,i,s,e,n,h){var r,o={};if(this.q.yAxis){var a=s.x-.5,u=e.y,c=s.y,f=e.y+.5;if(this.q.yAxis.step&&(r=parseFloat(this.q.yAxis.step)),"undefined"==typeof this.GC.step||"undefined"==typeof this.GC.start||"undefined"==typeof this.GC.end?(n=(o=this.PC(n,h)).start,h=o.end,r=o.step,this.q.yAxis.end=h,this.q.yAxis.start=n):"logarithmic"==this.config.scale&&(this.lC=!0),this.BC(s,e),0!==r){if(h==n)return u;for(var l=(u-c)*r/(h-n),d=0,v=n;v<=h;v+=r){var _=this.lC?Math.pow(10,v):v;o.fixNum&&(_=parseFloat(_).toFixed(o.fixNum));var p=Math.floor(u-d*l)+.5;if(v==n&&"auto"==this.q.origin||!this.q.yAxis.lines.call(this,v)||this.Kk(t,a,p,e.x,p,this.q.yAxis.lineColor.call(this,v),1),v==this.q.origin&&(f=p),r<1&&!this.lC){var m=Math.min(Math.floor(this.dC(r)),n<=0?0:Math.floor(this.dC(n))),b=Math.pow(10,-m);v=_=Math.round(_*b)/b}this.canvases.y.renderText(0,p-5,this.q.yAxis.template(_.toString()),"webix_axis_item_y",s.x-5),d++}return this.Kk(t,a,u+1,a,c,this.q.yAxis.color,1),f}}},BC:function(t,i){var s=this.canvases.y.renderTextAt("middle",!1,0,parseInt((i.y-t.y)/2+t.y,10),this.q.yAxis.title,"webix_axis_title_y");s&&(s.style.left=(S.transform?(s.offsetHeight-s.offsetWidth)/2:0)+"px")},xD:function(t,i){return{start:Math.floor(this.dC(t)),step:1,end:Math.ceil(this.dC(i))}},yD:function(t){var i=Math.floor(this.dC(t)),s=Math.pow(10,i),e=t/s;return e=5<e?10:5,parseInt(e,10)*s},PC:function(t,i){if(this.lC=!1,"logarithmic"==this.q.scale){var s=Math.floor(this.dC(t)),e=Math.ceil(this.dC(i));if(0<t&&0<i&&1<e-s)return this.lC=!0,this.xD(t,i)}var n,h,r;if("auto"!=this.q.origin&&this.q.origin<t&&(t=this.q.origin),(n=this.yD((i-t)/8||1))>Math.abs(t))h=t<0?-n:0;else{var o=Math.abs(t),a=Math.floor(this.dC(o)),u=o/Math.pow(10,a);for(h=Math.ceil(10*u)/10*Math.pow(10,a)-n,1<o&&.1<n&&(h=Math.ceil(h));t<0?h<=t:t<=h;)h-=n;t<0&&(h=-h-2*n)}10<i-h&&(n=this.yD((i-h)/8||1)),r=h;for(var c=Math.floor(this.dC(n));r<i;)r+=n,r=parseFloat((1*r).toFixed(Math.abs(c)));return{start:h,end:r,step:n,fixNum:c<0?Math.abs(c):0}},oC:function(t,i){var s,e,n=this.data.jr(),h=arguments.length&&"h"==t?this.RC:this.GC;if(i=i||"value",h&&"undefined"!=typeof h.end&&"undefined"!=typeof h.start&&h.step)s=parseFloat(h.end),e=parseFloat(h.start);else if(s=Bs.max(this.fC[0][i],n),e=h&&"undefined"!=typeof h.start?parseFloat(h.start):Bs.min(this.fC[0][i],n),1<this.fC.length)for(var r=1;r<this.fC.length;r++){var o=Bs.max(this.fC[r][i],n),a=Bs.min(this.fC[r][i],n);s<o&&(s=o),a<e&&(e=a)}return{max:s,min:e}},dC:function(t){return Math.log(t)/Math.LN10},cD:function(t,i,s,e,n){if(this.q.xAxis){var h=this.canvases.x.renderTextAt(n,e,t,i-(n?2:0),this.q.xAxis.template(s));h&&(h.className+=" webix_axis_item_x")}},fD:function(t,i,s,e,n){this.q.xAxis&&this.q.xAxis.lines&&this.Kk(t,i,s,i,e,this.q.xAxis.lineColor.call(this,n),1)},Kk:function(t,i,s,e,n,h,r){t.strokeStyle=h,t.lineWidth=r,t.beginPath(),t.moveTo(i,s),t.lineTo(e,n),t.stroke(),t.lineWidth=1},uC:function(t,i){return[i!=t?i-t:t,1]},gD:[function(t){return"#FF"+Zs.toHex(t/2,2)+"00"},function(t){return"#FF"+Zs.toHex(t/2+128,2)+"00"},function(t){return"#"+Zs.toHex(255-t,2)+"FF00"},function(t){
return"#00FF"+Zs.toHex(t,2)},function(t){return"#00"+Zs.toHex(255-t,2)+"FF"},function(t){return"#"+Zs.toHex(t,2)+"00FF"}],lc:["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],fc:0,addSeries:function(t){var i=H.extend({},this.q);this.q=H.extend({},i),this.at(t,{}),this.fC.push(this.q),this.q=i},vD:function(t,i,s){var e;if(s.getAttribute("userdata")&&(this.MD=1==this.fC.length?this.SD(i):s.getAttribute("userdata"),this.fC[this.MD])){for(var n=0;n<this.fC.length;n++)(e=this.fC[n].tooltip)&&e.disable();s.getAttribute("disabled")||(e=this.fC[this.MD].tooltip)&&e.enable()}},SD:function(t){var i,s,e,n,h,r,o,a;for(s=this.Ha.Ba,n=K(this.re.ne),o=(h=Z(t)).x-n.x,a=h.y-n.y,e=0;e<s.length;e++)o<=(i=s[e].points)[2]&&o>=i[0]&&a<=i[3]&&a>=i[1]&&(r?s[e].index>r.index&&(r=s[e]):r=s[e]);return r?r.index:0},hideSeries:function(t){this.canvases[t].hideCanvas();var i=this.q.legend;i&&i.values&&i.values[t]&&(i.values[t].$hidden=!0,this.mD()),this.Ha.hide(this.re,t,!0)},showSeries:function(t){this.canvases[t].showCanvas();var i=this.q.legend;i&&i.values&&i.values[t]&&(delete i.values[t].$hidden,this.mD()),this.Ha.hide(this.re,t,!1)},mD:function(t,i){var s,e,n,h,r,o,a,u,c,f,l,d=0,v=0;if(t=t||[],i=i||this.ze,u=this.canvases.legend.getCanvas(),e=this.q.legend,a="x"!=this.q.legend.layout?"width:"+e.width+"px":"",this._D&&(this._D.innerHTML="",this._D.parentNode.removeChild(this._D)),this.canvases.legend.clearCanvas(!0),n=Y("DIV",{"class":"webix_chart_legend",style:"left:"+d+"px; top:"+v+"px;"+a},""),e.padding&&(n.style.padding=e.padding+"px"),this._D=n,this.re.appendChild(n),r=[],e.values)for(s=0;s<e.values.length;s++)r.push(this.kD(n,e.values[s].text,"undefined"!=typeof e.values[s].id?k(e.values[s].id):s,e.values[s].$hidden));else for(s=0;s<t.length;s++)r.push(this.kD(n,e.template(t[s]),t[s].id));for(0===n.offsetWidth&&(n.style.width="auto"),o=n.offsetWidth,h=n.offsetHeight,o<i&&("x"==e.layout&&"center"==e.align&&(d=(i-o)/2),"right"==e.align&&(d=i-o),e.margin&&"center"!=e.align&&(d+=("left"==e.align?1:-1)*e.margin)),h<this.He&&("middle"==e.valign&&"center"!=e.align&&"x"!=e.layout?v=(this.He-h)/2:"bottom"==e.valign&&(v=this.He-h),e.margin&&"middle"!=e.valign&&(v+=("top"==e.valign?1:-1)*e.margin)),n.style.left=d+"px",n.style.top=v+"px",u.save(),s=0;s<r.length;s++)l=r[s],c=e.values&&e.values[s].$hidden?(f=!0,e.values[s].disableColor?e.values[s].disableColor:"#edeff0"):(f=!1,e.values?e.values[s].color:this.q.color.call(this,t[s])),this.CD(u,l.offsetLeft+d,l.offsetTop+v,c,l.offsetHeight,f,s);u.restore(),r=null},kD:function(t,i,s,e){var n="";"x"==this.q.legend.layout&&(n="float:left;");var h=Y("DIV",{style:n+"padding-left:"+(10+this.q.legend.marker.width)+"px","class":"webix_chart_legend_item"+(e?" hidden":""),role:"button",tabindex:"0","aria-label":ct.aria[(e?"show":"hide")+"Chart"]+" "+i},i);return 2<arguments.length&&h.setAttribute("series_id",s),t.appendChild(h),h},CD:function(t,i,s,e,n,h,r){var o=[],a=this.q.legend.marker,u=this.q.legend.values,c=u&&u[r].markerType?u[r].markerType:a.type;if(e&&(t.strokeStyle=t.fillStyle=e),"round"!=c&&a.radius)if("item"==c){if(this.q.line&&"scatter"!=this.q.type&&!this.q.disableLines){t.beginPath(),t.lineWidth=this.fC[r].line.width,t.strokeStyle=h?e:this.fC[r].line.color.call(this,{});var f=i+5,l=s+n/2;t.moveTo(f,l);var d=f+a.width;t.lineTo(d,l),t.stroke()}var v=this.fC[r].item,_=parseInt(v.radius.call(this,{}),10)||0,p=v.type.call(this,{});_&&(t.beginPath(),h?(t.lineWidth=v.borderWidth,t.strokeStyle=e,t.fillStyle=e):(t.lineWidth=v.borderWidth,t.fillStyle=v.color.call(this,{}),t.strokeStyle=v.borderColor.call(this,{}),t.globalAlpha=v.alpha.call(this,{})),t.beginPath(),i+=a.width/2+5,s+=n/2,this.kC(t,i,s,_+1,p),t.fill(),t.stroke()),t.globalAlpha=1}else t.beginPath(),t.lineWidth=1,i+=5,s+=n/2-a.height/2,o=[[i+a.radius,s+a.radius,a.radius,Math.PI,3*Math.PI/2,!1],[i+a.width-a.radius,s],[i+a.width-a.radius,s+a.radius,a.radius,-Math.PI/2,0,!1],[i+a.width,s+a.height-a.radius],[i+a.width-a.radius,
s+a.height-a.radius,a.radius,0,Math.PI/2,!1],[i+a.radius,s+a.height],[i+a.radius,s+a.height-a.radius,a.radius,Math.PI/2,Math.PI,!1],[i,s+a.radius]],this.CC(t,o),t.stroke(),t.fill();else{t.beginPath(),t.lineWidth=a.height,t.lineCap=a.type,i+=t.lineWidth/2+5,s+=n/2,t.moveTo(i,s);var m=i+a.width-a.height+1;t.lineTo(m,s),t.stroke(),t.fill()}},hD:function(t,i){var s,e,n,h;if(s=this.q.padding.left,e=this.q.padding.top,n=t-this.q.padding.right,h=i-this.q.padding.bottom,this.q.legend){var r=this.q.legend,o=this.q.legend.width,a=this.q.legend.height;"x"==r.layout?"center"==r.valign?"right"==r.align?n-=o:"left"==r.align&&(s+=o):"bottom"==r.valign?h-=a:e+=a:"right"==r.align?n-=o:"left"==r.align&&(s+=o)}return{start:{x:s,y:e},end:{x:n,y:h}}},DC:function(t){var i,s,e,n,h;if(this.q.yAxis&&"undefined"!=typeof this.q.yAxis.end&&"undefined"!=typeof this.q.yAxis.start&&this.q.yAxis.step)e=parseFloat(this.q.yAxis.end),n=parseFloat(this.q.yAxis.start);else{for(i=0;i<t.length;i++)for(t[i].$sum=0,t[i].$min=Infinity,s=0;s<this.fC.length;s++)h=Math.abs(parseFloat(this.fC[s].value(t[i])||0)),isNaN(h)||(-1!=this.fC[s].type.toLowerCase().indexOf("stacked")&&(t[i].$sum+=h),h<t[i].$min&&(t[i].$min=h));for(e=-Infinity,n=Infinity,i=0;i<t.length;i++)t[i].$sum>e&&(e=t[i].$sum),t[i].$min<n&&(n=t[i].$min);0<n&&(n=0)}return{max:e,min:n}},gC:function(t,i,s,e,n,h,r,o){var a,u,c,f,l,d;return"light"==h?(a="x"==o?t.createLinearGradient(i,s,e,s):t.createLinearGradient(i,s,i,n),d=[[0,"#FFFFFF"],[.9,r],[1,r]],u=2):"falling"==h||"rising"==h?(a="x"==o?t.createLinearGradient(i,s,e,s):t.createLinearGradient(i,s,i,n),c=Zs.toRgb(r),(f=Zs.rgbToHsv(c[0],c[1],c[2]))[1]*=.5,l="rgb("+Zs.hsvToRgb(f[0],f[1],f[2])+")","falling"==h?d=[[0,l],[.7,r],[1,r]]:"rising"==h&&(d=[[0,r],[.3,r],[1,l]]),u=0):(t.globalAlpha=.37,u=0,a="x"==o?t.createLinearGradient(i,n,i,s):t.createLinearGradient(i,s,e,s),d=[[0,"#9d9d9d"],[.3,"#e8e8e8"],[.45,"#ffffff"],[.55,"#ffffff"],[.7,"#e8e8e8"],[1,"#9d9d9d"]]),this.DD(a,d),{gradient:a,offset:u}},nC:function(t,i,s,e){return t*=-1,{x:i+=Math.cos(t)*e,y:s-=Math.sin(t)*e}},DD:function(t,i){for(var s=0;s<i.length;s++)t.addColorStop(i[s][0],i[s][1])},CC:function(t,i){var s,e;for(s=0;s<i.length;s++)e=s?"lineTo":"moveTo",2<i[s].length&&(e="arc"),t[e].apply(t,i[s])},$D:function(t,i,s,e,n){t.addRect(i,[s[0].x-e.x,s[0].y-e.y,s[1].x-e.x,s[1].y-e.y],n)}},lo={api:fo,view:H.protoUI(fo,Zr,Qr,to,io,so,eo,{$render_spline:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b;if(c=this.wC(t,i,s,e,n),r=this.q,this.MC=s,a=[],i.length){for(d=r.offset?s.x+.5*c.cellWidth:s.x,o=0;o<i.length;o++)((p=this.xC(i[o],s,e,c))||"0"==p)&&(l=o?c.cellWidth*o-.5+d:d,a.push({x:l,y:p,v:this.q.value(i[o]),index:o}));for(f=this.sD(a),o=0;o<a.length;o++){if(v=a[o].x,m=a[o].y,o<a.length-1){for(_=a[o+1].x,b=a[o+1].y,u=v;u<_;u++){var g=this.eD(u,v,o,f.a,f.b,f.c,f.d);g<s.y&&(g=s.y),g>e.y&&(g=e.y);var w=this.eD(u+1,v,o,f.a,f.b,f.c,f.d);w<s.y&&(w=s.y),w>e.y&&(w=e.y),this.Kk(t,u,g,u+1,w,r.line.color(i[o]),r.line.width)}this.Kk(t,_-1,this.eD(u,v,o,f.a,f.b,f.c,f.d),_,b,r.line.color(i[o]),r.line.width)}this.SC(t,v,m,i[a[o].index],r.label(i[a[o].index]),n,h)}}},sD:function(t){var i,s,e,n,h,r,o,a,u=[],c=[],f=t.length;for(h=0;h<f-1;h++)u[h]=t[h+1].x-t[h].x,c[h]=(t[h+1].y-t[h].y)/u[h];for(a=[],(o=[])[0]=0,o[1]=2*(u[0]+u[1]),a[0]=0,a[1]=6*(c[1]-c[0]),h=2;h<f-1;h++)o[h]=2*(u[h-1]+u[h])-u[h-1]*u[h-1]/o[h-1],a[h]=6*(c[h]-c[h-1])-u[h-1]*a[h-1]/o[h-1];for((r=[])[f-1]=r[0]=0,h=f-2;1<=h;h--)r[h]=(a[h]-u[h]*r[h+1])/o[h];for(i=[],s=[],e=[],n=[],h=0;h<f-1;h++)i[h]=t[h].y,s[h]=-u[h]*r[h+1]/6-u[h]*r[h]/3+(t[h+1].y-t[h].y)/u[h],e[h]=r[h]/2,n[h]=(r[h+1]-r[h])/(6*u[h]);for(h=0;h<t.length-1;h++)0===t[h].v&&0===t[h+1].v&&(i[h]=t[h].y,n[h]=e[h]=s[h]=0);return{a:i,b:s,c:e,d:n}},eD:function(t,i,s,e,n,h,r){return e[s]+(t-i)*(n[s]+(t-i)*(h[s]+(t-i)*r[s]))}},no,ho,ro,{presets:{simple:{item:{borderColor:"#ffffff",color:"#2b7100",shadow:!1,borderWidth:2},line:{color:"#8ecf03",width:2}},plot:{color:"#8664C6",item:{borderColor:"#8664C6",borderWidth:1,color:"#ffffff",type:"r",shadow:!1},line:{color:"#8664C6",width:2}},diamond:{
color:"#FF5C4C",item:{borderColor:"#FF5C4C",color:"#FF5C4C",type:"d",radius:3,shadow:!0},line:{color:"#FF5C4C",width:2}},point:{color:"#1ca1c1",disableLines:!0,fill:!1,disableItems:!1,item:{color:"#1ca1c1",borderColor:"#1ca1c1",radius:2,borderWidth:2,type:"r"},alpha:1},line:{line:{color:"#1ca1c1",width:2},item:{color:"#ffffff",borderColor:"#1ca1c1",radius:2,borderWidth:2,type:"d"},fill:!1,disableItems:!1,disableLines:!1,alpha:1},area:{fill:"#1ca1c1",line:{color:"#1ca1c1",width:1},disableItems:!0,alpha:.2,disableLines:!1},round:{item:{radius:3,borderColor:"#1ca1c1",borderWidth:1,color:"#1ca1c1",type:"r",shadow:!1,alpha:.6}},square:{item:{radius:3,borderColor:"#00a497",borderWidth:2,color:"#ffffff",type:"s",shadow:!1,alpha:1},line:{color:"#00a497"}},column:{color:"RAINBOW",gradient:!1,barWidth:45,radius:0,alpha:1,border:!0},stick:{barWidth:5,gradient:!1,color:"#1ca1c1",radius:2,alpha:1,border:!1},alpha:{color:"#b9a8f9",barWidth:70,gradient:"falling",radius:0,alpha:.5,border:!0}}},oo,ao,Ps,Ki,Cs,Us,g,Gi.view)},vo={name:"rangechart",$init:function(){this.attachEvent("onAfterRender",this.AD),this.FD()},AD:function(){-1===this.q.type.indexOf("pie")&&"radar"!==this.q.type&&this.q.type,this.Ha.Ba.length&&!this.TD?(this.zD(),this.VD=(this.Ha.Ba[0].points[2]-this.Ha.Ba[0].points[0])/2,this.HD=Y("div",{"class":"webix_chart_resizer right",tabindex:"0",role:"button","aria-label":ct.aria.resizeChart}),this.BD=Y("div",{"class":"webix_chart_resizer left",tabindex:"0",role:"button","aria-label":ct.aria.resizeChart}),this.TD=Y("div",{"class":"webix_chart_frame"}),this.nt.appendChild(this.BD),this.nt.appendChild(this.TD),this.nt.appendChild(this.HD),this.RD(),Lt(this.HD,S.mouse.down,this.PD,{bind:this}),Lt(this.BD,S.mouse.down,this.PD,{bind:this}),Lt(this.TD,S.mouse.down,this.PD,{bind:this}),Lt(A(this.HD),"keydown",this.jD,{bind:this}),Lt(A(this.BD),"keydown",this.jD,{bind:this}),this.ik&&(this.q.range=this.FD(this.ik)),this.ND(),this.callEvent("onAfterRangeChange",[this.ik]),this.data.attachEvent("onStoreUpdated",C(this.ND,this))):this.RD(!0)},$setSize:function(t,i){lo.api.$setSize.call(this,t,i)&&(this.zD(),this.ND())},RD:function(t){this.HD&&!this.ED&&(this.ED=this.HD.clientWidth/2,t&&this.ND())},zD:function(){var t=this.hD(this.ze,this.He);this.MC=t.start,this.LD=t.end},removeAllSeries:function(){this.TD=this.HD=this.BD=null,lo.api.removeAllSeries.apply(this,arguments)},jD:function(t){var i=t.which||t.keyCode;if(37===i||39===i){Q(t);var s=-1!==t.target.className.indexOf("right")?"eindex":"sindex",e=-1!==t.target.className.indexOf("right")?"end":"start",n=this.ik;n[s]=n[s]+(37===i?-1:1),this.Ha.Ba[n[s]]&&(n[e]=this.OD(n[s]),this.setFrameRange(n))}},PD:function(t){if(-1!==t.target.className.indexOf("webix_chart_resizer"))this.UD=t.target;else if(this.Ha.Ba.length){var i=this.Ha.Ba[this.ik.sindex].points[2]-this.VD,s=this.Ha.Ba[this.ik.eindex].points[2]-this.VD;this.YD={ex:Z(t).x,fx:i+this.MC.x,fw:s-i}}st(this.nt,"webix_noselect webix_wresize_cursor"),this.WD(),this.GD=Ot(document.body,S.mouse.move,this.XD,{bind:this}),this.JD=Ot(document.body,S.mouse.up,this.KD,{bind:this})},WD:function(){M.D[this.GD]&&(Ut(this.GD),Ut(this.JD))},XD:function(t){if(this.UD){var i=Z(t).x-K(this.$view).x;i>=this.MC.x&&i<=this.LD.x&&(-1!==this.UD.className.indexOf("left")?i<this.HD.offsetLeft&&(this.UD.style.left=i-this.ED+"px",this.TD.style.left=i+"px",this.TD.style.width=this.HD.offsetLeft-this.BD.offsetLeft-1+"px"):i>this.BD.offsetLeft+this.ED&&(this.UD.style.left=i-this.ED+"px",this.TD.style.width=this.HD.offsetLeft-this.BD.offsetLeft-1+"px"))}else if(this.YD){var s=Z(t).x-this.YD.ex,e=this.YD.fx+s,n=e+this.YD.fw;this.MC.x<=e&&this.LD.x>=n&&(H.extend(this.YD,{lx:e,rx:n},!0),this.BD.style.left=e-this.ED+"px",this.HD.style.left=n-this.ED+"px",this.TD.style.left=e+"px")}},KD:function(t){if(this.WD(),et(this.nt,"webix_noselect"),et(this.nt,"webix_wresize_cursor"),this.count()){if(this.UD){var i=S.touch?t.changedTouches[0].pageX:Z(t).x;i-=K(this.$view).x+this.MC.x;var s=this.qD(i),e=this.OD(s);this.UD===this.BD?(s>=this.ik.eindex&&(s=this.ik.eindex,e=this.OD(s
)),this.ik.start=e,this.ik.sindex=s):(s<=this.ik.sindex&&(s=this.ik.sindex,e=this.OD(s)),this.ik.end=e,this.ik.eindex=s),this.UD=null}else if(this.YD&&this.YD.lx){var n=this.ik.sindex=this.qD(this.YD.lx-this.MC.x),h=this.ik.eindex=this.qD(this.YD.rx-this.MC.x);this.ik.start=this.OD(n),this.ik.end=this.OD(h),this.YD=null}this.ND(),this.callEvent("onAfterRangeChange",[this.ik.start,this.ik.end])}},OD:function(t){return t>=this.data.order.length&&(t=this.data.order.length-1),this.getItem(this.data.order[t])[this.q.frameId||"id"]},qD:function(t){for(var i=this.Ha.Ba,s=0;s<i.length;s++)if(t<=i[s].points[2]-this.VD)return s;return i.length-1},ZD:function(t){for(var i=this.q.frameId||"id",s=0;s<this.data.order.length;s++)if(this.getItem(this.data.order[s])[i]==t)return s;return-1},FD:function(t){t?(t.start&&(t.sindex=this.ZD(t.start)),t.end&&(t.eindex=this.ZD(t.end)),t.start=t.start||this.OD(t.sindex),t.end=t.end||this.OD(t.eindex)):t={start:0,end:0,sindex:0,eindex:0},this.ik=t},range_setter:function(t){return this.FD(t),this.ik},getFrameData:function(){for(var t=[],i=this.ik.sindex;i<=this.ik.eindex;i++){var s=this.getItem(this.data.order[i]);s&&t.push(s)}return t},setFrameRange:function(t){this.FD(t),this.ND(),this.callEvent("onAfterRangeChange",[t])},ND:function(){if(this.Ha){var t=this.Ha.Ba;if(t.length){var i=t[this.ik.sindex].points[0]+this.MC.x+this.VD-1,s=t[this.ik.eindex].points[0]+this.MC.x+this.VD-1;this.BD.style.left=i-this.ED+"px",this.HD.style.left=s-this.ED+"px",this.TD.style.left=i+"px",this.TD.style.width=s-i+"px",this.q.range=this.ik}}},getFrameRange:function(){return this.q.range}},_o=(H.protoUI(vo,lo.view),{name:"grouplist",defaults:{animate:{}},Pm:"webix_grouplist",$init:function(){H.extend(this.data,Me,!0),this.data.count=function(){return this.order.length},this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",C(this.QD,this)),this.QD()},QD:function(){this.t$=[],this.i$=[]},$setSize:function(){Gi.api.$setSize.apply(this,arguments)&&(this.bt.style.width=this.ze)},on_click:{webix_list_item:function(t,i){if(this.Pv)return!1;for(var s=0;s<this.i$.length;s++)if(this.i$[s]==i){for(var e=s;e<this.i$.length;e++)this.data.getItem(this.i$[e]).$template="";return s?(this.t$=this.data.branch[this.i$[s-1]],this.i$.splice(s)):(this.t$=this.data.branch[0],this.i$=[]),this.s$=!1,this.render()}var n=this.getItem(i);if(n.$count)return this.s$=!0,this.i$.push(i),n.$template="Back",this.t$=this.data.branch[n.id],this.render();this.q.select&&(this.Nm=!0,"multiselect"==this.q.select||this.q.multiselect?this.select(i,!1,"touch"==this.q.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i),this.Nm=!1)}},getOpenState:function(){return{parents:this.i$,branch:this.t$}},render:function(){var t,i;if(this.i$=B(this.i$),this.t$=B(this.t$),this.i$.length)for(t=0;t<this.i$.length;t++)this.data.branch[this.i$[t]]||(this.i$.splice(t,1),t--);if(i=this.i$.length?this.i$[this.i$.length-1]:0,this.t$=B(this.data.branch[i]),!this.t$.length&&this.i$.length&&(this.t$=[i],this.i$.pop()),this.Pv)return $(this.render,this,arguments,100);for(t=0;t<this.t$.length;t++)this.data.getItem(this.t$[t]).$template="";if(this.t$.length||(this.t$=this.data.branch[0]),this.data.order=p([].concat(this.i$).concat(this.t$)),this.callEvent("onBeforeRender",[this.data])){if(!this.Nm&&this.bt.innerHTML&&Zi.isSupported()&&this.q.animate&&this.e$!=this.i$.length){if(this.callEvent("onBeforeRender",[this.data])){this.n$||(this.n$=[]);var s=this.bt.cloneNode(!1);s.innerHTML=this.data.getRange().map(this.Lt,this).join("");var e=H.extend({},this.q.animate);e.direction=this.s$?"left":"right";var n=[f(e),f(e)];if(this.s$)this.n$.push(this.getScrollState()),Mi&&Mi.$active&&(n[0].y=0,n[1].y=-this.getScrollState().y);else{var h=this.n$.pop();Mi&&Mi.$active&&(n[0].y=-h.y,n[1].y=-this.getScrollState().y)}var r=Zi.formLine(s,this.bt,e);Mi&&Mi.$active&&Mi.Ci(s,0,this.s$?0:n[0].y,"0ms"),e.master=this,e.callback=function(){this.bt=s,this.s$?Mi&&Mi.$active||this.scrollTo(0,0):Mi&&Mi.$active?$(function(){Mi.Ci(s,0,n[0].y,"0ms")},this):h&&this.scrollTo(0,h.y),
Zi.breakLine(r),e.master=e.callback=null,this.ne=null,this.Pv=!1,this.callEvent("onAfterRender",[])},this.Pv=!0,Zi(r,n)}}else Js.render.apply(this,arguments);this.e$=this.i$.length}},templateBack_setter:function(t){this.type.templateBack=Ft(t)},templateItem_setter:function(t){this.type.templateItem=Ft(t)},templateGroup_setter:function(t){this.type.templateGroup=Ft(t)},type:{template:function(t,i){return t.$count?i.templateGroup(t,i):i.templateItem(t,i)},css:"group",classname:function(t,i,s){return"webix_list_item webix_"+(t.$count?"group":"item")+(t.$template?"_back":"")+(s&&s.webix_selected?" webix_selected ":"")+(t.$css?t.$css:"")},templateStart:Ft('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()};  overflow:hidden;" {common.aria()}>'),templateBack:Ft("#value#"),templateItem:Ft("#value#"),templateGroup:Ft("#value#"),templateEnd:function(t){var i="";return t.$count&&(i+="<div class='webix_arrow_icon'></div>"),i+="</div>"}},showItem:function(t){var i,s;for(t&&(s=(i=this.getItem(t)).$parent,i.$count&&(s=i.id)),this.t$=this.data.branch[s||0],this.i$=[];s;)this.getItem(s).$template="Back",this.i$.unshift(s),s=this.getItem(s).$parent;this.Nm=!0,this.render(),this.Nm=!1,Js.showItem.call(this,t)}});Tt(H.protoUI(_o,Ps,Zh.view),{});var po={name:"unitlist",za:"webix_item_id",uniteBy_setter:Ft,render:function(t,i,s){var e=this.q;if(this.isVisible(e.id)&&e.uniteBy){if(t){var n=this.getItemNode(t);if(n&&"update"==s&&this.q.uniteBy.call(this,i)==this.getItem(t).$unitValue)return X(this.ne[t]=this.Pu(i),n),void G(n)}this.callEvent("onBeforeRender",[this.data])&&(this.units=null,this.h$(),this.units&&(this.bt.innerHTML=this.r$().map(this.Lt,this).join(""),this.ne=null),this.callEvent("onAfterRender",[]))}},getUnits:function(){var t=[];if(this.units)for(var i in this.units)t.push(i);return t},getUnitList:function(t){return this.units?this.units[t]:null},Lt:function(t){var i=this.data.fr[t.id];return!t.$template||this.type["template"+t.$template],t.$template,this.callEvent("onItemRender",[t]),t.$unit?this.type.templateStartHeader(t,this.type)+this.type.templateHeader.call(this,t.$unit)+this.type.templateEnd(t,this.type):this.type.templateStart(t,this.type,i)+(t.$template?this.type["template"+t.$template]:this.type.template)(t,this.type)+this.type.templateEnd(t,this.type)},r$:function(){var t,i,s,e;t=[];var n=this.data.$min||0,h=this.data.$max||Infinity,r=0;for(s in this.units)for(t.push({$unit:s}),e=this.units[s],i=0;i<e.length;i++){if(r==n&&(t=[{$unit:s}]),t.push(this.getItem(e[i])),r==h)return p(t);r++}return p(t)},h$:function(){var s=this;this.units={},this.data.each(function(t){var i=s.q.uniteBy.call(this,t);t.$unitValue=i,s.units[i]||(s.units[i]=[]),s.units[i].push(t.id)})},type:{headerHeight:20,templateHeader:function(t){return"<span class='webix_unit_header_inner'>"+t+"</span>"},templateStart:function(t,i,s){if(t.$unit)return i.templateStartHeader.apply(this,arguments);var e="webix_list_item webix_list_"+i.css+"_item"+(s&&s.webix_selected?" webix_selected":"")+(t.$css?t.$css:""),n="width:"+i.widthSize(t,i,s)+"; height:"+i.heightSize(t,i,s)+"; overflow:hidden;"+(i.layout&&"x"==i.layout?"float:left;":"");return'<div webix_item_id="'+t.id+'" class="'+e+'" style="'+n+'" '+i.aria(t,i,s)+">"},templateStartHeader:function(t,i,s){var e="webix_unit_header webix_unit_"+i.css+"_header"+(t.$selected?"_selected":""),n="width:"+i.widthSize(t,i,s)+"; height:"+i.headerHeight+"px; overflow:hidden;";return'<div webix_unit_id="'+t.$unit+'" class="'+e+'" style="'+n+'">'}},$skin:function(){this.type.headerHeight=Qi.unitHeaderHeight}};H.protoUI(po,Zh.view);ct.dbllist={selectAll:"<span class='webix_icon wxi-angle-double-right'></span>",selectOne:"<span class='webix_icon wxi-angle-right'></span>",deselectAll:"<span class='webix_icon wxi-angle-double-left'></span>",deselectOne:"<span class='webix_icon wxi-angle-left'></span>"};var mo={name:"dbllist",defaults:{borderless:!0},$init:function(){this.o$={},this.a$=C(function(t){return this.o$[t.id]},this),this.u$=C(function(t){
return!this.o$[t.id]},this),this.$view.className+=" webix_dbllist",this.$ready.unshift(this.Yb)},$onLoad:function(t,i){return this.c$(function(){this.$$("left").data.driver=i,this.$$("left").parse(t),this.$$("right").data.driver=i,this.$$("right").parse(t)}),this.tk(),!0},f$:function(){if(!1===this.q.buttons)return{width:10};var t=ct.dbllist,i=[this.l$("deselect_all",t.deselectAll),this.l$("select_all",t.selectAll),this.l$("deselect_one",t.deselectOne),this.l$("select_one",t.selectOne)];return i={width:120,template:i.join(""),onClick:{dbllist_button:function(t,i,s){this.getTopParentView().d$(s.getAttribute("action"))}}},this.q.buttons&&(i.template=this.q.buttons),i},l$:function(t,i){return"<button class='dbllist_button' action='"+t+"'>"+i+"</button>"},v$:function(t,i,s,e){var n={view:"list",select:"multiselect",multiselect:"touch",id:t,action:i,drag:!0,type:{margin:3,id:t},on:{onBeforeDrop:function(t){var i=t.from,s=t.to,e=i.getTopParentView();if(e===this.getTopParentView()){var n="select_one"!=s.q.action;e.select(t.source,n)}return!1},onItemDblClick:function(){return this.getTopParentView().d$(this.config.action)}}};return this.q.list&&H.extend(n,this.q.list,!0),s&&(n={rows:[{view:"label",label:s,css:"webix_inp_top_label"},n]}),e?{rows:[n,{view:"label",height:20,label:e,css:"bottom_label"}]}:n},Yb:function(){var t=[{margin:10,type:"clean",cols:[this.v$("left","select_one",this.q.labelLeft,this.q.labelBottomLeft),this.f$(),this.v$("right","deselect_one",this.q.labelRight,this.q.labelBottomRight)]}];this.cols_setter(t)},d$:function(t){var i=null,s=!1;"select_all"===t?(i=this.$$("left").data.order,s=!0):"select_one"===t?(i=this.$$("left").getSelectedId(!0),s=!0):"deselect_all"===t?(i=this.$$("right").data.order,s=!1):"deselect_one"===t&&(i=this.$$("right").getSelectedId(!0),s=!1),this.select(i,s)},select:function(t,i){var s;if("object"!==k(t)&&(t=[t]),i)for(s=0;s<t.length;s++)this.o$[t[s]]=!0;else for(s=0;s<t.length;s++)delete this.o$[t[s]];this.tk(),this.callEvent("onChange",[])},c$:function(t,i){Ai(C(t,this),!1),i&&(this.$$("left").q.autoheight||this.$$("right").q.autoheight)&&this.resize()},tk:function(){var t=this.$$("left"),i=this.$$("right");t&&this.c$(function(){t.filter(this.u$),i.filter(this.a$)},!0)},focus:function(){if(!Vi.canFocus(this))return!1;Vi.setFocus(this)},value_setter:function(t){this.setValue(t)},setValue:function(t){this.o$={},"object"!==k(t)&&(t=t.toString().split(","));for(var i=0;i<t.length;i++)this.o$[t[i]]=!0;this.tk()},getValue:function(){var t=[];for(var i in this.o$)t.push(i);return t.join(",")}},bo=(H.protoUI(mo,vi,Es,An.view),{name:"tree",defaults:{scroll:"a",navigation:!0},$init:function(){this.nt.className+=" webix_tree",H.extend(this.data,Me,!0),H.extend(this.on_click,be),this.attachEvent("onAfterRender",this.Lu),this.attachEvent("onPartialRender",this.Lu),this.data.provideApi(this,!0),this.nt.setAttribute("role","tree")},za:"webix_tm_id",on_context:{},on_dblclick:{webix_tree_checkbox:function(){if(this.on_click.webix_tree_checkbox)return this.on_click.webix_tree_checkbox.apply(this,arguments)}},$fixEditor:function(t){var i=this.getItemNode(t.id).querySelector("span");if(i){""===i.innerHTML&&(i.innerHTML="&nbsp;");var s=i.offsetLeft;t.node.style.width=this.$view.scrollWidth-s-10+"px",t.node.style.marginLeft=s+"px",t.node.style.left="0px"}},on_click:{webix_tree_item:function(t,i){this.q.activeTitle&&(this.getItem(i).open?this.close(i):this.open(i));if(this.q.select)if("multiselect"==this.q.select||this.q.multiselect){var s=t.ctrlKey||t.metaKey||"touch"==this.q.multiselect;if("level"==this.q.multiselect&&(s||t.shiftKey)){var e=this.getSelectedId(!0)[0];if(e&&this.getParentId(i)!=this.getParentId(e))return}this.select(i,!1,s,t.shiftKey)}else this.select(i)}},Ln:{insert:function(t){var i=this.getSelectedId()||"0";this.add({value:t},null,i)},modify:function(t){for(var i=this.getSelectedId(!0),s=0;s<i.length;s++)this.getItem(i[s]).value=t,this.refresh(i[s])},custom:function(){}},yo:!0,$dragHTML:function(t){return"<div class='borderless'>"+this.type.template(t,this.type)+"</div>"},
type:H.extend({template:function(t,i){return(i["template"+t.level]||i.templateCommon).apply(this,arguments)},classname:function(t,i,s){var e="webix_tree_item";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.$css&&(e+=" "+s.$css),e},aria:function(t,i,s){return'role="treeitem"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count?'aria-expanded="'+(t.open?"true":"false")+'"':"")+'aria-level="'+t.$level+'"'},templateCommon:Ft("{common.icon()} {common.folder()} <span>#value#</span>"),templateStart:Ft('<div webix_tm_id="#id#" class="{common.classname()}" {common.aria()}>'),templateEnd:Ft("</div>"),templateCopy:Ft("#value#")},ke)}),go=H.protoUI(bo,ye,Ki,Ps,me,$s,we,qs,Ls,Us,Ks,ge,Kh.view,xe,_s,g),wo={api:bo,view:go};Tt(go,{name:"lineTree",css:"webixLineTree",icon:function(t,i){for(var s="",e="",n=1;n<=t.$level;n++){n==t.$level&&(e=t.$count?t.open?"webix_tree_open ":"webix_tree_close ":"webix_tree_none ");var h=i._$(t,i,n);h&&(s+="<div class='"+e+"webix_tree_img webix_tree_"+h+"'></div>")}return s},_$:function(t,i,s){var e=i.Bc,n=xe.Xe;if(0===e&&n){var h=t.$level,r=t.id;for(e=[];h;){var o=n.getParentId(r),a=n.data.branch[o];a[a.length-1]==r&&(e[h]=!0),r=o,h--}i.Bc=e}if(!e)return 0;if(s!=t.$level)return e[s]?"blank":"line1";var u=3;return t.$parent||0===t.$index&&(u=4),e[t.$level]&&(u=2),t.$count?t.open?"minus"+u:"plus"+u:"line"+u}});var xo={name:"treemap",defaults:{activeItem:!1,subRender:!0,header:!0,headerHeight:35,value:Ft("#value#"),headerTemplate:"",navigation:!0},value_setter:Ft,headerTemplate_setter:Ft,header_setter:function(t){return t&&!0!==t&&(this.type.header=t),t},$init:function(){this.$view.className+=" webix_treemap",this.nt.setAttribute("role","tree"),this.p$=document.createElement("DIV"),H.extend(this.data,Me,!0),this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",C(function(){this.es="",this.$values={},this.$xy={}},this)),this.attachEvent("onKeyPress",this.je)},zc:function(t){var i=this.data.fr[t.id];this.callEvent("onItemRender",[t]);var s=t.$template?this.type["template"+t.$template].call(this,t,this.type,i):this.type.template.call(this,t,this.type,i);return this.type.templateStart.call(this,t,this.type,i)+s+this.type.templateEnd.call(this)},m$:function(t){var i=this.getItem(t),s=this.q.headerHeight,e="<div class='webix_treemap_header' style='height:"+s+"px;line-height:"+s+"px;'>";return e+=this.type.header.call(this,i,this.type),e+="</div>"},Ek:function(t){var i,s,e,n,h=[];if(!this.$width||!this.count())return this.es="",!1;if(t||(t=this.config.branch||0,this.es="",this.$values={},this.$xy={},this.$xy[t]={width:this.$width,height:this.$height,top:0,left:0},t&&this.q.header&&(this.$xy[t].height-=this.q.headerHeight,this.$xy[t].top=this.q.headerHeight,this.es+=this.m$(t)),n=0,this.data.each(function(t){var i=this.getParentId(t.id);if(!this.data.branch[t.id]&&(e=1*this.config.value.call(this,t),!isNaN(e)&&e))for(this.$values[t.id]=e,n+=e;i;)this.$values[i]||(this.$values[i]=0),this.$values[i]+=e,i=this.getParentId(i)},this,!1,t)),this.data.eachChild(t,function(t){this.$values[t.id]&&h.push(B(t))},this),n=n||this.$values[t],h.length&&n){(s={top:(i=this.$xy[t]).top,left:i.left,dx:i.width,dy:i.height,set:[],sum:0}).dim=Math.min(s.dx,s.dy);for(var r=s.dx*s.dy/n,o=0;o<h.length;o++)h[o].$value=this.$values[h[o].id]*r;h.sort(function(t,i){return t.$value>i.$value?-1:1});for(var a=Infinity,u=0;h[u];){var c=this.b$(s,h[u]);if(c<a)s.sum+=h[u].$value,s.set.push(h[u]),a=c,u++;else{this.g$(s);var f={top:s.top,left:s.left,dx:s.dx,dy:s.dy,set:[],sum:0},l=s.sum/s.dim;s.dx>s.dy?(f.left+=l,f.dx-=l):(f.top+=l,f.dy-=l),(s=f).dim=Math.min(s.dx,s.dy),a=Infinity}}}s&&this.g$(s)},g$:function(t){var i,s,e,n,h=t.top,r=t.left;for(t.mode=t.dy<t.dx,t.contra=t.sum/t.dim,i=0;i<t.set.length;i++)s=t.set[i].id,n=t.mode?(e=t.contra,t.set[i].$value/t.contra):(e=t.set[i].$value/t.contra,t.contra),this.$xy[s]={},this.$xy[s].top=h,this.$xy[s].left=r,t.mode?h+=n:r+=e,this.$xy[s].width=e,this.$xy[s].height=n,this.es+=this.zc(this.getItem(s)),
this.q.subRender&&this.data.branch[s]&&this.Ek(s)},b$:function(t,i){var s=t.sum+i.$value,e=s*s/(t.dim*t.dim*i.$value);return t.set.length&&(e=Math.max(t.dim*t.dim*t.set[0].$value/(s*s),e)),1<e?e:1/e},Pu:function(t){return this.p$.innerHTML=this.zc(t),this.p$.firstChild},showBranch:function(t){this.q.branch=t,this.refresh()},render:function(t,i,s){if(this.isVisible(this.q.id)&&!this.$blockRender){if("update"==s){var e=this.getItemNode(t);if(e)X(this.ne[t]=this.Pu(i),e),G(e)}else!this.data.branch||this.q.branch&&!this.data.branch[this.q.branch]||(this.ne=null,this.callEvent("onBeforeRender",[]),this.Ek(),this.bt.innerHTML=this.es,this.callEvent("onAfterRender",[]));return!0}},za:"webix_dm_id",on_click:{webix_treemap_item:function(t,i){this.q.select&&("multiselect"==this.q.select||this.q.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.q.multiselect,t.shiftKey):this.select(i)),this.q.activeItem&&this.isBranch(i)&&this.showBranch(i)},webix_treemap_header_item:function(t){var i=J(t,"webix_dm_header_id");this.define("branch",i),this.refresh()},webix_treemap_reset:function(){this.define("branch",0),this.refresh()}},on_dblclick:{},on_mouse_move:{},w$:function(t){var i="";for(var s in t)i+=s+":"+t[s]+";";return i},type:{template:Ft("#value#"),header:function(t,i){for(var s=t.id,e="<div role='button' tabindex='0' aria-label='"+ct.aria.resetTreeMap+"' class='webix_treemap_reset'></div>",n=[];s;)t=this.getItem(s),n.push(i.headerItem.call(this,t,i)),s=this.getParentId(s);return n.reverse(),e+n.join("<span class='webix_icon wxi-angle-right webix_treemap_path_icon'></span>")},headerItem:function(t){var i=this.config.headerTemplate(t),s='<a role="button" tabindex="0" aria-label="'+i+'" webix_dm_header_id="'+t.id+'" class="webix_treemap_header_item">';return s+=i,s+="</a>"},classname:function(t,i,s){var e="webix_treemap_item";i.css&&(e+=i.css+" "),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css);var n=this.$xy[t.id];s&&s.$css&&(e+=" "+s.$css),e+=" webix_treemap_level_"+this.getItem(t.id).$level;var h=this.getParentId(t.id);if(h&&h!=this.q.branch||(e+=" webix_treemap_level_top"),this.$height-n.top-n.height<1&&(e+=" webix_treemap_item_bottom"),this.$width-n.left-n.width<1&&(e+=" webix_treemap_item_right"),i.cssClass){var r=i.cssClass.call(this,t,i,s);r&&("object"==k(r)?e+=" "+L(r):e+=" "+r)}return e},templateStart:function(t,i,s){var e="";if(this.$xy){var n=this.$xy[t.id];e+="width: "+n.width+"px; height: "+n.height+"px;",e+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div role="treeitem" aria-level="'+t.$level+'" '+(s&&s.webix_selected?'aria-selected="true" tabindex="0"':"")+' webix_dm_id="'+t.id+'" class="'+i.classname.call(this,t,i,s)+'" style="'+e+'">'},templateEnd:Ft("</div>")}},yo=(H.protoUI(xo,Ki,Ps,me,qs,Ls,Us,Ks,ge,Kh.view,xe,_s,g),{name:"dataview",$init:function(t){t.sizeToContent&&this.$ready.unshift(this.Wh);var i=t.type||t.item;t.prerender||this.defaults.prerender||i&&"auto"==i.width||t.autoheight||H.extend(this,Ae,!0),t.autoheight&&(t.scroll=!1),i&&"tiles"==i.type&&(this.nt.firstChild.style.padding="8px",this.x$=8),this.re.className+=" webix_dataview",this.nt.setAttribute("role","listbox")},Wh:function(){var t=Y("DIV",0,this.type.template({}));t.style.position="absolute",document.body.appendChild(t),this.type.width=t.offsetWidth,this.type.height=t.offsetHeight,G(t)},defaults:{scroll:!0,datafetch:50,navigation:!0},za:"webix_l_id",qn:"webix_dataview_item",x$:0,on_click:{webix_dataview_item:function(t,i){this.q.select&&("multiselect"==this.q.select||this.q.multiselect?this.select(i,!1,"touch"==this.q.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i))}},on_dblclick:{},on_mouse_move:{},type:{template:Ft("#value#"),templateLoading:Ft("Loading..."),width:160,height:50,classname:function(t,i,s){var e="webix_dataview_item ";return i.css&&(e+=i.css+" "),i.type&&"tiles"==i.type.toString()&&(e+="tiles "),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=t.$css+" "),s&&s.$css&&(e+=s.$css+" "),e},tilesStart:function(t,i){
return"tiles"==i.type?'<div class="webix_dataview_inner_item" style="box-sizing:border-box; overflow:hidden;">':""},tilesEnd:function(t,i){return"tiles"==i.type?"</div>":""},aria:function(t,i,s){return'role="option"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')},templateStart:Ft('<div webix_l_id="#id#" class="{common.classname()}" {common.aria()} style="width:{common.width}px; height:{common.height}px; float:left; overflow:hidden;">{common.tilesStart()}'),templateEnd:Ft("{common.tilesEnd()}</div>")},y$:function(t){return this.q.height=this.type.height*Math.ceil(this.data.count()/Math.floor(t/this.type.width))},autoheight_setter:function(t){return t&&(this.data.attachEvent("onStoreLoad",C(this.resize,this)),this.re.style.overflowY="hidden"),t},$getSize:function(t,i){0<this.q.xCount&&"auto"!=this.type.width&&!this.M$&&(this.q.width=this.type.width*this.q.xCount+(this.Ve?S.scrollSize:0)),this.q.yCount&&"auto"!=this.type.height&&(this.q.height=this.type.height*this.q.yCount);var s=this.q.width||this.ze;return this.q.autoheight&&s&&(this.y$(s),this.scroll_setter(!1)),Gi.api.$getSize.call(this,t,i)},S$:function(){var t=!1;return this.q.yCount&&"auto"==this.type.height&&(this.type.height=Math.floor((this.He-this.x$)/this.q.yCount),t=!0),this.q.xCount&&("auto"==this.type.width||this.M$)?(this.M$=!0,this.type.width=Math.floor((this.ze-2*this.x$)/this.q.xCount),t=!0):this.M$=!1,t},$setSize:function(t,i){if(Gi.api.$setSize.call(this,t,i)){if(this.q.autoheight&&this.y$()!=this.He)return $(this.resize,this);(this.S$()||this.mf)&&this.render()}}});H.protoUI(yo,gs,$s,Us,Ls,qs,Ks,ps,Kh.view);ct.pager={first:"<span class='webix_icon wxi-angle-double-left'></span>",last:"<span class='webix_icon wxi-angle-double-right'></span>",next:"<span class='webix_icon wxi-angle-right'></span>",prev:"<span class='webix_icon wxi-angle-left'></span>"};var Mo={defaults:{size:10,page:0,group:5,template:"{common.pages()}",maxWidth:1e5,height:30,borderless:!0},name:"pager",on_click:{webix_pager_item:function(t,i){this.select(i)}},$init:function(t){this.data=this.q,this.bt=this.nt,this.nt.className+=" webix_pager"+(t.autowidth?" webix_pager_auto":""),!1!==t.master&&0!==t.master||this.$ready.push(this.k$)},k$:function(){this.refresh(),this.$master={refresh:function(){},select:function(){}}},select:function(t){if(this.$master&&"pager"==this.$master.name)return this.$master.select(t);switch(t){case"next":t=this.q.page+1;break;case"prev":t=this.q.page-1;break;case"first":t=0;break;case"last":t=this.q.limit-1}t<0&&(t=0),t>=this.data.limit&&(t=this.data.limit-1);var i=this.data.page;this.callEvent("onBeforePageChange",[t,i])&&(this.data.page=1*t,this.refresh()&&(this.q.animate&&this.ek(i,1*t,this.q.animate)||this.$master.refresh()),this.callEvent("onAfterPageChange",[t]))},za:"webix_p_id",template_setter:Ft,type:{template:function(t,i){return t.template.call(this,t,i)},pages:function(t){var i="";if(-1==t.page)return"";t.$min=t.page-Math.round((t.group-1)/2),t.$max=t.$min+1*t.group-1,t.$min<0&&(t.$max+=-1*t.$min,t.$min=0),t.$max>=t.limit&&(t.$min-=Math.min(t.$min,t.$max-t.limit+1),t.$max=t.limit-1);for(var s=t.$min||0;s<=t.$max;s++)i+=this.button({id:s,index:s+1,selected:s==t.page?"_selected":"",label:ct.aria.page+" "+(s+1)});return i},page:function(t){return t.page+1},first:function(){return this.button({id:"first",index:ct.pager.first,selected:"",label:ct.aria.pages[0]})},last:function(){return this.button({id:"last",index:ct.pager.last,selected:"",label:ct.aria.pages[3]})},prev:function(){return this.button({id:"prev",index:ct.pager.prev,selected:"",label:ct.aria.pages[1]})},next:function(){return this.button({id:"next",index:ct.pager.next,selected:"",label:ct.aria.pages[2]})},button:Ft("<button type='button' webix_p_id='{obj.id}' class='webix_pager_item{obj.selected}' aria-label='{obj.label}'>{obj.index}</button>")},clone:function(t){t.$view||(t.view="pager",t=Vt(t)),((this.D$=t).$master=this).C$()},refresh:function(){var t=this.q;if(t.count){t.limit=Math.ceil(t.count/t.size);var i=Math.min(t.limit-1,t.page)
;return i!=t.page?this.$master.setPage(i):0<=(t.page=i)&&i!=t.old_page||t.limit!=t.old_limit||t.old_count!=t.count?(this.render(),this.C$(),t.old_limit=t.limit,t.old_page=t.page,t.old_count=t.count,!0):void 0}},apiOnly_setter:function(t){return this.$apiOnly=t},C$:function(){this.D$&&(this.D$.q.count=this.q.count,this.D$.q.page=this.q.page,this.D$.refresh())},ek:function(t,i,s){if(t==i)return!1;if(this.A$)return this.I$&&window.clearTimeout(this.I$),this.I$=$(this.ek,this,[t,i,s],100);var e=t<i?"left":"right";"top"!=s.direction&&"bottom"!=s.direction||(e=t<i?"top":"bottom"),s.flip&&(e="");var n=0,h=this.$master.bt,r=!!this.$master.Yt;r&&(n=(h=this.$master.Yt).offsetTop,st(this.$master.$view,"webix_animation"));var o,a=h.cloneNode(!0);a.style.width=h.style.width="100%",this.$master.refresh(),X(a,h.nextSibling,h.parentNode),r&&(a.childNodes[1].scrollLeft=h.childNodes[1].scrollLeft);var u=!0!==s?s:{},c=H.extend({direction:e,callback:C(function(){c.callback=null,Zi.breakLine(o),this.A$=!1,this.$master.Yt&&et(this.$master.$view,"webix_animation")},this),top:n,keepViews:r},u);o=Zi.formLine(h,a,c),Zi([h,a],c),this.A$=!0}},So=(H.protoUI(Mo,Us,Xi,Gi.view,g),{name:"comments",defaults:{sendAction:"click",mode:"comments",moreButton:Ft(ct.comments.moreComments)},$init:function(t){this.$view.className+=" webix_comments",t.format||(t.format="%Y-%m-%d %H:%i:%s"),t.rows=[this.F$(t)],t.readonly||t.rows.push(this.T$()),this.rt=[],this.z$(t.users),this.V$(),this.$ready.push(this.Nk)},Nk:function(){var s=this;this.H$=this.queryView({view:"list"}),this.B$=this.queryView({view:"form"}),this.R$=this.queryView({view:"button"}),this.P$=this.queryView({view:"textarea"}),this.H$.data.provideApi(this,!0),this.serialize=function(){var t=s.H$.serialize(),i=s.getIndexById("$more");return 0<=i&&t.splice(i,1),t},this.j$=F("onClick",function(t){var i=jt(t);i==s.P$?(s.N$(!0),$(function(){s.P$.focus()})):i===s.R$||i===s.E$||t&&-1!==t.target.className.indexOf("webix_comments_menu")||s.N$()}),this.attachEvent("onDestruct",function(){T(this.j$)})},$onLoad:function(t,i){this.L$(t,i)},L$:function(t,i){var s=this,e=this.H$||this.queryView({view:"list"});e.data.driver=i;var n=t.more;if(t=i.getRecords(t),this.O$){if(this.O$=!1,t.length){var h=e.data.order,r=1;if("chat"==this.q.mode)e.data.order=p([h[0]].concat(new Array(t.length),h.slice(1)));else{var o=e.getIndexById("$more");e.data.order=p(h.slice(0,o).concat(new Array(t.length),h.slice(o))),r=o}e.parse({data:t,pos:r}),n&&Ms(this.H$).ignore(function(){s.H$.updateItem("$more",{value:n})}),"chat"==this.q.mode&&e.showItem(e.getIdByIndex(t.length))}t.length&&n||Ms(this.H$).ignore(function(){s.H$.remove("$more")})}else n&&!e.exists("$more")&&(n={id:"$more",value:n},"chat"==this.q.mode?t.unshift(n):t.push(n)),e.parse(t),"chat"==this.q.mode&&e.showItem(e.getLastId())},$skin:function(){this.Wp=Qi.inputHeight+6},format_setter:function(t){return this.U$=en.strToDate(t),this.Y$=en.dateToStr(t),t},getUsers:function(){return this.W$},getMenu:function(){return this.E$},setCurrentUser:function(t){this.config.currentUser=t,this.B$.clear(),this.H$.refresh()},edit:function(t){if(this.callEvent("onBeforeEditStart",[t])){this.N$(!0);var i=this.H$.getItem(t);this.B$.setValues(i),this.B$.focus();var s=this.B$.elements.text.getInputNode();s.scrollTop=s.scrollHeight,ot(s,i.text.length),this.callEvent("onAfterEditStart",[t])}},G$:function(t){var i=this.B$.getValues();i.text&&(i.id?this.updateItem(i.id,i):(this.config.currentUser&&(i.user_id=this.config.currentUser),i.date=new Date,this.add(i),this.H$.scrollTo(0,this.H$.getLastId())),this.B$.clear(),t&&(this.P$.getInputNode().value=""))},X$:function(t){this.B$.getValues().id==t&&this.B$.clear(),this.remove(t)},N$:function(t){if(!S.touch){var i=this.P$;t?(this.R$.getParentView().show(),i.define({height:84})):(Vi.hasFocus(this.R$)&&Vi.setFocus(this.H$),this.R$.getParentView().hide(),i.define({height:this.Wp})),i.resize()}},J$:function(t){t||(t=this.P$.getInputNode().value),t&&!this.R$.isEnabled()?this.R$.enable():!t&&this.R$.isEnabled()&&this.R$.disable()},V$:function(){var s=this
;this.E$=Vt({view:"contextmenu",autowidth:!0,point:!1,data:[{id:"edit",icon:"wxi-pencil",value:ct.comments.edit},{id:"remove",icon:"wxi-trash",value:ct.comments.remove}],on:{onShow:function(){var t=s.E$.getContext();s.H$.addCss(t.id,"active_menu")},onHide:function(){var t=s.E$.getContext();s.H$.removeCss(t.id,"active_menu")},onItemClick:function(t){var i=s.E$.getContext();s.callEvent("onBeforeMenuAction",[t,i.id])&&("edit"==t?s.edit(i.id):"remove"==t&&(ct.comments.confirmMessage?Ze({text:ct.comments.confirmMessage,callback:function(t){t&&s.X$(i.id)}}):s.X$(i.id)))}}}),this.rt.push(this.E$)},T$:function(){var n=this,t=ct.comments;return{view:"form",minHeight:50,paddingX:10,elements:[{view:"textarea",css:"webix_comments_textarea",height:this.Wp,name:"text",placeholder:t.placeholder,keyPressTimeout:100,on:{onTimedKeyPress:function(){n.J$()},onChange:function(t){n.J$(t)},onKeyPress:function(t,i){if(13==t){var s=n.q.sendAction,e=i.shiftKey;("enter"==s&&!e||"enter"!==s&&e)&&(Q(i),n.G$(!0))}}}},{hidden:!S.touch,cols:[{},{view:"button",disabled:!0,css:"webix_comments_send",type:"form",value:t.send,autowidth:!0,click:function(){n.G$()}}]}]}},F$:function(t){var r=this,o="webix_comments_",s={height:"auto",templateStatus:function(t){return"<span class = '"+o+"status "+t.status+"'></span>"},templateUser:function(t){var i=r.getUsers(),s=i&&i.exists(t.user_id)?i.getItem(t.user_id):{};return"<span class = '"+o+"name'>"+(s.value||"")+"</span>"},templateMenu:function(){return"<span class='webix_icon wxi-dots "+o+"menu'></span>"},templateDate:function(t){var i=en.dateToStr("%d %M, %H:%i");return t.date?"<span class='"+o+"date'>"+i(t.date)+"</span>":""},templateLinks:function(t){return t.text.replace(/(https?:\/\/[^\s]+)/g,function(t){var i="<a target='_blank' href='"+(t=Ft.escape(t))+"'>";return t.match(/.(jpg|jpeg|png|gif)$/)?i+="<img class='webix_comments_image' src='"+t+"'/>":i+=t,i+"</a>"})},templateText:function(t,i){return"<div class = '"+o+"message'>"+i.templateLinks(t)+"</div>"},templateAvatar:function(t,i){var s="<div class='"+o+"avatar'>",e=r.getUsers(),n=e&&e.exists(t.user_id)?e.getItem(t.user_id):{};if(n.status&&(s+=i.templateStatus(n)),s+="<div class='"+o+"avatar_image ",n.image)s+="'><img src = '"+n.image+"' class='"+o+"photo'>";else{var h=n.value?n.value[0].toUpperCase():"<span class='webix_icon wxi-user'></span>";s+=o+"avatar_text'>"+h}return s+="</div></div>"},template:function(t,i){var s;if("$more"==t.id)s="<div class='webix_comments_more'>"+r.q.moreButton(t)+"</div>";else{var e=i.templateAvatar(t,i),n=i.templateUser(t,i),h=i.templateDate(t,i);s=e+n+i.templateMenu(t,i)+h+i.templateText(t,i)}return s},classname:function(t,i,s){var e=Zh.api.type.classname(t,i,s);return(t.user_id&&t.user_id==r.q.currentUser||!r.W$.count())&&(e+=" webix_comments_current"),e}},i={view:"list",navigation:!1,type:s=H.extend(s,t.listItem||{},!0),scheme:{$init:function(t){t.date&&(t.date=r.U$(t.date))},$save:function(t){t.date&&(t.date=r.Y$(t.date))},$serialize:function(t){return t.date&&(t.date=r.Y$(t.date)),t}},onClick:{webix_comments_menu:function(t,i){r.E$.isVisible()?r.E$.hide():(r.E$.setContext({obj:r,id:i}),r.E$.show(t.target,s.menuPosition||{pos:"left",y:30,x:10}))},webix_comments_more:function(){if(r.config.url&&r.callEvent("onDataRequest",[])){r.O$=!0;var t=r.H$.getItem("$more").value,i="chat"==r.q.mode?t:r.H$.getIndexById("$more"),s=di.$parse(r.config.url),e={error:function(){r.O$=!1}};"string"==typeof s&&(s=s+(s.indexOf("?")<0?"?":"&")+"pos="+i+"&more="+t),r.load(s,e,{pos:i,more:t})}}},on:{onAfterScroll:C(function(){this.E$.hide()},this)}};return t.save&&(i.save=t.save),i},z$:function(t){var i=this;t&&t.getItem?this.W$=t:(this.W$=new Ih,this.rt.push(this.W$),t&&"string"==typeof t?this.W$.load(t):this.W$.parse(t||[])),this.W$.data.attachEvent("onStoreUpdated",function(){i.H$.refresh()})}}),ko=(H.protoUI(So,vi,An.view),{name:"menu",Pm:"webix_menu",$init:function(t){this.data.wr=C(function(t){t.disabled&&this.data.addMark(t.id,"webix_disabled",!0,1,!0)},this),t.autowidth&&(this.K$=!0,delete t.autowidth),this.data.attachEvent(
"onStoreUpdated",C(function(){this.Ya()},this)),this.attachEvent("onMouseMove",this.q$),this.attachEvent("onMouseOut",function(t){this.Z$()&&"click"==this.q.openAction||!this.Q$&&t.relatedTarget&&this.Ya()}),this.attachEvent("onItemClick",function(t,i,s){var e=this.getItem(t);if(e){if(e.$template)return;var n=this.getTopMenu();if(!this.data.getMark(t,"webix_disabled")){if(!n.callEvent("onMenuItemClick",[t,i,s]))return void(i.showpopup=!0);this!=n&&n.Ru(t,i,s),e.submenu||n.tA?(this!==n&&!S.touch||"click"!=n.q.openAction||this.Ga(t,s),i.showpopup=!0):(n.Ya(!0),n.iA&&n.hide())}}}),this.attachEvent("onKeyPress",function(t){if(9===t)this.getTopMenu().Ya();else if(13===t||32===t){var i,s=this.getSelectedId();s&&(i=this.getItemNode(s)),i&&it(i,"MouseEvents","click")}}),this.data.attachEvent("onClearAll",function(){this.sA=[]}),this.data.sA=[],this.nt.setAttribute("role","menubar"),this.rt=[]},sizeToContent:function(){if("y"==this.q.layout){var i=[],s=!1;this.data.each(function(t){i.push(this.Lt(t)),t.submenu&&(s=!0)},this),this.config.width=nt(i,this.$view.className).width+16+2+(s?15:0),this.resize()}},getTopMenu:function(){for(var t=this;t.Ua;)t=jt(t.Ua);return t},Lm:function(t){this.q.autoheight&&(t=this.count());for(var i=this.count(),s=0,e=0;e<t;e++){var n=this.data.pull[this.data.order[e]];n&&"Separator"==n.$template?(s+=4,this.q.autoheight||t++):s+=this.type.height}return this.Uu(t&&t<i,"y"),s},on_mouse_move:{},type:{eA:function(t){return t.submenu||t.data||t.item},css:"menu",width:"auto",aria:function(t,i,s){return'role="menuitem"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':'tabindex="-1"')+(i.eA(t)?'aria-haspopup="true"':"")+(s&&s.webix_disabled?' aria-disabled="true"':"")},templateStart:function(t,i,s){if("Separator"===t.$template||"Spacer"===t.$template)return'<div webix_l_id="#id#" role="separator" tabindex="-1" class="webix_context_'+t.$template.toLowerCase()+'">';var e=(t.href?" href='"+t.href+"' ":"")+(t.target?" target='"+t.target+"' ":"");return Zh.api.type.templateStart(t,i,s).replace(/^<div/,"<a "+e)+(i.eA(t)&&i.subsign?"<div class='webix_submenu_icon'></div>":"")},templateEnd:function(t){return"Separator"===t.$template||"Spacer"===t.$template?"</div>":"</a>"},templateSeparator:Ft("<div class='sep_line'></div>"),templateSpacer:Ft("<div></div>")},getMenu:function(t){if(this.data.pull[t])return this;for(var i in this.data.pull){var s=this.getItem(i);if(s.submenu){var e=this.nA(s).getMenu(t);if(e)return e}}},getSubMenu:function(t){var i=this.getMenu(t),s=i.getItem(t);return s.submenu?i.nA(s):null},getMenuItem:function(t){return this.getMenu(t).getItem(t)},nA:function(t){var i=jt(t.submenu);return i||(t.submenu=this.hA(t),i=jt(t.submenu)),i},q$:function(t,i,s){this.Z$()&&this.Ga(t,s)},Z$:function(){var t=this.getTopMenu();if("click"!=t.q.openAction)return!0;if(S.touch)return!1;var i=t.rA;return!(!i||!jt(i).isVisible())},Ga:function(t,i){var s=this.getItem(t);if(s&&(this.Q$=null,this.rA&&s.submenu!=this.rA&&this.Ya(!0),this.type.eA(s)&&!this.config.hidden)){var e=this.nA(s);if(this.data.getMark(t,"webix_disabled"))return;e.show(i,{pos:this.q.subMenuPos}),e.Ua=this.q.id,this.rA=s.submenu}},disableItem:function(t){this.getMenu(t).addCss(t,"webix_disabled")},enableItem:function(t){this.getMenu(t).removeCss(t,"webix_disabled")},oA:function(t,i){var s=this.data;s.sA[t]!=i&&(s.sA[t]=i,s.filter(function(t){return!s.sA[t.id]}),this.resize())},hideItem:function(t){var i=this.getMenu(t);i&&i.oA(t,!0)},showItem:function(t){var i=this.getMenu(t);if(i)return i.oA(t,!1),Zh.api.showItem.call(i,t)},Ya:function(t){if(this.rA){var i=jt(this.rA);i.Ya&&i.Ya(t),!t&&i.jn||(i.hide(),this.rA=null)}},hA:function(t){var i={view:"submenu",data:this.type.eA(t)},s=this.getTopMenu().q.submenuConfig;s&&H.extend(i,s,!0);var e=this.getMenuItem(t.id);e&&e.config&&H.extend(i,e.config,!0);var n=Vt(i);return this.rt.push(n),n.Ua=this,n.q.id},Wa:function(t,i,s){var e=this.getItem(t);if("Separator"==e.$template||"Spacer"==e.$template||this.data.getMark(t,"webix_disabled")){var n=this.getIndexById(t)+("up"==s?-1:1);return(
t=0<=n?this.getIdByIndex(n):null)?this.Wa(t,i,s):i}return t},$skin:function(){Zh.api.$skin.call(this),this.type.height=Qi.menuHeight},defaults:{scroll:"",layout:"x",mouseEventDelay:100,subMenuPos:"bottom"}}),Co={api:ko,view:H.protoUI(ko,Zh.view)},Do={name:"submenu",$init:function(){this.Z=f(this.aA),(this.Z.ot=this).attachEvent("onMouseOut",function(t){"click"!=this.getTopMenu().q.openAction&&(this.Q$||this.jn||!t.relatedTarget||this.hide())}),this.attachEvent("onMouseMoving",function(){this.Ua&&(jt(this.Ua).Q$=!0)}),this.attachEvent("onBeforeShow",function(){this.getTopMenu().K$&&this.sizeToContent&&!this.isVisible()&&this.sizeToContent()}),this.bt.setAttribute("role","menu")},$skin:function(){Co.api.$skin.call(this),nh.api.$skin.call(this),this.type.height=Qi.menuHeight},aA:{$getSize:function(t,i){var s=1*this.ot.q.height,e=1*this.ot.q.width,n=Co.api.$getSize.call(this.ot,t,i);return this.ot.q.height=s,this.ot.q.width=e,n},$setSize:function(t,i){this.ot.q.scroll&&(this.ot.yn.style.height=i+"px")},destructor:function(){this.ot=null}},body_setter:function(){},getChildViews:function(){return[]},defaults:{width:150,subMenuPos:"right",layout:"y",autoheight:!0},type:{height:Qi.menuHeight,subsign:!0}},$o={api:Do,view:H.protoUI(Do,Co.view,nh.view)},Ao={name:"sidemenu",defaults:{animate:!0,position:"left",width:200,borderless:!0},$init:function(){this.$view.className+=" webix_sidemenu"},$skin:function(){this.defaults.padding=0},position_setter:function(t){var i=this.q.position;return i&&et(this.$view," webix_sidemenu_"+i),st(this.$view," webix_sidemenu_"+t),t},$getSize:function(){var t=ls.api.$getSize.apply(this,arguments);return this.uA=t},$setSize:function(t,i){Gi.api.$setSize.call(this,t,i),t=this.ze-2*this.q.padding,i=this.He-2*this.q.padding,this.re.style.padding=this.q.padding+"px",this.en.style.display="none",this.yn.style.height=i+"px",this.Z.$setSize(t,i)},show:function(){if(!this.callEvent("onBeforeShow",arguments))return!1;this.q.hidden=!1,this.nt.style.zIndex=this.q.zIndex||Ti(),(this.q.modal||this.Sn)&&(this.nn(!0),this.Sn=null),this.nt.style.display="block",this.Pe(),this.q.position&&this.$n(),this.An=1,$(function(){this.An=0},this,[],S.touch?400:100),this.config.autofocus&&(this.In=Vi.getFocus(),Vi.setFocus(this)),-1==M.oe.find(this)&&M.oe.push(this),this.callEvent("onShow",[])},$n:function(t){var i,s,e,n,h,r=0,o=0,a={};this.$view.style.position="fixed",e=document.documentElement.offsetWidth,n=document.documentElement.offsetHeight,i=this.uA[0]||e,s=this.uA[2]||n,"top"==(h=this.q.position)?i=e:"right"==h?(s=n,r=e-i):"bottom"==h?(i=e,o=n-s):s=n,a={left:r,top:o,width:i,height:s,maxWidth:e,maxHeight:n},"function"==typeof this.q.state&&this.q.state.call(this,a),this.cA=a,this.$setSize(a.width,a.height),void 0===t&&this.fA()?(et(this.$view,"webix_animate"),this.ek[this.q.position].beforeShow.call(this,a),$(function(){st(this.$view,"webix_animate",!0)},this,null,1),$(function(){this.ek[this.q.position].show.call(this,a)},this,null,10)):("right"===this.q.position&&(a.left=a.right?e-a.width-a.right:e-a.width),this.setPosition(a.left,a.top))},fA:function(){return Zi.isSupported()&&this.q.animate&&!(S.isIE&&-1!=navigator.appVersion.indexOf("MSIE 9"))},hidden_setter:function(t){return t?this.hide(!0):this.show(),!!t},ek:{left:{beforeShow:function(t){this.$view.style.left=-t.width+"px",this.$view.style.top=t.top+"px"},show:function(t){this.$view.style.left=t.left?t.left+"px":"0px"},hide:function(t){this.$view.style.left=-t.width+"px"}},right:{beforeShow:function(t){this.$view.style.left="auto",this.$view.style.right=-t.width+"px",this.$view.style.top=t.top+"px"},show:function(t){this.$view.style.right=t.right?t.right+"px":"0px"},hide:function(t){this.$view.style.right=-t.width+"px"}},top:{beforeShow:function(t){this.setPosition(t.left,t.top),this.$view.style.height="0px",this.yn.style.height="0px"},show:function(t){this.$view.style.height=t.height+"px",this.yn.style.height=t.height+"px"},hide:function(){this.$view.style.height="0px",this.yn.style.height="0px"}},bottom:{beforeShow:function(t){this.$view.style.left=t.left+"px",
this.$view.style.top="auto";var i=t.bottom!=undefined?t.bottom:t.maxHeight-t.top-t.height;this.$view.style.bottom=i+"px",this.$view.style.height="0px"},show:function(t){this.$view.style.height=t.height+"px"},hide:function(){this.$view.style.height="0px"}}},hide:function(t){if(!this.$destructed){this.q.modal&&this.nn(!1);var i=document.documentElement.offsetWidth,s=document.documentElement.offsetHeight;if(!t&&this.fA()&&i==this.cA.maxWidth&&s==this.cA.maxHeight){this.ek[this.q.position].hide.call(this,this.cA);var e=Ot(this.$view,S.transitionEnd,C(function(){this.Fn(),Ut(e)},this))}else this.Fn();if(this.q.autofocus){var n=document.activeElement;n&&this.nt&&this.nt.contains(n)&&(Vi.setFocus(this.In),this.In=null)}this.Tn()}}},Io=(H.protoUI(Ao,nh.view),{name:"sidebar",defaults:{titleHeight:Qi.sidebarTitleHeight||40,type:"sideBar",activeTitle:!0,select:!0,scroll:!1,collapsed:!1,collapsedWidth:44,position:"left",width:250,mouseEventDelay:10},$init:function(){this.$ready.push(this.lA),this.$ready.push(this.dA),this.data.wr=function(t){t.data?t.menu=B(t.data):t.item&&(t.menu=B(t.item.length?t.item:[t.item]))}},on_context:{},on_mouse_move:{},lA:function(){this.vA=this.config.width,this.attachEvent("onBeforeOpen",function(t){if(!this.config.multipleOpen)for(var i=this.getOpenItems(),s=0;s<i.length;s++)this.getParentId(t)==this.getParentId(i[s])&&this.close(i[s]);return!this.config.collapsed}),this.attachEvent("onItemClick",function(t,i,s){this.getPopup()&&!this.getPopup().config.hidden&&(i.showpopup=!0),S.touch&&this._A(t,s)}),this.attachEvent("onBeforeSelect",function(t){return!this.getItem(t).$count&&(this.clearCss("webix_sidebar_selected"),!0)}),this.attachEvent("onAfterSelect",function(t){this.pA(this,t,!Qi.sidebarMarkAll),this.getPopup().mA(t)}),this.attachEvent("onMouseMove",function(t,i,s){this._A(t,s)}),this.config.collapsed&&this.collapse()},_A:function(t,i){if(this.config.collapsed){var s=this.getPopup();s&&(this.bA(t),this.gA(t),s.show(i,{x:"left"==this.config.position?this.config.collapsedWidth:-s.config.width,y:-1}))}},bA:function(t){var i=this.getPopup().getBody().getChildViews()[0];if(i){var s=this.getSelectedId();i.masterId=t,i.parse(this.getItem(t)),s&&this.getParentId(s)==t?st(i.$view,"webix_sidebar_selected",!0):et(i.$view,"webix_sidebar_selected"),s==t?st(i.$view,"webix_selected",!0):et(i.$view,"webix_selected")}},gA:function(t){var i=this.getPopup().getBody().getChildViews()[1];if(i){i.clearCss("webix_sidebar_selected"),i.masterId=t;var s=this.getSelectedId(),e=this.getItem(t).menu?B(this.getItem(t).menu):[].concat(B(this.data.getBranch(t)));i.unselect(),e.length?(i.show(),i.data.importData(e),i.exists(s)?i.select(s):s&&this.pA(i,s)):i.hide()}},dA:function(){var s,n=this,e=n.config;if(e.popup&&(s=jt(e.popup)),!s){var t="left"==e.position?"webix_sidebar_popup_left":"webix_sidebar_popup_right",i="left"==e.position?"right":"left",h=function(t){var i="wxi-angle-"+("left"==e.position?"right":"left");return(t.submenu||t.data||t.item?'<div class="webix_icon '+i+'"></div>':"")+t.value},r={view:"popup",css:"webix_sidebar_popup "+t+" "+e.css,autofit:!1,width:this.vA-this.config.collapsedWidth,borderless:!0,padding:0,body:{rows:[{view:"template",borderless:!0,css:"webix_sidebar_popup_title",template:"#value#",height:this.config.titleHeight+2,onClick:{webix_template:function(){var t=this.masterId;n.getItem(t).$count||n.select(t)}}},{view:"menu",submenu:"data",layout:"y",subMenuPos:i,select:!0,borderless:!0,autoheight:!0,css:"webix_sidebar_popup_list "+t+" "+e.css,template:h,type:{subsign:!1},submenuConfig:{padding:0,subMenuPos:i,template:h,select:!0,type:{subsign:!1},css:"webix_sidebar_popup_list "+t+" "+e.css,on:{onShow:function(){this.clearCss("webix_sidebar_selected"),this.unselectAll();var t=n.getSelectedId();t&&this.exists(t)?this.select(t):t&&n.pA(this,t)},onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onAfterSelect:function(t){for(var i=n.getPopup().queryView({view:"menu"}),s=n.getParentId(t);s;){var e=i.getMenu(s);e&&(e.unselectAll(),n.pA(e,t)),s=n.getParentId(s)}n.pA(this,t)}}},on:{
onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onMenuItemClick:function(t){this.getSubMenu(t)||n.select(t)}}}]}};H.extend(r,e.popup||{},!0),(s=Vt(r)).mA=function(t){n&&n.getParentId(t)==this.masterId&&st(this.$view,"webix_sidebar_selected",!0),n.config.collapsed&&1==n.getItem(t).$level&&st(this.$view,"webix_selected",!0)},s.queryView({view:"menu"}).tA=!0}s.attachEvent("onBeforeShow",function(){return e.collapsed}),this.rt=[s],e.popupId=s.config.id,Lt(document.body,"mousemove",function(t){var i=t.target||t.srcElement;s.config.hidden||s.$view.contains(i)||this.$view.firstChild.contains(i)||s.queryView({view:"menu"}).rA||s.hide()},{bind:this})},pA:function(i,s,e){var n="webix_sidebar_selected";i.data.each(function(t){!this.wA(s,t.id)||e&&"0"!=this.getParentId(t.id)?i.hasCss(t.id,n)&&i.removeCss(t.id,n):i.addCss(t.id,n)},this)},wA:function(t,i){var s=this.getParentId(t);return i==s||!!s&&this.wA(s,i)},getPopup:function(){return jt(this.config.popupId)},position_setter:function(t){var i=t,s="left"==t?"right":"left";et(this.$view,"webix_sidebar_"+s),st(this.$view,"webix_sidebar_"+i,!0);var e=this.getPopup();if(e){var n=e.$view;et(n,"webix_sidebar_popup_"+s),st(n,"webix_sidebar_popup_"+i,!0)}return t},collapse:function(){this.define("collapsed",!0)},expand:function(){this.define("collapsed",!1)},toggle:function(){var t=!this.config.collapsed;this.define("collapsed",t)},collapsed_setter:function(t){var i;return t?(i=this.config.collapsedWidth,this.closeAll(),this.type.collapsed=!0,et(this.$view,"webix_sidebar_expanded")):(i=this.vA,this.type.collapsed=!1,st(this.$view,"webix_sidebar_expanded",!0)),this.define("width",i),this.resize(),t}});Tt(wo.view,{name:"sideBar",height:"auto",css:"webix_sidebar",template:function(t,i){return i.collapsed?i.icon(t,i):i.arrow(t,i)+i.icon(t,i)+"<span>"+t.value+"</span>"},arrow:function(t){for(var i="",s=1;s<=t.$level;s++){if(s==t.$level&&t.$count)i+="<span class='"+("webix_sidebar_dir_icon webix_icon "+("wxi-angle-"+(t.open?"down":"left")))+"'></span>"}return i},icon:function(t){var i="";return 2<t.$level&&(i='style="padding-left:'+40*(t.$level-2)+'px"'),t.icon?"<span class='webix_icon webix_sidebar_icon "+t.icon+"' "+i+"></span>":"<span "+i+"></span>"}});H.protoUI(Io,wo.view),H.protoUI({name:"context"},ds,nh.view);var Fo={name:"contextmenu",iA:!0,$init:function(t){t.submenuConfig&&H.extend(t,t.submenuConfig)}},To=(H.protoUI(Fo,ds,$o.view),{name:"treetable",$init:function(){for(var t in H.extend(this.data,Me,!0),H.extend(this.type,ke),H.extend(this,we,!0),be)this.on_click[t]||(this.on_click[t]=this.xA(be[t]));this.type.treetable=Ft("{common.space()}{common.icon()} {common.folder()}"),this.type.treecheckbox=function(t){return t.indeterminate&&!t.nocheckbox?"<div class='webix_tree_checkbox webix_indeterminate'></div>":ke.checkbox.apply(this,arguments)},this.data.provideApi(this,!0),this.nt.setAttribute("role","treegrid")},yo:!1,xA:function(s){return function(t,i){return i=i.row,s.call(this,t,i)}},getState:function(){var t=Ds.getState.call(this);return H.extend(t,me.getState.call(this)),t},setState:function(t){me.setState.call(this,t)&&Ds.setState.call(this,t)},clipboard_setter:function(t){return H.extend(this.Ln,Se),pe.clipboard_setter.call(this,t)},Af:function(t,i){for(var s=0;s<t.start;s++){var e=this.data.order[s];e&&1!=this.getItem(e).$level&&t.start--}return Hr.api.Af.call(this,t,i)}}),zo=(H.protoUI(To,me,ye,ge,Hr.view),H.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(t){this.data=t||{};var i=t&&t.id?t.id:z();this.q={id:i},Vt.views[i]=this},getValues:function(){return this.data},setValues:function(t,i){this.data=i?H.extend(this.data,t,!0):t,this.callEvent("onChange",[t])},refresh:function(){this.callEvent("onBindRequest")}},g,Ei,vi,Hi)),Vo=H.proto({name:"DataValue",isVisible:function(){return!0},$init:function(t){t&&!D(t.value)||(this.data=t||"");var i=t&&t.id?t.id:z();this.q={id:i},Vt.views[i]=this},setValue:function(t){this.data=t,this.callEvent("onChange",[t])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},g,Ei
),Ho=H.proto({name:"TreeCollection",$init:function(){H.extend(this.data,Me,!0),this.data.provideApi(this,!0),H.extend(this,we,!0)}},ge,Ih);H.Date=en,H.Number=nn,H.promise=mt,H.DataCollection=Ih,H.DataRecord=zo,H.DataValue=Vo,H.TreeCollection=Ho,H.ActiveContent=Yt,H.AtomDataLoader=vi,H.AtomRender=_i,H.AutoScroll=pi,H.AutoTooltip=Ki,H.BaseBind=Ei,H.BindSource=Ni,H.Canvas=qi,H.CodeParser=yt,H.CollectionBind=Ri,H.ContextHelper=ds,H.CopyPaste=_s,H.CustomPrint=ps,H.CustomScroll=ms,H.DataMarks=bs,H.DataMove=gs,H.DataLoader=Cs,H.DataState=Ds,H.DataStore=ks,H.Destruction=Bi,H.DragControl=zi,H.DragItem=$s,H.DragOrder=As,H.EditAbility=Vs,H.EventSystem=g,H.FlexLayout=Hs,H.Group=Ps,H.GroupMethods=Bs,H.GroupStore=Rs,H.HTMLOptions=js,H.HtmlMap=Ns,H.IdSpace=Es,H.KeysNavigation=Ls,H.MapCollection=Os,H.Modality=us,H.MouseEvents=Us,H.Movable=as,H.NavigationButtons=Ys,H.OverlayBox=Ws,H.PagingAbility=Gs,H.ProgressBar=Xs,H.RecordBind=ji,H.RenderStack=Js,H.ResizeArea=cs,H.SingleRender=Xi,H.Scrollable=Ks,H.SelectionModel=qs,H.Settings=Hi,H.Sparklines=de,H.TablePaste=pe,H.Touch=Mi,H.TreeAPI=me,H.TreeClick=be,H.TreeDataLoader=ge,H.TreeDataMove=we,H.TreeRenderStack=xe,H.TreeStateCheckbox=ye,H.TreeStore=Me,H.TreeTablePaste=Se,H.TreeType=ke,H.UIManager=Vi,H.Undo=Is,H.UploadDriver=Ce,H.ValidateCollection=De,H.ValidateData=xs,H.ValueBind=Pi,H.Values=$e,H.VirtualRenderStack=Ae,H.VRenderStack=Ie,H.html=_n,H.skin=pn,H.debug=function Lo(t){if(t)if("object"!==k(t))c={events:!0};else for(var i in t)c[i]=t[i];else c={}},H.i18n=ct,H.ready=mi,H.env=S,H.color=Zs,H.csv=_e,H.clipbuffer=vs,H.history=rn,H.storage=ai,H.template=Ft,H.type=Tt,H.markup=on,H.editors=zs,H.animate=Zi,H.print=function(t,i){var s=jt(t);s&&s.$printView&&(s=s.$printView()),s&&(s.callEvent&&s.callEvent("onBeforePrint",[i]),function e(t){st(document.body,"webix_print"),t.docHeader&&dn("Header",t),t.docFooter&&dn("Footer",t),O("@media print { @page{ size:"+t.paper+" "+t.mode+";margin-top:"+t.margin.top+"px;margin-bottom:"+t.margin.bottom+"px;margin-right:"+t.margin.right+"px;margin-left:"+t.margin.left+"px;}}","print")}(i=function n(t){return(t=t||{}).paper=un[(t.paper||"").toLowerCase()]||"A4",t.mode=fn[t.mode]?t.mode:"portrait",t.fit=cn[t.fit]?t.fit:"page",t.scroll=t.scroll||!1,t.size=ln[t.paper],t.margin=t.margin||0===t.margin?t.margin:{},an=isNaN(1*t.margin)?an:t.margin,t.margin={top:t.margin.top||0===t.margin.top?t.margin.top:an,bottom:t.margin.bottom||0===t.margin.bottom?t.margin.bottom:an,right:t.margin.right||0===t.margin.right?t.margin.right:an,left:t.margin.left||0===t.margin.left?t.margin.left:an},t}(i)),s.$customPrint&&!0!==s.$customPrint(i)||function r(t,i){var s=t.$view.cloneNode(!0),e=t.$view.getElementsByTagName("canvas");if(e.length)for(var n=e.length-1;0<=n;n--){var h=s.getElementsByTagName("canvas")[n].getContext("2d");h.drawImage(e[n],0,0)}X(s,i.docFooter,document.body),st(s,"webix_ui_print"),!i.scroll&&(t.bt&&t.data&&t.data.pull||t.getBody)&&st(s,"webix_print_noscroll"),window.print(),G(s)}(s,i),function h(t){et(document.body,"webix_print"),U("print"),t.docHeader&&G(t.docHeader),t.docFooter&&G(t.docFooter)}(i))},H.rules=ws,H.patterns=vn,H.version="6.1.4",H.name="core",H.level_in=function Oo(){0},H.level_out=function Uo(){0},H.clone=f,H.copy=B,H.single=function Yo(t){var i=null;return function(){return i||(i=new t({})),i.yA&&i.yA.apply(i,arguments),i}},H.bind=C,H.exec=v,H.wrap=function Wo(i,s){return i?function(){var t=i.apply(this,arguments);return s.apply(this,arguments),t}:s},H.isUndefined=D,H.delay=$,H.once=l,H.uid=z,H.toNode=A,H.toArray=p,H.toFunctor=m,H.isArray=b,H.isDate=y,H.PowerArray=x,H.MA=Et,H.SA=Lt,H.event=Ot,H.eventRemove=Ut,H.callEvent=I,H.attachEvent=F,H.detachEvent=T,H.blockEvent=function(){return w.blockEvent()},H.unblockEvent=function(){return w.unblockEvent()},H.mapEvent=function(t){return w.mapEvent(t)},H.hasEvent=function(t){return w.hasEvent(t)},H.stringify=ft,H.toPNG=function(e,n){var h=mt.defer();return hi(S.cdn+"/extras/html2canvas.min.js").then(function(){"string"==typeof n&&(n={filename:n}),n=n||{};var t=jt(e);if(t&&t.$exportView&&(t=t.$exportView(n
)),!t)return h.reject(Fe);var i=t?t.$view:A(e),s=(n.filename||"Data")+".png";return window.html2canvas(i).then(function(i){var t=function(t){!1!==n.download&&ht(t,s),i.remove(),h.resolve(t)};i.msToBlob?t(i.msToBlob()):i.toBlob(t,"image/png")}),h})},H.toExcel=Te,H.toCSV=function(t,i){i=i||{};var s=jt(t);if(s&&s.$exportView&&(s=s.$exportView(i)),!s)return mt.reject(Fe);i.export_mode="csv",i.filterHTML=!0;var e=Ve(s,i),n=function o(t){return _e.stringify(t)}(He(s,i,e)),h=(i.filename||"Data")+".csv",r=new Blob(["\ufeff"+n],{type:"text/csv"});return!1!==i.download&&ht(r,h),mt.resolve(r)},H.toPDF=function(i,h){var r=mt.defer();return hi(S.cdn+"/extras/pdfjs.js").then(function(){h=h||{};var t=jt(i);if(t&&t.$exportView&&(t=t.$exportView(h)),!t)return r.reject(Fe);h.export_mode="pdf",h.Hf=ve,h.fontName=h.fontName||"pt-sans.regular";var s=Ve(t,h),e=He(t,h,s),n=function(t,i){var s=(i.filename||"Data")+".pdf",e=new Blob([t.toString()],{type:"application/pdf"});!1!==i.download&&ht(e,s),r.resolve(e)};return h.Hf?Ee(s,e,h,n):pdfjs.load(S.cdn+"/extras/"+h.fontName+".ttf",function(t,i){if(t)throw t;ve=h.Hf=new pdfjs.TTFFont(i),Ee(s,e,h,n)}),r})},H.alert=function Go(){var t=qe.apply(this,arguments);return t.type=t.type||"confirm",Xe(t)},H.confirm=Ze,H.modalbox=Qe,H.message=tn,H.editStop=function Xo(){I("onEditEnd",[])},H.ajax=xt,H.jsonp=bn,H.DataDriver=oi,H.dp=Ms,H.DataProcessor=Ss,H.remote=yn,H.require=hi,H.proxy=di,H.send=function Jo(t,i,s,e){var n=Y("FORM",{target:e||"_self",action:t,method:s||"POST"},"");for(var h in i){var r=Y("INPUT",{type:"hidden",name:h,value:i[h]},"");n.appendChild(r)}n.style.display="none",document.body.appendChild(n),n.submit(),document.body.removeChild(n)},H.ui=Vt,H.$$=jt,Object.defineProperty(H,"kA",{value:!0})});
//# sourceMappingURL=webix.js.map
