/**
 * @license
 * Webix UI v.6.2.1
 * 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,$:[],destructors:[],securityKey:"",D:null,I:0,T: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,e=["","webkit","Moz","O","ms"],s=document.createElement("DIV"),n=0;n<e.length;n++){var h=e[n]?e[n]+"Transform":"transform";if("undefined"!=typeof s.style[h]){i=n;break}}if(-1<i){S.cssPrefix=["","-webkit-","-Moz-","-o-","-ms-"][i];var r=S.jsPrefix=e[i];S.transform=r?r+"Transform":"transform",S.transition=r?r+"Transition":"transition",S.transitionDuration=r?r+"TransitionDuration":"transitionDuration",s.style[S.transform]="translate3d(0,0,0)",S.translate=s.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(Vo){}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.F;return i.prototype=t,new i}function B(t){var i,e=!!(window.Map&&window.Set&&window.WeakMap&&window.WeakSet);for(var s in 1<arguments.length?(i=arguments[0],t=arguments[1]):i=b(t)?[]:{},t){var n=t[s];!n||"object"!=k(n)||n instanceof RegExp?i[s]=n:y(n)?i[s]=new Date(n):e&&(n instanceof Map||n instanceof Set||n instanceof WeakMap||n instanceof WeakSet)?i[s]=n:(i[s]=b(n)?[]:{},B(i[s],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 x(t){return void 0===t}function $(i,e,s,t){return window.setTimeout(function(){if(!e||!e.$destructed){var t=i.apply(e,s||[]);return i=e=s=null,t}},t||1)}function l(t){var i=!0;return function(){i&&(i=!1,t.apply(this,arguments))}}f.F=function(){},H.extend=function(t,i,e){if(t.$protoWait)return A.insertAt.call(t.$protoWait,i,1),t;for(var s in i)s in t&&!e||(t[s]=i[s]);return i.defaults&&H.extend(t.defaults,i.defaults),i.$init&&i.$init.call(t),t};var _=(new Date).valueOf();function z(){return++_}function D(t){return"string"==typeof t?document.getElementById(t):t}function p(t){return H.extend(t||[],A,!0)}function m(t,i){if("string"!=typeof t)return t;var e=t.replace("()","");return i&&i[e]?i[e]:window[e]||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 A={removeAt:function(t,i){0<=t&&this.splice(t,i||1)},remove:function(t){this.removeAt(this.find(t))},insertAt:function(t,i){i||0===i?this.splice(i,0,t):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 e=0;e<this.length;e++)t.call(i||this,this[e])},map:function(t,i){for(var e=0;e<this.length;e++)this[e]=t.call(i||this,this[e]);return this},filter:function(t,i){for(var e=0;e<this.length;e++)t.call(i||this,this[e])||(this.splice(e,1),e--);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 e=m(t[i],this.$scope),s=i.indexOf("->");-1!==s?this[i.substr(0,s)].attachEvent(i.substr(s+2),C(e,this)):this.attachEvent(i,e)}},callEvent:function(t,i){var e=this.P||this;if(this.V.R)return!0;t=t.toLowerCase();var s=this.V[t.toLowerCase()],n=!0;if(s)for(var h=0;h<s.length;h++)!1===s[h].apply(e,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,e){t=t.toLowerCase(),e=e||z(),i=m(i,this.$scope);var s=this.V[t]||p();return arguments[3]?s.unshift(i):s.push(i),this.V[t]=s,this.H[e]={f:i,t:t},e},detachEvent:function(t){if(this.H[t]){var i=this.H[t].t,e=this.H[t].f;this.V[i].remove(e),delete this.H[t]}else{var s=(t+"").toLowerCase();this.V[s]&&(this.V[s]=p())}},hasEvent:function(t){t=t.toLowerCase();var i=this.V[t];if(i&&i.length)return!0;var e=this.B[t];return!!e&&e.hasEvent(t)}},w={};H.extend(w,g,!0);var I=function(t,i){return w.callEvent(t,i)},T=function(t,i,e,s){return w.attachEvent(t,i,e,s)},F=function(t){return w.detachEvent(t)},V=0,R={},P={};function j(){V||(V=document.onselectstart),document.onselectstart=tt}function E(){0!==V&&(document.onselectstart=V||null),V=0}function N(t){for(var i=0;t=t.previousSibling;)i++;return i}function L(t,i){var e="";for(var s in i=i||"",t)e+=s+":"+t[s]+";";var n=P[e+i];return n||(O("."+(n="s"+z())+(i||"")+"{"+e+"}"),P[e+i]=n),n}function O(t,i){var e=i?R[i]:R["default"];e||((e=document.createElement("style")).setAttribute("type","text/css"),e.setAttribute("media","screen,print"),document.getElementsByTagName("head")[0].appendChild(e),i?R[i]=e:R["default"]=e),e.styleSheet?e.styleSheet.cssText+=t:e.appendChild(document.createTextNode(t))}function U(t){var i=R[t||"default"];i&&(i.innerHTML="")}function Y(t,i,e){i=i||{};var s=document.createElement(t);for(var n in i)s.setAttribute(n,i[n]);return i.style&&(s.style.cssText=i.style),i["class"]&&(s.className=i["class"]),e&&(s.innerHTML=e),s}function W(t){return(t=D(t))?x(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,e){t&&(i&&i.parentNode?i.parentNode.insertBefore(t,i):e.appendChild(t))}function q(t,i){var e;for(e=t.tagName?t:(t=t||event).target||t.srcElement;e;){if(e.getAttribute){var s=e.getAttribute(i);if(s)return s}e=e.parentNode}return null}function J(t){if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),e=document.body,s=document.documentElement,n=window.pageYOffset||s.scrollTop||e.scrollTop,h=window.pageXOffset||s.scrollLeft||e.scrollLeft,r=s.clientTop||e.clientTop||0,o=s.clientLeft||e.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 K(t){return x((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,e){if(document.createEventObject){var s=document.createEventObject();t.fireEvent&&t.fireEvent("on"+e,s)}else{var n=document.createEvent(i);n.initEvent(e,!0,!0),t.dispatchEvent&&t.dispatchEvent(n)}}function et(t,i,e){e&&-1!==t.className.indexOf(i)||(t.className+=" "+i)}function st(t,i){t.className=t.className.replace(RegExp(" "+i,"g"),"")}function nt(t,i,e){var s=Y("DIV",{"class":"webix_view webix_measure_size "+(i||"")},"");s.style.cssText="height:auto;visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;"+(e?"width:"+e+"px;":"width:auto;white-space:nowrap;"),document.body.appendChild(s);for(var n="object"!==k(t)?[t]:t,h=0,r=0,o=0;o<n.length;o++)s.innerHTML=n[o],h=Math.max(h,s.offsetWidth),r=Math.max(r,s.offsetHeight);return G(s),{width:h,height:r}}function ht(t,i){var e=!1;if("object"==k(t)){if(window.navigator.msSaveBlob)return window.navigator.msSaveBlob(t,i);t=window.URL.createObjectURL(t),e=!0}var s=document.createElement("a");s.href=t,s.download=i,document.body.appendChild(s),s.click(),$(function(){e&&window.URL.revokeObjectURL(t),document.body.removeChild(s),s.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,e){if(i=i||0,e=e||i,t.focus(),t.setSelectionRange)t.setSelectionRange(i,e);else{var s=t.createTextRange();s.collapse(!0),s.moveEnd("character",e),s.moveStart("character",i),s.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(),e=t.createTextRange();e.moveToBookmark(i);var s=e.text.length;e.collapse(!0),e.moveStart("character",-t.value.length);var n=e.text.length;return{start:n,end:n+s}}function ut(t,i){document.getElementsByTagName("head").item(0).appendChild(Y("meta",{name:t,content:i}))}var ct={parseFormat:"%Y-%m-%d %H:%i:%s",parseTimeFormat:"%H:%i:%s"};function ft(t){var i,e=Date.prototype.toJSON;return Date.prototype.toJSON=function(){return ct.parseFormatStr(this)},i=t instanceof Date?t.toJSON():JSON.stringify(t),Date.prototype.toJSON=e,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,e,n=this,h=0,r=0,s=[];(n.promise=n).resolve=function(t){return i=n.fn,e=n.er,h||(r=t,h=1,pt(u)),n},n.reject=function(t){return i=n.fn,e=n.er,h||(r=t,h=2,pt(u)),n},n.j=1,n.then=function(t,i){if(1!=this.j)throw TypeError();var e=new mt;return e.fn=t,e.er=i,3==h?e.resolve(r):4==h?e.reject(r):s.push(e),e},n["finally"]=function(i){var e,t=function(t){return e=t,i()},s=function(){return e};return n.then(t,t).then(s,s)},n["catch"]=function(t){return n.then(null,t)},n.fail=function(t){return n.then(null,t)};var o=function(t){h=t||4;for(var i=0;i<s.length;i++){var e=s[i];3==h&&e.resolve(r)||e.reject(r)}};try{"function"==typeof t&&t(n.resolve,n.reject)}catch(Vo){n.reject(Vo)}return n;function a(t,i,e,s){if(2==h)return s();if("object"!=k(r)&&"function"!=typeof r||"function"!=typeof t)s();else try{var n=0;t.call(r,function(t){n++||(r=t,i())},function(t){n++||(r=t,e())})}catch(Vo){r=Vo,e()}}function u(){var t;try{t=r&&r.then}catch(Vo){return r=Vo,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 e&&(r=e(r),h=1)}catch(Vo){return r=Vo,o()}r==n?(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(e){if(
1!=this.j)throw TypeError();return new mt(function(t,i){i(e)})},mt.all=function(e){if(1!=this.j)throw TypeError();if(!(e instanceof Array))return mt.reject(TypeError());var s=new mt;return function n(t,i){return i?s.resolve(i):t?s.reject(t):(0==e.reduce(function(t,i){return i&&i.then?t+1:t},0)&&s.resolve(e),void e.map(function(t,i){t&&t.then&&t.then(function(t){return e[i]=t,n(),t},n)}))}(),s},mt.race=function(e){if(1!=this.j)throw TypeError();if(!(e instanceof Array))return mt.reject(TypeError());if(0==e.length)return new mt;var s=new mt;return function n(t,i){return i?s.resolve(i):t?s.reject(t):(0==e.reduce(function(t,i){return i&&i.then?t+1:t},0)&&s.resolve(e),void e.map(function(t){t&&t.then&&t.then(function(t){n(null,t)},n)}))}(),s},mt.j=1;var bt={N:function(t){return t&&t.documentElement?t.getElementsByTagName("parsererror").length?null:t:null},toObject:function(t,i){var e=i?i.rawxml?i.rawxml():i:null;return this.N(e)?e:(e="string"==typeof t?this.fromString(t.replace(/^[\s]+/,"")):t,this.N(e)?e: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 e=t;-1==t.nodeName.indexOf("document")&&(t=t.ownerDocument);for(var s=[],n=t.evaluate(i,e,null,XPathResult.ANY_TYPE,null),h=n.iterateNext();h;)s.push(h),h=n.iterateNext();return s}var r=!0;try{"undefined"==typeof t.selectNodes&&(r=!1)}catch(Vo){}if(r)return t.selectNodes(i);var o=i.split("/").pop();return t.getElementsByTagName(o)},assignTypes:function(t){for(var i in t){var e=t[i];if("object"==k(e))this.assignTypes(e);else if("string"==typeof e){if(""===e)continue;"true"==e?t[i]=!0:"false"==e?t[i]=!1:e==1*e&&(t[i]=1*t[i])}}return t},tagToObject:function(t,i){var e=0;if(1==t.nodeType&&t.getAttribute("stack")){i=[];for(var s=t.childNodes,n=0;n<s.length;n++)1==s[n].nodeType&&i.push(this.tagToObject(s[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,e=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],{}),e=2}if(!e)return this.nodeValue(t);e<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(Vo){return null}}},gt={toObject:function(t){if(!t)return null;if("string"==typeof t)try{if(this.parseDates){var e=/\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&&e.test(i)?new Date(i):i})}else t=JSON.parse(t)}catch(Vo){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)})};function wt(t,i,e){return 0!==arguments.length?(new wt).get(t,i,e):this&&this.getXHR?this:new wt}wt.count=0,wt.prototype={master:null,getXHR:function(){return new XMLHttpRequest},stringify:function(t){return ft(t)},O:function(t,i,s,e){var n;i&&(b(i)||"function"==typeof(i.success||i.error||i))&&(n=s,s=i,i=null);var h=mt.defer(),r=this.getXHR(),o=this.U||{};if(!I("onBeforeAjax",[e,t,i,r,o,null,h]))return h.reject(r);var a=!1;if(
"GET"!==e){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"===e&&(t=t+(-1!=t.indexOf("?")?"&":"?")+i,i=null),r.open(e,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||n,r.onreadystatechange=function(){if(!r.readyState||4==r.readyState){wt.count++;var t,i,e=400<=r.status||0===r.status;i="blob"==r.responseType||"arraybuffer"==r.responseType?(t="",r.response):(t=r.responseText||"",p.G(r)),e?(I("onAjaxError",[r]),h.reject(r)):h.resolve(i),s&&wt.$callback(p.master||window,s,t,i,r,e)}},this.X&&(r.timeout=this.X),this.Y?r.send(i||null):setTimeout(function(){r.send(i||null)},1),this.master&&!this.Y&&h.then(function(t){return p.master=null,s=p=n=null,t}),this.Y?r:h},G:function(t){return{xml:function(){try{return bt.tagToObject(bt.toObject(t.responseText,this))}catch(Vo){t.responseText,Vo.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,e){return this.O(t,i,e,"GET")},post:function(t,i,e){return this.O(t,i,e,"POST")},put:function(t,i,e){return this.O(t,i,e,"PUT")},del:function(t,i,e){return this.O(t,i,e,"DELETE")},patch:function(t,i,e){return this.O(t,i,e,"PATCH")},sync:function(){return this.Y=!0,this},timeout:function(t){return this.X=t,this},response:function(t){return this.W=t,this},headers:function(t){return this.U=H.extend(this.U||{},t),this},bind:function(t){return this.master=t,this}},wt.$callback=function(t,i,e,s,n,h){if(!t.$destructed&&(-1===n&&s&&"function"==typeof s.json&&(s=s.json()),h&&I("onAjaxError",[n]),i)){var r=i.success||i;h&&(r=i.error),r&&r.call&&r.call(t,e,s,n)}};var xt={collapseNames:function(t,i,e,s){if(e=e||{},i=i||"",s=s||function(){return!0},!t||"object"!=k(t))return null;for(var n in t){var h=t[n],r=i+n;h&&"object"==k(h)&&!y(h)&&!b(h)&&s(r,h)?xt.collapseNames(h,r+".",e,s):e[r]=h}return e},expandNames:function(t){var i,e,s,n,h,r={};for(h in t){for(e=(s=h.split(".")).length-1,n=r,i=0;i<e;i++)n[s[i]]||(n[s[i]]={}),n=n[s[i]];n[s[e]]=t[h]}return r}},yt={},Mt={},St=new RegExp("(\\r\\n|\\n)","g"),kt=new RegExp('(\\")',"g"),Ct=new RegExp("(\\\\)","g"),$t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Dt=/[&<>"'`]/g,At=function(t){return $t[t]||"&amp;"};function It(e){if("function"==typeof e)return e;if(yt[e])return yt[e];if(-1!=(e=(e||"").toString()).indexOf("->")){var t=e.split("->");switch(t[0]){case"html":e=W(t[1]);break;case"http":e=(new wt).sync().get(t[1],{uid:z()}).responseText}}if(e=(e||"").toString(),S.strict){if(!Mt[e]){Mt[e]=[];var h=[];if(e.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,function(t,i,e,s,n){h.push({pos:n,str:t,fn:function(t){return t[i]?e:s}})}),e.replace(/\{common\.([^}(]*)\}/g,function(t,e,i){h.push({pos:i,str:t,fn:function(t,i){return i[e]||""}})}),e.replace(/\{common\.([^}(]*)\(\)\}/g,function(t,e,i){h.push({pos:i,str:t,fn:function(t,i){return i[e]?i[e].apply(this,arguments):""}})}),e.replace(/\{obj\.([^:}]*)\}/g,function(t,i,e){h.push({pos:e,str:t,fn:function(t){return t[i]}})}),e.replace("{obj}",function(t,i){h.push({pos:i,str:t,fn:function(t){return t}})}),e.replace(/#([^#'";, ]+)#/gi,function(t,i,e){"!"==i.charAt(0)?(i=i.substr(1),h.push({pos:e,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=xt.collapseNames(t)),It.escape(t[i])}})):h.push({pos:e,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=xt.collapseNames(t)),t[i]}})}),h.sort(function(t,i){return t.pos>i.pos?1:-1}),h.length){for(var i=0,s=function(t,i,e){Mt[t].push(function(){return t.slice(i,e)})},n=0;n<h.length;n++){
var r=h[n].pos;s(e,i,r),Mt[e].push(h[n].fn),i=r+h[n].str.length}s(e,i,e.length)}else Mt[e].push(function(){return e})}return function(){for(var t="",i=0;i<Mt[e].length;i++)t+=Mt[e][i].apply(this,arguments);return t}}var o=!1;e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(Ct,"\\\\")).replace(St,"\\n")).replace(kt,'\\"')).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 "'+e+'";');yt[e]=function(t,i,e,s){return a(t,i,e,s,It)}}else yt[e]=Function("obj","common",'return "'+e+'";')}catch(Vo){}return yt[e]}function Tt(t,i){if(t.$protoWait)return t.q||(t.q=[]),void t.q.push(i);"function"==typeof t&&(t=t.prototype),t.types||(t.types={"default":t.type},t.type.name="default");var e=i.name,s=t.type;for(var n in e&&(s=t.types[e]=f(i.baseType?t.types[i.baseType]:t.type)),i)0===n.indexOf("template")?s[n]=It(i[n]):s[n]=i[n];return e}It.escape=function(t){return t===undefined||null===t?"":(t.toString()||"").replace(Dt,At)},It.empty=function(){return""};var Ft={};function zt(t,i,e){var s;M.w++;var n=M.i;M.i=t.$scope||n;try{s=function l(t,i,e){var s,n=b(t),h=D(t.container||i||document.body);h.J&&(e=function f(t,i,e){var s=[t];if(i)s=t.getChildViews();else if(t.K)s=[t.K];else{if("number"==typeof e)return e;if(e)return Ht(s=[Pt(e)]),s[0].config.id}return Ht(s),e}(h,n,e));var r=!1,o=h==document.body;t.J||h&&n?(s=t,r=!0):(h&&o&&(t.$topView=!0),t.Z||(t.Z={}),i&&i.getParentView&&(M._=e||0===e?i:i.getParentView()),s=Rt(t));!o||s.setPosition||s.$apiOnly||d("_fixHeight")();if(s.J&&s.J.Q&&!h.$view)s.J.tt=h;else if(!s.$apiOnly)if(h.appendChild)Vt(h,s,t);else if(h.destructor){var a=h;if(e||0===e||b(s)||(h=(e=h).getParentView()),h&&h.it){if(r&&s.getParentView){var u=s.getParentView();u&&u.et&&u.et(s),s._=h,s.$scope=h.$scope}h.it(s,e)}else{var c=a.$view.parentNode;a.destructor(),Vt(c,s,t)}}else t.container;return s}(t,i,e)}finally{M.w--,M.i=n}return s}function Vt(t,i,e){t.appendChild(i.st),i.getParentView()||(((!i.setPosition||i.J.fullscreen)&&t==document.body||i.J.position)&&M.top_views.push(i.nt),e.skipResize||i.adjust())}function Ht(t){for(var i=t.length-1;0<=i;i--){var e=t[i];delete Ft[e.config.id],e.config.id="x"+z(),(Ft[e.config.id]=e).getChildViews&&Ht(e.getChildViews()),e.ht&&Ht(e.ht)}}function Bt(t,i){var e=zt[t];return!!e&&(e.$protoWait&&(e=e.call(-1)),!!zt[t].prototype[i])}function Rt(t){if(t.view){var i=t.view;return new zt[i](t)}if(t.rows||t.cols){for(var e=t.rows||t.cols,s=!1,n=0;n<e.length;n++)!e[n].body||e[n].view||e[n].align||(s=!0);return s?new zt.headerlayout(t):new zt.layout(t)}return t.cells?new zt.multiview(t):t.template||t.content?new zt.template(t):t.align&&t.body?new zt.align(t):new zt.spacer(t)}function Pt(t){if(!t)return null;if(Ft[t])return Ft[t];var i=t;if("object"==k(t)){if(t.J)return t;i=t.target||t.srcElement||t}return Ft[q({target:D(i)},"view_id")]}zt.views=Ft,zt.rt=Rt,"undefined"==typeof window.$$&&(window.$$=Pt),H.protoUI=function(){var h=arguments[0].name,r=function(t){if(!r)return zt[h].prototype;var i=r.$protoWait;if(i){for(var e=[i[0]],s=1;s<i.length;s++)e[s]=i[s],e[s].$protoWait&&(e[s]=e[s].call(-1,e[s].name)),e[s].prototype&&e[s].prototype.name&&(zt[e[s].prototype.name]=e[s]);if(zt[h]=H.proto.apply(-1,e),r.q)for(var n=0;n<r.q.length;n++)Tt(zt[h],r.q[n]);r=i=null}return-1!=this?new zt[h](t):zt[h]};return r.$protoWait=Array.prototype.slice.call(arguments,0),zt[h]=r},H.proto=function(){for(var t=arguments,i=t[0],e=!!i.$init,s=[],n=t.length-1;0<n;n--){if(t[n],"function"==typeof t[n]&&(t[n]=t[n].prototype),t[n].$init&&s.push(t[n].$init),t[n].defaults){var h=t[n].defaults;for(var r in i.defaults||(i.defaults={}),h)x(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])}e&&s.push(i.$init),i.$init=function(){for(var t=0;t<s.length;t++)s[t].apply(this,arguments)},i.$skin&&i.$skin();var u=function(t){this.$ready=[],this.$init,this.$init(t),this.ot&&this.ot(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},T("onClick",function(t){var i=Pt(t);if(i&&i.touchable){d("UIManager").applyChanges(i),i.getNode(t);var e=t.target||t.srcElement;if("webix_disabled"==e.className)return;var s="";if(e.className&&0===e.className.toString().indexOf("webix_view"))return;for(i&&d("UIManager").at(i);e&&e.parentNode;){if(e.getAttribute){if(e.getAttribute("view_id"))break;if(s=e.className){s=s.toString().split(" ");for(var n=0;n<s.length;n++){if(i.on_click[s[n]])if(!1===i.on_click[s[n]].call(i,t,i.J.id,e))return}}}e=e.parentNode}if(i.J.click){var h=m(i.J.click,i.$scope);h&&h.call&&h.call(i,i.J.id,t)}var r=i.J.popup;i.J.popup&&!i.J.readonly&&("object"!=k(r)||r.name||(r=i.J.popup=zt(r).J.id),(r=Pt(r)).isVisible()||(r.J.master=i.J.id,r.show(i.getInputNode()||i.getNode(),null,!0))),i.callEvent("onItemClick",[i.J.id,t])}});var jt={};function Et(){for(var t in jt)Ot(t)}function Nt(t,i,e,s){(s=s||{}).inner=!0,Lt(t,i,e,s)}function Lt(t,i,e,s){s=s||{},t=D(t);var n=s.id||z();s.bind&&(e=C(e,s.bind));var h=[t,i,e,s.capture];s.inner||(jt[n]=h);var r=!!s.capture;return!x(s.passive)&&S.passiveEventListeners&&(r={passive:s.passive,capture:r}),t.addEventListener?t.addEventListener(i,e,r):t.attachEvent&&t.attachEvent("on"+i,h[2]=function(){return e.apply(t,arguments)}),n}function Ot(t){if(t){jt[t];var i=jt[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 jt[t]}}var Ut={$init:function(t){if(t.activeContent)for(var i in this.$ready.push(this.ut),this.ct={},this.ft={},this.lt={},this.dt={},t.activeContent)if(this[i]=this.vt(i),t.activeContent[i].earlyInit){var e=M._;M._=null,this[i].call(this,{},this,t.activeContent),M._=e}},_t:function(){for(var t in this.dt){var i=this.dt[t];i.destructor&&i.destructor()}},ut:function(){if(this.attachEvent("onDestruct",C(this._t,this)),Nt(this.$view,"blur",function(t){if("BUTTON"!=(t.target||t.srcElement).tagName){var i=Pt(t);if(i&&i!==this&&i.getValue&&i.setValue){i.getNode(t);var e=i.getValue();e!=i.J.value&&i.setValue(e)}}},{bind:this,capture:!0}),this.filter){for(var t in this.J.activeContent)this.type[t]=this[t],this[t]=this.pt(t);this.attachEvent("onBeforeRender",function(){this.type.masterUI=this}),this.type.masterUI=this}},pt:function(h){return function(t){for(var i=this.dt[h],e=i.J.id,s=this.getItemNode(t).getElementsByTagName("DIV"),n=0;n<s.length;n++)if(s[n].getAttribute("view_id")==e){i.st=i.mt=s[n];break}return i}},bt: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.gt(n,i),r.locate){var e=r.locate(i.parentNode),s=r.lt[h][e];n.J.value=s,n.J.$masterId=e}return i}i=i.parentNode}return n.st}},wt:function(s,n){return function(t){var i=n.data;if(n.filter){var e=n.locate(this.st.parentNode);i=n.getItem(e),this.refresh(),n.ft[s][e]=this.st.outerHTML||(new XMLSerializer).serializeToString(this.st),n.lt[s][e]=t}i&&(i[s]=t)}},vt:function(o){return function(t,i,e){var s=i.ct?i:i.masterUI;if(!s.ct[o]){var n=document.createElement("DIV"),h=zt((e=e||s.J.activeContent)[o],n);S.isIE8?n.firstChild.setAttribute("onclick","event.processed = true; event.srcElement.w_view = '"+h.J.id+"';"):n.firstChild.setAttribute("onclick","event.processed = true; "),h.getNode=s.bt(h,o,s),h.attachEvent("onChange",s.wt(o,s)),s.dt[o]=h,s.ct[o]=n.innerHTML,s.ft[o]={},s.lt[o]={},h.$activeEl=h.$view}if(s.filter&&t[o]!=s.lt[o]&&!x(t[o])){var r=s.dt[o];r.blockEvent(),s.gt(r,r.$activeEl),r.$view.firstChild||r.refresh(),r.setValue(t[o]),r.refresh(),r.unblockEvent(),s.lt[o][t.id]=t[o],s.ft[o][t.id]=r.st.outerHTML||(new XMLSerializer).serializeToString(r.st)}return s.ft[o][t.id]||s.ct[o]}},gt:function(t,i){
t.mt=t.st=t.$view=i}},Yt={$proxy:!0,load:function(){var i=this.source.split("@"),e=i[0].split(".").pop();return wt().response("arraybuffer").get(i[0]).then(function(t){return{data:t,options:{ext:e,dataurl:i[1]}}})}},Wt={$proxy:!0,connectorName:"!nativeeditor_status",load:function(){return wt(this.source)},saveAll:function(t,i){for(var e=this.source,s={},n=[],h=0;h<i.length;h++){var r=i[h];for(var o in n.push(r.id),r.data)0!==o.indexOf("$")&&(s[r.id+"_"+o]=r.data[o]);s[r.id+"_"+this.connectorName]=r.operation}return s.ids=n.join(","),s.webix_security=M.securityKey,e+=-1==e.indexOf("?")?"?":"&",e+="editing=true",wt().post(e,s).then(function(t){if(!(t=t.xml()))throw"Data loading error";var i=t.data.action;i.length||(i=[i]);for(var e=[],s=0;s<i.length;s++){var n=i[s];n.status=n.type,n.id=n.sid,n.newid=n.tid,e.push(n)}return e})}},Gt={$proxy:!0,load:function(){},save:function(t,i,e){$(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};e.processResult(t,t)})}},Xt={$proxy:!0,init:function(){this.clientId=this.clientId||z()},load:function(e){var t=this.clientId;this.client.subscribe(this.source,function(i){i.clientId!=t&&d("dp")(e).ignore(function(){if("delete"==i.operation)e.remove(i.data.id);else if("insert"==i.operation)e.add(i.data);else if("update"==i.operation){var t=e.getItem(i.data.id);t&&(H.extend(t,i.data,!0),e.refresh(t.id))}})})},save:function(t,i){i.clientId=this.clientId,this.client.publish(this.source,i)}},qt={$proxy:!0,create:function(t,r,i,e){this.source=t+"/",this.xt(e,i,function(t){var i=t.target.result;for(var e in r)for(var s=r[e],n=i.createObjectStore(e,{keyPath:"id",autoIncrement:!0}),h=0;h<s.length;h++)n.put(s[h])})},xt:function(i,t,e){if(-1!=this.source.indexOf("/")){var s=this.source.split("/");this.source=s[1],t=t||s[2];var n,h=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB;n=t?h.open(s[0],t):h.open(s[0]),e&&(n.onupgradeneeded=e),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.xt,this,[i],50)},load:function(){var s=mt.defer();return this.xt(function(){var t=this.db.transaction(this.source).objectStore(this.source),e=[],i=t.openCursor();i.onsuccess=function(t){var i=t.target.result;i?(e.push(i.value),i["continue"]()):s.resolve(e)},i.onerror=function(t){s.reject(t)}}),s},save:function(t,h){var r=mt.defer();return this.xt(function(){var t,e=h.operation,i=h.data,s=h.id,n=this.db.transaction([this.source],"readwrite").objectStore(this.source);"delete"==e?t=n["delete"](s):"update"==e?t=n.put(i):"insert"==e&&(delete i.id,t=n.add(i)),t.onsuccess=function(t){var i={status:e,id:h.id};"insert"==e&&(i.newid=t.target.result),r.resolve(i)},t.onerror=function(t){r.reject(t)}}),r}},Jt={$proxy:!0,load:function(){return wt(this.source)},save:function(t,i){return Jt.yt.call(this,i,wt())},yt:function(t,i){var e=this.source,s="",n=e.indexOf("?");-1!==n&&(s=e.substr(n),e=e.substr(0,n)),e+="/"==e.charAt(e.length-1)?"":"/";var h=t.operation,r=t.data;return"insert"==h&&delete r.id,"update"==h?i.put(e+r.id+s,r):"delete"==h?i.del(e+r.id+s,r):i.post(e+s,r)}},Kt={$proxy:!0,load:function(){return wt(this.source)},save:function(t,i){var e=wt().headers({"Content-Type":"application/json"});return Jt.yt.call(this,i,e)}},Zt={$proxy:!0,load:function(t,i){return i=H.extend(i||{},this.params||{},!0),wt().post(this.source,i)}},Qt={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={},e=0;e<t.length;e++)i["data"+e]=t[e];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},getOptions:function(){return!1},getInfo:function(){return{size:0}},idColumn:null},ti={toObject:function(t){if("string"!=typeof t)return t;var i=null;return-1==t.indexOf("<")&&(i=D(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"},ii={toObject:function(t){(t=D(t)).tagName.toLowerCase();var i=t.rows;return G(t),i},getRecords:function(t){for(var i=[],e=t[0]&&t[0].Mt?1:0;e<t.length;e++)i.push(t[e]);return i},getDetails:function(t){var i=t.getElementsByTagName("td");t={};for(var e=0;e<i.length;e++)t["data"+e]=i[e].innerHTML;return t},getInfo:function(){return{size:0}},getOptions:function(){},getConfig:function(t){var i=[],e=t[0].getElementsByTagName("th");e.length&&(t[0].Mt=!0);for(var s=0;s<e.length;s++){var n={id:"data"+s,header:this.St(e[s].innerHTML)},h=this.kt(e[s]);n=H.extend(n,h),i.push(n)}return i},St:function(t){var i=t.indexOf("json://");return-1!=i&&(t=JSON.parse(t.substr(i+7))),t},kt:function(t){for(var i=t.attributes,e={},s=0;s<i.length;s++)e[i[s].nodeName]=this.St(i[s].nodeValue);return e.width=parseInt(e.width,10),e}},ei={};function si(i,t,e){var s=mt.defer();if(t&&!0!==t&&(s=s.then(function(){t.call(e||this)})),si.disabled)return s.resolve(),s;if("string"!=typeof i){var n=i.length||0;if(n){var h=function(){n?(n--,si(i[i.length-n-1],h,e)):s.resolve()};h()}else{for(var r in i)n++;var o=function(){0===--n&&s.resolve()};for(var a in i)si(a,o,e)}return s}if(!0!==ei[i]){var u=i,c=i.split("?");if(".css"==c[0].substr(c[0].length-4)){var f=Y("LINK",{type:"text/css",rel:"stylesheet",href:u});return document.getElementsByTagName("head")[0].appendChild(f),s.resolve(),s}if(!0===t)v(wt().sync().get(u).responseText),ei[i]=!0;else if(ei[i])ei[i].push(s);else{ei[i]=[s];var l=document.createElement("script"),d=ei[i];l.onerror=function(){ei[i]=!1;for(var t=0;t<d.length;t++)d[t].reject()},l.onload=function(){ei[i]=!0;for(var t=0;t<d.length;t++)d[t].resolve()},document.getElementsByTagName("head")[0].appendChild(l),l.src=u}}else s.resolve();return s}var ni=H.extend({toObject:function(t){if(t.excel)return t;var i=t.options||{};i.dataurl&&H.extend(i,this.Ct(i.dataurl)),t=t.data||t;var e=mt.defer();if(t.name){i.ext=t.name.split(".").pop();var s=new FileReader;s.onload=C(function(t){e.resolve(this.parseData(t.target.result,i))},this),s.readAsArrayBuffer(t)}else e.resolve(this.parseData(t,i));return e},parseData:function(t,e){t=new Uint8Array(t);for(var s=[],i=0;i!=t.length;++i)s[i]=String.fromCharCode(t[i]);var n=(e.ext||e).toLowerCase();return"xls"!=n&&(n="xlsx"),si(S.cdn+"/extras/xlsx.core.styles.min.js").then(C(function(){var t="xls"==n?XLS.read(s.join(""),{type:"binary",cellStyles:!0,cellDates:!0}):XLSX.read(s.join(""),{type:"binary",cellStyles:!0,cellDates:!0}),i={sheets:t.Sheets,names:t.SheetNames,options:e,ranges:t.Workbook&&t.Workbook.Names||[]};return H.extend(this.getSheet(i,e),i)},this))},getSheet:function(t,i){var e=i.name||t.names[0];return t=this.sheetToArray(t.sheets[e],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 e=[],s=[],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("");e.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])&&s.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:e,spans:s,styles:n,sizes:h,excel:!0}},Ct:function(t){var i=t.split("["),e={};if(e.name=i[0],i[1]){var s=i[1].split(/[^0-9]+/g);s[0]=1*s[0]||0,s[1]=1*s[1]||9999999,e.rows=s}return e}},Qt),hi={json:gt,jsarray:Qt,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={},e=0;e<t.length;e++)i["data"+e]=t[e];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:ti,htmltable:ii,excel:ni},ri={prefix:function(e,s){return e+=".",{put:function(t,i){return s.put(e+t,i)},get:function(t){return s.get(e+t)},remove:function(t){return s.remove(e+t)}}}};ri.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?hi.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.localStorage&&window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}},ri.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?hi.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.removeItem(t)},clear:function(){window.sessionStorage.clear()}},ri.cookie={put:function(t,i,e,s){t&&window.JSON&&(document.cookie=t+"="+escape(ft(i))+(s&&s instanceof Date?";expires="+s.toUTCString():"")+(e?";domain="+e:"")+(S.https?";secure":""))},getRaw:function(t){for(var i=document.cookie.split(";"),e="",s="",n=0;n<i.length;n++){if((e=i[n].split("="))[0].replace(/^\s+|\s+$/g,"")==t)return!0,1<e.length&&(s=unescape(e[1].replace(/^\s+|\s+$/g,""))),s;e=null,""}return null},get:function(t){if(t&&window.JSON){var i=this.getRaw(t);return i?hi.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(";"),e=0;e<i.length;e++)document.cookie=/^[^=]+/.exec(i[e])[0]+"="+(t?";domain="+t:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};var oi={$proxy:!0,storage:ri.local,cache:!1,local:!1,data:"",$t:function(){this.cache||S.offline||(I("onOfflineMode",[]),S.offline=!0)},Dt:function(){!this.cache&&S.offline&&(S.offline=!1,I("onOnlineMode",[]))},At:function(t){this.Dt(),this.setCache(t)},It:function(t){this.$t();var i=this.getCache()||this.data;t.parse(i)},load:function(t){var i,e=this;if(!this.cache||!this.getCache())return(i=this.source.$proxy?this.source.load(t):wt().get(this.source))&&i.then&&i.then(function(t){e.At(t.text())},function(){e.It(t)}),i;this.It(t)},getCache:function(){return this.storage.get(this.Tt())},clearCache:function(){this.storage.remove(this.Tt())},setCache:function(t){this.storage.put(this.Tt(),t)},Tt:function(){return this.source.$proxy?this.source.source+"_$proxy$_data":this.source+"_$proxy$_data"},save:function(t,i,e){if(!S.offline&&!this.cache)return this.source.$proxy?this.source.save(t,i,e):wt().post(this.source,i.data)},saveAll:function(t,i){this.setCache(t.serialize()),i=this.cache||S.offline?i:[];for(var e=0;e<i.length;e++)i[e]={id:i[e].id,status:i[e].operation};return mt.resolve(i)}},ai={init:function(){H.extend(this,oi)},cache:!0},ui={init:function(){H.extend(this,oi)},cache:!0,local:!0,data:[]};var ci={$proxy:!0,save:function(t){return this.load(t)},load:function(t){var i={query:this.source};return 1===arguments.length&&(i.variables=t),wt().headers({"Content-type":"application/json"}).post(this.url,i).then(function(t){return function n(t){if(!t||"object"===!k(t)||Array.isArray(t))return t;var i="",e=0;for(var s in t){if(2==++e)return t;i=s}return t[i]}(t.json().data)})}};function fi(t,i,e){var s=B(fi[t]);return s.source=i,e&&H.extend(s,e,!0),s.init&&s.init(),s}fi.$parse=function(t){if("string"!=typeof t||-1==t.indexOf("->"))return t;var i=t.split("->");return fi(i[0],i[1])},fi.binary=Yt,fi.connector=Wt,fi.debug=Gt,fi.faye=Xt,fi.indexdb=qt,fi.json=Kt,fi.post=Zt,fi.rest=Jt,fi.offline=oi,fi.cache=ai,fi.local=fi.local=ui,fi.GraphQL=ci;var li={$init:function(t){this.data={},
this.waitData=mt.defer(),t&&(this.J.datatype=t.datatype||"json"),this.$ready.push(this.Ft)},Ft:function(){this.zt=!0,this.J.url&&this.url_setter(this.J.url),this.J.data&&this.data_setter(this.J.data)},url_setter:function(t){return t=fi.$parse(t),this.zt&&this.load(t,this.J.datatype),t},data_setter:function(t){return this.zt?(this.parse(t,this.J.datatype),!0):t},load:function(t,i){var e,s=this,n=arguments[2]||null;if(!this.callEvent("onBeforeLoad",[]))return mt.reject();"string"==typeof i?(this.data.driver=hi[i],i=arguments[2]):this.data.driver||(this.data.driver=hi.json),(e=(t=fi.$parse(t)).$proxy&&t.load?t.load(this,n):"function"==typeof t?t.call(this,n):wt().bind(this).get(t))&&!e.then&&(e=mt.resolve(e));var h=this.Vt;return e&&e.then&&e.then(function(t){if(s.$destructed||h&&s.Vt!==h)return mt.reject();s.Ht(t),i&&wt.$callback(s,i,"",t,-1)},function(t){return s.Bt(t,h)}),e},parse:function(t,i){if(t&&"function"==typeof t.then){var e=this.Vt;return t.then(C(function(t){if(this.$destructed||e&&this.Vt!==e)return mt.reject();this.parse(t,i)},this))}if(t&&t.sync&&this.sync)this.Rt(t);else{if(!this.callEvent("onBeforeLoad",[]))return mt.reject();this.data.driver=hi[i||"json"],this.Ht(t)}return mt.resolve()},Rt:function(t){this.data&&this.data.attachEvent("onSyncApply",C(function(){this.Pt&&this.Pt()},this)),this.sync(t)},jt:function(t){var i,e,s=this.data.driver;i=(e=s.getRecords(t)[0])?s.getDetails(e):{},this.setValues?this.setValues(i):this.data=i},Et:function(t){t?this.$onLoad&&this.$onLoad(t,this.data.driver)||(this.data&&this.data.jt?this.data.jt(t):this.jt(t)):this.Bt(t),this.Pt&&this.Pt(),this.callEvent("onAfterLoad",[]),this.waitData.resolve()},Ht:function(t){var i=this;t&&"function"==typeof t.text&&(t=t.text()),(t=this.data.driver.toObject(t))&&t.then?t.then(function(t){return i.Et(t)}):this.Et(t)},Bt:function(t,i){return this.$destructed||i&&this.Vt!==i||(this.callEvent("onAfterLoad",[]),this.callEvent("onLoadError",arguments)),I("onLoadError",[t,this]),mt.reject(t)},Nt:function(t){if(!this.J.dataFeed||this.Lt||!t)return!0;var i=this.J.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",[])&&wt(i,function(t,i,e){this.Lt=!0;var s=hi.json,n=s.toObject(t,i);n?this.setValues(s.getDetails(s.getRecords(n)[0])):this.Bt(e),this.Lt=!1,this.callEvent("onAfterLoad",[])},this),!1)}},di={Ot:function(t){return t.$empty?"":this.J.template(t,this)},render:function(){var t=this.J;return!!this.isVisible(t.id)&&(this.callEvent&&!this.callEvent("onBeforeRender",[this.data])||(this.data&&!t.content&&(this.mt.innerHTML="",this.mt.innerHTML=this.Ot(this.data)),this.callEvent&&this.callEvent("onAfterRender",[])),!0)},sync:function(i){this.Ut=!1,"DataStore"!=i.name&&(i.data&&"DataStore"==i.name?i=i.data:this.Ut=!0),this.Ut?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:It},vi={Yt:function(t){var i=1,e=0,s=this.J.dragscroll;"string"==typeof s&&(e=-1!=s.indexOf("x"),i=-1!=s.indexOf("y"));var n=this.Wt||this.$view,h=J(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.J;if(d.topSplit){var v=this.Gt(this.getIdByIndex(d.topSplit-1),this.columnId(0));r+=v.top+v.height}t.y<r+l?(this.Xt(c.x,c.y-2*l,t),f=!0):t.y>o-l&&(this.Xt(c.x,c.y+2*l,t),f=!0)}e&&(t.x<a+l?(this.Xt(c.x-2*l,c.y,t),f=!0):t.x>u-l&&(this.Xt(c.x+2*l,c.y,t),f=!0)),f&&(this.qt=$(this.Yt,this,[t],100))},Xt:function(t,i,e){this.callEvent("onBeforeAutoScroll",[e])&&this.scrollTo(t,i)}},_i={Jt:p(["dummy"]),Kt:0,delay:400,addTooltip:function(t,i){var e,s;(t=D(t))instanceof Element?(e=t,"string"==typeof i?e.setAttribute("webix_tooltip",i):s=i):(e=t.$view,s=t),s=s||this;var n=this.Jt.find(s);-1===n&&(n=this.Jt.length,this.Jt.push(s)),e.webix_tooltip=n,this.Kt++,this.Zt||(
this.Zt=new zt.tooltip({}),this.Qt=Lt(document,"mousemove",this.ti,{bind:this}),this.ii=Lt(document,"mouseleave",this.ei,{bind:this}),this.si=T("onDragMode",function(){_i.Kt&&_i.ei()}))},getTooltip:function(){return this.Zt},ti:function(t){for(var i,e=t.target||t.srcElement;e&&"HTML"!=e.tagName;){if(e.webix_tooltip)return this.ni&&this.ni!=e?(this.$tooltipOut(this.ni,e,t),void(this.ni=null)):(this.ni||(this.ni=this.$tooltipIn(e,t)),void this.$tooltipMove(e,t,i));i=i||e.getAttribute("webix_tooltip"),e=e.parentNode}this.ni&&(this.ni=this.$tooltipOut(this.ni,null,t))},ei:function(){clearTimeout(this.hi),this.Zt.hide()},getMaster:function(t){return this.Jt[t.webix_tooltip]},removeTooltip:function(t){var i;(i=(t=D(t))instanceof Element?t:t.$view).webix_tooltip&&(this.ni==i&&(this.ni=null),delete i.webix_tooltip,this.Kt--),!this.Kt&&this.Zt&&(this.Qt=Ot(this.Qt),this.ii=Ot(this.ii),this.si=F(this.si),this.Zt.destructor(),this.Zt=this.ni=null,this.Jt=p(["dummy"]))},$tooltipIn:function(t,i){var e=this.Jt[t.webix_tooltip];return e.$tooltipIn&&e!=this?e.$tooltipIn(t,i):(this.Zt.define({dx:20,dy:0,template:t.getAttribute("webix_tooltip")||"",css:""}),t)},$tooltipOut:function(t,i,e){var s=this.Jt[t.webix_tooltip];return s.$tooltipOut&&s!=this?s.$tooltipOut(t,i,e):(this.ei(),null)},$tooltipMove:function(t,i,e){var s=this.Jt[t.webix_tooltip];if(s.$tooltipMove&&s!=this)return s.$tooltipMove(t,i,e);this.Zt.hide(),clearTimeout(this.hi),this.hi=$(this.Zt.show,this.Zt,[e||{},Z(i)],this.delay)}};function pi(t){return"$"+t+(mi[t]=(mi[t]||0)+1)}var mi={},bi=!1;function gi(t,i){bi=!0;var e=t();return e&&e.then?e=e.then(function(t){return(bi=!1)!==i&&wi(),t}):(bi=!1)!==i&&wi(),e}function wi(){if(d("UIManager").applyChanges(),I("onClick",[]),M.ri=!0,!bi)for(var t=M.top_views.length-1;0<=t;t--)M.top_views[t].obj&&M.top_views[t].obj.resize();M.ri=!1}function xi(t,i,e,s){if(t)for(var n=s?[t]:t.getChildViews(),h=0;h<n.length;h++)!1!==i.call(e,n[h])&&xi(n[h],i,e)}function yi(){return S.zIndexBase++}function Mi(t){Si?t.call():ki.push(t)}Lt(window,"resize",function(){S.touch&&M.m&&new Date-M.m<1e3||wi()});var Si=!1,ki=[],Ci=document.getElementsByTagName("SCRIPT");Ci.length,Ci.length&&((Ci=(Ci[Ci.length-1].getAttribute("src")||"").split("/")).splice(Ci.length-1,1),S.codebase=Ci.slice(0,Ci.length).join("/")+"/");var $i=function(){S.isIE&&(document.body.className+=" webix_ie"),I("onReady",[])},Di=function(){Si=!0,window.webix_ready&&b(webix_ready)&&(ki=webix_ready.concat(ki));for(var t=0;t<ki.length;t++)ki[t].call();ki=[]};T("onReady",function(t){t?Di():$(Di)}),"complete"==document.readyState?$i():Lt(window,"load",$i),Mi(function(){Lt(document.body,"click",function(t){I("onClick",[t||Lt])})});var Ai={rt:null,oi:{},m:0,ai:0,ci:0,fi:{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},li:{input:1,button:1,textarea:1,select:1},di:function(){Lt(document.body,"click",C(this.vi,this)),Lt(document,"keydown",C(this._i,this)),Nt(document.body,"mousedown",C(function(){this.ci=new Date},this)),document.body.addEventListener&&Lt(document.body,"focus",this.pi,{capture:!0,bind:this}),M.destructors.push({obj:this})},destructor:function(){Ai.rt=null},getFocus:function(){return this.rt},at:function(t){this.mi=this.mi||t.J.id},setFocus:function(t,i,e){return(t=Pt(t))&&!t.$view&&(t=null),this.m=M.m=new Date,this.rt===t||(this.rt&&this.rt.callEvent&&this.rt.callEvent("onBlur",[this.rt]),t&&t.callEvent&&(t.callEvent("onFocus",[t,this.rt]),e&&t.callEvent("onTabFocus",[t,this.rt])),I("onFocusChange",[t,this.rt]),this.rt&&this.rt.blur&&!i&&this.rt.blur(),(this.rt=t)&&t.focus&&!i&&t.focus()),!0},applyChanges:function(t){var i=this.getFocus();i&&i!=t&&i.bi&&i.bi(t)},hasFocus:function(t){return t===this.rt},gi:function(t,i){var e=q(t,"view_id")||this.mi;if(e=Pt(e),this.mi=null,M.m=new Date,e!=this.rt)return i||(
this.mi=null),e?(e=Pt(e),this.canFocus(e)&&(e.getNode&&e.getNode(t),this.setFocus(e))):i||this.setFocus(null),!0},vi:function(t){return new Date-this.m<100?(this.mi=null,!1):this.gi(t)},pi:function(t){return!!this.li[t.target.nodeName.toLowerCase()]&&this.gi(t,!0)},canFocus:function(t){return t.isVisible()&&t.isEnabled()&&!t.queryView({disabled:!0},"parent")},wi:function(t){var i=this.getFocus();if(t&&!this.xi(t,i))return!1;this.yi("getPrev",t)||(this.rt=null)},Mi:{},xi:function(t,i){if(!t)return!1;if(!i)return!1;for(;i;){if(i===t)return!0;i=i.getParentView()}return!1},Si:function(){this&&this.callEvent&&this.callEvent("onTimedKeyPress",[])},ki:function(t){return t<112&&105<t},_i:function(t){var i=t.which||t.keyCode;95<i&&i<106&&(i-=48),i=this.Mi[i]||i;var e=t.ctrlKey,s=t.shiftKey,n=t.altKey,h=t.metaKey,r=this.Ci(i,e,s,n,h),o=this.getFocus();o&&o.callEvent&&(!1===o.callEvent("onKeyPress",[i,t])&&Q(t),o.hasEvent("onTimedKeyPress")&&(clearTimeout(o.$i),o.$i=$(this.Si,o,[],o.J.keyPressTimeout||250))),this.ki(i)||(r=this.Ci(String.fromCharCode(i),e,s,n,h));var a=!e&&!n&&!h&&9!=i&&27!=i&&13!=i;if(!1===this.Di(r,a,t))return Q(t),!1},yi:function(t){if(!this.getFocus())return null;t=t||"getNext";for(var i=this.getFocus(),e=i,s=z();;){if((i=this[t](i))&&this.canFocus(i))return this.setFocus(i);if(i===e||i.$fmarker==s)return null;i.$fmarker=s}},Ai:function(t,i){var e=!i.shiftKey;if(Ai.ai=new Date,t&&t.Ii&&!t.Ii(e,i))return!1;if(t&&t.Ti){if(t.editNext)return t.editNext(e);if(t.editStop)return t.editStop(),!0}else $(function(){Ai.setFocus(Pt(document.activeElement),!0,!0)},1)},getTop:function(t){for(var i,e=Pt(t);e&&(i=e.getParentView());)e=i;return e},getNext:function(t,i){var e=t.getChildViews();if(e.length&&!i)return e[0];var s=t.getParentView();if(!s)return t;var n=s.getChildViews();if(n.length)for(var h=A.find.call(n,t)+1;h<n.length;){if(this.canFocus(n[h]))return n[h];h++}return this.getNext(s,!0)},getPrev:function(t,i){var e=t.getChildViews();if(e.length&&i)return this.getPrev(e[e.length-1],!0);if(i)return t;var s=t.getParentView();if(!s)return this.getPrev(t,!0);var n=s.getChildViews();if(n)for(var h=A.find.call(n,t)-1;0<=h;){if(this.canFocus(n[h]))return this.getPrev(n[h],!0);h--}return s},addHotKey:function(t,i,e){var s=this.Fi(t);s.letter,e||(e=null),s.handler=i,s.view=e;var n=this.Ci(s.letter,s.ctrl,s.shift,s.alt,s.meta);return this.oi[n]||(this.oi[n]=[]),this.oi[n].push(s),t},removeHotKey:function(t,i,e){var s=this.Fi(t),n=this.Ci(s.letter,s.ctrl,s.shift,s.alt,s.meta);if(i||e){var h=this.oi[n];if(h){for(var r=h.length-1;0<=r;r--)e&&h[r].view!==e||i&&h[r].handler!==i||h.splice(r,1);h.length||delete this.oi[n]}}else delete this.oi[n]},Ci:function(t,i,e,s,n){return t+"_"+["",i?"1":"0",e?"1":"0",s?"1":"0",n?"1":"0"].join("")},Di:function(t,i,e){var s=this.getFocus();return this.oi[t]?this.zi(this.oi[t],s,e):!i||!this.oi.ANY_0000||this.zi(this.oi.ANY_0000,s,e)},zi:function(t,i,e){for(var s=0;s<t.length;s++){var n=t[s];if(null===n.view||i===n.view||"string"==typeof n.view&&i&&i.name===n.view){var h=n.handler(i,e);if(!!h===h)return h}}return!0},Fi:function(t){var i,e,s,n,h=this.fi,r=t.toLowerCase().split(/[+\-_]/);i=e=s=n=0;for(var o="",a=0;a<r.length;a++)if("ctrl"===r[a])i=1;else if("shift"===r[a])e=1;else if("alt"===r[a])s=1;else if("command"===r[a])n=1;else if(h[r[a]]){var u=h[r[a]];o=this.ki(u)?u.toString():String.fromCharCode(u)}else o=r[a];return{letter:o.toUpperCase(),ctrl:i,shift:e,alt:s,meta:n,debug:t}},getState:function(t,i){i=i||!1;var e={id:(t=Pt(t)).config.id,width:t.config.width,height:t.config.height,gravity:t.config.gravity};if(x(t.config.collapsed)||(e.collapsed=t.config.collapsed),"tabs"!==t.name&&"tabbar"!==t.name||(e.activeCell=t.getValue()),i&&(e=[e],t.Vi))for(var s=0;s<t.Vi.length;s++)e=e.concat(this.getState(t.Vi[s],i));return e},setState:function(t){b(t)||(t=[t]);for(var i=0;i<t.length;i++){var e=t[i],s=Pt(e.id);s&&(x(e.collapsed)||s.define("collapsed",e.collapsed),x(e.activeCell)||s.setValue(e.activeCell),s.define("width",e.width),s.define("height",e.height),s.define("gravity",e.gravity))}var n=Pt(
t[0].id);n&&n.resize()}};Mi(function(){Ai.di(),Ai.addHotKey("enter",function(t,i){if(t&&t.callEvent&&t.callEvent("onEnter",[i]),t&&t.editStop&&t.Ti)return t.editStop(),!0;if(t&&t.touchable){var e=t.getFormView();e&&!t.Hi&&e.callEvent("onSubmit",[t,i])}}),Ai.addHotKey("esc",function(t){if(t){if(t.editCancel&&t.Ti)return t.editCancel(),!0;var i=t.getTopParentView();i&&i.setPosition&&i.Bi()}}),Ai.addHotKey("shift+tab",Ai.Ai),Ai.addHotKey("tab",Ai.Ai)}),u("UIManager",Ai);var Ii={$init:function(){this.J=this.config={}},define:function(t,i){return"object"==k(t)?this.Ri(t):this.Pi(t,i)},Pi:function(t,i){var e=this[t+"_setter"];return this.J[t]=e?e.call(this,i,t):i},Ri:function(t){if(t)for(var i in t)this.Pi(i,t[i])},ot:function(t,i){var e={};i&&(e=H.extend(e,i)),"object"!=k(t)||t.tagName||H.extend(e,t,!0),this.Ri(e)},ji:function(t,i){for(var e in i)switch(k(t[e])){case"object":t[e]=this.ji(t[e]||{},i[e]);break;case"undefined":t[e]=i[e]}return t}},Ti={$init:function(){var t=this.nt={obj:this};M.destructors.push(t)},destructor:function(){var t=this.J;if(this.Ei&&this.editCancel(),this.callEvent&&this.callEvent("onDestruct",[]),this.destructor=function(){},this.nt.obj=null,this.getChildViews){var i=this.getChildViews();if(i)for(var e=0;e<i.length;e++)i[e].destructor();if(this.ht)for(var s=0;s<this.ht.length;s++)this.ht[s].destructor()}if(delete zt.views[t.id],t.$id){var n=this.getTopParentView();n&&n.Ni&&n.Ni(t.$id)}this.Li=null,this.Oi=null,this.Ui=null,this.Yi&&(this.Yi.innerHTML="",this.Yi.Li=null),this.st&&this.st.parentNode&&this.st.parentNode.removeChild(this.st),this.data&&this.data.destructor&&this.data.destructor(),this.unbind&&this.unbind(),this.data=null,this.st=this.$view=this.Yi=this.mt=null,this.V=this.H={},Ai.rt==this&&(Ai.rt=null);var h=t.url;h&&h.$proxy&&h.release&&h.release(),this.$scope=null,this.$destructed=!0}};Lt(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.Wi=p(),Et()});var Fi={$init:function(){this.Gi=null,this.attachEvent("onSelectChange",function(){var t=this.getSelectedId();this.setCursor(t?t.id||t:null)}),this.attachEvent("onAfterCursorChange",this.Xi),this.attachEvent("onAfterDelete",function(t){t==this.getCursor()&&this.setCursor(null)}),this.data.attachEvent("onStoreUpdated",C(function(t,i,e){t&&t==this.getCursor()&&"paint"!=e&&"delete"!=e&&this.Xi()},this)),this.data.attachEvent("onClearAll",C(function(){this.Gi=null},this)),this.data.attachEvent("onIdChange",C(function(t,i){this.Gi==t&&(this.Gi=i,this.Xi())},this))},refreshCursor:function(){this.Gi&&this.callEvent("onAfterCursorChange",[this.Gi])},setCursor:function(t){t==this.Gi||null!==t&&!this.getItem(t)||(this.callEvent("onBeforeCursorChange",[this.Gi]),this.Gi=t,this.callEvent("onAfterCursorChange",[t]))},getCursor:function(){return this.Gi},qi:function(t,i,e){if("$level"==i&&this.data.getBranch)return(t.data||t).importData(this.data.getBranch(this.getCursor()));var s=this.getItem(this.getCursor())||this.J.defaultData||null;"$data"==i?("function"==typeof e?e.call(t,s,this):t.data.importData(s?s[e]:[]),t.callEvent("onBindApply",[s,i,this])):(e&&(s=e(s)),this.Ji(t,i,s))}},zi={$init:function(){this.attachEvent("onChange",this.Xi)},qi:function(t,i,e){i=i||"value";var s=this.getValue()||"";if(e&&(s=e(s)),t.setValue)t.setValue(s);else if(t.filter)t.data.silent(function(){this.filter(i,s)});else{var n={};n[i]=s,t.Nt(s)&&t.setValues(n)}t.callEvent("onBindApply",[s,i,this])}},Vi={$init:function(){this.attachEvent("onChange",this.Xi)},qi:function(t,i,e){var s=this.getValues()||null;e&&(s=e(s)),this.Ji(t,i,s)}},Hi={$init:function(){this.Ki={},this.Zi={},this.Qi={},this.te(this)},saveBatch:function(t){this.ie=!0,t.call(this),this.ie=!1,this.Xi()},setBindData:function(t,i){if(i&&(this.Qi[i]=!0),this.setValue)this.setValue(t);else if(this.setValues)this.setValues(t);else{var e=this.getCursor();e?this.updateItem(e,t):this.add(t)}this.callEvent("onBindUpdate",[t,i]),this.save&&this.save(),i&&(this.Qi[i]=!1)},getBindData:function(t,i){if(this.Zi[t]
)return!1;var e=Pt(t);e.isVisible(e.J.id)&&(this.Zi[t]=!0,this.qi(e,this.Ki[t][0],this.Ki[t][1]),i&&e.filter&&e.refresh())},addBind:function(t,i,e){this.Ki[t]=[i,e]},removeBind:function(t){delete this.Ki[t],delete this.Zi[t],delete this.Qi[t]},te:function(t){t.filter?H.extend(this,Fi):t.setValue?H.extend(this,zi):H.extend(this,Vi)},Xi:function(){if(!this.ie)for(var t in this.Ki)this.Qi[t]||(this.Zi[t]=!1,this.getBindData(t,!0))},Ji:function(t,i,e){t.setValue?t.setValue(e&&i?e[i]:e):t.filter?t.data.silent(function(){this.filter(i,e)}):!e&&t.clear?t.clear():t.Nt(e)&&t.setValues(f(e)),t.callEvent("onBindApply",[e,i,this])}},Bi={bind:function(t,i,e){this.attachEvent||H.extend(this,g),"string"==typeof t&&(t=Pt(t)),t.ee&&t.ee(),this.ee&&this.ee(),t.getBindData||H.extend(t,Hi),this.se(),t.addBind(this.J.id,i,e),this.ne=t.J.id;var s=this.J.id;this.he=this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return t.getBindData(s)}),this.refresh&&this.isVisible(this.J.id)&&this.refresh()},unbind:function(){if(this.ne){var t=Pt(this.ne);t&&t.removeBind(this.J.id),this.detachEvent(this.he),this.ne=null}},se:function(){var t=this.J;if(this.filter){var i=t.id;this.data.re=C(function(){Pt(this.ne).Zi[i]=!1},this)}var e=this.render;this.render=function(){if(!this.oe){this.oe=!0;var t=this.callEvent("onBindRequest");return this.oe=!1,e.apply(this,!1===t?arguments:[])}},(this.getValue||this.getValues)&&(this.save=function(t){var i=Pt(this.ne);if(t)i.setBindData(t);else{if(this.validate&&!this.validate())return!1;var e=this.getValue?this.getValue:this.getValues();i.setBindData(e,this.J.id),this.setDirty&&this.setDirty(!1)}}),this.se=function(){}}},Ri=window.webix_view||{},Pi={name:"baseview",$init:function(t){t.id||(t.id=pi(this.name)),this._=M._,M._=null,this.$scope=t.$scope||(this._?this._.$scope:M.i),this.st||(this.Yi=this.st=Y("DIV",{"class":"webix_view"}),this.$view=this.st)},$skin:!1,defaults:{width:0,height:0,gravity:1},getNode:function(){return this.st},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(s,t){var i;if("string"==typeof s&&(s={view:s}),i="object"===k(s)?function(t){var i=t.config;for(var e in s)if(i[e]!=s[e])return!1;return!0}:s,"self"===t&&i(this))return this;var e="all"===t&&[],n="parent"===t?this.ae:this.ue,h=this.ce(i,n,e);return"all"===t?e:h},ue:function(t){return t.getChildViews()},ae:function(t){var i=t.getParentView();return i?[i]:[]},ce:function(t,i,e){for(var s=i(this),n=0;n<s.length;n++){if(t(s[n])){if(!e)return s[n];e.push(s[n])}var h=s[n].ce(t,i,e);if(h&&!e)return h}return null},isVisible:function(t){if(this.J.hidden)return t&&(this.fe||(this.fe=[],this.le={}),this.le[t]||(this.le[t]=!0,this.fe.push(t))),!1;var i=this.getParentView();return!i||i.isVisible(t,this.J.id)},isEnabled:function(){if(this.de)return!1;var t=this.getParentView();return!t||t.isEnabled()},disable:function(){G(this.de),this.J.disabled=!0,this.de=Y("div",{"class":"webix_disabled"}),this.st.appendChild(this.de),this.st.setAttribute("aria-disabled","true"),et(this.st,"webix_disabled_view",!0),Ai.wi(this)},enable:function(){this.J.disabled=!1,this.de&&(G(this.de),st(this.st,"webix_disabled_view"),this.st.removeAttribute("aria-disabled"),this.de=null)},disabled_setter:function(t){return t?this.disable():this.enable(),t},container_setter:function(t){return D(t),!0},css_setter:function(t){return"object"==k(t)&&(t=L(t)),this.st.className+=" "+t,t},id_setter:function(t){if(M.n&&(M.n!=this||this.ve)){var i=this.config.$id=t;t=pi(((this.ve||M.n)._e[t]=this).name),(this.ve||M.n).pe[t]=i}return zt.views[t],(zt.views[t]=this).st.setAttribute("view_id",t),t},$setSize:function(t,i){var e=this.me;return(!e||e[0]!=t||e[1]!=i)&&(this.me=[t,i],this.$width=this.be=t-(this.ge?S.scrollSize:0),this.$height=this.we=i-(this.xe?S.scrollSize:0),this.J.flex||(this.st.style.width=t+"px",this.st.style.height=i+"px"),!0)
},$getSize:function(t,i){var e=this.J,s=[1*(e.width||e.minWidth||0),1*(e.width||e.maxWidth||1e5),1*(e.height||e.minHeight||0),1*(e.height||e.maxHeight||1e5),e.gravity];return(isNaN(s[0])||isNaN(s[1])||isNaN(s[2])||isNaN(s[3]))&&(this.J.id,e.width=e.height=e.maxWidth=e.maxHeight=e.minWidth=e.minHeight=0,s=[0,0,1e5,1e5,1]),s[0]+=t,s[1]+=t,s[2]+=i,s[3]+=i,s},show:function(t,i){var e=this.getParentView(),s=!arguments[2];e?(!i&&!1!==i&&this.J.animate&&e.J.animate&&(i=H.extend(e.J.animate?H.extend({},e.J.animate):{},this.J.animate,!0)),(s?e.ye:e.Bi)&&(s?e.ye:e.Bi).call(e,this,i),s&&this.Me(),t&&s&&e.show(!e.$$&&t)):this.J.hidden?s&&(D(this.J.tt||document.body).appendChild(this.st),this.J.hidden=!1,this.adjust(),this.Me()):s||(this.J.hidden=this.J.Q=!0,this.st&&(this.J.tt=this.st.parentNode,G(this.st)))},Me:function(){if(this.fe){for(var t=0;t<this.fe.length;t++){var i=Pt(this.fe[t]);i&&i.render()}this.fe=[],this.le={}}},Se:function(t,i){var e=i.srcElement||i.target,s=e.getAttribute("role");13!==t&&32!==t||"button"!=s&&"tab"!=s||this.J.disabled||(it(e,"MouseEvents","click"),Q(i))},hidden_setter:function(t){return t&&this.hide(),this.J.hidden},hide:function(){this.show(null,null,!0),Ai.wi(this)},adjust:function(){if(!this.st.parentNode)return!1;var t=this.st.parentNode.clientWidth||0,i=this.st.parentNode.clientHeight||0,e=this.$getSize(0,0),s=this.st.parentNode==document.body&&!this.setPosition;e[0]>t&&(t=e[0]),e[2]>i&&(i=e[2]),(!s||this.J.width)&&t>e[1]&&(t=e[1]),(!s||this.J.height)&&i>e[3]&&(i=e[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",[]))}}},ji={api:Pi,view:H.protoUI(Pi,Ii,Ti,Bi,Ri)},Ei={name:"view",$init:function(t){this.ke(t)},ke:function(t){var i=x(t.borderless);i&&!this.setPosition&&t.$topView&&(i=!(t.borderless=!0)),i&&this.defaults.borderless||t.borderless?t.Z={top:!0,left:!0,bottom:!0,right:!0}:(t.Z||(t.Z={}),this.Yi.style.borderWidth="1px")},$getSize:function(t,i){var e=this.J.Z;return e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1)),ji.api.$getSize.call(this,t,i)},$setSize:function(t,i){var e=this.J.Z;return e&&(t-=(e.left?0:1)+(e.right?0:1),i-=(e.top?0:1)+(e.bottom?0:1)),ji.api.$setSize.call(this,t,i)}},Ni=H.protoUI(Ei,ji.view),Li={api:Ei,view:Ni};Ni.call(-1);var Oi=H.proto({template_setter:function(t){this.type.template=It(t)},Ot: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)}},di),Ui={name:"tooltip",defaults:{dy:0,dx:20},$init:function(t){"string"==typeof t&&(t={template:t}),this.$view=this.st=this.Yi=this.mt=Y("DIV",{role:"alert","aria-atomic":"true"}),this.Yi.className="webix_tooltip",X(this.Yi,document.body.firstChild,document.body),this.Ce=T("onClick",C(function(t){this.$e&&Pt(t)!=this&&this.hide()},this)),this.attachEvent("onDestruct",function(){F(this.Ce)})},adjust:function(){},isVisible:function(){return this.$e},De:function(t){this.callEvent("onBeforeRender",[t])&&(this.mt.innerHTML="",this.mt.innerHTML=t,this.callEvent("onAfterRender",[]))},css_setter:function(t){return"object"===k(t)&&(t=L(t)),this.st.className="webix_tooltip "+t,t},show:function(t,i){if(!this.Ae)if(this.$e=!0,"string"==typeof t?this.De(t):(this.data=H.extend({},t),this.render()),this.mt.firstChild){var e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),s=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=e-i.x,h=s-i.y;this.Yi.style.display="block",n-this.J.dx>this.Yi.offsetWidth?n=i.x:(n=i.x-2*this.J.dx-this.Yi.offsetWidth)<=0&&(n=0),h=h-this.J.dy>this.Yi.offsetHeight?i.y:i.y-this.J.dy-this.Yi.offsetHeight,this.Yi.style.left=n+this.J.dx+"px",this.Yi.style.top=h+this.J.dy+"px"}else this.hide()},hide:function(){this.data=null,this.Yi.style.display="none",this.$e=!1},disable:function(){this.Ae=!0},enable:function(){this.Ae=!1},type:{template:It("{obj.value}"),templateStart:It.empty,templateEnd:It.empty}},Yi=(
H.protoUI(Ui,Oi,Ii,g,Li.view),{tooltip_setter:function(t){if(t)return"function"!=typeof t&&"string"!=typeof t||(t={template:t}),"object"!==k(t)&&(t={}),_i.addTooltip(this),this.attachEvent("onDestruct",function(){_i.removeTooltip(this)}),this.attachEvent("onAfterScroll",function(){_i.Kt&&_i.ei()}),t},$tooltipIn:function(t){var i=_i.Zt,e=H.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.J.tooltip,!0);return i.define(e),t},$tooltipOut:function(){return _i.ei(),delete _i.Zt.type.column,null},$tooltipMove:function(t,i,e){_i.Zt.hide(),clearTimeout(_i.hi),_i.hi=$(this.Ie,this,[t,i,e],_i.delay)},Ie:function(t,i,e){var s=e||this.Te(t,i);s&&_i.Zt.show(s,Z(i))},Te:function(t,i){if(this.locate&&this.getItem){var e=this.locate(i);return e?this.getItem(e):null}return this.J}}),Wi=H.proto({$init:function(t){this.Fe=[],this.ze=x(t.series)?t.name:t.series,this.Ve=D(t.container||t);var i=t.width*(window.devicePixelRatio||1),e=t.height*(window.devicePixelRatio||1),s=t.style||"";s+=";width:"+t.width+"px;height:"+t.height+"px;",this.He(t.name,s,i,e,t.title)},He:function(t,i,e,s,n){return this.Be=Y("canvas",{title:n,width:e,height:s,canvas_id:t,style:i||""}),this.Ve.appendChild(this.Be),this.Be.getContext||(S.isIE?(si("legacy/excanvas/excanvas.js",!0),G_vmlCanvasManager.init_(document),G_vmlCanvasManager.initElement(this.Be)):this.Be.getContext),this.Be},getCanvas:function(t){var i=(this.Be||this.He(this.Yi)).getContext(t||"2d");return this.Re||(this.Re=!0,i.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)),i},Pe:function(t,i){this.Be&&(this.Be.setAttribute("width",t*(window.devicePixelRatio||1)),this.Be.setAttribute("height",i*(window.devicePixelRatio||1)),this.Be.style.width=t+"px",this.Be.style.height=i+"px",this.Re=!1)},renderText:function(t,i,e,s,n){if(e){n&&(n=Math.max(n,0)),i&&(i=Math.max(i,0));var h=Y("DIV",{"class":"webix_canvas_text"+(s?" "+s:""),style:"left:"+t+"px; top:"+i+"px;","aria-hidden":"true"},e);return this.Ve.appendChild(h),this.Fe.push(h),n&&(h.style.width=n+"px"),h}},renderTextAt:function(t,i,e,s,n,h,r){var o=this.renderText.call(this,e,s,n,h,r);return o&&(t&&(o.style.top="middle"==t?parseInt(s-o.offsetHeight/2,10)+"px":s-o.offsetHeight+"px"),i&&(o.style.left="left"==i?e-o.offsetWidth+"px":parseInt(e-o.offsetWidth/2,10)+"px")),o},clearCanvas:function(t){var i=[];if(G(this.Fe),this.Fe=[],!t&&this.Ve.Li){for(i=this.je();i.length;)i[0].parentNode.removeChild(i[0]),i.splice(0,1);i=null,this.Ve.Li.getElementsByTagName("AREA").length||(this.Ve.Li.parentNode.removeChild(this.Ve.Li),this.Ve.Li=null)}this.getCanvas().clearRect(0,0,this.Be.offsetWidth||Math.floor(this.Be.width/(window.devicePixelRatio||1)),this.Be.offsetHeight||Math.floor(this.Be.height/(window.devicePixelRatio||1)))},toggleCanvas:function(){this.Ee("none"==this.Be.style.display)},showCanvas:function(){this.Ee(!0)},hideCanvas:function(){this.Ee(!1)},Ee:function(t){var i,e;for(e=0;e<this.Fe.length;e++)this.Fe[e].style.display=t?"":"none";if(this.Ve.Li)for(i=this.je(),e=0;e<i.length;e++)t?i[e].removeAttribute("disabled"):i[e].setAttribute("disabled","true");this.Be.style.display=t?"":"none"},je:function(){var t,i,e=[];for(t=this.Ve.Li.getElementsByTagName("AREA"),i=0;i<t.length;i++)t[i].getAttribute("userdata")==this.ze&&e.push(t[i]);return e}}),Gi=function(t,i){var e=i;if(b(t))for(var s=0;s<t.length;s++){if(b(i)&&(e=i[s]),"slide"==e.type){if("out"==e.subtype&&0===s)continue;if("in"==e.subtype&&1==s)continue}if("flip"!=e.type)Gi(t[s],e);else{var n=f(e);0===s&&(n.type="flipback"),1==s&&(n.callback=null),Gi(t[s],n)}}else{var h=D(t);h.Ne?Gi.end(h,e):Gi.start(h,e)}};Gi.end=function(t,i){t.style[S.transitionDuration]="1ms",t.Ne=null,M.T&&window.clearTimeout(M.T),M.T=$(Gi,this,[t,i],10)},Gi.isSupported=function(){return!M.noanimate&&S.transform&&S.transition&&!S.isOpera},Gi.formLine=function(t,i,e){var s=e.direction;i.parentNode&&(i.parentNode.style.position="relative"),i.style.position="absolute",t.style.position="absolute";var n=S.isFF?"top"==s||"left"==s?-1:1:0;return"top"==s||"bottom"==s?(t.style.left="0px",t.style.top=(e.top||n)+("top"==s?1:-1
)*i.offsetHeight+"px"):(t.style.top=(e.top||0)+"px",t.style.left=n+("left"==s?1:-1)*i.offsetWidth+"px"),i.parentNode==t.parentNode&&e.keepViews?t.style.display="":X(t,i.nextSibling,i.parentNode),"slide"==e.type&&"out"==e.subtype&&(t.style.left="0px",t.style.top=(e.top||0)+"px",i.parentNode.removeChild(i),X(i,t.nextSibling,t.parentNode)),[t,i]},Gi.breakLine=function(t){arguments[1]?t[1].style.display="none":G(t[1]),Gi.clear(t[0]),Gi.clear(t[1]),t[0].style.position=""},Gi.clear=function(t){t.style[S.transform]="none",t.style[S.transition]="none",t.style.top=t.style.left=""},Gi.defaults={type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0},Gi.start=function(s,t){"string"==typeof t&&(t={type:t}),t=Ii.ji(t,Gi.defaults);var i,e,n=S.cssPrefix,h=s.Ne=t;switch("slide"==h.type&&h.direction){case"right":h.x=s.offsetWidth;break;case"left":h.x=-s.offsetWidth;break;case"top":h.y=-s.offsetHeight;break;case"bottom":default:h.y=h.y||s.offsetHeight}"flip"!=h.type&&"flipback"!=h.type||(i=[0,0],e="scaleX","vertical"==h.subtype?(i[0]=20,e="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) "+e+"(0.00001)",a="all "+r;break;case"flipback":h.delay+=h.duration/2,r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",s.style[S.transform]="skew("+-1*i[0]+"deg, "+-1*i[1]+"deg) "+e+"(0.00001)",s.style.left="0",u="skew(0deg, 0deg) "+e+"(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(){s.style[S.transition]=a,$(function(){o&&(s.style.cssText+=o),u&&(s.style[S.transform]=u);var i=!1,e=Lt(s,S.transitionEnd,function(t){s.Ne=null,h.callback&&h.callback.call(h.master||window,s,h,t),i=!0,Ot(e)});window.setTimeout(function(){i||(s.Ne=null,h.callback&&h.callback.call(h.master||window,s,h),i=!0,Ot(e))},1.3*(1*h.duration+1*h.delay))})})};var Xi,qi;function Ji(t){if(Ki[t],qi!==t)for(var i in Ki.$active=Xi=Ki[t],Ki.$name=qi=t,zt){var e=zt[i];e&&e.prototype&&e.prototype.$skin&&e.prototype.$skin(e.prototype)}}var Ki={set:Ji,material:{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"},mini:{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"},flat:{
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:3,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},compact:{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:1,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},contrast:{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:3,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}};Ji(window.webix_skin||"material");var Zi={config:{longTouchDelay:1e3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500,ellastic:!0,fastClick:!0},limit:function(t){Zi.Le=!1!==t},disable:function(){Zi.Ae=!0},enable:function(){Zi.Ae=!1},$init:function(){Zi.$init=function(){},Lt(document.body,te.down,Zi.Oe,{passive:!1}),Lt(document.body,te.move,Zi.Ue,{passive:!1}),Lt(document.body,te.up,Zi.Ye),Lt(document.body,"dragstart",function(t){if(!Zi.Ae&&!Zi.Le)return Q(t)}),Lt(document.body,"touchstart",function(t){if(!Zi.Ae&&!Zi.Le&&Zi.config.fastClick&&S.isSafari){var i=t.srcElement.tagName.toLowerCase();return"input"==i||"textarea"==i||"select"==i||"label"==i||(Zi.We=!0,Q(t))}},{passive:!1}),Zi.Ge(),Zi.Xe=[null,null],Zi.$active=!0},Ge:function(){Zi.qe=Zi.Je=Zi.Ke=Zi.Ze=null,Zi.Qe=Zi.ts=Zi.es=this.ss=null,Zi.ns={hs:0,rs:0,os:0},Zi.us&&(st(Zi.us,"webix_touch"),Zi.us=null),window.clearTimeout(Zi.cs),Zi.fs=!0,Zi.ls=!0,Zi.ds=!0,Zi.vs||Zi._s()},Ye:function(t){if(Zi.qe){if(Zi.Qe){var i=Zi.ps(Zi.ts),e=i.e,s=i.f,n=Zi.config.finish,h=Zi.ms(t,!0),r=Pt(Zi.ts),o=r&&r.$scroll?r.$scroll.gravity:Zi.config.gravity;if(h.os){var a=e+o*h.hs/h.os,u=s+o*h.rs/h.os,c=Zi.Xe[0]?Zi.bs(a,!1,!1,Zi.es.dx,Zi.es.px):e,f=Zi.Xe[1]?Zi.bs(u,!1,!1,Zi.es.dy,Zi.es.py):s,l=Math.max(Math.abs(c-e),Math.abs(f-s));l<150&&(n=n*l/150),c==e&&f==s||(n=Math.round(n*Math.max((c-e)/(a-e),(f-s)/(u-s))));var d={e:c,f:f};(r=Pt(Zi.ts))&&r.adjustScroll&&r.adjustScroll(d),n=Math.max(100,n),e!=d.e||s!=d.f?(Zi.gs(Zi.ts,d.e,d.f,n+"ms"),Zi.ws&&Zi.ws.xs(d.e,d.f,n+"ms"),Zi.ys(d.e,d.f,n+"ms")):Zi._s()}else Zi._s()}else if(!this.ss)if(Zi.ds&&!Zi.ls)Zi.Ms("onSwipeX");else if(Zi.ls&&!Zi.ds)Zi.Ms("onSwipeY");else if(S.isSafari&&Zi.We){Zi.We=!1;var v=Zi.qe.target;$(function(){var t=document.createEvent("MouseEvents");t.initEvent("click",!0,!0),v.dispatchEvent(t)})}Zi.Ms("onTouchEnd"),Zi.Ge()}},Ue:function(t){if(
Zi.Ze&&Zi.qe){var i=Zi.ms(t);if(Zi.Ms("onTouchMove"),Zi.Qe)Zi.Ss(i);else if(Zi.ls=Zi.ks(i.Cs,"x",Zi.ls),Zi.ds=Zi.ks(i.$s,"y",Zi.ds),Zi.Qe){var e=Zi.Ds("onBeforeScroll",!0);if(e){var s={};e.callEvent("onBeforeScroll",[s]),s.update&&(Zi.config.speed=s.speed,Zi.config.scale=s.scale)}Zi.As(i)}return Q(t)}},Ss:function(){if(Zi.ts){var t=Zi.ps(Zi.ts),i=Zi.Ke||Zi.qe,e=Pt(Zi.ts),s=e&&e.$scroll?e.$scroll.ellastic:Zi.config.ellastic;Zi.Xe[0]&&(t.e=Zi.bs(t.e-i.x+Zi.Je.x,s,t.e,Zi.es.dx,Zi.es.px)),Zi.Xe[1]&&(t.f=Zi.bs(t.f-i.y+Zi.Je.y,s,t.f,Zi.es.dy,Zi.es.py)),Zi.gs(Zi.ts,t.e,t.f,"0ms"),Zi.ws&&Zi.ws.xs(t.e,t.f,"0ms"),Zi.ys(t.e,t.f,"0ms")}},ys:function(t,i,e){var s=Zi.es.px/Zi.es.dx*-t,n=Zi.es.py/Zi.es.dy*-i;Zi.Xe[0]&&Zi.gs(Zi.Xe[0],s,0,e),Zi.Xe[1]&&Zi.gs(Zi.Xe[1],0,n,e)},scrollTo:function(t,i,e,s){Zi.gs(t,i,e,s)},gs:function(t,i,e,s){if(!Zi.Is&&window.setAnimationFrame&&window.setAnimationFrame(function(){return Zi.Is=!0,Zi.gs(t,i,e,s)}),Zi.Is=null,Zi.vs=!0,t){var n=Zi.config.translate||S.translate;t.style[S.transform]=n+"("+Math.round(i)+"px, "+Math.round(e)+"px"+("translate3d"==n?", 0":"")+")",t.style[S.transitionDuration]=s}},ps:function(t){var i,e=window.getComputedStyle(t)[S.transform];if("none"==e)i={e:0,f:0};else if(window.WebKitCSSMatrix)i=new WebKitCSSMatrix(e);else if(window.MSCSSMatrix)i=new MSCSSMatrix(e);else{var s=e.replace(/(matrix\()(.*)(\))/gi,"$2");s=(s=s.replace(/\s/gi,"")).split(","),i={};for(var n=["a","b","c","d","e","f"],h=0;h<n.length;h++)i[n[h]]=parseInt(s[h],10)}return Zi.ws&&Zi.ws.Ts(i),i},bs:function(t,i,e,s,n){if(t===e)return t;var h=Math.abs(t-e);if(0<t)return i?e+h/(t-e)*Math.sqrt(h):0;var r=s-n;return r+t<0?i?e-Math.sqrt(-(t-e)):-r:t},Fs: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,Zi._s,!1)}},As:function(){-1!=Zi.Qe.indexOf("x")&&(Zi.Xe[0]=Zi.zs("x",Zi.es.dx,Zi.es.px,"width")),-1!=Zi.Qe.indexOf("y")&&(Zi.Xe[1]=Zi.zs("y",Zi.es.dy,Zi.es.py,"height")),Zi.Fs(Zi.ts),window.setTimeout(Zi.Ss,1)},zs:function(t,i,e,s){if(i-e<2){var n=Zi.ps(Zi.ts),h="y"==t?n.e:0,r="y"==t?0:n.f;return Zi.ws||Zi.gs(Zi.ts,h,r,"0ms"),Zi.Qe=Zi.Qe.replace(t,""),""}var o=Y("DIV",{"class":"webix_scroll_"+t},"");return o.style[s]=Math.max(e*e/i-7,10)+"px",Zi.es.left&&("x"===t?o.style.left=Zi.es.left+"px":o.style.right=-Zi.es.left+"px"),Zi.es.hidden&&(o.style.visibility="hidden"),Zi.ts.parentNode.appendChild(o),o},ks:function(t,i,e){return t>Zi.config.deltaStep?(Zi.fs&&(Zi.Vs(i),Zi.Hs(i),-1==(Zi.Qe||"").indexOf(i)&&(Zi.Qe="")),!1):e},_s:function(){var t,i,e;(e=Pt(Zi.ts||this))&&(Zi.ts?t=Zi.ps(Zi.ts):e.getScrollState&&(t={e:(i=e.getScrollState()).x,f:i.y}),I("onAfterScroll",[t]),e.callEvent&&e.callEvent("onAfterScroll",[t])),Zi.Qe||(G(Zi.Xe),Zi.Xe=[null,null]),Zi.vs=!1},Vs:function(){window.clearTimeout(Zi.cs),Zi.fs=!1},Bs:function(t){if(!Zi.Xe[0]&&!Zi.Xe[1])return!0;Zi.Rs(t,Zi.Xe[0]?"x":"y")},Oe:function(t){var i=t.target||Lt.srcElement;if(!(Zi.Ae||i.tagName&&"textarea"==i.tagName.toLowerCase()&&i.offsetHeight<i.scrollHeight)){Zi.ss=null,Zi.Ze=Zi.qe=te.context(t);var e=Pt(t);!Zi.Le||Zi.Ps()||e&&e.$touchCapture||(Zi.Ze=null),Zi.Ms("onTouchStart"),Zi.Bs(t)&&(Zi.cs=window.setTimeout(Zi.js,Zi.config.longTouchDelay)),!e||!e.touchable||i.className&&0===i.className.indexOf("webix_view")||(Zi.us=e.getNode(t),et(Zi.us,"webix_touch"))}},js:function(){Zi.qe&&(Zi.Ms("onLongTouch"),I("onClick",[Zi.qe]),Zi.ss=!0)},Rs:function(t,i){Zi.Hs(i);var e=Zi.Xe[0]||Zi.Xe[1];if(e){var s=Zi.Ds("onBeforeScroll",!0);s&&s.callEvent("onBeforeScroll",[Zi.qe,Zi.Je])}!e||Zi.ts&&e.parentNode==Zi.ts.parentNode||(Zi.Ge(),Zi._s(),Zi.qe=te.context(t)),Zi.Ue(t)},ms:function(t){return Zi.Ke=Zi.Je,Zi.Je=te.context(t),Zi.ns.Cs=Math.abs(Zi.qe.x-Zi.Je.x),Zi.ns.$s=Math.abs(Zi.qe.y-Zi.Je.y),Zi.Ke&&(Zi.Je.time-Zi.Ke.time<Zi.config.scrollDelay?(Zi.ns.hs=Zi.ns.hs/1.3+Zi.Je.x-Zi.Ke.x,Zi.ns.rs=Zi.ns.rs/1.3+Zi.Je.y-Zi.Ke.y):Zi.ns.rs=Zi.ns.hs=0,Zi.ns.os=Zi.ns.os/1.3+(Zi.Je.time-Zi.Ke.time)),
Zi.ns},Es:function(t){Zi.es={dx:t.offsetWidth,dy:t.offsetHeight,px:t.parentNode.offsetWidth,py:t.parentNode.offsetHeight}},Ps:function(t){var i=Zi.qe.target;if(!S.touch&&!S.transition&&!S.transform)return null;for(;i&&"BODY"!=i.tagName;){if(i.getAttribute){var e=i.getAttribute("touch_scroll");if(e&&(!t||-1!=e.indexOf(t)))return[i,e]}i=i.parentNode}return null},Hs:function(t){var i=this.Ps(t);return i&&(Zi.Qe=i[1],Zi.ts=i[0],Zi.Es(i[0])),i},Ms:function(t){I(t,[Zi.qe,Zi.Je]);var i=Zi.Ds(t);i&&i.callEvent(t,[Zi.qe,Zi.Je])},Ds:function(t,i){var e=Pt(i?Zi.ts:Zi.qe);if(!e)return null;for(;e;){if(e.hasEvent&&e.hasEvent(t))return e;e=e.getParentView()}return null},Ns: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=Zi.Je;return i.time=new Date,i},Ls:function(t){return{target:t.target||t.srcElement,x:t.pageX,y:t.pageY,time:new Date}}};function Qi(t){t.down="touchstart",t.move="touchmove",t.up="touchend",t.context=Zi.Ns}Mi(function Ho(){if(S.touch)Zi.$init(),-1==document.body.className.indexOf("webix_full_screen")&&Zi.limit(!0),window.MSCSSMatrix&&O(".webix_view{ -ms-touch-action: none; }");else var s=Lt(document.body,"touchstart",function(t){if(t.touches.length&&4<t.touches[0].radiusX)for(var i in S.touch=!0,Qi(te),Ho(),zt.views){var e=zt.views[i];e&&e.$touch&&e.$touch()}Ot(s)},{capture:!0})});var te=S.mouse={down:"mousedown",up:"mouseup",move:"mousemove",context:Zi.Ls};window.navigator.pointerEnabled?(te.down="pointerdown",te.move="pointermove",te.up="pointerup"):window.navigator.msPointerEnabled?(te.down="MSPointerDown",te.move="MSPointerMove",te.up="MSPointerUp"):S.touch&&Qi(te);var ie={Os:p(["dummy"]),addDrop:function(t,i,e){(t=D(t)).webix_drop=this.Us(i),e&&(t.webix_master=!0)},Us:function(t){t=t||ie;var i=this.Os.find(t);return i<0&&(i=this.Os.length,this.Os.push(t)),i},Ys:function(t){var i=ie,e=this.Ws();if(e&&e.Gs){i.Ui||i.createDrag(t);var s=i.Xs;i.Ui.style.left=t.x+i.left+(s.x_offset||0)+"px",i.Ui.style.top=t.y+i.top+(s.y_offset||0)+"px"}},addDrag:function(t,i){(t=D(t)).webix_drag=this.Us(i),Nt(t,S.mouse.down,this.qs,{bind:t}),Nt(t,"dragstart",Q)},qs:function(t){if(ie.Js){if(ie.Ks==t)return;ie.Zs(),ie.destroyDrag(t)}ie.Js=this;var i=S.mouse.context(t);ie.Qs=i,ie.Ks=t,ie.tn=Lt(document.body,S.mouse.move,ie["in"]),ie.en=Lt(document,S.mouse.up,ie.Zs),et(document.body,"webix_noselect",1)},Zs:function(){ie.sn()},"in":function(t){var i=S.mouse.context(t),e=ie.Ws();if(!(e&&S.touch&&e.Gs&&!Zi.ss||Math.abs(i.x-ie.Qs.x)<5&&Math.abs(i.y-ie.Qs.y)<5)&&(ie.sn(!0),ie.Ui||ie.createDrag(ie.Ks)))return ie.sendSignal("start"),ie.tn=Lt(document.body,S.mouse.move,ie.nn),ie.en=Lt(document,S.mouse.up,ie.hn),ie.nn(t),S.touch?Q(t):void 0},hn:function(t){ie.sn(),ie.Ks=null,ie.ni&&(ie.$drop(ie.Js,ie.ni,t),ie.$dragOut(ie.Js,ie.ni,null,t)),ie.destroyDrag(t),ie.sendSignal("stop")},sn:function(t){this.tn=Ot(this.tn),this.en=Ot(this.en),t||st(document.body,"webix_noselect")},nn:function(s){var t=ie,i=Z(s),e=t.$dragPos(i,s),n=t.Xs;t.Ui.style.top=i.y+t.top+(e||!n.y_offset?0:n.y_offset)+"px",t.Ui.style.left=i.x+t.left+(e||!n.x_offset?0:n.x_offset)+"px";var h=s;if(t.rn)t.rn=!1;else{if(S.touch){var r=S.mouse.context(s),o=document.elementFromPoint(r.x,r.y);h=new Proxy(s,{get:function(t,i){if("target"===i)return o;var e=t[i];return"function"==typeof e?e.bind(s):e}})}t.an(h.target||h.srcElement,h)}return Q(s)},an:function(t,i){for(;t&&"BODY"!=t.tagName;){if(t.webix_drop)return this.ni&&(this.ni!=t||t.webix_master)&&this.$dragOut(this.Js,this.ni,t,i),!this.ni||this.ni!=t||t.webix_master?(this.ni=null,this.un=this.$dragIn(ie.Js,t,i),void(this.un&&(this.ni=t))):void 0;t=t.parentNode}this.ni&&(this.ni=this.un=this.$dragOut(this.Js,this.ni,null,i))},sendSignal:function(t){ie.active="start"==t,I("onDragMode",[t])},getMaster:function(t){return this.Os[t.webix_drag||t.webix_drop]},getContext:function(){return this.Xs},getNode:function(){return this.Ui},createDrag:function(t){var i=ie,e=i.Js;i.Xs={};var s,n=this.Os[e.webix_drag];if(n.$dragCreate){if(!(s=n.$dragCreate(e,t)))return!1;this.cn(t),
s.style.position="absolute"}else{var h=i.$drag(e,t);if(i.cn(t),!h)return!1;(s=document.createElement("DIV")).innerHTML=h,s.className="webix_drag_zone",document.body.appendChild(s);var r=i.Xs;r.html&&S.pointerevents&&(r.x_offset=-Math.round(.5*s.offsetWidth),r.y_offset=-Math.round(.75*s.offsetHeight))}return s.style.zIndex=Math.max(s.style.zIndex,yi()),ie.ln=Lt(s,S.mouse.move,ie.dn),ie.Xs.from||(ie.Xs={source:e,from:e}),ie.Ui=s,!0},dn:function(){ie.rn=!0},destroyDrag:function(t){var i=ie.Js,e=this.Os[i.webix_drag];e&&e.$dragDestroy?(ie.ln=Ot(ie.ln),ie.Ui&&e.$dragDestroy(i,ie.Ui,t)):G(ie.Ui),ie.vn&&G(ie.vn),ie.un=ie.Js=ie.ni=ie.Ui=ie.vn=null},Ws:function(){return ie.Os[ie.Js.webix_drag]},top:0,left:0,cn:function(t){var i=ie,e=i.Qs,s=i.Xs;if("undefined"!=typeof s.x_offset&&"undefined"!=typeof s.y_offset)return null;if(s.x_offset=s.y_offset=0,S.pointerevents){var n=ie.Ws();if(n.Gs&&n!==this){var h=n.Gs(e,t);h&&(s.x_offset=h.x-e.x,s.y_offset=h.y-e.y)}}},$dragPos:function(t,i){var e=this.Os[ie.Js.webix_drag];if(e.$dragPos&&e!=this)return e.$dragPos(t,i,ie.Ui),!0},$dragIn:function(t,i,e){var s=this.Os[i.webix_drop];return s.$dragIn&&s!=this?s.$dragIn(t,i,e):(i.className=i.className+" webix_drop_zone",i)},$dragOut:function(t,i,e,s){var n=this.Os[i.webix_drop];return n.$dragOut&&n!=this?n.$dragOut(t,i,e,s):(i.className=i.className.replace("webix_drop_zone",""),null)},$drop:function(t,i,e){var s=this.Os[i.webix_drop];if(ie.Xs.from=ie.getMaster(t),s.$drop&&s!=this)return s.$drop(t,i,e);i.appendChild(t)},$drag:function(t,i){var e=this.Os[t.webix_drag];return e.$drag&&e!=this?e.$drag(t,i):"<div style='"+t.style.cssText+"'>"+t.innerHTML+"</div>"}};T("onLongTouch",function(t){ie.Js&&ie.Ys(t)});var ee={move_setter:function(t){return t&&(this._n=f(this._n),this._n.master=this,ie.addDrag(this.pn?this.pn:this.$view,this._n)),t},_n:{$dragCreate:function(t,i){if(this.master.config.move){var e=J(t),s=Z(i);return ie.top=e.y-s.y,ie.left=e.x-s.x,D(this.master.st)}},$dragDestroy:function(t,i){var e=this.master;e.J&&(e.J.top=parseInt(i.style.top,10),e.J.left=parseInt(i.style.left,10)),ie.top=ie.left=0,this.master.callEvent("onViewMoveEnd",[])},$dragPos:function(t,i){this.master.callEvent("onViewMove",[t,i])}}},se={mn:function(t){if(t){if(!this.bn){this.bn=Y("div",{"class":"webix_modal"});var i=this.J.zIndex||yi();this.gn=M.I,M.I=i,this.bn.style.zIndex=i-1,this.st.style.zIndex=i,document.body.appendChild(this.bn),document.body.style.overflow="hidden",Nt(this.bn,"click",C(this.wn,this))}}else if(this.bn){G(this.bn),document.body.style.overflow="";var e=this.gn;setTimeout(function(){M.I=e},1),this.bn=null}return t}},ne={resize_setter:function(t){return t&&!this.xn&&this.yn(),t},yn:function(){if(!this.Mn){var t=this.st;t.firstChild&&((t=t.firstChild).style.position="relative"),this.Mn=Y("DIV",{"class":"webix_resize_handle",webix_disable_drag:"true"}),t.appendChild(this.Mn),Nt(this.Mn,S.mouse.down,this.Sn,{bind:this})}},kn:function(t,i){if(!this.Cn){this.Cn=Y("div",{"class":"webix_resize_frame"},""),document.body.appendChild(this.Cn);var e=J(this.st);this.Cn.style.left=e.x+"px",this.Cn.style.top=e.y+"px",this.Cn.style.zIndex=yi()}this.Cn.style.width=t+"px",this.Cn.style.height=i+"px"},Sn:function(){this.config.resize&&(et(document.body,"webix_noselect webix_resize_cursor"),this.$n=J(this.st),this.Dn=Lt(document.body,S.mouse.move,this.An,{bind:this}),this.In=Lt(document.body,S.mouse.up,this.Tn,{bind:this}))},An:function(t){if(!1!==this.$n){var i=Z(t),e={x:i.x-this.$n.x+10,y:i.y-this.$n.y+10};if(this.$resizeMove)this.$resizeMove(e);else{var s=Math.abs(this.$n.x-i.x),n=Math.abs(this.$n.y-i.y);if(s<(this.config.minWidth||100)||n<(this.config.minHeight||100)||s>this.J.maxWidth||n>this.J.maxHeight)return}this.Fn=e,this.kn(e.x,e.y)}},Tn:function(){this.Cn&&(this.Cn=G(this.Cn)),st(document.body,"webix_resize_cursor"),st(document.body,"webix_noselect"),Ot(this.Dn),Ot(this.In),this.Fn&&(this.$resizeEnd?this.$resizeEnd(this.Fn):(this.config.width=this.Fn.x,this.config.height=this.Fn.y,this.resize())),this.$n=this.Fn=!1,this.callEvent("onViewResize",[])}};M.Wi=p()
;var he={name:"window",$init:function(t){this.st.innerHTML="<div class='webix_win_content'><div class='webix_win_head'></div><div class='webix_win_body'></div></div>",this.Yi=this.st.firstChild,this.pn=this.Yi.childNodes[0],this.mt=this.zn=this.Yi.childNodes[1],this.st.className+=" webix_window",this.st.setAttribute("role","dialog"),this.st.setAttribute("tabindex","0"),this.Vn=this.K=null,this.J.Z={top:!1,left:!1,right:!1,bottom:!1},t.id||(t.id=z()),Nt(this.Yi,"click",C(this.wn,this)),this.Yi.addEventListener&&Nt(this.Yi,"click",function(){!this.J.zIndex&&this.J.toFront&&(this.st.style.zIndex=yi())},{bind:this,capture:!0}),t.modal&&(this.Hn=!0),this.attachEvent("onViewMoveEnd",function(){this.J.position&&delete this.J.position})},wn:function(t){var i=M.Wi,e=i.find(this);-1==e&&(e=i.length-1),t.click_view=e,S.isIE8&&(t.srcElement.click_view=e)},getChildViews:function(){return this.Vn?[this.Vn,this.K]:[this.K]},zIndex_setter:function(t){return this.st.style.zIndex=t},et:function(){this.K={destructor:function(){}}},it:function(t){this.K.destructor(),this.K=t,this.zn.appendChild(this.K.st);var i=this.K.st.style;i.borderTopWidth=i.borderBottomWidth=i.borderLeftWidth=i.borderRightWidth="1px",this.K.J.Z=f(this.J.Z),this.resize(!0)},show:function(t,i,e){if(!0===t){if(!this.J.hidden)return;t=null}if(!this.callEvent("onBeforeShow",arguments))return!1;var s,n,h;if(this.J.hidden=!1,this.st.style.zIndex=this.J.zIndex||yi(),(this.J.modal||this.Hn)&&(this.mn(!0),this.Hn=null),(i=i||{}).pos||(i.pos=this.J.relative),t){"object"!=k(t)||t.tagName?s=J(t=D(t)):t.target||t.srcElement?(s=Z(t),n=20,h=5):s=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.me,u=s.x,c=s.y,f=0,l=0,d=0,v=0,_=this.J.autofit;if(_){var p="node"===_,m=6,b=6,g=6;this.J.point||(m=b=g=0),e="top",u=c=0,d=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,r-s.x-n<a[0]&&"right"==i.pos&&!p&&(i.pos="left"),l="right"==i.pos?(u=s.x+m+n,b=-h,e="left",f=Math.round(s.y+h/2),u-g):"left"==i.pos?(u=s.x-m-a[0]-1,b=-h,e="right",f=Math.round(s.y+h/2),u+a[0]+1):(u=s.x<d?d:r+d-s.x>a[0]?s.x:r+d-m-a[0],l=Math.round(s.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-s.y-b>a[1]||p)&&"top"!=i.pos?(c=h+s.y+b-(this.J.point?4:0),f||(e="top",f=c-g)):(c=s.y-b-a[1])<0?(c=0,"top"==e&&(e=!1)):f||(e="bottom",f=--c+a[1]+1)}var w=i.x||0,x=i.y||0,y=this.Bn();y&&(c-=v,f-=v),this.setPosition(u+w,c+x),this.Rn&&(e&&this.J.point?this.Rn(e,l+w,f+x,y):this.Pn())}else this.jn(this.J.left,this.J.top);this.st.style.display="block",this.En=1,$(function(){this.En=0},this,[],S.touch?400:100),this.Me(),this.config.autofocus&&(this.Nn=Ai.getFocus(),Ai.setFocus(this)),-1==M.Wi.find(this)&&M.Wi.push(this),this.callEvent("onShow",[])},Bi:function(t){if(!(this.J.hidden||this.J.modal||this.En||t&&t.showpopup||M.I&&this.J.zIndex<=M.I)){if(t){var i=S.isIE8?t.srcElement.click_view:t.click_view;if(i||0===i||(i=-1),M.Wi.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.J.hidden)){if(this.J.modal&&this.mn(!1),"top"==this.J.position?Gi(this.st,{type:"slide",x:0,y:-(this.we+20),duration:300,callback:this.Ln,master:this}):this.Ln(),this.J.autofocus){var i=document.activeElement;i&&this.st&&(this.st.contains(i)||i===document.body)&&(Ai.setFocus(this.Nn),this.Nn=null)}this.On()}},On:function(){var t=M.Wi,i=t.find(this),e=t.length-1;if(-1<i)for(var s=e;i<s;s--)t[s].Pn&&t[s].hide();t.removeAt(i)},destructor:function(){this.mn(!1),G(this.st),this.J.autofocus&&(M.k||Ai.setFocus(this.Nn),this.Nn=null),this.On(),this.Pn&&this.Pn(),Ti.destructor.apply(this,[])},Ln:function(){this.$destructed||(this.st.style.display="none",this.J.hidden=!0,this.callEvent("onHide",[]))},close:function(){this.destructor()},Un:function(t){"undefined"==typeof t.borderless&&(t.borderless=!0)},body_setter:function(t){return"object"!=k(
t)&&(t={template:t}),this.Un(t),(M._=this).K=zt.rt(t),this.zn.appendChild(this.K.st),t},head_setter:function(t){return!1===t||("object"!=k(t)&&(this.st.setAttribute("aria-label",t),t={template:t,padding:0}),t.borderless=!0,(M._=this).Vn=zt.rt(t),this.pn.appendChild(this.Vn.st)),t},getBody:function(){return this.K},getHead:function(){return this.Vn},adjust:function(){return this.resize()},resizeChildren:function(){this.K&&this.resize()},resize:function(){ji.api.adjust.call(this),this.isVisible()&&this.jn(this.J.left,this.J.top)},Bn:function(){if(this.J.master){var t=Pt(this.J.master).getTopParentView().$view;return t&&"fixed"===t.style.position}return!1},jn:function(t,i){if(this.J.position||this.Bn()){this.$view.style.position="fixed";var e=this.be,s=this.we;if(e<=0||s<=0)return;var n=window.innerWidth||document.documentElement.offsetWidth,h=window.innerHeight||document.documentElement.offsetHeight,r=Math.round((n-e)/2),o=Math.round((h-s)/2);if("function"==typeof this.J.position){var a={left:r,top:o,width:e,height:s,maxWidth:n,maxHeight:h};this.J.position.call(this,a),a.width==e&&a.height==s||this.$setSize(a.width,a.height),this.setPosition(a.left,a.top)}else"top"==this.J.position&&(o=Gi.isSupported()?-1*s:10),this.J.position||(r=this.J.left||r,o=this.J.top||o),this.setPosition(r,o);"top"==this.J.position&&Gi(this.st,{type:"slide",x:0,y:s-2*(this.J.padding||0),duration:300,callback:this.Yn,master:this})}else this.setPosition(t,i)},Yn:function(t){Gi.clear(t),this.J.top=-2*(this.J.padding||0),this.setPosition(this.J.left,this.J.top)},setPosition:function(t,i){this.st.style.top=i+"px",this.st.style.left=t+"px",this.J.left=t,this.J.top=i},$getSize:function(t,i){var e=this.J.Z;e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1)),this.J.head&&(i+=1);var s=this.K.$getSize(0,0),n=0;if(this.Vn){var h=this.Vn.$getSize(0,0);h[3]==h[2]&&(this.J.headHeight=h[3]),i+=this.J.headHeight,n=h[0]}if(this.J.fullscreen){var r=window.innerWidth||document.body.clientWidth,o=window.innerHeight||document.body.clientHeight;return[r,r,o,o]}var a=Li.api.$getSize.call(this,0,0);return n&&1e5<s[1]&&(s[0]=Math.max(n,s[0])),a[1]=Math.min(a[1],(1e5<=s[1]&&1e5<=a[1]?Math.max(s[0],a[0]):s[1])+t),a[3]=Math.min(a[3],(1e5<=s[3]&&1e5<=a[3]?Math.max(s[2],a[2]):s[3])+i),a[0]=Math.min(Math.max(a[0],s[0]+t),a[1]),a[2]=Math.min(Math.max(a[2],s[2]+i),a[3]),a},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),t=this.be,i=this.we,!1===this.J.head?(this.pn.style.display="none",this.K.$setSize(t,i)):(this.Vn.$setSize(t,this.J.headHeight),this.K.$setSize(t,i-this.J.headHeight))},$skin:function(){this.defaults.headHeight=Xi.barHeight},defaults:{top:0,left:0,autofit:!0,relative:"bottom",body:"",head:"",hidden:!0,autofocus:!0,minWidth:300,minHeight:200}},re={api:he,view:H.protoUI(he,Li.view,ee,se,g,ne)},oe={defaults:{padding:"4",hidden:!0},body_setter:function(t){return t=re.api.body_setter.call(this,t),this.K.st.style.borderWidth="0px",t},attachTo:function(t){var i;i=t.on_context?t.attachEvent("onAfterContextMenu",C(this.Wn,this)):Lt(t,"contextmenu",this.Gn,{bind:this}),this.attachEvent("onDestruct",function(){t.callEvent?t.detachEvent(i):Ot(i),t=null})},getContext:function(){return this.Xn},setContext:function(t){this.Xn=t},Gn:function(t){return this.Xn=D(t||Lt),this.qn(t)},Wn:function(t,i){return this.Xn={obj:Pt(i),id:t},this.qn(i)},qn: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}},ae={Xn:null,Kn:null,Zn:0,init:function(){return null!==this.Xn||(M.destructors.push({obj:this}),this.Xn=document.createElement("textarea"),this.Xn.className="webix_clipbuffer",this.Xn.setAttribute("webixignore",1),this.Xn.setAttribute("spellcheck","false"),this.Xn.setAttribute("autocapitalize","off"),this.Xn.setAttribute("autocorrect","off"),this.Xn.setAttribute("autocomplete","off"),document.body.appendChild(this.Xn),Lt(document.body,"keydown",C(function(t){var i=t.keyCode,e=!(!t.ctrlKey&&!t.metaKey);86===i&&e&&(this.Xn.value="",$(this.Qn,this,[t],100))},this))),this.Xn},
destructor:function(){this.Xn=null},set:function(t){this.init(),t=""===t?"\n":t,this.Xn.value=t,this.focus()},focus:function(){this.th()||(this.init(),this.Xn.focus(),this.Xn.select())},th: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},Qn:function(t){if((t.target||t.srcElement)===this.Xn){var i=this.Xn.value,e=Ai.getFocus();!e||e.getEditor&&e.getEditor()||(e.callEvent("onPaste",[i]),this.Xn.select())}}},ue={clipboard_setter:function(t){return!0!==t&&1!==t||(t="modify"),this.attachEvent("onAfterSelect",function(t){var i=this.getItem(t),e=this.type.templateCopy(i);ae.set(e,this),ae.focus(),Ai.setFocus(this)}),this.attachEvent("onPaste",function(t){x(this.Qn[this.J.clipboard])||this.Qn[this.J.clipboard].call(this,t)}),this.attachEvent("onFocus",function(){ae.focus()}),this.attachEvent("onItemClick",function(t){this.ih&&-1===this.ih.find(t)||(ae.focus(),Ai.setFocus(this))}),t},Qn:{insert:function(t){this.add({value:t})},modify:function(t){for(var i=this.getSelectedId(!0),e=0;e<i.length;e++)this.getItem(i[e]).value=t,this.refresh(i[e])},custom:function(){}},templateCopy_setter:function(t){this.type.templateCopy=It(t)},type:{templateCopy:function(t){return this.template(t)}}},ce={$customPrint:function(t,i){if(this.eh(t,i))return!0;var e=this.sh(t),s=this.nh(e,t);if(i)return s;var n=Y("div",{"class":"webix_ui_print"});n.appendChild(s),X(n,t.docFooter,document.body),window.print(),G(n)},eh: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)},hh: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)},sh:function(t,i,e){var s,n,h=this.hh(t),r=t.xCount||this.oh().rh,o=[],a=[],u=0;e=e||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&&e<=n){if(h<(u+=this.type.width)&&e<n){s=a.length+e,o.push(a),c+=r-a.length,a=[],u=0;continue}var l=this.type.template(f,this.type),d=this.ah,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),s&&this.sh(t,i,s),i},nh:function(n,h){var r=Y("div");return n.forEach(C(function(t,i){var e=Y("table",{"class":"webix_table_print "+this.$view.className,style:"border-collapse:collapse"});if(t.forEach(function(t){var s=Y("tr");t.forEach(function(i){var e=Y("td");(i.txt&&(e.innerHTML=i.txt),i.className&&(e.className=i.className),i.style)&&Object.keys(i.style).forEach(function(t){i.style[t]&&(e.style[t]=i.style[t])});i.span&&(1<i.span.colspan&&(e.colSpan=i.span.colspan),1<i.span.rowspan&&(e.rowSpan=i.span.rowspan)),s.appendChild(e)}),e.appendChild(s)}),r.appendChild(e),!h.nobreaks&&i+1<n.length){var s=Y("DIV",{"class":"webix_print_pagebreak"});r.appendChild(s)}},this)),r}},fe={scrollStep:40,init:function(){this.uh(),S.$customScroll=!0,S.scrollSize=0,M.destructors.push({obj:{destructor:function(){this.ch=null}}}),T("onReconstruct",fe.fh),T("onResize",fe.fh),T("onClick",fe.fh)},resize:function(){this.fh()},lh:function(t){t.Wt.dh=t.J.id,t.attachEvent("onAfterRender",function(){var t=fe.vh(this),i=Math.max(t.dy-t.py,0),e=Math.max(t.dx-t.px,0);this._h&&this.ph>i?this._h.scrollTo(i):this.mh&&this.bh>e&&this.mh.scrollTo(e),fe.ch==this.Wt&&fe.fh()}),Nt(t.Wt,"mouseover",fe.gh),Nt(t.Wt,"mouseout",fe.wh)},enable:function(t,i){if(fe.uh(),t.mapCells)return this.lh(t);var e=t;t.mt&&(e=t.mt.parentNode),e.xh=i||"xy",Nt(e,"mouseover",fe.gh),Nt(e,"mouseout",fe.wh),Nt(e,"mousewheel",fe.yh,{passive:!1}),Nt(e,"DOMMouseScroll",fe.yh,{passive:!1}),this.Mh(t)},fh:function(){var t=fe.ch;t&&t.Sh&&(fe.kh.call(t),fe.gh.call(t))},uh:function(){Lt(document.body,"mousemove",function(t){fe.Ch&&fe.$h(fe.Ch,fe.Ch.Dh,Z(t))}),fe.uh=function(){}},gh:function(){
if(fe.ch=this,clearTimeout(this.Ah),!this.Sh&&!fe.Ch){var t=Pt(this);if(!t||t.isEnabled()){var i;if(this.dh){if(!(t=Pt(this.dh)))return;i=fe.vh(t)}else(i={dx:this.scrollWidth,dy:this.scrollHeight,px:this.clientWidth,py:this.clientHeight}).xe=i.dx>i.px&&-1!=this.xh.indexOf("x"),i.ge=i.dy>i.py&&-1!=this.xh.indexOf("y");(this.Sh=i).xe&&(i.Ih=fe.zs(this,"x",i.dx,i.px,"width","height"),i.Th=i.px-i.Ih.offsetWidth-4,i.Fh=i.dx-i.px,fe.trackBar&&(i.zh=fe.Vh(this,"x"))),i.ge&&(i.Hh=fe.zs(this,"y",i.dy,i.py,"height","width"),i.Bh=i.py-i.Hh.offsetHeight-4,i.Rh=i.dy-i.py,fe.trackBar&&(i.Ph=fe.Vh(this,"y"))),fe.jh(this)}}},Vh:function(t,i){var e=Y("DIV",{webixignore:"1","class":"webix_c_scroll_bar_"+i},"");return t.appendChild(e),e},$h:function(t,i,e){var s=t.Sh,n=t.dh;if(n&&(n=Pt(n)),s.Ih==t.Eh){var h=(e.x-i.x)*s.Fh/s.Th;n?n.mh.scrollTo(n.bh+h):fe.Nh(t,"scrollLeft",h)}if(s.Hh==t.Eh){var r=(e.y-i.y)*s.Rh/s.Bh;n?n._h.scrollTo(n.ph+r):fe.Nh(t,"scrollTop",r)}t.Dh=e,fe.jh(t)},vh:function(t){var i={};return t.mh&&t.J.scrollX&&(i.dx=t.mh.getSize(),i.px=t.mh.Lh||1,i.xe=1<i.dx-i.px),t._h&&t.J.scrollY&&(i.dy=t._h.getSize(),i.py=t._h.Lh||1,i.ge=1<i.dy-i.py),i},wh:function(){clearTimeout(this.Ah),this.Ah=$(fe.kh,this,[],200)},Oh:function(t){t&&(G(t),t.Uh&&(Ot(t.Uh),Ot(t.Yh),Ot(t.Wh)))},kh:function(){if(this.Sh){if(this.Eh)return void(this.Gh=!0);var t=this.Sh;fe.Oh(t.Ih),fe.Oh(t.Hh),st(document.body,"webix_noselect"),t.zh&&G(t.zh),t.Ph&&G(t.Ph),this.Sh=null}},yh:function(t){var i=this.Sh,e=t.wheelDelta/-40,s=!1;if(!e&&t.detail&&x(t.wheelDelta)&&(e=t.detail),i){t.scrolledBy||(t.scrolledBy=i.ge?"y":"x");var n=t.wheelDeltaX&&Math.abs(t.wheelDeltaX)>Math.abs(t.wheelDeltaY);if(i.Ih&&("y"!==t.scrolledBy&&(t.wheelDeltaX||e)||n)){var h=t.wheelDeltaX/-40||e;s=fe.Nh(this,"scrollLeft",h*fe.scrollStep)}else!n&&e&&i.Hh&&(s=fe.Nh(this,"scrollTop",e*fe.scrollStep))}if(fe.jh(this),!1!==s)return Q(t)},Nh:function(t,i,e){var s=t.Sh,n="scrollLeft"==i?s.dx-s.px:s.dy-s.py,h=t[i];return n<h+e&&(e=n-h),!(!e||h+e<0&&0===h)&&(S.isIE&&fe.jh(t,i,e+h),t[i]+=e,!0)},zs:function(t,i,e,s,n){var h=Y("DIV",{webixignore:"1","class":"webix_c_scroll_"+i},"<div></div>");return h.style[n]=Math.max(s*s/e-7,40)+"px",t.style.position="relative",t.appendChild(h),t.Uh=Lt(h,"mousedown",fe.Xh(t)),t.Yh=Lt(document.body,"mouseup",C(fe.qh,t)),t.Wh=Lt(document.body,"mouseleave",C(fe.qh,t)),h},Xh:function(i){return function(t){et(document.body,"webix_noselect",1),this.className+=" webix_scroll_active",(fe.Ch=i).Eh=this,i.Dh=Z(t)}},qh:function(){this.Eh&&(st(document.body,"webix_noselect"),this.Eh.className=this.Eh.className.toString().replace(" webix_scroll_active",""),this.Eh=!1,fe.Ch=0,this.Gh&&(fe.kh.call(this),this.Gh=!1))},jh:function(t,i,e){var s=t.Sh;if(s&&(s.Ih||s.Hh)){var n=t.dh,h="scrollLeft"==i?e:t.scrollLeft,r=n?Pt(n).bh:h,o=n?0:r,a="scrollTop"==i?e:t.scrollTop,u=n?Pt(n).ph:a,c=n?0:u;s.Ih&&(s.Ih.style.bottom=1-c+"px",s.Ih.style.left=Math.round(s.Th*r/(s.dx-s.px))+o+1+"px",s.zh&&(s.zh.style.bottom=1-c+"px",s.zh.style.left=o+"px")),s.Hh&&(s.Hh.style.right=0-o+"px",s.Hh.style.top=Math.round(s.Bh*u/(s.dy-s.py))+c+1+"px",s.Ph&&(s.Ph.style.right=0-o+"px",s.Ph.style.top=c+"px"))}},Mh:function(i){i.data&&i.data.attachEvent&&i.data.attachEvent("onStoreUpdated",function(){var t=fe.ch;t&&i.$view.contains(t)&&fe.resize()})}},le={addCss:function(t,i,e){if(!this.addRowCss&&!e&&!this.hasCss(t,i)){var s=this.getItemNode(t);s&&(s.className+=" "+i,e=!0)}return this.data.addMark(t,i,1,1,e)},removeCss:function(t,i,e){if(!this.addRowCss&&!e&&this.hasCss(t,i)){var s=this.getItemNode(t);s&&(s.className=s.className.replace(i,"").replace("  "," "),e=!0)}return this.data.removeMark(t,i,1,e)},hasCss:function(t,i){return this.data.getMark(t,i)},clearCss:function(t,i){return this.data.clearMark(t,1,i)}},de={copy:function(t,i,e,s){var n=(s=s||{}).newId||t;e=e||this;var h=this.getItem(t);return e&&(h=e.Jh(h)),e.data.add(e.Jh(h,n),i,s.parent||0)},Kh:function(t,i,e){if(i&&t){var s=this.getIndexById(t);return s+(e==this&&e.getIndexById(i)<s?0:1)}},move:function(t,i,e,s){var n=(s=s||{}).newId||t;if((e=e||this).data,
e.data){if(b(t)){3<t.length&&(this.$blockRender=e.$blockRender=!0);for(var h=0;h<t.length;h++){var r=this.move(t[h],i,e,s);i=e.Kh(r,t[h+1],this)}return this.$blockRender=e.$blockRender=!1,void(3<t.length&&(this.refresh(),e!=this&&e.refresh()))}var o=t,a=this.getItem(t);return e&&e!=this?(o=e.data.add(e.Jh(a,n),i,s.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 e=H.extend({},t);return e.id=!i||this.data.pull[i]?z():i,e.$template=null,this.J.externalData&&(e=this.J.externalData.call(this,e,i,t)),e}},ve={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}},_e={$init:function(){this.$&&this.attachEvent("onChange",this.clearValidation)},clearValidation:function(){if(this.elements)for(var t in this.elements)this.Zh(t)},validate:function(t,i){this.callEvent,this.callEvent("onBeforeValidate",[]);var e=this.Qh={},s=!0,n=this.J.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&&(s=this.ir(n.$obj,i,i,"")&&s);var l=n.$all,d=i;if(this.J.complexData&&(d=xt.collapseNames(i,"",{},function(t){return!n[t]})),l)for(var v in i)if(!u[v]){var _=this.ir(l,d[v],i,v);_||(e[v]=!0),s=_&&s}for(var p in n)if(!u[p]&&0!==p.indexOf("$")&&!e[p]){n[p];var m=this.ir(n[p],d[p],i,p);m||(e[p]=!0),s=m&&s}}if(a)for(var b in a)if(!e[b]){var g=a[b];if(g.validate){var w=g.validate();s=w&&s,w||(e[b]=!0)}else{var x=g.J;if(x){var y=x.validate;if(!y&&x.required&&(y=n.isNotEmpty),y){var M=this.ir(y,i[b],i,b);M||(e[b]=!0),s=M&&s}}}}return this.callEvent("onAfterValidation",[s,this.Qh]),s},ir:function(t,i,e,s){return"string"==typeof t&&(t=ve[t]),t.call(this,i,e,s)?(this.callEvent("onValidationSuccess",[s,e])&&this.Zh&&this.Zh(s),!0):(this.callEvent("onValidationError",[s,e])&&this.sr&&this.sr(s),!1)}},pe={};function me(t,i){if("object"==k(t)&&t.J&&(t=t.J.id),pe[t]||i)return pe[t];"string"!=typeof t&&"number"!=typeof t||(t={master:Pt(t)});var e=new be(t),s=e.J.master.J.id;return pe[s]=e,Pt(s).attachEvent("onDestruct",function(){pe[this.J.id]=null,delete pe[this.J.id]}),e}u("dp",me),me.$$=function(t){return pe[t]};var be=H.proto({defaults:{autoupdate:!0,updateFromResponse:!1,mode:"post",operationName:"webix_operation",trackMove:!1},$init:function(){this.reset(),this.nr=!1,this.name="DataProcessor",this.$ready.push(this.hr)},reset:function(){this.rr=[]},url_setter:function(t){var i="";if("string"==typeof t){var e=t.split("->");1<e.length&&(t=e[1],i=e[0])}else t&&t.mode&&(i=t.mode,t=t.url);return i?fi(i,t):t},master_setter:function(t){var i=t;return"DataStore"!=t.name&&(i=t.data),this.J.store=i,t},hr:function(){this.J.store,this.J.store.attachEvent("onStoreUpdated",C(this.or,this)),this.J.store.attachEvent("onDataMove",C(this.ar,this))},ignore:function(t,i){var e=this.nr;this.nr=!0,t.call(i||this),this.nr=e},off:function(){this.nr=!0},on:function(){this.nr=!1},ur:function(t){var i={};for(var e in t)0!==e.indexOf("$")&&(i[e]=t[e]);return i},save:function(t,i,e){i=i||"update",this.cr(t,e||this.J.store.getItem(t),i)},cr:function(t,i,e){if("object"==k(t)&&(t=t.toString()),!t||!0===this.nr||!e||"paint"==e)return!0;var s=this.J.store;s&&s.fr&&(i=s.fr(i));var n={id:t,data:this.ur(i),operation:e};if(x(i.$parent)||(n.data.parent=i.$parent),"delete"!=n.operation){var h=this.J.master;h&&h.data&&h.data.getMark&&h.data.getMark(t,"webix_invalid")&&(n.lr=!0),this.validate(null,n.data)||(n.lr=!0)}
return this.dr(n)&&this.rr.push(n),this.J.autoupdate&&this.send(),!0},ar:function(t,i,e,s){if(this.J.trackMove){var n=B(this.J.store.getItem(t));n.webix_move_index=i,n.webix_move_id=s,n.webix_move_parent=e,this.cr(t,n,"order")}},or:function(t,i,e){switch(e){case"save":case"update":e="update";break;case"add":e="insert";break;case"delete":e="delete";break;default:return!0}return this.cr(t,i,e)},dr:function(t){for(var i=0;i<this.rr.length;i++){var e=this.rr[i];if(e.id==t.id&&!e.vr)return"delete"==t.operation&&("insert"==e.operation?this.rr.splice(i,1):e.operation="delete"),e.data=t.data,e.lr=t.lr,!1}return!0},send:function(){this._r()},_r:function(){var i=this;if(this.J.url){for(var t=this.rr,e=[],s=this.J.url,n=0;n<t.length;n++){var h=t[n];if(!h.vr&&!h.lr){var r=h.id,o=h.operation,a=fi.$parse("object"!=k(s)||s.$proxy?s:s[o]),u=a&&(a.$proxy||"function"==typeof a);if(a&&(this.J.store.pr&&this.J.store.pr(h.data),this.callEvent("onBefore"+o,[r,h]))){if(h.vr=!0,!this.callEvent("onBeforeDataSend",[h]))return;h.data=this.mr(h.data);var c=this.gr({id:h.id,status:h.operation});if(a.$proxy){if(a.save){var f=a.save(this.config.master,h,this);this.wr(f,c)}e.push(h)}else if("insert"==o&&delete h.data.id,u){var l=a.call(this.config.master,h.id,h.operation,h.data);this.wr(l,c)}else h.data[this.J.operationName]=o,this.O(a,h.data,this.J.mode,o,c);this.callEvent("onAfterDataSend",[h])}}}if(s.$proxy&&s.saveAll&&e.length){var d=s.saveAll(this.config.master,e,this);d&&(d.then||(d=mt.resolve(d)),d.then(function(t){t&&"function"==typeof t.json&&(t=t.json()),i.xr(t)},function(t){i.yr(null,"",null,t)}))}}},wr:function(t,i){t&&(t.then||(t=mt.resolve(t)),t.then(function(t){t&&"function"==typeof t.json&&(t=t.json()),i.success("",t,-1)},function(t){i.error("",null,t)}))},mr:function(t){var i={};for(var e in t)0!==e.indexOf("$")&&(i[e]=t[e]);return i},O:function(t,i,e,s,n){if("function"==typeof t)return t(i,s,n);wt()[e](t,i,n)},gr:function(s){var n=this;return{success:function(t,i,e){return n.xr(s,t,i,e)},error:function(t,i,e){return n.yr(s,t,i,e)}}},attachProgress:function(t,i,e){this.attachEvent("onBeforeDataSend",t),this.attachEvent("onAfterSync",i),this.attachEvent("onAfterSaveError",e),this.attachEvent("onLoadError",e)},yr:function(t,i,e,s){t?this.Mr(!0,t.id,!1,t.status,!1,{text:i,data:e,loader:s}):(this.callEvent("onLoadError",arguments),I("onLoadError",[i,e,s,this]))},Mr:function(t,i,e,s,n,h){var r=this.J.master,o=this.getItemState(i);o.vr=!1,t?this.callEvent("onBeforeSaveError",[i,s,n,h])&&(o.lr=!0,this.J.undoOnError&&r.J.undo&&(this.ignore(function(){r.undo(i)}),this.setItemState(i,!1)),this.callEvent("onAfterSaveError",[i,s,n,h])):(this.setItemState(i,!1),e&&i!=e&&this.J.store.changeId(i,e),n&&"delete"!=s&&this.J.updateFromResponse&&this.ignore(function(){this.J.store.updateItem(e||i,n)}),this.J.undoOnError&&r.J.undo&&r.removeUndo(e||i),this.callEvent("onAfterSave",[n,i,h]),this.callEvent("onAfter"+s,[n,i,h]))},processResult:function(t,i,e){var s=i&&("error"==i.status||"invalid"==i.status),n=!!i&&(i.newid||i.id);this.Mr(s,t.id,n,t.status,i,e)},xr:function(t,i,e,s){var n=this;if(this.callEvent("onBeforeSync",[t,i,e,s]),b(t))t.forEach(function(t){n.processResult(t,t,{})});else if(-1===s)this.processResult(t,e,{});else{var h,r=this.J.url;if(r.$proxy&&r.result)r.result(t,this.J.master,this,i,e,s);else i&&(h=e.json(),i&&null==h&&(h={status:"error"})),this.processResult(t,h,{text:i,data:e,loader:s})}this.callEvent("onAfterSync",[t,i,e,s])},escape:function(t){return this.J.escape?this.J.escape(t):encodeURIComponent(t)},getState:function(){if(!this.rr.length)return!1;for(var t=this.rr.length-1;0<=t;t--)if(this.rr[t].vr)return"saving";return!0},getItemState:function(t){var i=this.Sr(t);return this.rr[i]||null},setItemState:function(t,i){if(i)this.save(t,i);else{var e=this.Sr(t);-1<e&&this.rr.splice(e,1)}},Sr:function(t){for(var i=-1,e=0;e<this.rr.length;e++)if(this.rr[e].id==t){i=e;break}return i}},Ii,g,_e);function ge(){this.name="DataStore",H.extend(this,g),this.setDriver("json"),this.pull={},this.order=p(),this.kr={}}ge.prototype={
setDriver:function(t){hi[t],this.driver=hi[t]},jt:function(t){this.callEvent("onParse",[this.driver,t]),this.Cr&&this.filter();var i=this.driver.getInfo(t);i.key&&(M.securityKey=i.key),i.config&&this.callEvent("onServerConfig",[i.config]);var e=this.driver.getOptions(t);e&&this.callEvent("onServerOptions",[e]);var s=this.driver.getRecords(t);this.Dr(i,s),this.Ar&&this.Ir&&!this.Tr&&this.Ir(this.Ar),this.Fr&&(this.blockEvent(),this.sort(this.Fr),this.unblockEvent()),this.callEvent("onStoreLoad",[this.driver,t]),this.refresh()},Dr:function(t,i){var e=t.from,s=!0,n=!1;if(!e&&0!==e&&this.order[0]){if(this.zr){n={};for(var h=0;h<this.order.length;h++)n[this.order[h]]=!0}s=!1,e=this.order.length}else e=1*(e||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]?s&&this.order[r+e]&&r++:(this.order[r+e]=u,r++),this.pull[u]?(H.extend(this.pull[u],a,!0),this.Vr&&this.Vr(this.pull[u]),n&&delete n[u]):(this.pull[u]=a,this.Hr&&this.Hr(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.Cr&&(this.Cr[this.Cr.find(t)]=i),this.kr[t]&&(this.kr[i]=this.kr[t],delete this.kr[t]),this.callEvent("onIdChange",[t,i]),this.Br&&this.Br(t,i),delete this.pull[t])},getItem:function(t){return this.pull[t]},updateItem:function(t,i,e){"object"===k(t)&&(t=t.toString());var s=this.getItem(t),n=null,h=this.hasEvent("onDataUpdate");!i||!i.id||i.id,x(i)||s===i||(h&&(n=B(s)),t=s.id,H.extend(s,i,!0),s.id=t),this.Vr&&this.Vr(s),this.callEvent("onStoreUpdated",[t,s,e||"update"]),h&&this.callEvent("onDataUpdate",[t,s,n])},refresh:function(t){this.Rr||(t?this.exists(t)&&this.callEvent("onStoreUpdated",[t,this.pull[t],"paint"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(t,i){this.Rr=!0,t.call(i||this),this.Rr=!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 e=i;i=t,t=e}return this.getIndexRange(t,i)},getIndexRange:function(t,i){i=Math.min(0===i?0:i||Infinity,this.count()-1);for(var e=p(),s=t||0;s<=i;s++)e.push(this.getItem(this.order[s]));return e},count:function(){return this.order.length},exists:function(t){return!!this.pull[t]},move:function(t,i){if(t!=i){var e=this.getIdByIndex(t),s=this.getItem(e);this.Cr&&this.Pr(this.Cr,0,0,this.getIdByIndex(t),this.getIdByIndex(i)),this.Pr(this.order,t,i),this.callEvent("onStoreUpdated",[e,s,"move"])}},Pr:function(t,i,e,s,n){if(s||n){i=e=-1;for(var h=0;h<t.length;h++)t[h]==s&&i<0&&(i=h),t[h]==n&&e<0&&(e=h)}var r=t[i];t.removeAt(i),t.insertAt(r,Math.min(t.length,e))},scheme:function(t){for(var i in this.jr={},this.pr=t.$save,this.Hr=t.$init||t.$change,this.Vr=t.$update||t.$change,this.fr=t.$serialize,this.Ar=t.$group,this.Fr=t.$sort,this.Er=t.$export,t)"$"!=i.substr(0,1)&&(this.jr[i]=t[i])},importData:function(t,i){var e=t?t.data||t:[];if(this.Cr=null,"function"==typeof e.serialize){if(this.order=p([].concat(e.order)),this.Nr){this.Nr=!1;var s=this.pull;for(var n in this.pull={},e.pull){var h=s[n];this.pull[n]=B(e.pull[n]),h&&h.open&&(this.pull[n].open=!0)}}else this.pull=e.pull;e.branch&&this.branch&&(this.branch=B(e.branch),this.Lr=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.Hr&&this.Hr(o),this.pull[o.id]=o;else for(var u in e)this.order.push(u),this.pull[u]={id:u,value:e[u]}}if(this.Or&&!e.branch){this.branch={0:[]},this.Ur||this.Yr("data");for(var c=0;c<this.order.length;c++){var f=this.order[c];this.Or(this.pull[f],0,0,!1)}}this.callEvent("onStoreLoad",[]),i||this.callEvent("onStoreUpdated",[])},sync:function(s,n,h){this.unsync();var t=k(s);if("string"==t&&(
s=Pt(s)),"function"!=t&&"object"!=t&&(h=n,n=null),"DataStore"!=s.name){if(!s.data||"DataStore"!==s.data.name&&"TreeStore"!==s.data.name)return this.Wr=s,I("onSyncUnknown",[this,s,n]);s=s.data}var i=C(function(t,i,e){this.Gr||(n&&this.branch&&(this.Nr=!0),this.importData(s,!0),n&&this.silent(n),this.re&&this.re(),t&&i&&e||(this.kr={}),"delete"==e&&this.kr[t]&&delete this.kr[t],this.callEvent("onSyncApply",[]),h?h=!1:this.refresh())},this);this.Xr=[s.attachEvent("onStoreUpdated",i),s.attachEvent("onIdChange",C(function(t,i){this.changeId(t,i),this.refresh(i)},this))],this.Wr=s,this.qr=this.attachEvent("onStoreUpdated",function(t,i,e){"update"!=e&&"save"!=e||(this.Gr=1,s.updateItem(t,i),this.Gr=0)}),i()},unsync:function(){if(this.Wr){var t=this.Wr;if("DataStore"==t.name||t.data&&"DataStore"==t.data.name){for(var i=0;i<this.Xr.length;i++)t.detachEvent(this.Xr[i]);this.detachEvent(this.qr)}else I("onUnSyncUnknown",[this,t]);this.Wr=null}},destructor:function(){this.unsync(),this.pull=this.order=this.kr=null,this.V=this.H={}},add:function(t,i){if(this.jr)for(var e in this.jr)x(t[e])&&(t[e]=this.jr[e]);this.Hr&&this.Hr(t);var s=this.id(t),n=arguments[2]||this.order,h=n.length;if((x(i)||i<0)&&(i=h),h<i&&(i=Math.min(n.length,i)),!1===this.callEvent("onBeforeAdd",[s,t,i]))return!1;if(this.exists(s),this.pull[s]=t,n.insertAt(s,i),this.Cr){var r=this.Cr.length;this.order.length&&(r=Math.min(i||0,r)),this.Cr.insertAt(s,r)}return this.callEvent("onStoreUpdated",[s,t,"add"]),this.callEvent("onAfterAdd",[s,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 e=this.getItem(t);this.order.remove(t),this.Cr&&this.Cr.remove(t),delete this.pull[t],this.kr[t]&&delete this.kr[t],this.callEvent("onStoreUpdated",[t,e,"delete"]),this.callEvent("onAfterDelete",[t])}},clearAll:function(t){this.pull={},this.kr={},this.order=p(),this.Cr=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,e){var s=t;"function"==typeof t?s={as:t,dir:i}:"string"==typeof t&&(s={by:t.replace(/#/g,""),dir:i,as:e});var n=[s.by,s.dir,s.as,s];this.callEvent("onBeforeSort",n)&&(this.order=this.Jr(s,this.order),this.Cr&&this.Cr.length!=this.order.length&&(this.Cr=this.Jr(s,this.Cr)),this.refresh(),this.callEvent("onAfterSort",n))},Jr:function(t,i){var e=this.sorting.create(t);if(this.order.length){for(var s=i.splice(0,this.$freeze),n=p(),h=i.length-1;0<=h;h--)n[h]=this.pull[i[h]];return n.sort(e),p(s.concat(n.map(function(t){return this.id(t)},this)))}return i},Kr:function(t){this.Cr&&!t&&(this.order=this.Cr,delete this.Cr)},Zr:function(t,i,e){for(var s=p(),n=this.$freeze||0,h=0;h<this.order.length;h++){var r=this.order[h];(h<n||t(this.getItem(r),i))&&s.push(r)}e&&this.Cr||(this.Cr=this.order),this.order=s},find:function(t,i){var e=[];for(var s in this.pull){var n=this.pull[s],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&&e.push(n),i&&e.length)return e[0]}return i?null:e},filter:function(e,i,t){if((e||this.Cr||this.Lr)&&this.callEvent("onBeforeFilter",[e,i])&&(this.Kr(t),this.order.length)){if(e){var s=e;i=i||"","string"==typeof e&&(e=e.replace(/#/g,""),s="function"==typeof i?function(t){return i(t[e])}:(i=i.toString().toLowerCase(),function(t,i){return-1!=(t[e]||"").toString().toLowerCase().indexOf(i)})),this.Zr(s,i,t,this.Qr)}this.refresh(),this.callEvent("onAfterFilter",[])}},io: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,e){var s=this.order;e&&(s=this.Cr||s);for(var n=0;n<s.length;n++)s[n]&&t.call(i||this,this.getItem(s[n]),n)},eo: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 e=["sort","add","remove","exists","getIdByIndex","getIndexById","getItem","updateItem","refresh","count","filter","find","getNextId","getPrevId","clearAll","getFirstId","getLastId","serialize","sync"],s=0;s<e.length;s++)t[e[s]]=this.eo(this,e[s])},addMark:function(t,i,e,s,n){var h=this.kr[t]||{};if(!(this.kr[t]=h)[i]){if(h[i]=s||!0,e){var r=h.$css||"";h.$css=r+" "+i}n||this.refresh(t)}return h[i]},removeMark:function(t,i,e,s){var n=this.kr[t];if(n){if(n[i]&&delete n[i],e){var h=n.$css;h&&(n.$css=h.replace(i,"").replace("  "," "))}s||this.refresh(t)}},getMark:function(t,i){var e=this.kr[t];return!!e&&e[i]},clearMark:function(t,i,e){for(var s in this.kr){var n=this.kr[s];n[t]&&(delete n[t],i&&n.$css&&(n.$css=n.$css.replace(t,"").replace("  "," ")),e||this.refresh(s))}},serialize:function(t){var i=this.order;t&&this.Cr&&(i=this.Cr);for(var e=[],s=0;s<i.length;s++){var n=this.pull[i[s]];this.fr&&!1===(n=this.fr(n))||e.push(n)}return e},sorting:{create:function(t){return this.so(t.dir,this.no(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}},no:function(e,s){return e?("function"!=typeof s&&(s=this.as[s||"string"]),function(t,i){return s(t[e],i[e])}):s},so:function(t,e){return"asc"!=t&&t?function(t,i){return-1*e(t,i)}:e}}};var we=H.proto({$init:function(t){t=t||"",this.ho={},this.Vt=1,this.data=new ge,this.data.attachEvent("onClearAll",C(this.ro,this)),this.data.attachEvent("onServerConfig",C(this.oo,this)),this.attachEvent("onDestruct",this.ro),this.data.feed=this.ao,this.data.owner=t.id},ao:function(t,i,e,s){return this.uo?(s=mt.defer(),this.uo=[t,i,e,s],s):(this.uo=!0,this.ho.from=t,this.ho.count=i,this.co.call(this,t,i,e,!1,!1,s))},co:function(t,i,e,s,n,h){var r=this,o=null;if(s=s||this.data.url,t<0&&(t=0),n||(n={start:t,count:i}),this.count()&&(n["continue"]="true"),this.getState&&(o=this.getState()),s&&"string"!=typeof s)return o&&(o.sort&&(n.sort=o.sort),o.filter&&(n.filter=o.filter)),this.load(s,0,n).then(function(t){return r.fo(t,e,h)},function(){return r.lo()});s+=-1==s.indexOf("?")?"?":"&";var a=[];for(var u in n)a.push(u+"="+n[u]);if(o&&(o.sort&&a.push("sort["+o.sort.id+"]="+encodeURIComponent(o.sort.dir)),o.filter))for(var c in o.filter){var f=o.filter[c];"object"==k(f)&&(f=wt().stringify(f)),a.push("filter["+c+"]="+encodeURIComponent(f))}if(s+=a.join("&"),this.ho.url!==s)return this.ho.url=s,this.load(s).then(function(t){return r.fo(t,e,h)},function(){return r.lo()});this.uo=!1},fo:function(t,i,e){var s=this;return $(function(){return s.lo()},"","",100),i&&wt.$callback(this,i,t),e&&e.resolve(t),t},lo:function(){var t=this.uo;this.uo=!1,"object"==k(t)&&this.data.feed.apply(this,t)},load:function(t){t=fi.$parse(t);var i=li.load.apply(this,arguments);return this.data.url||(this.data.url=t),i},loadNext:function(t,i,e,s,n){var h=this.J;if(h.datathrottle&&!n){this["do"]&&window.clearTimeout(this["do"]);var r=mt.defer();return this["do"]=$(function(){r.resolve(this.loadNext(t,i,e,s,!0))},this,0,h.datathrottle),r}if(i||0===i||(i=this.count()),t||(t=h.datafetch||this.count()),this.data.url=this.data.url||s,this.callEvent("onDataRequest",[i,t,e,s])&&this.data.url){var o=this.data.feed.call(this,i,t,e);return o&&o.then?o:mt.reject("Attempt to load data with the same url")}},vo:function(t,i){var e=this.ho;return!!(this.uo&&e.url&&e.from<=i&&e.count+e.from>=t+i)},removeMissed_setter:function(t){return this.data.zr=t},_o:function(){var t=this.J.save;!0===t&&(t=this.J.save=this.J.url);var i={master:this};t&&t.url?H.extend(i,t):i.url=t,me(i)},save_setter:function(t){return t&&this.$ready.push(this._o),t},
scheme_setter:function(t){this.data.scheme(t)},dataFeed_setter:function(t){return t=fi.$parse(t),this.data.attachEvent("onBeforeFilter",C(function(t,i){var e=this;if("function"==typeof t)return!0;if(this.J.dataFeed&&(t||i)){t=t||"id",i&&"object"==k(i)&&(i=i.id),this.clearAll();var s=this.J.dataFeed;if("string"==typeof s){var n="filter["+t+"]="+encodeURIComponent(i);this.load(s+(s.indexOf("?")<0?"?":"&")+n,this.J.datatype)}else{var h={};h[t]=i,"function"==typeof s?s.call(this,i,h):s.$proxy&&s.load&&s.load(this,{filter:h}).then(function(t){return e.Ht(t)},function(t){return e.Bt(t)})}return!1}},this)),t},Pt:function(){if(this.J.ready&&!this.po){var t=m(this.J.ready,this.$scope);t&&$(t,this,arguments),this.callEvent&&$(this.callEvent,this,["onReady",[]]),this.po=!0}},ro:function(t){this.Vt++,t||(this.uo=!1,this.ho={},this.waitData=mt.defer())},oo:function(t){this.Ri(t)}},li),xe={getState:function(){for(var t=this.config.columns.length,i=this.config.columns,e={ids:[],size:[],select:this.getSelectedId(!0),scroll:this.getScrollState()},s=0;s<t;s++){var n=i[s];e.ids.push(n.id),e.size.push(n.fillspace||n.adjust?-1:n.width)}if(e.order=[].concat(this.mo.length?this.mo:e.ids),this.bo&&(e.sort={id:this.bo,dir:this.go}),this.wo&&this.xo){var h={},r=0;for(var o in this.wo)if(!this.yo[o]){var a=this.wo[o];a[1].value=h[o]=a[2].getValue(a[0]),r=1}r&&(e.filter=h)}for(var u in e.hidden=[],this.yo)e.hidden.push(u);return e},setState:function(t){var i=this.config.columns;if(t){if(this.bo=null,this.blockEvent(),t.order&&t.order.length&&(this.mo=[].concat(t.order),this.Mo=[this.J.leftSplit,t.order.length-this.J.rightSplit]),t.hidden){for(var e={},s=0;s<t.hidden.length;s++)e[t.hidden[s]]=!0,this.mo.length||this.hideColumn(t.hidden[s]);if(this.mo.length)for(var n=0;n<this.mo.length;n++){var h=this.mo[n];!!e[h]==!this.yo[h]&&this.hideColumn(h,{},!1,!!e[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.So(f,t.size[f],!0))}this.unblockEvent();var d=!(this.J.leftSplit||this.J.rightSplit);if(this.ko(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.wo[p]){var b=this.wo[p];b[2].setValue(b[0],m);var g=b[1].contentId;g&&(this.$o[g].value=m)}}for(var w in this.wo)if(!t.filter[w]){var x=this.wo[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.Do(y[M],!0)}t.scroll&&this.scrollTo(t.scroll.x,t.scroll.y)}}},ye={Ao:function(t,i,e){i||ie.addDrop(t.Yi,t,!0),e||ie.addDrag(t.Yi,t),this.attachEvent("onDragOut",function(t,i){this.$dragMark(t,i)}),this.attachEvent("onBeforeAutoScroll",function(){var t=ie.getContext();return!(!ie.Js||!t||t.to!==this&&!this.Io)})},drag_setter:function(t){return t&&(H.extend(this,vi,!0),"order"!=t&&"move"!=t||H.extend(this,d("DragOrder"),!0),"inner"!=t&&"order"!=t||(this.To=!0),this.Ao(this,"source"==t,"target"==t),delete this.drag_setter),t},$dragIn:function(t,i,e){var s=this.locate(e)||null,n=ie.Xs;if((this.To||n.from.To)&&n.from!==this)return!1;var h=ie.getMaster(i),r=this.getItemNode(s,e)||this.mt;return r==ie.un?r:(n.target=s,n.to=h,this.qt&&(this.qt=window.clearTimeout(this.qt)),this.qt=$(function(t,i){this.Fo(i),this.Yt(t,i)},this,[Z(e),s],250),this.$dropAllow(n,e)&&this.callEvent("onBeforeDragIn",[n,e])?(this.$dragMark(n,e),r):(n.to=n.target=null,this.qt&&(this.qt=window.clearTimeout(this.qt)),null))},$dropAllow:function(){return!0},Fo:function(){},zo:function(t){return t&&"object"===k(t)?t.toString():t},$dragOut:function(t,i,e,s){var n=(this.st.contains(e)?this.locate(s):null)||null,h=ie.Xs;return(
h.target||"").toString()==(n||"").toString()||(this.qt&&(this.Io=null,this.qt=window.clearTimeout(this.qt)),h.target=h.to=null,this.callEvent("onDragOut",[h,s])),null},$drop:function(t,i,e){this.qt&&(this.qt=window.clearTimeout(this.qt));var s=ie.Xs;(s.to=this).Vo(t,i,s),this.$dragMark({},e),s.from&&s.from!=s.to&&s.from.callEvent&&s.from.callEvent("onBeforeDropOut",[s,e]),this.callEvent("onBeforeDrop",[s,e])&&(this.Ho(s,e),this.callEvent("onAfterDrop",[s,e]))},Vo:function(t,i,e){var s=this.zo(e.target);this.getBranchIndex?e.index=s?(e.parent=this.getParentId(s),this.getBranchIndex(s)):-1:e.index=s?this.getIndexById(s):this.count()},Ho: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)}},Gs:function(t,i){if(this.getItemNode){var e=this.locate(i,!0),s=e?this.getItemNode(e):null;return s?J(s):s}},$drag:function(t,i){var e=this.locate(i,!0);if(e){var s=[e];if(this.getSelectedId){var n=this.getSelectedId(!0,!0);if(n&&1<n.length&&-1!=A.find.call(n,e)){var h={};s=[];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]&&s.push(a)}}}var u=ie.Xs={source:s,start:e};if(u.fragile=this.addRowCss&&S.touch&&(S.isWebKit||S.isFF),(u.from=this).callEvent("onBeforeDrag",[u,i]))return Zi&&(Zi.qe=null),u.html||this.$dragHTML(this.getItem(e),i,u)}return null},$dragHTML:function(t,i,e){var s=this.Ot(t);return b(e.source)&&1<e.source.length&&(s=this.Bo(s,e.source.length)),s},Bo:function(t,i){var e="<div class='webix_drag_multiple'></div>";return 2<i&&(e="<div class='webix_drag_multiple_last'></div>"+e),e+(t="<div class='webix_drag_main'>"+t+"</div>")+"<span class='webix_badge'>"+i+"</span>"},$dragMark:function(t){var i=null;return t.target&&(i=this.zo(t.target)),this.Ro&&this.Ro!=i&&(t.fragile||this.removeCss(this.Ro,"webix_drag_over"),this.Ro=null),!this.Ro&&i?(this.Ro=i,t.fragile||this.addCss(i,"webix_drag_over"),i):!!t.to},$dropHTML:function(){return""},Po:function(t,i){var e=this.getItemNode(t);e?e.parentNode.insertBefore(ie.vn[0],e):i.children[0].appendChild(ie.vn[0])}},Me={$drag:function(t,i){var e=ye.$drag.apply(this,arguments);if(!e)return e;var s=ie.Xs;return this.jo&&this.jo(s),this.To&&this.getBranchIndex&&(this.Eo=this.No?20*(this.getItem(s.start).$level+1)+8:0),b(s.source)&&!s.fragile&&(ie.cn(i),this.Lo(s.source)),e},Lo:function(t){for(var i=0;i<t.length;i++)this.addCss(t[i],"webix_invisible")},Oo:function(t){for(var i=0;i<t.length;i++)this.removeCss(t[i],"webix_invisible")},$dragIn:function(t,i,e){var s=ye.$dragIn.apply(this,arguments);if(!s)return s;ie.vn||(ie.vn=this.Uo());var n=ie.Xs,h="$webix-last";if(n.target&&(h=this.zo(n.target)),"$webix-last"!=h&&"$webix-drop"!=h){var r={direction:this.J.layout||this.Yo||"y",x:"width",y:"height"},o=J(s);2*(Z(e)[r.direction]-o[r.direction])>o[r[r.direction]]&&(h=this.getNextId(h)||"$webix-last")}return h==this.Wo||"$webix-drop"==h||(this.Wo=h,this.Po(h,i)),s},$dragPos:function(t){if(!this.To){var i=ie.Xs;return t.y+=i.y_offset,void(t.x+=i.x_offset)}var e=J(this.$view);if("x"==this.J.layout)if(e.x-=12,t.y=e.y-8,t.x=t.x-18,t.x<e.x)t.x=e.x;else{var s=e.x+e.width;t.x>s&&(t.x=s)}else if(e.y+=(this.Go||0)-12,t.x=(this.Eo||e.x)+8,t.y=t.y-18,t.y<e.y)t.y=e.y;else{var n=e.y+e.height-(this.Go||0);t.y>n&&(t.y=n)}},$dragOut:function(t,i,e){return i!=e&&(G(ie.vn),this.Wo=ie.vn=null),ye.$dragOut.apply(this,arguments)},Vo:function(t,i,e){var s="$webix-last"==this.Wo?null:this.Wo;this.getBranchIndex?s?(e.parent=this.getParentId(s),e.index=this.getBranchIndex(s),t==i&&this.getParentId(e.start)==e.parent&&this.getBranchIndex(e.start)<e.index&&(e.index-=1)):e.index=-1:(e.index=s?this.getIndexById(s):this.count(),e.index-=t==i&&this.getIndexById(e.start)<e.index?1:0)},$dragDestroy:function(){var t=ie.Xs;b(t.source)&&!t.fragile&&this.Oo(t.source),G(ie.Ui)},Uo:function(){var t=document.createElement("div");return t.className="webix_drop_area",t.style.width=this.type.width+"px",t.style.height=this.type.height+"px",t.innerHTML=this.$dropHTML(),t.setAttribute(this.Xo,"$webix-drop"),[t]},
$dragMark:function(){return!1}};u("DragOrder",Me);var Se={$init:function(){this.qo=H.extend([],A,!0),this.Jo=-1},undo_setter:function(t){return t&&(this.Ko(),this.Ko=function(){}),t},Ko:function(){var n=this;this.attachEvent("onBeforeDrop",function(t){if(t.from==t.to){var i=n.Zo=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.Zo&&n.Zo.id==t){var i=n.Zo;n.Zo=null,n.Qo(t,i,"move")}}),this.data.attachEvent("onBeforeDelete",function(t){if(this.getItem(t)){var i=n.ta=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,e){n.Qo(t+"",e,"update")}),this.data.attachEvent("onStoreUpdated",function(t,i,e){var s=null;t&&("add"==e?s=B(i):"delete"==e&&(s=n.ta),s&&n.Qo(t,s,e))}),this.data.attachEvent("onIdChange",function(t,i){"object"==k(t)&&(t=t.row);for(var e=0;e<n.qo.length;e++)n.qo[e].id==t&&(n.qo[e].id=i)})},Qo:function(t,i,e){!this.ia&&this.J.undo&&(this.qo.push({id:t,action:e,data:i}),20==this.qo.length&&this.qo.splice(0,1),this.ea||(this.Jo=this.qo.length-1))},ignoreUndo:function(t,i){this.ia=!0,t.call(i||this),this.ia=!1},removeUndo:function(t){for(var i=this.qo.length-1;0<=i;i--)this.qo[i].id==t&&("id"==this.qo[i].action&&(t=this.qo[i].data),this.qo.removeAt(i));this.Jo=this.qo.length-1},undo:function(e){if(e)this.ignoreUndo(function(){var t,i;for(i=this.qo.length-1;!t&&0<=i;i--)this.qo[i].id==e&&(t=this.qo[i]);t&&(this.sa(t),this.qo.removeAt(i+1),this.Jo=this.qo.length-1)});else{var t=this.qo[this.Jo];t&&(this.ignoreUndo(function(){this.sa(t),this.qo.removeAt(this.Jo)}),this.Jo--)}},sa:function(t){if("delete"==t.action){var i=null,e=t.data.$parent;t.data.$branch&&(i={parent:t.id,data:B(t.data.$branch)},delete t.data.$branch,e&&!this.data.branch[e]&&(e=0)),this.add(t.data,t.data.$index,e),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 ke(t){return"string"==typeof t?t:t.linkInput?t.J.id:("object"==k(t)?(b(t)&&(t={data:t}),t.view=t.view||"suggest"):!0===t&&(t={view:"suggest"}),zt(t).config.id)}function Ce(t){return((t.header&&t.header[0]?t.header[0].text:t.editValue||t.label)||"").toString().replace(/<[^>]*>/g,"")}var $e={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 e=t.config.suggest;if(e){var s=Pt(t.config.suggest=ke(e));s&&i&&s.linkInput(i)}}(this,i)},getInputNode:function(){return this.node.firstChild},render:function(){return Y("div",{"class":"webix_dt_editor"},"<input type='text' aria-label='"+Ce(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(Vo){}},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='"+Ce(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 e=0;e<t.length;e++){var s=t[e],n=x(s.id),h=n?s:s.id,r=n?s:s.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='"+Ce(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()),Pt(this.config.$popup)},createPopup:function(){var t,i=this.config.popup||this.config.suggest;if(i)return(t="object"!=k(i)||i.name?Pt(i):(i.view=i.view||"suggest",zt(B(i)))).na||(t.linkInput?t.linkInput(document.body):this.linkInput&&this.linkInput(document.body),t.na=!0),t;var e=$e.$popup[this.popupType];return"string"==typeof e||e.name||(e=$e.$popup[this.popupType]=zt(e),this.popupInit(e),e.linkInput||this.linkInput(document.body)),e.J.id},linkInput:function(t){Nt(D(t),"keydown",C(function(t){if(this.config.$popup){var i,e=t.which||t.keyCode,s=this.getInputNode();if(s.isVisible())if(s.moveSelection&&e<41&&32<e)33==e&&(i="pgup"),34==e&&(i="pgdown"),35==e&&(i="bottom"),36==e&&(i="top"),37==e&&(i="left"),38==e&&(i="up"),39==e&&(i="right"),40==e&&(i="down"),s.moveSelection(i);else 13!==e||"TEXTAREA"===t.target.nodeName&&t.shiftKey||I("onEditEnd",[])}},this))},popupInit:function(){},popupType:"text",render:function(){return{}},$inline:!0}};$e.color=H.extend({focus:function(){},popupType:"color",popupInit:function(t){t.getChildViews()[0].attachEvent("onItemClick",function(t){I("onEditEnd",[t])})}},$e.popup),$e.date=H.extend({focus:function(){},popupType:"date",setValue:function(t){this.ha=this.config.stringResult||t&&"string"==typeof t,$e.popup.setValue.call(this,t)},getValue:function(){return this.getInputNode().getValue(this.ha?ct.parseFormatStr:"")||""},popupInit:function(t){t.getChildViews()[0].attachEvent("onDateSelect",function(t){I("onEditEnd",[t])})}},$e.popup),$e.combo=H.extend({ra:function(t){return this.config.popup?this.config.popup.config.id:t?ke(t):this.oa(t)},oa:function(){var t=$e.combo;return t.aa=t.aa||this.ra(!0)},render:function(){var t=Y("div",{"class":"webix_dt_editor"},"<input type='text' role='combobox' aria-label='"+Ce(this.config)+"'>"),i=this.config.suggest=this.ra(this.config.suggest);return i&&(Pt(i).linkInput(t.firstChild,!0),Nt(t.firstChild,"click",C(this.showPopup,this))),t},getPopup:function(){return Pt(this.config.suggest)},showPopup:function(){var t=this.getPopup(),i=t.getList(),e=this.getInputNode(),s=this.ua;t.show(e),e.setAttribute("aria-expanded","true"),s?(i.exists(s),i.exists(s)&&(i.select(s),i.showItem(s))):(i.unselect(),i.showItem(i.getFirstId())),t.ca=e},afterRender:function(){this.showPopup()},setValue:function(t){if(this.ua=t,this.config.suggest){var i=Pt(this.config.suggest),e=this.config.collection||this.config.options;e&&i.getList().data.importData(e),this.getInputNode(this.node).value=i.getItemText(t)}},getValue:function(){var t=this.getInputNode().value;if(this.config.suggest){var i=Pt(this.config.suggest),e=i.getList();(t||e.getSelectedId&&e.getSelectedId())&&(t=i.getSuggestion(t))}return t}},$e.text),$e.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"},$e.popup),$e.password=H.extend({render:function(){return Y("div",{"class":"webix_dt_editor"},
"<input type='password' aria-label='"+Ce(this.config)+"'>")}},$e.text),$e.$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 De={defaults:{editaction:"click"},$init:function(t){this.fa={},this.Ti=0,this.S=0,this.Yi.style.position="relative",t&&(t.onDblClick=t.onDblClick||{}),this.attachEvent("onAfterRender",this.la),this.J.editable&&this.da(),H.extend(this,Se)},va: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(Vo){}},la:function(){var t=this.getEditor();if(t&&t.$inline&&!t.getPopup){var i=this._a(t);if(i&&i!=t.node){var e=t.node.value;(t.node=i).value=e,i.focus(),this.va(i)}else this.editStop()}},editable_setter:function(t){return t&&this.da(),t},da:function(){T("onEditEnd",C(function(){this.Ti&&this.editStop()},this)),T("onClick",C(function(t){this.Ti&&200<new Date-this.S&&(this.Ei&&!this.Ei.popupType&&t&&this.Ei.node&&this.Ei.node.contains(t.target||t.srcElement)||this.editStop())},this)),this.data.attachEvent&&this.data.attachEvent("onIdChange",C(function(t,i){this.pa(t,i)},this)),this.attachEvent("onItemClick",function(t){this.J.editable&&"click"==this.J.editaction&&this.edit(t)}),this.attachEvent("onItemDblClick",function(t){this.J.editable&&"dblclick"==this.J.editaction&&this.edit(t)}),this.ma=C(function(){this.S=new Date},this),this.da=function(){},this.ba&&this.ba()},ga: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.wa(t,i.value,!1),this.callEvent("onLiveEdit",[i,t])}},this)},xa:function(t){var i=this.J.form;"string"!=typeof i&&(this.J.form=i=zt(i).config.id);var e=(i=Pt(i)).setValues?i:i.getChildViews()[0];e.setValues(this.getItem(t.row||t)),i.config.master=this.config.id,i.show(this.getItemNode(t));var s=e.getChildViews()[0];s.focus&&s.focus()},edit:function(t,i,e){if(this.J.editable&&this.callEvent("onBeforeEditStart",[t])){if(this.J.form)return this.xa(t);var s=this.ya(t);if(s){if(this.getEditor(t))return;i||this.editStop(),$e[s];var n=H.extend({},$e[s]),h=this.Ma(t,n,e);n.config.liveEdit&&(this.Sa=this.attachEvent("onKeyPress",this.ga));var r=n.getPopup?n.getPopup(h).st:h;return r&&Nt(r,"click",this.ma),h&&Nt(h,"change",this.ka,{bind:{view:this,id:t}}),!1!==e&&n.focus(),this.$fixEditor&&this.$fixEditor(n),this.S=M.edit_open_time=new Date,Ai.setFocus(this,!0),this.callEvent("onAfterEditStart",[t]),n}return null}},getEditor:function(t){return t?this.fa[t]:this.Ei},pa:function(t,i){var e=this.fa[t];e&&((this.fa[i]=e).id=i,delete this.fa[t])},ka:function(){this.view.hasEvent("onEditorChange")&&this.view.callEvent("onEditorChange",[this.id,this.view.getEditorValue(this.id)])},Ca:function(){return this.J},Ma:function(t,i,e){i.config=this.Ca(t);var s=i.render();i.$inline&&(s=this._a(t)),i.node=s;var n=this.getItem(t),h=n[this.J.editValue||"value"];return x(h)&&(h=""),i.setValue(h,n),i.value=h,this.$a(t,i),!1!==e&&this.showItem(t),i.$inline||this.Da(t,s,!0),i.afterRender&&i.afterRender(),s},Aa:function(t){return this.getItemNode(t)},_a:function(t){var i=this.Aa(t);return i&&(i=i.getElementsByTagName("input")[0]||i),i},ya:function(){return this.J.editor},$a:function(t,i){i.id=t,this.fa[t]=this.Ei=i,this.Ti++},Ia:function(t){this.Ei==t&&(this.Ei=0),t.destroy&&t.destroy(),delete t.popup,delete t.node,delete this.fa[t.id],this.Ti--},focusEditor:function(){var t=this.getEditor.apply(this,arguments);t&&t.focus&&t.focus()},editCancel:function(){this.editStop(null,null,!0)},bi:function(t){if(t){var i=this.getEditor();if(i&&i.getPopup&&i.getPopup()==t.getTopParentView())return}this.editStop()},editStop:function(t){if(!this.Ta){this.Ta=1;var i=arguments[2],e=1;return t?e=this.Fa(
this.fa[t],i):this.za(function(t){e*=this.Fa(t,i)}),this.Ta=0,e}},Gt:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Yi}},Da:function(t,i,e){if(i.style){var s=this.Gt(t);return i.style.top=s.top+"px",i.style.left=s.left+"px",i.style.width=s.width-1+"px",i.style.height=s.height-1+"px",i.top=s.top,e&&s.parent.appendChild(i),s}},za:function(t){for(var i in this.fa)t.call(this,this.fa[i])},Fa:function(t,i){if(t&&!M.k){var e={value:this.Va(t),old:t.value};if(this.callEvent("onBeforeEditStop",[e,t,i])){if(!i){var s=e.old;if("string"==typeof e.value&&(s+=""),s!=e.value||t.config.liveEdit){var n=this.wa(t,e.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&&Pt(h).hide(),this.Ia(t),this.Sa&&this.detachEvent(this.Sa),this.callEvent("onAfterEditStop",[e,t,i]),1}return 0}},validateEditor:function(t){var i=!0;if(this.J.rules){var e=this.getEditor(t),s=e.column||this.J.editValue||"value",n=this.J.rules[s],h=this.J.rules.$all;if(n||h){var r=this.data.getItem(e.row||e.id),o=e.getValue(),a=e.getInputNode();n&&(i=n.call(this,o,r,s)),h&&(i=h.call(this,o,r,s)&&i),i?st(a,"webix_invalid"):et(a,"webix_invalid"),I("onLiveValidation",[e,i,r,o])}}return i},getEditorValue:function(t){var i;if(i=0===arguments.length?this.Ei:this.getEditor(t))return i.getValue()},getEditState:function(){return this.Ei||!1},editNext:function(t,i){if(t=!1!==t,1==this.Ti||i){var e=this.Ha(this.Ei||i,function(t){return!!this.ya(t)},t);if(this.editStop())return e&&(this.edit(e),this.Ba(e)),!1}},Ba:function(){},Ha:function(t,i,e){var s=this.getIndexById(t.id),n=this.data.order;if(e){for(var h=s+1;h<n.length;h++)if(i.call(this,n[h]))return n[h]}else for(var r=s-1;0<=r;r--)if(i.call(this,n[r]))return n[r];return null},Va:function(t){return t.getValue()},wa:function(t,i,e){var s=e?{}:this.getItem(t.id);return s[this.J.editValue||"value"]=i,s}},Ae={$init:function(){this.$view.className+=" webix_flexlayout"},Ra:function(){},Pa:function(){},ja:function(){},$getSize:function(){var t=0,i=0,e=this.J.gravity;this.Ea=[];for(var s=0;s<this.Vi.length;s++){var n=this.Vi[s].$getSize(0,0);this.Ea.push(n),t=Math.max(t,n[0]),i=Math.max(i,n[2])}return t+=this.Na.left+this.Na.right,i+=this.Na.top+this.Na.bottom,this.J.width&&(t=Math.max(t,this.J.width)),this.J.height&&(i=Math.max(i,this.J.height)),[t,1e5,i,1e5,e]},render:function(){this.resize()},La:function(){if(this.isVisible(this.J.id)){var t=this.$view.style,i=Math.round(this.Oa/2);t.paddingTop=this.Na.top-i+"px",t.paddingBottom=this.Na.bottom-i+"px",t.paddingLeft=this.Na.left-i+"px",t.paddingRight=this.Na.right-i+"px";for(var e=0;e<this.Vi.length;e++)if(!this.Vi[e].J.hidden){var s=this.Vi[e].$view,n=this.Ea[e],h=this.Vi[e].J;s&&(s.style.minWidth=n[0]+"px",n[1]<1e5&&n[1]!=n[0]&&(s.style.maxWidth=n[1]+"px"),s.style.flexBasis=h.flexBasis||n[0]+"px",s.style.flexGrow=h.flexGrow||(n[1]!=n[0]?n[4]:0),s.style.height=n[3]!=n[2]?"auto":n[2]+"px",s.style.minHeight=n[2]+"px",n[3]<1e5&&n[3]!=n[2]&&(s.style.maxHeight=n[3]+"px"),s.style.margin=i+"px")}for(var r=[],o=0;o<this.Vi.length;o++)if(!this.Vi[o].J.hidden){var a=this.Vi[o].$view;r[o]=[a.offsetWidth,a.offsetHeight]}for(var u=0;u<this.Vi.length;u++)if(!this.Vi[u].J.hidden){var c=this.Vi[u];if(c.$view){c.J.flex=!0;var f=this.Ea[u],l=f[2]==f[3]?f[2]:r[u][1];c.$setSize(r[u][0],l),c.J.flex=!1}}this.$height=this.we=this.$view.scrollHeight,this.$view.style.height=this.we+"px"}}},Ie={sum:function(t,i){i=i||this;for(var e=0,s=0;s<i.length;s++){var n=parseFloat(t(i[s]),10);isNaN(n)||(e+=n)}return e},min:function(t,i){i=i||this;for(var e=Infinity,s=0;s<i.length;s++){var n=parseFloat(t(i[s]),10);isNaN(n)||n<e&&(e=n)}return e===Infinity?0:1*e},max:function(t,i){i=i||this;for(var e=-Infinity,s=0;s<i.length;s++){var n=parseFloat(t(i[s]),10);isNaN(n)||e<n&&(e=n)}return e===-Infinity?0:1*e},count:function(t,i){for(var e=0,s=0;s<i.length;s++){var n=t(i[s]);null!=n&&e++}return e},any:function(t,i){return t(i[0])},string:function(t){return t.$name}},Te={
$init:function(){this.attachEvent("onClearAll",this.Ua)},Ua:function(){this.Tr=this.Ya=null,this.Wa=0},ungroup:function(t){if(this.getBranchIndex)return this.Ga.apply(this,arguments);this.Tr&&(this.order=this.Tr,this.pull=this.Ya,this.Ya=this.Tr=null,t||this.callEvent("onStoreUpdated",[]))},Ir:function(t){this.blockEvent(),this.group(t),this.unblockEvent()},Xa:function(i){if("function"==typeof i)return i;var t=function(t){return t[i]};return t.$name=i,t},group:function(e){if(this.getBranchIndex)return this.qa.apply(this,arguments);"string"==typeof e&&(e={by:e,map:{}});var t="function"==typeof e.by?"value":e.by,s=this.Xa(e.by);e.map[t]||(e.map[t]=[t,this.Ja]);var n={},h=[];for(var i in this.each(function(t){var i=s(t);n[i]||(h.push({id:i,$group:!0,$row:e.row}),n[i]=p()),n[i].push(t)}),e.map){var r=e.map[i][1]||"any",o=this.Xa(e.map[i][0]);"function"!=typeof r&&(Ie[r],r=Ie[r]);for(var a=0;a<h.length;a++)h[a][i]=r.call(this,o,n[h[a].id])}this.Tr=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.Hr&&this.Hr(h[u])}this.callEvent("onStoreUpdated",[])},qa:function(t,i){var e,s;this.Wa=(this.Wa||0)+1,"string"==typeof t?(e={by:this.Xa(t),map:{}}).map[t]=[t]:e="function"==typeof t?{by:t,map:{}}:t,s=i?this.getItem(i).$level:i=0;for(var n=this.branch[i],h=this.Xa(e.by),r=[],o=[],a=0;a<n.length;a++){var u=this.getItem(n[a]),c=h(u),f=s+"$"+c,l=this.branch[f];if(!l){var d=this.pull[f]={id:f,value:c,$group:!0,$row:e.row};this.Hr&&this.Hr(d),o.push(d),(l=this.branch[f]=[]).Ka=[],r.push(f)}l.push(u.id),l.Ka.push(u)}for(var v in this.branch[i]=r,e.map){var _=e.map[v][1]||"any",p=this.Xa(e.map[v][0]);"function"!=typeof _&&(Ie[_],_=Ie[_]);for(var m=0;m<o.length;m++)o[m][v]=_.call(this,p,this.branch[o[m].id].Ka)}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].Ka]),e.footer){var w="footer$"+g.id,x=this.pull[w]={id:w,$footer:!0,value:g.value,$level:s,$count:0,$parent:g.id,$row:e.footer.row};for(var y in e.footer){var M=e.footer[y][1]||"any",S=this.Xa(e.footer[y][0]);"function"!=typeof M&&(Ie[M],M=Ie[M]),x[y]=M.call(this,S,this.branch[o[b].id].Ka)}this.branch[g.id].push(x.id),this.callEvent("onGroupFooter",[x.id,x.value,this.branch[g.id].Ka])}delete this.branch[g.id].Ka}this.Za(r,i,s+1),this.callEvent("onStoreUpdated",[])},Ga:function(t,i,e){if(e||this.Wa){this.Wa=Math.max(0,this.Wa-1),i=i||0;for(var s=[],n=this.branch[i],h=0;h<n.length;h++){var r=n[h],o=this.branch[r];o&&(s=s.concat(o)),delete this.pull[r],delete this.branch[r]}for(var a=(this.branch[i]=s).length-1;0<=a;a--)this.pull[s[a]].$footer&&s.splice(a,1);this.Za(s,0,1),t||this.callEvent("onStoreUpdated",[])}},Za:function(t,i,e){i&&(this.getItem(i).$count=t.length);for(var s=0;s<t.length;s++){var n=this.pull[t[s]];n.$level=e,n.$parent=i;var h=this.branch[n.id];h&&this.Za(h,n.id,e+1)}}},Fe={$init:function(){H.extend(this.data,Te),this.data.attachEvent("onClearAll",C(function(){this.data.Tr=this.data.Ya=null,this.Wa=0},this))},group:function(t){this.data.ungroup(!0),this.data.group(t)},ungroup:function(t){this.data.ungroup(t)}},ze={$init:function(){var t=this;(Xi.customRadio||this.addOption)&&this.$ready.push(function(){Nt(t.$view,"keydown",t.Qa,{bind:t})})},gi:function(){if(!Ai.canFocus(this))return!1;var t=this.tu();if(t)for(var i=0;i<t.length;i++)"0"==t[i].getAttribute("tabindex")&&t[i].focus()},iu:function(){var t=this.tu();if(t)for(var i=0;i<t.length;i++)"0"==t[i].getAttribute("tabindex")&&t[i].blur()},Qa:function(t){var i=t.which||t.keyCode;if((this.addOption?34:36)<i&&i<41){var e;Q(t);var s=this.tu();if(35==i)e=s.length-1;else if(36===i)e=0;else for(var n=37===i||38===i?-1:1,h=0;h<s.length;h++)if("0"==s[h].getAttribute("tabindex")){(e=h+n)<0?e=s.length-1:e>=s.length&&(e=0);break}if(!x(e)){var r=s[e].getAttribute("button_id");this.setValue(r),s[e].focus()}}},Te:function(t,i){for(var e=i.target||i.srcElement;e&&!e.webix_tooltip;){var s=e.getAttribute("webix_t_id");if(s)return this.getOption(s)
;e=e.parentNode}return null},getOption:function(t){for(var i=this.eu(this.J.options),e=0;e<i.length;e++)if(i[e].id==t)return i[e];return null}},Ve=H.proto({$init:function(t){this.Xo="map_"+z(),this.su=t,this.nu=[],this.hu=[]},addRect:function(t,i,e){this.ru(t,"RECT",i,e)},addPoly:function(t,i,e){this.ru(t,"POLY",i,e)},ru:function(t,i,e,s){var n="";4==arguments.length&&(n="userdata='"+s+"'"),this.nu.push("<area "+this.su+"='"+t+"' shape='"+i+"' coords='"+e.join()+"' "+n+"></area>"),this.hu.push({index:s,points:e})},addSector:function(t,i,e,s,n,h,r,o){var a=[];a.push(s),a.push(Math.floor(n*r));for(var u=i;u<e;u+=Math.PI/18)a.push(Math.floor(s+h*Math.cos(u))),a.push(Math.floor((n+h*Math.sin(u))*r));return a.push(Math.floor(s+h*Math.cos(e))),a.push(Math.floor((n+h*Math.sin(e))*r)),a.push(s),a.push(Math.floor(n*r)),this.addPoly(t,a,o)},hide:function(t,i,e){if(t.querySelectorAll)for(var s=t.querySelectorAll('area[userdata="'+i+'"]'),n=0;n<s.length;n++){var h=s[n];e?h.getAttribute("coords")&&(h.coordsdis=h.getAttribute("coords"),h.setAttribute("coords",""),h.coords=""):e||h.coordsdis&&(h.setAttribute("coords",h.coordsdis),h.coords=h.coordsdis,h.coordsdis=""),s[n].style.display=e?"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 e=S.isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";i.innerHTML="<map id='"+this.Xo+"' name='"+this.Xo+"'>"+this.nu.join("\n")+"</map><img "+e+" class='webix_map_img' usemap='#"+this.Xo+"'>",t.Li=i,this.nu=[]}}),He={$init:function(){this._e={},this.pe={},this.getTopParentView=this.ou=C(function(){return this},this),this.au(),this.$ready.push(this.uu)},$$:function(t){return this._e[t]},innerId:function(t){return this.pe[t]},au:function(){this.ve=M.n,M.n=this},uu:function(){for(var t in this._e){var i=this._e[t];this.callEvent&&i.mapEvent&&!i.B.onitemclick&&i.mapEvent({onitemclick:this}),i.getTopParentView=this.ou}M.n=this.ve,this.ve=0},Ni:function(t){delete this._e[t]},ui:function(){this.au();var t=zt.apply(this,arguments);return this.uu(),t}},Be={$init:function(){this.getSelectedId&&this.attachEvent("onAfterRender",this.cu),this.moveSelection&&this.attachEvent("onTabFocus",this.fu)},fu:function(){if(this.getSelectedId){var t=this.getSelectedId(!0);t.length&&this.getItemNode(t[0])||this.moveSelection("down")}},cu:function(){var t=this.getSelectedId(!0);if(!t.length||!this.getItemNode(t[0])){var i=this.mt.querySelector("["+this.Xo+"]");i&&i.setAttribute("tabindex","0")}},lu:function(n){return function(t,i){var e=i.srcElement||i.target;if(!e.getAttribute("webixignore")){var s=e.tagName;if("INPUT"==s||"TEXTAREA"==s||"SELECT"==s)return!0}return!(t&&t.moveSelection&&t.config.navigation&&!t.Ti)||(Q(i),t.moveSelection(n,{shift:i.shiftKey,ctrl:i.ctrlKey}))}},moveSelection:function(t,i,e){var s=this.J;if(!s.disabled){var n=this.getSelectedId(!0),h=this.count&&("x"==s.layout||1<s.xCount);if(("right"==t||"left"==t)&&this.du){var r=Pt(this.du);return r.vu(!0),void("x"===r.config.layout?r.moveSelection(t):Ai.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._u&&(n=this._u(n,o,t)),this.showItem(n),this.select(n),this.getSubMenu&&this.getSubMenu(n)&&this.pu(n,this.getItemNode(n)),!this.config.clipboard&&!1!==e){var l=this.getItemNode(n);l&&l.focus()}}return!1}},navigation_setter:function(t){return t&&!Ai.mu&&(Ai.mu=!0,Ai.addHotKey("up",this.lu("up")),Ai.addHotKey("down",this.lu("down")),Ai.addHotKey(
"right",this.lu("right")),Ai.addHotKey("left",this.lu("left")),Ai.addHotKey("shift+up",this.lu("up")),Ai.addHotKey("shift+down",this.lu("down")),Ai.addHotKey("shift+right",this.lu("right")),Ai.addHotKey("shift+left",this.lu("left")),Ai.addHotKey("ctrl+shift+up",this.lu("up")),Ai.addHotKey("ctrl+shift+down",this.lu("down")),Ai.addHotKey("ctrl+shift+right",this.lu("right")),Ai.addHotKey("ctrl+shift+left",this.lu("left")),Ai.addHotKey("pageup",this.lu("pgup")),Ai.addHotKey("pagedown",this.lu("pgdown")),Ai.addHotKey("home",this.lu("top")),Ai.addHotKey("end",this.lu("bottom"))),t}},Re={$init:function(){this.$ready.push(this.bu),this.attachEvent("onStructureUpdate",this.bu),this.attachEvent("onStructureLoad",function(){this.gu.length||this.bu()})},bu:function(){var e=this.gu=[],t=this.J;t.columns&&this.wu(t.columns),this.J.map&&this.xu(t.map),e.length&&(this.data.Hr=function(t){for(var i=0;i<e.length;i++)e[i](t)})},xu:function(t){for(var i in t)this.gu.push(this.yu(i,t[i]))},yu:function(e,t,i){var s,n=t.replace(/^(\s|)\((date|number)\)/,"");return s=""===n?function(t){return t[e]}:(-1===n.indexOf("#")&&-1===n.indexOf("{")&&(n="#"+n+"#"),It(n)),0===t.indexOf("(date)")?(i&&!i.format&&(i.format=ct.dateFormatStr),function(t){var i=(s(t)||"").toString();t[e]=ct.parseFormatDate(i)}):0===t.indexOf("(number)")?function(t){t[e]=1*s(t)}:function(t){t[e]=s(t)||""}},wu:function(t){for(var i=0;i<t.length;i++){var e=t[i].map,s=t[i].id;s||(s=t[i].id="i"+z(),t[i].header||(t[i].header="")),e&&this.gu.push(this.yu(s,e,t[i])),this.Mu(t[i])}},Mu:function(t){var i=t.options||t.collection;if(i)if("string"==typeof i){var e=Pt(i);e||(e=new(d("DataCollection"))({url:i}),this.ht.push(e)),e.getBody&&(e=e.getBody()),this.Su(e,t)}else if(i.loadNext)this.Su(i,t);else if(i[0]&&"object"==k(i[0]))i=new(d("DataCollection"))({data:i}),this.Su(i,t),this.ht.push(i);else{if(b(i)){for(var s={},n=0;n<i.length;n++)s[i[n]]=i[n];t.options=i=s}t.template=t.template||this.ku(i,t.id,t.optionslist)}},Su:function(t,i){if(i){delete i.options,i.collection=t,i.template=i.template||this.Cu(t,i.id,i.optionslist);var e=t.data.attachEvent("onStoreUpdated",C(function(){this.refresh(),this.refreshFilter&&this.refreshFilter(i.id)},this));this.attachEvent("onDestruct",function(){t.$destructed||t.data.detachEvent(e)})}},ku: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 e=i.split(r),s=0;s<e.length;s++)e[s]=n[e[s]]||"";return e.join(", ")}}return function(t){return n[t[h]]||t.value||""}},Cu: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 e=i.split(o),s=0;s<e.length;s++){var n=h.data.pull[e[s]];e[s]=n&&n.value||""}return e.join(", ")}}return function(t){var i=t[r]||t.value,e=h.data.pull[i];return e&&(e.value||0===e.value)?e.value:""}}},Pe={$init:function(t){t=t||{},this.$u=0,this.Du=300,this.Au=null,this.Iu(t.onClick,"on_click"),this.Iu(t.onContext,"on_context"),this.Iu(t.onDblClick,"on_dblclick"),this.Iu(t.onMouseMove,"on_mouse_move"),this.on_click&&(Nt(this.Yi,"click",this.Tu,{bind:this}),S.isIE8&&this.on_dblclick&&Nt(this.Yi,"dblclick",this.Fu,{bind:this})),this.on_context&&Nt(this.Yi,"contextmenu",this.zu,{bind:this}),this.on_mouse_move&&this.Vu()},Vu:function(){this.Hu||(this.on_mouse_move=this.on_mouse_move||{},Nt(this.Yi,"mousemove",this.Bu,{bind:this}),Nt(this.Yi,S.isIE?"mouseleave":"mouseout",this.Bu,{bind:this}),this.Hu=1,this.attachEvent("onDestruct",function(){this.Ru&&window.clearTimeout(this.Ru)}))},Iu:function(t,i){if(t){var e=this[i],s=e?H.extend({},e):{};this[i]=H.extend(s,t)}},Tu:function(t){if(!this.isEnabled())return!1;if(Ai.at(this),this.on_dblclick){var i=(new Date).valueOf();if(i-this.$u<=this.Du&&this.locate)if(""+this.locate(t)==""+this.Au)return this.$u=0,this.Fu(t);this.$u=i}return this.Pu(t,this.on_click,"ItemClick")},Fu:function(t){return this.Pu(t,this.on_dblclick,"ItemDblClick")},zu:function(t){this.Pu(t,this.on_context,"BeforeContextMenu","AfterContextMenu")},Bu:function(t){if(!this.$destructed){if(document.createEventObject
)t=document.createEventObject(event);else if(!x(t.movementY)&&!t.movementY&&!t.movementX)return;this.Ru&&window.clearTimeout(this.Ru),this.callEvent("onMouseMoving",[t]),this.Ru=window.setTimeout(C(function(){"mousemove"==t.type?this.ju(t):this.Eu(t)},this),this.J.mouseEventDelay||500)}},ju:function(t){this.Pu(t,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[t||event])},Eu:function(t){this.callEvent("onMouseOut",[t||event])},Pu:function(t,i,e,s){if(!(t=t||event).processed&&this.st){t.processed=!0;var n=t.target||t.srcElement;if(S.isIE8){var h=this.J.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.st&&n!=this.st.parentNode;){if(!u&&n.getAttribute&&(a=n.getAttribute(this.Xo))){if(this.Au=a,this.callEvent){if(!this.callEvent("on"+e,[a,t,n]))return;s&&this.callEvent("on"+s,[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||q(t,this.Xo),n))return u}}n=n.parentNode}return u}}},je={$init:function(){this.$ready.push(function(){this.attachEvent("onKeyPress",this.Se)})},Nu:function(t,i){if(37===t||39===t){Q(i),this.Lu(37===t?-1:1);var e=this.Ou.querySelector("[tabindex='0']");e&&e.focus()}},Uu:function(){G(this.Ou),this.Ou=Y("DIV",{"class":"webix_nav_panel webix_nav_panel_"+this.J.navigation.type,role:"tablist"},""),this.st.appendChild(this.Ou),this.Yu(),this.Wu(),this.Gu()},Gu:function(){var i=[];this.Ou&&(i[0]=Lt(this.Ou,"click",C(function(t){for(var i=t.srcElement||t.target,e=!1;i!=this.Ou&&!e;){var s=i.getAttribute(this.Xu);s&&(e=!0,this.qu(s)),i=i.parentNode}},this))),this.Ju&&(i[1]=Lt(this.Ju,"click",C(function(){this.Lu(-1)},this))),this.Ku&&(i[1]=Lt(this.Ku,"click",C(function(){this.Lu(1)},this))),this.attachEvent("onDestruct",function(){for(var t=0;t<i.length;t++)this.detachEvent(i[t]);i=null})},Lu:function(t){if(this.Vi){var i=this.Zu+t;(i>=this.Vi.length||i<0)&&(i=i<0?this.Vi.length-1:0),this.setActiveIndex(i)}},qu:function(t){this.Vi&&Pt(t).show()},Yu:function(){var t,i;if((i=this.J.navigation).items){this.Xu=i.linkAttr||"bind_id",this.Ou?this.Qu():this.Uu();var e=this.Vi?this.Vi:this.data.order;if(1<e.length)for(var s=0;s<e.length;s++){t=Y("DIV",{"class":"webix_nav_item webix_nav_"+(s==this.Zu?"active":"inactive"),role:"tab",tabindex:s==this.Zu?"0":"-1"});var n=this.Vi?this.Vi[s].J.id:e[s];n&&t.setAttribute(this.Xu,n),this.Ou.appendChild(t)}}},Qu:function(){if(this.Ou)for(var t=this.Ou.childNodes,i=t.length-1;0<=i;i--)G(t[i])},Wu:function(){var t=this.J.navigation;t.buttons&&(this.Ju&&G(this.Ju),this.Ju&&G(this.Ku),this.Ju=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.st.appendChild(this.Ju),this.Ku=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.st.appendChild(this.Ku))}},Ee={showOverlay:function(t){this.tc?this.tc.innerHTML=t:(this.tc=Y("DIV",{"class":"webix_overlay"},t||""),X(this.tc,this.st.firstChild,this.st),this.st.style.position="relative")},hideOverlay:function(){this.tc&&(G(this.tc),this.tc=null)}},Ne={pager_setter:function(s){if("string"==typeof s){var t=Pt(s);if(!t)return this.$blockRender=!0,$(function(){var t=Pt(s);this.J.pager=this.pager_setter(t);var i=t.J;i.count=this.data.ic(i.level),t.refresh(),this.$blockRender=!1,this.render()},this),null;s=t}return this.attachEvent("onBeforeRender",function n(t){if(s.config.autosize&&this.getVisibleCount){var i=this.getVisibleCount();isNaN(i)?(s.config.size=1,$(n,this,[!0])):i!=s.config.size&&(s.config.size=i,s.refresh(),!0===t&&this.refresh())}var e=this.J.pager;return-1!=e.page&&(this.data.$min=this.ec(0,e.page*e.size),this.data.$max=this.ec(this.data.$min,e.size),this.data.$pagesize=this.data.$max-this.data.$min,!0)}),s.$view||(s.view="pager",s=zt(s)),((this.sc=s).$master=this).data.attachEvent("onStoreUpdated",function(){var t=s.J
;t.count=this.ic(t.level),s.refresh()}),this.data.ic=this.ic,s.J},ic:function(i){if(i&&0!==i){var e=0;return this.each(function(t){t.$level==i&&e++}),e}return this.count()},ec:function(t,i){var e=this.J.pager;if(e.level&&0!==e.level){var s=t,n=this.data.order.length;if(i)for(;s<n;){if(this.data.order[s]&&this.data.getItem(this.data.order[s]).$level==e.level){if(0===i)break;i--}s++}return s}return t+i},setPage:function(t){this.sc&&this.sc.select(t)},getPage:function(){return this.sc.J.page},getPager:function(){return this.sc}},Le={$init:function(){x(this.nc)&&this.attachEvent&&(this.attachEvent("onBeforeLoad",this.showProgress),this.attachEvent("onAfterLoad",this.hideProgress),this.nc=null)},showProgress:function(h){if(!this.nc){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.nc=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.st.style.position="relative"),X(this.nc,this.st.firstChild,this.st),this.st.setAttribute("aria-busy","true"),!Zi.$active&&this.getScrollState){var i=this.getScrollState();this.st.scrollWidth!=this.$width&&(this.nc.style.left=i.x+"px"),this.st.scrollHeight!=this.$height&&("bottom"!=h.type?this.nc.style.top=i.y+"px":this.nc.style.top=i.y+this.$height-this.nc.offsetHeight+"px")}this.hc=1}h&&"icon"!=h.type?$(function(){if(this.nc){var t=h.position||1;if(this.nc.style[S.transitionDuration]===undefined&&h.delay){var i=0,e=0,s=t/h.delay*30,n=this;this.rc&&(window.clearInterval(this.rc),e=this.nc.firstChild.offsetWidth/this.nc.offsetWidth*100),this.rc=window.setInterval(function(){30*i==h.delay?window.clearInterval(n.rc):(n.nc&&n.nc.firstChild&&(n.nc.firstChild.style.width=e+i*s*t*100+"%"),i++)},30)}else this.nc.firstChild.style.width=100*t+"%",h.delay&&(this.nc.firstChild.style[S.transitionDuration]=h.delay+"ms");h.hide&&$(this.hideProgress,this,[1],h.delay)}this.hc=0},this):h&&"icon"==h.type&&h.hide&&$(this.hideProgress,this,[1],h.delay)},hideProgress:function(t){this.hc&&(t=!0),this.nc&&(t?(this.rc&&window.clearInterval(this.rc),G(this.nc),this.nc=null,this.st.removeAttribute("aria-busy")):this.showProgress({position:1.1,delay:300,hide:!0}))}},Oe={$init:function(){this.data,this.Ui=document.createElement("DIV"),this.data.attachEvent("onIdChange",C(this.Br,this)),this.attachEvent("onItemClick",this.oc),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.Yi.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=It(t)},Ot:function(t){var i=this.data.kr[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)},ac:function(t){return this.Ui.innerHTML=this.Ot(t),this.Ui.firstChild},Br:function(t,i){var e=this.getItemNode(t);e&&(e.setAttribute(this.Xo,i),this.Li[i]=this.Li[t],delete this.Li[t])},oc:function(){if(this.J.click){var t=m(this.J.click,this.$scope);t&&t.call&&t.apply(this,arguments)}},getItemNode:function(t){if(this.Li)return this.Li[t];this.Li={};for(var i=this.mt.childNodes,e=0;e<i.length;e++){var s=i[e].getAttribute(this.Xo);s&&(this.Li[s]=i[e])}return this.getItemNode(t)},locate:function(t){return q(t,this.Xo)},showItem:function(t){var i=this.getItemNode(t);if(i&&this.scrollTo){var e=i.offsetLeft,s=e+i.offsetWidth,n=i.offsetTop,h=n+i.offsetHeight,r=this.getScrollState(),o=r.x;(e<o||o+this.be<s)&&(o=e);var a=r.y;(n<a||a+this.we<h)&&(a=n),this.scrollTo(o,a),this.uc&&this.uc(t)}},render:function(t,i,e){if(this.isVisible(this.J.id
)&&!this.$blockRender)if(t){var s=this.getItemNode(t);switch(e){case"paint":case"update":if(!s)return;X(this.Li[t]=this.ac(i),s),G(s);break;case"delete":if(!s)return;G(s),delete this.Li[t];break;case"add":X(this.Li[t]=this.ac(i),this.getItemNode(this.data.getNextId(t)),this.mt);break;case"move":X(this.getItemNode(t),this.getItemNode(this.data.getNextId(t)),this.mt)}}else this.callEvent("onBeforeRender",[this.data])&&((this.cc||this.mt).innerHTML=this.data.getRange().map(this.Ot,this).join(""),this.Li=null,this.callEvent("onAfterRender",[]))}},Ue={$init:function(t){if(t&&!t.scroll&&this.fc)return this.mt=this.mt||this.Yi;(this.mt||this.Yi).appendChild(Y("DIV",{"class":"webix_scroll_cont"},"")),this.mt=(this.mt||this.Yi).firstChild,S.touch&&"native"!==S.touch||Nt(this.st,"scroll",C(function(){this.callEvent&&$(function(){this.callEvent("onAfterScroll",[])},this)},this))},scroll_setter:function(t){if(!t)return!1;var i="auto"===t,e="x"==t?"x":"xy"==t?"xy":i?"xy":"y";if(Zi.$active&&"native"!=S.touch)this.mt.setAttribute("touch_scroll",e),this.attachEvent&&this.attachEvent("onAfterRender",C(this.lc,this)),this.dc=!0;else if(S.$customScroll)fe.enable(this,e);else{var s=this.mt.parentNode.style;i?s.overflowX=s.overflowY="auto":(-1!=e.indexOf("x")&&(this.xe=!0,s.overflowX="scroll"),-1!=e.indexOf("y")&&(this.ge=!0,s.overflowY="scroll"))}return e},vc:function(t,i){if(!!this.J.scroll!=!!t){if(!S.$customScroll)this.mt.parentNode.style["x"===i?"overflowX":"overflowY"]=t?"auto":"hidden";"x"===i?this.xe=t:this.ge=t,this.J.scroll=!!t&&i}},getScrollState:function(){if(Zi.$active){var t=Zi.ps(this.mt);return{x:-t.e,y:-t.f}}return{x:this.mt.parentNode.scrollLeft,y:this.mt.parentNode.scrollTop}},scrollTo:function(t,i){Zi.$active&&"native"!=S.touch?(i=Math.max(0,Math.min(i,this.mt.offsetHeight-this.we)),t=Math.max(0,Math.min(t,this.mt.offsetWidth-this.be)),Zi.gs(this.mt,-t,-i,this.J.scrollSpeed||"100ms")):(this.mt.parentNode.scrollLeft=t,this.mt.parentNode.scrollTop=i)},lc:function(){-1!=this.J.scroll.toString().indexOf("x")&&(this.mt.scrollWidth&&(this.mt.style.width="100%",this.mt.style.width=this.mt.scrollWidth+"px"));if(Zi.$active&&this.dc){Zi.Ge(),Zi._s();var t=this.getScrollState(),i=this.mt.offsetWidth-this.$width-t.x,e=this.mt.offsetHeight-this.$height-t.y;if(i<0||e<0){var s=i<0?Math.min(-i-t.x,0):-t.x,n=e<0?Math.min(-e-t.y,0):-t.y;Zi.gs(this.mt,s,n,0)}}}},Ye={$init:function(){this.ih=p(),this.data,this.data.attachEvent("onStoreUpdated",C(this._c,this)),this.data.attachEvent("onStoreLoad",C(this.pc,this)),this.data.attachEvent("onAfterFilter",C(this.mc,this)),this.data.attachEvent("onSyncApply",C(this.bc,this)),this.data.attachEvent("onIdChange",C(this.gc,this)),this.$ready.push(this.wc)},wc:function(){("multiselect"==this.J.select||this.J.multiselect||"area"==this.J.select)&&Nt(this.$view,"mousedown",function(t){(t||Lt).shiftKey&&et(M.D=this,"webix_noselect",1)})},gc:function(t,i){for(var e=this.ih.length-1;0<=e;e--)this.ih[e]==t&&(this.ih[e]=i)},mc:function(){for(var t=this.ih.length-1;0<=t;t--)if(this.data.getIndexById(this.ih[t])<0){var i=this.ih[t];this.removeCss(i,"webix_selected",!0),this.ih.splice(t,1),this.callEvent("onSelectChange",[i])}},_c:function(t,i,e){"delete"==e?this.loadBranch?this.bc():this.ih.remove(t):t||this.data.count()||this.data.Cr||(this.ih=p())},pc:function(){this.J.select&&this.data.each(function(t){t&&t.$selected&&this.select(t.id)},this)},bc:function(){for(var t=this.ih.length-1;0<=t;t--)this.exists(this.ih[t])||this.ih.splice(t,1)},xc:function(t,i,e,s){var n=i?"onBeforeSelect":"onBeforeUnSelect";if(!this.callEvent(n,[t,i]))return!1;s&&(this.yc=!0,this.unselectAll(),this.yc=!1),i?this.addCss(t,"webix_selected",!0):this.removeCss(t,"webix_selected",!0),e?e.push(t):(i?this.ih.push(t):this.ih.remove(t),this.Mc(t));var h=i?"onAfterSelect":"onAfterUnSelect";return this.callEvent(h,[t]),!0},select:function(t,i){var e=arguments[2],s=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,e,s);else{if(this.data.exists(t),s&&this.ih.length)return this.selectAll(
this.ih[this.ih.length-1],t);var h=!1;e||i||1==this.ih.length&&this.ih[0]==t||(h=!0),h||!this.isSelected(t)?this.xc(t,!0,null,h):e&&this.unselect(t)}},unselect:function(t){if(!t)return this.unselectAll();this.isSelected(t)&&this.xc(t,!1)},selectAll:function(t,i){var e=[];(t||i?this.data.getRange(t||null,i||null):this.data.getRange()).each(function(t){this.data.getMark(t.id,"webix_selected")||(this.ih.push(t.id),this.xc(t.id,!0,e))},this),this.Mc(e)},unselectAll:function(){var i=[];this.ih.each(function(t){this.xc(t,!1,i)},this),this.ih=p(),this.Mc(i)},isSelected:function(t){return-1!=this.ih.find(t)},getSelectedId:function(t){switch(this.ih.length){case 0:return t?[]:"";case 1:return t?[this.ih[0]]:this.ih[0];default:return[].concat(this.ih)}},getSelectedItem:function(t){var i=this.getSelectedId(!0);if(1<i.length||t){for(var e=i.length-1;0<=e;e--)i[e]=this.getItem(i[e]);return i}if(i.length)return this.getItem(i[0])},Sc:function(t){return 100<t.length||t.length>this.data.count/2},Mc:function(t){if("object"!=k(t)&&(t=[t]),t.length){if(this.Sc(t))this.data.refresh();else for(var i=0;i<t.length;i++)this.render(t[i],this.data.getItem(t[i]),"update");this.yc||this.callEvent("onSelectChange",[t])}}};Mi(function(){Lt(document.body,"mouseup",function(){M.D&&(st(M.D,"webix_noselect"),M.D=null)})});var We={kc:["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 e="";0<t;)e=this.kc[t%16]+e,t=Math.floor(t/16);for(;e.length<i;)e="0"+e;return e},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 We.toHex(Math.floor(t),2)}).join("")},hexToDec:function(t){return parseInt(t,16)},toRgb:function(t){var i,e,s,n;return s="string"!=typeof t?(i=t[0],e=t[1],t[2]):-1!=t.indexOf("rgb")?(i=(n=t.substr(t.indexOf("(")+1,t.lastIndexOf(")")-t.indexOf("(")-1).split(","))[0],e=n[1],n[2]):("#"==t.substr(0,1)&&(t=t.substr(1)),i=this.hexToDec(t.substr(0,2)),e=this.hexToDec(t.substr(2,2)),this.hexToDec(t.substr(4,2))),((i=parseInt(i,10)||0)<0||255<i)&&(i=0),((e=parseInt(e,10)||0)<0||255<e)&&(e=0),((s=parseInt(s,10)||0)<0||255<s)&&(s=0),[i,e,s]},hsvToRgb:function(t,i,e){var s,n,h,r,o,a,u,c;switch(h=e*(1-i),r=e*(1-(n=t/60-(s=Math.floor(t/60)%6))*i),o=e*(1-(1-n)*i),c=u=a=0,s){case 0:a=e,u=o,c=h;break;case 1:a=r,u=e,c=h;break;case 2:a=h,u=e,c=o;break;case 3:a=h,u=r,c=e;break;case 4:a=o,u=h,c=e;break;case 5:a=e,u=h,c=r}return[a=Math.floor(255*a),u=Math.floor(255*u),c=Math.floor(255*c)]},rgbToHsv:function(t,i,e){var s,n,h,r,o,a,u;return s=t/255,n=i/255,h=e/255,r=Math.min(s,n,h),a=0,(u=o=Math.max(s,n,h))==r?a=0:o==s&&h<=n?a=60*(n-h)/(o-r)+0:o==s&&n<h?a=60*(n-h)/(o-r)+360:o==n?a=60*(h-s)/(o-r)+120:o==h&&(a=60*(s-n)/(o-r)+240),[a,0===o?0:1-r/o,u]}};function Ge(t){var i=" ";if(t)for(var e in t)i+=e+'="'+t[e]+'" ';return i}var Xe={draw:function(t,i,e,s){return"<svg "+Ge({xmlns:"http://www.w3.org/2000/svg",version:"1.1",height:"100%",width:"100%",viewBox:"0 0 "+i+" "+e,"class":s||""})+">"+t+"</svg>"},styleMap:{lineColor:"stroke",color:"fill"},group:function(t){return"<g>"+t+"</g>"}};Xe.Cc={M:function(t){return" M "+t.x+" "+t.y},L:function(t){return" L "+t.x+" "+t.y},C:function(t,i,e){return" C "+t.x+" "+t.y+" "+i.x+" "+i.y+" "+e.x+" "+e.y},A:function(t,i,e,s){var n=t.x+Math.cos(s)*i,h=t.y+Math.sin(s)*i;return" A "+i+" "+i+" 0 "+(s-e>=Math.PI?1:0)+" 1 "+n+" "+h}},Xe.definePath=function(t,i){for(var e="",s=0;s<t.length;s++){t[s][0]&&t[s][0];var n=t[s][0].toUpperCase();this.Cc[n],e+=this.Cc[n].apply(this,t[s].slice(1))}return i&&(e+=" Z"),e},Xe.Dc=function(t){for(var i=[],e=0;e<t.length;e++)i.push([e?"L":"M",t[e]]);return i},Xe.setOpacity=function(t,i){var e=We.toRgb(t);return e.push(i),"rgba("+e.join(",")+")"},Xe.Ac=function(t){for(var i=[],e=0;e<t.length;e++){var s=t[e];e||i.push(["M",s[0]]),i.push(["C",s[1],s[2],s[3]])}return i},Xe.getPath=function(t,i,e){return'<path class="'+i+'" vector-effect="non-scaling-stroke" d="'+t+'" '+(e=Ge(e))+"/>"},Xe.getSector=function(t,i,e,s,n,h){h=Ge(h);var r=[
["M",t],["L",{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}],["A",t,i,e,s],["L",t]];return'<path class="'+n+'" vector-effect="non-scaling-stroke" d="'+Xe.definePath(r,!0)+'" '+h+"/>"},Xe.getCurve=function(t,i,e){return e=Ge(e),'<path fill="none" class="'+i+'" vector-effect="non-scaling-stroke" d="'+this.definePath(this.Ac(t))+'" '+e+"/>"},Xe.getLine=function(t,i,e,s){return this.getPath(this.definePath(this.Dc([t,i]),!0),e,s)},Xe.getCircle=function(t,i,e,s){return s=Ge(s),'<circle class="'+e+'" cx="'+t.x+'" cy="'+t.y+'" r="'+i+'" '+s+"/>"},Xe.getRect=function(t,i,e,s,n,h){return'<rect class="'+n+'" rx="0" ry="0" x="'+t+'" y="'+i+'" width="'+e+'" height="'+s+'" '+(h=Ge(h))+"/>"};var qe={paddingX:6,paddingY:6,radius:2,minHeight:4,eventRadius:8};function Je(t){this.config=H.extend(B(qe),t||{},!0)}Je.prototype.draw=function(t,i,e){var s=this.getPoints(t,i,e),n=this.config,h=Xe,r=n.color?this.Ic(h,n.color):null,o=h.definePath(this.Tc(s)),a=h.group(h.getPath(o,"webix_sparklines_line"+(r?" "+r.line:"")));a+=this.Fc(h,s,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.zc(h,s,u),h.draw(a,i,e,"webix_sparklines_line_chart"+(n.css?" "+n.css:""))},Je.prototype.Ic=function(t,i){var e={line:{},item:{}},s=t.styleMap;if(i)for(var n in e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=L(e[n]);return e},Je.prototype.Fc=function(t,i,e,s,n){for(var h=[],r=0;r<i.length;r++)h.push(t.getCircle(i[r],e,s,n));return t.group(h.join(""))},Je.prototype.zc=function(t,i,e){for(var s=[],n=0;n<i.length;n++)s.push(t.getCircle(i[n],e,"webix_sparklines_event_area",{webix_area:n}));return t.group(s.join(""))},Je.prototype.Tc=function(t){var i,e,s=[];for(i=0;i<t.length;i++)e=i?"L":"M",s.push([e,t[i]]);return s},Je.prototype.getPoints=function(t,i,e){var s=this.config,n=Math.min.apply(null,t);"undefined"!=typeof s.origin&&(n=Math.min(s.origin,n));var h=Math.max.apply(null,t),r=[],o=s.paddingX||0,a=s.paddingY||0;i=(i||100)-2*o;var u=s.minHeight||0;if(e=(e||100)-2*a,t.length)if(1==t.length)r.push({x:i/2+o,y:e/2+o});else{var c=i/(t.length-1),f=s.scale||h-n,l=(e-u)/(f||1);f||(e/=2);for(var d=0;d<t.length;d++)r.push({x:Math.ceil(c*d)+o,y:e-Math.ceil(l*(t[d]-n))+a-u})}return r};var Ke={paddingX:3,paddingY:4,radius:1,minHeight:4,eventRadius:8};function Ze(t){this.config=H.extend(B(Ke),t||{},!0)}Ze.prototype.draw=function(t,i,e){var s,n,h,r,o,a=this.config,u=Je.prototype,c=Xe;return r=this.getPoints(t,i,e),h=c.definePath(u.Tc(r),!0),a.color&&(o=this.Ic(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.Tc(r)),n+=c.group(c.getPath(h,"webix_sparklines_line"+(o?" "+o.line:""))),n+=u.Fc(c,r,a.radius,"webix_sparklines_item"+(o?" "+o.item:"")),s=Math.min(t.length?(i-2*(a.paddingX||0))/t.length:0,a.eventRadius),n+=u.zc(c,r,s),c.draw(n,i,e,"webix_sparklines_area_chart"+(a.css?" "+a.css:""))},Ze.prototype.Ic=function(t,i){var e={area:{},line:{},item:{}},s=t.styleMap;if(i)for(var n in e.area[s.color]=t.setOpacity(i,.2),e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=L(e[n]);return e},Ze.prototype.getPoints=function(t,i,e){var s=Je.prototype.getPoints.call(this,t,i,e),n=this.config.paddingX||0,h=this.config.paddingY||0;return s.push({x:i-n,y:e-h},{x:n,y:e-h},{x:n,y:s[0].y}),s};var Qe={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 ts(t){this.config=H.extend(B(Qe),t||{},!0)}ts.prototype.draw=function(t,i,e){var s,n,h,r,o,a=this.config,u="",c=[],f=this.getPoints(t,i,e),l=Xe;for(s=0;s<f.length;s++)n="function"==typeof a.itemCss?a.itemCss.call(this,t[s]):a.itemCss||"",a.negativeColor&&t[s]<a.origin?n+=" "+this.Ic(l,a.negativeColor):a.color&&(n+=" "+this.Ic(l,a.color)),h=f[s],c.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_bar "+n));u+=l.group(c.join("")),r=parseInt(this.Vc(t,i,e),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.Hc(t,i,e),v=[]
;for(s=0;s<d.length;s++)h=d[s],v.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_event_area ",{webix_area:s}));return u+=l.group(v.join("")),l.draw(u,i,e,"webix_sparklines_bar_chart"+(a.css?" "+a.css:""))},ts.prototype.Ic=function(t,i){var e={},s=t.styleMap;return i&&(e[s.color]=i),L(e)},ts.prototype.Vc=function(t,i,e){var s=this.config,n=s.paddingY||0,h=n+(e=(e||100)-2*n);if(!1!==s.origin){var r=Math.min.apply(null,t),o=Math.max.apply(null,t),a=s.origin||-1e-6;if(o<=a)h=n;else if(r<a){h-=e/(o-r)*(a-r)}}return h},ts.prototype.Hc=function(t,i,e){var s=[],n=this.config.paddingX||0,h=this.config.paddingY||0;if(i=(i||100)-2*n,e=(e||100)-2*h,t.length)for(var r=i/t.length,o=0;o<t.length;o++)s.push({x:Math.ceil(r*o)+n,y:h,height:e,width:r});return s},ts.prototype.getPoints=function(t,i,e){var s=this.config,n=Math.min.apply(null,t);s.origin<n&&(n=s.origin);var h=Math.max.apply(null,t),r=[],o=s.paddingX,a=s.paddingY,u=s.margin,c=s.width||20,f=this.Vc(t,i,e);if(i=(i||100)-2*o,e=(e||100)-2*a,t.length){var l=i/t.length,d=s.scale||h-n;u=l-(c=Math.min(l-u,c));var v=0,_=n;!1!==s.origin&&s.origin>n?_=s.origin||0:v=s.minHeight;for(var p=(e-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 is={paddingY:2};function es(t){this.config=H.extend(is,t||{},!0)}es.prototype.Bc=0,es.prototype.Rc=["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],es.prototype.Pc=function(t,i){var e=i.length,s=this.Rc.length;return e<s?(t&&(t=t<s-e?this.Bc+2:this.Bc+1),this.Bc=t):t%=s,this.Rc[t]},es.prototype.draw=function(t,i,e){var s,n,h,r,o=this.config,a=o.color||this.Pc,u=this.getAngles(t),c=Xe,f=e/2-(o.paddingY||0),l=i/2,d=e/2;for("function"!=typeof a&&(a=function(){return a}),r="",h=0;h<u.length;h++)(s={})[c.styleMap.color]=a.call(this,h,t,this.jc),r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_sector",s);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,e,"webix_sparklines_pie_chart"+(o.css?" "+o.css:""))},es.prototype.getAngles=function(t){var i,e,s=-Math.PI/2,n=[],h=this.Ec(t);for(e=0;e<t.length;e++)i=-Math.PI/2+h[e]-1e-4,n.push([s,i]),s=i;return n},es.prototype.Nc=function(t){for(var i=0,e=0;e<t.length;e++)i+=1*t[e];return i},es.prototype.Ec=function(t){var i,e,s=[],n=0,h=this.Nc(t);for(i=0;i<t.length;i++)e=1*t[i],s[i]=2*Math.PI*(h?(e+n)/h:1/t.length),n+=e;return s};var ss={paddingX:3,paddingY:6,radius:2,minHeight:4,eventRadius:8};function ns(t){this.config=H.extend(B(ss),t||{},!0)}ns.prototype.draw=function(t,i,e){var s=this.config,n="",h=Je.prototype,r=this.getPoints(t,i,e),o=Xe,a=s.color?this.Ic(o,s.color):null;n+=o.group(o.getCurve(r,"webix_sparklines_line"+(a?" "+a.line:"")));var u=h.getPoints.call(this,t,i,e);n+=h.Fc(o,u,s.radius,"webix_sparklines_item"+(a?" "+a.item:""));var c=Math.min(t.length?(i-2*(s.paddingX||0))/t.length:0,s.eventRadius);return n+=h.zc(o,u,c),o.draw(n,i,e,"webix_sparklines_line_chart"+(s.css?" "+s.css:""))},ns.prototype.Ic=function(t,i){var e={line:{},item:{}},s=t.styleMap;if(i)for(var n in e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=L(e[n]);return e},ns.prototype.getPoints=function(t,i,e){var s,n,h,r,o=[],a=[],u=[];for(n=Je.prototype.getPoints.call(this,t,i,e),s=0;s<n.length;s++)a.push(n[s].x),u.push(n[s].y);for(h=this.Lc(a),r=this.Lc(u),s=0;s<n.length-1;s++)o.push([n[s],{x:h[0][s],y:r[0][s]},{x:h[1][s],y:r[1][s]},n[s+1]]);return o},ns.prototype.Lc=function(t){var i,e,s=[],n=[],h=[],r=[],o=[],a=[],u=t.length-1;for(n[s[0]=0]=2,h[0]=1,r[0]=t[0]+2*t[1],i=1;i<u-1;i++)s[i]=1,n[i]=4,h[i]=1,r[i]=4*t[i]+2*t[i+1];for(s[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++)e=s[i]/n[i-1],n[i]=n[i]-e*h[i-1],r[i]=r[i]-e*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 hs={
paddingX:3,paddingY:6,radius:1,minHeight:4,eventRadius:8};function rs(t){this.config=H.extend(B(hs),t||{},!0)}function os(){}(rs.prototype=B(ns.prototype)).draw=function(t,i,e){var s=this.config,n=Je.prototype,h=Xe,r=s.color?this.Ic(h,s.color):null,o=this.getPoints(t,i,e),a=o.splice(o.length-3,3),u=h.Dc(a);u[0][0]="L";var c=h.Ac(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.Ac(o)),"webix_sparklines_line"+(r?" "+r.line:"")));var l=n.getPoints.call(this,t,i,e);f+=n.Fc(h,l,s.radius,"webix_sparklines_item"+(r?" "+r.item:""));var d=Math.min(t.length?(i-2*(s.paddingX||0))/t.length:0,s.eventRadius);return f+=n.zc(h,l,d),h.draw(f,i,e,"webix_sparklines_splinearea_chart"+(s.css?" "+s.css:""))},rs.prototype.Ic=function(t,i){var e={area:{},line:{},item:{}},s=t.styleMap;if(i)for(var n in e.area[s.color]=t.setOpacity(i,.2),e.line[s.lineColor]=i,e.item[s.color]=i,e)e[n]=L(e[n]);return e},rs.prototype.getPoints=function(t,i,e){var s=ns.prototype.getPoints.call(this,t,i,e),n=this.config.paddingX||0,h=this.config.paddingY||0;return s.push({x:i-n,y:e-h},{x:n,y:e-h},{x:n,y:s[0][0].y}),s},os.types={},os.getTemplate=function(t){var i=t||{};"string"==typeof t&&(i={type:t}),H.extend(i,{type:"line"});var e=this.types[i.type];return C(this.Oc,new e(i))},os.Oc=function(t,i,e,s){return s?this.draw(function n(t){for(var i=[],e=t.length-1;0<=e;e--){var s=t[e];i[e]="object"===k(s)?s.value:s}return i}(e),s.width,33):this.draw(t.data||t,i.width,i.height)},T("onDataTable",function(t){t.type.sparklines=os.getTemplate()}),os.types.area=Ze,os.types.bar=ts,os.types.line=Je,os.types.pie=es,os.types.spline=ns,os.types.splineArea=rs;var as={escape:!0,delimiter:{rows:"\n",cols:"\t"},parse:function(t,i){if(i=i||this.delimiter,!this.escape)return this.Uc(t,i);for(var e=t.replace(/\n$/,"").split(i.rows),s=0;s<e.length-1;)this.Yc(e[s],'"')%2==1&&(e[s]+=i.rows+e[s+1],delete e[s+1],s++),s++;var n=[];for(s=0;s<e.length;s++)if("undefined"!=typeof e[s]){for(var h=e[s],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},Uc:function(t,i){for(var e=t.split(i.rows),s=0;s<e.length;s++)e[s]=e[s].split(i.cols);return e},Yc:function(t,i){return t.split(i).length-1},stringify:function(t,i){if(i=i||this.delimiter,!this.escape){for(var e=0;e<t.length;e++)t[e]=t[e].join(i.cols);return t.join(i.rows)}for(var s=/\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):s.test(r)&&(t[n][h]='"'+r.toString().replace(/"/g,'""')+'"')}t[n]=t[n].join(i.cols)}return t=t.join(i.rows)}},us={clipboard_setter:function(t){return!0!==t&&1!==t||(t="block"),ae.init(),this.attachEvent("onSelectChange",this.Wc),this.attachEvent("onItemClick",function(){document.activeElement&&this.$view.contains(document.activeElement)&&(ae.focus(),Ai.setFocus(this))}),this.attachEvent("onPaste",this.Gc),t},templateCopy_setter:It,Wc:function(){var t=this.Xc();ae.set(t),Ai.setFocus(this)},Xc:function(){var h=[],r=this.J.templateCopy;return this.mapSelection(function(t,i,e,s){h[s]||(h[s]=[]);var n=r?r(t,i,e):t;return h[s].push(n),t}),1===h.length&&1===h[0].length?h[0][0]:as.stringify(h,this.J.delimiter)},Gc:function(t){if(!x(this.Qn[this.J.clipboard])){var i=as.parse(t,this.J.delimiter);this.Qn[this.J.clipboard].call(this,i)}},Qn:{block:function(h){var t=this.mapSelection(null);t&&(this.mapCells(t.row,t.column,h.length,null,function(t,i,e,s,n){return h[s]&&h[s].length>n?h[s][n]:t}),this.render())},selection:function(h){this.mapSelection(function(t,i,e,s,n){return h[s]&&h[s].length>n?h[s][n]:t}),this.render()},repeat:function(h){this.mapSelection(function(t,i,e,s,n){return(i=h[s%h.length])[n%i.length]}),this.render()},custom:function(){}}},cs={open:function(t,i){if(t){var e=this.getItem(t);e.$count&&!e.open&&(this.callEvent("onBeforeOpen",[t])&&(e.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()},qc:function(t,i,e){if(this.J.threeState)return this.Jc(t,null!==i?i:"");var s,n=this.getItem(t),h=e?e.target||e.srcElement:null;s=h&&"checkbox"==h.type?!!h.checked:null!==i?i:!n.checked,n.checked=s,this.callEvent("onItemCheck",[t,n.checked,e])},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)}},Kc:function(t,i){var e=this.data.attachEvent("onStoreLoad",function(){t.setState.call(t,i),t.data.detachEvent(e),t=null})},setState:function(t){if(t.open){this.closeAll();for(var i=t.open,e=0;e<i.length;e++){var s=this.getItem(i[e]);if(s&&s.$count&&(s.open=!0,-1==s.$count))return this.Kc(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}},fs={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.qc(i,null,t),!1}},ls={$init:function(){this.data.attachEvent("onStoreUpdated",C(this.Zc,this),null,!0),this.co=this.Qc},Qc:function(t,i,e,s){var n=0===i?{parent:encodeURIComponent(t)}:null;return we.prototype.co.call(this,t,i,e,s,n)},loadBranch:function(t,i,e){return t=t||0,this.data.url=e||this.data.url,this.callEvent("onDataRequest",[t,i,this.data.url])&&this.data.url?this.data.feed.call(this,t,0,i,e):mt.reject()},Zc:function(t,i,e){e&&"add"!=e&&"delete"!=e&&"branch"!=e||this.data.tf(this)}},ds={$init:function(){this.data},copy:function(t,i,e,s){return(s=s||{}).copy=!0,this.move(t,i,e,s)},Kh:function(t,i,e){if(i&&t){var s=this.getBranchIndex(t);return s+(e==this&&e.getBranchIndex(i)<s?0:1)}},"if":function(t,i){var e=this.data.branch[t];if(e&&e.length)for(var s=0;s<e.length;s++){if(e[s]==i)return!0;if(this["if"](e[s],i))return!0}return!1},move:function(t,i,e,s){i=i||0;var n=(s=s||{}).newId||t,h=s.parent||0;if((e=e||this).data,e.data){if(!b(t)){if(this!=e||s.copy){if(n=e.data.add(e.Jh(this.getItem(t),n),i,h||0),this.data.branch[t]&&e.getBranchIndex){var r=this.data.fr;this.data.fr=function(t){var i=B(t);return delete i.$parent,delete i.$level,delete i.$child,e.data.pull[i.id]&&(i.id=z()),i};var o={data:this.serialize(t,!0),parent:n};this.data.fr=r,e.parse(o)}s.copy||this.data.remove(t)}else{if(t==h||this["if"](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=A.find.call(c,t);if(i<0&&(i=u.length),c===u&&i===f)return;if(A.removeAt.call(c,f),A.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=e.getItem(h);l.$count++,this.ef(a,l.$level+1)}else this.ef(a,1);a.$parent=h,e.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,e,s);i=e.Kh(v,t[d+1],this)}}},ef:function(t,i){t.$level=i;var e=this.data.branch[t.id];if(e)for(var s=0;s<e.length;s++)this.ef(this.getItem(e[s]),i+1)},Fo:function(t){t&&!t.header&&this.exists(t)&&this.zo(t)!=ie.Xs.start&&this.open(t)},$dropAllow:function(t){if(t.from!=t.to)return!0;for(var i=0;i<t.source.length;i++)if(this["if"](t.source,t.target))return!1;return!0},Jh:function(t,i){var e=de.Jh.call(this,t,i);return delete e.open,e}},vs={$init:function(){this.render},sf:function(t){var i=this.data.kr[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()},nf:function(t){return this.Ui.innerHTML=this.sf(t),this.Ui.firstChild},Ot:function(t){!t.$template||this.type["template"+t.$template],t.$template;var i="<div role='presentation' class='webix_tree_branch_"+t.$level+"'>"+this.sf(t);return t.open&&(i+=this.hf(t.id)),i+="</div>"},hf:function(t){var i="",e=this.data.branch[t];if(e){i+="<div role='presentation' class='webix_tree_leaves'>";for(var s=e.length-1,n=0;n<=s;n++){var h=this.getItem(e[n]),r=this.type.rf;0!==r&&(r[h.$level]=n==s),i+=this.Ot(h)}i+="</div>"}return i},render:function(t,i,e){if((vs.Ve=this).isVisible(this.J.id)&&!this.$blockRender){if(t){var s,n,h=this.getItem(t);if("add"!=e&&!(s=this.getItemNode(t)))return;switch(e){case"branch":var r=s.parentNode;X(n=this.ac(h),r),G(r),this.Li=null;break;case"paint":case"update":X(n=this.Li[t]=this.nf(h),s),G(s);break;case"delete":G(s.parentNode);break;case"add":var o;if(0==h.$parent)o=this.mt.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.ac(h),this.Li[t]=n.firstChild,X(n,u,o)}break;default:return!1}this.callEvent("onPartialRender",[t,i,e])}else this.callEvent("onBeforeRender",[this.data])&&(this.type.rf=[],this.mt.innerHTML=this.hf(0),this.Li=null,this.callEvent("onAfterRender",[]));return this.type.rf=0,!(vs.Ve=null)}},getItemNode:function(t){if(this.Li)return this.Li[t];this.Li={};for(var i=this.mt.getElementsByTagName("DIV"),e=0;e<i.length;e++){var s=i[e].getAttribute(this.Xo);s&&(this.Li[s]=i[e])}return this.getItemNode(t)},af:1},_s={uf:function(){if(this.af){var s=this.render;this.render=function(t,i){var e=s.apply(this,arguments);this.J.threeState&&e&&"checkbox"!=i&&this.cf.apply(this,arguments)},this.uf=function(){}}},threeState_setter:function(t){return t&&this.uf(),t},cf:function(t){var i,e,s,n,h;if(s=[],h=this,t&&!h.data.pull[t]&&(t=0),!t||h.data.pull[t].$count)for((e=this.ff(t)).sort(function(t,i){return h.data.pull[i].$level-h.data.pull[t].$level}),i=0;i<e.length;i++)i&&h.data.pull[e[i]].$parent==h.data.pull[e[i-1]].$parent||(s=s.concat(h.lf(e[i])));else s=s.concat(h.lf(t));for(n={},i=0;i<s.length;i++)n[s[i]]||(n[s[i]]=1,this.df(s[i]));h=null},df: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))},lf:function(t){var i,e,s,n,h,r,o;for(n=this.getParentId(t),h=[];n&&"0"!=n;){e=r=0,this.data.eachChild(n,function(t){t.indeterminate?r++:t.checked&&e++}),i=s=o=!1;var a=this.getItem(n);e==a.$count?i=!0:(0<e||0<r)&&(s=!0),(s||s!=a.indeterminate)&&(o=!0),a.indeterminate=s,(i||a.checked!=i)&&(o=!0),a.checked=i,n=o?(h.push(n),this.getParentId(n)):0}return h},getChecked:function(){var i=[],e=this;return this.data.eachSubItem(0,function(t){e.isChecked(t.id)&&i.push(t.id)}),i},Jc:function(t,i){var e=this.getItem(t);if(e&&(""===i&&(i=!e.checked),e.checked!=i||e.indeterminate)){e.checked=i,this.vf(t);var s=this.lf(t);if(this.af&&s.length<5)for(var n=0;n<s.length;n++)this.df(s[n]);else this.refresh();this.callEvent("onItemCheck",[t,i])}},checkItem:function(t){this.qc(t,!0),this.updateItem(t)},uncheckItem:function(t){this.qc(t,!1),this.updateItem(t)},_f:function(t,i,e){var s=i?"checkItem":"uncheckItem";t?this[s](t):t=0,this.J.threeState?t||this.data.eachChild(0,function(t){this[s](t.id)},this,e):this.data.each(function(t){this[s](t.id)},this,e,t)},checkAll:function(t,i){this._f(t,!0,i)},uncheckAll:function(t,i){this._f(t,!1,i)},vf:function(t){var i,e=this.getItem(t);e.indeterminate=!1,i=e.checked,this.data.eachSubItem(t,function(t){t.indeterminate=!1,t.checked=i}),this.af&&this.isBranchOpen(e.$parent)&&this.render(t,0,"branch")},
isChecked:function(t){return this.getItem(t).checked},ff:function(t){var e=[];return this.data.eachSubItem(t,function(t,i){i||e.push(t.id)}),e}},ps={name:"TreeStore",$init:function(){this.Qr={showSubItems:!0},this.branch={0:[]},this.attachEvent("onParse",function(t){this.Yr(t.child)}),this.attachEvent("onClearAll",C(function(){this.Lr=null},this))},filterMode_setter:function(t){return H.extend(this.Qr,t,!0)},Kr:function(t){if(this.Lr&&!t){for(var i in this.branch=this.Lr,this.order=p(B(this.branch[0])),this.branch)"0"!=i&&(this.getItem(i).$count=this.branch[i].length);delete this.Lr}},Zr:function(t,i,e,s){e&&this.Lr||(this.Lr=this.branch,this.branch=f(this.branch)),this.branch[0]=this.pf(t,i,this.branch[0],1,s||{})},pf:function(t,i,e,s,n){for(var h=[],r=n.level&&n.level!=s,o=0;o<e.length;o++){var a=e[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.pf(t,i,f,s+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},mf:function(t,i,e,s){if(t[e]){for(var n=t[s]=t[e],h=0;h<n.length;h++)this.getItem(n[h]).$parent=s;delete t[e]}if(t[i]){var r=A.find.call(t[i],e);0<=r&&(t[i][r]=s)}},changeId:function(t,i){if(t!=i){var e=this.getItem(t).$parent;return this.mf(this.branch,e,t,i),this.Lr&&this.mf(this.Lr,e,t,i),ge.prototype.changeId.call(this,t,i)}},clearAll:function(t){this.branch={0:[]},ge.prototype.clearAll.call(this,t)},getPrevSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],e=A.find.call(i,t)-1;return 0<=e?i[e]:null},getNextSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],e=A.find.call(i,t)+1;return e<i.length?i[e]: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 A.find.call(i,t)},Yr:function(e){this.Ur="string"==typeof e?function(t){var i=t[e];return i&&delete t[e],i}:e},Dr:function(t,i){for(var e=t.parent||0,s=0;s<i.length;s++){var n=this.driver.getDetails(i[s]),h=this.id(n),r=!!this.pull[h];r?(n=H.extend(this.pull[h],n,!0),this.Vr&&this.Vr(n)):(this.Hr&&this.Hr(n),this.pull[h]=n),this.Or(n,e,0,r,t.from?1*t.from+s:0)}var o=this.pull[e]||{},a=this.branch[e]||[];o.$count=a.length,delete o.webix_kids,t.size&&t.size!=a.length&&(a[t.size-1]=undefined)},Or:function(t,i,e,s,n){t.$count=0,t.$parent="0"!=i?i:0,t.$level=e||("0"!=i?this.pull[i].$level+1:1);var h=this.branch[t.$parent];(h||(h=this.branch[t.$parent]=[]),this.Lr&&(this.Lr[t.$parent]=h),s)||(h[n||h.length]=t.id);var r=this.Ur(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=hi.json.getDetails(r[o]),u=this.id(a);(s=!!this.pull[u])?(a=H.extend(this.pull[u],a,!0),this.Vr&&this.Vr(a)):(this.Hr&&this.Hr(a),this.pull[u]=a),this.Or(a,t.id,t.$level+1,s)}var c=this.branch[t.id];c&&(t.$count=c.length)},tf:function(t){this.order=p(),this.bf(0,t)},bf:function(t,i){for(var e=this.branch[t],s=0;s<e.length;s++){var n=e[s];this.order.push(n);var h=this.pull[n];h&&h.open&&(-1==h.$count?i.loadBranch(n):h.$count&&this.bf(n,i))}},provideApi:function(t,i){for(var e=["getPrevSiblingId","getNextSiblingId","getParentId","getFirstChildId","isBranch","getBranchIndex","filterMode_setter"],s=0;s<e.length;s++)t[e[s]]=this.eo(this,e[s]);t.getIndexById||ge.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,e,s){var n=this.branch;s&&this.Lr&&(n=this.Lr);var h=n[t];if(h)for(var r=0;r<h.length;r++)h[r]&&i.call(e||this,this.getItem(h[r]))},each:function(e,s,n,t){this.eachChild(t||0,function(t){var i=this.branch;e.call(s||this,t),n&&this.Lr&&(
i=this.Lr),t&&i[t.id]&&this.each(e,s,n,t.id)},this,n)},eachOpen:function(i,e,t){this.eachChild(t||0,function(t){i.call(e||this,t),this.branch[t.id]&&t.open&&this.eachOpen(i,e,t.id)})},eachSubItem:function(t,i){var e=this.branch[t||0];if(e)for(var s=0;s<e.length;s++){var n=e[s];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 e=this.branch[t||0];if(e)for(var s=0;s<e.length;s++){var n=e[s];this.branch[n]?this.eachLeaf(n,i):i.call(this,this.getItem(n),!1)}},Jr:function(t,i){var e=this.sorting.create(t);for(var s in this.branch){for(var n=this.branch[s],h=[],r=0;r<n.length;r++)h.push(this.pull[n[r]]);h.sort(e);for(var o=0;o<n.length;o++)h[o]=h[o].id;this.branch[s]=h}return i},add:function(t,i,e){var s=!1,n=this.getItem(e||0);if(n&&(this.branch[n.id]||(s=!0),n.$count++,n.$count||(n.$count=1)),this.branch[e||0]=this.order=p(this.branch[e||0]),t.$count=t.webix_kids?-1:0,t.$level=n?n.$level+1:1,t.$parent=n?n.id:0,this.Lr){var h=this.Lr[e||0];if(h||(h=this.Lr[e]=this.order),this.order!==h){var r=h.length;!i&&this.branch[e||0].length&&(r=0),h=p(h),t.id=t.id||z(),h.insertAt(t.id,r)}}var o=ge.prototype.add.call(this,t,i);return s&&this.refresh(e),o},gf:function(t){var i=this.pull[t];if(this.branch[i.id]&&0<this.branch[i.id].length)for(var e=this.branch[t],s=0;s<e.length;s++)this.gf(e[s],!0);delete this.branch[t],this.Lr&&delete this.Lr[t],delete this.pull[t],this.kr[t]&&delete this.kr[t]},wf:function(t,i,e){var s=t[i];1==s.length&&s[0]==e&&i?delete t[i]:p(s).remove(e)},remove:function(t){if(b(t))for(var i=0;i<t.length;i++)this.remove(t[i]);else{this.exists(t);var e=this.pull[t],s=e.$parent||0;if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.gf(t),this.callEvent("onAfterDelete",[t]);var n=this.pull[s];this.wf(this.branch,s,t),this.Lr&&this.wf(this.Lr,s,t);var h=0;n&&(n.$count--,n.$count<=0&&(n.$count=0,n.open=0,h=1)),this.callEvent("onStoreUpdated",[t,e,"delete"]),h&&this.refresh(n.id)}},getBranch:function(t){var i=[],e=(this.Lr||this.branch)[t];if(e)for(var s=0;s<e.length;s++)i[s]=this.pull[e[s]];return i},serialize:function(t,i){var e=this.branch;i&&this.Lr&&(e=this.Lr);for(var s=e[t||0],n=[],h=0;h<s.length;h++){var r,o=this.pull[s[h]];if(this.fr){if(!1===(r=this.fr(o)))continue}else r=B(o);e[o.id]&&(r.data=this.serialize(o.id,i)),n.push(r)}return n}},ms={insert:function(t){for(var i=this.getSelectedId(!0,!0),e=0;e<t.length;e++){for(var s={},n=0;n<this.J.columns.length;n++)s[this.J.columns[n].id]=t[e][n]||"";!x(s.id)&&this.exists(s.id)&&(s.id=z()),this.add(s,null,i[0])}}},bs={space:function(t){for(var i="",e=1;e<t.$level;e++)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>"}},gs={flash:{$render:function(){window.swfobject||si("legacy/swfobject.js",!0);var t=this.J;t.swfId=t.swfId||"webix_swf_"+z(),this.xf().innerHTML+="<div class='webix_upload_flash'><div id='"+t.swfId+"'></div></div>",this.yf=this.xf().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"}),Nt(this.st,"click",C(function(){250<new Date-(this.Mf||0)&&this.fileDialog()},this)),this.files.attachEvent("onBeforeDelete",C(this.Sf,this))},$applyFlash:function(t,i){return this[t].apply(this,i)},getSwfObject:function(){return swfobject.getObjectById(this.J.swfId)},fileDialog:function(){this.getSwfObject()&&this.getSwfObject().showDialog()},send:function(t){if(
"function"==typeof t&&(this.kf=t,t=0),t){var i=this.files.getItem(t);if("client"!==i.status)return!1;if(i.status="transfer",this.getSwfObject()){var e=this.Cf(i),s=this.J.formData||{};"function"==typeof s&&(s=s.call(this));var n=H.extend(i.formData||{},s);this.getSwfObject().upload(t,e,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.$f()},$beforeAddFileToQueue:function(t,i,e){var s=i.split(".").pop(),n=this.Df(e);return this.callEvent("onBeforeFileAdd",[{id:t,name:i,size:e,sizetext:n,type:s}])},$addFileToQueue:function(t,i,e){if(this.files.exists(t))return!1;this.J.multiple||this.files.clearAll();var s=i.split(".").pop(),n={name:i,id:t,size:e,sizetext:this.Df(e),type:s,status:"client"};this.files.add(n),this.callEvent("onAfterFileAdd",[n]),t&&this.J.autosend&&this.send(t)},stopUpload:function(t){this.Sf(t)},Sf:function(t){var i=this.files.getItem(t);"transfer"==i.status&&(this.getSwfObject().uploadStop(t),i.status="client")},Af:function(){},$onUploadComplete:function(){this.J.autosend&&this.$f()},$onUploadSuccess:function(t,i,e){var s=this.files.getItem(t);s&&(s.status="server",s.progress=100,e.text&&"string"==typeof e.text&&(hi.json.toObject(e.text),H.extend(s,e,!0)),this.callEvent("onFileUpload",[s,e]),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.yf)this.Yi.firstChild.appendChild(this.yf);else{this.files.attachEvent("onBeforeDelete",this.Sf);var t={type:"file","class":"webix_hidden_upload",tabindex:-1};this.J.accept&&(t.accept=this.J.accept),this.J.multiple&&(t.multiple="true"),this.J.directory&&(t.webkitdirectory="true",t.mozdirectory="true",t.directory="true");var i=Y("input",t);this.yf=this.Yi.firstChild.appendChild(i),Nt(this.st,"drop",C(function(t){this.Af(t),Q(t)},this)),Nt(i,"change",C(function(){if(this.If(i.files),S.isIE){var t=document.createElement("form");t.appendChild(this.yf),t.reset(),this.Yi.firstChild.appendChild(i)}else i.value=""},this)),Nt(this.st,"click",C(function(){250<new Date-(this.Mf||0)&&this.fileDialog()},this)),Nt(this.st,"dragenter",Q),Nt(this.st,"dragexit",Q),Nt(this.st,"dragover",Q)}},Tf:function(t){return t.isDirectory},Ff:function(e,s,n){if(e.isFile)e.file(function(t){s.addFile(t,null,null,{name:n+"/"+t.name})});else if(e.isDirectory){e.createReader().readEntries(function(t){for(var i=0;i<t.length;i++)s.Ff(t[i],s,(n?n+"/":"")+e.name)})}},Af:function(t){var i=t.dataTransfer.files,e=t.dataTransfer.items;if(this.callEvent("onBeforeFileDrop",[i,t])){e=e||i;for(var s=0;s<e.length;s++){var n=e[s];n.webkitGetAsEntry&&(n=n.webkitGetAsEntry()).isDirectory?this.Ff(n,this,""):this.addFile(i[s])}}this.callEvent("onAfterFileDrop",[i,t])},fileDialog:function(t){this.Mf=new Date,this.zf=t;var i=this.st.getElementsByTagName("INPUT");i[i.length-1].click()},send:function(i){if("function"==typeof i&&(this.kf=i,i=0),i){var t=this.files.getItem(i);if("client"!==t.status)return!1;this.J.upload,t.status="transfer";var e=new FormData;e.append(this.config.inputName,t.file,t.name),e.append(this.config.inputName+"_fullpath",t.name);var s={},n=this.J.formData||{};"function"==typeof n&&(n=n.call(this));var h=H.extend(t.formData||{},n),r=new XMLHttpRequest,o=this.Cf(t);if(I("onBeforeAjax",["POST",o,h,r,s,e])){for(var a in h)e.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.Vf(i)},this),r.open("POST",o,!0),s)r.setRequestHeader(u,s[u]);r.send(e)}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.$f()},Vf:function(t){var i=this.files.getItem(t);if(i){var e=null;if(i.xhr.status<400){var s=hi[this.J.datatype||"json"];(e=s.toObject(i.xhr.responseText))&&(e=s.getDetails(e))}e&&"error"!=e.status?(!e.status||e.status,this.Hf(t,e)):(
i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,e])),delete i.xhr}},stopUpload:function(t){C(this.Sf,this.files)(t)},Sf:function(t){var i=this.getItem(t);"undefined"!=typeof i.xhr&&(i.xhr.aborted=!0,i.xhr.abort(),delete i.xhr,i.status="client")}}},ws={Bf:function(){this.data.attachEvent("onStoreUpdated",C(function(t,i,e){!t||"add"!=e&&"update"!=e||this.validate(t)},this)),this.data.attachEvent("onClearAll",C(this.clearValidation,this)),this.Bf=function(){}},rules_setter:function(t){return t&&this.Bf(),t},clearValidation:function(){this.data.clearMark("webix_invalid",!0)},validate:function(t){var i=!0;if(t){this.Qh={};var e=this.getItem(t);(i=_e.validate.call(this,null,e))?this.callEvent("onValidationSuccess",[t,e])&&this.Zh(t):this.callEvent("onValidationError",[t,e,this.Qh])&&this.sr(t,this.Qh)}else for(var s in this.data.pull)i=this.validate(s)&&i;return i},ir:function(t,i,e,s){"string"==typeof t&&(t=ve[t]);var n=t.call(this,i,e,s);return n||(this.Qh[s]=!0),n},Zh:function(t){this.data.removeMark(t,"webix_invalid",!0)},sr:function(t){this.data.addMark(t,"webix_invalid",!0)}},xs={$init:function(){this.elements={}},focus:function(t){if(t)this.elements[t],this.gi(this.elements[t]);else for(var i in this.elements)if(!1!==this.gi(this.elements[i]))return!0;return!1},gi:function(t){return!(!t||!t.focus)&&t.focus()},setValues:function(t,i){var e=this;this.J.complexData&&(t=xt.collapseNames(t,"",{},function(t){return x(e.Rf[t])})),this.Pf(t,i)},Pf:function(t,i){for(var e in this.jf=i,this.blockEvent(),i&&this.Rf||(this.Rf={}),t)this.elements[e]||(this.Rf[e]=t[e]);for(var s in this.elements){var n=this.elements[s];n&&(x(t[s])?!i&&n.$allowsClear&&n.setValue(""):n.setValue(t[s]),this.Rf[s]=n.getValue())}this.unblockEvent(),this.callEvent("onValues",[])},isDirty:function(){return!!this.jf||1===this.getDirtyValues(1)},setDirty:function(t){(this.jf=t)||(this.Rf=this.Ef())},getDirtyValues:function(){var t={};if(this.Rf)for(var i in this.elements){var e=this.elements[i].getValue();if(this.Rf[i]!=e&&(t[i]=e,arguments[0]))return 1}return t},getCleanValues:function(){return this.Rf},getValues:function(t){var i=this.Ef(t);return this.J.complexData&&(i=xt.expandNames(i)),i},Ef:function(t){var i,e=null,s=this.Rf?B(this.Rf):{};for(var n in this.elements)e=this.elements[n],i=!0,t&&("object"==k(t)?(!1===t.hidden&&(i=e.isVisible()),i&&!1===t.disabled&&(i=e.isEnabled())):i=t.call(this,e)),i?s[n]=e.getValue():delete s[n];return s},clear:function(){this.jf=!1;var t={};for(var i in this.elements)this.elements[i].$allowsClear&&(t[i]="");this.Pf(t)},markInvalid:function(t,i){if(!1===i)this.Zh(t);else{if("string"==typeof i){var e=this.elements[t];e&&(e.J.invalidMessage=i)}this.sr(t)}},sr:function(t){var i=this.elements[t];t&&i&&(this.Zh(t,!0),et(i.st,"webix_invalid"),i.J.invalid=!0,"string"==typeof i.J.invalidMessage&&i.setBottomText&&i.setBottomText())},Zh:function(t,i){var e=this.elements[t];t&&e&&e.$view&&e.J.invalid&&(st(e.st,"webix_invalid"),e.J.invalid=!1,"string"==typeof e.J.invalidMessage&&!i&&e.setBottomText&&e.setBottomText())}},ys={$init:function(){this.render,this.Li={},Nt(this.st,"scroll",C(this.Nf,this)),S.touch&&this.attachEvent("onAfterScroll",C(this.Nf,this)),this.Lf=[]},getItemNode:function(t){return this.Li[t]},showItem:function(t){var i=this.oh(),e=this.data.getIndexById(t),s=Math.floor(e/i.rh)*i.$s,n=this.getScrollState();(s<n.y||s+this.J.height>=n.y+this.we)&&this.scrollTo(0,s)},render:function(t,i,e){if(this.isVisible(this.J.id)&&!this.$blockRender)if(t){var s=this.getItemNode(t);switch(e){case"update":if(!s)return;X(this.Li[t]=this.ac(i),s),G(s);break;default:this.Of()}}else this.callEvent("onBeforeRender",[this.data])&&(this.Li={},this.Nf(null,!0),this.Uf=!1,this.callEvent("onAfterRender",[]))},Of:function(){this.Uf||(this.Uf=!0,window.setTimeout(C(function(){this.render()},this),1))},Yf: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},Nf:function(t,i
){this.Lf=[];var e=this.oh();this.mt.firstChild&&!i||(this.mt.innerHTML="",this.mt.appendChild(this.Yf(e.Wf)),this.Oi=[this.mt.firstChild]);for(var s=e.Gf;s<=e.Xf;){for(;this.Oi[s]&&this.Oi[s].qf&&s<=e.Xf;)s++;if(s>e.Xf)break;for(var n=s;!this.Oi[n];)n--;var h=this.Oi[n],r=s*e.rh+(this.data.$min||0);if(r>(this.data.$max||Infinity))break;var o=Math.min(r+e.rh-1,this.data.$max?this.data.$max-1:Infinity),a=this.Yf(e.$s),u=this.data.getIndexRange(r,o);if(!u.length)break;for(var c={$template:"Loading"},f=0;f<u.length;f++)u[f]||this.Lf.push(r+f),u[f]=this.Ot(u[f]||c);a.innerHTML=u.join("");for(var l=0;l<u.length;l++)this.Li[this.data.getIdByIndex(r+l)]=a.childNodes[l];var d=parseFloat(h.style.height,10),v=(s-n)*e.$s,_=d-v-e.$s;if(X(a,v?h.nextSibling:h,this.mt),(this.Oi[s]=a).qf=!0,v<=0&&0<_)h.style.height=_+"px",this.Oi[s+1]=h;else if(v<0?G(h):h.style.height=v+"px",0<_)X(this.Oi[s+1]=this.Yf(_),a.nextSibling,this.mt);s++}if(this.Lf.length){var p=this.Lf[0],m=this.Lf.pop()+1;if(p<m){var b=m-p;if(this.vo(b,p))return;b=Math.max(b,this.J.datafetch||this.J.loadahead||0),this.loadNext(b,p)}}},oh:function(){var t=this.getScrollState(),i=Math.max(0,t.y),e=this.be,s=this.we,n=this.type,h=Math.floor(e/n.width)||1,r=Math.floor(i/n.height),o=Math.ceil((s+i)/n.height)-1,a=this.data.$max?this.data.$max-this.data.$min:this.data.count();return{Gf:r,Xf:o,Jf:i,Wf:Math.ceil(a/h)*n.height,$s:n.height,rh:h}},Gt:function(t){var i=this.getItemNode(t);return i||(this.showItem(t),this.Nf(),i=this.getItemNode(t)),{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Yi}}},Ms={$init:function(){this.Li={},Zi.$active?(this.attachEvent("onBeforeScroll",function(){this.Kf=!0}),this.attachEvent("onAfterScroll",function(){this.render(null,null,"paint"),this.Kf=!1}),this.attachEvent("onTouchMove",function(){this.Kf&&(this.blockEvent(),this.render(null,null,"paint"),this.unblockEvent())})):Nt(this.st,"scroll",C(function(){this.render(null,null,"paint")},this))},xs:function(t,i,e){this.J.footer&&Zi.gs(this.Zf.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},getItemNode:function(t){return this.Li&&this.Li[t]},showItem:function(t){var i=this.data.getIndexById(t);if(-1<i){var e=i*this.type.height,s=e+this.type.height,n=this.getScrollState(),h=J(this.$view);e<n.y?this.scrollTo(0,e):s>n.y+h.height&&this.scrollTo(0,s-h.height)}},render:function(t,i,e){if(this.isVisible(this.J.id)&&!this.$blockRender){var s=this.cc||this.mt;if(!t||"paint"!=e&&"update"!=e){if("paint"!=e&&(this.Li={},s.innerHTML=""),this.callEvent("onBeforeRender",[this.data])){var n=this.data.count(),h=this.getScrollState(),r=J(this.st),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.Li[f])u.push("<div></div>");else{var l=this.data.getItem(f);if(!l){this.Qf({count:a-c+(this.J.loadahead||0),start:c});break}u.push(this.Ot(l))}}this.Ui.innerHTML=u.join(""),s.style.position="relative",s.style.height=n*this.type.height+"px";for(var d=this.Ui.childNodes,v=d.length-1;0<=v;v--){var _=d[v],p=_.getAttribute(this.Xo);p&&(_.style.position="absolute",_.style.top=(o+v)*this.type.height+"px",_.style.left=0,_.style.width="100%",s.appendChild(_),this.Li[p]=_)}this.callEvent("onAfterRender",[])}}else{var m=this.getItemNode(t);if(m){var b=this.Li[t]=this.ac(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(){Li.api.$setSize.apply(this,arguments)&&this.render(null,null,"paint")},Qf:function(t){var i=Math.max(t.count,this.J.datafetch||this.J.loadahead||0);this.vo(t.count,t.start)||this.loadNext(i,t.start)}},Ss="non-existing view for export";function ks(i,e,t){return!t&&e.format?function(t){return e.format(t[i])}:function(t){return t[i]}}function Cs(t,i){var e=[],s=0,n=0,h=t.getColumnConfig,r=i.columns,o=!!i.rawValues;if(e.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.tl);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&&e.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.il[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?ks(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 $=k.header[C]||{},D=$.contentId?t.getHeaderContent($.contentId).getValue(!0):$.text;k.header[C]=(D||"").toString().replace(/<[^>]*>/gi,"")}if(s=Math.max(s,k.header.length),t.J.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)}e.push(k)}}for(var T=0;T<e.length;T++){for(var F=s-e[T].header.length,z=0;z<F;z++)e[T].header.push("");if(t.J.footer){F=n-e[T].footer.length;for(var V=0;V<F;V++)e[T].footer.push("")}}return e}function $s(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 e=0;e<a[0].header.length;e++){i=[];for(var s=0;s<a.length;s++)t="",a[s].header[e]&&(t=a[s].header[e],u&&(t=a[s].header[e]=t.replace(c,""))),i.push(t);"excel"!=l||!r.tl||!1===o.heights||r.el[e]===Xi.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.el[e]),"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)){this.data.Er&&(t=r.data.Er(t));for(var i=[],e=0;e<a.length;e++){var s=a[e],n=null;if(o.math&&t["$"+s.id]&&"="==t["$"+s.id].charAt(0)&&!t["$"+s.id].match(/^=(image|link|sparkline)\(/i)&&(n=t["$"+s.id]),this.sl){var h=this.getSpan(t.id,s.id);h&&h[4]&&h[0]==t.id&&h[1]==s.id&&(n=h[4],u&&"string"==typeof n&&(n=n.replace(c,"")))}n||((n=s.template(t,r.type,t[s.id],s,e))||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.tl&&!1!==o.heights&&(t.$height&&t.$height!==Xi.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.tl||!1===o.heights||r.nl[h]===Xi.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.nl[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}var Ds={};function As(t,i){var e=(i.filename||"Data")+".pdf",s=new Blob([t.toString()],{type:"application/pdf"});return!1!==i.download&&ht(s,e),s}function Is(s,n){for(var t,h=function o(t){var i=t.width||595.296,e=t.height||841.896;t.orientation&&"landscape"===t.orientation&&(e=[i,i=e][0]);return new pdfjs.Document({padding:40,font:t.hl,threshold:256,width:i,height:e})}(n),r=[],i=0;i<s.length;i++
)s[i].node?r.push((t=s[i].node,window.html2canvas(t,{background:"#fff",logging:!1}).then(function(t){var e=mt.defer(),i=t.toDataURL("image/jpeg");return pdfjs.load(i,function(t,i){e.resolve(new pdfjs.Image(i))}),e}))):r.push(mt.resolve());return mt.all(r).then(function(t){for(var i=0;i<r.length;i++){var e=s[i].viewOptions;e.textBefore&&Ts(h,"before",e.textBefore),t[i]?h.image(t[i],{align:"center"}):zs(s[i].scheme,s[i].data,e,h),e.textAfter&&Ts(h,"after",e.textAfter),i!=s.length-1&&h.pageBreak()}return function o(s,n){if(!1!==n.docFooter){var t=s.footer();t.text({color:6710886,textAlign:"center"}).append(ct.dataExport.page||"Page").pageNumber().append("  "+(ct.dataExport.of||"of")+"  ").pageCount()}var h={text:0,image:1};n.docHeader&&("string"==typeof n.docHeader&&(n.docHeader={text:n.docHeader}),H.extend(n.docHeader,{color:6710886,textAlign:"right",order:0}),h.text=n.docHeader.order);n.docHeaderImage&&("string"==typeof n.docHeaderImage&&(n.docHeaderImage={url:n.docHeaderImage}),H.extend(n.docHeaderImage,{align:"right",order:1}),h.image=n.docHeaderImage.order);n.docHeader&&h.image>h.text&&s.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader);{if(n.docHeaderImage){var r=mt.defer();return pdfjs.load(n.docHeaderImage.url,function(t,i){if(!t){var e=new pdfjs.Image(i);s.header({paddingBottom:10}).image(e,n.docHeaderImage),n.docHeader&&h.image<h.text&&s.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader)}r.resolve(s.render())}),r}return mt.resolve(s.render())}}(h,n)})}function Ts(t,i,e){"after"==i&&t.text().br(),"string"==typeof e&&(e={text:e}),t.text(e.text,e.options||{}),"before"==i&&t.text().br()}function Fs(t){for(var i=80,e=0;e<t.length;e++)i+=t[e].width;return i}function zs(t,i,e,s){e.header=x(e.header)||!0===e.header?{}:e.header,e.footer=x(e.footer)||!0===e.footer?{}:e.footer,e.table=e.table||{};for(var n=!1===e.header?0:t[0].header.length,h=!1!==e.footer&&t[0].footer?t[0].footer.length:0,r=[],o=0;o<t.length;o++)r[o]=t[o].width;var a=H.extend(e.table,{borderWidth:1,height:20,lineHeight:1.1,borderColor:15658734,backgroundColor:16777215,color:6710886,textAlign:"left",paddingRight:10,paddingLeft:10,headerRows:n,widths:r.length?r:["100%"]}),u=s.table(a);if(n)for(var c=H.extend(e.header,{borderRightColor:11587299,borderBottomColor:11587299,color:4868682,backgroundColor:13820911,height:27,lineHeight:1.2}),f=0;f<n;f++)for(var l=u.tr(c),d=0;d<t.length;d++)l.td(t[d].header[f].toString());for(var v=0;v<i.length;v++)for(var _=u.tr({}),p=0;p<i[v].length;p++)_.td(i[v][p]);if(h)for(var m=H.extend(e.footer,{borderRightColor:15658734,borderBottomColor:15658734,backgroundColor:16448250,color:6710886,height:27,lineHeight:1.2}),b=0;b<h;b++)for(var g=u.tr(m),w=0;w<t.length;w++)g.td(t[w].footer[b].toString())}var Vs=function(t,d){(d=d||{}).export_mode="excel",t=b(t)?t:[t];for(var v=[],i=0;i<t.length;i++){var e=Pt(t[i]);if(e&&e.$exportView&&(e=e.$exportView(d)),e&&(v=v.concat(e)),d.dataOnly){var s=Cs(e,d);v[i]={scheme:s,exportData:$s(e,d,s),spans:d.spans?js(e,d):[]}}}if(d.dataOnly)return v;var _=mt.defer();return si(S.cdn+"/extras/xlsx.core.styles.min.js").then(function(){if(!v.length)return _.reject(Ss);for(var t={SheetNames:[],Sheets:{},Workbook:{WBProps:{},Names:[]}},i=b(d.sheets)?d.sheets:[d.name||"Data"],e=0;e<v.length;e++){var s=v[e].scheme||Cs(v[e],d),n=v[e].exportData||$s(v[e],d,s),h=v[e].spans?v[e].spans:d.spans?js(v[e],d):[],r=v[e].ranges||[],o=Rs(n,s,h,v[e].styles||[],d),a=(i[e]||"Data"+e).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),e=new Uint8Array(i),s=0;s!=t.length;++s)e[s]=255&t.charCodeAt(s);return i}(u)],{type:"application/xlsx"});return!1!==d.download&&ht(f,c),_.resolve(f),_})};var Hs={number:"n",date:"n",string:"s","boolean":"b"},Bs="_table";function Rs(t,i,e,s,n){for(var h,r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},a=0;a!=t.length;++a)for(
var u=0;u!=t[a].length;++u){o.s.r>a&&(o.s.r=a),o.s.c>u&&(o.s.c=u),o.e.r<a&&(o.e.r=a),o.e.c<u&&(o.e.c=u);var c={v:t[a][u]};if(null!==c.v){var f=XLSX.utils.encode_cell({c:u,r:a}),l=c.v.toString(),d="="===l.charAt(0);if((n.docHeader?2:0)+i[0].header.length<=a&&!d){var v=i[u];v.type&&(c.t=Hs[v.type]||""),v.format&&(c.z=v.format)}if(c.v instanceof Date?(c.t=c.t||"n",c.z=c.z||XLSX.SSF[Bs][14],c.v=(h=c.v,Math.round(25569+h/864e5))):c.t||("boolean"==typeof c.v?c.t="b":"number"==typeof c.v||parseFloat(c.v)==c.v?(c.v=1*c.v,c.t="n"):(c.v=l,d?(c.t="n",c.f=c.v,delete c.v):c.t="s")),s){var _=Ps(a,u,s);_.format&&(c.z=_.format,delete _.format),c.s=_}r[f]=c}}return o.s.c<1e7&&(r["!ref"]=XLSX.utils.encode_range(o)),r["!rows"]=function p(t){for(var i in t)t[i]={hpx:t[i],hpt:.75*t[i]};return t}(i.heights),r["!cols"]=function m(t){for(var i=[],e=0;e<t.length;e++)i.push({wch:t[e].width});return i}(i),e.length&&(r["!merges"]=e),r}function Ps(t,i,e){return e[t]&&e[t][i]?e[t][i]:""}function js(t,i){var e=t.getColumnConfig,s=t.sl,n=[];if(e){if(!1!==i.header&&(n=Es(t,i,"header",n)),s){var h=i.xCorrection||0,r=i.yCorrection||0;for(var o in s){var a=s[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=Es(t,i,"footer",n))}return n}function Es(t,i,e,s){for(var n=t.config.columns,h=(i.docHeader?2:0)+("header"==e?0:(!1!==i.header?t.el.length:0)+t.count()),r=0;r<n.length;r++)for(var o=n[r][e],a=0;a<o.length;a++)o[a]&&(o[a].colspan||o[a].rowspan)&&s.push({s:{c:r,r:a+h},e:{c:r+(o[a].colspan||1)-1,r:a+(o[a].rowspan||1)-1+h}});return s}function Ns(t,i){-1!=t.type.indexOf("confirm")&&!1===i?t.rl.reject():t.rl.resolve(i);var e=t.callback;e&&e(i,t.details),Ks.hide(t.id)}function Ls(t){var i=Ks.order.length;if(0<i&&Zs.keyboard){var e=(t=t||Lt).which||Lt.keyCode,s=Ks.pull[Ks.order[i-1]];return 13!=e&&32!=e||Ns(s,!0),27==e&&Ns(s,!1),t.preventDefault&&t.preventDefault(),!(t.cancelBubble=!0)}}function Os(t,i){var e,s=i||document.body;if(x(s.modality)){if((e=Y("DIV",{"class":"webix_modal_cover",style:"position:"+(i?"absolute":"fixed")+";"})).onkeydown=Ls,i){var n=window.getComputedStyle(i).position;"fixed"!=n&&"absolute"!=n&&"sticky"!=n&&"relative"!=n&&(s.style.position="relative")}s.appendChild(e),s.modality=1}else t?s.modality++:s.modality--;if(t&&1===s.modality||0===s.modality)if(e)e.style.display="inline-block";else{e=s.querySelectorAll(".webix_modal_cover");for(var h=0;h<e.length;h++)if(e[h].parentNode==s){e[h].style.display=1==s.modality?"inline-block":"none";break}}}function Us(t,i,e){return"<div role='button' tabindex='0' aria-label='"+t+"' class='webix_popup_button"+(e?" "+e:"")+"' result='"+i+"' ><div>"+t+"</div></div>"}function Ys(t,i,e){var s=t.tagName?t:function a(s,t,i){var e=document.createElement("DIV"),n=s.css?" "+s.css:"";e.className="webix_modal_box webix_"+s.type+n,e.setAttribute("webixbox",1),e.setAttribute("role","alertdialog"),e.setAttribute("aria-label",s.title||""),e.setAttribute("tabindex","0");var h="";if(s.width&&(e.style.width=s.width+(ve.isNumber(s.width)?"px":"")),s.height&&(e.style.height=s.height+(ve.isNumber(s.height)?"px":"")),s.title&&(h+='<div class="webix_popup_title">'+s.title+"</div>"),h+='<div class="webix_popup_text"><span>'+(s.content?"":s.text)+'</span></div><div  class="webix_popup_controls">',i&&(h+=Us(s.cancel||ct.message.cancel,!1)),t&&(h+=Us(s.ok||ct.message.ok,!0,"confirm")),s.buttons&&!t&&!i)for(var r=0;r<s.buttons.length;r++)h+=Us(s.buttons[r],r);if(h+="</div>",e.innerHTML=h,s.content){var o=s.content;"string"==typeof o&&(o=document.getElementById(o)),"none"==o.style.display&&(o.style.display=""),e.childNodes[s.title?1:0].appendChild(o)}return e.onclick=function(t){var i=(t=t||Lt).target||t.srcElement;if(i.className||(i=i.parentNode),-1!=i.className.indexOf("webix_popup_button")){var e=i.getAttribute("result");Ns(s,e="true"==e||"false"!=e&&e)}t.cancelBubble=!0},s.ol=e}(t,i,e),n=t.container?t.container.offsetWidth:window.innerWidth||document.documentElement.offsetWidth,
h=t.container?t.container.offsetHeight:window.innerHeight||document.documentElement.offsetHeight;t.container&&(s.style.position="absolute"),D((t.container||document.body).appendChild(s)),Os(!0,t.container);var r=t.left||Math.abs(Math.floor((n-s.offsetWidth)/2)),o=t.top||Math.abs(Math.floor((h-s.offsetHeight)/2));return"top"==t.position?s.style.top="-3px":s.style.top=o+"px",s.style.left=r+"px",s.onkeydown=Ls,s.focus(),t.id?Ks.pull[t.id]&&Ks.hide(t.id):t.id=pi("modalbox"),Ks.order.push(t.id),(Ks.pull[t.id]=t).rl=mt.defer(),t.rl}function Ws(t){return Ys(t,!0)}function Gs(t){return Ys(t,!0,!0)}function Xs(t){return Ys(t)}function qs(t,i,e){return"object"!=k(t)&&("function"==typeof i&&(e=i,i=""),t={text:t,type:i,callback:e}),t}function Js(){var t=qs.apply(this,arguments);return t.type=t.type||"confirm",Gs(t)}function Ks(){var t=qs.apply(this,arguments);return t.type=t.type||"alert",Xs(t)}function Zs(t,i,e,s){switch((t=function n(t,i,e,s){return"object"!=k(t)&&(t={text:t,type:i,expire:e,id:s}),t.id=t.id||pi("message"),t.expire=t.expire||Qs.expire,t}.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return Ws(t);case"confirm":return Gs(t);case"modalbox":return Xs(t);default:return function h(t){Qs.area||(Qs.area=document.createElement("DIV"),Qs.area.className="webix_message_area",Qs.area.style[Qs.position]="5px",document.body.appendChild(Qs.area)),Qs.area.setAttribute("role","alert"),Qs.area.setAttribute("aria-atomic",!0),Qs.hide(t.id);var i=document.createElement("DIV");return i.innerHTML="<div>"+t.text+"</div>",i.className="webix_message webix_"+t.type,i.onclick=function(){Qs.hide(t.id),t=null},"bottom"==Qs.position&&Qs.area.firstChild?Qs.area.insertBefore(i,Qs.area.firstChild):Qs.area.appendChild(i),0<t.expire&&(Qs.timers[t.id]=window.setTimeout(function(){Qs.hide(t.id)},t.expire)),i.style.height=i.offsetHeight-2+"px",Qs.pull[t.id]=i,i=null,t.id}(t)}}Lt(document,"keydown",Ls,{capture:!0}),Ks.pull={},Ks.order=[],Ks.hide=function(t){if(t&&Ks.pull[t]){var i=Ks.pull[t].ol;i&&(i.parentNode.removeChild(i),Ks.order.splice(Ks.order.indexOf(t),1),Os(!1,Ks.pull[t].container),delete Ks.pull[t])}},Ks.hideAll=function(){for(var t in Ks.pull)this.hide(t)};var Qs=Zs;Qs.expire=4e3,Qs.keyboard=!0,Qs.position="top",Qs.pull={},Qs.timers={},Qs.hideAll=function(){for(var t in Qs.pull)Qs.hide(t)},Qs.hide=function(t){var i=Qs.pull[t];i&&i.parentNode&&(window.setTimeout(function(){i.parentNode.removeChild(i),i=null},2e3),i.style.height=0,i.className+=" hidden",Qs.area.removeAttribute("role"),Qs.timers[t]&&window.clearTimeout(Qs.timers[t]),delete Qs.pull[t])},u("message",Zs),S.isIE8&&(Object.defineProperty=function(t,i,e){t[i]=e.value});var tn={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,e){if("function"==typeof h)return h;if(S.strict)return function(i){var s="",n=0;return h.replace(/%[a-zA-Z]/g,function(e,t){s+=h.slice(n,t);s+=function(t){if("%d"==e)return tn.toFixed(t.getDate());if("%m"==e)return tn.toFixed(t.getMonth()+1);if("%j"==e)return t.getDate();if("%n"==e)return t.getMonth()+1;if("%y"==e)return tn.toFixed(t.getFullYear()%100);if("%Y"==e)return t.getFullYear();if("%D"==e)return ct.calendar.dayShort[t.getDay()];if("%l"==e)return ct.calendar.dayFull[t.getDay()];if("%M"==e)return ct.calendar.monthShort[t.getMonth()];if("%F"==e)return ct.calendar.monthFull[t.getMonth()];if("%h"==e)return tn.toFixed((t.getHours()+11)%12+1);if("%g"==e)return(t.getHours()+11)%12+1;if("%G"==e)return t.getHours();if("%H"==e)return tn.toFixed(t.getHours());if("%i"==e)return tn.toFixed(t.getMinutes());if("%a"==e)return 11<t.getHours()?ct.pm[0]:ct.am[0];if("%A"==e)return 11<t.getHours()?ct.pm[1]:ct.am[1];if("%s"==e)return tn.toFixed(t.getSeconds())
;if("%S"==e)return tn.toFixed(t.getMilliseconds(),!0);if("%W"==e)return tn.toFixed(Date.getISOWeek(t));if("%c"!=e)return e;var i=t.getFullYear();return i+="-"+tn.toFixed(t.getMonth()+1),i+="-"+tn.toFixed(t.getDate()),i+="T",i+=tn.toFixed(t.getHours()),i+=":"+tn.toFixed(t.getMinutes()),i+=":"+tn.toFixed(t.getSeconds())}(i),n=t+2}),s+=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===e&&(i+="Z"),i;default:return t}}),!0===e&&(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,tn)}},strToDate:function(t,h){if("function"==typeof t)return t;var r,i,e,o=t.match(/%[a-zA-Z]/g),s="var temp=date.split(/[^0-9a-zA-Z]+/g);";if(!ct.calendar.monthShort_hash){for(e=ct.calendar.monthShort,i=ct.calendar.monthShort_hash={},r=0;r<e.length;r++)i[e[r]]=r;for(e=ct.calendar.monthFull,i=ct.calendar.monthFull_hash={},r=0;r<e.length;r++)i[e[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),e=[0,0,1,0,0,0,0];for(r=0;r<o.length;r++){var s=o[r];if("%y"==s)e[0]=1*i[r]+(30<i[r]?1900:2e3);else if("%Y"==s)e[0]=1*(i[r]||0),e[0]<30&&(e[0]+=2e3);else if("%n"==s||"%m"==s)e[1]=(i[r]||1)-1;else if("%M"==s)e[1]=ct.calendar.monthShort_hash[i[r]]||0;else if("%F"==s)e[1]=ct.calendar.monthFull_hash[i[r]]||0;else if("%j"==s||"%d"==s)e[2]=i[r]||1;else if("%g"==s||"%G"==s||"%h"==s||"%H"==s)e[3]=i[r]||0;else if("%a"==s)e[3]=e[3]%12+((i[r]||"")==ct.am[0]?0:12);else if("%A"==s)e[3]=e[3]%12+((i[r]||"")==ct.am[1]?0:12);else if("%i"==s)e[4]=i[r]||0;else if("%s"==s)e[5]=i[r]||0;else if("%S"==s)e[6]=i[r]||0;else if("%c"==s){var n=/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(\+.*|)/g.exec(t);e[0]=1*(n[1]||0),e[0]<30&&(e[0]+=2e3),e[1]=(n[2]||1)-1,e[2]=n[3]||1,e[3]=n[4]||0,e[4]=n[5]||0,e[5]=n[6]||0}}return h?new Date(Date.UTC(e[0],e[1],e[2],e[3],e[4],e[5],e[6])):new Date(e[0],e[1],e[2],e[3],e[4],e[5],e[6])};for(r=0;r<o.length;r++)switch(o[r]){case"%j":case"%d":s+="set[2]=temp["+r+"]||1;";break;case"%n":case"%m":s+="set[1]=(temp["+r+"]||1)-1;";break;case"%y":s+="set[0]=temp["+r+"]*1+(temp["+r+"]>30?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":s+="set[3]=temp["+r+"]||0;";break;case"%i":s+="set[4]=temp["+r+"]||0;";break;case"%Y":s+="set[0]=(temp["+r+"]||0)*1; if (set[0]<30) set[0]+=2000;";break;case"%a":s+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[0]?0:12);";break;case"%A":s+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[1]?0:12);";break;case"%s":s+="set[5]=temp["+r+"]||0;";break;case"%S":s+="set[6]=temp["+r+"]||0;";break;case"%M":s+="set[1]=i18n.calendar.monthShort_hash[temp["+r+"]]||0;";break;case"%F":
s+="set[1]=i18n.calendar.monthFull_hash[temp["+r+"]]||0;";break;case"%c":s+="var res = date.split('T');",s+="if(res[0]){ var d = res[0].split('-');",s+="set[0]= (d[0]||0)*1; if (set[0]<30) set[0]+=2000;",s+="set[1]= (d[1]||1)-1;",s+="set[2]= d[2]||1;}",s+="if(res[1]){ var t = res[1].split(':');",s+="set[3]= t[0]||0;",s+="set[4]= t[1]||0;",s+="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]; "+s+" 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 e=new Date(t.valueOf());e.setDate(t.getDate()+(4-i));var s=e.getFullYear(),n=Math.floor((e.getTime()-new Date(s,0,1).getTime())/864e5);return 1+Math.floor(n/7)},getUTCISOWeek:function(t){return this.getISOWeek(t)},al:function(t,i,e,s){if(e){var n=s(t,i);if(n)for(var h=0<e?1:-1;n;)t.setHours(t.getHours()+h),n=s(t,i),h+=0<e?1:-1}},add:function(t,i,e,s){s&&(t=this.copy(t));var n=tn.copy(t);switch(e){case"day":t.setDate(t.getDate()+i),this.al(t,n,i,function(t,i){return tn.datePart(i,!0).valueOf()==tn.datePart(t,!0).valueOf()});break;case"week":t.setDate(t.getDate()+7*i),this.al(t,n,7*i,function(t,i){return tn.datePart(i,!0).valueOf()==tn.datePart(t,!0).valueOf()});break;case"month":t.setMonth(t.getMonth()+i),this.al(t,n,i,function(t,i){return i.getMonth()==t.getMonth()&&i.getYear()==t.getYear()});break;case"year":t.setYear(t.getFullYear()+i),this.al(t,n,i,function(t,i){return i.getFullYear()==t.getFullYear()});break;case"hour":t.setHours(t.getHours()+i),this.al(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:tn.add[e](t,i,e)}return t},datePart:function(t,i){i&&(t=this.copy(t));var e=this.copy(t);return e.setHours(0),e.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"}},en={getConfig:function(t){var i={decimalSize:0,groupSize:999,prefix:"",sufix:""},e=t.split(/[0-9].*[0-9]/g);e[0].length&&(i.prefix=e[0]),e[1].length&&(i.sufix=e[1]),(i.prefix||i.sufix)&&(t=t.substr(i.prefix.length,t.length-i.prefix.length-i.sufix.length));var s=t.indexOf("1");0<s&&(i.prefix=t.substr(0,s),t=t.substr(s));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 e="";if(i.decimalDelimiter){var s=t.indexOf(i.decimalDelimiter);-1<s&&(e=(e=t.substr(s+1).replace(/[^0-9]/g,"")).substr(0,Math.min(e.length,i.decimalSize)),t=t.substr(0,s))}var n="-"===t[0]?-1:1;return(t=t.replace(/[^0-9]/g,""))||(t="0"),e&&(t+="."+e),parseFloat(t)*n},format:function(t,i){if(""===t||void 0===t)return t;i=i||ct;var e=(t=parseFloat(t))<0?"-":"";t=Math.abs(t),i.decimalOptional||(t=t.toFixed(i.decimalSize));var s=t.toString();s=s.split(".");var n="";if(i.groupSize){var h=i.groupSize,r=s[0].length;do{n=(0<(r-=h)?s[0].substr(r,h):s[0].substr(0,h+r))+(n?i.groupDelimiter+n:"")}while(0<r)}else n=s[0];return s=i.decimalSize?e+n+(s[1]?i.decimalDelimiter+s[1]:""):e+n,i.prefix||i.sufix?i.prefix+s+i.sufix:s},numToStr:function(i){return function(t){return en.format(t,i)}}};var sn=["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 e in i
)"object"!=k(i[e])||b(i[e])?t[e]=i[e]:(t[e]||(t[e]={}),r(t[e],i[e]))}(ct,t));for(var i=0;i<sn.length;i++){var e=sn[i],s=ct[e+"UTC"];ct[e+"Str"]=tn.dateToStr(ct[e],s),ct[e+"Date"]=tn.strToDate(ct[e],s)}var n=It(ct.price),h=ct.priceSettings||ct;ct.intFormat=en.numToStr({groupSize:ct.groupSize,groupDelimiter:ct.groupDelimiter,decimalSize:0}),ct.priceFormat=function(t){return n(en.format(t,h))},ct.numberFormat=en.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",enterPassword:"Enter password",passwordError:"Wrong password"},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 nn={track:function(t,i){if(this.ul(t,i),this.cl&&Pt(this.fl).detachEvent(this.cl),t){var e=Pt(this.fl=t),s=function(){nn.ll||e.getValue&&nn.push(t,e.getValue())};e.getActiveId?this.cl=e.attachEvent("onViewChange",s):this.cl=e.attachEvent("onChange",s)}},dl:function(t,i){nn.ll=1,(t=Pt(t)).callEvent("onBeforeHistoryNav",[i])&&t.setValue&&t.setValue(i),nn.ll=0},push:function(t,i,e){t=Pt(t);var s="";i&&(s="#!/"+i),x(e)&&(e=t.getValue?t.getValue():i),window.history.pushState({webix:!0,id:t.J.id,value:e},"",s)},ul:function(t,i){Lt(window,"popstate",function(t){t.state&&t.state.webix&&nn.dl(t.state.id,t.state.value)});var e=window.location.hash;M.noanimate=!0,e&&0===e.indexOf("#!/")?nn.dl(t,e.replace("#!/","")):i&&(nn.push(t,i),nn.dl(t,i)),M.noanimate=!1,this.ul=function(){}}},hn={namespace:"x",attribute:"data-",dataTag:"li",vl:/-([a-z])/g,_l:function(t){return t[1].toUpperCase()},pl:{width:!0,height:!0,gravity:!0,margin:!0,padding:!0,paddingX:!0,paddingY:!0,minWidth:!0,maxWidth:!0,minHeight:!0,maxHeight:!0,headerRowHeight:!0},ml:{disabled:!0,hidden:!0},bl:function(t,i){return Bt(t,i)},init:function(t,i,e){t=t||document.body;for(var s=[],n=this.gl(t),h=n.html,r=null,o=n.length-1;0<=o;o--)s[o]=n[o];for(var a=0;a<s.length;a++){var u;(u=this.wl(s[a],h)).$scope=e,r=this.xl(u,s[a],h,i)}return r},parse:function(t,i){"string"==typeof t&&(t=hi[i||"xml"].toObject(t,t));var e=this.gl(t,i);return this.wl(e[0],e.html)},xl:function(t,i,e,s){return s?t.container=s:(t.container=i.parentNode,
G(i)),this.bl(t.view,"setPosition")&&delete t.container,zt(t)},gl:function(t){this.yl=this.namespace?this.namespace+":":"",this.Ml=this.yl+"ui";var i=t.getElementsByTagName(this.Ml);return!i.length&&t.documentElement&&t.documentElement.tagName==this.Ml&&(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.Sl(t)).html=!0),i},Sl:function(t){if(t.getAttribute&&t.getAttribute(this.attribute+"view"))return[t];for(var i=t.querySelectorAll("["+this.attribute+"view]"),e=[],s=0;s<i.length;s++)i[s].parentNode.getAttribute(this.attribute+"view")||e.push(i[s]);return e},wl:function(t,i,e){var s=!1;if(!e){var n=this.kl(t,i);if("ui"==n)for(var h=t.childNodes,r=0;r<h.length;r++)if(1==h[r].nodeType)return this.wl(h[r],i);e={view:n},i&&"table"==t.tagName.toLowerCase()&&(e.data=t,e.datatype="htmltable",s=!0)}for(var o="cols"==e.view||"rows"==e.view||this.bl(e.view,"addView"),a=[],u=0,c=!(i||t.style),f=t.firstChild;f;){if(1==f.nodeType){var l=this.kl(f,i);if("data"==l){u=1;var d=f;f=f.nextSibling,e.data=this.Cl(d,i);continue}if("config"==l){this.$l(f,e,i);var v=f;f=f.nextSibling,G(v);continue}if("column"==l){u=1;var _=this.Dl(f,i);_.header=_.header||_.value,_.width=1*_.width||"",e.columns=e.columns||[],e.columns.push(_)}else if(l||o&&i){var p=this.wl(f,i,{view:l});"head"==p.view?e.head=p.rows?p.rows[0]:p.template:"body"==p.view?this.bl(e.view,"addView")?a.push({body:p.rows?p.rows[0]:p.value,header:p.header||""}):e.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.vl,this._l)),e[m]=hi.xml.tagToObject(f)}}f=f.nextSibling}if(this.Al(t,e,i),a.length)e.stack?e[e.stack]=a:e.subui?e[e.subui]=a[0]:this.bl(e.view,"setValues")?e.elements=a:"rows"==e.view?(e.view="layout",e.rows=a):"cols"==e.view?(e.view="layout",e.cols=a):this.bl(e.view,"setValue")?e.cells=a:this.bl(e.view,"getBody")?e.body=1==a.length?a[0]:{rows:a}:e.rows=a;else if(!s&&!u)if(!i||e.template||e.view&&"template"!=e.view){var b=this.Il(t,i);if(b){var g="template";this.bl(e.view,"setValue")&&(g="value"),e[g]=e[g]||b}}else e.view="template",e.content=t;return e},Tl:function(t){return!(0<t.replace(/\s+/gm,"").length)},Fl:{body:1,head:1,data:1,rows:1,cols:1,cells:1,elements:1,ui:1,column:1,config:1},$l:function(t,i,e){var s=this.Al(t,{});s.name?delete(i[s.name]=s).name:s.stack?i[s.stack]=[]:i=s;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.$l(n[h],s,e):1==n[h].nodeType&&"data"==n[h].tagName.toLowerCase()?(r=this.Cl(n[h],e),s.stack||(s.data=r)):r=n[h].innerHTML,s.stack&&r&&i[s.stack].push(r)}return i},kl:function(t,i){if(i)return t.getAttribute(this.attribute+"view")||("config"==t.tagName.toLowerCase()?"config":null);var e=t.tagName.toLowerCase();if(this.namespace){if(0===e.indexOf(this.yl)||t.scopeName==this.namespace)return e.replace(this.yl,"")}else if(zt[e]||this.Fl[e])return e;return 0},Cl:function(t,i){for(var e=[],s=t.getElementsByTagName(hn.dataTag),n=0;n<s.length;n++){var h=s[n];if(h.parentNode.parentNode.tagName!=hn.dataTag){var r=this.Dl(h,i);h.className&&(r.$css=h.className),e.push(r)}}return G(t),e},Il:function(t){return t.style?t.innerHTML:t.firstChild&&(t.firstChild.wholeText||t.firstChild.data)||""},Dl:function(t,i){if(!i)return hi.xml.tagToObject(t);var e=this.Al(t,{},i);return!e.value&&t.childNodes.length&&(e.value=this.Il(t,i)),e},Al:function(t,i,e){for(var s=t.attributes,n=0;n<s.length;n++){var h=s[n].name;if(e){if(0!==h.indexOf(this.attribute))continue;h=h.replace(this.attribute,"").replace(this.vl,this._l)}var r=s[n].value;-1!=r.indexOf("json://")&&(r=JSON.parse(r.replace("json://",""))),this.pl[h]?r=parseInt(r,10):this.ml[h]&&(r=r&&"false"!==r&&"0"!=r),i[h]=r}return i}};S.printPPI=96,S.printMargin=.75*S.printPPI;var rn=S.printMargin,on={a4:"A4",a3:"A3",letter:"letter"},an={page:!0,data:!0},un={portrait:!0,landscape:!0},cn={A3:{width:11.7,height:16.5},A4:{
width:8.27,height:11.7},letter:{width:8.5,height:11}};function fn(t,i){var e=Y("div",{"class":"webix_view webix_print_"+t.toLowerCase(),style:"height:0px;visibility:hidden;"},i["doc"+t]);"Header"===t?X(e,document.body.firstChild):document.body.appendChild(e),i["doc"+t]=e}var ln={phone:{mask:"+# (###) ###-####",allow:/[0-9]/g},card:{mask:"#### #### #### ####",allow:/[0-9]/g},date:{mask:"####-##-## ##:##",allow:/[0-9]/g}},dn={denySelect:j,allowSelect:E,index:N,createCss:L,addStyle:O,removeStyle:U,create:Y,getValue:W,remove:G,insertBefore:X,locate:q,offset:J,posRelative:K,pos:Z,preventEvent:Q,stopEvent:tt,triggerEvent:it,addCss:et,removeCss:st,getTextSize:nt,download:ht,zl:rt,setSelectionRange:ot,getSelectionRange:at,addMeta:ut},vn={};function _n(t,i,e,s){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&&(s=e,e=i,i={}),i||(i={}),i.jsonp=h,window[h]=function(){e&&e.apply(s||window,arguments),n.resolve(arguments[0]),window.clearTimeout(vn[h]),delete vn[h],r.parentNode.removeChild(r),e=o=s=r=null,delete window[h]},vn[h]=window.setTimeout(function(){n.reject(),delete window[h]},_n.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}_n.timer=3e3;var pn="__webix_remote_error";function mn(t,i){this.Vl={},this.Hl=[],this.Bl=t,this.su="",i?this.Rl(i):this.Pl=wt(t).then(function(t){return t.text()}).then(C(function(t){return t=t.split("/*api*/")[1],this.Rl(JSON.parse(t)),this.Vl},this))}function bn(t,i){var e=new mn(t,i).jl();for(var s in e)gn[s]=e[s];return e}mn.prototype={Rl:function(t){if(t.$key&&(this.su=t.$key),t.$vars)for(var i in t.$vars)this.Vl[i]=t.$vars[i];this.jt(t,this.Vl,"")},jt:function(t,i,e){for(var s in t)if("$key"!==s&&"$vars"!==s){var n=t[s];if("object"==k(n)){var h=i[s]={};this.jt(n,h,e+s+".")}else i[s]=this.El(this,e+s)}},Nl:function(t,i){var e=this.Ll(this,t,i);return this.Hl.push(e),this.Ol(),e},Ol:function(){this.Ul||(this.Ul=setTimeout(C(this.Yl,this),1))},Yl:function(){for(var t=[],h=this.Hl,i=0;i<this.Hl.length;i++){var e=this.Hl[i];e.$sync?(h.splice(i,1),i--):t.push({name:e.$name,args:e.$args})}if(h.length){var s=wt(),n=this.Wl(t);I("onBeforeRemoteCall",[s,n,{}]);var r=s.post(this.Bl,n).then(function(t){for(var i=t.json().data,e=0;e<i.length;e++){var s=i[e],n=i[e]&&i[e][pn];n?(I("onRemoteError",[n]),h[e].reject(n)):h[e].resolve(s)}},function(t){for(var i=0;i<h.length;i++)h[i].reject(t);throw t});I("onAfterRemoteCall",[r])}this.Hl=[],this.Ul=null},Y:function(){var t=null;this.$sync=!0;var i=[{name:this.$name,args:this.$args}];try{var e=wt(),s=this.$context.Wl(i);I("onBeforeRemoteCall",[e,s,{sync:!0}]);var n=e.sync().post(this.$context.Bl,s);I("onAfterRemoteCall",[null]),(t=JSON.parse(n.responseText).data[0])[pn]&&(t=null)}catch(Vo){}return t},Ll:function(t,i,e){var s=mt.defer();return s.sync=t.Y,s.$name=i,s.$args=e,s.$context=this,s},El:function(t,i){return function(){return t.Nl(i,[].slice.call(arguments))}},jl:function(){return this.Pl||this.Vl},Wl:function(t){return{key:this.su,payload:t}}};var gn=function(t,i){if("object"!==k(t))return bn(t,i);var e=document.getElementsByTagName("script");return i=t,bn(t=e[e.length-1].src,i)};function wn(){var t=!!(window.orientation%180);M.orientation!==t&&(M.orientation=t,I("onRotate",[t]))}S.touch&&(M.orientation=!!((x(window.orientation)?90:window.orientation)%180),Lt(window,"onorientationchange"in window?"orientationchange":"resize",wn));var xn={textWaitDelay:500,summColumn:{getValue:function(t){return t.firstChild.innerHTML},setValue:function(){},refresh:function(t,i,e){var s=0;t.mapCells(null,e.columnId,null,1,function(t){t*=1,isNaN(t)||(s+=t)},!0),e.format&&(s=e.format(s)),e.template&&(s=e.template({value:s})),i.firstChild.innerHTML=s},trackCells:!0,render:function(t,i){return i.template&&(i.template=It(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(e,t,s){t.onclick=function(){this.getElementsByTagName("input")[0].checked=s.checked=!s.checked;var t=e.getColumnConfig(s.columnId),i=s.checked?t.checkValue:t.uncheckValue;e.data.each(function(t){t[s.columnId]=i,e.callEvent("onCheck",[t.id,s.columnId,i]),this.callEvent("onStoreUpdated",[t.id,t,"save"])}),e.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,e){i.component=t.J.id,t.registerFilter(i,e,this),i.Gl=t.J.id,e.value&&this.getValue(i)!=e.value&&this.setValue(i,e.value),i.onclick=Q,Nt(i,"keydown",this.Xl)},render:function(t,i){return this.init&&this.init(i),i.css="webix_ss_filter","<input "+(i.placeholder?'placeholder="'+i.placeholder+'" ':"")+"type='text'>"},Xl:function(t){var i=this.Gl;9!=(t.which||t.keyCode)&&(this.ql&&window.clearTimeout(this.ql),this.ql=window.setTimeout(function(){var t=Pt(i);t&&t.filterByAll()},xn.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,e,s){var t;s.compare=s.compare||function(t,i){return t==i},e.component=i.J.id,i.registerFilter(e,s,this);var n=s.options;n?"string"==typeof n?(t=s.options=[],wt(n).then(C(function(t){s.options=t.json(),this.refresh(i,e,s)},this))):t=n:(t=i.collectValues(s.columnId,s.collect)).unshift({id:"",value:""});var h=Pt(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)}e.firstChild.innerHTML="",e.firstChild.appendChild(r),s.value&&this.setValue(e,s.value),e.onclick=Q,r.Gl=i.J.id,Nt(r,"change",this.Jl)},render:function(t,i){return this.init&&this.init(i),i.css="webix_ss_filter",""},Jl:function(){Pt(this.Gl).filterByAll()}}};xn.serverFilter=H.extend({$server:!0,Xl:function(t){var i=this.Gl,e=t.which||t.keyCode;9==e||33<=e&&e<=40||(this.ql&&window.clearTimeout(this.ql),this.ql=window.setTimeout(function(){Pt(i).filterByAll()},xn.textWaitDelay))}},xn.textFilter),xn.serverSelectFilter=H.extend({$server:!0,Jl:function(){Pt(this.Gl).filterByAll()}},xn.selectFilter),xn.numberFilter=H.extend({init:function(h){h.prepare=function(t){var e,s=this,i=-1!=t.indexOf("="),n=this.format(t);return""===n?"":(-1!=t.indexOf(">")?e=this.Kl:-1!=t.indexOf("<")&&(e=this.Zl),h.compare=e&&i?function(t,i){return s.Ql(t,i)||e(t,i)}:e||this.Ql,n)}},format:function(t){return t.replace(/[^\-.0-9]/g,"")},Kl:function(t,i){return i<1*t},Zl:function(t,i){return""!==t&&1*t<i},Ql:function(t,i){return""!==t&&1*t==i}},xn.textFilter),xn.dateFilter=H.extend({format:function(t){if(""===t)return"";var i=new Date;if(-1!=t.indexOf("today"))i=tn.dayStart(i);else if(-1==t.indexOf("now")){var e=t.match(/[0-9]+/g);if(!e||!e.length)return"";i=e.length<3?(e.reverse(),new Date(e[0],(e[1]||1)-1,1)):ct.dateFormatDate(t.replace(/^[>< =]+/,""))}return i.valueOf()}},xn.numberFilter);var yn={name:"baselayout",restore:function(t,i,e){var s=this.ed(B(t),i);if(e)return s;zt(s.cols||s.rows,this)},ed:function(t,i){if(!t.$layout)return i.call(this,t);for(var e=t.cols||t.rows,s=0;s<e.length;s++)e[s]=this.ed(e[s],i);return t},serialize:function(t){for(var i=[],e=this.getChildViews(),s=0;s<e.length;s++){var n=e[s];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.sd),this.mt=this.Yi,this.nd=[],this.hd=[],this.Na={top:0,left:0,right:0,bottom:0},t.$topView&&(t.borderless=!0,t.Z={top:!0,left:!0,
bottom:!0,right:!0}),t.isolate&&H.extend(this,He)},rows_setter:function(t){return this.rd=1,this.od=t,!0},cols_setter:function(t){return this.rd=0,this.$view.style.whiteSpace="nowrap",this.od=t,!0},et:function(t){A.removeAt.call(this.Vi,A.find.call(this.Vi,t)),this.resizeChildren(!0)},it:function(t,i){if(x(i)){for(var e=0;e<this.Vi.length;e++)this.Vi[e].destructor();this.od=t,this.sd()}else{var s;if("number"==typeof i){(i<0||i>this.Vi.length)&&(i=this.Vi.length);var n=(this.Vi[i]||{}).st;A.insertAt.call(this.Vi,t,i),t.J.hidden||X(t.st,n,this.mt)}else{s=Pt(i),i=A.find.call(this.Vi,s);var h=s.st.parentNode;h&&!t.J.hidden&&h.insertBefore(t.st,s.st),s.destructor(),this.Vi[i]=t}this.rd||this.Ra(t)}this.resizeChildren(!0);var r=this.elements?this:this.getFormView();r&&r.ad(),I("onReconstruct",[this])},Ra:function(t){t.st.style.display="inline-block",t.st.style.verticalAlign="top"},addView:function(t,i){x(i)&&(i=this.Vi.length);var e=this.$$?this:this.getTopParentView();M._=this;var s=e&&e.ui?e.ui(t,this,i):zt(t,this,i);return M._=null,s.J.id},removeView:function(t){var i;i="object"!=k(t)?Pt(t)||(this.$$?this.$$(t):null):t;var e=A.find.call(this.Vi,i);if(0<=e){this.ud&&this.ud(e,i);var s=this.elements?this:this.getFormView();this.Vi.splice(e,1),s&&zt.each(i,function(t){t.name&&delete s.getCleanValues()[t.config.name]},s,!0),i.destructor(),this.resizeChildren(!0),s&&s.ad()}I("onReconstruct",[this])},reconstruct:function(){this.cd=0,this.it(this.od)},Bi:function(t,i,e){t.J.hidden||(t.J.hidden=!0,G(t.st),this.cd++,e||M.w||this.resizeChildren(!0))},fd:function(t){t.callEvent&&t.callEvent("onViewShow",[])},resizeChildren:function(){if(!M.l&&this.nd){var t=this.getParentView();if(t)return t.resizeChildren?t.resizeChildren():t.resize();var i,e,s,n,h=this.$getSize(0,0);if(s=i=this.nd[0]||0,n=e=this.nd[1]||0,(1e5<=h[1]||1e5<=h[3])&&this.st.parentNode&&(s=i=Math.max(h[0],this.J.width||this.st.parentNode.offsetWidth||i||0),n=e=Math.max(h[2],this.J.height||this.st.parentNode.offsetHeight||e||0)),t)this.La(i,e);else{h[0]>i&&(s=h[0]),h[2]>e&&(n=h[2]);var r=this.st.parentNode==document.body&&!this.setPosition;!r&&i>h[1]&&(s=h[1]),!r&&e>h[3]&&(n=h[3]),this.$setSize(s,n)}M.o&&(M.o=!1,this.resizeChildren()),I("onResize",[])}},getChildViews:function(){return this.Vi},index:function(t){t.J&&(t=t.J.id);for(var i=0;i<this.Vi.length;i++)if(this.Vi[i].J.id==t)return i;return-1},ye:function(t,i,e){if(t.J.hidden){t.J.hidden=!1;for(var s=this.index(t)+1;this.Vi[s]&&this.Vi[s].J.hidden;)s++;var n=this.Vi[s]?this.Vi[s].st:null;X(t.st,n,this.mt||this.st),this.cd--,e||(this.resizeChildren(!0),t.refresh&&t.refresh()),t.callEvent&&(t.callEvent("onViewShow",[]),zt.each(t,this.fd))}},showBatch:function(t,i){var e=void 0!==i;if(i=!1!==i,e)this.J.visibleBatch="";else{if(this.J.visibleBatch==t)return;this.J.visibleBatch=t}for(var s=[],n=0;n<this.Vi.length;n++)this.Vi[n].J.batch||this.Vi[n].J.hidden?this.Vi[n].J.batch==t?i?s.push(this.Vi[n]):this.Bi(this.Vi[n],null,!0):e||this.Bi(this.Vi[n],null,!0):s.push(this.Vi[n]);for(var h=0;h<s.length;h++)this.ye(s[h],null,!0),s[h].Me();this.resizeChildren(!0)},sd:function(t){this.Vi=[],this.name;for(var i=0;i<t.length;i++)M._=this,t[i].Z||(t[i].borderless=!0),this.Vi[i]=zt.rt(t[i],this),this.rd||this.Ra(this.Vi[i]),this.J.visibleBatch&&this.J.visibleBatch!=this.Vi[i].J.batch&&this.Vi[i].J.batch&&(this.Vi[i].J.hidden=!0,this.cd++),this.Vi[i].J.hidden||((this.mt||this.Yi).appendChild(this.Vi[i].st),this.Vi[i].$nospace&&this.cd++);this.ld&&this.ld(t)},dd:function(t,i,e){if(this.rd!=e)for(var s=0;s<this.Vi.length;s++)this.Vi[s].J[t]=i,this.Vi[s].dd&&this.Vi[s].dd(t,i,e)},$getSize:function(t,i){var e=0,s=1e5,n=1e5,h=0;this.rd?n=0:s=0;var r=0,o=0,a=0;this.Ea=[];for(var u=0;u<this.Vi.length;u++)if(!this.Vi[u].J.hidden){var c=this.Ea[u]=this.Vi[u].$getSize(0,0);this.Vi[u].$nospace?o++:this.rd?(c[0]>e&&(e=c[0]),c[1]<s&&(s=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]),e+=c[0],s+=c[1],c[0]==c[1]&&-1!=c[0]?(r+=c[0],o++):a+=c[4])}n<h&&(n=h),s<e&&(s=e),this.vd=[r,this.Vi.length-o,a],
this._d=[e+t,h+i];var f=ji.api.$getSize.call(this,0,0);return 1e5<=f[1]&&(f[1]=0),1e5<=f[3]&&(f[3]=0),f[0]=(f[0]||e)+t,f[1]=Math.max(f[0],(f[1]||s)+t),f[2]=(f[2]||h)+i,f[3]=Math.max(f[2],(f[3]||n)+i),!this.rd&&this.J.responsive&&(f[0]=0),f},$setSize:function(t,i){this.nd=[t,i],ji.api.$setSize.call(this,t,i),this.La(t,i)},pd:function(t,i,e){var s=i=t[i];if(i!=(e=t[e])){var n=this.md*t[4]/this.bd;if(n<i)s=i,this.bd-=t[4],this.md-=s;else{if(!(e<n))return-1;s=e,this.bd-=t[4],this.md-=s}}return s},gd:function(t,i){var e=Pt(i);"hide"!==e&&e?(e||(e=zt({view:"popup",body:[{}]})),t.wd=t.J.width,t.xd=t.J.height,t.yd=e.J.id,t.J.width=0,t.J.height||(t.J.autoheight=!0),zt(t,e,this.hd.length)):(t.hide(),t.yd="hide"),this.hd.push(t)},Md:function(t){var i=t.yd;if(t.yd=0,"hide"!==i&&i){t.J.width=t.wd,t.J.height=t.xd,delete t.J.autoheight;for(var e=0;this.Vi[e]&&!1===this.Vi[e].J.responsiveCell;)e++;zt(t,this,e)}else t.show();this.hd.pop()},Sd:function(t){if(M.u=!0,t+this.Na.left+this.Na.right+this.Oa*(this.Vi.length-1)<this._d[0])for(var i=this.Vi.length-1,e=0;e<i;e++){var s=this.Vi[e];if(!s.yd){if(!1!==s.J.responsiveCell){this.gd(s,this.J.responsive),I("onResponsiveHide",[s.J.id]),M.o=!0;break}i=this.Vi.length}}else if(this.hd.length){var n=this.hd[this.hd.length-1],h="hide"==n.yd?0:n.wd;n.$getSize(h,0)[0]+this._d[0]+this.Oa+20<=t&&(this.Md(n),I("onResponsiveShow",[n.J.id]),M.o=!0)}M.u=!1},La:function(t,i){M.h=(M.h||0)+1,!this.rd&&this.J.responsive&&this.Sd(t,i),this.md=(this.rd?i:t)-this.vd[0],this.bd=this.vd[2];for(var e=t,s=i,n=[],h=0;h<this.Vi.length;h++)if(!this.Vi[h].J.hidden&&this.Ea[h]){var r=this.Ea[h];if(this.rd){if((s=this.pd(r,2,3))<0){n.push(h);continue}}else if((e=this.pd(r,0,1))<0){n.push(h);continue}this.Vi[h].$setSize(e,s)}for(var o=0;o<n.length;o++){var a=n[o],u=this.Ea[a],c=Math.round(this.md*u[4]/this.bd);this.md-=c,this.bd-=u[4],this.rd?s=c:e=c,this.Vi[a].$setSize(e,s)}M.h-=1},kd:function(t,i){var e=this.index(t);return-1==e?null:this.Vi[e+i]},Cd:function(){return this.Vi[0]}},Mn={api:yn,view:H.protoUI(yn,g,ji.view)},Sn={name:"layout",$init:function(){this.cd=0},defaults:{type:"line"},sd:function(){this.$d&&(t=this.$d(t)),this.Dd||(this.st.className+=" webix_layout_"+(this.J.type||""),this.Dd=1),this.J.margin!==undefined&&(this.Oa=this.J.margin),this.J.padding!==undefined&&"object"!==k(this.J.padding)&&(this.Na.left=this.Na.right=this.Na.top=this.Na.bottom=this.J.padding),this.J.paddingX!==undefined&&(this.Na.left=this.Na.right=this.J.paddingX),this.J.paddingY!==undefined&&(this.Na.top=this.Na.bottom=this.J.paddingY),"object"===k(this.J.padding)&&H.extend(this.Na,this.J.padding,!0),(this.Na.left||this.Na.right||this.Na.top||this.Na.bottom)&&(this.Na.defined=!0),this.Ad()&&!this.J.borderless&&(this.Yi.style.borderWidth="1px",this.Id=!0);var t=this.od;this.J.borderless&&(this.J.Z={top:!0,left:!0,right:!0,bottom:!0}),this.Pa(t),Mn.api.sd.call(this,t),this.ja(t)},$getSize:function(t,i){t=t||0,i=i||0;var e=this.Oa*(this.Vi.length-this.cd-1);if(this.Id||this.Ad()){var s=this.J.Z;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1))}return this.J.height||(i+=this.Na.top+this.Na.bottom+(this.rd?e:0)),this.J.width||(t+=this.Na.left+this.Na.right+(this.rd?0:e)),Mn.api.$getSize.call(this,t,i)},$setSize:function(t,i){this.nd=[t,i],this.Ad()||this.Id?Li.api.$setSize.call(this,t,i):ji.api.$setSize.call(this,t,i),i=this.we,t=this.be,this.J.scroll&&(i=Math.max(i,this._d[1]),t=Math.max(t,this._d[0])),this.La(t,i)},La:function(t,i){var e=this.Oa*(this.Vi.length-this.cd-1);return i-=this.Na.top+this.Na.bottom,t-=this.Na.left+this.Na.right,this.rd?i-=e:t-=e,Mn.api.La.call(this,t,i)},resizeChildren:function(t){if(t){this.me=null;for(var i=[],e=0;e<this.Vi.length;e++){var s=this.Vi[e];i[e]=s.J;var n=s.nd&&!s.Id||s.J.borderless?"0px":"1px";s.st.style.borderTopWidth=s.st.style.borderBottomWidth=s.st.style.borderLeftWidth=s.st.style.borderRightWidth=n}this.Pa(i);for(var h=0;h<i.length;h++)i[h].borderless&&this.Vi[h].ke&&this.Vi[h].ke(i[h]);this.ja(this.Vi)}M.u||Mn.api.resizeChildren.call(this)},Ad:function(){
return this.Na.defined&&0<this.Oa&&!this.Td},Pa:function(t){if(!this.Ad()||this.J.borderless&&"space"!=this.J.type){for(var i=0;i<t.length;i++)t[i].Z=f(this.J.Z);var e=!1;this.Td&&(e=!0);var s=t.length;if(this.rd){for(var n=1;n<s-1;n++)t[n].Z.top=t[n].Z.bottom=e;if(1<s){for("head"!=this.J.type&&(t[0].Z.bottom=e);t[s-1].hidden&&1<s;)s--;0<s&&(t[s-1].Z.top=e)}}else{for(var h=1;h<s-1;h++)t[h].Z.left=t[h].Z.right=e;if(1<s){for("head"!=this.J.type&&(t[0].Z.right=e),t[s-1].Z.left=e;1<s&&t[s-1].hidden;)s--;0<s&&(t[s-1].Z.left=e)}}}else for(var r=0;r<t.length;r++)t[r].Z&&t[r].borderless||(t[r].Z={top:!1,left:!1,right:!1,bottom:!1})},Fd:function(t,i){i.top&&(t.borderTopWidth="0px"),i.left&&(t.borderLeftWidth="0px"),i.right&&(t.borderRightWidth="0px"),i.bottom&&(t.borderBottomWidth="0px")},ja:function(t){for(var i=0,e=0;e<t.length;e++){var s=this.Vi[e],n=s.J.Z;if(s.J.hidden&&this.Vi[e+1]){var h=this.Vi[e+1].J.Z;n.top||(h.top=!1),n.left||(h.left=!1),e==i&&i++}this.Fd(s.st.style,s.J.Z)}for(var r=this.rd?"marginLeft":"marginTop",o=this.rd?"marginTop":"marginLeft",a=this.rd?this.Na.left:this.Na.top,u=this.rd?this.Na.top:this.Na.left,c=0;c<t.length;c++)this.Vi[c].st.style[r]=a+"px";this.Vi.length&&(this.Vi[i].st.style[o]=u+"px");for(var f=i+1;f<t.length;f++)this.Vi[f].st.style[o]=this.Oa+"px"},type_setter:function(t){return this.Oa="undefined"!=typeof this.zd[t]?this.zd[t]:this.zd.line,this.Na.left=this.Na.right=this.Na.top=this.Na.bottom="undefined"!=typeof this.zd[t]?this.Vd[t]:this.Vd.line,this.Td="material"==t||"clean"==t,"material"==t&&(this.J.borderless=!0),t},$skin:function(){this.zd=Xi.layoutMargin,this.Vd=Xi.layoutPadding}},kn=H.protoUI(Sn,Mn.view),Cn={api:Sn,view:kn};kn.call(-1);var $n={name:"daterange",defaults:{button:!1,icons:!1,calendarCount:2,borderless:!1},$init:function(t){t.calendar=t.calendar||{},t.value=this.Hd(t.value),delete t.calendar.type,this.st.className+=" webix_daterange",this.Bd=this.Rd[t.calendar.type]||0;for(var i=[],e=Xi.calendar,s=e&&e.height?e.height:250,n=e&&e.width?e.width:250,h=H.extend({view:"calendar",width:n,height:s},t.calendar||{},!0),r=t.calendarCount=0===this.Bd&&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=tn.add(a,this.Pd[this.Bd]*u,"month",!0);H.extend(h,{events:C(this.jd,this),css:o+(1===r?"":0===u?"0":u+1==r?"N":"1"),timepicker:0===this.Bd&&t.timepicker,borderless:!0,date:c},!0),i.push(B(h))}t.rows=[{type:"clean",cols:i},this.Ed(t,n*r)],t.height=t.height||h.height+(t.icons||t.button?35:0),t.type="line",this.$ready.push(this.Nd),Lt(this.$view,"keydown",C(function(t){this.Se(t.which||t.keyCode,t)},this))},value_setter:function(t){return this.Hd(t)},getValue:function(){return this.J.value},setValue:function(t,i){t=this.Hd(t);var e=(this.J.value=t).start||t.end||new Date;if(!i){this.Ld[0].showCalendar(t.start);for(var s=1;s<this.Ld.length;s++)this.Ld[s].J.date=e,this.Od(this.Ld[s],1,s)}this.callEvent("onChange",[t]),this.refresh()},refresh:function(){for(var t=0;t<this.Ld.length;t++)if(this.Ld[t].Bd===this.Bd){st(this.Ld[t].$view,"webix_cal_timepicker"),st(this.Ld[t].$view,"webix_range_timepicker");var i=this.Ud(this.Ld[t].getVisibleDate());if(i.start||i.end){if(this.Ld[t].J.date=i.start||i.end,this.J.timepicker){var e="webix_"+(i.start&&i.end?"range":"cal")+"_timepicker";et(this.Ld[t].$view,e)}}else tn.datePart(this.Ld[t].J.date);this.Ld[t].refresh()}},addToRange:function(t){var i=this.Yd(this.Wd(t));this.setValue(i)},Gd:[{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.J.timepicker||(t=tn.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",[])}}}],Xd:function(t){if(t){t="object"==k(t)?t:this.Gd;for(var i={
css:"webix_cal_footer ",borderless:!0,height:30,template:"<div class='webix_cal_icons'>",onClick:{}},e=0;e<t.length;e++){if(t[e].template){var s="function"==typeof t[e].template?t[e].template:It(t[e].template);i.template+=s.call(this)}if(t[e].on_click)for(var n in t[e].on_click)i.onClick[n]=C(t[e].on_click[n],this)}return i.template+="</div>",i.width=nt(i.template).width+30,i}return{width:0}},Ed:function(t,i){var e={view:"button",value:ct.calendar.done,minWidth:100,maxWidth:230,align:"center",height:30,click:function(){this.getParentView().getParentView().hide()}},s=this.Xd(t.icons),n={css:"webix_range_footer",cols:[{width:s.width}]};return(t.button||t.icons)&&2*s.width+e.minWidth>i&&(n.cols[0].width=0),n.cols.push(t.button?e:{}),n.cols.push(s),n},Rd:{time:-1,month:1,year:2},Pd:{0:1,1:12,2:120},Hd:function(t){return t||(t={start:null,end:null}),t.start||t.end||(t={start:t}),t.end=this.Wd(t.end)||null,t.start=this.Wd(t.start)||null,(t.end&&t.end<t.start||!t.start)&&(t.end=[t.start,t.start=t.end][0]),t},Wd:function(t){return"string"==typeof t&&(t=ct.parseFormatDate(t)),isNaN(1*t)?null:t},jd:function(t,i){if(!i){var e=this.J.value,s=e.start?tn.datePart(tn.copy(e.start)):null,n=e.end?tn.datePart(tn.copy(e.end)):null,h=tn.datePart(t),r=tn.add(h,1,"day",!0),o=tn.add(h,-1,"day",!0),a="";return s<=h&&n&&h<=n&&(a="webix_cal_range",tn.equal(o,s)&&(a+=" webix_cal_range_first"),tn.equal(r,n)&&(a+=" webix_cal_range_last")),tn.equal(h,s)&&(a="webix_cal_range_start"),tn.equal(h,n)&&(a="webix_cal_range_end"),a+" "+(tn.isHoliday(t)+" "||"")}},Nd:function(){var t=this.Ld=this.getChildViews()[0].getChildViews(),e=this,i=this.config.id;this.qd={};for(var s=0;s<t.length;s++)t[s].config.master=i,t[this.qd[t[s].config.id]=s].attachEvent("onBeforeDateSelect",function(t){return e.Jd(this,t)}),t[s].attachEvent("onBeforeZoom",function(t){return e.Kd(this,t)}),0!==s&&s!==t.length-1||(t[s].attachEvent("onAfterMonthChange",C(this.Zd,this)),t[s].attachEvent("onAfterZoom",function(t,i){e.Qd(this,t,i)}));this.J.timepicker&&this.refresh()},Kd:function(t,i){var e=this.tv(t.config.id);if(0<=i&&0<e&&e!==this.Ld.length-1)return!1;if(-1===i){var s=this.Ud(t.getVisibleDate());s.start&&s.end&&(t.J.date=s[this.iv])}return!0},Zd:function(t,i){var e=i<t?1:-1,s=i<t?this.Ld[this.Ld.length-1]:this.Ld[0],n=s.sv[s.Bd].ev;this.nv(e,n,s),this.refresh()},Qd:function(t,i,e){var s=t.sv[t.Bd].ev,n=this.tv(t.config.id),h=0===n?1:-1;if(this.Ld[n+h]){var r=this.Ld[n+h].J.date;if(i<e&&0<=i){var o=0;if(1===i){var a=r.getFullYear();(this.Bd||-1===h&&11===r.getMonth()||1===h&&0===r.getMonth())&&(a-=h),o=t.J.date.getFullYear()-a}else if(0===i){var u=r.getMonth()-h;12!==u&&-1!=u||(u=-1===u?11:0),o=t.J.date.getMonth()-u}this.nv(o,s,t),this.refresh()}}},Od:function(t,i,e){t.blockEvent(),0<=t.Bd&&t.hv(i,e),t.unblockEvent()},tv:function(t){return this.qd[t]},nv:function(t,i,e){for(var s=0;s<this.Ld.length;s++){var n=this.Ld[s];e&&n.config.id===e.config.id||this.Od(n,t,i)}},Ud:function(t){var i=this.J.value,e={};return i.start&&i.start.getYear()===t.getYear()&&i.start.getMonth()===t.getMonth()&&(e.start=i.start),i.end&&i.end.getYear()===t.getYear()&&i.end.getMonth()===t.getMonth()&&(e.end=i.end),e},rv:function(t,i){t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds()),t.setMilliseconds(i.getMilliseconds())},Yd:function(t,i){var e=B(this.J.value);0===this.Bd||x(i)?e.start&&!e.end?e.end=t:(e.start=t,e.end=null):e[i?"end":"start"]=t;return e},Jd:function(t,i){if(this.callEvent("onBeforeDateSelect",[i])){var e=this.J.value;if(t.Bd<0){var s,n=B(this.Ud(i));(s=n.start&&n.end?n[this.iv]:n.start||n.end)&&this.rv(s,i),t.Bd=0,e=H.extend(B(e),n,!0)}else{var h=t.getVisibleDate(),r=this.tv(t.config.id);if(i.getMonth()!==h.getMonth()&&(0===r||r===this.Ld.length-1)){var o=h<i?1:-1;this.nv(o,1)}e=this.Yd(i,r)}t.Bd!==this.Bd&&t.showCalendar(i),this.setValue(e,!0),this.callEvent("onAfterDateSelect",[this.getValue()])}return!1}},Dn={api:$n,view:H.protoUI($n,Cn.view)};xn.richSelectFilter={getInputNode:function(t){return Pt(t.$webix)||null},getValue:function(t,i){
var e=this.getInputNode(t);return i&&e.getText?e.getText():e?e.getValue():""},setValue:function(t,i){var e=this.getInputNode(t);return e?e.setValue(i):""},compare:function(t,i){return t==i},refresh:function(e,t,s){if(!e.$destructed){var i,n=Pt(s.richselect);if(!n.$view.parentNode)Y("div",{"class":"webix_richfilter"}).appendChild(n.$view);t.$webix=s.richselect,t.style.marginLeft="-10px",s.compare=s.compare||this.compare,s.prepare=s.prepare||this.prepare,e.registerFilter(t,s,this);var h=s.options;h?"string"==typeof h?(i=s.options=[],wt(h).then(C(function(t){s.options=t.json();var i=document.body.contains(i)?i:document.body.querySelector('[active_id="'+s.contentId+'"]');this.refresh(e,i,s)},this))):i=h:i=e.collectValues(s.columnId,s.collect);var r=n.getPopup().getList(),o=Pt(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!==s.emptyOption||s.emptyOption)){var a={id:"",value:s.emptyOption||"",$empty:!0};r.add(a,0)}s.value&&this.setValue(t,s.value),n.render(),$(n.resize,n)}},render:function(t,i){if(!i.richselect){var e={container:Y("div",{"class":"webix_richfilter"}),view:this.inputtype,options:[]},s=H.extend(this.inputConfig||{},i.inputConfig||{},!0);H.extend(e,s),i.separator&&(e.separator=i.separator),i.suggest&&(e.suggest=i.suggest);var n=zt(e);n.attachEvent("onChange",function(){t.filterByAll()}),i.richselect=n.J.id,t.ht.push(n)}return i.css="webix_div_filter"," "},inputtype:"richselect"},xn.serverRichSelectFilter=H.extend({$server:!0},xn.richSelectFilter),xn.multiSelectFilter=H.extend({$noEmptyOption:!0,inputtype:"multiselect",prepare:function(t,i){if(!t)return t;for(var e={},s=t.toString().split(i.separator||","),n=0;n<s.length;n++)e[s[n]]=1;return e},compare:function(t,i){return!i||i[t]}},xn.richSelectFilter),xn.serverMultiSelectFilter=H.extend({$server:!0,Jl:function(){Pt(this.Gl).filterByAll()}},xn.multiSelectFilter),xn.multiComboFilter=H.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},xn.multiSelectFilter),xn.serverMultiComboFilter=H.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},xn.serverMultiSelectFilter),xn.datepickerFilter=H.extend({prepare:function(t){return t||""},compare:function(t,i){return 1*t==1*i},inputtype:"datepicker"},xn.richSelectFilter),xn.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(e,t,s){t.onclick=function(t){tt(t);var i=this.firstChild.firstChild;s.closed?(s.closed=!1,i.className="webix_tree_open"):(s.closed=!0,i.className="webix_tree_close"),$(function(){e.callEvent("onColumnGroupCollapse",[s.columnId,s.batch,!s.closed]),e.showColumnBatch(s.batch,!s.closed)})},s.firstRun||(s.firstRun=1,s.closed&&e.showColumnBatch(s.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||"")}},xn.dateRangeFilter=H.extend({prepare:function(t){return t.start||t.end?Dn.api.Hd(t):""},compare:function(t,i){return(!i.start||t>=i.start)&&(!i.end||t<=i.end)},inputtype:"daterangepicker"},xn.richSelectFilter),xn.serverDateRangeFilter=H.extend({$server:!0},xn.dateRangeFilter),S.scrollSize=S.touch||S.$customScroll?0:17,Mi(function(){var t=function s(){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,e={200:"flat",210:"compact",230:"contrast",240:"material",250:"mini"}[10*Math.floor(t.offsetHeight/10)];document.body.removeChild(t),e&&Ji(e);return S.$customScroll?0:i}();S.scrollSize=S.touch?0:t});var An=!1;u("_fixHeight",function Bo(){An||(O("html, body{ height:100%; }"),document.body.className+=" webix_full_screen",Zi.limit(!1),An=!0)}),zt.animate=function Ro(t,i,e){
var s=Pt(i);if(s){var n=e||{type:"slide",direction:"left"},h=s.st.cloneNode(!0),r=zt(t,i);r.st.parentNode.appendChild(h);var o=Gi.formLine(r.st,h,n);return n.callback=function(){Gi.breakLine(o)},Gi(o,n),r}},zt.animateView=function Po(i,t,e){if(i=Pt(i)){e=e||{type:"slide",direction:"left"};for(var s=function(t){var i=t.st,e=i.className,s=i.innerHTML;return"<div class='"+e+"' style='width:"+i.offsetWidth+"px;height:"+i.offsetHeight+"px;'>"+s+"</div>"},n=[],h=0;h<i.st.childNodes.length;h++){var r=i.st.childNodes[h],o=r.currentStyle?r.currentStyle.display:getComputedStyle(r,null).display;n.push(o||"")}var a=s(i);"function"==typeof t&&t.call(this);for(var u=s(i),c=i.st.insertBefore(Y("DIV",{"class":"webix_view_animate",style:"width:"+i.st.offsetWidth+"px;height:"+i.st.offsetHeight+"px;"},u+a),i.st.firstChild),f=1;f<i.st.childNodes.length;f++)i.st.childNodes[f].style.display="none";var l=Gi.formLine(c.childNodes[0],c.childNodes[1],e);return e.callback=function(){if(c){i.st.removeChild(c),c=null;for(var t=0;t<i.st.childNodes.length;t++)i.st.childNodes[t].style.display=n[t]}},Gi(l,e),i}},zt.freeze=gi,zt.resize=wi,zt.each=xi,zt.hasMethod=Bt,zt.datafilter=xn,zt.fullScreen=function jo(){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,wi()},i=function(){M.l=!0,$(t,null,[],500)};T("onRotate",i),wn(),$(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",enterPassword:"Passwort eingeben",passwordError:"Falsches passwort"},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",enterPassword:"Introduzca la contraseña",passwordError:"Contraseña incorrecta"},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",enterPassword:"Entrez le mot de passe",passwordError:"Mauvais mot de passe"},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",enterPassword:"Inserisci la password",passwordError:"Password errata"},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:"ページの高さ",enterPassword:"パスワードを入力する",passwordError:"間違ったパスワード"},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",enterPassword:"Digite a senha",passwordError:"Senha incorreta"},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:"页面高度",enterPassword:"输入密码",passwordError:"密码错误"},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:"Высота страницы",enterPassword:"Введите пароль",passwordError:"Неверный пароль"},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:"Вышыня старонкі",enterPassword:"Увядзіце пароль",passwordError:"Няправільны пароль"},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.st.className+=" webix_spacer"}},Li.view);var In={name:"template",$init:function(t){var i=this.ov[t.type];i&&(i.css&&(this.st.className+=" "+i.css,delete i.css),H.extend(t,i),t.borderless&&(delete t.Z,this.ke(t))),this.mt==this.st?(this.mt=Y("DIV"),this.mt.className=" webix_template",this.st.appendChild(this.mt)):this.mt.className+=" webix_template",this.attachEvent("onAfterRender",this.av)},setValues:function(t,i){this.data=i?H.extend(this.data,t,!0):t,this.render()},getValues:function(){return this.data},$skin:function(){this.ov.header.height=Xi.barHeight-2*Xi.borderWidth,this.ov.section.height=Xi.barHeight},ov:{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.Tu||H.extend(this,Pe),t},defaults:{template:It.empty},uv:function(){this.cv=!1,this.fv(),this.resize()},fv:function(){this.cv||(this.cv=!0,this.render())},src_setter:function(t){return this.cv=!0,this.callEvent("onBeforeLoad",[])?(wt(t,C(function(t){this.J.template=It(t),this.uv(),this.callEvent("onAfterLoad",[])},this)),t):""},av:function(){this.J.autoheight&&(this.me=null,this.resize()),this.J.scroll&&-1!=this.J.scroll.indexOf("x")&&(this.mt.style.width=this.mt.scrollWidth+"px")},content_setter:function(t){t&&(this.cv=!0,this.render=function(){},this.mt.appendChild(D(t)),$(this.av,this))},refresh:function(){this.render()},setHTML:function(t){this.J.template=function(){return t},this.refresh()},setContent:function(t){this.mt.innerHTML="",this.content_setter(t)},$setSize:function(t,i){if(Li.api.$setSize.call(this,t,i)){if(this.fv(),this.J.autoheight){var e=this.getTopParentView();clearTimeout(e.lv),e.lv=$(this.resize,this)}return!0}},$getSize:function(t,i){return!this.J.autoheight||this.J.type&&"clean"!=this.J.type||(this.J.height=this.dv()),Li.api.$getSize.call(this,t,i)},dv:function(){var t,i=Xi.layoutPadding.space;return this.fv(),this.isVisible()?(this.mt.style.height="auto",t=this.mt.scrollHeight,this.mt.style.height=""):t=nt(this.Ot(this.data)||this.mt.innerHTML,"webix_template",(this.$width||(this.getParentView()?this.getParentView().$width:0))-i).height,t},fc:!0},Tn={api:In,view:H.protoUI(In,Ue,Yi,li,di,g,Li.view)},Fn={name:"scrollview",defaults:{scroll:"y",scrollSpeed:"0ms"},$init:function(){this.st.className+=" webix_scrollview"},body_setter:function(t){t.borderless=!0,(M._=this).K=zt.rt(t),this.mt.appendChild(this.K.st)},getChildViews:function(){return[this.K]},getBody:function(){return this.K},resizeChildren:function(){this.K&&(this._d=this.K.$getSize(0,0),this.vv(),I("onResize",[]))},vv:function(){var t=Math.max(this.be,this._d[0]),i=Math.max(this.we,this._d[2]);if(this.K.$setSize(t,i),this.mt.style.width=this.K.be+"px",this.mt.style.height=this.K.we+"px",S.touch){var e=this.getScrollState(),s=this.K.we-this.we;s<e.y&&this.scrollTo(null,s)}M.o&&(M.o=!1,this._d=this.K.$getSize(0,0),this.vv())},$getSize:function(t,i){var e=this._d=this.K.$getSize(0,0),s=Li.api.$getSize.call(this,t,i),n=this._v||S.scrollSize;return"x"==this.J.scroll?(s[2]=Math.max(s[2],e[2])+n,s[3]=Math.min(s[3],e[3])+n):"y"==this.J.scroll&&(s[0]=Math.max(s[0],e[0])+n,s[1]=Math.min(s[1],e[1])+n),s},$setSize:function(t,i){var e=S.scrollSize;S.scrollSize=this._v||e,(Li.api.$setSize.call(this,t,i)||M.ri)&&this.vv(),S.scrollSize=e},scroll_setter:function(t){var i=S.$customScroll;return"string"==typeof t&&0===t.indexOf("native-")&&(this._v=17,t=t.replace("native-"),S.$customScroll=!1),
t=Ue.scroll_setter.call(this,t),S.$customScroll=i,t},it:function(t){this.K.destructor(),this.K=t,this.zn.appendChild(this.K.st),this.resize()},showView:function(t){var i=Pt(t).$view.offsetTop-Pt(t).$view.parentNode.offsetTop;this.scrollTo(0,i)}},zn=(H.protoUI(Fn,Ue,g,Li.view),H.protoUI({name:"iframe",$init:function(){this.mt=this.Yi,this.Yi.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.Yi.getElementsByTagName("iframe")[0]},getWindow:function(){return this.getIframe().contentWindow}},Li.view,g),{name:"accordion",defaults:{panelClass:"accordionitem",multi:!1,collapsed:!1},$init:function(){this.st.setAttribute("role","tablist"),this.st.setAttribute("aria-multiselectable","true")},it:function(t){Cn.api.it.apply(this,arguments),t.collapsed_setter&&t.refresh&&t.refresh()},sd:function(){for(var t=this.J.panelClass,i=this.od,e=0;e<i.length;e++)!i[e].body&&!i[e].header||i[e].view||i[e].align||(i[e].view=t),x(i[e].collapsed)&&(i[e].collapsed=this.J.collapsed);this.pv=!0,Cn.api.sd.call(this),this.pv=!1;for(var s=0;s<this.Vi.length;s++)this.Vi[s].name==t&&this.Vi[s].refresh(),this.Vi[s].mv=!1;for(var n=!1,h=this.Vi.length-1;0<=h&&!n;h--)this.Vi[h].J.hidden||(n=this.Vi[h].mv=!0)},bv:function(t){if(!1===this.J.multi&&!0!==this.pv)for(var i=0;i<this.Vi.length;i++)t!=this.Vi[i]&&!this.Vi[i].J.collapsed&&this.Vi[i].collapse&&this.Vi[i].collapse();t.callEvent&&(t.callEvent("onViewShow",[]),xi(t,this.fd))},gv:function(t){if(!0===this.J.multi||this.pv)return!0;for(var i=0;i<this.Vi.length;i++)if(t!=this.Vi[i]&&!this.Vi[i].J.collapsed&&this.Vi[i].isVisible()&&!this.Vi[i].$nospace)return!0;return!1},$skin:function(){var t=this.defaults;Xi.accordionType&&(t.type=Xi.accordionType)}}),Vn={api:zn,view:H.protoUI(zn,Cn.view)},Hn=(H.protoUI({name:"headerlayout",defaults:{type:"accordion",multi:"mixed",collapsed:!1}},Vn.view),{name:"accordionitem",$init:function(t){this.st.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.Yi=this.st,this.pn=this.Yi.childNodes[0],t.header||(this.pn.style.display="none"),this.wv=this.Yi.childNodes[0].childNodes[1],this.xv=this.Yi.childNodes[0].childNodes[0],this.zn=this.Yi.childNodes[1],this.st.className+=" webix_accordionitem",this.Vn=this.K=null,this.Vi=!0,this.zn.setAttribute("role","tabpanel"),this.pn.setAttribute("role","tab"),this.attachEvent("onKeyPress",this.Se)},et:function(){this.K={destructor:function(){}}},it:function(t){this.K.destructor(),this.K=t,this.zn.appendChild(this.K.st),this.resize()},Xo:"webix_ai_id",getChildViews:function(){return[this.K]},body_setter:function(t){return"object"!=k(t)&&(t={template:t}),t.Z={top:!0,left:!0,right:!0,bottom:!0},(M._=this).K=zt.rt(t),this.zn.appendChild(this.K.st),t},header_setter:function(t){return t&&(t=It(t)),t},headerAlt_setter:function(t){return t&&(t=It(t)),t},$getSize:function(t,i){var e=this.K.$getSize(0,0),s=this.J.Z;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1));var n=0,h=ji.api.$getSize.call(this,0,0);h[0]=(h[0]||e[0])+t,1e5<=h[1]&&(h[1]=e[1]),h[1]+=t,h[2]=(h[2]||e[2])+i;var r=h[3]<1e5;return r||(h[3]=e[3]),h[3]+=i,this.getParentView().rd?this.J.collapsed?h[2]=h[3]=this.yv()+i:this.J.header&&(n=this.J.headerHeight):(this.J.collapsed&&(h[0]=h[1]=this.yv()+t),this.J.header&&(n=this.J.headerHeight)),r||(h[2]+=n,h[3]+=n),h},on_click:{webix_accordionitem_header:function(t){return this.Mv(t),!1},webix_accordionitem_header_v:function(t){return this.Mv(t),!1}},Mv:function(){this.define("collapsed",!this.J.collapsed)},collapsed_setter:function(t){if(!1!==this.J.header){var i=this.getParentView();if(i){if(t)if(i.gv(this))this.Sv();else{var e=0;if(
1<i.Vi.length)for(var s=0;s<i.Vi.length;s++){var n=i.Vi[s];if(this!=n&&n.isVisible()&&n.expand){n.expand(),this.Sv(),e=1;break}}if(!e)return}else this.kv();(this.J.collapsed=t)||i.bv(this),this.refresh(),M.w||this.resize(),i.callEvent("onAfter"+(t?"Collapse":"Expand"),[this.J.id]),this.J.$noresize=t}return t}},collapse:function(){this.define("collapsed",!0),Ai.wi(this)},expand:function(){this.define("collapsed",!1)},ye:function(){this.show()},Bi:function(){this.hide()},kv:function(){this.zn.style.display="",st(this.$view,"collapsed"),st(this.pn,"collapsed"),this.pn.setAttribute("aria-expanded","true")},Sv:function(){this.J.headerAlt&&(this.wv.innerHTML=this.J.headerAlt()),this.zn.style.display="none",et(this.$view,"collapsed"),et(this.pn,"collapsed"),this.pn.setAttribute("aria-expanded","false")},refresh:function(){var t=this.J[this.J.collapsed?"headerAlt":"header"]||this.J.header;t&&(this.wv.innerHTML=t(),this.xv.setAttribute("aria-label",t()));var i=this.getParentView().rd?"vertical":"horizontal";this.st.className.indexOf(" "+i)<0&&et(this.st,i),S.transform||et(this.st,"webix_ie",!0)},yv:function(){return this.J.collapsed?this.J.headerAltHeight:this.J.headerHeight},$setSize:function(t,i){if(Li.api.$setSize.call(this,t,i)||this.yv()!=this.Cv){t=this.be,i=this.we;var e=this.Cv=this.yv();if(this.J.header)if(this.pn.style.height=e+"px",this.pn.style.width="auto",this.pn.style[S.transform]="",this.pn.style.borderBottomWidth=(this.J.collapsed?0:1)+"px",this.getParentView().rd||!this.J.collapsed)i-=this.yv();else if(this.J.collapsed)if(Gi.isSupported()){this.pn.style.width=i+"px",this.pn.style.height=t+3+"px";var s=Math.floor(i/2-t/2)+(t-this.J.headerAltHeight)/2;this.pn.style[S.transform]="rotate(90deg) translate("+s+"px, "+(s+1)+"px)"}else this.pn.style.width=t+"px",this.pn.style.height=i+3+"px";this.J.collapsed||(this.K.$setSize(t,i),this.$v=i)}else if(!this.J.collapsed){var n=this.K;this.$v&&n.$setSize(this.be,this.$v)}},$skin:function(){var t=this.defaults;t.headerAltHeight=t.headerHeight=Xi.barHeight-2*Xi.borderWidth},defaults:{header:!1,headerAlt:!1,body:""}}),Bn=(H.protoUI(Hn,Pe,g,Li.view),{name:"resizearea",defaults:{dir:"x"},$init:function(t){var i=t.dir||"x",e=D(t.container),s="x"==i?"width":"height",n=t.margin?t.margin+"px":0;this.Dv="x"==i?"left":"top",this.st=Y("DIV",{"class":"webix_resize_area webix_dir_"+i}),Nt(this.st,S.mouse.down,tt),n&&(n="x"==i?n+" 0 "+n:"0 "+n+" 0 "+n),this.Av=Y("DIV",{"class":"webix_resize_handle_"+i,style:n?"padding:"+n:""},"<div class='webix_handle_content'></div>"),this.Iv=Y("DIV",{"class":"webix_resize_origin_"+i}),t[s]&&(this.Iv.style[s]=t[s]+(t.border?1:0)+"px",this.Av.style[s]=t[s]+"px"),t.cursor&&(this.Av.style.cursor=this.Iv.style.cursor=this.st.style.cursor=t.cursor),this.Tv=Lt(e,S.mouse.move,this.Fv,{bind:this}),this.zv=Lt(document.body,S.mouse.up,this.Vv,{bind:this}),this.Av.style[this.Dv]=this.Iv.style[this.Dv]=t.start+"px",e.appendChild(this.st),e.appendChild(this.Av),e.appendChild(this.Iv)},Vv:function(){this.callEvent("onResizeEnd",[this.Hv]),Ot(this.Tv),Ot(this.zv),G(this.st),G(this.Av),G(this.Iv),this.st=this.Av=this.Iv=null},Fv:function(t){var i=Z(t);this.Hv=("x"==this.J.dir?i.x:i.y)+this.J.start-this.J.eventPos,this.Av.style[this.Dv]=this.Hv+"px",this.callEvent("onResize",[this.Hv])}}),Rn=(H.protoUI(Bn,g,Ii),{name:"resizer",defaults:{width:7,height:7},$init:function(t){this.getParentView(),this.st.className+=" webix_resizer";var i=this.getParentView().Oa;Nt(this.st,S.mouse.down,this.Bv,{bind:this}),Lt(document.body,S.mouse.up,this.Rv,{bind:this});var e=this.Pv();this.jv=!1,this.Ev=e,this.Nv="x"==e?"width":"height","x"==e?t.height=0:t.width=0,0<i?(this.st.className+=" webix_resizer_v"+e,this.st.style.marginRight="-"+i+"px","x"==e?t.width=i:t.height=i,this.$nospace=!0):this.st.className+=" webix_resizer_"+e,this.st.innerHTML="<div class='webix_resizer_content'></div>","y"==e&&0<i&&(this.st.style.marginBottom="-"+(t.height||this.defaults.height)+"px"),this.st.setAttribute("webix_disable_drag","true"),this.st.setAttribute("tabindex","-1"),this.st.setAttribute(
"aria-grabbed","false")},Bv:function(t){var i=this.Lv();if(i&&!this.J.disabled){t=t||Lt,this.jv=!0,this.Ov=Z(t),this.Uv=[],this.st.setAttribute("aria-grabbed","true");for(var e=0;e<2;e++)i[e].$view.setAttribute("aria-dropeffect","move");this.st.setAttribute("aria-dropeffect","move"),this.Yv(t,i[0])}},Rv:function(){this.jv=!1,this.Ov=!1},Yv:function(t,i){var e,s,n,h,r;t=t||Lt,e=this.Ev,this.getParentView().st.style.position="relative",n=J(this.st),h=J(this.getParentView().st),r=n[e]-h[e],s=J(i.$view)[e]-J(this.getParentView().$view)[e],this.Wv=[e,i,r,s],this.Gv=new zt.resizearea({container:this.getParentView().st,dir:e,eventPos:this.Ov[e],start:r-1,height:this.$height,width:this.$width,border:1,margin:this.getParentView().Na["x"===e?"left":"top"]}),this.Gv.attachEvent("onResizeEnd",C(this.Xv,this)),this.Gv.attachEvent("onResize",C(this.qv,this)),et(document.body,"webix_noselect",1)},Pv:function(){return this.getParentView().rd?"y":"x"},qv:function(){var t,i,e,s,n,h,r,o,a,u;if(this.Wv)for(t=this.Lv(),n=this.Wv[0],s=this.Gv.Hv-this.Wv[2],a=this.Jv(t,n,s),u=t[0]["$"+this.Nv]+t[1]["$"+this.Nv],r="y"==n?["minHeight","maxHeight"]:["minWidth","maxWidth"],h=0;h<2;h++){e=h?-s:s;var c=(i=t[h].J)[r[0]],f=i[r[1]];if(0<e&&f&&f<=a[h]||e<0&&(c||3)>=a[h])return this.Uv[h]=0<e?f:c||3,o=this.Kv(t,n),void(this.Gv.Av.style["y"==n?"top":"left"]=this.Wv[3]+o[0]+"px");a[h]<3?this.Gv.Av.style["y"==n?"top":"left"]=this.Wv[3]+h*u+1+"px":this.Uv[h]=null}},Lv:function(){var t,i,e;for(t=this.getParentView().Vi,i=0;i<t.length;i++)if(t[i]==this)return(e=[this.Zv(t,i,1,-1),this.Zv(t,i,1,1)])[0]&&e[1]||(e=null),e},Zv:function(t,i,e,s){var n=t[i+s*e];return n&&n.J.hidden?this.Zv(t,i,e+1,s):n&&n.J.$noresize?null:n},Xv:function(t){if(void 0!==t){var i,e,s,n,h=this.getParentView().rd;if(this.Qv=null,this.Wv){if(e=this.Wv[0],s=t-this.Wv[2],(i=this.Lv())[0]&&i[1]){n=this.t_(i,e,s);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].J[this.Nv]=n[r],i[r].dd&&i[r].dd(this.Nv,n[r],h);else{var a=i[r].$view[h?"offsetHeight":"offsetWidth"];i[r].J.gravity=n[r]/a*i[r].J.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.Wv=!1}this.Wv=!1,this.jv=!1,this.Uv=null,st(document.body,"webix_noselect"),this.st.setAttribute("aria-grabbed","false"),this.st.removeAttribute("aria-dropeffect")}},Kv:function(t){var i,e,s;return s=t[0]["$"+this.Nv]+t[1]["$"+this.Nv],this.Uv[0]?e=s-(i=this.Uv[0]):this.Uv[1]&&(i=s-(e=this.Uv[1])),[i,e]},Jv:function(t,i,e){for(var s=[],n="height"==this.Nv?"offsetHeight":"offsetWidth",h=0;h<2;h++)s[h]=t[h].$view[n]+(h?-1:1)*e;return s},t_:function(t,i,e){var s,n,h;if(this.Uv[0]||this.Uv[1])n=this.Kv(t,i);else for(n=this.Jv(t,i,e),s=0;s<2;s++)n[s]<0&&(h=n[0]+n[1],n[s]=1,n[1-s]=h-1);return n}}),Pn=(H.protoUI(Rn,Pe,Ti,Li.view),{name:"align",defaults:{borderless:!0,left:0,top:0,right:0,bottom:0},$init:function(){this.st.className+=" webix_view_align"},getChildViews:function(){return[this.K]},body_setter:function(t){return t.Z={top:!1,left:!1,right:!1,bottom:!1},(M._=this).K=zt.rt(t),this.st.appendChild(this.K.st),t},align_setter:function(t){"string"==typeof t&&(t=t.split(",")),this.i_=this.e_=this.s_="";for(var i=0;i<t.length;i++){var e=t[i];"center"!==e&&"left"!==e&&"right"!==e||(this.i_=e),"top"!==e&&"bottom"!==e&&"middle"!==e||(this.e_=e),"absolute"===e&&(this.i_=this.e_=this.s_="precise")}return t},getBody:function(){return this.K},$setSize:function(t,i){var e,s;Li.api.$setSize.call(this,t,i),s=this.s_?(e=t-this.J.left-this.J.right,i-this.J.top-this.J.bottom):(e=this._d[0]||t,this._d[2]||i),this.K.$setSize(e,s);var n=this.K.st;"center"==this.i_?n.style.marginLeft=Math.ceil((t-e)/2)+"px":"right"==this.i_?n.style.marginLeft=t-e+"px":n.style.marginLeft=(this.s_?this.J.left:0)+"px","middle"==this.e_?n.style.marginTop=Math.ceil((i-s)/2)+"px":"bottom"==this.e_?n.style.marginTop=i-s+"px":n.style.marginTop=(this.s_?this.J.top:0)+"px"},$getSize:function(t,i){var e=this._d=this.K.$getSize(0,0),
s=ji.api.$getSize.call(this,0,0);return this.s_&&(t+=this.J.left+this.J.right,i+=this.J.top+this.J.bottom),!this.i_||this.s_?(s[0]=e[0]+t,s[1]=e[1]+t):(s[0]=(s[0]||e[0])+i,s[1]+=t),!this.e_||this.s_?(s[2]=e[2]+i,s[3]=e[3]+i):(s[2]=(s[2]||e[2])+i,s[3]+=i),s}}),jn=(H.protoUI(Pn,Li.view),{name:"multiview",defaults:{animate:{}},setValue:function(t){Pt(t).show()},getValue:function(){return this.getActiveId()},$init:function(){this.Zu=0,this.rd=1,this.st.style.position="relative",this.st.className+=" webix_multiview",this.n_=[]},h_:function(t,i){var e=Pt(t);e.r_||(e.o_=[],e.r_={}),e.r_[i]||(e.r_[i]=!0,e.o_.push(i))},a_:function(t){var i=Pt(t);if(this.J.keepViews&&(i.st.style.display=""),this.n_[this.n_.length-2]!=t?(10==this.n_.length&&this.n_.splice(0,1),this.n_.push(t)):this.n_.splice(this.n_.length-1,1),i.r_){for(var e=0;e<i.o_.length;e++){var s=Pt(i.o_[e]);s&&s.render()}i.o_=[],i.r_={}}},addView:function(){var t=Mn.api.addView.apply(this,arguments);return this.J.keepViews?Pt(t).st.style.display="none":G(Pt(t).st),t},ud:function(t){if(t==this.Zu){var i=Math.max(t-1,0);this.Vi[i]&&(this.u_=!1,this.ye(this.Vi[i],!1))}t<this.Zu&&this.Zu--},Bi:function(){},sd:function(t){t=t||this.od;for(var i=0;i<t.length;i++)t[i].Z=this.J.borderless?{top:1,left:1,right:1,bottom:1}:this.J.Z||{};Mn.api.sd.call(this,t);for(var e=1;e<this.Vi.length;e++)this.J.keepViews?this.Vi[e].st.style.display="none":G(this.Vi[e].st);for(var s=0;s<t.length;s++){var n=this.Vi[s];if(!n.Vi||n.Id){var h=n.J.Z;h.top&&(n.st.style.borderTopWidth="0px"),h.left&&(n.st.style.borderLeftWidth="0px"),h.right&&(n.st.style.borderRightWidth="0px"),h.bottom&&(n.st.style.borderBottomWidth="0px"),n.st.setAttribute("role","tabpanel")}}this.a_(this.getActiveId())},cells_setter:function(t){t&&t.length,this.od=t},c_:function(t,i){var e=(this.J.animate||{}).direction,s="top"==e||"bottom"==e;return t<i?s?"bottom":"right":s?"top":"left"},ye:function(t,i){var e=this.getParentView();if(e&&e.getTabbar&&e.getTabbar().setValue(t.J.$id||t.J.id),this.u_)return $(this.ye,this,[t,i],100);for(var s=-1,n=0;n<this.Vi.length;n++)if(this.Vi[n]==t){s=n;break}if(!(s<0||s==this.Zu)){var h=this.Vi[this.Zu],r=this.Vi[s];if(h.$getSize(0,0),(i||void 0===i)&&Gi.isSupported()&&this.J.animate){var o=H.extend({},this.J.animate);this.J.keepViews&&(o.keepViews=!0),o.direction=this.c_(s,this.Zu),o=Ii.ji(i||{},o);var a=Gi.formLine(r.st,h.st,o);r.$getSize(0,0),r.$setSize(this.be,this.we);var u=o.callback;o.callback=function(){Gi.breakLine(a,this.J.keepViews),this.u_=!1,u&&u.call(this),u=o.master=o.callback=null,this.resize()},(o.master=this).Zu=s,this.a_(this.getActiveId()),Gi(a,o),this.u_=!0}else this.J.keepViews?h.st.style.display="none":(G(h.st),this.st.appendChild(this.Vi[n].st)),this.Zu=s,this.resizeChildren(),this.a_(this.getActiveId());r.callEvent&&(r.callEvent("onViewShow",[]),xi(r,this.fd)),this.callEvent("onViewChange",[h.J.id,r.J.id])}},$getSize:function(t,i){if(!this.Vi.length)return ji.api.$getSize.call(this,0,0);var e=this.Vi[this.Zu].$getSize(0,0);if(this.J.fitBiggest)for(var s=0;s<this.Vi.length;s++)if(s!=this.Zu)for(var n=this.Vi[s].$getSize(0,0),h=0;h<4;h++)e[h]=Math.max(e[h],n[h]);var r=ji.api.$getSize.call(this,0,0);return 1e5<=r[1]&&(r[1]=0),1e5<=r[3]&&(r[3]=0),r[0]=(r[0]||e[0])+t,r[1]=(r[1]||e[1])+t,r[2]=(r[2]||e[2])+i,r[3]=(r[3]||e[3])+i,r},$setSize:function(t,i){this.Vi.length&&(this.nd=[t,i],ji.api.$setSize.call(this,t,i),this.Vi[this.Zu].$setSize(t,i))},isVisible:function(t,i){return i&&i!=this.getActiveId()?(t&&this.h_(i,t),!1):Li.api.isVisible.call(this,t,this.J.id)},getActiveId:function(){return this.Vi.length?this.Vi[this.Zu].J.id:null},back:function(t){if(t=t||1,this.callEvent("onBeforeBack",[this.getActiveId(),t])){if(this.n_.length>t){var i=this.n_[this.n_.length-t-1];return Pt(i).show(),i}return null}return null}}),En=(H.protoUI(jn,Mn.view),{name:"tabview",setValue:function(t){this.Vi[0].setValue(t)},getValue:function(){return this.Vi[0].getValue()},getTabbar:function(){return this.Vi[0]},getMultiview:function(){return this.Vi[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.f_);var i=t.cells,e=[];i&&i.length;for(var s=i.length-1;0<=s;s--){var n=i[s].body||i[s];n.id||(n.id="view"+z()),e[s]={value:i[s].header,id:n.id,close:i[s].close,width:i[s].width,hidden:!!i[s].hidden},i[s]=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||e,t.rows=[h,r],delete t.cells,delete t.tabs},f_:function(){this.getTabbar().attachEvent("onOptionRemove",function(t){var i=Pt(t);if(i){var e=i.getParentView();e&&e.removeView(i)}})}}),Nn=(H.protoUI(En,Cn.view),{name:"carousel",defaults:{scrollSpeed:"300ms",type:"clean",navigation:{},animate:!0},$init:function(){this.st.className+=" webix_carousel",this.l_=null,this.mt=null,this.Zu=0,this.$ready.unshift(this.d_),this.$ready.push(this.hr)},addView:function(t,i){var e=this.l_.addView(t,i);return this.v_(),e},removeView:function(t){this.l_.removeView(t),this.v_()},it:function(t,i){this.l_.it(t,i),this.v_()},v_:function(){this.Vi=this.l_.Vi,this.Uu(),this.setActiveIndex(Math.min(this.Zu,this.Vi.length-1))},d_:function(){this.l_&&this.l_.destructor&&this.l_.destructor();var t="";this.config.cols?(t="cols",this.rd=0):(t="rows",this.rd=1);var i={borderless:!0,type:"clean"};i[t]=B(this.J[t]);for(var e=["type","margin","marginX","marginY","padding","paddingX","paddingY"],s={},n=0;n<e.length;n++)this.J[e[n]]&&(s[e[n]]=this.J[e[n]]);H.extend(i,s,!0),(M._=this).l_=zt.rt(i),this.st.appendChild(this.l_.st),this.Vi=this.l_.Vi,this.l_.ye=C(Nn.ye,this),this.l_.adjustScroll=C(Nn.adjustScroll,this),T("onReconstruct",C(function(t){t==this.l_&&this.__()},this)),this.Yi=this.st.firstChild},Se:function(t,i){this.J.navigation.items&&"tab"===i.target.getAttribute("role")&&this.Nu(t,i),ji.api.Se.call(this,t,i)},getChildViews:function(){return[this.l_]},getLayout:function(){return this.l_},hr:function(){this.Yi.setAttribute("touch_scroll",this.rd?"y":"x"),this.l_.attachEvent("onAfterScroll",C(function(){this.callEvent("onShow",[this.getActiveId()])},this)),xi(this.l_,function(t){t.st.setAttribute("role","tabpanel")})},adjustScroll:function(t){var i,e=this.rd?this.we:this.be;return this.rd?(i=Math.round(t.f/e),t.f=i*e):(i=Math.round(t.e/e),t.e=i*e),this.Zu=-i,this.J.navigation&&this.Yu(),!0},ye:function(t){var i,e,s,n,h,r;for(s=-1,e=this.l_,i=0;i<e.Vi.length;i++)if(e.Vi[i]==t){s=i;break}s<0||s==this.Zu||(this.Zu=s,n=e.rd?this.we:this.be,h=-(e.rd?0:s*n),r=-(e.rd?s*n:0),this.scrollTo(h,r),this.callEvent("onShow",[e.Vi[this.Zu].J.id]),this.J.navigation&&this.Uu())},scrollTo:function(t,i){Zi&&Gi.isSupported()&&this.J.animate?Zi.gs(this.Yi,t,i,this.J.scrollSpeed||"100ms"):(this.Yi.style.marginLeft=t+"px",this.Yi.style.marginTop=i+"px")},navigation_setter:function(t){return this.ji(t,{type:"corner",buttons:!0,items:!0}),t},showNext:function(){this.Zu<this.l_.Vi.length-1&&this.setActiveIndex(this.Zu+1)},showPrev:function(){0<this.Zu&&this.setActiveIndex(this.Zu-1)},setActiveIndex:function(t){this.l_.Vi.length,Pt(this.l_.Vi[t].J.id).show()},getActiveIndex:function(){return this.Zu},$getSize:function(t,i){var e=this.l_.$getSize(0,0),s=Li.api.$getSize.call(this,t,i);return this.l_.rd?(s[0]=Math.max(s[0],e[0]),s[1]=Math.min(s[1],e[1])):(s[2]=Math.max(s[2],e[2]),s[3]=Math.min(s[3],e[3])),s},$setSize:function(t,i){var e=this.l_,s=e.Vi.length,n=Li.api.$setSize.call(this,t,i),h=this.we*(e.rd?s:1),r=this.be*(e.rd?1:s);n?(this.Yi.style.height=h+"px",this.Yi.style.width=r+"px",e.$setSize(r,h),this.__()):e.$setSize(r,h)},__:function(){var t=this.l_,i=this.Zu||0,e=t.rd?this.we:this.be,s=-(t.rd?0:i*e),n=-(t.rd?i*e:0);this.scrollTo(s,n),this.J.navigation&&this.Uu()},getActiveId:function(){var t=this.l_.Vi[this.Zu];return t?t.J.id:null},setActive:function(t){Pt(t).show()}}),Ln=(H.protoUI(Nn,g,je,Li.view),{name:"proxy",body_setter:function(t){
return(M._=this).K=zt.rt(t),this.st.appendChild(this.K.st),t},getChildViews:function(){return[this.K]},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),this.K.$setSize(this.$width,this.$height)},$getSize:function(t,i){var e=Li.api.$getSize.call(this,t,i),s=this.K.$getSize(t,i);return s[0]=Math.max(e[0],s[0]),s[1]=Math.min(e[1],s[1]),s[2]=Math.max(e[2],s[2]),s[3]=Math.min(e[3],s[3]),s[4]=Math.max(e[4],s[4]),s},it:function(t){this.K.destructor(),this.K=t,this.st.appendChild(t.st)}}),On=(H.protoUI(Ln,Li.view),{name:"portlet",defaults:{layoutType:"wide",icon:"wxi-drag"},$init:function(t){this.st.style.position="relative",t.header&&t.body&&(t.body=[{template:t.header,type:"header"},t.body]),this.$ready.push(this.p_),T("onAfterPortletMove",this.m_)},m_:function(t){xi(t,function(t){t.b_&&t.b_()})},p_:function(){var t=this.getChildViews();if(1<t.length)ie.addDrag(t[0].$view,this);else if(this.J.icon){var i=Y("div",{"class":"portlet_drag"},"<span class='webix_icon "+this.J.icon+"'></span>");this.st.appendChild(i),ie.addDrag(i,this)}else ie.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.g_);t=Pt(t),this.g_||(this.g_=Y("div",null,"&nbsp;")),t.$view.appendChild(this.g_),this.g_.className="portlet_marker"+i},movePortlet:function(t,i){var e=t.getParentView(),s=this.getParentView(),n=e.index(t),h=s.index(this);if(I("onBeforePortletMove",[s,e,this,t,i])){M.l=!0;var r=s!=e?1:0,o=e.rd;"top"==i||"bottom"==i?(1!==o&&(zt(t,e=zt({type:t.J.layoutType,rows:[]},e,n+r),0),n=0,r=1),"bottom"==i&&(r+=1)):"left"!=i&&"right"!=i||(0!==o&&(zt(t,e=zt({type:t.J.layoutType,cols:[]},e,n+r),0),n=0,r=1),"right"==i&&(r+=1)),h<n&&(r-=1),zt(this,e,n+r),"replace"==i&&zt(t,s,h),this.w_(s),M.l=!1,t.resize(),s.resize(),I("onAfterPortletMove",[s,e,this,t,i])}},w_:function(t){for(var i,e=0;t.getChildViews().length<=e;)t=(i=t).getParentView(),e=1;e&&t.removeView(i)},$drag:function(t){return et(this.st,"portlet_in_drag"),ie.Xs={source:t,from:t},this.st.innerHTML},$dragDestroy:function(t,i){st(this.st,"portlet_in_drag"),G(i),this.x_&&(this.movePortlet(this.x_,this.y_),this.markDropArea(),this.x_=null)},Gs:function(){return J(this.$view)},$dragPos:function(t,i,e){e.style.left="-10000px";var s=S.mouse.context(i),n=document.body.scrollTop||document.documentElement.scrollTop||0,h=document.body.scrollLeft||document.documentElement.scrollLeft||0,r=document.elementFromPoint(s.x-h,s.y-n),o=null;r&&(o=Pt(r)),this.x_=this.M_(o),this.y_=this.S_(this.x_,i),t.x=t.x-this.be+10,t.y=t.y-20,ie.rn=!0},S_:function(t,i){var e="",s="";if(i&&t){var n=J(t.$view),h=Z(i),r=h.x-n.x-n.width/2,o=h.y-n.y-n.height/2;(s=t.J.mode)||(s=Math.abs(r)*(n.height/n.width)>Math.abs(o)?"cols":"rows"),"cols"==s?e=0<=r?"right":"left":"rows"==s&&(e=0<=o?"bottom":"top"),this.markDropArea(t,e)}return this.markDropArea(t,e),e||s},M_:function(t){for(;t;){if(t.movePortlet)return t;t=t.getParentView()}}}),Un=(H.protoUI(On,Cn.view),{name:"abslayout",$init:function(){this.$view.className+=" webix_abslayout",delete this.rows_setter,delete this.cols_setter,this.od=[]},cells_setter:function(t){this.od=t},sd:function(){Mn.api.sd.call(this,this.od)},$getSize:function(){for(var t=ji.api.$getSize.call(this,0,0),i=null,e=0;e<this.Vi.length;e++)this.Vi[e].J.relative&&(i=this.Vi[e].$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.nd=[t,i],ji.api.$setSize.call(this,t,i),this.La(t,i)},La:function(t,i){for(var e=0;e<this.Vi.length;e++){var s=this.Vi[e],n=s.J,h=s.$getSize(0,0);n.relative?(n.left=n.top=0,s.$setSize(t,i)):s.$setSize(h[0],h[2]);for(var r=s.$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")}}}}),Yn={api:Un,view:H.protoUI(Un,Mn.view)},Wn={name:"gridlayout",defaults:{autoplace:!0,gridColumns:2,gridRows:2,margin:10,padding:10},gridRows_setter:function(t){return this.k_=t},sd:function(){for(var t=0;t<this.od.length;t++)this.od[t].Z={}
;Mn.api.sd.call(this,this.od)},removeView:function(t){Yn.api.removeView.call(this,t),this.C_(),this.callEvent("onChange",[])},D_:function(t){if(t.dx=t.dx||1,t.dy=t.dy||1,x(t.y)||x(t.x)){for(var i=this.A_(),e=0;e<this.k_;e++)for(var s=0;s<this.J.gridColumns;s++)if(!i[s][e]&&this.I_(i,s,e,s+t.dx,e+t.dy))return t.x=s,void(t.y=e);t.x=0,t.y=this.k_}var n=t.x+t.dx-this.J.gridColumns;0<n&&(t.dx-=n)},it:function(t){this.D_(t.config),this.Vi.push(t),this.$view.appendChild(t.st),this.T_(t.config,t.config.id),this.C_(!0),this.F_||this.callEvent("onChange",[])},I_:function(t,i,e,s,n){for(var h=i;h<s;h++)for(var r=e;r<n;r++)if(!t[h]||t[h][r])return!1;return!0},z_:function(t,i,e){for(var s=0;s<i.dx;s++)for(var n=0;n<i.dy;n++)t[s+i.x][n+i.y]=e},V_:function(t,i,e){for(var s=this.J.gridColumns,n=i.x+i.dx;n+e.dx<=s;n++)if(this.I_(t,n,e.y,n+e.dx,e.y+e.dy))return n-e.x;return 0},H_:function(t,i,e){for(var s=i.x-e.dx;0<=s;s--)if(this.I_(t,s,e.y,s+e.dx,e.y+e.dy))return e.x-s;return 0},B_:function(t,i,e){for(var s=i.y-e.dy;0<=s;s--)if(this.I_(t,e.x,s,e.x+e.dx,s+e.dy))return e.y-s;return 0},A_:function(t){for(var i=[],e=0;e<this.J.gridColumns;e++)i[e]=[];for(var s=0;s<this.Vi.length;s++){var n=this.Vi[s].config;n.id===t||n.hidden||this.z_(i,n,n.id)}return i},C_:function(t){(this.R_()||t)&&this.P_()},R_:function(){if(!this.J.autoplace)return!1;var t=this.J.gridColumns,i=this.k_,e=this.A_(),s=!1;t:for(var n=i-1;0<=n;n--){for(var h=t-1;0<=h;h--)if(e[h][n])continue t;s=!0;for(var r=0;r<this.Vi.length;r++){var o=this.Vi[r].config;!o.hidden&&o.y>=n&&(o.y-=1)}}return s},T_:function(t,i){if(t.x-=Math.max(0,t.x+t.dx-this.J.gridColumns),this.J.autoplace){for(var e=[],s=this.A_(i),n=0;n<this.Vi.length;n++){var h=this.Vi[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&&e.push(h)}for(var r=[],o=0;o<e.length;o++){var a=e[o];this.z_(s,a,0);var u=this.V_(s,t,a);if(u)a.x+=u;else{var c=this.H_(s,t,a);if(c)a.x-=c;else{var f=this.B_(s,t,a);f?a.y-=f:(a.y=t.y+t.dy,r.push(a))}}this.z_(s,a,a.id)}for(var l=0;l<r.length;l++)this.T_(r[l],r[l].id)}else t.y-=Math.max(0,t.y+t.dy-this.J.gridRows)},P_:function(){for(var t=this.J.gridRows,i=0;i<this.Vi.length;i++){var e=this.Vi[i].config;e.hidden||(t=Math.max(t,e.y+e.dy))}this.k_!=t&&(this.k_=t,this.resize()),this.La()},moveView:function(t,i){i=H.extend(Pt(t).config,i,!0),this.T_(i,t),this.C_(!0),this.callEvent("onChange",[])},serialize:function(t){for(var i=[],e=0;e<this.Vi.length;e++)if(t)i.push(t.call(this,this.Vi[e]));else{var s=this.Vi[e].config;i.push({id:s.id,name:s.name,x:s.x,y:s.y,dx:s.dx,dy:s.dy})}return i},clearAll:function(){for(var t=0;t<this.Vi.length;t++)this.Vi[t].destructor();this.Vi=[],this.callEvent("onChange",[])},restore:function(t,i){i=i||this.J.factory,t=B(t),this.F_=!0;for(var e={},s=0;s<t.length;s++){var n=t[s],h=Pt(n.id);e[h?(H.extend(h.config,n,!0),h.config.id):(h=i.call(this,n),this.addView(h))]=1}for(var r=this.Vi.length-1;0<=r;r--)e[this.Vi[r].config.id]||(this.Vi[r].destructor(),this.Vi.splice(r,1));this.P_(),this.F_=!1},$getSize:function(){for(var t=ji.api.$getSize.call(this,0,0),i=0;i<this.Vi.length;i++)this.Vi[i].$getSize(0,0);var e=this.J.cellWidth,s=this.J.cellHeight,n=this.j_(0,0,this.J.gridColumns,this.k_);return e&&(t[0]=n.dx+2*n.x),s&&(t[2]=n.dy+2*n.y),t},j_:function(t,i,e,s){var n=this.J.margin,h=this.J.paddingX||this.J.padding,r=this.J.paddingY||this.J.padding,o=this.J.cellWidth;o||(o=(this.$width-2*h+n)/this.J.gridColumns-n);var a=this.J.cellHeight;return a||(a=(this.$height-2*r+n)/this.k_-n),{x:h+(o+n)*t,y:r+(a+n)*i,dx:Math.ceil(o+(o+n)*(e-1)),dy:Math.ceil(a+(a+n)*(s-1))}},La:function(){for(var t=0;t<this.Vi.length;t++){var i=this.Vi[t],e=i.J,s=this.j_(e.x,e.y,e.dx,e.dy);i.$getSize(0,0),i.$setSize(s.dx,s.dy);var n=i.$view;n.style.left=s.x+"px",n.style.top=s.y+"px"}}},Gn={api:Wn,view:H.protoUI(Wn,Yn.view)},Xn={name:"dashboard",$init:function(){ie.addDrag(this.$view,this),ie.addDrop(this.$view,this,!0)},E_: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.E_(t.parentNode))},$dragCreate:function(t,i){if(i.target){if(!this.E_(i.target))return!1;var e=Pt(i);e.$resizeMove||(e=e.queryView(function(t){return!!t.config.dx},"parent"));var s=J(this.$view),n=Z(i);return ie.Xs={source:e,from:this,dashboard:{sx:n.x-s.x-parseInt(e.$view.style.left)+this.J.margin/2,sy:n.y-s.y-parseInt(e.$view.style.top)+this.J.margin/2}},this.N_(e.J.dx,e.J.dy),e.$view}},N_:function(t,i){var e=this.L_=Y("div",{"class":"panel_target"}),s=this.j_(0,0,t,i);e.style.width=s.dx+"px",e.style.height=s.dy+"px",this.$view.appendChild(this.L_)},$drop:function(){var t=ie.Xs,i={x:t.dashboard.x,y:t.dashboard.y};if(t.from===this){var e=t.source.config;this.moveView(e.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.J.factory.call(this,i))&&this.addView(i)},$dragDestroy:function(t,i){i.style.zIndex=1,G(this.L_),this.L_=null,this.P_()},O_:function(t,i){var e=this.J.margin,s=this.J.paddingX||this.J.padding,n=this.J.paddingY||this.J.padding,h=this.J.cellWidth;h||(h=(this.$width-2*s+e)/this.J.gridColumns-e);var r=this.J.cellHeight;return r||(r=(this.$height-2*n+e)/this.k_-e),t=Math.round((t-s)/(h+e/2)-.2),i=Math.round((i-s)/(r+e/2)-.2),{x:t=Math.max(0,Math.min(t,this.J.gridColumns)),y:i=Math.max(0,Math.min(i,this.k_)),width:h,height:r,margin:e,rx:t*h+e*t+s,ry:i*r+e*i+n}},$dragOut:function(){var t=ie.Xs;this.L_&&t.external&&(G(this.L_),this.L_=null)},$dragIn:function(t,i,e){var s=ie.Xs;if(!this.L_){if(!s.from||!s.from.getItem)return!1;if(!this.J.factory)return!1;s.external=!0;var n=s.from.getItem(s.source);s.dashboard={dx:n.dx,dy:n.dy},this.N_(n.dx,n.dy)}if(s.external){var h=this.L_,r=S.mouse.context(e),o=J(this.$view),a=this.O_(r.x-o.x,r.y-o.y);H.extend(s.dashboard,a,!0),h.style.left=a.rx+"px",h.style.top=a.ry+"px"}return!0},$dragPos:function(t,i,e){var s=ie.Xs;e.style.left="-10000px";var n=S.mouse.context(i),h=J(this.$view),r=s.dashboard,o=this.O_(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.L_;a.style.left=o.rx+"px",a.style.top=o.ry+"px",H.extend(r,o,!0)}},qn=(H.protoUI(Xn,Gn.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]}et(this.$view,"panel_drag_view"),this.$ready.push(this.p_)},p_:function(){var t=this.getChildViews(),i=1===t.length?this:t[1];if(this.J.icon){var e=Y("div",{"class":"panel_icon"},"<span class='webix_icon "+this.J.icon+" panel_icon_span'></span>");i!=this&&(i.$view.style.position="relative"),i.$view.appendChild(e)}},body_setter:function(t){return this.rows_setter(b(t)?t:[t])},$resizeEnd:function(t){var i=this.getParentView();if(i&&i.O_){var e=i.O_(t.x,t.y),s=Math.max(e.x,1),n=Math.max(e.y,1);i.moveView(this.J.id,{dx:s,dy:n})}},$resizeMove:function(t){var i=this.getParentView();if(i&&i.O_){var e=i.O_(t.x,t.y);t.x=e.width*e.x+e.margin*(e.x-1),t.y=e.height*e.y+e.margin*(e.y-1)}}}),Jn=(H.protoUI(qn,Cn.view,ne),{$init:function(){H.extend(this,Ae,!0)},name:"flexlayout"}),Kn=(H.protoUI(Jn,Cn.view),{name:"datalayout",$init:function(){this.data.provideApi(this,!0),this.data.attachEvent("onStoreUpdated",C(this.render,this))},sd:function(){return this.U_||(this.U_=this.od,this.od=[{}]),Cn.api.sd.call(this,this.od)},setValue:function(t){this.parse(t)},getValue:function(){for(var t=this.U_.length,i=0;i<this.Vi.length;i++){var e=this.data.order[Math.floor(i/t)],s=this.data.getItem(e);this.Y_(this.Vi[i],s)}return this.data.serialize()},Y_:function(t,i){var e=t.J.name;if(e){var s=null;t.getValues?s=t.getValues():t.getValue?s=t.getValue():t.serialize&&(s=t.serialize()),"$value"==e?H.extend(i,s,!0):i[e]=s}else{var n=t.Vi;if(n)for(var h=0;h<n.length;h++)this.Y_(n[h],i)}},W_:function(t,i){var e,s=t.J.name;if(s)e="$value"==s?i:i[s],t.setValues?t.setValues(e):t.setValue?t.setValue(e):t.parse&&(t.openAll&&(e=B(e)),t.parse(e));else{var n=t.Vi;if(n)for(var h=0;h<n.length;h++)this.W_(n[h],i)}},render:function(t,i,e){var s=this.U_.length;if(t&&"update"===e)for(
var n=this.getItem(t),h=this.getIndexById(t),r=0;r<s;r++)this.W_(this.Vi[h*s+r],n);else{for(var o=this.od=[],a=this.data.order,u=0;u<a.length;u++)if(s)for(var c=0;c<s;c++)o.push(B(this.U_[c]));else o.push(this.getItem(a[u]));if(o.length||o.push({}),this.reconstruct(),s)for(var f=0;f<a.length;f++)for(var l=this.getItem(a[f]),d=0;d<s;d++){var v=this.Vi[f*s+d];this.W_(v,l)}}}}),Zn={api:Kn,view:H.protoUI(Kn,we,Cn.view)},Qn={$init:function(){H.extend(this,Ae,!0)},name:"flexdatalayout"},th=(H.protoUI(Qn,Zn.view),{name:"popup",$init:function(){var i=this;this.J.head=!1,this.$view.className+=" webix_popup",T("onClick",function(t){return i.Bi(t)}),this.attachEvent("onHide",this.Pn)},$skin:function(){this.defaults.headHeight=Xi.barHeight,this.defaults.padding=Xi.popupPadding,this.defaults.point=!Xi.popupNoPoint,this.defaults.borderless=Xi.borderlessPopup},close:function(){G(this.G_),re.api.close.call(this)},$getSize:function(t,i){return re.api.$getSize.call(this,t+2*this.J.padding,i+2*this.J.padding)},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),t=this.be-2*this.J.padding,i=this.we-2*this.J.padding,this.Yi.style.padding=this.J.padding+"px",this.pn.style.display="none",this.K.$setSize(t,i)},Un:function(t){"undefined"==typeof t.borderless&&(t.borderless=!1)},head_setter:function(){},Rn:function(t,i,e,s){this.Pn(),document.body.appendChild(this.G_=Y("DIV",{"class":"webix_point_"+t},"")),this.G_.style.zIndex=yi(),this.G_.style.position=s?"fixed":"absolute",this.G_.style.top=e+"px",this.G_.style.left=i+"px"},Pn:function(){this.G_=G(this.G_)}}),ih={api:th,view:H.protoUI(th,re.view)},eh={name:"toolbar",defaults:{type:"toolbar"},Id:!0,X_:"webix_toolbar",q_:!1,$init:function(t){t.borderless||(this.Yi.style.borderWidth="1px",this.J.Z={top:!1,left:!1,right:!1,bottom:!1}),this.Yi.className+=" "+this.X_,this.st.setAttribute("role","toolbar")},ad:function(){var i=this;i.elements={},xi(this,function(t){if(t.J.name&&t.getValue&&t.setValue&&(i.elements[t.J.name]=t).mapEvent&&t.mapEvent({onbeforetabclick:i,onaftertabclick:i,onitemclick:i,onchange:i}),t.setValues)return!1});var t=this.Rf;if(this.setDirty(!1),t){var e=this.Rf;for(var s in i.elements)t[s]&&e[s]!=t[s]&&(e[s]=t[s],this.setDirty(!0))}},ld:function(){this.ad()},$d:function(t){var i=this.J;return i.elements&&!t&&(this.od=t=i.elements,this.rd=this.q_,delete i.elements),this.J.elementsConfig&&this.J_(this.od,i.elementsConfig),t},J_:function(t,i){for(var e=0;e<t.length;e++){var s=t[e];H.extend(s,i);var n,h=i;s.elementsConfig&&(h=H.extend(H.extend({},s.elementsConfig),i)),(n=s.body?[s.body]:s.rows||s.cols||s.cells||s.body)&&this.J_(n,h)}},$getSize:function(t,i){var e=Cn.api.$getSize.call(this,t,i),s=this.getParentView(),n=this.rd?3:1;return s&&this.rd!=s.rd&&(e[n]+=1e5),e},render:function(){},refresh:function(){this.render()}},sh={api:eh,view:H.protoUI(eh,Ue,li,xs,Cn.view,_e)},nh={name:"form",defaults:{type:"form",autoheight:!0},K_:-1,X_:"webix_form",q_:!0,$init:function(){this.st.setAttribute("role","form")},$getSize:function(t,i){this.ge&&!this.J.width&&(t+=S.scrollSize);var e=Cn.api.$getSize.call(this,t,i);return!this.J.scroll&&this.J.autoheight||(e[2]=this.J.height||this.J.minHeight||0,e[3]+=1e5),e}},hh=(H.protoUI(nh,sh.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.st.className+=" "+i,this.st.innerHTML="<fieldset><legend class='"+i+"_label"+(t.required?" webix_required":"")+"'></legend><div class='"+i+"_body'></div></fieldset>"},label_setter:function(t){return this.st.firstChild.childNodes[0].innerHTML=t},getChildViews:function(){return[this.Z_]},body_setter:function(t){return(M._=this).Z_=zt(t,this.st.firstChild.childNodes[1]),t},getBody:function(){return this.Z_},resizeChildren:function(){if(this.Z_){var t=this.$width-this.J.paddingX,i=this.$height-this.J.paddingY,e=this.Z_.$getSize(0,0);e[0]>t&&(t=e[0]),e[2]>i&&(i=e[2]),this.Z_.$setSize(t,i),this.resize()}},$getSize:function(t,i){t+=this.J.paddingX,i+=this.J.paddingY;var e=this.Z_.$getSize(t,i),
s=this.Q_=Li.api.$getSize.call(this,t,i);return s[0]<e[0]&&(s[0]=e[0]),s[2]<e[2]&&(s[2]=e[2]),s[1]>e[1]&&(s[1]=e[1]),s[3]>e[3]&&(s[3]=e[3]),s[1]<s[0]&&(s[1]=s[0]),s[3]<s[2]&&(s[3]=s[2]),s},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(t=Math.min(this.Q_[1],t),i=Math.min(this.Q_[3],i),this.Z_.$setSize(t-this.J.paddingX,i-this.J.paddingY))}}),rh={api:hh,view:H.protoUI(hh,Li.view)},oh={name:"forminput",defaults:{$cssName:"webix_forminput",labelWidth:80,labelAlign:"left",paddingY:0,paddingX:0},setValue:function(t){this.Z_.setValue?this.Z_.setValue(t):this.Z_.setValues&&this.Z_.setValues(t)},focus:function(){return!!this.Z_.focus&&this.Z_.focus()},getValue:function(){return this.Z_.getValue?this.Z_.getValue():this.Z_.getValues?this.Z_.getValues():void 0},getBody:function(){return this.Z_},$skin:function(){this.tp=Xi.inputPadding,this.ip=Xi.inputSpacing,this.ep=Xi.labelTopHeight||15},$init:function(t){if(this.$ready.push(function(){var t=this.st.firstChild.childNodes[0];if(!this.J.label||!this.J.labelWidth)return t.style.display="none",void(this.J.paddingX=this.J.paddingY=0);"top"==this.J.labelPosition?(t.style.lineHeight=this.ep-this.tp+"px",t.className+=" "+this.defaults.$cssName+"_label_top"):t.style.width=this.J.paddingX+"px",t.style.textAlign=this.J.labelAlign,this.J.value&&this.setValue(this.J.value)}),"top"!=t.labelPosition){var i=x(t.labelWidth)?this.defaults.labelWidth:t.labelWidth;t.paddingX=i-2*this.tp+2*this.ip}else t.paddingY=this.ep},setBottomText:function(t){var i=this.J;if(void 0!==t){if(i.bottomLabel==t)return;i.bottomLabel=t}var e=(i.invalid?i.invalidMessage:"")||i.bottomLabel;this.sp&&G(this.sp),e&&(this.$view.style.position="relative",this.sp=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.J.labelWidth+"px; "},e),this.st.appendChild(this.sp))}};H.protoUI(oh,rh.view);function ah(t){return t.tagName?t.tagName.toLowerCase():null}function uh(t,i){if(!t.getAttribute)return null;var e=t.getAttribute(i);return e?e.toLowerCase():null}function ch(){var t=ah(this);return fh[t]?fh[t](this):fh.other(this)}var fh={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"===uh(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 lh(t){var i=ah(this);return dh[i]?dh[i](this,t):dh.other(this,t)}var dh={radio:function(t,i){for(var e=0;e<t.length;e++)t[e].checked=t[e].value==i},input:function(t,i){"checkbox"===uh(t,"type")?t.checked=!!i:t.value=i},textarea:function(t,i){t.value=i},select:function(t,i){t.value=i,-1===t.selectedIndex&&(t.value=t.firstElementChild.value)},other:function(t,i){t.innerHTML=i}},vh={name:"htmlform",$init:function(t){this.elements={},this.np=!1,t.content&&(t.container==t.content||!t.container&&t.content==document.body)&&(this.hp=!0)},content_setter:function(t){if(t=D(t),this.hp)for(;1<t.childNodes.length;)this.st.childNodes[0].appendChild(t.childNodes[0]);else this.st.childNodes[0].appendChild(t);return this.rp(),!0},render:function(){Tn.api.render.apply(this,arguments),this.rp()},rp:function(){var t=this.st.querySelectorAll("[name]");this.elements={};for(var i=0;i<t.length;i++){var e=t[i],s=uh(e,"name");if(s){var n="button"===ah(e),h=uh(e,"type"),r=n||"button"===h||"submit"===h;if("radio"===h){var o=this.elements[s]||[];o.tagName="radio",o.push(e),e=o}(this.elements[s]=e).getValue=ch,e.setValue=lh,e.$allowsClear=!r}}return this.elements},sr:function(t,i){this.Zh(t,i);var e=this.st.querySelector('[name="'+t+'"]');e&&et(e,"invalid")},Zh:function(t){var i=this.st.querySelector('[name="'+t+'"]');i&&st(i,"invalid")},focus:function(t){if(!t&&this.$view.contains(document.activeElement))return!1;xs.focus.apply(this,arguments)}},_h=(H.protoUI(vh,Tn.view,xs),{name:"property",$init:function(){this.Yi.className+=" webix_property",this.Yi.setAttribute("role","listbox"),this.ht=[],
this.attachEvent("onAfterEditStart",function(t){et(this.getItemNode(t),"webix_focused")}),this.attachEvent("onAfterEditStop",function(t,i){st(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},Xo:"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 e in i.click)this.on_click[e]=i.click[e]},elements_setter:function(t){this.op={};for(var i=0;i<t.length;i++){var e=t[i];"multiselect"==e.type&&(e.optionslist=!0),e.id=e.id||z(),e.label=e.label||"",e.value=e.value||"",this.op[e.id]=i,this.template=this.Mu(t[i])}return t},showItem:function(t){Oe.showItem.call(this,t)},locate:function(){return q(arguments[0],this.Xo)},getItemNode:function(t){return this.mt.childNodes[this.op[t]]},getItem:function(t){return this.J.elements[this.op[t]]},ya:function(t){var i=this.getItem(t).type;if("checkbox"==i)return"inline-checkbox";var e=this.on_edit[i];return!1!==e&&(e||i)},Ca:function(t){return this.getItem(t)},Ha:function(t,i,e){var s=this.op[t.id],n=this.J.elements;if(e){for(var h=s+1;h<n.length;h++)if(i.call(this,n[h].id))return n[h].id}else for(var r=s-1;0<=r;r--)if(i.call(this,n[r].id))return n[r].id;return null},updateItem:function(t,i){i=i||{};var e=this.getItem(t);e&&H.extend(e,i,!0),this.refresh()},Gt:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft+this.J.nameWidth,top:i.offsetTop,height:i.firstChild.offsetHeight,width:this.ap,parent:this.Yi}},cp:function(){for(var t=this.J.elements,i=0;i<t.length;i++)t[i].value=""},clear:function(){this.cp(),this.fp={},this.refresh()},setValues:function(t,i){var e=this;for(var s in this.J.complexData&&(t=xt.collapseNames(t,"",{},function(t){return x(e.op[t])})),i||this.cp(),t){var n=this.getItem(s);n&&(n.value=t[s])}this.fp=t,this.refresh()},getValues:function(){for(var t=f(this.fp||{}),i=0;i<this.J.elements.length;i++){var e=this.J.elements[i];"label"!=e.type&&(t[e.id]=e.value)}return this.J.complexData&&(t=xt.expandNames(t)),t},refresh:function(){this.render()},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(this.ap=this.be-this.J.nameWidth,this.render())},$getSize:function(t,i){if(this.J.autoheight){var e=this.J.elements.length;this.J.height=Math.max(this.type.height*e,this.J.minHeight||0)}return Li.api.$getSize.call(this,t,i)},Ot:function(){var t=[],i=this.J.elements;if(i)for(var e=0;e<i.length;e++){var s=i[e];s.css&&"object"==k(s.css)&&(s.css=L(s.css));var n='<div webix_f_id="'+s.id+'"'+("label"!==s.type?'role="option" tabindex="0"':"")+' class="webix_property_line '+(s.css||"")+'">';if("label"==s.type)t[e]=n+"<div class='webix_property_label_line'>"+s.label+"</div></div>";else{var h,r=this.on_render[s.type],o="<div class='webix_property_label' style='width:"+this.J.nameWidth+"px'>"+s.label+"</div><div class='webix_property_value' style='width:"+this.ap+"px'>";h=s.collection||s.options?s.template(s,s.value):s.format?s.format(s.value):s.value,r&&(h=r.call(this,s.value,s)),t[e]=n+o+h+"</div></div>"}}return t.join("")},type:{height:24,templateStart:It(""),templateEnd:It("</div>")},$skin:function(){this.type.height=Xi.propertyItemHeight}}),ph=(H.protoUI(_h,Yi,De,Re,Pe,Ue,Oi,li,g,Li.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:tn.isHoliday,minuteStep:5,timeIcon:"wxi-clock",icons:!1,timepickerHeight:30,headerHeight:70,dayTemplate:function(t){return t.getDate()},width:260,height:250},dayTemplate_setter:It,
calendarHeader_setter:tn.dateToStr,calendarWeekHeader_setter:tn.dateToStr,calendarTime_setter:function(t){return this.lp=t,tn.dateToStr(t)},date_setter:function(t){return this.Wd(t)},maxDate_setter:function(t){return this.Wd(t)},minDate_setter:function(t){return this.Wd(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},vp:function(){var t="focus"+(S.isIE?"in":"");S.touch||Nt(this.$view,t,C(function(t){var i=t.target.className,e=-1!==i.indexOf("webix_cal_day")?"webix_cal_day":-1!==i.indexOf("webix_cal_block")?"webix_cal_block":"";if(300<new Date-Ai.ai&&100<new Date-Ai.ci&&e){var s=t.relatedTarget;if(s&&!x(s.className)){var n="webix_cal_day"==e?this._p(t.target):this.pp(t.target);this.Qa(n)}}},this),{capture:!S.isIE})},$init:function(){this.st.className+=" webix_calendar",this.st.setAttribute("role","region"),this.st.setAttribute("aria-label",ct.aria.calendar),this.mp={},this.bp={},this.Bd=0,this.vp(),this.attachEvent("onKeyPress",this.Se),this.attachEvent("onAfterZoom",function(t){0<=t&&this.$view.querySelector(".webix_cal_month_name").blur()})},type_setter:function(t){return"time"==t?(this.gp=!0,this.Bd=-1):"year"==t&&(this.wp=!0),t},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},$getSize:function(t,i){if(this.J.cellHeight){var e=this.xp(this.J.date);this.J.height=this.J.cellHeight*e.yp+(Xi.calendarHeight||70)}return Li.api.$getSize.call(this,t,i)},moveSelection:function(t,i,e){if(!this.config.master){var s=this.getSelectedDate();this.config.multiselect&&(s=s[0]);var n=tn.copy(s||this.getVisibleDate());this.Qa(n,t,e)}},Qa:function(t,i,e){var s=this.sv[this.Bd].Mp(t,i,this);if(!1!==e){var n=this.st.querySelector("."+s+"[tabindex='0']");n&&n.focus()}},xp:function(t,i){if(!this.Sp||i){var e=t.getMonth(),s=t.getFullYear(),n=new Date(s,e+1,1),h=tn.weekStart(new Date(s,e,1)),r=Math.round((n.valueOf()-h.valueOf())/864e5),o=this.J.skipEmptyWeeks?Math.ceil(r/7):6;this.Sp={kp:e,Cp:h,kd:n,yp:o}}return this.Sp},$skin:function(){Xi.calendar&&(Xi.calendar.width&&(this.defaults.width=Xi.calendar.width),Xi.calendar.height&&(this.defaults.height=Xi.calendar.height),Xi.calendar.headerHeight&&(this.defaults.headerHeight=Xi.calendar.headerHeight),Xi.calendar.timepickerHeight&&(this.defaults.timepickerHeight=Xi.calendar.timepickerHeight))},$p:function(t){for(var i=this.xp(t),e=this.J,s=[],n=[],h=Infinity,r=this.be-36,o=this.we-this.J.headerHeight-10-(this.J.timepicker||this.Gd?this.J.timepickerHeight:0),a=e.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.yp,f=0;f<c;f++)s[f]=Math.ceil(o/(c-f)),o-=s[f],h=Math.min(h,s[f]);return[n,s,h]},icons_setter:function(t){t?"object"==k(t)?this.Gd=t:this.Gd=this.Dp:this.Gd=null},Gd:[],Dp:[{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.J.timepicker||(t=tn.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.Bd=0,this.Ap=!1;var t=this.J;if(this.isVisible(t.id)){this.Ip=tn.datePart(new Date),this.callEvent("onBeforeRender",[]);var i=this.J.date,e=this.xp(i,!0),s=this.$p(i),n=s[0],h=s[1],r="<div class='webix_cal_month'><span role='button' tabindex='0' aria-live='assertive' aria-atomic='true' class='webix_cal_month_name"+(this.J.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.Tp(n)+"</div>"),r+="<div class='webix_cal_body'>"+this.Fp(n,h,e,s[2])+"</div>",(this.J.timepicker||this.Gd)&&(r+="<div class='webix_cal_footer'>",this.J.timepicker&&(r+=this.zp(i)),this.Gd&&(r+=this.Xd()),r+="</div>"),this.Yi.innerHTML=r,"time"==this.J.type){var o=this.J.date;o&&("string"==typeof o?i=ct.parseTimeFormatDate(o):b(o)&&(i.setHours(o[0]),i.setMinutes(o[1]))),this.Vp(-1,i)}else"month"==this.J.type?this.Vp(1,i):"year"==this.J.type&&this.Vp(2,i);this.callEvent("onAfterRender",[])}},Xd:function(t){for(var i="<div class='webix_cal_icons'>",e=this.Gd,s=0;s<e.length;s++){if(e[s].template){var n="function"==typeof e[s].template?e[s].template:n(e[s].template);i+=n.call(this,t)}e[s].on_click&&H.extend(this.on_click,e[s].on_click)}return i+="</div>"},zp:function(t){var i=this.J.calendarTime||ct.timeFormatStr,e=this.J.timeIcon,s="";if(this.J.master){var n=B(Pt(this.J.master).J.value);for(var h in tn.equal(n.end,t)&&(n.start=n.end),n)s+="<div role='button' tabindex='0' class='webix_range_time_"+h+" webix_cal_time'><span class='webix_icon "+e+"'></span> "+i(n[h])+"</div>"}else s="<div role='button' tabindex='0' class='webix_cal_time"+(this.Gd?" webix_cal_time_icons":"")+"'><span class='webix_icon "+e+"'></span> "+i(t)+"</div>";return s},Tp:function(t){var i=this.J,e="",s=0;i.weekNumber&&(s=1,e+="<div class='webix_cal_week_header' style='width: "+t[0]+"px;' >"+i.calendarWeekHeader()+"</div>");for(var n=tn.startOnMonday?1:0,h=0;h<7;h++){var r=(n+h)%7,o=ct.calendar.dayShort[r];e+="<div day='"+r+"' style='width: "+t[h+s]+"px;' >"+o+"</div>"}return e},blockDates_setter:function(t){return m(t,this.$scope)},Hp:function(t,i){var e="",s=!1;return tn.equal(t,this.Ip)&&(e+=" webix_cal_today"),this.Bp(t)||(e+=" webix_cal_day_disabled"),t.getMonth()!=i.kp&&(s=!0,e+=" webix_cal_outside"),!s&&this.Rp(t)&&(e+=" webix_cal_select"),this.J.events&&(e+=" "+(this.J.events(t,s)||"")),e+=" webix_cal_day"},Fp:function(t,i,e,s){for(var n=this.J,h="",r=tn.datePart(tn.copy(e.Cp)),o=n.weekNumber?1:0,a=tn.getISOWeek(tn.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=tn.getISOWeek(tn.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.Hp(r,e),l=this.J.dayTemplate.call(this,r),d=this.Rp(r),v="",_=r.getMonth()!=e.kp;"object"==k(l)?(v=l.aria||v,l=l.text):v=tn.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.Pp(s,s)+"'>"+l+"</span></div>",(r=tn.add(r,1,"day")).getHours()&&(r=tn.datePart(r))}h+="</div>",a++}return h},hv:function(t,i){var e=this.J.date;i||(i=this.sv[this.Bd].ev),this.Bd||(e=tn.copy(e)).setDate(1);var s=tn.add(e,t*i,"month",!0);this.jp(e,s)},jp:function(t,i){this.callEvent("onBeforeMonthChange",[t,i])&&(this.Bd?this.Ep(i):this.showCalendar(i),this.callEvent("onAfterMonthChange",[i,t]))},sv:{"-2":{Np:function(t){var i=this.J,e=i.date,s=!1,n=i.minTime?i.minTime[0]:0,h=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24,r=i.minTime&&e.getHours()==n?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&e.getHours()==h-1?i.maxTime[1]:60;if(this.J.blockTime){var a=tn.copy(e);a.setMinutes(t),s=this.J.blockTime(a)}return t<r||o<=t||s},Lp:function(t,i){t.setMinutes(i)},Op:function(t,i,e){if(!this.Np.call(e,t.getMinutes()))return t;var s=e.J.minuteStep,n=tn.add(t,"right"==i?s:-s,"minute",!0);return t.getHours()===n.getHours()?this.Op(n,i,e):void 0}},"-1":{Np:function(t){
var i=this.J,e=i.date,s=i.minTime?i.minTime[0]:0,n=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24;if(t<s||n<=t)return!0;if(i.blockTime){var h=tn.copy(e);h.setHours(t);for(var r=i.minTime&&t==s?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}},Lp:function(t,i){t.setHours(i)},Mp:function(t,i,e){var s,n,h=e.J.minuteStep;return"bottom"===i||"top"===i?(t.setHours("bottom"===i?23:0),t.setMinutes("bottom"===i?55:0),t.setSeconds(0),t.setMilliseconds(0),s=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,s=e.sv[-2].Op(tn.add(t,n,"minute"),i,e)):"up"===i||"down"===i?(n="down"===i?1:-1,"down"===i&&23===t.getHours()&&(n=-23),"up"===i&&0===t.getHours()&&(n=23),s=this.Op(tn.add(t,n,"hour"),i,e)):!1===i&&(s=this.Op(t,i,e)),e.selectDate(s,!1),s&&(e.Ep(s),e.selectDate(s,!1)),"webix_cal_block"+("left"===i||"right"===i?"_min":"")},Op:function(t,i,e){if(!this.Np.call(e,t.getHours()))return t;var s=tn.add(t,"down"==i?1:-1,"hour",!0);return t.getDate()===s.getDate()?this.Op(s,i,e):void 0}},0:{ev:1,Mp:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=tn.add(t,"pgdown"===i?1:-1,"month"):"bottom"===i?s=new Date(t.getFullYear(),t.getMonth()+1,0):"top"===i?s=new Date(t.setDate(1)):"left"===i||"right"===i?s=tn.add(t,"right"===i?1:-1,"day"):"up"!==i&&"down"!==i||(s=tn.add(t,"down"===i?1:-1,"week")),e.Bp(s)||(s=e.Op(t,i)),s&&e.selectDate(s,!0),"webix_cal_day"}},1:{Np:function(t,i){var e,s,n=!1,h=i.J.minDate||null,r=i.J.maxDate||null,o=i.J.date.getFullYear();return h&&r&&(e=h.getFullYear(),s=r.getFullYear(),(o<e||o==e&&h.getMonth()>t||s<o||o==s&&r.getMonth()<t)&&(n=!0)),n},al:function(t,i){return t<i.J.minDate?t=tn.copy(i.J.minDate):t>i.J.maxDate&&(t=tn.copy(i.J.maxDate)),t},Up:function(t){return t.getFullYear()},Yp:function(t){return ct.calendar.monthShort[t]},Lp:function(t,i){i!=t.getMonth()&&t.setDate(1),t.setMonth(i)},ev:12,Mp:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=tn.add(t,"pgdown"===i?1:-1,"year"):"bottom"===i?s=new Date(t.setMonth(11)):"top"===i?s=new Date(t.setMonth(0)):"left"===i||"right"===i?s=tn.add(t,"right"===i?1:-1,"month"):"up"!==i&&"down"!==i||(s=tn.add(t,"down"===i?4:-4,"month")),e.Bp(s)||(s=e.Op(t,i)),s&&(e.Ep(s),e.selectDate(s,!1)),"webix_cal_block"}},2:{Np:function(t,i){t+=i.Wp;var e=!1,s=i.J.minDate,n=i.J.maxDate;return s&&n&&(s.getFullYear()>t||n.getFullYear()<t)&&(e=!0),e},al:function(t,i){return t<i.J.minDate?t=tn.copy(i.J.minDate):t>i.J.maxDate&&(t=tn.copy(i.J.maxDate)),t},Up:function(t,i){var e=t.getFullYear();return i.Wp=e=e-e%10-1,e+" - "+(e+10+1)},Yp:function(t,i){return i.Wp+t},Lp:function(t,i,e){t.setFullYear(e.Wp+i)},ev:120,Mp:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=tn.add(t,"pgdown"===i?10:-10,"year"):"bottom"===i?s=new Date(t.setYear(e.Wp+10)):"top"===i?s=new Date(t.setYear(e.Wp)):"left"===i||"right"===i?s=tn.add(t,"right"===i?1:-1,"year"):"up"!==i&&"down"!==i||(s=tn.add(t,"down"===i?4:-4,"year")),e.Bp(s)||(s=e.Op(t,i)),s&&(e.Ep(s),e.selectDate(s,!1)),"webix_cal_block"}}},Gp:function(){var t;if(this.sv[-1].Np.call(this,this.J.date.getHours()))for(t=0;t<24;t++)if(!this.sv[-1].Np.call(this,t)){this.J.date.setHours(t);break}if(this.sv[-2].Np.call(this,this.J.date.getMinutes()))for(t=0;t<60;t+=this.J.minuteStep)if(!this.sv[-2].Np.call(this,t)){this.J.date.setMinutes(t);break}},Ep:function(t){var i,e,s,n,h,r,o,a,u,c,f,l,d="";if(h=(i=this.J).weekHeader?2:1,c=this.sv[this.Bd],r=this.Yi.childNodes,t&&(i.date=t),a=i.type,this.Ap||(this.Xp=this.Yi.offsetHeight-i.headerHeight,"year"!=a&&"month"!=a?this.Xp-=i.timepickerHeight:this.Gd&&(this.Xp-=10),this.qp=r[h].offsetWidth,this.Ap=1),this.gp){s=this.Xp/6;var v=6,_=(this.lp||ct.timeFormat).match(/%([a,A])/);for(_&&v++,u=parseInt((this.qp-3)/v,10),l=Math.min(u,s),d+="<div class='webix_time_header'>"+this.Jp(u,_)+"</div>",d+="<div  class='webix_cal_body' style='height:"+this.Xp+"px'>",this.Gp(),d+="<div class='webix_hours'>",o=i.date.getHours(),
f=tn.copy(i.date),n=0;n<24;n++){if(e="",_&&n%4==0){var p=n?12==n?ct.pm[0]:"":ct.am[0];d+="<div class='webix_cal_block_empty"+e+"' style='"+this.Pp(u,s)+"clear:both;'>"+p+"</div>"}this.sv[-1].Np.call(this,n)?e+=" webix_cal_day_disabled":o==n&&(e+=" webix_selected"),f.setHours(n),d+="<div aria-label='"+tn.dateToStr(ct.aria.hourFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block"+e+"' data-value='"+n+"' style='"+this.Pp(u,s)+(n%4!=0||_?"":"clear:both;")+"'><span style='display:inline-block; "+this.Pp(l,l)+"'>"+tn.toFixed(_?n&&12!=n?n%12:12:n)+"</span></div>"}for(d+="</div>",d+="<div class='webix_minutes'>",o=i.date.getMinutes(),f=tn.copy(i.date),n=0;n<60;n+=i.minuteStep)e="",this.sv[-2].Np.call(this,n)?e=" webix_cal_day_disabled":o==n&&(e=" webix_selected"),f.setMinutes(n),d+="<div aria-label='"+tn.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"+e+"' data-value='"+n+"' style='"+this.Pp(u,s)+(n%2==0?"clear:both;":"")+"'><span style='display:inline-block; "+this.Pp(l,l)+"'>"+tn.toFixed(n)+"</span></div>";d+="</div>",d+="</div>",d+="<div  class='webix_time_footer'>"+this.Kp()+"</div>",this.Yi.innerHTML=d}else{var m=r[0].childNodes,b=ct.aria["nav"+(1==this.Bd?"Year":"Decade")];for(m[0].innerHTML=c.Up(i.date,this),m[1].setAttribute("aria-label",b[0]),m[2].setAttribute("aria-label",b[1]),s=Math.floor(this.Xp/3),u=Math.floor(this.qp/4),l=Math.min(s,u),this.Bp(i.date)&&(o=1==this.Bd?i.date.getMonth():i.date.getFullYear()),n=0;n<12;n++){e=o==(1==this.Bd?n:c.Yp(n,this))?" webix_selected":"",c.Np(n,this)&&(e+=" webix_cal_day_disabled");var g=ct.aria[(1==this.Bd?"month":"year")+"Format"];d+="<div role='gridcell' aria-label='"+tn.dateToStr(g)(i.date)+"' tabindex='"+(-1!==e.indexOf("selected")?"0":"-1")+"' aria-selected='"+(-1!==e.indexOf("selected")?"true":"false")+"' class='webix_cal_block"+e+"' data-value='"+n+"' style='"+this.Pp(u,s)+"'><span style='display:inline-block; "+this.Pp(l,l)+"'>"+c.Yp(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.Kp():this.Yi.innerHTML+="<div  class='webix_time_footer'>"+this.Kp()+"</div>"),r[h].style.height=this.Xp+"px"}},Pp:function(t,i){return"width:"+t+"px; height:"+i+"px; line-height:"+i+"px;"},Kp:function(){return"<input type='button' style='width:100%' class='webix_cal_done' value='"+ct.calendar.done+"'>"},Jp:function(t,i){var e=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:"+e+"px'>"+ct.calendar.minutes+"</div>"},Vp:function(t,i){var e=this.Bd;this.callEvent("onBeforeZoom",[t,e])&&((this.Bd=t)?this.Ep(i):this.showCalendar(i),this.callEvent("onAfterZoom",[t,e]))},al:function(t){return!this.Bp(t)&&this.sv[this.Bd].al&&(t=this.sv[this.Bd].al(t,this)),t},Zp:function(t){var i=this.pp(t),e=this.Bd-(this.wp?0:1);if(i=this.al(i),this.Bp(i)){this.Vp(e,i);var s=this.J.type;"month"!=s&&"year"!=s||this.Qp(i)}},Qp:function(t,i){this.callEvent("onBeforeDateSelect",[t])&&(this.selectDate(t,!0,i),this.callEvent("onDateSelect",[t]),this.callEvent("onAfterDateSelect",[t]))},_p:function(t){var i=N(t)-(this.J.weekNumber?1:0),e=N(t.parentNode),s=tn.add(this.xp().Cp,i+7*e,"day",!0);return this.J.timepicker&&(s.setHours(this.J.date.getHours()),s.setMinutes(this.J.date.getMinutes())),s},pp:function(t){var i=1*t.getAttribute("data-value"),e=-1!=t.className.indexOf("webix_cal_block_min")?this.Bd-1:this.Bd,s=this.J.date,n=tn.copy(s);return this.sv[e].Lp(n,i,this),n},on_click:{webix_cal_prev_button:function(){this.hv(-1)},webix_cal_next_button:function(){this.hv(1)},webix_cal_day_disabled:function(){return!1},webix_cal_outside:function(){if(!this.J.navigation)return!1},webix_cal_day:function(t,i,e){var s=this._p(e),n="touch"===this.J.multiselect||t.ctrlKey||t.metaKey;this.Qp(s,n)},webix_cal_time:function(){if(this.sv[this.Bd-1]){this.gp=!0;var t=this.Bd-1
;this.Vp(t)}},webix_range_time_start:function(){Pt(this.J.master).iv="start"},webix_range_time_end:function(){Pt(this.J.master).iv="end"},webix_cal_done:function(){var t=tn.copy(this.J.date);t=this.al(t),this.Qp(t)},webix_cal_month_name:function(){if(this.gp=!1,2!=this.Bd&&this.J.monthSelect){var t=Math.max(this.Bd,0)+1;this.Vp(t)}},webix_cal_block:function(t,i,e){if(this.gp){if(-1!==e.className.indexOf("webix_cal_day_disabled"))return!1;var s=this.pp(e);this.Ep(s)}else-1==e.className.indexOf("webix_cal_day_disabled")&&this.Zp(e)}},Wd:function(t,i){return t?("string"==typeof t&&(t=i?tn.strToDate(i)(t):ct.parseFormatDate(t)),t):tn.datePart(new Date)},Bp:function(t){var i=this.J.blockDates&&this.J.blockDates.call(this,t),e=this.J.minDate,s=this.J.maxDate;return!i&&!(t<e||s<t)},Op:function(t,i){var e,s="top"===i||"left"===i||"pgup"===i||"up"===i?-1:1,n=tn.add(t,s,"day",!0);return this.Bp(n)?n:(0===this.Bd?e=t.getMonth()===n.getMonth():1===this.Bd?e=t.getFullYear()===n.getFullYear():2===this.Bd&&(e=n.getFullYear()>this.Wp&&n.getFullYear()<this.Wp+10),e?this.Op(n,i):void 0)},showCalendar:function(t){t=this.Wd(t),this.J.date=t,this.render(),this.resize()},Rp:function(t){return t&&this.bp[t.valueOf()]},getSelectedDate:function(){var t=[];for(var i in this.bp)t.push(tn.copy(this.bp[i]));return this.config.multiselect?t:t[0]||null},getVisibleDate:function(){return tn.copy(this.J.date)},setValue:function(t){this.selectDate(t,!0)},getValue:function(t){var i=this.getSelectedDate();return t&&(i=tn.dateToStr(t)(i)),i},selectDate:function(t,i,e){if(t&&e&&this.config.multiselect||(this.bp={}),t){b(t)||(t=[t]);for(var s=0;s<t.length;s++){var n=this.Wd(t[s]),h=tn.datePart(tn.copy(n)).valueOf();if(this.bp[h]&&e?delete this.bp[h]:this.bp[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}}),mh=(H.protoUI(ph,Be,Pe,Li.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(){Nt(this.st,"click",C(function(t){var i=q(t,"webix_val");this.setValue(i),this.callEvent("onItemClick",[this.J.value,t]),this.callEvent("onSelect",[this.J.value])},this)),this.$view.setAttribute("role","grid"),this.st.setAttribute("aria-readonly","true")},fu:function(){this.getValue()||this.moveSelection("up")},tm:function(t){var i=this.J.palette;t=(t||"").toUpperCase();for(var e=0,s=i.length;e<s;e++)for(var n=0,h=i[e].length;n<h;n++)if(i[e][n].toUpperCase()==t)return{row:e,col:n};return null},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.J.value},xf:function(){return this.st.firstChild},setValue:function(t){t&&"#"!=t.toString().charAt(0)&&(t="#"+t);var i=this.J.value;return this.J.value=t,this.$setValue(t,i),t},im:null,em:function(){if(this.im&&this.im.parentNode)return this.im;var t=this.im=document.createElement("div");return t.className="webix_color_selector",this.st.lastChild.appendChild(t),t},$setValue:function(t,i){if(this.isVisible(this.J.id)){var e,s,n,h,r,o=0,a=0;if(i&&(n=this.tm(i)),n||(n={row:0,col:0}),this.st.lastChild.childNodes[n.row].childNodes[n.col].setAttribute("tabindex","-1"),(n=this.tm(t))&&(e=this.st.lastChild.childNodes[n.row].childNodes[n.col]),!(e&&e.parentNode&&e.parentNode.parentNode))return this.im&&(this.im.style.left="-100px"),void this.st.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0");h=e.parentNode,o=e.offsetLeft-h.offsetLeft,a=-(this.$height-(e.offsetTop-h.parentNode.offsetTop)),e.setAttribute("tabindex","0"),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),e.setAttribute("aria-selected","true"),s=this.em(),r=["left:"+o+"px","top:"+a+"px","width:"+e.style.width,"height:"+e.style.height].join(";"),"undefined"!=typeof s.style.cssText?s.style.cssText=r:s.setAttribute("style",r)}},sm:function(t){function s(t){return We.toHex(t,2)}function h(t,i,e){return"#"+s(Math.floor(t)
)+s(Math.floor(i))+s(Math.floor(e))}function i(t,i,e){var s,n,h;if(i){var r=e<.5?e*(1+i):e+i-e*i,o=2*e-r;s=a(o,r,t+1/3),n=a(o,r,t),h=a(o,r,t-1/3)}else s=n=h=e;return{r:255*s,g:255*n,b:255*h}}function a(t,i,e){return e<0&&(e+=1),1<e&&(e-=1),e<1/6?t+6*(i-t)*e:e<=.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t}var e=[],n=t.rows-1,r=1/t.cols,o=(t.maxLightness-t.minLightness)/n,u=null;e.push(function _(t){for(var i=[],e=255,s=e/t,n=0;n<t;n++)e=Math.round(0<e?e:0),i.push(h(e,e,e)),e-=s;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}e.push(u),f+=o}this.J.palette=e},moveSelection:function(t,i,e){var s,n,h=this.getValue();if(h&&(s=this.tm(h)),s||(s={row:0,col:0}),s&&("up"==t||"down"==t?s.row=s.row+("up"==t?-1:1):"right"==t||"left"==t?s.col=s.col+("right"==t?1:-1):"top"==t?s.row=s.col=0:"bottom"==t&&(s.row=this.st.lastChild.querySelectorAll(".webix_color_row").length-1,s.col=this.st.lastChild.childNodes[s.row].childNodes.length-1),s.row=Math.max(s.row,0),0<=s.row&&(n=this.st.lastChild.childNodes[s.row].childNodes[s.col]),n&&(h=n.getAttribute("webix_val"),this.setValue(h),this.callEvent("onSelect",[this.J.value]),!1!==e))){var r=this.st.querySelector("div[tabindex='0']");r&&r.focus()}},render:function(){if(this.isVisible(this.J.id)){this.J.palette||this.sm(this.J);var t=this.J.palette;this.callEvent("onBeforeRender",[]);for(var h=It('<div role=\'gridcell\' tabindex=\'-1\' aria-label="{obj.val}" style="width:{obj.width}px;height:{obj.height}px;" webix_val="{obj.val}">'+(this.J.template||"")+"</div>"),r={width:0,height:0,val:0},i=this.$width,e=this.$height,s=[],n='<div class="webix_color_palette"role="rowgroup">',o="object"==k(t[0])?t[0]:t,a=0;a<o.length;a++)s[a]=Math.floor(i/(o.length-a)),i-=s[a];if("object"==k(t[0]))for(var u=0;u<t.length;u++){var c=Math.floor(e/(t.length-u));e-=c,n+=f(t[u],s,c)}else n+=f(t,s,e);n+="</div>",this.st.innerHTML=n,this.im=null,this.J.value?this.$setValue(this.J.value):this.st.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0"),this.callEvent("onAfterRender",[])}function f(t,i,e){for(var s='<div class="webix_color_row" role="row">',n=0;n<t.length;n++)r.width=i[n],r.height=e,r.val=t[n],s+=h(r);return s+="</div>"}},refresh:function(){this.render()}}),bh=(H.protoUI(mh,Be,Li.view,g),{name:"button",touchable:!0,$skin:function(){this.defaults.height=Xi.buttonHeight||Xi.inputHeight,this.ep=Xi.labelTopHeight||15,this.nm=Xi.borderWidth},defaults:{template:function(t,i){var e=i.$renderInput(t,i);return t.badge&&(e=e.replace("</button>","<span class='webix_badge'>"+t.badge+"</span></button>")),"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+e+"</div>"},label:"",borderless:!0},$renderInput:function(t){var i="class='webixtype_"+(t.type||"base")+"' ";return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+i+">"+It.escape(t.label||t.value)+"</button>"},$init:function(){this.st.className+=" webix_control webix_el_"+(this.$cssName||this.name),this.data=this.J,this.mt=this.st,this.$ready.push(function(){this.hm(this.config)})},hotkey_setter:function(t){var e=this;this.rm(t,function(t,i){e.isVisible()&&(it(e.$view.firstChild,"MouseEvents","click"),Q(i))})},rm:function(t,i,e){var s=Ai.addHotKey(t,i,e);this.attachEvent("onDestruct",function(){Ai.removeHotKey(s,i,e)})},type_setter:function(t){return this.Rd[t]&&(this.$renderInput=It(this.Rd[t])),this.om=("prev"==t||"next"==t)&&this.um,t},Rd:{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>"},cm:function(){for(var t=[],i=["input","select","textarea","button"],e=0;e<i.length;e++)for(var s=this.$view.getElementsByTagName(i[e]),n=0;n<s.length;n++)t.push(s[n]);return t},disable:function(){var t,i,e=this.xf();if(ji.api.disable.apply(this,arguments),e&&-1==e.className.indexOf(" webix_disabled_box")){e.className+=" webix_disabled_box";var s=this.cm();for(t=0;t<s.length;t++)s[t].setAttribute("disabled",!0);if((i=this.getInputNode())&&"div"==i.tagName.toLowerCase()&&(this.fm=i.getAttribute("tabIndex"),i.removeAttribute("tabIndex")),"top"==this.J.labelPosition){var n=this.mt.firstChild;n&&(n.className+=" webix_disabled_top_label")}}},enable:function(){ji.api.enable.apply(this,arguments);var t,i=this.xf();if(i){i.className=i.className.replace(" webix_disabled_box","");for(var e=this.cm(),s=0;s<e.length;s++)e[s].removeAttribute("disabled");if((t=this.getInputNode())&&!x(this.fm)&&t.setAttribute("tabIndex",this.fm),"top"==this.J.labelPosition){var n=this.mt.firstChild;n&&(n.className=n.className.replace(" webix_disabled_top_label",""))}}},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},setValue:function(t){t=this.$prepareValue(t);var i=this.J.value;if(this.$compareValue(i,t))return!1;this.J.value=t,this.lm&&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.dm(t,!1)},dm: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.lm?this.$getValue():this.J.value;return void 0===t?"":t},$getValue:function(){return this.J.value||""},focus:function(){if(!Ai.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.mt.getElementsByTagName("input")[0]||this.mt.getElementsByTagName("button")[0]},xf:function(){for(var t=0;t<this.mt.childNodes.length;t++)if(0<=this.mt.childNodes[t].className.indexOf("webix_el_box"))return this.mt.childNodes[t];return null},Te:function(t,i){var e=i.target||i.srcElement,s=this.xf();return s&&s.contains(e)?this.J:null},vm:Math.sqrt(2),um:function(){var t=this.J,i=this.xf().childNodes[1],e=i.previousSibling,s="next"==t.type?"right":"left",n=t.aheight-2*Xi.inputPadding-2*this.nm,h=n*this.vm/2;i.style.width=h+"px",i.style.height=h+"px",i.style.top=(n-h)/2+Xi.inputPadding+"px",i.style[s]=(n-h)/2+this.vm/2+"px",e.style.width=t.awidth-n/2-2+"px",e.style.height=n+2+"px",e.style[s]=n/2+2+"px",
e.style.top=Xi.inputPadding+"px"},hm:function(t){(t=t||this.J).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-Xi.inputPadding:0))},_m:function(){this.mm=this.J.inputWidth||(2<this.be-this.J.width?this.J.width:0)||this.be,this.bm=this.J.inputHeight||this.gm||0},resize:function(){return this.hm(),Li.api.resize.apply(this,arguments)},render:function(){if(this._m(),this.J.awidth=this.mm||this.be,this.J.aheight=this.bm||this.we,this.J.bheight=this.J.aheight+2,this.J.cheight=this.J.aheight-2*Xi.inputPadding,this.J.dheight=this.J.cheight-2,di.render.call(this)){if(this.lm=!0,this.om&&this.om(),this.J.align){var t=this.mt.firstChild;switch("top"==this.J.labelPosition&&t.nextSibling&&(t=t.nextSibling),this.J.align){case"right":t.style.cssFloat="right",t.style.textAlign="right";break;case"center":t.style.display="inline-block",t.parentNode.style.textAlign="center";break;case"middle":t.style.marginTop=Math.round((this.we-this.bm)/2)+"px";break;case"bottom":t.style.marginTop=this.we-this.bm+"px";break;case"left":t.style.cssFloat="left";break;default:this.J.align}}this.$render&&this.$render(this.data),this.J.disabled&&this.disable(),this.uh&&(this.uh(this.data),this.uh=0)}},refresh:function(){this.render()},on_click:{wm:function(t){var i=q(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.wm.call(this,t,i)},webix_all_tabs:function(t,i){this.on_click.wm.call(this,t,i)},webix_inp_counter_next:function(){this.J.readonly||this.next()},webix_inp_counter_prev:function(){this.J.readonly||this.prev()},webix_input_icon:function(){this.getInputNode().focus()},webix_inp_checkbox_border:function(t){this.J.disabled||"DIV"==(t.target||t.srcElement).tagName||this.J.readonly||this.toggle()},webix_inp_checkbox_label:function(){this.J.readonly||this.toggle()},webix_inp_radio_border:function(t){var i=q(t,"radio_id");this.setValue(i),this.focus()},webix_inp_radio_label:function(t,i,e){return e=e.parentNode.getElementsByTagName("input")[0],this.on_click.webix_inp_radio_border.call(this,e,i,e)},webix_tab_more_icon:function(t,i,e){this.getPopup().resize(),this.getPopup().show(e,null,!0)},webix_tab_close:function(t){var i=q(t,"button_id");i&&this.callEvent("onBeforeTabClose",[i,t])&&this.removeOption(i)}},eu: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]}:(x(t[i].id)&&(t[i].id=t[i].value),x(t[i].value)&&(t[i].value=t[i].id));return t},xm:function(t){var i=t?t.placeholder:this.J.placeholder;return i?"<span class='webix_placeholder'>"+i+"</span>":""}}),gh={api:bh,view:H.protoUI(bh,Li.view,Yi,di,Ii,g)},wh={name:"label",defaults:{template:"<div class='webix_el_box' style='width:#awidth#px;height:#aheight#px;line-height:#cheight#px'>#label#</div>"},$skin:function(){this.defaults.height=Xi.inputHeight},focus:function(){return!1},xf:function(){return this.mt.firstChild},setHTML:function(t){this.J.label=t,this.refresh()},setValue:function(t){this.J.label=t,gh.api.setValue.apply(this,arguments)},$setValue:function(t){this.mt.firstChild.innerHTML=t},om:function(){},hm:function(t){(t=t||this.J).autowidth&&(t.width=nt(t.value||t.label,"webix_el_label").width)}},xh=(H.protoUI(wh,gh.view),{});for(var yh in Ai.fi)xh[Ai.fi[yh]]=yh;var Mh={9:"tab",38:"up",40:"down",37:"left",39:"right"},Sh={$init:function(t){var i=this.defaults.pattern||t.pattern,e=this.defaults.format||t.format;t.value=x(t.value)?"":t.value,(i||e&&!this.format_setter)&&(this.attachEvent("onKeyPress",function(t,i){i.ctrlKey||i.altKey||this.ym||(105<t&&t<112&&(t-=64),xh[t]&&8!==t&&46!==t?Mh[t]||Q(i):(Q(i),this.Mm(i,t)))}),this.attachEvent("onAfterRender",this.Sm),this.getText=function(){return this.getInputNode().value},this.dm=function(t,i){return!1===i?this.km(t):this.Cm(t)},e&&("object"===k(e)?this.ym=e:(e=en.getConfig(e),this.ym={parse:function(t){return en.parse(t,e)},edit:function(t){
return en.format(t,e)}})))},pattern_setter:function(t){var i=ln[t]||t;return"string"==typeof i&&(i={mask:i}),i.allow=i.allow||/[A-Za-z0-9]/g,this.$m(i),i},Dm:function(){this.config.validate=this.config.validate||C(function(){var t=this.getText(),i=t.replace(this.Am,"");return(t.toString().match(this.Im)||[]).join("").length==i.length&&t.length==this.J.pattern.mask.length},this)},Sm:function(){var t=S.isIE8?"propertychange":"input";this.ym||Nt(this.getInputNode(),t,function(){var t=(new Date).valueOf();this.$view.offsetWidth;(!this.Tm||100<t-this.Tm)&&(this.Tm=t,this.$setValue(this.getText()))},{bind:this}),Nt(this.getInputNode(),"blur",function(){this.bi()},{bind:this})},$m:function(t){for(var i=t.mask,e={},s="",n=0,h=0;h<i.length;h++)"#"===i[h]?(e[h]=n,n++):(e[h]=!1,-1===s.indexOf(i[h])&&(s+="\\"+i[h]));this.Im=t.allow,this.Am=new RegExp("["+s+"]","g"),this.Fm=e,this.Dm()},Mm:function(t,i){var e=this.getInputNode(),s=e.value,n=at(e),h="";8==i||46==i?n.start==n.end&&(8==i?n.start--:n.end++):(h=String.fromCharCode(i),t.shiftKey||(h=h.toLowerCase())),s=s.substr(0,n.start)+h+s.substr(n.end),n=this.zm(h,s.length,n.start,i),this.Vm=i,this.$setValue(s),ot(e,n)},zm:function(t,i,e,s){if(t&&t.match(this.Im)||8==s||46==s)e=t?e+1:e,e=this.Hm(e,s);else if(i-1==e&&8!==s&&46!==s){var n=this.J.pattern.mask.indexOf("#",e);0<n&&(e+=n)}return e},Hm:function(t,i){var e=t-1*(46!==i);return!1===this.Fm[e]?(t+=8==i?-1:1,this.Hm(t,i)):!1===this.Fm[t]&&8!==i?this.Hm(t+1,i)-1:t},km:function(t){return this.ym?this.ym.parse(t):((t=t||0===t?t:"").toString().match(this.Im)||[]).join("").replace(this.Am,"")},Cm:function(t){if(this.ym)return this.ym.edit(this.ym.parse(t));var i=this.km(t),e=this.J.pattern.mask,s=this.J.pattern.mask,n=this.Fm,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];e=(c?e.substr(0,r):"")+c+(c&&f?e.substr(r+1):""),f||(h=!0)}a++}var l=this.Vm;if(l&&8!==l||!l&&a-1===o&&e.length<s.length)if(i){var d=r+1;if("#"!==s.charAt(d)&&e.length<s.length){var v=s.indexOf("#",d);v<0&&(v=s.length),e+=s.substr(d,v-d)}}else 46!==l&&(e+=s.substr(0,s.indexOf("#")));return this.Vm=null,e}},kh={name:"text",$allowsClear:!0,Bm:function(){this.$allowsClear&&(this.Rm||Nt(this.getInputNode(),"change",this.bi,{bind:this}),this.J.suggest&&Pt(this.J.suggest).linkInput(this))},bi:function(){var t=this.getValue(),i=this.setValue(t,!0);this.ym&&!1===i&&this.$setValue(t)},$skin:function(){this.defaults.height=Xi.inputHeight,this.defaults.inputPadding=Xi.inputPadding,this.ip=Xi.inputSpacing},$init:function(t){"top"==t.labelPosition&&x(t.height)&&this.defaults.height&&(t.height=this.defaults.height+(t.label?this.ep:0)),this.ht=[],this.attachEvent("onAfterRender",this.Bm),this.attachEvent("onBlur",function(){this.Rm&&this.Rm()})},$renderIcon:function(){var t=this.J;if(t.icon){var i=t.aheight-2*t.inputPadding,e=(i-18)/2-1,s=this.addSection?"role='button' tabindex='0' aria-label='"+ct.aria["multitext"+(t.mode||"")+"Section"]+"'":"";return"<span style='height:"+(i-e)+"px;padding-top:"+e+"px;' class='webix_input_icon "+t.icon+"' "+s+"></span>"}return""},relatedView_setter:function(t){return this.attachEvent("onChange",function(){var t=this.getValue(),i=this.J.relatedAction,e=this.J.relatedView,s=Pt(e);if(!s){var n=this.getTopParentView();n&&n.$$&&(s=n.$$(e))}"enable"==i?t?s.enable():s.disable():t?s.show():s.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.J.validate;!t&&this.J.required&&(t=ve.isNotEmpty);var i=this.getFormView(),e=this.J.name,s=this.getValue(),n={};return n[e]=s,!(t&&!i.ir(t,s,n,e))},bottomLabel_setter:function(t){return this.J.bottomPadding||(this.J.bottomPadding=18),t},Pm:function(){var t=this.J.invalidMessage;return"function"==typeof t&&t.call(this),t},setBottomText:function(t,i){var e=this.J;if(void 0!==t){if(e.bottomLabel==t)return;e.bottomLabel=t}var s=(e.invalid?e.invalidMessage:"")||e.bottomLabel;s||e.bottomPadding||(e.inputHeight=0),s&&!e.bottomPadding?(
this.jm=1,e.bottomPadding=e.bottomPadding||i||18,this.render(),this.resize()):!s&&this.jm?(e.bottomPadding=this.jm=0,e.height||this.render(),this.resize()):this.render()},$getSize:function(){var t=Li.api.$getSize.apply(this,arguments),i=this.config.bottomPadding;return i&&(t[2]+=i,t[3]+=i),t},$setSize:function(t,i){var e=this.J;if(Li.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==e.labelPosition?(e.inputHeight||(this.gm=this.we-(e.label?this.ep:0)-(this.config.bottomPadding||0)),e.labelWidth=0):e.bottomPadding&&(e.inputHeight=this.we-this.config.bottomPadding),this.render()}},Em:function(t){var i=(this.mm||0)-(t.label?this.J.labelWidth:0)-this.ip-(t.iconWidth||0);return i<0?0:i},Nm:function(t,i){var e="x"+z(),s=i.Em(t),n=t.inputAlign||"left",h=this.J.aheight-2*Xi.inputPadding-2*this.nm,r=t.text||t.value||this.xm(t),o="<div class='webix_inp_static' role='combobox' aria-label='"+It.escape(t.label)+"' tabindex='0'"+(t.readonly?" aria-readonly='true'":"")+(t.invalid?"aria-invalid='true'":"")+" onclick='' style='line-height:"+h+"px;width: "+s+"px; text-align: "+n+";' >"+r+"</div>";return i.$renderInput(t,o,e)},Lm:function(t){var i="<"+t+(this.J.placeholder?" placeholder='"+this.J.placeholder+"' ":" ");this.J.readonly&&(i+="readonly='true' aria-readonly=''"),this.J.required&&(i+="aria-required='true'"),this.J.invalid&&(i+="aria-invalid='true'");var e=this.J.attributes;if(e)for(var s in e)i+=s+"='"+e[s]+"' ";return i},$renderLabel:function(t,i){var e="";if(t.label){var s=t.labelAlign||"left",n="top"==this.J.labelPosition;e="<label style='"+(n?"display:block;":"width: "+this.J.labelWidth+"px;")+"text-align: "+s+";line-height:"+this.Om(n)+"px;' onclick='' for='"+i+"' class='webix_inp_"+(n?"top_":"")+"label "+(t.required?"webix_required":"")+"'>"+(t.label||"")+"</label>"}return e},Om:function(t){return t?this.ep-this.J.inputPadding:this.J.aheight-2*this.J.inputPadding},$renderInput:function(t,i,e){var s=t.inputAlign||"left",n="top"==t.labelPosition,h=this.Em(t);e=e||z();var r=this.$renderLabel(t,e),o="";if(i)o+=i;else{var a=It.escape(t.text||this.dm(t.value));o+=this.Lm("input")+"id='"+e+"' type='"+(t.type||this.name)+"'"+(t.editable?" role='combobox'":"")+" value='"+a+"' style='width: "+h+"px; text-align: "+s+";'";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*Xi.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,Xi.inputPadding)+"px;'>"+d+"</div>"),f},defaults:{template:function(t,i){return i.$renderInput(t)},label:"",labelWidth:80},type_setter:function(t){return t},om:!1,$setValue:function(t){this.getInputNode().value=this.dm(t)},$getValue:function(){return this.dm(this.getInputNode().value,!1)},suggest_setter:function(t){if(t){if("string"==typeof t){if(Pt(t))return Pt(t).J.id;t={body:{url:t,dataFeed:t}}}else t.getItem?t={body:{data:t}}:b(t)?t={body:{data:this.eu(t)}}:t.body||(t.body={});H.extend(t,{view:"suggest"});var i=zt(t);return this.ht.push(i),i.J.id}return!1}},Ch={api:kh,view:H.protoUI(kh,Sh,gh.view)},$h=H.proto({name:"DataCollection",isVisible:function(){return!!(this.data.order.length||this.data.Cr||this.J.dataFeed)},$init:function(t){this.data.provideApi(this,!0);var i=t&&t.id?t.id:z();this.J.id=i,(zt.views[i]=this).data.attachEvent("onStoreLoad",C(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},de,Fi,Hi,ws,we,Re,g,Bi,Ti,Ii);u("DataCollection",$h);var Dh={name:"select",defaults:{template:function(i,t){var e=t.eu(i.options),s="x"+z(),n=t.Lm("select")+"id='"+s+"' style='width:"+t.Em(i)+"px;'>",h=Pt(e);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<e.length;r++)n+="<option"+(e[r].id==i.value?" selected='true'":"")+" value='"+e[r].id+"'>"+e[r].value+"</option>";return n+="</select>",t.$renderInput(i,n,s)}},options_setter:function(t){if(t){if("string"!=typeof t)return t;var i=new $h({url:t});return i.data.attachEvent("onStoreLoad",C(this.refresh,this)),i}},getInputNode:function(){return this.mt.getElementsByTagName("select")[0]}},Ah=(H.protoUI(Dh,Ch.view),{name:"checkbox",defaults:{checkValue:1,uncheckValue:0,template:function(t,i){var e="x"+z(),s="";t.labelRight&&(s="<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.J.aheight-16)/2),r=i.Lm("input")+"style='margin-top:"+h+"px;"+(t.customCheckbox?"display:none":"")+"' id='"+e+"' type='checkbox' "+(n?"checked='1'":"")+(t.labelRight?" aria-label='"+It.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"+It.escape(t.labelRight||t.label))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false")));var u="<div style='line-height:"+i.J.cheight+"px' class='"+o+"'>"+r+a+s+"</div>";return i.$renderInput(t,u,e)}},customCheckbox_setter:function(t){return!0===t&&Xi.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()},dm:function(t){return t},Bm:function(){},$setValue:function(t){var i=t==this.J.checkValue,e=this.$view.getElementsByTagName("input")[0],s=e?e.parentNode:null;if(s&&this.J.customCheckbox){var n=s.getElementsByTagName("BUTTON");n[0]&&n[0].setAttribute("aria-checked",i?"true":"false")}s&&(s.className=s.className.replace(/(webix_checkbox_)\d/,"$1"+(i?1:0))),e.checked=i},toggle:function(){var t=this.getValue()!=this.J.checkValue?this.J.checkValue:this.J.uncheckValue;this.setValue(t)},getValue:function(){return this.J.value==this.J.checkValue?this.J.checkValue:this.J.uncheckValue},getInputNode:function(){return this.$view.getElementsByTagName(this.J.customCheckbox?"button":"input")[0]},$skin:function(){this.defaults.customCheckbox=!!Xi.customCheckbox}}),Ih={api:Ah,view:H.protoUI(Ah,Ch.view)},Th={name:"radio",defaults:{template:function(t,i){for(var e,s=i.eu(t.options),n=[],h=0;h<s.length;h++){var r="x"+z();e=e||r,h&&(s[h].newline||t.vertical)&&n.push("<div class='webix_line_break'></div>");var o=s[h].id==t.value,a=s[h].value||"",u=t.tooltip?" webix_t_id='"+s[h].id+"'":"",c=t.customRadio||"";if(c){var f=(0===h?t.label+" ":"")+a;c=(c=(c=(c=(c=c.replace(/(aria-label=')\w*(?=')/,"$1"+It.escape(f))).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"+s[h].id)}var l=i.Lm("input")+" name='"+(t.name||t.id)+"' type='radio' "+(o?"checked='1'":"")+"tabindex="+(o||0===h&&!t.value?"0":"-1")+" value='"+s[h].id+"' id='"+r+"' style='"+(c?"display:none":"")+"' />",d="<div radio_id='"+s[h].id+"' class='webix_inp_radio_border webix_radio_"+(o?"1":"0")+"' role='presentation'>"+l+c+"</div>";a&&(a="<label for='"+r+"' class='webix_label_right'>"+a+"</label>"),n.push("<div class='webix_radio_option' role='presentation'"+u+">"+d+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,e)}},refresh:function(){this.render(),this.me&&this.$getSize(0,0)[2]!=this.me[1]&&this.resize()},$getSize:function(t,i){var e=gh.api.$getSize.call(this,t,i);if(this.J.options){for(var s=this.J.vertical?0:1,n=0;n<this.J.options.length;n++)(
this.J.vertical||this.J.options[n].newline)&&s++;e[3]=e[2]=Math.max(e[2],(this.J.optionHeight||25)*s+2*this.J.inputPadding+("top"==this.J.labelPosition?this.ep:0))}var h=this.config.bottomPadding;return h&&(e[2]+=h,e[3]+=h),e},tu:function(){return this.mt.getElementsByTagName(this.J.customRadio?"button":"input")},$setValue:function(t){for(var i=this.mt.getElementsByTagName("input"),e=0;e<i.length;e++){i[e].parentNode.getAttribute("radio_id")==t?(i[e].checked=!0,i[e].setAttribute("tabindex","0")):(i[e].checked=!1,i[e].setAttribute("tabindex","-1"));var s=i[e]?i[e].parentNode:null;if(s&&(s.className=s.className.replace(/(webix_radio_)\d/,"$1"+(i[e].checked?1:0)),this.J.customRadio)){var n=s.getElementsByTagName("BUTTON");n[0]&&(n[0].setAttribute("aria-checked",i[e].checked?"true":"false"),n[0].setAttribute("tabindex",i[e].checked?"0":"-1"))}}},getValue:function(){return this.J.value},focus:function(){return this.gi()},blur:function(){this.iu()},customRadio_setter:function(t){return!0===t&&Xi.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=!!Xi.customRadio,Xi.optionHeight&&(this.defaults.optionHeight=Xi.optionHeight)}},Fh=(H.protoUI(Th,Ch.view,ze),{name:"datepicker",$init:function(){this.$ready.push(this.Um)},defaults:{template:function(t,i){"time"==i.J.type&&(i.J.icon=i.J.timeIcon);var e=t.type;t.type="";var s=t.editable?i.$renderInput(t):i.Nm(t,i);return t.type=e,s},stringResult:!1,timepicker:!1,icon:"wxi-calendar",icons:!0,timeIcon:"wxi-clock",separator:", "},Rm:function(){if(this.J.text!=this.getText()&&(!x(this.J.text)||this.getText())){var t=this.getPopup().getValue();t&&this.setValue(t)}},$skin:function(){this.defaults.inputPadding=Xi.inputPadding,this.defaults.point=!Xi.popupNoPoint},getPopup:function(){return Pt(this.J.popup)},Um:function(){var t=this.J;if(t.suggest)t.popup=t.suggest;else if(!t.popup){var i=this.J.timepicker;t.popup=t.suggest=this.suggest_setter({type:"calendar",point:!1!==this.J.point,padding:0,body:{height:240+(i||this.J.icons?30:0),width:250,multiselect:this.J.multiselect,timepicker:i,type:this.J.type,icons:this.J.icons,timeIcon:this.J.timeIcon}})}this.uh=function(){}},$render:function(t){x(t.value)||(t.value=this.$prepareValue(t.value),this.$setValue(t.value))},$prepareValue:function(t){if(this.J.multiselect){"string"==typeof t?t=t.split(this.J.separator):t instanceof Date?t=[t]:t||(t=[]);for(var i=0;i<t.length;i++)t[i]=this.Ym(t[i]);return t}return this.Ym(t)},Ym:function(t){var i=this.J.type,e="time"==i;if(isNaN(parseFloat(t))||(t=""+t),"string"==typeof t&&t){t=("month"!=i&&"year"!=i||!this.Wm?e?ct.parseTimeFormatDate:ct.parseFormatDate:this.Wm)(t)}if(t){if(e&&b(t)){var s=new Date;s.setHours(t[0]),s.setMinutes(t[1]),t=s}isNaN(t.getTime())&&(t="")}return t},Gm:function(t){return this.J.multiselect?[].concat(t).map(function(t){return this.Xm(t)}.bind(this)).join(this.config.separator):this.Xm(t)},Xm:function(t){var i="time"==this.J.type,e=this.config.timepicker;return(this.qm||(i?ct.timeFormatStr:e?ct.fullDateFormatStr:ct.dateFormatStr))(t)},Jm:function(){var t=this.getInputNode();t.value==undefined?t.innerHTML=this.J.text||this.xm():t.value=this.J.text||""},$compareValue:function(t,i){return!t&&!i||tn.equal(t,i)},$setValue:function(t){this.J.text=t?this.Gm(t):"",this.Jm()},format_setter:function(t){return t?"function"==typeof t?this.qm=t:(this.qm=tn.dateToStr(t),this.Wm=tn.strToDate(t)):this.qm=this.Wm=null,t},getInputNode:function(){return this.J.editable?this.mt.getElementsByTagName("input")[0]:this.mt.getElementsByTagName("DIV")[1]},getValue:function(){if(this.J.multiselect){var t=this.J.value;if(!t)return[];var i=[].concat(t).map(function(t){return this.Km(t)}.bind(this));return this.J.stringResult?i.join(this.J.separator):i}return this.Km(this.J.value)},Km:function(t){var i=this.J.type,e="time"==i,s=this.config.timepicker;if(this.lm){if(this.J.editable){t=(this.Wm||(
e?ct.timeFormatDate:s?ct.fullDateFormatDate:ct.dateFormatDate))(this.getInputNode().value)}}else t=this.$prepareValue(t)||null;if(this.J.stringResult){var n=ct.parseFormatStr;return e&&(n=ct.parseTimeFormatStr),!this.qm||"month"!=i&&"year"!=i||(n=this.qm),this.J.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:""}}),zh={api:Fh,view:H.protoUI(Fh,Ch.view)},Vh={name:"colorpicker",$init:function(){this.$ready.push(this.Um)},defaults:{icon:!0},Um:function(){var t=this.J;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({type:"colorboard",height:200})),this.uh=function(){}},$render:function(t){x(t.value)||(t.value=this.$prepareValue(t.value),this.$setValue(t.value))},getValue:function(){return this.lm&&this.J.editable?this.getInputNode().value:this.J.value},$prepareValue:function(t){return t&&t.charAt&&"#"!=t.charAt(0)&&(t="#"+t),t||""},Zm:function(){return this.$view.getElementsByTagName("DIV")[this.J.editable?1:2]},Gm:function(t){return t},$setValue:function(t){this.Zm().style.backgroundColor=t,this.J.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>'}},Hh=(H.protoUI(Vh,zh.view),{name:"richselect",defaults:{template:function(t,i){return i.Nm(t,i)},popupWidth:200,icon:"wxi-menu-down"},Rm:function(){if(this.J.text!=this.getText()&&(!x(this.J.text)||this.getText())){var t=this.getPopup(),i=this.getInputNode().value,e=t.getSuggestion(i),s=this.getValue();!e||e==s||""===i&&""!==t.getItemText(e)?""===i?this.setValue(""):this.Qm&&this.Qm():this.setValue(e)}},suggest_setter:function(t){return this.options_setter(t)},options_setter:function(t){t=this.tb?this.tb(t):t;var i=this.J.popup=this.J.suggest=Ch.api.suggest_setter.call(this,t),e=Pt(i).getList();return e&&e.attachEvent("onAfterLoad",C(this.ib,this)),i},getList:function(){var t=Pt(this.J.suggest);return t.getList()},dm:function(t){return t},ib:function(){var t=this.J.value;x(t)||this.getPopup().isVisible()||this.J.text||!this.mt.firstChild||this.$setValue(t)},$skin:function(){this.defaults.inputPadding=Xi.inputPadding},$render:function(t){x(t.value)||this.$setValue(t.value)},getInputNode:function(){return this.mt.getElementsByTagName("DIV")[1]},getPopup:function(){return Pt(this.J.popup)},getText:function(){var t=this.J.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.lm){var i=t;if(this.getPopup()&&(i=this.getPopup().getItemText(t)),!i&&t&&t.id){var e=this.getPopup(),s=e.getList(),n=s.exists(t.id);n||s.add(t),i=e.getItemText(t.id),s.J.dynamic&&!n&&s.remove(t.id),this.J.value=t.id}var h=this.getInputNode();x(h.value)?h.innerHTML=i||this.xm():h.value=i=i.replace(/<[^>]*>/g,""),this.J.text=i}},getValue:function(){return this.J.value||""},eb:function(t){this.focus(),Q(t)}}),Bh={api:Hh,view:H.protoUI(Hh,Ch.view)},Rh={name:"combo",getInputNode:function(){return this.mt.getElementsByTagName("input")[0]},$render:function(t){x(t.value)||this.$setValue(t.value)},Qm:function(){if(!this.J.editable){var t=this.getValue();this.$setValue(x(t)?"":t)}},bi:function(){var t=this.getInputNode(),i="",e=this.getPopup();t.value&&(i=this.J.value,e.getItemText(i)!=this.getText()&&(i=e.getSuggestion()||i)),i!=this.J.value?this.setValue(i,!0):this.$setValue(i)},$compareValue:function(t){var i=Bh.api.$compareValue.apply(this,arguments);return i&&t!=this.getText()&&this.Qm(),i},defaults:{template:function(t,i){return i.$renderInput(t).replace(/(<input)\s*(?=\w)/,"$1 role='combobox'")},icon:"wxi-menu-down"},on_click:{webix_inp_label:function(t){this.eb(t)},webix_inp_top_label:function(t){this.eb(t)}}},Ph=(H.protoUI(Rh,Bh.view),{name:"counter",defaults:{template:function(t,i){var e=t.value,s="x"+z(),
n="<div role='spinbutton' aria-label='"+It.escape(t.label)+"' aria-valuemin='"+t.min+"' aria-valuemax='"+t.max+"' aria-valuenow='"+t.value+"' class='webix_el_group' style='width:"+i.Em(t)+"px'>";return n+="<button type='button' class='webix_inp_counter_prev' tabindex='-1' aria-label='"+ct.aria.decreaseValue+"'>-</button>",n+=i.Lm("input")+" id='"+s+"' type='text' class='webix_inp_counter_value' aria-live='assertive' value='"+e+"'></input>",n+="<button type='button' class='webix_inp_counter_next' tabindex='-1' aria-label='"+ct.aria.increaseValue+"'>+</button></div>",i.$renderInput(t,n,s)},min:0,max:Infinity,value:0,step:1},$init:function(){Nt(this.$view,"keydown",this.Mp,{bind:this})},Mp:function(t){var i=t.which||t.keyCode,e=this.J,s=this.getValue();32<i&&i<41&&(36===i?s=e.min:35===i?s=e.max===Infinity?1e6:e.max:33===i?this.next():34===i?this.prev():s+=37===i||40===i?-1:1,34<i&&s>=e.min&&s<=e.max&&this.setValue(s))},$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.mt.getElementsByTagName("input")[0]},getValue:function(){return 1*gh.api.getValue.apply(this,arguments)},next:function(t){t=1*(t||this.J.step),this.shift(t)},prev:function(t){t=-1*(t||this.J.step),this.shift(t)},shift:function(t){var i=this.J.min,e=this.J.max,s=this.getValue()+t;i<=s&&s<=e&&this.setValue(s)}}),jh=(H.protoUI(Ph,Ch.view),{name:"icon",$skin:function(){this.defaults.height=Xi.inputHeight,this.defaults.width=Xi.inputHeight},defaults:{template:function(t,i){var e=Math.min(t.awidth,t.aheight),s=Math.round((i.we-t.aheight)/2),n="<button type='button' style='height:"+e+"px;width:"+e+"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:"+s+"px'>"+n+(t.badge?"<span class='webix_badge'>"+t.badge+"</span>":"")+"</div>"}},om:function(){},$setValue:function(){}}),Eh=(H.protoUI(jh,gh.view),{name:"search",on_click:{webix_input_icon:function(t){this.getInputNode().focus(),this.callEvent("onSearchIconClick",[t])}},$skin:function(){this.defaults.inputPadding=Xi.inputPadding},defaults:{type:"text",icon:"wxi-search"}}),Nh=(H.protoUI(Eh,Ch.view),{name:"segmented",$allowsClear:!1,$init:function(){this.attachEvent("onChange",function(t){this.J.multiview&&this.sb(t)}),this.attachEvent("onAfterRender",l(function(){this.J.multiview&&this.J.value&&this.sb(this.J.value)}))},sb:function(t){var i=this.getTopParentView(),e=null;i&&i.$$&&(e=i.$$(t)),e||(e=Pt(t)),e&&e.show&&e.show()},defaults:{template:function(t,i){t.options;var e=t.options;i.eu(e),e=i.nb(e);var s,n=i.Em(t),h=z(),r="<div style='width:"+n+"px' class='webix_all_segments' role='tablist' aria-label='"+It.escape(t.label)+"'>",o=t.optionWidth||Math.floor(n/e.length);t.value||(t.value=e[0].id);for(var a=0;a<e.length;a++)s=t.tooltip?" webix_t_id='"+e[a].id+"'":"",r+="<button type='button' style='width:"+(e[a].width||o)+"px' role='tab' aria-selected='"+(t.value==e[a].id?"true":"false")+"' tabindex='"+(t.value==e[a].id?"0":"-1")+"'",r+="class='webix_segment_"+(a==e.length-1?"N":0<a?1:0)+(t.value==e[a].id?" webix_selected ":"")+"' button_id='"+e[a].id+"'"+s+">",r+=e[a].value+"</button>";return i.$renderInput(t,r+"</div>",h)}},tu:function(){return this.$view.getElementsByTagName("BUTTON")},focus:function(){return this.gi()},blur:function(){this.iu()},$setValue:function(t){for(var i=this.tu(),e=0;e<i.length;e++){var s=i[e].getAttribute("button_id");i[e].setAttribute("aria-selected",t==s?"true":"false"),i[e].setAttribute("tabindex",t==s?"0":"-1"),t==s?et(i[e],"webix_selected"):st(i[e],"webix_selected")}var n=this.config.tabbarPopup;n&&Pt(n)&&Pt(n).getBody().exists(t)&&this.refresh()},getValue:function(){return this.J.value},getInputNode:function(){return null},optionIndex:function(t){for(var i=this.J.options,e=0;e<i.length;e++)if(i[e].id==t)return e;return-1},addOption:function(t,i,e,s){var n=t;"object"!=k(t)?n={id:t,
value:i=i||t}:(t=n.id,s=e,e=i),this.optionIndex(t)<0&&A.insertAt.call(this.J.options,n,s),this.refresh(),e&&this.setValue(t)},removeOption:function(t){var i=this.optionIndex(t),e=this.J.options;0<=i&&A.removeAt.call(e,i),this.J.value==t&&this.hb(e,i),this.refresh(),this.callEvent("onOptionRemove",[t,this.J.value])},hb:function(t,i){var e=t.length;if(e){for(var s=i=Math.min(i,e-1);s<e;s++)if(!t[s].hidden)return this.setValue(t[s].id);for(var n=i;0<=n;n--)if(!t[n].hidden)return this.setValue(t[n].id)}this.setValue("")},nb:function(t){for(var i=[],e=0;e<t.length;e++)t[e].hidden||i.push(t[e]);return i},rb:function(t,i){var e=this.J.options,s=this.optionIndex(t),n=e[s];n&&i==!!n.hidden&&(n.hidden=!i,i||this.J.value!=t?this.refresh():this.hb(e,s))},hideOption:function(t){this.rb(t,!1)},showOption:function(t){this.rb(t,!0)},om:!1}),Lh={api:Nh,view:H.protoUI(Nh,Ch.view,ze)},Oh={name:"textarea",defaults:{template:function(t,i){var e=t.name||t.id,s="x"+z(),n=i.Lm("textarea")+"style='width:"+i.Em(t)+"px;'";return n+=" id='"+s+"' name='"+e+"' class='webix_inp_textarea'>"+i.dm(t.value)+"</textarea>",i.$renderInput(t,n,s)},height:0,minHeight:60},$skin:function(){this.defaults.inputPadding=Xi.inputPadding,this.ip=Xi.inputSpacing},Hi:!0,Om:function(t){return t?this.ep-this.J.inputPadding:""},getInputNode:function(){return this.mt.getElementsByTagName("textarea")[0]}},Uh=(H.protoUI(Oh,Ch.view),{name:"toggle",$allowsClear:!0,$init:function(){this.attachEvent("onItemClick",function(){this.toggle()})},$setValue:function(t){var i=this.getInputNode(),e=this.J,s=t&&"0"!=t,n=(s?e.onLabel:e.offLabel)||e.label,h=i.lastChild;i.setAttribute("aria-pressed",!!s&&"true"),i.value=n,h&&((h.firstChild||h).nodeValue=n),i.firstChild&&"SPAN"===i.firstChild.nodeName&&e.onIcon&&e.offIcon&&e.onIcon!==e.offIcon&&(i.firstChild.className=i.firstChild.className.replace(s?e.offIcon:e.onIcon,s?e.onIcon:e.offIcon));var r=i.parentNode;s?et(r,"webix_pressed"):st(r,"webix_pressed")},toggle:function(){this.setValue(!this.getValue())},getValue:function(){var t=this.J.value;return t&&"0"!=t?1:0},defaults:{template:function(t,i){var e=t.value&&"0"!=t.value,s=e?" webix_pressed":"";t.label=(e?t.onLabel:t.offLabel)||t.label,t.icon=(e?t.onIcon:t.offIcon)||t.icon;var n="<div class='webix_el_box"+s+"' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+i.$renderInput(t,i)+"</div>";return n=n.replace(/(button)\s*(?=\w)/,"$1 aria-pressed='"+(e?"true":"false")+"' "),t.badge&&(n=n.replace(/<\/div>$/,"<span class='webix_badge'>"+t.badge+"</span></div>")),n}},om:!1}),Yh=(H.protoUI(Uh,gh.view),{name:"multitext",$cssName:"text",defaults:{icon:"wxi-plus-circle",iconWidth:25,separator:", "},getValueHere:function(){return Ch.api.getValue.call(this)},setValueHere:function(t){return Ch.api.$setValue.call(this,t)},getValue:function(){if("extra"==this.config.mode)return this.getValueHere();if(this.ob)return this.ob;for(var t=[this.getValueHere(this)],i=0;i<this.ab.length;i++){var e=Pt(this.ab[i]).getValueHere();e&&t.push(e)}return t.join(this.config.separator)},$setValue:function(t){if(t=t||"","extra"==this.config.mode)return this.setValueHere(t);var i=(this.ob=t).split(this.config.separator);if(i.length!=this.ab.length+1){this.removeSection(),this.setValueHere.call(this,i[0]);for(var e=1;e<i.length;e++)this.addSection(i[e]);this.ob=""}else{this.setValueHere(i[0]);for(var s=0;s<this.ab.length;s++)Pt(this.ab[s]).setValueHere(i[s+1]);this.ob=""}},ub:function(){var t=this.config.master?Pt(this.config.master):this,i=t.getValue(),e=t.J.value;i!==e&&(t.J.value=i,t.callEvent("onChange",[i,e]))},addSection:function(t){var i=this.config,e={labelWidth:i.labelWidth,inputWidth:i.inputWidth,width:i.width,label:i.label?"&nbsp;":"",view:this.name,mode:"extra",value:t||"",icon:"wxi-minus-circle",tooltip:i.tooltip,suggest:i.suggest||null,master:i.id};H.extend(e,i.subConfig||{},!0);var s=this.getParentView().addView(e);return Pt(s).attachEvent("onChange",this.ub),this.ab.push(s),this.callEvent("onSectionAdd",[s,this.ab.length]),s},removeSection:function(t){for(var i=this.config.master?Pt(this.config.master
):this,e=i.ab.length-1;0<=e;e--){var s=i.ab[e];t&&s!=t||(i.ab.removeAt(e),this.getParentView().removeView(s),i.callEvent("onSectionRemove",[s,e+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.ub()}else Pt(this.addSection()).focus();return!1}},$init:function(){this.ab=p([]),this.attachEvent("onKeyPress",this.Se)},$render:function(t){this.$setValue(t.value)}}),Wh=(H.protoUI(Yh,Ch.view),{name:"proto",$init:function(){this.data.provideApi(this,!0),this.mt=this.mt||this.Yi,this.data.attachEvent("onStoreUpdated",C(function(){this.render.apply(this,arguments)},this))},$setSize:function(){Li.api.$setSize.apply(this,arguments)&&this.render()},Xo:"webix_item",on_mouse_move:{},type:{}}),Gh={api:Wh,view:H.protoUI(Wh,Ne,le,Yi,ws,Oe,we,Li.view,g,Ii)},Xh={name:"list",cb:"webix_list",ah:"webix_list_item",$init:function(t){et(this.st,this.cb+("x"==(t.layout||this.defaults.layout)?"-x":"")),this.data.provideApi(this,!0),this.fb=C(this.fb,this),this.data.attachEvent("onStoreUpdated",this.fb),this.data.attachEvent("onSyncApply",this.fb),this.attachEvent("onAfterRender",this.av),this.st.setAttribute("role","listbox")},dynamic_setter:function(t){return t&&H.extend(this,Ms,!0),t},$dragHTML:function(t,i,e){var s;return"y"==this.J.layout&&"auto"==this.type.width?(this.type.width=this.be,s=this.Ot(t),this.type.width="auto"):s=this.Ot(t),b(e.source)&&1<e.source.length&&(s=this.Bo(s,e.source.length)),s},defaults:{select:!1,scroll:!0,layout:"y",navigation:!0,datafetch:50},Xo:"webix_l_id",on_click:{webix_list_item:function(t,i){this.J.select&&(this.lb=!0,"multiselect"==this.J.select||this.J.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.J.multiselect,t.shiftKey):this.select(i),this.lb=!1)}},on_dblclick:{},getVisibleCount:function(){return Math.floor(this.we/this.vb())},fb:function(){(this.J.autoheight||this.J.autowidth)&&this.resize()},_b:function(t){var i=this.data.$pagesize||this.count();this.vc(t&&t<i,"y"),this.J.autoheight&&i<(t||Infinity)&&(t=i);var e=this.vb()*t+(this.type.margin||0);return this.getUnits&&(e+=this.getUnits().length*this.type.headerHeight),Math.max(e,this.J.minHeight||0)},vb:function(){return this.type.height+(this.type.margin||0)},pb:function(t){var i=this.data.$pagesize||this.count();return this.vc(t&&t<i,"x"),this.J.autowidth&&i<(t||Infinity)&&(t=i),this.type.width*t},av:function(){"x"==this.J.layout&&(this.mt.style.width="auto"!=this.type.width?this.type.width*this.count()+"px":"auto")},$getSize:function(t,i){return"y"==this.J.layout?("auto"!=this.type.width&&(this.J.width=this.type.width+(this.ge?S.scrollSize:0)),(this.J.yCount||this.J.autoheight)&&(this.J.height=this._b(this.J.yCount)||1)):("auto"!=this.type.height&&(this.J.height=this.vb()+(this.xe?S.scrollSize:0)),(this.J.xCount||this.J.autowidth)&&(this.J.width=this.pb(this.J.xCount)||1)),Li.api.$getSize.call(this,t,i)},$setSize:function(){Li.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,e){var s="webix_list_item";return i.css&&(s+=" "+i.css),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),s+=" "+t.$css),e&&e.$css&&(s+=" "+e.$css),s},aria:function(t,i,e){return'role="option"'+(e&&e.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:It('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>'),templateEnd:It("</div>")},$skin:function(){this.type.height=Xi.listItemHeight}},qh={api:Xh,view:H.protoUI(Xh,ce,Be,de,ye,Pe,Ye,Ue,Gh.view,ue)},Jh={name:"multiselect",$cssName:"richselect",defaults:{separator:","},tb:function(t){
var i=!b(t)&&"object"==k(t)&&!t.name,e={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button};this.J.optionWidth?e.width=this.J.optionWidth:e.fitMaster=!0,i&&H.extend(e,t,!0);var s=zt(e),n=s.getList();return"string"==typeof t?n.load(t):i||n.parse(t),s.attachEvent("onShow",function(){s.setValue(Pt(s.J.master).config.value)}),s},$setValue:function(t){if(this.lm){var i=this.getPopup(),e="";i&&"object"==k(e=i.setValue(t))&&(e=e.join(this.config.separator+" ")),this.J.text=e,this.getInputNode().innerHTML=e||this.xm()}},getValue:function(){return this.J.value||""}};$e.multiselect=H.extend({popupType:"multiselect"},$e.richselect),Tt(qh.view,{name:"multilist",templateStart:It('<div webix_l_id="#!id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>')}),Tt(qh.view,{name:"checklist",templateStart:It('<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:It("#value#")});H.protoUI(Jh,Bh.view);var Kh={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.mb(t,i)}},$init:function(){this.$view.className+=" webix_multicombo",this.attachEvent("onBeforeRender",function(){return this.gm||(this.gm=Xi.inputHeight),!0}),this.attachEvent("onAfterRender",function(){this.me=null})},on_click:{webix_multicombo_delete:function(t,i,e){var s;return!this.J.readonly&&e&&(s=e.parentNode.getAttribute("optvalue"))&&this.bb(s),!1},webix_inp_label:function(t){this.eb(t)},webix_inp_top_label:function(t){this.eb(t)}},Rm:function(){var t=this.getInputNode().value;t&&this.J.newValues&&100<new Date-(this.getPopup().gb||0)&&this.wb(t),this.J.keepText||(this.xb=""),this.refresh()},bb:function(t){var i=this.J.value,e=Pt(this.config.suggest);"string"==typeof i&&(i=i.split(this.J.separator)),(i=p(B(i))).remove(t),this.setValue(i.join(this.J.separator)),e&&e.J.selectAll&&e.getBody().Vi[0].setValue(0)},yb:function(t){var i=Pt(this.config.suggest);if(i.getList().getItem(t)){var e=i.getValue();e&&"string"==typeof e&&(e=e.split(i.config.separator)),(e=p(e||[])).find(t)<0&&(e.push(t),i.setValue(e),this.setValue(i.getValue()))}},wb:function(t){var i,e=Pt(this.config.suggest),s=e.getList();if(t=t.replace(/^\s+|\s+$/g,""))for(var n in s.data.pull)e.getItemText(n)==t&&(i=n);!i&&t&&(i=s.add({id:t,value:t})),this.yb(i)},tb:function(t){var i=!b(t)&&"object"==k(t)&&!t.name,e={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button},s=this;i&&H.extend(e,t,!0),!e.width&&this.J.optionWidth&&H.extend(e,{width:this.J.optionWidth,fitMaster:!1},!0),e.width=e.fitMaster||x(e.fitMaster)?0:e.width;var n=zt(e);e.width||(n.$customWidth=function(){this.config.width=s.Em(s.J)}),n.attachEvent("onBeforeShow",function(t,i,e){if(this.J.master&&(this.setValue(Pt(this.J.master).config.value),Pt(this.J.master).getInputNode().value||this.isVisible()?(this.getList().refresh(),this.Mb=!0):this.getList().filter(),t.tagName&&"input"==t.tagName.toLowerCase()))return ih.api.show.apply(this,[t.parentNode,i,e]),!1});var h=n.getList();return"string"==typeof t?h.load(t):i||h.parse(t),n.Sb=function(){},n},mb:function(t,i){var e,s,n,h,r,o,a,u,c,f,l,d,v="",_="top"==this.J.labelPosition;return e="x"+z(),d=i.Em(t),s=t.inputAlign||"left",r=this.gm-2*Xi.inputPadding-2,h=this.xb||"",u="<ul class='webix_multicombo_listbox' style='line-height:"+r+"px'></ul>",n="width: "+Math.min(d,i.kb||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: "+s+";height:auto' >"+u+("<input id='"+e+"' role='combobox' aria-multiline='true' aria-label='"+It.escape(t.label)+"' tabindex='0' type='text' class='webix_multicombo_input' "+l+" style='"+n+"' value='"+h+"'/>")+"</div>",a=i.$renderLabel(t,e),f=this.J.awidth-d-2*Xi.inputPadding,(c=(t.invalid?t.invalidMessage:"")||t.bottomLabel)&&(v="<div class='webix_inp_bottom_label' style='width:"+d+"px;margin-left:"+Math.max(f,Xi.inputPadding)+"px;'>"+c+"</div>"),_?a+"<div class='webix_el_box' style='width:"+this.J.awidth+"px; '>"+o+v+"</div>":"<div class='webix_el_box' style='width:"+this.J.awidth+"px; min-height:"+this.J.aheight+"px;'>"+a+o+v+"</div>"},Cb:function(){return this.xf().getElementsByTagName("UL")[0]},om:function(){var t=this.getPopup();if(t){var i=t?t.setValue(this.J.value):null;t.$b&&(this.J.value=t.$b(this.J.value));var e="",s=this.Cb(),n=i&&i.length;if(n){var h=this.gm-2*Xi.inputPadding-8,r=this.J.value;if("string"==typeof r&&(r=r.split(this.J.separator)),this.J.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>";e+="<li class='webix_multicombo_value' style='line-height:"+h+"px;' optvalue='"+r[o]+"'>"+a+"</li>"}else e+="<li class='webix_multicombo_tag' style='line-height:"+h+"px;'><span>"+this.J.tagTemplate(r)+"</span></li>"}s.innerHTML=e;var u=this.getInputNode();this.J.placeholder&&(n?(u.placeholder="",!u.value&&20<u.offsetWidth&&(u.style.width="20px")):u.value||(u.placeholder=this.J.placeholder,u.style.width=this.Em(this.J)+"px")),!this.J.tagMode&&s.firstChild&&(u.style.width=this.Db()+"px")}this.Ab()},Ib: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 e=t.value.length;t.selectionStart=e,t.selectionEnd=e,t.focus()}}else t.focus()},Ab:function(){var t="top"==this.J.labelPosition,i=this.Tb(),e=Math.max(i.offsetHeight+2*Xi.inputPadding,this.gm);if(t&&(e+=this.ep),(e+=this.J.bottomPadding||0)!=this.$getSize(0,0)[2]){var s=i.offsetHeight+(t?this.ep:0),n=this.getTopParentView();clearTimeout(n.lv),n.lv=$(function(){var t=s+2*Xi.inputPadding;this.config.height!=t&&(this.config.height=t,this.resize()),this.Fb&&(this.Ib(this.getInputNode()),this.Fb=!1),this.zb&&(this.J.keepText?this.getInputNode().select():this.getInputNode().value="",this.zb=!1),(this.getPopup().isVisible()||this.Fb)&&this.getPopup().show(this.Tb())},this)}this.zb&&this.getInputNode().select()},Tb:function(){for(var t=this.xf(),i=t.childNodes,e=0;e<i.length;e++)if(i[e].className&&-1!=i[e].className.indexOf("webix_inp_static"))return i[e];return t},getInputNode:function(){return this.xf().getElementsByTagName("INPUT")[0]},$setValue:function(){this.lm&&this.om()},getValue:function(t){if("object"==k(t)&&t.options)return this.Vb();var i=this.J.value;return i?"string"!=typeof i?i.join(this.J.separator):i:""},getText:function(){var t=this.J.value;if(!t)return"";"string"==typeof t&&(t=t.split(this.J.separator));for(var i=[],e=0;e<t.length;e++)i.push(this.getPopup().getItemText(t[e]));return i.join(this.J.separator)},Vb:function(){var t,i,e,s=[],n=this.J.value;if(!n)return[];for("string"==typeof n&&(n=n.split(this.J.separator)),e=this.getPopup(),t=0;t<n.length;t++)(i=e.getList().getItem(n[t])||(e.Hb?e.Hb[n[t]]:null))&&s.push(i);return s},$setSize:function(t,i){var e=this.J;if(Li.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==e.labelPosition&&(e.labelWidth=0),this.render()}},Bb: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 e=i.offsetWidth+10;return document.body.removeChild(i),e},Db:function(){var t=this.Cb()
;return t.offsetWidth-t.firstChild.offsetWidth-17},Bm:function(){Nt(this.xf(),"click",function(){this.getInputNode().focus()},{bind:this}),Nt(this.getInputNode(),"focus",function(){-1==this.xf().className.indexOf("webix_focused")&&(this.xf().className+=" webix_focused")},{bind:this}),Nt(this.getInputNode(),"blur",function(){this.xf().className=this.xf().className.replace(" webix_focused","")},{bind:this}),Nt(this.getInputNode(),"input",function(){!this.getInputNode().value&&this.xb&&(this.getInputNode().style.width="20px",this.kb=20,this.xb="",this.Fb=!0,this.getPopup().show(this.Tb()),this.Ab())},{bind:this}),Nt(this.getInputNode(),"keyup",function(t){var i,e,s=this.getInputNode();if(t=t||event,!this.J.placeholder||this.J.value||s.value?(e=i=this.Bb(s.value)+10,!this.J.tagMode&&this.Cb().firstChild&&(e=this.Db())):e=this.Em(this.J),s.style.width=e+"px",i!=this.kb?(this.J.keepText||13!=t.keyCode?this.xb=s.value:this.xb=!1,this.Fb=!0,this.kb&&this.getPopup().show(this.Tb()),this.kb=i||e,this.Ab()):this.Rb!=this.getPopup().$height&&this.getPopup().show(this.Tb()),-1<s.value.indexOf(this.J.separator)&&this.J.tagMode){var n=s.value.replace(this.J.separator,"");if(n)if(this.J.newValues)this.zb=!0,this.wb(n);else{var h=this.getPopup().getItemId(n);h&&this.yb(h)}this.J.keepText?(this.xb=n,s.value=n,this.zb=!0,this.Fb=!0,this.Ab()):s.value=""}},{bind:this}),Nt(this.getInputNode(),"keydown",function(t){if(this.zb=!1,this.isVisible()){t=t||event;var i=this.Cb().lastChild;if(this.Rb=this.getPopup().$height,8==t.keyCode&&i&&(!this.getInputNode().value&&100<(new Date).valueOf()-(this.Pb||0)?(this.Fb=!0,this.bb(i.getAttribute("optvalue"))):this.Pb=(new Date).valueOf()),13==t.keyCode||9==t.keyCode){var e=this.getInputNode(),s="",n=Pt(this.J.suggest);n.getList().getSelectedId()||(e.value&&(s=n.getSuggestion(e.value)),this.J.newValues?(13==t.keyCode&&(this.zb=!0),this.wb(e.value),this.J.keepText?this.xb=e.value:e.value=""):s&&(9==t.keyCode?(this.Fb=!1,this.xb="",this.kb=10,e.value="",this.yb(s)):(this.zb=!0,this.yb(s),this.J.keepText?this.xb=e.value:e.value=""))),13==t.keyCode&&(this.zb=!0,this.Fb=!0,this.J.keepText?this.xb=e.value:e.value="")}}},{bind:this}),Pt(this.J.suggest).linkInput(this)}},Zh=(H.protoUI(Kh,Bh.view),{name:"slider",$touchCapture:!0,defaults:{min:0,max:100,value:50,step:1,title:!1,moveTitle:!0,template:function(t,i){var e=i.jb="x"+z(),s="",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' webix_disable_drag='true' 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='"+e+"'>&nbsp;</div>";return s=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,s,e)}},type_setter:function(t){this.st.className+=" webix_slider_"+t},title_setter:function(t){return"string"==typeof t?It(t):t},Eb:function(){return this.$view.querySelector(".webix_slider_handle")},om:function(){var t=this.Eb(),i=this.J;if(t){var e=i.vertical?this.we:this.Em(i),s=i.value%i.step?Math.round(i.value/i.step)*i.step:i.value,n=i.max-i.min;s=Math.max(Math.min(s,i.max),i.min),s=i.vertical?n-(s-i.min):s-i.min;var h=Math.ceil((e-2*this.Nb)*s/n),r=e-2*this.Nb-h,o=i.vertical?"top":"left",a=i.vertical?"height":"width";t.style[o]=this.Nb+h-this.Lb/2+"px",t.parentNode.style[a]=e+"px",r=Math.min(Math.max(r,2*this.Ob),e-2*this.Nb-2*this.Ob),h=Math.min(Math.max(h,2*this.Ob),e-2*this.Nb-2*this.Ob);var u=t.previousSibling;u.style[a]=r+"px",u.previousSibling.style[a]=h+"px",this.Ub(t,h,r,o)}},Ub:function(t,i,e,s){var n=this.J;if(this.J.title){var h=t.parentNode[n.vertical?"nextSibling":"previousSibling"];if(h.innerHTML=this.J.title(this.J,this),this.J.moveTitle){var r=0;if(n.vertical)r=i+2*this.Ob-this.Lb/2;else{var o=h.clientWidth/2,
a=i<o?o-i-2*this.Ob:0,u=e<o?o-e-2*this.Ob-this.Lb/2:0;r=this.Nb+i-o+a-u}h.style[s]=r+"px"}}},Yb:function(){this.Eb().setAttribute("aria-valuenow",this.J.value)},refresh:function(){var t=this.Eb();t&&(this.Yb(),this.J.title&&t.setAttribute("aria-label",this.J.label+" "+this.J.title(this.J,this)),this.om())},value_setter:function(t){return this.$prepareValue(t)},$setValue:function(){this.refresh()},$getValue:function(){return this.J.value},$prepareValue:function(t){return t=parseFloat(t),isNaN(t)?0:t},$init:function(t){S.touch?this.attachEvent("onTouchStart",C(this.Wb,this)):Nt(this.st,"mousedown",C(this.Wb,this)),Nt(this.$view,"keydown",C(this.Gb,this)),t.vertical&&(t.height=t.height||Xi.vSliderHeight,this.st.className+=" webix_slider_vertical",this.Nb=Xi.vSliderPadding)},$skin:function(){this.Lb=Xi.sliderHandleWidth,this.Nb=Xi.sliderPadding,this.Ob=Xi.sliderBorder},Gb:function(t){var i=t.keyCode,e=this.J,s=e.value;if(32<i&&i<41){Q(t);var n=t.target||t.srcElement,h=/webix_slider_handle_(\d)/.exec(n.className);if(this.Xb=h?parseInt(h[1],10):-1,h&&(s=e.value[this.Xb]),s=s<e.min?e.min:s>e.max?e.max:s,36===i)s=e.min;else if(35===i)s=e.max;else{var r=37===i||40===i||34===i?-1:1;(33===i||34===i||1<e.step)&&(r*=e.step),s=1*s+r}if(h){var o=e.value[this.Xb?0:1];s=this.Xb&&s<=o||!this.Xb&&o<=s?o:s}if(s>=e.min&&s<=e.max){if(h){for(var a=[],u=0;u<e.value.length;u++)a[u]=u===this.Xb?s:e.value[u];s=a}this.setValue(s),this.Xb=-1}}},Wb:function(t){var i=t.target||t.srcElement;this.qb&&this.qb(t);var e=this.J.value;if(b(e)&&(e=B(e)),-1!=i.className.indexOf("webix_slider_handle"))return this.Jb=e,this.Kb.apply(this,arguments);-1!=i.className.indexOf("webix_slider")&&(this.Jb=e,this.J.value=this.Zb.apply(this,arguments),this.Kb(t))},Kb:function(){S.touch?this.Qb=[this.attachEvent("onTouchMove",C(this.tg,this)),this.attachEvent("onTouchEnd",C(this.ig,this))]:this.Qb=[Lt(document.body,"mousemove",C(this.tg,this)),Lt(window,"mouseup",C(this.ig,this))],et(document.body,"webix_noselect")},ig:function(){this.Qb&&(S.touch?(this.detachEvent(this.Qb[0]),this.detachEvent(this.Qb[1])):(Ot(this.Qb[0]),Ot(this.Qb[1])),this.Qb=[]),st(document.body,"webix_noselect");var t=this.J.value;b(t)&&(t=B(t)),this.J.value=this.Jb,this.setValue(t),this.Eb(this.Xb).focus(),this.Xb=-1},tg:function(){this.J.value=this.Zb.apply(this,arguments),this.refresh(),this.callEvent("onSliderDrag",[])},Zb:function(t,i){var e=0,s=this.J.vertical?"y":"x";return e=S.touch?i?i[s]:t[s]:Z(t)[s],this.eg(e)},eg:function(t){var i=this.J,e=i.max-i.min,s=i.vertical?"y":"x",n=J(this.Eb().parentNode)[s]+this.Nb,h=(i.vertical?this.we:this.Em(i))-2*this.Nb,r=h?(t-n)*e/h:0;return i.vertical&&(r=e-r),r=Math.round((r+1*i.min)/i.step)*i.step,Math.max(Math.min(r,i.max),i.min)},Bm:function(){}}),Qh={api:Zh,view:H.protoUI(Zh,Ch.view)},tr={name:"rangeslider",$cssName:"slider webix_rangeslider",defaults:{separator:",",value:[20,80],template:function(t,i){var e="x"+z();i.jb=[e+"_0",e+"_1"];var s="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' webix_disable_drag='true' id='"+i.jb[0]+"' "+s+" aria-valuenow='"+t.value[0]+"'>&nbsp;</div>";n+="<div class='webix_slider_handle webix_slider_handle_1' webix_disable_drag='true' id='"+i.jb[1]+"' "+s+" 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.Nb-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,e)}},$prepareValue:function(t){if(b(t)||(t=(t||"").toString().split(this.J.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},Eb:function(t){return t=t&&0<=t?t:0,this.$view.querySelector(".webix_slider_handle_"+(t||0))},sg:function(t,i){var e,s,n;return s=(e=this.J).max-e.min,n=e.value[i]%e.step?Math.round(e.value[i]/e.step)*e.step:e.value[i],n=Math.max(Math.min(n,e.max),e.min),Math.ceil((t-2*this.Nb)*(n-e.min)/s)},ng:function(t,i,e){var s=this.Nb+i-this.Lb/2*(e?-1:1);return(s=e?t-s:s)+"px"},hg:function(t,i,e,s){var n=i+this.Nb+2*this.Ob;return s&&(n=t-n-e),n+"px"},om:function(){var t,i,e,s,n,h,r,o,a,u,c;i=this.Eb(0),e=this.Eb(1),b((t=this.J).value)||this.define("value",t.value),i&&(a=t.vertical?"height":"width",c=t.vertical?"top":"left",h=(u=t.vertical?this.we:this.Em(t))-2*this.Nb-2*this.Ob,s=this.sg(u,0),r=(n=this.sg(u,1))-s,i.style[c]=this.ng(u,s,t.vertical),e.style[c]=this.ng(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.hg(u,s,r,t.vertical),this.Ub(i,[s,n],h,c))},rg:0,og:function(t,i){x(this.rg)||(t[this.rg].style.visibility="visible"),x(i)||(t[i].style.visibility="hidden",this.rg=i)},Ub:function(t,i,e,s){var n=this.J;if(this.J.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.ag(o[u],n.value[u],i[u],e,s,u));var c=n.vertical?a[0]-a[1]-this.Lb:a[1]-a[0],f=n.vertical?"clientHeight":"clientWidth";o[0][f]/2+o[1][f]/2>c?this.og(o,x(this.Xb)?0:this.Xb?0:1):this.og(o);for(var l=0;l<2;l++)o[l].style[s]=a[l]+"px"}else h[r].innerHTML=this.J.title(this.J,this)}},ag:function(t,i,e,s,n,h){t.innerHTML=this.J.title({value:i},this);var r=t.clientWidth/2,o=0;return o=this.J.vertical?s-e-this.Lb/2-(h?this.Nb:0)+2*this.Ob:(o=e+this.Lb/2+2*this.Ob-r,o=e<r?r-e+o:o,h&&s<r+e?o-r+(s-e):o)},Yb:function(){for(var t=0;t<2;t++)this.Eb(t).setAttribute("aria-valuenow",this.J.value[t])},qb:function(t){var i=t.target||t.srcElement,e=/webix_slider_handle_(\d)/.exec(i.className);this.Xb=e?parseInt(e[1],10):-1,e&&this.ug(this.Xb)},$compareValue:function(t,i){return i=this.$prepareValue(i),t[0]===i[0]&&t[1]===i[1]},$getValue:function(){var t=this.J.value;return this.J.stringResult?t.join(this.J.separator):t},ug:function(t){var i=this.Eb(t),e=this.Eb(1-t);-1==i.className.indexOf("webix_slider_active")&&(i.className+=" webix_slider_active"),e.className=e.className.replace(" webix_slider_active","")},eg:function(t){var i=this.J,e=i.value,s=i.max-i.min,n=i.vertical?"y":"x",h=J(this.Eb().parentNode)[n],r=Math.ceil((t-h)*s/(i.vertical?this.we:this.Em(i)));r=Math.round((r+1*i.min)/i.step)*i.step,i.vertical&&(r=s-r);var o=null,a=J(this.Eb(0))[n],u=J(this.Eb(1))[n];a!=u||i.value[0]!=i.min&&i.value[0]!=i.max?0<=this.Xb?o=this.Xb:a==u?o=t<a?0:1:(o=Math.abs(a-t)<Math.abs(u-t)?0:1,this.Xb=o):(o=i.value[0]==i.min?1:0,this.ug(o));return e[o]=o?Math.max(Math.min(r,i.max),e[0]):Math.max(Math.min(r,e[1]),i.min),e}},ir=(H.protoUI(tr,Qh.view),{name:"switch",defaults:{template:function(t,i){i.cg();var e=t.name||"x"+z(),s="";t.labelRight&&(s="<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.fg+'px"><span class="webix_switch_text">'+((n?t.onLabel:t.offLabel)||"")+'</span><button class="webix_switch_handle" '+h+' style="left:'+(n?i.fg-i.lg:0)+'px;"><input  id="'+e+'" class="webix_switch_toggle" type="checkbox" '+(n?"checked":"")+"></button></div>"+s;return i.$renderInput(t,r,e)}},$skin:function(){this.lg=Xi.switchHeight,this.fg=Xi.switchWidth},$setValue:function(t){var i=this.J,e=t==i.checkValue,s=this.$view.querySelector(".webix_switch_box");if(s){var n=s.childNodes[1],h=(e?i.onLabel:i.offLabel)||"";e?et(s,"webix_switch_on"):st(s,"webix_switch_on"),n.style.left=(e?this.fg-this.lg:0)+"px",n.firstChild.checked=e,n.setAttribute("aria-checked",
e?"true":"false"),h&&(s.childNodes[0].innerHTML=h)}},cg:function(){var t=this.J;if(t.onLabel||t.offLabel){var i=t.onLabel?nt(t.onLabel,"webix_switch_text").width:0,e=t.onLabel?nt(t.offLabel,"webix_switch_text").width:0;this.fg=Math.max(i,e)+this.lg}},on_click:{webix_switch_box:function(){this.J.readonly||this.toggle()},webix_label_right:function(){this.J.readonly||this.toggle()}}}),er=(H.protoUI(ir,Ih.view),{name:"tabbar",$init:function(){this.attachEvent("onKeyPress",this.Se)},$skin:function(){var t=Xi,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},dg:function(){var t,i,e=this.J,s=this.vg||e.options,n=this.mm-2*e.tabOffset,h=e.optionWidth||e.tabMinWidth;if(i=s.length,e.tabMinWidth&&n/i<h)return{max:parseInt(n/h,10)||1};if(!e.optionWidth)for(t=0;t<i;t++)s[t].width&&(n-=s[t].width+(t||e.type?0:e.tabMargin),i--);return{width:i?n/i:e.tabMinWidth}},Um:function(){var t=this.J;if(!t.tabbarPopup){var i=zt({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),Pt(this.J.tabbarPopup).hide(),this.callEvent("onAfterTabClick",[t]),!0},this)),i.getBody().attachEvent("onAfterSelect",C(function(){this.refresh()},this)),t.tabbarPopup=i.J.id,this.ht.push(i)}this.Um=function(){}},getPopup:function(){return this.Um(),Pt(this.J.tabbarPopup)},moreTemplate_setter:It,popupTemplate_setter:It,defaults:{popupWidth:200,popupTemplate:"#value#",yCount:7,moreTemplate:'<span class="webix_icon wxi-dots"></span>',template:function(t,i){var e,s,n,h,r,o,a,u,c;if(i.vg=a=i.nb(t.options),a.length){i.eu(a),!t.value&&a.length&&(t.value=a[0].id),e="",t.tabOffset&&(e+="<div class='webix_tab_filler' style='width:"+t.tabOffset+"px;'>&nbsp;</div>"),i.mm-2*t.tabOffset-(t.type?0:t.tabMargin*(a.length-1)),u=t.topOffset+t.bottomOffset;var f=i.dg();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(s=0;s<a.length&&!v;s++)if(a[s].id==t.value&&(v=!0,s+1>f.max)){var _=a.splice(s,1);a=a.splice(0,f.max-1).concat(_).concat(a)}d.clearAll(),d.parse(a.slice(f.max))}else d.clearAll()}else i.J.tabbarPopup&&Pt(i.J.tabbarPopup).hide();o=t.tabOffset;var p=!1;for(s=0;s<a.length&&!p;s++)c=f&&f.max?(f.max==s+1&&(p=!0),(i.mm-2*t.tabOffset-(!t.type&&1<f.max?t.tabMargin*(f.max-1):0)-t.tabMoreWidth)/f.max):f.width,o+=(c=a[s].width||t.optionWidth||c)+(s&&!t.type?t.tabMargin:0),0<t.tabMargin&&s&&!t.type&&(e+="<div class='webix_tab_filler' style='width:"+t.tabMargin+"px;'></div>"),e+=i._g(a[s],c),p&&(e+='<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.be-o)&&!t.type&&(e+="<div class='webix_tab_filler' style='width:"+n+"px;'>&nbsp;</div>")}else e="<div class='webix_tab_filler' style='width:"+i.mm+"px; border-right:0px;'></div>";return h="",r=u&&!t.type?"height:"+(i.we-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:"")+"'>"+e+"</div>",t.bottomOffset&&!t.type&&(h+="<div class='webix_after_all_tabs' style='width:100%;height:"+t.bottomOffset+"px'></div>"),h}},tu:function(){return this.$view.querySelectorAll(".webix_item_tab")},_g:function(t,i){var e,s="",n="",h=this.config;if(t.id==h.value&&(s=" webix_selected"),t.css&&(s+=" "+t.css),h.tooltip&&(n=" webix_t_id='"+t.id+"'"),i=t.width||i,e='<div class="webix_item_tab'+s+'" button_id="'+t.id+'" role="tab" aria-selected="'+(t.id==h.value?"true":"false")+'" tabindex="'+(t.id==h.value?"0":"-1"
)+'" style="width:'+i+'px;"'+n+">",this.pg){var r=this.we-2*h.inputPadding-2,o=this.we-2,a=H.extend({cheight:r,aheight:o},t);e+=this.pg(a)}else{e+=(t.icon?"<span class='webix_icon "+t.icon+"'></span> ":"")+t.value}return(t.close||h.close)&&(e+="<span role='button' tabindex='0' aria-label='"+ct.aria.closeTab+"' class='webix_tab_close webix_icon wxi-close'></span>"),e+="</div>"},xf:function(){return this.mt.firstChild},Rd:{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.J.tabOffset=0,this.Rd[t]&&(this.pg=It(this.Rd[t])),t}}),sr=(H.protoUI(er,Lh.view),{name:"richtext",defaults:{label:"",labelWidth:80,labelPosition:"left"},$init:function(){this.st.className+=" webix_richtext",this.$ready.unshift(this.mg)},getInputNode:function(){return this.$view.querySelector(".webix_richtext_editor")},gg:function(t){return{view:"toggle",type:"iconButton",icon:"wxi-"+t,name:t,id:t,label:ct.richtext[t],autowidth:!0,action:t,click:this.wg}},mg: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.lm=!0,t.refresh(),Nt(t.getInputNode(),"blur",function(){t.xg(this.innerHTML)}),Nt(t.getInputNode(),"keyup",function(){t.yg()})}},onClick:{webix_richtext_editor:function(){t.yg()}}},e={view:"toolbar",id:"toolbar",elements:[this.gg("underline"),this.gg("bold"),this.gg("italic"),{}]},s=[e,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:s}])):(e.elements.concat([{view:"label",label:this.config.label,align:"right"},{width:4}]),this.rows_setter(s))},yg: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.lm&&(this.getInputNode().innerHTML=this.config.value||"")},Mg:function(t,i){var e;if(0<(window.getSelection()?(e=window.getSelection()).toString().length:(e=document.selection.createRange()).text.length))for(var s=0;s<e.rangeCount;++s){var n=e.getRangeAt(s);if(e.isCollapsed){var h=e.focusNode.textContent,r=e.focusNode,o=e.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),e.removeAllRanges(),window.getSelection().addRange(n),document.execCommand(i,!1,"")}else document.execCommand(i,!1,"")}},wg:function(){var t=this.getTopParentView(),i=t.getInputNode();this.$view.contains(this.getInputNode())&&t.Mg(i,this.config.action)},focus:function(){if(!Ai.canFocus(this))return!1;this.$view.querySelector(".webix_richtext_editor").focus()},xg:function(t){var i=this.config.value;this.config.value=t||"",i!==t&&this.callEvent("onChange",[t,i])},setValue:function(t){this.xg(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(sr,He,Cn.view);Tt(qh.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){Pt(this.config.uploader).files.remove(i)}}});var nr={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=gs.html5;this.files=new $h,this.ht=[this.files],(x(XMLHttpRequest)||x((new XMLHttpRequest).upload))&&(t=gs.flash),H.extend(this,t,!0)},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},apiOnly_setter:function(t){return $(this.render,this),this.$apiOnly=t},If:function(t){for(var i=0;i<t.length;i++)this.addFile(t[i])},link_setter:function(t){return t&&$(function(){var t=Pt(this.J.link);if(!t){var i=this.getTopParentView();i.$$&&(t=i.$$(this.J.link))}t.sync&&t.filter?t.sync(this.files):t.setValues&&this.files.data.attachEvent("onStoreUpdated",function(){t.setValues(this)}),t.J.uploader=this.J.id},this),t},addFile:function(t,i,e,s){var n=null;"object"==k(t)&&(t=(n=t).name,i=n.size);var h=this.Df(i);e=e||t.split(".").pop();var r={file:n,name:t,id:z(),size:i,sizetext:h,type:e,context:this.zf,status:"client"};if(n&&n.webkitRelativePath&&(r.name=n.webkitRelativePath),s&&H.extend(r,s,!0),this.callEvent("onBeforeFileAdd",[r])){this.J.multiple||this.files.clearAll();var o=this.files.add(r);this.callEvent("onAfterFileAdd",[r]),o&&this.J.autosend&&this.send(o)}return r},Cf:function(t){var i=this.J.upload,e=H.extend(t.urlData||{},this.J.urlData||{});if(i&&e){var s=[];for(var n in e)s.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));s.length&&(i+=(-1==i.indexOf("?")?"?":"&")+s.join("&"))}return i},addDropZone:function(t,i){var e=D(t),s="";i&&(s=" "+L({content:'"'+i+'"'},":before"));var n="webix_drop_file"+s,h=null;Nt(e,"dragover",Q),Nt(e,"dragover",function(){et(e,n,!0),h&&(clearTimeout(h),h=null)}),Nt(e,"dragleave",function(){h=setTimeout(function(){st(e,n)},150)}),Nt(e,"drop",C(function(t){return st(e,n),this.Af(t),Q(t)},this))},Df:function(t){for(var i=0;1024<t;)i++,t/=1024;return Math.round(100*t)/100+" "+ct.fileSize[i]},Hf:function(t,i){var e=this.files.getItem(t);H.extend(e,i,!0),e.status="server",e.progress=100,this.callEvent("onFileUpload",[e,i]),this.callEvent("onChange",[]),this.files.updateItem(t),this.isUploaded()&&this.$f(i)},$f:function(t){this.callEvent("onUploadComplete",[t]),this.kf&&(this.kf.call(this,t),this.kf=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(",")}},hr=(H.protoUI(nr,gh.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:It,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 e=this.Sg(i);t.body&&H.extend(e,t.body,!0),t.data&&(e.data=t.data
),t.url&&(e.url=t.url),t.datatype&&(e.datatype=t.datatype),t.id&&(i.id=i.id||t.id+"_"+i.view),t.body=i,this.$ready.push(this.kg),this.attachEvent("onShow",function(){if(this.J.master){var t=Pt(this.J.master);if(t)(t.Tb?t.Tb():t.getInputNode()).setAttribute("aria-expanded","true")}this.Cg()}),this.attachEvent("onHide",function(){if(this.J.master){var t=Pt(this.J.master);if(t)(t.Tb?t.Tb():t.getInputNode()).setAttribute("aria-expanded","false")}}),this.$g={}},Sg:function(t){return t},Dg:function(t){var i,e,s="";t&&this.J.master&&((e=(i=Pt(this.J.master)).getInputNode())&&i.$setValueHere?i.$setValueHere(t.value):e&&(i.options_setter?s=this.getItemText(t.id):t.value&&(s=i.Gm?i.Gm(t.value):t.value.toString()),x(e.value)?e.innerHTML=s:e.value=s.replace(/<[^>]*>/g,""))),(e=e||this.ca)&&e.focus()},setMasterValue:function(t,i){var e=t.id?this.getItemText(t.id):t.text||t.value;if(this.J.master){var s=Pt(this.J.master);i&&t.id?s.refresh():s.options_setter?s.setValue(t.$empty?"":t.id):s.setValueHere?s.setValueHere(e):s.setValue(e)}else this.ca&&(this.ca.value=e);i||(this.hide(!0),this.ca&&this.ca.focus()),this.callEvent("onValueSuggest",[t,e]),$(function(){I("onEditEnd",[])})},getMasterValue:function(){return this.J.master?Pt(this.J.master).getValue():null},getItemId:function(t){var i=this.getList();for(var e in i.data.pull){var s=i.getItem(e);if(this.J.filter.call(this,s,t))return s.id}},getItemText:function(t){var i=this.getList().getItem(t);if(!i)return this.$g[t]||"";if(this.J.template)return this.J.template.call(this,i,this.type);if(this.J.textValue)return""+i[this.J.textValue];var e=this.getList().type,s=e.template.call(e,i,e);return this.$g[t]=s},getSuggestion:function(t){var i,e=this.getList(),s=e.data.order;return e.getSelectedId&&(i=e.getSelectedId()),t&&s.length&&(!i||s.find(i)<0)&&(i=s[0],!e.config.dataFeed&&!this.config.filter.call(this,e.data.pull[i],t))?null:(i&&"object"==k(i)&&(i+=""),i)},getList:function(){return this.K},kg:function(){var i=this.getList(),t=this.J.type;i.count?(i.attachEvent("onItemClick",C(function(t){this.setMasterValue(i.getItem(t))},this)),i.data.attachEvent("onstoreupdated",C(function(t,i,e){"delete"==e&&t==this.getMasterValue()?this.setMasterValue({id:"",text:""},1):"update"==e&&t==this.getMasterValue()&&this.setMasterValue(i,1)},this)),i.data.attachEvent("onAfterFilter",C(this.Sb,this)),i.data.attachEvent("onStoreLoad",C(this.Sb,this)),x(this.J.fitMaster)&&(this.J.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 e;i.getInputNode?(e=i.getInputNode()).webix_master_id=i.J.id:e=D(i),Nt(e,"keydown",function(t){e==document.body&&!this.isVisible()||(i.config?i.config.readonly:e.getAttribute("readonly"))||this.Ag(t)},{bind:this}),i.Tb&&(e=i.Tb()),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","false"),"DIV"===e.tagName&&(e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true")),this.Ig=!0},Ag:function(t){t=t||event;var e=this.getList(),s=t.target||t.srcElement;if((s!=document.body||this.isVisible())&&"webix_clipbuffer"!=s.className){this.ca=s,this.J.master=s.webix_master_id,window.clearTimeout(this.Tg);var i=t.keyCode;if(16!=i&&17!=i)return 9==i?this.Fg(this,e):27==i?this.zg(this,e):13==i?this.$enterKey(this,e):this.Vg(t)?(Q(t),!1):void(x(s.value)||(clearTimeout(this.Hg),this.Hg=$(function(){if(this.Ig||Ai.getFocus()==Pt(this.J.master)){this.Bg=!0;var i=s.value;e.config.dataFeed?e.filter("value",i):e.filter&&e.filter(C(function(t){return this.J.filter.call(this,t,i)},this))}},this,[],this.J.keyPressTimeout)))}},Sb:function(){if(!this.Bg)return!0;this.Bg=!1,0<this.getList().count()?(
this.adjust(),this.isVisible()||(this.Mb=!0),this.show(this.ca,null,!0),this.Mb=!1):(this.hide(!0),this.ca=null)},show:function(t){if(!this.isVisible()){var i=this.getList();i.filter&&!this.Mb&&i.filter(""),this.$customWidth?this.$customWidth(t):t.tagName&&this.J.fitMaster&&(this.J.width=t.offsetWidth-2),i.Bd&&i.render(),this.adjust(),"INPUT"==t.tagName&&(this.ca=t)}ih.api.show.apply(this,arguments)},Cg: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.J.master&&(i=Pt(this.J.master).$prepareValue(i)),t.setValue(i))},$enterKey:function(t,i){var e;t.isVisible()?(i.count&&i.count()?(e=i.getSelectedId(!1,!0),1==i.count()&&i.getFirstId()!=e&&(e=i.getFirstId()),e&&(e=i.getItem(e))):i.getSelectedDate&&i.getSelectedDate()?e={value:i.getSelectedDate()}:i.getValue&&i.getValue()&&(e={value:i.getValue()}),e&&this.setMasterValue(e),t.hide(!0)):t.show(this.ca)},zg:function(t){return t.hide(!0)},Fg:function(t){return t.hide(!0)},Vg:function(t){var i,e=this.getList(),s=t.keyCode;if(!(e.moveSelection&&s<41&&32<s)||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return!1;if(40===s){this.isVisible()||this.show(this.ca),e.moveSelection("down",!1,!1)}else{if(e.count&&38!==s||!e.count&&!e.isVisible())return!1;var n;33==s&&(n="pgup"),34==s&&(n="pgdown"),35==s&&(n="bottom"),36==s&&(n="top"),37==s&&(n="left"),38==s&&(n="up"),39==s&&(n="right"),e.moveSelection(n,!1,!1)}return e.count?i=e.getSelectedItem():e.getSelectedDate?i={value:e.getVisibleDate()}:e.getValue&&(i={value:e.getValue()}),this.Dg(i),!0},getValue:function(){var t=this.getList(),i=(t.getValue?t.getValue():t.getSelectedId())||"";if(i=i.id||i,t.getItem){var e=t.getItem(i);if(e&&e.$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()))}}),rr={api:hr,view:H.protoUI(hr,ih.view)},or={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.Rg(t)})}}},{view:"button",click:function(){var t=this.getParentView().getParentView();t.setMasterValue({id:t.getValue()}),t.hide()}}]}},Rg:function(t,i,e){var s=this.getValue(),n=e||p(s?this.getValue().split(this.J.separator):[]),h=Pt(this.J.master);if(e||(n.find(t)<0?n.push(t):n.remove(t)),h)h.setValue(n.join(this.J.separator));else{var r=this.setValue(n);this.ca&&(this.ca.value=r.join(this.J.separator))}if(i){var o=this.getList().getItemNode(t).getElementsByTagName("SPAN");o&&o.length&&o[0].focus()}},Sg:function(t){return t.rows[0]},kg:function(){var t=this.getButton(),i=this.J.button?this.J.buttonText||ct.combo.select:0;if(t&&(i?(t.J.value=i,t.refresh()):t.hide()),this.J.selectAll)return this.getBody().getChildViews()[0].show();this.getList().data.attachEvent("onAfterFilter",C(function(){return this.Sb()},this))},Cg:function(){var t=this.getList(),i=this.getMasterValue();if(i&&(i=i.toString().split(this.config.separator))[0])for(var e=0;e<i.length;e++)t.exists(i[e])&&t.select(i[e],!0)},getButton:function(){return this.getBody().getChildViews()[1]},getList:function(){return this.getBody().getChildViews()[0]},setValue:function(t){var i=[],e=this.getList();if(e.unselect(),t&&(b(t)||(t=t.toString().split(this.config.separator)),t[0]))for(var s=0;s<t.length;s++)e.getItem(t[s])&&(e.exists(t[s])&&e.select(t[s],!0),i.push(this.getItemText(t[s])));return this.J.value=t?t.join(this.config.separator):"",i},getValue:function(){return this.J.value}},ar={api:or,view:H.protoUI(or,rr.view)},ur={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(),e=i.getList(),s=e.data.order,n=0;n<s.length;n++){e.getItem(s[n]).$checked=this.getValue()}var h=this.getValue()?[].concat(s):[];i.Rg(s[0],t,h),e.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.Pg())}}},{view:"list",css:"webix_multilist",borderless:!0,autoheight:!0,yCount:5,type:"checklist",on:{onItemClick:function(t,i){var e=this.getItem(t);e.$checked=e.$checked?0:1,this.refresh(t);var s=this.getParentView().getParentView();s.gb=new Date,s.Rg(t,i),s.config.selectAll&&(e.$checked?s.Pg()&&s.getBody().Vi[0].setValue(1):s.getBody().Vi[0].setValue(0))}}},{view:"button",click:function(){var t=this.getParentView().getParentView();t.setMasterValue({id:t.getValue()}),t.hide()}}]}},Pg:function(){return(this.getValue()||"").split(this.config.separator).length===this.getList().count()},Sg:function(t){return t.rows[1]},getButton:function(){return this.getBody().getChildViews()[2]},getList:function(){return this.getBody().getChildViews()[1]},$init:function(){this.Hb={},this.$ready.push(this.jg)},jg:function(){var t=this.getList();if(t.config.dataFeed){var i=this;t.attachEvent("onAfterLoad",function(){i.setValue(i.J.value)}),t.getItem=function(t){return this.data.pull[t]||i.Hb[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 e=i.getSelectedId(!1,!0);e&&this.Rg(e),t.hide(!0)}else t.show(this.ca);else t.isVisible()&&t.hide(!0)},Cg:function(){var t=this.getList();t.select&&t.unselect()},setValue:function(t){var i,e=this.getList(),s=[],n={},h=[];for(b(t=t||[])?e.config.dataFeed&&(t=this.$b(t)):t=t.toString().split(this.config.separator),i=0;i<t.length;i++)n[t[i]]=1,e.getItem(t[i])&&(this.Hb&&(this.Hb[t[i]]=B(e.getItem(t[i]))),s.push(this.getItemText(t[i])));for(e.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++)e.refresh(h[i]);return this.J.value=t.length?t.join(this.config.separator):"",s},getValue:function(){return this.J.value},Dg:function(){var t;this.J.master&&(t=Pt(this.J.master).getInputNode()),(t=t||this.ca)&&t.focus()},$b:function(t){if(t&&b(t)){for(var i=[],e=0;e<t.length;e++)t[e].id?(this.Hb[t[e].id]=B(t[e]),i.push(t[e].id)):i.push(t[e]);t=i}return t}},cr=(H.protoUI(ur,ar.view),H.protoUI({name:"datasuggest",defaults:{type:"dataview",fitMaster:!1,width:0,body:{xCount:3,autoheight:!0,select:!0}}},rr.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.Eg,this))},Eg:function(t){var i=this.getBody(),e=this.config.textValue||i.config.columns[0].id;return i.getText(t.id,e)}}),fr=(H.protoUI(cr,rr.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]},Ng:function(t,i){var e=Pt(this.J.master);e?(e.setValue(t),i&&this.hide()):this.setValue(t)},kg:function(){var t=this.getRange();t.attachEvent("onAfterDateSelect",C(function(t){this.Ng(t)},this)),t.attachEvent("onDateClear",C(function(t){this.Ng(t)},this)),t.attachEvent("onTodaySet",C(function(t){this.Ng(t)},this))}}),lr=(H.protoUI(fr,rr.view),{$cssName:"datepicker",name:"daterangepicker",$init:function(t){this.J.value={},delete t.type},Um:function(){var t=this.J;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.uh=function(){}},$prepareValue:function(t){return(t=t||{}).start=zh.api.$prepareValue.call(this,t.start?t.start:null),t.end=zh.api.$prepareValue.call(this,t.end?t.end:null),B(Pt(this.J.popup).getRange().Hd(t))},$compareValue:function(t,i){var e=zh.api.$compareValue,s=e.call(this,t.start,i.start),n=e.call(this,t.end,i.end);return s&&n},$setValue:function(t){t=t||{},this.J.text=(t.start?this.Gm(t.start):"")+(t.end?" - "+this.Gm(t.end):""),this.Jm()},$render:function(t){t.value=this.$prepareValue(t.value),this.$setValue(t.value)},getValue:function(){var t=this.J.value;if(this.J.stringResult){var i=ct.parseFormatStr;return this.Lg(i,t)}return t||null},Lg:function(t,i){return i.start&&(i.start=t(i.start)),i.end&&(i.end=t(i.end)),i}}),dr=(H.protoUI(lr,zh.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()}},sh.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",e=this.st=D(t.container);e.className+=" webix_vscroll_"+i,e.innerHTML="<div class='webix_vscroll_body'></div>",Nt(e,"scroll",this.Og,{bind:this}),this.Lh=0},reset:function(){this.config.scrollPos=0,this.st["x"==this.config.scroll?"scrollLeft":"scrollTop"]=0},Ug:function(t){return 15e5<t?(this.J.zoom=t/1e6,t=1e6):this.J.zoom=1,t},scrollWidth_setter:function(t){return t=this.Ug(t),this.st.firstChild.style.width=t+"px",t},scrollHeight_setter:function(t){return t=this.Ug(t),this.st.firstChild.style.height=t+"px",t},sizeTo:function(t,i,e){t=t-(i||0)-(e||0);var s=this.J.scrollSize;S.isIE&&s&&(s+=1),s||!this.J.scrollVisible||S.$customScroll||(this.st.style.pointerEvents="none",s=14),s?(this.st.style.display="block",i&&(this.st.style.marginTop=i+"px"),this.st.style["x"==this.J.scroll?"width":"height"]=Math.max(0,t)+"px",this.st.style["x"==this.J.scroll?"height":"width"]=s+"px"):this.st.style.display="none",this.Lh=t},getScroll:function(){return Math.round(this.J.scrollPos*this.J.zoom)},getSize:function(){return Math.round((this.J.scrollWidth||this.J.scrollHeight)*this.J.zoom)},scrollTo:function(t){t<0&&(t=0);var i=this.J;if((t/=i.zoom)<0&&(t=0),t!=this.J.scrollPos)return this.st["x"==i.scroll?"scrollLeft":"scrollTop"]=t,this.Yg(t,!0),!0},Og:function(){var t=this.st["x"==this.J.scroll?"scrollLeft":"scrollTop"];Math.floor(t)!=Math.floor(this.J.scrollPos)&&this.Yg(t,!1)},Yg:function(t,i){var e=this.J.scrollWidth||this.J.scrollHeight;t>=e-this.Lh/(i?this.J.zoom:1)&&(t=Math.max(0,e-this.Lh/this.J.zoom)),this.J.scrollPos=t||0,this.callEvent("onScroll",[this.getScroll()])},activeArea:function(t,i){this.Wg=i,Nt(t,S.isIE8?"mousewheel":"wheel",this.Gg,{bind:this,passive:!1}),this.Xg(t)},Xg:function(t){!S.touch&&window.navigator.pointerEnabled&&(et(t,"webix_scroll_touch_ie",!0),Nt(t,"pointerdown",function(t){"touch"!=t.pointerType&&"pen"!=t.pointerType||(this.qe=Zi.Ls(t),this.qg=this.getScroll())},{bind:this}),Lt(document.body,"pointermove",function(t){var i;this.qe&&(this.Je=Zi.Ls(t),"x"==this.J.scroll?i=this.Je.x-this.qe.x:"y"==this.J.scroll&&(i=this.Je.y-this.qe.y),i&&5<Math.abs(i)&&this.scrollTo(this.qg-i))},{bind:this}),Lt(window,"pointerup",function(){this.qe&&(this.qe=this.Je=null)},{bind:this}))},Gg:function(t){var i=0,e=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.J.scrollVisible&&(i=t.deltaX/e):!this.Wg&&this.J.scrollVisible&&(i=x(t.deltaY)?t.detail:t.deltaY/e),S.isSafari&&(this.Jg=t.target||t.srcElement),i&&this.scrollTo(this.getScroll()+i*this.J.scrollStep)
)return Q(t)}}),vr=(H.protoUI(dr,g,Ii),{Kg:function(){this.Zg=!0,this.Qg={},this.define("select","area"),this.attachEvent("onAfterScroll",function(){this.refreshSelectArea()}),this.attachEvent("onAfterRender",function(){this.refreshSelectArea()}),this.attachEvent("onBeforeColumnHide",function(t){this.tw=this.getColumnIndex(t)}),this.attachEvent("onAfterColumnHide",function(){this.iw(this.tw)}),this.attachEvent("onAfterRender",function(){this.ew()}),this.sw=function(t,i,e,s){if(t.row&&i.row){if(e)return this.addSelectArea(t,i,!0),!(this.Zg=!0);if(!this.callEvent("onAreaDrag",[t,i,s]))return!1;this.nw||!this.Zg||this.J.multiselect&&s&&s.ctrlKey||(this.removeSelectArea(),this.Zg=!1)}},this.attachEvent("onBeforeAreaAdd",this.hw),Nt(this.Wt,"mousedown",this.rw,{bind:this})},ow:!0,iw:function(t){var i=this.Qg;for(var e in i){var s=i[e];if(this.getColumnIndex(s.start.column)<0)if(s.start.column==s.end.column)this.removeSelectArea(s.name);else{var n=this.columnId(t);n&&this.aw(s.name,{row:s.start.row,column:n},null)}else if(this.getColumnIndex(s.end.column)<0){var h=this.columnId(t-1);h&&this.aw(s.name,null,{row:s.end.row,column:h})}}},uw:function(t,i,e,s){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"==e?"left"===e&&s.ctrl?(n=this.cw(c,n,e),h=f):"left"===e&&f<h?h--:n=a:(h<=a||"right"==e)&&("right"==e&&s.ctrl?(h=this.cw(c,h,e),n=f):"right"==e&&n<f?n++:h=a),u<r||"up"==e?"up"==e&&s.ctrl?(r=this.cw(r,f,e),o=c):"up"==e&&c<o?o--:r=u:(o<u||"down"==e)&&("down"==e&&s.ctrl?(o=this.cw(o,f,e),r=c):"down"==e&&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.aw(i.name,l,d),this.callEvent("onSelectChange",[]),this.callEvent("onAfterBlockSelect",[l,d]))}},cw:function(t,i,e){var s=this.config.columns,n=this.data.order,h=this.data.pull[n[t]],r=s[i].id,o=0;if("right"==e)for(var a=i+1;a<s.length;a++){if(h[s[a].id]){o=a;break}o=a}else if("left"==e){for(var u=i-1;0<=u;u--)if(h[s[u].id]){o=u;break}}else if("down"==e)for(var c=t+1;c<n.length;c++){if(this.getItem(n[c])[r]){o=c;break}o=c}else if("up"==e)for(var f=t-1;0<=f;f--)if(this.getItem(n[f])[r]){o=f;break}return o},aw:function(t,i,e,s){var n=this.Qg[t];if(!n)return!1;var h=B(n),r={start:i||n.start,end:e||n.end};this.hw(r),H.extend(n,r,!0),this.refreshSelectArea(),this.ew(h),s&&this.callEvent("onSelectChange",[])},areaselect_setter:function(t){return t&&(this.Kg(),this.Kg=function(){}),this.define("blockselect",t),t},addSelectArea:function(t,i,e,s,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),s=s||this.nw||z(),this.nw=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.Qg[s])return this.aw(s,f.start,f.end,!0);f.handle=!0,f.name=s,f.init=f.start,this.callEvent("onBeforeAreaAdd",[f])&&(this.lw=s,e||this.removeSelectArea(),this.Qg[f.name]=f,this.dw.push(f),this.refreshSelectArea(),this.ew(),this.callEvent("onAfterAreaAdd",[f]),this.callEvent("onSelectChange",[]))},vw:function(){var t=Y("DIV");return t.className="webix_area_selection_layer",t.style.top=this._w+"px",t},refreshSelectArea:function(){var t,i,e,s,n=null,h=null,r=null,o=this.J.prerender;if(this.pw){t=this.mw(o),i=this.bw(!0===o),this.gw||(this.gw=this.vw(),this.Wt.childNodes[1].appendChild(this.gw),this.ww=this.vw(),this.Wt.childNodes[0].appendChild(this.ww),this.xw=this.vw(),this.Wt.childNodes[2].appendChild(this.xw)),this.gw.innerHTML="",this.ww.innerHTML="",this.xw.innerHTML="";var a=this.J.leftSplit,u=this.J.rightSplit;for(e in this.Qg){s=this.Qg[e];var c=this.yw(s,t,i);if(null!==c){var f=this.getColumnIndex(
s.start.column),l=this.getColumnIndex(s.end.column);if(c.r0<=c.r1){if(this.J.topSplit&&this.J.topSplit<=void 0&&void 0<this.Mw)return!1;f<a&&(h=this.Sw(c.r0,f,c.r1,Math.min(l,a-1))),c.c0<=c.c1&&(n=this.Sw(c.r0,c.c0,c.r1,c.c1)),u&&l>=this.kw&&(r=this.Sw(c.r0,Math.max(f,this.kw),c.r1,l)),(h||n||r)&&this.Cw(h,n,r,e,s.css,s.handle)}}else this.removeSelectArea(e)}}},yw:function(t,i,e){var s,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(e[1],r),this.J.topSplit){if((s=h)>=this.J.topSplit&&(s=Math.max(e[0]-this.J.topSplit,h)),n>=this.J.topSplit){var u=this.Gt(this.getIdByIndex(r),t.end.column),c=this.Gt(this.getIdByIndex(this.J.topSplit-1),t.end.column);c.top+c.height>u.top+u.height&&(n=this.J.topSplit-1)}}else s=Math.max(e[0],this.getIndexById(t.start.row));return{r0:s,r1:n,c0:Math.max(i[0],o),c1:Math.min(this.kw?i[1]-1:i[1],a)}},Sw:function(t,i,e,s){return[this.Gt(this.getIdByIndex(t),this.columnId(i)),this.Gt(this.getIdByIndex(e),this.columnId(s))]},Cw:function(t,i,e,d,v,s){var n,h,r=this.Qg[d],_=0;this.J.topSplit&&(_=this.$w(r.start,!0));var o=function(t,i,e,s,n){var h,r,o,a,u,c,f={top:1,right:1,bottom:1,left:1};for(h in s&&delete f.left,n&&delete f.right,r=e.top-i.top+e.height-1,o=e.left-i.left+e.width,f){a=i.top+_,"bottom"==h&&(a=e.top+e.height),u=i.left,"right"==h&&(u=e.left+e.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"),e.height==_&&"bottom"==h&&(l.style.display="none"))}};e&&o(this.xw,e[0],e[1],!!i,!1),i&&o(this.gw,i[0],i[1],!!t,!!e),t&&o(this.ww,t[0],t[1],!1,!!i),s&&(h=e?e[1]:i?i[1]:t[1],(n=e?this.xw:i?this.gw:this.ww).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"))},Dw:function(s){if(s){var t=function(t){for(var i=t.childNodes,e=i.length-1;0<=e;e--)i[e].getAttribute("webix_area_name")==s&&t.removeChild(i[e])};t(this.gw),t(this.ww),t(this.xw)}},removeSelectArea:function(t){if(t&&this.Qg[t]){if(this.callEvent("onBeforeAreaRemove",[t])){for(var i in this.ew(B(this.Qg[t]),!0),delete this.Qg[t],this.Dw(t),this.dw=[],this.Qg)this.dw.push(this.Qg[i]);this.callEvent("onAfterAreaRemove",[t])}}else for(var e in this.Qg)this.removeSelectArea(e)},rw:function(t){var i=t.target||t.srcElement,e=rt(i);if(e&&-1!=e.indexOf("webix_area_selection_handle")){var s=i.getAttribute("webix_area_name");this.nw=s;var n=this.Qg[s],h=this.Gt(n.start.row,n.start.column),r=this.Gt(n.end.row,n.end.column),o=this.J.prerender,a=this.getColumnIndex(n.start.column)<this.J.leftSplit?0:this.Aw,u=this.getColumnIndex(n.end.column)<this.J.leftSplit?0:this.Aw;return this.Iw=[h.left+1+a-this.bh,h.top+1-(o?this.ph:0),{row:n.start.row,column:n.start.column}],this.Tw=J(this.Wt),this.Fw(t),this.zw=[r.left+1+u-this.bh,r.top+1-(o?this.ph:0)],this.Vw(!1,!1,t),Q(t)}},getSelectArea:function(t){return this.Qg[t||this.lw]},getAllSelectAreas:function(){return this.Qg},hw:function(t,i){var e,s,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),e=r;e<=o;e++){if(this.getItem(this.getIdByIndex(e)).$row&&!i)_=!0,v=this.tl.length-1;else if(this.config.spans)for(s=n;s<=h;s++)(a=this.getSpan(this.getIdByIndex(e),this.columnId(s)))&&((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.hw(t,!0)
)},ew:function(t,i){var e;if(t&&(e=this.getItemNode({row:t.start.row,column:t.start.column}))&&e.removeAttribute("tabindex"),!i&&this.dw.length){var s=this.getSelectedId(!0)[0];(e=this.getItemNode(s))&&e.setAttribute("tabindex","1")}}}),_r={filterByAll:function(){var r=!1;this.data.silent(function(){this.filter();var t=!1;for(var e in this.wo)if(this.isColumnVisible(e)){var i=this.wo[e],s=i[2].getValue(i[0]),n=s;i[1].prepare&&(n=i[1].prepare.call(i[2],n,i[1],this)),i[1].value=s;var h=i[1].compare;if(this.callEvent("onBeforeFilter",[e,n,i[1]]))if(i[2].$server||r)r=!0;else{if(""===n)continue;h?(h=this.Hw(e,h),this.filter(C(function(t,i){return!!t&&h(t[e],i,t)},this),n,t)):this.filter(e,n,t),t=!0}}r&&this.Bw()},this),r||(this.refresh(),this.callEvent("onAfterFilter",[]))},Hw:function(t,h){var i=this.getColumnConfig(t),r=i?i.optionslist:null;return r?("string"!=typeof r&&(r=","),function(t,i,e){if(!t)return!0;for(var s=t.split(r),n=0;n<s.length;n++)if(h(s[n],i,e))return!0}):h},filterMode_setter:function(t){return H.extend(this.data.Qr,t,!0)},getFilter:function(t){var i=this.wo[t];return i&&i[2].getInputNode?i[2].getInputNode(i[0]):null},registerFilter:function(t,i,e){this.wo[i.columnId]=[t,i,e]},collectValues:function(t,i){var e=[],s={"":!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++)e.push({id:h[r],value:h[r]});else for(var o in h)e.push({id:o,value:h[o]});return e}"string"==typeof h&&(h=Pt(h)),h.getBody&&(h=h.getBody()),this.Rw.call(h,"id","value",e,s)}else this.Rw(n.id,n.id,e,s);var a={values:e};return this.callEvent("onCollectValues",[t,a]),a.values},Rw:function(s,n,h,r){if(this.data.each(function(t){var i=t?t[s]:"";if(i!==undefined&&!r[i]){r[i]=!0;var e=t[s];0===e&&(e="0"),h.push({id:e,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"}))}},Bw:function(){var i=this;this.loadNext(0,0,0,0,1).then(function(t){i.editStop&&i.editStop(),i.clearAll(!0),i.parse(t),i.callEvent("onAfterFilter",[])})}},pr={hover_setter:function(t){return t&&!this.Pw&&(this.Vu(),this.config.experimental=!0,this.attachEvent("onMouseMoving",function(){var t=this.locate(arguments[0]);t=t?t.row:null,this.jw!=t&&(this.jw&&this.removeRowCss(this.jw,this.J.hover),this.jw=t,this.jw&&this.addRowCss(this.jw,this.J.hover))}),Lt(this.$view,"mouseout",C(function(t){this.jw&&document.body.contains(t.target)&&(this.removeRowCss(this.jw,this.J.hover),this.jw=null)},this)),this.Pw=1),t},select_setter:function(t){return!this.select&&t&&(H.extend(this,this.Nw.Ew,!0),!0===t?t="row":"multiselect"==t&&(t="row",this.J.multiselect=!0),this.Nw[t],H.extend(this,this.Nw[t],!0)),t},getSelectedId:function(t){return t?[]:""},getSelectedItem:function(t){return Ye.getSelectedItem.call(this,t)},Nw:{Ew:{Lw:" webix_cell_select",$init:function(){this.Ow(),this.on_click.webix_cell=C(this.Uw,this),this.Yw=this.mc=function(){this.unselect()},this.data.attachEvent("onStoreUpdated",C(this._c,this)),this.data.attachEvent("onSyncApply",C(this.Ww,this)),this.data.attachEvent("onClearAll",C(this.Yw,this)),this.data.attachEvent("onAfterFilter",C(this.mc,this)),this.data.attachEvent("onIdChange",C(this.gc,this)),this.$ready.push(Ye.wc)},gc:function(t,i){for(var e=0;e<this.Gw.length;e++)this.Gw[e]==t&&(this.Gw[e]=i);for(var s=0;s<this.dw.length;s++){var n=this.dw[s];n.row==t&&(t=this.Xw(n),n.row=i,i=this.Xw(n),n.id=i,delete this.qw[t],this.qw[i]=!0)}},_c:function(t,i,e){"delete"==e&&this.unselect(t)},Ww:function(){for(var t=this.dw.length-1;0<=t;t--){var i=this.dw[t].row;this.exists(i)||(this.dw.splice(t,1),delete this.qw[i])}},Ow:function(){this.dw=[],this.qw={},this.Gw=[]},isSelected:function(t,i){var e;return e=x(i)?"object"===k(t)?this.Xw(t):t:this.Xw({row:t,column:i}),this.qw[e]},getSelectedId:function(t,i){var e;if(1<this.dw.length||t){if(e=[].concat(this.dw),i)for(var s=0;s<e.length;s++)e[s]=e[s].id}else if(e=this.dw[0],i&&e)return e.id;return e},Jw:function(){return this.row},Do:function(t,i){
var e=this.Xw(t);if(null!==e){if(-1===i)return this.Kw(t);if(t.id=e,t.toString=this.Jw,!this.callEvent("onBeforeSelect",[t,i]))return!1;if(!this.qw[e]||!i&&1!=this.dw.length)return i||this.Zw(),this.dw.push(t),this.qw[e]=!0,this.callEvent("onAfterSelect",[t,i]),this.Qw(this.tx(t)),!0}},Zw:function(){if(!this.dw.length)return!1;for(var t=0;t<this.dw.length;t++)if(!this.callEvent("onBeforeUnSelect",[this.dw[t]]))return!1;for(var i=0;i<this.Gw.length;i++)this.data.removeMark(this.Gw[i],"webix_selected");var e=this.J.columns;if(e)for(var s=0;s<e.length;s++)e[s].$selected=null;var n=this.dw;this.Ow();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.Zw()&&(this.callEvent("onSelectChange",[]),this.render())},Kw:function(t){var i=this.Xw(t);if(!i&&this.dw.length&&(this.clearSelection(),this.callEvent("onSelectChange",[])),this.qw[i]){if(!this.callEvent("onBeforeUnSelect",[t]))return!1;for(var e=0;e<this.dw.length;e++)if(this.dw[e].id==i){this.dw.splice(e,1);break}delete this.qw[i],this.callEvent("onAfterUnSelect",[t]),this.Qw(0,this.ix(t))}},nx:function(t){var i=this.getItem(t);return this.data.addMark(i.id,"webix_selected",0,{$count:0},!0)},Qw:function(t){t&&this.Gw.push(t),this.yc||(this.render(),this.callEvent("onSelectChange",[]))},Uw:function(t,i){var e=t.ctrlKey||t.metaKey||"touch"==this.J.multiselect,s=t.shiftKey;if(this.J.multiselect||"multiselect"==this.J.select||"area"==this.J.select||(e=s=!1),s&&this.dw.length){var n=this.dw[this.dw.length-1];this.hx(i,n)}else e&&this.qw[this.Xw(i)]?this.Kw(i):this.Do({row:i.row,column:i.column},e)},ox:function(t,i,e){var s=this.J.columns;if(i){for(var n=[],h=0;h<s.length;h++)s[h].$selected&&n.push(s[h]);s=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<s.length;l++){var d=s[l].id;if(e||i||c[d]){if(!t)return{row:r[a],column:d};u[d]=t(u[d],r[a],d,o,f),f++}}o++}}}}},row:{Lw:" webix_row_select",Xw:function(t){return t.row},select:function(t,i){t&&(t=t.toString()),this.data.exists(t),this.Do({row:t},i)},tx:function(t){return this.nx(t.row).$row=!0,t.row},unselect:function(t){this.Kw({row:t})},ix:function(t){return this.data.removeMark(t.row,"webix_selected",0,1),t.row},mapSelection:function(t){return this.ox(t,!1,!0)},hx:function(t,i){return this.selectRange(t.row,i.row)},selectRange:function(t,i,e){x(e)&&(e=!0);var s=t?this.getIndexById(t):0,n=i?this.getIndexById(i):this.data.order.length-1;if(n<s){var h=s;s=n,n=h}this.yc=!0;for(var r=s;r<=n;r++){var o=this.getIdByIndex(r);if(!o){t&&this.select(t);break}this.select(o,e)}this.yc=!1,this.Qw()}},cell:{Xw:function(t){return t.column?t.row+"_"+t.column:null},select:function(t,i,e){this.data.exists(t),this.Do({row:t,column:i},e)},tx:function(t){var i=this.nx(t.row);return i.$count++,i[t.column]=!0,t.row},unselect:function(t,i){this.Kw({row:t,column:i})},ix:function(t){var i=this.nx(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.ox(t,!1,!1)},hx:function(t,i){return this.selectRange(t.row,t.column,i.row,i.column)},selectRange:function(t,i,e,s,n){x(n)&&(n=!0);var h=t?this.getIndexById(t):0,r=e?this.getIndexById(e):this.data.order.length-1,o=i?this.getColumnIndex(i):0,a=s?this.getColumnIndex(s):this.tl.length-1;if(r<h){var u=h;h=r,r=u}if(a<o){var c=o;o=a,a=c}this.yc=!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.yc=!1,this.Qw()}},column:{Lw:" webix_column_select",Xw:function(t){return t.column},Jw:function(){return this.column},select:function(t,i){this.Do({column:t},i)},tx:function(t){this.J.columns[this.getColumnIndex(t.column)].$selected=!0,this.yc||this.ax()},unselect:function(t){this.Kw({column:t})},ix:function(t){this.J.columns[this.getColumnIndex(t.column)].$selected=null,this.ax()},mapSelection:function(t){return this.ox(t,!0,!1)},
hx:function(t,i){return this.selectRange(t.column,i.column)},selectRange:function(t,i,e){x(e)&&(e=!0);var s=t?this.getColumnIndex(t):0,n=i?this.getColumnIndex(i):this.tl.length-1;if(n<s){var h=s;s=n,n=h}this.yc=!0;for(var r=s;r<=n;r++)this.select(this.columnId(r),e);this.yc=!1,this.ax(),this.Qw()},Ww:function(){}},area:{Xw:function(t){return t.row+"_"+t.column},getSelectedId:function(t){var i=this.getSelectArea(),e=[];if(i)if(!t||i.start.row==i.end.row&&i.start.column==i.end.column)e.push(i.end);else{var s=this.getIndexById(i.start.row),n=this.getIndexById(i.end.row);if(-1==s||-1==n)return e;for(var h=this.getColumnIndex(i.start.column),r=this.getColumnIndex(i.end.column),o=s;o<=n;o++)for(var a=h;a<=r;a++)e.push({row:this.getIdByIndex(o),column:this.columnId(a)})}return t?e:e[0]},unselect:function(){this.Kw()},Kw:function(){this.removeSelectArea(),this.callEvent("onSelectChange",[])},mapSelection:function(t){var i=this.getSelectArea();if(i)for(var e=this.getColumnIndex(i.start.column),s=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=e;u<=s;u++){var c=this.tl[u].id;if(!t)return{row:o,column:c};a[c]=t(a[c],o,c,r-n,u-e)}},select:function(t,i,e){this.data.exists(t),this.Do({row:t,column:i},e)},hx:function(t,i){this.uw(t,i)},Do:function(t){return this.addSelectArea(t,t,!1),!0},Ww:function(){this.dw.length&&this.refreshSelectArea()}}}},mr={blockselect_setter:function(t){return t&&this.ow&&(Nt(this.st,S.mouse.move,this.ux,{bind:this}),Nt(this.st,S.mouse.down,this.cx,{bind:this}),Lt(document.body,S.mouse.up,this.vx,{bind:this}),this.ow=this.Iw=this.zw=!1,this.attachEvent("onAfterScroll",function(){this._x()}),H.extend(this,vi,!0),this.attachEvent("onBeforeAutoScroll",function(){return this.zw})),t},ow:!0,mx:function(t,i){for(var e=t.target||t.srcElement;e;){if(e.getAttribute&&e.getAttribute("webixignore"))return!1;if(e==i)return!0;e=e.parentNode}return!1},cx:function(t){if((!this.J.subview||this==Pt(t.target||t.srcElement))&&this.mx(t,this.Wt)){if(t.target&&"INPUT"==t.target.tagName||this.Ov)return;this.Tw=J(this.Wt);var i=Z(t);this.Iw=[i.x-this.Tw.x,i.y-this.Tw.y],Q(t)}},vx:function(t){this.bx&&(this.Vw("select",!0,t),this.bx=G(this.bx)),st(document.body,"webix_noselect"),this.Iw=this.zw=!1,this.qt&&(this.qt=window.clearTimeout(this.qt))},_x:function(){this.zw&&this.Vw(!1,!1)},Vw:function(t,i,e){var s;this.Iw[2]||(this.Iw[2]=this.gx.apply(this,this.Iw)),s=this.Iw[2];var n=this.gx.apply(this,this.zw);if(this.callEvent("onBeforeBlockSelect",[s,n,i,e])){if((!this.sw||!1!==this.sw(s,n,i,e))&&s.row&&n.row)if("select"===t)this.Zw(),this.hx(s,n);else{var h,r,o,a;if("box"===t)h=Math.min(this.Iw[0],this.zw[0]),o=Math.max(this.Iw[0],this.zw[0]),r=Math.min(this.Iw[1],this.zw[1]),a=Math.max(this.Iw[1],this.zw[1]);else{var u=this.Gt(s.row,s.column),c=this.Gt(n.row,n.column),f=this.getScrollState(),l=u.width,d=c.width;this.wx&&this.Iw[0]>this.Aw+this.xx?u.left+=this.Aw+this.xx:this.Aw?this.Iw[0]>this.Aw&&(u.left<f.x?(l-=f.x-u.left,u.left=this.Aw):u.left+=this.Aw-f.x):u.left-=f.x,this.wx&&this.zw[0]>this.Aw+this.xx?c.left+=this.Aw+this.xx:this.Aw?this.zw[0]>this.Aw&&(c.left<f.x?(d-=f.x-c.left,c.left=this.Aw):c.left+=this.Aw-f.x):c.left-=f.x,this.J.prerender&&(u.top-=this.ph,c.top-=this.ph),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.J.topSplit&&(r+=this.$w(s)),this.qt&&(this.qt=window.clearTimeout(this.qt)),e&&(this.qt=$(this.Yt,this,[Z(e)],250))}var v=this.bx.style;v.left=h+"px",v.top=r+"px",v.width=o-h+"px",v.height=a-r+"px"}i&&this.callEvent("onAfterBlockSelect",[s,n])}},Fw:function(){this.bx=Y("div",{"class":"webix_block_selection"},""),this.Wt.appendChild(this.bx)},ux:function(t){if(!1!==this.Iw){this.zw||et(document.body,"webix_noselect");var i=Z(t),e=[i.x-this.Tw.x,i.y-this.Tw.y];if(Math.abs(this.Iw[0]-e[0])<5&&Math.abs(this.Iw[1]-e[1])<5)return;!1===this.zw&&this.Fw(t),this.zw=e,this.Vw(this.config.blockselect,!1,t)}},gx:function(t,i){
var e=!1,s=null,n=null;if(this.wx&&t>this.Aw+this.xx?t+=this.mh.getSize()-this.xx-this.Aw-this.wx:(!this.Aw||t>this.Aw)&&(t+=this.mh.getScroll()),this.J.topSplit&&this.Mw>this.J.topSplit){var h=this.Gt(this.getIdByIndex(this.J.topSplit-1),this.columnId(0));h.top+h.height>i&&(e=!0)}e||(i+=this.getScrollState().y),t<0&&(t=0),i<0&&(i=0);for(var r=this.J.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.J.fixedRowHeight)s=o[c+Math.floor(i/this.J.rowHeight)];else for(var f=c;f<o.length;f++)if(i<=(a+=this.yx(f))){s=o[f];break}return s||(s=o[o.length-1]),{row:s,column:n}},$w:function(t,i){var e=0,s=this.getIndexById(t.row);if(s>=this.J.topSplit){var n=this.Gt(this.getIdByIndex(s),t.column),h=this.Gt(this.getIdByIndex(this.J.topSplit-1),t.column);0<h.top+h.height-n.top&&(e=h.top+h.height-(0<n.top||!i?n.top:0))}return e}},br={resizeRow_setter:function(t){return this.J.scrollAlignY=!1,this.J.fixedRowHeight=!1,this.resizeColumn_setter(t)},resizeColumn_setter:function(t){return t&&this.Mx&&(Nt(this.st,"mousemove",this.Sx,{bind:this}),Nt(this.st,"mousedown",this.kx,{bind:this}),Nt(this.st,"mouseup",this.Cx,{bind:this}),this.Mx=!1),t},Mx:!0,kx:function(t){this.J.subview&&this!=Pt(t.target||t.srcElement)||this.$x&&(this.Ov=[Z(t),this.$x[2]],et(document.body,"webix_noselect"),j())},Cx:function(){this.Ov=!1,st(document.body,"webix_noselect"),E()},Dx:function(){if(!this.Wv){var t=this.$x[0],i=this.Ov[1],e=this.Hs(i);if(e){var s,n=this.Ov[0];if("x"==t?(s=J(i).x+this.$x[1]-J(this.Wt).x,n=n.x,this.$x[1]||(e.cind-=i.parentNode.colSpan||1)):(s=J(i).y+this.$x[1]-J(this.Wt).y+this.Go,n=n.y,this.$x[1]||e.rind--),0<=e.cind&&0<=e.rind)this.Wv=[t,e,s],new zt.resizearea({container:this.st,dir:t,eventPos:n,start:s,cursor:("x"==t?"col":"row")+"-resize"}).attachEvent("onResizeEnd",C(this.Ax,this));this.kx=this.$x=!1}}},Ax:function(t){if(this.Wv){var i=this.Wv[0],e=this.Wv[1],s=t-this.Wv[2];if("x"==i){this.J.rightSplit&&e.cind+1>=this.kw&&e.cind!==this.tl.length-1&&(e.cind++,s*=-1);var n=this.tl[e.cind],h=n.width;delete n.fillspace,delete n.adjust,this.So(e.cind,h+s,!0,!0),this.ko()}else{var r=this.getIdByIndex(e.rind),o=this.Ix(this.getItem(r));this.setRowHeight(r,o+s)}this.Cx()}this.Wv=null},Sx:function(t){var i=null,e=this.J;if(this.$x&&this.Ov)return this.Dx(t);var s=(t=t||event).target||t.srcElement,n=!1;if("TD"!=s.tagName&&"TABLE"!=s.tagName){var h=s.className||"",r="string"==typeof h&&-1!=h.indexOf("webix_cell");if(!r||!e.drag){var o="string"==typeof h&&-1!=h.indexOf("webix_hcell");if(this.$x=!1,r||o){var a=s.offsetWidth,u=s.offsetHeight,c=K(t),f=e.resizeRow;"object"==k(f)&&f.headerOnly&&0<(i=this.Hs(s)).cind&&(f=!1),r&&f&&(f="object"==k(f)&&f.size?f.size:3,c.y<f?(i||(i=this.Hs(s)),i.rind&&(this.$x=["y",0,s],n="row-resize")):u-c.y<f+1&&(this.$x=["y",u,s],n="row-resize"));var l=e.resizeColumn;"object"==k(l)&&l.headerOnly&&r&&(l=!1),l&&(l="object"==k(l)&&l.size?l.size:3,c.x<l?(this.$x=["x",0,s],n="col-resize"):a-c.x<l+1&&(this.$x=["x",a,s],n="col-resize"))}this.Tx&&window.clearTimeout(this.Tx),this.Tx=$(this.Fx,this,[n],n?100:0)}}},Fx:function(t){this.zx!=t&&(this.zx=t,this.st.style.cursor=t||"default")}};T("onDataTable",function(t,i){S.touch&&(Zi.$init(),i.scrollSize=0,Zi.Ae&&Zi.limit(),t.$ready.push(t.$touch))});var gr={$touch:function(){var t=this.J;t.scrollAlignY=!1,H.extend(this,!0===t.prerender?this.Vx:this.Hx);var i="";t.autowidth||!1===t.scrollX||(i+="x"),t.autoheight||!1===t.scrollY||(i+="y"),this.Wt.setAttribute("touch_scroll",i),Zi.Fs(this.Wt.childNodes[1].firstChild),Zi.gs(this.Wt.childNodes[1].firstChild,0,0,"0ms"),this.xs(0,0,"0ms")},Vx:{Bx:function(t,i){Zi.gs(this.Wt.childNodes[1].firstChild,-t,-i,"0ms"),this.xs(-t,-i,"0ms")},Rx:function(){var t=Zi.ps(this.Wt.childNodes[1].firstChild);return{x:-t.e,y:-t.f}},$init:function(){this.attachEvent("onBeforeScroll",function(){Zi.ts=this.Wt.childNodes[1].firstChild,Zi.Es(Zi.ts),Zi.ws=this}),this.attachEvent("onTouchEnd",function(){Zi.ws=null})},xs:function(t,i,e){this.J.leftSplit&&Zi.gs(
this.Wt.childNodes[0].firstChild,0,i,e),this.J.rightSplit&&Zi.gs(this.Wt.childNodes[2].firstChild,0,i,e),this.J.header&&Zi.gs(this.U.childNodes[1].firstChild,t,0,e),this.J.footer&&Zi.gs(this.Zf.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},Ts:function(){}},Hx:{Bx:function(t,i){$(function(){this.callEvent("onAfterScroll",[{e:-t,f:-i}])},this)},$scroll:{gravity:0,elastic:!1},$init:function(){this.attachEvent("onAfterColumnHide",function(){this.Bx(0,0)}),this.attachEvent("onBeforeScroll",function(){var t=Zi;t.ts=this.Wt.childNodes[1].firstChild,t.Es(t.ts),t.es.left=this.bh,t.es.hidden=this.mh.J.scrollVisible||this._h.J.scrollVisible,t.es.dy=this.Px,t.ws=this}),this.attachEvent("onAfterScroll",function(t){if(t){var i=this.bh!=-t.e,e=this.ph!=-t.f;Zi.ws=null,Zi.jx=null,this.ph=0,this.bh=0;var s=Zi.config.translate;return Zi.config.translate="translate",this.xs(this.mh?0:t.e,0,"0ms"),Zi.config.translate=s,this.bh=-t.e,this.ph=-t.f,this.Ex(),this.render(),i&&(this.mh&&this.mh.scrollTo(this.bh),this.callEvent("onScrollX",[])),e&&(this._h&&this._h.scrollTo(this.ph),this.callEvent("onScrollY",[])),!1}})},xs:function(t,i,e){i+=this.ph,t+=this.bh,Zi.gs(this.Wt.childNodes[1].firstChild,t,i,e),this.J.leftSplit&&Zi.gs(this.Wt.childNodes[0].firstChild,0,i,e),this.J.rightSplit&&Zi.gs(this.Wt.childNodes[2].firstChild,0,i,e),this.J.header&&Zi.gs(this.U.childNodes[1].firstChild,t,0,e),this.J.footer&&Zi.gs(this.Zf.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},Ts:function(t){t.f-=this.ph,t.e-=this.bh}}},wr={$init:function(){this.data.attachEvent("onStoreUpdated",C(function(t){t||this.Nx()},this)),this.attachEvent("onStructureLoad",this.Nx),this.attachEvent("onStructureUpdate",this.Lx),this.attachEvent("onColumnResize",function(t,i,e,s){s&&this.Lx()}),this.attachEvent("onResize",this.Lx)},Nx:function(){for(var t=!1,i=this.tl,e=0;e<i.length;e++)i[e].adjust&&("header"==i[e].adjust||this.count())&&(t=this.Ox(e,i[e].adjust,!0)||t);t&&(this.ko(!0),this.Lx())},Lx:function(){var t=this.J.columns,i=[],e=0;if(t&&!this.J.autowidth)for(var s=0;s<t.length;s++){var n=t[s].fillspace;n&&(e+=1*(i[s]=n)||1)}e&&this.Ux(i,e)},Ux:function(t,i){var e=this.J.columns;if(e){var s=this.be-this.Yx,n=!1;if(0<s){for(var h=0;h<e.length;h++)t[h]||(s-=e[h].width||this.config.columnWidth);for(var r=0;r<t.length;r++)if(t[r]){var o=Math.min(s,Math.round(s*t[r]/i));n=this.So(r,o,!0)||n,s-=e[r].width,i-=t[r]}n&&this.ko(!0)}}},Wx:function(t,i){var e=this.J.columns[t],s=e.minColumnWidth||10;if("header"!=i){var n=this.data.order.length;e.adjustBatch&&e.adjustBatch<n&&(n=e.adjustBatch);for(var h=this.data.order.slice(0,n),r=0;r<n;r++)h[r]=h[r]?this.Gx(this.getItem(h[r]),e,0):"";s=Math.max(s,nt(h,"webix_table_cell webix_cell").width)}if("data"!=i){for(var o=0;o<e.header.length;o++){var a=e.header[o];if(a){var u=0;if(a.rotate)for(var c=0;c<(a.rowspan||1);c++)u+=this.el[c];var f="webix_table_cell webix_cell "+(a.css||"")+(a.rotate?"webix_measure_rotate":""),l=nt([a.text],f,u);s=Math.max(s,a.rotate?l.height:l.width)}}e.sort&&(s+=10)}return s+1+(S.isIE?Xi.layoutPadding.space:0)},Ox:function(t,i,e){if(0<=t){var s=this.Wx(t,i);return this.So(t,s,e)}},adjustColumn:function(t,i){this.Ox(this.getColumnIndex(t),i)},adjustRowHeight:function(t,i){var e=this;if(t){var s,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&&(s=this.$view.cloneNode(!0),document.body.appendChild(s),s.appendChild(h)),this.data.each(function(t){h.innerHTML=this.Gx(t,n,0),t.$height=Math.max(h.scrollHeight,this.J.rowHeight)},this),h=G(h),s&&G(s)}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){e.adjustRowHeight(o[t].id,!0);var i=0;e.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()}},xr={math_setter:function(t
){return t&&this.Xx(),t},qx:"$",Xx:function(){S.strict||(this.data.attachEvent("onStoreUpdated",C(this.Jx,this)),this.data.attachEvent("onStoreLoad",C(this.Kx,this)),this.attachEvent("onStructureLoad",this.Kx))},Jx:function(t,i,e){if(t&&"paint"!=e)if("delete"==e)for(var s=0;s<this.tl.length;s++)this.Zx(i,this.tl[s].id);else{"add"==e&&this.Qx(i);for(var n=0;n<this.tl.length;n++)this.ty(t,this.tl[n].id,"add"!==e);this.iy={}}},ty:function(t,i,e){var s,n=this.getItem(t);if(!0===e?s=n[this.qx+i]||n[i]:(s=n[i],this.iy={}),s&&0<s.length&&"="===s.toString().substr(0,1)?(n[this.qx+i]&&!0===e||(n[this.qx+i]=n[i]),n[i]=this.ey(s,t,i)):("undefined"!=typeof n[this.qx+i]&&delete n[this.qx+i],this.Zx(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.iy[r]&&(this.iy[r]=!0,this.ty(n.depends[i][h][0],n.depends[i][h][1],!0))}},ny:function(t,i){var e=this.getItem(t);"undefined"!=typeof e[this.qx+i]&&(e[i]=e[this.qx+i])},Kx:function(){if(this.tl&&this.count()){this.Qx();for(var t=0;t<this.tl.length;t++){var i=this.columnId(t);this.data.each(function(t){this.ty(t.id,i)},this)}this.iy={}}},Qx:function(t){for(var i=0;i<this.tl.length;i++)if(this.tl[i].math){var e=this.columnId(i),s="="+this.tl[i].math;s=s.replace(/\$c/g,"#$c#"),t?(t[e]=this.hy(s,t.id,e),delete t[this.qx+e],this.Zx(t,e)):this.data.each(function(t){t[e]=this.hy(s,t.id,e),delete t[this.qx+e],this.Zx(t,e)},this)}},hy:function(t,i,e){return It(t)({$r:i,$c:e})},oy:function(t,i){var e;if(!this.exists(t))return"#out_of_range";var s=(e=this.getItem(t))[this.qx+i]||e[i]||0;return"="!==(s=s.toString()).substring(0,1)?s:("undefined"==typeof e[this.qx+i]&&(e[this.qx+i]=e[i]),e[i]=this.ey(s,t,i,!0),e[i])},ey:function(t,i,e,s){if(!0===s){if(this.ay(i,e))return"#selfreference"}else this.uy();this.cy(i,e);var n=this.getItem(i);t=t.substring(1);var h=this.fy(t),r=this.ly(t,i);t=h?(t=this.vy(t,r),this._y(t,h)):this.vy(t,r,!0);var o=this.my(t);if(!1!==o)return o;this.gy(i,e),this.Zx(n,e);for(var a=0;a<r.length;a++)this.wy([i,e],r[a]);return!1!==(o=this.my(t))?o:t?(t=this.xy(t.replace(/\$r/g,n.id)),!1!==(o=this.my(t))?o:t):t},fy:function(t){return t.replace(/\[[^)]*?\]/g,"").match(/(\+|-|\*|\/)/g)},ly:function(t,i){var e=t.match(/\[([^\]]+),([^\]]+)\]/g);null===e&&(e=[]);for(var s=0;s<e.length;s++){var n=e[s],h=n;(n=(n=n.substr(1,n.length-2)).split(","))[0]=this.yy(n[0]),n[1]=this.yy(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,e[s]=n}return e},vy:function(t,i,e){var s="(",n=")";e&&(s=n="");for(var h=0;h<i.length;h++){var r=i[h],o=this.oy(r[0],r[1]);isNaN(o)&&(o='"'+o+'"'),t=t.replace(r[2],s+o+n)}return t},_y:function(t,i){for(var e=[],s=0;s<i.length;s++){var n=i[s],h=this.My(t,n);e.push(h[0]),t=h[1]}e.push(t);for(var r=0;r<e.length;r++){var o=this.yy(e[r]);e[r]=o}for(var a="",u=0;u<e.length-1;u++)a+=e[u]+i[u];return a+=e[e.length-1]},xy:function(t){var i;try{i=window.eval(t)}catch(e){i=""}return i.toString()},My:function(t,i){var e=t.indexOf(i);return[t.substr(0,e),t.substr(e+1)]},yy:function(t){return t=(t=t.replace(/^ */g,"")).replace(/ *$/g,"")},uy:function(){this.Sy=[]},cy:function(t,i){this.Sy[t+"__"+i]=!0},gy:function(t,i){"undefined"!=typeof this.Sy[t+"__"+i]&&delete this.Sy[t+"__"+i]},ay:function(t,i){return"undefined"!=typeof this.Sy[t+"__"+i]},wy:function(t,i){var e=this.getItem(i[0]);"undefined"==typeof e.depends&&(e.depends={}),"undefined"==typeof e.depends[i[1]]&&(e.depends[i[1]]={}),e.depends[i[1]][t[0]+"__"+t[1]]=t,"undefined"==typeof(e=this.getItem(t[0])).triggers&&(e.triggers={}),"undefined"==typeof e.triggers[t[1]]&&(e.triggers[t[1]]={}),e.triggers[t[1]][i[0]+"__"+i[1]]=i},Zx:function(t,i){if(t&&"undefined"!=typeof t.triggers)for(var e in t.triggers[i]){var s=t.triggers[i][e],n=this.getItem(s[0]);n&&delete n.depends[s[1]][t.id+"__"+i]}},my:function(t){var i=t.match(/#\w+/);return null!==i&&0<i.length&&i[0]}},yr={headermenu_setter:function(t){
return t&&(t.data&&(this.ky=!0),t=this.Cy(t)),t},Cy: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=Pt(this.J.headermenu),e=i.getItem(t).hidden;i.getItem(t).hidden=!e,i.refresh(t),i.$blockRender=!0;var s={spans:"object"==k(n)&&n.spans};return e?this.showColumn(t,s):this.hideColumn(t,s),i.$blockRender=!1},this)},data:[]};"object"==k(n)&&H.extend(t,n,!0);var i=zt(t);return i.attachTo(this.U),this.ht.push(i),this.attachEvent("onStructureLoad",this.$y),this.attachEvent("onStructureUpdate",this.$y),this.Cy=function(t){return t},i.J.id},$y:function(){var t=Pt(this.J.headermenu),i=this.yo;if(!t.$blockRender){if(this.ky)return t.data.each(function(t){t.hidden=!!i[t.id]}),void t.refresh();var e=[],s=this.mo;s.length||(s=this.tl);for(var n=0;n<s.length;n++){var h=this.getColumnConfig(s[n].id||s[n]),r=h.header[0],o=!!i[h.id];!1!==h.headermenu&&r&&e.push({id:h.id,value:o?r.text:r.groupText||r.text,hidden:o})}e.length&&t.data.importData(e)}}};xn.headerMenu={getValue:function(){},setValue:function(){},refresh:function(t,i){t.J.headermenu||(t.define("headermenu",!0),t.$y()),i.onclick=function(){Pt(t.config.headermenu).show(i)}},render:function(){return"<span class='webix_icon wxi-columns' role='button' tabindex='0' aria-label='"+ct.aria.headermenu+"'>"}};var Mr={ya:function(t){return this.getColumnConfig(t.column).editor},getEditor:function(t,i){return t?(1==arguments.length&&(i=t.column,t=t.row),(this.fa[t]||{})[i]):this.Ei},za:function(t){for(var i in this.fa){var e=this.fa[i];for(var s in e)"$count"!=s&&t.call(this,e[s])}},Ma:function(t,i,e){var s=t.row,n=t.column,h=i.config=this.getColumnConfig(n);!1!==e&&this.showCell(s,n);var r=i.render();i.$inline&&(r=this._a(t)),i.node=r;var o,a=this.getItem(s),u=h.editFormat;return this.J.editMath&&(o=a["$"+n]),x(o=o||a[n])&&(o=""),i.setValue(u?u(o):o,a),i.value=a[n],this.$a(t,i),i.$inline||(i.Dy=this.Da(t,r,!0)),i.afterRender&&i.afterRender(),this.J.liveValidation&&(Nt(i.node,"keyup",this.Ay(t,this)),this.validateEditor(t)),r},Ay:function(t,i){return function(){i.validateEditor(t)}},Va:function(t){var i=this.getColumnConfig(t.column).editParse,e=t.getValue();return i?i(e):e},wa:function(t,i,e){var s=e?{}:this.getItem(t.row);return s[t.column]=i,this.J.editMath&&(s["$"+t.column]=null),s},$a:function(t,i){var e=this.fa[t.row]=this.fa[t.row]||{};e.$count=(e.$count||0)+1,i.row=t.row,i.column=t.column,this.Ei=e[t.column]=i,this.Ti++,this.Iy=this.getScrollState()},Ia:function(t){this.Ei==t&&(this.Ei=0),t.destroy&&t.destroy();var i=this.fa[t.row];delete i[t.column],i.$count--,i.$count||delete this.fa[t.row],this.Ti--},pa:function(t,i){var e=this.fa[t];if(e)for(var s in this.fa[i]=e,delete this.fa[t],e)"$count"!=s&&(e[s].row=i)},Aa:function(t){var i,e,s,n,h,r=this.getColumnConfig(t.column),o=0;if(r&&r.node&&r.attached){if(s=this.getIndexById(t.row),this.sl&&this.getSpan(t.row,t.column))for(e=0;e<3;e++)for(i=this.Ty[e],n=0;!o&&n<i.childNodes.length;n++)(h=i.childNodes[n]).getAttribute("row")==s&&h.getAttribute("column")==this.getColumnIndex(t.column)&&(o=h);!o&&s>=r.Fy-this.J.topSplit&&s<r.zy&&(o=r.node.childNodes[s-r.Fy+this.J.topSplit])}return o},editCell:function(t,i,e,s){return i=i||this.J.columns[0].id,De.edit.call(this,{row:t,column:i},e,s)},editRow:function(i){i&&i.row&&(i=i.row);var e=!1;this.eachColumn(function(t){this.edit({row:i,column:t},e,!e),e=!0})},editColumn:function(i){i&&i.column&&(i=i.column);var e=!1;this.eachRow(function(t){this.edit({row:t,column:i},e,!e),e=!0})},eachRow:function(t,i){var e=this.data.order;i&&(e=this.data.Cr||e);for(var s=0;s<e.length;s++)t.call(this,e[s])},eachColumn:function(t,i){for(var e in this.il){var s=this.il[e];t.call(this,s.id,s)}if(i)for(var n in this.yo){var h=this.yo[n];t.call(this,h.id,h)}},Ba:function(t){if(this.getSelectedId&&1==this.getSelectedId(!0).length)return this.Do(t),!1},Ii:function(t,i){if(this.J.editable&&!this.Ti){if(i.target&&"INPUT"==i.target.tagName)return!0
;var e=this.getSelectedId(!0);if(1==e.length){var s=e[0];return"row"==this.J.select&&(s.column=this.J.columns[i.shiftKey?0:this.J.columns.length-1].id),this.editNext(t,s),!1}}return!0},Ha:function(t,i,e){var s=this.getIndexById(t.row),n=this.getColumnIndex(t.column),h=this.data.order,r=this.tl;if(e)for(var o=s;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.Vy||!this.Vy(t,u)))return u}n=-1}else for(var c=s;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},Hy:function(){this.Ti&&(this.By?this.By=!1:(this._h.scrollTo(this.getScrollState().y+this.Wt.childNodes[1].firstChild.scrollTop),this.Wt.childNodes[1].firstChild.scrollTop=0,this.By=!0))},Ry:function(){this.Ti&&this.mh.scrollTo(this.Wt.childNodes[1].scrollLeft)},ba:function(){this.attachEvent("onScrollY",this.Py),this.attachEvent("onScrollX",this.Py),this.attachEvent("onScrollY",this.la),this.attachEvent("onColumnResize",function(){this.editStop()}),this.attachEvent("onAfterFilter",function(){this.editStop()}),this.attachEvent("onRowResize",function(){this.editStop()}),this.attachEvent("onAfterScroll",function(){this.J.topSplit&&this.editStop()}),this.Wt.childNodes[1].firstChild.onscroll=C(this.Hy,this),this.Wt.childNodes[1].onscroll=C(this.Ry,this)},Py:function(){if(this.Ti){var t=this.Iy;this.Iy=this.getScrollState();var r=this.Iy.y-t.y;this.za(function(t){if(t.getPopup){var i=this.getItemNode(t),e=!1;if(this.J.prerender){var s=t.Dy,n=s.top-this.ph,h=s.left-this.bh;e=n<0||n+s.height>this.jy||h<0||h+s.width>this.$width-this.Ey}!i||e?t.getPopup().show({x:-1e4,y:-1e4}):t.getPopup().show(i)}this.J.prerender||t.linkInput||t.$inline||(t.node.top-=r,t.node.style.top=t.node.top+"px")})}}},Sr={$init:function(){this.Ny(),this.attachEvent("onStructureLoad",this.Ly)},Ny:function(){this.yo={},this.mo=p(),this.Mo=[0,0]},Ly:function(){for(var t=this.tl,i=0;i<t.length;i++)t[i].header&&this.Oy(t,t[i].header),t[i].footer&&this.Oy(t,t[i].footer);for(var e=t.length-1;0<=e;e--)t[e].hidden?this.hideColumn(t[e].id,{},!0,!0):t[e].batch&&this.config.visibleBatch&&t[e].batch!=this.config.visibleBatch&&this.hideColumn(t[e].id,{},!0,!0)},Oy:function(t,i){for(var e=0;e<i.length;e++){var s=i[e];s&&s.colspan&&!s.$colspan&&(s.$colspan=s.colspan)}},moveColumn:function(t,i){var e=this.getColumnIndex(t);if(e!=i){var s=this.J.columns,n=s.splice(e,1),h=i-(e<i?1:0);A.insertAt.call(s,n[0],h);var r=this.mo;if(r.length){var o=(r=p(r)).find(t);r.removeAt(o),0===h?r.unshift(t):r.insertAt(t,r.find(s[h-1].id)+1)}this.Uy()}},Yy:function(){var t=this.mo,i=this.J.columns;if(!t.length){for(var e=0;e<i.length;e++)t[e]=i[e].id;this.Mo=[this.J.leftSplit,this.kw]}},isColumnVisible:function(t){return!this.yo[t]},hideColumn:function(t,i,e,s){var n,h=this.J.columns,r=this.mo,o=this.yo,a=1;if(i=i||{},!1!==s){var u=this.getColumnIndex(t);if(-1===u||!this.callEvent("onBeforeColumnHide",[t]))return;if(-1==u)return;if(this.Yy(),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.J.leftSplit&&(this.J.leftSplit-=a),u>=this.kw?this.J.rightSplit-=a:this.kw-=a;for(var l=u+a-1;u<=l;l--)this.Wy(u),(o[(n=h.splice(u,1)[0]).id]=n).Fy=-1,delete this.il[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?(A.insertAt.call(h,w,p),delete w.hidden,delete o[w.id],this.il[w.id]=w):a--}_<this.Mo[0]&&(this.J.leftSplit+=a),_>=this.Mo[1]?this.J.rightSplit+=a:this.kw+=a,this.callEvent("onAfterColumnShow",[t])}n.header&&this.Gy(n,!1!==s?0:1,"header"),n.footer&&this.Gy(n,!1!==s?0:1,"footer"),e||this.Uy()},Gy:function(t,i,e){for(var s=t[e].length-1;0<=s;s--)for(var n,h=this.mo,r=!1,o=0,
a=0;a<h.length;a++){var u=this.getColumnConfig(h[a]),c=u[e][s];this.isColumnVisible(h[a])?(r&&0<o&&n&&0<n.colspan?n=c=u[e][s]=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){this.Xy=!0,(t&&t!=this.config.columns||i)&&(this.Ny(),this.wo={},t&&(this.kw=t.length-(this.config.rightSplit||0))),this.il={};for(var e=0;e<this.tl.length;e++){var s=this.tl[e];(this.il[s.id]=s).attached=s.node=null}for(var n=0;n<3;n++)this.U.childNodes[n].innerHTML="",this.Wt.childNodes[n].firstChild.innerHTML="";this.tl=this.config.columns=t||this.config.columns,this.kw=this.tl.length-this.J.rightSplit,this.xo=0,this.qy(),this.callEvent("onStructureUpdate"),this.jh(),this.render(),this.Xy=0},Uy:function(){this.xo=0,this.callEvent("onStructureUpdate"),this.Jy(),this.render()},showColumn:function(t,i,e){return this.hideColumn(t,i,e,!1)},showColumnBatch:function(s,n){var h=void 0!==n;n=!1!==n,this.eachColumn(function(t,i){if(i.batch){var e=this.yo[i.id];n||(e=!e),i.batch==s&&e?this.hideColumn(i.id,{spans:!0},!0,!n):h||i.batch==s||e||this.hideColumn(i.id,{spans:!0},!0,n)}},!0),this.Uy()}},kr={$init:function(){this.attachEvent("onAfterScroll",this.cu),this.attachEvent("onFocus",function(){et(this.$view,"webix_dtable_focused")}),this.attachEvent("onBlur",function(){st(this.$view,"webix_dtable_focused")})},cu:function(){if(!this.Ky()){var t=this.mt.querySelector(".webix_cell");t&&t.setAttribute("tabindex","0")}},Ky: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,e){if(!this.J.disabled){i=i||{};var s=this.getSelectedId(!0),n=s.length-1,h=!(!this.J.multiselect&&!this.J.areaselect)&&i.shift;if(1<s.length&&"cell"!==this.J.select&&(s=s.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,s=[{row:1,column:1}]}if(0<=n){var r=s[n].row,o=s[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.sc?this.sc.config.size:Math.round(this.jy/this.J.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.J.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.Zy)&&"right"==t)return this.open?this.open(r):this.openSub(r);if((this.close||this.Zy)&&"left"==t)return this.close?this.close(r):this.closeSub(r)}}if(r){this.showCell(r,o),this.select||(H.extend(this,this.Nw.Ew,!0),this.J.select=this.open||this.Zy?"row":"cell",H.extend(this,this.Nw[this.J.select],!0));var f={row:r,column:o};if(h&&"area"==this.J.select){var l=this.dw[this.dw.length-1];this.uw(f,l,t,i)}else this.Do(f,h);if(!this.J.clipboard&&!1!==e){var d=this.getItemNode(f);d&&d.focus()}}}return!1}}},Cr={Lo:function(t){var i=ie.Xs;this.J.prerender||(t=[i.start]);for(var e=0;e<t.length;e++){for(var s=0;s<this.tl.length;s++){var n=this.getItemNode({row:t[e],cind:s});n&&et(n,"webix_invisible")}this.data.addMark(t[e],"webix_invisible",1,1,!0)}},Oo:function(t){var i=ie.Xs;this.J.prerender||(t=[i.start]);for(var e=0;e<t.length;e++){for(var s=0;s<this.tl.length;s++){var n=this.getItemNode({row:t[e],cind:s});n&&st(n,"webix_invisible")}this.data.removeMark(t[e],"webix_invisible",1)}},Po:function(t){for(var i=0;i<this.tl.length;i++){var e=this.tl[i],
s=this.getItemNode({row:t,cind:i});s?s.parentNode.insertBefore(ie.vn[i],s):e.node.appendChild(ie.vn[i])}},Uo:function(){var t=[],i=this.tl.length,e=document.createElement("div");e.className="webix_drop_area",e.style.height=this.J.rowHeight+"px",e.innerHTML=this.$dropHTML();for(var s=0;s<i;s++)t.push(e.cloneNode(!0));return t}},$r={drag_setter:function(t){return this.attachEvent("onBeforeDrag",function(t){return this.Qy(t.source)}),this.attachEvent("onBeforeDragIn",function(t){var i=this.Qy(t.target);return!i&&ie.vn&&(G(ie.vn),this.Wo=ie.vn=null),i}),ye.drag_setter.call(this,t),"order"!=t&&"move"!=t||H.extend(this,Cr,!0),t},Qy:function(t){var i,e,s=!1;if(this.J.topSplit&&t)for(b(t)||(t=[t]),i=0;!s&&i<t.length;i++)s=0<=(e=this.getIndexById(t[i]))&&e<this.J.topSplit;return!s},Ot:function(t){for(var i="<div class='webix_dd_drag' style='width:"+(this.be-this.Yx)+"px;'>",e=this.J.columns,s=0;s<e.length;s++){var n=this.Gx(t,e[s]);i+="<div style='width:"+e[s].width+"px;'>"+n+"</div>"}return i+"</div>"},getHeaderNode:function(t,i){return this.tM(t,i,this.U)},getFooterNode:function(t,i){return this.tM(t,i,this.Zf)},tM:function(t,i,e){if(this.isColumnVisible(t)){var s=this.getColumnIndex(t),n=this.J.leftSplit>s?0:this.kw<=s?2:1;i=i||0;var h=e.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")==s)return r[o].firstChild}return null},getItemNode:function(t){if(t&&!t.header){var i=t.row||t,e="number"==typeof t.rind?t.rind:this.getIndexById(i),s=this.bw(),n=s[0]-this.J.topSplit;if(e<n&&e>s[1])return;var h=this.mw(),r=this.J.leftSplit?0:h[0],o="number"==typeof t.cind;if((t.column||o)&&(r=o?t.cind:this.getColumnIndex(t.column))<this.kw&&r>=this.J.leftSplit&&(r<h[0]||r>h[1]))return;var a=this.J.columns[r];if(a.attached&&a.node){if("$webix-drop"===i)return ie.vn[r];for(var u=e<this.J.topSplit||this.J.prerender?e:e-n,c=a.node.childNodes,f=Math.min(c.length,u+1),l=0;l<f;l++)"webix_drop_area"===c[l].className&&u++;return c[u]}}},iM:function(t){var i=(t.target||t.srcElement).nodeName;return"INPUT"!=i&&"TEXTAREA"!=i},dragColumn_setter:function(t){var r;"order"==t?r={$drag:C(function(t,i){if(!this.iM(i)||this.Ov)return!1;var e=this.locate(i);if(!e||!this.callEvent("onBeforeColumnDrag",[e.column,i]))return!1;ie.Xs={from:r,start:e,custom:"column_dnd"};var s=this.getColumnConfig(e.column);return this.eM=K(i),this.sM=s.width,"<div class='webix_dd_drag_column' style='width:"+s.width+"px'>"+(s.header[0].text||"&nbsp;")+"</div>"},this),$dragPos:C(function(t,i,e){var s=ie.getContext(),n=J(this.$view);e.style.display="none";var h=document.elementFromPoint(t.x,n.y+1),r=h?this.locate(h):null,o=ie.getContext().start.column;if(r&&r.column!=o&&(!this.nM||r.column!=this.hM)&&"column_dnd"==s.custom&&Pt(h)==this){if(!this.callEvent("onBeforeColumnDropOrder",[o,r.column,i]))return;var a=this.getColumnIndex(o),u=this.getColumnIndex(r.column);i.touches&&(this.rM=i.target,this.rM.style.display="none",this.$view.parentNode.appendChild(this.rM)),this.moveColumn(o,u+(a<u?1:0)),this.hM=r.column,this.nM=!0}if(r&&r.column==o&&(this.nM=!1),e.style.display="block",t.x=t.x-this.eM.x,t.y=n.y,t.x<n.x)t.x=n.x;else{var c=n.x+this.$view.offsetWidth-this.Yx-this.sM;t.x>c&&(t.x=c)}ie.rn=!0},this),$dragDestroy:C(function(t,i){G(i),this.rM&&G(this.rM);var e=ie.getContext().start;this.callEvent("onAfterColumnDropOrder",[e.column,this.hM,t])},this),$drop:function(){}}:t&&(r={To:!0,$drag:C(function(t,i){if(!this.iM(i)||this.Ov)return!1;var e=this.locate(i);if(!e||!this.callEvent("onBeforeColumnDrag",[e.column,i]))return!1;ie.Xs={from:r,start:e,custom:"column_dnd"};for(var s=this.getColumnConfig(e.column).header,n="&nbsp;",h=0;h<s.length;h++)if(s[h]){n=s[h].text;break}return"<div class='webix_dd_drag_column'>"+n+"</div>"},this),$drop:C(function(t,i,e){var s=e;e.touches&&this.oM&&(s=this.oM);var n=this.locate(s);if(!n)return!1;var h=ie.getContext().start.column;if(h!=n.column){if(!this.callEvent("onBeforeColumnDrop",[h,n.column,e]))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,e])}},this),$dragIn:C(function(t,i,e){var s=ie.getContext();if("column_dnd"!=s.custom||s.from!=r)return!1;for(var n=e.target||e.srcElement;-1==(n.className||"").indexOf("webix_hcell");)if(!(n=n.parentNode))return;return n!=this.oM&&(this.oM&&st(this.oM,"webix_dd_over_column"),et(n,"webix_dd_over_column")),this.oM=n},this),$dragDestroy:C(function(t,i){this.oM&&st(this.oM,"webix_dd_over_column"),G(i)},this)}),t&&(ie.addDrag(this.U,r),ie.addDrop(this.U,r,!0))}},Dr={eh:function(t,i){if(t.scroll&&!i)return!0;t.header=x(t.header)?!!this.config.header:t.header,t.footer=x(t.footer)?!!this.config.footer:t.footer,t.xCorrection=t.xCorrection||0},tm:function(t,i){for(var e=-1,s=0;e<0&&s<t.length;s++)i(t[s])&&(e=s);return e},aM:function(e,c,f){var l={},d=0;return e.forEach(C(function(t,o){var i=t[0],a=[],u=i.length;i.forEach(C(function(t,i){for(var e=c[i+d],s=0;s<e[f].length;s++){var n=e[f][s];if(n||l[o]&&l[o][s]){if(n=B(n||{text:""}),l[o]&&l[o][s]&&0===i&&(n.colspan=l[o][s],l[o][s]=0),n.colspan){var h=Math.min(n.colspan,u-i);l[o+1]=l[o+1]||{},l[o+1][s]=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(e.id,s).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":e.width+"px"},span:n.colspan||n.rowspan?{colspan:n.colspan||1,rowspan:n.rowspan||1}:null};a[s]=a[s]||[],a[s][i]=r}}},this)),e[o]="header"==f?a.concat(t):t.concat(a),d+=u},this)),e},sh:function(v,t,_){var p=this.config.columns,m=this.getSelectedId(!0),b=this.hh(v),g=0,w=0,x=[],y=0;return _=_||0+v.xCorrection,t=t||[],this.eachRow(C(function(i){for(var t=0,e=this.getItem(i),s=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.tm(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]:e[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.il[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":(e.$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(s+1,w)),h=h||!!f}else u&&(n.push({$inspan:!0}),g=Math.max(a+1,g),w=Math.max(s+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.sh(v,t,y):(v.footer&&(t=this.aM(t,p,"footer")),v.header&&(t=this.aM(t,p,"header"))),t},nh:function(n,h){var r=Y("div");return n.forEach(C(function(t,i){var e=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 s=Y("tr");t.forEach(function(t){if(!t.$inspan){var i=Y("td");for(var e in i.innerHTML=t.txt,i.className=t.className,t.style)i.style[e]=t.style[e];t.span&&(i.colSpan=t.span.colspan,i.rowSpan=t.span.rowspan),s.appendChild(i)}}),e.appendChild(s)}),r.appendChild(e),i+1<n.length){var s=Y("DIV",{"class":"webix_print_pagebreak"});r.appendChild(s)}},this)),r}},Ar={$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=x(t.heights)?"all":t.heights;var i=Vs(this,t);return i[0].styles=this.uM(t),delete t.dataOnly,i},uM:function(t){var c=this.config.columns,f=[]
;return this.cM=this.cM||{},t.docHeader&&(f=[{0:this.fM(t.docHeader.css)},{0:{}}]),!1!==t.header&&(f=this.lM(t,"header",f)),this.data.each(function(t){for(var i={},e=0;e<c.length;e++){var s=this.getCss(t.id,c[e].id),n=c[e].node.className,h="",r=this.getIndexById(t.id)%2?"even":"odd",o=null,a=null;if(this.sl&&(o=this.getSpan(t.id,c[e].id))?(a=this.getSpanNode({row:o[0],column:o[1]}),h="webix_dtable_span "+(o[5]||"")):a=this.getItemNode({row:t.id,column:c[e].id}),!a){a=Y("div",{"class":s,style:"visibility:hidden"});var u=c[e].node;c[e].attached||(u=Y("div",{"class":n,style:"visibility:hidden"}),this.Wt.appendChild(u)),u.appendChild(a)}i[e]=this.dM(a,[s,n,h,r].join(":"))}f[f.length]=i},this),!1!==t.footer&&this.config.footer&&(f=this.lM(t,"footer",f)),t.docFooter&&(f=f.concat([{0:{}},{0:this.fM(t.docFooter.css)}])),f},lM:function(t,i,e){for(var s=this.config.columns,n=[],h=0;h<s[0][i].length;h++){for(var r={},o=0;o<s.length;o++){var a=s[o][i][h];if(a){var u=a.colspan?s[o+a.colspan-1].id:s[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.dM(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])}}e[e.length]=r}return e},dM:function(t,i){if(this.cM[i])return this.cM[i];var e=this.vM(t),s={font:{},alignment:{},border:{}};s.font.name=e["font-family"].replace(/,.*$/,""),s.font.sz=.75*e["font-size"].replace("px",""),s.font.color={rgb:We.rgbToHex(e.color)},"normal"!==e["font-weight"]&&(s.font.bold=!0),"underline"===e["text-decoration-line"]&&(s.font.underline=!0),"italic"===e["font-style"]&&(s.font.italic=!0),"line-through"===e["text-decoration-line"]&&(s.font.strike=!0),s.alignment.horizontal=e["text-align"],s.alignment.vertical=e.height==e["line-height"]?"center":"top","normal"==e["white-space"]&&(s.alignment.wrapText=!0),t.firstChild&&t.firstChild.className&&-1!==t.firstChild.className.indexOf("webix_rotate")&&(s.alignment.textRotation=90);var n=We.rgbToHex(e["background-color"])||"FFFFFF";return s.fill={fgColor:{rgb:n}},-1!==e["background-image"].indexOf("gradient")&&(s.fill={fgColor:{rgb:We.rgbToHex(e["background-image"].substring(e["background-image"].lastIndexOf("(")))}}),t.parentNode&&"TD"==t.parentNode.nodeName&&(e=this.vM(t.parentNode)),"0px"!==e["border-right-width"]&&(s.border.right={style:"thin",color:{rgb:We.rgbToHex(e["border-right-color"])||n}}),"0px"!==e["border-bottom-width"]&&(s.border.bottom={style:"thin",color:{rgb:We.rgbToHex(e["border-bottom-color"])||n}}),"0px"!==e["border-left-width"]&&(s.border.left={style:"thin",color:{rgb:We.rgbToHex(e["border-left-color"])||n}}),"0px"!==e["border-top-width"]&&(s.border.top={style:"thin",color:{rgb:We.rgbToHex(e["border-top-color"])||n}}),this.cM[i]=s},fM:function(t){t=H.extend(t||{},{visibility:"hidden","white-space":"nowrap","text-align":"left"});var i="";for(var e in t)i+=e+":"+t[e]+";";var s=Y("div",{style:i});this.Wt.appendChild(s);var n=this.dM(s,i);return G(s),n},vM:function(t){return window.getComputedStyle?window.getComputedStyle(t):t.currentStyle}},Ir={subrow_setter:function(t){return!!t&&(this._M(),this.J.fixedRowHeight=!1,It(t))},subview_setter:function(t){return t&&(this.J.subrow=this.subrow_setter("<div></div>")),t},defaults:{subRowHeight:35},pM:function(){this.data.each(function(t){t&&(t.$sub=this.J.subrow(t,this.type))},this),this.mM()},mM:function(t){if("auto"===this.J.subRowHeight&&this.be&&this.bM(),t&&this.J.subview)for(var i in this.Zy){var e=Pt(this.Zy[i]);e.J.hidden||e.adjust()}},gM:function(t){var i=this.getItem(t);i.$sub=this.J.subrow(i,this.type),"auto"===this.J.subRowHeight&&this.bM(i.id,i.$sub)},$init:function(){this._M=l(function(){var t="#"+this.wM+" .webix_cell.webix_dtable_subview { line-height:normal;}";this.J.fixedRowHeight&&(t+="#"+this.wM+" .webix_column .webix_cell { white-space: nowrap;}"),O(t),this.Zy={},this.attachEvent("onSubViewRender",this.xM),this.data.attachEvent(
"onStoreUpdated",C(function(t,i,e){t?"update"==e||"add"==e?this.gM(t):"delete"==e&&i.$subContent&&(Pt(i.$subContent).destructor(),delete this.Zy[i.$subContent]):this.pM()},this)),this.attachEvent("onResize",function(t,i,e){e!=t&&this.mM(!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.J.subrow,i.$subHeight=i.$subHeight||this.J.subRowHeight,i.$subopen=!0;var e=this.Zy[i.$subContent];e&&(e.repaintMe=!0),this.refresh(t),this.callEvent("onSubViewOpen",[t])}},getSubView:function(t){var i=this.getItem(t);if(i){var e=this.Zy[i.$subContent];if(e)return Pt(e)}return null},resizeSubView:function(t){var i=this.getSubView(t);i&&this.yM(this.getItem(t),i)},yM:function(t,i){var e=i.$getSize(0,0)[2],s=t.$subHeight||this.J.subRowHeight;2<Math.abs(e-(s||0))&&(t.$subHeight=e,this.refresh(t.id))},MM:function(t){var i=t.$width;if(t.nd){var e=t.Vi.length-t.cd;t.rd?i-=t.Na.left+t.Na.right+2:i-=t.Oa*(e-1)+t.Na.left+t.Na.right+2*e}return 0<i},xM:function(n,t){var i,e=this.Zy[n.$subContent];if(e)t.firstChild.appendChild(e),i=Pt(n.$subContent),this.MM(i)||i.adjust(),e.repaintMe&&(delete e.repaintMe,i.config.hidden=!1,i.Me());else{var s,h=this.J.subview;(i="function"==typeof h?h.call(this,n,t.firstChild):((s=B(h)).$scope=this.$scope,zt(s,t.firstChild))).getMasterView=C(function(){return this},this),n.$subContent=i.config.id,this.Zy[n.$subContent]=i.$view,this.ht.push(i),i.attachEvent("onResize",C(function(t,i,e,s){i&&i!=s&&this.refresh(n.id)},this)),this.callEvent("onSubViewCreate",[i,n])}this.yM(n,i||Pt(e))},bM:function(i,e){var s=Y("DIV",{"class":"webix_measure_size webix_cell webix_dtable_subrow"},"");s.style.cssText="width:"+this.be+"px; height:auto; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(s),this.data.each(function(t){(t&&!i||t.id==i&&t.$sub)&&(s.innerHTML=e||this.J.subrow(t,this.type),t.$subHeight=s.offsetHeight)},this),s=G(s)},closeSub:function(t){var i=this.getItem(t);if(i.$subopen){i.$row=!1,i.$subopen=!1;var e=this.Zy[i.$subContent];e&&(Pt(e).config.hidden=!0),this.refresh(t),this.callEvent("onSubViewClose",[t])}}},Tr={spans_setter:function(t){return t&&!this.sl&&this.SM(),t},SM:function(){this.sl={},this.Ty=[],this.data.attachEvent("onStoreLoad",C(function(t,i){i&&i.spans&&this.addSpan(i.spans)},this)),this.data.attachEvent("onClearAll",C(function(){this.sl={}},this)),this.attachEvent("onSyncScroll",function(t,i,e){for(var s=0;s<3;s++)Zi.gs(this.Ty[s],1==s?t:0,i,e)}),this.attachEvent("onScrollY",this.kM),this.attachEvent("onScrollX",this.kM),this.attachEvent("onAfterRender",this.CM),this.attachEvent("onColumnResize",this.CM),this.attachEvent("onSelectChange",this.$M)},addSpan:function(t,i,e,s,n,h){if("object"!=k(t))s=s||1,e=e||1,this.sl[t]||(this.sl[t]={}),this.sl[t][i]=[e,s,n,h];else for(var r=0;r<t.length;r++)this.addSpan.apply(this,t[r])},removeSpan:function(t,i){arguments.length||(this.sl={});var e=this.sl[t];e&&delete e[i]},getSpan:function(t,i){if(!t)return this.sl;var e,s,n,h,r,o=this.sl;for(t in e=this.getIndexById(t),n=this.getColumnIndex(i),o)for(i in o[t])if(r=o[t][i],s=this.getIndexById(t),0<=(h=this.getColumnIndex(i))&&0<=s&&!(e>s+r[1]-1||e<s||n>h+r[0]-1||n<h))return[t,i].concat(r);return null},CM:function(){var t,i,e=this.tl.length-this.J.rightSplit;for(G(this.Ty),i=0;i<3;i++)t=this.Ty[i]=Y("DIV",{"class":"webix_span_layer"}),this.Wt.childNodes[i].appendChild(t);this.kM(),this.J.leftSplit&&this.DM(this.Ty[0],0,this.J.leftSplit),this.J.rightSplit&&this.DM(this.Ty[2],e,this.tl.length),this.DM(this.Ty[1],this.J.leftSplit,e),this.J.topSplit&&!S.touch&&this.AM()},IM:function(){for(var t,i=0,e=0,s=0,n=0;i<this.J.leftSplit;)e+=this.tl[i].width,i++;for(t=(i=this.tl.length-1)-this.J.rightSplit;t<=i;
)n+=this.tl[i].width,i--;for(i=this.J.leftSplit;i<this.tl.length-this.J.rightSplit;i++)s+=this.tl[i].width;return[e,s,n]},AM:function(){var t,i,e,s=this.tl.length-this.J.rightSplit;for(i=3;i<6;i++)t=this.Ty[i]=Y("DIV",{"class":"webix_span_layer_top"}),this.Wt.childNodes[i-3].appendChild(t);e=this.IM(),this.J.leftSplit&&(this.Ty[3].style.width=e[0]+"px",this.DM(this.Ty[3],0,this.J.leftSplit,!0)),this.J.rightSplit&&(this.Ty[5].style.width=e[2]+"px",this.DM(this.Ty[5],s,this.tl.length,!0)),this.Ty[4].style.width=e[1]+"px",this.DM(this.Ty[4],this.J.leftSplit,s,!0)},DM:function(t,i,e,s){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.sl[a];if(u&&(!s||o<this.J.topSplit))for(var c=i;c<e;c++){var f=this.tl[c].id;u[f]&&this.TM(t,o,c,u,n,i,a,f)}n+=this.Ix(this.getItem(a))}}},$M:function(){for(var t=this.config.select,i="cell"==t||"column"==t,e=this.getSelectedId(!0),s=[],n=this.FM||[],h=z()+"",r=!1,o=0;o<e.length;o++){var a=this.sl[e[o]];!a||i&&!a[e[o].column]||(a.$selected&&a.$selected.id==e[o].id||(r=!0),a.$selected=e[o],a.$time=h,s.push(e[o].id))}for(var u=0;u<n.length;u++){var c=this.sl[n[u]];c&&c.$time!==h&&(delete c.$selected,r=!0)}this.FM=[].concat(e),r&&this.CM()},zM:function(t,i){for(var e=0,s=t;s<i;s++){var n=this.tl[s];e+=n?n.width:0}return e},VM:function(t,i){for(var e=0,s=t;s<i;s++){var n=this.getItem(this.data.order[s]);e+=n?this.Ix(n):this.J.rowHeight}return e},TM:function(t,i,e,s,n,h,r,o){var a=s[o],u=a[2]||this.getText(r,o),c="";!s.$selected||"row"!==this.J.select&&s.$selected.column!==o||(c="webix_selected ");var f={column:e,row:i,"class":c+"webix_cell webix_table_cell webix_dtable_span "+(a[3]||""),"aria-colindex":e+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.zM(h,e)+"px",l.style.width=this.zM(e,e+a[0])+"px",l.style.height=this.VM(i,i+a[1])+"px",t.appendChild(l)},kM:function(){if(!this.J.prerender)for(var t=this.getScrollState(),i=0;i<3;i++)this.Ty[i].style.top="-"+(t.y||0)+"px"},Vy:function(t,i){var e,s,n=!1;return this.sl&&(e=this.getSpan(t.row,t.column),s=this.getSpan(i.row,i.column),e&&s&&e[0]==s[0]&&e[1]==s[1]&&(n=!0)),n},getSpanNode:function(t){for(var i=this.Ty,e=this.getIndexById(t.row),s=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")==e&&h[r].getAttribute("column")==s)return h[r];return null}},Fr={name:"datatable",defaults:{leftSplit:0,rightSplit:0,topSplit:0,columnWidth:100,minColumnWidth:20,minColumnHeight:26,prerender:!1,autoheight:!1,autowidth:!1,header:!0,fixedRowHeight:!0,scrollAlignY:!0,scrollX:!0,scrollY:!0,datafetch:50,navigation:!0},$skin:function(){this.defaults.rowHeight=Xi.rowHeight,this.defaults.headerRowHeight=Xi.barHeight-2*Xi.borderWidth},on_click:{webix_richfilter:function(){return!1},webix_table_checkbox:function(t,i){i=this.locate(t);var e=this.getItem(i.row),s=this.getColumnConfig(i.column),n=t.target||t.srcElement,h=("checkbox"==n.type?n.checked:e[i.column]!=s.checkValue)?s.checkValue:s.uncheckValue,r={};return r[i.column]=h,this.updateItem(i.row,r,this.J.checkboxRefresh?"update":"save"),this.callEvent("onCheck",[i.row,i.column,h]),!1},webix_table_radio:function(t){var e=this.locate(t),i=this.getItem(e.row),s=this.getColumnConfig(e.column);return this.eachRow(function(t){var i=this.data.pull[t];i&&i[e.column]==s.checkValue&&(i[e.column]=s.uncheckValue)}),i[e.column]=s.checkValue,this.callEvent("onCheck",[e.row,e.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.Yi.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.wM=this.Yi.id=this.name+z(),this.Yi.className+=" webix_dtable",this.mt=this.Yi,this.U=this.Yi.firstChild,this.Wt=this.U.nextSibling,this.Zf=this.Wt.nextSibling.nextSibling,this.st.setAttribute("role","grid"),t.editable||this.st.setAttribute("aria-readonly","true"),this.data.provideApi(this,!0),this.data.attachEvent("onParse",C(this.HM,this)),this.$ready.push(this.BM),this.tl=[],this.mo=[],this.el=[],this.nl=[],this.RM=[],this.$o={},this.wo={},this.Go=this.PM=0,this.ht=[],this.data.attachEvent("onServerConfig",C(this.jM,this)),this.data.attachEvent("onServerOptions",C(this.EM,this)),this.attachEvent("onViewShow",function(){this.b_(),this.NM()}),this.data.attachEvent("onClearAll",C(function(t){t||(this.bh=this.ph=0,this.mh&&this.mh.reset(),this._h&&this._h.reset(),this.LM(0))},this)),this.attachEvent("onDestruct",this.OM),this.attachEvent("onKeyPress",this.Se),this.attachEvent("onScrollY",this.UM),I("onDataTable",[this,t])},YM:function(){this.Ey=this.Yx=S.scrollSize,O("#"+this.wM+" .webix_cell { height:"+this.J.rowHeight+"px; line-height:"+(this.J.rowLineHeight||this.J.rowHeight)+"px;"+(this.J.fixedRowHeight?"":"white-space:normal;")+" }"),O("#"+this.wM+" .webix_hcell { height:"+this.J.headerRowHeight+"px; line-height:"+this.J.headerRowHeight+"px;}"),this.YM=function(){}},BM:function(){this.data.attachEvent("onStoreLoad",C(this.NM,this)),this.data.attachEvent("onSyncApply",C(this.NM,this)),this.data.attachEvent("onStoreUpdated",C(function(){return this.render.apply(this,arguments)},this)),this.data.attachEvent("onStoreUpdated",C(this.WM,this)),this.render()},refresh:function(){this.render()},render:function(t,i,e){if("save"!=e){if("move"==e){var s=ie.getContext();if(s&&s.fragile)return}if(!this.tl.length){var n=this.J.columns;if(!n||!n.length){if(!this.J.autoConfig||!this.data.order.length||this.mo.length)return;this.xo=0,this.GM()}this.qy()}if(!this.isVisible(this.J.id)||this.$blockRender)return this.YM();var h=this.config.experimental&&!this.J.subview;return!t||-1==i||"paint"!=e&&"update"!=e||h?(this.XM&&(clearTimeout(this.XM),this.XM=0),this.callEvent("onBeforeRender",[this.data])?(this.YM(),this.xo||this.Jy(),this.be&&(h&&("paint"==e||"update"==e)&&t?this.qM(t):this.JM(!0,!0)),t&&"update"==e||(this.Px=this.KM(),this.ZM()),this.st.setAttribute("aria-colcount",Math.max(this.mo.length,this.tl.length)),this.st.setAttribute("aria-rowcount",this.data.count()),this.callEvent("onAfterRender",[this.data]),!0):void 0):(this.XM&&clearTimeout(this.XM),void(this.XM&&this.QM!=t?(this.QM=null,this.XM=$(function(){this.render()},this)):(this.QM=t,this.XM=$(function(){this.render(t,-1,e)},this))))}},getColumnConfig:function(t){return this.il[t]||this.yo[t]},EM:function(t){for(var i in t){var e=this.getColumnConfig(i),s=new $h({data:t[i]});this.ht.push(s),this.Su(s,e)}},jM:function(t){t.columns&&this.xo&&this.refreshColumns(null,!0)},qy:function(){if(this.J.columns){this.tl=this.J.columns,this.il={};for(var t=0;t<this.tl.length;t++){var i=this.tl[t],e=(this.il[i.id]=i).cssFormat;if(e&&(i.cssFormat=m(e,this.$scope)),i.width=i.width||this.J.columnWidth,"string"==typeof i.format&&(i.format=ct[i.format]||window[i.format]),i.numberFormat){var s=i.numberFormat;"string"==typeof s&&(i.numberFormat=s=en.getConfig(s)),
i.format=en.numToStr(s),i.editFormat=i.editFormat||function(t){return en.format(t,s)},i.editParse=i.editParse||function(t){return en.parse(t,s)}}x(i.checkValue)&&(i.checkValue=1),x(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=It(n))}this.tS("header",this.el),this.tS("footer",this.nl),this.callEvent("onStructureLoad",[])}},iS:function(){this.Jy()},OM:function(){for(var t=0;t<this.tl.length;t++)delete this.tl[t].attached,delete this.tl[t].node},Jy:function(){this.kw=this.tl.length-this.J.rightSplit;for(var t=this.eS=0;t<this.tl.length;t++){if(!this.tl[t].node){var i=Y("DIV");i.style.width=this.tl[t].width+"px",this.tl[t].node=i}t>=this.J.leftSplit&&t<this.kw&&(this.eS+=this.tl[t].width)}var e=[];if(this.J.rightSplit){var s=this.tl.length-this.J.rightSplit;e[s]=" webix_first",e[s-1]=" webix_last"}if(this.J.leftSplit){var n=this.J.leftSplit;e[n]=" webix_first",e[n-1]=" webix_last"}e[0]=(e[0]||"")+" webix_first webix_select_mark";var h=this.tl.length-1;e[h]=(e[h]||"")+" webix_last";for(var r=0;r<this.tl.length;r++){var o=this.tl[r].node;o.setAttribute("column",r),o.className="webix_column "+(this.tl[r].css||"")+(e[r]||"")}this.sS(),this.nS(),this.hS(),this.ax(),this.xo=!0},nS:function(){for(var t=0,i=0;i<this.tl.length;i++){var e=this.tl[i];i!=this.J.leftSplit&&i!=this.kw||(t=0),e.node&&(e.node.style.left=t+"px",(this.J.leftSplit||this.J.rightSplit)&&(G(e.node),e.attached=!1)),t+=e.width}},ax:function(){this.rS||(this.rS=0),this.Go=this.PM=0,this.J.header&&(this.oS(this.U,0,1),this.tS("header",this.el),this.Go=this.el.aS,this.uS(this.U,"header",this.el)),this.J.footer&&(this.oS(this.Zf,0,1),this.tS("footer",this.nl),this.PM=this.nl.aS,this.uS(this.Zf,"footer",this.nl)),this.refreshHeaderContent(!1,!1),this.cS(),this.bo&&this.markSorting(this.bo,this.go)},fS:function(t,i,e){var s=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++)s+=this.tl[e+r]?this.tl[e+r].width:this.config.columnWidth;var o=nt([t.text],h,s);return(t.rotate?o.width:o.height)+1},tS:function(t,i){for(var e=0,s=0;s<this.tl.length;s++){var n=this.tl[s][t];n&&"object"==k(n)&&n.length||(x(n)&&(n="header"==t?this.tl[s].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.fS(n[h],this.tl[s],s));e=Math.max(e,n.length),this.tl[s][t]=n}for(var r=(i.aS=e)-1;0<=r;r--)i[r]=i[r]||this.J.headerRowHeight,i.aS+=1*i[r];for(var o=0;o<this.tl.length;o++)for(var a=this.tl[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.tl[o+f][t][u]=null}for(var l=0;l<this.tl.length;l++){var d=this.tl[l][t];if(d.length<e){var v=d.length-1;d[v].rowspan=e-d.length+1;for(var _=v+1;_<e;_++)d[_]=null}}return e},lS:function(t,i){for(var e=t.getElementsByTagName("TD"),s=0;s<e.length;s++)if(e[s].getAttribute("active_id")==i)return e[s]},getHeaderContent:function(t){var i=this.lS(this.U,t);if(i||(i=this.lS(this.Zf,t)),i){var e=this.$o[t],s=xn[e.content],n={type:s,getValue:function(t){return s.getValue(i,t)},setValue:function(t){return s.setValue(i,t)}};return s.getHelper&&H.extend(n,s.getHelper(i,e)),n}},dS:function(t,i,e){var s=e?-1:0;for(e+=i;i<e;i++)s+=t[i]+1;return s},vS:function(t,i,e,s,n){if(t==i)return"";var h="<table role='presentation' style='width:"+e+"px' cellspacing='0' cellpadding='0'>";h+="<tr class='webix_size_row'>";for(var r=t;r<i;r++)h+="<td style='width:"+this.tl[r].width+"px;'></td>";h+="</tr>";for(var o=this.tl[0][s].length,a=0;a<o;a++){h+="<tr section='"+s+"' role='row'>";for(var u=t;u<i;u++){var c=this.tl[u][s][a];if(null!==c){c.content&&(c.contentId=c.contentId||z(),c.columnId=this.tl[u].id,c.format=this.tl[u].format,xn[c.content],c.content,c.text=xn[c.content].render(this,c),this.$o[c.contentId]=c,this._S=!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.dS(this.el,a,c.rowspan)),l!=this.J.headerRowHeight&&(d=" style='line-height:"+l+"px; height:"+l+"px;'");var v="webix_hcell",_=c.css;_&&("object"==k(_)&&(c.css=_=L(_)),v+=" "+_),this.tl[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 e=this.J.pager;if(e){var s=Math.floor(t/e.size);s!=e.page&&Pt(e.id).select(s)}var n=this.getScrollState();if(-1!=t){var h=this.bw();if(t<h[0]+1||t>=h[1]-1){var r=this.pS(e?this.data.$min:0,t);t<h[0]+1?r=Math.max(0,r-1)-this.mS:(r+=this.yx(t)-this.jy,0<t&&(r+=this.yx(t-1)-1)),n.y=r}}if(-1!=i){if(i<this.J.leftSplit)return;if(i>=this.kw)return;var o=this.mw();if(i<o[0]+1||i>=o[1]-1){for(var a=0,u=this.J.leftSplit;u<i;u++)a+=this.tl[u].width;i<o[0]+1||(a+=this.tl[i].width-this.xx),n.x=a}}this.scrollTo(n.x,n.y)},showCell:function(t,i){if(!i||!t){var e=this.getSelectedId(!0);1==e.length&&(i=i||e[0].column,t=t||e[0].row)}i=i?this.getColumnIndex(i):-1,t=t?this.getIndexById(t):-1,this.showItemByIndex(t,i)},scrollTo:function(t,i){if(this.mh){if(this.Bx)return this.Bx(t,i);null!==t&&this.mh.scrollTo(t),null!==i&&this._h.scrollTo(i)}},getScrollState:function(){if(this.Rx)return this.Rx();var t=this._w?0:this.bS||0;return{x:this.bh||0,y:this.ph+t}},showItem:function(t){this.showItemByIndex(this.getIndexById(t),-1)},uS:function(t,i,e){var s=t.childNodes;s[0].innerHTML=this.vS(0,this.J.leftSplit,this.Aw,i,e),s[1].innerHTML=this.vS(this.J.leftSplit,this.kw,this.eS,i,e),s[2].innerHTML=this.vS(this.kw,this.tl.length,this.wx,i,e),this.Xy&&(s[1].scrollLeft=this.getScrollState().x),s[1].onscroll=C(this.gS,this)},gS:function(){var t=this.getScrollState().x,i=this.U.childNodes[1].scrollLeft;i!=t&&this.scrollTo(i,null)},WM:function(){this.refreshHeaderContent(!0,!0)},NM:function(){this.refreshHeaderContent(!1,!0)},refreshHeaderContent:function(t,i,e){this.J.header&&(i&&this.oS(this.U,t,1,e),this.oS(this.U,t,0,e)),this.J.footer&&(i&&this.oS(this.Zf,t,1,e),this.oS(this.Zf,t,0,e))},refreshFilter:function(t){this.refreshHeaderContent(!1,!0,t)},oS:function(t,i,e,s){if(this._S&&t)for(var n=t.getElementsByTagName("TD"),h=0;h<n.length;h++)if(n[h].getAttribute("active_id")){var r=this.$o[n[h].getAttribute("active_id")];if(s&&s!=r.columnId)continue;var o=xn[r.content];e?o.getValue&&(r.value=o.getValue(n[h])):i&&!o.trackCells||o.refresh(this,n[h],r)}},headerContent:[],wS:function(t,i,e){if(this.Yx){if(t.style.height=Math.max(i,1)-1+"px",t.style.width=(this.kw?0:e)+this.Yx-1+"px",S.isWebKit)t.offsetWidth}else t.style.display="none"},cS:function(){this.J.header&&this.wS(this.xS,this.Go,this.rS),this.J.footer&&this.wS(this.yS,this.PM,this.rS)},jh:function(){var t=!(this.J.autowidth||!1===this.J.scrollX);this.Ey=t?S.scrollSize:0;var i=!(this.J.autoheight||!1===this.J.scrollY);this.Yx=i?S.scrollSize:0,S.touch&&(t=i=!1),this.mh&&(this.mh.J.scrollSize=this.Ey,this.mh.J.scrollVisible=t),this._h&&(this._h.J.scrollSize=this.Yx,this._h.J.scrollVisible=i)},sS:function(){var t,i;if(this.ph=0,this.bh=0,t=i=1,(this.J.autoheight||!1===this.J.scrollY)&&(i=this.Yx=0),(this.J.autowidth||!1===this.J.scrollX)&&(t=this.Ey=0),S.touch&&(t=i=0),this.mh||(this.mh=zt({view:"vscroll",container:this.Zf.previousSibling,scrollWidth:this.eS,scrollSize:this.Ey,scrollVisible:t}),!t||this.Ey||S.$customScroll||(this.mh.st.style.position="absolute"),this.mh.attachEvent("onScroll",C(this.MS,this))),!this._h){this.xS=this.Zf.nextSibling;var e=this.xS.nextSibling;this.yS=e.nextSibling,this._h=zt({view:"vscroll",container:e,
scrollHeight:100,scroll:"y",scrollSize:this.Yx,scrollVisible:i}),this._h.activeArea(this.Wt),this.mh.activeArea(this.Wt,!0),this._h.attachEvent("onScroll",C(this.SS,this))}this.be&&this.callEvent("onResize",[this.be,this.we]),S.$customScroll&&fe.enable(this),this.sS=function(){}},columnId:function(t){return this.tl[t].id},getColumnIndex:function(t){for(var i=0;i<this.tl.length;i++)if(this.tl[i].id==t)return i;return-1},kS:function(t,i){var e,s=0,n=0,h=0,r=0,o=0;for(e=0;e<this.tl.length&&(this.kw!=e&&this.J.leftSplit!=e||(s=0,o++),this.tl[e].id!=i);e++)s+=this.tl[e].width;for(n+=this.tl[e].width,e=0;e<this.data.order.length&&this.data.order[e]!=t;e++)r+=this.yx(e);return h+=this.yx(e),[s,n,r-this.ph,h,this.Wt.childNodes[o]]},Jw:function(){return this.row},locate:function(t,i){if(this.J.subview&&this!=Pt(t))return null;for(t=t.target||t.srcElement||t;t&&t.getAttribute&&t!==this.$view;){var e=rt(t).toString(),s=null;if(-1!=e.indexOf("webix_cell")&&(s=this.Hs(t))&&(s.row=this.data.order[s.rind]),-1!=e.indexOf("webix_hcell")&&(s=this.Hs(t))&&(s.header=!0),-1!=e.indexOf("webix_drop_area")&&(s=this.Hs(t))&&(s.row=s.rind="$webix-drop"),s)return i?s.header?null:s.row:(s.column=this.tl[s.cind].id,s.toString=this.Jw,s);t=t.parentNode}return null},Hs:function(t){var i=t.parentNode;if(!i)return null;var e=1*(t.getAttribute("column")||i.getAttribute("column")),s=t.getAttribute("aria-rowindex");return{rind:t.getAttribute("row")||(s?s-1:0),cind:e,span:1*(t.getAttribute("colspan")||i.getAttribute("colspan"))}},Ex:function(){for(var t=-this.xx,i=0;i<this.tl.length;i++)t+=this.tl[i].width;this.bh=Math.min(this.bh,Math.max(0,t))},ko:function(t){this.xo&&(this.Ex(),this.nS(),this.hS(),this.ax(),t||this.JM(!1,!1))},setColumnWidth:function(t,i,e){return this.So(this.getColumnIndex(t),i,e)},So:function(t,i,e,s){if(!(isNaN(i)||t<0)){var n=this.tl[t];n.minWidth&&i<n.minWidth?i=n.minWidth:i<this.J.minColumnWidth&&(i=this.J.minColumnWidth);var h=n.width;return h!=i&&(t>=this.J.leftSplit&&t<this.kw&&(this.eS+=i-h),n.width=i,!!n.node&&(n.node.style.width=i+"px",e||this.ko(),this.callEvent("onColumnResize",[n.id,i,h,!!s]),!0))}},Ix:function(t){return(t.$height||this.J.rowHeight)+(t.$subopen?t.$subHeight:0)},yx:function(t){var i=this.data.order[t];return i?this.Ix(this.data.pull[i]):this.J.rowHeight},pS:function(t,i){if(this.J.fixedRowHeight)return(i-t)*this.J.rowHeight;for(var e=0;t<i;t++)e+=this.yx(t);return e},Gt:function(t,i){1==arguments.length&&(i=t.column,t=t.row);for(var e=this.getItem(t),s=this.getColumnConfig(i),n=0,h=0,r=0;r<this.tl.length;r++){r!=this.J.leftSplit&&r!=this.kw||(n=0);var o=this.tl[r];if(o.id==i){var a=r<this.J.leftSplit?0:r>=this.kw?2:1;h=this.Wt.childNodes[a].firstChild;break}n+=o.width}return{parent:h,top:this.getIndexById(t)<this.J.topSplit?this.pS(0,this.getIndexById(t)):this.pS((this.Mw||0)-this.J.topSplit,this.getIndexById(t))+(this._w||0),left:n,width:s.width,height:e.$height||this.J.rowHeight}},KM:function(){var t=this.J.pager,i=0,e=this.data.order.length;return t&&(i=t.size*t.page,e=Math.min(e,i+t.size),t.level&&(i=this.data.$min,e=this.data.$max)),this.pS(i,e)},setRowHeight:function(t,i){if(!isNaN(i)){i<this.J.minColumnHeight&&(i=this.J.minColumnHeight);var e=this.getItem(t),s=e.$height||this.J.rowHeight;s!=i&&(e.$height=i,this.config.fixedRowHeight=!1,this.render(),this.callEvent("onRowResize",[t,i,s]))}},SS:function(t){var i=this.ph!==t;if(this.ph=t,this.J.prerender)for(var e=this.Wt.childNodes,s=0;s<e.length;s++)e[s].scrollTop=t;else this.JM();S.$customScroll&&fe.jh(this.Wt),i&&(this.callEvent("onScrollY",[]),this.callEvent("onAfterScroll",[]))},LM:function(t){this.Wt.childNodes[1].scrollLeft=this.bh=t,this.J.header&&(this.U.childNodes[1].scrollLeft=t),this.J.footer&&(this.Zf.childNodes[1].scrollLeft=t)},MS:function(t){var i=this.bh!==t;this.LM(t),!1===this.J.prerender&&this.JM(!this.CS),S.$customScroll&&fe.jh(this.Wt),i&&(this.callEvent("onScrollX",[]),this.callEvent("onAfterScroll",[]))},mw:function(t){if(t)return[0,this.tl.length];for(var i=this.bh,e=this.J.leftSplit;0<i&&this.tl.length-1>e;
)i-=this.tl[e].width,e++;var s=e;for(i&&0<e&&e--,i+=this.xx;0<i&&s<this.kw;)i-=this.tl[s].width,s++;return[e,s]},getVisibleCount:function(){return Math.floor(this.jy/this.config.rowHeight)},bw:function(t){var i=this.ph,e=0,s=this.count(),n=this.J.pager;if(n&&(e=n.page*n.size,s=Math.min(s,e+n.size),n.level&&(e=this.data.$min,s=this.data.$max)),this.J.autoheight)return[e,s,0];if(t)return[e,s,0];var h=e,r=this.J.topSplit||0;r&&(h+=r);var o=this.J.fixedRowHeight?this.J.rowHeight:0;if(o){var a=Math.ceil(i/o);i-=a*o,h+=a}else for(;0<i;)i-=this.yx(h),h++;var u=0<h&&i?-(this.yx(h-1)+i):0,c=h;if(i&&h--,i+=(this.jy||this.we)-(this.mS||0),o){var f=Math.ceil(i/o);i-=f*o,c+=f}else for(;0<i&&c<s;)i-=this.yx(c),c++;return s<c&&(c=s),[h,c,u]},qM:function(t){var i=this.getItem(t),e=this.getIndexById(t),s=this.bw(),n=this.config.topSplit,h="";if(n<=e){if(e<s[0]||e>=s[1])return;e-=s[0]-n}else h=e==n-1?" webix_topcell webix_last_topcell":" webix_topcell";for(var r=this.mw(),o=0;o<this.tl.length;o++){var a=this.tl[o];if(o<this.kw&&o>=this.J.leftSplit&&(o<r[0]||o>r[1])&&(a.Fy=-999),a.attached&&a.node){var u=a.node.childNodes[e];if(!u)continue;var c=this.Gx(i,this.tl[o],0);u.innerHTML=c,u.className=this.$S(this.tl[o],c,i,t)+h}}},JM:function(t,i){if(this.tl.length){i&&this.DS();var e=this.mw(this.J.prerender),s=this.bw(!0===this.J.prerender);if(t){for(var n=this.J.leftSplit;n<e[0];n++)this.Wy(n,i);for(var h=e[1];h<this.kw;h++)this.Wy(h,i)}this.pw=[];for(var r=0;r<this.J.leftSplit;r++)this.AS(r,s,i);for(var o=e[0];o<e[1];o++)this.AS(o,s,i,o==e[0]);for(var a=this.kw;a<this.tl.length;a++)this.AS(a,s,i);this.IS(s[0],s[1],i),this.TS(s)}},FS:function(t,i){this.zS=t,this.VS=i,G(this.RM),this.RM=[]},UM:function(){if(this.J.prerender&&this.HS){var t=this.getScrollState();this.HS.style.top="-"+(t.y||0)+"px"}},IS:function(t,i,e){if(this.HS&&(this.HS.style.top=this._w+"px"),e||t!=this.zS||i!=this.VS){if(this.FS(t,i),this.BS){this.BS=!1;for(var s=0;s<this.pw.length;s++){var n,h=this.pw[s],r=this.getItem(h.id);n="function"==typeof r.$row?r.$row.call(this,r,this.type):this.Gx(r,this.getColumnConfig(r.$row),s);var o=this.RM[s]=Y("DIV",null,n);o.className="webix_cell "+(r.$sub?"webix_dtable_sub"+(this.J.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.J.rowHeight;r.$subopen?o.style.height=r.$subHeight+"px":o.style.height=a+"px",o.style.paddingRight=S.scrollSize+"px";var u=this.pw[s].index<this.config.topSplit?-this._w: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._w+"px",this.Wt.appendChild(this.HS)),this.HS.appendChild(o),this.attachEvent("onSyncScroll",function(t,i,e){Zi.gs(this.HS,0,i,e)}),this.J.subview&&this.callEvent("onSubViewRender",[r,o])}}}else if(this.config.topSplit)for(var c=0;c<this.pw.length;c++){var f=this.RM[c];this.pw[c].index<this.config.topSplit&&(f.style.top=this.pw[c].top-this._w+"px")}},TS:function(t){var i=this.J.pager,e=this.J.datafetch,s=!this.RS||t[0]>=this.RS;if(this.RS=t[0],this.PS){if(i&&(!e||e>=i.size)&&this.jS([0,i.size*i.page],Math.max(e,i.size),!0))return this.PS=null;this.Qf(this.PS,s),this.PS=null}else this.J.loadahead&&this.jS(t,this.J.loadahead,s)},jS:function(t,i,e){var s=t[1],n=s+i;e||(s=t[0]-i,n=t[0]),s<0&&(s=0),n=Math.min(n,this.data.order.length-1);for(var h=!1,r=s;r<n;r++)this.data.order[r]||(h?(h.last=r,h.count=r-s):h={start:r,count:n-s});if(h)return this.Qf(h,e),!0},Qf:function(t,i){var e=Math.max(t.count,this.J.datafetch||this.J.loadahead||0),s=i?t.start:t.last-e+1;this.vo(t.count,t.start)||this.loadNext(e,s)},ES:function(t){if(S.isSafari){var i,e,s,n,h=[this.mh,this._h];for(i=0;i<2;i++)(n=h[i])&&n.Jg&&n.Jg.parentNode==t&&(e=n.Jg);e&&(this.NS&&G(this.NS),s=(this.NS=e).cloneNode(!0),e.parentNode.insertBefore(s,e),this.NS.style.display="none",this.Wt.appendChild(this.NS))}},Wy:function(t){var i=this.tl[t];this.ES(i.node),G(i.node),i.attached=!1},DS:function(){for(
var t=0;t<this.tl.length;t++)this.tl[t].Fy=-1;this.RM.length&&(G(this.RM),this.RM=[])},getText:function(t,i){return this.Gx(this.getItem(t),this.getColumnConfig(i),0)},getCss:function(t,i){var e=this.getItem(t);return this.$S(this.getColumnConfig(i),e[i],e,t)},$S:function(t,i,e,s){var n="webix_cell";if(t.cssFormat){var h=t.cssFormat(i,e,s,t.id);h&&("object"==k(h)?n+=" "+L(h):n+=" "+h)}var r=e.$css;r&&("object"==k(r)&&(e.$css=r=L(r)),n+=" "+r);var o=this.data.kr[s];if(o&&(o.$css&&(n+=" "+o.$css),o.$cellCss)){var a=o.$cellCss[t.id];a&&(n+=" "+a)}if(e.$cellCss){var u=e.$cellCss[t.id];u&&("object"==k(u)&&(u=L(u)),n+=" "+u)}var c=this.data.getMark(e.id,"webix_selected");return(c&&(c.$row||c[t.id])||t.$selected)&&(n+=this.Lw),n},Gx:function(t,i,e){return t?((s=t[i.id])!==undefined&&null!==s||(s=""),i.format&&(s=i.format(s)),i.template&&(s=i.template(t,this.type,s,i,e)),s):"";var s},type:{checkbox:function(t,i,e,s){return"<input class='webix_table_checkbox' type='checkbox' "+(e==s.checkValue?'checked="true"':"")+">"},radio:function(t,i,e,s){return"<input class='webix_table_radio' type='radio' "+(e==s.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.Yi.className+=" "+this.type.css)):Tt(this,t),this.type.on_click&&H.extend(this.on_click,this.type.on_click),t},AS:function(t,i,e,s){var n=this.tl[t];if(!n.attached){var h=t<this.J.leftSplit?0:t>=this.kw?2:1;this.Wt.childNodes[h].firstChild.appendChild(n.node),n.attached=!0,n.split=h}if(this.Mw=i[0],this._w=0,this.bS=i[2],this.J.scrollAlignY?i[1]==this.data.order.length||this.data.$pagesize&&i[1]%this.data.$pagesize==0?n.node.style.top=(this._w=i[2])+"px":n.LS&&(n.node.style.top="0px"):(this._w=i[2],n.node.style.top=i[2]+"px"),!(e||n.Fy!=i[0]||n.zy!=i[1]||this.J.topSplit&&n._w!=this._w))return 0;for(var r="",o=this.J.columns[t],a={row:this.J.rowHeight,total:0,single:s},u=0;u<this.J.topSplit;u++)r+=this.OS(u,o,i,a,-this._w,t);this.PS=null;for(var c=Math.max(i[0],this.J.topSplit);c<i[1];c++)r+=this.OS(c,o,i,a,-1,t);return this.ES(n.node),n.node.innerHTML=r,n.Fy=i[0],n.zy=i[1],n.LS=i[2],n._w=this._w,1},OS:function(t,i,e,s,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(s.single&&o.$row&&(this.BS=!0,this.pw.push({top:s.total,id:o.id,index:t}),!o.$sub)){var c=o.$height||s.row;return s.total+=c,"<div"+u+" class='webix_cell' style='height:"+c+"px;'></div>"}var f=this.Gx(o,i,t),l=this.$S(i,f,o,r),d=" aria-selected='true' tabindex='0'";if(-1!==l.indexOf("select"))if(-1!==l.indexOf("row"))this.mw()[0]===h&&(u+=d);else-1!==l.indexOf("col")?t===e[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.J.topSplit-1&&(l="webix_last_topcell "+l)),o.$height?(a="<div"+u+" class='"+l+"' style='height:"+o.$height+"px;"+_+"'>"+f+"</div>",s.total+=o.$height-s.row):a="<div"+u+" class='"+l+"'"+(_?" style='"+_+"'":"")+">"+f+"</div>",v&&(s.total+=o.$subHeight)}else a="<div role='gridcell' class='webix_cell'></div>",this.PS?this.PS.last=t:this.PS={start:t,count:e[1]-t};return s.total+=s.row,a},ZM:function(){if(this.tl.length&&!isNaN(1*this.we)){var t=this.Px+(this.Ey?this.Ey:0);if(!this.J.autoheight&&!this.J.yCount||!this.resize()){this._h.sizeTo(this.we,this.Go,this.PM),this._h.define("scrollHeight",t),this.mS=this.J.topSplit?this.pS(0,this.J.topSplit):0,this.jy=Math.max(0,this.we-this.Ey-this.Go-this.PM);for(var i=0;i<3;i++)this.Wt.childNodes[i].style.height=this.jy+"px",this.J.prerender?this.Wt.childNodes[i].firstChild.style.height=this.Px+"px":this.Wt.childNodes[i].firstChild.style.height=this.jy+"px";this.U.style.height=this.Go+"px"}}},
hS:function(){if(this.tl.length){var t=0;for(this.Aw=0,this.wx=0,this.xx=0;t<this.J.leftSplit;)this.Aw+=this.tl[t].width,t++;for(t=this.tl.length-1;t>=this.kw;)this.wx+=this.tl[t].width,t--;if(this.be&&(!this.J.autowidth||!this.resize())){this.xx=this.be-this.wx-this.Aw-this.Yx,this.Wt.childNodes[1].firstChild.style.width=this.eS+"px",this.Wt.childNodes[0].style.width=this.Aw+"px",this.Wt.childNodes[1].style.width=this.xx+"px",this.Wt.childNodes[2].style.width=this.wx+"px",this.U.childNodes[0].style.width=this.Aw+"px",this.U.childNodes[1].style.width=this.xx+"px",this.U.childNodes[2].style.width=this.wx+"px",this.Zf.childNodes[0].style.width=this.Aw+"px",this.Zf.childNodes[1].style.width=this.xx+"px",this.Zf.childNodes[2].style.width=this.wx+"px";var i=this.xx-this.eS;if(i<0&&(i=0),i!=this.rS&&(this.rS=i,this.cS()),S.isWebKit){this.Wt.childNodes[0].offsetWidth;this.Wt.childNodes[1].offsetWidth,this.Wt.childNodes[1].firstChild.offsetWidth,this.Wt.childNodes[2].offsetWidth}this.mh.sizeTo(this.be-this.Yx),this.mh.define("scrollWidth",this.eS+this.Aw+this.wx)}}},$getSize:function(t,i){if((this.J.autoheight||this.J.yCount)&&this.J.columns){var e=(this.J.yCount||0)*this.J.rowHeight;e||(e=this.isVisible()?this.Px:this.count()*this.J.rowHeight),this.J.height=Math.max(e+(this.Ey?this.Ey:0)-1,this.J.minHeight||0)+this.Go+this.PM}this.J.autowidth&&this.J.columns&&(this.J.width=Math.max(this.eS+this.Aw+this.wx+this.Yx,this.J.minWidth||0));var s=this.Aw+this.wx+this.Yx,n=Li.api.$getSize.call(this,t,i);return n[0]=Math.max(n[0]||s),n},b_:function(){if(this.mh&&!S.touch){var t=this.getScrollState();this.mh.US=this._h.US=-1,this.scrollTo(t.x,t.y)}},$setSize:function(){var t=this.be,i=this.we;Li.api.$setSize.apply(this,arguments)&&(this.xo&&(this.callEvent("onResize",[this.be,this.we,t,i]),this.hS(),this.ZM()),this.render())},YS:function(t){var i=this.getColumnConfig(t);if(i.sort){var e="asc";i.id==this.bo&&(e="asc"==this.go?"desc":"asc"),this.Co(i.id,e,i.sort)}},markSorting:function(t,i){this.WS||(this.WS=Y("DIV"));var e=this.WS.parentNode;if(e&&(e.removeAttribute("aria-sort"),e.removeAttribute("tabindex")),G(this.WS),i){var s=this.GS(this.getColumnIndex(t));s&&(this.WS.className="webix_ss_sort_"+i,s.style.position="relative",s.appendChild(this.WS),s.setAttribute("aria-sort",i+"ending"),s.setAttribute("tabindex","0")),this.bo=t,this.go=i}else this.bo=this.go=null},scroll_setter:function(t){return"string"==typeof t?(this.J.scrollX=-1!=t.indexOf("x"),this.J.scrollY=-1!=t.indexOf("y"),t):this.J.scrollX=this.J.scrollY=t},GS:function(t){for(var i=this.U.getElementsByTagName("TD"),e=null,s=0;s<i.length;s++)if(i[s].getAttribute("column")==t&&!i[s].getAttribute("active_id")&&(e=i[s].firstChild,(i[s].colSpan||0)<2))return e;return e},Co:function(i,e,s){var n=this;e=e||"asc",this.markSorting(i,e),"server"==s?(this.callEvent("onBeforeSort",[i,e,s]),this.loadNext(0,0,0,0,1).then(function(t){n.clearAll(!0),n.parse(t),n.callEvent("onAfterSort",[i,e,s])})):("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,e):this.data.sort(i,e,s||"string"))},XS:function(t,i,e,s){var n;if(t.length)for(n=0;n<t.length;n++)if(!1===m(t[n],this.$scope).call(this,i,e,s))return!1},Pu:function(t,i,e,s){var n=(t=t||event).target||t.srcElement;if(!this.J.subview||this==Pt(n)){for(var h="",r=[],o=!1,a=null;n&&n.parentNode&&n!=this.st.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.tl[c])return;if(o=!0,f){var l=n.parentNode.getAttribute("row")||n.getAttribute("row");if(!l){if(n.getAttribute("column"))return;(l=N(n))>=this.J.topSplit&&!this.J.prerender&&(l+=this.tl[c].Fy-this.J.topSplit)}this.Au=a={row:this.data.order[l],column:this.tl[c].id},a.toString=this.Jw}else this.Au=a={column:this.tl[c].id};if(!1===this.XS(r,t,a,n))return;if(f)this.callEvent("on"+e,[a,t,n])&&s&&this.callEvent("on"+s,[a
,t,n]);else if("ItemClick"==e){"header"==n.parentNode.parentNode.getAttribute("section")&&this.callEvent("onHeaderClick",[a,t,n])&&this.YS(a.column)}r=[]}}n=n.parentNode}return this.XS(r,t,a,this.$view),o}},Te:function(t,i){var e=this.locate(i);if(!e)return null;var s,n=_i.Zt;if(e.header){for(var h,r=i.target||i.srcElement,o=e.cind-(e.span?e.span-1:0),a=-1;r&&!h;)h=(r=r.parentNode).getAttribute("section");for(;null!==(r=r.previousSibling);)a++;var u=this.tl[o][h][a];if(!u.tooltip)return null;n.type.template=It(!0===u.tooltip?"#text#":u.tooltip),s=u}else{var c=n.type.column=this.getColumnConfig(e.column),f=!c.tooltip||!0===c.tooltip;if(!c.tooltip&&c.tooltip!==undefined)return null;if(f&&!this.J.tooltip.template)s=this.getText(e.row,e.column).toString();else if(f)n.type.template=It(this.J.tooltip.template);else{var l=(i.target||i.srcElement).getAttribute("webix_area");n.type.template=l?function(t,i){var e=t[c.id];return It(c.tooltip).call(this,t,i,e[l],l)}:It(c.tooltip)}}return s||this.getItem(e.row)},showOverlay:function(t){if(!this.qS){var i=Y("DIV",{"class":"webix_overlay"},"");this.Wt.appendChild(i),this.qS=i}this.qS.innerHTML=t},hideOverlay:function(){this.qS&&(G(this.qS),this.qS=null)},mapCells:function(t,i,e,s,n,h){if(null===t&&0<this.data.order.length&&(t=this.data.order[0]),null===i&&(i=this.columnId(0)),null===e&&(e=this.data.order.length),null===s&&(s=this.J.columns.length),this.exists(t)&&(t=this.getIndexById(t),null!==(i=this.getColumnIndex(i))))for(var r=0;r<e&&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<s&&i+c<this.J.columns.length;c++){var f=i+c,l=this.columnId(f),d=n(u[l],a,l,r,c);h||(u[l]=d)}}},HM:function(t,i){!this.J.columns&&t.getConfig&&this.define("columns",t.getConfig(i))},GM:function(){var t=this.getItem(this.getFirstId()),i=this.J.columns=[];for(var e in t)"id"!=e&&"$"!=e[0]&&i.push({id:e,header:e[0].toUpperCase()+e.substr(1),sort:"string",editor:"text"});i.length&&(i[0].fillspace=!0),"undefined"==typeof this.J.select&&this.define("select","row")}},zr={api:Fr,view:H.protoUI(Fr,vr,xe,us,de,De,Be,Ne,ce,Dr,ws,{clearValidation:function(){for(var t in this.data.kr)this.JS(t);this.data.clearMark("webix_invalid",!0)},sr:function(t,i){for(var e in this.JS(t),i)this.addCellCss(t,e,"webix_invalid_cell");this.addCss(t,"webix_invalid")},Zh:function(t){this.JS(t),this.removeCss(t,"webix_invalid")},JS:function(t){var i=this.data.getMark(t,"$cellCss");if(i)for(var e in i)i[e]=i[e].replace("webix_invalid_cell","").replace("  "," ")},addRowCss:function(t,i,e){this.addCss(t,i,e)},removeRowCss:function(t,i,e){this.removeCss(t,i,e)},addCellCss:function(t,i,e,s){var n=this.data.getMark(t,"$cellCss"),h=n||{},r=h[i]||"";h[i]=r.replace(e,"").replace("  "," ")+" "+e,n||this.data.addMark(t,"$cellCss",!1,h,!0),s||this.refresh(t)},removeCellCss:function(t,i,e,s){var n=this.data.getMark(t,"$cellCss");if(n){var h=n[i]||"";h&&(n[i]=h.replace(e,"").replace("  "," ")),s||this.refresh(t)}}},Ar,ye,$r,kr,Sr,Mr,xr,yr,wr,gr,br,Ir,mr,pr,_r,{topSplit_setter:function(t){return this.data&&(this.data.$freeze=t),t},freezeRow:function(t,i){var r=this.J.topSplit,e=this.data.order,s=this.data.Cr;function n(t,i,e,s,n){var h;if(e&&r<=t){for(n||r++,h=t;r<=h;h--)s[h]=s[h-1];s[r-1]=i}if(!e&&t<r){for(n||r--,h=t;h<r;h++)s[h]=s[h+1];s[r]=i}}t?(n(this.getIndexById(t),t=t.toString(),i,e),s&&n(s.find(t),t,i,s,!0)):i||(r=0),this.define("topSplit",r),this.refresh()}},Tr,Yi,Fe,le,we,Pe,Re,Li.view,g,Ii)},Vr={name:"excelviewer",$init:function(){this.$ready.push(function(){this.J.toolbar&&Pt(this.J.toolbar).attachEvent("onExcelSheetSelect",C(this.showSheet,this))})},defaults:{datatype:"excel"},$onLoad:function(t){if(t.sheets){this.KS=t,this.J.toolbar&&Pt(this.J.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.ZS],t.dataOnly=!0,t.heights=x(t.heights
)&&t.styles?"all":t.heights;for(var i=[],e=this.ZS,s=0;s<t.sheets.length;s++)this.showSheet(t.sheets[s]),i=i.concat(Vs(this,t)),t.styles&&(i[s].styles=this.uM(t));return this.showSheet(e),delete t.dataOnly,i},showSheet:function(t){this.clearAll();var i=this.data.driver.sheetToArray(this.KS.sheets[t],{spans:this.J.spans}),e=this.J.excelHeader,s={},n={};if(i.sizes)for(var h=0;h<i.sizes.length;h++)"column"==i.sizes[h][0]?s[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(e)if(!0===e){e=i.data.splice(0,1)[0];for(var r=0;r<e.length;r++)e[r]={header:e[r],id:"data"+r,width:s[r],adjust:!s[r],editor:"text",sort:"string"}}else e=B(e);else{e=B(i.data[0]);for(var o=0;o<e.length;o++)e[o]={header:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[o],id:"data"+o,width:s[o],adjust:!s[o],editor:"text",sort:"string"}}this.config.columns=e,this.refreshColumns(),this.parse(i,this.J.datatype),this.ZS=t;var a=this.QS(i.spans),u=this.tk(n),c=this.ik(i.styles,a);(a||u||c)&&this.refresh()},getSheets:function(){return this.KS.names},ek:function(t,i,e,s){for(var n=!1,h=0;h<t.length;h++)if(t[h][0]===i&&t[h][1]===e){t[h][5]=L(this.sk(s)),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},ik:function(t,i){var e=0;if(t&&t.length){for(var s=0;s<t.length;s++){var n=t[s][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[s][1]);o&&(i.length&&this.ek(i,h,o,t[s][2])||(r.$cellCss=r.$cellCss||{},r.$cellCss[o]=this.sk(t[s][2])),e++)}}}return e}return!1},nk:function(t){return 8===(t=t||"000000").length&&(t=t.substring(2)),"#"+t},sk:function(t){var i={};if(t.fill&&t.fill.fgColor&&(i["background-color"]=this.nk(t.fill.fgColor.rgb)),t.font){var e=t.font;e.name&&(i["font-family"]=e.name),e.sz&&(i["font-size"]=e.sz/.75+"px"),e.color&&e.color.rgb&&(i.color=this.nk(e.color.rgb)),e.bold&&(i["font-weight"]="bold"),e.underline&&(i["text-decoration"]="underline"),e.italic&&(i["font-style"]="italic"),e.strike&&(i["text-decoration"]="line-through")}if(t.alignment){var s=t.alignment;s.vertical&&"center"==s.vertical&&(i.display="flex",i["justify-content"]="flex-start",i["align-items"]="center"),s.vertical&&"bottom"==s.vertical&&(i.display="flex",i["justify-content"]="flex-end",i["align-items"]="flex-end"),s.horizontal&&(!s.vertical||"center"!=s.vertical&&"bottom"!=s.vertical?i["text-align"]=s.horizontal:i["justify-content"]="center"),s.wrapText&&(i["white-space"]="normal")}if(t.border){var n=t.border;n.top&&(i["border-top"]="1px solid "+this.nk(n.top.color.rgb)),n.bottom&&(i["border-bottom"]="1px solid "+this.nk(n.bottom.color.rgb)+" !important"),n.left&&(i["border-left"]="1px solid "+this.nk(n.left.color.rgb)),n.right&&(i["border-right"]="1px solid "+this.nk(n.right.color.rgb)+" !important")}return i},tk:function(t){var i=0;for(var e in t){var s=this.config.excelHeader?e-1:e;if(0<=s){var n=this.getIdByIndex(s);this.exists(n)&&(this.getItem(n).$height=t[e],i++)}}return this.config.fixedRowHeight=!i,i},QS:function(t){var i=[];if(this.J.spans&&t&&t.length){this.sl={};for(var e=0;e<t.length;e++)this.config.excelHeader&&t[e][0]--,0<=t[e][0]&&(t[e][0]=this.getIdByIndex(t[e][0]),t[e][1]="data"+t[e][1],i.push(t[e]));return this.addSpan(i),i}return!1}},Hr=(H.protoUI(Vr,zr.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().Vg("prev")}},{view:"text",width:70,value:"0",on:{onBlur:function(){this.getParentView().Vg(this.getValue())},onKeyPress:function(t){13===t&&this.getParentView().Vg(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().Vg("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.hk)},hk: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()},Vg: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()}}),Br=(H.protoUI(Hr,sh.view),{name:"pdfviewer",defaults:{scale:"auto"},$init:function(t){this.$view.className+=" webix_pdf";var i=document.createElement("DIV");i.className="canvas_wrapper";var e=document.createElement("canvas");this.rk=this.$view,this.tt=this.$view.appendChild(i),this.Be=this.tt.appendChild(e),this.$pdfDoc=null,this.$pageNum=0,this.$numPages=0,this.ak=!1,this.uk=null,this.ck=this.Be.getContext("2d"),this.fk=.1,this.lk=t.scaleDelta||1.1,this.dk=t.minScale||.25,this.vk=t.maxScale||10,this._k=1.25,this.pk=40,this.mk=10,this.$ready.push(this.bk)},toolbar_setter:function(t){if("string"==typeof t){var i=Pt(t);return i&&(i.$master=this,i.refresh()),this.attachEvent("onDocumentReady",function(){i?(i.setPage(this.$pageNum),i.setValues(this.$numPages,this.J.scale)):this.toolbar_setter(t)}),t}},bk:function(){if(delete this.J.datatype,this.attachEvent("onScaleChange",function(t,i){i&&this.J.toolbar&&Pt(this.J.toolbar).setScale&&Pt(this.J.toolbar).setScale(t)}),S.touch)this.gk=!1,Nt(this.st,"touchstart",C(function(t){var i=t.targetTouches;2===i.length&&(Q(t),this.gk=Math.abs(i[0].pageY-i[1].pageY))},this)),Nt(this.$view,"touchmove",C(function(t){var i=t.targetTouches;2===i.length&&!1!==this.gk&&(Q(t),Math.abs(i[0].pageY-i[1].pageY)>this.gk?this.zoomIn():this.zoomOut(),this.gk=!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 e=this.$view.clientHeight,s=this.$view.scrollHeight,n=this.$view.offsetHeight,h=this.$view.scrollTop,r=i.y-t.y;if(e===s||r<0&&s-n<h||0<r&&0===h){var o=this.$pageNum+(0<r?-1:1);0<o&&o<=this.$numPages&&(this.$pageNum=o,this.wk(this.$pageNum),this.$view.scrollTop=0<r?s:0)}else this.$view.scrollTop=h-r});else{var t=S.isFF?"DOMMouseScroll":"mousewheel";Lt(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})}},$onLoad:function(t){return window.PDFJS?this.xk(t):si([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.xk(t)},this)
,!0},xk:function(t){if(t.name){var i=new FileReader;i.onload=C(function(t){this.xk({data:t.target.result})},this),i.readAsArrayBuffer(t)}else this.yk({data:t.data})},yk:function(i){var e=this;return PDFJS.getDocument({data:i.data,password:i.password}).then(function(t){e.clear(),e.$pdfDoc=t,e.$numPages=e.$pdfDoc.numPages,e.$pageNum=1,e.Mk(e.$pageNum).then(function(){e.callEvent("onDocumentReady")})})["catch"](function(t){"PasswordException"==t.name&&e.Sk(i)})},getPopup:function(){var e=this;return this.kk||(this.kk=zt({view:"window",position:"center",modal:!0,head:ct.PDFviewer.enterPassword,body:{view:"form",elements:[{view:"text",name:"password",type:"password",invalidMessage:ct.PDFviewer.passwordError,required:!0},{cols:[{view:"button",value:ct.message.cancel,hotkey:"esc",click:function(){e.getPopup().hide()}},{view:"button",type:"form",value:ct.message.ok,hotkey:"enter",click:function(){var t=e.getPopup(),i=t.getBody();i.validate()?(e.yk({data:e.Ck,password:i.getValues().password}),t.hide()):i.focus()}}]}]},on:{onHide:function(){var t=e.getPopup().getBody();t.clear(),t.clearValidation(),delete e.Ck}}})),this.kk},Sk:function(t){var i=this.getPopup(),e=i.getBody();this.Ck=t.data,t.password&&(e.markInvalid("password"),e.setValues({password:t.password})),i.show(),e.focus()},$k:function(t,i){var e=t.getViewport(i);return this.Be.height=e.height,this.Be.width=e.width,this.tt.style.width=e.width+"px",this.tt.style.height=e.height+"px",e},Mk:function(t){var n=this;return n.ak=!0,this.$pdfDoc.getPage(t).then(function(t){var i=isNaN(parseFloat(n.J.scale))?n.fk:n.J.scale,e=n.$k(t,i);i!==n.J.scale&&(i=n.Dk(n.J.scale),e=n.$k(t,i),n.J.scale=i);var s={canvasContext:n.ck,viewport:e};return t.cleanupAfterRender=!0,t.render(s).promise.then(function(){n.callEvent("onPageRender",[n.$pageNum]),n.ak=!1,null!==n.uk&&(n.Mk(n.uk),n.uk=null)})})},wk:function(t){this.ak?this.uk=t:this.Mk(t)},renderPage:function(t){!this.$pdfDoc||t<0||t>this.$numPages||(this.$pageNum=t,this.wk(this.$pageNum))},prevPage:function(){this.$pageNum<=1||(this.$pageNum--,this.wk(this.$pageNum))},nextPage:function(){this.$pageNum>=this.$numPages||(this.$pageNum++,this.wk(this.$pageNum))},zoomIn:function(){var t=this.J.scale;t=(t*this.lk).toFixed(2),t=Math.ceil(10*t)/10,t=Math.min(this.vk,t),this.setScale(t,!0)},zoomOut:function(){var t=this.J.scale;t=(t/this.lk).toFixed(2),t=Math.floor(10*t)/10,t=Math.max(this.dk,t),this.setScale(t,!0)},Dk:function(t){if(!isNaN(parseFloat(t)))return t;isNaN(parseFloat(this.J.scale))&&(this.J.scale=this.fk);var i=1,e=((this.rk.clientWidth-this.pk)*this.J.scale/this.Be.clientWidth).toFixed(2),s=((this.rk.clientHeight-this.mk)*this.J.scale/this.Be.clientHeight).toFixed(2);switch(t){case"page-actual":i=1;break;case"page-width":i=e;break;case"page-height":i=s;break;case"page-fit":i=Math.min(e,s);break;case"auto":var n=this.rk.clientWidth>this.rk.clientHeight?Math.min(s,e):e;i=Math.min(this._k,n)}return i},setScale:function(t,i){if(isNaN(parseFloat(t))){var e=this.Dk(t);this.Ak(e,i)}else this.Ak(t,i)},Ak:function(t,i){this.J.scale=t,this.renderPage(this.$pageNum),this.callEvent("onScaleChange",[t,i])},download:function(){if(this.$pdfDoc){var i=(this.J.downloadName||"document")+".pdf";this.$pdfDoc.getData().then(function(t){ht(PDFJS.createBlob(t,"application/pdf"),i)})}},clear:function(){this.$pdfDoc&&(this.ck.clearRect(0,0,this.Be.width,this.Be.height),this.tt.style.height=this.tt.style.width=this.Be.width=this.Be.height=0,this.J.scale="auto",this.$pageNum=this.$numPages=0,this.$pdfDoc.transport.startCleanup(),this.$pdfDoc.destroy(),this.$pdfDoc=null,this.J.toolbar&&Pt(this.J.toolbar)&&Pt(this.J.toolbar).reset())}}),Rr=(H.protoUI(Br,g,li,Li.view),{name:"video",$init:function(t){t.id||(t.id=z()),this.$ready.push(this.Ik)},Ik:function(){var t=this.J;if(this.Yi=Y("video",{"class":"webix_view_video",style:"width:100%;height:100%;",autobuffer:"autobuffer"},""),t.poster&&(this.Yi.poster=t.poster),t.src){"object"!=k(t.src)&&(t.src=[t.src]);for(var i=0;i<t.src.length;i++)this.Yi.innerHTML+=' <source src="'+t.src[i]+'">'}t.controls&&(
this.Yi.controls=!0),t.autoplay&&(this.Yi.autoplay=!0),this.st.appendChild(this.Yi)},getVideo:function(){return this.Yi},defaults:{src:"",controls:!0}}),Pr=(H.protoUI(Rr,Li.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.Tk,this)),this.attachEvent("onDestruct",function(){this.Fk=this.zk=this.Vk=null})},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.Hk()},Hk:function(){this.Bk=this.config.value;var t=this.$view.querySelector(".webix_gage_curves"),i=this.$view.querySelector(".webix_gage_info"),e=this.config.scale,s=this.$width;t.setAttribute("r",s/e),t.setAttribute("strokeDasharray",Math.round(Math.PI*s/e)),t.style.r=s/e,t.style.strokeDasharray=Math.round(Math.PI*s/e),i.setAttribute("style","width: "+Math.round(s/e*2)+"px;"),this.Vk.setAttribute("style","height: "+(s/e+20)+"px;"),this.Fk.setAttribute("r",s/e),this.Fk.setAttribute("style","stroke-dasharray: "+Math.round(this.gradientLength*Math.PI*s/e)+", 1900;"),this.Rk(t.style.r),this.Pk()},jk:function(t){return Math.min(Math.max(t,this.J.minRange),this.J.maxRange)},Rk:function(t){var i=this.$width,e=this.config.value,s=(e=this.jk(e))-this.config.minRange,n=Math.round(180*s/(this.config.maxRange-this.config.minRange));0!==n&&180!==n||(this.Vk.style.paddingTop="3px"),this.zk.style.transformOrigin=i/2-.55+"px 0 0",this.zk.setAttribute("y1","0"),this.zk.setAttribute("x1",Math.round(.55*i)),this.zk.setAttribute("y2",0),this.zk.setAttribute("x2",Math.round(.525*i+parseInt(t)))},Pk:function(){var t=this.config.value,i=this.$view.querySelector(".webix_gage-value"),e=this.jk(t)-this.config.minRange,s=Math.round(180*e/(this.config.maxRange-this.config.minRange)),n=this.$width;n=Math.floor(n/10),this.$view.style.fontSize=n+"px",i.innerHTML=t,this.Fk.style.stroke=this.color,this.Fk.setAttribute("stroke",this.color),this.zk.setAttribute("transform","rotate("+s+" "+this.$width/2+" 0)"),this.zk.style.transform="rotate("+s+"deg)"},Ek:function(){this.config.minRange,this.config.maxRange,this.gradientLength=(this.jk(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%)"},Tk:function(){this.gradientLength=0,this.Ek(),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.Fk=this.$view.querySelector(".webix_gage_gradient"),this.zk=this.$view.querySelector(".webix_gage_gradient_point"),this.Vk=this.$view.querySelector(".webix_gage"),!0===this.isVisible()&&!0===this.config.smoothFlow&&S.svganimation&&!S.isEdge&&(this.Fk.setAttribute("class","webix_gage_gradient webix_gage_animated"),this.zk.setAttribute("class","webix_gage_gradient_point webix_gage_gradient_point_animated"))},refresh:function(){var t=this.config.value;this.config.smoothFlow&&t!=this.Bk&&(this.config.value=this.Bk),this.Tk(),this.Hk(),this.Bk!=t&&this.st.parentNode.clientHeight&&this.setValue(t)},
setValue:function(t){this.config.value=t,this.Ek(),this.Hk()},getValue:function(){return this.config.value}}),jr=(H.protoUI(Pr,g,Li.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.J.id)&&(this.canvas&&this.canvas.clearCanvas(!0),this.$view.innerHTML="",this.Nk())},Nk:function(){this.canvas=new Wi({container:this.$view,name:this.name,title:this.J.ariaLabel,width:this.$width,height:this.$height}),this.Lk()},Lk:function(){var t,i,e,s,n=this.J.value,h=this.J.type;if(!h||!this.types[h]||!n)return!1;if(s=(t=this.type.encode(n)).length,i=this.canvas.getCanvas(),s){var r=(this.$width-2*this.config.paddingX)/s,o=0;for(e=0;e<s;e++){parseInt(t.charAt(e),10)?(o++,e==s-1&&this.Ok(i,e+1,r,o,s)):o&&(this.Ok(i,e,r,o,s),o=0)}this.Uk(n,r)}},Ok:function(t,i,e,s,n){var h,r,o,a;r=parseInt(i*e+this.config.paddingX,10),h=parseInt(r-s*e,10),o=this.config.paddingY,a=this.$height-this.config.paddingY-this.config.textHeight,this.Yk()&&(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()},Uk:function(t,i){var e,s,n;if(this.type.template&&(t=this.type.template(t)),this.Yk()){if(this.type.firstDigit&&(this.canvas.renderTextAt(!0,"left",this.config.paddingX,this.$height-this.config.paddingY,t.charAt(0)),t=t.slice(1)),s=t.length,this.type.lastDigit&&s--,s){var h=(this.$width-2*this.config.paddingX-11*i)/s;for(e=0;e<s;e++)n=this.config.paddingX+e*h+(e<s/2?3:8)*i+h/2,this.canvas.renderTextAt(!0,!0,n,this.$height-this.config.paddingY,t.charAt(e));this.type.lastDigit&&(n=this.config.paddingX+s*h+11*i,this.canvas.renderTextAt(!0,!1,n,this.$height-this.config.paddingY,t.charAt(s)))}}else this.canvas.renderTextAt(!0,!0,this.$width/2,this.$height-this.config.paddingY,t)},setValue:function(t){return this.J.value=t,this.render(),t},getValue:function(){var t=this.J.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.Yi.className+=" "+this.type.css)):this.customize(t),t},Yk:function(){var t=this.config.type;return 0===t.indexOf("ean")||-1!=t.indexOf("upcA")},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()}}),Er=H.protoUI(jr,Li.view);Tt(Er,{name:"upcA",firstDigit:!0,lastDigit:!0,encode:function(t){return t.length<12&&(t="0"+t),Nr.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),Nr.checksum(t)}}),Tt(Er,{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,e;if(7!=(t=t.replace(/[^0-9]/g,"").substring(0,7)).length)return"";for(t+=this.checksum(t),i="101",e=0;e<4;e++)i+=this.encodings[parseInt(t.charAt(e),10)][0];for(i+="01010",e=4;e<8;e++)i+=this.encodings[parseInt(t.charAt(e),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,e=!0,s=0;for(i=0;i<7;i++)s+=(e?3:1)*parseInt(t.charAt(i),10),e=!e;return((10-s%10)%10).toString()}});var Nr={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,e,s;if(12!=(t=t.replace(/[^0-9]/g,"").substring(0,12)
).length)return"";for(t+=this.checksum(t),i="101",e=this.encodings[parseInt(t.charAt(0),10)][3],s=1;s<7;s++)i+=this.encodings[parseInt(t.charAt(s),10)][parseInt(e.charAt(s-1),10)];for(i+="01010",s=7;s<13;s++)i+=this.encodings[parseInt(t.charAt(s),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,e=!1,s=0;for(t=t.substring(0,12),i=0;i<12;i++)s+=(e?3:1)*parseInt(t.charAt(i),10),e=!e;return((10-s%10)%10).toString()}};Tt(Er,Nr);var Lr,Or,Ur,Yr,Wr={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:It,placeholder_setter:It,$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=It(t.template||"#value#")),t},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(this.Tk("y"===this.J.layout?i:t),(this.J.value||0===this.J.value)&&this.Pk(0,this.J.value))},jk:function(t){return Math.min(Math.max(t,this.J.minRange),this.J.maxRange)-this.J.minRange},Wk:function(t){var i;this.Gk=t-(this.os||t),this.os=t,(1e3<(i=this.J.flowTime>this.Gk?this.J.flowTime/this.Gk:this.J.flowTime)||i<5)&&(i=30);var e=(this.J.value-this.Xk)/i;this.qk+=e,Math.abs(this.qk-this.J.value)<Math.abs(e)&&(this.qk=this.J.value),this.qk!=this.J.value?this.Jk=requestAnimationFrame(this.Wk.bind(this)):(cancelAnimationFrame(this.Jk),this.Jk=null),this.Kk.setAttribute("width",Math.floor(this.jk(this.qk)*this.Zk)),this.Kk.style.fill=this.Pc()},Pk:function(t,i){this.Xk=this.qk=t,this.J.value=this.Bk=i,!0===this.isVisible()&&!0===this.J.smoothFlow&&window.requestAnimationFrame?this.Jk||(this.Jk=requestAnimationFrame(this.Wk.bind(this))):(this.Kk.setAttribute("width",Math.floor(this.jk(i)*this.Zk)),this.Kk.style.fill=this.Pc())},Pc:function(){var t=this.J.color;return"function"==typeof t?t(this.Bk):t},Qk:function(t,i,e){for(var s=0;s<i.length;s++)t.setAttribute(i[s],e[s])},tC:function(t,i,e){var s=document.createElementNS("http://www.w3.org/2000/svg",t);return i&&this.Qk(s,i,e),s},iC:function(t){var i=this.tC(t[0],t[1],t[2]),e=t[3];if(e)for(var s=0;s<e.length;s++)i.appendChild(this.iC(e[s]));return i},eC:function(){var t="d"+z(),i=this.tC("svg",["class"],["webix_bullet_graph_svg"]),e=this.tC("g"),s=this.tC("g"),n=this.tC("rect",["x","y","width","height","class","style"],[this.sC,this.nC,100,this.J.stroke,"webix_bullet_value","filter:url(#"+t+");fill:"+this.Pc()]),h=this.tC("rect",["x","y","width","height","fill"],[0,5,3,this.J.barWidth-10,"rgba(0,0,0,0.5)"]),r=this.tC("g",["stroke","stroke-width","fill"],["#8b94ac","2","none"]),o=this.tC("text",["text-anchor","stroke","fill"],["end","none","#8b94ac"]),a="y"==this.J.layout?"50%":this.sC-10,u="y"==this.J.layout?11:17,c=this.tC("tspan",["x","y","class"],[a,u,"webix_bullet_header"]),f=this.tC("tspan",["x","y","class"],[a,u+17,"webix_bullet_subheader"]),l=this.tC("text",["text-anchor","stroke","class","fill"],["middle","none","webix_bullet_scale","#8b94ac"]),d=this.iC(["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");e.appendChild(s),!1!==this.J.marker&&(h.setAttribute("x",this.sC+this.jk(this.J.marker)*this.Zk-2),e.appendChild(h)),e.appendChild(n),o.appendChild(c),o.appendChild(f),i.appendChild(o);var _="y"===this.J.layout,p=this.J.tickSize;if(this.J.scale){for(var m=this.sC,b=this.J.minRange;b<=this.J.maxRange;b+=this.J.scale.step){var g=Math.max(
b-this.J.minRange,0),w=Math.floor(g*this.Zk-(g?.1:-1)),x=_?(this.$width-this.J.barWidth)/2+(p?2-p:4):w+m,y=_?this.hC+m-w+6:this.J.barWidth+(p?16+p:14),M=_?-4:this.J.barWidth+3+p,S=_?"end":"middle",k=this.tC("tspan",["x","y","text-anchor"],[x,y,S]),C=this.tC("line",["x1","y1","x2","y2","stroke-width"],[w+m,M,w+m,M-p,1]);v.innerHTML=this.J.scale.template({value:b}),k.appendChild(v.childNodes[0]),l.appendChild(k),r.appendChild(C)}e.appendChild(r),i.appendChild(l)}for(var $=0;$<this.J.bands.length;$++){var D=this.J.bands[$],A=this.tC("path"),I=this.jk(D.value)*this.Zk;A.setAttribute("d","M "+this.sC+",0 l "+I+",0 l 0,"+this.J.barWidth+" l -"+I+",0 z"),A.setAttribute("fill",D.color),s.appendChild(A)}if(i.appendChild(e),"y"===this.J.layout){var T=this.J.scale?this.$width/2-10:0,F=this.$height+this.sC-28;e.setAttribute("transform","translate("+T+", "+F+") 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},Tk:function(t){this.config.minRange,this.config.maxRange,t=t||("x"==this.J.layout?this.$width:this.$height);var i=this.$view;i.innerHTML="";var e=this.J,s=e.label&&e.label(e)||e.placeholder&&e.placeholder(e);this.sC=s?e.labelHeight||e.labelWidth:7,this.nC=Math.floor((this.J.barWidth-this.J.stroke)/2),this.hC=t-this.sC-30,this.Zk=this.hC/(this.J.maxRange-this.J.minRange);var n=this.eC();n.setAttribute("height",this.$height),n.setAttribute("width",this.$width),i.appendChild(n),this.Kk=i.querySelector(".webix_bullet_value");var h=this.J.label;h&&(this.$view.querySelector(".webix_bullet_header").textContent=h(this.J));var r=this.J.placeholder;r&&(this.$view.querySelector(".webix_bullet_subheader").textContent=r(this.J))},refresh:function(){this.Tk(),this.Pk(this.Bk,this.J.value)},setValue:function(t){this.J.value!=t&&this.Pk(this.J.value,t)},getValue:function(){return this.J.value}},Gr=(H.protoUI(Wr,Li.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.Yi=this.$view.firstChild,this.rC=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.oC,this)),this.data.attachEvent("onStoreUpdated",C(this.aC,this))},getMap:function(t){return t?this.rC:this.nu},uC:function(t){return C(function(){"function"==typeof t&&t(),Lr=Lr||window.google,this.cC()},this)},render:function(){"undefined"==typeof window.google||"undefined"==typeof window.google.charts?(Or||((Or=document.createElement("script")).type="text/javascript",Or.src="//www.gstatic.com/charts/loader.js",document.getElementsByTagName("head")[0].appendChild(Or)),Or.onload=this.uC(Or.onload)):this.uC()()},cC:function(){Lr.visualization&&Lr.visualization.GeoChart?(this.nu=new Lr.visualization.GeoChart(this.Yi),this.fC(),this.rC.resolve(this.nu)):(Lr.charts.load("current",{packages:["geochart"],mapsApiKey:this.J.key}),Lr.charts.setOnLoadCallback(C(function(){this.cC()},this)))},$onLoad:function(t){return!this.nu&&(this.rC.then(C(function(){this.parse(t,this.J.datatype)},this)),!0)},aC:function(){if(this.nu){var n=this.tl&&this.tl.length?this.tl:this.lC(),h=[];if(this.data.each(function(t){for(var i=[],e=0;e<n.length;e++){var s=t[n[e].label];"number"==n[e].type?s*=1:"tooltip"==n[e].role&&(s=this.J.tooltip(t)),i.push(s)}h.push(i)},this),n.length){for(var t=new Lr.visualization.DataTable,i=0;i<n.length;i++)t.addColumn(n[i]);t.addRows(h);var e=new Lr.visualization.DataView(t);this.nu.draw(e,this.J.chart)}else this.nu.draw(Lr.visualization.arrayToDataTable([["",""]]),{})}else this.nu||this.rC.then(C(this.aC,this))},setDisplayMode:function(t){this.J.chart.displayMode=t,this.refresh()},setRegion:function(t){this.J.chart.region=t,this.refresh()},refresh:function(){this.nu.clearChart(),this.aC()},tooltip_setter:function(t){
var i=this.J.chart.tooltip;return this.J.chart.tooltip=H.extend(i||{},{isHtml:!0}),It(t)},$setSize:function(t,i){Li.api.$setSize.apply(this,arguments)&&this.nu&&(H.extend(this.J,{width:t,height:i}),this.refresh())},oC:function(){this.tl=null,this.aC()},dC:function(t,i){if(!t||x(t[i]))return"string";var e=k(t[i]);return"string"!=e||isNaN(1*t[i])||(e="number"),e},lC:function(){var t=this.J.columns||[],i=this.data.pull[this.data.order[0]];if(!t.length&&i)for(var e in i)"id"!==e&&t.push(e);for(var s=0;s<t.length;s++)"object"!==k(t[s])&&(t[s]={type:this.dC(i,t[s]),label:t[s]});return this.J.tooltip&&t.push({type:"string",role:"tooltip",p:{html:!0}}),this.tl=t},fC:function(){Lr.visualization.events.addListener(this.nu,"error",C(function(){this.callEvent("onMapError",arguments)},this)),Lr.visualization.events.addListener(this.nu,"ready",C(function(){this.callEvent("onMapReady",arguments)},this)),Lr.visualization.events.addListener(this.nu,"regionClick",C(function(){this.callEvent("onRegionClick",arguments)},this)),Lr.visualization.events.addListener(this.nu,"select",C(function(){var t=this.nu.getSelection()[0],i=t||this.vC;if(i){var e=this.data.order[i.row];this.vC=i,this.callEvent("onItemClick",[e,!!t])}},this))}}),Xr=(H.protoUI(Gr,we,g,Li.view),{name:"google-map",$init:function(){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.Yi=this.$view.firstChild,this.rC=mt.defer(),this.data.provideApi(this,!0),this.$ready.push(this.render)},getMap:function(t){return t?this.rC:this.nu},uC:function(t){return C(function(){"function"==typeof t&&t(),Ur=Ur||window.google,this.cC.call(this)},this)},render:function(){if("undefined"==typeof window.google||"undefined"==typeof window.google.maps){if(!Yr){(Yr=document.createElement("script")).type="text/javascript";var t=this.J,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),Yr.src=i,document.getElementsByTagName("head")[0].appendChild(Yr)}Yr.onload=this.uC(Yr.onload)}else this.uC()()},cC:function(){var t=this.config;this.isVisible(t.id)&&(this.nu=new Ur.maps.Map(this.Yi,{zoom:t.zoom,center:new Ur.maps.LatLng(t.center[0],t.center[1]),mapTypeId:Ur.maps.MapTypeId[t.mapType]}),this.rC.resolve(this.nu),this.Yi.firstChild.setAttribute("webix_disable_drag","true"))},center_setter:function(t){return this.nu&&this.nu.setCenter(new Ur.maps.LatLng(t[0],t[1])),t},mapType_setter:function(t){return this.nu&&this.nu.setMapTypeId(Ur.maps.MapTypeId[t]),t},zoom_setter:function(t){return this.nu&&this.nu.setZoom(t),t},layerType_setter:function(t){return"heatmap"==t&&(this.config.libraries="visualization"),this._C[t]&&(H.extend(this,this._C[t],!0),this.data.attachEvent("onStoreUpdated",C(function(){this.rC.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(){Li.api.$setSize.apply(this,arguments),this.nu&&Ur.maps.event.trigger(this.nu,"resize")},$onLoad:function(t){return!this.nu&&(this.rC.then(C(function(){this.parse(t)},this)),!0)},_C:{marker:{drawData:function(t,i,e){switch(e){case"add":case"update":i.$marker=this.pC(i);break;case"delete":i.$marker.setMap(null);break;default:this.data.each(function(t){t.$marker=this.pC(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.nu.setCenter(new Ur.maps.LatLng(i.lat,i.lng))},pC:function(t){var i={};for(var e in t)i[e]=t[e];i.position=new Ur.maps.LatLng(t.lat,t.lng),i.map=t.hidden?null:this.nu;var s=t.$marker;return s?t.$marker.setMap(i.map):(s=new Ur.maps.Marker(i),this.$(s)),this.callEvent("onItemRender",[t]),s},$:function(t){var i=this;t.addListener("click",function(){i.callEvent("onItemClick",[this.id,this])}),t.getDraggable()&&(t.addListener("dragend",function(){i.mC(this,!0)}),t.addListener("drag",function(){i.mC(this)}))},mC:function(t,i){var e=this.getItem(t.id),s=t.getPosition(),n=i?"onAfterDrop":"onDrag"
;e.lat=s.lat(),e.lng=s.lng(),this.callEvent(n,[e.id,e])}},heatmap:{heatmapConfig_setter:function(t){return t=t||{}},drawData:function(){this.bC&&(this.bC.setMap(null),this.bC=null);var i=[];if(this.data.each(function(t){i.push(this.gC(t))},this),i.length){var t=H.extend(this.config.heatmapConfig,{data:i,map:this.nu},!0);this.bC=new Ur.maps.visualization.HeatmapLayer(t),this.callEvent("onHeatMapRender",[this.bC])}},getHeatmap:function(){return this.bC},gC:function(t){var i={};for(var e in t)i[e]=t[e];return i.location=new Ur.maps.LatLng(t.lat,t.lng),i}}}}),qr=(H.protoUI(Xr,we,g,Li.view),{name:"organogram",defaults:{scroll:"auto",ariaLabel:"lines"},$init:function(){this.st.className+=" webix_organogram",this.Ui=document.createElement("DIV"),this.$ready.push(this.wC),H.extend(this.data,ps,!0),this.data.provideApi(this,!0)},Xo:"webix_dg_id",on_click:{webix_organogram_item:function(t,i){this.J.select&&("multiselect"==this.J.select||this.J.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.J.multiselect,t.shiftKey):this.select(i),this.lb=!1)}},on_context:{},on_dblclick:{},wC:function(){this.mt.style.position="relative",this.data.attachEvent("onStoreUpdated",C(this.render,this))},sf:function(t){var i=this.data.kr[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)},Ot:function(t){var i=this.sf(t);return this.data.branch[t.id]&&(i+=this.xC(t.id)),i},yC:function(){return this.type.listMarginX||this.type.listMarginY},xC:function(t,i){var e,s,n,h,r="",o=this.data.branch[t],a=this.data.kr[t],u=this.getItem(t),c=!!u&&u.$type;if(i=i||0,"list"===c&&(i+=this.type.listMarginX),t||(this.MC=[],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.yC()||(r+=this.type.templateListStart.call(this,u,this.type,a));var f=0,l=0;for(e=0;e<o.length;e++){s=o[e],h=this.SC[s];var d=this.getItem(s);d.open==undefined&&(d.open=!0),"list"==c&&this.data.addMark(s,"list_item","",1,!0);var v=this.kC(s);if("list"==c){var _=0;this.yC()?_=this.type.listMarginY:e||(_=this.type.marginY),this.$xy[s]={totalWidth:h,start:n.start,width:this.type.width,height:v,left:n.start+h/2-this.type.width/2+i,top:e?this.$xy[o[e-1]].top+this.$xy[o[e-1]].height+_+l:n.top+n.height+_},l=this.data.branch[s]?this.CC(s):0}else this.$xy[s]={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.sf(d),f+=h}for(e=0;e<o.length;e++)s=o[e],this.data.branch[s]&&this.getItem(s).open?r+=this.xC(s,i):u&&("list"!=u.$type?this.MC.push(this.$xy[s].top+this.$xy[s].height):e==o.length-1&&this.MC.push(this.$xy[s].top+this.$xy[s].height));var p=0;for(var m in this.$xy){var b=this.$xy[m];p=Math.max(b.left+b.width,p)}this.mt.style.width=p+this.type.padding+this.type.marginX/2+"px","list"!=c||this.yC()||(r+=this.type.templateListEnd(u,this.type,a))}return r},CC:function(t){for(var i=this.data.branch[t],e=0,s=0;s<i.length;s++)e+=this.kC(i[s])+this.type.listMarginY,this.data.branch[i[s]]&&(e+=this.CC(i[s]));return e+this.type.marginY},kC:function(t){var i=this.getItem(t),e=this.type.height;return"function"==typeof e&&(e=e.call(i,this.type,this.data.kr[t])),this.$C||(this.$C=Y("div"),this.mt.appendChild(this.$C)),this.$C.className=this.type.classname(i,this.type,this.data.kr[t]),this.$C.style.cssText="width:"+this.type.width+"px;height:"+e+("auto"==e?"":"px")+";",this.$C.innerHTML=this.type.template.call(this,i,this.type,this.data.kr[t]),this.$C.scrollHeight},DC: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 e=this.branch[i],s=n[i]=0;s<e.length;s++)n[i]+=n[e[s]]||0;i=this.getParentId(i)}}),this.SC=n},getItemNode:function(t){if(this.Li
)return this.Li[t];this.Li={};for(var i=this.mt.childNodes,e=0;e<i.length;e++){var s=i[e].getAttribute(this.Xo);if(s&&(this.Li[s]=i[e]),-1!=i[e].className.indexOf("webix_organogram_list")&&!this.yC())for(var n=i[e].childNodes,h=0;h<n.length;h++)(s=n[h].getAttribute(this.Xo))&&(this.Li[s]=n[h])}return this.getItemNode(t)},ac:function(t){return this.Ui.innerHTML=this.sf(t),this.Ui.firstChild},render:function(t,i,e){if(this.isVisible(this.J.id)&&!this.$blockRender){if("update"!=e)return this.callEvent("onBeforeRender",[this.data])&&(this.DC(),this.Li=null,this.mt.innerHTML=this.xC(0),this.$C=null,this.mt.style.height=Math.max.apply(Math,this.MC)+this.type.padding+"px",this.Nk(),this.resize(),this.callEvent("onAfterRender",[])),!0;var s=this.getItemNode(t);return X(this.Li[t]=this.ac(i),s),G(s),!0}},Nk:function(){this.canvas&&this.canvas.clearCanvas(!0),this.canvas=new Wi({container:this.mt,name:this.name,title:this.J.ariaLabel,width:this.mt.offsetWidth,height:this.mt.offsetHeight}),this.AC(0)},IC:function(t,i,e,s,n,h,r){t.strokeStyle=h,t.lineCap="square",t.lineWidth=r,t.beginPath(),t.moveTo(i,e),t.lineTo(s,n),t.stroke(),t.lineWidth=1},AC:function(t,i){var e,s,n,h,r,o,a,u,c,f;if(i||(i=this.canvas.getCanvas()),this.$xy&&(t=t||0,n=this.data.branch[t],s=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"==s.$type){if(!this.yC())return u=parseInt(h.top+h.height+this.type.marginY,10),void this.IC(i,o,a,o,u,this.type.lineColor)}else this.IC(i,o,a,o,u,this.type.lineColor);for(a=parseInt(h.top+h.height+this.type.marginY/2,10)+.5,e=0;e<n.length;e++)t&&(r=this.$xy[n[e]],"list"==s.$type&&this.yC()?(o=parseInt(h.left+this.type.listMarginX/2,10)+.5,e?e==n.length-1&&(f=o):c=o,u=parseInt(r.top+r.height/2,10),this.IC(i,o,a-this.type.marginY/2,o,u,this.type.lineColor),this.IC(i,o,u,o+this.type.listMarginX/2,u,this.type.lineColor)):(o=parseInt(r.left+r.width/2,10)+.5,e?e==n.length-1&&(f=o):c=o,u=parseInt(r.top,10),this.IC(i,o,a,o,u,this.type.lineColor))),this.getItem(n[e]).open&&this.AC(n[e],i);t&&this.IC(i,c,a,f,a,this.type.lineColor)}},$getSize:function(t,i){var e=this.J.autowidth,s=this.J.autoheight;return e&&(t=this.mt.offsetWidth+(this.mt.offsetHeight>i&&!s?S.scrollSize:0)),s&&(i=this.mt.offsetHeight+(this.mt.offsetWidth>t&&!e?S.scrollSize:0)),Li.api.$getSize.call(this,t,i)},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(this.mt.style.width=this.$width+"px",this.mt.style.height=this.$height+"px",this.render())},type:{width:120,height:"auto",padding:20,marginX:20,marginY:20,listMarginX:0,listMarginY:0,lineColor:Xi.organogramLineColor||"#90caf9",classname:function(t,i,e){var s="webix_organogram_item";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),s+=" "+t.$css),e&&e.list_item&&(s+=" webix_organogram_list_item"),e&&e.$css&&(s+=e.$css),s+=" webix_organogram_level_"+t.$level,i.css&&(s+=" "+i.css),s},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:It("#value#"),templateStart:function(t,i,e){var s="";if((!e||!e.list_item||i.listMarginX||i.listMarginY)&&this.$xy){var n=this.$xy[t.id];s+="width: "+n.width+"px; height: "+n.height+"px;",s+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div webix_dg_id="'+t.id+'" class="'+i.classname.call(this,t,i,e)+'"'+(s?'style="'+s+'"':"")+'">'},templateEnd:It("</div>"),templateListStart:function(t,i,e){var s="";if(this.$xy){var n=this.$xy[t.id];s+="width: "+n.width+"px;",s+="top: "+(n.top+n.height+i.marginY)+"px; left: "+n.left+"px;"}return'<div class="'+i.listClassName.call(this,t,i,e)+'"'+(s?'style="'+s+'"':"")+'">'},templateListEnd:It("</div>")}}),Jr=(H.protoUI(qr,Yi,Fe,cs,le,Ye,Pe,Ue,Oe,ls,we,Li.view,g),{$render_pie:function(t,i,e,s,n,h){this.TC(t,i,e,s,1,h,n)},TC:function(t,i,e,s,n,h,r){if(i.length){var o=this.FC(e,s),a=this.J.radius?this.J.radius:o.radius;if(!(a<0)){var u=this.zC(i),c=this.Nc(u),f=this.Ec(u,c),
l=this.J.x?this.J.x:o.x,d=this.J.y?this.J.y:o.y;1==n&&this.J.shadow&&this.VC(t,l,d,a),d/=n;var v,_=-Math.PI/2,p=[];if(t.scale(1,n),this.J.gradient){var m=1!=n?l+a/3:l,b=1!=n?d+a/3:d;this.HC(t,l,d,a,m,b)}for(var g=0;g<i.length;g++)if(u[g]){t.strokeStyle=this.J.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.J.color.call(this,i[g]);t.fillStyle=x,t.fill(),this.J.pieInnerText&&this.BC(l,d,5*a/6,_,w,n,this.J.pieInnerText(i[g],c),!0),this.J.label&&this.BC(l,d,a+this.J.labelOffset,_,w,n,this.J.label(i[g])),1!=n&&(this.RC(t,l,d,_,w,a,!0),t.fillStyle="#000000",t.globalAlpha=.2,this.RC(t,l,d,_,w,a,!1),t.globalAlpha=1,t.fillStyle=x),h.addSector(i[g].id,_,w,l-e.x,d-e.y/n,a,n,r),_=w}for(t.globalAlpha=.8,g=0;g<p.length;g++)v=this.PC(p[g],l,d,a),this.IC(t,l,d,v.x,v.y,this.J.lineColor.call(this,i[g]),2);(t.globalAlpha=1)==n&&this.J.border&&(t.lineWidth=this.J.borderWidth||2,t.strokeStyle=this.J.borderColor?this.J.borderColor.call(this):"#ffffff",t.beginPath(),t.arc(l,d,a+1,0,2*Math.PI,!1),t.stroke()),t.scale(1,1/n)}}},zC:function(t){for(var i=[],e=0;e<t.length;e++)i.push(Math.abs(parseFloat(this.J.value(t[e])||0)));return i},Nc:function(t){for(var i=0,e=0;e<t.length;e++)i+=t[e];return i},Ec:function(t,i){var e,s=[],n=0;i=i||this.Nc(t);for(var h=0;h<t.length;h++)e=t[h],s[h]=2*Math.PI*(i?(e+n)/i:1/t.length),n+=e;return s},FC:function(t,i){var e=i.x-t.x,s=i.y-t.y;return{x:t.x+e/2,y:t.y+s/2,radius:Math.min(e/2,s/2)}},RC:function(t,i,e,s,n,h,r){if(t.lineWidth=1,s<=0&&0<=n||0<=s&&n<=Math.PI||.003<Math.abs(s-Math.PI)&&s<=Math.PI&&n>=Math.PI){s<=0&&0<=n&&(s=0,r=!1,this.jC(t,i,e,h,s,n)),s<=Math.PI&&n>=Math.PI&&(n=Math.PI,r=!1,this.jC(t,i,e,h,s,n));var o=(this.J.pieHeight||Math.floor(h/4))/this.J.cant;t.beginPath(),t.arc(i,e,h,s,n,!1),t.lineTo(i+h*Math.cos(n),e+h*Math.sin(n)+o),t.arc(i,e+o,h,n,s,!0),t.lineTo(i+h*Math.cos(s),e+h*Math.sin(s)),t.fill(),r&&t.stroke()}},jC:function(t,i,e,s,n,h){t.beginPath(),t.arc(i,e,s,n,h,!1),t.stroke()},VC:function(t,i,e,s){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,e+1,s+h,0,2*Math.PI,!0),t.fill();t.globalAlpha=1},EC:function(t){return t.addColorStop(0,"#ffffff"),t.addColorStop(.7,"#7a7a7a"),t.addColorStop(1,"#000000"),t},HC:function(t,i,e,s,n,h){var r;t.beginPath(),r="function"!=typeof this.J.gradient?(r=t.createRadialGradient(n,h,s/4,i,e,s),this.EC(r)):this.J.gradient(r),t.fillStyle=r,t.arc(i,e,s,0,2*Math.PI,!0),t.fill(),t.globalAlpha=.7},BC:function(t,i,e,s,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-s<.2?4:8;o&&(c=u/1.8);var f=s+(n-s)/2;e-=(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.J.height||Math.floor(e/4))/h);var _=(i+Math.floor((e+v)*Math.sin(f)))*h-8,p=t+Math.floor((e+c/2)*Math.cos(f))+l,m=n<Math.PI/2+.01,b=s<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,e,s,n,h){this.TC(t,i,e,s,this.J.cant,h)},$render_donut:function(t,i,e,s,n,h){if(i.length){this.TC(t,i,e,s,1,h,n);var r=this.J,o=this.FC(e,s),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()}}}),Kr={$render_bar:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g=s.y-e.y;b=!!this.J.yAxis,m=!!this.J.xAxis,c=(u=this.NC()).max,f=u.min,o=(s.x-e.x)/i.length,n||"auto"!=this.J.origin&&!b||this.LC(i,e,s,f,c,o),b&&(c=parseFloat(this.J.yAxis.end),f=parseFloat(this.J.yAxis.start)),l=(v=this.OC(f,c))[0],d=v[1],p=l?g/l:l,b||"auto"!=this.J.origin&&m||(_=10,p=l?(g-_)/l:_),!n&&"auto"!=this.J.origin&&!b&&this.J.origin>f&&this.UC(t,i,e,s
,o,s.y-p*(this.J.origin-f)),r=parseInt(this.J.barWidth,10);var w=0,x=0;for(a=0;a<this.YC.length;a++)a==n&&(x=w),"bar"==this.YC[a].type&&w++;this.YC&&o<r*w+4&&(r=parseInt(o/w-4,10));var y=(o-r*w)/2,M="undefined"!=typeof this.J.radius?parseInt(this.J.radius,10):Math.round(r/5),S=!1,k=this.J.gradient;for(k&&"function"!=typeof k?(S=k,k=!1):k&&(k=t.createLinearGradient(0,s.y,0,e.y),this.J.gradient(k)),m||this.IC(t,e.x,s.y+.5,s.x,s.y+.5,"#edeff0",1),a=0;a<i.length;a++){var C=parseFloat(this.J.value(i[a])||0);this.WC&&(C=this.GC(C)),c<C&&(C=c),C-=f,C*=d;var $=e.x+y+a*o+(r+1)*x,D=s.y,A=k||this.J.color.call(this,i[a]),I=this.J.border?1:0,T=this.J.label(i[a]);C==this.J.origin||"auto"==this.J.origin&&this.J.value(i[a])==f?(I=0,T=""):C<0||this.J.yAxis&&0===C&&!("auto"!=this.J.origin&&this.J.origin>f)?(C=I=0,T=""):b||"auto"!=this.J.origin&&m||(C+=_/p),t.globalAlpha=this.J.alpha.call(this,i[a]);var F=this.Ok(t,e,$,D,r,f,M,p,C,A,k,S,I);S&&this.XC(t,$,D,r,f,M,p,C,A,S,I),I&&this.qC(t,$,D,r,f,M,p,C,A),t.globalAlpha=1,F[0]!=$?this.canvases[n].renderTextAt(!1,!0,$+Math.floor(r/2),F[1],T):this.canvases[n].renderTextAt(!0,!0,$+Math.floor(r/2),F[3],T),h.addRect(i[a].id,[$-e.x,F[3]-e.y,F[2]-e.x,F[1]-e.y],n)}},JC:function(t,i,e,s,n,h,r){var o=e;return this.J.xAxis&&"auto"!=this.J.origin&&this.J.origin>r&&(o=e-=(this.J.origin-r)*n,(s-=this.J.origin-r)<0&&(s*=-1,t.translate(i+h,e),t.rotate(Math.PI),e=i=0),e-=.5),{value:s,x0:i,y0:e,start:o}},Ok:function(t,i,e,s,n,h,r,o,a,u,c,f,l){t.save(),t.fillStyle=u;var d=this.JC(t,e,s,a,o,n,h),v=this.KC(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!=e?e+v[0]:v[0];return[_,d.x0!=e?d.start-v[1]-d.y0:d.y0,p,d.x0!=e?d.start-d.y0:v[1]]},ZC:function(t,i){var e,s;s=We.toRgb(i),(e=We.rgbToHsv(s[0],s[1],s[2]))[2]/=1.4;var n="rgb("+We.hsvToRgb(e[0],e[1],e[2])+")";t.strokeStyle=n,1==t.globalAlpha&&(t.globalAlpha=.9)},qC:function(t,i,e,s,n,h,r,o,a){var u;t.save(),u=this.JC(t,i,e,o,r,s,n),this.ZC(t,a),this.KC(t,u.x0,u.y0,s,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},XC:function(t,i,e,s,n,h,r,o,a,u,c){t.save();var f=this.JC(t,i,e,o,r,s,n),l=this.QC(t,f.x0,f.y0,f.x0+s,f.y0-r*f.value+2,u,a,"y");t.fillStyle=l.gradient,this.KC(t,f.x0+l.offset,f.y0,s-2*l.offset,h,r,f.value,l.offset+c),t.fill(),t.restore()},KC:function(t,i,e,s,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,e);var f=e-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+s-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+s-o;return t.lineTo(_,e),a||t.lineTo(i+o,e),[_,v]}},Zr={$render_line:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,m;if(u=this.t$(t,i,e,s,n),r=this.J,i.length){for(c=r.offset?e.x+.5*u.cellWidth:e.x,a=[],o=0;o<i.length;o++)if((m=this.i$(i[o],e,s,u))||"0"==m){if(l=o?u.cellWidth*o-.5+c:c,v="object"==k(m)?m.y0:m,o&&this.J.fixOverflow){if((p=this.i$(i[o-1],e,s,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?s.y:e.y,a.push({x:this.e$(f,l,d,v,_),y:_})),m.out&&(_="min"==m.out?s.y:e.y,a.push({x:this.e$(f,l,d,v,_),y:_}))}m.out||a.push({x:l,y:m,index:o})}for(this.s$=e,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.IC(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.IC(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.n$(t,f,d,i[a[o-1].index],r.label(i[a[o-1].index]),n,h,e)}},e$:function(t,i,e,s,n){return t+(n-e)*(i-t)/(s-e)},n$:function(t,i,e,s,n,h,r){var o=this.J.item,a=parseInt(o.radius.call(this,s),10)||0,u=this.s$,c=o.type.call(this,s);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.h$(t,i,e+2*a/3,a+l+1,c),t.stroke();t.beginPath(),t.globalAlpha=.3,
t.fillStyle="#bdbdbd",this.h$(t,i,e+2*a/3,a+1,c),t.fill()}t.restore(),t.lineWidth=o.borderWidth,t.fillStyle=o.color.call(this,s),t.strokeStyle=o.borderColor.call(this,s),t.globalAlpha=o.alpha.call(this,s),t.beginPath(),this.h$(t,i,e,a+1,c),t.fill(),t.stroke(),t.globalAlpha=1}if(n&&this.canvases[h].renderTextAt(!1,!0,i,e-a-this.J.labelOffset,this.J.label.call(this,s)),r){var d=this.J.eventRadius||a+1;r.addRect(s.id,[i-d-u.x,e-d-u.y,i+d-u.x,e+d-u.y],h)}},h$:function(t,i,e,s,n){var h=[];if(!n||"square"!=n&&"s"!=n)if(!n||"diamond"!=n&&"d"!=n)h=!n||"triangle"!=n&&"t"!=n?[[i,e,s,0,2*Math.PI,!0]]:[[i,e-s],[i+Math.sqrt(3)*s/2,e+s/2],[i-Math.sqrt(3)*s/2,e+s/2],[i,e-s]];else{var r=1<t.lineWidth?t.lineWidth*Math.sqrt(2)/4:0;h=[[i,e-s],[i+s,e],[i,e+s],[i-s,e],[i+r,e-s-r]]}else h=[[i-(s*=Math.sqrt(2)/2)-t.lineWidth/2,e-s],[i+s,e-s],[i+s,e+s],[i-s,e+s],[i-s,e-s]];this.r$(t,h)},i$:function(t,i,e,s){var n=s.minValue,h=s.maxValue,r=s.unit,o=s.valueFactor,a=this.J.value(t);this.WC&&(a=this.GC(a));var u=(parseFloat(a||0)-n)*o;this.J.yAxis||(u+=s.startValue/r);var c=e.y-r*u;return!this.J.fixOverflow||"line"!=this.J.type&&"area"!=this.J.type?(h<a&&(c=i.y),(u<0||a<n)&&(c=e.y)):h<a?c={y:i.y,y0:c,out:"max"}:(u<0||a<n)&&(c={y:e.y,y0:c,out:"min"}),c},t$:function(t,i,e,s,n){var h,r={};r.totalHeight=s.y-e.y,this.J.cellWidth?r.cellWidth=Math.min(s.x-e.x,this.J.cellWidth):r.cellWidth=(s.x-e.x)/(this.J.offset?i.length:i.length-1);var o=!!this.J.yAxis,a=-1!=this.J.type.indexOf("stacked")?this.o$(i):this.NC();r.maxValue=a.max,r.minValue=a.min,n||this.LC(i,e,s,r.minValue,r.maxValue,r.cellWidth),o&&(r.maxValue=parseFloat(this.J.yAxis.end),r.minValue=parseFloat(this.J.yAxis.start));var u=this.OC(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}},Qr={$render_barH:function(t,i,e,s,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=(s.y-e.y)/i.length,d=(l=this.NC("h")).max,v=l.min,x=s.x-e.x,C=!!this.J.xAxis,n||this.a$(t,i,e,s,v,d,a),C&&(d=parseFloat(this.J.xAxis.end),v=parseFloat(this.J.xAxis.start)),m=(g=this.OC(v,d))[0],p=g[1],M=m?x/m:10,C||(w=10,M=m?(x-w)/m:10),(o=parseInt(this.J.barWidth,10))*this.YC.length+4>a&&(o=a/this.YC.length-4),r=Math.floor((a-o*this.YC.length)/2),b="undefined"!=typeof this.J.radius?parseInt(this.J.radius,10):Math.round(o/5),_=!1,(c=this.J.gradient)&&"function"!=typeof c?(_=c,c=!1):c&&(c=t.createLinearGradient(e.x,e.y,s.x,e.y),this.J.gradient(c)),C||this.IC(t,e.x-.5,e.y,e.x-.5,s.y,"#edeff0",1),f=0;f<i.length;f++)if(y=parseFloat(this.J.value(i[f]||0)),this.WC&&(y=this.GC(y)),y&&!isNaN(y))if(d<y&&(y=d),y-=v,y*=p,S=e.x,k=e.y+r+f*a+(o+1)*n,y<0&&"auto"==this.J.origin||this.J.xAxis&&0===y&&!("auto"!=this.J.origin&&this.J.origin>v))this.canvases[n].renderTextAt("middle","right",S+10,k+o/2+r,this.J.label(i[f]));else{y<0&&"auto"!=this.J.origin&&this.J.origin>v&&(y=0),C||(y+=w/M),u=c||this.J.color.call(this,i[f]),this.J.border&&this.u$(t,S,k,o,v,b,M,y,u),t.globalAlpha=this.J.alpha.call(this,i[f]);var $=this.c$(t,s,S,k,o,v,b,M,y,u,c,_);_&&this.f$(t,S,k,o,v,b,M,y,u,_),t.globalAlpha=1,$[3]==k?(this.canvases[n].renderTextAt("middle","left",$[0]-5,$[3]+Math.floor(o/2),this.J.label(i[f])),h.addRect(i[f].id,[$[0]-e.x,$[3]-e.y,$[2]-e.x,$[3]+o-e.y],n)):(this.canvases[n].renderTextAt("middle",!1,$[2]+5,$[1]+Math.floor(o/2),this.J.label(i[f])),h.addRect(i[f].id,[$[0]-e.x,k-e.y,$[2]-e.x,$[3]-e.y],n))}},l$:function(t,i,e,s,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,e+o);var f=i+h*r-n-(n?0:o);f=Math.max(i,f),n<h*r&&t.lineTo(f,e+o);var l=e+n;n&&0<n&&t.arc(f,l,n-o,-Math.PI/2+u,0,!1);var d=e+s-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 _=e+s-o;return t.lineTo(i,_),a||t.lineTo(i,e+o),[v,_]},a$:function(t,i,e,s,n,h,r){var o=0;this.J.xAxis&&(this.canvases.x||(this.canvases.x=this.d$("axis_x")),o=this.v$(this.canvases.x.getCanvas(),i,e,s,n,h)),this.J.yAxis&&(this.canvases.y||(this.canvases.y=this.d$("axis_y")),this._$(
this.canvases.y.getCanvas(),i,e,s,r,o))},_$:function(t,i,e,s,n,h){if(this.J.yAxis){var r,o=parseInt(h||e.x,10)-.5,a=s.y+.5,u=e.y;this.IC(t,o,a,o,u,this.J.yAxis.color,1);for(var c=0;c<i.length;c++){var f="auto"!=this.J.origin&&"barH"==this.J.type&&parseFloat(this.J.value(i[c]))<this.J.origin;r=u+n/2+c*n,this.canvases.y.renderTextAt("middle",!f&&"left",f?o+5:o-5,r,this.J.yAxis.template(i[c]),"webix_axis_item_y",f?0:o-10),this.J.yAxis.lines.call(this,i[c])&&this.IC(t,e.x,r,s.x,r,this.J.yAxis.lineColor.call(this,i[c]),1)}this.J.yAxis.lines.call(this,{})&&this.IC(t,e.x+.5,u+.5,s.x,u+.5,this.J.yAxis.lineColor.call(this,{}),1),this.p$(e,s)}},v$:function(t,i,e,s,n,h){var r,o={},a=this.J.xAxis;if(a){var u=s.y+.5,c=e.x-.5,f=s.x-.5,l=e.x;if(this.IC(t,c,u,f,u,a.color,1),a.step&&(r=parseFloat(a.step)),"undefined"!=typeof this.m$.step&&"undefined"!=typeof this.m$.start&&"undefined"!=typeof this.m$.end||(n=(o=this.b$(n,h)).start,h=o.end,r=o.step,this.J.xAxis.end=h,this.J.xAxis.start=n,this.J.xAxis.step=r),0!==r){for(var d=(f-c)*r/(h-n),v=0,_=n;_<=h;_+=r){var p=this.WC?Math.pow(10,_):_;o.fixNum&&(p=parseFloat(p).toFixed(o.fixNum));var m=Math.floor(c+v*d)+.5;if(_==n&&"auto"==this.J.origin||!a.lines.call(this,_)||this.IC(t,m,u,m,e.y,this.J.xAxis.lineColor.call(this,_),1),_==this.J.origin&&(l=m+1),r<1&&!this.WC){var b=Math.min(Math.floor(this.GC(r)),n<=0?0:Math.floor(this.GC(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,s.y+this.J.padding.bottom-3,this.J.xAxis.title,"webix_axis_title_x",s.x-e.x),l}}},g$:function(t,i,e,s,n,h,r){var o=i;return this.J.yAxis&&"auto"!=this.J.origin&&this.J.origin>r&&(o=i+=(this.J.origin-r)*n,(s-=this.J.origin-r)<0&&(s*=-1,t.translate(i,e+h),t.rotate(Math.PI),i=.5,e=0),i+=.5),{value:s,x0:i,y0:e,start:o}},c$:function(t,i,e,s,n,h,r,o,a,u,c,f){t.save();var l=this.g$(t,e,s,a,o,n,h);t.fillStyle=u,t.beginPath();var d=this.l$(t,l.x0,l.y0,n,r,o,l.value,this.J.border?1:0);c&&!f&&t.lineTo(i.x,l.y0+(this.J.border?1:0)),t.fill(),t.restore();var v=l.y0,_=l.y0!=s?s:d[1];return[l.y0!=s?l.start-d[0]:l.start,v,l.y0!=s?l.start:d[0],_]},u$:function(t,i,e,s,n,h,r,o,a){t.save();var u=this.g$(t,i,e,o,r,s,n);t.beginPath(),this.ZC(t,a),t.globalAlpha=.9,this.l$(t,u.x0,u.y0,s,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},f$:function(t,i,e,s,n,h,r,o,a,u){t.save();var c=this.g$(t,i,e,o,r,s,n),f=this.QC(t,c.x0,c.y0+s,c.x0+r*c.value,c.y0,u,a,"x");t.fillStyle=f.gradient,t.beginPath(),this.l$(t,c.x0,c.y0+f.offset,s-2*f.offset,h,r,c.value,f.offset),t.fill(),t.globalAlpha=1,t.restore()}},to={$render_stackedBar:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d=this.J,v=s.y-e.y,_=!!d.yAxis,p=!!d.xAxis,m=this.o$(i),b=0===d.origin;r=m.max,o=m.min;var g=Math.floor((s.x-e.x)/i.length);n||(a=this.LC(i,e,s,o,r,g)),_&&(r=parseFloat(d.yAxis.end),o=parseFloat(d.yAxis.start));var w=this.OC(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.IC(t,e.x,s.y+.5,s.x,s.y+.5,"#edeff0",1);for(var k=0;k<i.length;k++){var C=Math.abs(parseFloat(d.value(i[k]||0)));this.WC&&(C=this.GC(C)),u=e.x+M+k*g;var $=b&&C<0;if(n?c=$?i[k].$startYN:i[k].$startY:(c=a-1,i[k].$startY=c,b&&($&&(c=a+1),i[k].$startYN=a+1)),C&&!isNaN(C)&&(n||b||(C-=o),C*=f,!(c<e.y+1))){var D=this.J.color.call(this,i[k]),A=Math.abs(c-(b?s.y+o*x:s.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?$?-1:1:0),T=this.w$(t,u-(d.border?.5:0),c,y+(d.border?.5:0),I,0,e.y);if(t.fill(),t.stroke(),S){t.save();var F=this.QC(t,u,c,u+y,T[1],S,D,"y");t.fillStyle=F.gradient,t.beginPath(),T=this.w$(t,u+F.offset,c,y-2*F.offset,I,d.border?1:0,e.y),t.fill(),t.restore()}d.border&&(t.save(),"string"==typeof d.border?t.strokeStyle=d.border:this.ZC(t,D),t.beginPath(),this.w$(t,u-.5,parseInt(c,10)+.5,y+1,parseInt(I,10)+.5,0,e.y,A),t.stroke(),t.restore()),t.globalAlpha=1,this.canvases[n].renderTextAt(!1,!0,u+Math.floor(y/2),T[1]+(c-T[1])/2-7,
this.J.label(i[k])),h.addRect(i[k].id,[u-e.x,T[1]-e.y,T[0]-e.x,i[k][$?"$startYN":"$startY"]-e.y],n),i[k][$?"$startYN":"$startY"]=T[1]}}},w$:function(t,i,e,s,n,h,r,o){t.moveTo(i,e),n<r&&(n=r),t.lineTo(i,n);var a=i+s,u=n;t.lineTo(a,u);var c=i+s;return t.lineTo(c,e),o||t.lineTo(i,e),[c,u]}},io={$render_stackedBarH:function(t,i,e,s,n,h){var r,o,a,u,c=s.x-e.x,f=!!this.J.yAxis,l=this.o$(i);r=l.max,o=l.min;var d=Math.floor((s.y-e.y)/i.length);n||this.a$(t,i,e,s,o,r,d),f&&(r=parseFloat(this.J.xAxis.end),o=parseFloat(this.J.xAxis.start));var v=this.OC(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.J.barWidth,10);d<m+4&&(m=d-4);var b=(d-m)/2,g=!1,w=this.J.gradient;w&&(g=!0),f||this.IC(t,e.x-.5,e.y,e.x-.5,s.y,"#edeff0",1);var x=0,y=0;for(M=0;M<this.YC.length;M++)M==n&&(y=x),"stackedBarH"==this.YC[M].type&&x++;for(var M=0;M<i.length;M++){y||(i[M].$startX=e.x);var S=Math.abs(parseFloat(this.J.value(i[M]||0)));r<S&&(S=r),S-=o,S*=a;var k=e.x,C=e.y+b+M*d;if(y?k=i[M].$startX:i[M].$startX=k,S&&!isNaN(S)){f||(S+=p/_);var $=this.J.color.call(this,i[M]);t.globalAlpha=this.J.alpha.call(this,i[M]),t.fillStyle=this.J.color.call(this,i[M]),t.beginPath();var D=this.l$(t,k,C,m,0,_,S,0);if(w&&!g&&t.lineTo(e.x+c,C+(this.J.border?1:0)),t.fill(),g){var A=this.QC(t,k,C+m,k,C,g,$,"x");t.fillStyle=A.gradient,t.beginPath(),D=this.l$(t,k,C,m,0,_,S,0),t.fill()}this.J.border&&this.u$(t,k,C,m,o,0,_,S,$),t.globalAlpha=1,this.canvases[n].renderTextAt("middle",!0,i[M].$startX+(D[0]-i[M].$startX)/2-1,C+(D[1]-C)/2,this.J.label(i[M])),h.addRect(i[M].id,[i[M].$startX-e.x,C-e.y,D[0]-e.x,D[1]-e.y],n),i[M].$startX=D[0]}}}},eo={$render_area:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w;if(f=this.t$(t,i,e,s,n),u=(o=this.J).eventRadius||Math.floor(f.cellWidth/2),i.length){for(l=[],_=o.offset?e.x+.5*f.cellWidth:e.x,a=0;a<i.length;a++)if(c=i[a],v=this.i$(c,e,s,f),b=_+f.cellWidth*a,v){if(g="object"==k(v)?v.y0:v,a&&this.J.fixOverflow){if((d=this.i$(i[a-1],e,s,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?s.y:e.y,l.push([this.e$(p,b,m,g,w),w])),v.out&&(w="min"==v.out?s.y:e.y,l.push([this.e$(p,b,m,g,w),w]),a==i.length-1&&w==e.y&&l.push([b,e.y]))}v.out||(l.push([b,g]),h.addRect(c.id,[b-u-e.x,g-u-e.y,b+u-e.x,g+u-e.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,s.y]),l.push([l[0][0],s.y])),t.globalAlpha=this.J.alpha.call(this,i[0]),t.fillStyle=this.J.color.call(this,i[0]),t.beginPath(),this.r$(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.ZC(t,t.fillStyle),t.beginPath(),this.r$(t,l),t.stroke())}},$render_stackedArea:function(t,e,i,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w,x,y;if(v=this.t$(t,e,i,s,n),l=(u=this.J).eventRadius||Math.floor(v.cellWidth/2),e.length){_=[],b=[],p=u.offset?i.x+.5*v.cellWidth:i.x;var M=function(t,i){return n?e[t].$startY?i-s.y+e[t].$startY:0:i};for(c=0;c<e.length;c++)d=e[c],c?p+=v.cellWidth:(m=M(c,s.y),_.push([p,m])),m=M(c,this.i$(d,i,s,v)),b.push(isNaN(m)&&!c?e[c].$startY||s.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,s.y)]),n)for(c=e.length-2;0<c;c--)p-=v.cellWidth,(m=e[c].$startY)&&_.push([p,m]);for(_.push([_[0][0],_[0][1]]),t.globalAlpha=this.J.alpha.call(this,e[0]),t.fillStyle=this.J.color.call(this,e[0]),t.beginPath(),this.r$(t,_),t.fill(),c=0;c<e.length;c++){if(!(m=b[c]))for(c==e.length-1&&(m=e[c].$startY),f=c+1;f<e.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}e[c].$startY=m}}}},so={$render_radar:function(t,i,e,s,n,h){this.x$(t,i,e,s,n,h)},x$:function(t,i,e,s,n,h){if(i.length){for(var r=this.FC(e,s),o=this.J.radius?this.J.radius:r.radius,a=this.J.x?this.J.x:r.x,u=this.J.y?this.J.y:r.y,c=[],f=0;f<i.length;f++
)c.push(1);var l=this.Ec(c,i.length);this.s$=e,n||this.y$(l,a,u,o,i),this.M$(t,l,a,u,o,i,n,h)}},M$:function(t,i,e,s,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.J).yAxis.start,d=c.yAxis.end,k=(g=(C=this.OC(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.WC&&(x=this.GC(x)),(parseFloat(x||0)-l)*S),m=Math.floor(k*y),x=c.value(f!=h.length-1?h[f+1]:h[0]),this.WC&&(x=this.GC(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.PC(a,e,s,m),_=this.PC(u,e,s,b),p.push(v);c.fill&&this.S$(t,p,h),!c.disableLines&&2<h.length&&this.k$(t,p,h),(!c.disableItems||h.length<3)&&this.C$(t,p,h,r,o),p=null},C$:function(t,i,e,s,n){for(var h=0;h<i.length;h++)this.n$(t,i[h].x,i[h].y,e[h],this.J.label.call(this,e),s,n)},S$:function(t,i,e){var s,n;t.globalAlpha=this.J.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.J.fill.call(this,e[h]),s=i[h],n=i[h+1]||i[0],h||t.moveTo(s.x,s.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},k$:function(t,i,e){for(var s,n,h=0;h<i.length;h++)s=i[h],n=i[h+1]||i[0],this.IC(t,s.x,s.y,n.x,n.y,this.J.line.color.call(this,e[h]),this.J.line.width)},y$:function(t,i,e,s,n){var h=this.J.yAxis,r=this.J.xAxis,o=h.start,a=h.end,u=h.step,c={},f=this.D$;if("undefined"==typeof f.step||"undefined"==typeof f.start||"undefined"==typeof f.end){var l=this.NC();o=(c=this.b$(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=s*u/(a-o);u<1&&(p=Math.min(this.GC(u),o<=0?0:this.GC(o)),m=Math.pow(10,-p));var x=[];this.canvases.scale||(this.canvases.scale=this.d$("radar_scale"));var y=this.canvases.scale.getCanvas();for(d=a;o<=d;d-=u){var M=this.WC?Math.pow(10,d):d;c.fixNum&&(M=parseFloat(d).toFixed(c.fixNum)),b.push(Math.floor(g*w)+.5),m&&!this.WC&&(d=M=Math.round(M*m)/m);var S=e-s+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.A$(y,"arc",i,e,s-b[b.length-1],-Math.PI/2,3*Math.PI/2,d);var k,C=-Math.PI/2,$=C;for(v=0;v<t.length;v++)g||x.push($),k=C+t[v]-1e-4,this.A$(y,2<t.length?f.lineShape||"line":"arc",i,e,s-b[b.length-1],$,k,d,v,n[d]),$=k;g++}for(d=0;d<x.length;d++)_=this.PC(x[d],i,e,s),r.lines.call(this,n[d],d)&&this.IC(y,i,e,_.x,_.y,r?r.lineColor.call(this,n[d]):"#cfcfcf",1),this.I$(y,i,e,s,x[d],r?r.template.call(this,n[d]):"&nbsp;")},A$:function(t,i,e,s,n,h,r,o,a){var u,c;if(n<0)return!1;u=this.PC(h,e,s,n),c=this.PC(r,e,s,n);var f=this.J.yAxis;f.bg&&(t.beginPath(),t.moveTo(e,s),"arc"==i?t.arc(e,s,n,h,r,!1):(t.lineTo(u.x,u.y),t.lineTo(c.x,c.y)),t.fillStyle=f.bg(o,a),t.moveTo(e,s),t.fill(),t.closePath()),f.lines.call(this,o)&&(t.lineWidth=1,t.beginPath(),"arc"==i?t.arc(e,s,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())},I$:function(t,i,e,s,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.PC(n,i,e,s+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"}},no={$render_scatter:function(t,i,e,s,n,h){if(this.J.xValue){var r=this.J,o=!(r.disableLines||"undefined"==typeof r.disableLines),a=this.NC(),u=this.NC("h","xValue");n||(this.canvases.x||(this.canvases.x=this.d$("axis_x")),this.canvases.y||(this.canvases.y=this.d$("axis_y")),this.T$(this.canvases.y.getCanvas(),i,e,s,a.min,a.max),this.v$(this.canvases.x.getCanvas(),i,e,s,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.F$(t,i,e,s,u,a);this.s$=e;for(var f,l,d,v,_,p=[],m=0;m<i.length;m++){var b=this.z$(c,s,e,u,i[m],"X"),g=this.z$(c,e,s,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.IC(t,d,v
,p[0].x,p[0].y,x,r.line.width),r.disableItems||this.V$(t,h,p[0],i[0],n),r.fill&&this.H$(t,p,i)):(d=p[w+1].x,v=p[w+1].y,this.IC(t,f,l,d,v,x,r.line.width))}!r.disableItems&&p[w]&&this.V$(t,h,p[w],i[_],n)}}},H$:function(t,i,e){var s,n;t.globalAlpha=this.J.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.J.fill.call(this,e[h]),s=i[h],n=i[h+1]||i[0],h||t.moveTo(s.x,s.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},F$:function(t,i,e,s,n,h){var r={};return r.totalHeight=s.y-e.y,r.totalWidth=s.x-e.x,this.B$(r,n.min,n.max,r.totalWidth,"X"),this.B$(r,h.min,h.max,r.totalHeight,"Y"),r},V$:function(t,i,e,s,n){this.n$(t,e.x,e.y,s,this.J.label.call(this,s),n,i)},z$:function(t,i,e,s,n,h){var r=this.J["X"==h?"xValue":"value"].call(this,n),o=t["valueFactor"+h],a=(parseFloat(r||0)-s.min)*o,u=t["unit"+h],c=e[h.toLowerCase()]-("X"==h?-1:1)*Math.floor(u*a);return a<0&&(c=e[h.toLowerCase()]),r>s.max&&(c=i[h.toLowerCase()]),r<s.min&&(c=e[h.toLowerCase()]),c},B$:function(t,i,e,s,n){var h=this.OC(i,e);t["relValue"+(n=n||"")]=h[0],t["valueFactor"+n]=h[1],t["unit"+n]=t["relValue"+n]?s/t["relValue"+n]:10}},ho={$render_splineArea:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g=this.J,w=[];if(f=this.t$(t,i,e,s,n),c=g.eventRadius||Math.floor(f.cellWidth/2),a=[],i.length){for(v=e.x,o=0;o<i.length;o++)((m=this.i$(i[o],e,s,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-e.x,m-c-e.y,d+c-e.x,m+c-e.y],n));for(l=this.R$(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.P$(u,_,o,l.a,l.b,l.c,l.d);x<e.y&&(x=e.y),x>s.y&&(x=s.y);var y=this.P$(u+1,_,o,l.a,l.b,l.c,l.d);y<e.y&&(y=e.y),y>s.y&&(y=s.y),w.push([u,x]),w.push([u+1,y])}w.push([p,b])}r=this.J.color.call(this,i[0]),w.length&&(w.push([p,s.y]),w.push([w[0][0],s.y])),t.globalAlpha=this.J.alpha.call(this,i[0]),t.fillStyle=r,t.beginPath(),this.r$(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.ZC(t,r),t.beginPath(),w.splice(w.length-3),this.r$(t,w),t.stroke())}}},ro={dynamic_setter:function(t){return t&&function i(r){if(r.j$)return;var o=r.J;o.cellWidth||(o.cellWidth=30);o.animateDuration||(o.animateDuration=400);o.offset=!1,r.j$=r.attachEvent("onBeforeRender",function(t,i){var e=r.E$(r.be,r.we);!function s(e){ao(e,function(t,i){i.Pe(e.be+2*e.J.cellWidth,e.we)})}(r),function h(t,i,e,s){if(s&&t.length){var n=Math.ceil((e.x-i.x)/s);t.length>n+1&&t.splice(0,t.length-n-1)}}(t,e.start,e.end,o.cellWidth),"add"==i&&function n(i){var t=i.J.cellWidth;i.N$!=t&&(i.N$=t,i.render());i.N$=0,i.L$=null,window.requestAnimationFrame&&!document.hidden&&window.requestAnimationFrame(function(t){!function h(i,t){var e,s=i.J.animateDuration,n=i.J.cellWidth;n&&1<i.count()&&(i.L$||(i.L$=t),e=t-i.L$,i.N$=Math.min(Math.max(e/s*n,1),n),i.render(),e<s&&window.requestAnimationFrame(function(t){h(i,t)}))}(i,t)});i.O$||(i.O$=i.attachEvent("onAfterRender",function(t){!function h(t,c){var f=t.count(),e=t.E$(t.be,t.we),l=t.J.cellWidth,d=t.N$||0,i=c.length<f||(c.length-1)*l>e.end.x-e.start.x;function s(t,i,e,s){var n=t.getCanvas(),h=t.Be,r=t.Fe,o=t.ze;if(d&&(c.length<f||(c.length-1)*l>e-i)?(h.style.left=-d+"px",1<c.length&&(!function u(t,i,e){if(t.length){G(t[0]);for(var s=1;s<t.length;s++)oo(e,t[s])||(t[s].style.left=t[s].offsetLeft-i+"px")}}(r,d,o),n.clearRect(0,0,i+d,h.offsetHeight),n.clearRect(e+d,0,h.offsetWidth,h.offsetHeight))):(h.style.left="0px",s||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;oo(o,r[a])&&(a-=1),r[a].style.display="none"}}ao(t,function(t,i){s(i,e.start.x,e.end.x,"x"==t)}),function n(t,i,e){t.Yi.Li.style.left=i.start.x-e+"px",t.Yi.Li.style.width=i.end.x-i.start.x+e+"px"}(t,e,i?d:0)}(i,t)}))}(r)}),r.U$=r.attachEvent("onBeforeXAxis",function(t,i,e,s,n,h){return function _(t,i,e,s,n,h,r){var o,a,u,c,f=t.J,l=s.x-.5,d=parseInt(r||n.y,10)+.5,v=n.x;if(!f.dynamic)return!1;for(u=(e.length-1)*h>v-l||e.length<t.count(),a=0;a<e.length;a++)c=l+a*h,
o=u?1<a:!!a,c=Math.ceil(c)-.5,t.Y$(c,d,e[a],o),a&&f.xAxis.lines.call(t,e[a])&&t.W$(i,c,n.y,s.y,e[a]);t.canvases.x.renderTextAt(!0,!1,l,n.y+f.padding.bottom-3,f.xAxis.title,"webix_axis_title_x",n.x-s.x),t.IC(i,l,d,v+(u?t.N$:0),d,f.xAxis.color,1)}(r,t,i,e,s,n,h),!1})}(this),t}};function oo(t,i){return"axis_x"===t&&-1!==i.className.indexOf("webix_axis_title_x")}function ao(t,i){if(t.canvases){for(var e=0;e<t.YC.length;e++)t.canvases[e]&&i(e,t.canvases[e]);t.canvases.x&&i("x",t.canvases.x)}}var uo={name:"chart",$init:function(t){if(this.YC=[this.J],this.G$=[],this.Yi.className+=" webix_chart",this.$ready.push(this.hr),t.preset&&this.X$(t),t.series){var i=t.series;delete t.series,t.series=i}this.data.provideApi(this,!0)},hr: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"},Xo:"webix_area_id",on_click:{webix_chart_legend_item:function(t,i,e){var s=e.getAttribute("series_id");if(this.callEvent("onLegendClick",[t,s,e])&&void 0!==s&&1<this.YC.length){var n=this.J,h=n.legend.values;(h&&h[s].toggle||n.legend.toggle)&&(-1!=e.className.indexOf("hidden")?this.showSeries(s):this.hideSeries(s))}}},on_dblclick:{},on_mouse_move:{},locate:function(t){return q(t,this.Xo)},$setSize:function(t,i){var e=Li.api.$setSize.call(this,t,i);if(e){for(var s in this.canvases)this.canvases[s].Pe(this.be,this.we);this.render()}return e},type_setter:function(t){return this["$render_"+t],"undefined"==typeof this.J.offset&&(this.J.offset=!(-1!=t.toLowerCase().indexOf("area"))),"radar"!=t||this.J.yAxis||this.define("yAxis",{}),"scatter"==t&&(this.J.yAxis||this.define("yAxis",{}),this.J.xAxis||this.define("xAxis",{})),t},destructor:function(){this.removeAllSeries(),Ti.destructor.apply(this,arguments)},removeAllSeries:function(){this.clearCanvas(),this.q$&&(this.q$.innerHTML="",this.q$.parentNode.removeChild(this.q$),this.q$=null),this.canvases&&(this.canvases={}),this.Yi.innerHTML="",this.YC=[]},clearCanvas:function(){if(this.canvases&&"object"==k(this.canvases))for(var t in this.canvases)this.canvases[t].clearCanvas()},render:function(t,i,e){var s,n,h,r;if(this.isVisible(this.J.id)&&(n=this.J$(),this.callEvent("onBeforeRender",[n,e]))){if(this.canvases&&"object"==k(this.canvases))for(var o in this.canvases)this.canvases[o].clearCanvas();else this.canvases={};if(this.J.legend&&(this.canvases.legend||(this.canvases.legend=this.d$("legend")),this.K$(this.data.getRange(),this.be,this.we)),this.nu=h=new Ve(this.Xo),r=this.J,s=this.E$(this.be,this.we),this.YC)for(var a=0;a<this.YC.length;a++)this.J=this.YC[a],this.canvases[a]||(this.canvases[a]=this.d$(this.name+" "+a,"z-index:"+(2+a),null,a,this.J.ariaLabel)),this["$render_"+this.J.type](this.canvases[a].getCanvas(),n,s.start,s.end,a,h);if(h.render(this.Yi),this.Yi.lastChild.style.zIndex=100,this.Z$(this.Yi.lastChild,s),this.callEvent("onAfterRender",[n]),this.J=r,this.J.legend&&this.J.legend.values)for(var u=this.J.legend.values,c=0;c<u.length;c++)u[c].$hidden&&this.hideSeries(c)}},Z$:function(t,i){var e={};for(var s in e.left=i.start.x,e.top=i.start.y,e.width=i.end.x-i.start.x,e.height=i.end.y-i.start.y,e)t.style[s]=e[s]+"px"},J$:function(){var t,i,e,s,n,h,r,o,a,u;if(s=this.data.getRange(),t=-1!=this.J.type.toLowerCase().indexOf("barh")?"yAxis":"xAxis",(i=this.J[t])&&i.units&&"object"==k(i.units)){if(o=[],"undefined"!=typeof(e=i.units).start&&"undefined"!=typeof e.end&&"undefined"!=typeof e.next)for(r=e.start;r<=e.end;)o.push(r),r=e.next.call(this,r);else"[object Array]"===Object.prototype.toString.call(e)&&(o=e);if(h=[],o.length){for(a=i.value,u={},n=0;n<s.length;n++)u[a(s[n])]=n;for(n=0;n<o.length;n++)"undefined"!=typeof u[o[n]]?(s[u[o[n]]].$unit=o[n],h.push(s[u[o[n]]])):h.push({$unit:o[n]})}return h}
return s},series_setter:function(t){if("object"!=k(t));else{this.ot(t.length?t[0]:t),this.YC=[this.J];for(var i=1;i<t.length;i++)this.addSeries(t[i])}return t},value_setter:It,xValue_setter:It,yValue_setter:function(t){this.define("value",t)},alpha_setter:It,label_setter:It,lineColor_setter:It,borderColor_setter:It,pieInnerText_setter:It,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.Q$[Math.floor(i/256)](i%256)},"default":function(t){var i=this.count(),e=this.Rc.length,s=this.getIndexById(t.id);return i<e?(s&&(s=s<e-i?this.Bc+2:this.Bc+1),this.Bc=s):s%=e,this.Rc[s]}},color_setter:function(t){return this.colormap[t]||It(t)},fill_setter:function(t){return!(!t||"0"==t)&&It(t)},X$:function(t){this.define("preset",t.preset),delete t.preset},preset_setter:function(t){var i,e,s;if(this.defaults=H.extend({},this.defaults),"object"!=k(s=this.presets[t]))return!1;for(i in s)if("object"==k(s[i]))if(this.defaults[i]&&"object"==k(this.defaults[i]))for(e in this.defaults[i]=H.extend({},this.defaults[i]),s[i])this.defaults[i][e]=s[i][e];else this.defaults[i]=H.extend({},s[i]);else this.defaults[i]=s[i];return t},legend_setter:function(t){return t?("object"!=k(t)&&(t={template:t}),this.ji(t,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:-1!=this.J.type.toLowerCase().indexOf("stacked")?"":"hide",marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3}),t.template=It(t.template),t):(this.q$&&(this.q$.innerHTML="",this.q$=null),!1)},item_setter:function(t){"object"!=k(t)&&(t={color:t,borderColor:t}),this.ji(t,H.extend({},this.defaults.item));return this.tD(["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=It(t.color),t},padding_setter:function(t){return"object"!=k(t)&&(t={left:t,right:t,top:t,bottom:t}),this.ji(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.ji(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0});return this.tD(["lineColor","template","lines"],t),this.m$=H.extend({},t),t},yAxis_setter:function(t){this.ji(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0,bg:"#ffffff"});return this.tD(["lineColor","template","lines","bg"],t),this.D$=H.extend({},t),t},tD:function(t,i){for(var e=0;e<t.length;e++)i[t[e]]=It(i[t[e]])},d$:function(t,i,e,s,n){var h={container:e||this.Yi,name:t,title:x(n)?t:n||"",series:s,style:i||"",width:this.be,height:this.we};return new Wi(h)},LC:function(t,i,e,s,n,h){var r,o=0;return this.J.yAxis&&(this.canvases.y||(this.canvases.y=this.d$("axis_y")),o=this.T$(this.canvases.y.getCanvas(),t,i,e,s,n)),this.J.xAxis&&(this.canvases.x||(this.canvases.x=this.d$("axis_x")),r=this.canvases.x.getCanvas(),this.callEvent("onBeforeXAxis",[r,t,i,e,h,o])&&this.UC(r,t,i,e,h,o)),o},UC:function(t,i,e,s,n,h){var r,o,a=this.J,u=e.x-.5,c=parseInt(h||s.y,10)+.5,f=s.x,l=!0,d="stackedBar"==a.type?s.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:s.x,l=!!r),o=Math.ceil(o)-.5;var v="auto"!=a.origin&&"bar"==a.type&&parseFloat(a.value(i[r]))<a.origin;this.Y$(o,d,i[r],l,v),(a.offset||r||a.cellWidth)&&a.xAxis.lines.call(this,i[r])&&this.W$(t,o,s.y,e.y,i[r])}this.canvases.x.renderTextAt(!0,!1,u,s.y+a.padding.bottom-3,a.xAxis.title,"webix_axis_title_x",s.x-e.x),this.IC(t,u,c,f,c,a.xAxis.color,1),a.xAxis.lines.call(this,{})&&a.offset&&this.IC(t,f+.5,s.y,f+.5,e.y+.5,a.xAxis.lineColor.call(this,{}),1)},T$:function(t,i,e,s,n,h){var r,o={};if(this.J.yAxis){var a=e.x-.5,u=s.y,c=e.y,f=s.y+.5;if(this.J.yAxis.step&&(r=parseFloat(this.J.yAxis.step)),"undefined"==typeof this.D$.step||"undefined"==typeof this.D$.start||"undefined"==typeof this.D$.end?(n=(o=this.b$(n,h)).start,h=o.end,r=o.step,this.J.yAxis.end=h,this.J.yAxis.start=n):"logarithmic"==this.config.scale&&(this.WC=!0),this.p$(e,s)
,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.WC?Math.pow(10,v):v;o.fixNum&&(_=parseFloat(_).toFixed(o.fixNum));var p=Math.floor(u-d*l)+.5;if(v==n&&"auto"==this.J.origin||!this.J.yAxis.lines.call(this,v)||this.IC(t,a,p,s.x,p,this.J.yAxis.lineColor.call(this,v),1),v==this.J.origin&&(f=p),r<1&&!this.WC){var m=Math.min(Math.floor(this.GC(r)),n<=0?0:Math.floor(this.GC(n))),b=Math.pow(10,-m);v=_=Math.round(_*b)/b}this.canvases.y.renderText(0,p-5,this.J.yAxis.template(_.toString()),"webix_axis_item_y",e.x-5),d++}return this.IC(t,a,u+1,a,c,this.J.yAxis.color,1),f}}},p$:function(t,i){var e=this.canvases.y.renderTextAt("middle",!1,0,parseInt((i.y-t.y)/2+t.y,10),this.J.yAxis.title,"webix_axis_title_y");e&&(e.style.left=(S.transform?(e.offsetHeight-e.offsetWidth)/2:0)+"px")},iD:function(t,i){return{start:Math.floor(this.GC(t)),step:1,end:Math.ceil(this.GC(i))}},eD:function(t){var i=Math.floor(this.GC(t)),e=Math.pow(10,i),s=t/e;return s=5<s?10:5,parseInt(s,10)*e},b$:function(t,i){if(this.WC=!1,"logarithmic"==this.J.scale){var e=Math.floor(this.GC(t)),s=Math.ceil(this.GC(i));if(0<t&&0<i&&1<s-e)return this.WC=!0,this.iD(t,i)}var n,h,r;if("auto"!=this.J.origin&&this.J.origin<t&&(t=this.J.origin),(n=this.eD((i-t)/8||1))>Math.abs(t))h=t<0?-n:0;else{var o=Math.abs(t),a=Math.floor(this.GC(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.eD((i-h)/8||1)),r=h;for(var c=Math.floor(this.GC(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}},NC:function(t,i){var e,s,n=this.data.io(),h=arguments.length&&"h"==t?this.m$:this.D$;if(i=i||"value",h&&"undefined"!=typeof h.end&&"undefined"!=typeof h.start&&h.step)e=parseFloat(h.end),s=parseFloat(h.start);else if(e=Ie.max(this.YC[0][i],n),s=h&&"undefined"!=typeof h.start?parseFloat(h.start):Ie.min(this.YC[0][i],n),1<this.YC.length)for(var r=1;r<this.YC.length;r++){var o=Ie.max(this.YC[r][i],n),a=Ie.min(this.YC[r][i],n);e<o&&(e=o),a<s&&(s=a)}return{max:e,min:s}},GC:function(t){return Math.log(t)/Math.LN10},Y$:function(t,i,e,s,n){if(this.J.xAxis){var h=this.canvases.x.renderTextAt(n,s,t,i-(n?2:0),this.J.xAxis.template(e));h&&(h.className+=" webix_axis_item_x")}},W$:function(t,i,e,s,n){this.J.xAxis&&this.J.xAxis.lines&&this.IC(t,i,e,i,s,this.J.xAxis.lineColor.call(this,n),1)},IC:function(t,i,e,s,n,h,r){t.strokeStyle=h,t.lineWidth=r,t.beginPath(),t.moveTo(i,e),t.lineTo(s,n),t.stroke(),t.lineWidth=1},OC:function(t,i){return[i!=t?i-t:t,1]},Q$:[function(t){return"#FF"+We.toHex(t/2,2)+"00"},function(t){return"#FF"+We.toHex(t/2+128,2)+"00"},function(t){return"#"+We.toHex(255-t,2)+"FF00"},function(t){return"#00FF"+We.toHex(t,2)},function(t){return"#00"+We.toHex(255-t,2)+"FF"},function(t){return"#"+We.toHex(t,2)+"00FF"}],Rc:["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],Bc:0,addSeries:function(t){var i=H.extend({},this.J);this.J=H.extend({},i),this.ot(t,{}),this.YC.push(this.J),this.J=i},sD:function(t){var i,e,s,n,h,r,o,a;for(e=this.nu.hu,n=J(this.Yi.Li),o=(h=Z(t)).x-n.x,a=h.y-n.y,s=0;s<e.length;s++)o<=(i=e[s].points)[2]&&o>=i[0]&&a<=i[3]&&a>=i[1]&&(r?e[s].index>r.index&&(r=e[s]):r=e[s]);return r?r.index:0},hideSeries:function(t){this.canvases[t].hideCanvas();var i=this.J.legend;i&&i.values&&i.values[t]&&(i.values[t].$hidden=!0,this.K$()),this.nu.hide(this.Yi,t,!0)},showSeries:function(t){this.canvases[t].showCanvas();var i=this.J.legend;i&&i.values&&i.values[t]&&(delete i.values[t].$hidden,this.K$()),this.nu.hide(this.Yi,t,!1)},K$:function(t,i){var e,s,n,h,r,o,a,u,c,f,l,d=0,v=0;if(t=t||[],i=i||this.be,u=this.canvases.legend.getCanvas(),s=this.J.legend,a="x"!=this.J.legend.layout?"width:"+s.width+"px":"",this.q$&&(this.q$.innerHTML="",this.q$.parentNode.removeChild(this.q$)),this.canvases.legend.clearCanvas(!0),n=Y("DIV",{"class":"webix_chart_legend",style:"left:"+d+"px; top:"+v+"px;"+a},""),s.padding&&(
n.style.padding=s.padding+"px"),this.q$=n,this.Yi.appendChild(n),r=[],s.values)for(e=0;e<s.values.length;e++)r.push(this.nD(n,s.values[e].text,"undefined"!=typeof s.values[e].id?k(s.values[e].id):e,s.values[e].$hidden));else for(e=0;e<t.length;e++)r.push(this.nD(n,s.template(t[e]),t[e].id));for(0===n.offsetWidth&&(n.style.width="auto"),o=n.offsetWidth,h=n.offsetHeight,o<i&&("x"==s.layout&&"center"==s.align&&(d=(i-o)/2),"right"==s.align&&(d=i-o),s.margin&&"center"!=s.align&&(d+=("left"==s.align?1:-1)*s.margin)),h<this.we&&("middle"==s.valign&&"center"!=s.align&&"x"!=s.layout?v=(this.we-h)/2:"bottom"==s.valign&&(v=this.we-h),s.margin&&"middle"!=s.valign&&(v+=("top"==s.valign?1:-1)*s.margin)),n.style.left=d+"px",n.style.top=v+"px",u.save(),e=0;e<r.length;e++)l=r[e],c=s.values&&s.values[e].$hidden?(f=!0,s.values[e].disableColor?s.values[e].disableColor:"#edeff0"):(f=!1,s.values?s.values[e].color:this.J.color.call(this,t[e])),this.hD(u,l.offsetLeft+d,l.offsetTop+v,c,l.offsetHeight,f,e);u.restore(),r=null},nD:function(t,i,e,s){var n="";"x"==this.J.legend.layout&&(n="float:left;");var h=Y("DIV",{style:n+"padding-left:"+(10+this.J.legend.marker.width)+"px","class":"webix_chart_legend_item"+(s?" hidden":""),role:"button",tabindex:"0","aria-label":ct.aria[(s?"show":"hide")+"Chart"]+" "+i},i);return 2<arguments.length&&h.setAttribute("series_id",e),t.appendChild(h),h},hD:function(t,i,e,s,n,h,r){var o=[],a=this.J.legend.marker,u=this.J.legend.values,c=u&&u[r].markerType?u[r].markerType:a.type;if(s&&(t.strokeStyle=t.fillStyle=s),"round"!=c&&a.radius)if("item"==c){if(this.J.line&&"scatter"!=this.J.type&&!this.J.disableLines){t.beginPath(),t.lineWidth=this.YC[r].line.width,t.strokeStyle=h?s:this.YC[r].line.color.call(this,{});var f=i+5,l=e+n/2;t.moveTo(f,l);var d=f+a.width;t.lineTo(d,l),t.stroke()}var v=this.YC[r].item,_=parseInt(v.radius.call(this,{}),10)||0,p=v.type.call(this,{});_&&(t.beginPath(),h?(t.lineWidth=v.borderWidth,t.strokeStyle=s,t.fillStyle=s):(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,e+=n/2,this.h$(t,i,e,_+1,p),t.fill(),t.stroke()),t.globalAlpha=1}else t.beginPath(),t.lineWidth=1,i+=5,e+=n/2-a.height/2,o=[[i+a.radius,e+a.radius,a.radius,Math.PI,3*Math.PI/2,!1],[i+a.width-a.radius,e],[i+a.width-a.radius,e+a.radius,a.radius,-Math.PI/2,0,!1],[i+a.width,e+a.height-a.radius],[i+a.width-a.radius,e+a.height-a.radius,a.radius,0,Math.PI/2,!1],[i+a.radius,e+a.height],[i+a.radius,e+a.height-a.radius,a.radius,Math.PI/2,Math.PI,!1],[i,e+a.radius]],this.r$(t,o),t.stroke(),t.fill();else{t.beginPath(),t.lineWidth=a.height,t.lineCap=a.type,i+=t.lineWidth/2+5,e+=n/2,t.moveTo(i,e);var m=i+a.width-a.height+1;t.lineTo(m,e),t.stroke(),t.fill()}},E$:function(t,i){var e,s,n,h;if(e=this.J.padding.left,s=this.J.padding.top,n=t-this.J.padding.right,h=i-this.J.padding.bottom,this.J.legend){var r=this.J.legend,o=this.J.legend.width,a=this.J.legend.height;"x"==r.layout?"center"==r.valign?"right"==r.align?n-=o:"left"==r.align&&(e+=o):"bottom"==r.valign?h-=a:s+=a:"right"==r.align?n-=o:"left"==r.align&&(e+=o)}return{start:{x:e,y:s},end:{x:n,y:h}}},o$:function(t){var i,e,s,n,h;if(this.J.yAxis&&"undefined"!=typeof this.J.yAxis.end&&"undefined"!=typeof this.J.yAxis.start&&this.J.yAxis.step)s=parseFloat(this.J.yAxis.end),n=parseFloat(this.J.yAxis.start);else{for(i=0;i<t.length;i++)for(t[i].$sum=0,t[i].$min=Infinity,e=0;e<this.YC.length;e++)h=Math.abs(parseFloat(this.YC[e].value(t[i])||0)),isNaN(h)||(-1!=this.YC[e].type.toLowerCase().indexOf("stacked")&&(t[i].$sum+=h),h<t[i].$min&&(t[i].$min=h));for(s=-Infinity,n=Infinity,i=0;i<t.length;i++)t[i].$sum>s&&(s=t[i].$sum),t[i].$min<n&&(n=t[i].$min);0<n&&(n=0)}return{max:s,min:n}},QC:function(t,i,e,s,n,h,r,o){var a,u,c,f,l,d;return"light"==h?(a="x"==o?t.createLinearGradient(i,e,s,e):t.createLinearGradient(i,e,i,n),d=[[0,"#FFFFFF"],[.9,r],[1,r]],u=2):"falling"==h||"rising"==h?(a="x"==o?t.createLinearGradient(i,e,s,e):t.createLinearGradient(i,e,i,n),c=We.toRgb(r),(f=We.rgbToHsv(c[0],c[1],
c[2]))[1]*=.5,l="rgb("+We.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,e):t.createLinearGradient(i,e,s,e),d=[[0,"#9d9d9d"],[.3,"#e8e8e8"],[.45,"#ffffff"],[.55,"#ffffff"],[.7,"#e8e8e8"],[1,"#9d9d9d"]]),this.rD(a,d),{gradient:a,offset:u}},PC:function(t,i,e,s){return t*=-1,{x:i+=Math.cos(t)*s,y:e-=Math.sin(t)*s}},rD:function(t,i){for(var e=0;e<i.length;e++)t.addColorStop(i[e][0],i[e][1])},r$:function(t,i){var e,s;for(e=0;e<i.length;e++)s=e?"lineTo":"moveTo",2<i[e].length&&(s="arc"),t[s].apply(t,i[e])},oD:function(t,i,e,s,n){t.addRect(i,[e[0].x-s.x,e[0].y-s.y,e[1].x-s.x,e[1].y-s.y],n)}},co={api:uo,view:H.protoUI(uo,Jr,Kr,Zr,Qr,to,io,{$render_spline:function(t,i,e,s,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b;if(c=this.t$(t,i,e,s,n),r=this.J,this.s$=e,a=[],i.length){for(d=r.offset?e.x+.5*c.cellWidth:e.x,o=0;o<i.length;o++)((p=this.i$(i[o],e,s,c))||"0"==p)&&(l=o?c.cellWidth*o-.5+d:d,a.push({x:l,y:p,v:this.J.value(i[o]),index:o}));for(f=this.R$(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.P$(u,v,o,f.a,f.b,f.c,f.d);g<e.y&&(g=e.y),g>s.y&&(g=s.y);var w=this.P$(u+1,v,o,f.a,f.b,f.c,f.d);w<e.y&&(w=e.y),w>s.y&&(w=s.y),this.IC(t,u,g,u+1,w,r.line.color(i[o]),r.line.width)}this.IC(t,_-1,this.P$(u,v,o,f.a,f.b,f.c,f.d),_,b,r.line.color(i[o]),r.line.width)}this.n$(t,v,m,i[a[o].index],r.label(i[a[o].index]),n,h)}}},R$:function(t){var i,e,s,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=[],e=[],s=[],n=[],h=0;h<f-1;h++)i[h]=t[h].y,e[h]=-u[h]*r[h+1]/6-u[h]*r[h]/3+(t[h+1].y-t[h].y)/u[h],s[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]=s[h]=e[h]=0);return{a:i,b:e,c:s,d:n}},P$:function(t,i,e,s,n,h,r){return s[e]+(t-i)*(n[e]+(t-i)*(h[e]+(t-i)*r[e]))}},eo,so,no,{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}}},ho,ro,Fe,Yi,we,Pe,g,Li.view)},fo={name:"rangechart",$init:function(){this.attachEvent("onAfterRender",this.aD),this.uD()},aD:function(){if(-1===this.J.type.indexOf("pie")&&"radar"!==this.J.type&&this.J.type,this.nu.hu.length&&!this.cD){this.fD(),this.lD=(this.nu.hu[0].points[2]-this.nu.hu[0].points[0])/2;var t={webix_disable_drag:"true",tabindex:"0",role:"button","aria-label":ct.aria.resizeChart};this.dD=Y("div",H.extend({"class":"webix_chart_resizer right"},t)),this.vD=Y("div",H.extend({"class":"webix_chart_resizer left"},t)),this.cD=Y("div",{"class":"webix_chart_frame",webix_disable_drag:"true"}),this.st.appendChild(this.vD),this.st.appendChild(
this.cD),this.st.appendChild(this.dD),this._D(),Nt(this.dD,S.mouse.down,this.pD,{bind:this}),Nt(this.vD,S.mouse.down,this.pD,{bind:this}),Nt(this.cD,S.mouse.down,this.pD,{bind:this}),Nt(D(this.dD),"keydown",this.mD,{bind:this}),Nt(D(this.vD),"keydown",this.mD,{bind:this}),this.Bk&&(this.J.range=this.uD(this.Bk)),this.bD(),this.callEvent("onAfterRangeChange",[this.Bk]),this.data.attachEvent("onStoreUpdated",C(this.bD,this))}else this._D(!0)},$setSize:function(t,i){co.api.$setSize.call(this,t,i)&&(this.fD(),this.bD())},_D:function(t){this.dD&&!this.gD&&(this.gD=this.dD.clientWidth/2,t&&this.bD())},fD:function(){var t=this.E$(this.be,this.we);this.s$=t.start,this.wD=t.end},removeAllSeries:function(){this.cD=this.dD=this.vD=null,co.api.removeAllSeries.apply(this,arguments)},mD:function(t){var i=t.which||t.keyCode;if(37===i||39===i){Q(t);var e=-1!==t.target.className.indexOf("right")?"eindex":"sindex",s=-1!==t.target.className.indexOf("right")?"end":"start",n=this.Bk;n[e]=n[e]+(37===i?-1:1),this.nu.hu[n[e]]&&(n[s]=this.xD(n[e]),this.setFrameRange(n))}},pD:function(t){if(-1!==t.target.className.indexOf("webix_chart_resizer"))this.yD=t.target;else if(this.nu.hu.length){var i=this.nu.hu[this.Bk.sindex].points[2]-this.lD,e=this.nu.hu[this.Bk.eindex].points[2]-this.lD;this.MD={ex:Z(t).x,fx:i+this.s$.x,fw:e-i}}et(this.st,"webix_noselect webix_wresize_cursor"),this.SD(),this.kD=Lt(document.body,S.mouse.move,this.CD,{bind:this}),this.$D=Lt(document.body,S.mouse.up,this.DD,{bind:this})},SD:function(){M.$[this.kD]&&(Ot(this.kD),Ot(this.$D))},CD:function(t){if(this.yD){var i=Z(t).x-J(this.$view).x;i>=this.s$.x&&i<=this.wD.x&&(-1!==this.yD.className.indexOf("left")?i<this.dD.offsetLeft&&(this.yD.style.left=i-this.gD+"px",this.cD.style.left=i+"px",this.cD.style.width=this.dD.offsetLeft-this.vD.offsetLeft-1+"px"):i>this.vD.offsetLeft+this.gD&&(this.yD.style.left=i-this.gD+"px",this.cD.style.width=this.dD.offsetLeft-this.vD.offsetLeft-1+"px"))}else if(this.MD){var e=Z(t).x-this.MD.ex,s=this.MD.fx+e,n=s+this.MD.fw;this.s$.x<=s&&this.wD.x>=n&&(H.extend(this.MD,{lx:s,rx:n},!0),this.vD.style.left=s-this.gD+"px",this.dD.style.left=n-this.gD+"px",this.cD.style.left=s+"px")}},DD:function(t){if(this.SD(),st(this.st,"webix_noselect"),st(this.st,"webix_wresize_cursor"),this.count()){if(this.yD){var i=S.touch?t.changedTouches[0].pageX:Z(t).x;i-=J(this.$view).x+this.s$.x;var e=this.AD(i),s=this.xD(e);this.yD===this.vD?(e>=this.Bk.eindex&&(e=this.Bk.eindex,s=this.xD(e)),this.Bk.start=s,this.Bk.sindex=e):(e<=this.Bk.sindex&&(e=this.Bk.sindex,s=this.xD(e)),this.Bk.end=s,this.Bk.eindex=e),this.yD=null}else if(this.MD&&this.MD.lx){var n=this.Bk.sindex=this.AD(this.MD.lx-this.s$.x),h=this.Bk.eindex=this.AD(this.MD.rx-this.s$.x);this.Bk.start=this.xD(n),this.Bk.end=this.xD(h),this.MD=null}this.bD(),this.callEvent("onAfterRangeChange",[this.Bk.start,this.Bk.end])}},xD:function(t){return t>=this.data.order.length&&(t=this.data.order.length-1),this.getItem(this.data.order[t])[this.J.frameId||"id"]},AD:function(t){for(var i=this.nu.hu,e=0;e<i.length;e++)if(t<=i[e].points[2]-this.lD)return e;return i.length-1},TD:function(t){for(var i=this.J.frameId||"id",e=0;e<this.data.order.length;e++)if(this.getItem(this.data.order[e])[i]==t)return e;return-1},uD:function(t){t?(t.start&&(t.sindex=this.TD(t.start)),t.end&&(t.eindex=this.TD(t.end)),t.start=t.start||this.xD(t.sindex),t.end=t.end||this.xD(t.eindex)):t={start:0,end:0,sindex:0,eindex:0},this.Bk=t},range_setter:function(t){return this.uD(t),this.Bk},getFrameData:function(){for(var t=[],i=this.Bk.sindex;i<=this.Bk.eindex;i++){var e=this.getItem(this.data.order[i]);e&&t.push(e)}return t},setFrameRange:function(t){this.uD(t),this.bD(),this.callEvent("onAfterRangeChange",[t])},bD:function(){if(this.nu){var t=this.nu.hu;if(t.length){var i=t[this.Bk.sindex].points[0]+this.s$.x+this.lD-1,e=t[this.Bk.eindex].points[0]+this.s$.x+this.lD-1;this.vD.style.left=i-this.gD+"px",this.dD.style.left=e-this.gD+"px",this.cD.style.left=i+"px",this.cD.style.width=e-i+"px",this.J.range=this.Bk}}},getFrameRange:function(){
return this.J.range}},lo=(H.protoUI(fo,co.view),{name:"grouplist",defaults:{animate:{}},cb:"webix_grouplist",$init:function(){H.extend(this.data,ps,!0),this.data.count=function(){return this.order.length},this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",C(this.FD,this)),this.FD()},FD:function(){this.zD=[],this.VD=[]},$setSize:function(){Li.api.$setSize.apply(this,arguments)&&(this.mt.style.width=this.be)},on_click:{webix_list_item:function(t,i){if(this.u_)return!1;for(var e=0;e<this.VD.length;e++)if(this.VD[e]==i){for(var s=e;s<this.VD.length;s++)this.data.getItem(this.VD[s]).$template="";return e?(this.zD=this.data.branch[this.VD[e-1]],this.VD.splice(e)):(this.zD=this.data.branch[0],this.VD=[]),this.HD=!1,this.render()}var n=this.getItem(i);if(n.$count)return this.HD=!0,this.VD.push(i),n.$template="Back",this.zD=this.data.branch[n.id],this.render();this.J.select&&(this.lb=!0,"multiselect"==this.J.select||this.J.multiselect?this.select(i,!1,"touch"==this.J.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i),this.lb=!1)}},getOpenState:function(){return{parents:this.VD,branch:this.zD}},render:function(){var t,i;if(this.VD=B(this.VD),this.zD=B(this.zD),this.VD.length)for(t=0;t<this.VD.length;t++)this.data.branch[this.VD[t]]||(this.VD.splice(t,1),t--);if(i=this.VD.length?this.VD[this.VD.length-1]:0,this.zD=B(this.data.branch[i]),!this.zD.length&&this.VD.length&&(this.zD=[i],this.VD.pop()),this.u_)return $(this.render,this,arguments,100);for(t=0;t<this.zD.length;t++)this.data.getItem(this.zD[t]).$template="";if(this.zD.length||(this.zD=this.data.branch[0]),this.data.order=p([].concat(this.VD).concat(this.zD)),this.callEvent("onBeforeRender",[this.data])){if(!this.lb&&this.mt.innerHTML&&Gi.isSupported()&&this.J.animate&&this.BD!=this.VD.length){if(this.callEvent("onBeforeRender",[this.data])){this.RD||(this.RD=[]);var e=this.mt.cloneNode(!1);e.innerHTML=this.data.getRange().map(this.Ot,this).join("");var s=H.extend({},this.J.animate);s.direction=this.HD?"left":"right";var n=[f(s),f(s)];if(this.HD)this.RD.push(this.getScrollState()),Zi&&Zi.$active&&(n[0].y=0,n[1].y=-this.getScrollState().y);else{var h=this.RD.pop();Zi&&Zi.$active&&(n[0].y=-h.y,n[1].y=-this.getScrollState().y)}var r=Gi.formLine(e,this.mt,s);Zi&&Zi.$active&&Zi.gs(e,0,this.HD?0:n[0].y,"0ms"),s.master=this,s.callback=function(){this.mt=e,this.HD?Zi&&Zi.$active||this.scrollTo(0,0):Zi&&Zi.$active?$(function(){Zi.gs(e,0,n[0].y,"0ms")},this):h&&this.scrollTo(0,h.y),Gi.breakLine(r),s.master=s.callback=null,this.Li=null,this.u_=!1,this.callEvent("onAfterRender",[])},this.u_=!0,Gi(r,n)}}else Oe.render.apply(this,arguments);this.BD=this.VD.length}},templateBack_setter:function(t){this.type.templateBack=It(t)},templateItem_setter:function(t){this.type.templateItem=It(t)},templateGroup_setter:function(t){this.type.templateGroup=It(t)},type:{template:function(t,i){return t.$count?i.templateGroup(t,i):i.templateItem(t,i)},css:"group",classname:function(t,i,e){return"webix_list_item webix_"+(t.$count?"group":"item")+(t.$template?"_back":"")+(e&&e.webix_selected?" webix_selected":"")+(i.css?" "+i.css:"")+(t.$css?" "+t.$css:"")},templateStart:It('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()};  overflow:hidden;" {common.aria()}>'),templateBack:It("#value#"),templateItem:It("#value#"),templateGroup:It("#value#"),templateEnd:function(t){var i="";return t.$count&&(i+="<div class='webix_arrow_icon'></div>"),i+="</div>"}},showItem:function(t){var i,e;for(t&&(e=(i=this.getItem(t)).$parent,i.$count&&(e=i.id)),this.zD=this.data.branch[e||0],this.VD=[];e;)this.getItem(e).$template="Back",this.VD.unshift(e),e=this.getItem(e).$parent;this.lb=!0,this.render(),this.lb=!1,Oe.showItem.call(this,t)}});Tt(H.protoUI(lo,Fe,qh.view),{});var vo={name:"unitlist",Xo:"webix_item_id",uniteBy_setter:It,render:function(t,i,e){var s=this.J;if(this.isVisible(s.id)&&s.uniteBy){if(t){var n=this.getItemNode(t);if(n&&"update"==e&&this.J.uniteBy.call(this,i)==this.getItem(t).$unitValue)return X(this.Li[t]=this.ac(i),n),
void G(n)}this.callEvent("onBeforeRender",[this.data])&&(this.units=null,this.PD(),this.units&&(this.mt.innerHTML=this.jD().map(this.Ot,this).join(""),this.Li=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},Ot:function(t){var i=this.data.kr[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)},jD:function(){var t,i,e,s;t=[];var n=this.data.$min||0,h=this.data.$max||Infinity,r=0;for(e in this.units)for(t.push({$unit:e}),s=this.units[e],i=0;i<s.length;i++){if(r==n&&(t=[{$unit:e}]),t.push(this.getItem(s[i])),r==h)return p(t);r++}return p(t)},PD:function(){var e=this;this.units={},this.data.each(function(t){var i=e.J.uniteBy.call(this,t);t.$unitValue=i,e.units[i]||(e.units[i]=[]),e.units[i].push(t.id)})},type:{headerHeight:20,templateHeader:function(t){return"<span class='webix_unit_header_inner'>"+t+"</span>"},templateStart:function(t,i,e){if(t.$unit)return i.templateStartHeader.apply(this,arguments);var s="webix_list_item webix_list_"+i.css+"_item"+(e&&e.webix_selected?" webix_selected":"")+(t.$css?t.$css:""),n="width:"+i.widthSize(t,i,e)+"; height:"+i.heightSize(t,i,e)+"; overflow:hidden;"+(i.layout&&"x"==i.layout?"float:left;":"");return'<div webix_item_id="'+t.id+'" class="'+s+'" style="'+n+'" '+i.aria(t,i,e)+">"},templateStartHeader:function(t,i,e){var s="webix_unit_header webix_unit_"+i.css+"_header"+(t.$selected?"_selected":""),n="width:"+i.widthSize(t,i,e)+"; height:"+i.headerHeight+"px; overflow:hidden;";return'<div webix_unit_id="'+t.$unit+'" class="'+s+'" style="'+n+'">'}},$skin:function(){this.type.headerHeight=Xi.unitHeaderHeight}};H.protoUI(vo,qh.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 _o={name:"dbllist",defaults:{borderless:!0},$init:function(){this.ED={},this.ND=C(function(t){return this.ED[t.id]},this),this.LD=C(function(t){return!this.ED[t.id]},this),this.$view.className+=" webix_dbllist",this.$ready.unshift(this.mg)},$onLoad:function(t,i){return this.OD(function(){this.$$("left").data.driver=i,this.$$("left").parse(t),this.$$("right").data.driver=i,this.$$("right").parse(t)}),this.Hk(),!0},UD:function(){if(!1===this.J.buttons)return{width:10};var t=ct.dbllist,i=[this.YD("deselect_all",t.deselectAll),this.YD("select_all",t.selectAll),this.YD("deselect_one",t.deselectOne),this.YD("select_one",t.selectOne)];return i={width:120,template:i.join(""),onClick:{dbllist_button:function(t,i,e){this.getTopParentView().WD(e.getAttribute("action"))}}},this.J.buttons&&(i.template=this.J.buttons),i},YD:function(t,i){return"<button class='dbllist_button' action='"+t+"'>"+i+"</button>"},GD:function(t,i,e,s){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,e=t.to,s=i.getTopParentView();if(s===this.getTopParentView()){var n="select_one"!=e.J.action;s.select(t.source,n)}return!1},onItemDblClick:function(){return this.getTopParentView().WD(this.config.action)}}};return this.J.list&&H.extend(n,this.J.list,!0),e&&(n={rows:[{view:"label",label:e,css:"webix_inp_top_label"},n]}),s?{rows:[n,{view:"label",height:20,label:s,css:"bottom_label"}]}:n},mg:function(){var t=[{margin:10,type:"clean",cols:[this.GD("left","select_one",this.J.labelLeft,this.J.labelBottomLeft),this.UD(),this.GD("right","deselect_one",this.J.labelRight,this.J.labelBottomRight)]}];this.cols_setter(t)},WD:function(t){var i=null,e=!1;"select_all"===t?(
i=this.$$("left").data.order,e=!0):"select_one"===t?(i=this.$$("left").getSelectedId(!0),e=!0):"deselect_all"===t?(i=this.$$("right").data.order,e=!1):"deselect_one"===t&&(i=this.$$("right").getSelectedId(!0),e=!1),this.select(i,e)},select:function(t,i){var e;if("object"!==k(t)&&(t=[t]),i)for(e=0;e<t.length;e++)this.ED[t[e]]=!0;else for(e=0;e<t.length;e++)delete this.ED[t[e]];this.Hk(),this.callEvent("onChange",[])},OD:function(t,i){gi(C(t,this),!1),i&&(this.$$("left").J.autoheight||this.$$("right").J.autoheight)&&this.resize()},Hk:function(){var t=this.$$("left"),i=this.$$("right");t&&this.OD(function(){t.filter(this.LD),i.filter(this.ND)},!0)},focus:function(){if(!Ai.canFocus(this))return!1;Ai.setFocus(this)},value_setter:function(t){this.setValue(t)},setValue:function(t){this.ED={},"object"!==k(t)&&(t=t.toString().split(","));for(var i=0;i<t.length;i++)this.ED[t[i]]=!0;this.Hk()},getValue:function(){var t=[];for(var i in this.ED)t.push(i);return t.join(",")}},po=(H.protoUI(_o,li,He,Cn.view),{name:"tree",defaults:{scroll:"auto",navigation:!0},$init:function(){this.st.className+=" webix_tree",H.extend(this.data,ps,!0),H.extend(this.on_click,fs),this.attachEvent("onAfterRender",this.lc),this.attachEvent("onPartialRender",this.lc),this.data.provideApi(this,!0),this.st.setAttribute("role","tree")},Xo:"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 e=i.offsetLeft;t.node.style.width=this.$view.scrollWidth-e-10+"px",t.node.style.marginLeft=e+"px",t.node.style.left="0px"}},on_click:{webix_tree_item:function(t,i){this.J.activeTitle&&(this.getItem(i).open?this.close(i):this.open(i));if(this.J.select)if("multiselect"==this.J.select||this.J.multiselect){var e=t.ctrlKey||t.metaKey||"touch"==this.J.multiselect;if("level"==this.J.multiselect&&(e||t.shiftKey)){var s=this.getSelectedId(!0)[0];if(s&&this.getParentId(i)!=this.getParentId(s))return}this.select(i,!1,e,t.shiftKey)}else this.select(i)}},Qn:{insert:function(t){var i=this.getSelectedId()||"0";this.add({value:t},null,i)},modify:function(t){for(var i=this.getSelectedId(!0),e=0;e<i.length;e++)this.getItem(i[e]).value=t,this.refresh(i[e])},custom:function(){}},No:!0,$dragHTML:function(t,i,e){var s="<div class='webix_tree_item'>"+this.type.template(t,this.type)+"</div>";return b(e.source)&&1<e.source.length&&(s=this.Bo(s,e.source.length)),s},jo:function(t){for(var i=t.source,e=0;e<i.length;e++)this.close(i[e])},Po:function(t,i){var e=this.getItemNode(t);e?e.parentNode.insertBefore(ie.vn[0],e):i.children[0].children[0].appendChild(ie.vn[0])},type:H.extend({template:function(t,i){return(i["template"+t.level]||i.templateCommon).apply(this,arguments)},classname:function(t,i,e){var s="webix_tree_item";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),s+=" "+t.$css),e&&e.$css&&(s+=" "+e.$css),i.css&&(s+=" "+i.css),s},aria:function(t,i,e){return'role="treeitem"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count?'aria-expanded="'+(t.open?"true":"false")+'"':"")+'aria-level="'+t.$level+'"'},templateCommon:It("{common.icon()} {common.folder()} <span>#value#</span>"),templateStart:It('<div webix_tm_id="#id#" class="{common.classname()}" {common.aria()}>'),templateEnd:It("</div>"),templateCopy:It("#value#")},bs)}),mo=H.protoUI(po,_s,Fe,cs,ye,ds,Ye,Be,Pe,Ue,ls,Gh.view,vs,ue,g),bo={api:po,view:mo};Tt(mo,{name:"lineTree",css:"webixLineTree",icon:function(t,i){for(var e="",s="",n=1;n<=t.$level;n++){n==t.$level&&(s=t.$count?t.open?"webix_tree_open ":"webix_tree_close ":"webix_tree_none ");var h=i.XD(t,i,n);h&&(e+="<div class='"+s+"webix_tree_img webix_tree_"+h+"'></div>")}return e},XD:function(t,i,e){var s=i.rf,n=vs.Ve;if(0===s&&n){var h=t.$level,r=t.id;for(s=[];h;){var o=n.getParentId(r),a=n.data.branch[o];a[a.length-1]==r&&(s[h]=!0),r=o,h--}i.rf=s}if(!s)return 0;if(e!=t.$level)return s[e]?"blank":"line1"
;var u=3;return t.$parent||0===t.$index&&(u=4),s[t.$level]&&(u=2),t.$count?t.open?"minus"+u:"plus"+u:"line"+u}});var go={name:"treemap",defaults:{activeItem:!1,subRender:!0,header:!0,headerHeight:35,value:It("#value#"),headerTemplate:"",navigation:!0},value_setter:It,headerTemplate_setter:It,header_setter:function(t){return t&&!0!==t&&(this.type.header=t),t},$init:function(){this.$view.className+=" webix_treemap",this.st.setAttribute("role","tree"),this.qD=document.createElement("DIV"),H.extend(this.data,ps,!0),this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",C(function(){this.Ui="",this.$values={},this.$xy={}},this)),this.attachEvent("onKeyPress",this.Se)},sf:function(t){var i=this.data.kr[t.id];this.callEvent("onItemRender",[t]);var e=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)+e+this.type.templateEnd.call(this)},JD:function(t){var i=this.getItem(t),e=this.J.headerHeight,s="<div class='webix_treemap_header' style='height:"+e+"px;line-height:"+e+"px;'>";return s+=this.type.header.call(this,i,this.type),s+="</div>"},xC:function(t){var i,e,s,n,h=[];if(!this.$width||!this.count())return this.Ui="",!1;if(t||(t=this.config.branch||0,this.Ui="",this.$values={},this.$xy={},this.$xy[t]={width:this.$width,height:this.$height,top:0,left:0},t&&this.J.header&&(this.$xy[t].height-=this.J.headerHeight,this.$xy[t].top=this.J.headerHeight,this.Ui+=this.JD(t)),n=0,this.data.each(function(t){var i=this.getParentId(t.id);if(!this.data.branch[t.id]&&(s=1*this.config.value.call(this,t),!isNaN(s)&&s))for(this.$values[t.id]=s,n+=s;i;)this.$values[i]||(this.$values[i]=0),this.$values[i]+=s,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){(e={top:(i=this.$xy[t]).top,left:i.left,dx:i.width,dy:i.height,set:[],sum:0}).dim=Math.min(e.dx,e.dy);for(var r=e.dx*e.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.KD(e,h[u]);if(c<a)e.sum+=h[u].$value,e.set.push(h[u]),a=c,u++;else{this.ZD(e);var f={top:e.top,left:e.left,dx:e.dx,dy:e.dy,set:[],sum:0},l=e.sum/e.dim;e.dx>e.dy?(f.left+=l,f.dx-=l):(f.top+=l,f.dy-=l),(e=f).dim=Math.min(e.dx,e.dy),a=Infinity}}}e&&this.ZD(e)},ZD:function(t){var i,e,s,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++)e=t.set[i].id,n=t.mode?(s=t.contra,t.set[i].$value/t.contra):(s=t.set[i].$value/t.contra,t.contra),this.$xy[e]={},this.$xy[e].top=h,this.$xy[e].left=r,t.mode?h+=n:r+=s,this.$xy[e].width=s,this.$xy[e].height=n,this.Ui+=this.sf(this.getItem(e)),this.J.subRender&&this.data.branch[e]&&this.xC(e)},KD:function(t,i){var e=t.sum+i.$value,s=e*e/(t.dim*t.dim*i.$value);return t.set.length&&(s=Math.max(t.dim*t.dim*t.set[0].$value/(e*e),s)),1<s?s:1/s},ac:function(t){return this.qD.innerHTML=this.sf(t),this.qD.firstChild},showBranch:function(t){this.J.branch=t,this.refresh()},render:function(t,i,e){if(this.isVisible(this.J.id)&&!this.$blockRender){if("update"==e){var s=this.getItemNode(t);if(s)X(this.Li[t]=this.ac(i),s),G(s)}else!this.data.branch||this.J.branch&&!this.data.branch[this.J.branch]||(this.Li=null,this.callEvent("onBeforeRender",[]),this.xC(),this.mt.innerHTML=this.Ui,this.callEvent("onAfterRender",[]));return!0}},Xo:"webix_dm_id",on_click:{webix_treemap_item:function(t,i){this.J.select&&("multiselect"==this.J.select||this.J.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.J.multiselect,t.shiftKey):this.select(i)),this.J.activeItem&&this.isBranch(i)&&this.showBranch(i)},webix_treemap_header_item:function(t){var i=q(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:{},QD:function(t){var i="";for(var e in t)i+=e+":"+t[e]+";";return i},type:{template:It("#value#"),header:function(t,i){for(var e=t.id,
s="<div role='button' tabindex='0' aria-label='"+ct.aria.resetTreeMap+"' class='webix_treemap_reset'></div>",n=[];e;)t=this.getItem(e),n.push(i.headerItem.call(this,t,i)),e=this.getParentId(e);return n.reverse(),s+n.join("<span class='webix_icon wxi-angle-right webix_treemap_path_icon'></span>")},headerItem:function(t){var i=this.config.headerTemplate(t),e='<a role="button" tabindex="0" aria-label="'+i+'" webix_dm_header_id="'+t.id+'" class="webix_treemap_header_item">';return e+=i,e+="</a>"},classname:function(t,i,e){var s="webix_treemap_item";i.css&&(s+=" "+i.css),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),s+=" "+t.$css);var n=this.$xy[t.id];e&&e.$css&&(s+=" "+e.$css),s+=" webix_treemap_level_"+this.getItem(t.id).$level;var h=this.getParentId(t.id);if(h&&h!=this.J.branch||(s+=" webix_treemap_level_top"),this.$height-n.top-n.height<1&&(s+=" webix_treemap_item_bottom"),this.$width-n.left-n.width<1&&(s+=" webix_treemap_item_right"),i.cssClass){var r=i.cssClass.call(this,t,i,e);r&&("object"==k(r)?s+=" "+L(r):s+=" "+r)}return s},templateStart:function(t,i,e){var s="";if(this.$xy){var n=this.$xy[t.id];s+="width: "+n.width+"px; height: "+n.height+"px;",s+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div role="treeitem" aria-level="'+t.$level+'" '+(e&&e.webix_selected?'aria-selected="true" tabindex="0"':"")+' webix_dm_id="'+t.id+'" class="'+i.classname.call(this,t,i,e)+'" style="'+s+'">'},templateEnd:It("</div>")}},wo=(H.protoUI(go,Fe,cs,Ye,Be,Pe,Ue,ls,Gh.view,vs,ue,g),{name:"dataview",$init:function(t){t.sizeToContent&&this.$ready.unshift(this.hr);var i=t.type||t.item;t.prerender||this.defaults.prerender||i&&"auto"==i.width||"move"==t.drag||"order"==t.drag||t.autoheight||H.extend(this,ys,!0),t.autoheight&&(t.scroll=!1),i&&"tiles"==i.type&&(this.st.firstChild.style.padding="8px",this.tA=8),this.Yi.className+=" webix_dataview",this.st.setAttribute("role","listbox")},hr: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},Xo:"webix_l_id",ah:"webix_dataview_item",tA:0,Yo:"x",on_click:{webix_dataview_item:function(t,i){this.J.select&&("multiselect"==this.J.select||this.J.multiselect?this.select(i,!1,"touch"==this.J.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i))}},on_dblclick:{},on_mouse_move:{},type:{template:It("#value#"),templateLoading:It("Loading..."),width:160,height:50,classname:function(t,i,e){var s="webix_dataview_item";return i.css&&(s+=" "+i.css),i.type&&"tiles"==i.type.toString()&&(s+=" tiles "),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),s+=" "+t.$css),e&&e.$css&&(s+=" "+e.$css),s},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,e){return'role="option"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')},templateStart:It('<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:It("{common.tilesEnd()}</div>")},iA:function(t){return this.J.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.Yi.style.overflowY="hidden"),t},$getSize:function(t,i){0<this.J.xCount&&"auto"!=this.type.width&&!this.eA&&(this.J.width=this.type.width*this.J.xCount+(this.ge?S.scrollSize:0)),this.J.yCount&&"auto"!=this.type.height&&(this.J.height=this.type.height*this.J.yCount);var e=this.J.width||this.be;return this.J.autoheight&&e&&(this.iA(e),this.scroll_setter(!1)),Li.api.$getSize.call(this,t,i)},sA:function(){var t=!1;return this.J.yCount&&"auto"==this.type.height&&(this.type.height=Math.floor((this.we-this.tA)/this.J.yCount),t=!0),this.J.xCount&&("auto"==this.type.width||this.eA)?(this.eA=!0
,this.type.width=Math.floor((this.be-2*this.tA)/this.J.xCount),t=!0):this.eA=!1,t},$setSize:function(t,i){if(Li.api.$setSize.call(this,t,i)){if(this.J.autoheight&&this.iA()!=this.we)return $(this.resize,this);(this.sA()||this.Nf)&&this.render()}}});H.protoUI(wo,de,ye,Pe,Be,Ye,Ue,ce,Gh.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 xo={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.J,this.mt=this.st,this.st.className+=" webix_pager"+(t.autowidth?" webix_pager_auto":""),!1!==t.master&&0!==t.master||this.$ready.push(this.nA)},nA: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.J.page+1;break;case"prev":t=this.J.page-1;break;case"first":t=0;break;case"last":t=this.J.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.J.animate&&this.Pk(i,1*t,this.J.animate)||this.$master.refresh()),this.callEvent("onAfterPageChange",[t]))},Xo:"webix_p_id",template_setter:It,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 e=t.$min||0;e<=t.$max;e++)i+=this.button({id:e,index:e+1,selected:e==t.page?"_selected":"",label:ct.aria.page+" "+(e+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:It("<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=zt(t)),((this.rA=t).$master=this).hA()},refresh:function(){var t=this.J;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.hA(),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},hA:function(){this.rA&&(this.rA.J.count=this.J.count,this.rA.J.page=this.J.page,this.rA.refresh())},Pk:function(t,i,e){if(t==i)return!1;if(this.oA)return this.aA&&window.clearTimeout(this.aA),this.aA=$(this.Pk,this,[t,i,e],100);var s=t<i?"left":"right";"top"!=e.direction&&"bottom"!=e.direction||(s=t<i?"top":"bottom"),e.flip&&(s="");var n=0,h=this.$master.mt,r=!!this.$master.Wt;r&&(n=(h=this.$master.Wt).offsetTop,et(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!==e?e:{},c=H.extend({direction:s,callback:C(function(){c.callback=null,Gi.breakLine(o),this.oA=!1,this.$master.Wt&&st(this.$master.$view,"webix_animation")},this),top:n,keepViews:r},u);o=Gi.formLine(h,a,c),Gi([h,a],c),this.oA=!0}},yo=(H.protoUI(xo,Pe,Oi,Li.view,g),{name:"comments",defaults:{sendAction:"click",mode:"comments",moreButton:It(ct.comments.moreComments)},$init:function(t){this.$view.className+=" webix_comments",t.rows=[this.uA(t)],
t.readonly||t.rows.push(this.cA()),this.ht=[],this.fA(t.users),this.lA(),this.$ready.push(this.wC)},$exportView:function(){return this.dA},wC:function(){var e=this;this.dA=this.queryView({view:"list"}),this.vA=this.queryView({view:"form"}),this._A=this.queryView({view:"button"}),this.pA=this.queryView({view:"textarea"}),this.dA.data.provideApi(this,!0),this.serialize=function(){var t=e.dA.serialize(),i=e.getIndexById("$more");return 0<=i&&t.splice(i,1),t},this.mA=T("onClick",function(t){var i=Pt(t);i==e.pA?(e.bA(!0),$(function(){e.pA.focus()})):i===e._A||i===e.gA||t&&-1!==(t.target.className||"").toString().indexOf("webix_comments_menu")||e.bA()}),this.attachEvent("onDestruct",function(){F(this.mA)})},$onLoad:function(t,i){this.wA(t,i)},wA:function(t,i){var e=this,s=this.dA||this.queryView({view:"list"});s.data.driver=i;var n=t.more;if(t=i.getRecords(t),this.xA){if(this.xA=!1,t.length){var h=s.data.order,r=1;if("chat"==this.J.mode)s.data.order=p([h[0]].concat(new Array(t.length),h.slice(1)));else{var o=s.getIndexById("$more");s.data.order=p(h.slice(0,o).concat(new Array(t.length),h.slice(o))),r=o}s.parse({data:t,pos:r}),n&&me(this.dA).ignore(function(){e.dA.updateItem("$more",{value:n})}),"chat"==this.J.mode&&s.showItem(s.getIdByIndex(t.length))}t.length&&n||me(this.dA).ignore(function(){e.dA.remove("$more")})}else n&&!s.exists("$more")&&(n={id:"$more",value:n},"chat"==this.J.mode?t.unshift(n):t.push(n)),s.parse(t),"chat"==this.J.mode&&s.showItem(s.getLastId())},$skin:function(){this.gm=Xi.inputHeight+6},getUsers:function(){return this.yA},getMenu:function(){return this.gA},setCurrentUser:function(t){this.config.currentUser=t,this.vA.clear(),this.dA.refresh()},edit:function(t){if(this.callEvent("onBeforeEditStart",[t])){this.bA(!0);var i=this.dA.getItem(t);this.vA.setValues(i),this.vA.focus();var e=this.vA.elements.text.getInputNode();e.scrollTop=e.scrollHeight,ot(e,i.text.length),this.callEvent("onAfterEditStart",[t])}},MA:function(t){var i=this.vA.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.dA.scrollTo(0,this.dA.getLastId())),this.vA.clear(),t&&(this.pA.getInputNode().value=""))},SA:function(t){this.vA.getValues().id==t&&this.vA.clear(),this.remove(t)},bA:function(t){if(!S.touch){var i=this.pA;t?(this._A.getParentView().show(),i.define({height:84})):(Ai.hasFocus(this._A)&&Ai.setFocus(this.dA),this._A.getParentView().hide(),i.define({height:this.gm})),i.resize()}},kA:function(t){t||(t=this.pA.getValue()),t&&!this._A.isEnabled()?this._A.enable():!t&&this._A.isEnabled()&&this._A.disable()},lA:function(){var e=this;this.gA=zt({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=e.gA.getContext();e.dA.addCss(t.id,"active_menu")},onHide:function(){var t=e.gA.getContext();e.dA.removeCss(t.id,"active_menu")},onItemClick:function(t){var i=e.gA.getContext();e.callEvent("onBeforeMenuAction",[t,i.id])&&("edit"==t?e.edit(i.id):"remove"==t&&(ct.comments.confirmMessage?Js({text:ct.comments.confirmMessage,callback:function(t){t&&e.SA(i.id)}}):e.SA(i.id)))}}}),this.ht.push(this.gA)},cA:function(){var n=this,t=ct.comments;return{view:"form",minHeight:50,paddingX:10,elements:[{view:"textarea",css:"webix_comments_textarea",height:this.gm,name:"text",placeholder:t.placeholder,keyPressTimeout:100,on:{onTimedKeyPress:function(){n.kA()},onChange:function(t){n.kA(t)},onKeyPress:function(t,i){if(13==t){var e=n.J.sendAction,s=i.shiftKey;("enter"==e&&!s||"enter"!==e&&s)&&(Q(i),n.MA(!0))}}}},{hidden:!S.touch,cols:[{},{view:"button",disabled:!0,css:"webix_comments_send",type:"form",value:t.send,autowidth:!0,click:function(){n.MA()}}]}]}},uA:function(t){var r=this,o="webix_comments_",e={height:"auto",templateStatus:function(t){return"<span class = '"+o+"status "+t.status+"'></span>"},templateUser:function(t){var i=r.getUsers(),e=i&&i.exists(t.user_id)?i.getItem(t.user_id):{};return"<span class = '"+o+"name'>"+(
e.value||"")+"</span>"},templateMenu:function(){return"<span class='webix_icon wxi-dots "+o+"menu'></span>"},templateDate:function(t){var i=tn.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=It.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 e="<div class='"+o+"avatar'>",s=r.getUsers(),n=s&&s.exists(t.user_id)?s.getItem(t.user_id):{};if(n.status&&(e+=i.templateStatus(n)),e+="<div class='"+o+"avatar_image ",n.image)e+="'><img src = '"+n.image+"' class='"+o+"photo'>";else{var h=n.value?n.value[0].toUpperCase():"<span class='webix_icon wxi-user'></span>";e+=o+"avatar_text'>"+h}return e+="</div></div>"},template:function(t,i){var e;if("$more"==t.id)e="<div class='webix_comments_more'>"+r.J.moreButton(t)+"</div>";else{var s=i.templateAvatar(t,i),n=i.templateUser(t,i),h=i.templateDate(t,i);e=s+n+i.templateMenu(t,i)+h+i.templateText(t,i)}return e},classname:function(t,i,e){var s=qh.api.type.classname(t,i,e);return(t.user_id&&t.user_id==r.J.currentUser||!r.yA.count())&&(s+=" webix_comments_current"),s}};e=H.extend(e,t.listItem||{},!0);var i={$init:function(t){t.date&&(t.date=ct.parseFormatDate(t.date))}};i=H.extend(i,t.scheme||{},!0);var s={view:"list",navigation:!1,type:e,scheme:i,onClick:{webix_comments_menu:function(t,i){r.gA.isVisible()?r.gA.hide():(r.gA.setContext({obj:r,id:i}),r.gA.show(t.target,e.menuPosition||{pos:"left",y:30,x:10}))},webix_comments_more:function(){if(r.config.url&&r.callEvent("onDataRequest",[])){r.xA=!0;var t=r.dA.getItem("$more").value,i="chat"==r.J.mode?t:r.dA.getIndexById("$more"),e=fi.$parse(r.config.url),s={error:function(){r.xA=!1}};"string"==typeof e&&(e=e+(e.indexOf("?")<0?"?":"&")+"pos="+i+"&more="+t),r.load(e,s,{pos:i,more:t})}}},on:{onAfterScroll:C(function(){this.gA.hide()},this)}};return t.save&&(s.save=t.save),s},fA:function(t){var i=this;t&&t.getItem?this.yA=t:(this.yA=new $h,this.ht.push(this.yA),t&&"string"==typeof t?this.yA.load(t):this.yA.parse(t||[])),this.yA.data.attachEvent("onStoreUpdated",function(){i.dA.refresh()})}}),Mo=(H.protoUI(yo,li,Cn.view),{name:"menu",cb:"webix_menu",$init:function(t){this.data.Hr=C(function(t){t.disabled&&this.data.addMark(t.id,"webix_disabled",!0,1,!0)},this),t.autowidth&&(this.CA=!0,delete t.autowidth),this.data.attachEvent("onStoreUpdated",C(function(){this.vu()},this)),this.attachEvent("onMouseMove",this.$A),this.attachEvent("onMouseOut",function(t){this.DA()&&"click"==this.J.openAction||!this.AA&&t.relatedTarget&&this.vu()}),this.attachEvent("onItemClick",function(t,i,e){var s=this.getItem(t);if(s){if(s.$template)return;var n=this.getTopMenu();if(!this.data.getMark(t,"webix_disabled")){if(!n.callEvent("onMenuItemClick",[t,i,e]))return void(i.showpopup=!0);this!=n&&n.oc(t,i,e),s.submenu||n.IA?(this!==n&&!S.touch||"click"!=n.J.openAction||this.pu(t,e),i.showpopup=!0):(n.vu(!0),n.TA&&n.hide())}}}),this.attachEvent("onKeyPress",function(t){if(9===t)this.getTopMenu().vu();else if(13===t||32===t){var i,e=this.getSelectedId();e&&(i=this.getItemNode(e)),i&&it(i,"MouseEvents","click")}}),this.data.attachEvent("onClearAll",function(){this.FA=[]}),this.data.FA=[],this.st.setAttribute("role","menubar"),this.ht=[]},sizeToContent:function(){if("y"==this.J.layout){var i=[],e=!1;this.data.each(function(t){i.push(this.Ot(t)),t.submenu&&(e=!0)},this),this.config.width=nt(i,this.$view.className).width+16+2+(e?15:0),this.resize()}},getTopMenu:function(){for(var t=this;t.du;)t=Pt(t.du);return t},_b:function(t){this.J.autoheight&&(t=this.count());for(var i=this.count(),e=0,s=0;s<t;s++){var n=this.data.pull[this.data.order[s]];n&&"Separator"==n.$template?(e+=4,this.J.autoheight||t++):e+=this.type.height}return this.vc(t&&t<i,"y"),e},on_mouse_move:{},type:{zA:function(t){return t.submenu||t.data||t.item},
css:"menu",width:"auto",aria:function(t,i,e){return'role="menuitem"'+(e&&e.webix_selected?' aria-selected="true" tabindex="0"':'tabindex="-1"')+(i.zA(t)?'aria-haspopup="true"':"")+(e&&e.webix_disabled?' aria-disabled="true"':"")},templateStart:function(t,i,e){if("Separator"===t.$template||"Spacer"===t.$template)return'<div webix_l_id="#id#" role="separator" tabindex="-1" class="webix_context_'+t.$template.toLowerCase()+'">';var s=(t.href?" href='"+t.href+"' ":"")+(t.target?" target='"+t.target+"' ":"");return qh.api.type.templateStart(t,i,e).replace(/^<div/,"<a "+s)+(i.zA(t)&&i.subsign?"<div class='webix_submenu_icon'></div>":"")},templateEnd:function(t){return"Separator"===t.$template||"Spacer"===t.$template?"</div>":"</a>"},templateSeparator:It("<div class='sep_line'></div>"),templateSpacer:It("<div></div>")},getMenu:function(t){if(this.data.pull[t])return this;for(var i in this.data.pull){var e=this.getItem(i);if(e.submenu){var s=this.VA(e).getMenu(t);if(s)return s}}},getSubMenu:function(t){var i=this.getMenu(t),e=i.getItem(t);return e.submenu?i.VA(e):null},getMenuItem:function(t){return this.getMenu(t).getItem(t)},VA:function(t){var i=Pt(t.submenu);return i||(t.submenu=this.HA(t),i=Pt(t.submenu)),i},$A:function(t,i,e){this.DA()&&this.pu(t,e)},DA:function(){var t=this.getTopMenu();if("click"!=t.J.openAction)return!0;if(S.touch)return!1;var i=t.BA;return!(!i||!Pt(i).isVisible())},pu:function(t,i){var e=this.getItem(t);if(e&&(this.AA=null,this.BA&&e.submenu!=this.BA&&this.vu(!0),this.type.zA(e)&&!this.config.hidden)){var s=this.VA(e);if(this.data.getMark(t,"webix_disabled"))return;s.show(i,{pos:this.J.subMenuPos}),s.du=this.J.id,this.BA=e.submenu}},disableItem:function(t){this.getMenu(t).addCss(t,"webix_disabled")},enableItem:function(t){this.getMenu(t).removeCss(t,"webix_disabled")},RA:function(t,i){var e=this.data;e.FA[t]!=i&&(e.FA[t]=i,e.filter(function(t){return!e.FA[t.id]}),this.resize())},hideItem:function(t){var i=this.getMenu(t);i&&i.RA(t,!0)},showItem:function(t){var i=this.getMenu(t);if(i)return i.RA(t,!1),qh.api.showItem.call(i,t)},vu:function(t){if(this.BA){var i=Pt(this.BA);i.vu&&i.vu(t),!t&&i.Jn||(i.hide(),this.BA=null)}},HA:function(t){var i={view:"submenu",data:this.type.zA(t)},e=this.getTopMenu().J.submenuConfig;e&&H.extend(i,e,!0);var s=this.getMenuItem(t.id);s&&s.config&&H.extend(i,s.config,!0);var n=zt(i);return this.ht.push(n),n.du=this,n.J.id},_u:function(t,i,e){var s=this.getItem(t);if("Separator"==s.$template||"Spacer"==s.$template||this.data.getMark(t,"webix_disabled")){var n=this.getIndexById(t)+("up"==e?-1:1);return(t=0<=n?this.getIdByIndex(n):null)?this._u(t,i,e):i}return t},$skin:function(){qh.api.$skin.call(this),this.type.height=Xi.menuHeight},defaults:{scroll:"",layout:"x",mouseEventDelay:100,subMenuPos:"bottom"}}),So={api:Mo,view:H.protoUI(Mo,qh.view)},ko={name:"submenu",$init:function(){this.K=f(this.PA),(this.K.rt=this).attachEvent("onMouseOut",function(t){"click"!=this.getTopMenu().J.openAction&&(this.AA||this.Jn||!t.relatedTarget||this.hide())}),this.attachEvent("onMouseMoving",function(){this.du&&(Pt(this.du).AA=!0)}),this.attachEvent("onBeforeShow",function(){this.getTopMenu().CA&&this.sizeToContent&&!this.isVisible()&&this.sizeToContent()}),this.mt.setAttribute("role","menu")},$skin:function(){So.api.$skin.call(this),ih.api.$skin.call(this),this.type.height=Xi.menuHeight},PA:{$getSize:function(t,i){var e=1*this.rt.J.height,s=1*this.rt.J.width,n=So.api.$getSize.call(this.rt,t,i);return this.rt.J.height=e,this.rt.J.width=s,n},$setSize:function(t,i){this.rt.J.scroll&&(this.rt.zn.style.height=i+"px")},destructor:function(){this.rt=null}},body_setter:function(){},getChildViews:function(){return[]},defaults:{width:150,subMenuPos:"right",layout:"y",autoheight:!0},type:{height:Xi.menuHeight,subsign:!0}},Co={api:ko,view:H.protoUI(ko,So.view,ih.view)},$o={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.J.position
;return i&&st(this.$view," webix_sidemenu_"+i),et(this.$view," webix_sidemenu_"+t),t},$getSize:function(){var t=re.api.$getSize.apply(this,arguments);return this.jA=t},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),t=this.be-2*this.J.padding,i=this.we-2*this.J.padding,this.Yi.style.padding=this.J.padding+"px",this.pn.style.display="none",this.zn.style.height=i+"px",this.K.$setSize(t,i)},show:function(){if(!this.callEvent("onBeforeShow",arguments))return!1;this.J.hidden=!1,this.st.style.zIndex=this.J.zIndex||yi(),(this.J.modal||this.Hn)&&(this.mn(!0),this.Hn=null),this.st.style.display="block",this.Me(),this.J.position&&this.jn(),this.En=1,$(function(){this.En=0},this,[],S.touch?400:100),this.config.autofocus&&(this.Nn=Ai.getFocus(),Ai.setFocus(this)),-1==M.Wi.find(this)&&M.Wi.push(this),this.callEvent("onShow",[])},jn:function(t){var i,e,s,n,h,r=0,o=0,a={};this.$view.style.position="fixed",s=document.documentElement.offsetWidth,n=document.documentElement.offsetHeight,i=this.jA[0]||s,e=this.jA[2]||n,"top"==(h=this.J.position)?i=s:"right"==h?(e=n,r=s-i):"bottom"==h?(i=s,o=n-e):e=n,a={left:r,top:o,width:i,height:e,maxWidth:s,maxHeight:n},"function"==typeof this.J.state&&this.J.state.call(this,a),this.EA=a,this.$setSize(a.width,a.height),void 0===t&&this.NA()?(st(this.$view,"webix_animate"),this.Pk[this.J.position].beforeShow.call(this,a),$(function(){et(this.$view,"webix_animate",!0)},this,null,1),$(function(){this.Pk[this.J.position].show.call(this,a)},this,null,10)):("right"===this.J.position&&(a.left=a.right?s-a.width-a.right:s-a.width),this.setPosition(a.left,a.top))},NA:function(){return Gi.isSupported()&&this.J.animate&&!(S.isIE&&-1!=navigator.appVersion.indexOf("MSIE 9"))},hidden_setter:function(t){return t?this.hide(!0):this.show(),!!t},Pk:{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.zn.style.height="0px"},show:function(t){this.$view.style.height=t.height+"px",this.zn.style.height=t.height+"px"},hide:function(){this.$view.style.height="0px",this.zn.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.J.modal&&this.mn(!1);var i=document.documentElement.offsetWidth,e=document.documentElement.offsetHeight;if(!t&&this.NA()&&i==this.EA.maxWidth&&e==this.EA.maxHeight){this.Pk[this.J.position].hide.call(this,this.EA);var s=Lt(this.$view,S.transitionEnd,C(function(){this.Ln(),Ot(s)},this))}else this.Ln();if(this.J.autofocus){var n=document.activeElement;n&&this.st&&this.st.contains(n)&&(Ai.setFocus(this.Nn),this.Nn=null)}this.On()}}},Do=(H.protoUI($o,ih.view),{name:"sidebar",defaults:{type:"sideBar",activeTitle:!0,select:!0,scroll:!1,collapsed:!1,collapsedWidth:44,position:"left",width:250,mouseEventDelay:10},$skin:function(){this.defaults.titleHeight=Xi.sidebarTitleHeight},$init:function(){this.$view.className+=" webix_sidebar",this.$ready.push(this.LA),this.$ready.push(this.OA),this.data.Hr=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.UA=this.config.width,this.attachEvent("onBeforeOpen",function(t){if(!this.config.multipleOpen)for(var i=this.getOpenItems(),e=0;e<i.length;e++)this.getParentId(t)==this.getParentId(i[e])&&this.close(i[e]);return!this.config.collapsed}),this.attachEvent(
"onItemClick",function(t,i,e){this.getPopup()&&!this.getPopup().config.hidden&&(i.showpopup=!0),S.touch&&this.YA(t,e)}),this.attachEvent("onBeforeSelect",function(t){return!this.getItem(t).$count&&(this.clearCss("webix_sidebar_selected"),!0)}),this.attachEvent("onAfterSelect",function(t){this.WA(this,t,!Xi.sidebarMarkAll),this.getPopup().GA(t)}),this.attachEvent("onMouseMove",function(t,i,e){this.YA(t,e)}),this.config.collapsed&&this.collapse()},YA:function(t,i){if(this.config.collapsed){var e=this.getPopup();e&&(this.XA(t),this.qA(t),e.show(i,{x:"left"==this.config.position?this.config.collapsedWidth:-e.config.width,y:-1}))}},XA:function(t){var i=this.getPopup().getBody().getChildViews()[0];if(i&&i.masterId!=t){var e=this.getSelectedId();i.masterId=t,i.parse(this.getItem(t)),e&&this.getParentId(e)==t?et(i.$view,"webix_sidebar_selected",!0):st(i.$view,"webix_sidebar_selected"),e==t?et(i.$view,"webix_selected",!0):st(i.$view,"webix_selected")}},qA:function(t){var i=this.getPopup().getBody().getChildViews()[1];if(i&&i.masterId!=t){this.exists(i.masterId)&&this.getItem(i.masterId).menu&&this.updateItem(i.masterId,{menu:i.data.serialize()}),i.clearCss("webix_sidebar_selected"),i.masterId=t;var e=this.getSelectedId(),s=B(this.getItem(t).menu||[]);i.unselect(),s.length?(i.show(),i.data.importData(s),i.exists(e)?i.select(e):e&&this.WA(i,e)):(i.hide(),i.data.clearAll())}},OA:function(){var e,n=this,s=n.config;if(s.popup&&(e=Pt(s.popup)),!e){var t="left"==s.position?"webix_sidebar_popup_left":"webix_sidebar_popup_right",i="left"==s.position?"right":"left",h=function(t){var i="wxi-angle-"+("left"==s.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+" "+s.css,autofit:!1,width:this.UA-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+" "+s.css,template:h,type:{subsign:!1},submenuConfig:{padding:0,subMenuPos:i,template:h,select:!0,type:{subsign:!1},css:"webix_sidebar_popup_list "+t+" "+s.css,on:{onShow:function(){this.clearCss("webix_sidebar_selected"),this.unselectAll();var t=n.getSelectedId();t&&this.exists(t)?this.select(t):t&&n.WA(this,t)},onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onAfterSelect:function(t){for(var i=n.getPopup().queryView({view:"menu"}),e=n.getParentId(t);e;){var s=i.getMenu(e);s&&(s.unselectAll(),n.WA(s,t)),e=n.getParentId(e)}n.WA(this,t)}}},on:{onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onMenuItemClick:function(t){this.getSubMenu(t)||n.select(t)}}}]}};H.extend(r,s.popup||{},!0),(e=zt(r)).GA=function(t){if(n&&n.getParentId(t)==this.masterId&&et(this.$view,"webix_sidebar_selected",!0),n.config.collapsed&&1==n.getItem(t).$level){var i=e.getBody().getChildViews()[0];i&&et(i.$view,"webix_selected",!0)}},e.queryView({view:"menu"}).IA=!0}e.attachEvent("onBeforeShow",function(){return s.collapsed}),this.ht=[e],s.popupId=e.config.id,Nt(document.body,"mousemove",function(t){var i=t.target||t.srcElement;e.config.hidden||e.$view.contains(i)||this.$view.firstChild.contains(i)||e.queryView({view:"menu"}).BA||e.hide()},{bind:this})},WA:function(i,e,s){var n="webix_sidebar_selected";i.data.each(function(t){!this.JA(e,t.id)||s&&"0"!=this.getParentId(t.id)?i.hasCss(t.id,n)&&i.removeCss(t.id,n):i.addCss(t.id,n)},this)},JA:function(t,i){var e=this.getParentId(t);return i==e||!!e&&this.JA(e,i)},getPopup:function(){return Pt(this.config.popupId)},position_setter:function(t){var i=t,e="left"==t?"right":"left";st(this.$view,"webix_sidebar_"+e),et(this.$view,"webix_sidebar_"+i,!0);var s=this.getPopup();if(s){var n=s.$view;st(n,"webix_sidebar_popup_"+e),et(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,st(this.$view,"webix_sidebar_expanded")):(i=this.UA,this.type.collapsed=!1,et(this.$view,"webix_sidebar_expanded",!0)),this.define("width",i),this.resize(),t},getState:function(){var t={collapsed:this.config.collapsed};return H.extend(t,cs.getState.call(this)),t},setState:function(t){cs.setState.call(this,t),this.define("collapsed",t.collapsed)}});Tt(bo.view,{name:"sideBar",height:"auto",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="",e=1;e<=t.$level;e++){if(e==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(Do,bo.view),H.protoUI({name:"context"},oe,ih.view);var Ao={name:"contextmenu",TA:!0,$init:function(t){t.submenuConfig&&H.extend(t,t.submenuConfig)}},Io=(H.protoUI(Ao,oe,Co.view),{name:"treetable",$init:function(){for(var t in H.extend(this.data,ps,!0),H.extend(this.type,bs),H.extend(this,ds,!0),fs)this.on_click[t]||(this.on_click[t]=this.KA(fs[t]));this.type.treetable=It("{common.space()}{common.icon()} {common.folder()}"),this.type.treecheckbox=function(t){return t.indeterminate&&!t.nocheckbox?"<div class='webix_tree_checkbox webix_indeterminate'></div>":bs.checkbox.apply(this,arguments)},this.data.provideApi(this,!0),this.st.setAttribute("role","treegrid")},No:!1,KA:function(e){return function(t,i){return i=i.row,e.call(this,t,i)}},jo:function(t){for(var i=this.J.prerender?t.source:[t.start],e=0;e<i.length;e++)this.close(i[e])},getState:function(){var t=xe.getState.call(this);return H.extend(t,cs.getState.call(this)),t},setState:function(t){cs.setState.call(this,t)&&xe.setState.call(this,t)},clipboard_setter:function(t){return H.extend(this.Qn,ms),us.clipboard_setter.call(this,t)},Qf:function(t,i){for(var e=0;e<t.start;e++){var s=this.data.order[e];s&&1!=this.getItem(s).$level&&t.start--}return zr.api.Qf.call(this,t,i)}}),To=(H.protoUI(Io,cs,_s,ls,zr.view),H.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(t){this.data=t||{};var i=t&&t.id?t.id:z();this.J={id:i},zt.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,Bi,li,Ii)),Fo=H.proto({name:"DataValue",isVisible:function(){return!0},$init:function(t){t&&!x(t.value)||(this.data=t||"");var i=t&&t.id?t.id:z();this.J={id:i},zt.views[i]=this},setValue:function(t){this.data=t,this.callEvent("onChange",[t])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},g,Bi),zo=H.proto({name:"TreeCollection",$init:function(){H.extend(this.data,ps,!0),this.data.provideApi(this,!0),H.extend(this,ds,!0)}},ls,$h);H.Date=tn,H.Number=en,H.promise=mt,H.DataCollection=$h,H.DataRecord=To,H.DataValue=Fo,H.TreeCollection=zo,H.ActiveContent=Ut,H.AtomDataLoader=li,H.AtomRender=di,H.AutoScroll=vi,H.AutoTooltip=Yi,H.BaseBind=Bi,H.BindSource=Hi,H.Canvas=Wi,H.CodeParser=xt,H.CollectionBind=Fi,H.ContextHelper=oe,H.CopyPaste=ue,H.CustomPrint=ce,H.CustomScroll=fe,H.DataMarks=le,H.DataMove=de,H.DataLoader=we,H.DataState=xe,H.DataStore=ge,H.Destruction=Ti,H.DragControl=ie,H.DragItem=ye,H.DragOrder=Me,H.EditAbility=De,H.EventSystem=g,H.FlexLayout=Ae,H.Group=Fe,H.GroupMethods=Ie,H.GroupStore=Te,H.HTMLOptions=ze,H.HtmlMap=Ve,H.IdSpace=He,H.KeysNavigation=Be,H.MapCollection=Re,H.Modality=se,H.MouseEvents=Pe,H.Movable=ee,H.NavigationButtons=je,H.OverlayBox=Ee,H.PagingAbility=Ne,H.ProgressBar=Le,H.RecordBind=Vi,H.RenderStack=Oe,H.ResizeArea=ne,H.SingleRender=Oi,H.Scrollable=Ue,H.SelectionModel=Ye,
H.Settings=Ii,H.Sparklines=os,H.TablePaste=us,H.TooltipControl=_i,H.Touch=Zi,H.TreeAPI=cs,H.TreeClick=fs,H.TreeDataLoader=ls,H.TreeDataMove=ds,H.TreeRenderStack=vs,H.TreeStateCheckbox=_s,H.TreeStore=ps,H.TreeTablePaste=ms,H.TreeType=bs,H.UIManager=Ai,H.Undo=Se,H.UploadDriver=gs,H.ValidateCollection=ws,H.ValidateData=_e,H.ValueBind=zi,H.Values=xs,H.VirtualRenderStack=ys,H.VRenderStack=Ms,H.html=dn,H.skin=Ki,H.debug=function Eo(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=We,H.csv=as,H.clipbuffer=ae,H.history=nn,H.storage=ri,H.template=It,H.type=Tt,H.markup=hn,H.editors=$e,H.animate=Gi,H.print=function(t,i){var e=Pt(t);e&&e.$printView&&(e=e.$printView()),e&&(e.callEvent&&e.callEvent("onBeforePrint",[i]),function s(t){et(document.body,"webix_print"),t.docHeader&&fn("Header",t),t.docFooter&&fn("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=on[(t.paper||"").toLowerCase()]||"A4",t.mode=un[t.mode]?t.mode:"portrait",t.fit=an[t.fit]?t.fit:"page",t.scroll=t.scroll||!1,t.size=cn[t.paper],t.margin=t.margin||0===t.margin?t.margin:{},rn=isNaN(1*t.margin)?rn:t.margin,t.margin={top:t.margin.top||0===t.margin.top?t.margin.top:rn,bottom:t.margin.bottom||0===t.margin.bottom?t.margin.bottom:rn,right:t.margin.right||0===t.margin.right?t.margin.right:rn,left:t.margin.left||0===t.margin.left?t.margin.left:rn},t}(i)),e.$customPrint&&!0!==e.$customPrint(i)||function r(t,i){var e=t.$view.cloneNode(!0),s=t.$view.getElementsByTagName("canvas");if(s.length)for(var n=s.length-1;0<=n;n--){var h=e.getElementsByTagName("canvas")[n].getContext("2d");h.drawImage(s[n],0,0)}X(e,i.docFooter,document.body),et(e,"webix_ui_print"),!i.scroll&&(t.mt&&t.data&&t.data.pull||t.getBody)&&et(e,"webix_print_noscroll"),window.print(),G(e)}(e,i),function h(t){st(document.body,"webix_print"),U("print"),t.docHeader&&G(t.docHeader),t.docFooter&&G(t.docFooter)}(i))},H.rules=ve,H.patterns=ln,H.version="6.2.1",H.name="core",H.level_in=function No(){0},H.level_out=function Lo(){0},H.clone=f,H.copy=B,H.single=function Oo(t){var i=null;return function(){return i||(i=new t({})),i.ZA&&i.ZA.apply(i,arguments),i}},H.bind=C,H.exec=v,H.wrap=function Uo(i,e){return i?function(){var t=i.apply(this,arguments);return e.apply(this,arguments),t}:e},H.isUndefined=x,H.delay=$,H.once=l,H.uid=z,H.toNode=D,H.toArray=p,H.toFunctor=m,H.isArray=b,H.isDate=y,H.PowerArray=A,H.QA=Et,H.tI=Nt,H.event=Lt,H.eventRemove=Ot,H.callEvent=I,H.attachEvent=T,H.detachEvent=F,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(s,n){var h=mt.defer();return si(S.cdn+"/extras/html2canvas-1.0.min.js").then(function(){"string"==typeof n&&(n={filename:n}),n=n||{};var t=Pt(s);if(t&&t.$exportView&&(t=t.$exportView(n)),!t)return h.reject(Ss);var i=t?t.$view:D(s),e=(n.filename||"Data")+".png";return window.html2canvas(i,{background:"#fff",logging:!1}).then(function(i){var t=function(t){!1!==n.download&&ht(t,e),i.remove(),h.resolve(t)};i.msToBlob?t(i.msToBlob()):i.toBlob(t,"image/png")}),h})},H.toCSV=function(t,i){i=i||{};var e=Pt(t);if(e&&e.$exportView&&(e=e.$exportView(i)),!e)return mt.reject(Ss);i.export_mode="csv",i.filterHTML=!0;var s=Cs(e,i),n=function o(t){return as.stringify(t)}($s(e,i,s)),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(r,o){return si([S.cdn+"/extras/pdfjs.js",S.cdn+"/extras/html2canvas-1.0.min.js"]).then(function(){(o=o||{}).export_mode="pdf",o.hl=Ds,o.fontName=o.fontName||"pt-sans.regular",o.display=o.display||"table",r=b(r)?r:[r];for(var e=[],t=0;t<r.length;t++){r[t].id||(r[t]={id:r[t]});var i=Pt(r[t].id),s=H.extend(r[t].options||{},o);if(i&&i.$exportView&&(i=i.$exportView(s)),
i&&("table"!==s.display&&(e.push({node:i.$view,viewOptions:s}),o.autowidth&&(o.width=Math.max(o.width||0,i.$view.$width))),"image"!==s.display&&i.data&&i.data.pull)){var n=Cs(i,s);e.push({scheme:n,data:$s(i,s,n),viewOptions:s}),o.autowidth&&(o.width=Math.max(o.width||0,Fs(n)))}}if(0==e.length)return mt.reject(Ss);if(Ds[o.fontName])return o.hl=Ds[o.fontName],Is(e,o).then(function(t){return As(t,o)});var h=mt.defer();return pdfjs.load(S.cdn+"/extras/"+o.fontName+".ttf",function(t,i){if(t)throw t;o.hl=Ds[o.fontName]=new pdfjs.TTFFont(i),h.resolve(Is(e,o).then(function(t){return As(t,o)}))}),h})},H.toExcel=Vs,H.alert=function Yo(){var t=qs.apply(this,arguments);return t.type=t.type||"alert",Ws(t)},H.confirm=Js,H.modalbox=Ks,H.message=Zs,H.editStop=function Wo(){I("onEditEnd",[])},H.ajax=wt,H.jsonp=_n,H.DataDriver=hi,H.dp=me,H.DataProcessor=be,H.remote=gn,H.require=si,H.proxy=fi,H.send=function Go(t,i,e,s){var n=Y("FORM",{target:s||"_self",action:t,method:e||"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=zt,H.$$=Pt,Object.defineProperty(H,"iI",{value:!0})});
//# sourceMappingURL=webix.js.map
