168 lines (166 with data), 651.9 kB
/**
* @license
* webix UI v.9.0.0
* This software is allowed to use under GPL or you need to obtain Commercial License
* to use it in non-GPL project. Please contact sales@webix.com for details
*/
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.webix={})}(this,function(F){"use strict";function M(t){return(M="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)}function a(t,i){return function e(t){if(Array.isArray(t))return t}(t)||function u(t,i){var e=[],s=!0,n=!1,r=undefined;try{for(var h,o=t[Symbol.iterator]();!(s=(h=o.next()).done)&&(e.push(h.value),!i||e.length!==i);s=!0);}catch(a){n=!0,r=a}finally{try{s||null==o["return"]||o["return"]()}finally{if(n)throw r}}return e}(t,i)||function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function s(t){if(Array.isArray(t)){for(var i=0,e=new Array(t.length);i<t.length;i++)e[i]=t[i];return e}}(t)||function i(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function e(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i=window,e=1,s={},n=!1;function f(t){i.setImmediate?i.setImmediate(t):i.importScripts||!i.addEventListener?setTimeout(t):(s[++e]=t,i.postMessage(e,"*"))}function m(t){if("function"!=typeof t&&t!=undefined)throw TypeError();if("object"!=M(this)||this&&this.then)throw TypeError();var i,e,n=this,r=0,h=0,s=[];(n.promise=n).resolve=function(t){return i=n.fn,e=n.er,r||(h=t,r=1,f(u)),n},n.reject=function(t){return i=n.fn,e=n.er,r||(h=t,r=2,f(u)),n},n.i=1,n.then=function(t,i){if(1!=this.i)throw TypeError();var e=new m;return e.fn=t,e.er=i,3==r?e.resolve(h):4==r?e.reject(h):s.push(e),e},n["finally"]=function(i){var e,t=function(t){return e=t,i()},s=function(){var t=new m;return 4==r?t.reject(e):t.resolve(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){r=t||4;for(var i=0;i<s.length;i++){var e=s[i];3==r&&e.resolve(h)||e.reject(h)}};try{"function"==typeof t&&t(n.resolve,n.reject)}catch(c){n.reject(c)}return n;function a(t,i,e,s){if(2==r)return s();if("object"!=M(h)&&"function"!=typeof h||"function"!=typeof t)s();else try{var n=0;t.call(h,function(t){n++||(h=t,i())},function(t){n++||(h=t,e())})}catch(c){h=c,e()}}function u(){var t;try{t=h&&h.then}catch(c){return h=c,r=2,u()}a(t,function(){r=1,u()},function(){r=2,u()},function(){try{1==r&&"function"==typeof i?h=i(h):2==r&&"function"==typeof e&&(h=e(h),r=1)}catch(c){return h=c,o()}h==n?(h=TypeError(),o()):a(t,function(){o(3)},o,function(){o(1==r&&3)})})}}!i.setImmediate&&i.addEventListener&&i.addEventListener("message",function(t){if(t.source==i)if(n)f(s[t.data]);else{n=!0;try{s[t.data]()}catch(t){}delete s[t.data],n=!1}}),m.resolve=function(i){if(1!=this.i)throw TypeError();return i instanceof m?i:new m(function(t){t(i)})},m.reject=function(e){if(1!=this.i)throw TypeError();return new m(function(t,i){i(e)})},m.all=function(e){if(1!=this.i)throw TypeError();if(!(e instanceof Array))return m.reject(TypeError());var s=new m;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},m.race=function(e){if(1!=this.i)throw TypeError();if(!(e instanceof Array))return m.reject(TypeError());if(0==e.length)return new m;var s=new m;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},m.i=1,m.defer=function(){return new m(null)};var r={};function t(t,i){r[t]=i}function d(t){return r[t]}var h={};function l(t){var i=l.h;return i.prototype=t,new i}function S(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=I(t)?[]:{},t){var n=t[s];!n||"object"!=M(n
)||n instanceof RegExp?i[s]=n:A(n)?i[s]=new Date(n):e&&(n instanceof Map||n instanceof Set||n instanceof WeakMap||n instanceof WeakSet)?i[s]=n:(i[s]=I(n)?[]:{},S(i[s],n))}return i}function k(t,i){return function(){return t.apply(i,arguments)}}function _(t){window.execScript?window.execScript(t):window.eval(t)}function z(t){return void 0===t}function C(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 u(t){var i=!0;return function(){i&&(i=!1,t.apply(this,arguments))}}l.h=function(){},F.extend=function(t,i,e){if(t.$protoWait)return x.insertAt.call(t.$protoWait,i,1),t;for(var s in i)s in t&&!e||(t[s]=i[s]);return i.defaults&&F.extend(t.defaults,i.defaults),i.$init&&i.$init.call(t),t};var c=(new Date).valueOf();function $(){return++c}function D(t){return"string"==typeof t?document.getElementById(t):t}function v(t,i){if("string"!=typeof t)return t;var e=t.replace("()","");return i&&i[e]?i[e]:window[e]||window.eval(t)}function I(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function A(t){return t instanceof Date}function T(t){return F.extend(t||[],x,!0)}var x={removeAt:function(t,i){0<=t&&this.splice(t,i||1)},remove:function(t){this.removeAt(this.find(t))},insertAt:function(t,i){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}},P={parseFormat:"%Y-%m-%d %H:%i:%s",parseTimeFormat:"%H:%i:%s"};function p(t){var i,e=Date.prototype.toJSON;return Date.prototype.toJSON=function(){return P.parseFormatStr(this)},i=t instanceof Date?t.toJSON():JSON.stringify(t),Date.prototype.toJSON=e,i}var b={$init:function(){this.o||(this.o={},this.u={},this.l={})},blockEvent:function(){this.o._=!0},unblockEvent:function(){this.o._=!1},mapEvent:function(t){F.extend(this.l,t,!0)},on_setter:function(t){if(t)for(var i in t){var e=v(t[i],this.$scope),s=i.indexOf("->");-1!==s?this[i.substr(0,s)].attachEvent(i.substr(s+2),k(e,this)):this.attachEvent(i,e)}},callEvent:function(t,i){var e=this.m||this;if(this.o._)return!0;t=t.toLowerCase();var s=this.o[t.toLowerCase()],n=!0;if(s)for(var r=0;r<s.length;r++)!1===s[r].apply(e,i||[])&&(n=!1);if(this.l[t]){var h=this.l[t];h.$eventSource=this,h.callEvent(t,i)||(n=!1),h.$eventSource=null}return n},attachEvent:function(t,i,e){t=t.toLowerCase(),e=e||$(),i=v(i,this.$scope);var s=this.o[t]||T();return arguments[3]?s.unshift(i):s.push(i),this.o[t]=s,this.u[e]={f:i,t:t},e},detachEvent:function(t){if(this.u[t]){var i=this.u[t].t,e=this.u[t].f;this.o[i].remove(e),delete this.u[t]}else{var s=(t+"").toLowerCase();this.o[s]&&(this.o[s]=T())}},hasEvent:function(t){t=t.toLowerCase();var i=this.o[t];if(i&&i.length)return!0;var e=this.l[t];return!!e&&e.hasEvent(t)}},g={};F.extend(g,b,!0);var w=function(t,i){return g.callEvent(t,i)},y=function(t,i,e,s){return g.attachEvent(t,i,e,s)},V=function(t){return g.detachEvent(t)},H={w: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.w(e)?e:(e="string"==typeof t?this.fromString(t.replace(/^[\s]+/,"")):t,this.w(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}},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),r=n.iterateNext();r;)s.push(r),r=n.iterateNext();return s}var h=!0;try{"undefined"==typeof t.selectNodes&&(h=!1)}catch(a){}if(h)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"==M(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 r=t.attributes;if(r&&r.length)for(var h=0;h<r.length;h++)i[r[h].name]=r[h].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(e){return null}}},R={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(i){return null}return t},getRecords:function(t){return t&&t.data&&(t=t.data),t&&!I(t)?[t]:t},getDetails:function(t){return"string"==typeof t?{id:t||$(),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}},child:"data",parseDates:!1};function B(t,i,e){return 0!==arguments.length?(new B).get(t,i,e):this&&this.getXHR?this:new B}B.count=0,B.prototype={master:null,getXHR:function(){return new XMLHttpRequest},stringify:function(t){return p(t)},S:function(t,i,s,e){var n;i&&(I(i)||"function"==typeof(i.success||i.error||i))&&(n=s,s=i,i=null);var r=m.defer(),h=this.getXHR(),o=this.k||{};if(!w("onBeforeAjax",[e,t,i,h,o,null,r]))return r.reject(h);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"==M(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"===M(d)&&(d=this.stringify(d)),f.push(l+"="+encodeURIComponent(d))}i=f.join("&")}i&&"GET"===e&&(t=t+(-1!=t.indexOf("?")?"&":"?")+i,i=null),h.open(e,t,!this.$);var v=this.D;for(var _ in v&&(h.responseType=v),o)h.setRequestHeader(_,o[_]);var p=this;return this.master=this.master||n,h.onreadystatechange=function(){if(!h.readyState||4==h.readyState){B.count++;var t,i,e=400<=h.status||0===h.status;i="blob"==h.responseType||"arraybuffer"==h.responseType?(t="",h.response):(t=h.responseText||"",p.I(h)),e?(w("onAjaxError",[h]),r.reject(h)):r.resolve(i),s&&B.$callback(p.master||window,s,t,i,h,e)}},this.T&&(h.timeout=this.T),this.$?h.send(i||null):setTimeout(function(){h.send(i||null)},0),this.master&&!this.$&&r.then(function(t){return p.master=null,s=p=n=null,t}),this.$?h:r},I:function(i){return{xml:function(){try{return H.tagToObject(H.toObject(i.responseText,this))}catch(t){i.responseText,t.toString()}},rawxml:function(){return window.XPathResult?i.responseXML:H.fromString(i.responseText)},text:function(){return i.responseText},json:function(){return R.toObject(i.responseText,!1)}}},get:function(t,i,e){return this.S(t,i,e,"GET")},post:function(t,i,e){return this.S(t,i,e,"POST")},put:function(t,i,e){return this.S(t,i,e,"PUT")},del:function(t,i,e){return this.S(t,i,e,"DELETE")},patch:function(t,i,e){return this.S(t,i,e,"PATCH")},
sync:function(){return this.$=!0,this},timeout:function(t){return this.T=t,this},response:function(t){return this.D=t,this},headers:function(t){return this.k=F.extend(this.k||{},t),this},bind:function(t){return this.master=t,this}},B.$callback=function(t,i,e,s,n,r){if(!t.$destructed&&(r&&w("onAjaxError",[n]),i)){var h=i.success||i;r&&(h=i.error),h&&h.call&&h.call(t,e,s,n)}};var E={$proxy:!0,load:function(){var i=this.source.split("@"),e=i[0].split(".").pop();return B().response("arraybuffer").get(i[0]).then(function(t){return{data:t,options:{ext:e,dataurl:i[1]}}})}},j={$proxy:!0,load:function(){},save:function(t,i,e){C(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)})}},L={$proxy:!0,load:function(){return B(this.source)},save:function(t,i){return L.F.call(this,i,B())},F: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 r=t.operation,h=t.data;return"insert"==r&&delete h.id,"update"==r?i.put(e+h.id+s,h):"delete"==r?i.del(e+h.id+s,h):i.post(e+s,h)}},O={$proxy:!0,load:function(){return B(this.source)},save:function(t,i){var e=B().headers({"Content-Type":"application/json"});return L.F.call(this,i,e)}},N={$proxy:!0,load:function(t,i){return i=F.extend(i||{},this.params||{},!0),B().post(this.source,i)}};var W={$proxy:!0,save:function(t){return this.load(t)},load:function(t){var i={query:this.source};return 1===arguments.length&&(i.variables=t),B().headers({"Content-type":"application/json"}).post(this.url,i).then(function(t){return function n(t){if(!t||"object"===!M(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 Y(t,i,e){var s=S(Y[t]);return s.source=i,e&&F.extend(s,e,!0),s.init&&s.init(),s}Y.$parse=function(t){if("string"!=typeof t||-1==t.indexOf("->"))return t;var i=t.split("->");return Y(i[0],i[1])},Y.binary=E,Y.debug=j,Y.json=O,Y.post=N,Y.rest=L,Y.GraphQL=W;var U={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},q={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 H.tagToObject(t)},getOptions:function(){return!1},getInfo:function(){return{size:0}},tag:"LI"},G={cdn:"//cdn.webix.com",codebase:"",zIndexBase:100,scrollSize:17};G.strict=!!window.webix_strict,G.https="https:"===document.location.protocol;var X=navigator.userAgent;if(G.isMac=-1!=X.indexOf("Mac"),-1==X.indexOf("Mobile")&&-1==X.indexOf("Windows Phone")||(G.mobile=!0),(G.mobile||-1!=X.indexOf("iPad")||-1!=X.indexOf("Android"))&&(G.touch=!0),!G.touch&&"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints&&(G.touch=!0),-1!=X.indexOf("Opera"))G.isOpera=!0;else{if(G.isIE=!!document.all||-1!==X.indexOf("Trident"),G.isIE)8==parseFloat(navigator.appVersion.split("MSIE")[1])&&(G.isIE8=!0);G.isEdge=-1!=X.indexOf("Edge"),G.isFF=-1!=X.indexOf("Firefox"),G.isWebKit=-1!=X.indexOf("KHTML"),G.isSafari=G.isWebKit&&G.isMac&&-1==X.indexOf("Chrome"),(G.isIE||G.isEdge||G.isFF)&&(G.maxHTMLElementSize=1e7),G.isSafari&&(G.maxHTMLElementSize=1e8)}-1!=X.toLowerCase().indexOf("android")&&(G.isAndroid=!0,-1!=X.toLowerCase().indexOf("trident")&&(G.isAndroid=!1,G.isIEMobile=!0)),G.transform=!1,G.transition=!1;for(var K=-1,J=["","webkit","Moz","O","ms"],Z=document.createElement("DIV"),Q=0;Q<J.length;Q++){var tt=J[Q]?J[Q]+"Transform":"transform";if("undefined"!=typeof Z.style[tt]){K=Q;break}}if(-1<K){G.cssPrefix=["","-webkit-","-Moz-","-o-","-ms-"][K];var it=G.jsPrefix=J[K];G.transform=it?it+"Transform":"transform",
G.transition=it?it+"Transition":"transition",G.transitionDuration=it?it+"TransitionDuration":"transitionDuration",Z.style[G.transform]="translate3d(0,0,0)",G.translate=Z.style[G.transform]?"translate3d":"translate",G.transitionEnd="-Moz-"==G.cssPrefix?"transitionend":it?it+"TransitionEnd":"transitionend"}G.pointerevents=!G.isIE||null!==new RegExp("Trident/.*rv:11").exec(X),G.passiveEventListeners=!1;try{var et=Object.defineProperty({},"passive",{get:function(){G.passiveEventListeners=!0}});window.addEventListener("testPassive",null,et),window.removeEventListener("testPassive",null,et)}catch(Qh){}G.svg=document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),G.svganimation=document.implementation.hasFeature("https://www.w3.org/TR/SVG11/feature#SVG-animation","1.1");var st=0,nt={},rt={};function ht(){st||(st=document.onselectstart),document.onselectstart=xt}function ot(){0!==st&&(document.onselectstart=st||null),st=0}function at(t){for(var i=0;t=t.previousSibling;)i++;return i}function ut(t,i){var e="";for(var s in i=i||"",t)e+=s+":"+t[s]+";";var n=rt[e+i];return n||(ct("."+(n="s"+$())+(i||"")+"{"+e+"}"),rt[e+i]=n),n}function ct(t,i){var e=i?nt[i]:nt["default"];e||((e=document.createElement("style")).setAttribute("type","text/css"),e.setAttribute("media","screen,print"),document.getElementsByTagName("head")[0].appendChild(e),i?nt[i]=e:nt["default"]=e),e.styleSheet?e.styleSheet.cssText+=t:e.appendChild(document.createTextNode(t))}function ft(t){var i=nt[t||"default"];i&&(i.innerHTML="")}function lt(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 dt(t){return(t=D(t))?z(t.value)?t.innerHTML:t.value:""}function vt(t){if(t instanceof Array)for(var i=0;i<t.length;i++)vt(t[i]);else t&&t.parentNode&&t.parentNode.removeChild(t)}function _t(t,i,e){t&&(i&&i.parentNode?i.parentNode.insertBefore(t,i):e.appendChild(t))}function pt(t,i){var e;for(e=t.tagName?t:(t=t||event).target;e;){if(e.getAttribute){var s=e.getAttribute(i);if(s)return s}e=e.parentNode}return null}function mt(t){if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),e=document.body,s=document.documentElement,n=window.pageYOffset||s.scrollTop||e.scrollTop,r=window.pageXOffset||s.scrollLeft||e.scrollLeft,h=s.clientTop||e.clientTop||0,o=s.clientLeft||e.clientLeft||0,a=i.top+n-h,u=i.left+r-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 bt(t){return z((t=t||event).offsetX)?{x:t.layerX,y:t.layerY}:{x:t.offsetX,y:t.offsetY}}function gt(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=G.isIE&&"BackCompat"!=document.compatMode?document.documentElement:document.body;return{x:t.clientX+i.scrollLeft-i.clientLeft,y:t.clientY+i.scrollTop-i.clientTop}}function wt(t){return t&&t.preventDefault&&t.preventDefault(),t&&(t.returnValue=!1),xt(t)}function xt(t){return(t=t||event).stopPropagation&&t.stopPropagation(),!(t.cancelBubble=!0)}function yt(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 Mt(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 kt(t,i,e){var s=lt("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"!==M(t)?[t]:t,r=0,h=0,o=0;o<n.length;o++)s.innerHTML=n[o],r=Math.max(r,s.offsetWidth+1),h=Math.max(h,s.offsetHeight+1);return vt(s),{width:r,height:h}}function Ct(t,i){var e=!1;if(
"object"==M(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(),C(function(){e&&window.URL.revokeObjectURL(t),document.body.removeChild(s),s.remove()})}function $t(t){if(!t)return"";var i=t.className||"";return i.baseVal&&(i=i.baseVal),i.indexOf||(i=""),i}function Dt(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 It(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 At(t,i){document.getElementsByTagName("head").item(0).appendChild(lt("meta",{name:t,content:i}))}var Tt={toObject:function(t){(t=D(t)).tagName.toLowerCase();var i=t.rows;return vt(t),i},getRecords:function(t){for(var i=[],e=t[0]&&t[0].P?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].P=!0);for(var s=0;s<e.length;s++){var n={id:"data"+s,header:this.V(e[s].innerHTML)},r=this.H(e[s]);n=F.extend(n,r),i.push(n)}return i},V:function(t){var i=t.indexOf("json://");return-1!=i&&(t=JSON.parse(t.substr(i+7))),t},H:function(t){for(var i=t.attributes,e={},s=0;s<i.length;s++)e[i[s].nodeName]=this.V(i[s].nodeValue);return e.width=parseInt(e.width,10),e}},Ft={};function zt(e,t,i){var s=m.defer();if(t&&!0!==t&&(s=s.then(function(){t.call(i||this)})),zt.disabled)return s.resolve(),s;if("string"!=typeof e){var n=e.length||0;if(n){var r=function(){n?(n--,zt(e[e.length-n-1]).then(r,function(){return s.reject()})):s.resolve()};r()}else{for(var h in e)n++;var o=function(){0===--n&&s.resolve()};for(var a in e)zt(a).then(o,function(){return s.reject()})}return s}if(!0!==Ft[e]){var u=e;if(!0===t)return _(B().sync().get(u).responseText),Ft[e]=!0,s.resolve();if(Ft[e])return Ft[e].push(s),s;Ft[e]=[s];var c=function(){var t=Ft[e];Ft[e]=!1;for(var i=0;i<t.length;i++)t[i].reject()},f=function(){var t=Ft[e];Ft[e]=!0;for(var i=0;i<t.length;i++)t[i].resolve()},l=e.split("?");if(".css"==l[0].substr(l[0].length-4)){var d=lt("LINK",{type:"text/css",rel:"stylesheet",href:u});d.onload=f,d.onerror=c,document.getElementsByTagName("head")[0].appendChild(d)}else{var v=document.createElement("script");v.onload=f,v.onerror=c,document.getElementsByTagName("head")[0].appendChild(v),v.src=u}}else s.resolve();return s}var Pt=F.extend({toObject:function(t){if(t.excel)return t;var i=t.options||{};i.dataurl&&F.extend(i,this.R(i.dataurl)),t=t.data||t;var e=m.defer();if(t.name){i.ext=t.name.split(".").pop();var s=new FileReader;s.onload=k(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"),zt(G.cdn+"/extras/xlsx.core.styles.min.js").then(k(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 F.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=[],r=[],h=[],o=[],a={n:"number",d:"date",s:"string",b:"boolean"};if(t&&t["!ref"]){var u,c,f,
l=XLS.utils.decode_range(t["!ref"]),d=l.s.c,v=l.s.r+(i.rows?i.rows[0]:0);for(u=l.s.r;u<=l.e.r;u++){var _=[];for(c=l.s.c;c<=l.e.c;c++)if(f=t[XLS.utils.encode_cell({r:u,c:c})]){var p="";p=i.math&&f.f?"="==f.f.charAt(0)?f.f:"="+f.f:"d"==f.t&&A(f.v)?P.dateFormatStr(f.v):f.v,_.push(p),f.s&&n.push([u-v,c-d,f.s]),f.t&&h.push([u-v,c-d,a[f.t]])}else _.push("");e.push(_)}if(t["!merges"])for(var m=t["!merges"],b=0;b<m.length;b++){var g=m[b].s,w=m[b].e;(!i.rows||0<=g.r-v&&w.r-v<=i.rows[1])&&s.push([g.r-v,g.c-d,w.c-g.c+1,w.r-g.r+1])}if(t["!cols"])for(var x=t["!cols"],y=0;y<x.length;y++){var M=x[y];if(M){var S=y-d;r.push(["column",S,Math.round(M.wch/(8.43/70))]),M.hidden&&o.push(["column",S])}}if(t["!rows"])for(var k=t["!rows"],C=0;C<k.length;C++){var $=k[C];if($){var D=C-v;r.push(["row",D,$.hpx]),$.hidden&&o.push(["row",D])}}}return{data:e,spans:s,styles:n,sizes:r,types:h,hidden:o,excel:!0}},R: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}},U),Vt={json:R,jsarray:U,xml:H,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:q,htmltable:Tt,excel:Pt},Ht={},Rt={$init:function(t){this.data={},this.waitData=m.defer(),t&&(this.B.datatype=t.datatype||"json"),this.$ready.push(this.j)},j:function(){this.O=!0,this.B.url&&this.url_setter(this.B.url),this.B.data&&this.data_setter(this.B.data)},url_setter:function(t){return t=Y.$parse(t),this.O&&this.load(t,this.B.datatype),t},data_setter:function(t){return this.O?(this.parse(t,this.B.datatype),!0):t},load:function(t,i,e,s){var n,r=this;"string"==typeof i&&(n=i,i=e);var h=this.N(t,n,e||null);if(h&&h.then)return h.then(function(t){return r.W(t,s),i&&B.$callback(r,i,"",t,-1),t},function(t){return r.Y(t)})},N:function(t,i,e){var s,n=this;if(!i&&this.data.driver||(this.data.driver=Vt[i||"json"]),!this.callEvent("onBeforeLoad",[]))return m.reject();(s=(t=Y.$parse(t)).$proxy&&t.load?t.load(this,e):"function"==typeof t?t.call(this,e):B().bind(this).get(t))&&!s.then&&(s=m.resolve(s));var r=this.U;return s&&s.then?s.then(function(t){return n.$destructed||r&&n.U!==r?m.reject(Ht):t}):s},parse:function(t,i,e){if(t&&"function"==typeof t.then){var s=this.U;return t.then(k(function(t){if(this.$destructed||s&&this.U!==s)return m.reject();this.parse(t,i,e)},this))}if(t&&t.sync&&this.sync)this.q(t);else{if(!this.callEvent("onBeforeLoad",[]))return m.reject();!i&&this.data.driver||(this.data.driver=Vt[i||"json"]),this.W(t,e)}return m.resolve()},q:function(t){this.data&&this.data.attachEvent&&this.data.attachEvent("onSyncApply",k(function(){this.G&&this.G()},this)),this.sync(t)},X:function(t){var i,e,s=this.data.driver;i=(e=s.getRecords(t)[0])?s.getDetails(e):{},this.setValues?this.setValues(i,!1,"auto"):this.data=i},K:function(t,i){t?this.$onLoad&&this.$onLoad(t,this.data.driver,i)||(this.data&&this.data.X?(i&&this.data.clearAll(!0),this.data.X(t)):(i&&this.clearAll(!0),this.X(t))):this.Y(t),this.G&&this.G(),this.callEvent("onAfterLoad",[]),this.waitData.resolve()},W:function(t,i){var e=this;t&&"function"==typeof t.text&&!t.name&&(t=t.text()),(t=this.data.driver.toObject(t))&&t.then?t.then(function(t){return e.K(t,i)}):this.K(t,i)},Y:function(t){return t!==Ht&&(this.$destructed||(this.callEvent("onAfterLoad",[]),this.callEvent("onLoadError",arguments)),w("onLoadError",[t,this])),m.reject(t)},J:function(t){if(!this.B.dataFeed||this.Z||!t)return!0;var i=this.B.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",[])&&B(i,function(t,i,e){this.Z=!0;var s=Vt.json,n=s.toObject(t,i)
;n?this.setValues(s.getDetails(s.getRecords(n)[0]),!1,"auto"):this.Y(e),this.Z=!1,this.callEvent("onAfterLoad",[])},this),!1)}},Bt={collapseNames:function(t,i,e,s){if(e=e||{},i=i||"",s=s||function(){return!0},!t||"object"!=M(t))return null;for(var n in t){var r=t[n],h=i+n;r&&"object"==M(r)&&!A(r)&&!I(r)&&s(h)?Bt.collapseNames(r,h+".",e,s):e[h]=r}return e},expandNames:function(t){var i,e,s,n,r,h={};for(r in t){for(e=(s=r.split(".")).length-1,n=h,i=0;i<e;i++)n[s[i]]||(n[s[i]]={}),n=n[s[i]];n[s[e]]=t[r]}return h}},Et={},jt={},Lt=new RegExp("(\\r\\n|\\n)","g"),Ot=new RegExp('(\\")',"g"),Nt=new RegExp("(\\\\)","g"),Wt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Yt=/[&<>"'`]/g,Ut=function(t){return Wt[t]||"&"};function qt(e){if("function"==typeof e)return e;if(Et[e])return Et[e];if(-1!=(e=(e||"").toString()).indexOf("->")){var t=e.split("->");switch(t[0]){case"html":e=dt(t[1]);break;case"http":e=(new B).sync().get(t[1],{uid:$()}).responseText}}if(e=(e||"").toString(),G.strict){if(!jt[e]){jt[e]=[];var r=[];if(e.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,function(t,i,e,s,n){r.push({pos:n,str:t,fn:function(t){return t[i]?e:s}})}),e.replace(/\{common\.([^}(]*)\}/g,function(t,e,i){r.push({pos:i,str:t,fn:function(t,i){return i[e]||""}})}),e.replace(/\{common\.([^}(]*)\(\)\}/g,function(t,e,i){r.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){r.push({pos:e,str:t,fn:function(t){return t[i]}})}),e.replace("{obj}",function(t,i){r.push({pos:i,str:t,fn:function(t){return t}})}),e.replace(/#([^#'";, ]+)#/gi,function(t,i,e){"!"==i.charAt(0)?(i=i.substr(1),r.push({pos:e,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=Bt.collapseNames(t)),qt.escape(t[i])}})):r.push({pos:e,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=Bt.collapseNames(t)),t[i]}})}),r.sort(function(t,i){return t.pos>i.pos?1:-1}),r.length){for(var i=0,s=function(t,i,e){jt[t].push(function(){return t.slice(i,e)})},n=0;n<r.length;n++){var h=r[n].pos;s(e,i,h),jt[e].push(r[n].fn),i=h+r[n].str.length}s(e,i,e.length)}else jt[e].push(function(){return e})}return function(){for(var t="",i=0;i<jt[e].length;i++)t+=jt[e][i].apply(this,arguments);return t}}var o=!1;e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(Nt,"\\\\")).replace(Lt,"\\n")).replace(Ot,'\\"')).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+'";');Et[e]=function(t,i,e,s){return a(t,i,e,s,qt)}}else Et[e]=Function("obj","common",'return "'+e+'";')}catch(Qh){}return Et[e]}qt.escape=function(t){return t===undefined||null===t?"":(t.toString()||"").replace(Yt,Ut)},qt.empty=function(){return""};var Gt={Q:function(t){return t.$empty?"":this.B.template(t,this)},render:function(){var t=this.B;return!!this.isVisible(t.id)&&(this.callEvent&&!this.callEvent("onBeforeRender",[this.data])||(this.data&&!t.content&&(this.tt.innerHTML="",this.tt.innerHTML=this.Q(this.data)),this.callEvent&&this.callEvent("onAfterRender",[])),!0)},sync:function(i){this.it=!1,"DataStore"!=i.name&&(i.data&&"DataStore"==i.data.name?i=i.data:this.it=!0),this.it?i.bind("change",k(function(t){t.id==this.data.id&&(this.data=t.attributes,this.refresh())},this)):i.attachEvent("onStoreUpdated",k(function(t){t&&t!=this.data.id||(this.data=i.pull[t],this.refresh())},this))},template_setter:qt},Xt={et:function(t){var i,e,s=this.B.dragscroll;"string"!=typeof s&&(s=this.B.layout||"xy"),e=-1!==s.indexOf("x"),i=-1!==s.indexOf("y");var n=mt(this.st||this.$view),r=Math.max((this.B.rowHeight||(this.type&&!isNaN(parseFloat(this.type.height))?this.type.height:0))+5,40),h=!1;i&&this.nt(t,n,r)&&(h=!0),e&&this.rt(t,n,r
)&&(h=!0),h&&(this.ht=C(this.et,this,[t],100))},ot:function(t){var i=this.B.dragscroll;if("string"!=typeof i||-1!==i.indexOf("x")){var e=mt(this.k||this.$view),s=Math.max(this.B.headerRowHeight||0,40);this.rt(t,e,s)&&(this.ht=C(this.ot,this,[t],100))}},nt:function(t,i,e){var s=i.y,n=s+i.height,r=this.getScrollState(),h=this.B;if(h.topSplit){var o=this.at(this.getIdByIndex(h.topSplit-1),this.columnId(0));s+=o.top+o.height}return t.y<s+e?this.ut(r.x,r.y-2*e,t,"y"):t.y>n-e&&this.ut(r.x,r.y+2*e,t,"y")},rt:function(t,i,e){var s=i.x,n=s+i.width,r=this.getScrollState();return t.x<s+e?this.ut(r.x-2*e,r.y,t,"x"):t.x>n-e&&this.ut(r.x+2*e,r.y,t,"x")},ut:function(t,i,e,s){if(this.callEvent("onBeforeAutoScroll",[e])){this.scrollTo(t,i),this.callEvent("onAfterAutoScroll",[]);var n=this.getScrollState();return Math.abs(("x"===s?t:i)-n[s])<1}return!1}},Kt={};function Jt(){for(var t in Kt)ti(t)}function Zt(t,i,e,s){(s=s||{}).inner=!0,Qt(t,i,e,s)}function Qt(t,i,e,s){s=s||{},t=D(t);var n=s.id||$();s.bind&&(e=k(e,s.bind));var r=[t,i,e,s.capture];s.inner||(Kt[n]=r);var h=!!s.capture;return!z(s.passive)&&G.passiveEventListeners&&(h={passive:s.passive,capture:h}),t.addEventListener?t.addEventListener(i,e,h):t.attachEvent&&t.attachEvent("on"+i,r[2]=function(){return e.apply(t,arguments)}),n}function ti(t){if(t){Kt[t];var i=Kt[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 Kt[t]}}function ii(t,i){if(t.$protoWait)return t.ct||(t.ct=[]),void t.ct.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]=l(i.baseType?t.types[i.baseType]:t.type)),i)0===n.indexOf("template")?s[n]=qt(i[n]):s[n]=i[n];return e}var ei={top_views:[],ft:null,lt:null,dt:null,vt:null,_t:null,pt:null,mt:null,bt:null,gt:0,wt:null,xt:null,yt:[],destructors:[],Mt:null,St:[],kt:T(),Ct:null},si={};function ni(t,i,e){var s;ei.gt++;var n=ei.ft;ei.ft=t.$scope||n;try{s=function l(t,i,e){var s,n=I(t),r=D(t.container||i||document.body);r.B&&(e=function f(t,i,e){var s=[t];if(i)s=t.getChildViews();else if(t.$t)s=[t.$t];else{if("number"==typeof e)return e;if(e)return hi(s=[ai(e)]),s[0].config.id}return hi(s),e}(r,n,e));var h=!1,o=r==document.body;t.B||r&&n?(s=t,h=!0):(r&&o&&(t.$topView=!0),t.Dt||(t.Dt={}),i&&i.getParentView&&(ei.mt=e||0===e?i:i.getParentView()),s=oi(t));!o||s.setPosition||s.$apiOnly||d("_fixHeight")();if(s.B&&s.B.It&&!r.$view)s.B.At=r;else if(!s.$apiOnly)if(r.appendChild)ri(r,s,t);else if(r.destructor){var a=r;if(e||0===e||I(s)||(r=(e=r).getParentView()),r&&r.Tt){if(h&&s.getParentView){var u=s.getParentView();u&&u.Ft&&u.Ft(s),s.mt=r,s.$scope=r.$scope}r.Tt(s,e)}else{var c=a.$view.parentNode;a.destructor(),ri(c,s,t)}}else t.container;return s}(t,i,e)}finally{ei.gt--,ei.ft=n}return s}function ri(t,i,e){t.appendChild(i.zt),i.getParentView()||(((!i.setPosition||i.B.fullscreen)&&t==document.body||i.B.position)&&ei.top_views.push(i.Pt),e.skipResize||i.adjust())}function hi(t){for(var i=t.length-1;0<=i;i--){var e=t[i];delete si[e.config.id],e.config.id="x"+$(),(si[e.config.id]=e).getChildViews&&hi(e.getChildViews()),e.Vt&&hi(e.Vt)}}function oi(t){if(t.view){var i=t.view;return new ni[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 ni.headerlayout(t):new ni.layout(t)}return t.cells?new ni.multiview(t):t.template||t.content?new ni.template(t):t.align&&t.body?new ni.align(t):new ni.spacer(t)}function ai(t){if(!t)return null;if(si[t])return si[t];var i=t;if("object"==M(t)){if(t.B)return t;i=t.target||t}return si[pt({target:D(i)},"view_id")]}ni.views=si,ni.Ht=oi,"undefined"==typeof window.$$&&(window.$$=ai),F.protoUI=function(){var r=arguments[0].name,h=function(t){if(!h)return ni[r].prototype;var i=h.$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&&(ni[e[s].prototype.name]=e[s]);if(ni[r]=F.proto.apply(-1,e),h.ct)for(
var n=0;n<h.ct.length;n++)ii(ni[r],h.ct[n]);h=i=null}return-1!=this?new ni[r](t):ni[r]};return h.$protoWait=Array.prototype.slice.call(arguments,0),ni[r]=h},F.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 r=t[n].defaults;for(var h in i.defaults||(i.defaults={}),r)z(i.defaults[h])&&(i.defaults[h]=r[h])}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.Rt&&this.Rt(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},y("onClick",function(t){var i=ai(t);if(i&&i.touchable){d("UIManager").applyChanges(i),i.getNode(t);var e=t.target;if(i.config.disabled)return;var s="";if(e.className&&0===e.className.toString().indexOf("webix_view"))return;for(i&&d("UIManager").Bt(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.B.id,e))return}}}e=e.parentNode}if(i.B.click){var r=v(i.B.click,i.$scope);r&&r.call&&r.call(i,i.B.id,t)}var h=i.B.popup;h&&!i.B.readonly&&("object"!=M(h)||h.name||(h=i.B.popup=ni(h).B.id,i.Vt.push(ai(h))),(h=ai(h)).isVisible()||(h.B.master=i.B.id,h.show(i.getInputNode()||i.getNode(),null,!0))),i.callEvent("onItemClick",[i.B.id,t])}});var ui={Et:T(["dummy"]),jt:0,overflow:!1,delay:400,addTooltip:function(t,i){var e,s,n=this;(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 r=this.Et.find(s);-1===r&&(r=this.Et.length,this.Et.push(s)),e.webix_tooltip=r,this.jt++,this.Lt||(this.Lt=new ni.tooltip({}),this.Lt.Ot="webix_tooltip webix_global_tooltip",this.Nt=Qt(document,"mousemove",this.Wt,{bind:this}),this.Yt=Qt(document,"mouseleave",this.Ut,{bind:this}),this.qt=y("onDragMode",function(){return n.Ut()}),this.Gt=y("onClick",function(){return n.Ut()}))},getTooltip:function(){return this.Lt},Wt:function(t){for(var i={},e=t.target;e instanceof Element&&"HTML"!=e.tagName;){if(!i.first||!i.overflow){var s=e.getAttribute("webix_tooltip");i.first=i.first||s,s&&e.scrollWidth>e.clientWidth&&(i.overflow=s)}if(this.Et[e.webix_tooltip])return this.Xt&&this.Xt!=e?(this.$tooltipOut(this.Xt,e,t),void(this.Xt=null)):(this.Xt||(this.Xt=this.$tooltipIn(e,t)),this.$tooltipMove(e,t,i));e=e.parentElement}this.Xt&&(this.Xt=this.$tooltipOut(this.Xt,null,t))},Ut:function(){clearTimeout(this.Kt),this.Lt.hide()},getMaster:function(t){return this.Et[t.webix_tooltip]},removeTooltip:function(t){var i,e=(i=(t=D(t))instanceof Element?t:t.$view).webix_tooltip;e&&(this.Xt==i&&(this.Ut(),this.Xt=null),delete i.webix_tooltip,this.jt--,this.Et[e]=null),!this.jt&&this.Lt&&(this.Nt=ti(this.Nt),this.Yt=ti(this.Yt),this.qt=V(this.qt),this.Gt=V(this.Gt),this.Lt.destructor(),this.Lt=this.Xt=null,this.Et=T(["dummy"]))},$tooltipIn:function(t,i){var e=this.Et[t.webix_tooltip];return e.$tooltipIn&&e!=this?e.$tooltipIn(t,i):(this.Lt.define({dx:20,dy:0,template:"",css:""}),t)},$tooltipOut:function(t,i,e){var s=this.Et[t.webix_tooltip];return s.$tooltipOut&&s!=this?s.$tooltipOut(t,i,e):(this.Ut(),null)},$tooltipMove:function(t,i,e){var s=this.Et[t.webix_tooltip];if(s.$tooltipMove&&s!=this)return s.$tooltipMove(t,i,e);var n=z(s.overflow)?this.overflow:s.overflow,r=z(s.delay)?this.delay:s.delay,h=n?e.overflow:e.first;0<r&&this.Ut(),this.Kt=C(this.Lt.show,this.Lt,[h||{},gt(i)],r)}};function ci(t){return"$"+t+(fi[t]=(fi[t]||0)+1)}var fi={},li=!1;function di(t,i){li=!0;var e=t();return e&&e.then?e=e.then(function(t){return(li=!1)!==i&&vi(),t}):(li=!1)!==i&&vi(),e}function vi(){if(d("UIManager").applyChanges(),w("onClick",[]),ei.Jt=!0,!li)for(var t=ei.top_views.length-1;0<=t;t--
)ei.top_views[t].obj&&ei.top_views[t].obj.resize();ei.Jt=!1}function _i(t,i,e,s){if(t)for(var n=s?[t]:t.getChildViews(),r=0;r<n.length;r++)!1!==i.call(e,n[r])&&_i(n[r],i,e)}function pi(t){return z(t)?G.zIndexBase++:(G.zIndexBase=Math.max(G.zIndexBase,t+1),t)}function mi(t){bi?t.call():gi.push(t)}Qt(window,"resize",function(){G.touch&&ei.bt&&new Date-ei.bt<1e3||vi()});var bi=!1,gi=[],wi=document.getElementsByTagName("SCRIPT");wi.length,wi.length&&((wi=(wi[wi.length-1].getAttribute("src")||"").split("/")).splice(wi.length-1,1),G.codebase=wi.slice(0,wi.length).join("/")+"/");var xi=function(){G.isIE&&(document.body.className+=" webix_ie"),w("onReady",[])},yi=function(){bi=!0,window.webix_ready&&I(webix_ready)&&(gi=webix_ready.concat(gi));for(var t=0;t<gi.length;t++)gi[t].call();gi=[]};y("onReady",function(t){t?yi():C(yi)}),"complete"==document.readyState?xi():Qt(window,"load",xi),mi(function(){Qt(document.body,"click",function(t){w("onClick",[t||window.event])})});var Mi={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}};function Si(t,i){if(-1!=t.type.indexOf("prompt"))if(!1===i)t.Zt.reject();else{var e=t.Qt.querySelector(".webix_popup_input"),s=e.querySelector("input");if(t.input.required&&!s.value)return t.input.invalid=!0,void Mt(e,"webix_popup_invalid");i=s.value||"",t.Zt.resolve(i)}-1!=t.type.indexOf("confirm")&&!1===i?t.Zt.reject():t.Zt.resolve(i);var n=t.callback;n&&n(i,t.details),Hi.hide(t.id)}function ki(t){var i=Hi.order,e=i.length,s=t.target;if(0<e&&Ri.keyboard){var n,r=(t=t||window.event).which||t.keyCode;if(13!=r&&32!=r&&27!=r)return;for(var h=e-1;0<=h;h--){var o=Hi.pull[i[h]];if(o.Qt!=s&&o.Qt.contains(s)&&32==r)return;if(o.container&&o.container.contains(s)){n=o;break}}return n||(n=Hi.pull[i[i.length-1]]),13==r||32==r?Si(n,!0):27==r&&Si(n,!1),wt(t),!(t.cancelBubble=!0)}}function Ci(t,i){var e,s=i||document.body;if(z(s.modality)){if((e=lt("DIV",{"class":"webix_modal_cover",style:"position:"+(i?"absolute":"fixed")+";"})).onkeydown=ki,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--;return(t&&1===s.modality||0===s.modality)&&(e=e||Array.prototype.slice.call(s.querySelectorAll(".webix_modal_cover")).filter(function(t){return t.parentNode==s})[0])&&(s.modality?1==s.modality&&(e.style.display="inline-block",Mt(s,"webix_modalbox_inside")):(e.style.display="none",St(s,"webix_modalbox_inside"))),e}function $i(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 Di(s,t,i,e){var n=document.createElement("DIV"),r=s.css?" "+s.css:"";n.className="webix_modal_box webix_"+s.type+r,n.setAttribute("webixbox",1),n.setAttribute("role","alertdialog"),n.setAttribute("aria-label",s.title||""),n.setAttribute("tabindex","0");var h="";if(s.width&&(n.style.width=s.width+(Mi.isNumber(s.width)?"px":"")),s.height&&(n.style.height=s.height+(Mi.isNumber(s.height)?"px":"")),s.title&&(h+='<div class="webix_popup_title">'+s.title+"</div>"),h+='<div class="webix_popup_text'+(e?" webix_popup_label":"")+'"><span>'+(s.content?"":s.text||"")+"</span></div>",h+='<div class="webix_popup_controls">',e&&(h+=function c(t){return"<div tabindex='0' class='webix_popup_input webix_el_text"+(t.required?" webix_required":"")+"'><input value='"+qt.escape(t.value||"")+"' placeholder='"+qt.escape(t.placeholder||"")+"'></input></div>"}(s.input)),i&&(h+=$i(s.cancel||P.message.cancel,!1)),t&&(h+=$i(s.ok||P.message.ok,!0,"confirm")),s.buttons&&!t&&!i)for(var o=0;o<s.buttons.length;o++)h+=$i(s.buttons[o],o);if(h+="</div>",n.innerHTML=h,s.content){var a=s.content;"string"==typeof a&&(a=document.getElementById(a)),"none"==a.style.display&&(a.style.display=""),n.childNodes[s.title?1:0].appendChild(a)}if(-1!=s.type.indexOf("prompt")){var u=n.querySelector(
".webix_popup_input");u.querySelector("input").oninput=function(){s.input.invalid&&(St(u,"webix_popup_invalid"),s.input.invalid=!1)}}return n.onclick=function(t){var i=(t=t||window.event).target;if(i.className||(i=i.parentNode),-1!=i.className.indexOf("webix_popup_button")){var e=i.getAttribute("result");Si(s,e="true"==e||"false"!=e&&e)}t.cancelBubble=!0},s.Qt=n}function Ii(t,i,e,s){var n=t.tagName?t:Di(t,i,e,s),r=t.container,h=r?r.offsetWidth:window.innerWidth||document.documentElement.offsetWidth,o=r?r.offsetHeight:window.innerHeight||document.documentElement.offsetHeight,a=r?r.scrollLeft:0,u=r?r.scrollTop:0;t.container&&(n.style.position="absolute"),D((t.container||document.body).appendChild(n));var c=Ci(!0,t.container),f=t.left||Math.abs(a+Math.floor((h-n.offsetWidth)/2)),l=t.top||Math.abs(u+Math.floor((o-n.offsetHeight)/2));return"top"==t.position?n.style.top="-3px":(n.style.top=l+"px",c&&(c.style.top=u+"px",c.style.left=a+"px")),n.style.left=f+"px",n.onkeydown=ki,n.focus(),t.id?Hi.pull[t.id]&&Hi.hide(t.id):t.id=ci("modalbox"),Hi.order.push(t.id),(Hi.pull[t.id]=t).Zt=m.defer(),t.Zt}function Ai(t){return Ii(t,!0)}function Ti(t){return Ii(t,!0,!0)}function Fi(t){return Ii(t)}function zi(t){return Ii(t,!0,!0,!0)}function Pi(t,i,e){return"object"!=M(t)&&("function"==typeof i&&(e=i,i=""),t={text:t,type:i,callback:e}),t}function Vi(){var t=Pi.apply(this,arguments);return t.type=t.type||"confirm",Ti(t)}function Hi(){var t=Pi.apply(this,arguments);return t.type=t.type||"alert",Fi(t)}function Ri(t,i,e,s){switch((t=function n(t,i,e,s){return"object"!=M(t)&&(t={text:t,type:i,expire:e,id:s}),t.id=t.id||ci("message"),t.expire=t.expire||Bi.expire,t}.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return Ai(t);case"confirm":return Ti(t);case"modalbox":return Fi(t);case"prompt":return zi(t);default:return function r(t){Bi.area||(Bi.area=document.createElement("DIV"),Bi.area.className="webix_message_area",Bi.area.style[Bi.position]="5px",document.body.appendChild(Bi.area)),Bi.area.setAttribute("role","alert"),Bi.area.setAttribute("aria-atomic",!0),Bi.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(){t&&Bi.hide(t.id),t=null},"bottom"==Bi.position&&Bi.area.firstChild?Bi.area.insertBefore(i,Bi.area.firstChild):Bi.area.appendChild(i),0<t.expire&&(Bi.timers[t.id]=window.setTimeout(function(){Bi.hide(t.id)},t.expire)),i.style.height=i.offsetHeight-2+"px",Bi.pull[t.id]=i,i=null,t.id}(t)}}Qt(document,"keydown",ki,{capture:!0}),Hi.pull={},Hi.order=[],Hi.hide=function(t){if(t&&Hi.pull[t]){var i=Hi.pull[t].Qt;i&&(i.parentNode.removeChild(i),Hi.order.splice(Hi.order.indexOf(t),1),Ci(!1,Hi.pull[t].container),delete Hi.pull[t])}},Hi.hideAll=function(){for(var t in Hi.pull)this.hide(t)};var Bi=Ri;Bi.expire=4e3,Bi.keyboard=!0,Bi.position="top",Bi.pull={},Bi.timers={},Bi.hideAll=function(){for(var t in Bi.pull)Bi.hide(t)},Bi.hide=function(t){var i=Bi.pull[t];i&&i.parentNode&&(window.setTimeout(function(){i.parentNode.removeChild(i),i=null},2e3),i.style.height=0,i.className+=" hidden",Bi.area.removeAttribute("role"),Bi.timers[t]&&window.clearTimeout(Bi.timers[t]),delete Bi.pull[t])},t("message",Ri);var Ei={set:function(t,i){i=i||{},this.Ht&&this.exit(),ai(t)?t=ai(t):("string"==typeof t&&(t=document.getElementById(t)),t instanceof Element&&(t={$view:t,$html:!0})),this.Ht=t,this.ti=this.ii();var e=t.config;return t.setPosition?(e.fullscreen=!0,t.resize(),t):(this.ei=ni({view:"window",head:this.si(i),css:i.css||"",fullscreen:!0,borderless:!0,body:{rows:[]}}),e&&(this.ni={width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,height:e.height,minHeight:e.minHeight,maxHeight:e.maxHeight}),t.getParentView&&t.getParentView()?(this.ri=t.getParentView(),this.ri.index&&(this.ti.index=this.ri.index(t),this.ti.active=!!this.ri.getActiveId&&this.ri.getActiveId()==e.id)):(this.ri=t.$view.parentNode,this.ti.node=lt("div"),this.ri.replaceChild(this.ti.node,t.$view)),this.ei.getBody().addView(t.$html?{view:"template",content:t.$view,
css:"webix_fullscreen_html"}:t),this.ei.show(),this.hi(t),this.ei)},exit:function(){if(this.Ht){var t=this.Ht.config;this.ii(!0),this.Ht.setPosition?(t.fullscreen=!1,this.Ht.resize()):(this.ri instanceof Element?(this.Ht.mt=null,this.Ht.oi&&this.Ht.oi(this.Ht.config),this.ri.replaceChild(this.Ht.$view,this.ti.node)):z(this.ti.index)?(this.Ht.mt=this.ri,this.ri.Tt(this.Ht)):(this.ri.addView(this.Ht,this.ti.index),this.ti.active&&this.Ht.show(!1,!1)),this.hi(this.Ht,this.ni),this.Ht.$html||(this.ei.getBody().ai=[]),this.ei.close()),this.ci()}},ci:function(){delete this.ri,delete this.Ht,delete this.ni,delete this.ti,delete this.ei},ii:function(i){var e=this,t=this.Ht,s={};if(t.setPosition)i?t.setPosition(this.ti.left,this.ti.top):(s.left=t.config.left,s.top=t.config.top,t.setPosition(0,0));else{var n=t.$view.style;["position","top","bottom","left","right"].forEach(function(t){n[t]=i?e.ti[t]:(s[t]=n[t],"position"==t?"relative":0)})}return s},hi:function(t,i){t.$html||(i=i||{height:0,minHeight:0,maxHeight:0,width:0,minWidth:0,maxWidth:0},t.define(i),t.resize())},si:function(t){var i=this;return!1===t.head||"object"==M(t.head)?t.head:{cols:[{template:t.head||"",type:"header",borderless:!0},{view:"icon",icon:"wxi-close",click:function(){i.exit()}}]}}},ji={Ht:null,fi:{},bt:0,li:0,di:0,vi:{esc:"escape",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pgdown:"pagedown",pgup:"pageup",space:" ",multiply:"*",add:"+",subtract:"-",decimal:".",divide:"/",pausebreak:"pause","5numlocked":"clear"},_i:{input:1,button:1,textarea:1,select:1},pi:function(){Qt(document,"keydown",this.mi,{bind:this}),Qt(document.body,"click",this.bi,{capture:!0,bind:this}),Qt(document.body,"mousedown",function(){this.di=new Date},{bind:this}),Qt(document.body,"focus",this.gi,{capture:!0,bind:this}),ei.destructors.push({obj:this})},destructor:function(){ji.Ht=null},getFocus:function(){return this.Ht},Bt:function(t){this.wi=this.wi||t.B.id},setFocus:function(t,i,e){return(t=ai(t))&&!t.$view&&(t=null),this.bt=ei.bt=new Date,this.Ht===t||(this.Ht&&this.Ht.callEvent&&this.Ht.callEvent("onBlur",[this.Ht]),t&&t.callEvent&&(t.callEvent("onFocus",[t,this.Ht]),e&&t.callEvent("onTabFocus",[t,this.Ht])),w("onFocusChange",[t,this.Ht]),this.Ht&&this.Ht.blur&&!i&&this.Ht.blur(),(this.Ht=t)&&t.focus&&!i&&t.focus()),!0},applyChanges:function(t){var i=this.getFocus();i&&i!=t&&i.xi&&i.xi(t)},hasFocus:function(t){return t===this.Ht},yi:function(t){for(var i=0;i<Hi.order.length;i++)if(Hi.pull[Hi.order[i]].Qt.contains(t.target))return;var e=pt(t,"view_id")||this.wi;return e=ai(e),this.wi=null,ei.bt=new Date,e==this.Ht||(e?this.canFocus(e)?this.Ht&&this.Ht.getFormView()==e&&this.Ht.focus?this.Ht.focus():this.setFocus(e):e.$view.contains(t.target)&&t.target.blur():this.setFocus(null)),!0},bi:function(t){return new Date-this.bt<100?(this.wi=null,!1):this.yi(t)},gi:function(t){return!!this._i[t.target.nodeName.toLowerCase()]&&this.yi(t)},Mi:function(t){var i=ei.St;return!i.length||((t.queryView(function(t){return!t.getParentView()},"parent")||t).$view.style.zIndex||0)>=Math.max.apply(Math,o(i))},canFocus:function(t){return!(document.body.modality||t.$view.modality||t.queryView(function(t){return t.$view.modality},"parent"))&&(t.isVisible()&&t.isEnabled()&&!t.config.disabled&&this.Mi(t)&&!t.queryView({disabled:!0},"parent"))},Si:function(t){var i=this.getFocus();if(t&&!this.ki(t,i))return!1;this.Ci("getPrev",t)||(this.Ht=null)},ki:function(t,i){if(!t)return!1;if(!i)return!1;for(;i;){if(i===t)return!0;i=i.getParentView()}return!1},$i:function(){this&&this.callEvent&&this.callEvent("onTimedKeyPress",[])},mi:function(t){var i=t.which||t.keyCode;95<i&&i<106&&(i-=48);var e=this.getFocus();if(e&&e.callEvent&&(!1===e.callEvent("onKeyPress",[i,t])&&wt(t),e.hasEvent("onTimedKeyPress")&&(clearTimeout(e.Di),e.Di=C(this.$i,e,[],e.B.keyPressTimeout||250))),!1===this.Ii(t))return wt(t),!1},Ci:function(t,i){var e=i||this.getFocus();if(e){t=t||"getNext";for(var s=e,n=$();;){if((e=this[t](e))&&this.canFocus(e))return this.setFocus(e);if(e===s||e.$fmarker==n
)return i&&document.activeElement.blur(),null;e.$fmarker=n}}},Ai:function(t,i){var e=!i.shiftKey;if(ji.li=new Date,t&&t.Ti&&!t.Ti(e,i))return!1;if(t&&t.Fi){if(t.editNext)return t.editNext(e);if(t.editStop)return t.editStop(),!0}else C(function(){if((t=ai(document.activeElement))&&!ji.canFocus(t))return ji.Ci(e?"getNext":"getPrev",t);ji.setFocus(t,!0,!0)})},getTop:function(t){for(var i,e=ai(t);e&&(i=e.getParentView());)e=i;return e},getNext:function(t,i){var e=t.getChildViews();if(e.length&&!i)for(var s=0;s<e.length;s++)if(this.canFocus(e[s]))return e[s];var n=t.getParentView();if(!n)return t;var r=n.getChildViews();if(r.length)for(var h=x.find.call(r,t)+1;h<r.length;){if(this.canFocus(r[h]))return r[h];h++}return this.getNext(n,!0)},getPrev:function(t,i){var e=t.getChildViews();if(e.length&&i)for(var s=e.length-1;0<=s;s--)if(this.canFocus(e[s]))return this.getPrev(e[s],!0);if(i&&this.canFocus(t))return t;var n=t.getParentView();if(!n)return this.canFocus(t)?this.getPrev(t,!0):t;var r=n.getChildViews();if(r)for(var h=x.find.call(r,t)-1;0<=h;){if(this.canFocus(r[h]))return this.getPrev(r[h],!0);h--}return this.getPrev(n,!0)},addHotKey:function(t,i,e){var s=this.zi(t);return e||(e=null),this.fi[s]||(this.fi[s]=[]),this.fi[s].push({handler:i,view:e}),t},removeHotKey:function(t,i,e){var s=this.zi(t);if(i||e){var n=this.fi[s];if(n){for(var r=n.length-1;0<=r;r--)e&&n[r].view!==e||i&&n[r].handler!==i||n.splice(r,1);n.length||delete this.fi[s]}}else delete this.fi[s]},Pi:function(t,i,e,s,n){return(t||"").toLowerCase()+"_"+["",i?"1":"0",e?"1":"0",s?"1":"0",n?"1":"0"].join("")},Ii:function(t){var i=t.which||t.keyCode,e=!t.ctrlKey&&!t.altKey&&!t.metaKey&&9!=i&&27!=i&&13!=i,s=this.Pi(t.key,t.ctrlKey,t.shiftKey,t.altKey,t.metaKey),n=this.getFocus();return this.fi[s]?this.Vi(this.fi[s],n,t):!e||!this.fi.any_0000||this.Vi(this.fi.any_0000,n,t)},Vi: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 r=n.handler(i,e);if(!!r===r)return r}}return!0},zi:function(t){var i,e,s,n,r=this.vi,h=t.toLowerCase().split(/[ +\-_]/);i=e=s=n=0;for(var o="",a=0;a<h.length;a++)"ctrl"===h[a]?i=1:"shift"===h[a]?e=1:"alt"===h[a]?s=1:"command"===h[a]?n=1:o=r[h[a]]||h[a];return this.Pi(o,i,e,s,n)},getState:function(t,i){i=i||!1;var e={id:(t=ai(t)).config.id,width:t.config.width,height:t.config.height,gravity:t.config.gravity};if(z(t.config.collapsed)||(e.collapsed=t.config.collapsed),"tabs"!==t.name&&"tabbar"!==t.name||(e.activeCell=t.getValue()),i&&(e=[e],t.ai))for(var s=0;s<t.ai.length;s++)e=e.concat(this.getState(t.ai[s],i));return e},setState:function(t){I(t)||(t=[t]);for(var i=0;i<t.length;i++){var e=t[i],s=ai(e.id);s&&(z(e.collapsed)||s.define("collapsed",e.collapsed),z(e.activeCell)||s.setValue(e.activeCell,"auto"),s.define("width",e.width),s.define("height",e.height),s.define("gravity",e.gravity))}var n=ai(t[0].id);n&&n.resize()}};mi(function(){ji.pi(),ji.addHotKey("enter",function(t,i){if(t&&t.callEvent&&t.callEvent("onEnter",[i]),t&&t.editStop&&t.Fi)return t.editStop(),!0;if(t&&t.touchable){var e=t.getFormView();e&&!t.Hi&&e.callEvent("onSubmit",[t,i])}}),ji.addHotKey("esc",function(t){if(t){if(t.editCancel&&t.Fi)return t.editCancel(),!0;var i=t.getTopParentView();i&&i.setPosition&&(Ei.ei==i&&Ei.exit(),i.Ri())}}),ji.addHotKey("shift+tab",ji.Ai),ji.addHotKey("tab",ji.Ai)}),t("UIManager",ji);var Li={$init:function(){this.B=this.config={}},define:function(t,i){return"object"==M(t)?this.Bi(t):this.Ei(t,i)},Ei:function(t,i){var e=this[t+"_setter"];return this.B[t]=e?e.call(this,i,t):i},Bi:function(t){if(t)for(var i in t)this.Ei(i,t[i])},Rt:function(t,i){var e={};i&&(e=F.extend(e,i)),"object"!=M(t)||t.tagName||F.extend(e,t,!0),this.Bi(e)},ji:function(t,i){for(var e in i)switch(M(t[e])){case"object":t[e]=this.ji(t[e]||{},i[e]);break;case"undefined":t[e]=i[e]}return t}},Oi={$init:function(){var t=this.Pt=this.Pt||{obj:this};ei.destructors.push(t)},destructor:function(){var t=this.B;if(this.Li&&this.editCancel(),this.callEvent&&this.callEvent("onDestruct",[]),
this.destructor=function(){},this.Pt.obj=null,this.getChildViews){var i=this.getChildViews();if(i)for(var e=0;e<i.length;e++)i[e].destructor();if(this.Vt)for(var s=0;s<this.Vt.length;s++)this.Vt[s].destructor()}if(delete ni.views[t.id],t.$id){var n=this.getTopParentView();n&&n.Oi&&n.Oi(t.$id)}this.Ni=null,this.Wi=null,this.Yi=null,this.Ui&&(this.Ui.innerHTML="",this.Ui.Ni=null),this.zt&&this.zt.parentNode&&this.zt.parentNode.removeChild(this.zt),this.data&&this.data.destructor&&this.data.destructor(),this.unbind&&this.unbind(),this.data=null,this.mt=null,this.zt=this.$view=this.Ui=this.tt=null,this.o=this.u=this.l={},ji.Ht==this&&(ji.Ht=null);var r=t.url;r&&r.$proxy&&r.release&&r.release(),this.$scope=null,this.$destructed=!0}};Qt(window,"unload",function(){w("unload",[]),ei.xt=!0;for(var t=0;t<ei.destructors.length;t++){var i=ei.destructors[t].obj;i&&i.destructor()}ei.destructors=[],ei.kt=T(),Jt()});var Ni={$init:function(){this.qi=null,this.attachEvent("onSelectChange",function(){var t=this.getSelectedId();this.setCursor(t?t.id||t:null)}),this.attachEvent("onAfterCursorChange",this.Gi),this.attachEvent("onAfterDelete",function(t){t==this.getCursor()&&this.setCursor(null)}),this.data.attachEvent("onStoreUpdated",k(function(t,i,e){t&&t==this.getCursor()&&"paint"!=e&&"delete"!=e&&this.Gi()},this)),this.data.attachEvent("onClearAll",k(function(){this.qi=null},this)),this.data.attachEvent("onIdChange",k(function(t,i){this.qi==t&&(this.qi=i,this.Gi())},this))},refreshCursor:function(){this.qi&&this.callEvent("onAfterCursorChange",[this.qi])},setCursor:function(t){t==this.qi||null!==t&&!this.getItem(t)||(this.callEvent("onBeforeCursorChange",[this.qi]),this.qi=t,this.callEvent("onAfterCursorChange",[t]))},getCursor:function(){return this.qi},Xi: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.B.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.Ki(t,i,s))}},Wi={$init:function(){this.attachEvent("onChange",this.Gi)},Xi:function(t,i,e){i=i||"value";var s=this.getValue()||"";if(e&&(s=e(s)),t.setValue)t.setValue(s,"auto");else if(t.filter)t.data.silent(function(){this.filter(i,s)});else{var n={};n[i]=s,t.J(s)&&t.setValues(n,!1,"auto")}t.callEvent("onBindApply",[s,i,this])}},Yi={$init:function(){this.attachEvent("onChange",this.Gi)},Xi:function(t,i,e){var s=this.getValues()||null;e&&(s=e(s)),this.Ki(t,i,s)}},Ui={$init:function(){this.Ji={},this.Zi={},this.Qi={},this.te(this)},saveBatch:function(t){this.ie=!0,t.call(this),this.ie=!1,this.Gi()},setBindData:function(t,i){if(i&&(this.Qi[i]=!0),this.setValue)this.setValue(t,"auto");else if(this.setValues)this.setValues(t,!1,"auto");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=ai(t);e.isVisible(e.B.id)&&(this.Zi[t]=!0,this.Xi(e,this.Ji[t][0],this.Ji[t][1]),i&&e.filter&&e.refresh())},addBind:function(t,i,e){this.Ji[t]=[i,e]},removeBind:function(t){delete this.Ji[t],delete this.Zi[t],delete this.Qi[t]},te:function(t){t.filter?F.extend(this,Ni):t.setValue?F.extend(this,Wi):F.extend(this,Yi)},Gi:function(){if(!this.ie)for(var t in this.Ji)this.Qi[t]||(this.Zi[t]=!1,this.getBindData(t,!0))},Ki:function(t,i,e){t.setValue?t.setValue(e&&i?e[i]:e,"auto"):t.filter?t.data.silent(function(){this.filter(i,e)}):!e&&t.clear?t.clear("auto"):t.J(e)&&t.setValues(l(e),!1,"auto"),t.callEvent("onBindApply",[e,i,this])}},qi={bind:function(t,i,e){this.attachEvent||F.extend(this,b),"string"==typeof t&&(t=ai(t)),t.ee&&t.ee(),this.ee&&this.ee(),t.getBindData||F.extend(t,Ui),this.se(),t.addBind(this.B.id,i,e),this.ne=t.B.id,this.re=this.B.id,this.he=this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return t.getBindData(this.re)}),this.refresh&&this.isVisible(this.re)&&this.refresh()},unbind:function(){if(this.ne){var t=ai(
this.ne);t&&t.removeBind(this.re),this.detachEvent(this.he),this.ne=this.he=null}},se:function(){var t=this.B;if(this.filter){var i=t.id;this.data.oe=k(function(){ai(this.ne).Zi[i]=!1},this)}var e=this.render;this.render=function(){if(!this.ae){this.ae=!0;var t=this.callEvent("onBindRequest");return this.ae=!1,e.apply(this,!1===t?arguments:[])}},(this.getValue||this.getValues)&&(this.save=function(t){var i=ai(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.B.id),this.setDirty&&this.setDirty(!1)}}),this.se=function(){}}},Gi=window.webix_view||{},Xi={name:"baseview",$init:function(t){t.id||(t.id=ci(this.name)),this.mt=ei.mt,ei.mt=null,this.$scope=t.$scope||(this.mt?this.mt.$scope:ei.ft),this.zt||(this.Ui=this.zt=lt("DIV",{"class":"webix_view"}),this.$view=this.zt)},$skin:!1,defaults:{width:0,height:0,gravity:1},getNode:function(){return this.zt},$setNode:function(t){this.zt=this.tt=this.$view=t},getParentView:function(){return this.mt||null},getTopParentView:function(){var t=this.getParentView();return t?t.getTopParentView():this},getFormView:function(){var t=this.getParentView();return!t||t.ue?t:t.getFormView()},getChildViews:function(){return[]},queryView:function(s,t){var i;if("string"==typeof s&&(s={view:s}),i="object"===M(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.ce:this.fe,r=this.le(i,n,e);return"all"===t?e:r},fe:function(t){return t.getChildViews()},ce:function(t){var i=t.getParentView();return i?[i]:[]},le: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 r=s[n].le(t,i,e);if(r&&!e)return r}return null},isVisible:function(t){if(this.B.hidden)return t&&(this.de||(this.de=[],this.ve={}),this.ve[t]||(this.ve[t]=!0,this.de.push(t))),!1;var i=this.getParentView();return!i||i.isVisible(t,this.B.id)},isEnabled:function(){if(this._e)return!1;var t=this.getParentView();return!t||t.isEnabled()},pe:function(){this._e&&!this._e.parentNode&&this.zt.appendChild(this._e)},disable:function(){vt(this._e),this.B.disabled=!0,this._e=lt("div",{"class":"webix_disabled"}),this.zt.appendChild(this._e),this.zt.setAttribute("aria-disabled","true"),Mt(this.zt,"webix_disabled_view",!0),ji.Si(this)},enable:function(){this.B.disabled=!1,this._e&&(vt(this._e),St(this.zt,"webix_disabled_view"),this.zt.removeAttribute("aria-disabled"),this._e=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"==M(t)&&(t=ut(t)),this.zt.className+=" "+t,t},id_setter:function(t){if(ei.lt&&(ei.lt!=this||this.me)){var i=this.config.$id=t;t=ci(((this.me||ei.lt).be[t]=this).name),(this.me||ei.lt).ge[t]=i}return ni.views[t],(ni.views[t]=this).zt.setAttribute("view_id",t),t},$setSize:function(t,i){var e=this.we;return(!e||e[0]!=t||e[1]!=i)&&(this.we=[t,i],this.$width=this.xe=t-(this.ye?G.scrollSize:0),this.$height=this.Me=i-(this.Se?G.scrollSize:0),this.B.flex||(this.zt.style.width=t+"px",this.zt.style.height=i+"px"),!0)},$getSize:function(t,i){var e=this.B,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.B.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.B.animate&&e.B.animate&&(i=F.extend(e.B.animate?F.extend({},e.B.animate):{},this.B.animate,!0)),(s?e.ke:e.Ri)&&(s?e.ke:e.Ri).call(e,this,i),s&&this.Ce(),t&&s&&e.show(!e.$$&&t)):this.B.hidden?s&&(D(this.B.At||document.body).appendChild(this.zt),this.B.hidden=!1,this.adjust(),this.callEvent&&(this.callEvent("onViewShow",[]),this.$e&&_i(this,this.$e)),this.Ce()):s||(this.B.hidden=this.B.It=!0,this.zt&&(this.B.At=this.zt.parentNode,vt(this.zt)))},Ce:function(){if(
this.de){for(var t=0;t<this.de.length;t++){var i=ai(this.de[t]);i&&i.render()}this.de=[],this.ve={}}},De:function(t,i){var e=i.target,s=e.getAttribute("role");13!==t&&32!==t||"button"!=s&&"tab"!=s||this.B.disabled||(yt(e,"MouseEvents","click"),wt(i))},hidden_setter:function(t){return t&&this.hide(),this.B.hidden},hide:function(){this.show(null,null,!0),ji.Si(this)},adjust:function(){if(!this.zt.parentNode)return!1;var t=this.zt.parentNode.clientWidth||0,i=this.zt.parentNode.clientHeight||0,e=this.$getSize(0,0),s=this.zt.parentNode==document.body&&!this.setPosition;e[0]>t&&(t=e[0]),e[2]>i&&(i=e[2]),(!s||this.B.width)&&t>e[1]&&(t=e[1]),(!s||this.B.height)&&i>e[3]&&(i=e[3]),this.$setSize(t,i),ei.vt&&(ei.vt=!1,this.adjust())},resize:function(){if(!(ei.dt||ei.pt||ei._t)){var t=this.getParentView();t?t.resizeChildren?t.resizeChildren():t.resize():(this.adjust(),w("onResize",[]))}}},Ki={api:Xi,view:F.protoUI(Xi,Li,Oi,qi,Gi)},Ji={name:"view",$init:function(t){this.oi(t)},oi:function(t){var i=z(t.borderless);i&&!this.setPosition&&t.$topView&&(i=!(t.borderless=!0)),i&&this.defaults.borderless||t.borderless?t.Dt={top:!0,left:!0,bottom:!0,right:!0}:(t.Dt||(t.Dt={}),this.Ui.style.borderWidth="1px")},$getSize:function(t,i){var e=this.B.Dt;return e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1)),Ki.api.$getSize.call(this,t,i)},$setSize:function(t,i){var e=this.B.Dt;return e&&(t-=(e.left?0:1)+(e.right?0:1),i-=(e.top?0:1)+(e.bottom?0:1)),Ki.api.$setSize.call(this,t,i)}},Zi=F.protoUI(Ji,Ki.view),Qi={api:Ji,view:Zi};Zi.call(-1);var te=F.proto({$init:function(){this.type=l(this.type)},customize:function(t){ii(this,t)},template_setter:function(t){this.type.template=qt(t)},Q:function(t){var i=this.type;return(i.templateStart?i.templateStart(t,i):"")+i.template(t,i)+(i.templateEnd?i.templateEnd(t,i):"")}},Gt),ie={name:"tooltip",defaults:{dy:0,dx:20},$init:function(t){"string"==typeof t&&(t={template:t}),this.$view=this.zt=this.Ui=this.tt=lt("DIV",{role:"alert","aria-atomic":"true"}),this.zt.className=this.Ot,_t(this.Ui,document.body.firstChild,document.body)},adjust:function(){},isVisible:function(){return this.Ie},Ae:function(t){this.callEvent("onBeforeRender",[t])&&(this.tt.innerHTML="",this.tt.innerHTML=t,this.callEvent("onAfterRender",[]))},Ot:"webix_tooltip",css_setter:function(t){return"object"===M(t)&&(t=ut(t)),this.zt.className=this.Ot+" "+t,t},show:function(t,i){if(!this.Te)if(this.Ie=!0,"string"==typeof t?this.Ae(t):(this.data=F.extend({},t),this.render()),this.tt.firstChild){var e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),s=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=e-i.x,r=s-i.y;this.Ui.style.display="block",n-this.B.dx>this.Ui.offsetWidth?n=i.x:(n=i.x-2*this.B.dx-this.Ui.offsetWidth)<0&&(n=0),r-this.B.dy>this.Ui.offsetHeight?r=i.y:(r=i.y-2*this.B.dy-this.Ui.offsetHeight)<0&&(r=0),this.Ui.style.left=n+this.B.dx+"px",this.Ui.style.top=r+this.B.dy+"px"}else this.hide()},hide:function(){this.Ie&&(this.data=null,this.Ui.style.display="none",this.Ie=!1)},disable:function(){this.Te=!0},enable:function(){this.Te=!1},type:{template:qt("{obj.value}"),templateStart:qt.empty,templateEnd:qt.empty}},ee=(F.protoUI(ie,te,Li,b,Qi.view),{tooltip_setter:function(t){return t?("function"!=typeof t&&"string"!=typeof t||(t={template:t}),"object"!==M(t)&&(t={}),t.overflow&&z(t.template)&&(t.template=""),this.Fe(),t):this.B.tooltip?{template:""}:void 0},Fe:function(){ui.addTooltip(this),this.attachEvent("onDestruct",function(){ui.removeTooltip(this)}),this.attachEvent("onAfterScroll",function(){ui.jt&&ui.Ut()}),this.Fe=function(){}},$tooltipIn:function(t){var i=ui.Lt,e=F.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.B.tooltip,!0);return i.define(e),t},$tooltipOut:function(){return ui.Ut(),null},$tooltipMove:function(t,i,e){var s=this.B.tooltip,n=!s||z(s.overflow)?ui.overflow:s.overflow,r=!s||z(s.delay)?ui.delay:s.delay,h=n?e.overflow:e.first;0<r&&ui.Ut(),ui.Kt=C(this.ze,this,[t,i,h],r)},ze:function(t,i,e){var s=e||this.Pe(t,i);s&&this.isVisible()&&ui.Lt.show(s,gt(i))},
Pe:function(t,i){if(this.locate&&this.getItem){var e=this.locate(i);return e?this.getItem(e):null}return this.B}}),se=F.proto({$init:function(t){this.Ve=[],this.He=z(t.series)?t.name:t.series,this.Re=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.Be(t.name,s,i,e,t.title)},Be:function(t,i,e,s,n){return this.Ee=lt("canvas",{title:n,width:e,height:s,canvas_id:t,style:i||""}),this.Re.appendChild(this.Ee),this.Ee},getCanvas:function(t){var i=(this.Ee||this.Be(this.Ui)).getContext(t||"2d");return this.je||(this.je=!0,i.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)),i},Le:function(t,i){this.Ee&&(this.Ee.setAttribute("width",t*(window.devicePixelRatio||1)),this.Ee.setAttribute("height",i*(window.devicePixelRatio||1)),this.Ee.style.width=t+"px",this.Ee.style.height=i+"px",this.je=!1)},renderText:function(t,i,e,s,n){if(e){n&&(n=Math.max(n,0)),i&&(i=Math.max(i,0));var r=lt("DIV",{"class":"webix_canvas_text"+(s?" "+s:""),style:"left:"+t+"px; top:"+i+"px;","aria-hidden":"true"},e);return this.Re.appendChild(r),this.Ve.push(r),n&&(r.style.width=n+"px"),r}},renderTextAt:function(t,i,e,s,n,r,h){var o=this.renderText.call(this,e,s,n,r,h);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(vt(this.Ve),this.Ve=[],!t&&this.Re.Ni){for(i=this.Oe();i.length;)i[0].parentNode.removeChild(i[0]),i.splice(0,1);i=null,this.Re.Ni.getElementsByTagName("AREA").length||(this.Re.Ni.parentNode.removeChild(this.Re.Ni),this.Re.Ni=null)}this.getCanvas().clearRect(0,0,this.Ee.offsetWidth||Math.floor(this.Ee.width/(window.devicePixelRatio||1)),this.Ee.offsetHeight||Math.floor(this.Ee.height/(window.devicePixelRatio||1)))},toggleCanvas:function(){this.Ne("none"==this.Ee.style.display)},showCanvas:function(){this.Ne(!0)},hideCanvas:function(){this.Ne(!1)},Ne:function(t){var i,e;for(e=0;e<this.Ve.length;e++)this.Ve[e].style.display=t?"":"none";if(this.Re.Ni)for(i=this.Oe(),e=0;e<i.length;e++)t?i[e].removeAttribute("disabled"):i[e].setAttribute("disabled","true");this.Ee.style.display=t?"":"none"},Oe:function(){var t,i,e=[];for(t=this.Re.Ni.getElementsByTagName("AREA"),i=0;i<t.length;i++)t[i].getAttribute("userdata")==this.He&&e.push(t[i]);return e}}),ne=function(t,i){var e=i;if(I(t))for(var s=0;s<t.length;s++){if(I(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)ne(t[s],e);else{var n=l(e);0===s&&(n.type="flipback"),1==s&&(n.callback=null),ne(t[s],n)}}else{var r=D(t);r.We?ne.end(r,e):ne.start(r,e)}};ne.end=function(t,i){t.style[G.transitionDuration]="1ms",t.We=null,ei.Ct&&window.clearTimeout(ei.Ct),ei.Ct=C(ne,this,[t,i],10)},ne.isSupported=function(){return G.transform&&G.transition&&!G.isOpera},ne.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=G.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="":_t(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),_t(i,t.nextSibling,t.parentNode)),[t,i]},ne.breakLine=function(t){arguments[1]?t[1].style.display="none":vt(t[1]),ne.clear(t[0]),ne.clear(t[1]),t[0].style.position=""},ne.clear=function(t){t.style[G.transform]="none",t.style[G.transition]="none",t.style.top=t.style.left=""},ne.defaults={type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0},ne.start=function(s,t){"string"==typeof t&&(t={type:t}),t=Li.ji(t,ne.defaults);var i,e,n=G.cssPrefix,r=s.We=t;switch("slide"==r.type&&r.direction){case"right":
r.x=s.offsetWidth;break;case"left":r.x=-s.offsetWidth;break;case"top":r.y=-s.offsetHeight;break;case"bottom":default:r.y=r.y||s.offsetHeight}"flip"!=r.type&&"flipback"!=r.type||(i=[0,0],e="scaleX","vertical"==r.subtype?(i[0]=20,e="scaleY"):i[1]=20,"right"!=r.direction&&"bottom"!=r.direction||(i[0]*=-1,i[1]*=-1));var h=r.duration+"ms "+r.timing+" "+r.delay+"ms",o=n+"TransformStyle: preserve-3d;",a="",u="";switch(r.type){case"fade":a="opacity "+h,o="opacity: 0;";break;case"show":a="opacity "+h,o="opacity: 1;";break;case"flip":h=r.duration/2+"ms "+r.timing+" "+r.delay+"ms",u="skew("+i[0]+"deg, "+i[1]+"deg) "+e+"(0.00001)",a="all "+h;break;case"flipback":r.delay+=r.duration/2,h=r.duration/2+"ms "+r.timing+" "+r.delay+"ms",s.style[G.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 "+h;break;case"slide":var c=r.x+"px",f=r.y+"px";u=G.translate+"("+c+", "+f+("translate3d"==G.translate?", 0":"")+")",a=n+"transform "+h}C(function(){s.style[G.transition]=a,C(function(){o&&(s.style.cssText+=o),u&&(s.style[G.transform]=u);var i=!1,e=Qt(s,G.transitionEnd,function(t){s.We=null,r.callback&&r.callback.call(r.master||window,s,r,t),i=!0,ti(e)});window.setTimeout(function(){if(!i){var t=r.master||window;s.We=null,!t.$destructed&&r.callback&&r.callback.call(t,s,r),i=!0,ti(e)}},1.3*(1*r.duration+1*r.delay))})})};var re,he;function oe(t){if(ae[t],he!==t)for(var i in ae.$active=re=ae[t],ae.$name=he=t,ni){var e=ni[i];e&&e.prototype&&e.prototype.$skin&&e.prototype.$skin(e.prototype)}}var ae={set:oe,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,timelineItemHeight:70,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,dataPadding:12,calendarWeekHeaderHeight:18,padding:0,accordionType:"accordion",optionHeight:32,timelineColor:"#1CA1C1",backColor:"#ffffff",colorPadding:4},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,timelineItemHeight:50,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,dataPadding:12,calendarWeekHeaderHeight:18,padding:0,accordionType:"accordion",optionHeight:24,timelineColor:"#1CA1C1",backColor:"#ffffff",colorPadding:4},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,timelineItemHeight:70,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,dataPadding:10,
calendarWeekHeaderHeight:24,padding:0,accordionType:"accordion",optionHeight:32,timelineColor:"#3498db",backColor:"#ffffff",colorPadding:4},compact:{topLayout:"space",barHeight:34,tabbarHeight:34,sidebarTitleHeight:34,rowHeight:24,toolbarHeight:34,listItemHeight:28,unitHeaderHeight:20,propertyItemHeight:24,timelineItemHeight:50,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,inputSpacing:4,borderWidth:1,sliderHandleWidth:10,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,dataPadding:10,calendarWeekHeaderHeight:24,padding:0,accordionType:"accordion",optionHeight:23,timelineColor:"#3498db",backColor:"#ffffff",colorPadding:4},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,timelineItemHeight:70,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,dataPadding:10,calendarWeekHeaderHeight:24,padding:0,accordionType:"accordion",optionHeight:32,timelineColor:"#b300b3",backColor:"#393939",colorPadding:4}};oe(window.webix_skin||"material");var ue={config:{longTouchDelay:1e3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500,ellastic:!0},limit:function(t){ue.Ye=!1!==t},disable:function(){ue.Te=!0},enable:function(){ue.Te=!1},$init:function(){ue.$init=function(){},Qt(document.body,fe.down,ue.Ue,{passive:!1}),Qt(document.body,fe.move,ue.qe,{passive:!1}),Qt(document.body,fe.up,ue.Ge),Qt(document.body,"dragstart",function(t){if(!ue.Te&&!ue.Ye)return wt(t)}),ue.Xe(),ue.Ke=[null,null],ue.$active=!0},Xe:function(){ue.Je=ue.Ze=ue.Qe=ue.ts=null,ue.es=ue.ss=ue.ns=ue.rs=null,ue.hs={os:0,us:0,cs:0},ue.fs&&(St(ue.fs,"webix_touch"),ue.fs=null),window.clearTimeout(ue.ls),ue.ds=!0,ue.vs=!0,ue._s=!0,ue.ps||ue.ms()},Ge:function(t){if(ue.Je){if(ue.es){var i=ue.bs(ue.ss),e=i.e,s=i.f,n=ue.config.finish,r=ue.gs(t,!0),h=ai(ue.ss),o=h&&h.$scroll?h.$scroll.gravity:ue.config.gravity;if(r.cs){var a=e+o*r.os/r.cs,u=s+o*r.us/r.cs,c=ue.Ke[0]?ue.ws(a,!1,!1,ue.ns.dx,ue.ns.px):e,f=ue.Ke[1]?ue.ws(u,!1,!1,ue.ns.dy,ue.ns.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};(h=ai(ue.ss))&&h.adjustScroll&&h.adjustScroll(d),n=Math.max(100,n),e!=d.e||s!=d.f?(ue.xs(ue.ss,d.e,d.f,n+"ms"),ue.ys&&ue.ys.Ms(d.e,d.f,n+"ms"),ue.Ss(d.e,d.f,n+"ms")):ue.ms()}else ue.ms()}else ue.rs||(ue._s&&!ue.vs?ue.ks("onSwipeX"):ue.vs&&!ue._s&&ue.ks("onSwipeY"));ue.ks("onTouchEnd"),ue.Xe()}},qe:function(t){if(ue.ts&&ue.Je){var i=ue.gs(t);if(ue.ks("onTouchMove"),ue.es)ue.Cs(i);else if(ue.vs=ue.$s(i.Ds,"x",ue.vs),ue._s=ue.$s(i.Is,"y",ue._s),ue.es){var e=ue.As("onBeforeScroll",!0);if(e){var s={};e.callEvent("onBeforeScroll",[s]),s.update&&(ue.config.speed=s.speed,ue.config.scale=s.scale)}ue.Ts(i)}else if(G.isMac){var n=ai(ue.Je);if(n&&n.$hasYScroll&&n.$hasYScroll()&&t.cancelable)return wt(t)}return ue.es&&t.cancelable?wt(t):void 0}},Cs:function(){if(ue.ss){var t=ue.bs(ue.ss),i=ue.Qe||ue.Je,e=ai(ue.ss),s=e&&e.$scroll?e.$scroll.ellastic:ue.config.ellastic;ue.Ke[0]&&(t.e=ue.ws(t.e-i.x+ue.Ze.x,s,t.e,ue.ns.dx,ue.ns.px)),ue.Ke[1]&&(t.f=ue.ws(t.f-i.y+ue.Ze.y,s,t.f,ue.ns.dy,ue.ns.py)),ue.xs(ue.ss,t.e,t.f,"0ms"),ue.ys&&ue.ys.Ms(t.e,t.f,"0ms"),ue.Ss(t.e,t.f,"0ms")}},Ss:function(t,i,e){
var s=ue.ns.px/ue.ns.dx*-t,n=ue.ns.py/ue.ns.dy*-i;ue.Ke[0]&&ue.xs(ue.Ke[0],s,0,e),ue.Ke[1]&&ue.xs(ue.Ke[1],0,n,e)},scrollTo:function(t,i,e,s){ue.xs(t,i,e,s)},xs:function(t,i,e,s){if(s){if(ue.ps=!0,t){var n=ue.config.translate||G.translate;t.style[G.transform]=n+"("+Math.round(i)+"px, "+Math.round(e)+"px"+("translate3d"==n?", 0":"")+")",t.style[G.transitionDuration]=s}}else t.style[G.transform]=""},bs:function(t){var i,e=window.getComputedStyle(t)[G.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"],r=0;r<n.length;r++)i[n[r]]=parseInt(s[r],10)}return ue.ys&&ue.ys.Fs(i),i},ws:function(t,i,e,s,n){if(t===e)return t;var r=Math.abs(t-e);if(0<t)return i?e+r/(t-e)*Math.sqrt(r):0;var h=s-n;return h+t<0?i?e-Math.sqrt(-(t-e)):-h:t},zs:function(t){if(!t.scroll_enabled){t.scroll_enabled=!0,t.parentNode.style.position="relative";var i=G.cssPrefix;t.style.cssText+=i+"transition: "+i+"transform; "+i+"user-select:none; "+i+"transform-style:flat;",t.addEventListener(G.transitionEnd,ue.ms,!1)}},Ts:function(){-1!=ue.es.indexOf("x")&&(ue.Ke[0]=ue.Ps("x",ue.ns.dx,ue.ns.px,"width")),-1!=ue.es.indexOf("y")&&(ue.Ke[1]=ue.Ps("y",ue.ns.dy,ue.ns.py,"height")),ue.zs(ue.ss),window.setTimeout(function(){ue.Cs(),ue.ns&&!ue.ns.hidden&&(ue.Ke[0]&&(ue.Ke[0].style.visibility="visible"),ue.Ke[1]&&(ue.Ke[1].style.visibility="visible"))},0)},Ps:function(t,i,e,s){if(i-e<2){var n=ue.bs(ue.ss),r="y"==t?n.e:0,h="y"==t?0:n.f;return ue.ys||ue.xs(ue.ss,r,h,"0ms"),ue.es=ue.es.replace(t,""),""}var o=lt("DIV",{"class":"webix_scroll_"+t},"");return o.style.visibility="hidden",o.style[s]=Math.max(e*e/i-7,10)+"px",ue.ns.left&&("x"===t?o.style.left=ue.ns.left+"px":o.style.right=-ue.ns.left+"px"),ue.ss.parentNode.appendChild(o),o},$s:function(t,i,e){return t>ue.config.deltaStep?(ue.ds&&(ue.Vs(i),ue.Hs(i),-1==(ue.es||"").indexOf(i)&&(ue.es="")),!1):e},ms:function(){var t,i,e;(e=ai(ue.ss||this))&&(ue.ss?t=ue.bs(ue.ss):e.getScrollState&&(t={e:-(i=e.getScrollState()).x,f:-i.y}),w("onAfterScroll",[t]),e.callEvent&&e.callEvent("onAfterScroll",[t])),ue.es||(vt(ue.Ke),ue.Ke=[null,null]),ue.ps=!1},Vs:function(){window.clearTimeout(ue.ls),ue.ds=!1},Rs:function(t){if(!ue.Ke[0]&&!ue.Ke[1])return!0;ue.Bs(t,ue.Ke[0]?"x":"y")},Ue:function(t){var i=t.target;if(!ue.Te){ue.rs=null,ue.ts=ue.Je=fe.context(t);var e=ai(t);!ue.Ye||ue.Es()||e&&e.$touchCapture||(ue.ts=null),ue.ks("onTouchStart"),ue.Rs(t)&&(ue.ls=window.setTimeout(ue.js,ue.config.longTouchDelay)),!e||!e.touchable||i.className&&0===i.className.indexOf("webix_view")||(ue.fs=e.getNode(t),Mt(ue.fs,"webix_touch"))}},js:function(){ue.Je&&(ue.rs=!0,ue.ks("onLongTouch"),w("onClick",[ue.Je]))},Bs:function(t,i){ue.Hs(i);var e=ue.Ke[0]||ue.Ke[1];if(e){var s=ue.As("onBeforeScroll",!0);s&&s.callEvent("onBeforeScroll",[ue.Je,ue.Ze])}!e||ue.ss&&e.parentNode==ue.ss.parentNode||(ue.Xe(),ue.ms(),ue.Je=fe.context(t)),ue.qe(t)},gs:function(t){return ue.Qe=ue.Ze,ue.Ze=fe.context(t),ue.hs.Ds=Math.abs(ue.Je.x-ue.Ze.x),ue.hs.Is=Math.abs(ue.Je.y-ue.Ze.y),ue.Qe&&(ue.Ze.time-ue.Qe.time<ue.config.scrollDelay?(ue.hs.os=ue.hs.os/1.3+ue.Ze.x-ue.Qe.x,ue.hs.us=ue.hs.us/1.3+ue.Ze.y-ue.Qe.y):ue.hs.us=ue.hs.os=0,ue.hs.cs=ue.hs.cs/1.3+(ue.Ze.time-ue.Qe.time)),ue.hs},Ls:function(t){ue.ns={dx:t.offsetWidth,dy:t.offsetHeight,px:t.parentNode.offsetWidth,py:t.parentNode.offsetHeight}},Es:function(t){var i=ue.Je.target;if(!G.touch&&!G.transition&&!G.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.Es(t);return i&&(ue.es=i[1],ue.ss=i[0],ue.Ls(i[0])),i},ks:function(t){w(t,[ue.Je,ue.Ze]);var i=ue.As(t);i&&i.callEvent(t,[ue.Je,ue.Ze])},As:function(t,i){var e=ai(i?ue.ss:ue.Je);if(!e)return null;for(;e;){if(e.hasEvent&&e.hasEvent(t))return e;e=e.getParentView()}return null},Os: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=ue.Ze;return i.time=new Date,i},Ns:function(t){return{target:t.target,x:t.pageX,y:t.pageY,time:new Date}}};function ce(t){t.down="touchstart",t.move="touchmove",t.up="touchend",t.context=ue.Os}mi(function to(){if(G.touch)ue.$init(),-1==document.body.className.indexOf("webix_full_screen")&&ue.limit(!0),G.isSafari&&ct(".webix_view{ -webkit-overflow-scrolling: touch; }"),window.MSCSSMatrix&&ct(".webix_view{ -ms-touch-action: none; }");else var s=Qt(document.body,"touchstart",function(t){if(t.touches.length&&4<t.touches[0].radiusX)for(var i in G.touch=!0,ce(fe),to(),ni.views){var e=ni.views[i];e&&e.$touch&&e.$touch()}ti(s)},{capture:!0})});var fe=G.mouse={down:"mousedown",up:"mouseup",move:"mousemove",context:ue.Ns};window.navigator.pointerEnabled?(fe.down="pointerdown",fe.move="pointermove",fe.up="pointerup"):window.navigator.msPointerEnabled?(fe.down="MSPointerDown",fe.move="MSPointerMove",fe.up="MSPointerUp"):G.touch&&ce(fe);var le={Ws:T(["dummy"]),addDrop:function(t,i,e){(t=D(t)).webix_drop=this.Ys(i),e&&(t.webix_master=!0)},Ys:function(t){t=t||le;var i=this.Ws.find(t);return i<0&&(i=this.Ws.length,this.Ws.push(t),t.attachEvent&&t.attachEvent("onDestruct",function(){return le.unlink(t)})),i},unlink:function(t){var i=this.Ws.find(t);-1<i&&(le.Us&&le.Us.webix_drag==i&&le.qs(),le.Xt&&le.Xt.webix_drop==i&&(le.Xt=null),this.Ws[i]=null)},Gs:function(t){var i=le,e=this.Xs();if(e&&e.$longTouchLimit){if(!i.Yi&&!i.createDrag(t))return;t.longtouch_drag=!0;var s={x:t.x,y:t.y},n=i.$dragPos(s,t),r=i.Ks;i.Yi.style.top=s.y+i.top+(n||!r.y_offset?0:r.y_offset)+"px",i.Yi.style.left=s.x+i.left+(n||!r.x_offset?0:r.x_offset)+"px"}},addDrag:function(t,i){(t=D(t)).webix_drag=this.Ys(i),Zt(t,G.mouse.down,this.Js,{bind:t}),Zt(t,"dragstart",wt)},Js:function(t){if(le.Us){if(le.Zs==t)return;le.Qs(t),le.destroyDrag(t)}le.Us=this;var i=G.mouse.context(t);le.tn=i,le.Zs=t;var e=G.touch?{passive:!1}:null;le["in"]=Qt(document.body,G.mouse.move,le.en,e),le.sn=Qt(document,G.mouse.up,le.Qs),Mt(document.body,"webix_noselect",1)},Qs:function(t){le.nn(),le.rn=!t.cancelable},en:function(t){if(le.rn=!t.cancelable,G.touch&&le.rn)return le.nn(),le.destroyDrag(t);var i=G.mouse.context(t),e=le.Xs();if(!(G.touch&&e&&e.$longTouchLimit&&!ue.rs||Math.abs(i.x-le.tn.x)<5&&Math.abs(i.y-le.tn.y)<5)){if(!le.Yi&&!le.createDrag(le.Zs))return le.nn();le.nn(!0),le.sendSignal("start");var s=G.touch?{passive:!1}:null;le["in"]=Qt(document.body,G.mouse.move,le.hn,s),le.sn=Qt(document,G.mouse.up,le.qs),le.hn(t)}},qs:function(t){le.nn(),le.Zs=null,le.Xt&&t&&(le.$drop(le.Us,le.Xt,t),le.$dragOut(le.Us,le.Xt,null,t)),le.destroyDrag(t),le.sendSignal("stop")},nn:function(t){this["in"]=ti(this["in"]),this.sn=ti(this.sn),t||St(document.body,"webix_noselect")},hn:function(s){var t=le,i=gt(s),e=t.$dragPos(i,s),n=t.Ks;t.Yi.style.top=i.y+t.top+(e||!n.y_offset?0:n.y_offset)+"px",t.Yi.style.left=i.x+t.left+(e||!n.x_offset?0:n.x_offset)+"px";var r=s;if(t.an)t.an=!1;else{if(G.touch){var h=G.mouse.context(s),o=document.elementFromPoint(h.x,h.y);r=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.un(r.target,r)}return wt(s)},un:function(t,i){for(;t&&"BODY"!=t.tagName;){if(t.webix_drop)return this.Xt&&(this.Xt!=t||t.webix_master)&&this.$dragOut(this.Us,this.Xt,t,i),!this.Xt||this.Xt!=t||t.webix_master?(this.Xt=null,this.cn=this.$dragIn(le.Us,t,i),void(this.cn&&(this.Xt=t))):void 0;t=t.parentNode}this.Xt&&(this.Xt=this.cn=this.$dragOut(this.Us,this.Xt,null,i))},sendSignal:function(t){le.active="start"==t,w("onDragMode",[t])},getMaster:function(t){return this.Ws[t.webix_drag||t.webix_drop]},getContext:function(){return this.Ks},getNode:function(){return this.Yi},createDrag:function(t){var i=le,e=i.Us;i.Ks={};var s,n=this.Ws[e.webix_drag];if(n.$dragCreate){if(!(s=n.$dragCreate(e,t)))return!1;this.ln(t),s.style.position="absolute"}else{var r=i.$drag(e,t);if(i.ln(t),!r)return!1;(s=document.createElement("DIV")).innerHTML=r,s.className="webix_drag_zone",
document.body.appendChild(s);var h=i.Ks;h.html&&G.pointerevents&&(h.x_offset=-Math.round(.5*s.offsetWidth),h.y_offset=-Math.round(.75*s.offsetHeight))}return s.style.zIndex=Math.max(s.style.zIndex,pi()),le.dn=Qt(s,G.mouse.move,le.vn),le.Ks.from||(le.Ks={source:e,from:e}),le.Yi=s,!0},vn:function(){le.an=!0},destroyDrag:function(t){var i=le.Us,e=this.Ws[i.webix_drag];e&&e.$dragDestroy?(le.dn=ti(le.dn),le.Yi&&e.$dragDestroy(i,le.Yi,t)):vt(le.Yi),e&&e.ht&&(e.ht=window.clearTimeout(e.ht)),le._n&&vt(le._n),le.cn=le.Us=le.Xt=le.Yi=le._n=null,le.Ks=null},Xs:function(){return le.Ws[le.Us.webix_drag]},top:0,left:0,ln:function(t){var i=le,e=i.tn,s=i.Ks;if("undefined"!=typeof s.x_offset&&"undefined"!=typeof s.y_offset)return null;if(s.x_offset=s.y_offset=0,G.pointerevents){var n=le.Xs();if(n.pn&&n!==this){var r=n.pn(e,t);r&&(s.x_offset=r.x-e.x,s.y_offset=r.y-e.y)}}},$dragPos:function(t,i){var e=this.Ws[le.Us.webix_drag];if(e.$dragPos&&e!=this)return e.$dragPos(t,i,le.Yi),!0},$dragIn:function(t,i,e){var s=this.Ws[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.Ws[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.Ws[i.webix_drop];if(le.Ks.from=le.getMaster(t),s.$drop&&s!=this)return s.$drop(t,i,e);i.appendChild(t)},$drag:function(t,i){var e=this.Ws[t.webix_drag];return e.$drag&&e!=this?e.$drag(t,i):"<div style='"+t.style.cssText+"'>"+t.innerHTML+"</div>"}};y("onLongTouch",function(t){le.Us&&!le.rn&&le.Gs(t)});var de={move_setter:function(t){return t&&(F.extend(this,ve,!0),le.addDrag(this.mn?this.mn:this.$view,this),delete this.move_setter),t}},ve={$dragCreate:function(t,i){if(this.config.move){var e=mt(t),s=gt(i);return le.top=e.y-s.y,le.left=e.x-s.x,D(this.zt)}},$dragDestroy:function(t,i){this.B&&(this.B.top=parseInt(i.style.top,10),this.B.left=parseInt(i.style.left,10)),le.top=le.left=0,this.callEvent("onViewMoveEnd",[])},$dragPos:function(t,i){this.callEvent("onViewMove",[t,i])}},_e={bn:function(t){if(t){if(!this.gn){this.gn=lt("div",{"class":"webix_modal"});var i=this.St=pi(this.B.zIndex);ei.St.push(i),this.gn.style.zIndex=i-1,this.zt.style.zIndex=i,document.body.appendChild(this.gn),document.body.style.overflow="hidden",Zt(this.gn,"click",k(this.wn,this))}}else if(this.gn){vt(this.gn),this.gn=null;var e=ei.St;e.splice(e.indexOf(this.St),1),e.length||(document.body.style.overflow="")}return t}},pe={resize_setter:function(t){return t&&!this.xn&&this.yn(),t},yn:function(){if(!this.Mn){var t=this.zt;t.firstChild&&((t=t.firstChild).style.position="relative"),this.Mn=lt("DIV",{"class":"webix_resize_handle",webix_disable_drag:"true"}),t.appendChild(this.Mn),Zt(this.Mn,G.mouse.down,this.Sn,{bind:this})}},kn:function(t,i){if(!this.Cn){this.Cn=lt("div",{"class":"webix_resize_frame"},""),document.body.appendChild(this.Cn);var e=mt(this.zt);this.Cn.style.left=e.x+"px",this.Cn.style.top=e.y+"px",this.Cn.style.zIndex=pi()}this.Cn.style.width=t+"px",this.Cn.style.height=i+"px"},Sn:function(){this.config.resize&&(Mt(document.body,"webix_noselect webix_resize_cursor"),this.$n=mt(this.zt),this.Dn=Qt(document.body,G.mouse.move,this.In,{bind:this}),this.An=Qt(document.body,G.mouse.up,this.Tn,{bind:this}))},In:function(t){if(!1!==this.$n){var i=gt(t),e={x:i.x-this.$n.x,y:i.y-this.$n.y};if(this.$resizeMove)this.$resizeMove(e);else{var s=this.config,n=s.minWidth||100,r=s.minHeight||100;e.x<n?e.x=n:e.x>s.maxWidth&&(e.x=s.maxWidth),e.y<r?e.y=r:e.y>s.maxHeight&&(e.y=s.maxHeight)}this.Fn=e,this.kn(e.x,e.y)}},Tn:function(){this.Cn&&(this.Cn=vt(this.Cn)),St(document.body,"webix_resize_cursor"),St(document.body,"webix_noselect"),ti(this.Dn),ti(this.An),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",[])}},me={name:"window",$init:function(t){
this.zt.innerHTML="<div class='webix_win_content'><div class='webix_win_head'></div><div class='webix_win_body'></div></div>",this.Ui=this.zt.firstChild,this.mn=this.Ui.childNodes[0],this.tt=this.zn=this.Ui.childNodes[1],this.zt.className+=" webix_window",this.zt.setAttribute("role","dialog"),this.zt.setAttribute("tabindex","0"),this.Pn=this.$t=null,this.B.Dt={top:!1,left:!1,right:!1,bottom:!1},t.id||(t.id=$()),Zt(this.Ui,"click",this.wn,{bind:this}),Zt(this.Ui,"click",function(){!this.B.zIndex&&this.B.toFront&&(this.zt.style.zIndex=pi())},{bind:this,capture:!0}),t.modal&&(this.Vn=!0),t.headHeight&&(this.B.headHeight=t.headHeight),t.close&&(this.B.close=t.close),this.attachEvent("onViewMoveEnd",function(){this.B.position&&delete this.B.position})},wn:function(t){var i=ei.kt,e=i.find(this);-1==e&&(e=i.length-1),t.click_view=e},getChildViews:function(){return this.Pn?[this.Pn,this.$t]:[this.$t]},zIndex_setter:function(t){return this.zt.style.zIndex=t},Ft:function(){this.body_setter()},Tt:function(t,i){var e=(i=i||this.$t)==this.$t;i.destructor(),e?this.$t=t:this.Pn=t,(e?this.zn:this.mn).appendChild(t.zt);var s=t.zt.style,n={top:!0,left:!0,right:!0,bottom:!0},r="0px";!1===t.config.borderless&&(n=l(this.B.Dt),r="1px"),t.B.Dt=n,s.borderTopWidth=s.borderBottomWidth=s.borderLeftWidth=s.borderRightWidth=r,this.resize(!0)},show:function(t,i,e){if(!0===t){if(!this.B.hidden)return;t=null}if(!this.callEvent("onBeforeShow",arguments))return!1;var s,n,r;if(this.B.hidden=!1,this.zt.style.zIndex=pi(this.B.zIndex),(this.B.modal||this.Vn)&&(this.bn(!0),this.Vn=null),(i=i||{}).pos||(i.pos=this.B.relative),t){"object"!=M(t)||t.tagName?s=mt(t=D(t)):t.target?(s=gt(t),n=20,r=5):s=t;var h=Math.max(window.innerWidth||0,document.body.offsetWidth),o=Math.max(window.innerHeight||0,document.body.offsetHeight);n=n||t.offsetWidth||0,r=r||t.offsetHeight||0;var a=this.we,u=s.x,c=s.y,f=0,l=0,d=0,v=0,_=this.B.autofit;if(_){var p="node"===_,m=6,b=6,g=6;this.B.point||(m=b=g=0),e="top",u=c=0,d=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,h-s.x-n<a[0]&&"right"==i.pos&&!p&&(i.pos="left"),l="right"==i.pos?(u=s.x+m+n,b=-r,e="left",f=Math.round(s.y+r/2),u-g):"left"==i.pos?(u=s.x-m-a[0]-1,b=-r,e="right",f=Math.round(s.y+r/2),u+a[0]+1):(u=s.x<d?d:h+d-s.x>a[0]?s.x:h+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-r-s.y-b>a[1]||p)&&"top"!=i.pos?(c=r+s.y+b-(this.B.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.Hn();this.$view.style.position=y?"fixed":"absolute",y&&(c-=v,f-=v),this.setPosition(u+w,c+x),this.Rn&&(e&&this.B.point?this.Rn(e,l+w,f+x,y):this.Bn())}else this.ii(this.B.left,this.B.top);this.zt.style.display="block",this.En=1,C(function(){this.En=0},this,[],G.touch?400:100),this.Ce(),this.config.autofocus&&(this.jn=ji.getFocus(),ji.setFocus(this)),-1==ei.kt.find(this)&&ei.kt.push(this),this.callEvent("onShow",[])},Ri:function(t){if(!this.B.hidden&&!this.B.modal&&this.B.escHide&&!this.En&&!(t&&t.showpopup&&(t.showpopup==this.B.id||this.getTopMenu&&this.getTopMenu().B.id==t.showpopup)||t&&G.touch&&t.longtouch_drag||ei.St.length&&this.zt.style.zIndex<=Math.max.apply(Math,o(ei.St)))){if(t){var i=t.click_view;if(i||0===i||(i=-1),ei.kt.find(this)<=i)return}this.Ln()}},hidden_setter:function(t){return t?this.hide():this.show(),!!t},hide:function(){var t=this.Ln();this.On(t)},Ln:function(){if(!this.$destructed&&!this.B.hidden){if(this.B.modal&&this.bn(!1),this.Nn(),this.B.autofocus){var t=document.activeElement;t&&this.zt&&(this.zt.contains(t)||t===document.body)&&(ji.setFocus(this.jn),this.jn=null)}var i=ei.kt.find(this);return-1<i&&ei.kt.removeAt(i),i}},Nn:function(){"top"==this.B.position?ne(this.zt,{type:"slide",x:0,y:-(this.Me+20),duration:300,callback:this.Wn,master:this}):this.Wn()},On:function(t){if(-1<t)for(var i=ei.kt,e=i.length-1;t<=e;e--)i[e].Bn&&i[e].Ln()},destructor:function(){this.hide(),Oi.destructor.apply(this,[])},Wn:function(){
this.$destructed||(this.zt.style.display="none",this.B.hidden=!0,this.callEvent("onHide",[]))},close:function(){this.destructor()},Yn:function(t){"undefined"==typeof t.borderless&&(t.borderless=!0)},body_setter:function(t){return"object"!=M(t)&&(t={template:t}),this.Yn(t),(ei.mt=this).$t=ni.Ht(t),this.zn.appendChild(this.$t.zt),t},head_setter:function(t){var i=this;if(!1===t)return t;var e=this.B.headHeight,s="string"==typeof t,n={height:e,padding:0,css:"webix_win_title",type:"header",borderless:!0};s&&(this.zt.setAttribute("aria-label",t),t={template:t}),("template"==t.view||!t.view&&t.template)&&F.extend(t,n),s&&this.config.close?t={padding:{left:re.inputHeight+2,right:2},cols:[t,{height:e,view:"icon",icon:"wxi-close",click:function(){i.hide()}}]}:F.extend(t,{borderless:!0}),(ei.mt=this).Pn=ni.Ht(t);var r=this.Pn.zt.querySelector(".webix_win_title>div");return r&&(r.style.lineHeight=e+"px"),this.mn.appendChild(this.Pn.zt),t},getBody:function(){return this.$t},getHead:function(){return this.Pn},adjust:function(){return this.resize()},resizeChildren:function(){this.$t&&this.resize()},resize:function(){Ki.api.adjust.call(this),w("onResize",[]),this.isVisible()&&this.ii(this.B.left,this.B.top)},Hn:function(){if(this.B.master){var t=ai(this.B.master).getTopParentView().$view;return t&&"fixed"===t.style.position}return!1},ii:function(t,i){if(this.B.position||this.Hn()){this.$view.style.position="fixed";var e=this.xe,s=this.Me;if(e<=0||s<=0)return;var n=window.innerWidth||document.documentElement.offsetWidth,r=window.innerHeight||document.documentElement.offsetHeight,h=Math.round((n-e)/2),o=Math.round((r-s)/2);if("function"==typeof this.B.position){var a={left:h,top:o,width:e,height:s,maxWidth:n,maxHeight:r};this.B.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.B.position&&(o=ne.isSupported()?-1*s:10),this.B.position||(h=this.B.left||h,o=this.B.top||o),this.setPosition(h,o);"top"==this.B.position&&ne(this.zt,{type:"slide",x:0,y:s-2*(this.B.padding||0),duration:300,callback:this.Un,master:this})}else this.setPosition(t,i)},Un:function(t){ne.clear(t),this.B.top=-2*(this.B.padding||0),this.setPosition(this.B.left,this.B.top)},setPosition:function(t,i){this.zt.style.top=i+"px",this.zt.style.left=t+"px",this.B.left=t,this.B.top=i},$getSize:function(t,i){var e=this.B.Dt;e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1)),this.B.head&&(i+=1);var s=this.$t.$getSize(0,0),n=0;if(this.Pn){var r=this.Pn.$getSize(0,0);r[3]==r[2]&&(this.B.headHeight=r[3]),i+=this.B.headHeight,n=r[0]}if(this.B.fullscreen){var h=window.innerWidth||document.body.clientWidth,o=window.innerHeight||document.body.clientHeight;return[h,h,o,o]}var a=Qi.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){Qi.api.$setSize.call(this,t,i),t=this.xe,i=this.Me,!1===this.B.head?(this.mn.style.display="none",this.$t.$setSize(t,i)):(this.Pn.$setSize(t,this.B.headHeight),this.$t.$setSize(t,i-this.B.headHeight))},$skin:function(){this.defaults.headHeight=re.barHeight},defaults:{top:0,left:0,autofit:!0,relative:"bottom",body:"",head:"",hidden:!0,autofocus:!0,minWidth:300,minHeight:200,escHide:!0}};y("onLongTouch",function(t){if(t&&t.target){var i=ai(t.target);if(i){i=i.queryView(function(t){return!t.getParentView()},"parent")||i;var e=ei.kt.find(i);-1!==e&&(t.click_view=e)}}});var be={api:me,view:F.protoUI(me,Qi.view,de,_e,b,pe)},ge={defaults:{padding:"4",hidden:!0},body_setter:function(t){return t=be.api.body_setter.call(this,t),this.$t.zt.style.borderWidth="0px",t},attachTo:function(t){var i;i=t.on_context?t.attachEvent("onAfterContextMenu",k(this.qn,this)):Qt(t,"contextmenu",this.Gn,{bind:this}),this.attachEvent("onDestruct",function(){t.callEvent?t.detachEvent(i):ti(i),t=null})},getContext:function(){return this.Xn},
setContext:function(t){this.Xn=t},Gn:function(t){return this.Xn=D(t||be.event),this.Kn(t)},qn:function(t,i){return this.Xn={obj:ai(i),id:t},this.Kn(i)},Kn:function(t){var i=this.show(t,null,!0);if(!1===i)return i;var e=ai(t);if(e){var s=e.queryView(function(t){return!t.getParentView()},"parent")||e;s.wn&&s.wn(t)}return w("onClick",[t]),wt(t)},Jn:!0,master_setter:function(t){return this.attachTo(t),null}},we={Xn:null,Zn:null,Qn:0,init:function(){return null!==this.Xn||(ei.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),Qt(document.body,"keydown",k(function(t){var i=t.keyCode,e=!(!t.ctrlKey&&!t.metaKey);86===i&&e&&(this.Xn.value="",C(this.ir,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.sr()||(this.init(),this.Xn.focus(),this.Xn.select())},sr: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},ir:function(t){if(t.target===this.Xn){var i=this.Xn.value,e=ji.getFocus();!e||e.getEditor&&e.getEditor()||(e.callEvent("onPaste",[i]),this.Xn.select())}}},xe={escape:!0,delimiter:{rows:"\n",cols:"\t"},parse:function(t,i){if(i=i||this.delimiter,!this.escape)return this.nr(t,i);for(var e=t.replace(/\n$/,"").split(i.rows),s=0;s<e.length-1;)this.rr(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 r=e[s],h=0,o=[],a=!1,u=0;u<=r.length;u++){if(!a&&r[u]===i.cols||u===r.length){var c=r.substr(h,u-h);c[0]===c[c.length-1]&&'"'===c[0]&&(c=c.substr(1,c.length-2).replace('""','"')),o.push(c),h=u+1}'"'!==r[u]||(a=!a)}n.push(o)}return n},nr: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},rr: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 r=0;r<t[n].length;r++){var h=t[n][r];h instanceof Date?t[n][r]=P.parseFormatStr(h):s.test(h)&&(t[n][r]='"'+h.toString().replace(/"/g,'""')+'"')}t[n]=t[n].join(i.cols)}return t=t.join(i.rows)}},ye={clipboard_setter:function(t){return G.touch||(!0!==t&&1!==t||(t="modify"),this.attachEvent("onAfterSelect",this.hr),this.attachEvent("onAfterEditStop",function(t,i){var e=this.getSelectedId(!0);1==e.length&&i.id==e[0]&&this.hr()}),this.attachEvent("onPaste",function(t){if(!z(this.ir[this.B.clipboard])){var i=xe.parse(t,this.B.delimiter);this.ir[this.B.clipboard].call(this,i)}}),this.attachEvent("onFocus",function(){we.focus()}),this.attachEvent("onItemClick",function(t){this.or&&-1===this.or.find(t)||(we.focus(),ji.setFocus(this))})),t},hr:function(){var h=this;C(function(){if(!h.getEditor||!h.getEditor()){for(var t=h.getSelectedId(!0),i=[],e=0;e<t.length;e++){var s=t[e],n=h.getItem(s);i.push([h.type.templateCopy(n)])}var r=1===i.length?i[0][0]:xe.stringify(i,h.B.delimiter);we.set(r,h),we.focus(),ji.setFocus(h)}})},ir:{insert:function(t){var i=this;t.forEach(function(t){return i.add({value:t})})},modify:function(t){for(var i=this.getSelectedId(!0),e=0;e<i.length;e++){if(z(t[e]))return;this.getItem(i[e]).value=t[e],this.refresh(i[e])}},custom:function(){}},templateCopy_setter:function(t){this.type.templateCopy=qt(t)},type:{templateCopy:function(t){return this.template(t)}}},Me={$customPrint:function(t,i){if(this.ar(t,i))return!0;var e=this.ur(t),s=this.cr(e,t);if(i)return s;var n=lt("div",{"class":"webix_ui_print"});n.appendChild(s),_t(n,t.docFooter,document.body),window.print(),vt(n)},ar:function(t,i){if(!i&&(
"y"==this.config.layout||t.scroll||this.config.prerender||this.config.autoheight))return!0;"x"==this.config.layout&&F.extend(t||{},{xCount:this.count(),nobreaks:!0},!0)},fr:function(t){var i=t.size["portrait"==t.mode?"width":"height"];return Math.min(i*G.printPPI-2*G.printMargin)},ur:function(t,i,e){var s,n,r="page"==t.fit?Infinity:this.fr(t),h=t.xCount||this.dr().lr,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/h)*h,f&&e<=n){if(r<(u+=this.type.width)&&e<n){s=a.length+e,o.push(a),c+=h-a.length,a=[],u=0;continue}var l=this.type.template(f,this.type),d=this.vr,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)%h==0&&(o.push(a),a=[],u=0)}c++}return i.push(o),s&&this.ur(t,i,s),i},cr:function(n,r){var h=lt("div");return n.forEach(k(function(t,i){var e=lt("table",{"class":"webix_table_print "+this.$view.className,style:"border-collapse:collapse"});if(t.forEach(function(t){var s=lt("tr");t.forEach(function(i){var e=lt("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)}),h.appendChild(e),!r.nobreaks&&i+1<n.length){var s=lt("DIV",{"class":"webix_print_pagebreak"});h.appendChild(s)}},this)),h}},Se=null,ke={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)}},Ce={copy:function(t,i,e,s){var n=(s=s||{}).newId||t;e=e||this;var r=this.getItem(t);return e&&(r=e._r(r)),e.data.add(e._r(r,n),i,s.parent||0)},pr: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(I(t)){3<t.length&&(this.$blockRender=e.$blockRender=!0);for(var r=0;r<t.length;r++){var h=this.move(t[r],i,e,s);i=e.pr(h,t[r+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._r(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){var e=this.getIndexById(t)-(i||1);return this.move(t,e<0?0:e)},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)},_r:function(t,i){var e=F.extend({},t);return e.id=!i||this.data.pull[i]?$():i,e.$template=null,this.B.externalData&&(e=this.B.externalData.call(this,e,i,t)),e}},$e={$init:function(){this.yt&&this.attachEvent("onChange",this.clearValidation)},clearValidation:function(){if(this.elements)for(var t in this.elements)this.mr(t)},validate:function(t,i){this.callEvent,this.callEvent("onBeforeValidate",[]);var e=this.gr={},s=!0,n=this.B.rules,r=this.isVisible&&!this.isVisible(),h=t&&t.hidden,o=t&&t.disabled,a={},u={};for(var c in this.elements){var f=this.elements[c].config.name;(r||this.elements[c].isVisible()||h)&&(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.wr(n.$obj,i,i,"")&&s);var l=n.$all,d=i;if(this.B.complexData&&(d=Bt.collapseNames(i,"",{},function(t){return!n[t]})),l)for(var v in i)if(!u[v]){var _=this.wr(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.wr(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.B;if(x){var y=x.validate;if(!y&&x.required&&(y=n.isNotEmpty),y){var M=this.wr(y,i[b],i,b);M||(e[b]=!0),s=M&&s}}}}return this.callEvent("onAfterValidation",[s,this.gr]),s},wr:function(t,i,e,s){return"string"==typeof t&&(t=Mi[t]),t.call(this,i,e,s)?(this.callEvent("onValidationSuccess",[s,e])&&this.mr&&this.mr(s),!0):(this.callEvent("onValidationError",[s,e])&&this.xr&&this.xr(s),!1)}},De={};function Ie(t,i){if("object"==M(t)&&t.B&&(t=t.B.id),De[t]||i)return De[t];"string"!=typeof t&&"number"!=typeof t||(t={master:ai(t)});var e=new Ae(t),s=e.B.master.B.id;return De[s]=e,ai(s).attachEvent("onDestruct",function(){De[this.B.id]=null,delete De[this.B.id]}),e}t("dp",Ie),Ie.$$=function(t){return De[t]};var Ae=F.proto({defaults:{autoupdate:!0,updateFromResponse:!1,mode:"post",operationName:"webix_operation",trackMove:!1},$init:function(){this.reset(),this.yr=!1,this.name="DataProcessor",this.$ready.push(this.Mr)},reset:function(){this.Sr=[]},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?Y(i,t):t},master_setter:function(t){var i=t;return"DataStore"!=t.name&&(i=t.data),this.B.store=i,t},Zt:function(t){var i=this.kr;this.kr=[],t();var e=Promise.all(this.kr);return(this.kr=i)&&i.push(e),e},Mr:function(){var t=this.B.store;t&&(t.attachEvent("onStoreUpdated",k(this.Cr,this)),t.attachEvent("onDataMove",k(this.Dr,this)))},ignore:function(t,i){var e=this.yr;this.yr=!0,t.call(i||this),this.yr=e},off:function(){this.yr=!0},on:function(){this.yr=!1},Ir:function(t){var i={};for(var e in t)0!==e.indexOf("$")&&(i[e]=t[e]);return i},save:function(t,i,e){return i=i||"update",this.Ar(t,e,i,!0)},Ar:function(t,i,e,s){if("object"==M(t)&&(t=t.toString()),t&&!0!==this.yr&&e&&"paint"!=e){var n=this.B.store;n&&(i=i||this.B.store.getItem(t),n.Tr&&(i=n.Tr(i)));var r={id:t,data:this.Ir(i),operation:e};if(z(i.$parent)||(r.data.parent=i.$parent),"delete"!=r.operation){var h=this.B.master;h&&h.data&&h.data.getMark&&h.data.getMark(t,"webix_invalid")&&(r.Fr=!0),this.validate(null,r.data)||(r.Fr=!0)}return this.zr(r)&&this.Sr.push(r),this.B.autoupdate||s?this.Pr(t):void 0}},Dr:function(t,i,e,s){if(this.B.trackMove){var n=S(this.B.store.getItem(t));n.webix_move_index=i,n.webix_move_id=s,n.webix_move_parent=e,this.Ar(t,n,"order")}},Cr: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.Ar(t,i,e)},zr:function(t){for(var i=0;i<this.Sr.length;i++){var e=this.Sr[i];if(e.id==t.id&&!e.Vr)return"delete"==t.operation&&("insert"==e.operation?this.Sr.splice(i,1):e.operation="delete"),e.data=t.data,e.Fr=t.Fr,!1}return!0},send:function(){return this.Pr()},Pr:function(t){if(this.B.url){for(var i,e=this.Sr,s=[],n=this.B.url,r=0;r<e.length;r++){var h=e[r];if(!h.Vr&&!h.Fr){var o=h.id;if(this.B.autoupdate||!t||t==o){var a=h.operation,u=Y.$parse("object"!=M(n)||n.$proxy?n:n[a]),c=u&&(u.$proxy||"function"==typeof u);if(u){var f=this.B.store;if(f&&f.Hr&&f.Hr(h.data),this.callEvent("onBefore"+a,[o,h])){if(h.Vr=!0,!this.callEvent("onBeforeDataSend",[h]))return;h.data=this.Rr(h.data);var l=void 0;u.$proxy?(u.save&&(l=u.save(this.config.master,h,this)),s.push(h)):("insert"==a&&delete h.data.id,l=c?u.call(this.config.master,h.id,h.operation,h.data):(h.data[this.B.operationName]=a,this.S(u,h.data,this.B.mode))),l&&(l=this.Br(l,{id:h.id,status:h.operation}),t&&o===t&&(i=l)),this.callEvent("onAfterDataSend",[h])}}}}}if(n.$proxy&&n.saveAll&&s.length){var d=n.saveAll(this.config.master,s,this);d&&(d=this.Br(d,null),i||(i=d))}return i}},Br:function(t,e){var s=this;if(t)return t.then||(t=m.resolve(t)),t=t.then(function(t){var i;if(t&&"function"==typeof t.json&&(t=t.json()),!(i=null===e?s.Er(t):s.Er(e,"",t,-1)))throw i;return i},function(t){throw s.jr(e,"",null,t),t}),this.kr&&this.kr.push(t),t},Rr:function(t){var i={};for(var e in t)0!==e.indexOf("$")&&(i[e]=t[e]);return i},S:function(t,i,e
){return B()[e](t,i)},attachProgress:function(t,i,e){this.attachEvent("onBeforeDataSend",t),this.attachEvent("onAfterSync",i),this.attachEvent("onAfterSaveError",e),this.attachEvent("onLoadError",e)},jr:function(t,i,e,s){t?this.Lr(!0,t.id,!1,t.status,!1,{text:i,data:e,loader:s}):(this.callEvent("onLoadError",arguments),w("onLoadError",[i,e,s,this]))},Lr:function(t,i,e,s,n,r){var h=this.B.master,o=this.getItemState(i);if(o.Vr=!1,!t){this.setItemState(i,!1);var a=this.B.store;return a&&a.exists(i)&&(e&&i!=e&&a.changeId(i,e),n&&"delete"!=s&&this.B.updateFromResponse&&this.ignore(function(){a.updateItem(e||i,n)})),this.B.undoOnError&&h.B.undo&&h.removeUndo(e||i),this.callEvent("onAfterSave",[n,i,r]),this.callEvent("onAfter"+s,[n,i,r]),n||{}}this.callEvent("onBeforeSaveError",[i,s,n,r])&&(o.Fr=!0,this.B.undoOnError&&h.B.undo&&(this.ignore(function(){h.undo(i)}),this.setItemState(i,!1)),this.callEvent("onAfterSaveError",[i,s,n,r]))},processResult:function(t,i,e){var s=i&&("error"==i.status||"invalid"==i.status),n=!!i&&(i.newid||i.id);return this.Lr(s,t.id,n,t.status,i,e)},Er:function(t,i,e,s){var n,r=this;if(this.callEvent("onBeforeSync",[t,i,e,s]),I(t))n=[],t.forEach(function(t){n.push(r.processResult(t,t,{}))});else if(-1===s)n=this.processResult(t,e,{});else{var h,o=this.B.url;if(o.$proxy&&o.result)n=o.result(t,this.B.master,this,i,e,s)||{};else i&&(h=e.json(),i&&null==h&&(h={status:"error"})),n=this.processResult(t,h,{text:i,data:e,loader:s})}return this.callEvent("onAfterSync",[t,i,e,s]),n},escape:function(t){return this.B.escape?this.B.escape(t):encodeURIComponent(t)},getState:function(){if(!this.Sr.length)return!1;for(var t=this.Sr.length-1;0<=t;t--)if(this.Sr[t].Vr)return"saving";return!0},getItemState:function(t){var i=this.Or(t);return this.Sr[i]||null},setItemState:function(t,i){if(i)this.Ar(t,null,"update");else{var e=this.Or(t);-1<e&&this.Sr.splice(e,1)}},Or:function(t){for(var i=-1,e=0;e<this.Sr.length;e++)if(this.Sr[e].id==t){i=e;break}return i}},Li,b,$e);function Te(){this.name="DataStore",F.extend(this,b),this.setDriver("json"),this.pull={},this.order=T(),this.Nr={}}Te.prototype={setDriver:function(t){Vt[t],this.driver=Vt[t]},X:function(t){this.callEvent("onParse",[this.driver,t]),this.Wr&&this.filter();var i=this.driver.getInfo(t);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.Yr(i,s),this.Ur&&this.qr&&!this.Gr&&this.qr(this.Ur),this.Xr&&(this.blockEvent(),this.sort(this.Xr),this.unblockEvent()),this.callEvent("onStoreLoad",[this.driver,t]),this.refresh()},Yr:function(t,i){var e=t.from,s=!0,n=!1;if(!e&&0!==e&&this.order[0]){if(this.Kr){n={};for(var r=0;r<this.order.length;r++)n[this.order[r]]=!0}s=!1,e=this.order.length}else e=1*(e||0);for(var h=0,o=0;o<i.length;o++){var a=this.driver.getDetails(i[o]),u=this.id(a);this.pull[u]?s&&this.order[h+e]&&h++:(this.order[h+e]=u,h++),this.pull[u]?(F.extend(this.pull[u],a,!0),this.Jr&&this.Jr(this.pull[u]),n&&delete n[u]):(this.pull[u]=a,this.Zr&&this.Zr(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=T(this.order.slice(0,f))))},id:function(t){return t.id||(t.id=$())},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.Wr&&(this.Wr[this.Wr.find(t)]=i),this.Nr[t]&&(this.Nr[i]=this.Nr[t],delete this.Nr[t]),this.callEvent("onIdChange",[t,i]),this.Qr&&this.Qr(t,i),delete this.pull[t])},getItem:function(t){return this.pull[t]},updateItem:function(t,i,e){"object"===M(t)&&(t=t.toString());var s=this.getItem(t),n=null,r=this.hasEvent("onDataUpdate");!i||!i.id||i.id,z(i)||s===i||(r&&(n=S(s)),t=s.id,F.extend(s,i,!0),s.id=t),this.Jr&&this.Jr(s),this.callEvent("onStoreUpdated",[t,s,e||"update"]),r&&this.callEvent("onDataUpdate",[t,s,n])},refresh:function(t){this.th||(t?this.exists(t)&&this.callEvent("onStoreUpdated",[t,this.pull[t],"paint"]):this.callEvent(
"onStoreUpdated",[null,null,null]))},silent:function(t,i){this.th=!0,t.call(i||this),this.th=!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=T(),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.Wr&&this.ih(this.Wr,0,0,this.getIdByIndex(t),this.getIdByIndex(i)),this.ih(this.order,t,i),this.callEvent("onStoreUpdated",[e,s,"move"])}},ih:function(t,i,e,s,n){if(s||n){i=e=-1;for(var r=0;r<t.length;r++)t[r]==s&&i<0&&(i=r),t[r]==n&&e<0&&(e=r)}var h=t[i];t.removeAt(i),t.insertAt(h,Math.min(t.length,e))},scheme:function(t){for(var i in this.eh={},this.Hr=t.$save,this.Zr=t.$init||t.$change,this.Jr=t.$update||t.$change,this.Tr=t.$serialize,this.Ur=t.$group,this.Xr=t.$sort,this.sh=t.$export,t)"$"!=i.substr(0,1)&&(this.eh[i]=t[i])},importData:function(t,i){var e=t?t.data||t:[];if(this.Wr=null,"function"==typeof e.serialize){if(this.order=T([].concat(e.order)),this.nh){this.nh=!1;var s=this.pull;for(var n in this.pull={},e.pull){var r=s[n];this.pull[n]=S(e.pull[n]),r&&r.open&&(this.pull[n].open=!0)}}else for(var h in this.pull={},e.pull)this.pull[h]=e.pull[h];e.branch&&this.branch&&(this.branch=S(e.branch),this.rh=null)}else{var o,a;if(this.order=T(),this.pull={},I(t))for(var u=0;u<t.length;u++)"object"==M(a=o=t[u])?a.id=a.id||$():a={id:o,value:o},this.order.push(a.id),this.Zr&&this.Zr(a),this.pull[a.id]=a;else for(var c in e)this.order.push(c),this.pull[c]={id:c,value:e[c]}}if(this.hh&&!e.branch){this.branch={0:[]},this.oh||this.ah("data");for(var f=0;f<this.order.length;f++){var l=this.order[f];this.hh(this.pull[l],0,0,!1)}}this.callEvent("onStoreLoad",[]),i||this.callEvent("onStoreUpdated",[])},sync:function(s,n,r){this.unsync();var t=M(s);if("string"==t&&(s=ai(s)),"function"!=t&&"object"!=t&&(r=n,n=null),"DataStore"!=s.name&&"TreeStore"!=s.name){if(!s.data||"DataStore"!==s.data.name&&"TreeStore"!==s.data.name)return this.uh=s,w("onSyncUnknown",[this,s,n]);s=s.data}var i=k(function(t,i,e){this.ch||(n&&this.branch&&(this.nh=!0),this.importData(s,!0),n&&this.silent(n),this.oe&&this.oe(),t&&i&&e||this.count()||(this.Nr={}),"delete"==e&&this.Nr[t]&&delete this.Nr[t],this.callEvent("onSyncApply",[]),r?r=!1:this.refresh())},this);this.fh=[s.attachEvent("onStoreUpdated",i),s.attachEvent("onIdChange",k(function(t,i){this.changeId(t,i),this.refresh(i)},this))],this.uh=s,this.lh=this.attachEvent("onStoreUpdated",function(t,i,e){"update"!=e&&"save"!=e||(this.ch=1,s.updateItem(t,i),this.ch=0)}),i()},unsync:function(){if(this.uh){var t=this.uh;if("DataStore"==t.name||"TreeStore"==t.name||t.data&&"DataStore"==t.data.name&&"TreeStore"==t.data.name){for(var i=0;i<this.fh.length;i++)t.detachEvent(this.fh[i]);this.detachEvent(this.lh)}else w("onUnSyncUnknown",[this,t]);this.uh=null}},destructor:function(){this.unsync(),this.pull=this.order=this.Nr=null,this.o=this.u={}},add:function(t,i){if(this.eh)for(var e in this.eh)z(t[e])&&(t[e]=this.eh[e]);this.Zr&&this.Zr(t);var s=this.id(t),n=arguments[2]||this.order,r=n.length;if((z(i)||i<0)&&(i=r),r<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.Wr){var h=this.Wr.length;this.order.length&&(h=Math.min(i||0,h)),this.Wr.insertAt(s,h)}return this.callEvent("onStoreUpdated",[s,t,"add"]),this.callEvent("onAfterAdd",[s,i]),t.id},remove:function(t){if(I(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.Wr&&this.Wr.remove(t),delete this.pull[t],this.Nr[t]&&delete this.Nr[t],this.callEvent("onStoreUpdated",[t,e,"delete"]),this.callEvent(
"onAfterDelete",[t])}},clearAll:function(t){this.pull={},this.Nr={},this.order=T(),this.Wr=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,n=this,r=t;if(s=I(r)?[r=r.map(function(t){return n.dh(t)})]:[(r=this.dh(t,i,e)).by,r.dir,r.as,r],this.callEvent("onBeforeSort",s)){var h=this.sorting.create(r);this.order=this.vh(h,this.order),this.Wr&&(this.Wr=this.vh(h,this.Wr)),this.refresh(),this.callEvent("onAfterSort",s)}},dh:function(t,i,e){var s=t;return"function"==typeof t?s={as:t,dir:i}:"string"==typeof t&&(s={by:t,dir:i,as:e}),"string"==typeof s.by&&(s.by=s.by.replace(/#/g,"")),s},vh:function(t,i){if(this.order.length){for(var e=i.splice(0,this.$freeze),s=T(),n=i.length-1;0<=n;n--)s[n]=this.pull[i[n]];return s.sort(t),T(e.concat(s.map(function(t){return this.id(t)},this)))}return i},_h:function(t){this.Wr&&!t&&(this.order=this.Wr,delete this.Wr)},ph:function(t,i,e){for(var s=T(),n=this.$freeze||0,r=0;r<this.order.length;r++){var h=this.order[r];(r<n||t(this.getItem(h),i))&&s.push(h)}e&&this.Wr||(this.Wr=this.order),this.order=s},find:function(t,i){var e=[];for(var s in this.pull){var n=this.pull[s],r=!0;if("object"==M(t)){for(var h in t)if(n[h]!=t[h]){r=!1;break}}else t(n)||(r=!1);if(r&&e.push(n),i&&e.length)return e[0]}return i?null:e},filter:function(e,i,t){if((e||this.Wr||this.rh)&&this.callEvent("onBeforeFilter",[e,i])&&(this._h(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.ph(s,i,t,this.mh)}this.refresh(),this.callEvent("onAfterFilter",[])}},bh: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.Wr||s);for(var n=0;n<s.length;n++)s[n]&&t.call(i||this,this.getItem(s[n]),n)},gh: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.gh(this,e[s])},addMark:function(t,i,e,s,n){var r=this.Nr[t]||{};if(!(this.Nr[t]=r)[i]){if(r[i]=s||!0,e){var h=r.$css||"";r.$css=h+" "+i}n||this.refresh(t)}return r[i]},removeMark:function(t,i,e,s){var n=this.Nr[t];if(n){if(n[i]&&delete n[i],e){var r=n.$css;r&&(n.$css=r.replace(i,"").replace(" "," "))}s||this.refresh(t)}},getMark:function(t,i){var e=this.Nr[t];return!!e&&e[i]},clearMark:function(t,i,e){for(var s in this.Nr){var n=this.Nr[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.Wr&&(i=this.Wr);for(var e=[],s=0;s<i.length;s++){var n=this.pull[i[s]];this.Tr&&!1===(n=this.Tr(n))||e.push(n)}return e},sorting:{create:function(t){return I(t)?this.wh(t):this.xh(t.dir,this.yh(t.by,t.as))},as:{server:function(){return!1},date:function(t,i){return t-=0,i-=0,isNaN(i)?1:isNaN(t)?-1:i<t?1:t<i?-1:0},"int":function(t,i){return t*=1,i*=1,isNaN(i)?1:isNaN(t)?-1:i<t?1:t<i?-1:0},string_strict:function(t,i){return i?t?(t=t.toString(),(i=i.toString())<t?1:t<i?-1:0):-1:1},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}},wh:function(n){var i=this;return n=n.map(function(t){return i.xh(t.dir,i.yh(t.by,t.as))}),function(
t,i){for(var e,s=0;!(e=n[s](t,i))&&n[++s];);return e}},yh:function(e,s){return e?("function"!=typeof s&&(s=this.as[s||"string"]),function(t,i){return s(t[e],i[e])}):s},xh:function(t,e){return"asc"!=t&&t?function(t,i){return-1*e(t,i)}:e}}};var Fe=F.proto({$init:function(t){t=t||"",this.Mh={},this.U=1,this.data=new Te,this.data.attachEvent("onClearAll",k(this.Sh,this)),this.data.attachEvent("onServerConfig",k(this.kh,this)),this.attachEvent("onDestruct",this.Sh),this.data.feed=this.Ch,this.data.owner=t.id},Ch:function(t,i,e,s,n){return this.$h?(s=m.defer(),this.$h=[t,i,e,s,n],s):(this.$h=!0,this.Mh.from=t,this.Mh.count=i,this.Dh.call(this,t,i,e,s,!1,n))},Dh:function(t,i,e,s,n,r){var h=this,o=this.data.url;t<0&&(t=0),n||(n={start:t,count:i}),this.count()&&(n["continue"]="true");var a=this.getState?this.getState():null;if(o&&"string"!=typeof o)return a&&(a.sort&&(n.sort=a.sort),a.filter&&(n.filter=a.filter)),this.load(o,0,n,r).then(function(t){return h.Ih(t,e,s)},function(){return h.Ah()});o+=-1==o.indexOf("?")?"?":"&";var u=[];for(var c in n)u.push(c+"="+n[c]);if(a){if(a.sort)for(var f=I(a.sort)?a.sort:[a.sort],l=0;l<f.length;l++)u.push("sort["+f[l].id+"]="+encodeURIComponent(f[l].dir));if(a.filter)for(var d in a.filter){var v=a.filter[d];"object"==M(v)&&(v=B().stringify(v)),u.push("filter["+d+"]="+encodeURIComponent(v))}}return o+=u.join("&"),this.Mh.url!==o?(this.Mh.url=o,this.load(o,0,null,r).then(function(t){return h.Ih(t,e,s)},function(){return h.Ah()})):(this.$h=!1,m.reject())},Ih:function(t,i,e){var s=this;return C(function(){return s.Ah()},"","",100),i&&B.$callback(this,i,t),e&&e.resolve(t),t},Ah:function(){var t=this.$h;this.$h=!1,"object"==M(t)&&this.data.feed.apply(this,t)},load:function(t){t=Y.$parse(t);var i=Rt.load.apply(this,arguments);return this.data.url||(this.data.url=t),i},loadNext:function(t,i,e,s,n,r){var h=this.B;if(!h.datathrottle||n)return i||0===i||(i=this.count()),t||(t=h.datafetch||this.count()),this.data.url=s||this.data.url,this.callEvent("onDataRequest",[i,t,e,s])&&this.data.url?this.data.feed.call(this,i,t,e,!1,r):m.reject();this.Th&&window.clearTimeout(this.Th);var o=m.defer();return this.Th=C(function(){o.resolve(this.loadNext(t,i,e,s,!0,r))},this,0,h.datathrottle),o},Fh:function(t,i){var e=this.Mh;return!!(this.$h&&e.url&&e.from<=i&&e.count+e.from>=t+i)},removeMissed_setter:function(t){return this.data.Kr=t},zh:function(){var t=this.B.save;!0===t&&(t=this.B.save=this.B.url);var i={master:this};t&&t.url?F.extend(i,t):i.url=t,Ie(i)},save_setter:function(t){return t&&this.$ready.push(this.zh),t},waitSave:function(t){var i=this;return Ie(this).Zt(function(){t.call(i)}).then(function(t){return 1==t.length?t[0]:t})},scheme_setter:function(t){this.data.scheme(t)},dataFeed_setter:function(t){return t=Y.$parse(t),this.data.attachEvent("onBeforeFilter",k(function(t,i){var e,s=this;if("function"==typeof t)return!0;if(this.B.dataFeed&&(t||i)){t=t||"id",i&&"object"==M(i)&&(i=i.id);var n=this.B.dataFeed;if("string"==typeof n){var r="filter["+t+"]="+encodeURIComponent(i);e=this.N(n+(n.indexOf("?")<0?"?":"&")+r,this.B.datatype)}else{var h={};h[t]=i,"function"==typeof n?e=n.call(this,i,h):n.$proxy&&n.load&&(e=n.load(this,{filter:h}))}return e&&(e.then||(e=m.resolve(e)),e.then(function(t){s.W(t,!0),s.data.callEvent("onAfterFilter",[])},function(t){return s.Y(t)})),!1}},this)),t},G:function(){if(this.B.ready&&!this.Ph){var t=v(this.B.ready,this.$scope);t&&C(t,this,arguments),this.callEvent&&C(this.callEvent,this,["onReady",[]]),this.Ph=!0}},Sh:function(t){this.U++,t||(this.$h=!1,this.Mh={},this.waitData=m.defer())},kh:function(t){this.Bi(t)}},Rt),ze={getState:function(){for(var i=this,t=this.config.columns.length,e=this.config.columns,s={ids:[],size:[],select:this.getSelectedId(!0),scroll:this.getScrollState()},n=0;n<t;n++){var r=e[n];s.ids.push(r.id),s.size.push(r.fillspace||r.adjust?-1:r.width)}if(s.order=[].concat(this.Vh.length?this.Vh:s.ids),this.Hh.length){var h=this.Hh.map(function(t){return{id:t,dir:i.Rh[t].dir}});s.sort=1==h.length?h[0]:h}if(this.Bh&&this.Eh){var o={},a=0;for(var u in this.Bh)if(
!this.jh[u]){var c=this.Bh[u];c[1].value=o[u]=c[2].getValue(c[0]),a=1}a&&(s.filter=o)}for(var f in s.hidden=[],this.jh)s.hidden.push(f);return s},setState:function(t){var i=this,e=this.config.columns;if(t){if(this.markSorting(),this.Hh=[],this.Rh={},this.blockEvent(),t.order&&t.order.length){this.Vh=T([].concat(t.order));var s=t.order.length-this.B.rightSplit;this.Lh=[this.B.leftSplit,s,this.B.rightSplit]}if(t.hidden){for(var n={},r=0;r<t.hidden.length;r++)n[t.hidden[r]]=!0,this.Vh.length||this.hideColumn(t.hidden[r]);if(this.Vh.length)for(var h=0;h<this.Vh.length;h++){var o=this.Vh[h];!!n[o]==!this.jh[o]&&this.hideColumn(o,{},!1,!!n[o])}}if(t.ids){for(var a=!1,u=0;u<e.length;u++)e[u].id!=t.ids[u]&&(a=!0);if(a){for(var c=0;c<t.ids.length;c++)e[c]=this.getColumnConfig(t.ids[c])||e[c];this.refreshColumns()}}if(t.size)for(var f=Math.min(t.size.length,e.length),l=0;l<f;l++){var d=e[l];d&&0<t.size[l]&&d.width!=t.size[l]&&(delete d.fillspace,delete d.adjust,this.Oh(l,t.size[l],!0))}this.unblockEvent();var v=!(this.B.leftSplit||this.B.rightSplit);this.Nh(v),this.callEvent("onStructureUpdate",[]);var _=this.Wh={};if(t.sort){var p=t.sort,m=!0;I(p)||(m=!(p=[p]));for(var b=0;b<p.length;b++){var g=this.getColumnConfig(p[b].id);g&&(this.Yh(g.id,p[b].dir,g.sort,m),"server"==g.sort&&(_.sort=!0))}}if(t.filter){var w=this.filterByAll;for(var x in this.filterByAll=function(){},t.filter){var y=t.filter[x],M=this.Bh[x];if(y&&M){M[2].setValue(M[0],y);var S=M[1].contentId;S&&(this.Uh[S].value=y)}}for(var k in this.Bh)if(!t.filter[k]){var C=this.Bh[k];C[2].setValue(C[0],"")}this.filterByAll=w,this.filterByAll()}if(delete this.Wh,(_.sort||_.filter)&&this.loadNext(0,0,0,0,!0,!0).then(function(){_.sort&&i.qh(_.$params),_.filter&&i.Gh()}),t.select&&this.select){var $=t.select;this.unselect();for(var D=0;D<$.length;D++)$[D].row&&!this.exists($[D].row)||this.Xh($[D],!0)}t.scroll&&this.scrollTo(t.scroll.x,t.scroll.y)}}},Pe={Kh:function(t,i,e){i||le.addDrop(t.Ui,t,!0),e||le.addDrag(t.Ui,t),this.attachEvent("onDragOut",function(t,i){this.$dragMark(t,i)}),this.attachEvent("onBeforeAutoScroll",function(){var t=le.getContext();return!(!le.Us||!t||t.to!==this&&!this.Jh)})},drag_setter:function(t){return t&&(F.extend(this,Xt,!0),"order"!=t&&"move"!=t||F.extend(this,d("DragOrder"),!0),"inner"!=t&&"order"!=t||(this.Zh=!0),this.Kh(this,"source"==t,"target"==t),delete this.drag_setter),t},$dragIn:function(t,i,e){var s=this.locate(e)||null,n=le.Ks;if((this.Zh||n.from.Zh)&&n.from!==this)return!1;var r=le.getMaster(i),h=this.getItemNode(s,e)||this.tt;if(h==le.cn)return h;n.target=s,n.to=r,this.ht&&(this.ht=window.clearTimeout(this.ht));var o=this.addRowCss&&G.touch&&!this.B.prerender;return!1===this.B.dragscroll||o||(this.ht=C(function(t,i){this.Qh(i),this.et(t,i)},this,[gt(e),s],250)),this.$dropAllow(n,e)&&this.callEvent("onBeforeDragIn",[n,e])?(this.$dragMark(n,e),h):(n.to=n.target=null,this.ht&&(this.ht=window.clearTimeout(this.ht)),null)},$dropAllow:function(){return!0},Qh:function(){},io:function(t){return t&&"object"===M(t)?t.toString():t},$dragOut:function(t,i,e,s){var n=(this.zt.contains(e)?this.locate(s):null)||null,r=le.Ks;return(r.target||"").toString()==(n||"").toString()||(this.ht&&(this.ht=window.clearTimeout(this.ht)),r.target=r.to=null,this.callEvent("onDragOut",[r,s])),null},$drop:function(t,i,e){var s=le.Ks;(s.to=this).eo(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.so(s,e),this.callEvent("onAfterDrop",[s,e]))},eo:function(t,i,e){var s=this.io(e.target);this.getBranchIndex?e.index=s?(e.parent=this.getParentId(s),this.getBranchIndex(s)):-1:e.index=s?this.getIndexById(s):this.count()},so: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)}},$longTouchLimit:!0,pn:function(t,i){if(this.getItemNode){var e=this.locate(i,!0),s=e?this.getItemNode(e):null;return s?mt(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!=x.find.call(n,e)){var r={};s=[];for(var h=0;h<n.length;h++)r[n[h]]=!0;for(var o=0;o<this.data.order.length;o++){var a=this.data.order[o];r[a]&&s.push(a)}}}var u=le.Ks={source:s,start:e};if((u.from=this).callEvent("onBeforeDrag",[u,i]))return G.touch&&"touch"==this.no&&C(function(){ue.Je=null}),u.html||this.$dragHTML(this.getItem(e),i,u)}return null},$dragHTML:function(t,i,e){var s=this.Q(t);return I(e.source)&&1<e.source.length&&(s=this.ro(s,e.source.length)),s},ro: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.io(t.target)),this.ho&&this.ho!=i&&(this.oo([this.ho],"webix_drag_over",!0),this.ho=null),!this.ho&&i?(this.ho=i,this.ao([i],"webix_drag_over",!0),i):!!t.to},ao:function(t,i){for(var e=0;e<t.length;e++)this.addCss(t[e],i)},oo:function(t,i){for(var e=0;e<t.length;e++)this.removeCss(t[e],i)},$dropHTML:function(){return""},uo:function(t,i){var e=this.getItemNode(t);e?e.parentNode.insertBefore(le._n[0],e):i.children[0].appendChild(le._n[0])}},Ve={$drag:function(t,i){var e=Pe.$drag.apply(this,arguments);if(!e)return e;var s=le.Ks;return this.co&&this.co(s),this.Zh&&this.getBranchIndex&&(this.fo=this.lo?20*(this.getItem(s.start).$level+1)+8:0),I(s.source)&&(le.ln(i),this.ao(s.source,"webix_invisible")),e},$dragIn:function(t,i,e){var s=Pe.$dragIn.apply(this,arguments);if(!s)return s;le._n||(le._n=this["do"]());var n=le.Ks,r="$webix-last";if(n.target&&(r=this.io(n.target)),"$webix-last"!=r&&"$webix-drop"!=r){var h={direction:this.B.layout||this.vo||"y",x:"width",y:"height"},o=mt(s);2*(gt(e)[h.direction]-o[h.direction])>o[h[h.direction]]&&(r=this.getNextId(r)||"$webix-last")}return r==this._o||"$webix-drop"==r||(this._o=r,this.uo(r,i)),s},$dragPos:function(t){if(!this.Zh){var i=le.Ks;return t.y+=i.y_offset,void(t.x+=i.x_offset)}var e=mt(this.$view);if("x"==this.B.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.po||0)-12,t.x=e.x+8+(this.fo||0),t.y=t.y-18,t.y<e.y)t.y=e.y;else{var n=e.y+e.height-(this.po||0);t.y>n&&(t.y=n)}},$dragOut:function(t,i,e){return i!=e&&(this.mo?this.mo():vt(le._n),this._o=le._n=null),Pe.$dragOut.apply(this,arguments)},eo:function(t,i,e){var s="$webix-last"==this._o?null:this._o;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=le.Ks;I(t.source)&&this.oo(t.source,"webix_invisible"),vt(le.Yi)},"do":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._id,"$webix-drop"),[t]},$dragMark:function(){return!1}};t("DragOrder",Ve);var He={$init:function(){this.bo=F.extend([],x,!0),this.go=-1},undo_setter:function(t){return t&&(this.wo(),this.wo=function(){}),t},wo:function(){var n=this;this.attachEvent("onBeforeDrop",function(t){if(t.from==t.to){var i=n.xo=S(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.xo&&n.xo.id==t){var i=n.xo;n.xo=null,n.yo(t,i,"move")}}),this.data.attachEvent("onBeforeDelete",function(t){if(this.getItem(t)){var i=n.Mo=S(this.getItem(t));this.branch?(i.$index=this.getBranchIndex(t),this.branch[t]&&(i.$branch=S(this.serialize(t)))):i.$index=this.getIndexById(t)}}),this.data.attachEvent("onDataUpdate",function(t,i,e){n.yo(t+"",e,"update")}),this.data.attachEvent("onStoreUpdated",function(t,i,e){var s=null;t&&("add"==e?s=S(i):"delete"==e&&(s=n.Mo),s&&n.yo(t,s,e))}),this.data.attachEvent("onIdChange",function(t,i){"object"==M(t)&&(t=t.row);for(
var e=0;e<n.bo.length;e++)n.bo[e].id==t&&(n.bo[e].id=i)})},yo:function(t,i,e){!this.So&&this.B.undo&&(this.bo.push({id:t,action:e,data:i}),20==this.bo.length&&this.bo.splice(0,1),this.ko||(this.go=this.bo.length-1))},ignoreUndo:function(t,i){this.So=!0,t.call(i||this),this.So=!1},removeUndo:function(t){for(var i=this.bo.length-1;0<=i;i--)this.bo[i].id==t&&("id"==this.bo[i].action&&(t=this.bo[i].data),this.bo.removeAt(i));this.go=this.bo.length-1},undo:function(e){if(e)this.ignoreUndo(function(){var t,i;for(i=this.bo.length-1;!t&&0<=i;i--)this.bo[i].id==e&&(t=this.bo[i]);t&&(this.Co(t),this.bo.removeAt(i+1),this.go=this.bo.length-1)});else{var t=this.bo[this.go];t&&(this.ignoreUndo(function(){this.Co(t),this.bo.removeAt(this.go)}),this.go--)}},Co:function(t){if("delete"==t.action){var i=null,e=t.data.$parent;t.data.$branch&&(i={parent:t.id,data:S(t.data.$branch)},delete t.data.$branch,e&&!this.data.pull[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 Re(t){t&&t.setMasterValue&&!t.$o&&(t.$o=!0,t.attachEvent("onValueSuggest",function(){C(function(){w("onEditEnd",[])})}))}function Be(t){return"string"==typeof t?t:t.linkInput?t.B.id:("object"==M(t)?(I(t)&&(t={data:t}),t.view=t.view||"suggest"):!0===t&&(t={view:"suggest"}),ni(t).config.id)}function Ee(t){return((t.header&&t.header[0]?t.header[0].text:t.editValue||t.label)||"").toString().replace(/<[^>]*>/g,"")}var je={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,Re(function n(t,i){var e=t.config.suggest;if(e){var s=ai(t.config.suggest=Be(e));return s&&i&&s.linkInput(i),s}}(this,i))},getInputNode:function(){return this.node.firstChild},render:function(){return lt("div",{"class":"webix_dt_editor"},"<input type='text' aria-label='"+Ee(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(Qh){}},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 lt("div",{"class":"webix_dt_editor"},"<div><input type='checkbox' aria-label='"+Ee(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(I(t))for(var e=0;e<t.length;e++){var s=t[e],n=z(s.id),r=n?s:s.id,h=n?s:s.value;i+="<option value='"+r+"'>"+h+"</option>"}else for(var o in t)i+="<option value='"+o+"'>"+t[o]+"</option>";return lt("div",{"class":"webix_dt_editor"},"<select aria-label='"+Ee(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()),ai(this.config.$popup)},createPopup:function(){var t,
i=this.config.popup||this.config.suggest;if(i)return(t="object"!=M(i)||i.name?ai(i):(i.view=i.view||"suggest",ni(S(i)))).Do||(t.linkInput?t.linkInput(document.body):this.linkInput&&this.linkInput(document.body),t.Do=!0),Re(t),t;var e=je.$popup[this.popupType];return"string"==typeof e||e.name||(e=je.$popup[this.popupType]=ni(e),this.popupInit(e),e.linkInput||this.linkInput(document.body)),e.B.id},linkInput:function(t){Zt(D(t),"keydown",k(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||w("onEditEnd",[])}},this))},popupInit:function(){},popupType:"text",render:function(){return{}},$inline:!0}};je.color=F.extend({focus:function(){},popupType:"color",popupInit:function(t){t.getChildViews()[0].attachEvent("onItemClick",function(t){w("onEditEnd",[t])})}},je.popup),je.date=F.extend({focus:function(){},popupType:"date",setValue:function(t){this.Io=this.config.stringResult||t&&"string"==typeof t,je.popup.setValue.call(this,t)},getValue:function(){return this.getInputNode().getValue(this.Io?P.parseFormatStr:"")||""},popupInit:function(t){t.getChildViews()[0].attachEvent("onAfterDateSelect",function(t){w("onEditEnd",[t])})}},je.popup),je.combo=F.extend({Ao:function(t){var i,e;return this.config.popup?e=(i=this.config.popup).config.id:t?i=ai(e=Be(t)):e=this.To(t),Re(i),e},To:function(){var t=je.combo;return t.Fo=t.Fo||this.Ao(!0)},render:function(){var t=lt("div",{"class":"webix_dt_editor"},"<input type='text' role='combobox' aria-label='"+Ee(this.config)+"'>"),i=this.config.suggest=this.Ao(this.config.suggest);return i&&(ai(i).linkInput(t.firstChild,!0),Zt(t.firstChild,"click",k(this.showPopup,this))),t},getPopup:function(){return ai(this.config.suggest)},showPopup:function(){var t=this.getPopup(),i=t.getList(),e=this.getInputNode(),s=this.zo;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.Po=e},afterRender:function(){this.showPopup()},setValue:function(t){if(this.zo=t,this.config.suggest){var i=ai(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=ai(this.config.suggest),e=i.getList();(t||e.getSelectedId&&e.getSelectedId())&&(t=i.getSuggestion(t))}return t}},je.text),je.richselect=F.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),Re(t)},popupType:"richselect"},je.popup),je.password=F.extend({render:function(){var t=this,i=lt("div",{"class":"webix_dt_editor webix_password_editor"},"<input type='password' aria-label='"+Ee(this.config)+"'><span class='webix_icon wxi-eye'></span>");return Zt(i.querySelector(".webix_icon"),"click",function(){t.toggleInput(),t.getInputNode(t.node).focus()}),i},toggleInput:function(){var t=this.getInputNode(this.node),i="password"===t.getAttribute("type");t.setAttribute("type",i?"text":"password"),t.nextSibling.className="webix_icon wxi-eye".concat(i?"-slash":"")}},je.text),je.$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 Le={defaults:{editaction:"click"},$init:function(t){this.Vo={},this.Fi=0,this.wt=0,
this.Ui.style.position="relative",t&&(t.onDblClick=t.onDblClick||{}),this.attachEvent("onAfterRender",this.Ho),this.B.editable&&this.Ro(),F.extend(this,He)},Bo: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(Qh){}},Ho:function(){var t=this.getEditor();if(t&&t.$inline&&!t.getPopup){var i=this.Eo(t);if(i&&i!=t.node){var e=t.node.value;(t.node=i).value=e,i.focus(),this.Bo(i)}else this.editStop()}},editable_setter:function(t){return t&&this.Ro(),t},Ro:function(){var t=y("onEditEnd",k(function(){this.Fi&&this.editStop()},this)),i=y("onClick",k(function(t){this.Fi&&200<new Date-this.wt&&(this.Li&&!this.Li.popupType&&t&&this.Li.node&&this.Li.node.contains(t.target)||this.editStop())},this));this.attachEvent("onDestruct",function(){V(t),V(i)}),this.data.attachEvent&&this.data.attachEvent("onIdChange",k(function(t,i){this.jo(t,i)},this)),this.attachEvent("onItemClick",function(t){this.B.editable&&"click"==this.B.editaction&&this.edit(t)}),this.attachEvent("onItemDblClick",function(t){this.B.editable&&"dblclick"==this.B.editaction&&this.edit(t)}),this.Lo=k(function(){this.wt=new Date},this),this.Ro=function(){},this.Oo&&this.Oo()},No:function(){C(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.Wo(t,i.value,!1),this.callEvent("onLiveEdit",[i,t])}},this)},Yo:function(t){var i=this.B.form;"string"!=typeof i&&(this.B.form=i=ni(i).config.id);var e=(i=ai(i)).setValues?i:i.getChildViews()[0];e.setValues(this.getItem(t.row||t),!1,"auto"),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.B.editable&&this.callEvent("onBeforeEditStart",[t])){if(this.B.form)return this.Yo(t);var s=this.Uo(t);if(s){if(this.getEditor(t))return;i||this.editStop(),je[s];var n=F.extend({},je[s]),r=this.qo(t,n,e);n.config.liveEdit&&(this.Go=this.attachEvent("onKeyPress",this.No));var h=n.getPopup?n.getPopup(r).zt:r;return h&&Zt(h,"click",this.Lo),r&&Zt(r,"change",this.Xo,{bind:{view:this,id:t}}),!1!==e&&n.focus(),this.$fixEditor&&this.$fixEditor(n),this.wt=ei.edit_open_time=new Date,ji.setFocus(this,!0),this.callEvent("onAfterEditStart",[t]),n}return null}},getEditor:function(t){return t?this.Vo[t]:this.Li},jo:function(t,i){var e=this.Vo[t];e&&((this.Vo[i]=e).id=i,delete this.Vo[t])},Xo:function(){this.view.hasEvent("onEditorChange")&&this.view.callEvent("onEditorChange",[this.id,this.view.getEditorValue(this.id)])},Ko:function(){return this.B},qo:function(t,i,e){i.config=this.Ko(t);var s=i.render();i.$inline&&(s=this.Eo(t)),i.node=s;var n=this.getItem(t),r=n[this.B.editValue||"value"];return z(r)&&(r=""),i.setValue(r,n),i.value=r,this.Jo(t,i),!1!==e&&this.showItem(t),i.$inline||this.Zo(t,s,!0),i.afterRender&&i.afterRender(),s},Qo:function(t){return this.getItemNode(t)},Eo:function(t){var i=this.Qo(t);return i&&(i=i.getElementsByTagName("input")[0]||i),i},Uo:function(){return this.B.editor},Jo:function(t,i){i.id=t,this.Vo[t]=this.Li=i,this.Fi++},ta:function(t){this.Li==t&&(this.Li=0),t.destroy&&t.destroy(),delete t.popup,delete t.node,delete this.Vo[t.id],this.Fi--},focusEditor:function(){var t=this.getEditor.apply(this,arguments);t&&t.focus&&t.focus()},editCancel:function(){this.editStop(null,null,!0)},xi:function(t){if(t){var i=this.getEditor();if(i&&i.getPopup&&i.getPopup()==t.getTopParentView())return}this.editStop()},editStop:function(t){if(!this.ia){this.ia=1;var i=arguments[2],e=1;return t?e=this.ea(this.Vo[t],i):this.sa(function(t){e*=this.ea(t,i)}),this.ia=0,e}},at:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Ui}},Zo:function(t,i,e){if(i.style){var s=this.at(t,null,!0);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}},sa:function(t
){for(var i in this.Vo)t.call(this,this.Vo[i])},ea:function(t,i){if(t&&!ei.xt){var e={value:this.na(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.Wo(t,e.value,!0);this.updateItem(t.row||t.id,n)}}t.$inline?t.node=null:vt(t.node);var r=t.config.suggest;return r&&"string"==typeof r&&ai(r).hide(),this.ta(t),this.Go&&this.detachEvent(this.Go),this.callEvent("onAfterEditStop",[e,t,i]),1}return 0}},validateEditor:function(t){var i=!0;if(this.B.rules){var e=this.getEditor(t),s=e.column||this.B.editValue||"value",n=this.B.rules[s],r=this.B.rules.$all,h=e.getInputNode();if((n||r)&&!h.zt){var o=this.data.getItem(e.row||e.id),a=e.getValue();n&&(i=n.call(this,a,o,s)),r&&(i=r.call(this,a,o,s)&&i),i?St(h,"webix_invalid"):Mt(h,"webix_invalid"),w("onLiveValidation",[e,i,o,a])}}return i},getEditorValue:function(t){var i;if(i=0===arguments.length?this.Li:this.getEditor(t))return i.getValue()},getEditState:function(){return this.Li||!1},editNext:function(t,i){if(t=!1!==t,1==this.Fi||i){var e=this.ra(this.Li||i,function(t){return!!this.Uo(t)},t);if(this.editStop())return e&&(this.edit(e),this.ha(e)),!1}},ha:function(){},ra:function(t,i,e){var s=this.getIndexById(t.id),n=this.data.order;if(e){for(var r=s+1;r<n.length;r++)if(i.call(this,n[r]))return n[r]}else for(var h=s-1;0<=h;h--)if(i.call(this,n[h]))return n[h];return null},na:function(t){return t.getValue()},Wo:function(t,i,e){var s=e?{}:this.getItem(t.id);return s[this.B.editValue||"value"]=i,s}},Oe={$init:function(){this.$view.className+=" webix_flexlayout"},oa:function(){},aa:function(){},ua:function(){},$getSize:function(){var t=0,i=0,e=this.B.gravity;this.ni=[];for(var s=0;s<this.ai.length;s++){var n=this.ai[s].$getSize(0,0);this.ni.push(n),t=Math.max(t,n[0]),i=Math.max(i,n[2])}return t+=this.ca.left+this.ca.right,i+=this.ca.top+this.ca.bottom,this.B.width&&(t=Math.max(t,this.B.width)),this.B.height&&(i=Math.max(i,this.B.height)),[t,1e5,i,1e5,e]},render:function(){this.resize()},fa:function(){if(this.isVisible(this.B.id)){var t=this.$view.style,i=Math.round(this.la/2);t.paddingTop=this.ca.top-i+"px",t.paddingBottom=this.ca.bottom-i+"px",t.paddingLeft=this.ca.left-i+"px",t.paddingRight=this.ca.right-i+"px";for(var e=0;e<this.ai.length;e++)if(!this.ai[e].B.hidden){var s=this.ai[e].$view,n=this.ni[e],r=this.ai[e].B;s&&(s.style.minWidth=n[0]+"px",n[1]<1e5&&n[1]!=n[0]&&(s.style.maxWidth=n[1]+"px"),s.style.flexBasis=r.flexBasis||n[0]+"px",s.style.flexGrow=r.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 h=[],o=0;o<this.ai.length;o++)if(!this.ai[o].B.hidden){var a=this.ai[o].$view;h[o]=[a.offsetWidth,a.offsetHeight]}for(var u=0;u<this.ai.length;u++)if(!this.ai[u].B.hidden){var c=this.ai[u];if(c.$view){c.B.flex=!0;var f=this.ni[u],l=f[2]==f[3]?f[2]:h[u][1];c.$setSize(h[u][0],l),c.B.flex=!1}}this.$view.style.height="",this.$height=this.Me=this.$view.scrollHeight,this.$view.style.height=this.Me+"px"}}},Ne={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}},We={$init:function(){var t=this;this.attachEvent("onClearAll",function(){return t.Gr=null}),this.attachEvent("onSyncApply",function(){return t.Gr=null})},ungroup:function(t){if(this.getBranchIndex){if(!this.da(t))return}else{if(!this.Gr)return;this.order=this.Gr,this.pull=this.va}this.callEvent("onStoreUpdated",[])},da:function(t){for(var i=this,e=t||0,s="0"==e?1:this.getItem(e).$level+1,
n=!1,r=this.branch[e],h=[],o=0;o<r.length;o++){var a=r[o];if(this.pull[a].$group){n=!0;var u=this.branch[a];u&&(this.branch[a]=u.filter(function(t){if(!i.pull[t].$footer)return t;i._a(t)})),h=h.concat(this.branch[a]||[]),this._a(a)}else h.push(a)}return!!n&&(this.branch[e]=h,this.pa(this.branch[e],e,s),void 0===t&&this.da(),!0)},_a:function(t){delete this.pull[t],delete this.branch[t]},qr:function(t){this.blockEvent(),this.group(t),this.unblockEvent()},ma:function(i){if("function"==typeof i)return i;var t=function(t){return t[i]};return t.$name=i,t},group:function(e,t){var i;if("string"==typeof e?(i=e,e={by:this.ma(e),map:{}}):"function"==typeof e?e={by:e,map:{}}:"string"==typeof e.by&&(i=e.by,e.by=this.ma(e.by)),e.map=e.map||{},i&&!e.map[i]&&(e.map[i]=[i]),e.missing=e.missing===undefined||e.missing,this.getBranchIndex)return this.ba(e,t);this.Gr||(this.Gr=this.order,this.va=this.pull);var s={},n=[],r=[],h=e.missing;this.each(function(t){var i=e.by(t);if(!i&&0!==i){if(!1===h)return;if(!0===h)return void r.push(t);i=h}s[i]||(n.push({id:i,value:i,$group:!0,$row:e.row}),s[i]=T()),s[i].push(t)});for(var o=0;o<n.length;o++){var a=n[o];this.ga(e.map,a,s[n[o].id]),this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[a.id,a.value,s[n[o].id]])}this.order=T(),this.pull={},this.wa(n),this.wa(r),this.callEvent("onStoreUpdated",[])},wa:function(t){for(var i=0;i<t.length;i++){var e=this.id(t[i]);this.pull[e]&&(e=t[i].id=$()),this.pull[e]=t[i],this.order.push(e),this.Zr&&this.Zr(t[i])}},ga:function(t,i,e){for(var s in t){var n=t[s][1]||"any",r=this.ma(t[s][0]);"function"!=typeof n&&(Ne[n],n=Ne[n]),i[s]=n.call(this,r,e)}},ba:function(t,i){var e=0;i?e=this.getItem(i).$level:i=0;for(var s=[],n=[],r=[],h=this.branch[i],o={},a=0;a<h.length;a++){var u=this.getItem(h[a]),c=t.by(u);if(!c&&0!==c){if(!1===t.missing)continue;if(!0===t.missing){r.push(u.id);continue}c=t.missing}var f=o[c];if(!f){var l=$(),d=this.pull[l]={id:l,value:c,$group:!0,$row:t.row};this.Zr&&this.Zr(d),n.push(d),(f=o[c]=this.branch[l]=[]).xa=[],s.push(l)}f.push(u.id),f.xa.push(u)}this.branch[i]=s.concat(r);for(var v=0;v<n.length;v++){var _=n[v];if(this.ga(t.map,_,this.branch[n[v].id].xa),this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[_.id,_.value,this.branch[_.id].xa]),t.footer){var p="footer$"+_.id,m=this.pull[p]={id:p,$footer:!0,value:_.value,$level:e,$count:0,$parent:_.id,$row:t.footer.row};this.ga(t.footer,m,this.branch[n[v].id].xa),this.branch[_.id].push(m.id),this.callEvent("onGroupFooter",[m.id,m.value,this.branch[_.id].xa])}delete this.branch[_.id].xa}this.pa(this.branch[i],i,e+1),this.callEvent("onStoreUpdated",[])},pa: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 r=this.branch[n.id];r&&this.pa(r,n.id,e+1)}}},Ye={$init:function(){F.extend(this.data,We)},group:function(t,i){i||0===i||(this.$blockRender=!0,this.data.ungroup(),this.$blockRender=!1),this.data.group(t,i)},ungroup:function(t){this.data.ungroup(t)}},Ue={$init:function(){var t=this;this.$ready.push(function(){t.customRadio_setter&&!t.config.customRadio||Zt(t.$view,"keydown",t.ya,{bind:t})})},yi:function(){if(!ji.canFocus(this))return!1;var t=this.Ma();if(t)for(var i=0;i<t.length;i++)if("0"==t[i].getAttribute("tabindex"))return t[i].focus()},Sa:function(){var t=this.Ma();if(t)for(var i=0;i<t.length;i++)if("0"==t[i].getAttribute("tabindex"))return t[i].blur()},ya:function(t){var i=t.which||t.keyCode;if(34<i&&i<41){var e=this.Ma(),s=!1;if(!e.length)return;wt(t);var n=37===i||38===i||35===i?-1:1;if(35===i)s=e.length-1;else if(36===i)s=0;else for(var r=0;r<e.length;r++)if("0"==e[r].getAttribute("tabindex")){s=r+n;break}if(!1!==s){var h=s;do{if(h>=e.length&&(h=0),h<0&&(h=e.length-1),e[h].getAttribute("webix_disabled"))h+=n;else{var o=e[h].getAttribute("button_id");this.setValue(o,"user"),e[h].focus(),h="success"}}while("success"!==h&&h!==s)}}},Pe:function(t,i){for(var e,s=i.target;s&&!s.webix_tooltip;){if(e=s.getAttribute("webix_t_id"))return this.getOption(e);s=s.parentNode}return null},
optionIndex:function(t){for(var i=this.B.options,e=0;e<i.length;e++)if(i[e].id==t)return e;return-1},getOption:function(t){var i=this.optionIndex(t);return-1!==i?this.B.options[i]:null},addOption:function(t,i,e,s){var n=t;"object"!=M(t)?n={id:t,value:i=i||t}:(t=n.id,s=e,e=i),-1===this.optionIndex(t)&&(x.insertAt.call(this.B.options,n,s),this.refresh(),this.callEvent("onOptionAdd",[t,n])),e&&(1===this.B.options.length&&(this.B.value=""),this.setValue(t,"auto"))},removeOption:function(t){var i=this.optionIndex(t);if(-1!==i){var e=this.B.options;x.removeAt.call(e,i),this.refresh(),this.B.value==t&&this.ka(e,i),this.callEvent("onOptionRemove",[t,this.B.value])}},ka:function(t,i){var e=t.length;if(e&&!this.customRadio_setter){for(var s=i=Math.min(i,e-1);s<e;s++)if(!t[s].hidden)return this.setValue(t[s].id,"auto");for(var n=i;0<=n;n--)if(!t[n].hidden)return this.setValue(t[n].id,"auto")}this.setValue("","auto")},Ca:function(t){var i=this.B.options;if(i.length){for(var e=0;e<i.length;e++)if(!i[e].hidden&&!i[e].disabled)return i[e].id;if(t)return i[0].id}return""},$a:function(t){for(var i=[],e=0;e<t.length;e++)t[e].hidden||i.push(t[e]);return i},Da:function(t,i,e){var s=this.B.options,n=this.optionIndex(t);s[n]&&e!=!!s[n][i]&&((s[n][i]=e)&&"hidden"===i&&this.B.value==t&&this.ka(s,n),this.refresh())},hideOption:function(t){this.Da(t,"hidden",!0)},showOption:function(t){this.Da(t,"hidden",!1)},disableOption:function(t){this.Da(t,"disabled",!0)},enableOption:function(t){this.Da(t,"disabled",!1)}},qe=F.proto({$init:function(t){this._id="map_"+$(),this.Ia=t,this.Aa=[],this.Ta=[]},addRect:function(t,i,e){this.Fa(t,"RECT",i,e)},addPoly:function(t,i,e){this.Fa(t,"POLY",i,e)},Fa:function(t,i,e,s){var n="";4==arguments.length&&(n="userdata='"+s+"'"),this.Aa.push("<area "+this.Ia+"='"+t+"' shape='"+i+"' coords='"+e.join()+"' "+n+"></area>"),this.Ta.push({index:s,points:e})},addSector:function(t,i,e,s,n,r,h,o){var a=[];a.push(s),a.push(Math.floor(n*h));for(var u=i;u<e;u+=Math.PI/18)a.push(Math.floor(s+r*Math.cos(u))),a.push(Math.floor((n+r*Math.sin(u))*h));return a.push(Math.floor(s+r*Math.cos(e))),a.push(Math.floor((n+r*Math.sin(e))*h)),a.push(s),a.push(Math.floor(n*h)),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 r=s[n];e?r.getAttribute("coords")&&(r.coordsdis=r.getAttribute("coords"),r.setAttribute("coords",""),r.coords=""):e||r.coordsdis&&(r.setAttribute("coords",r.coordsdis),r.coords=r.coordsdis,r.coordsdis=""),s[n].style.display=e?"none":""}},render:function(t){var i=lt("DIV");i.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;",t.appendChild(i);var e=G.isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";i.innerHTML="<map id='"+this._id+"' name='"+this._id+"'>"+this.Aa.join("\n")+"</map><img "+e+" class='webix_map_img' usemap='#"+this._id+"'>",t.Ni=i,this.Aa=[]}}),Ge={$init:function(){this.be={},this.ge={},this.getTopParentView=this.za=k(function(){return this},this),this.Pa(),this.$ready.push(this.Va)},$$:function(t){return this.be[t]},innerId:function(t){return this.ge[t]},Pa:function(){this.me=ei.lt,ei.lt=this},Va:function(){for(var t in this.be){var i=this.be[t];this.callEvent&&i.mapEvent&&!i.l.onitemclick&&i.mapEvent({onitemclick:this}),i.getTopParentView=this.za}ei.lt=this.me,this.me=0},Oi:function(t){delete this.be[t]},ui:function(){this.Pa();var t=ni.apply(this,arguments);return this.Va(),t}},Xe={$init:function(){this.getSelectedId&&this.attachEvent("onAfterRender",this.Ha),this.moveSelection&&this.attachEvent("onTabFocus",this.Ra)},Ra:function(){if(this.getSelectedId){var t=this.getSelectedId(!0);t.length&&this.getItemNode(t[0])||this.moveSelection("down")}},Ha:function(){var t=this.getSelectedId(!0);if(!t.length||!this.getItemNode(t[0])){var i=this.tt.querySelector("["+this._id+"]");i&&i.setAttribute("tabindex","0")}},Ba:function(n){return function(t,i){var e=i.target;if(!e.getAttribute("webixignore")){var s=e.tagName;if(
"INPUT"==s||"TEXTAREA"==s||"SELECT"==s)return!0}if(t&&t.moveSelection&&t.config.navigation&&!t.Fi)return wt(i),t.moveSelection(n,{shift:i.shiftKey,ctrl:i.ctrlKey,e:i})}},moveSelection:function(t,i,e){var s=this.B;if(!s.disabled){var n=this.getSelectedId(!0),r=this.count&&("x"==s.layout||1<s.xCount);if(("right"==t||"left"==t)&&this.Ea){var h=ai(this.Ea);return h.ja(!0),void("x"===h.config.layout?h.moveSelection(t):ji.setFocus(h))}if(!n.length&&this.count()){if("down"==t||"right"==t&&r)t="top";else{if(!("up"==t||"left"==t&&r))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))}var l="up"==t||"left"==t||"pgdown"==t||"bottom"==t?-1:1;if(this.La&&(n=this.La(n,o,l)),this.showItem(n),this.select(n),this.getSubMenu&&this.getSubMenu(n)&&this.Oa(n,this.getItemNode(n)),!this.config.clipboard&&!1!==e){var d=this.getItemNode(n);d&&d.focus()}}return!1}},navigation_setter:function(t){return t&&!ji.Na&&(ji.Na=!0,ji.addHotKey("up",this.Ba("up")),ji.addHotKey("down",this.Ba("down")),ji.addHotKey("right",this.Ba("right")),ji.addHotKey("left",this.Ba("left")),ji.addHotKey("shift+up",this.Ba("up")),ji.addHotKey("shift+down",this.Ba("down")),ji.addHotKey("shift+right",this.Ba("right")),ji.addHotKey("shift+left",this.Ba("left")),ji.addHotKey("ctrl+shift+up",this.Ba("up")),ji.addHotKey("ctrl+shift+down",this.Ba("down")),ji.addHotKey("ctrl+shift+right",this.Ba("right")),ji.addHotKey("ctrl+shift+left",this.Ba("left")),ji.addHotKey("pageup",this.Ba("pgup")),ji.addHotKey("pagedown",this.Ba("pgdown")),ji.addHotKey("home",this.Ba("top")),ji.addHotKey("end",this.Ba("bottom"))),t}},Ke={$init:function(){this.$ready.push(this.Wa),this.attachEvent("onStructureUpdate",this.Wa),this.attachEvent("onStructureLoad",function(){this.Ya.length||this.Wa()})},Wa:function(){var e=this.Ya=[],t=this.B;t.columns&&this.Ua(t.columns),this.B.map&&this.qa(t.map),e.length&&(this.data.Zr=function(t){for(var i=0;i<e.length;i++)e[i](t)})},qa:function(t){for(var i in t)this.Ya.push(this.Ga(i,t[i]))},Ga: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+"#"),qt(n)),0===t.indexOf("(date)")?(i&&!i.format&&(i.format=P.dateFormatStr),function(t){var i=(s(t)||"").toString();t[e]=P.parseFormatDate(i)}):0===t.indexOf("(number)")?function(t){t[e]=1*s(t)}:function(t){t[e]=s(t)||""}},Ua:function(t){for(var i=0;i<t.length;i++){var e=t[i];e.id||(e.id="i"+$(),e.header||(e.header="")),e.map&&this.Ya.push(this.Ga(e.id,e.map,t[i])),this.Xa(t[i])}},Ka:function(t){if("string"==typeof t){var i=ai(t);i?t=i:(t=new(d("DataCollection"))({url:t}),this.Vt.push(t)),t.getBody&&(t=i.getBody())}else if("function"==typeof t||t.$proxy)t=new(d("DataCollection"))({url:t}),this.Vt.push(t);else if(!t.loadNext){var e=I(t),s=[];if(e&&"object"!==M(t[0])){for(var n=0;n<t.length;n++)s.push({id:t[n],value:t[n]});t=s}else if(!e){for(var r in t)s.push({id:r,value:t[r]});t=s}t=new(d("DataCollection"))({data:t}),this.Vt.push(t)}return t},Xa:function(t){var i=t.options||t.collection;i&&(i=this.Ka(i),this.Ja(i,t)),t.header&&(this.Za(t.header),this.Za(t.footer))},Za:function(n){var r=this;n=n||[];for(var t=function(t){var i=n[t];if(i&&i.options){var e=i.options;e.loadNext||(e=i.options=r.Ka(e));var s=e.data.attachEvent("onStoreUpdated",function(){r.refreshFilter&&r.refreshFilter(i.columnId)});r.attachEvent("onDestruct",function(){e.$destructed||e.data.detachEvent(s)})}},i=0;i<n.length;i++)t(i)},Ja:function(t,i){var e=this;if(i){delete i.options,i.collection=t,i.template=i.template||this.Qa(t,i.id,i.optionslist);var s=t.data.attachEvent("onStoreUpdated",function(){e.refresh(),
e.refreshFilter&&e.refreshFilter(i.id)});this.attachEvent("onDestruct",function(){t.$destructed||t.data.detachEvent(s)})}},Qa:function(r,h,t){if(h=this.getColumnConfig?h:"value",t){var o="string"==typeof t?t:",";return function(t){var i=t[h];if(!i)return"";for(var e=i.toString().split(o),s=0;s<e.length;s++){var n=r.data.pull[e[s]];e[s]=n&&n.value||""}return e.join(", ")}}return function(t){var i=r.data.pull[t[h]];return i&&(i.value||0===i.value)?i.value:""}}},Je={$init:function(t){t=t||{},this.tu=0,this.iu=300,this.eu=null,this.su(t.onClick,"on_click"),this.su(t.onContext,"on_context"),this.su(t.onDblClick,"on_dblclick"),this.su(t.onMouseMove,"on_mouse_move"),this.on_click&&(Zt(this.Ui,"click",this.nu,{bind:this}),G.isIE8&&this.on_dblclick&&Zt(this.Ui,"dblclick",this.ru,{bind:this})),this.on_context&&Zt(this.Ui,"contextmenu",this.hu,{bind:this}),this.on_mouse_move&&this.ou()},ou:function(){this.au||(this.on_mouse_move=this.on_mouse_move||{},Zt(this.Ui,"mousemove",this.uu,{bind:this}),Zt(this.Ui,G.isIE?"mouseleave":"mouseout",this.uu,{bind:this}),this.au=1,this.attachEvent("onDestruct",function(){this.cu&&window.clearTimeout(this.cu)}))},su:function(t,i){if(t){var e=this[i],s=e?F.extend({},e):{};this[i]=F.extend(s,t)}},nu:function(t){if(!this.isEnabled())return!1;if(ji.Bt(this),this.on_dblclick){var i=(new Date).valueOf();if(i-this.tu<=this.iu&&this.locate)if(""+this.locate(t)==""+this.eu)return this.tu=0,this.ru(t);this.tu=i}return this.fu(t,this.on_click,"ItemClick")},ru:function(t){return this.fu(t,this.on_dblclick,"ItemDblClick")},hu:function(t){this.fu(t,this.on_context,"BeforeContextMenu","AfterContextMenu")},uu:function(t){this.$destructed||(document.createEventObject&&(t=document.createEventObject(event)),this.cu&&window.clearTimeout(this.cu),this.callEvent("onMouseMoving",[t]),this.cu=C(function(t){"mousemove"==t.type?this.lu(t):this.du(t)},this,[t],this.B.mouseEventDelay||500))},lu:function(t){this.fu(t,this.on_mouse_move,"MouseMove")||this.du(t)},du:function(t){this.callEvent("onMouseOut",[t||event])},fu:function(t,i,e,s){if(!(t=t||event).processed&&this.zt){t.processed=!0;var n=t.target;if(G.isIE8){var r=this.B.id,h=n.w_view;if(h){if(h!==r)return}else n.w_view=r}for(var o="",a=null,u=!1;n&&n.parentNode&&this.zt&&n!=this.zt.parentNode;){if(!u&&n.getAttribute&&(a=n.getAttribute(this._id))){if(n.getAttribute("webix_disabled"))return void(this.eu=null);if(this.eu=a,this.callEvent){if(!this.callEvent("on"+e,[a,t,n]))return;s&&this.callEvent("on"+s,[a,t,n])}u=!0}if(o=$t(n)){o=o.toString().split(" ");for(var c=0;c<o.length;c++){if(i[o[c]])if(!1===v(i[o[c]],this.$scope).call(this,t,a||pt(t,this._id),n))return u}}n=n.parentNode}return u}}},Ze={$init:function(){this.$ready.push(function(){this.attachEvent("onKeyPress",this.De)})},vu:function(t,i){if(37===t||39===t){wt(i),this._u(37===t?-1:1);var e=this.pu.querySelector("[tabindex='0']");e&&e.focus()}},mu:function(){vt(this.pu),this.pu=lt("DIV",{"class":"webix_nav_panel webix_nav_panel_"+this.B.navigation.type,role:"tablist"},""),this.zt.appendChild(this.pu),this.bu(),this.gu(),this.wu()},wu:function(){var i=[];this.pu&&(i[0]=Qt(this.pu,"click",k(function(t){for(var i=t.target,e=!1;i!=this.pu&&!e;){var s=i.getAttribute(this.xu);s&&(e=!0,this.yu(s)),i=i.parentNode}},this))),this.Mu&&(i[1]=Qt(this.Mu,"click",k(function(){this._u(-1)},this))),this.Su&&(i[1]=Qt(this.Su,"click",k(function(){this._u(1)},this))),this.attachEvent("onDestruct",function(){for(var t=0;t<i.length;t++)this.detachEvent(i[t]);i=null})},_u:function(t){if(this.ai){var i=this.ku+t;(i>=this.ai.length||i<0)&&(i=i<0?this.ai.length-1:0),this.setActiveIndex(i)}},yu:function(t){this.ai&&ai(t).show()},bu:function(){var t,i;if((i=this.B.navigation).items){this.xu=i.linkAttr||"bind_id",this.pu?this.Cu():this.mu();var e=this.ai?this.ai:this.data.order;if(1<e.length)for(var s=0;s<e.length;s++){t=lt("DIV",{"class":"webix_nav_item webix_nav_"+(s==this.ku?"active":"inactive"),role:"tab",tabindex:s==this.ku?"0":"-1"});var n=this.ai?this.ai[s].B.id:e[s];n&&t.setAttribute(this.xu,n),this.pu.appendChild(t)}}},Cu:function(
){if(this.pu)for(var t=this.pu.childNodes,i=t.length-1;0<=i;i--)vt(t[i])},gu:function(){var t=this.B.navigation;t.buttons&&(this.Mu&&vt(this.Mu),this.Mu&&vt(this.Su),this.Mu=lt("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_prev "},'<div role="button" tabindex="0" aria-label="'+P.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.zt.appendChild(this.Mu),this.Su=lt("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_next "},'<div role="button" tabindex="0" aria-label="'+P.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.zt.appendChild(this.Su))}},Qe={showOverlay:function(t){this.$u?this.$u.innerHTML=t:(this.$u=lt("DIV",{"class":"webix_overlay"},t||""),_t(this.$u,this.zt.firstChild,this.zt),this.zt.style.position="relative")},hideOverlay:function(){this.$u&&(vt(this.$u),this.$u=null)}},ts={pager_setter:function(s){if("string"==typeof s){var t=ai(s);if(!t)return this.$blockRender=!0,C(function(){var t=ai(s);this.B.pager=this.pager_setter(t);var i=t.B;i.count=this.data.Du(i.level),t.refresh(),this.$blockRender=!1,this.render()},this),null;s=t}return this.attachEvent("onBeforeRender",function n(t){if(this.config.topSplit&&(this.config.topSplit=0),s.config.autosize&&this.getVisibleCount){var i=this.getVisibleCount();isNaN(i)?(s.config.size=1,C(n,this,[!0])):i!=s.config.size&&(s.config.size=i,s.refresh(),!0===t&&this.refresh())}var e=this.B.pager;return-1!=e.page&&(this.data.$min=this.Iu(0,e.page*e.size),this.data.$max=this.Iu(this.data.$min,e.size),this.data.$pagesize=this.data.$max-this.data.$min,!0)}),s.$view||(s.view="pager",s=ni(s)),((this.Au=s).$master=this).data.attachEvent("onStoreUpdated",function(){var t=s.B;t.count=this.Du(t.level),s.refresh()}),this.data.Du=this.Du,s.B},Du:function(i){if(i&&0!==i){var e=0;return this.each(function(t){t.$level==i&&e++}),e}return this.count()},Iu:function(t,i){var e=this.B.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.Au&&this.Au.select(t)},getPage:function(){return this.Au.B.page},getPager:function(){return this.Au}},is={$init:function(){var t=this;z(this.Tu)&&this.attachEvent&&(this.attachEvent("onBeforeLoad",function(){return t.showProgress()}),this.attachEvent("onAfterLoad",function(){return t.hideProgress()}),this.Tu=null)},showProgress:function(t){var i;if(!this.Tu){var e="icon"==(t=F.extend({position:0,delay:2e3,type:"icon",icon:"wxi-sync",hide:!1},t||{},!0)).type?t.icon+" webix_spin":"";if(this.Tu=lt("DIV",{"class":"webix_progress_"+t.type,role:"progressbar","aria-valuemin":"0","aria-valuemax":"100",tabindex:"0"},"<div class='webix_progress_state "+e+"'></div>"),this.setPosition||(this.zt.style.position="relative"),_t(this.Tu,this.zt.firstChild,this.zt),this.zt.setAttribute("aria-busy","true"),(!ue.$active||"native"==this.no)&&this.getScrollState){var s=this.getScrollState();this.zt.scrollWidth!=this.$width&&(this.Tu.style.left=s.x+"px"),this.zt.scrollHeight!=this.$height&&("bottom"!=t.type?this.Tu.style.top=s.y+"px":this.Tu.style.top=s.y+this.$height-this.Tu.offsetHeight+"px")}this.Fu="icon"!=t.type}if(t){if(this.Fu){var n=t.position||1;if(this.Tu.style[G.transitionDuration]===undefined&&t.delay){var r=0,h=0,o=n/t.delay*30,a=this;this.zu&&(window.clearInterval(this.zu),h=this.Tu.firstChild.offsetWidth/this.Tu.offsetWidth*100),this.zu=window.setInterval(function(){30*r==t.delay?window.clearInterval(a.zu):(a.Tu&&a.Tu.firstChild&&(a.Tu.firstChild.style.width=h+r*o*n*100+"%"),r++)},30)}else t.delay&&(i=this.zt.firstChild.offsetWidth,this.Tu.firstChild.style[G.transitionDuration]=t.delay+"ms"),this.Tu.firstChild.style.width=100*n+"%"}return this.Pu&&clearTimeout(this.Pu),t.hide&&(this.Pu=C(this.hideProgress,this,[1],t.delay)),i}},hideProgress:function(t){this.Tu&&(t||!this.Fu?(this.zu&&window.clearInterval(this.zu),vt(this.Tu),this.Tu=null,this.zt.removeAttribute("aria-busy")):this.showProgress({position:1.1,delay:300,hide:!0}))}},es={$init:function(){
this.data,this.Yi=document.createElement("DIV"),this.data.attachEvent("onIdChange",k(this.Qr,this)),this.attachEvent("onItemClick",this.Vu),this.types||(this.types={"default":this.type},this.type.name="default"),this.type=l(this.type)},customize:function(t){ii(this,t)},item_setter:function(t){return this.type_setter(t)},type_setter:function(t){return this.types[t]?(this.type=l(this.types[t]),this.type.css&&(this.Ui.className+=" "+this.type.css)):this.customize(t),this.type.on_click&&F.extend(this.on_click,this.type.on_click),t},template_setter:function(t){this.type.template=qt(t)},Q:function(t){var i=this.data.Nr[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)},Hu:function(t){return this.Yi.innerHTML=this.Q(t),this.Yi.firstChild},Qr:function(t,i){var e=this.getItemNode(t);e&&(e.setAttribute(this._id,i),this.Ni[i]=this.Ni[t],delete this.Ni[t])},Vu:function(){if(this.B.click){var t=v(this.B.click,this.$scope);t&&t.call&&t.apply(this,arguments)}},getItemNode:function(t){if(this.Ni)return this.Ni[t];this.Ni={};for(var i=this.tt.childNodes,e=0;e<i.length;e++){var s=i[e].getAttribute(this._id);s&&(this.Ni[s]=i[e])}return this.getItemNode(t)},locate:function(t){return pt(t,this._id)},showItem:function(t){var i=this.getItemNode(t);if(i&&this.scrollTo){var e=i.offsetLeft,s=e+i.offsetWidth,n=i.offsetTop,r=n+i.offsetHeight,h=this.getScrollState(),o=h.x;(e<o||o+this.xe<s)&&(o=e);var a=h.y;(n<a||a+this.Me<r)&&(a=n),this.scrollTo(o,a),this.Ru&&this.Ru(t)}},render:function(t,i,e){if(this.isVisible(this.B.id)&&!this.$blockRender)if(t){var s=this.getItemNode(t);switch(e){case"paint":case"update":if(!s)return;_t(this.Ni[t]=this.Hu(i),s),vt(s);break;case"delete":if(!s)return;vt(s),delete this.Ni[t];break;case"add":_t(this.Ni[t]=this.Hu(i),this.getItemNode(this.data.getNextId(t)),this.tt);break;case"move":_t(this.getItemNode(t),this.getItemNode(this.data.getNextId(t)),this.tt)}}else this.callEvent("onBeforeRender",[this.data])&&((this.Bu||this.tt).innerHTML=this.data.getRange().map(this.Q,this).join(""),this.Ni=null,this.callEvent("onAfterRender",[]))}},ss={$init:function(t){if(t&&!t.scroll&&this.Eu)return this.tt=this.tt||this.Ui;(this.tt||this.Ui).appendChild(lt("DIV",{"class":"webix_scroll_cont"},"")),this.tt=(this.tt||this.Ui).firstChild,!this.callEvent||G.touch&&"native"!=this.no||Zt(this.zt,"scroll",function(){C(function(){this.callEvent("onAfterScroll",[])},this)},{bind:this})},no:"native",scroll_setter:function(t){if(!t)return!1;var i="auto"===t,e="x"==t?"x":"xy"==t?"xy":i?"xy":"y";if(G.$customScroll)Se.enable(this,e);else{var s=this.tt.parentNode.style;i?s.overflowX=s.overflowY="auto":(-1!=e.indexOf("x")&&(this.Se=!0,s.overflowX="scroll"),-1!=e.indexOf("y")&&(this.ye=!0,s.overflowY="scroll"))}return e},ju:function(t,i){if(!!this.B.scroll!=!!t){if(!G.$customScroll)this.tt.parentNode.style["x"===i?"overflowX":"overflowY"]=t?"auto":"hidden";"x"===i?this.Se=t:this.ye=t,this.B.scroll=!!t&&i}},getScrollState:function(){return{x:this.tt.parentNode.scrollLeft,y:this.tt.parentNode.scrollTop}},scrollTo:function(t,i){this.tt.parentNode.scrollLeft=t,this.tt.parentNode.scrollTop=i}},ns={$init:function(){this.or=T(),this.data,this.data.attachEvent("onStoreUpdated",k(this.Lu,this)),this.data.attachEvent("onStoreLoad",k(this.Ou,this)),this.data.attachEvent("onAfterFilter",k(this.Nu,this)),this.data.attachEvent("onSyncApply",k(this.Wu,this)),this.data.attachEvent("onIdChange",k(this.Yu,this)),this.$ready.push(this.Uu)},Uu:function(){("multiselect"==this.B.select||this.B.multiselect||"area"==this.B.select)&&Zt(this.$view,"mousedown",function(t){(t||window.event).shiftKey&&Mt(ei.Mt=this,"webix_noselect",1)})},Yu:function(t,i){for(var e=this.or.length-1;0<=e;e--)this.or[e]==t&&(this.or[e]=i)},Nu:function(){for(var t=this.or.length-1;0<=t;t--)if(this.data.getIndexById(this.or[t])<0){var i=this.or[t];this.removeCss(i,"webix_selected",!0),
this.or.splice(t,1),this.callEvent("onSelectChange",[i])}},Lu:function(t,i,e){"delete"==e?this.loadBranch?this.Wu():this.or.remove(t):t||this.data.count()||this.data.Wr||this.data.rh||(this.or=T())},Ou:function(){this.B.select&&this.data.each(function(t){t&&t.$selected&&this.select(t.id)},this)},Wu:function(){for(var t=this.or.length-1;0<=t;t--)this.exists(this.or[t])||this.or.splice(t,1)},qu:function(t,i,e,s){var n=i?"onBeforeSelect":"onBeforeUnSelect";if(!this.callEvent(n,[t,i]))return!1;s&&(this.Gu=!0,this.unselectAll(),this.Gu=!1),i?this.addCss(t,"webix_selected",!0):this.removeCss(t,"webix_selected",!0),e?e.push(t):(i?this.or.push(t):this.or.remove(t),this.Xu(t));var r=i?"onAfterSelect":"onAfterUnSelect";return this.callEvent(r,[t]),!0},select:function(t,i){var e=arguments[2],s=arguments[3];if(!t)return this.selectAll();if(I(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.or.length)return this.selectAll(this.or[this.or.length-1],t);var r=!1;e||i||1==this.or.length&&this.or[0]==t||(r=!0),r||!this.isSelected(t)?this.qu(t,!0,null,r):e&&this.unselect(t)}},unselect:function(t){if(!t)return this.unselectAll();this.isSelected(t)&&this.qu(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.or.push(t.id),this.qu(t.id,!0,e))},this),this.Xu(e)},unselectAll:function(){var i=[];this.or.each(function(t){this.qu(t,!1,i)},this),this.or=T(),this.Xu(i)},isSelected:function(t){return-1!=this.or.find(t)},getSelectedId:function(t){switch(this.or.length){case 0:return t?[]:"";case 1:return t?[this.or[0]]:this.or[0];default:return[].concat(this.or)}},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])},Ku:function(t){return 100<t.length||t.length>this.data.count/2},Xu:function(t){if("object"!=M(t)&&(t=[t]),t.length){if(this.Ku(t))this.data.refresh();else for(var i=0;i<t.length;i++)this.render(t[i],this.data.getItem(t[i]),"update");this.Gu||this.callEvent("onSelectChange",[t])}}};mi(function(){Qt(document.body,"mouseup",function(){ei.Mt&&(St(ei.Mt,"webix_noselect"),ei.Mt=null)})});var rs={Ju:["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.Ju[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))}):I(t)&&(i=t),0===i[3]?"":i.slice(0,3).map(function(t){return rs.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,r,h,o,a,u,c;switch(r=e*(1-i),h=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=r;break;case 1:a=h,u=e,c=r;break;case 2:a=r,u=e,c=o;break;case 3:a=r,u=h,c=e;break;case 4:a=o,u=r,c=e;break;case 5:a=e,u=r,c=h}return[a=Math.floor(255*a),u=Math.floor(255*u),c=Math.floor(255*c)]},rgbToHsv:function(t,i,e){var s,n,r,h,o,a,u;return s=t/255,n=i/255,r=e/255,h=Math.min(s,n,r),a=0,(u=o=Math.max(s,n,r))==h?a=0:o==s&&r<=n?a=60*(n-r)/(o-h)+0:o==s&&n<r?a=60*(n-r)/(o-h)+360:o==n?a=60*(r-s)/(o-h)+120:o==r&&(a=60*(s-n)/(o-h)+240),[a,0===o?0:1-h/o,u]}};function hs(t){var i=" ";if(t)for(var e in t)i+=e+'="'+t[e]+'" ';return i}var os={draw:function(t,i,e,s){return"<svg "+hs({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>"}};os.Zu={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,r=t.y+Math.sin(s)*i;return" A "+i+" "+i+" 0 "+(s-e>=Math.PI?1:0)+" 1 "+n+" "+r}},os.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.Zu[n],e+=this.Zu[n].apply(this,t[s].slice(1))}return i&&(e+=" Z"),e},os.Qu=function(t){for(var i=[],e=0;e<t.length;e++)i.push([e?"L":"M",t[e]]);return i},os.setOpacity=function(t,i){var e=rs.toRgb(t);return e.push(i),"rgba("+e.join(",")+")"},os.tc=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},os.getPath=function(t,i,e){return'<path class="'+i+'" vector-effect="non-scaling-stroke" d="'+t+'" '+(e=hs(e))+"/>"},os.getSector=function(t,i,e,s,n,r){r=hs(r);var h=[["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="'+os.definePath(h,!0)+'" '+r+"/>"},os.getCurve=function(t,i,e){return e=hs(e),'<path fill="none" class="'+i+'" vector-effect="non-scaling-stroke" d="'+this.definePath(this.tc(t))+'" '+e+"/>"},os.getLine=function(t,i,e,s){return this.getPath(this.definePath(this.Qu([t,i]),!0),e,s)},os.getCircle=function(t,i,e,s){return s=hs(s),'<circle class="'+e+'" cx="'+t.x+'" cy="'+t.y+'" r="'+i+'" '+s+"/>"},os.getRect=function(t,i,e,s,n,r){return'<rect class="'+n+'" rx="0" ry="0" x="'+t+'" y="'+i+'" width="'+e+'" height="'+s+'" '+(r=hs(r))+"/>"};var as={paddingX:6,paddingY:6,radius:2,minHeight:4,eventRadius:8};function us(t){this.config=F.extend(S(as),t||{},!0)}us.prototype.draw=function(t,i,e){var s=this.getPoints(t,i,e),n=this.config,r=os,h=n.color?this.ic(r,n.color):null,o=r.definePath(this.ec(s)),a=r.group(r.getPath(o,"webix_sparklines_line"+(h?" "+h.line:"")));a+=this.sc(r,s,n.radius,"webix_sparklines_item"+(h?" "+h.item:""));var u=Math.min(t.length?(i-2*(n.paddingX||0))/t.length:0,n.eventRadius);return a+=this.nc(r,s,u),r.draw(a,i,e,"webix_sparklines_line_chart"+(n.css?" "+n.css:""))},us.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]=ut(e[n]);return e},us.prototype.sc=function(t,i,e,s,n){for(var r=[],h=0;h<i.length;h++)r.push(t.getCircle(i[h],e,s,n));return t.group(r.join(""))},us.prototype.nc=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(""))},us.prototype.ec=function(t){var i,e,s=[];for(i=0;i<t.length;i++)e=i?"L":"M",s.push([e,t[i]]);return s},us.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 r=Math.max.apply(null,t),h=[],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)h.push({x:i/2+o,y:e/2+o});else{var c=i/(t.length-1),f=s.scale||r-n,l=(e-u)/(f||1);f||(e/=2);for(var d=0;d<t.length;d++)h.push({x:Math.ceil(c*d)+o,y:e-Math.ceil(l*(t[d]-n))+a-u})}return h};var cs={paddingX:3,paddingY:4,radius:1,minHeight:4,eventRadius:8};function fs(t){this.config=F.extend(S(cs),t||{},!0)}fs.prototype.draw=function(t,i,e){var s,n,r,h,o,a=this.config,u=us.prototype,c=os;return h=this.getPoints(t,i,e),r=c.definePath(u.ec(h),!0),a.color&&(o=this.ic(c,a.color)),n=c.group(c.getPath(r,"webix_sparklines_area"+(o?" "+o.area:""))),h.splice(h.length-3,3),r=c.definePath(u.ec(h)),n+=c.group(c.getPath(r,"webix_sparklines_line"+(o?" "+o.line:""))),n+=u.sc(c,h,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.nc(c,h,s),c.draw(n,i,e,"webix_sparklines_area_chart"+(a.css?" "+a.css:""))},fs.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]=ut(e[n]);return e},fs.prototype.getPoints=function(t,i,e){var s=us.prototype.getPoints.call(this,t,i,e),n=this.config.paddingX||0,r=this.config.paddingY||0;return s.push({x:i-n,y:e-r},{x:n,y:e-r},{x:n,y:s[0].y}),s};var ls={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 ds(t){this.config=F.extend(S(ls),t||{},!0)}ds.prototype.draw=function(t,i,e){var s,n,r,h,o,a=this.config,u="",c=[],f=this.getPoints(t,i,e),l=os;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)),r=f[s],c.push(l.getRect(r.x,r.y,r.width,r.height,"webix_sparklines_bar "+n));u+=l.group(c.join("")),h=parseInt(this.rc(t,i,e),10)+.5,o=a.paddingX||0,u+=l.group(l.getLine({x:o,y:h},{x:i-o,y:h},"webix_sparklines_origin"));var d=this.hc(t,i,e),v=[];for(s=0;s<d.length;s++)r=d[s],v.push(l.getRect(r.x,r.y,r.width,r.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:""))},ds.prototype.ic=function(t,i){var e={},s=t.styleMap;return i&&(e[s.color]=i),ut(e)},ds.prototype.rc=function(t,i,e){var s=this.config,n=s.paddingY||0,r=n+(e=(e||100)-2*n);if(!1!==s.origin){var h=Math.min.apply(null,t),o=Math.max.apply(null,t),a=s.origin||-1e-6;if(o<=a)r=n;else if(h<a){r-=e/(o-h)*(a-h)}}return r},ds.prototype.hc=function(t,i,e){var s=[],n=this.config.paddingX||0,r=this.config.paddingY||0;if(i=(i||100)-2*n,e=(e||100)-2*r,t.length)for(var h=i/t.length,o=0;o<t.length;o++)s.push({x:Math.ceil(h*o)+n,y:r,height:e,width:h});return s},ds.prototype.getPoints=function(t,i,e){var s=this.config,n=Math.min.apply(null,t);s.origin<n&&(n=s.origin);var r=Math.max.apply(null,t),h=[],o=s.paddingX,a=s.paddingY,u=s.margin,c=s.width||20,f=this.rc(t,i,e);if(i=(i||100)-2*o,e=(e||100)-2*a,t.length){var l=i/t.length,d=s.scale||r-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]-_));h.push({x:Math.ceil(l*m)+o+u/2,y:f-(t[m]>=_?b:0)-v,height:Math.abs(b)+v,width:c})}}return h};var vs={paddingY:2};function _s(t){this.config=F.extend(vs,t||{},!0)}_s.prototype.oc=0,_s.prototype.ac=["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],_s.prototype.uc=function(t,i){var e=i.length,s=this.ac.length;return e<s?(t&&(t=t<s-e?this.oc+2:this.oc+1),this.oc=t):t%=s,this.ac[t]},_s.prototype.draw=function(t,i,e){var s,n,r,h,o=this.config,a=o.color||this.uc,u=this.getAngles(t),c=os,f=e/2-(o.paddingY||0),l=i/2,d=e/2;for("function"!=typeof a&&(a=function(){return a}),h="",r=0;r<u.length;r++)(s={})[c.styleMap.color]=a.call(this,r,t,this.cc),h+=c.getSector({x:l,y:d},f,u[r][0],u[r][1],"webix_sparklines_sector",s);for(n=c.group(h),h="",r=0;r<u.length;r++)h+=c.getSector({x:l,y:d},f,u[r][0],u[r][1],"webix_sparklines_event_area",{webix_area:r});return n+=c.group(h),c.draw(n,i,e,"webix_sparklines_pie_chart"+(o.css?" "+o.css:""))},_s.prototype.getAngles=function(t){var i,e,s=-Math.PI/2,n=[],r=this.fc(t);for(e=0;e<t.length;e++)i=-Math.PI/2+r[e]-1e-4,n.push([s,i]),s=i;return n},_s.prototype.lc=function(t){for(var i=0,e=0;e<t.length;e++)i+=1*t[e];return i},_s.prototype.fc=function(t){var i,e,s=[],n=0,r=this.lc(t);for(i=0;i<t.length;i++)e=1*t[i],s[i]=2*Math.PI*(r?(e+n)/r:1/t.length),n+=e;return s};var ps={paddingX:3,paddingY:6,radius:2,minHeight:4,eventRadius:8};function ms(t){this.config=F.extend(S(ps),t||{},!0)}ms.prototype.draw=function(t,i,e){var s=this.config,n="",r=us.prototype,h=this.getPoints(t,i,e),o=os,a=s.color?this.ic(o,s.color):null;n+=o.group(o.getCurve(h,"webix_sparklines_line"+(a?" "+a.line:"")));var u=r.getPoints.call(this,t,i,e);n+=r.sc(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+=r.nc(o,u,c),o.draw(n,i,e,"webix_sparklines_line_chart"+(s.css?" "+s.css:""))},ms.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]=ut(e[n]);return e},ms.prototype.getPoints=function(t,i,e){var s,n,r,h,o=[],a=[],u=[];for(n=us.prototype.getPoints.call(this,t,i,e),s=0;s<n.length;s++)a.push(n[s].x),u.push(n[s].y);for(r=this.dc(a),h=this.dc(u),s=0;s<n.length-1;s++)o.push([n[s],{x:r[0][s],y:h[0][s]},{x:r[1][s],y:h[1][s]},n[s+1]]);return o},ms.prototype.dc=function(t){var i,e,s=[],n=[],r=[],h=[],o=[],a=[],u=t.length-1;for(n[s[0]=0]=2,r[0]=1,h[0]=t[0]+2*t[1],i=1;i<u-1;i++)s[i]=1,n[i]=4,r[i]=1,h[i]=4*t[i]+2*t[i+1];for(s[u-1]=2,n[u-1]=7,r[u-1]=0,h[u-1]=8*t[u-1]+t[u],i=1;i<u;i++)e=s[i]/n[i-1],n[i]=n[i]-e*r[i-1],h[i]=h[i]-e*h[i-1];for(o[u-1]=h[u-1]/n[u-1],i=u-2;0<=i;--i)o[i]=(h[i]-r[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 bs={paddingX:3,paddingY:6,radius:1,minHeight:4,eventRadius:8};function gs(t){this.config=F.extend(S(bs),t||{},!0)}function ws(){}(gs.prototype=S(ms.prototype)).draw=function(t,i,e){var s=this.config,n=us.prototype,r=os,h=s.color?this.ic(r,s.color):null,o=this.getPoints(t,i,e),a=o.splice(o.length-3,3),u=r.Qu(a);u[0][0]="L";var c=r.tc(o).concat(u),f=r.group(r.getPath(r.definePath(c),"webix_sparklines_area"+(h?" "+h.area:""),!0));f+=r.group(r.getPath(r.definePath(r.tc(o)),"webix_sparklines_line"+(h?" "+h.line:"")));var l=n.getPoints.call(this,t,i,e);f+=n.sc(r,l,s.radius,"webix_sparklines_item"+(h?" "+h.item:""));var d=Math.min(t.length?(i-2*(s.paddingX||0))/t.length:0,s.eventRadius);return f+=n.nc(r,l,d),r.draw(f,i,e,"webix_sparklines_splinearea_chart"+(s.css?" "+s.css:""))},gs.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]=ut(e[n]);return e},gs.prototype.getPoints=function(t,i,e){var s=ms.prototype.getPoints.call(this,t,i,e),n=this.config.paddingX||0,r=this.config.paddingY||0;return s.push({x:i-n,y:e-r},{x:n,y:e-r},{x:n,y:s[0][0].y}),s},ws.types={},ws.getTemplate=function(t){var i=t||{};"string"==typeof t&&(i={type:t}),F.extend(i,{type:"line"});var e=this.types[i.type];return k(this.vc,new e(i))},ws.vc=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"===M(s)?s.value:s}return i}(e),s.width,33):this.draw(t.data||t,i.width,i.height)},y("onDataTable",function(t){t.type.sparklines=ws.getTemplate()}),ws.types.area=fs,ws.types.bar=ds,ws.types.line=us,ws.types.pie=_s,ws.types.spline=ms,ws.types.splineArea=gs;var xs={clipboard_setter:function(t){return G.touch||(!0!==t&&1!==t||(t="block"),we.init(),this.attachEvent("onSelectChange",this.hr),this.attachEvent("onAfterEditStop",function(t,i){var e=this.getSelectedId(!0);1==e.length&&i.row==e[0].row&&this.hr()}),this.attachEvent("onItemClick",function(){document.activeElement&&this.$view.contains(document.activeElement)&&(we.focus(),ji.setFocus(this))}),this.attachEvent("onPaste",this._c)),t},templateCopy_setter:qt,hr:function(){var i=this;C(function(){if(!i.getEditor||!i.getEditor()){var t=i.pc();we.set(t),ji.setFocus(i)}})},pc:function(){var r=[],h=this.B.templateCopy;return this.mapSelection(function(t,i,e,s){r[s]||(r[s]=[]);var n=h?h(t,i,e):t;return r[s].push(n),t}),1===r.length&&1===r[0].length?r[0][0]:xe.stringify(r,this.B.delimiter)},_c:function(t){if(!z(this.ir[this.B.clipboard])){var i=xe.parse(t,this.B.delimiter);this.ir[this.B.clipboard].call(this,i)}},ir:{block:function(r){var t=this.mapSelection(null);t&&(this.mapCells(t.row,t.column,r.length,null,function(t,i,e,s,n){return r[s]&&r[s].length>n?r[s][n]:t}),this.render())},selection:function(r){this.mapSelection(function(t,i,e,s,n){return r[s]&&r[s].length>n?r[s][n]:t}),this.render()},repeat:function(r){this.mapSelection(function(t,i,e,s,n){return(i=r[s%r.length])[n%i.length]}),this.render()},custom:function(){}}},ys={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()},mc:function(t,i,e){if(this.B.threeState)return this.bc(t,null!==i?i:"");var s,n=this.getItem(t),r=e?e.target:null;s=r&&"checkbox"==r.type?!!r.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)}},gc: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.gc(this,t),this.refresh(),0}this.refresh()}if(t.select&&this.select){var n=t.select;this.unselect();for(var r=0;r<n.length;r++)this.exists(n[r])&&this.select(n[r],!0)}return 1}},Ms={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.mc(i,null,t),!1}},Ss={$init:function(){this.data.attachEvent("onStoreUpdated",k(this.wc,this),null,!0),this.Dh=this.xc},xc:function(t,i,e,s,n,r){return n=0===i?{parent:encodeURIComponent(t)}:null,Fe.prototype.Dh.call(this,t,i,e,s,n,r)},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):m.reject()},wc:function(t,i,e){e&&"add"!=e&&"delete"!=e&&"branch"!=e||this.data.yc(this)}},ks={$init:function(){this.data},copy:function(t,i,e,s){return(s=s||{}).copy=!0,this.move(t,i,e,s)},pr:function(t,i,e){if(i&&t){var s=this.getBranchIndex(t);return s+(e==this&&this.getParentId(t)==this.getParentId(i)&&e.getBranchIndex(i)<s?0:1)}},Mc: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.Mc(e[s],i))return!0}return!1},Sc:function(t){for(var i=0;i<t.length;i++)for(var e=t[i];this.getParentId(e);)e=this.getParentId(e),-1==x.find.call(t,e)||(t.splice(i,1),i--);return t},move:function(t,i,e,s){i=i||0;var n=(s=s||{}).newId||t,r=s.parent||0;if((e=e||this).data,e.data){if(!I(t)){if(this!=e||s.copy){if(n=e.data.add(e._r(this.getItem(t),n),i,r||0),this.data.branch[t]&&e.getBranchIndex){var h=this.data.Tr;this.data.Tr=function(t){var i=S(t);return delete i.$parent,delete i.$level,delete i.$child,e.data.pull[i.id]&&(i.id=$()),i};var o={data:this.serialize(t,!0),parent:n};this.data.Tr=h,e.parse(o)}s.copy||this.data.remove(t)}else{if(t==r||this.Mc(t,r))return;var a=this.getItem(t),u=this.data.branch[r];u||(u=this.data.branch[r]=[]);var c=this.data.branch[a.$parent],f=x.find.call(c,t);if(i<0&&(i=u.length),c===u&&i===f)return n;if(x.removeAt.call(c,f),x.insertAt.call(u,t,Math.min(u.length,i)),c.length||delete this.data.branch[a.$parent],a.$parent&&"0"!=a.$parent&&this.getItem(a.$parent).$count--,r&&"0"!=r){var l=e.getItem(r);l.$count++,this.kc(a,l.$level+1)}else this.kc(a,1);a.$parent=r,e.data.callEvent("onDataMove",[t,i,r,u[i+1]])}return this.refresh(),n}this.Sc(t);for(var d=0;d<t.length;d++){var v=this.move(t[d],i,e,s);i=e.pr(v,t[d+1],this)}}},kc:function(t,i){t.$level=i;var e=this.data.branch[t.id];if(e)for(var s=0;s<e.length;s++)this.kc(this.getItem(e[s]),i+1)},Qh:function(t){t&&!t.header&&this.exists(t)&&this.io(t)!=le.Ks.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.Mc(t.source,t.target))return!1;return!0},_r:function(t,i){var e=Ce._r.call(this,t,i);return delete e.open,e}},Cs={$init:function(){this.render},Cc:function(t){var i=this.data.Nr[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()},Dc:function(t){return this.Yi.innerHTML=this.Cc(t),this.Yi.firstChild},Q:function(t){!t.$template||this.type["template"+t.$template],t.$template;var i="<div role='presentation' class='webix_tree_branch_"+t.$level+"'>"+this.Cc(t);return t.open&&(i+=this.Ic(t.id)),i+="</div>"},Ic: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 r=this.getItem(e[n]),h=this.type.Ac;0!==h&&(h[r.$level]=n==s),i+=this.Q(r)}i+="</div>"}return i},render:function(t,i,e){if((Cs.Re=this).isVisible(this.B.id)&&!this.$blockRender){if(t){var s,n,r=this.getItem(t);if("add"!=e&&!(s=this.getItemNode(t)))return;switch(e){case"branch":var h=s.parentNode;_t(n=this.Hu(r),h),vt(h),this.Ni=null;break;case"paint":case"update":_t(n=this.Ni[t]=this.Dc(r),s),vt(s);break;case"delete":vt(s.parentNode);break;case"add":var o;if(0==r.$parent)o=this.tt.firstChild;else if(this.getItem(r.$parent).open&&(o=this.getItemNode(r.$parent))){if(!o.nextSibling){var a=lt("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.Hu(r),this.Ni[t]=n.firstChild,_t(n,u,o)}break;default:return!1}this.callEvent("onPartialRender",[t,i,e])}else this.callEvent("onBeforeRender",[this.data])&&(this.type.Ac=[],this.tt.innerHTML=this.Ic(0),this.Ni=null,this.callEvent("onAfterRender",[]));return this.type.Ac=0,!(Cs.Re=null)}},getItemNode:function(t){if(this.Ni)return this.Ni[t];this.Ni={};for(var i=this.tt.getElementsByTagName("DIV"),e=0;e<i.length;e++){var s=i[e].getAttribute(this._id);s&&(this.Ni[s]=i[e])}return this.getItemNode(t)},Tc:1},$s={Fc:function(){if(this.Tc){var s=this.render;this.render=function(t,i){var e=s.apply(this,arguments);this.B.threeState&&e&&"checkbox"!=i&&this.zc.apply(this,arguments)},this.Fc=function(){}}},threeState_setter:function(t){return t&&this.Fc(),t},zc:function(t){var i,e,s,n,r;if(s=[],r=this,t&&!r.data.pull[t]&&(t=0),!t||r.data.pull[t].$count)for((e=this.Pc(t)).sort(function(t,i){return r.data.pull[i].$level-r.data.pull[t].$level}),i=0;i<e.length;i++)i&&r.data.pull[e[i]].$parent==r.data.pull[e[i-1]].$parent||(s=s.concat(r.Vc(e[i])));else s=s.concat(r.Vc(t));for(n={},i=0;i<s.length;i++)n[s[i]]||(n[s[i]]=1,this.Hc(s[i]));r=null},Hc: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))},Vc:function(t){var i,e,s,n,r,h,o;for(n=this.getParentId(t),r=[];n&&"0"!=n;){e=h=0,this.data.eachChild(n,function(t){t.indeterminate?h++:t.checked&&e++}),i=s=o=!1;var a=this.getItem(n);e==a.$count?i=!0:(0<e||0<h)&&(s=!0),(s||s!=a.indeterminate)&&(o=!0),a.indeterminate=s,(i||a.checked!=i)&&(o=!0),a.checked=i,n=o?(r.push(n),this.getParentId(n)):0}return r},getChecked:function(){var i=[],e=this;return this.data.eachSubItem(0,function(t){e.isChecked(t.id)&&i.push(t.id)}),i},bc:function(t,i){var e=this.getItem(t);if(e&&(""===i&&(i=!e.checked),e.checked!=i||e.indeterminate)){e.checked=i,this.Rc(t);var s=this.Vc(t);if(this.Tc&&s.length<5)for(var n=0;n<s.length;n++)this.Hc(s[n]);else this.refresh();this.callEvent("onItemCheck",[t,i])}},checkItem:function(t){this.mc(t,!0),this.updateItem(t)},uncheckItem:function(t){this.mc(t,!1),this.updateItem(t)},Bc:function(t,i,e){var s=i?"checkItem":"uncheckItem";t?this[s](t):t=0,this.B.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.Bc(t,!0,i)},uncheckAll:function(t,i){this.Bc(t,!1,i)},Rc: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.Tc&&this.isBranchOpen(e.$parent)&&this.render(t,0,"branch")},isChecked:function(t){return this.getItem(t).checked},Pc:function(t){var e=[];return this.data.eachSubItem(t,function(t,i){i||e.push(t.id)}),e}},Ds={name:"TreeStore",$init:function(){this.mh={showSubItems:!0},this.branch={0:[]},this.attachEvent("onParse",function(t){this.ah(t.child)}),this.attachEvent("onClearAll",k(function(){this.rh=null},this))},filterMode_setter:function(t){return F.extend(this.mh,t,!0)},_h:function(t){if(this.rh&&!t){for(var i in this.branch=this.rh,this.order=T(S(this.branch[0])),this.branch)"0"!=i&&(this.getItem(i).$count=this.branch[i].length);delete this.rh}},ph:function(t,i,e,s){e&&this.rh||(this.rh=this.branch,this.branch=l(this.branch)),this.branch[0]=this.Ec(t,i,this.branch[0],1,s||{})},Ec:function(t,i,e,s,n){for(var r=[],h=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(h)c=!0;else if(t(this.getItem(a),i)){if(r.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((h||!n.level)&&f){var d=this.branch[a]=this.Ec(t,i,f,s+1,n);u.$count=d.length,c&&d.length&&r.push(a)}}return r},count:function(){if(this.order.length)return this.order.length;var t=0;return this.eachOpen(function(){t++}),t},jc:function(t,i,e,s){if(t[e]){for(var n=t[s]=t[e],r=0;r<n.length;r++)this.getItem(n[r]).$parent=s;delete t[e]}if(t[i]){var h=x.find.call(t[i],e);0<=h&&(t[i][h]=s)}},changeId:function(t,i){if(t!=i){var e=this.getItem(t).$parent;return this.jc(this.branch,e,t,i),this.rh&&this.jc(this.rh,e,t,i),Te.prototype.changeId.call(this,t,i)}},clearAll:function(t){this.branch={0:[]},Te.prototype.clearAll.call(this,t)},getPrevSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],e=x.find.call(i,t)-1;return 0<=e?i[e]:null},getNextSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],e=x.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 x.find.call(i,t)},ah:function(e){this.oh="string"==typeof e?function(t){var i=t[e];return i&&delete t[e],i}:e},Yr:function(t,i){for(var e=t.parent||0,s=0;s<i.length;s++){var n=this.driver.getDetails(i[s]),r=this.id(n),h=!!this.pull[r];h?(n=F.extend(this.pull[r],n,!0),this.Jr&&this.Jr(n)):(this.Zr&&this.Zr(n),this.pull[r]=n),this.hh(n,e,0,h,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)},hh: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 r=this.branch[t.$parent];(r||(r=this.branch[t.$parent]=[]),this.rh&&(this.rh[t.$parent]=r),s)||(r[n||r.length]=t.id);var h=this.oh(t);if(t.webix_kids)return t.$count=-1;if(!h)return t.$count=0;I(h)||(h=[h]);for(var o=0;o<h.length;o++){var a=Vt.json.getDetails(h[o]),u=this.id(a);(s=!!this.pull[u])?(a=F.extend(this.pull[u],a,!0),this.Jr&&this.Jr(a)):(this.Zr&&this.Zr(a),this.pull[u]=a),this.hh(a,t.id,t.$level+1,s)}var c=this.branch[t.id];c&&(t.$count=c.length)},yc:function(t){this.order=T(),this.Lc(this.order,0,t)},Lc:function(t,i,e){for(var s=this.branch[i],n=0;n<s.length;n++){var r=s[n];t.push(r);var h=this.pull[r];h&&h.open&&(-1==h.$count?e.loadBranch(r):h.$count&&this.Lc(t,r,e))}},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.gh(this,e[s]);t.getIndexById||Te.prototype.provideApi.call(this,t,i)},getTopRange:function(){return T([].concat(this.branch[0])).map(function(t
){return this.getItem(t)},this)},eachChild:function(t,i,e,s){var n=this.branch;s&&this.rh&&(n=this.rh);var r=n[t];if(r)for(var h=0;h<r.length;h++)r[h]&&i.call(e||this,this.getItem(r[h]))},each:function(e,s,n,t){this.eachChild(t||0,function(t){var i=this.branch;e.call(s||this,t),n&&this.rh&&(i=this.rh),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)}},vh:function(t,i){for(var e in this.branch){for(var s=this.branch[e],n=[],r=0;r<s.length;r++)n.push(this.pull[s[r]]);n.sort(t);for(var h=0;h<s.length;h++)n[h]=n[h].id;this.branch[e]=n}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=T(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.rh){var r=this.rh[e||0];if(r||(r=this.rh[e]=this.order),this.order!==r){var h=r.length;!i&&this.branch[e||0].length&&(h=0),r=T(r),t.id=t.id||$(),r.insertAt(t.id,h)}}var o=Te.prototype.add.call(this,t,i);return s&&this.refresh(e),o},Oc: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.Oc(e[s],!0);delete this.branch[t],this.rh&&delete this.rh[t],delete this.pull[t],this.Nr[t]&&delete this.Nr[t]},Nc:function(t,i,e){var s=t[i];1==s.length&&s[0]==e&&i?delete t[i]:T(s).remove(e)},remove:function(t){if(I(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.Oc(t),this.callEvent("onAfterDelete",[t]);var n=this.pull[s];this.Nc(this.branch,s,t),this.rh&&this.Nc(this.rh,s,t);var r=0;n&&(n.$count--,n.$count<=0&&(n.$count=0,n.open=0,r=1)),this.callEvent("onStoreUpdated",[t,e,"delete"]),r&&this.refresh(n.id)}},getBranch:function(t){var i=[],e=(this.rh||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.rh&&(e=this.rh);for(var s=e[t||0],n=[],r=0;r<s.length;r++){var h,o=this.pull[s[r]];if(this.Tr){if(!1===(h=this.Tr(o)))continue}else h=S(o);e[o.id]&&(h.data=this.serialize(o.id,i)),n.push(h)}return n}},Is={insert:function(t){for(var i=this.getSelectedId(!0,!0),e=0;e<t.length;e++){for(var s={},n=0;n<this.B.columns.length;n++)s[this.B.columns[n].id]=t[e][n]||"";!z(s.id)&&this.exists(s.id)&&(s.id=$()),this.add(s,null,i[0])}}},As={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>"}},Ts={$render:function(){if(this.Wc)this.Ui.firstChild.appendChild(this.Wc);else{this.files.attachEvent("onBeforeDelete",this.Yc);var t={type:"file","class":"webix_hidden_upload",tabindex:-1};this.B.accept&&(t.accept=this.B.accept),this.B.multiple&&(t.multiple="true"),this.B.directory&&(t.webkitdirectory="true",t.mozdirectory="true",t.directory="true");var i=lt("input",t);this.Wc=this.Ui.firstChild.appendChild(i),Zt(this.zt,"drop",k(function(t){this.$drop(t),wt(t)},this)),Zt(i,"change",k(function(){if(this.Uc(i.files),G.isIE){var t=document.createElement("form");t.appendChild(
this.Wc),t.reset(),this.Ui.firstChild.appendChild(i)}else i.value=""},this)),Zt(this.zt,"click",k(function(){250<new Date-(this.qc||0)&&this.fileDialog()},this)),Zt(this.zt,"dragenter",wt),Zt(this.zt,"dragexit",wt),Zt(this.zt,"dragover",wt)}},Gc:function(t){return t.isDirectory},Xc: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.Xc(t[i],s,(n?n+"/":"")+e.name)})}},$drop:function(t){var i=t.dataTransfer.files,e=t.dataTransfer.items;if(i.length){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.Xc(n,this,""):this.addFile(i[s])}}this.callEvent("onAfterFileDrop",[i,t])}},fileDialog:function(t){this.qc=new Date,this.Kc=t;var i=this.zt.getElementsByTagName("INPUT");i[i.length-1].click()},send:function(i){if("function"==typeof i&&(this.Jc=i,i=0),i){var t=this.files.getItem(i);if("client"!==t.status)return!1;this.B.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.B.formData||{};"function"==typeof n&&(n=n.call(this));var r=F.extend(t.formData||{},n),h=new XMLHttpRequest,o=this.Zc(t);if(w("onBeforeAjax",["POST",o,r,h,s,e])){for(var a in r)e.append(a,r[a]);for(var u in(t.xhr=h).upload.addEventListener("progress",k(function(t){this.$updateProgress(i,t.loaded/t.total*100)},this),!1),h.onload=k(function(){h.aborted||this.Qc(i)},this),h.open("POST",o,!0),s)h.setRequestHeader(u,s[u]);h.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.tf()},Qc:function(t){var i=this.files.getItem(t);if(i){var e=null;if(i.xhr.status<400){var s=Vt[this.B.datatype||"json"];(e=s.toObject(i.xhr.responseText))&&(e=s.getDetails(e))}e&&"error"!=e.status?(!e.status||e.status,this["if"](t,e)):(i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,e])),delete i.xhr}},stopUpload:function(t){k(this.Yc,this.files)(t)},Yc:function(t){var i=this.getItem(t);"undefined"!=typeof i.xhr&&(i.xhr.aborted=!0,i.xhr.abort(),delete i.xhr,i.status="client")}},Fs={ef:function(){this.data.attachEvent("onStoreUpdated",k(function(t,i,e){!t||"add"!=e&&"update"!=e&&"save"!=e||this.validate(t)},this)),this.data.attachEvent("onClearAll",k(this.clearValidation,this)),this.ef=function(){}},rules_setter:function(t){return t&&this.ef(),t},clearValidation:function(){this.data.clearMark("webix_invalid",!0)},validate:function(t){var i=!0;if(t){this.gr={};var e=this.getItem(t);(i=$e.validate.call(this,null,e))?this.callEvent("onValidationSuccess",[t,e])&&this.mr(t):this.callEvent("onValidationError",[t,e,this.gr])&&this.xr(t,this.gr)}else for(var s in this.data.pull)i=this.validate(s)&&i;return i},wr:function(t,i,e,s){"string"==typeof t&&(t=Mi[t]);var n=t.call(this,i,e,s);return n||(this.gr[s]=!0),n},mr:function(t){this.data.removeMark(t,"webix_invalid",!0)},xr:function(t){this.data.addMark(t,"webix_invalid",!0)}},zs={$init:function(){this.elements={}},focus:function(t){if(t)this.elements[t],this.yi(this.elements[t]);else for(var i in this.elements)if(!1!==this.yi(this.elements[i]))return!0;return!1},yi:function(t){return!(!t||!t.focus)&&t.focus()},setValues:function(t,i,e){var s=this;this.B.complexData&&(t=Bt.collapseNames(t,"",{},function(t){return!s.elements[t]})),this.sf(t,i,e)},sf:function(t,i,e){for(var s in this.nf=i,this.blockEvent(),i&&this.rf||(this.rf={}),t)this.elements[s]||(this.rf[s]=t[s]);for(var n in this.elements){var r=this.elements[n];r&&(z(t[n])?!i&&r.$allowsClear&&r.setValue("",e):r.setValue(t[n],e),this.rf[n]=r.getValue())}this.unblockEvent(),this.callEvent("onValues",[])},isDirty:function(){return!!this.nf||!0===this.getDirtyValues(!0)},setDirty:function(t){(this.nf=t)||(this.rf=this.hf())},getDirtyValues:function(){var t={};if(this.rf)for(var i in this.elements){var e=this.elements[i],
s=e.getValue(),n=this.rf[i];if((e.$compareValue?!e.$compareValue(n,s):n!=s)&&(t[i]=s,arguments[0]))return!0}return t},getCleanValues:function(){return this.rf},getValues:function(t){var i=this.hf(t);return this.B.complexData&&(i=Bt.expandNames(i)),i},hf:function(t){var i,e=null,s=this.rf?S(this.rf):{};for(var n in this.elements)e=this.elements[n],i=!0,t&&("object"==M(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(t){this.nf=!1;var i={};for(var e in this.elements)this.elements[e].$allowsClear&&(i[e]="");this.sf(i,!1,t)},markInvalid:function(t,i){if(!1===i)this.mr(t);else{if("string"==typeof i){var e=this.elements[t];e&&(e.B.invalidMessage=i)}this.gr&&(this.gr[t]=!0),this.xr(t)}},xr:function(t){var i=this.elements[t];t&&i&&(this.mr(t,!0),Mt(i.zt,"webix_invalid"),i.B.invalid=!0,"string"==typeof i.B.invalidMessage&&i.setBottomText&&i.setBottomText())},mr:function(t,i){var e=this.elements[t];t&&e&&e.$view&&e.B.invalid&&(St(e.zt,"webix_invalid"),e.B.invalid=!1,"string"==typeof e.B.invalidMessage&&!i&&e.setBottomText&&e.setBottomText())}},Ps={$init:function(){this.render,this.Ni={},Zt(this.zt,"scroll",k(this.af,this)),this.uf=[]},getItemNode:function(t){return this.Ni[t]},showItem:function(t){var i=this.dr(),e=this.data.getIndexById(t),s=Math.floor(e/i.lr)*i.Is,n=this.getScrollState();(s<n.y||s+this.B.height>=n.y+this.Me)&&this.scrollTo(0,s)},render:function(t,i,e){if(this.isVisible(this.B.id)&&!this.$blockRender)if(t){var s=this.getItemNode(t);switch(e){case"update":if(!s)return;_t(this.Ni[t]=this.Hu(i),s),vt(s);break;default:this.cf()}}else this.callEvent("onBeforeRender",[this.data])&&(this.Ni={},this.af(null,!0),this.ff=!1,this.callEvent("onAfterRender",[]))},cf:function(){this.ff||(this.ff=!0,window.setTimeout(k(function(){this.render()},this),1))},lf:function(t){G.maxHTMLElementSize&&(t=Math.min(G.maxHTMLElementSize,t));var i=document.createElement("DIV");return i.style.cssText="height:"+t+"px; width:100%; overflow:hidden;",i},af:function(t,i){this.uf=[];var e=this.dr();this.tt.firstChild&&!i||(this.tt.innerHTML="",this.tt.appendChild(this.lf(e.df)),this.Wi=[this.tt.firstChild]);for(var s=e.vf;s<=e._f;){for(;this.Wi[s]&&this.Wi[s].pf&&s<=e._f;)s++;if(s>e._f)break;for(var n=s;!this.Wi[n];)n--;var r=this.Wi[n],h=s*e.lr+(this.data.$min||0);if(h>(this.data.$max||Infinity))break;var o=Math.min(h+e.lr-1,this.data.$max?this.data.$max-1:Infinity),a=this.lf(e.Is),u=this.data.getIndexRange(h,o);if(!u.length)break;for(var c={$template:"Loading"},f=0;f<u.length;f++)u[f]||this.uf.push(h+f),u[f]=this.Q(u[f]||c);a.innerHTML=u.join("");for(var l=0;l<u.length;l++)this.Ni[this.data.getIdByIndex(h+l)]=a.childNodes[l];var d=parseFloat(r.style.height,10),v=(s-n)*e.Is,_=d-v-e.Is;if(_t(a,v?r.nextSibling:r,this.tt),(this.Wi[s]=a).pf=!0,v<=0&&0<_)r.style.height=_+"px",this.Wi[s+1]=r;else if(v<0?vt(r):r.style.height=v+"px",0<_)_t(this.Wi[s+1]=this.lf(_),a.nextSibling,this.tt);s++}if(this.uf.length){var p=this.uf[0],m=this.uf.pop()+1;if(p<m){var b=m-p;if(this.Fh(b,p))return;b=Math.max(b,this.B.datafetch||this.B.loadahead||0),this.loadNext(b,p)}}},dr:function(){var t=this.getScrollState(),i=Math.max(0,t.y),e=this.mf||0,s=this.xe-e,n=this.Me-e/2,r=this.type,h=Math.floor(s/r.width)||1,o=Math.floor(i/r.height),a=Math.ceil((n+i)/r.height)-1,u=this.data.$max?this.data.$max-this.data.$min:this.data.count();return{vf:o,_f:a,bf:i,df:Math.ceil(u/h)*r.height,Is:r.height,lr:h}},at:function(t){var i=this.getItemNode(t);return i||(this.showItem(t),this.af(),i=this.getItemNode(t)),{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Ui}}},Vs={$init:function(){this.Ni={},Zt(this.zt,"scroll",k(function(){this.render(null,null,"paint")},this))},Ms:function(t,i,e){this.B.footer&&ue.xs(this.gf.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},getItemNode:function(t){return this.Ni&&this.Ni[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(),r=mt(this.$view);e<n.y?this.scrollTo(0,e):s>n.y+r.height&&this.scrollTo(0,s-r.height)}},render:function(t,i,e){if(this.isVisible(this.B.id)&&!this.$blockRender){var s=this.Bu||this.tt;if(!t||"paint"!=e&&"update"!=e){var n,r,h=this._o;if(le.active&&"drag-end"!=e){var o=le.getContext();r=(n=this["do"]&&o.from===this)&&T(S(o.source||[]))}if(("paint"!=e||n)&&(this.Ni={},s.innerHTML=""),this.callEvent("onBeforeRender",[this.data])){var a=this.data.count(),u=this.getScrollState(),c=mt(this.zt),f=Math.floor(u.y/this.type.height)-2,l=Math.ceil((u.y+c.height)/this.type.height)+2;f=Math.max(0,f),l=Math.min(a-1,l+(n?r.length-1:0));for(var d=[],v=f;v<=l;v++){var _=this.data.order[v];if(n&&-1!==r.find(_))_==h&&(h=this.data.order[v+1]);else if(this.Ni[_])d.push('<div webix_skip="true" '.concat(this._id,'="').concat(_,'"></div>'));else{var p=this.data.getItem(_);if(!p){this.wf({count:l-v+(this.B.loadahead||0),start:v});break}d.push(this.Q(p))}}if(this.Yi.innerHTML=d.join(""),this["do"]&&"drag-in"==e){var m=this.Yi.querySelector("[".concat(this._id,'="').concat(h,'"]'));m?this.Yi.insertBefore(le._n[0],m):this.Yi.appendChild(le._n[0])}s.style.position="relative",s.style.height=a*this.type.height+"px";for(var b=this.Yi.childNodes,g=b.length-1;0<=g;g--){var w=b[g];if(!w.getAttribute("webix_skip")){var x=w.getAttribute(this._id);x&&(w.style.position="absolute",w.style.top=(f+g)*this.type.height+"px",w.style.left=0,w.style.width="100%",s.appendChild(w),this.Ni[x]=w)}}this.callEvent("onAfterRender",[])}}else{var y=this.getItemNode(t);if(y){var M=this.Ni[t]=this.Hu(i);return M.style.top=y.style.top,M.style.position="absolute",M.style.left=0,M.style.width="100%",_t(M,y),void vt(y)}}}},$setSize:function(){Qi.api.$setSize.apply(this,arguments)&&this.render(null,null,"paint")},wf:function(t){var i=Math.max(t.count,this.B.datafetch||this.B.loadahead||0);this.Fh(t.count,t.start)||this.loadNext(i,t.start)},uo:function(){this.render(null,null,"drag-in")},mo:function(){vt(le._n),this.render(null,null,"drag-out")},$dragDestroy:function(){if(this["do"]){var t=le.Ks;I(t.source)&&this.oo(t.source,"webix_invisible"),this.render(null,null,"drag-end")}vt(le.Yi)}},Hs="non-existing view for export";function Rs(i,e,t){return!t&&e.format?function(t){return e.format(t[i])}:function(t){return t[i]}}function Bs(t,i){var e=i.text;if(i.contentId){var s=t.getHeaderContent(i.contentId);s&&!s.type.$icon&&(e=s.getValue(!0))}return(e||"").toString().replace(/<[^>]*>/gi,"")}function Es(t,i,e){return e[t]&&e[t][i]?e[t][i]:{}}function js(t,o){var i,e=[],s=0,n=0,r=t.getColumnConfig,a=o.columns,h=!!o.rawValues,u="TreeStore"==t.data.name,c=o.treeLines;if((!0===c||z(c))&&(c="value"),e.heights={},(o.hidden||o.hide)&&(e.hiddenCols={},e.hiddenRows={}),a){if(!a.length){var f=[];for(var l in a)f.push(F.extend({id:l},F.extend({},a[l])));a=f}}else if(a=[],r){var d=t.Vh;if(o.hidden&&d.length)for(var v=0;v<d.length;v++){var _=t.getColumnConfig(d[v]);t.isColumnVisible(_.id)||(e.hiddenCols[_.id]=1),a.push(_)}else a=a.concat(t.xf)}else{var p=t.data.pull[t.data.order[0]];for(var m in p)"id"!==m&&"$"!=m[0]&&a.push({id:m,isTree:u&&m===c})}if(o.ignore)for(var b=a.length-1;0<=b;b--)o.ignore[a[b].id]&&a.splice(b,1);o.id&&e.push({id:"id",width:50,header:" ",template:function(t){return t.id}}),o.flatTree&&function(){for(var e=o.flatTree.id,t=[].concat(o.flatTree.columns),s=[],n=!!o.flatTree.fill,i=1;i<=t.length;i++)t[i-1].template=function(i){return function(t){return t.$level==i?s[i]=t[e]:n&&i<t.$level?s[i]:""}}(i);for(var r=0,h=a.length-1;0<=h;h--)a[h].id===e&&(r=h);a=[].concat(a.slice(0,r)).concat(t).concat(a.slice(r+1))}();for(var g=0;g<a.length;g++){var w=a[g],x=w.id;if(!w.noExport){var y=h&&r;if(r){var M=t.getColumnConfig(x);!w.template||M&&M.template==w.template||(y=!1),M&&(w=F.extend(F.extend({},w),M))}var S={id:w.id,template:y||!w.template?Rs(x,w,h):w.template,width:(w.width||200)*("excel"===o.export_mode?8.43/70:1),header:!1!==w.header?w.header||x:""};u&&x===c&&(S.isTree=i=!0),"excel"===o.export_mode&&(F.extend(S,{type:w.exportType||"",format:w.exportFormat||""}),
w.hidden&&(e.hiddenCols||(e.hiddenCols={}),e.hiddenCols[w.id]=1)),"string"==typeof S.header?S.header=[{text:S.header}]:S.header=[].concat(S.header);for(var k=0;k<S.header.length;k++)S.header[k]=S.header[k]?Bs(t,S.header[k]):"";if(s=Math.max(s,S.header.length),t.config.footer){var C=w.footer||"";C="string"==typeof C?[{text:C}]:[].concat(C);for(var $=0;$<C.length;$++)C[$]=C[$]?Bs(t,C[$]):"";S.footer=C,n=Math.max(n,S.footer.length)}e.push(S)}}!i&&u&&o.treeLines!=c&&e[0]&&(e[0].isTree=!0);for(var D=0;D<e.length;D++){for(var I=s-e[D].header.length,A=0;A<I;A++)e[D].header.push("");if(t.config.footer){I=n-e[D].footer.length;for(var T=0;T<I;T++)e[D].footer.push("")}}return e}function Ls(t,i){return t&&(t=t.replace(/[/?\\<>:*|"]/g,"").substring(0,150)),"".concat(t||"Data",".").concat(i)}function Os(u,c,f){var t,i,l=!!c.filterHTML,d=/<[^>]*>/gi,v=[],_=c.export_mode;if("excel"!==_&&"csv"!=_||!c.docHeader||(v=[[(c.docHeader.text||c.docHeader).toString()],[""]],"excel"===_&&c.docHeader.height&&(f.heights[0]=c.docHeader.height)),!1!==c.header&&f.length)for(var e=0;e<f[0].header.length;e++){i=[];for(var s=0;s<f.length;s++)t="",f[s].header[e]&&(t=f[s].header[e],l&&(t=f[s].header[e]=t.replace(d,""))),i.push(t);"excel"!=_||!u.xf||!1===c.heights||u.yf[e]===re.barHeight&&"all"!=c.heights||(f.heights[v.length]=u.yf[e]),"pdf"!==_&&(v[v.length]=i)}c.yCorrection=(c.yCorrection||0)-v.length;var p=c.flatTree||c.plainOutput?"":"-";if(u.data.each(function(t,i){if(!c.filter||c.filter(t)){var e=c.hidden&&u.data.Wr&&-1==u.getIndexById(t.id);if(c.hide&&c.hide(t)||e){var s=(c.docHeader?2:0)+(!1===c.header?0:f[0].header.length);f.hiddenRows[s+i]=1}this.data.sh&&(t=u.data.sh(t));for(var n=[],r=0;r<f.length;r++){var h=f[r],o=null;if(u.$getExportValue?o=u.$getExportValue(t.id,h.id,c):c.math&&t["$"+h.id]&&"="==t["$"+h.id].charAt(0)&&(o=t["$"+h.id]),this.Mf){var a=this.getSpan(t.id,h.id);a&&a[4]&&a[0]==t.id&&a[1]==h.id&&(o=a[4],l&&"string"==typeof o&&(o=o.replace(d,"")))}o||((o=h.template(t,u.type,t[h.id],h,r))||0===o||(o=""),h.isTree&&p&&(o=" "+Array(t.$level).join(p)+" "+o),l&&"string"==typeof o&&(o=o.replace(d,"")),"string"==typeof o&&"csv"===_&&(o=o.trim()),"string"!=typeof o||"excel"!==_&&"csv"!==_||(o=o.replace(/<br\s*\/?>/gm,"\n"))),n.push(o)}"excel"==_&&u.xf&&!1!==c.heights&&(t.$height&&t.$height!==re.rowHeight||"all"==c.heights)&&(f.heights[v.length]=t.$height||this.config.rowHeight),v.push(n)}},u,c.hidden),!1!==c.footer)for(var n=f[0].footer?f[0].footer.length:0,r=0;r<n;r++){for(var h=[],o=0;o<f.length;o++){var a=f[o].footer[r];l&&(a=f[o].footer[r]=a.toString().replace(d,"")),h.push(a)}"excel"!=_||!u.xf||!1===c.heights||u.Sf[r]===re.barHeight&&"all"!=c.heights||(f.heights[v.length]=u.Sf[r]),"pdf"!==_&&v.push(h)}return"excel"===_&&c.docFooter&&(v=v.concat([[],[(c.docFooter.text||c.docFooter).toString()]]),c.docFooter.height&&(f.heights[v.length-1]=c.docFooter.height)),v}var Ns={},Ws=function(t,n){(n=n||{}).export_mode="pdf",n.fontName=n.fontName||"pt-sans.regular",n.boldFontName=n.boldFontName||"pt-sans.bold",t=I(t)?t:[t];for(var r=[],i=0;i<t.length;i++){t[i].id||(t[i]={id:t[i]});var e=ai(t[i].id);if(e){var s=F.extend(t[i].options||{},n),h=s.display||"table";if("image"==s.display&&delete s.styles,e.$exportView&&(e=e.$exportView(s)),I(e))r=r.concat(e),n.autowidth&&Xs(s,n);else{if(("table"==h||"all"==h)&&e.data&&e.data.pull){var o=js(e,s);r.push({scheme:o,exportData:Os(e,s,o),viewOptions:s}),n.autowidth&&Xs(e,n,o)}if("image"==h||"all"==h){var a=s.It?Js(e.$view):e.$view;r.push({node:a,viewOptions:s}),n.autowidth&&Xs(e,n)}}}}return n.dataOnly?r:zt([G.cdn+"/extras/pdfjs.js",G.cdn+"/extras/html2canvas-1.0.min.js"]).then(function(){if(0==r.length)return m.reject(Hs);if(Ns[n.fontName]&&Ns[n.boldFontName])return n.kf=Ns[n.fontName],n.Cf=Ns[n.boldFontName],Us(r,n).then(function(t){return Ys(t,n)});var s=m.defer();return pdfjs.load(n.fontURL||G.cdn+"/extras/"+n.fontName+".ttf",function(t,e){if(t)return s.reject(t);pdfjs.load(n.boldFontURL||G.cdn+"/extras/"+n.boldFontName+".ttf",function(t,i){n.kf=Ns[n.fontName]=new pdfjs.TTFFont(e),
n.Cf=Ns[n.boldFontName]=t?null:new pdfjs.TTFFont(i),s.resolve(Us(r,n).then(function(t){return Ys(t,n)}))})}),s})};function Ys(t,i){var e=Ls(i.filename,"pdf"),s=new Blob([t.toString()],{type:"application/pdf"});return!1!==i.download&&Ct(s,e),s}function Us(s,n){for(var r=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.kf,threshold:256,width:i,height:e})}(n),h=[],t=0;t<s.length;t++)s[t].node?h.push(Gs(s[t].node)):h.push(m.resolve());return m.all(h).then(function(t){for(var i=0;i<h.length;i++){var e=s[i].viewOptions;e.textBefore&&qs(r,"before",e.textBefore),t[i]?r.image(t[i],{align:"center"}):(e.Cf=n.Cf,Ks(s[i],r)),e.textAfter&&qs(r,"after",e.textAfter),i!=s.length-1&&r.pageBreak()}return function o(s,n){if(!1!==n.docFooter){var t=s.footer();t.text({color:6710886,textAlign:"center"}).append(P.dataExport.page||"Page").pageNumber().append(" "+(P.dataExport.of||"of")+" ").pageCount()}var r={text:0,image:1};n.docHeader&&("string"==typeof n.docHeader&&(n.docHeader={text:n.docHeader}),F.extend(n.docHeader,{color:6710886,textAlign:"right",order:0}),r.text=n.docHeader.order);n.docHeaderImage&&("string"==typeof n.docHeaderImage&&(n.docHeaderImage={url:n.docHeaderImage}),F.extend(n.docHeaderImage,{align:"right",order:1}),r.image=n.docHeaderImage.order);n.docHeader&&r.image>r.text&&s.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader);{if(n.docHeaderImage){var h=m.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&&r.image<r.text&&s.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader)}h.resolve(s.render())}),h}return m.resolve(s.render())}}(r,n)})}function qs(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 Gs(t){var i=!document.body.contains(t);return i&&(document.body.appendChild(t),t.style.position="absolute",t.style.left="-9999px"),window.html2canvas(t,{background:"#fff",logging:!1,useCORS:!0}).then(function(t){for(var i=t.toDataURL("image/jpeg"),e=window.atob(i.split("base64,")[1]),s=e.length,n=new Uint8Array(s),r=0;r<s;r++)n[r]=e.charCodeAt(r);return new pdfjs.Image(n.buffer)})["finally"](function(){i&&document.body.removeChild(t)})}function Xs(t,i,e){var s,n=i.orientation&&"landscape"==i.orientation?"height":"width";if(e){s=80;for(var r=0;r<e.length;r++)s+=e[r].width}else s=t.$width?t.$width:t[n];i[n]=Math.max(i[n]||0,s||0)}function Ks(t,i){var e=t.scheme,s=t.exportData,n=t.viewOptions,r=t.styles;n.header=z(n.header)||!0===n.header?{}:n.header,n.footer=z(n.footer)||!0===n.footer?{}:n.footer,n.table=n.table||{};for(var h=!1===n.header?0:e[0].header.length,o=!1!==n.footer&&e[0].footer?e[0].footer.length:0,a=[],u=0;u<e.length;u++)a[u]=e[u].width;var c=F.extend(n.table,{borderWidth:1,height:20,lineHeight:1.1,borderColor:15658734,backgroundColor:16777215,color:6710886,textAlign:"left",paddingRight:10,paddingLeft:10,headerRows:h,widths:a.length?a:["100%"]}),f=i.table(c),l=n.Cf;if(h)for(var d=F.extend(n.header,{borderRightColor:11587299,borderBottomColor:11587299,color:4868682,backgroundColor:13820911,height:27,lineHeight:1.2}),v=0;v<h;v++)for(var _=f.tr(d),p=0;p<e.length;p++){var m=r?Es(v,p,r):{};l&&m.bold&&(m.font=l),_.td(e[p].header[v].toString(),m)}for(var b=0;b<s.length;b++)for(var g=f.tr({}),w=0;w<s[b].length;w++){var x=r?Es(b+h,w,r):{};l&&x.bold&&(x.font=l),g.td(s[b][w],x)}if(o)for(var y=F.extend(n.footer,{borderRightColor:15658734,borderBottomColor:15658734,backgroundColor:16448250,color:6710886,height:27,lineHeight:1.2}),M=0;M<o;M++)for(var S=h+s.length,k=f.tr(y),C=0;C<e.length;C++){var $=r?Es(M+S,C,r):{};l&&$.bold&&($.font=l),k.td(e[C].footer[M].toString(),$)}}function Js(t){var i=t.cloneNode(!1);if(t.tagName){var e=window.getComputedStyle(t);i.style.cssText=e.cssText}for(var s=0;s<t.childNodes.length;s++)i.appendChild(Js(t.childNodes[s]));return i}var Zs=function(t,v){(v=v||{}).export_mode="excel",t=I(t
)?t:[t];for(var _=[],i=0;i<t.length;i++){t[i].id||(t[i]={id:t[i]});var e=ai(t[i].id),s=F.extend(t[i].options||{},v);if(e&&e.$exportView&&(e=e.$exportView(s)),I(e))_=_.concat(e);else if(e.data&&e.data.pull){var n=js(e,s);_.push({scheme:n,exportData:Os(e,s,n),spans:s.spans?sn(e,s):[],viewOptions:s})}}if(v.dataOnly)return _;var p=m.defer();return zt(G.cdn+"/extras/xlsx.core.styles.min.js").then(function(){if(!_.length)return p.reject(Hs);for(var t={SheetNames:[],Sheets:{},Workbook:{WBProps:{},Names:[]}},i=0;i<_.length;i++){for(var e=_[i].viewOptions,s=_[i].scheme,n=_[i].exportData,r=_[i].spans,h=_[i].ranges||[],o=en(n,s,r,_[i].styles||[],e),a=(e.name||"Data"+(i+1)).replace(/[*?:[\]\\/]/g,"").replace(/&/g,"&").substring(0,31),u=i;-1!=t.SheetNames.indexOf(a);)a="Data"+ ++u;t.SheetNames.push(a),t.Sheets[a]=o,t.Workbook.Names=t.Workbook.Names.concat(h)}var c=XLSX.write(t,{bookType:"xlsx",bookSST:!1,type:"binary"}),f=Ls(v.filename,"xlsx"),l=new Blob([function d(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}(c)],{type:"application/xlsx"});return!1!==v.download&&Ct(l,f),p.resolve(l),p})};var Qs={number:"n",date:"n",string:"s","boolean":"b"},tn="_table";function en(t,i,e,s,n){for(var r,h={},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(s){var v=Es(a,u,s);v.format&&(c.z=v.format,delete v.format),v.type&&(c.t=Qs[v.type],delete v.type),c.s=v}if((n.docHeader?2:0)+i[0].header.length<=a&&!d){var _=i[u];_.type&&!c.t&&(c.t=Qs[_.type]||""),_.format&&!c.z&&(c.z=_.format)}n.stubCells&&!l?c.t="z":c.v instanceof Date?(c.t=c.t||"n",c.z=c.z||XLSX.SSF[tn][14],c.v=(r=c.v,void 0,(25569+(r.getTime()-60*r.getTimezoneOffset()*1e3)/864e5).toString().substr(0,20))):d?(c.t=c.t||"n",c.f=c.v.substring(1),delete c.v):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,c.t="s")),h[f]=c}}return o.s.c<1e7&&(h["!ref"]=XLSX.utils.encode_range(o)),h["!rows"]=function p(t){var i=t.heights;for(var e in i)i[e]={hpx:i[e],hpt:.75*i[e]};var s=t.hiddenRows;if(s)for(var n in s)i[n]||(i[n]={}),i[n].hidden=1;return i}(i),h["!cols"]=function m(t){for(var i=[],e=0;e<t.length;e++){var s=t[e];i.push({wch:s.width,hidden:t.hiddenCols?t.hiddenCols[s.id]:0})}return i}(i),e.length&&(h["!merges"]=e),h}function sn(t,i){var e=t.getColumnConfig,s=t.Mf,n=[];if(e){if(!1!==i.header&&(n=nn(t,i,"header",n)),s){var r=i.xCorrection||0,h=i.yCorrection||0;for(var o in s){var a=s[o];for(var u in a){var c=t.getColumnIndex(u),f=t.getItem(o).id,l=t.getIndexById(f);if(i.hidden){var d=t.Vh;if(d.length){var v=t.getColumnConfig(u).id;c=d.indexOf(v)}var _=t.data.Wr;_&&_.length&&(l=_.indexOf(f))}var p=c-r,m=l-h;if(!(p<0||m<0)){var b=p+a[u][0]-1,g=m+(a[u][1]-1);n.push({s:{c:p,r:m},e:{c:b,r:g}})}}}}!1!==i.footer&&(n=nn(t,i,"footer",n))}return n}function nn(t,i,e,s){for(var n=t.config.columns,r=(i.docHeader?2:0)+("header"==e?0:(!1!==i.header?t.yf.length:0)+t.count()),h=0;h<n.length;h++)for(var o=n[h][e],a=0;a<o.length;a++)o[a]&&(o[a].colspan||o[a].rowspan)&&s.push({s:{c:h,r:a+r},e:{c:h+(o[a].colspan||1)-1,r:a+(o[a].rowspan||1)-1+r}});return s}G.isIE8&&(Object.defineProperty=function(t,i,e){t[i]=e.value});var rn={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(r,e){if("function"==typeof r)return r;if(G.strict)return function(i){if(!i)return"";i.getMonth||(i=P.parseFormatDate(i));var s="",n=0;return r.replace(/%[a-zA-Z]/g,function(e,t){s+=r.slice(n,t);s+=function(t){if("%d"==e
)return rn.toFixed(t.getDate());if("%m"==e)return rn.toFixed(t.getMonth()+1);if("%j"==e)return t.getDate();if("%n"==e)return t.getMonth()+1;if("%y"==e)return rn.toFixed(t.getFullYear()%100);if("%Y"==e)return t.getFullYear();if("%D"==e)return P.calendar.dayShort[t.getDay()];if("%l"==e)return P.calendar.dayFull[t.getDay()];if("%M"==e)return P.calendar.monthShort[t.getMonth()];if("%F"==e)return P.calendar.monthFull[t.getMonth()];if("%h"==e)return rn.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 rn.toFixed(t.getHours());if("%i"==e)return rn.toFixed(t.getMinutes());if("%a"==e)return 11<t.getHours()?P.pm[0]:P.am[0];if("%A"==e)return 11<t.getHours()?P.pm[1]:P.am[1];if("%s"==e)return rn.toFixed(t.getSeconds());if("%S"==e)return rn.toFixed(t.getMilliseconds(),!0);if("%W"==e)return rn.toFixed(Date.getISOWeek(t));if("%c"!=e)return e;var i=t.getFullYear();return i+="-"+rn.toFixed(t.getMonth()+1),i+="-"+rn.toFixed(t.getDate()),i+="T",i+=rn.toFixed(t.getHours()),i+=":"+rn.toFixed(t.getMinutes()),i+=":"+rn.toFixed(t.getSeconds())}(i),n=t+2}),s+=r.slice(n,r.length)};r=r.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&&(r=r.replace(/date\.get/g,"date.getUTC"));var i=new Function("date","i18n","wDate","if (!date) return ''; if (!date.getMonth) date=i18n.parseFormatDate(date); return \""+r+'";');return function(t){return i(t,P,rn)}},strToDate:function(t,r){if("function"==typeof t)return t;var h,i,e,o=t.match(/%[a-zA-Z]/g),s="var temp=date.split(/[\\s\\./\\-\\:\\,]+/g); if(!temp.join('')){return ''}";if(!P.calendar.monthShort_hash){for(e=P.calendar.monthShort,i=P.calendar.monthShort_hash={},h=0;h<e.length;h++)i[e[h]]=h;for(e=P.calendar.monthFull,i=P.calendar.monthFull_hash={},h=0;h<e.length;h++)i[e[h]]=h}if(G.strict)return function(t){if(!t)return"";if("object"==M(t))return t;var i=t.split(/[\s./\-:,]+/g);if(!i.join(""))return"";var e=[0,0,1,0,0,0,0];for(h=0;h<o.length;h++){var s=o[h];if("%y"==s)e[0]=1*i[h]+(30<i[h]?1900:2e3);else if("%Y"==s)e[0]=1*(i[h]||0),e[0]<30&&(e[0]+=2e3);else if("%n"==s||"%m"==s)e[1]=(i[h]||1)-1;else if("%M"==s)e[1]=P.calendar.monthShort_hash[i[h]]||0;else if("%F"==s)e[1]=P.calendar.monthFull_hash[i[h]]||0;else if("%j"==s||"%d"==s)e[2]=i[h]||1;else if("%g"==s||"%G"==s||"%h"==s||"%H"==s)e[3]=i[h]||0;else if("%a"==s)e[3]=e[3]%12+((i[h]||"")==P.am[0]?0:12);else if("%A"==s)e[3]=e[3]%12+((i[h]||"")==P.am[1]?0:12);else if("%i"==s)e[4]=i[h]||0;else if("%s"==s)e[5]=i[h]||0;else if("%S"==s)e[6]=i[h]||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 r?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(h=0;h<o.length;h++)switch(o[h]){case"%j":case"%d":s+="set[2]=temp["+h+"]||1;";break;case"%n":case"%m":s+="set[1]=(temp["+h+"]||1)-1;";break;case"%y":s+="set[0]=temp["+h+"]*1+(temp["+h+"]>30?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":s+="set[3]=temp["+h+"]||0;";break;case"%i":s+="set[4]=temp["+h+"]||0;";break;case"%Y":s+="set[0]=(temp["+h+"]||0)*1; if (set[0]<30) set[0]+=2000;";break;case"%a":s+="set[3]=set[3]%12+(temp["+h+"]==i18n.am[0]?0:12);";break;case"%A":s+="set[3]=set[3]%12+(temp["+h+"]==i18n.am[1]?0:12);";break;case"%s":s+="set[5]=temp["+h+"]||0;";break;case"%S":s+="set[6]=temp["+h+"]||0;";break;case"%M":s+="set[1]=i18n.calendar.monthShort_hash[temp["+h+"]]||0;";break;case"%F":s+="set[1]=i18n.calendar.monthFull_hash[temp["+h+"]]||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]";r&&(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,P)}},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)},$f:function(t,i,e,s){if(e){var n=s(t,i);if(n)for(var r=0<e?1:-1;n;)t.setHours(t.getHours()+r),n=s(t,i),r+=0<e?1:-1}},add:function(t,i,e,s){s&&(t=this.copy(t));var n=rn.copy(t);switch(e){case"day":t.setDate(t.getDate()+i),this.$f(t,n,i,function(t,i){return rn.datePart(i,!0).valueOf()==rn.datePart(t,!0).valueOf()});break;case"week":t.setDate(t.getDate()+7*i),this.$f(t,n,7*i,function(t,i){return rn.datePart(i,!0).valueOf()==rn.datePart(t,!0).valueOf()});break;case"month":t.setMonth(t.getMonth()+i),this.$f(t,n,i,function(t,i){return i.getMonth()==t.getMonth()&&i.getYear()==t.getYear()});break;case"quarter":t.setMonth(t.getMonth()+3*i),this.$f(t,n,i,function(t,i){return i.getMonth()==t.getMonth()&&i.getYear()==t.getYear()});break;case"year":t.setYear(t.getFullYear()+i),this.$f(t,n,i,function(t,i){return i.getFullYear()==t.getFullYear()});break;case"hour":t.setHours(t.getHours()+i),this.$f(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:rn.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"}},hn={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 r=t.match(/[^0-9]/);return r&&(i.groupSize=t.length-r.index-1,i.groupDelimiter=t[r.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||P;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 r=i.groupSize,h=s[0].length;do{n=(0<(h-=r)?s[0].substr(h,r):s[0].substr(0,r+h))+(n?i.groupDelimiter+n:"")}while(0<h)}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 hn.format(t,i)}}};var on=["fullDateFormat","timeFormat","dateFormat","longDateFormat","parseFormat","parseTimeFormat"];P.setLocale=function(t){"string"==typeof t&&(t=P.locales[t]),t&&(t.priceSettings=S(t.priceSettings||t),function h(t,i){for(var e in i)"object"!=M(i[e])||I(i[e])?t[e]=i[e]:(t[e]||(t[e]={}),h(t[e],i[e]))}(P,t),delete P.calendar.monthShort_hash,delete P.calendar.monthFull_hash);for(var i=0;i<on.length;i++){var e=on[i],s=P[e+"UTC"];P[e+"Str"]=rn.dateToStr(P[e],s),P[e+"Date"]=rn.strToDate(P[e],s)}var n=qt(P.price),r=P.priceSettings||P;P.intFormat=hn.numToStr({groupSize:P.groupSize,groupDelimiter:P.groupDelimiter,decimalSize:0}),P.priceFormat=function(t){return n(hn.format(t,r))},P.numberFormat=hn.format},P.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"},filter:{less:"less",lessOrEqual:"less or equal",greater:"greater",greaterOrEqual:"greater or equal",contains:"contains",notContains:"not contains",equal:"equal",notEqual:"not equal",beginsWith:"begins with",notBeginsWith:"not begins with",endsWith:"ends with",notEndsWith:"not ends with",between:"between",notBetween:"not between"},timeboard:{seconds:"Seconds"}}},P.setLocale("en-US");var an={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)}}}};an.local={put:function(t,i){t&&window.JSON&&window.localStorage&&window.localStorage.setItem(t,p(i))},get:function(t){if(t&&window.JSON&&window.localStorage){var i=window.localStorage.getItem(t);return i?Vt.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.localStorage&&window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}},an.session={put:function(t,i){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.setItem(t,p(i))},get:function(t){if(t&&window.JSON&&window.sessionStorage){var i=window.sessionStorage.getItem(t);return i?Vt.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.removeItem(t)},clear:function(){window.sessionStorage.clear()}},an.cookie={put:function(t,i,e,s){t&&window.JSON&&(document.cookie=t+"="+escape(p(i))+(s&&s instanceof Date?";expires="+s.toUTCString():"")+(e?";domain="+e:"")+(G.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?Vt.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"}},G.printPPI=96,G.printMargin=.75*G.printPPI;var un={a4:"A4",a3:"A3",letter:"letter"},cn={page:!0,data:!0},fn={portrait:!0,landscape:!0},ln={A3:{width:11.7,height:16.5},A4:{width:8.27,height:11.7},letter:{width:8.5,height:11}};function dn(t,i){var e=lt("div",{"class":"webix_view webix_print_"+t.toLowerCase(),style:"height:0px;visibility:hidden;"},i["doc"+t]);"Header"===t?_t(e,document.body.firstChild):document.body.appendChild(e),i["doc"+t]=e}var vn={phone:{mask:"+# (###) ###-####",allow:/[0-9]/g},card:{mask:"#### #### #### ####",allow:/[0-9]/g},date:{mask:"####-##-## ##:##",allow:/[0-9]/g}},_n={denySelect:ht,allowSelect:ot,index:at,createCss:ut,addStyle:ct,removeStyle:ft,create:lt,getValue:dt,remove:vt,insertBefore:_t,locate:pt,offset:mt,posRelative:bt,pos:gt,preventEvent:wt,stopEvent:xt,triggerEvent:yt,addCss:Mt,removeCss:St,getTextSize:kt,download:Ct,Df:$t,setSelectionRange:Dt,getSelectionRange:It,addMeta:At},pn="__webix_remote_error";function mn(t,i){this.If={},this.Af=[],this.Tf=t,this.Ia="",i?this.Ff(i):this.zf=B(t).then(function(t){return t.text()}).then(k(function(t){return t=t.split("/*api*/")[1],this.Ff(JSON.parse(t)),this.If},this))}function bn(t,i){var e=new mn(t,i).Pf();for(var s in e)gn[s]=e[s];return e}mn.prototype={Ff:function(t){if(t.$key&&(this.Ia=t.$key),t.$vars)for(var i in t.$vars)this.If[i]=t.$vars[i];this.X(t,this.If,"")},X:function(t,i,e){for(var s in t)if("$key"!==s&&"$vars"!==s){var n=t[s];if("object"==M(n)){var r=i[s]={};this.X(n,r,e+s+".")}else i[s]=this.Vf(this,e+s)}},Hf:function(t,i){var e=this.Rf(this,t,i);return this.Af.push(e),this.Bf(),e},Bf:function(){this.Ef||(this.Ef=setTimeout(k(this.jf,this),1))},jf:function(){for(var t=[],r=this.Af,i=0;i<this.Af.length;i++){var e=this.Af[i];e.$sync?(r.splice(i,1),i--):t.push({name:e.$name,args:e.$args})}if(r.length){var s=B(),n=this.Lf(t);w("onBeforeRemoteCall",[s,n,{}]);var h=s.post(this.Tf,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?(w("onRemoteError",[n]),r[e].reject(n)):r[e].resolve(s)}},function(t){for(var i=0;i<r.length;i++)r[i].reject(t);throw t});w("onAfterRemoteCall",[h])}this.Af=[],this.Ef=null},$:function(){var t=null;this.$sync=!0;var i=[{name:this.$name,args:this.$args}];try{var e=B(),s=this.$context.Lf(i);w("onBeforeRemoteCall",[e,s,{sync:!0}]);var n=e.sync().post(this.$context.Tf,s);w("onAfterRemoteCall",[null]),(t=JSON.parse(n.responseText).data[0])[pn]&&(t=null)
}catch(Qh){}return t},Rf:function(t,i,e){var s=m.defer();return s.sync=t.$,s.$name=i,s.$args=e,s.$context=this,s},Vf:function(t,i){return function(){return t.Hf(i,[].slice.call(arguments))}},Pf:function(){return this.zf||this.If},Lf:function(t){return{key:this.Ia,payload:t}}};var gn=function(t,i){if("object"!==M(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);ei.orientation!==t&&(ei.orientation=t,w("onRotate",[t]))}G.touch&&(ei.orientation=!!((z(window.orientation)?90:window.orientation)%180),Qt(window,"onorientationchange"in window?"orientationchange":"resize",wn));var xn={textWaitDelay:500,summColumn:{getValue:function(t){return t.innerText},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.innerHTML=s},trackCells:!0,render:function(t,i){return i.template&&(i.template=qt(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.querySelector("input")||{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.B.id,t.registerFilter(i,e,this),i.Of=t.B.id,e.value&&this.getValue(i)!=e.value&&this.setValue(i,e.value),i.onclick=wt,Zt(i,"keydown",this.Nf)},render:function(t,i){return this.init&&this.init(i),i.css=(i.css||"")+" webix_ss_filter","<input "+(i.placeholder?'placeholder="'+i.placeholder+'" ':"")+"type='text'>"},Nf:function(t){var i=this.Of;9!=(t.which||t.keyCode)&&(this.Wf&&window.clearTimeout(this.Wf),this.Wf=window.setTimeout(function(){var t=ai(i);t&&t.filterByAll()},xn.textWaitDelay))}},selectFilter:{getInputNode:function(t){return t.querySelector("select")||{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(t,i,e){e.compare=e.compare||function(t,i){return t==i},i.component=t.B.id,t.registerFilter(i,e,this);var s=xn.Yf(t,e);!1!==e.emptyOption&&s.unshift({id:"",value:e.emptyOption||""});for(var n=document.createElement("select"),r=0;r<s.length;r++){var h=document.createElement("option");h.value=s[r].id,h.text=s[r].value,n.add(h)}i.innerHTML="",i.appendChild(n),e.value&&this.setValue(i,e.value),i.onclick=wt,n.Of=t.B.id,Zt(n,"change",this.Uf)},render:function(t,i){return this.init&&this.init(i),i.css=(i.css||"")+" webix_ss_filter",""},Uf:function(){ai(this.Of).filterByAll()}},Yf:function(t,i){var e=i.options;return e?t.qf.call(e,"id","value"):t.collectValues(i.columnId,i.collect)}};xn.serverFilter=F.extend({$server:!0,Nf:function(t){var i=this.Of,e=t.which||t.keyCode;9==e||33<=e&&e<=40||(this.Wf&&window.clearTimeout(this.Wf),this.Wf=window.setTimeout(function(){ai(i).filterByAll()},xn.textWaitDelay))}},xn.textFilter),xn.serverSelectFilter=F.extend({$server:!0,Uf:function(){ai(this.Of).filterByAll()}},xn.selectFilter),xn.numberFilter=F.extend({init:function(r){r.prepare=function(t){var e,s=this,i=-1!=t.indexOf("="),n=this.format(t);return""===n?"":(-1!=t.indexOf(">")?e=this.Gf:-1!=t.indexOf("<")&&(e=this.Xf),r.compare=e&&i?function(t,i){return s.Kf(t,i)||e(t,i)}:e||this.Kf,n)}},format:function(t){return t.replace(/[^\-.0-9]/g,"")},Gf:function(t,i){return i<1*t},Xf:function(t,i){return""!==t&&1*t<i},Kf:function(t,i){return""!==t&&1*t==i}},xn.textFilter
),xn.dateFilter=F.extend({format:function(t){if(""===t)return"";var i=new Date;if(-1!=t.indexOf("today"))i=rn.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)):P.dateFormatDate(t.replace(/^[>< =]+/,""))}return i.valueOf()}},xn.numberFilter),G.scrollSize=G.touch||G.$customScroll?0:17,mi(function(){var t=function s(){var t=lt("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&&oe(e);return G.$customScroll?0:i}();G.scrollSize=G.touch?0:t});var yn=!1;t("_fixHeight",function io(){yn||(ct("html, body{ height:100%; }"),document.body.className+=" webix_full_screen",ue.limit(!1),yn=!0)}),ni.animate=function eo(t,i,e){var s=ai(i);if(s){var n=e||{type:"slide",direction:"left"},r=s.zt.cloneNode(!0),h=ni(t,i);h.zt.parentNode.appendChild(r);var o=ne.formLine(h.zt,r,n);return n.callback=function(){ne.breakLine(o)},ne(o,n),h}},ni.animateView=function so(i,t,e){if(i=ai(i)){e=e||{type:"slide",direction:"left"};for(var s=function(t){var i=t.zt,e=i.className,s=i.innerHTML;return"<div class='"+e+"' style='width:"+i.offsetWidth+"px;height:"+i.offsetHeight+"px;'>"+s+"</div>"},n=[],r=0;r<i.zt.childNodes.length;r++){var h=i.zt.childNodes[r],o=h.currentStyle?h.currentStyle.display:getComputedStyle(h,null).display;n.push(o||"")}var a=s(i);"function"==typeof t&&t.call(this);for(var u=s(i),c=i.zt.insertBefore(lt("DIV",{"class":"webix_view_animate",style:"width:"+i.zt.offsetWidth+"px;height:"+i.zt.offsetHeight+"px;"},u+a),i.zt.firstChild),f=1;f<i.zt.childNodes.length;f++)i.zt.childNodes[f].style.display="none";var l=ne.formLine(c.childNodes[0],c.childNodes[1],e);return e.callback=function(){if(c){i.zt.removeChild(c),c=null;for(var t=0;t<i.zt.childNodes.length;t++)i.zt.childNodes[t].style.display=n[t]}},ne(l,e),i}},ni.freeze=di,ni.resize=vi,ni.zIndex=pi,ni.datafilter=xn,ni.fullScreen=function no(){if(G.touch){At("apple-mobile-web-app-capable","yes"),At("viewport","initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no"),G.isMac||ct("body.webix_full_screen{ overflow-y: auto; }");var t=function(){var t=window.innerWidth,i=window.innerHeight;i&&(document.body.style.height=i+"px",document.body.style.width=t+"px"),ei.pt=!1,vi()},i=function(){ei.pt=!0,C(t,null,[],500)};y("onRotate",i),wn(),C(i)}};P.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:"von"},PDFviewer:{of:"von",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"},filter:{less:"weniger",lessOrEqual:"weniger oder gleich",greater:"mehr",greaterOrEqual:"größer oder gleich",contains:"enthält",notContains:"nicht enthält",equal:"gleich",notEqual:"ungleich",beginsWith:"beginnt mit",notBeginsWith:"nicht beginnt mit",endsWith:"endet mit",notEndsWith:"nicht endet mit",between:"zwischen",notBetween:"nicht zwischen"},timeboard:{seconds:"Sekunden"}},P.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"},filter:{less:"menos",lessOrEqual:"menor o igual",greater:"mayor",greaterOrEqual:"mayor o igual",contains:"contiene",notContains:"not contiene",equal:"igual",notEqual:"no es igual",beginsWith:"comienza con",notBeginsWith:"no comienza con",endsWith:"termina con",notEndsWith:"no termina con",between:"entre",notBetween:"no entre"},timeboard:{seconds:"segundos"}},P.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"},filter:{less:"moins",lessOrEqual:"inférieur ou égal",greater:"plus grand",greaterOrEqual:"supérieur ou égal",contains:"contient",notContains:"ne contient",equal:"égal",notEqual:"pas égal",beginsWith:"commence par",notBeginsWith:"ne commence par",endsWith:"se termine par",notEndsWith:"pas se termine par",between:"entre",notBetween:"pas entre"},timeboard:{seconds:"secondes"}},P.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"},filter:{less:"meno",lessOrEqual:"minore o uguale",greater:"maggiore",greaterOrEqual:"maggiore o uguale",contains:"contiene",notContains:"non contiene",equal:"uguale",notEqual:"non uguale",beginsWith:"inizia con",notBeginsWith:"non inizia con",endsWith:"finisce con",notEndsWith:"non termina con",between:"tra",notBetween:"non tra"},timeboard:{seconds:"secondi"}},P.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:"その他のコメント"},filter:{less:"レス",lessOrEqual:"以下",greater:"大きいです",greaterOrEqual:"以上",contains:"含まれています",notContains:"含まれていません",equal:"等しいです",notEqual:"等しくありません",beginsWith:"で始まります",notBeginsWith:"ないで始まります",endsWith:"で終わります",notEndsWith:"で終わりではありません",between:"間に",notBetween:"いない間"},timeboard:{seconds:"秒"}},P.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"},filter:{less:"menos",lessOrEqual:"menor ou igual",greater:"maior",greaterOrEqual:"maior ou igual",contains:"contém",notContains:"não contém",equal:"igual",notEqual:"não é igual",beginsWith:"começa com",notBeginsWith:"não começa com",endsWith:"termina com",notEndsWith:"não termina com",between:"entre",notBetween:"não entre"},timeboard:{seconds:"segundos"}},P.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:"更多评论"},filter:{less:"小于",lessOrEqual:"少于等于",greater:"大于",greaterOrEqual:"大于等于",contains:"包含",notContains:"不包含",equal:"等于",notEqual:"不等于",beginsWith:"开始于",notBeginsWith:"不以开始",endsWith:"结束",notEndsWith:"不以结束",between:"之间",notBetween:"不介于"},timeboard:{seconds:"秒"}},P.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:"Больше комментариев"},filter:{less:"меньше",lessOrEqual:"меньше или равно",greater:"больше",greaterOrEqual:"больше или равно",contains:"содержит",notContains:"не содержит",equal:"равно",notEqual:"не равно",beginsWith:"начинается с",notBeginsWith:"не начинается с",endsWith:"заканчиватся",notEndsWith:"не заканчиватся",between:"между",notBetween:"не между"},timeboard:{seconds:"Секунды"}},P.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:"Больш каментарыяў"},filter:{less:"менш",lessOrEqual:"менш або роўна",greater:"больш",greaterOrEqual:"больш або роўна",contains:"змяшчае",notContains:"не змяшчае",equal:"роўныя",notEqual:"не роўныя",beginsWith:"пачынаецца з",notBeginsWith:"не пачынаецца з",endsWith:"заканчваецца",notEndsWith:"не сканчаецца",between:"паміж",notBetween:"не паміж"},timeboard:{seconds:"Секунды"}};var Mn={name:"baselayout",restore:function(t,i,e){var s=this.Jf(S(t),i);if(e)return s;ni(s.cols||s.rows,this)},Jf: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.Jf(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 r=n.getChildViews();i.push(t.call(this,r[r.length-1]))}else n.serialize?i.push(n.serialize(t,!0)):i.push(t.call(this,n))}var h={$layout:!0,type:this.config.type};return this.config.rows?h.rows=i:h.cols=i,h},$init:function(t){this.$ready.push(this.Zf),this.tt=this.Ui,this.Qf=[],this.tl=[],this.ca={top:0,left:0,right:0,bottom:0},t.$topView&&(t.borderless=!0,t.Dt={top:!0,left:!0,bottom:!0,right:!0}),t.isolate&&F.extend(this,Ge)},rows_setter:function(t){return this.il=1,this.el=t,!0},cols_setter:function(t){return this.il=0,this.$view.style.whiteSpace="nowrap",this.el=t,!0},Ft:function(t){var i=x.find.call(this.ai,t);this.sl&&this.sl(i),x.removeAt.call(this.ai,i),this.nl(!0)},nl:function(t){for(var i=this.rl=0;i<this.ai.length;i++){var e=this.ai[i];(e.B.hidden||e.$nospace)&&this.rl++}t&&this.resizeChildren(!0)},Tt:function(t,i){if(z(i)){for(var e=0;e<this.ai.length;e++)this.ai[e].destructor();this.el=t,this.Zf()}else{var s;"number"==typeof i?((i<0||i>this.ai.length)&&(i=this.ai.length),x.insertAt.call(this.ai,t,i),t.B.hidden||this.hl(t,this.ai[i])):(s=ai(i),i=x.find.call(this.ai,s),t.B.hidden||this.hl(t,s),s.destructor(),this.ai[i]=t),this.il||this.oa(t)}this.nl(!0);var n=this.elements?this:this.getFormView();n&&!this.ol&&n.ue(),w("onReconstruct",[this])},oa:function(t){t.zt.style.display="inline-block",t.zt.style.verticalAlign="top"},addView:function(t,i){z(i)&&(i=this.ai.length);var e=this.$$?this:this.getTopParentView();ei.mt=this;var s=e&&e.ui?e.ui(t,this,i):ni(t,this,i);return ei.mt=null,s.B.id},removeView:function(t){var i;i="object"!=M(t)?ai(t)||(this.$$?this.$$(t):null):t;var e=x.find.call(this.ai,i);if(0<=e){this.sl&&this.sl(e,i);var s=this.elements?this:this.getFormView();this.ai.splice(e,1),s&&_i(i,function(t){t.name&&delete s.getCleanValues()[t.config.name]},s,!0),i.destructor(),this.nl(!0),s&&s.ue()}w("onReconstruct",[this])},reconstruct:function(){this.rl=0,this.Tt(this.el)},Ri:function(t,i,e){t.B.hidden||(t.B.hidden=!0,vt(t.zt),this.rl++,e||ei.gt||this.resizeChildren(!0))},$e:function(t){t.callEvent&&t.callEvent("onViewShow",[])},resizeChildren:function(){if(!ei.pt&&this.Qf){var t=this.getParentView();if(t)return t.resizeChildren?t.resizeChildren():t.resize();var i,e,s,n,r=this.$getSize(0,0);if(s=i=this.Qf[0]||0,n=e=this.Qf[1]||0,(1e5<=r[1]||1e5<=r[3])&&this.zt.parentNode&&(s=i=Math.max(r[0],this.B.width||this.zt.parentNode.offsetWidth||i||0),n=e=Math.max(r[2],this.B.height||this.zt.parentNode.offsetHeight||e||0)),t)this.fa(i,e);else{r[0]>i&&(s=r[0]),r[2]>e&&(n=r[2]);var h=this.zt.parentNode==document.body&&!this.setPosition;!h&&i>r[1]&&(s=r[1]),!h&&e>r[3]&&(n=r[3]),this.$setSize(s,n)}ei.vt&&(ei.vt=!1,this.resizeChildren()),w("onResize",[])}},getChildViews:function(){return this.ai},index:function(t){t.B&&(t=t.B.id);for(var i=0;i<this.ai.length;i++)if(this.ai[i].B.id==t)return i;return-1},hl:function(t,i){if(i)if(i.B.hidden||t===i){for(var e=this.index(i)+1;this.ai[e]&&this.ai[e].B.hidden;)e++;i=this.ai[e]?this.ai[e].zt:null}else i=i.zt;_t(t.zt,i,this.tt||this.zt)},ke:function(t,i,e){t.B.hidden&&(this.hl(t,t),t.B.hidden=!1,this.rl--,e||(this.resizeChildren(!0),t.refresh&&t.refresh()),t.callEvent&&(t.callEvent("onViewShow",[]),_i(t,this.$e)))},showBatch:function(t,i
){var e=void 0!==i;if(i=!1!==i,e)this.B.visibleBatch="";else{if(this.B.visibleBatch==t)return;this.B.visibleBatch=t}for(var s=[],n=0;n<this.ai.length;n++)this.ai[n].B.batch||this.ai[n].B.hidden?this.ai[n].B.batch==t?i?s.push(this.ai[n]):this.Ri(this.ai[n],null,!0):e||this.Ri(this.ai[n],null,!0):s.push(this.ai[n]);for(var r=0;r<s.length;r++)this.ke(s[r],null,!0),s[r].Ce();this.resizeChildren(!0)},Zf:function(t){this.ai=[],this.name;for(var i=0;i<t.length;i++)ei.mt=this,t[i].Dt||(t[i].borderless=!0),this.ai[i]=ni.Ht(t[i],this),this.il||this.oa(this.ai[i]),this.B.visibleBatch&&this.B.visibleBatch!=this.ai[i].B.batch&&this.ai[i].B.batch&&(this.ai[i].B.hidden=!0),this.ai[i].B.hidden||(this.tt||this.Ui).appendChild(this.ai[i].zt);this.nl(),this.al&&this.al(t)},ul:function(t,i){i.top&&(t.borderTopWidth="0px"),i.left&&(t.borderLeftWidth="0px"),i.right&&(t.borderRightWidth="0px"),i.bottom&&(t.borderBottomWidth="0px")},cl:function(t,i,e){if(this.il!=e)for(var s=0;s<this.ai.length;s++)this.ai[s].B[t]=i,this.ai[s].cl&&this.ai[s].cl(t,i,e)},$getSize:function(t,i){var e=0,s=1e5,n=1e5,r=0;this.il?n=0:s=0;var h=0,o=0,a=0;this.ni=[];for(var u=0;u<this.ai.length;u++)if(!this.ai[u].B.hidden){var c=this.ni[u]=this.ai[u].$getSize(0,0);this.ai[u].$nospace?o++:this.il?(c[0]>e&&(e=c[0]),c[1]<s&&(s=c[1]),r+=c[2],n+=c[3],c[2]==c[3]&&-1!=c[2]?(h+=c[2],o++):a+=c[4]):(c[2]>r&&(r=c[2]),c[3]<n&&(n=c[3]),e+=c[0],s+=c[1],c[0]==c[1]&&-1!=c[0]?(h+=c[0],o++):a+=c[4])}n<r&&(n=r),s<e&&(s=e),this.fl=[h,this.ai.length-o,a],this.ll=[e+t,r+i];var f=Ki.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]||r)+i,f[3]=Math.max(f[2],(f[3]||n)+i),!this.il&&this.B.responsive&&(f[0]=0),f},$setSize:function(t,i){this.Qf=[t,i],Ki.api.$setSize.call(this,t,i),this.fa(t,i)},dl:function(t,i,e){var s=i=t[i];if(i!=(e=t[e])){var n=this.vl*t[4]/this._l;if(n<i)s=i,this._l-=t[4],this.vl-=s;else{if(!(e<n))return-1;s=e,this._l-=t[4],this.vl-=s}}return s},pl:function(t,i){var e=ai(i);"hide"!==e&&e?(e||(e=ni({view:"popup",body:[{}]})),t.ml=t.B.width,t.bl=t.B.height,t.gl=e.B.id,t.B.width=0,t.B.height||(t.B.autoheight=!0),ni(t,e,this.tl.length)):(t.hide(),t.gl="hide"),this.tl.push(t)},wl:function(t){var i=t.gl;if(t.gl=0,"hide"!==i&&i){t.B.width=t.ml,t.B.height=t.bl,delete t.B.autoheight;for(var e=0;this.ai[e]&&!1===this.ai[e].B.responsiveCell;)e++;ni(t,this,e)}else t.show();this.tl.pop()},xl:function(t){if(ei._t=!0,t+this.ca.left+this.ca.right+this.la*(this.ai.length-1)<this.ll[0])for(var i=this.ai.length-1,e=0;e<i;e++){var s=this.ai[e];if(!s.gl){if(!1!==s.B.responsiveCell){this.pl(s,this.B.responsive),w("onResponsiveHide",[s.B.id]),ei.vt=!0;break}i=this.ai.length}}else if(this.tl.length){var n=this.tl[this.tl.length-1],r="hide"==n.gl?0:n.ml;n.$getSize(r,0)[0]+this.ll[0]+this.la+20<=t&&(this.wl(n),w("onResponsiveShow",[n.B.id]),ei.vt=!0)}ei._t=!1},fa:function(t,i){ei.dt=(ei.dt||0)+1,!this.il&&this.B.responsive&&this.xl(t,i),this.vl=(this.il?i:t)-this.fl[0],this._l=this.fl[2];for(var e=t,s=i,n=[],r=0;r<this.ai.length;r++)if(!this.ai[r].B.hidden&&this.ni[r]){var h=this.ni[r];if(this.il){if((s=this.dl(h,2,3))<0){n.push({oldIndex:r,view:this.ai[r]});continue}}else if((e=this.dl(h,0,1))<0){n.push({oldIndex:r,view:this.ai[r]});continue}this.ai[r].$setSize(e,s)}for(var o=0;o<n.length;o++){var a=n[o].oldIndex,u=this.ni[a],c=Math.round(this.vl*u[4]/this._l);this.vl-=c,this._l-=u[4],this.il?s=c:e=c,n[o].view.$setSize(e,s)}ei.dt-=1},yl:function(t,i){var e=this.index(t);return-1==e?null:this.ai[e+i]},Ml:function(){return this.ai[0]}},Sn={api:Mn,view:F.protoUI(Mn,b,Ki.view)},kn=(F.protoUI({name:"spacer",defaults:{borderless:!0},$init:function(){this.zt.className+=" webix_spacer"}},Qi.view),{name:"template",$init:function(t){var i=this.Sl[t.type];i&&(i.css&&t.css&&(this.zt.className+=" "+i.css),F.extend(t,i),t.borderless&&(delete t.Dt,this.oi(t))),this.tt==this.zt?(this.tt=lt("DIV"),this.tt.className=" webix_template",this.zt.appendChild(this.tt)):this.tt.className+=" webix_template",this.attachEvent("onAfterRender",
this.kl)},setValues:function(t,i){this.data=i?F.extend(this.data,t,!0):t,this.render()},getValues:function(){return this.data},$skin:function(){this.Sl.header.height=re.barHeight-2*re.borderWidth,this.Sl.section.height=re.barHeight},Sl:{header:{css:"webix_header"},section:{css:"webix_section",borderless:!0},clean:{css:"webix_clean",borderless:!0}},onClick_setter:function(t){return this.on_click=F.extend(this.on_click||{},t,!0),this.nu||F.extend(this,Je),t},defaults:{template:qt.empty},Cl:function(){this.$l=!1,this.Dl(),this.resize()},Dl:function(){this.$l||(this.$l=!0,this.render())},src_setter:function(t){return this.$l=!0,this.callEvent("onBeforeLoad",[])?(B(t,k(function(t){this.B.template=qt(t),this.Cl(),this.callEvent("onAfterLoad",[])},this)),t):""},content_setter:function(t){t&&(this.$l=!0,this.render=function(){},this.tt.appendChild(D(t)),this.kl())},refresh:function(){this.render()},setHTML:function(t){this.B.template=function(){return t},this.refresh()},setContent:function(t){this.tt.innerHTML="",this.content_setter(t)},$setSize:function(t,i){if(Qi.api.$setSize.call(this,t,i)){if(this.Dl(),this.B.autoheight){var e=this.getTopParentView();clearTimeout(e.Il),e.Il=C(this.resize,this)}return!0}},$getSize:function(t,i){return!this.B.autoheight||this.B.type&&"clean"!=this.B.type||(this.B.height=this.Al()),Qi.api.$getSize.call(this,t,i)},kl:function(){this.B.autoheight&&(this.we=null,this.resize())},Al:function(){var t,i=re.layoutPadding.space;return this.Dl(),this.isVisible()?(this.tt.style.height="auto",t=this.tt.scrollHeight,this.tt.style.height=""):t=kt(this.Q(this.data)||this.tt.innerHTML,"webix_template",(this.$width||(this.getParentView()?this.getParentView().$width:0))-i).height,t},Eu:!0}),Cn={api:kn,view:F.protoUI(kn,ss,ee,Rt,Gt,b,Qi.view)},$n={name:"scrollview",defaults:{scroll:"y",scrollSpeed:"300ms"},$init:function(){this.zt.className+=" webix_scrollview"},body_setter:function(t){t.borderless=!0,(ei.mt=this).$t=ni.Ht(t),this.tt.appendChild(this.$t.zt)},getChildViews:function(){return[this.$t]},getBody:function(){return this.$t},resizeChildren:function(){this.$t&&(this.ll=this.$t.$getSize(0,0),this.Tl(),w("onResize",[]))},Tl:function(){var t=Math.max(this.xe,this.ll[0]),i=Math.max(this.Me,this.ll[2]);if(this.$t.$setSize(t,i),G.touch){var e=this.getScrollState(),s=this.$t.Me-this.Me;s<e.y&&this.scrollTo(null,s)}ei.vt&&(ei.vt=!1,this.ll=this.$t.$getSize(0,0),this.Tl())},$getSize:function(t,i){var e=this.ll=this.$t.$getSize(0,0),s=Qi.api.$getSize.call(this,t,i),n=this.Fl||G.scrollSize;return"x"==this.B.scroll?(s[2]=Math.max(s[2],e[2])+n,s[3]=Math.min(s[3],e[3])+n):"y"==this.B.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=G.scrollSize;G.scrollSize=this.Fl||e,(Qi.api.$setSize.call(this,t,i)||ei.Jt)&&this.Tl(),G.scrollSize=e},scroll_setter:function(t){var i=G.$customScroll;return"string"==typeof t&&0===t.indexOf("native-")&&(this.Fl=17,t=t.replace("native-",""),G.$customScroll=!1),t=ss.scroll_setter.call(this,t),G.$customScroll=i,t},Tt:function(t){this.$t.destructor(),this.$t=t,this.tt.appendChild(this.$t.zt),this.resizeChildren()},showView:function(t){var i=ai(t).$view.offsetTop-ai(t).$view.parentNode.offsetTop;this.scrollTo(0,i)}},Dn=(F.protoUI($n,ss,b,Qi.view),F.protoUI({name:"iframe",$init:function(){this.tt=this.Ui,this.Ui.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.Ui.getElementsByTagName("iframe")[0]},getWindow:function(){return this.getIframe().contentWindow}},Qi.view,b),{name:"layout",$init:function(){this.rl=0},defaults:{type:"line"},Zf:function(){this.zl&&(t=this.zl(t)),this.Pl||(this.zt.className+=" webix_layout_"+(this.B.type||""),this.Pl=1),this.B.margin!==undefined&&(this.la=this.B.margin),this.B.padding!==undefined&&"object"!==M(
this.B.padding)&&(this.ca.left=this.ca.right=this.ca.top=this.ca.bottom=this.B.padding),this.B.paddingX!==undefined&&(this.ca.left=this.ca.right=this.B.paddingX),this.B.paddingY!==undefined&&(this.ca.top=this.ca.bottom=this.B.paddingY),"object"===M(this.B.padding)&&F.extend(this.ca,this.B.padding,!0),(this.ca.left||this.ca.right||this.ca.top||this.ca.bottom)&&(this.ca.defined=!0),this.Vl()&&!this.B.borderless&&(this.Ui.style.borderWidth="1px",this.Hl=!0);var t=this.el;this.B.borderless&&(this.B.Dt={top:!0,left:!0,right:!0,bottom:!0}),this.aa(t),Sn.api.Zf.call(this,t),this.ua(t)},$getSize:function(t,i){t=t||0,i=i||0;var e=this.la*(this.ai.length-this.rl-1);if(this.Hl||this.Vl()){var s=this.B.Dt;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1))}return this.B.height||(i+=this.ca.top+this.ca.bottom+(this.il?e:0)),this.B.width||(t+=this.ca.left+this.ca.right+(this.il?0:e)),Sn.api.$getSize.call(this,t,i)},$setSize:function(t,i){this.Qf=[t,i],this.Vl()||this.Hl?Qi.api.$setSize.call(this,t,i):Ki.api.$setSize.call(this,t,i),i=this.Me,t=this.xe,this.B.scroll&&(i=Math.max(i,this.ll[1]),t=Math.max(t,this.ll[0])),this.fa(t,i)},fa:function(t,i){var e=this.la*(this.ai.length-this.rl-1);return i-=this.ca.top+this.ca.bottom,t-=this.ca.left+this.ca.right,this.il?i-=e:t-=e,Sn.api.fa.call(this,t,i)},resizeChildren:function(t){if(t){this.we=null;for(var i=[],e=0;e<this.ai.length;e++){var s=this.ai[e];i[e]=s.B;var n=s.Qf&&!s.Hl||s.B.borderless?"0px":"1px";s.zt.style.borderTopWidth=s.zt.style.borderBottomWidth=s.zt.style.borderLeftWidth=s.zt.style.borderRightWidth=n}this.aa(i);for(var r=0;r<i.length;r++)i[r].borderless&&this.ai[r].oi&&this.ai[r].oi(i[r]);this.ua(this.ai)}ei._t||Sn.api.resizeChildren.call(this)},Vl:function(){return this.ca.defined&&0<this.la&&!this.Rl},aa:function(t){if(!this.Vl()||this.B.borderless&&"space"!=this.B.type){for(var i=0;i<t.length;i++)t[i].Dt=l(this.B.Dt);var e=!1;this.Rl&&(e=!0);var s=t.length;if(this.il){for(var n=1;n<s-1;n++)t[n].Dt.top=t[n].Dt.bottom=e;if(1<s){for("head"!=this.B.type&&(t[0].Dt.bottom=e);t[s-1].hidden&&1<s;)s--;0<s&&(t[s-1].Dt.top=e)}}else{for(var r=1;r<s-1;r++)t[r].Dt.left=t[r].Dt.right=e;if(1<s){for("head"!=this.B.type&&(t[0].Dt.right=e),t[s-1].Dt.left=e;1<s&&t[s-1].hidden;)s--;0<s&&(t[s-1].Dt.left=e)}}}else for(var h=0;h<t.length;h++)t[h].Dt&&t[h].borderless||(t[h].Dt={top:!1,left:!1,right:!1,bottom:!1})},ua:function(t){for(var i=0,e=0;e<t.length;e++){var s=this.ai[e],n=s.B.Dt;if(s.B.hidden&&this.ai[e+1]){var r=this.ai[e+1].B.Dt;n.top||(r.top=!1),n.left||(r.left=!1),e==i&&i++}this.ul(s.zt.style,s.B.Dt)}for(var h=this.il?"marginLeft":"marginTop",o=this.il?"marginTop":"marginLeft",a=this.il?this.ca.left:this.ca.top,u=this.il?this.ca.top:this.ca.left,c=0;c<t.length;c++)this.ai[c].zt.style[h]=a+"px";this.ai.length&&(this.ai[i].zt.style[o]=u+"px");for(var f=i+1;f<t.length;f++)this.ai[f].zt.style[o]=this.la+"px"},type_setter:function(t){return this.la="undefined"!=typeof this.Bl[t]?this.Bl[t]:this.Bl.line,this.ca.left=this.ca.right=this.ca.top=this.ca.bottom="undefined"!=typeof this.Bl[t]?this.El[t]:this.El.line,this.Rl="material"==t||"clean"==t,"material"==t&&(this.B.borderless=!0),t},$skin:function(){this.Bl=re.layoutMargin,this.El=re.layoutPadding}}),In=F.protoUI(Dn,Sn.view),An={api:Dn,view:In};In.call(-1);var Tn={name:"accordion",defaults:{panelClass:"accordionitem",multi:!1,collapsed:!1},$init:function(){this.zt.setAttribute("role","tablist"),this.zt.setAttribute("aria-multiselectable","true")},Tt:function(t){An.api.Tt.apply(this,arguments),t.collapsed_setter&&t.refresh&&t.refresh()},Zf:function(){for(var t=this.B.panelClass,i=this.el,e=0;e<i.length;e++)!i[e].body&&!i[e].header||i[e].view||i[e].align||(i[e].view=t),z(i[e].collapsed)&&(i[e].collapsed=this.B.collapsed);this.jl=!0,An.api.Zf.call(this),this.jl=!1;for(var s=0;s<this.ai.length;s++)this.ai[s].name==t&&this.ai[s].refresh(),this.ai[s].Ll=!1;for(var n=!1,r=this.ai.length-1;0<=r&&!n;r--)this.ai[r].B.hidden||(n=this.ai[r].Ll=!0)},Ol:function(t){if(!1===this.B.multi&&!0!==this.jl)for(var i=0;i<this.ai.length;i++
)t!=this.ai[i]&&!this.ai[i].B.collapsed&&this.ai[i].collapse&&this.ai[i].collapse();t.callEvent&&(t.callEvent("onViewShow",[]),_i(t,this.$e))},Nl:function(t){if(!0===this.B.multi||this.jl)return!0;for(var i=0;i<this.ai.length;i++)if(t!=this.ai[i]&&!this.ai[i].B.collapsed&&this.ai[i].isVisible()&&!this.ai[i].$nospace)return!0;return!1},$skin:function(){An.api.$skin.call(this),re.accordionType&&(this.defaults.type=re.accordionType)}},Fn={api:Tn,view:F.protoUI(Tn,An.view)},zn=(F.protoUI({name:"headerlayout",defaults:{type:"accordion",multi:"mixed",collapsed:!1}},Fn.view),{name:"accordionitem",$init:function(t){this.zt.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.Ui=this.zt,this.mn=this.Ui.childNodes[0],t.header||(this.mn.style.display="none"),this.Wl=this.Ui.childNodes[0].childNodes[1],this.Yl=this.Ui.childNodes[0].childNodes[0],this.zn=this.Ui.childNodes[1],this.zt.className+=" webix_accordionitem",this.Pn=this.$t=null,this.ai=!0,this.zn.setAttribute("role","tabpanel"),this.mn.setAttribute("role","tab"),this.attachEvent("onKeyPress",this.De)},Ft:function(){this.body_setter()},Tt:function(t){this.$t.destructor(),this.$t=t,this.zn.appendChild(this.$t.zt),this.resize()},_id:"webix_ai_id",getChildViews:function(){return[this.$t]},body_setter:function(t){return"object"!=M(t)&&(t={template:t}),t.Dt={top:!0,left:!0,right:!0,bottom:!0},(ei.mt=this).$t=ni.Ht(t),this.zn.appendChild(this.$t.zt),t},header_setter:function(t){return t&&(t=qt(t)),t},headerAlt_setter:function(t){return t&&(t=qt(t)),t},$getSize:function(t,i){var e=this.$t.$getSize(0,0),s=this.B.Dt;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1));var n=0,r=Ki.api.$getSize.call(this,0,0);r[0]=(r[0]||e[0])+t,1e5<=r[1]&&(r[1]=e[1]),r[1]+=t,r[2]=(r[2]||e[2])+i;var h=r[3]<1e5;return h||(r[3]=e[3]),r[3]+=i,this.getParentView().il?this.B.collapsed?r[2]=r[3]=this.Ul()+i:this.B.header&&(n=this.B.headerHeight):(this.B.collapsed&&(r[0]=r[1]=this.Ul()+t),this.B.header&&(n=this.B.headerHeight)),h||(r[2]+=n,r[3]+=n),r},on_click:{webix_accordionitem_header:function(t){return this.ql(t),!1},webix_accordionitem_header_v:function(t){return this.ql(t),!1}},ql:function(){this.define("collapsed",!this.B.collapsed)},collapsed_setter:function(t){if(!1!==this.B.header){var i=this.getParentView();if(i){if(t)if(i.Nl(this))this.Gl();else{var e=0;if(1<i.ai.length)for(var s=0;s<i.ai.length;s++){var n=i.ai[s];if(this!=n&&n.isVisible()&&n.expand){n.expand(),this.Gl(),e=1;break}}if(!e)return}else this.Xl();(this.B.collapsed=t)||i.Ol(this),this.refresh(),ei.gt||this.resize(),i.callEvent("onAfter"+(t?"Collapse":"Expand"),[this.B.id]),this.B.$noresize=t}return t}},collapse:function(){this.define("collapsed",!0),ji.Si(this)},expand:function(){this.define("collapsed",!1)},ke:function(){this.show()},Ri:function(){this.hide()},Xl:function(){this.zn.style.display="",St(this.$view,"collapsed"),St(this.mn,"collapsed"),this.mn.setAttribute("aria-expanded","true")},Gl:function(){this.B.headerAlt&&(this.Wl.innerHTML=this.B.headerAlt()),this.zn.style.display="none",Mt(this.$view,"collapsed"),Mt(this.mn,"collapsed"),this.mn.setAttribute("aria-expanded","false")},refresh:function(){var t=this.B[this.B.collapsed?"headerAlt":"header"]||this.B.header;t&&(this.Wl.innerHTML=t(),this.Yl.setAttribute("aria-label",t()));var i=this.getParentView().il?"vertical":"horizontal";this.zt.className.indexOf(" "+i)<0&&Mt(this.zt,i),G.transform||Mt(this.zt,"webix_ie",!0)},Ul:function(){return this.B.collapsed?this.B.headerAltHeight:this.B.headerHeight},$setSize:function(t,i){if(Qi.api.$setSize.call(this,t,i)||this.Ul()!=this.Kl){t=this.xe,i=this.Me;var e=this.Kl=this.Ul();if(this.B.header)if(this.mn.style.height=e+"px",this.mn.style.width="auto",this.mn.style[G.transform]="",this.mn.style.borderBottomWidth=(this.B.collapsed?0:1)+"px",this.getParentView().il||!this.B.collapsed)i-=this.Ul();else if(this.B.collapsed)if(ne.isSupported()){
this.mn.style.width=i+"px",this.mn.style.height=t+3+"px";var s=Math.floor(i/2-t/2)+(t-this.B.headerAltHeight)/2;this.mn.style[G.transform]="rotate(90deg) translate("+s+"px, "+(s+1)+"px)"}else this.mn.style.width=t+"px",this.mn.style.height=i+3+"px";this.B.collapsed||(this.$t.$setSize(t,i),this.Jl=i)}else if(!this.B.collapsed){var n=this.$t;this.Jl&&n.$setSize(this.xe,this.Jl)}},$skin:function(){this.defaults.headerAltHeight=this.defaults.headerHeight=re.barHeight-2*re.borderWidth},defaults:{header:!1,headerAlt:!1,body:""}}),Pn=(F.protoUI(zn,Je,b,Qi.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.Zl="x"==i?"left":"top",this.zt=lt("DIV",{"class":"webix_resize_area webix_dir_"+i}),Zt(this.zt,G.mouse.down,xt),n&&(n="x"==i?n+" 0 "+n:"0 "+n+" 0 "+n),this.Ql=lt("DIV",{"class":"webix_resize_handle_"+i,style:n?"padding:"+n:""},"<div class='webix_handle_content'></div>"),this.ed=lt("DIV",{"class":"webix_resize_origin_"+i}),t[s]&&(this.ed.style[s]=t[s]+(t.border?1:0)+"px",this.Ql.style[s]=t[s]+"px"),t.cursor&&(this.Ql.style.cursor=this.ed.style.cursor=this.zt.style.cursor=t.cursor),this.sd=Qt(e,G.mouse.move,this.nd,{bind:this}),this.rd=Qt(document.body,G.mouse.up,this.hd,{bind:this}),this.Ql.style[this.Zl]=this.ed.style[this.Zl]=t.start+"px",e.appendChild(this.zt),e.appendChild(this.Ql),e.appendChild(this.ed)},hd:function(){this.callEvent("onResizeEnd",[this.od]),ti(this.sd),ti(this.rd),vt(this.zt),vt(this.Ql),vt(this.ed),this.zt=this.Ql=this.ed=null},nd:function(t){var i=gt(t);this.od=("x"==this.B.dir?i.x:i.y)+this.B.start-this.B.eventPos,this.Ql.style[this.Zl]=this.od+"px",this.callEvent("onResize",[this.od])}}),Vn=(F.protoUI(Pn,b,Li),{name:"resizer",defaults:{width:7,height:7},$init:function(t){this.getParentView(),this.zt.className+=" webix_resizer";var i=this.getParentView().la;Zt(this.zt,G.mouse.down,this.ad,{bind:this});var e=this.ud();this.cd=!1,this.fd=e,this.ld="x"==e?"width":"height","x"==e?t.height=0:t.width=0,0<i?(this.zt.className+=" webix_resizer_v"+e,this.zt.style.marginRight="-"+i+"px","x"==e?t.width=i:t.height=i,this.$nospace=!0):this.zt.className+=" webix_resizer_"+e,this.zt.innerHTML="<div class='webix_resizer_content'></div>","y"==e&&0<i&&(this.zt.style.marginBottom="-"+(t.height||this.defaults.height)+"px"),this.zt.setAttribute("webix_disable_drag","true"),this.zt.setAttribute("tabindex","-1"),this.zt.setAttribute("aria-grabbed","false")},ad:function(t){var i=this,e=this.dd();if(e&&!this.B.disabled){t=t||window.event,this.cd=!0,this.vd=gt(t),this._d=[],this.zt.setAttribute("aria-grabbed","true");for(var s=0;s<2;s++)e[s].$view.setAttribute("aria-dropeffect","move");this.zt.setAttribute("aria-dropeffect","move"),this.pd(t,e[0]);var n=Qt(document.body,G.mouse.up,function(t){return ti(n),i.md(t)})}},md:function(){this.cd=!1,this.vd=!1},pd:function(t,i){var e,s,n,r,h;t=t||window.event,e=this.fd,this.getParentView().zt.style.position="relative",n=mt(this.zt),r=mt(this.getParentView().zt),h=n[e]-r[e],s=mt(i.$view)[e]-mt(this.getParentView().$view)[e],this.bd=[e,i,h,s],this.gd=new ni.resizearea({container:this.getParentView().zt,dir:e,eventPos:this.vd[e],start:h-1,height:this.$height,width:this.$width,border:1,margin:this.getParentView().ca["x"===e?"left":"top"]}),this.gd.attachEvent("onResizeEnd",k(this.wd,this)),this.gd.attachEvent("onResize",k(this.xd,this)),Mt(document.body,"webix_noselect",1)},ud:function(){return this.getParentView().il?"y":"x"},xd:function(){var t,i,e,s,n,r,h,o,a;if(this.bd)for(t=this.dd(),s=this.bd[0],e=this.gd.od-this.bd[2],o=this.yd(t,s,e),a=t[0]["$"+this.ld]+t[1]["$"+this.ld],n=0;n<2;n++){i=n?-e:e,r=t[n].$getSize(0,0);var u="y"==s?r[2]:r[0],c="y"==s?r[3]:r[1];if(u===c&&(u=t[n].B["y"==s?"minHeight":"minWidth"]||3,c=t[n].B["y"==s?"maxHeight":"maxWidth"]||1e5),0<i&&c&&c<=o[n]||i<0&&u&&u>=o[n])return this._d[n]=0<i?c:u,h=this.Md(t,s),void(this.gd.Ql.style["y"==s?"top":"left"]=this.bd[3]+h[0]+"px");o[n]<3?this.gd.Ql.style["y"==s?"top":"left"]=this.bd[3]+n*a+1+"px":this._d[n]=null}},
dd:function(){var t,i,e;for(t=this.getParentView().ai,i=0;i<t.length;i++)if(t[i]==this)return(e=[this.Sd(t,i,1,-1),this.Sd(t,i,1,1)])[0]&&e[1]||(e=null),e},Sd:function(t,i,e,s){var n=t[i+s*e];return n&&n.B.hidden?this.Sd(t,i,e+1,s):n&&n.B.$noresize?null:n},wd:function(t){if(void 0!==t){var i,e,s,n,r=this.getParentView().il;if(this.kd=null,this.bd){if(e=this.bd[0],s=t-this.bd[2],(i=this.dd())[0]&&i[1]){n=this.Cd(i,e,s);for(var h=0;h<2;h++){var o=i[h].$getSize(0,0);if(r?o[2]==o[3]:Math.abs(o[1]-o[0])<3)i[h].B[this.ld]=n[h],i[h].cl&&i[h].cl(this.ld,n[h],r);else{var a=i[h].$view[r?"offsetHeight":"offsetWidth"];i[h].B.gravity=n[h]/a*i[h].B.gravity}}i[0].resize();for(var u=0;u<2;u++)i[u].callEvent&&i[u].callEvent("onViewResize",[]),i[u].$view.removeAttribute("aria-dropeffect");w("onLayoutResize",[i])}this.bd=!1}this.bd=!1,this.cd=!1,this._d=null,St(document.body,"webix_noselect"),this.zt.setAttribute("aria-grabbed","false"),this.zt.removeAttribute("aria-dropeffect")}},Md:function(t){var i,e,s;return s=t[0]["$"+this.ld]+t[1]["$"+this.ld],this._d[0]?e=s-(i=this._d[0]):this._d[1]&&(i=s-(e=this._d[1])),[i,e]},yd:function(t,i,e){for(var s=[],n="height"==this.ld?"offsetHeight":"offsetWidth",r=0;r<2;r++)s[r]=t[r].$view[n]+(r?-1:1)*e;return s},Cd:function(t,i,e){var s,n,r;if(this._d[0]||this._d[1])n=this.Md(t,i);else for(n=this.yd(t,i,e),s=0;s<2;s++)n[s]<0&&(r=n[0]+n[1],n[s]=1,n[1-s]=r-1);return n}}),Hn=(F.protoUI(Vn,Je,Oi,Qi.view),{name:"align",defaults:{borderless:!0,left:0,top:0,right:0,bottom:0},$init:function(){this.zt.className+=" webix_view_align"},Ft:function(){this.body_setter({})},Tt:function(t){this.$t.destructor(),this.$t=t,this.zt.appendChild(this.$t.zt),this.resize()},getChildViews:function(){return[this.$t]},body_setter:function(t){return t.Dt={top:!1,left:!1,right:!1,bottom:!1},(ei.mt=this).$t=ni.Ht(t),this.zt.appendChild(this.$t.zt),t},align_setter:function(t){"string"==typeof t&&(t=t.split(",")),this.$d=this.Dd=this.Id="";for(var i=0;i<t.length;i++){var e=t[i];"center"!==e&&"left"!==e&&"right"!==e||(this.$d=e),"top"!==e&&"bottom"!==e&&"middle"!==e||(this.Dd=e),"absolute"===e&&(this.$d=this.Dd=this.Id="precise")}return t},getBody:function(){return this.$t},$setSize:function(t,i){var e,s;Qi.api.$setSize.call(this,t,i),s=this.Id?(e=t-this.B.left-this.B.right,i-this.B.top-this.B.bottom):(e=this.ll[0]||t,this.ll[2]||i),this.$t.$setSize(e,s);var n=this.$t.zt;"center"==this.$d?n.style.marginLeft=Math.ceil((t-e)/2)+"px":"right"==this.$d?n.style.marginLeft=t-e+"px":n.style.marginLeft=(this.Id?this.B.left:0)+"px","middle"==this.Dd?n.style.marginTop=Math.ceil((i-s)/2)+"px":"bottom"==this.Dd?n.style.marginTop=i-s+"px":n.style.marginTop=(this.Id?this.B.top:0)+"px"},$getSize:function(t,i){var e=this.ll=this.$t.$getSize(0,0),s=Ki.api.$getSize.call(this,0,0);return this.Id&&(t+=this.B.left+this.B.right,i+=this.B.top+this.B.bottom),!this.$d||this.Id?(s[0]=e[0]+t,s[1]=e[1]+t):(s[0]=(s[0]||e[0])+i,s[1]+=t),!this.Dd||this.Id?(s[2]=e[2]+i,s[3]=e[3]+i):(s[2]=(s[2]||e[2])+i,s[3]+=i),s}}),Rn=(F.protoUI(Hn,Qi.view),{name:"multiview",defaults:{animate:{}},setValue:function(t){ai(t).show()},getValue:function(){return this.getActiveId()},$init:function(){this.ku=0,this.il=1,this.zt.style.position="relative",this.zt.className+=" webix_multiview",this.Ad=[]},Td:function(t,i){var e=ai(t);e.Fd||(e.zd=[],e.Fd={}),e.Fd[i]||(e.Fd[i]=!0,e.zd.push(i))},Pd:function(t){var i=ai(t);if(this.B.keepViews&&(i.zt.style.display=""),this.Ad[this.Ad.length-2]!=t?(10==this.Ad.length&&this.Ad.splice(0,1),this.Ad.push(t)):this.Ad.splice(this.Ad.length-1,1),i.Fd){for(var e=0;e<i.zd.length;e++){var s=ai(i.zd[e]);s&&s.render()}i.zd=[],i.Fd={}}},addView:function(t,i){var e=!z(i)&&i<=this.ku?1:0,s=Sn.api.addView.apply(this,arguments);return 1<this.ai.length&&(this.B.keepViews?ai(s).zt.style.display="none":vt(ai(s).zt),this.ku+=e),s},Tt:function(t){if(!t.B.borderless){var i=l(this.B.Dt);t.B.Dt=i;var e=t.zt.style;e.borderTopWidth=e.borderBottomWidth=e.borderLeftWidth=e.borderRightWidth="1px",this.ul(e,i)}Sn.api.Tt.apply(this,arguments)},sl:function(t){if(t==this.ku){
var i=t?t-1:1;this.ai[i]&&(this.Vd=null,this.ke(this.ai[i],!1))}t<this.ku&&this.ku--},Ri:function(){},Zf:function(t){t=t||this.el;for(var i=0;i<t.length;i++)t[i].Dt=this.B.borderless?{top:1,left:1,right:1,bottom:1}:this.B.Dt||{};Sn.api.Zf.call(this,t);for(var e=1;e<this.ai.length;e++)this.B.keepViews?this.ai[e].zt.style.display="none":vt(this.ai[e].zt);for(var s=0;s<t.length;s++){var n=this.ai[s];n.ai&&!n.Hl||(this.ul(n.zt.style,n.B.Dt),n.zt.setAttribute("role","tabpanel"))}this.Pd(this.getActiveId())},cells_setter:function(t){t&&t.length,this.el=t},Hd:function(t,i){var e=(this.B.animate||{}).direction,s="top"==e||"bottom"==e;return t<i?s?"bottom":"right":s?"top":"left"},ke:function(t,i){var e=this,s=arguments,n=this.getParentView();if(n&&n.getTabbar){var r=n.getTabbar();r.blockEvent(),r.setValue(t.B.$id||t.B.id),r.unblockEvent()}if(this.Vd)return this.Vd.then(function(){return e.ke.apply(e,s)});for(var h=-1,o=0;o<this.ai.length;o++)if(this.ai[o]==t){h=o;break}if(!(h<0||h==this.ku)){var a=this.ai[this.ku],u=this.ai[h];if(a.$getSize(0,0),(i||void 0===i)&&ne.isSupported()&&this.B.animate){var c=F.extend({},this.B.animate);this.B.keepViews&&(c.keepViews=!0),c.direction=this.Hd(h,this.ku),c=Li.ji(i||{},c);var f=ne.formLine(u.zt,a.zt,c);u.$getSize(0,0),u.$setSize(this.xe,this.Me);var l=c.callback;c.callback=function(){ne.breakLine(f,this.B.keepViews),this.Vd=null,c.wait_animation.resolve(),l&&l.call(this),l=c.master=c.callback=null,this.resize()},(c.master=this).ku=h,this.Pd(this.getActiveId()),ne(f,c),this.Vd=c.wait_animation=m.defer()}else this.B.keepViews?a.zt.style.display="none":(vt(a.zt),this.zt.appendChild(this.ai[o].zt)),this.ku=h,this.resizeChildren(),this.Pd(this.getActiveId());u.callEvent&&(u.callEvent("onViewShow",[]),_i(u,this.$e)),this.callEvent("onViewChange",[a.B.id,u.B.id])}},$getSize:function(t,i){if(!this.ai.length)return Ki.api.$getSize.call(this,0,0);var e=this.ai[this.ku].$getSize(0,0);if(this.B.fitBiggest)for(var s=0;s<this.ai.length;s++)if(s!=this.ku)for(var n=this.ai[s].$getSize(0,0),r=0;r<4;r++)e[r]=Math.max(e[r],n[r]);var h=Ki.api.$getSize.call(this,0,0);return 1e5<=h[1]&&(h[1]=0),1e5<=h[3]&&(h[3]=0),h[0]=(h[0]||e[0])+t,h[1]=(h[1]||e[1])+t,h[2]=(h[2]||e[2])+i,h[3]=(h[3]||e[3])+i,h},$setSize:function(t,i){this.ai.length&&(this.Qf=[t,i],Ki.api.$setSize.call(this,t,i),this.ai[this.ku].$setSize(t,i))},isVisible:function(t,i){return i&&i!=this.getActiveId()?(t&&this.Td(i,t),!1):Qi.api.isVisible.call(this,t,this.B.id)},getActiveId:function(){return this.ai.length?this.ai[this.ku].B.id:null},back:function(t){if(t=t||1,this.callEvent("onBeforeBack",[this.getActiveId(),t])){if(this.Ad.length>t){var i=this.Ad[this.Ad.length-t-1];return ai(i).show(),i}return null}return null},hl:function(t,i){!this.B.keepViews&&i&&i!=this.ai[this.ku]||Sn.api.hl.call(this,t,i)}}),Bn=(F.protoUI(Rn,Sn.view),{name:"tabview",setValue:function(t,i){this.ai[0].setValue(t,i)},getValue:function(){return this.ai[0].getValue()},getTabbar:function(){return this.ai[0]},getMultiview:function(){return this.ai[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.Rd);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"+$()),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 r={view:"tabbar",multiview:!0},h={view:"multiview",cells:i,animate:!!t.animate};t.value&&(r.value=t.value),t.tabbar&&F.extend(r,t.tabbar,!0),t.multiview&&F.extend(h,t.multiview,!0),r.options=r.options||e,t.rows=[r,h],delete t.cells,delete t.tabs},Rd:function(){this.getTabbar().attachEvent("onOptionRemove",function(t){var i=ai(t);if(i){var e=i.getParentView();e&&e.removeView(i)}})}}),En=(F.protoUI(Bn,An.view),{name:"carousel",defaults:{scrollSpeed:"300ms",type:"clean",navigation:{},animate:!0},$init:function(){this.zt.className+=" webix_carousel",this.Bd=null
,this.tt=null,this.ku=0,this.$ready.unshift(this.Ed),this.$ready.push(this.Mr)},addView:function(t,i){var e=this.Bd.addView(t,i);return this.jd(),e},removeView:function(t){this.Bd.removeView(t),this.jd()},Tt:function(t,i){this.Bd.Tt(t,i),this.jd()},jd:function(){this.ai=this.Bd.ai,this.mu(),this.setActiveIndex(Math.min(this.ku,this.ai.length-1))},Ed:function(){var i=this;this.Bd&&this.Bd.destructor&&this.Bd.destructor();var t="";this.config.cols?(t="cols",this.il=0):(t="rows",this.il=1);var e={borderless:!0,type:"clean"};e[t]=S(this.B[t]);for(var s=["type","margin","marginX","marginY","padding","paddingX","paddingY"],n={},r=0;r<s.length;r++)this.B[s[r]]&&(n[s[r]]=this.B[s[r]]);F.extend(e,n,!0),(ei.mt=this).Bd=ni.Ht(e),this.zt.appendChild(this.Bd.zt),this.ai=this.Bd.ai,this.Bd.ke=k(En.ke,this),this.Bd.adjustScroll=k(En.adjustScroll,this);var h=y("onReconstruct",function(t){t==i.Bd&&i.Ld()});this.attachEvent("onDestruct",function(){V(h)}),this.Ui=this.zt.firstChild},De:function(t,i){this.B.navigation.items&&"tab"===i.target.getAttribute("role")&&this.vu(t,i),Ki.api.De.call(this,t,i)},getChildViews:function(){return[this.Bd]},getLayout:function(){return this.Bd},Mr:function(){this.Ui.setAttribute("touch_scroll",this.il?"y":"x"),this.Bd.attachEvent("onAfterScroll",k(function(){this.callEvent("onShow",[this.getActiveId()])},this)),_i(this.Bd,function(t){t.zt.setAttribute("role","tabpanel")})},adjustScroll:function(t){var i,e=this.il?this.Me:this.xe;return this.il?(i=Math.round(t.f/e),t.f=i*e):(i=Math.round(t.e/e),t.e=i*e),this.ku=-i,this.B.navigation&&this.bu(),!0},ke:function(t){var i,e,s,n,r,h;for(s=-1,e=this.Bd,i=0;i<e.ai.length;i++)if(e.ai[i]==t){s=i;break}s<0||s==this.ku||(this.ku=s,n=e.il?this.Me:this.xe,r=-(e.il?0:s*n),h=-(e.il?s*n:0),this.scrollTo(r,h),this.callEvent("onShow",[e.ai[this.ku].B.id]),this.B.navigation&&this.mu())},scrollTo:function(t,i){ue&&ne.isSupported()&&this.B.animate?ue.xs(this.Ui,t,i,this.B.scrollSpeed||"100ms"):(this.Ui.style.marginLeft=t+"px",this.Ui.style.marginTop=i+"px")},navigation_setter:function(t){return this.ji(t,{type:"corner",buttons:!0,items:!0}),t},showNext:function(){this.ku<this.Bd.ai.length-1&&this.setActiveIndex(this.ku+1)},showPrev:function(){0<this.ku&&this.setActiveIndex(this.ku-1)},setActiveIndex:function(t){this.Bd.ai.length,ai(this.Bd.ai[t].B.id).show()},getActiveIndex:function(){return this.ku},$getSize:function(t,i){var e=this.Bd.$getSize(0,0),s=Qi.api.$getSize.call(this,t,i);return this.Bd.il?(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.Bd,s=e.ai.length,n=Qi.api.$setSize.call(this,t,i),r=this.Me*(e.il?s:1),h=this.xe*(e.il?1:s);n?(this.Ui.style.height=r+"px",this.Ui.style.width=h+"px",e.$setSize(h,r),this.Ld()):e.$setSize(h,r)},Ld:function(){var t=this.Bd,i=this.ku||0,e=t.il?this.Me:this.xe,s=-(t.il?0:i*e),n=-(t.il?i*e:0);this.scrollTo(s,n),this.B.navigation&&this.mu()},getActiveId:function(){var t=this.Bd.ai[this.ku];return t?t.B.id:null},setActive:function(t){ai(t).show()}}),jn=(F.protoUI(En,b,Ze,Qi.view),{name:"proxy",body_setter:function(t){return(ei.mt=this).$t=ni.Ht(t),this.zt.appendChild(this.$t.zt),t},getChildViews:function(){return[this.$t]},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i),this.$t.$setSize(this.$width,this.$height)},$getSize:function(t,i){var e=Qi.api.$getSize.call(this,t,i),s=this.$t.$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},Tt:function(t){this.$t.destructor(),this.$t=t,this.zt.appendChild(t.zt),this.resize()}});F.protoUI(jn,Qi.view);F.protoUI({name:"portlet",defaults:{template:"GPL version doesn't support portlet <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"dashboard",defaults:{template:"GPL version doesn't support dashboard <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"panel",defaults:{template:"GPL version doesn't support panel <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"abslayout",defaults:{
template:"GPL version doesn't support abslayout <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"gridlayout",defaults:{template:"GPL version doesn't support gridlayout <br> You need Webix PRO"}},Cn.view);var Ln={$init:function(){F.extend(this,Oe,!0)},name:"flexlayout"};F.protoUI(Ln,An.view);F.protoUI({name:"flexdatalayout",defaults:{template:"GPL version doesn't support flexdatalayout <br> You need Webix PRO"}},Cn.view);var On={name:"popup",$init:function(){var i=this;this.B.head=!1,this.$view.className+=" webix_popup";var t=y("onClick",function(t){return i.Ri(t)});this.attachEvent("onDestruct",function(){V(t)}),this.attachEvent("onHide",this.Bn)},$skin:function(){be.api.$skin.call(this),this.defaults.padding=re.popupPadding,this.defaults.point=!re.popupNoPoint,this.defaults.borderless=re.borderlessPopup},close:function(){vt(this.Od),be.api.close.call(this)},$getSize:function(t,i){return be.api.$getSize.call(this,t+2*this.B.padding,i+2*this.B.padding)},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i),t=this.xe-2*this.B.padding,i=this.Me-2*this.B.padding,this.Ui.style.padding=this.B.padding+"px",this.mn.style.display="none",this.$t.$setSize(t,i)},Yn:function(t){"undefined"==typeof t.borderless&&(t.borderless=!1)},head_setter:function(){},Rn:function(t,i,e,s){this.Bn(),document.body.appendChild(this.Od=lt("DIV",{"class":"webix_point_"+t},"")),this.Od.style.zIndex=this.zt.style.zIndex,this.Od.style.position=s?"fixed":"absolute",this.Od.style.top=e+"px",this.Od.style.left=i+"px"},Bn:function(){this.Od=vt(this.Od)}},Nn={api:On,view:F.protoUI(On,be.view)},Wn={name:"toolbar",defaults:{type:"toolbar"},Hl:!0,Nd:"webix_toolbar",Wd:!1,$init:function(t){t.borderless||(this.Ui.style.borderWidth="1px",this.B.Dt={top:!1,left:!1,right:!1,bottom:!1}),this.Ui.className+=" "+this.Nd,this.zt.setAttribute("role","toolbar")},ue:function(){var i=this;i.elements={},_i(this,function(t){if(t.B.name&&t.getValue&&t.setValue&&(i.elements[t.B.name]=t).mapEvent&&t.mapEvent({onbeforetabclick:i,onaftertabclick:i,onitemclick:i,onchange:i}),t.setValues||t.ol)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))}},al:function(){this.ue()},zl:function(t){var i=this.B;return i.elements&&!t&&(this.el=t=i.elements,this.il=this.Wd,delete i.elements),this.B.elementsConfig&&this.Yd(this.el,i.elementsConfig),t},Yd:function(t,i){for(var e=0;e<t.length;e++){var s=t[e];F.extend(s,i);var n,r=i;s.elementsConfig&&(r=F.extend(F.extend({},s.elementsConfig),i)),(n=s.body?[s.body]:s.rows||s.cols||s.cells||s.body)&&this.Yd(n,r)}},$getSize:function(t,i){var e=An.api.$getSize.call(this,t,i),s=this.getParentView(),n=this.il?3:1;return s&&this.il!=s.il&&(e[n]+=1e5),e},render:function(){},refresh:function(){this.render()}},Yn={api:Wn,view:F.protoUI(Wn,ss,Rt,zs,An.view,$e)},Un={name:"form",defaults:{type:"form",autoheight:!0},Ud:-1,Nd:"webix_form",Wd:!0,$init:function(){this.zt.setAttribute("role","form")},$getSize:function(t,i){this.ye&&!this.B.width&&(t+=G.scrollSize);var e=An.api.$getSize.call(this,t,i);return!this.B.scroll&&this.B.autoheight||(e[2]=this.B.height||this.B.minHeight||0,e[3]=this.B.height||1e5),e}},qn=(F.protoUI(Un,Yn.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.zt.className+=" "+i,this.zt.innerHTML="<fieldset><legend class='"+i+"_label"+(t.required?" webix_required":"")+"'></legend><div class='"+i+"_body'></div></fieldset>"},label_setter:function(t){return this.zt.firstChild.childNodes[0].innerHTML=t},getChildViews:function(){return[this.qd]},body_setter:function(t){return(ei.mt=this).qd=ni(t,this.zt.firstChild.childNodes[1]),t},getBody:function(){return this.qd},resizeChildren:function(){if(this.qd){var t=this.$width-this.B.paddingX,i=this.$height-this.B.paddingY,e=this.qd.$getSize(0,0);e[0]>t&&(t=e[0]),e[2]>i&&(i=e[2]),this.qd.$setSize(t,i),this.resize()}},$getSize:function(t,i){t+=this.B.paddingX,i+=this.B.paddingY;var e=this.qd.$getSize(t,i),
s=this.Gd=Qi.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){Qi.api.$setSize.call(this,t,i)&&(t=Math.min(this.Gd[1],t),i=Math.min(this.Gd[3],i),this.qd.$setSize(t-this.B.paddingX,i-this.B.paddingY))}}),Gn={api:qn,view:F.protoUI(qn,Qi.view)},Xn={name:"forminput",defaults:{$cssName:"webix_forminput",labelWidth:80,labelAlign:"left",paddingY:0,paddingX:0},setValue:function(t,i){this.qd.setValue?this.qd.setValue(t,i):this.qd.setValues&&this.qd.setValues(t,!1,i)},focus:function(){return!!this.qd.focus&&this.qd.focus()},getValue:function(){return this.qd.getValue?this.qd.getValue():this.qd.getValues?this.qd.getValues():void 0},getBody:function(){return this.qd},$skin:function(){this.Xd=re.inputPadding,this.Kd=re.inputSpacing,this.Jd=re.labelTopHeight},$init:function(){this.$ready.push(function(){var t=this.zt.firstChild.childNodes[0],i=this.zt.firstChild.childNodes[1],e=this.B;if("top"!=e.labelPosition?(e.labelWidth=e.label?this.Zd(e.labelWidth,e.label):0,e.paddingX=e.labelWidth+this.Kd):(e.paddingY=this.Jd,e.paddingX=this.Kd),!e.label||!e.labelWidth&&"top"!=e.labelPosition)return t.style.display="none",i.style.padding="0 "+this.Kd/2+"px",e.paddingX=this.Kd,void(e.paddingY=0);"top"==e.labelPosition?(t.style.lineHeight=this.Jd-this.Xd+"px",t.className+=" "+this.defaults.$cssName+"_label_top",i.style.padding="0 "+this.Kd/2+"px"):t.style.width=e.paddingX-this.Kd/2+"px",t.style.textAlign=e.labelAlign,e.value&&this.setValue(e.value,"auto")})},Zd:function(t,i){return"auto"==t&&(t=kt(i,"webix_inp_label").width),t?Math.max(t,re.dataPadding):0},setBottomText:function(t){var i=this.B;if(void 0!==t){if(i.bottomLabel==t)return;i.bottomLabel=t}var e=(i.invalid?i.invalidMessage:"")||i.bottomLabel;this.Qd&&vt(this.Qd),e&&(this.$view.style.position="relative",this.Qd=lt("div",{"class":"webix_inp_bottom_label",role:i.invalid?"alert":"","aria-relevant":"all",style:"position:absolute; bottom:0px; padding:2px 0; background: white; left:"+(this.Kd/2+(i.label?i.labelWidth:0))+"px; "},e),this.zt.appendChild(this.Qd))}};F.protoUI(Xn,Gn.view);function Kn(t){return t.tagName?t.tagName.toLowerCase():null}function Jn(t,i){if(!t.getAttribute)return null;var e=t.getAttribute(i);return e?e.toLowerCase():null}function Zn(){var t=Kn(this);return Qn[t]?Qn[t](this):Qn.other(this)}var Qn={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"===Jn(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 tr(t){var i=Kn(this);return ir[i]?ir[i](this,t):ir.other(this,t)}var ir={radio:function(t,i){for(var e=0;e<t.length;e++)t[e].checked=t[e].value==i},input:function(t,i){"checkbox"===Jn(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}},er={name:"htmlform",$init:function(t){this.elements={},this.tv=!1,t.content&&(t.container==t.content||!t.container&&t.content==document.body)&&(this.iv=!0)},content_setter:function(t){if(t=D(t),this.iv)for(;1<t.childNodes.length;)this.zt.childNodes[0].appendChild(t.childNodes[0]);else this.zt.childNodes[0].appendChild(t);return this.ev(),!0},render:function(){Cn.api.render.apply(this,arguments),this.ev()},ev:function(){var t=this.zt.querySelectorAll("[name]");this.elements={};for(var i=0;i<t.length;i++){var e=t[i],s=Jn(e,"name");if(s){var n="button"===Kn(e),r=Jn(e,"type"),h=n||"button"===r||"submit"===r;if("radio"===r){var o=this.elements[s]||[];o.tagName="radio",o.push(e),e=o}(this.elements[s]=e).getValue=Zn,e.setValue=tr,e.$allowsClear=!h}}return this.elements},xr:function(t,i){this.mr(t,i);var e=this.zt.querySelector('[name="'+t+'"]');e&&Mt(e,"invalid")},mr:function(t){var i=this.zt.querySelector('[name="'+t+'"]');i&&St(i,"invalid")},focus:function(t
){if(!t&&this.$view.contains(document.activeElement))return!1;zs.focus.apply(this,arguments)}},sr=(F.protoUI(er,Cn.view,zs),{name:"property",$init:function(){this.Ui.className+=" webix_property",this.Ui.setAttribute("role","listbox"),this.Vt=[],this.attachEvent("onAfterEditStart",function(t){Mt(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:{password:function(t){return t||0===t?"•".repeat(t.toString().length):""},checkbox:function(t){return"<input type='checkbox' class='webix_property_check' "+(t?"checked":"")+">"},color:function(t){return"<div class='webix_property_col_ind' style='background-color:"+(t||"#FFFFFF")+";'></div>"+t}},on_edit:{label:!1},_id:"webix_f_id",on_click:{webix_property_check:function(t){var i=this.locate(t),e=this.getItem(i);return this.callEvent("onCheck",[i,e.value=!e.value]),!1}},on_dblclick:{},registerType:function(t,i){if(z(i.template)||(this.on_render[t]=i.template),z(i.editor)||(this.on_edit[t]=i.editor),!z(i.click))for(var e in i.click)this.on_click[e]=i.click[e]},elements_setter:function(t){this.sv={};for(var i=0;i<t.length;i++){var e=t[i];"multiselect"==e.type&&(e.optionslist=!0),e.id=e.id||$(),e.label=e.label||"",e.value=e.value||"",this.sv[e.id]=i,this.Xa(t[i])}return t},showItem:function(t){es.showItem.call(this,t)},locate:function(){return pt(arguments[0],this._id)},getItemNode:function(t){return this.tt.childNodes[this.sv[t]]},getItem:function(t){return this.B.elements[this.sv[t]]},Uo: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)},Ko:function(t){return this.getItem(t)},ra:function(t,i,e){var s=this.sv[t.id],n=this.B.elements;if(e){for(var r=s+1;r<n.length;r++)if(i.call(this,n[r].id))return n[r].id}else for(var h=s-1;0<=h;h--)if(i.call(this,n[h].id))return n[h].id;return null},updateItem:function(t,i){var e=this.getItem(t);e&&F.extend(e,i||{},!0),this.refresh()},at:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft+this.B.nameWidth,top:i.offsetTop,height:i.firstChild.offsetHeight,width:this.nv,parent:this.Ui}},rv:function(){for(var t=this.B.elements,i=0;i<t.length;i++)t[i].value=""},clear:function(){this.rv(),this.hv={},this.refresh()},setValues:function(t,i){var e=this;for(var s in this.B.complexData&&(t=Bt.collapseNames(t,"",{},function(t){return z(e.sv[t])})),i||this.rv(),t){var n=this.getItem(s);n&&(n.value=t[s])}this.hv=t,this.refresh()},getValues:function(){for(var t=l(this.hv||{}),i=0;i<this.B.elements.length;i++){var e=this.B.elements[i];"label"!=e.type&&(t[e.id]=e.value)}return this.B.complexData&&(t=Bt.expandNames(t)),t},refresh:function(){this.render()},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i)&&(this.nv=this.xe-this.B.nameWidth,this.render())},$getSize:function(t,i){if(this.B.autoheight){var e=this.B.elements.length;this.B.height=Math.max(this.type.height*e,this.B.minHeight||0)}return Qi.api.$getSize.call(this,t,i)},Q:function(){var t=[],i=this.B.elements;if(i)for(var e=0;e<i.length;e++){var s=i[e];s.css&&"object"==M(s.css)&&(s.css=ut(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 r,h=this.on_render[s.type],o="<div class='webix_property_label' style='width:"+this.B.nameWidth+"px'>"+s.label+"</div><div class='webix_property_value' style='width:"+this.nv+"px'>";r=s.collection||s.options?s.template(s):s.format?s.format(s.value):s.value,h&&(r=h.call(this,s.value,s)),t[e]=n+o+r+"</div></div>"}}return t.join("")},type:{height:24,templateStart:qt(""),templateEnd:qt("</div>")},$skin:function(){this.type.height=re.propertyItemHeight}}),nr=(F.protoUI(sr,ee,Le,Ke,Je,ss,te,Rt,b,Qi.view),{name:"calendar",defaults:{date:new Date,navigation:!0,monthSelect:!0,weekHeader:!0,monthHeader:!0,weekNumber:!1,skipEmptyWeeks:!1,calendarHeader:"%F %Y",
events:rn.isHoliday,minuteStep:5,timeIcon:"wxi-clock",icons:!1,timepickerHeight:30,headerHeight:30,dayTemplate:function(t){return t.getDate()},width:260,height:250},dayTemplate_setter:qt,calendarHeader_setter:rn.dateToStr,calendarTime_setter:function(t){return this.ov=t,rn.dateToStr(t)},date_setter:function(t){return this.av(t)},maxDate_setter:function(t){return this.av(t)},minDate_setter:function(t){return this.av(t)},minTime_setter:function(t){return"string"==typeof t&&(t=[(t=P.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},maxTime_setter:function(t){return"string"==typeof t&&(t=[(t=P.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},uv:function(){var t="focus"+(G.isIE?"in":"");G.touch||Zt(this.$view,t,k(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-ji.li&&100<new Date-ji.di&&e){var s=t.relatedTarget;if(s&&!z(s.className)){var n="webix_cal_day"==e?this.cv(t.target):this.fv(t.target);this.ya(n)}}},this),{capture:!G.isIE})},$init:function(){this.zt.className+=" webix_calendar",this.zt.setAttribute("role","region"),this.zt.setAttribute("aria-label",P.aria.calendar),this.lv={},this.dv={},this.vv=0,this.uv(),this.attachEvent("onKeyPress",this.De)},minuteStep_setter:function(t){return Math.max(Math.min(t,60),this.defaults.minuteStep)},type_setter:function(t){return"time"==t?(this._v=!0,this.vv=-1):"year"==t&&(this.pv=!0),t},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i)&&this.render()},$getSize:function(t,i){var e=this.B;if(e.cellHeight&&!e.type){var s=this.mv(e.date);e.height=e.cellHeight*s.bv+e.headerHeight+(e.weekHeader?re.calendarWeekHeaderHeight:0)+(e.timepicker||this.gv?e.timepickerHeight:0)+2*(this.wv+re.borderWidth)}return Qi.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=rn.copy(s||this.getVisibleDate());this.ya(n,t,e)}},ya:function(t,i,e){var s=this.yv[this.vv].xv(t,i,this);if(!1!==e){var n=this.zt.querySelector("."+s+"[tabindex='0']");n&&n.focus()}},mv:function(t,i){if(!this.Mv||i){var e=t.getMonth(),s=t.getFullYear(),n=new Date(s,e+1,1),r=rn.weekStart(new Date(s,e,1)),h=Math.round((n.valueOf()-r.valueOf())/864e5),o=this.B.skipEmptyWeeks?Math.ceil(h/7):6;this.Mv={Sv:e,kv:r,yl:n,bv:o}}return this.Mv},$skin:function(){re.calendar&&(re.calendar.width&&(this.defaults.width=re.calendar.width),re.calendar.height&&(this.defaults.height=re.calendar.height),re.calendar.headerHeight&&(this.defaults.headerHeight=re.calendar.headerHeight),re.calendar.timepickerHeight&&(this.defaults.timepickerHeight=re.calendar.timepickerHeight)),this.wv=re.layoutPadding.form},Cv:function(t){for(var i=this.mv(t),e=this.B,s=[],n=[],r=Infinity,h=this.xe-2*(this.wv+re.borderWidth),o=this.Me-(e.monthHeader?e.headerHeight:0)-(e.weekHeader?re.calendarWeekHeaderHeight:0)-(e.timepicker||this.gv?e.timepickerHeight:0)-2*(this.wv+re.borderWidth),a=e.weekNumber?8:7,u=0;u<a;u++)n[u]=Math.ceil(h/(a-u)),h-=n[u],r=Math.min(r,n[u]);for(var c=i.bv,f=0;f<c;f++)s[f]=Math.ceil(o/(c-f)),o-=s[f],r=Math.min(r,s[f]);return[n,s,r]},icons_setter:function(t){t?"object"==M(t)?this.gv=t:this.gv=this.$v:this.gv=null},gv:[],$v:[{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+P.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date;this.B.timepicker||(t=rn.datePart(t)),this.setValue(t,"user"),this.callEvent("onTodaySet",[this.getSelectedDate()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+P.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue("","user"),this.callEvent("onDateClear",[this.getSelectedDate()])}}}],refresh:function(){this.render()},render:function(){this.vv=0,this.Dv=!1;var t=this.B;if(this.isVisible(t.id)){this.Iv=rn.datePart(new Date),this.callEvent("onBeforeRender",[]);var i=this.B.date,e=this.mv(i,!0),s=this.Cv(i),n=this.wv+"px",r=s[0],h=s[1],o=""
;if(t.monthHeader&&(o+="<div class='webix_cal_month' style='margin:0 "+n+"'><span aria-live='assertive' aria-atomic='true' class='webix_cal_month_name"+(t.monthSelect&&t.navigation?"' role='button' tabindex='0'":" webix_readonly'")+">"+t.calendarHeader(i)+"</span>",t.navigation&&(o+="<div role='button' tabindex='0' aria-label='"+P.aria.navMonth[0]+"' class='webix_cal_prev_button'></div><div role='button' tabindex='0' aria-label='"+P.aria.navMonth[1]+"' class='webix_cal_next_button'></div>"),o+="</div>"),t.weekHeader&&(o+="<div class='webix_cal_header' style='margin:0 "+n+"' aria-hidden='true'>"+this.Av(r)+"</div>"),o+="<div class='webix_cal_body' style='margin:0 "+n+"'>"+this.Tv(r,h,e,s[2])+"</div>",(this.B.timepicker||this.gv)&&(o+="<div class='webix_cal_footer' style='margin:0 "+n+"'>",this.B.timepicker&&(o+=this.Fv(i)),this.gv&&(o+=this.zv()),o+="</div>"),this.Ui.innerHTML=o,this.Ui.firstChild.style.marginTop=n,"time"==this.B.type){var a=this.B.date;a&&("string"==typeof a?i=P.parseTimeFormatDate(a):I(a)&&(i.setHours(a[0]),i.setMinutes(a[1]))),this.Pv(-1,i)}else"month"==this.B.type?this.Pv(1,i):"year"==this.B.type&&this.Pv(2,i);this.pe(),this.callEvent("onAfterRender",[])}},zv:function(t){for(var i="<div class='webix_cal_icons'>",e=this.gv,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&&F.extend(this.on_click,e[s].on_click)}return i+="</div>"},Fv:function(t){var i=this.B.calendarTime||P.timeFormatStr,e=this.B.timeIcon,s="";if(this.B.master){var n=S(ai(this.B.master).B.value);for(var r in rn.equal(n.end,t)&&(n.start=n.end),n)s+="<div role='button' tabindex='0' class='webix_range_time_"+r+" webix_cal_time'><span class='webix_icon "+e+"'></span> "+i(n[r])+"</div>"}else s="<div role='button' tabindex='0' class='webix_cal_time"+(this.gv?" webix_cal_time_icons":"")+"'><span class='webix_icon "+e+"'></span> "+i(t)+"</div>";return s},Av:function(t){var i=this.B,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=rn.startOnMonday?1:0,r=0;r<7;r++){var h=(n+r)%7,o=P.calendar.dayShort[h];e+="<div day='"+h+"' style='width: "+t[r+s]+"px;' >"+o+"</div>"}return e},blockDates_setter:function(t){return v(t,this.$scope)},Vv:function(t,i){var e="",s=!1;return rn.equal(t,this.Iv)&&(e+=" webix_cal_today"),this.Hv(t)||(e+=" webix_cal_day_disabled"),t.getMonth()!=i.Sv&&(s=!0,e+=" webix_cal_outside"),!s&&this.Rv(t)&&(e+=" webix_cal_select"),this.B.events&&(e+=" "+(this.B.events(t,s)||"")),e+=" webix_cal_day"},Tv:function(t,i,e,s){for(var n=this.B,r="",h=rn.datePart(rn.copy(e.kv)),o=n.weekNumber?1:0,a=rn.getISOWeek(rn.add(h,2,"day",!0)),u=0;u<i.length;u++){r+="<div class='webix_cal_row' style='height:"+i[u]+"px;line-height:"+i[u]+"px'>",o&&(!h.getMonth()&&h.getDate()<7&&(a=rn.getISOWeek(rn.add(h,2,"day",!0))),r+="<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.Vv(h,e),l=this.B.dayTemplate.call(this,h),d=this.Rv(h),v="",_=h.getMonth()!=e.Sv;"object"==M(l)?(v=l.aria||v,l=l.text):v=rn.dateToStr(P.aria.dateFormat)(h),r+="<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.Bv(s,s)+"'>"+l+"</span></div>",(h=rn.add(h,1,"day")).getHours()&&(h=rn.datePart(h))}r+="</div>",a++}return r},Ev:function(t,i){var e=this.B.date;i||(i=this.yv[this.vv].jv),this.vv||(e=rn.copy(e)).setDate(1);var s=rn.add(e,t*i,"month",!0);this.Lv(e,s)},Lv:function(t,i){this.callEvent("onBeforeMonthChange",[t,i])&&(this.vv?this.Ov(i):this.showCalendar(i),this.callEvent("onAfterMonthChange",[i,t]))},yv:{"-2":{Nv:function(t){var i=this.B,e=i.date,s=!1,n=i.minTime?i.minTime[0]:0,r=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24,h=i.minTime&&e.getHours()==n?i.minTime[1]:0,
o=i.maxTime&&i.maxTime[1]&&e.getHours()==r-1?i.maxTime[1]:60;if(this.B.blockTime){var a=rn.copy(e);a.setMinutes(t),s=this.B.blockTime(a)}return t<h||o<=t||s},Wv:function(t,i){t.setMinutes(i)},Yv:function(t,i,e){if(!this.Nv.call(e,t.getMinutes()))return t;var s=e.B.minuteStep,n=rn.add(t,"right"==i?s:-s,"minute",!0);return t.getHours()===n.getHours()?this.Yv(n,i,e):void 0}},"-1":{Nv:function(t){var i=this.B,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 r=rn.copy(e);r.setHours(t);for(var h=i.minTime&&t==s?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&t==n-1?i.maxTime[1]:60,a=h;a<o;a+=i.minuteStep)if(r.setMinutes(a),!i.blockTime(r))return!1;return!0}},Wv:function(t,i){t.setHours(i)},xv:function(t,i,e){var s,n,r=e.B.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?r:-r,"left"===i&&t.getMinutes()<r&&(n=60-r),"right"===i&&t.getMinutes()>=60-r&&(n=r-60),n-=t.getMinutes()%r,s=e.yv[-2].Yv(rn.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.Yv(rn.add(t,n,"hour"),i,e)):!1===i&&(s=this.Yv(t,i,e)),e.selectDate(s,!1,!1,"user"),s&&(e.Ov(s),e.selectDate(s,!1,!1,"user")),"webix_cal_block"+("left"===i||"right"===i?"_min":"")},Yv:function(t,i,e){if(!this.Nv.call(e,t.getHours()))return t;var s=rn.add(t,"down"==i?1:-1,"hour",!0);return t.getDate()===s.getDate()?this.Yv(s,i,e):void 0}},0:{jv:1,xv:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=rn.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=rn.add(t,"right"===i?1:-1,"day"):"up"!==i&&"down"!==i||(s=rn.add(t,"down"===i?1:-1,"week")),e.Hv(s)||(s=e.Yv(t,i)),s&&e.selectDate(s,!0,!1,"user"),"webix_cal_day"}},1:{Nv:function(t,i){var e=!1,s=i.B.minDate,n=i.B.maxDate,r=i.B.date.getFullYear();if(s){var h=s.getFullYear();e=r<h||r==h&&s.getMonth()>t}if(n&&!e){var o=n.getFullYear();e=o<r||r==o&&n.getMonth()<t}return e},$f:function(t,i){return(t=rn.monthStart(t))<i.B.minDate?t=rn.copy(i.B.minDate):t>i.B.maxDate&&(t=rn.copy(i.B.maxDate)),t},Uv:function(t){return t.getFullYear()},qv:function(t){return P.calendar.monthShort[t]},Wv:function(t,i){i!=t.getMonth()&&t.setDate(1),t.setMonth(i)},jv:12,xv:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=rn.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=rn.add(t,"right"===i?1:-1,"month"):"up"!==i&&"down"!==i||(s=rn.add(t,"down"===i?4:-4,"month")),s=e.$f(s),e.Hv(s)||(s=e.Yv(t,i)),s&&(e.Ov(s),e.selectDate(s,!1,!1,"user")),"webix_cal_block"}},2:{Nv:function(t,i){t+=i.Gv;var e=i.B.minDate,s=i.B.maxDate;return!!(e&&e.getFullYear()>t||s&&s.getFullYear()<t)},$f:function(t,i){return(t=rn.yearStart(t))<i.B.minDate?t=rn.copy(i.B.minDate):t>i.B.maxDate&&(t=rn.copy(i.B.maxDate)),t},Uv:function(t,i){var e=t.getFullYear();return i.Gv=e=e-e%10-1,e+" - "+(e+10+1)},qv:function(t,i){return i.Gv+t},Wv:function(t,i,e){t.setFullYear(e.Gv+i)},jv:120,xv:function(t,i,e){var s=t;return"pgup"===i||"pgdown"===i?s=rn.add(t,"pgdown"===i?10:-10,"year"):"bottom"===i?s=new Date(t.setYear(e.Gv+10)):"top"===i?s=new Date(t.setYear(e.Gv)):"left"===i||"right"===i?s=rn.add(t,"right"===i?1:-1,"year"):"up"!==i&&"down"!==i||(s=rn.add(t,"down"===i?4:-4,"year")),s=e.$f(s),e.Hv(s)||(s=e.Yv(t,i)),s&&(e.Ov(s),e.selectDate(s,!1,!1,"user")),"webix_cal_block"}}},Xv:function(){var t;if(this.yv[-1].Nv.call(this,this.B.date.getHours()))for(t=0;t<24;t++)if(!this.yv[-1].Nv.call(this,t)){this.B.date.setHours(t);break}if(this.yv[-2].Nv.call(this,this.B.date.getMinutes()))for(t=0;t<60;t+=this.B.minuteStep)if(!this.yv[-2].Nv.call(this,t)){this.B.date.setMinutes(t);break}},Ov:function(t){var i,e,s,n,r,h,o,a,u,c,f,l,d="",v=this.wv+"px";if(r=2-((i=this.B).weekHeader?0:1)-(i.monthHeader?0:1),c=this.yv[this.vv],
h=this.Ui.childNodes,t&&(i.date=t),a=i.type,this.Dv||(this.Kv=this.Ui.offsetHeight-(i.monthHeader||this._v?i.headerHeight:0)-2*(this.wv+re.borderWidth),"year"!=a&&"month"!=a&&(this.Kv-=i.timepickerHeight),this.Jv=h[r].offsetWidth,this.Dv=1),this._v){s=this.Kv/6;var _=6,p=(this.ov||P.timeFormat).match(/%([a,A])/);for(p&&_++,u=parseInt((this.Jv-3)/_,10),l=Math.min(u,s),d+="<div class='webix_time_header' style='margin:0 "+v+"'>"+this.Zv(u,p)+"</div>",d+="<div class='webix_cal_body' style='height:"+this.Kv+"px; margin:0 "+v+";'>",this.Xv(),d+="<div class='webix_hours'>",o=i.date.getHours(),f=rn.copy(i.date),n=0;n<24;n++){if(e="",p&&n%4==0){var m=n?12==n?P.pm[0]:"":P.am[0];d+="<div class='webix_cal_block_empty"+e+"' style='"+this.Bv(u,s)+"clear:both;'>"+m+"</div>"}this.yv[-1].Nv.call(this,n)?e+=" webix_cal_day_disabled":o==n&&(e+=" webix_selected"),f.setHours(n),d+="<div aria-label='"+rn.dateToStr(P.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.Bv(u,s)+(n%4!=0||p?"":"clear:both;")+"'><span style='display:inline-block; "+this.Bv(l,l)+"'>"+rn.toFixed(p?n&&12!=n?n%12:12:n)+"</span></div>"}for(d+="</div>",d+="<div class='webix_minutes'>",o=i.date.getMinutes(),f=rn.copy(i.date),n=0;n<60;n+=i.minuteStep)e="",this.yv[-2].Nv.call(this,n)?e=" webix_cal_day_disabled":o==n&&(e=" webix_selected"),f.setMinutes(n),d+="<div aria-label='"+rn.dateToStr(P.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.Bv(u,s)+(n/i.minuteStep%2==0?"clear:both;":"")+"'><span style='display:inline-block; "+this.Bv(l,l)+"'>"+rn.toFixed(n)+"</span></div>";d+="</div>",d+="</div>",d+="<div class='webix_time_footer' style='margin:0 "+v+"'>"+this.Qv()+"</div>",this.Ui.innerHTML=d,this.Ui.firstChild.style.marginTop=v}else{if(i.monthHeader){var b=h[0].childNodes,g=P.aria["nav"+(1==this.vv?"Year":"Decade")];b[0].innerHTML=c.Uv(i.date,this),b[0].blur(),i.navigation&&(b[1].setAttribute("aria-label",g[0]),b[2].setAttribute("aria-label",g[1]))}else c.Uv(i.date,this);for(s=Math.floor(this.Kv/3),u=Math.floor(this.Jv/4),l=Math.min(s,u),this.Hv(i.date)&&(o=1==this.vv?i.date.getMonth():i.date.getFullYear()),n=0;n<12;n++){e=o==(1==this.vv?n:c.qv(n,this))?" webix_selected":"",c.Nv(n,this)&&(e+=" webix_cal_day_disabled");var w=P.aria[(1==this.vv?"month":"year")+"Format"];d+="<div role='gridcell' aria-label='"+rn.dateToStr(w)(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.Bv(u,s)+"'><span style='display:inline-block; "+this.Bv(l,l)+"'>"+c.qv(n,this)+"</span></div>"}i.weekHeader&&(h[r-1].style.display="none",1===r&&(h[r].style.marginTop=v)),h[r].innerHTML=d,"year"!=a&&"month"!=a?h[r+1]?h[r+1].innerHTML=this.Qv():this.Ui.innerHTML+="<div class='webix_time_footer' style='margin:0 "+v+"'>"+this.Qv()+"</div>":h[r+1]&&(h[r+1].style.display="none"),h[r].style.height=this.Kv+"px"}},Bv:function(t,i){return"width:"+t+"px; height:"+i+"px; line-height:"+i+"px;"},Qv:function(){return"<input type='button' style='width:100%' class='webix_cal_done' value='"+P.calendar.done+"'>"},Zv:function(t,i){var e=2*t;return"<div class='webix_cal_hours' style='width:"+t*(i?5:4)+"px'>"+P.calendar.hours+"</div><div class='webix_cal_minutes' style='width:"+e+"px'>"+P.calendar.minutes+"</div>"},Pv:function(t,i){var e=this.vv;this.callEvent("onBeforeZoom",[t,e])&&((this.vv=t)?this.Ov(i):this.showCalendar(i),this.callEvent("onAfterZoom",[t,e]))},$f:function(t){return!this.Hv(t)&&this.yv[this.vv].$f&&(t=this.yv[this.vv].$f(t,this)),t},t_:function(t,i){var e=this.fv(t),s=this.vv-(this.pv?0:1);if(e=this.$f(e),this.Hv(e)){this.Pv(s,e);var n=this.B.type;"month"!=n&&"year"!=n||this.i_(e,!1,i)}},i_:function(t,i,e){this.callEvent("onBeforeDateSelect",[t])&&(this.selectDate(t,!0,i,e),this.callEvent(
"onAfterDateSelect",[t]))},cv:function(t){var i=at(t)-(this.B.weekNumber?1:0),e=at(t.parentNode),s=rn.add(this.mv().kv,i+7*e,"day",!0);return this.B.timepicker&&(s.setHours(this.B.date.getHours()),s.setMinutes(this.B.date.getMinutes())),s},fv:function(t){var i=1*t.getAttribute("data-value"),e=-1!=t.className.indexOf("webix_cal_block_min")?this.vv-1:this.vv,s=this.B.date,n=rn.copy(s);return this.yv[e].Wv(n,i,this),n},on_click:{webix_cal_prev_button:function(){this.Ev(-1)},webix_cal_next_button:function(){this.Ev(1)},webix_cal_day_disabled:function(){return!1},webix_cal_outside:function(){if(!this.B.navigation)return!1},webix_cal_day:function(t,i,e){var s=this.cv(e),n="touch"===this.B.multiselect||t.ctrlKey||t.metaKey;this.i_(s,n,"user")},webix_cal_time:function(){if(this.yv[this.vv-1]){this._v=!0;var t=this.vv-1;this.Pv(t)}},webix_range_time_start:function(){ai(this.B.master).e_="start"},webix_range_time_end:function(){ai(this.B.master).e_="end"},webix_cal_done:function(){var t=rn.copy(this.B.date);t=this.$f(t),this.i_(t,!1,"user")},webix_cal_month_name:function(){if(this.B.navigation&&(this._v=!1,2!=this.vv&&this.B.monthSelect)){var t=Math.max(this.vv,0)+1;this.Pv(t)}},webix_cal_block:function(t,i,e){if(this._v){if(-1!==e.className.indexOf("webix_cal_day_disabled"))return!1;var s=this.fv(e);this.Ov(s)}else-1==e.className.indexOf("webix_cal_day_disabled")&&this.t_(e,"user")}},av:function(t,i){return t?("string"==typeof t&&(t=i?rn.strToDate(i)(t):P.parseFormatDate(t)),t):rn.datePart(new Date)},Hv:function(t){var i=this.B.blockDates&&this.B.blockDates.call(this,t),e=this.B.minDate,s=this.B.maxDate;return!i&&!(t<e||s<t)},Yv:function(t,i){var e,s="top"===i||"left"===i||"pgup"===i||"up"===i?-1:1,n=rn.add(t,s,"day",!0);return this.Hv(n)?n:(0===this.vv?e=t.getMonth()===n.getMonth():1===this.vv?e=t.getFullYear()===n.getFullYear():2===this.vv&&(e=n.getFullYear()>this.Gv&&n.getFullYear()<this.Gv+10),e?this.Yv(n,i):void 0)},showCalendar:function(t){t=this.av(t),this.B.date=t,this.render(),this.resize()},Rv:function(t){return t&&this.dv[t.valueOf()]},getSelectedDate:function(){var t=[];for(var i in this.dv)t.push(rn.copy(this.dv[i]));return this.config.multiselect?t:t[0]||null},getVisibleDate:function(){return rn.copy(this.B.date)},setValue:function(t,i){this.selectDate(t,!0,!1,i)},getValue:function(t){var i=this.getSelectedDate();return t&&(i=rn.dateToStr(t)(i)),i},selectDate:function(t,i,e,s){if(t&&e&&this.config.multiselect||(this.dv={}),t){I(t)||(t=[t]);for(var n=0;n<t.length;n++){var r=this.av(t[n]),h=rn.datePart(rn.copy(r)).valueOf();if(this.dv[h]&&e?delete this.dv[h]:this.dv[h]=r,!this.config.multiselect)break}t.length&&i&&this.showCalendar(t[0])}!1!==i&&this.render(),this.callEvent("onChange",[t,s])},locate:function(){return null}}),rr=(F.protoUI(nr,Xe,Je,Qi.view,b),{name:"colorboard",defaults:{template:function(t){return'<div class="webix_color_item" style="background-color:'.concat(t.val,';"></div>')},palette:null,height:250,width:260,cols:11,rows:10,minLightness:.15,maxLightness:1,navigation:!0,grayScale:!0,type:"material"},$init:function(){Zt(this.zt,"click",k(function(t){var i=pt(t.target.parentNode,"webix_val");if(i){var e=this.B.value;i=this.setValue(i,"user"),this.callEvent("onItemClick",[i,t]),i!=e&&this.callEvent("onSelect",[i])}},this)),this.$view.setAttribute("role","grid"),this.zt.setAttribute("aria-readonly","true")},s_:function(){return["#F34336","#FF9700","#FFEA3B","#4CB050","#009788","#00BCD4","#2196F3","#3F51B5","#673BB7","#9C28B1","#EA1E63"]},Ra:function(){this.getValue()||this.moveSelection("up")},n_:function(t){var i=this.B.palette;t=(t||"").toUpperCase();for(var e=0,s=i.length;e<s;e++)for(var n=0,r=i[e].length;n<r;n++)if(i[e][n].toUpperCase()==t)return{row:e,col:n};return null},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.B.value},r_:function(){return this.zt.firstChild},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},value_setter:function(t){return this.$prepareValue(t)},
setValue:function(t,i){t=this.$prepareValue(t);var e=this.B.value;return e!=t&&(this.B.value=t,this.$setValue(t),this.callEvent("onChange",[t,e,i])),t},$setValue:function(t){if(this.isVisible(this.B.id)){if(this.h_){var i=this.o_(this.h_);this.a_(i,!1)}var e=this.h_=this.n_(t);if(e){var s=this.o_(e);this.a_(s,!0)}}},o_:function(t){return this.zt.lastChild.childNodes[t.row].childNodes[t.col]},a_:function(t,i){i?(t.setAttribute("tabindex","0"),t.setAttribute("aria-selected","true"),Mt(t,"webix_color_selected")):(t.setAttribute("tabindex","-1"),t.removeAttribute("aria-selected"),St(t,"webix_color_selected"))},u_:function(t){return rs.toHex(t,2)},c_:function(t,i,e){return"#"+this.u_(Math.floor(t))+this.u_(Math.floor(i))+this.u_(Math.floor(e))},f_:function(t,i,e){var s,n,r;if(i){var h=e<.5?e*(1+i):e+i-e*i,o=2*e-h;s=this.l_(o,h,t+1/3),n=this.l_(o,h,t),r=this.l_(o,h,t-1/3)}else s=n=r=e;return{r:255*s,g:255*n,b:255*r}},l_:function(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},d_:function(t,i){return{r:t[0]*i+255*(1-i),g:t[1]*i+255*(1-i),b:t[2]*i+255*(1-i)}},v_:function(t){for(var i=[],e=255,s=e/t,n=0;n<t;n++)e=Math.round(0<e?e:0),i.push(this.c_(e,e,e)),e-=s;return i[i.length-1]="#000000",i},__:function(t){var i=this.s_();t.cols=i.length;var e=[],s=t.rows-1,n=1/t.rows,r=null;if(this.B.grayScale){var h=this.v_(t.cols);e.push(h.reverse()),n=1/s,s-=1}e.push(i);for(var o=0,a=t.maxLightness;o<s;o++){a-=n,r=[];for(var u=0;u<t.cols;u++){var c=rs.toRgb(i[u]),f=this.d_(c,a);r.push(this.c_(f.r,f.g,f.b))}e.push(r)}this.B.palette=e},p_:function(t){var i=[],e=1/t.cols,s=t.rows,n=null;this.B.grayScale&&(i.push(this.v_(t.cols)),s-=1);for(var r=(t.maxLightness-t.minLightness)/s,h=0,o=t.minLightness;h<s;h++){n=[];for(var a=0,u=0;a<t.cols;a++){var c=this.f_(u,1,o);n.push(this.c_(c.r,c.g,c.b)),u+=e}i.push(n),o+=r}this.B.palette=i},moveSelection:function(t,i,e){var s,n,r=this.getValue();if(r&&(s=this.n_(r)),s||(s={row:0,col:0}),s){if("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.zt.lastChild.querySelectorAll(".webix_color_row").length-1,s.col=this.zt.lastChild.childNodes[s.row].childNodes.length-1),s.row=Math.max(s.row,0),0<=s.row){var h=this.zt.lastChild.childNodes[s.row];h&&(n=h.childNodes[s.col])}if(n){r=n.getAttribute("webix_val");var o=i&&i.e instanceof KeyboardEvent?"user":"auto";if(this.setValue(r,o),this.callEvent("onSelect",[this.B.value]),!1!==e){var a=this.zt.querySelector("div[tabindex='0']");a&&a.focus()}}}},m_:function(t,i,e){for(var s={width:0,height:0,val:0},n='<div class="webix_color_row" role="row">',r=0;r<t.length;r++)s.width=i[r],s.height=e,s.val=t[r],n+=this.b_(s);return n+="</div>"},b_:function(t){var i=qt(this.B.template||"");return'<div role="gridcell" tabindex="-1" aria-label="'.concat(t.val,'" style="width:').concat(t.width,"px;height:").concat(t.height,'px;" ',"webix_val",'="').concat(t.val,'">').concat(i(t),"</div>")},render:function(){if(this.isVisible(this.B.id)){var t=this.B.type;this.B.palette||("classic"===t?this.p_(this.B):this.__(this.B));var i=this.B.palette;this.callEvent("onBeforeRender",[]);for(var e="classic"===t?0:re.colorPadding,s="object"==M(i[0]),n=s?i[0]:i,r=2*e+e*(n.length-1),h=2*e+e*(s?i.length-1:0),o=this.$width-r,a=this.$height-h,u=[],c='<div class="webix_color_palette '.concat("webix_palette_"+t,'" role="rowgroup">'),f=0;f<n.length;f++)u[f]=Math.floor(o/(n.length-f)),o-=u[f];if("object"==M(i[0]))for(var l=0;l<i.length;l++){var d=Math.floor(a/(i.length-l));a-=d;var v=i[l];c+=this.m_(v,u,d)}else c+=this.m_(i,u,a);c+="</div>",this.zt.innerHTML=c,this.B.value?this.$setValue(this.B.value):this.zt.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0"),this.pe(),this.callEvent("onAfterRender",[])}},refresh:function(){this.render()}}),hr=(F.protoUI(rr,Xe,Qi.view,b),{name:"colorselect",defaults:{width:260,height:250,value:"#751FE0"},$init:function(){var n=this;this.g_=this.w_=this.x_=0,G.touch&&this.attachEvent("onTouchStart",function(t,i){
var e=t.target.className,s=t.target.parentNode.className;"webix_color_block"==e||"webix_color_block"==s?n.y_(i||t):0==e.indexOf("webix_color_line")&&n.y_(i||t,!0)}),Zt(this.$view,"keydown",function(t){return n.M_(t)}),this.attachEvent("onAfterRender",function(){var i=this;G.touch||(Zt(this.S_,"mousedown",function(t){return i.y_(t)}),Zt(this.k_,"mousedown",function(t){return i.y_(t,!0)})),Zt(this.C_,"change",function(){return i.setValue(i.C_.value,"user")}),this.B.button&&Zt(this.zt.querySelector(".webix_button"),"click",function(){i.callEvent("onColorSelect",[i.getValue()])})}),this.attachEvent("onDestruct",function(){this.D_=this.I_=this.S_=null,this.k_=this.C_=this.A_=this.T_=null,this.F_&&this.z_()})},$skin:function(){this.P_="compact"==he||"mini"==he?24:32},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.B.value},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},value_setter:function(t){return this.$prepareValue(t)},setValue:function(t,i){t=this.$prepareValue(t);var e=this.B.value;e!=t&&(this.B.value=t,this.$setValue(t),this.callEvent("onChange",[t,e,i]))},$setValue:function(t){if(this.isVisible(this.B.id)){var i=rs.toRgb(t);if(t!==this.V_){var e=rs.rgbToHsv.apply(rs,o(i));this.g_=e[0],this.w_=e[1],this.x_=e[2]}var s=this.g_*this.T_.width/359;this.I_.style.left=s+"px";var n=this.w_*this.T_.width,r=Math.abs(this.T_.height*(this.x_-1));this.D_.style.left=Math.max(Math.min(n,this.T_.width),0)+"px",this.D_.style.top=Math.max(Math.min(r,this.T_.height),0)+"px",this.D_.setAttribute("aria-valuetext",t),this.I_.setAttribute("aria-valuetext",t),this.H_(i,t),this.R_()}},H_:function(t,i){t||(t=rs.hsvToRgb(this.g_,this.w_,this.x_)),i||(i="#"+rs.rgbToHex(t));var e="rgb(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")");this.D_.style.backgroundColor=e,this.A_.style.backgroundColor=e,this.C_.value=i.toUpperCase(),this.V_=i},R_:function(){var t=rs.hsvToRgb(this.g_,1,1),i="rgb(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")");this.I_.style.backgroundColor=i,this.S_.style.backgroundColor=i},B_:function(t){var i=G.touch?{x:t.x,y:t.y}:gt(t),e=i.x-this.T_.x,s=i.y-this.T_.y;e=Math.max(Math.min(e,this.T_.width),0),s=Math.max(Math.min(s,this.T_.height),0),this.D_.style.left=e+"px",this.D_.style.top=s+"px";var n=this.T_.width/100,r=this.T_.height/100,h=Math.ceil(e/n)/100,o=Math.ceil(Math.abs(s/r-100))/100;this.w_=h,this.x_=o,this.H_()},E_:function(t){var i=(G.touch?{x:t.x,y:t.y}:gt(t)).x-this.T_.x;i=Math.max(Math.min(i,this.T_.width),0),this.I_.style.left=i+"px";var e=Math.round(359*i/this.T_.width);this.g_=Math.max(Math.min(e,359),0),this.H_(),this.R_()},y_:function(t,e){var s=this;this.T_=mt(this.S_),e?(Mt(this.k_,"webix_color_area_active"),this.E_(t)):(Mt(this.S_,"webix_color_area_active"),this.B_(t)),G.touch?this.F_=[this.attachEvent("onTouchMove",function(t,i){return s.j_(i||t,e)}),this.attachEvent("onTouchEnd",function(){return s.L_(e)})]:this.F_=[Qt(document.body,"mousemove",function(t){return s.j_(t,e)}),Qt(window,"mouseup",function(){return s.L_(e)})],Mt(document.body,"webix_noselect")},j_:function(t,i){i?this.E_(t):this.B_(t)},z_:function(){G.touch?(this.detachEvent(this.F_[0]),this.detachEvent(this.F_[1])):(ti(this.F_[0]),ti(this.F_[1])),this.F_=null},L_:function(t){this.z_(),this.setValue(this.V_,"user"),t?(St(this.k_,"webix_color_area_active"),this.I_.focus()):(St(this.S_,"webix_color_area_active"),this.D_.focus()),St(document.body,"webix_noselect")},O_:function(t,i){return Math.min(Math.max(t+i/100,0),1)},N_:function(t,i){return Math.min(Math.max(t+i,0),359)},M_:function(t){var i=t.keyCode;if(32<i&&i<41){var e=/webix_color_(\w*)circle/.exec(t.target.className);if(!e)return;if(wt(t),e[1].length){if(36===i)this.g_=0;else if(35===i)this.g_=359;else{var s=37===i||40===i||34===i?-1:1;this.g_=this.N_(this.g_,s)}this.R_()}else if(36===i)this.w_=0,this.x_=1;else if(35===i)this.w_=this.x_=1;else if(39===i||37===i){var n=39===i?1:-1;this.w_=this.O_(this.w_,n)}else{var r=33===i||38===i?1:-1;this.x_=this.O_(this.x_
,r)}this.H_(),this.B.value==this.V_?this.$setValue(this.V_):this.setValue(this.V_,"user")}},moveSelection:function(t){if("pgup"==t||"pgdown"==t){var i="pgup"===t?-1:1;this.g_=this.N_(this.g_,i),this.R_()}else if("top"!=t&&"bottom"!==t){var e="up"==t||"right"==t?1:-1;"down"==t||"up"==t?this.x_=this.O_(this.x_,e):this.w_=this.O_(this.w_,e)}this.H_(),this.setValue(this.V_,"auto")},render:function(){if(this.isVisible(this.B.id)){this.callEvent("onBeforeRender",[]);var t=(this.$width-3*re.dataPadding)/2,i=this.$height-24-32-this.P_-(this.B.button?this.P_+12:0),e='<div class="webix_color_area">';e+="\n\t\t\t<div ".concat("webix_disable_drag",'="true" class="webix_color_block" style="height:',i,'px;">\n\t\t\t\t<div class="webix_color_circle" tabindex="0" role="slider"></div>\n\t\t\t</div>\n\t\t\t<div ',"webix_disable_drag",'="true" class="webix_color_line">\n\t\t\t\t<div class="webix_color_line_circle" tabindex="0" role="slider"></div>\n\t\t\t</div>\n\t\t\t<div class="webix_color_out">\n\t\t\t\t<div style="width:').concat(t,'px" class="webix_color_out_block"></div>\n\t\t\t\t<input type="text" style="width:').concat(t,'px" class="webix_color_out_text"></input>\n\t\t\t</div>\n\t\t'),this.B.button&&(e+="<div class='webix_secondary'><button class=\"webix_button\">".concat(P.combo.select,"</button></div>")),e+="</div>",this.zt.innerHTML=e,this.W_(),this.$setValue(this.B.value),this.pe(),this.callEvent("onAfterRender",[])}},W_:function(){this.D_=this.zt.querySelector(".webix_color_circle"),this.I_=this.zt.querySelector(".webix_color_line_circle"),this.S_=this.zt.querySelector(".webix_color_block"),this.k_=this.zt.querySelector(".webix_color_line"),this.C_=this.zt.querySelector(".webix_color_out_text"),this.A_=this.zt.querySelector(".webix_color_out_block"),this.T_=mt(this.S_)},refresh:function(){this.render()}}),or=(F.protoUI(hr,Qi.view,b),{name:"button",touchable:!0,$skin:function(){this.defaults.height=re.buttonHeight||re.inputHeight},defaults:{template:function(t,i){var e=i.$renderInput(t,i);return(t.badge||0===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:"",value:"",borderless:!0},$renderInput:function(t){return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+" class='webix_button'>"+(t.label||t.value)+"</button>"},$init:function(t){this.zt.className+=" webix_control webix_el_"+(this.$cssName||this.name),this.Vt=[],this.Y_(t),this.data=this.B,this.tt=this.zt,this.$ready.push(function(){this.U_(this.config)})},hotkey_setter:function(t){var e=this;this.q_(t,function(t,i){e.isVisible()&&(yt(e.$view.firstChild,"MouseEvents","click"),wt(i))})},Y_:function(t){t.css&&this.G_(t.css)&&(!this.defaults.css||this.G_(this.defaults.css))||(this.zt.className+=" webix_secondary")},G_:function(t){if("string"==typeof t){for(var i in{webix_danger:1,webix_transparent:1,webix_primary:1})if(-1!==t.indexOf(i))return!0}return!1},q_:function(t,i,e){var s=ji.addHotKey(t,i,e);this.attachEvent("onDestruct",function(){ji.removeHotKey(s,i,e)})},type_setter:function(t){return this.X_[t]&&(this.$renderInput=qt(this.X_[t])),t},K_:!1,X_:{image:"<button type='button' class='webix_button webix_img_btn' style='line-height:#cheight#px;'><img class='webix_image' style='max-width:#cheight#px; max-height:#cheight#px;' src = '#image#'>#label#</button>",imageTop:"<button type='button' class='webix_button webix_img_btn_top'><img class='webix_image' style='max-width:#cheight#px; max-height:#cheight#px;' src = '#image#'><div class='webix_img_btn_text'>#label#</div></button>",icon:"<button type='button' class='webix_button webix_img_btn' style='line-height:#cheight#px;'><span class='webix_icon_btn #icon#' style='max-width:#cheight#px;'></span>#label#</button>",iconTop:"<button type='button' class='webix_button webix_img_btn_top' style='width:100%;text-align:center;'><span class='webix_icon #icon#'></span><div class='webix_img_btn_text'>#label#</div></button>"},J_: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.r_();if(Ki.api.disable.apply(this,arguments),e&&-1==e.className.indexOf(" webix_disabled_box")){e.className+=" webix_disabled_box";var s=this.J_();for(t=0;t<s.length;t++)s[t].setAttribute("disabled",!0);if((i=this.getInputNode())&&"div"==i.tagName.toLowerCase()&&(this.Z_=i.getAttribute("tabIndex"),i.removeAttribute("tabIndex")),"top"==this.B.labelPosition){var n=this.tt.firstChild;n&&(n.className+=" webix_disabled_top_label")}}},enable:function(){Ki.api.enable.apply(this,arguments);var t,i=this.r_();if(i){i.className=i.className.replace(" webix_disabled_box","");for(var e=this.J_(),s=0;s<e.length;s++)e[s].removeAttribute("disabled");if((t=this.getInputNode())&&!z(this.Z_)&&t.setAttribute("tabIndex",this.Z_),"top"==this.B.labelPosition){var n=this.tt.firstChild;n&&(n.className=n.className.replace(" webix_disabled_top_label",""))}}},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i)&&this.render()},setValue:function(t,i){t=this.$prepareValue(t);var e=this.B.value;this.$compareValue(e,t)?this.Q_&&t!=this.$getValue()&&this.$setValue(t):(this.B.value=t,this.Q_&&this.$setValue(t),this.callEvent("onChange",[t,e,i]))},$compareValue:function(t,i){return"number"==typeof i&&(i=i.toString()),"number"==typeof t&&(t=t.toString()),t==i},$prepareValue:function(t){return 0===t?"0":(t||"").toString()},value_setter:function(t){return this.$prepareValue(t)},$setValue:function(t){var i=this.getInputNode();i&&!this.X_[this.B.type]&&(t=this.B.label||t,"BUTTON"==i.tagName?i.innerHTML=t:i.value=t)},getValue:function(){var t=this.Q_?this.$getValue():this.B.value;return void 0===t?"":t},$getValue:function(){return this.B.value||""},focus:function(){if(!ji.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.tt.getElementsByTagName("input")[0]||this.tt.getElementsByTagName("button")[0]},r_:function(){for(var t=0;t<this.tt.childNodes.length;t++)if(0<=this.tt.childNodes[t].className.indexOf("webix_el_box"))return this.tt.childNodes[t];return null},Pe:function(t,i){var e=i.target,s=this.r_();return"top"==this.B.labelPosition&&this.tt.firstChild.contains(e)||s&&s.contains(e)?this.B:null},tp:Math.sqrt(2),U_:function(t){if((t=t||this.B).autowidth){var i=kt(t.value||t.label||"","webixbutton").width+(t.badge||0===t.badge?2*kt(t.badge,"webix_badge").width-32:0)+("icon"===t.type?24:0)+("image"===t.type?t.height-re.inputPadding:0);i=Math.max(t.minWidth||0,i),t.width=Math.min(t.maxWidth||Infinity,i)}},ip:function(){this.ep=this.B.inputWidth||(2<this.xe-this.B.width?this.B.width:0)||this.xe,this.sp=this.B.inputHeight||this.np||0},resize:function(){return this.U_(),Qi.api.resize.apply(this,arguments)},render:function(){if(this.ip(),this.B.awidth=this.ep||this.xe,this.B.aheight=this.sp||this.Me,this.B.bheight=this.B.aheight+2,this.B.cheight=this.B.aheight-2*re.inputPadding,this.B.dheight=this.B.cheight-2,Gt.render.call(this)){if(this.Q_=!0,this.K_&&this.K_(),this.B.align){var t=this.tt.firstChild;switch("top"==this.B.labelPosition&&t.nextSibling&&(t=t.nextSibling),this.B.align){case"right":t.style.cssFloat="right";break;case"center":t.style.display="inline-block",t.parentNode.style.textAlign="center";break;case"middle":t.style.marginTop=Math.round((this.Me-this.sp)/2)+"px";break;case"bottom":t.style.marginTop=this.Me-this.sp+"px";break;case"left":t.style.cssFloat="left";break;default:this.B.align}}this.$render&&this.$render(this.data),this.B.disabled&&this.disable(),this.rp&&(this.rp(this.data),this.rp=0)}},refresh:function(){this.render()},on_click:{hp:function(t){var i=pt(t,"button_id"),e=this.getOption(i);e&&!e.disabled&&this.callEvent("onBeforeTabClick",[i,t])&&(this.setValue(i,"user"),this.focus(),this.callEvent("onAfterTabClick",[i,t]))},webix_all_segments:function(t,i){this.on_click.hp.call(this,t,i)},webix_all_tabs:function(t,i){this.on_click.hp.call(this,t,i)},
webix_inp_counter_next:function(){this.B.readonly||this.next(this.B.step,"user")},webix_inp_counter_prev:function(){this.B.readonly||this.prev(this.B.step,"user")},webix_input_icon:function(){this.getInputNode().focus()},webix_clear_icon:function(){return this.$allowsClear&&this.setValue("","user"),!1},webix_inp_checkbox_border:function(t){this.B.disabled||"DIV"==t.target.tagName||this.B.readonly||this.toggle("user")},webix_inp_checkbox_label:function(){this.B.readonly||this.toggle("user")},webix_inp_radio_border:function(t){var i=pt(t,"radio_id"),e=this.getOption(i);e&&!e.disabled&&(this.setValue(i,"user"),this.focus())},webix_tab_more_icon:function(t,i,e){var s=this.getPopup();s.isVisible()?s.hide():(s.resize(),s.show(e,null,!0))},webix_tab_close:function(t){var i=pt(t,"button_id"),e=this.getOption(i);return e&&!e.disabled&&this.callEvent("onBeforeTabClose",[i,t])&&this.removeOption(i),!1}},op:function(t){this.name,I(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]}:(z(t[i].id)&&(t[i].id=t[i].value),z(t[i].value)&&(t[i].value=t[i].id));return t},ap:function(t){var i=t?t.placeholder:this.B.placeholder;return i?"<span class='webix_placeholder'>"+i+"</span>":""}}),ar={api:or,view:F.protoUI(or,Qi.view,ee,Gt,Li,b)},ur={name:"label",defaults:{template:"<div class='webix_el_box' style='width:#awidth#px;height:#aheight#px;line-height:#cheight#px'>#label#</div>"},$skin:function(){ar.api.$skin.call(this),this.defaults.height=re.inputHeight},focus:function(){return!1},r_:function(){return this.tt.firstChild},setHTML:function(t){this.B.label=t,this.refresh()},setValue:function(t){this.B.label=t,ar.api.setValue.apply(this,arguments)},$setValue:function(t){this.tt.firstChild.innerHTML=t},$render:function(t){"right"===t.align&&(this.tt.firstChild.style.textAlign="right")},K_:!1,Y_:function(){},U_:function(t){var i="webix_el_box webixlabel"+(this.queryView("toolbar","parent")?" webixtoolbarlabel":"");(t=t||this.B).autowidth&&(t.width=kt(t.label,i).width)}},cr=(F.protoUI(ur,ar.view),{9:"tab",38:"up",40:"down",37:"left",39:"right"}),fr={$init:function(t){var i=this.defaults.pattern||t.pattern,e=this.defaults.format||t.format;t.value=z(t.value)?"":t.value,(i||e&&!this.format_setter)&&(this.attachEvent("onKeyPress",function(t,i){i.ctrlKey||i.altKey||this.B.readonly||this.cp||(105<t&&t<112&&(t-=64),cr[t]&&8!==t&&46!==t||(wt(i),this.fp(i,t)))}),this.attachEvent("onAfterRender",this.lp),this.getText=function(){return this.getInputNode().value},this.$prepareValue=function(t){return this.vp(t,!1)},this.vp=function(t,i){return!1===i?this._p(t):this.pp(t)},e&&("object"===M(e)?this.cp=e:(e=hn.getConfig(e),this.cp={parse:function(t){return hn.parse(t,e)},edit:function(t){return hn.format(t,e)}}))),i&&(this.B.pattern=this.pattern_setter(i),delete t.pattern)},pattern_setter:function(t){var i=vn[t]||t;return"string"==typeof i&&(i={mask:i}),i.allow=i.allow||/[A-Za-z0-9]/g,this.mp(i),i},bp:function(){this.config.validate=this.config.validate||k(function(){var t=this.getText(),i=t.replace(this.gp,"");return(t.toString().match(this.wp)||[]).join("").length==i.length&&t.length==this.B.pattern.mask.length},this)},lp:function(){var t=G.isIE8?"propertychange":"input";this.cp||Zt(this.getInputNode(),t,function(){var t=(new Date).valueOf();this.$view.offsetWidth;(!this.xp||100<t-this.xp)&&(this.xp=t,this.$setValue(this.getText()))},{bind:this}),Zt(this.getInputNode(),"blur",function(){this.xi()},{bind:this})},mp:function(t){for(var i=t.mask,e={},s="",n=0,r=0;r<i.length;r++)"#"===i[r]?(e[r]=n,n++):(e[r]=!1,-1===s.indexOf(i[r])&&(s+="\\"+i[r]));this.wp=t.allow,this.gp=new RegExp("["+s+"]","g"),this.yp=e,this.bp()},fp:function(t,i){var e=this.getInputNode(),s=e.value,n=It(e),r="";if(8==i||46==i)n.start==n.end&&(8==i?n.start--:n.end++);else{r=String.fromCharCode(i);var h=t.getModifierState("CapsLock");(!t.shiftKey&&!h||t.shiftKey&&h)&&(r=r.toLowerCase())}s=s.substr(0,n.start)+r+s.substr(n.end),n=this.Mp(r,s.length,n.start,i),this.Sp=i,this.$setValue(s),Dt(e,n)},Mp:function(t,i,e,s){if(t&&t.match(this.wp
)||8==s||46==s)e=t?e+1:e,e=this.kp(e,s);else if(i-1==e&&8!==s&&46!==s){var n=this.B.pattern.mask.indexOf("#",e);0<n&&(e+=n)}return e},kp:function(t,i){var e=t-1*(46!==i);return!1===this.yp[e]?(t+=8==i?-1:1,this.kp(t,i)):!1===this.yp[t]&&8!==i?this.kp(t+1,i)-1:t},_p:function(t){return this.cp?this.cp.parse(t):((t=t||0===t?t:"").toString().match(this.wp)||[]).join("").replace(this.gp,"")},pp:function(t){if(this.cp)return this.cp.edit(this.cp.parse(t));var i=this._p(t),e=this.B.pattern.mask,s=this.B.pattern.mask,n=this.yp,r=!1,h=0,o=0,a=0;for(var u in n)if(!1!==n[u]){if(!r){h=1*u;var c=i[o=n[u]]||"",f=i[o+1];e=(c?e.substr(0,h):"")+c+(c&&f?e.substr(h+1):""),f||(r=!0)}a++}var l=this.Sp;if(l&&8!==l||!l&&a-1===o&&e.length<s.length)if(i){var d=h+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.Sp=null,e}},lr={name:"text",$allowsClear:!0,Cp:function(){var i=this;if(this.$allowsClear){var t=this.B,e=this.getInputNode();if(this.$p||Zt(e,"change",this.xi,{bind:this}),t.suggest&&ai(t.suggest).linkInput(this),t.clear&&!this.addSection){this.Dp=this.$view.querySelector(".webix_input_icon:last-child"),"INPUT"!=e.tagName&&"SELECT"!=e.tagName||Zt(e,"input",function(t){return i.Ip(t.target.value)});var s=this.getText?this.getText():t.text||t.value;this.Ip(s)}}},xi:function(){var t=this.getValue(),i=this.setValue(t,"user");this.cp&&!1===i&&this.$setValue(t)},Ip:function(t){var i=this.B;if(i.clear&&this.Dp)if("hover"===i.clear||"replace"===i.clear){var e=t?"webix_clear_icon "+("hover"===i.clear?i.icon:"wxi-close"):i.icon;this.Dp.className="webix_input_icon "+e}else{var s=t?"":"hidden";this.Dp.style.visibility!==s&&(this.Dp.style.visibility=s)}},$skin:function(){ar.api.$skin.call(this),this.defaults.height=re.inputHeight,this.defaults.inputPadding=re.inputPadding,this.Kd=re.inputSpacing,this.Jd=re.labelTopHeight},$init:function(t){"top"==t.labelPosition&&z(t.height)&&this.defaults.height&&(t.height=this.defaults.height+(t.label?this.Jd:0)),z(t.icon)||(this.B.icon=t.icon),this.$p&&this.attachEvent("onBlur",function(){this.Q_&&this.$p()}),this.attachEvent("onAfterRender",this.Cp),this.attachEvent("onDestruct",function(){this.Dp=null})},clear_setter:function(t){return t&&(this.B.icon||(t=!0),"hover"!==t&&"replace"!==t&&(t=!!t)),t},$renderIcon:function(t){var i=t.aheight-2*t.inputPadding,e=(i-18)/2-1,s=this.Kd/2-24,n="";return t.icon&&(n+="<span style='right:"+(s+=24)+"px;height:"+(i-e)+"px;padding-top:"+e+"px;' class='webix_input_icon "+t.icon+"'></span>"),!0===t.clear&&(n+="<span style='right:"+(s+=24)+"px;height:"+(i-e)+"px;padding-top:"+e+"px;' class='webix_input_icon webix_clear_icon webix_icon_transparent wxi-close'></span>"),n},relatedView_setter:function(t){return this.attachEvent("onChange",function(){var t=this.getValue(),i=this.B.relatedAction,e=this.B.relatedView,s=ai(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.B.validate;!t&&this.B.required&&(t=Mi.isNotEmpty);var i=this.getFormView(),e=this.B.name,s=this.getValue(),n={};return n[e]=s,!(t&&!i.wr(t,s,n,e))},bottomLabel_setter:function(t){return this.B.bottomPadding||(this.B.bottomPadding=18),t},Ap:function(){var t=this.B.invalidMessage;return"function"==typeof t&&t.call(this),t},setBottomText:function(t,i){var e=this.B;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.Tp=1,e.bottomPadding=e.bottomPadding||i||18,this.render(),this.adjust(),this.resize()):!s&&this.Tp?(e.bottomPadding=this.Tp=0,e.height||this.render(),this.adjust(),this.resize()):this.render()},$getSize:function(){var t=Qi.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.B;if(Qi.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==e.labelPosition?(e.labelWidth=0,e.inputHeight||(this.np=this.Me-(e.label?this.Jd:0)-(this.config.bottomPadding||0))):(e.label&&(e.labelWidth=this.Zd(e.labelWidth,e.label)),e.bottomPadding&&(e.inputHeight=this.Me-this.config.bottomPadding)),this.render()}},Fp:function(t){var i=(this.ep||0)-(t.label?t.labelWidth:0)-this.Kd-(t.iconWidth||0);return i<0?0:i},zp:function(t,i){var e="x"+$(),s=i.Fp(t),n=t.inputAlign||"left",r=t.aheight-2*re.inputPadding-2*re.borderWidth,h=!0===t.clear?"padding-right:51px;":"",o=t.text||t.value||this.ap(t),a="<div class='webix_inp_static' role='combobox' aria-label='"+qt.escape(t.label)+"' tabindex='0'"+(t.readonly?" aria-readonly='true'":"")+(t.invalid?"aria-invalid='true'":"")+" onclick='' style='line-height:"+r+"px;width:"+s+"px;text-align:"+n+";"+h+"'>"+o+"</div>";return i.$renderInput(t,a,e)},Pp:function(t){var i="<"+t+(this.B.placeholder?" placeholder='"+qt.escape(this.B.placeholder)+"' ":" ");this.B.readonly&&(i+="readonly='true' aria-readonly=''"),this.B.required&&(i+="aria-required='true'"),this.B.invalid&&(i+="aria-invalid='true'");var e=this.B.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="top"==this.B.labelPosition,n="text-align:".concat(t.labelAlign||"left","; line-height:").concat(this.Vp(s),"px; ");e="<label style='"+(n+=s?"display:block;":t.labelWidth?"width:".concat(t.labelWidth,"px;"):"display:none;")+"' onclick='' for='"+i+"' class='webix_inp_"+(s?"top_":"")+"label "+(t.required?"webix_required":"")+"'>"+(t.label||"")+"</label>"}return e},Vp:function(t){return t?this.Jd-this.B.inputPadding:this.B.aheight-2*this.B.inputPadding},$renderInput:function(t,i,e){var s=t.inputAlign||"left",n="top"==t.labelPosition,r=this.Fp(t);e=e||$();var h=this.$renderLabel(t,e),o="";if(i)o+=i;else{var a=qt.escape(t.text||this.vp(t.value)),u=(t.icon||t.clear?27:0)+(t.icon&&!0===t.clear?24:0);u=u&&!this.addSection?"padding-right:"+u+"px;":"",o+=this.Pp("input")+"id='"+e+"' type='"+(t.type||this.name)+"'"+(t.editable?" role='combobox'":"")+" value='"+a+"' style='width:"+r+"px;text-align:"+s+";"+u+"'";var c=t.attributes;if(c)for(var f in c)o+=" "+f+"='"+c[f]+"'";o+=" />"}o+=this.$renderIcon?this.$renderIcon(t):"";var l="";l=n?h+"<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'>"+h+o+"</div>";var d=t.awidth-r-2*re.inputPadding,v=(t.invalid?t.invalidMessage:"")||t.bottomLabel;return v&&(l+="<div class='webix_inp_bottom_label'"+(t.invalid?"role='alert' aria-relevant='all'":"")+" style='width:"+(r||t.awidth)+"px;margin-left:"+Math.max(d,re.inputPadding)+"px;'>"+v+"</div>"),l},defaults:{template:function(t,i){return i.$renderInput(t)},label:"",labelWidth:80},Zd:function(t,i){return"auto"==t&&(t=kt(i,"webix_inp_label").width),t?Math.max(t,re.dataPadding):0},type_setter:function(t){return t},K_:!1,Y_:function(){},vp:function(t){return t},$setValue:function(t){t=this.vp(t),this.getInputNode().value=t,this.Ip(t)},$getValue:function(){return this.vp(this.getInputNode().value,!1)},setValueHere:function(t,i,e){if(e&&e.symbol){var s=e.symbol,n=this.getValue(),r=n.substring(e.pos);n=(n=n.substring(0,e.pos)).substring(0,n.lastIndexOf(s)+s.length)+t,this.setValue(n+r,e.config),Dt(this.getInputNode(),n.length)}else this.setValue(t,e&&e.config)},suggest_setter:function(t){if(t){if("string"==typeof t){if(ai(t))return ai(t).B.id;t={body:{url:t,dataFeed:t}}}else t.getItem?t={body:{data:t}}:I(t)?t={body:{data:this.op(t)}}:t.body||(t.body={});F.extend(t,{view:"suggest"});var i=ni(t);return this.Vt.push(i),i.B.id}return!1}},dr={api:lr,view:F.protoUI(lr,fr,ar.view)},vr=F.proto({name:"DataCollection",isVisible:function(){return!!(this.data.order.length||this.data.Wr||this.B.dataFeed)},$init:function(t){this.data.provideApi(this,!0);var i=t&&t.id?t.id:$();this.B.id=i,(ni.views[i]=this).data.attachEvent("onStoreLoad",k(function(){this.callEvent(
"onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},Ce,Ni,Ui,Fs,Fe,Ke,b,qi,Oi,Li);t("DataCollection",vr);var _r={name:"select",defaults:{template:function(i,t){var e="x"+$(),s=t.Pp("select")+"id='"+e+"' style='width:"+t.Fp(i)+"px;'>",n=ai(i.options);if(n&&n.data&&n.data.each)n.data.each(function(t){s+="<option"+(t.id==i.value?" selected='true'":"")+" value='"+t.id+"'>"+t.value+"</option>"});else for(var r=t.op(i.options),h=0;h<r.length;h++)s+="<option"+(r[h].id==i.value?" selected='true'":"")+" value='"+r[h].id+"'>"+r[h].value+"</option>";return s+="</select>",t.$renderInput(i,s,e)}},options_setter:function(t){if(t){if("string"!=typeof t)return t;var i=new vr({url:t});return i.data.attachEvent("onStoreLoad",k(this.refresh,this)),i}},$renderIcon:function(){return""},getInputNode:function(){return this.tt.getElementsByTagName("select")[0]}},pr=(F.protoUI(_r,dr.view),{name:"checkbox",defaults:{checkValue:1,uncheckValue:0,template:function(t,i){var e="x"+$(),s="";t.labelRight&&(s="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||" "));var n=t.checkValue==t.value,r=Math.floor((i.B.aheight-16)/2),h=i.Pp("input")+"style='margin-top:"+r+"px;"+(t.customCheckbox?"display:none":"")+"' id='"+e+"' type='checkbox' "+(n?"checked='1'":"")+(t.labelRight?" aria-label='"+qt.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"+qt.escape(t.labelRight||t.label))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false")));var u="<div style='line-height:"+i.B.cheight+"px' class='"+o+"'>"+h+a+s+"</div>";return i.$renderInput(t,u,e)}},customCheckbox_setter:function(t){return!0===t&&re.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()},$prepareValue:function(t){return t},Cp:function(){},$setValue:function(t){var i=t==this.B.checkValue,e=this.$view.getElementsByTagName("input")[0],s=e?e.parentNode:null;if(s&&this.B.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(t){var i=this.B,e=this.getValue()!=i.checkValue?i.checkValue:i.uncheckValue;this.setValue(e,t)},getValue:function(){var t=this.B;return t.value==t.checkValue?t.checkValue:t.uncheckValue},getInputNode:function(){return this.$view.getElementsByTagName(this.B.customCheckbox?"button":"input")[0]},$skin:function(){dr.api.$skin.call(this),this.defaults.customCheckbox=!!re.customCheckbox}}),mr={api:pr,view:F.protoUI(pr,dr.view)},br={name:"radio",defaults:{template:function(t,i){i.op(t.options);for(var e,s,n,r,h,o,a,u,c,f,l,d=i.$a(t.options),v=i.Ca(),_=[],p=0;p<d.length;p++)s="x"+$(),e=e||s,p&&(d[p].newline||t.vertical)&&_.push("<div class='webix_line_break'></div>"),l=(n=d[p].id==t.value)||!t.value&&d[p].id===v,r=!!d[p].disabled,h=d[p].value||"",o=t.tooltip?" webix_t_id='"+d[p].id+"'":"",(a=t.customRadio||"")&&(u=(0===p?t.label+" ":"")+h,a=(a=(a=(a=(a=a.replace(/(aria-label=')\w*(?=')/,"$1"+qt.escape(u))).replace(/(aria-checked=')\w*(?=')/,"$1"+(n?"true":"false"))).replace(/(tabindex=')\w*(?=')/,"$1"+(!r&&l?"0":"-1"))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false"))).replace(/(button_id=')\w*(?=')/,"$1"+d[p].id),r&&(a=a.replace("role='radio'","role='radio' webix_disabled='true'"))),c=i.Pp("input")+" name='"+(t.name||t.id)+"' type='radio' "+(n?"checked='1'":"")+"tabindex="+(!r&&l?"0":"-1")+" value='"+d[p].id+"' id='"+s+"'"+(r?" disabled='true'":"")+" style='"+(a?"display:none":"")+"' />",f="<div radio_id='"+d[p].id+"' class='webix_inp_radio_border webix_radio_"+(n?"1":"0")+"' role='presentation'>"+c+a+"</div>",
h&&(h="<label for='"+s+"' class='webix_label_right'>"+h+"</label>"),_.push("<div class='webix_radio_option"+(r?" webix_disabled":"")+"' role='presentation'"+o+">"+f+h+"</div>");return _="<div class='webix_el_group' role='radiogroup' style='margin-left:"+(t.label?t.labelWidth:0)+"px;'>"+_.join("")+"</div>",i.$renderInput(t,_,e)}},refresh:function(){this.render(),this.we&&this.$getSize(0,0)[2]!=this.we[1]&&this.resize()},$getSize:function(t,i){var e=ar.api.$getSize.call(this,t,i),s=this.$a(this.B.options);if(s){for(var n=this.B.vertical?0:1,r=0;r<s.length;r++)(this.B.vertical||s[r].newline)&&n++;e[3]=e[2]=Math.max(e[2],(this.B.optionHeight||25)*n+2*this.B.inputPadding+("top"==this.B.labelPosition?this.Jd:0))}var h=this.config.bottomPadding;return h&&(e[2]+=h,e[3]+=h),e},Ma:function(){return this.tt.getElementsByTagName(this.B.customRadio?"button":"input")},$setValue:function(t){for(var i,e,s,n,r,h=this.tt.getElementsByTagName("input"),o=this.Ca(),a=0;a<h.length;a++)i=h[a].parentNode.getAttribute("radio_id"),e=this.getOption(i),h[a].checked=i==t,s=e&&!e.disabled&&(h[a].checked||!t&&e.id==o),h[a].setAttribute("tabindex",s?"0":"-1"),(n=h[a]?h[a].parentNode:null)&&(n.className=n.className.replace(/(webix_radio_)\d/,"$1"+(h[a].checked?1:0)),this.B.customRadio&&(r=n.getElementsByTagName("BUTTON"))[0]&&(r[0].setAttribute("aria-checked",h[a].checked?"true":"false"),r[0].setAttribute("tabindex",s?"0":"-1")))},getValue:function(){return this.B.value},focus:function(){return this.yi()},blur:function(){this.Sa()},customRadio_setter:function(t){return!0===t&&re.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(){dr.api.$skin.call(this),this.defaults.customRadio=!!re.customRadio,re.optionHeight&&(this.defaults.optionHeight=re.optionHeight)}},gr=(F.protoUI(br,dr.view,Ue),{name:"datepicker",Hp:!0,$init:function(t){t.multiselect&&(this.B.multiselect=t.multiselect),t.type&&(this.B.type=t.type),this.$ready.push(this.Rp)},defaults:{template:function(t,i){"time"==i.B.type&&(i.B.icon=i.B.timeIcon);var e=t.type;t.type="";var s=t.editable?i.$renderInput(t):i.zp(t,i);return t.type=e,s},stringResult:!1,timepicker:!1,icon:"wxi-calendar",icons:!0,timeIcon:"wxi-clock",separator:", "},$p:function(){var t=this.getText();if(this.B.text!=t){var i=this.B.editable?this.getValue():this.getPopup().getValue();this.setValue(i||"","user")}},$skin:function(){dr.api.$skin.call(this),this.defaults.inputPadding=re.inputPadding,this.defaults.point=!re.popupNoPoint},getPopup:function(){return ai(this.B.popup)},Rp:function(){var t=this.B;if(t.suggest)t.popup=t.suggest;else if(!t.popup){var i=this.B.timepicker;t.popup=t.suggest=this.suggest_setter({type:"calendar",point:!1!==this.B.point,padding:0,body:{height:240+(i||this.B.icons?30:0),width:250,multiselect:this.B.multiselect,timepicker:i,type:this.B.type,icons:this.B.icons,timeIcon:this.B.timeIcon}})}this.rp=function(){}},$render:function(t){this.$setValue(t.value)},$prepareValue:function(t){if(this.B.multiselect){"string"==typeof t?t=t.split(this.B.separator):t instanceof Date?t=[t]:t||(t=[]);for(var i=0;i<t.length;i++)t[i]=this.Bp(t[i]);return t}return this.Bp(t)},Bp:function(t){var i=this.B.type,e="time"==i;if(isNaN(parseFloat(t))||(t=""+t),"string"==typeof t&&t){t=("month"!=i&&"year"!=i||!this.Ep?e?P.parseTimeFormatDate:P.parseFormatDate:this.Ep)(t)}if(t){if(e&&I(t)){var s=new Date;s.setHours(t[0]),s.setMinutes(t[1]),t=s}isNaN(t.getTime())&&(t="")}return t},jp:function(t){var i=this;return this.B.multiselect?[].concat(t).map(function(t){return i.Lp(t)}).join(this.config.separator):this.Lp(t)},Lp:function(t){var i=this.Op;return i||(i="time"==this.B.type?P.timeFormatStr:this.config.timepicker?P.fullDateFormatStr:P.dateFormatStr),i(t)},Np:function(){var t=this.getInputNode();z(t.value)?t.innerHTML=this.B.text||this.ap():t.value=this.B.text||""},$compareValue:function(t,i){return!t&&!i||rn.equal(t,i)},$setValue:function(t){
this.B.text=t?this.jp(t):"",this.Np(),this.Ip(this.B.text)},format_setter:function(t){return t?"function"==typeof t?this.Op=t:(this.Op=rn.dateToStr(t),this.Ep=rn.strToDate(t)):this.Op=this.Ep=null,t},getInputNode:function(){return this.B.editable?this.tt.getElementsByTagName("input")[0]:this.tt.getElementsByTagName("DIV")[1]},getValue:function(){var i=this;if(this.B.multiselect){var t=this.B.value;if(!t)return[];var e=[].concat(t).map(function(t){return i.Wp(t)});return this.B.stringResult?e.join(this.B.separator):e}return this.Wp(this.B.value)},Wp:function(t){var i=this.B.type,e="time"==i;if(this.Q_){if(this.B.editable){var s=this.Ep;s||(s=e?P.timeFormatDate:this.config.timepicker?P.fullDateFormatDate:P.dateFormatDate);var n=s(this.getInputNode().value);e&&""!=t?(t.setHours(n.getHours()),t.setMinutes(n.getMinutes())):t=n}}else t=this.$prepareValue(t)||null;if(this.B.stringResult){var r=P.parseFormatStr;return e&&(r=P.parseTimeFormatStr),!this.Op||"month"!=i&&"year"!=i||(r=this.Op),this.B.multiselect?[].concat(t).map(function(t){return t?r(t):""}):t?r(t):""}return t||null},getText:function(){var t=this.getInputNode();return t?z(t.value)?t.firstChild&&"webix_placeholder"===t.firstChild.className?"":t.innerHTML:t.value:""}}),wr={api:gr,view:F.protoUI(gr,dr.view)},xr={name:"colorpicker",$init:function(){this.$ready.push(this.Rp)},defaults:{icon:!0},Rp:function(){var t=this.B;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({type:"colorboard"})),this.rp=function(){}},clear_setter:function(t){return!!t},getValue:function(){return this.Q_&&this.B.editable?this.getInputNode().value:this.B.value},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},Yp:function(){return this.$view.getElementsByTagName("DIV")[this.B.editable?1:2]},jp:function(t){return t},$compareValue:function(t,i){return t==i},$setValue:function(t){this.Yp().style.backgroundColor=t,this.B.text=t,this.Ip(t);var i=this.getInputNode();z(i.value)?i.innerHTML=t:i.value=t},$renderIcon:function(t){var i=this.Kd/2+5,e="<div class='webix_input_icon' style='top:"+(t.inputPadding+4)+"px;right:"+i+"px;background-color:"+t.value+";'></div>";if(t.clear){var s=t.aheight-2*t.inputPadding,n=(s-18)/2-1;e+="<span style='right:"+(i+=24)+"px;height:"+(s-n)+"px;padding-top:"+n+"px;' class='webix_input_icon webix_clear_icon wxi-close'></span>"}return e}},yr=(F.protoUI(xr,wr.view),{name:"richselect",defaults:{template:function(t,i){return i.zp(t,i)},popupWidth:200,icon:"wxi-menu-down"},$p:function(){var t=this.getText();if(this.B.text!=t&&(!z(this.B.text)||t)){var i=this.getPopup();if(!i.$view.contains(document.activeElement)){var e=this.getInputNode().value,s=i.getSuggestion(e),n=this.getValue();!s||s==n||""===e&&""!==i.getItemText(s)?""===e?this.setValue("","user"):this.Up&&this.Up():this.setValue(s,"user")}}},suggest_setter:function(t){return this.options_setter(t)},options_setter:function(t){t=this.qp?this.qp(t):t;var i=this.B.popup=this.B.suggest=dr.api.suggest_setter.call(this,t),e=ai(i).getList();return e&&e.attachEvent("onAfterLoad",k(this.Gp,this)),i},getList:function(){var t=ai(this.B.suggest);return t.getList()},Gp:function(){var t=this.B.value||[];!t.length||this.getPopup().isVisible()||!this.getInputNode()||this.B.text||this.getText()||this.$setValue(t)},$skin:function(){dr.api.$skin.call(this),this.defaults.inputPadding=re.inputPadding},$render:function(t){this.$setValue(t.value)},getInputNode:function(){return this.tt.getElementsByTagName("DIV")[1]},getPopup:function(){return ai(this.B.popup)},getText:function(){var t=this.B.value,i=this.getInputNode();return i?z(i.value)?i.firstChild&&"webix_placeholder"===i.firstChild.className?"":i.innerHTML:i.value:t?this.getPopup().getItemText(t):""},$prepareValue:function(t){return t&&t.id?t:dr.api.$prepareValue.call(this,t)},$setValue:function(t){var i=t,e=this.getPopup();if(e&&(i=e.getItemText(t)),t&&t.id){var s=e.getList(),n=s.exists(t.id);n||s.add(t),i=e.getItemText(t.id),s.B.dynamic&&!n&&s.remove(t.id),this.B.value=this.$prepareValue(t.id)}
var r=this.getInputNode();z(r.value)?r.innerHTML=i||this.ap():r.value=i=i.replace(/<[^>]*>/g,""),this.B.text=i,this.Ip(i)},getValue:function(){return this.B.value||""},Xp:function(t){this.focus(),wt(t)}}),Mr={api:yr,view:F.protoUI(yr,dr.view)},Sr={name:"combo",getInputNode:function(){return this.tt.getElementsByTagName("input")[0]},Up:function(){var t=this.getValue();this.$setValue(z(t)?"":t)},xi:function(){var t=this.getInputNode(),i="",e=this.getPopup();t.value&&(i=this.B.value,e.getItemText(i)!=this.getText()&&(i=e.getSuggestion()||i)),i!=this.B.value?this.setValue(i,"user"):this.$setValue(i)},defaults:{template:function(t,i){return i.$renderInput(t).replace(/(<input)\s*(?=\w)/,"$1 role='combobox'")},icon:"wxi-menu-down"},on_click:{webix_clear_icon:function(){return this.$allowsClear&&this.setValue("","user"),!1},webix_inp_label:function(t){this.Xp(t)},webix_inp_top_label:function(t){this.Xp(t)}}},kr=(F.protoUI(Sr,Mr.view),{name:"counter",defaults:{template:function(t,i){var e=t.value,s="x"+$(),n="<div role='spinbutton' aria-label='"+qt.escape(t.label)+"' aria-valuemin='"+t.min+"' aria-valuemax='"+t.max+"' aria-valuenow='"+t.value+"' class='webix_el_group' style='width:"+i.Fp(t)+"px'>";return n+="<button type='button' class='webix_inp_counter_prev' tabindex='-1' aria-label='"+P.aria.decreaseValue+"'>-</button>",n+=i.Pp("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='"+P.aria.increaseValue+"'>+</button></div>",i.$renderInput(t,n,s)},min:0,max:Infinity,value:0,step:1},$init:function(){Zt(this.$view,"keydown",this.xv,{bind:this})},xv:function(t){if(!this.B.readonly){var i=t.which||t.keyCode,e=this.B,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(e.step,"user"):34===i?this.prev(e.step,"user"):s+=37===i||40===i?-1:1,34<i&&s>=e.min&&s<=e.max&&this.setValue(s,"user"))}},$setValue:function(t){this.getInputNode().value=t},$prepareValue:function(t){t=parseFloat(t);var i=this.B.min,e=this.B.max;return isNaN(t)&&(t=isFinite(i)?i:0),Math.min(Math.max(t,i),e)},getInputNode:function(){return this.tt.getElementsByTagName("input")[0]},getValue:function(){return 1*ar.api.getValue.apply(this,arguments)},next:function(t,i){t=1*(t||this.B.step),this.shift(t,i)},prev:function(t,i){t=-1*(t||this.B.step),this.shift(t,i)},shift:function(t,i){var e=Math.round(1e5*(this.getValue()+t))/1e5;this.setValue(e,i)}}),Cr=(F.protoUI(kr,dr.view),{name:"icon",$skin:function(){ar.api.$skin.call(this),this.defaults.height=re.inputHeight,this.defaults.width=re.inputHeight},defaults:{template:function(t,i){var e=Math.min(t.awidth,t.aheight),s=Math.round((i.Me-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>",r=t.aheight!=e?t.aheight:0;return"<div class='webix_el_box' style='width:"+t.awidth+"px;height:"+t.aheight+"px;line-height:"+r+"px;margin-top:"+s+"px'>"+n+(t.badge||0===t.badge?"<span class='webix_badge'>"+t.badge+"</span>":"")+"</div>"}},K_:!1,Y_:function(){},$setValue:function(){}}),$r=(F.protoUI(Cr,ar.view),F.protoUI({name:"search",on_click:{webix_clear_icon:function(){return this.$allowsClear&&this.setValue("","user"),!1},webix_input_icon:function(t){this.getInputNode().focus(),"hover"!==this.config.clear&&t.target&&-1!==t.target.className.indexOf(this.config.icon)&&this.callEvent("onSearchIconClick",[t])}},defaults:{type:"text",icon:"wxi-search"}},dr.view),{name:"segmented",$allowsClear:!1,$init:function(){this.attachEvent("onChange",function(t){this.B.multiview&&this.Kp(t)}),this.attachEvent("onAfterRender",u(function(){this.B.multiview&&this.B.value&&this.Kp(this.B.value)}))},Kp:function(t){var i=this.getTopParentView(),e=null;i&&i.$$&&(e=i.$$(t)),e||(e=ai(t)),e&&e.show&&e.show()},defaults:{template:function(t,i){i.op(t.options);var e,s,n=i.$a(t.options),r=i.Fp(t),h="contrast"==he?0:n.length-1,o=t.optionWidth||Math.floor((r-h)/n.length),
a="<div style='width:"+r+"px' class='webix_all_segments' role='tablist' aria-label='"+qt.escape(t.label)+"'>";t.value||(t.value=i.Ca(!0));for(var u=0;u<n.length;u++)s=!!n[u].disabled,e=t.tooltip?" webix_t_id='"+n[u].id+"'":"",a+="<button type='button' style='width:"+(n[u].width||o)+"px' role='tab' aria-selected='"+(t.value==n[u].id?"true":"false")+"' tabindex='"+(s||t.value!=n[u].id?"-1":"0")+"' class='webix_segment_"+(u==n.length-1?"N":0<u?1:0)+(t.value==n[u].id?" webix_selected":"")+(s?" webix_disabled":"")+"' "+(s?"webix_disabled='true' ":"")+"button_id='"+n[u].id+"'"+e+">"+n[u].value+"</button>";return i.$renderInput(t,a+"</div>",$())}},Ma:function(){return this.$view.getElementsByTagName("BUTTON")},focus:function(){return this.yi()},blur:function(){this.Sa()},$setValue:function(t){var i=this.config.tabbarPopup;if(i&&ai(i)&&ai(i).getBody().exists(t))return this.refresh();for(var e,s,n=this.Ma(),r=0;r<n.length;r++)e=n[r].getAttribute("button_id"),s=this.getOption(e),n[r].setAttribute("aria-selected",t==e?"true":"false"),n[r].setAttribute("tabindex",s&&!s.disabled&&t==e?"0":"-1"),t==e?Mt(n[r],"webix_selected"):St(n[r],"webix_selected")},$getValue:function(){return this.B.value||""},getValue:function(){return this.B.value},getInputNode:function(){return null},K_:!1}),Dr={api:$r,view:F.protoUI($r,dr.view,Ue)},Ir={name:"textarea",defaults:{template:function(t,i){var e=t.name||t.id,s="x"+$(),n=i.Pp("textarea")+"style='width:"+i.Fp(t)+"px;'";return n+=" id='"+s+"' name='"+e+"' class='webix_inp_textarea'>"+i.vp(t.value)+"</textarea>",i.$renderInput(t,n,s)},minHeight:60},$skin:function(){dr.api.$skin.call(this),this.defaults.height=0},Hi:!0,Vp:function(t){return t?this.Jd-this.B.inputPadding:""},$renderIcon:function(){return""},getInputNode:function(){return this.tt.getElementsByTagName("textarea")[0]}},Ar=(F.protoUI(Ir,dr.view),{name:"toggle",$allowsClear:!0,$init:function(){this.attachEvent("onItemClick",function(){this.toggle("user")})},$renderInput:function(t){return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+" class='webix_button'>"+t.label+"</button>"},$setValue:function(t){var i=this.getInputNode(),e=this.B,s=t&&"0"!=t,n=(s?e.onLabel:e.offLabel)||e.label,r=i.children;if(this.X_[e.type]){var h=r[0];"SPAN"==h.nodeName&&e.onIcon&&e.offIcon&&e.onIcon!=e.offIcon&&(h.className=h.className.replace(s?e.offIcon:e.onIcon,s?e.onIcon:e.offIcon)),"imageTop"==e.type||"iconTop"==e.type?r[1].innerHTML=n:(i.innerHTML=n,i.insertBefore(h,i.firstChild))}else i.innerHTML=n;i.setAttribute("aria-pressed",s?"true":"false"),(s?Mt:St)(i.parentNode,"webix_pressed")},toggle:function(t){this.setValue(!this.getValue(),t)},getValue:function(){var t=this.B.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||0===t.badge)&&(n=n.replace(/<\/div>$/,"<span class='webix_badge'>"+t.badge+"</span></div>")),n}},K_:!1}),Tr=(F.protoUI(Ar,ar.view),{name:"multitext",$cssName:"text",defaults:{icon:"wxi-plus-circle",iconWidth:25,separator:", "},getValueHere:function(){return dr.api.getValue.call(this)},setValueHere:function(t){return dr.api.$setValue.call(this,t)},getValue:function(){if("extra"==this.config.mode)return this.getValueHere();if(this.Jp)return this.Jp;for(var t=[this.getValueHere(this)],i=0;i<this.Zp.length;i++){var e=ai(this.Zp[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.Jp=t).split(this.config.separator);if(i.length!=this.Zp.length+1){this.removeSection(),this.setValueHere.call(this,i[0]);for(var e=1;e<i.length;e++)this.addSection(i[e]);this.Jp=""}else{this.setValueHere(i[0]);for(var s=0;s<this.Zp.length;s++)ai(this.Zp[s]).setValueHere(i[s+1]);this.Jp=""}},
$renderIcon:function(t){if(t.icon){var i=t.aheight-2*t.inputPadding,e=(i-18)/2-1,s="role='button' tabindex='0' aria-label='"+P.aria["multitext"+(t.mode||"")+"Section"]+"'";return"<span style='right:0;height:"+(i-e)+"px;padding-top:"+e+"px;' class='webix_input_icon webix_multitext_icon "+t.icon+"' "+s+"></span>"}return""},Qp:function(t,i,e){var s=this.config.master?ai(this.config.master):this,n=s.getValue(),r=s.B.value;n!=r&&(s.B.value=n,s.callEvent("onChange",[n,r,e]))},addSection:function(t){var i=this.config,e={labelWidth:i.labelWidth,inputWidth:i.inputWidth,width:i.width,label:i.label?" ":"",view:this.name,mode:"extra",value:t||"",icon:"wxi-minus-circle",tooltip:i.tooltip,suggest:i.suggest||null,master:i.id};F.extend(e,i.subConfig||{},!0);var s=this.getParentView().addView(e);return ai(s).attachEvent("onChange",this.Qp),this.Zp.push(s),this.callEvent("onSectionAdd",[s,this.Zp.length]),s},removeSection:function(t){for(var i=this.config.master?ai(this.config.master):this,e=i.Zp.length-1;0<=e;e--){var s=i.Zp[e];t&&s!=t||(i.Zp.removeAt(e),this.getParentView().removeView(s),i.callEvent("onSectionRemove",[s,e+1]))}},on_click:{webix_input_icon:function(){if("extra"==this.config.mode){var t=this.getParentView();this.removeSection(this.config.id);var i=t.getChildViews();i[i.length-1].focus(),this.Qp(null,null,"user")}else ai(this.addSection()).focus();return!1}},$init:function(){this.Zp=T([]),this.attachEvent("onKeyPress",this.De)},$render:function(t){this.$setValue(t.value)}});F.protoUI(Tr,dr.view);F.protoUI({name:"multiselect",defaults:{template:"GPL version doesn't support multiselect <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"multicombo",defaults:{template:"GPL version doesn't support multicombo <br> You need Webix PRO"}},Cn.view);var Fr={name:"slider",$touchCapture:!0,defaults:{min:0,max:100,value:50,step:1,title:!1,moveTitle:!0,template:function(t,i){var e=i.tm="x"+$(),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>",r="<div class='webix_slider_left'> </div>",h="<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+"'> </div>";return s=t.vertical?"<div class='webix_slider_box'>"+h+r+o+"</div>"+n:n+"<div class='webix_slider_box'>"+r+h+o+"</div>",i.$renderInput(t,s,e)}},type_setter:function(t){this.zt.className+=" webix_slider_"+t},title_setter:function(t){return"string"==typeof t?qt(t):t},im:function(){return this.$view.querySelector(".webix_slider_handle")},K_:function(){var t=this.im(),i=this.B;if(t){var e=i.vertical?this.Me:this.Fp(i),s=i.value%i.step?Math.round(i.value/i.step)*i.step:i.value,n=i.max-i.min;s=this.em(s),s=i.vertical?n-(s-i.min):s-i.min;var r=Math.ceil((e-2*this.sm)*s/n),h=e-2*this.sm-r,o=i.vertical?"top":"left",a=i.vertical?"height":"width";t.style[o]=this.sm+r-this.nm/2+"px",t.parentNode.style[a]=e+"px",h=this.em(h,2*this.rm,e-2*this.sm-2*this.rm),r=this.em(r,2*this.rm,e-2*this.sm-2*this.rm);var u=t.previousSibling;u.style[a]=h+"px",u.previousSibling.style[a]=r+"px",this.hm(t,r,h,o)}},hm:function(t,i,e,s){var n=this.B;if(this.B.title){var r=t.parentNode[n.vertical?"nextSibling":"previousSibling"];if(r.innerHTML=this.B.title(this.B,this),this.B.moveTitle){var h=0;if(n.vertical)h=i+2*this.rm-this.nm/2;else{var o=r.clientWidth/2,a=i<o?o-i-2*this.rm:0,u=e<o?o-e-2*this.rm-this.nm/2:0;h=this.sm+i-o+a-u}r.style[s]=h+"px"}}},om:function(){this.im().setAttribute("aria-valuenow",this.B.value)},em:function(t,i,e){return i=i||this.B.min,e=e||this.B.max,Math.min(Math.max(t,i),e)},refresh:function(){var t=this.im();t&&(this.om(),this.B.title&&t.setAttribute("aria-label",this.B.label+" "+this.B.title(this.B,this)),this.K_())},$setValue:function(){this.refresh()},$getValue:function(){return this.B.value},$prepareValue:function(t){
return t=parseFloat(t),isNaN(t)&&(t=this.B.min),this.em(t)},$init:function(t){G.touch?this.attachEvent("onTouchStart",k(this.um,this)):Zt(this.zt,"mousedown",k(this.um,this)),Zt(this.$view,"keydown",k(this.M_,this)),t.vertical&&(t.height=t.height||re.vSliderHeight,this.zt.className+=" webix_slider_vertical",this.sm=re.vSliderPadding)},$skin:function(){dr.api.$skin.call(this),this.nm=re.sliderHandleWidth,this.sm=re.sliderPadding,this.rm=re.sliderBorder},M_:function(t){var i=t.keyCode,e=this.B,s=e.value;if(32<i&&i<41){wt(t);var n=t.target,r=/webix_slider_handle_(\d)/.exec(n.className);if(this.cm=r?parseInt(r[1],10):-1,r&&(s=e.value[this.cm]),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 h=37===i||40===i||34===i?-1:1;(33===i||34===i||1<e.step)&&(h*=e.step),s=1*s+h}if(r){var o=e.value[this.cm?0:1];s=this.cm&&s<=o||!this.cm&&o<=s?o:s}if(s>=e.min&&s<=e.max){if(r){for(var a=[],u=0;u<e.value.length;u++)a[u]=u===this.cm?s:e.value[u];s=a}this.setValue(s,"user"),this.cm=-1}}},um:function(t){if(!this.F_){var i=t.target;this.fm&&this.fm(t);var e=this.B.value;if(I(e)&&(e=S(e)),-1!=i.className.indexOf("webix_slider_handle"))return this.lm=e,this.dm.apply(this,arguments);-1!=i.className.indexOf("webix_slider")&&(this.lm=e,this.B.value=this.vm.apply(this,arguments),this.dm(t))}},dm:function(){G.touch?this.F_=[this.attachEvent("onTouchMove",k(this.j_,this)),this.attachEvent("onTouchEnd",k(this.L_,this))]:this.F_=[Qt(document.body,"mousemove",k(this.j_,this)),Qt(window,"mouseup",k(this.L_,this))],Mt(document.body,"webix_noselect")},L_:function(){this.F_&&(G.touch?(this.detachEvent(this.F_[0]),this.detachEvent(this.F_[1])):(ti(this.F_[0]),ti(this.F_[1])),this.F_=null),St(document.body,"webix_noselect");var t=this.B.value;I(t)&&(t=S(t)),this.B.value=this.lm,this.setValue(t,"user"),this.im(this.cm).focus(),this.cm=-1},j_:function(){this.B.value=this.vm.apply(this,arguments),this.refresh(),this.callEvent("onSliderDrag",[])},vm:function(t,i){var e=0,s=this.B.vertical?"y":"x";return e=G.touch?i?i[s]:t[s]:gt(t)[s],this._m(e)},_m:function(t){var i=this.B,e=i.max-i.min,s=i.vertical?"y":"x",n=mt(this.im().parentNode)[s]+this.sm,r=(i.vertical?this.Me:this.Fp(i))-2*this.sm,h=r?(t-n)*e/r:0;return i.vertical&&(h=e-h),h=Math.round((h+1*i.min)/i.step)*i.step,this.em(h)},Cp:function(){}};F.protoUI(Fr,dr.view);F.protoUI({name:"rangeslider",defaults:{template:"GPL version doesn't support rangeslider <br> You need Webix PRO"}},Cn.view);var zr={name:"switch",defaults:{template:function(t,i){i.mm();var e=t.name||"x"+$(),s="";t.labelRight&&(s="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||" "));var n=t.checkValue==t.value,r='aria-label="'+(t.label||t.labelRight||"")+'" role="checkbox" tabindex="0" aria-checked="'+(n?"true":"false")+'" '+(t.readonly?"aria-readonly='true'":"")+'"',h='<div class="webix_switch_box '+(n?" webix_switch_on":"")+'" style="width:'+i.bm+'px"><span class="webix_switch_text">'+((n?t.onLabel:t.offLabel)||"")+'</span><button class="webix_switch_handle" '+r+' style="left:'+(n?i.bm-i.gm:0)+'px;"><input id="'+e+'" class="webix_switch_toggle" type="checkbox" '+(n?"checked":"")+"></button></div>"+s;return i.$renderInput(t,h,e)}},$skin:function(){mr.api.$skin.call(this),this.gm=re.switchHeight,this.bm=re.switchWidth},$setValue:function(t){var i=this.B,e=t==i.checkValue,s=this.$view.querySelector(".webix_switch_box");if(s){var n=s.childNodes[1],r=(e?i.onLabel:i.offLabel)||"";e?Mt(s,"webix_switch_on"):St(s,"webix_switch_on"),n.style.left=(e?this.bm-this.gm:0)+"px",n.firstChild.checked=e,n.setAttribute("aria-checked",e?"true":"false"),r&&(s.childNodes[0].innerHTML=r)}},mm:function(){var t=this.B;if(t.onLabel||t.offLabel){var i=t.onLabel?kt(t.onLabel,"webix_switch_text").width:0,e=t.onLabel?kt(t.offLabel,"webix_switch_text").width:0;this.bm=Math.max(i,e)+this.gm}},on_click:{webix_switch_box:function(){this.B.readonly||this.toggle("user")},webix_label_right:function(){this.B.readonly||this.toggle("user")}}},Pr=(F.protoUI(zr,mr.view),{name:"tabbar",$init:function(){
this.attachEvent("onKeyPress",this.De)},$skin:function(){var t=re,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},wm:function(){var t,i,e=this.B,s=this.$a(e.options),n=this.ep-2*e.tabOffset,r=e.optionWidth||e.tabMinWidth;if(i=s.length,e.tabMinWidth&&n/i<r)return{max:parseInt(n/r,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}},Rp:function(){var i=this,t=this.B;if(!t.tabbarPopup||!ai(t.tabbarPopup)){var e=F.extend({view:"popup",autofocus:!1,width:200},t.tabbarPopup||{}),s=F.extend({view:"list",borderless:!0,select:!0,autoheight:!0,yCount:7,template:qt("#value#")},t.tabbarPopup&&t.tabbarPopup.body||{},!0);s.css="webix_tab_list ".concat(s.css||""),e.body=s;var n=ni(e),r=n.getBody();n.attachEvent("onShow",function(){r.unselect(),ji.setFocus(r);var t=r.getItemNode(r.getFirstId());t&&t.focus()}),r.attachEvent("onItemClick",function(t){return i.xm(t)}),r.attachEvent("onEnter",function(){return i.xm()}),t.tabbarPopup=n.B.id,this.Vt.push(n)}this.Rp=function(){}},xm:function(t){var i=ai(this.B.tabbarPopup);return(t=t||i.getBody().getSelectedId())&&this.callEvent("onBeforeTabClick",[t])&&(this.setValue(t,"user"),i.hide(),this.callEvent("onAfterTabClick",[t]),this.refresh(),this.focus()),!1},getPopup:function(){return this.Rp(),ai(this.B.tabbarPopup)},moreTemplate_setter:qt,defaults:{moreTemplate:'<span class="webix_icon wxi-dots"></span>',template:function(t,i){i.op(t.options);var e,s,n,r,h,o,a,u=i.$a(t.options);if(u.length){t.value||(t.value=i.Ca(!0)),e="",t.tabOffset&&(e+="<div class='webix_tab_filler' style='width:"+t.tabOffset+"px;'> </div>"),i.ep-2*t.tabOffset-(t.type?0:t.tabMargin*(u.length-1)),o=t.topOffset+t.bottomOffset;var c=i.wm();if(c.max&&c.max<u.length){var f=i.getPopup();f.hide();var l=f.getBody()||null;if(l)if(c.max){for(var d=0,v=!1;d<u.length&&!v;d++)if(u[d].id==t.value&&(v=!0,d+1>c.max)){var _=u.splice(d,1);u=u.splice(0,c.max-1).concat(_).concat(u)}l.clearAll(),l.parse(u.slice(c.max))}else l.clearAll()}else if(i.B.tabbarPopup){var p=ai(i.B.tabbarPopup);p&&p.hide()}h=t.tabOffset;for(var m=0,b=!1;m<u.length&&!b;m++)a=c&&c.max?(c.max==m+1&&(b=!0),(i.ep-2*t.tabOffset-(!t.type&&1<c.max?t.tabMargin*(c.max-1):0)-t.tabMoreWidth)/c.max):c.width,h+=(a=u[m].width||t.optionWidth||a)+(m&&!t.type?t.tabMargin:0),0<t.tabMargin&&m&&!t.type&&(e+="<div class='webix_tab_filler' style='width:"+t.tabMargin+"px;'></div>"),e+=i.ym(u[m],a),b&&(e+='<div role="button" tabindex="0" aria-label="'+P.aria.showTabs+'" class="webix_tab_more_icon" style="width:'+t.tabMoreWidth+'px;">'+t.moreTemplate(t,i)+"</div>",h+=t.tabMoreWidth);0<(s=i.xe-h)&&!t.type&&(e+="<div class='webix_tab_filler' style='width:"+s+"px;'> </div>")}else e="<div class='webix_tab_filler' style='width:"+i.ep+"px; border-right:0px;'></div>";return n="",r=o&&!t.type?"height:"+(i.Me-o)+"px":"",t.topOffset&&!t.type&&(n+="<div class='webix_before_all_tabs' style='width:100%;height:"+t.topOffset+"px'></div>"),n+="<div style='"+r+"' role='tablist' class='webix_all_tabs "+(t.type?"webixtype_"+t.type:"")+"'>"+e+"</div>",t.bottomOffset&&!t.type&&(n+="<div class='webix_after_all_tabs' style='width:100%;height:"+t.bottomOffset+"px'></div>"),n}},Ma:function(){return this.$view.querySelectorAll(".webix_item_tab")},ym:function(t,i){var e,s="",n="",r=!!t.disabled,h=this.config;if(t.id==h.value&&(s+=" webix_selected"),r&&(s+=" webix_disabled"),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="'+(r||t.id!=h.value?"-1":"0")+'" style="width:'+i+'px;"'+(r?' webix_disabled="true"':"")+n+">",this.Mm){var o=this.Me-2*h.inputPadding-2,a=this.Me-2,u=F.extend({cheight:o,aheight:a},t);e+=this.Mm(u)
}else{e+=(t.icon?"<span class='webix_icon "+t.icon+"'></span> ":"")+t.value}return r||!t.close&&!h.close||(e+="<span role='button' tabindex='0' aria-label='"+P.aria.closeTab+"' class='webix_tab_close webix_icon wxi-close'></span>"),e+="</div>"},r_:function(){return this.tt.firstChild},X_:{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.B.tabOffset=0,this.X_[t]&&(this.Mm=qt(this.X_[t])),t}}),Vr=(F.protoUI(Pr,Dr.view),{name:"richtext",defaults:{label:"",labelWidth:80,labelPosition:"left"},$init:function(){this.zt.className+=" webix_richtext",this.$ready.unshift(this.Sm)},$skin:function(){An.api.$skin.call(this),this.defaults.paddingX=re.inputSpacing/2,this.defaults.paddingY=re.inputPadding},getInputNode:function(){return this.$view.querySelector(".webix_richtext_editor")},km:function(t){return{view:"toggle",type:"icon",icon:"wxi-"+t,name:t,id:t,label:P.richtext[t],autowidth:!0,action:t,click:this.Cm}},Sm: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.Q_=!0,t.refresh(),Zt(t.getInputNode(),"blur",function(){t.$m(this.innerHTML,"user")}),Zt(t.getInputNode(),"keyup",function(){t.Dm("auto")})}},onClick:{webix_richtext_editor:function(){t.Dm("auto")}}},e=[this.km("underline"),this.km("bold"),this.km("italic"),{}],s={view:"toolbar",id:"toolbar",elements:e},n=[s,i],r=this.config;"top"==r.labelPosition?(s.elements=e.concat([{view:"label",label:r.label,align:"right"},{width:4}]),this.rows_setter(n)):(r.labelWidth=r.label?this.Zd(r.labelWidth,r.label):0,r.labelWidth?(r.margin=0,this.cols_setter([{template:r.label,css:"webix_richtext_inp_label"+(r.required?" webix_required":""),borderless:!0,width:r.labelWidth},{rows:n}])):this.rows_setter(n))},Zd:function(t,i){return"auto"==t&&(t=kt(i,"webix_inp_label").width),t?Math.max(t,re.dataPadding):0},Dm:function(t){var i;this.$$("toolbar").setValues({italic:!1,underline:!1,bold:!1},!1,t),i=window.getSelection?window.getSelection():document.selection.createRange();for(var e=0;e<i.rangeCount;++e)this.$view.contains(this.getInputNode())&&(document.queryCommandState("bold")&&this.$$("bold").setValue(!0,t),document.queryCommandState("underline")&&this.$$("underline").setValue(!0,t),document.queryCommandState("italic")&&this.$$("italic").setValue(!0,t))},refresh:function(){this.Q_&&(this.getInputNode().innerHTML=this.B.value)},Im:function(t){var i,e;if(window.getSelection){e=(i=window.getSelection()).toString().length;var s=this.getInputNode();if(s.contains(i.anchorNode)&&s.contains(i.focusNode)&&0<e)for(var n=0;n<i.rangeCount;++n){var r=i.getRangeAt(n);if(i.isCollapsed){var h=i.focusNode.textContent,o=i.focusNode,a=i.anchorOffset,u=h.substring(0,a).match(/[A-Za-z]*$/)[0],c=h.substring(a).match(/^[A-Za-z]*/)[0],f=a-u.length,l=a+c.length;r.setStart(o,f),r.setEnd(o,l),i.removeAllRanges(),i.addRange(r),document.execCommand(t,!1,"")}else document.execCommand(t,!1,"")}}},Cm:function(){this.getTopParentView().Im(this.config.action)},focus:function(){if(!ji.canFocus(this))return!1;this.getInputNode().focus()},$m:function(t,i){t=this.$prepareValue(t);var e=this.B.value;e!=t&&(this.B.value=t,this.callEvent("onChange",[t,e,i]))},setValue:function(t,i){this.$m(t,i),this.refresh()},$prepareValue:function(t){return 0===t?"0":(t||"").toString()},value_setter:function(t){return this.$prepareValue(t)},getValue:function(){var t=this.getInputNode();return t?t.innerHTML:this.B.value}}),Hr=(F.protoUI(Vr,Ge,An.view),{name:"proto",
$init:function(){this.data.provideApi(this,!0),this.tt=this.tt||this.Ui,this.data.attachEvent("onStoreUpdated",k(function(){this.render.apply(this,arguments)},this))},$setSize:function(){Qi.api.$setSize.apply(this,arguments)&&this.render()},_id:"webix_item",on_mouse_move:{},type:{}}),Rr={api:Hr,view:F.protoUI(Hr,ts,ke,ee,Fs,es,Fe,Qi.view,b,Li)},Br={name:"list",Am:"webix_list",vr:"webix_list_item",$init:function(t){Mt(this.zt,this.Am+("x"==(t.layout||this.defaults.layout)?"-x":"")),this.data.provideApi(this,!0),this.Tm=k(this.Tm,this),this.data.attachEvent("onStoreUpdated",this.Tm),this.data.attachEvent("onSyncApply",this.Tm),this.zt.setAttribute("role","listbox")},dynamic_setter:function(t){return t&&F.extend(this,Vs,!0),t},$dragHTML:function(t,i,e){var s;return"y"==this.B.layout&&"auto"==this.type.width?(this.type.width=this.xe,s=this.Q(t),this.type.width="auto"):s=this.Q(t),I(e.source)&&1<e.source.length&&(s=this.ro(s,e.source.length)),s},defaults:{select:!1,scroll:!0,layout:"y",navigation:!0,datafetch:50},_id:"webix_l_id",on_click:{webix_list_item:function(t,i){this.B.select&&(this.Fm=!0,"multiselect"==this.B.select||this.B.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.B.multiselect,t.shiftKey):this.select(i),this.Fm=!1)}},on_dblclick:{},getVisibleCount:function(){return Math.floor(this.Me/this.zm())},Tm:function(){var t=this.B;if(t.autoheight||t.autowidth)return this.resize();"y"==t.layout?t.yCount&&this.Pm(t.yCount):t.xCount&&this.Vm(t.xCount)},Pm:function(t){var i=this.data.$pagesize||this.count();this.ju(t&&t<i,"y"),this.B.autoheight&&i<(t||Infinity)&&(t=i);var e=this.zm()*t+(this.type.margin||0);return this.getUnits&&(e+=this.getUnits().length*this.type.headerHeight),Math.max(e,this.B.minHeight||0)},zm:function(){return this.type.height+(this.type.margin||0)},Vm:function(t){var i=this.data.$pagesize||this.count();return this.ju(t&&t<i,"x"),this.B.autowidth&&i<(t||Infinity)&&(t=i),this.type.width*t},$getSize:function(t,i){return"y"==this.B.layout?("auto"!=this.type.width&&(this.B.width=this.type.width+(this.ye?G.scrollSize:0)),(this.B.yCount||this.B.autoheight)&&(this.B.height=this.Pm(this.B.yCount)||1)):("auto"!=this.type.height&&(this.B.height=this.zm()+(this.Se?G.scrollSize:0)),(this.B.xCount||this.B.autowidth)&&(this.B.width=this.Vm(this.B.xCount)||1)),Qi.api.$getSize.call(this,t,i)},$setSize:function(){Qi.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.disabled&&(s+=" webix_disabled"),t.$css&&("object"==M(t.$css)&&(t.$css=ut(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"':"")+(t.disabled?' aria-disabled="true" webix_disabled="true"':"")},template:function(t){return(t.icon?"<span class='webix_list_icon webix_icon "+t.icon+"'></span>":"")+t.value+(t.badge||0===t.badge?"<div class='webix_badge'>"+t.badge+"</div>":"")},width:"auto",templateStart:qt('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>'),templateEnd:qt("</div>")},$skin:function(){this.type.height=re.listItemHeight},disableItem:function(t){this.Hm(t,!0)},enableItem:function(t){this.Hm(t,!1)},Hm:function(t,i){var e=this.getItem(t);e&&(e.disabled=i,this.refresh(t))},isItemEnabled:function(t){var i=this.getItem(t);return i&&!i.disabled},La:function(t,i,e){return this.isItemEnabled(t)?t:(t=this.getNextId(t,e)||null)&&t!=i?this.La(t,i,e):i}},Er={api:Br,view:F.protoUI(Br,Me,Xe,Ce,Pe,Je,ns,ss,Rr.view,ye)};ii(Er.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){ai(this.config.uploader).files.remove(i)}}});var jr={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(){},$skin:function(){ar.api.$skin.call(this),"material"!=he&&"mini"!=he||(this.defaults.css="webix_primary")},$init:function(){this.files=new vr,this.Vt=[this.files],F.extend(this,Ts,!0)},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i)&&this.render()},apiOnly_setter:function(t){return C(this.render,this),this.$apiOnly=t},Uc:function(t){for(var i=0;i<t.length;i++)this.addFile(t[i])},link_setter:function(t){return t&&C(function(){var t=ai(this.B.link);if(!t){var i=this.getTopParentView();i.$$&&(t=i.$$(this.B.link))}t.sync&&t.filter?t.sync(this.files):t.setValues&&this.files.data.attachEvent("onStoreUpdated",function(){t.setValues(this,!1,"auto")}),t.B.uploader=this.B.id},this),t},addFile:function(t,i,e,s){var n=null;"object"==M(t)&&(t=(n=t).name,i=n.size);var r=this.Rm(i);e=e||t.split(".").pop();var h={file:n,name:t,id:$(),size:i,sizetext:r,type:e,context:this.Kc,status:"client"};if(n&&n.webkitRelativePath&&(h.name=n.webkitRelativePath),s&&F.extend(h,s,!0),this.callEvent("onBeforeFileAdd",[h])){this.B.multiple||this.files.clearAll();var o=this.files.add(h);this.callEvent("onAfterFileAdd",[h]),o&&this.B.autosend&&this.send(o)}return h},Zc:function(t){var i=this.B.upload,e=F.extend(t.urlData||{},this.B.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=" "+ut({content:'"'+i+'"'},":before"));var n="webix_drop_file"+s,r=null;Zt(e,"dragover",wt),Zt(e,"dragover",function(){Mt(e,n,!0),r&&(clearTimeout(r),r=null)}),Zt(e,"dragleave",function(){r=setTimeout(function(){St(e,n)},150)}),Zt(e,"drop",k(function(t){return St(e,n),this.$drop(t),wt(t)},this))},Rm:function(t){for(var i=0;1024<t;)i++,t/=1024;return Math.round(100*t)/100+" "+P.fileSize[i]},"if":function(t,i){var e=this.files.getItem(t);F.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.tf(i)},tf:function(t){this.callEvent("onUploadComplete",[t]),this.Jc&&(this.Jc.call(this,t),this.Jc=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(",")}},Lr=(F.protoUI(jr,ar.view),{name:"texthighlight",defaults:{template:function(t,i){var e=t.name||t.id,s="x"+$(),n=i.Fp(t),r='<div class="webix_text_highlight" style="width:'.concat(n,'px;"><div class="webix_text_highlight_value"');return"textarea"==t.type&&G.mobile&&G.isSafari&&(r+=' style="margin-left:'.concat(re.dataPadding+3,"px; margin-right:").concat(re.dataPadding+3,'px;"')),r+="></div></div>","textarea"==t.type?(r+="".concat(i.Pp("textarea"),' style="width:').concat(n,'px;" id="').concat(s,'" name="').concat(e,'" class="webix_inp_textarea">').concat(i.vp(t.value),
"</textarea>"),i.$renderInput(t,r,s)):r+i.$renderInput(t)},highlight:function(t){return qt.escape(t)},type:"text"},$init:function(t){var i=this,e=t.type||this.defaults.type;this.zt.className+=" webix_el_"+e,"textarea"==e?(delete t.clear,t.height=t.height||0,t.minHeight=t.minHeight||60,this.Hi=!0):(this.scrollEv=Qt(document,"selectionchange",function(){i.$view.contains(document.getSelection().focusNode)&&i.Bm()}),this.attachEvent("onDestruct",function(){ti(i.scrollEv)})),this.attachEvent("onChange",function(){return i.Bm()}),this.attachEvent("onAfterRender",function(){i.Em();["scroll","focus","blur","paste","cut","keyup","input"].forEach(function(t){return Zt(i.getInputNode(),t,function(){return i.Bm()})}),i.jm(!0)})},$setSize:function(){dr.api.$setSize.apply(this,arguments),this.Em()},$renderIcon:function(t){return"text"==t.type?dr.api.$renderIcon.apply(this,arguments):""},Vp:function(t){return"textarea"==this.B.type?t?this.Jd-this.B.inputPadding:"":dr.api.Vp.apply(this,arguments)},getInputNode:function(){return this.tt.querySelector("text"==this.B.type?"input":"textarea")},Lm:function(){return this.tt.querySelector(".webix_text_highlight")},jm:function(t){var i=this.Lm().firstElementChild,e=this.getValue();(t||e!=(this.Om||""))&&(this.Om=e,i.innerHTML=this.B.highlight.apply(this,[e])+" ")},Nm:function(){var t=this.Lm();"text"==this.B.type&&(t=t.firstElementChild);var i=this.getInputNode();t.scrollTop=i.scrollTop,t.scrollLeft=i.scrollLeft},Em:function(){if(this.Q_&&this.isVisible()){var t=this.getInputNode(),i=this.Lm().style;i.left=t.offsetLeft+"px",i.top=t.offsetTop+"px",i.height=t.getBoundingClientRect().height+"px"}},Bm:function(){C(function(){this.$destructed||(this.jm(),this.Nm())},this)}}),Or=(F.protoUI(Lr,dr.view),{name:"timeboard",defaults:{width:260,hours:!0,seconds:!1,twelve:/%([a,A])/.test(P.timeFormat)},$skin:function(){An.api.$skin.call(this),this.defaults.margin=re.layoutMargin.form,this.defaults.padding=re.layoutPadding.space},$init:function(t){var s=this;this.$view.className+=" webix_timeboard";var i=[],e=z(t.twelve)?this.defaults.twelve:t.twelve,n=z(t.hours)?this.defaults.hours:t.hours,r=t.seconds||this.defaults.seconds;if(z(t.height)){var h=1+1*n+1+1*r+1*!!t.button;t.height=re.inputHeight*h+(t.margin||this.defaults.margin)*(h-1)+2*(t.padding||this.defaults.padding)}i.push(this.Wm(n,r,e)),i.push.apply(i,o(this.Ym(n,r,e))),t.button&&i.push(this.Um()),t.rows=[{view:"form",elements:i,padding:0,borderless:!0,on:{onChange:function(t,i,e){return s.qm(e)}}}],this.$ready.push(function(){this.Gm=this.queryView("form");var t=this.B.value;t&&this.setValue(t,"auto")})},setValue:function(t,i){t=this.$prepareValue(t);var e=this.B.value;rn.equal(t,e)||(this.B.value=t,this.$setValue(t),this.callEvent("onChange",[t,e,i]))},$prepareValue:function(t){return"string"==typeof t&&(t=P.parseTimeFormatDate(t)),t||rn.datePart(new Date)},$setValue:function(t){var i={};i.minutes=i.sminutes=t.getMinutes(),this.B.hours&&(i.shours=i.hours=t.getHours()),this.B.seconds&&(i.sseconds=i.seconds=t.getSeconds()),this.B.twelve&&(z(i.hours)||(i.day_part=11<i.hours?P.pm[1]:P.am[1],i.hours=i.hours&&12!=i.hours?i.hours%12:12,i.shours=12==i.hours?0:i.hours)),this.Gm.setValues(i,!1,"auto")},qm:function(t){var i=this.$getValue(),e=this.B.value?rn.copy(this.B.value):new Date;e.setHours(i.hours||0),e.setMinutes(i.minutes),this.B.seconds&&e.setSeconds(i.seconds),this.setValue(e,t)},$getValue:function(){var t=this.Gm.getValues();return this.B.twelve&&this.B.hours&&(t.day_part==P.pm[1]&&t.hours<12?t.hours=(1*t.hours+12).toString():t.day_part==P.am[1]&&12==t.hours&&(t.hours=0)),t},getValue:function(){if(this.B.stringResult){var t=this.$getValue(),i=[];return t.hours&&i.push(t.hours),t.minutes&&i.push(t.minutes),t.seconds&&i.push(t.seconds),i.join(":")}return this.B.value},Wm:function(t,i,e){var s=[{},this.Xm("minutes"),{}],n={css:"webix_colon_template",template:":",borderless:!0,width:16};if(t&&s.splice(1,0,this.Xm("hours",e),S(n)),i&&s.splice(-1,0,S(n),this.Xm("seconds")),e&&t){var r=P.am[1],h=P.pm[1],o={view:"label",name:"day_part",
css:"webix_day_part",template:"<div tabindex='0' role='button' class='webix_el_box' style='width:#awidth#px;height:#aheight#px;line-height:#cheight#px'>#label#</div>",inputWidth:30,on:{onItemClick:function(){this.setValue(this.getValue()==r?h:r,"user")},onKeyPress:function(t,i){this.De(t,i)}}};s.splice(-1,1,o)}return{type:"clean",cols:s}},Xm:function(e,s){var n=this,i="hours"===e?s?11:23:59;return{view:"text",width:kt("00").width+2*re.dataPadding+2*re.inputPadding,name:e,format:{parse:function(t){return 12==t&&"hours"===e&&s&&(t="00"),1<t.length?t.replace(/^0/,""):t||0},edit:function(t){return t<=0&&"hours"===e&&s?t=12:t<0?t=0:i<t&&(t=i),1===(t+"").length?"0"+t:t+""||"00"}},on:{onChange:function(t){var i=1*(!s||"hours"!==e||t&&12!=t?t:0);n.Gm.elements["s"+e].setValue(i,"auto")}}}},Ym:function(t,i,e){var s=[this.Km("minutes",P.calendar.minutes,59)];return t&&s.unshift(this.Km("hours",P.calendar.hours,e?11:23)),i&&s.push(this.Km("seconds",P.timeboard.seconds,59,e)),s},Km:function(e,t,i,s){var n=this,r="hours"===e&&s;return{view:"slider",name:"s"+e,title:t,moveTitle:!1,min:0,max:i,on:{onChange:function(t){n.Gm.elements[e].setValue((r?t&&12!=t?t%12:12:t)+"","auto")},onSliderDrag:function(){var t=this.getValue(),i=this.getFormView();i.blockEvent(),i.elements[e].setValue((r?t&&12!=t?t%12:12:t)+"","auto"),i.unblockEvent()}}}},Um:function(){var t=this;return{view:"button",value:P.calendar.done,css:"webix_primary",click:function(){t.callEvent("onTimeSelect",[t.B.value])}}}}),Nr=(F.protoUI(Or,An.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:qt,filter_setter:function(t){return v(t,this.$scope)},Jm:!0,$init:function(t){var i={};F.extend(i,S(this.defaults.body)),i.view=t.type||this.defaults.type;var e=this.Zm(i);t.body&&F.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.Qm),this.attachEvent("onShow",function(){if(this.B.master){var t=ai(this.B.master);if(t)(t.tb?t.tb():t.getInputNode()).setAttribute("aria-expanded","true");this.ib()}}),this.attachEvent("onHide",function(){if(this.B.master){var t=ai(this.B.master);if(t)(t.tb?t.tb():t.getInputNode()).setAttribute("aria-expanded","false")}}),this.eb={}},Zm:function(t){return t},sb:function(t){return z(t)?null:{config:t}},nb:function(t){this.Po.value=t},rb:function(t){var i,e=t.id?this.getItemText(t.id):t.text||t.value;if(this.B.master){var s=ai(this.B.master);if(i=s.getInputNode()){var n=s.B.text;s.options_setter?s.$setValue(t.$empty?"":t.id):s.$setValueHere?s.$setValueHere(e,t,this.sb()):s.$setValue(e),s.B.text=n}}else this.Po&&this.nb(e);(i=i||this.Po)&&i.focus()},setMasterValue:function(t,i,e){var s=t.id?this.getItemText(t.id):t.text||t.value;if(this.B.master){var n=ai(this.B.master);i&&t.id?n.refresh():n.options_setter?n.setValue(t.$empty?"":t.id,e):n.setValueHere?n.setValueHere(s,t,this.sb(e)):n.setValue(s,e)}else this.Po&&this.nb(s);i||(this.hide(),this.Po&&this.Po.focus()),this.callEvent("onValueSuggest",[t,s])},getMasterValue:function(){return this.B.master?ai(this.B.master).getValue():null},getItemId:function(t){var i=this.getList();for(var e in i.data.pull){var s=i.getItem(e);if(this.B.filter.call(this,s,t))return s.id}},getItemText:function(t){var i=this.getList().getItem(t);if(!i)return this.eb[t]||"";if(this.B.template)return this.B.template.call(this,i,this.type);if(this.B.textValue)return""+i[this.B.textValue];var e=this.getList().type,s=e.template.call(e,i,e);return this.eb[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"==M(i)&&(i+=""),e.getItem(i).$empty)?null:i},getList:function(){return this.$t},Qm:function(){var i=this.getList(),t=this.B.type
;i.count?(i.attachEvent("onItemClick",k(function(t){this.setMasterValue(i.getItem(t),!1,"user")},this)),i.data.attachEvent("onStoreUpdated",k(function(t,i,e){"delete"==e&&t==this.getMasterValue()?this.setMasterValue({id:"",text:""},!0,"auto"):"update"==e&&t==this.getMasterValue()&&this.setMasterValue(i,!0,"auto")},this)),i.data.attachEvent("onAfterFilter",k(this.hb,this)),i.data.attachEvent("onStoreLoad",k(this.hb,this)),z(this.B.fitMaster)&&(this.B.fitMaster=!0)):"calendar"==t?(i.attachEvent("onAfterDateSelect",function(){this.getParentView().setMasterValue({value:i.getSelectedDate()},i.config.multiselect,"user")}),i.attachEvent("onTodaySet",function(t){this.getParentView().setMasterValue({value:t},!1,"user")}),i.attachEvent("onDateClear",function(t){this.getParentView().setMasterValue({value:t},!1,"user")})):"colorboard"==t?i.attachEvent("onItemClick",function(t){this.getParentView().setMasterValue({value:t},!1,"user")}):"timeboard"==t?i.attachEvent("onTimeSelect",function(t){this.getParentView().setMasterValue({value:t},!1,"user")}):"colorselect"==t&&i.attachEvent("onColorSelect",function(t){this.getParentView().setMasterValue({value:t},!1,"user")})},input_setter:function(t){return this.linkInput(t),0},linkInput:function(i){var e;i.getInputNode?(e=i.getInputNode()).webix_master_id=i.B.id:e=D(i),Zt(e,"keydown",function(t){e==document.body&&!this.isVisible()||(i.config?i.config.readonly:e.getAttribute("readonly"))||this.ob(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.ab=!0},ob:function(t){this.ub&&(this.ub=clearTimeout(this.ub)),t=t||event;var e=this.getList(),s=t.target;if((s!=document.body||this.isVisible())&&"webix_clipbuffer"!=s.className){this.Po=s,this.B.master=s.webix_master_id;var i=t.keyCode;if(16!=i&&17!=i){if(9==i)return this.cb(t,e);if(27==i)return this.fb(t,e);if(13==i)return this.$enterKey(t,e);if(this.lb(t)&&this.isVisible())return wt(t),!1;var n="true"==s.getAttribute("contentEditable")||""==s.getAttribute("contentEditable");z(s.value)&&!n||(this.ub=C(function(){if(this.ab||ji.getFocus()==ai(this.B.master)){this.db=!0;var i=n?s.innerText:s.value;this.vb&&this.vb(),e.config.dataFeed?e.filter("value",i):e.filter&&e.filter(k(function(t){return this.B.filter.call(this,t,i)},this))}},this,[],this.B.keyPressTimeout))}}},hb:function(){if(!this.db)return!0;this.db=!1,0<this.getList().count()?(this.adjust(),this.isVisible()||(this._b=!0),this.show(this.Po,null,!0),this._b=!1):(this.hide(),this.Po=null)},show:function(t){var i=!t||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName?null:t;if(!this.isVisible()||i&&i!=this.Po){var e=this.getList();e.filter&&!this._b&&e.filter(""),this.$customWidth?this.$customWidth(t):t&&t.tagName&&this.B.fitMaster&&(this.B.width=t.offsetWidth-2),e.vv&&e.render(),this.adjust(),i&&(this.Po=i)}Nn.api.show.apply(this,arguments)},ib:function(){var t=this.getList(),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.B.master&&(i=ai(this.B.master).$prepareValue(i)),t.setValue(i,"auto"))},$enterKey:function(t,i){var e,s,n=this.isVisible();this.B.master&&(s=ai(this.B.master)),s&&s.Hp&&s.B.editable?s.xi():n&&(i.count?(e=i.getSelectedId(!1,!0),1==i.count()&&i.getFirstId()!=e&&(e=i.getFirstId()),e&&(e=i.getItem(e))):(i.getSelectedDate?e=i.getSelectedDate():i.getValue&&(e=i.getValue()),e&&(e={value:e})),e&&this.setMasterValue(e,!1,"user")),n?this.hide():this.Jm&&this.show(this.Po)},fb:function(){return this.hide()},cb:function(){return this.hide()},lb: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||38===s){this.Jm&&!this.isVisible()&&this.show(this.Po);var n=38===s?"up":"down";e.moveSelection(n,!1,!1)}else{if(e.count||!e.count&&!e.isVisible())return!1;var r;33==s&&(r="pgup"),34==s&&(r="pgdown"),35==s&&(r="bottom"),36==s&&(r="top"),
37==s&&(r="left"),39==s&&(r="right"),e.moveSelection(r,!1,!1)}return e.count?i=e.getSelectedItem(!1):(e.getSelectedDate?i=e.getSelectedDate():e.getValue&&(i=e.getValue()),i&&(i={value:i})),i&&this.isVisible()&&this.rb(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()))}}),Wr={api:Nr,view:F.protoUI(Nr,Nn.view)};F.protoUI({name:"multisuggest",defaults:{template:"GPL version doesn't support multisuggest <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"checksuggest",defaults:{template:"GPL version doesn't support checksuggest <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"datasuggest",defaults:{template:"GPL version doesn't support datasuggest <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"gridsuggest",defaults:{template:"GPL version doesn't support gridsuggest <br> You need Webix PRO"}},Cn.view);var Yr={name:"mentionsuggest",defaults:{symbol:"@",filter:function(t,i){var e=this.B.symbol;return-1!==(i=i.substring(0,this.pb)).indexOf(e)&&(!!(i=i.substring(i.lastIndexOf(e)+e.length)).length&&-1!==(t.id?this.getItemText(t.id):t.text||t.value).toString().toLowerCase().indexOf(i.toLowerCase()))}},$init:function(){this.attachEvent("onValueSuggest",this.vb)},$enterKey:function(t){var i;this.isVisible()&&(wt(t),this.B.master&&(i=ai(this.B.master)),i&&i.callEvent&&i.callEvent("onEnter"));return Wr.api.$enterKey.apply(this,arguments)},vb:function(){this.Po&&(this.pb=It(this.Po).start)},sb:function(t){return{pos:this.pb,symbol:this.B.symbol,config:t}},rb:function(){},nb:function(t){var i=this.B.symbol,e=this.Po.value,s=e.substring(this.pb);e=(e=e.substring(0,this.pb)).substring(0,e.lastIndexOf(i)+i.length)+t,this.Po.value=e+s,Dt(this.Po,e.length)},Jm:!1};F.protoUI(Yr,Wr.view);F.protoUI({name:"daterange",defaults:{template:"GPL version doesn't support daterange <br> You need Webix PRO"}},Cn.view);var Ur={name:"daterangesuggest",defaults:{type:"daterange",body:{view:"daterange",icons:!0,button:!0,borderless:!0}},getValue:function(){return this.getRange().getValue()},setValue:function(t,i){this.getRange().setValue(S(t),i)},getRange:function(){return this.getBody()},getButton:function(){return this.getBody().getChildViews()[1].getChildViews()[1]},mb:function(t){var i=ai(this.B.master);i&&i.setValue(t,"user")},Qm:function(){var t=this.getRange();t.attachEvent("onAfterDateSelect",k(function(t){this.mb(t)},this)),t.attachEvent("onDateClear",k(function(t){this.mb(t)},this)),t.attachEvent("onTodaySet",k(function(t){this.mb(t)},this))}};F.protoUI(Ur,Wr.view);F.protoUI({name:"daterangepicker",defaults:{template:"GPL version doesn't support daterangepicker <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"excelbar",defaults:{template:"GPL version doesn't support excelbar <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"excelviewer",defaults:{template:"GPL version doesn't support excelviewer <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"pdfbar",defaults:{template:"GPL version doesn't support pdfbar <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"pdfviewer",defaults:{template:"GPL version doesn't support pdfviewer <br> You need Webix PRO"}},Cn.view);var qr,Gr,Xr={name:"video",$init:function(t){t.id||(t.id=$()),this.$ready.push(this.bb)},bb:function(){var t=this.B;if(this.Ui=lt("video",{"class":"webix_view_video",style:"width:100%;height:100%;",autobuffer:"autobuffer"},""),t.poster&&(this.Ui.poster=t.poster),t.src){"object"!=M(t.src)&&(t.src=[t.src]);for(var i=0;i<t.src.length;i++)this.Ui.innerHTML+=' <source src="'+t.src[i]+'">'}t.controls&&(this.Ui.controls=!0),t.autoplay&&(this.Ui.autoplay=!0),this.zt.appendChild(this.Ui)},getVideo:function(){return this.Ui},defaults:{src:"",controls:!0}};F.protoUI(Xr,Qi.view);F.protoUI({name:"gage",defaults:{template:"GPL version doesn't support gage <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"barcode",defaults:{
template:"GPL version doesn't support barcode <br> You need Webix PRO"}},Cn.view),F.protoUI({name:"bulletgraph",defaults:{template:"GPL version doesn't support bulletgraph <br> You need Webix PRO"}},Cn.view);var Kr,Jr,Zr={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.Ui=this.$view.firstChild,this.gb=m.defer(),t.chart=F.extend(t.chart||{},this.defaults.chart),this.data.provideApi(this,!0),this.$ready.push(this.render),this.data.attachEvent("onClearAll",k(this.wb,this)),this.data.attachEvent("onStoreUpdated",k(this.xb,this))},getMap:function(t){return t?this.gb:this.Aa},yb:function(t){return k(function(){"function"==typeof t&&t(),qr=qr||window.google,this.Mb()},this)},render:function(){"undefined"==typeof window.google||"undefined"==typeof window.google.charts?(Gr||((Gr=document.createElement("script")).type="text/javascript",Gr.src="//www.gstatic.com/charts/loader.js",document.getElementsByTagName("head")[0].appendChild(Gr)),Gr.onload=this.yb(Gr.onload)):this.yb()()},Mb:function(){qr.visualization&&qr.visualization.GeoChart?(this.Aa=new qr.visualization.GeoChart(this.Ui),this.Sb(),this.gb.resolve(this.Aa)):(qr.charts.load("current",{packages:["geochart"],mapsApiKey:this.B.key}),qr.charts.setOnLoadCallback(k(function(){this.Mb()},this)))},$onLoad:function(t){return!this.Aa&&(this.gb.then(k(function(){this.parse(t,this.B.datatype)},this)),!0)},xb:function(){if(this.Aa){var n=this.xf&&this.xf.length?this.xf:this.kb(),r=[];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.B.tooltip(t)),i.push(s)}r.push(i)},this),n.length){for(var t=new qr.visualization.DataTable,i=0;i<n.length;i++)t.addColumn(n[i]);t.addRows(r);var e=new qr.visualization.DataView(t);this.Aa.draw(e,this.B.chart)}else this.Aa.draw(qr.visualization.arrayToDataTable([["",""]]),{})}else this.Aa||this.gb.then(k(this.xb,this))},setDisplayMode:function(t){this.B.chart.displayMode=t,this.refresh()},setRegion:function(t){this.B.chart.region=t,this.refresh()},refresh:function(){this.Aa.clearChart(),this.xb()},tooltip_setter:function(t){var i=this.B.chart.tooltip;return this.B.chart.tooltip=F.extend(i||{},{isHtml:!0}),qt(t)},$setSize:function(t,i){Qi.api.$setSize.apply(this,arguments)&&this.Aa&&(F.extend(this.B,{width:t,height:i}),this.refresh())},wb:function(){this.xf=null,this.xb()},Cb:function(t,i){if(!t||z(t[i]))return"string";var e=M(t[i]);return"string"!=e||isNaN(1*t[i])||(e="number"),e},kb:function(){var t=this.B.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"!==M(t[s])&&(t[s]={type:this.Cb(i,t[s]),label:t[s]});return this.B.tooltip&&t.push({type:"string",role:"tooltip",p:{html:!0}}),this.xf=t},Sb:function(){qr.visualization.events.addListener(this.Aa,"error",k(function(){this.callEvent("onMapError",arguments)},this)),qr.visualization.events.addListener(this.Aa,"ready",k(function(){this.callEvent("onMapReady",arguments)},this)),qr.visualization.events.addListener(this.Aa,"regionClick",k(function(){this.callEvent("onRegionClick",arguments)},this)),qr.visualization.events.addListener(this.Aa,"select",k(function(){var t=this.Aa.getSelection()[0],i=t||this.$b;if(i){var e=this.data.order[i.row];this.$b=i,this.callEvent("onItemClick",[e,!!t])}},this))}},Qr=(F.protoUI(Zr,Fe,b,Qi.view),{name:"google-map",$init:function(){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.Ui=this.$view.firstChild,this.gb=m.defer(),this.data.provideApi(this,!0),this.$ready.push(this.render)},getMap:function(t){return t?this.gb:this.Aa},yb:function(t){return k(function(){"function"==typeof t&&t(),Kr=Kr||window.google,this.Mb.call(this)},this)},render:function(){if("undefined"==typeof window.google||"undefined"==typeof window.google.maps){if(!Jr){(Jr=document.createElement("script")).type="text/javascript"
;var t=this.B,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),Jr.src=i,document.getElementsByTagName("head")[0].appendChild(Jr)}Jr.onload=this.yb(Jr.onload)}else this.yb()()},Mb:function(){var t=this.config;this.isVisible(t.id)&&(this.Aa=new Kr.maps.Map(this.Ui,{zoom:t.zoom,center:new Kr.maps.LatLng(t.center[0],t.center[1]),mapTypeId:Kr.maps.MapTypeId[t.mapType]}),this.gb.resolve(this.Aa),this.Ui.firstChild.setAttribute("webix_disable_drag","true"))},center_setter:function(t){return this.Aa&&this.Aa.setCenter(new Kr.maps.LatLng(t[0],t[1])),t},mapType_setter:function(t){return this.Aa&&this.Aa.setMapTypeId(Kr.maps.MapTypeId[t]),t},zoom_setter:function(t){return this.Aa&&this.Aa.setZoom(t),t},layerType_setter:function(t){return"heatmap"==t&&(this.config.libraries="visualization"),this.Db[t]&&(F.extend(this,this.Db[t],!0),this.data.attachEvent("onStoreUpdated",k(function(){this.gb.then(k(function(){this.drawData.call(this,arguments)},this))},this))),t},defaults:{zoom:5,center:[39.5,-98.5],mapType:"ROADMAP",layerType:"marker"},$setSize:function(){Qi.api.$setSize.apply(this,arguments),this.Aa&&Kr.maps.event.trigger(this.Aa,"resize")},$onLoad:function(t){return!this.Aa&&(this.gb.then(k(function(){this.parse(t)},this)),!0)},Db:{marker:{drawData:function(t,i,e){switch(e){case"add":case"update":i.$marker=this.Ib(i);break;case"delete":i.$marker.setMap(null);break;default:this.data.each(function(t){t.$marker=this.Ib(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.Aa.setCenter(new Kr.maps.LatLng(i.lat,i.lng))},Ib:function(t){var i={};for(var e in t)i[e]=t[e];i.position=new Kr.maps.LatLng(t.lat,t.lng),i.map=t.hidden?null:this.Aa;var s=t.$marker;return s?t.$marker.setMap(i.map):(s=new Kr.maps.Marker(i),this.yt(s)),this.callEvent("onItemRender",[t]),s},yt:function(t){var i=this;t.addListener("click",function(){i.callEvent("onItemClick",[this.id,this])}),t.getDraggable()&&(t.addListener("dragend",function(){i.Ab(this,!0)}),t.addListener("drag",function(){i.Ab(this)}))},Ab: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.Tb&&(this.Tb.setMap(null),this.Tb=null);var i=[];if(this.data.each(function(t){i.push(this.Fb(t))},this),i.length){var t=F.extend(this.config.heatmapConfig,{data:i,map:this.Aa},!0);this.Tb=new Kr.maps.visualization.HeatmapLayer(t),this.callEvent("onHeatMapRender",[this.Tb])}},getHeatmap:function(){return this.Tb},Fb:function(t){var i={};for(var e in t)i[e]=t[e];return i.location=new Kr.maps.LatLng(t.lat,t.lng),i}}}}),th=(F.protoUI(Qr,Fe,b,Qi.view),{$render_pie:function(t,i,e,s,n,r){this.zb(t,i,e,s,1,r,n)},zb:function(t,i,e,s,n,r,h){if(i.length){var o=this.Pb(e,s),a=this.B.radius?this.B.radius:o.radius;if(!(a<0)){var u=this.Vb(i),c=this.lc(u),f=this.fc(u,c),l=this.B.x?this.B.x:o.x,d=this.B.y?this.B.y:o.y;1==n&&this.B.shadow&&this.Hb(t,l,d,a),d/=n;var v,_=-Math.PI/2,p=[];if(t.scale(1,n),this.B.gradient){var m=1!=n?l+a/3:l,b=1!=n?d+a/3:d;this.Rb(t,l,d,a,m,b)}for(var g=0;g<i.length;g++)if(u[g]){t.strokeStyle=this.B.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.B.color.call(this,i[g]);t.fillStyle=x,t.fill(),this.B.pieInnerText&&this.Bb(l,d,5*a/6,_,w,n,this.B.pieInnerText(i[g],c),!0),this.B.label&&this.Bb(l,d,a+this.B.labelOffset,_,w,n,this.B.label(i[g])),1!=n&&(this.Eb(t,l,d,_,w,a,!0),t.fillStyle="#000000",t.globalAlpha=.2,this.Eb(t,l,d,_,w,a,!1),t.globalAlpha=1,t.fillStyle=x),r.addSector(i[g].id,_,w,l-e.x,d-e.y/n,a,n,h),_=w}for(t.globalAlpha=.8,g=0;g<p.length;g++)v=this.jb(p[g],l,d,a),this.Lb(t,l,d,v.x,v.y,this.B.lineColor.call(this,i[g]),2);(t.globalAlpha=1)==n&&this.B.border&&(t.lineWidth=this.B.borderWidth||2,
t.strokeStyle=this.B.borderColor?this.B.borderColor.call(this):"#ffffff",t.beginPath(),t.arc(l,d,a+1,0,2*Math.PI,!1),t.stroke()),t.scale(1,1/n)}}},Vb:function(t){for(var i=[],e=0;e<t.length;e++)i.push(Math.abs(parseFloat(this.B.value(t[e]))||0));return i},lc:function(t){for(var i=0,e=0;e<t.length;e++)i+=t[e];return i},fc:function(t,i){var e,s=[],n=0;i=i||this.lc(t);for(var r=0;r<t.length;r++)e=t[r],s[r]=2*Math.PI*(i?(e+n)/i:1/t.length),n+=e;return s},Pb: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)}},Eb:function(t,i,e,s,n,r,h){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,h=!1,this.Ob(t,i,e,r,s,n)),s<=Math.PI&&n>=Math.PI&&(n=Math.PI,h=!1,this.Ob(t,i,e,r,s,n));var o=(this.B.pieHeight||Math.floor(r/4))/this.B.cant;t.beginPath(),t.arc(i,e,r,s,n,!1),t.lineTo(i+r*Math.cos(n),e+r*Math.sin(n)+o),t.arc(i,e+o,r,n,s,!0),t.lineTo(i+r*Math.cos(s),e+r*Math.sin(s)),t.fill(),h&&t.stroke()}},Ob:function(t,i,e,s,n,r){t.beginPath(),t.arc(i,e,s,n,r,!1),t.stroke()},Hb:function(t,i,e,s){t.globalAlpha=.5;for(var n=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"],r=n.length-1;-1<r;r--)t.beginPath(),t.fillStyle=n[r],t.arc(i+1,e+1,s+r,0,2*Math.PI,!0),t.fill();t.globalAlpha=1},Nb:function(t){return t.addColorStop(0,"#ffffff"),t.addColorStop(.7,"#7a7a7a"),t.addColorStop(1,"#000000"),t},Rb:function(t,i,e,s,n,r){var h;t.beginPath(),h="function"!=typeof this.B.gradient?(h=t.createRadialGradient(n,r,s/4,i,e,s),this.Nb(h)):this.B.gradient(h),t.fillStyle=h,t.arc(i,e,s,0,2*Math.PI,!0),t.fill(),t.globalAlpha=.7},Bb:function(t,i,e,s,n,r,h,o){var a=this.canvases[0].renderText(0,0,h,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&&r<1&&0<f&&f<Math.PI&&(v=(this.B.height||Math.floor(e/4))/r);var _=(i+Math.floor((e+v)*Math.sin(f)))*r-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,r){this.zb(t,i,e,s,this.B.cant,r)},$render_donut:function(t,i,e,s,n,r){if(i.length){this.zb(t,i,e,s,1,r,n);var h=this.B,o=this.Pb(e,s),a=h.radius?h.radius:o.radius;if(!(a<=0)){var u=h.innerRadius&&h.innerRadius<a?h.innerRadius:a/3,c=h.x?h.x:o.x,f=h.y?h.y:o.y;if(t.fillStyle=re.backColor,t.beginPath(),t.arc(c,f,u,0,2*Math.PI,!0),t.fill(),this.B.donutInnerText){var l=this.Vb(i),d=this.lc(l),v=re.dataPadding,_=2*u-2*v,p=this.canvases[0].renderText(c-u+v,f-u+v,'<div class="webix_donut_center_text">'.concat(this.B.donutInnerText(i,d),"</div>"),"webix_donut_center_text_box",_);p.style.height=p.style.lineHeight=_+"px"}}}}}),ih={$render_bar:function(t,i,e,s,n,r){var h,o,a,u,c,f,l,d,v,_,p,m,b,g=s.y-e.y;b=!!this.B.yAxis,m=!!this.B.xAxis,c=(u=this.Wb()).max,f=u.min,o=(s.x-e.x)/i.length,n||"auto"!=this.B.origin&&!b||this.Yb(i,e,s,f,c,o),b&&(c=parseFloat(this.B.yAxis.end),f=parseFloat(this.B.yAxis.start)),l=(v=this.Ub(f,c))[0],d=v[1],p=l?g/l:l,b||"auto"!=this.B.origin&&m||(_=10,p=l?(g-_)/l:_),!n&&"auto"!=this.B.origin&&!b&&this.B.origin>f&&this.qb(t,i,e,s,o,s.y-p*(this.B.origin-f)),h=parseInt(this.B.barWidth,10);var w=0,x=0;for(a=0;a<this.Gb.length;a++)a==n&&(x=w),"bar"==this.Gb[a].type&&w++;this.Gb&&o<h*w+4&&(h=parseInt(o/w-4,10));var y=(o-h*w)/2,M="undefined"!=typeof this.B.radius?parseInt(this.B.radius,10):Math.round(h/5),S=!1,k=this.B.gradient;for(k&&"function"!=typeof k?(S=k,k=!1):k&&(k=t.createLinearGradient(0,s.y,0,e.y),this.B.gradient(k)),m||this.Lb(t,e.x,s.y+.5,s.x,s.y+.5,"#edeff0",1),a=0;a<i.length;a++){var C=parseFloat(this.B.value(i[a])||0);if(this.Xb&&(C=this.Kb(C)),C&&!isNaN(C)){c<C&&(C=c),C-=f,C*=d;var $=e.x+y+a*o+(h+1)*x,D=s.y,I=k||this.B.color.call(this,i[a]),A=this.B.border?1:0,
T=this.B.label(i[a]);b||"auto"!=this.B.origin&&m?C==this.B.origin||"auto"==this.B.origin&&this.B.value(i[a])==f?(A=0,T=""):(C<0||this.B.yAxis&&0===C&&!("auto"!=this.B.origin&&this.B.origin>f))&&(C=A=0,T=""):C+=_/p,t.globalAlpha=this.B.alpha.call(this,i[a]);var F=this.Jb(t,e,$,D,h,f,M,p,C,I,k,S,A);S&&this.Zb(t,$,D,h,f,M,p,C,I,S,A),A&&this.Qb(t,$,D,h,f,M,p,C,I),t.globalAlpha=1,F[0]!=$?this.canvases[n].renderTextAt(!1,!0,$+Math.floor(h/2),F[1],T):this.canvases[n].renderTextAt(!0,!0,$+Math.floor(h/2),F[3],T),r.addRect(i[a].id,[$-e.x,F[3]-e.y,F[2]-e.x,F[1]-e.y],n)}}},tg:function(t,i,e,s,n,r,h){var o=e;return"auto"!=this.B.origin&&this.B.origin>h&&(o=e-=(this.B.origin-h)*n,(s-=this.B.origin-h)<0&&(s*=-1,t.translate(i+r,e),t.rotate(Math.PI),e=i=0),e-=.5),{value:s,x0:i,y0:e,start:o}},Jb:function(t,i,e,s,n,r,h,o,a,u,c,f,l){t.save(),t.fillStyle=u;var d=this.tg(t,e,s,a,o,n,r),v=this.ig(t,d.x0,d.y0,n,h,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]]},eg:function(t,i){var e,s;s=rs.toRgb(i),(e=rs.rgbToHsv(s[0],s[1],s[2]))[2]/=1.4;var n="rgb("+rs.hsvToRgb(e[0],e[1],e[2])+")";t.strokeStyle=n,1==t.globalAlpha&&(t.globalAlpha=.9)},Qb:function(t,i,e,s,n,r,h,o,a){var u;t.save(),u=this.tg(t,i,e,o,h,s,n),this.eg(t,a),this.ig(t,u.x0,u.y0,s,r,h,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},Zb:function(t,i,e,s,n,r,h,o,a,u,c){t.save();var f=this.tg(t,i,e,o,h,s,n),l=this.sg(t,f.x0,f.y0,f.x0+s,f.y0-h*f.value+2,u,a,"y");t.fillStyle=l.gradient,this.ig(t,f.x0+l.offset,f.y0,s-2*l.offset,r,h,f.value,l.offset+c),t.fill(),t.restore()},ig:function(t,i,e,s,n,r,h,o,a){t.beginPath();var u=0;if(r*h<n){var c=(n-r*h)/n;c<=1&&-1<=c&&(u=-Math.acos(c)+Math.PI/2)}t.moveTo(i+o,e);var f=e-Math.floor(r*h)+n+(n?0:o);n<r*h&&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]}},eh={$render_line:function(t,i,e,s,n,r){var h,o,a,u,c,f,l,d,v,_,p,m;if(u=this.ng(t,i,e,s,n),h=this.B,i.length){for(c=h.offset?e.x+.5*u.cellWidth:e.x,a=[],o=0;o<i.length;o++)if((m=this.rg(i[o],e,s,u))||"0"==m){if(l=o?u.cellWidth*o-.5+c:c,v="object"==M(m)?m.y0:m,o&&this.B.fixOverflow){if((p=this.rg(i[o-1],e,s,u)).out&&p.out==m.out)continue;f=u.cellWidth*(o-1)-.5+c,d="object"==M(p)?p.y0:p,p.out&&(_="min"==p.out?s.y:e.y,a.push({x:this.hg(f,l,d,v,_),y:_})),m.out&&(_="min"==m.out?s.y:e.y,a.push({x:this.hg(f,l,d,v,_),y:_}))}m.out||a.push({x:l,y:m,index:o})}for(this.og=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.Lb(t,f,d,l,v,h.line.color.call(this,i[o-1]),h.line.width),h.line&&h.line.shadow&&(t.globalAlpha=.3,this.Lb(t,f+2,d+h.line.width+8,l+2,v+h.line.width+8,"#eeeeee",h.line.width+3),t.globalAlpha=1)),"undefined"!=typeof a[o-1].index&&this.ag(t,f,d,i[a[o-1].index],h.label(i[a[o-1].index]),n,r,e)}},hg:function(t,i,e,s,n){return t+(n-e)*(i-t)/(s-e)},ag:function(t,i,e,s,n,r,h){var o=this.B.item,a=parseInt(o.radius.call(this,s),10)||0,u=this.og,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.ug(t,i,e+2*a/3,a+l+1,c),t.stroke();t.beginPath(),t.globalAlpha=.3,t.fillStyle="#bdbdbd",this.ug(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.ug(t,i,e,a+1,c),t.fill(),t.stroke(),t.globalAlpha=1}if(n&&this.canvases[r].renderTextAt(!1,!0,i,e-a-this.B.labelOffset,this.B.label.call(this,s)),h){var d=this.B.eventRadius||a+1;h.addRect(s.id,[i-d-u.x,e-d-u.y,i+d-u.x,e+d-u.y],r)}},ug:function(t,i,e,s,n){var r=[];if(!n||"square"!=n&&"s"!=n)if(!n||"diamond"!=n&&"d"!=n)r=!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 h=1<t.lineWidth?t.lineWidth*Math.sqrt(2)/4:0;r=[[i,e-s],[i+s,e],[i,e+s],[i-s,e],[i+h,e-s-h]]}else r=[[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.cg(t,r)},rg:function(t,i,e,s){var n=s.minValue,r=s.maxValue,h=s.unit,o=s.valueFactor,a=this.B.value(t);this.Xb&&(a=this.Kb(a));var u=(parseFloat(a||0)-n)*o;this.B.yAxis||(u+=s.startValue/h);var c=e.y-h*u;return!this.B.fixOverflow||"line"!=this.B.type&&"area"!=this.B.type?(r<a&&(c=i.y),(u<0||a<n)&&(c=e.y)):r<a?c={y:i.y,y0:c,out:"max"}:(u<0||a<n)&&(c={y:e.y,y0:c,out:"min"}),c},ng:function(t,i,e,s,n){var r,h={};h.totalHeight=s.y-e.y,this.B.cellWidth?h.cellWidth=Math.min(s.x-e.x,this.B.cellWidth):h.cellWidth=(s.x-e.x)/(this.B.offset?i.length:i.length-1);var o=!!this.B.yAxis,a=-1!=this.B.type.indexOf("stacked")?this.fg(i):this.Wb();h.maxValue=a.max,h.minValue=a.min,n||this.Yb(i,e,s,h.minValue,h.maxValue,h.cellWidth),o&&(h.maxValue=parseFloat(this.B.yAxis.end),h.minValue=parseFloat(this.B.yAxis.start));var u=this.Ub(h.minValue,h.maxValue);return r=u[0],h.valueFactor=u[1],h.unit=r?h.totalHeight/r:10,h.startValue=0,o||(h.startValue=10,h.unit!=h.totalHeight&&(h.unit=r?(h.totalHeight-h.startValue)/r:10)),h}},sh={$render_barH:function(t,i,e,s,n,r){var h,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.Wb("h")).max,v=l.min,x=s.x-e.x,C=!!this.B.xAxis,n||this.lg(t,i,e,s,v,d,a),C&&(d=parseFloat(this.B.xAxis.end),v=parseFloat(this.B.xAxis.start)),m=(g=this.Ub(v,d))[0],p=g[1],M=m?x/m:10,C||(w=10,M=m?(x-w)/m:10),(o=parseInt(this.B.barWidth,10))*this.Gb.length+4>a&&(o=a/this.Gb.length-4),h=Math.floor((a-o*this.Gb.length)/2),b="undefined"!=typeof this.B.radius?parseInt(this.B.radius,10):Math.round(o/5),_=!1,(c=this.B.gradient)&&"function"!=typeof c?(_=c,c=!1):c&&(c=t.createLinearGradient(e.x,e.y,s.x,e.y),this.B.gradient(c)),C||this.Lb(t,e.x-.5,e.y,e.x-.5,s.y,"#edeff0",1),f=0;f<i.length;f++)if(y=parseFloat(this.B.value(i[f]||0)),this.Xb&&(y=this.Kb(y)),y&&!isNaN(y))if(d<y&&(y=d),y-=v,y*=p,S=e.x,k=e.y+h+f*a+(o+1)*n,y<0&&"auto"==this.B.origin||this.B.xAxis&&0===y&&!("auto"!=this.B.origin&&this.B.origin>v))this.canvases[n].renderTextAt("middle","right",S+10,k+o/2+h,this.B.label(i[f]));else{y<0&&"auto"!=this.B.origin&&this.B.origin>v&&(y=0),C||(y+=w/M),u=c||this.B.color.call(this,i[f]),this.B.border&&this.dg(t,S,k,o,v,b,M,y,u),t.globalAlpha=this.B.alpha.call(this,i[f]);var $=this.vg(t,s,S,k,o,v,b,M,y,u,c,_);_&&this._g(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.B.label(i[f])),r.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.B.label(i[f])),r.addRect(i[f].id,[$[0]-e.x,k-e.y,$[2]-e.x,$[3]-e.y],n))}},pg:function(t,i,e,s,n,r,h,o,a){var u=0;if(r*h<n){var c=(n-r*h)/n;u=-Math.asin(c)+Math.PI/2}t.moveTo(i,e+o);var f=i+r*h-n-(n?0:o);f=Math.max(i,f),n<r*h&&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,_]},lg:function(t,i,e,s,n,r,h){var o=0;this.B.xAxis&&(this.canvases.x||(this.canvases.x=this.mg("axis_x")),o=this.gg(this.canvases.x.getCanvas(),i,e,s,n,r)),this.B.yAxis&&(this.canvases.y||(this.canvases.y=this.mg("axis_y")),this.wg(this.canvases.y.getCanvas(),i,e,s,h,o))},wg:function(t,i,e,s,n,r){if(this.B.yAxis){var h,o=parseInt(r||e.x,10)-.5,a=s.y+.5,u=e.y;this.Lb(t,o,a,o,u,this.B.yAxis.color,1);for(var c=0;c<i.length;c++){var f="auto"!=this.B.origin&&"barH"==this.B.type&&parseFloat(this.B.value(i[c]))<this.B.origin;h=u+n/2+c*n,this.canvases.y.renderTextAt("middle",!f&&"left",f?o+5:o-5,h,this.B.yAxis.template(i[c]),"webix_axis_item_y",f?0:o-10),this.B.yAxis.lines.call(this,i[c])&&this.Lb(t,e.x,h,s.x,h,this.B.yAxis.lineColor.call(this,i[c]),1)}this.B.yAxis.lines.call(this,{})&&this.Lb(t,e.x+.5,u+.5,s.x,u+.5,this.B.yAxis.lineColor.call(this,{}),1),this.xg(e,s)}},gg:function(t,i,e,s,n,r){var h,o={},
a=this.B.xAxis;if(a){var u=s.y+.5,c=e.x-.5,f=s.x-.5,l=e.x;if(this.Lb(t,c,u,f,u,a.color,1),a.step&&(h=parseFloat(a.step)),"undefined"!=typeof this.yg.step&&"undefined"!=typeof this.yg.start&&"undefined"!=typeof this.yg.end||(n=(o=this.Mg(n,r)).start,r=o.end,h=o.step,this.B.xAxis.end=r,this.B.xAxis.start=n,this.B.xAxis.step=h),0!==h){for(var d=(f-c)*h/(r-n),v=0,_=n;_<=r;_+=h){var p=this.Xb?Math.pow(10,_):_;o.fixNum&&(p=parseFloat(p).toFixed(o.fixNum));var m=Math.floor(c+v*d)+.5;if(_==n&&"auto"==this.B.origin||!a.lines.call(this,_)||this.Lb(t,m,u,m,e.y,this.B.xAxis.lineColor.call(this,_),1),_==this.B.origin&&(l=m+1),h<1&&!this.Xb){var b=Math.min(Math.floor(this.Kb(h)),n<=0?0:Math.floor(this.Kb(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.B.padding.bottom-3,this.B.xAxis.title,"webix_axis_title_x",s.x-e.x),l}}},Sg:function(t,i,e,s,n,r,h){var o=i;return this.B.yAxis&&"auto"!=this.B.origin&&this.B.origin>h&&(o=i+=(this.B.origin-h)*n,(s-=this.B.origin-h)<0&&(s*=-1,t.translate(i,e+r),t.rotate(Math.PI),i=.5,e=0),i+=.5),{value:s,x0:i,y0:e,start:o}},vg:function(t,i,e,s,n,r,h,o,a,u,c,f){t.save();var l=this.Sg(t,e,s,a,o,n,r);t.fillStyle=u,t.beginPath();var d=this.pg(t,l.x0,l.y0,n,h,o,l.value,this.B.border?1:0);c&&!f&&t.lineTo(i.x,l.y0+(this.B.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],_]},dg:function(t,i,e,s,n,r,h,o,a){t.save();var u=this.Sg(t,i,e,o,h,s,n);t.beginPath(),this.eg(t,a),t.globalAlpha=.9,this.pg(t,u.x0,u.y0,s,r,h,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},_g:function(t,i,e,s,n,r,h,o,a,u){t.save();var c=this.Sg(t,i,e,o,h,s,n),f=this.sg(t,c.x0,c.y0+s,c.x0+h*c.value,c.y0,u,a,"x");t.fillStyle=f.gradient,t.beginPath(),this.pg(t,c.x0,c.y0+f.offset,s-2*f.offset,r,h,c.value,f.offset),t.fill(),t.globalAlpha=1,t.restore()}},nh={$render_stackedBar:function(t,i,e,s,n,r){var h,o,a,u,c,f,l,d=this.B,v=s.y-e.y,_=!!d.yAxis,p=!!d.xAxis,m=this.fg(i),b=0===d.origin;h=m.max,o=m.min;var g=Math.floor((s.x-e.x)/i.length);n||(a=this.Yb(i,e,s,o,h,g)),_&&(h=parseFloat(d.yAxis.end),o=parseFloat(d.yAxis.start));var w=this.Ub(o,h);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.Lb(t,e.x,s.y+.5,s.x,s.y+.5,"#edeff0",1);for(var k=0;k<i.length;k++){var C=parseFloat(d.value(i[k]||0));this.Xb&&(C=this.Kb(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;var D=d.border,I=d.label(i[k]);if(!(c<e.y+1)){var A=this.B.color.call(this,i[k]),T=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 F=c-x*C+(T?$?-1:1:0);Math.floor(F)>s.y&&(F=s.y,""!=I&&F-c<kt('<div class="webix_canvas_text">'.concat(I,"</div>"),this.$view.className).height&&(I=""));var z=this.kg(t,u-(D?.5:0),c,y+(D?.5:0),F,0,e.y);if(t.fill(),t.stroke(),S){t.save();var P=this.sg(t,u,c,u+y,z[1],S,A,"y");t.fillStyle=P.gradient,t.beginPath(),z=this.kg(t,u+P.offset,c,y-2*P.offset,F,D?1:0,e.y),t.fill(),t.restore()}D&&(t.save(),"string"==typeof D?t.strokeStyle=D:this.eg(t,A),t.beginPath(),this.kg(t,u-.5,parseInt(c,10)+.5,y+1,parseInt(F,10)+.5,0,e.y,T),t.stroke(),t.restore()),t.globalAlpha=1,this.canvases[n].renderTextAt(!1,!0,u+Math.floor(y/2),z[1]+(c-z[1])/2-7,I),r.addRect(i[k].id,[u-e.x,z[1]-e.y,z[0]-e.x,i[k][$?"$startYN":"$startY"]-e.y],n),i[k][$?"$startYN":"$startY"]=z[1]}}}},kg:function(t,i,e,s,n,r,h,o){t.moveTo(i,e),n<h&&(n=h),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]}},rh={$render_stackedBarH:function(t,i,e,s,n,r){var h,o,a,u,c=s.x-e.x,f=!!this.B.yAxis,l=this.fg(i);h=l.max,o=l.min;var d=Math.floor((s.y-e.y)/i.length);n||this.lg(t,i,e,s,o,h,d),f&&(h=parseFloat(this.B.xAxis.end),o=parseFloat(this.B.xAxis.start));var v=this.Ub(o,h);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.B.barWidth,10);d<m+4&&(m=d-4);var b=(d-m)/2,g=!1,w=this.B.gradient;w&&(g=!0),f||this.Lb(t,e.x-.5,e.y,e.x-.5,s.y,"#edeff0",1);var x=0,y=0;for(M=0;M<this.Gb.length;M++)M==n&&(y=x),"stackedBarH"==this.Gb[M].type&&x++;for(var M=0;M<i.length;M++){y||(i[M].$startX=e.x);var S=Math.abs(parseFloat(this.B.value(i[M]||0)));h<S&&(S=h),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.B.color.call(this,i[M]);t.globalAlpha=this.B.alpha.call(this,i[M]),t.fillStyle=this.B.color.call(this,i[M]),t.beginPath();var D=this.pg(t,k,C,m,0,_,S,0);if(w&&!g&&t.lineTo(e.x+c,C+(this.B.border?1:0)),t.fill(),g){var I=this.sg(t,k,C+m,k,C,g,$,"x");t.fillStyle=I.gradient,t.beginPath(),D=this.pg(t,k,C,m,0,_,S,0),t.fill()}this.B.border&&this.dg(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.B.label(i[M])),r.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]}}}},hh={$render_area:function(t,i,e,s,n,r){var h,o,a,u,c,f,l,d,v,_,p,m,b,g,w;if(f=this.ng(t,i,e,s,n),u=(o=this.B).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.rg(c,e,s,f),b=_+f.cellWidth*a,v){if(g="object"==M(v)?v.y0:v,a&&this.B.fixOverflow){if((d=this.rg(i[a-1],e,s,f)).out&&d.out==v.out)continue;p=f.cellWidth*(a-1)-.5+_,m="object"==M(d)?d.y0:d,d.out&&(w="min"==d.out?s.y:e.y,l.push([this.hg(p,b,m,g,w),w])),v.out&&(w="min"==v.out?s.y:e.y,l.push([this.hg(p,b,m,g,w),w]),a==i.length-1&&w==e.y&&l.push([b,e.y]))}v.out||(l.push([b,g]),r.addRect(c.id,[b-u-e.x,g-u-e.y,b+u-e.x,g+u-e.y],n)),o.yAxis||(h=o.offset||a!=i.length-1?"center":"left",this.canvases[n].renderTextAt(!1,h,b,g-o.labelOffset,o.label(c)))}l.length&&(l.push([b,s.y]),l.push([l[0][0],s.y])),t.globalAlpha=this.B.alpha.call(this,i[0]),t.fillStyle=this.B.color.call(this,i[0]),t.beginPath(),this.cg(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.eg(t,t.fillStyle),t.beginPath(),this.cg(t,l),t.stroke())}},$render_stackedArea:function(t,e,i,s,n,r){var h,o,a,u,c,f,l,d,v,_,p,m,b,g,w,x,y;if(v=this.ng(t,e,i,s,n),l=(u=this.B).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.rg(d,i,s,v)),b.push(isNaN(m)&&!c?e[c].$startY||s.y:m),m&&(_.push([p,m]),r.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.B.alpha.call(this,e[0]),t.fillStyle=this.B.color.call(this,e[0]),t.beginPath(),this.cg(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]){h={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=h).y)/(x.x-w.x))*g+w.y-y*w.x;break}e[c].$startY=m}}}},oh={$render_radar:function(t,i,e,s,n,r){this.Cg(t,i,e,s,n,r)},Cg:function(t,i,e,s,n,r){if(i.length){for(var h=this.Pb(e,s),o=this.B.radius?this.B.radius:h.radius,a=this.B.x?this.B.x:h.x,u=this.B.y?this.B.y:h.y,c=[],f=0;f<i.length;f++)c.push(1);var l=this.fc(c,i.length);this.og=e,n||this.$g(l,a,u,o,i),this.Dg(t,l,a,u,o,i,n,r)}},Dg:function(t,i,e,s,n,r,h,o){var a,u,c,f,l,d,v,_,p,m,b,g,w,x,y,M,S,k,C;for(l=(c=this.B).yAxis.start,d=c.yAxis.end,k=(g=(C=this.Ub(l,d))[0])?n/g:n/2,S=C[1],a=u=w=-Math.PI/2,p=[],f=_=0;f<r.length;f++)y=M||(x=c.value(r[f]),this.Xb&&(x=this.Kb(x)),(parseFloat(x||0)-l)*S),m=Math.floor(k*y),x=c.value(f!=r.length-1?r[f+1]:r[0]),this.Xb&&(x=this.Kb(x)),M=(parseFloat(x||0)-l)*S,b=Math.floor(k*M),a=u,u=f!=r.length-1?w+i[f]-1e-4:w,v=_||this.jb(a,e,s,m),_=this.jb(u,e,s,b),p.push(v);c.fill&&this.Ig(t
,p,r),!c.disableLines&&2<r.length&&this.Ag(t,p,r),(!c.disableItems||r.length<3)&&this.Tg(t,p,r,h,o),p=null},Tg:function(t,i,e,s,n){for(var r=0;r<i.length;r++)this.ag(t,i[r].x,i[r].y,e[r],this.B.label.call(this,e),s,n)},Ig:function(t,i,e){var s,n;t.globalAlpha=this.B.alpha.call(this,{}),t.beginPath();for(var r=0;r<i.length;r++)t.fillStyle=this.B.fill.call(this,e[r]),s=i[r],n=i[r+1]||i[0],r||t.moveTo(s.x,s.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},Ag:function(t,i,e){for(var s,n,r=0;r<i.length;r++)s=i[r],n=i[r+1]||i[0],this.Lb(t,s.x,s.y,n.x,n.y,this.B.line.color.call(this,e[r]),this.B.line.width)},$g:function(t,i,e,s,n){var r=this.B.yAxis,h=this.B.xAxis,o=r.start,a=r.end,u=r.step,c={},f=this.Fg;if("undefined"==typeof f.step||"undefined"==typeof f.start||"undefined"==typeof f.end){var l=this.Wb();o=(c=this.Mg(l.min,l.max)).start,a=c.end,u=c.step,r.end=a,r.start=o}var d,v,_,p,m,b=[],g=0,w=s*u/(a-o);u<1&&(p=Math.min(this.Kb(u),o<=0?0:this.Kb(o)),m=Math.pow(10,-p));var x=[];this.canvases.scale||(this.canvases.scale=this.mg("radar_scale"));var y=this.canvases.scale.getCanvas();for(d=a;o<=d;d-=u){var M=this.Xb?Math.pow(10,d):d;c.fixNum&&(M=parseFloat(d).toFixed(c.fixNum)),b.push(Math.floor(g*w)+.5),m&&!this.Xb&&(d=M=Math.round(M*m)/m);var S=e-s+b[b.length-1];this.canvases.scale.renderTextAt("middle","left",i,S,r.template(M.toString()),"webix_axis_item_y webix_radar");var k,C=-Math.PI/2,$=C;for(v=0;v<t.length;v++)g||x.push($),k=C+t[v]-1e-4,this.zg(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.jb(x[d],i,e,s),h&&(h.lines.call(this,n[d],d)&&this.Lb(y,i,e,_.x,_.y,h.lineColor.call(this,n[d]),1),this.Pg(y,i,e,s,x[d],h.template.call(this,n[d])))},zg:function(t,i,e,s,n,r,h,o,a){var u,c;if(n<0)return!1;u=this.jb(r,e,s,n),c=this.jb(h,e,s,n);var f=this.B.yAxis;f.bg&&(t.beginPath(),t.moveTo(e,s),"arc"==i?t.arc(e,s,n,r,h,!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,r,h,!1):(t.moveTo(u.x,u.y),t.lineTo(c.x,c.y)),t.strokeStyle=f.lineColor.call(this,o),t.stroke())},Pg:function(t,i,e,s,n,r){if(!r)return!1;var h=this.canvases.scale.renderText(0,0,r,"webix_axis_radar_title",1),o=h.scrollWidth,a=h.offsetHeight,u=this.jb(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),h.style.top=u.y+f+"px",h.style.left=u.x+c+"px",h.style.width=o+"px",h.style.whiteSpace="nowrap"}},ah={$render_scatter:function(t,i,e,s,n,r){if(this.B.xValue){var h=this.B,o=!(h.disableLines||"undefined"==typeof h.disableLines),a=this.Wb(),u=this.Wb("h","xValue");n||(this.canvases.x||(this.canvases.x=this.mg("axis_x")),this.canvases.y||(this.canvases.y=this.mg("axis_y")),this.Vg(this.canvases.y.getCanvas(),i,e,s,a.min,a.max),this.gg(this.canvases.x.getCanvas(),i,e,s,u.min,u.max)),a={min:h.yAxis.start,max:h.yAxis.end},u={min:h.xAxis.start,max:h.xAxis.end};var c=this.Hg(t,i,e,s,u,a);this.og=e;for(var f,l,d,v,_,p=[],m=0;m<i.length;m++){var b=this.Rg(c,s,e,u,i[m],"X"),g=this.Rg(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=h.line.color.call(this,i[_]);f=p[w].x,l=p[w].y,w==p.length-1?h.shape&&2<p.length&&(this.Lb(t,d,v,p[0].x,p[0].y,x,h.line.width),h.disableItems||this.Bg(t,r,p[0],i[0],n),h.fill&&this.Eg(t,p,i)):(d=p[w+1].x,v=p[w+1].y,this.Lb(t,f,l,d,v,x,h.line.width))}!h.disableItems&&p[w]&&this.Bg(t,r,p[w],i[_],n)}}},Eg:function(t,i,e){var s,n;t.globalAlpha=this.B.alpha.call(this,{}),t.beginPath();for(var r=0;r<i.length;r++)t.fillStyle=this.B.fill.call(this,e[r]),s=i[r],n=i[r+1]||i[0],r||t.moveTo(s.x,s.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},Hg:function(t,i,e,s,n,r){var h={};return h.totalHeight=s.y-e.y,h.totalWidth=s.x-e.x,this.jg(h,n.min,n.max,h.totalWidth,"X"),this.jg(h,r.min,r.max,h.totalHeight,"Y"),h},Bg:function(t,i,e,s,n){this.ag(t,e.x,e.y,s,this.B.label.call(this,s),n,i)},
Rg:function(t,i,e,s,n,r){var h=this.B["X"==r?"xValue":"value"].call(this,n),o=t["valueFactor"+r],a=(parseFloat(h||0)-s.min)*o,u=t["unit"+r],c=e[r.toLowerCase()]-("X"==r?-1:1)*Math.floor(u*a);return a<0&&(c=e[r.toLowerCase()]),h>s.max&&(c=i[r.toLowerCase()]),h<s.min&&(c=e[r.toLowerCase()]),c},jg:function(t,i,e,s,n){var r=this.Ub(i,e);t["relValue"+(n=n||"")]=r[0],t["valueFactor"+n]=r[1],t["unit"+n]=t["relValue"+n]?s/t["relValue"+n]:10}},uh={$render_splineArea:function(t,i,e,s,n,r){var h,o,a,u,c,f,l,d,v,_,p,m,b,g=this.B,w=[];if(f=this.ng(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.rg(i[o],e,s,f))||"0"==m)&&(d=o?f.cellWidth*o-.5+v:v,a.push({x:d,y:m,index:o}),r.addRect(i[o].id,[d-c-e.x,m-c-e.y,d+c-e.x,m+c-e.y],n));for(l=this.Lg(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.Og(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.Og(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])}h=this.B.color.call(this,i[0]),w.length&&(w.push([p,s.y]),w.push([w[0][0],s.y])),t.globalAlpha=this.B.alpha.call(this,i[0]),t.fillStyle=h,t.beginPath(),this.cg(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.eg(t,h),t.beginPath(),w.splice(w.length-3),this.cg(t,w),t.stroke())}}},ch={dynamic_setter:function(t){return t&&function i(h){if(h.Ng)return;var o=h.B;o.cellWidth||(o.cellWidth=30);o.animateDuration||(o.animateDuration=400);o.offset=!1,h.Ng=h.attachEvent("onBeforeRender",function(t,i){var e=h.Wg(h.xe,h.Me);!function s(e){lh(e,function(t,i){i.Le(e.xe+2*e.B.cellWidth,e.Me)})}(h),function r(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.B.cellWidth;i.Yg!=t&&(i.Yg=t,i.render());i.Yg=0,i.Ug=null,window.requestAnimationFrame&&!document.hidden&&window.requestAnimationFrame(function(t){!function r(i,t){var e,s=i.B.animateDuration,n=i.B.cellWidth;n&&1<i.count()&&(i.Ug||(i.Ug=t),e=t-i.Ug,i.Yg=Math.min(Math.max(e/s*n,1),n),i.render(),e<s&&window.requestAnimationFrame(function(t){r(i,t)}))}(i,t)});i.qg||(i.qg=i.attachEvent("onAfterRender",function(t){!function r(t,c){var f=t.count(),e=t.Wg(t.xe,t.Me),l=t.B.cellWidth,d=t.Yg||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(),r=t.Ee,h=t.Ve,o=t.He;if(d&&(c.length<f||(c.length-1)*l>e-i)?(r.style.left=-d+"px",1<c.length&&(!function u(t,i,e){if(t.length){vt(t[0]);for(var s=1;s<t.length;s++)fh(e,t[s])||(t[s].style.left=t[s].offsetLeft-i+"px")}}(h,d,o),n.clearRect(0,0,i+d,r.offsetHeight),n.clearRect(e+d,0,r.offsetWidth,r.offsetHeight))):(r.style.left="0px",s||d==l||n.clearRect(i+(c.length-1)*l-l+d,0,r.offsetWidth,r.offsetHeight)),1<h.length&&d&&d!=l){var a=h.length-1;fh(o,h[a])&&(a-=1),h[a].style.display="none"}}lh(t,function(t,i){s(i,e.start.x,e.end.x,"x"==t)}),function n(t,i,e){t.Ui.Ni.style.left=i.start.x-e+"px",t.Ui.Ni.style.width=i.end.x-i.start.x+e+"px"}(t,e,i?d:0)}(i,t)}))}(h)}),h.Gg=h.attachEvent("onBeforeXAxis",function(t,i,e,s,n,r){return function _(t,i,e,s,n,r,h){var o,a,u,c,f=t.B,l=s.x-.5,d=parseInt(h||n.y,10)+.5,v=n.x;if(!f.dynamic)return!1;for(u=(e.length-1)*r>v-l||e.length<t.count(),a=0;a<e.length;a++)c=l+a*r,o=u?1<a:!!a,c=Math.ceil(c)-.5,t.Xg(c,d,e[a],o),a&&f.xAxis.lines.call(t,e[a])&&t.Kg(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.Lb(i,l,d,v+(u?t.Yg:0),d,f.xAxis.color,1)}(h,t,i,e,s,n,r),!1})}(this),t}};function fh(t,i){return"axis_x"===t&&-1!==i.className.indexOf("webix_axis_title_x")}function lh(t,i){if(t.canvases){for(var e=0;e<t.Gb.length;e++)t.canvases[e]&&i(e,t.canvases[e]);t.canvases.x&&i("x",t.canvases.x)}}var dh={name:"chart",$init:function(t){if(this.Gb=[this.B],this.Jg=[],this.Ui.className+=" webix_chart",this.$ready.push(this.Mr),t.preset&&this.Zg(t),t.series){var i=t.series;delete t.series,
t.series=i}this.data.provideApi(this,!0)},Mr:function(){this.data.attachEvent("onStoreUpdated",k(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"},_id:"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.Gb.length){var n=this.B,r=n.legend.values;(r&&r[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 pt(t,this._id)},$setSize:function(t,i){var e=Qi.api.$setSize.call(this,t,i);if(e){for(var s in this.canvases)this.canvases[s].Le(this.xe,this.Me);this.render()}return e},type_setter:function(t){return this["$render_"+t],"undefined"==typeof this.B.offset&&(this.B.offset=!(-1!=t.toLowerCase().indexOf("area"))),"radar"!=t||this.B.yAxis||this.define("yAxis",{}),"scatter"==t&&(this.B.yAxis||this.define("yAxis",{}),this.B.xAxis||this.define("xAxis",{})),t},destructor:function(){this.removeAllSeries(),Oi.destructor.apply(this,arguments)},removeAllSeries:function(){this.clearCanvas(),this.Qg&&(this.Qg.innerHTML="",this.Qg.parentNode.removeChild(this.Qg),this.Qg=null),this.canvases&&(this.canvases={}),this.Ui.innerHTML="",this.Gb=[]},clearCanvas:function(){if(this.canvases&&"object"==M(this.canvases))for(var t in this.canvases)this.canvases[t].clearCanvas()},render:function(t,i,e){var s,n,r,h;if(this.isVisible(this.B.id)&&(n=this.tw(),this.callEvent("onBeforeRender",[n,e]))){if(this.canvases&&"object"==M(this.canvases))for(var o in this.canvases)this.canvases[o].clearCanvas();else this.canvases={};if(this.B.legend&&(this.canvases.legend||(this.canvases.legend=this.mg("legend")),this.iw(this.data.getRange(),this.xe,this.Me)),this.Aa=r=new qe(this._id),h=this.B,s=this.Wg(this.xe,this.Me),this.Gb)for(var a=0;a<this.Gb.length;a++)this.B=this.Gb[a],this.canvases[a]||(this.canvases[a]=this.mg(this.name+" "+a,"z-index:"+(2+a),null,a,this.B.ariaLabel)),this["$render_"+this.B.type](this.canvases[a].getCanvas(),n,s.start,s.end,a,r);if(r.render(this.Ui),this.Ui.lastChild.style.zIndex=80,this.ew(this.Ui.lastChild,s),this.callEvent("onAfterRender",[n]),this.B=h,this.B.legend&&this.B.legend.values)for(var u=this.B.legend.values,c=0;c<u.length;c++)u[c].$hidden&&this.hideSeries(c)}},ew: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"},tw:function(){var t,i,e,s,n,r,h,o,a,u;if(s=this.data.getRange(),t=-1!=this.B.type.toLowerCase().indexOf("barh")?"yAxis":"xAxis",(i=this.B[t])&&i.units&&"object"==M(i.units)){if(o=[],"undefined"!=typeof(e=i.units).start&&"undefined"!=typeof e.end&&"undefined"!=typeof e.next)for(h=e.start;h<=e.end;)o.push(h),h=e.next.call(this,h);else"[object Array]"===Object.prototype.toString.call(e)&&(o=e);if(r=[],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],r.push(s[u[o[n]]])):r.push({$unit:o[n]})}return r}return s},series_setter:function(t){if(t&&"object"==M(t)){this.Rt(t.length?t[0]:t),this.Gb=[this.B];for(var i=1;i<t.length;i++)this.addSeries(t[i])}else;return t},value_setter:qt,xValue_setter:qt,yValue_setter:function(t){this.define("value",t)},alpha_setter:qt,label_setter:qt,lineColor_setter:qt,borderColor_setter:qt,pieInnerText_setter:qt,donutInnerText_setter:qt,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.sw[Math.floor(i/256)](i%256)},"default":function(t){var i=this.count(),e=this.ac.length,s=this.getIndexById(t.id)
;return i<e?(s&&(s=s<e-i?this.oc+2:this.oc+1),this.oc=s):s%=e,this.ac[s]}},color_setter:function(t){return this.colormap[t]||qt(t)},fill_setter:function(t){return!(!t||"0"==t)&&qt(t)},Zg:function(t){this.define("preset",t.preset),delete t.preset},preset_setter:function(t){var i,e,s;if(this.defaults=F.extend({},this.defaults),"object"!=M(s=this.presets[t]))return!1;for(i in s)if("object"==M(s[i]))if(this.defaults[i]&&"object"==M(this.defaults[i]))for(e in this.defaults[i]=F.extend({},this.defaults[i]),s[i])this.defaults[i][e]=s[i][e];else this.defaults[i]=F.extend({},s[i]);else this.defaults[i]=s[i];return t},legend_setter:function(t){return t?("object"!=M(t)&&(t={template:t}),this.ji(t,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:-1!=this.B.type.toLowerCase().indexOf("stacked")?"":"hide",marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3}),t.template=qt(t.template),t):(this.Qg&&(this.Qg.innerHTML="",this.Qg=null),!1)},item_setter:function(t){"object"!=M(t)&&(t={color:t,borderColor:t}),this.ji(t,F.extend({},this.defaults.item));return this.nw(["alpha","borderColor","color","radius","type"],t),t},line_setter:function(t){return"object"!=M(t)&&(t={color:t}),(t=F.extend(t,this.defaults.line)).color=qt(t.color),t},padding_setter:function(t){return"object"!=M(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"!=M(t)&&(t={template:t}),this.ji(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0});return this.nw(["lineColor","template","lines"],t),this.yg=F.extend({},t),t},yAxis_setter:function(t){this.ji(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0,bg:re.backColor});return this.nw(["lineColor","template","lines","bg"],t),this.Fg=F.extend({},t),t},nw:function(t,i){for(var e=0;e<t.length;e++)i[t[e]]=qt(i[t[e]])},mg:function(t,i,e,s,n){var r={container:e||this.Ui,name:t,title:z(n)?t:n||"",series:s,style:i||"",width:this.xe,height:this.Me};return new se(r)},Yb:function(t,i,e,s,n,r){var h,o=0;return this.B.yAxis&&(this.canvases.y||(this.canvases.y=this.mg("axis_y")),o=this.Vg(this.canvases.y.getCanvas(),t,i,e,s,n)),this.B.xAxis&&(this.canvases.x||(this.canvases.x=this.mg("axis_x")),h=this.canvases.x.getCanvas(),this.callEvent("onBeforeXAxis",[h,t,i,e,r,o])&&this.qb(h,t,i,e,r,o)),o},qb:function(t,i,e,s,n,r){var h,o,a=this.B,u=e.x-.5,c=parseInt(r||s.y,10)+.5,f=s.x,l=!0,d="stackedBar"==a.type?s.y+.5:c;for(h=0;h<i.length;h++){!0===a.offset?o=u+n/2+h*n:(o=h!=i.length-1||a.cellWidth?u+h*n:s.x,l=!!h),o=Math.ceil(o)-.5;var v="auto"!=a.origin&&"bar"==a.type&&parseFloat(a.value(i[h]))<a.origin;this.Xg(o,d,i[h],l,v),(a.offset||h||a.cellWidth)&&a.xAxis.lines.call(this,i[h])&&this.Kg(t,o,s.y,e.y,i[h])}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.Lb(t,u,c,f,c,a.xAxis.color,1),a.xAxis.lines.call(this,{})&&a.offset&&this.Lb(t,f+.5,s.y,f+.5,e.y+.5,a.xAxis.lineColor.call(this,{}),1)},Vg:function(t,i,e,s,n,r){var h,o={};if(this.B.yAxis){var a=e.x-.5,u=s.y,c=e.y,f=s.y+.5;if(this.B.yAxis.step&&(h=parseFloat(this.B.yAxis.step)),"undefined"==typeof this.Fg.step||"undefined"==typeof this.Fg.start||"undefined"==typeof this.Fg.end?(n=(o=this.Mg(n,r)).start,r=o.end,h=o.step,this.B.yAxis.end=r,this.B.yAxis.start=n):"logarithmic"==this.config.scale&&(this.Xb=!0),this.xg(e,s),0!==h){if(r==n)return u;for(var l=(u-c)*h/(r-n),d=0,v=this.B.origin,_=n;_<=r;_+=h){var p=this.Xb?Math.pow(10,_):_;o.fixNum&&(p=parseFloat(p).toFixed(o.fixNum));var m=Math.floor(u-d*l)+.5;if(_==n&&"auto"==v||!this.B.yAxis.lines.call(this,_)||this.Lb(t,a,m,s.x,m,this.B.yAxis.lineColor.call(this,_),1),"auto"!=v&&_<=v&&v<_+h&&(f=m-l*(v-p)/h),h<1&&!this.Xb){var b=Math.min(Math.floor(this.Kb(h)),n<=0?0:Math.floor(this.Kb(n))),g=Math.pow(10,-b);_=p=Math.round(p*g)/g}this.canvases.y.renderText(0,m-5,this.B.yAxis.template(p.toString()),"webix_axis_item_y",e.x-5),d++}return this.Lb(t,a,u+1,a,c,this.B.yAxis.color,1),f}}},xg:function(t,i){
var e=this.canvases.y.renderTextAt("middle",!1,0,parseInt((i.y-t.y)/2+t.y,10),this.B.yAxis.title,"webix_axis_title_y");e&&(e.style.left=(G.transform?(e.offsetHeight-e.offsetWidth)/2:0)+"px")},rw:function(t,i){return{start:Math.floor(this.Kb(t)),step:1,end:Math.ceil(this.Kb(i))}},hw:function(t){var i=Math.floor(this.Kb(t)),e=Math.pow(10,i),s=t/e;return s=5<s?10:5,parseInt(s,10)*e},Mg:function(t,i){if(this.Xb=!1,"logarithmic"==this.B.scale){var e=Math.floor(this.Kb(t)),s=Math.ceil(this.Kb(i));if(0<t&&0<i&&1<s-e)return this.Xb=!0,this.rw(t,i)}var n,r;"auto"!=this.B.origin&&this.B.origin<t&&(t=this.B.origin);var h=this.hw((i-t)/8||1),o=Math.floor(this.Kb(h));if(h>Math.abs(t))n=t<0?-h:0;else{var a=Math.abs(t),u=Math.floor(this.Kb(a)),c=a/Math.pow(10,u);for(n=0!=u||.1<=h?Math.ceil(10*c)/10*Math.pow(10,u)-h:a,1<a&&.1<h&&(n=Math.ceil(n));t<0?n<=t:t<=n;)n-=h;t<0&&(n=-n-2*h),n-=n%h,n=parseFloat((1*n).toFixed(Math.abs(o)))}for(10<i-n&&(h=this.hw((i-n)/8||1)),r=n,0==i&&i==t&&(i=h);r<i;)r+=h,r=parseFloat((1*r).toFixed(Math.abs(o)));return{start:n,end:r,step:h,fixNum:o<0?Math.abs(o):0}},Wb:function(t,i){var e,s,n=this.data.bh(),r=arguments.length&&"h"==t?this.yg:this.Fg;if(i=i||"value",r&&"undefined"!=typeof r.end&&"undefined"!=typeof r.start&&r.step)e=parseFloat(r.end),s=parseFloat(r.start);else if(e=Ne.max(this.Gb[0][i],n),s=r&&"undefined"!=typeof r.start?parseFloat(r.start):Ne.min(this.Gb[0][i],n),1<this.Gb.length)for(var h=1;h<this.Gb.length;h++){var o=Ne.max(this.Gb[h][i],n),a=Ne.min(this.Gb[h][i],n);e<o&&(e=o),a<s&&(s=a)}return{max:e,min:s}},Kb:function(t){return Math.log(t)/Math.LN10},Xg:function(t,i,e,s,n){if(this.B.xAxis){var r=this.canvases.x.renderTextAt(n,s,t,i-(n?2:0),this.B.xAxis.template(e));r&&(r.className+=" webix_axis_item_x")}},Kg:function(t,i,e,s,n){this.B.xAxis&&this.B.xAxis.lines&&this.Lb(t,i,e,i,s,this.B.xAxis.lineColor.call(this,n),1)},Lb:function(t,i,e,s,n,r,h){t.strokeStyle=r,t.lineWidth=h,t.beginPath(),t.moveTo(i,e),t.lineTo(s,n),t.stroke(),t.lineWidth=1},Ub:function(t,i){return[i!=t?i-t:t,1]},sw:[function(t){return"#FF"+rs.toHex(t/2,2)+"00"},function(t){return"#FF"+rs.toHex(t/2+128,2)+"00"},function(t){return"#"+rs.toHex(255-t,2)+"FF00"},function(t){return"#00FF"+rs.toHex(t,2)},function(t){return"#00"+rs.toHex(255-t,2)+"FF"},function(t){return"#"+rs.toHex(t,2)+"00FF"}],ac:["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],oc:0,addSeries:function(t){var i=this.B;this.B=F.extend({},i),this.Rt(t),this.Gb.push(this.B),this.B=i},$tooltipIn:function(t){return t},Pe:function(t,i){var e=this.locate(i);if(!e)return null;var s=this.ow(i),n=F.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.Gb[s].tooltip||{template:""},!0);return ui.Lt.define(n),this.getItem(e)},ow:function(t){var i,e,s,n,r,h,o,a;for(e=this.Aa.Ta,n=mt(this.Ui.Ni),o=(r=gt(t)).x-n.x,a=r.y-n.y,s=0;s<e.length;s++)o<=(i=e[s].points)[2]&&o>=i[0]&&a<=i[3]&&a>=i[1]&&(h?e[s].index>h.index&&(h=e[s]):h=e[s]);return h?h.index:0},hideSeries:function(t){this.canvases[t].hideCanvas();var i=this.B.legend;i&&i.values&&i.values[t]&&(i.values[t].$hidden=!0,this.iw()),this.Aa.hide(this.Ui,t,!0)},showSeries:function(t){this.canvases[t].showCanvas();var i=this.B.legend;i&&i.values&&i.values[t]&&(delete i.values[t].$hidden,this.iw()),this.Aa.hide(this.Ui,t,!1)},iw:function(t,i){var e,s,n,r,h,o,a,u,c,f,l,d=0,v=0;if(t=t||[],i=i||this.xe,u=this.canvases.legend.getCanvas(),s=this.B.legend,a="x"!=this.B.legend.layout?"width:"+s.width+"px":"",this.Qg&&(this.Qg.innerHTML="",this.Qg.parentNode.removeChild(this.Qg)),this.canvases.legend.clearCanvas(!0),n=lt("DIV",{"class":"webix_chart_legend",style:"left:"+d+"px; top:"+v+"px;"+a},""),s.padding&&(n.style.padding=s.padding+"px"),this.Qg=n,this.Ui.appendChild(n),h=[],s.values)for(e=0;e<s.values.length;e++)h.push(this.aw(n,s.values[e].text,"undefined"!=typeof s.values[e].id?M(s.values[e].id):e,s.values[e].$hidden));else for(e=0;e<t.length;e++)h.push(this.aw(n,s.template(t[e]),t[e].id));var _,p,m=document.body.contains(
this.Ui);for(m||(p=lt("DIV",{style:"visibility:hidden; position:absolute; top:0px; left:0px;"},""),_=this.Ui.parentNode,document.body.appendChild(p),p.appendChild(this.Ui)),o=n.offsetWidth,r=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)),r<this.Me&&("middle"==s.valign&&"center"!=s.align&&"x"!=s.layout?v=(this.Me-r)/2:"bottom"==s.valign&&(v=this.Me-r),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<h.length;e++)l=h[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.B.color.call(this,t[e])),this.uw(u,l.offsetLeft+d,l.offsetTop+v,c,l.offsetHeight,f,e);u.restore(),m||(_.appendChild(this.Ui),vt(p)),h=null},aw:function(t,i,e,s){var n="";"x"==this.B.legend.layout&&(n="float:left;");var r=lt("DIV",{style:n+"padding-left:"+(10+this.B.legend.marker.width)+"px","class":"webix_chart_legend_item"+(s?" hidden":""),role:"button",tabindex:"0","aria-label":P.aria[(s?"show":"hide")+"Chart"]+" "+i},i);return 2<arguments.length&&r.setAttribute("series_id",e),t.appendChild(r),r},uw:function(t,i,e,s,n,r,h){var o=[],a=this.B.legend.marker,u=this.B.legend.values,c=u&&u[h].markerType?u[h].markerType:a.type;if(s&&(t.strokeStyle=t.fillStyle=s),"round"!=c&&a.radius)if("item"==c){if(this.B.line&&"scatter"!=this.B.type&&!this.B.disableLines){t.beginPath(),t.lineWidth=this.Gb[h].line.width,t.strokeStyle=r?s:this.Gb[h].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.Gb[h].item,_=parseInt(v.radius.call(this,{}),10)||0,p=v.type.call(this,{});_&&(t.beginPath(),r?(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.ug(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.cg(t,o),t.stroke(),t.fill();else{t.beginPath();var m=a.height/2;t.arc(i+m+5,e+n/2,m,0,2*Math.PI),t.fill()}},Wg:function(t,i){var e,s,n,r;if(e=this.B.padding.left,s=this.B.padding.top,n=t-this.B.padding.right,r=i-this.B.padding.bottom,this.B.legend){var h=this.B.legend,o=this.B.legend.width,a=this.B.legend.height;"x"==h.layout?"center"==h.valign?"right"==h.align?n-=o:"left"==h.align&&(e+=o):"bottom"==h.valign?r-=a:s+=a:"right"==h.align?n-=o:"left"==h.align&&(e+=o)}return{start:{x:e,y:s},end:{x:n,y:r}}},fg:function(t){var i,e,s,n,r;if(this.B.yAxis&&"undefined"!=typeof this.B.yAxis.end&&"undefined"!=typeof this.B.yAxis.start&&this.B.yAxis.step)s=parseFloat(this.B.yAxis.end),n=parseFloat(this.B.yAxis.start);else{for(i=0;i<t.length;i++)for(t[i].$sum=0,t[i].$min=Infinity,e=0;e<this.Gb.length;e++)r=Math.abs(parseFloat(this.Gb[e].value(t[i])||0)),isNaN(r)||(-1!=this.Gb[e].type.toLowerCase().indexOf("stacked")&&(t[i].$sum+=r),r<t[i].$min&&(t[i].$min=r));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}},sg:function(t,i,e,s,n,r,h,o){var a,u,c,f,l,d;return"light"==r?(a="x"==o?t.createLinearGradient(i,e,s,e):t.createLinearGradient(i,e,i,n),d=[[0,"#FFFFFF"],[.9,h],[1,h]],u=2):"falling"==r||"rising"==r?(a="x"==o?t.createLinearGradient(i,e,s,e):t.createLinearGradient(i,e,i,n),c=rs.toRgb(h),(f=rs.rgbToHsv(c[0],c[1],c[2]))[1]*=.5,l="rgb("+rs.hsvToRgb(f[0],f[1],f[2])+")","falling"==r?d=[[0,l],[.7,h],[1,h]]:"rising"==r&&(d=[[0,h],[.3,h],[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.cw(a,d),{gradient:a,offset:u}},jb:function(t,i,e,s){return t*=-1,{x:i+=Math.cos(t)*s,y:e-=Math.sin(t)*s}},cw:function(t,i){for(var e=0;e<i.length;e++)t.addColorStop(i[e][0],i[e][1])},cg: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])},fw: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)}};F.protoUI(dh,th,ih,eh,sh,nh,rh,{$render_spline:function(t,i,e,s,n,r){var h,o,a,u,c,f,l,d,v,_,p,m,b;if(c=this.ng(t,i,e,s,n),h=this.B,this.og=e,a=[],i.length){for(d=h.offset?e.x+.5*c.cellWidth:e.x,o=0;o<i.length;o++)((p=this.rg(i[o],e,s,c))||"0"==p)&&(l=o?c.cellWidth*o-.5+d:d,a.push({x:l,y:p,v:this.B.value(i[o]),index:o}));for(f=this.Lg(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.Og(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.Og(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.Lb(t,u,g,u+1,w,h.line.color(i[o]),h.line.width)}this.Lb(t,_-1,this.Og(u,v,o,f.a,f.b,f.c,f.d),_,b,h.line.color(i[o]),h.line.width)}this.ag(t,v,m,i[a[o].index],h.label(i[a[o].index]),n,r)}}},Lg:function(t){var i,e,s,n,r,h,o,a,u=[],c=[],f=t.length;for(r=0;r<f-1;r++)u[r]=t[r+1].x-t[r].x,c[r]=(t[r+1].y-t[r].y)/u[r];for(a=[],(o=[])[0]=0,o[1]=2*(u[0]+u[1]),a[0]=0,a[1]=6*(c[1]-c[0]),r=2;r<f-1;r++)o[r]=2*(u[r-1]+u[r])-u[r-1]*u[r-1]/o[r-1],a[r]=6*(c[r]-c[r-1])-u[r-1]*a[r-1]/o[r-1];for((h=[])[f-1]=h[0]=0,r=f-2;1<=r;r--)h[r]=(a[r]-u[r]*h[r+1])/o[r];for(i=[],e=[],s=[],n=[],r=0;r<f-1;r++)i[r]=t[r].y,e[r]=-u[r]*h[r+1]/6-u[r]*h[r]/3+(t[r+1].y-t[r].y)/u[r],s[r]=h[r]/2,n[r]=(h[r+1]-h[r])/(6*u[r]);for(r=0;r<t.length-1;r++)0===t[r].v&&0===t[r+1].v&&(i[r]=t[r].y,n[r]=s[r]=e[r]=0);return{a:i,b:e,c:s,d:n}},Og:function(t,i,e,s,n,r,h){return s[e]+(t-i)*(n[e]+(t-i)*(r[e]+(t-i)*h[e]))}},hh,oh,ah,{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}}},uh,ch,Ye,ee,Fe,Je,b,Qi.view);F.protoUI({name:"rangechart",defaults:{template:"GPL version doesn't support rangechart <br> You need Webix PRO"}},Cn.view);var vh={name:"grouplist",defaults:{animate:{}},Am:"webix_grouplist",$init:function(){F.extend(this.data,Ds,!0),this.data.count=function(){return this.order.length},this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",k(this.lw,this)),this.lw()},lw:function(){this.dw=[],this.vw=[]},$setSize:function(){Qi.api.$setSize.apply(this,arguments)&&(this.tt.style.width=this.xe)},on_click:{webix_list_item:function(t,i){if(this.Vd)return!1;for(var e=0;e<this.vw.length;e++)if(this.vw[e]==i){for(var s=e;s<this.vw.length;s++)this.data.getItem(this.vw[s]).$template="";return e?(this.dw=this.data.branch[this.vw[e-1]],this.vw.splice(e)):(this.dw=this.data.branch[0],this.vw=[]),this._w=!1,this.render()}
var n=this.getItem(i);if(n.$count)return this._w=!0,this.vw.push(i),n.$template="Back",this.dw=this.data.branch[n.id],this.render();this.B.select&&(this.Fm=!0,"multiselect"==this.B.select||this.B.multiselect?this.select(i,!1,"touch"==this.B.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i),this.Fm=!1)}},getOpenState:function(){return{parents:this.vw,branch:this.dw}},render:function(t,i,e){var s,n,r=this,h=arguments;if(this.vw=S(this.vw),this.dw=S(this.dw),this.vw.length)for(s=0;s<this.vw.length;s++)this.data.branch[this.vw[s]]||(this.vw.splice(s,1),s--);if(n=this.vw.length?this.vw[this.vw.length-1]:0,this.dw=S(this.data.branch[n]),!this.dw.length&&this.vw.length&&(this.dw=[n],this.vw.pop()),this.Vd)return this.Vd.then(function(){return r.render.apply(r,h)});for(s=0;s<this.dw.length;s++)this.data.getItem(this.dw[s]).$template="";if(this.dw.length||(this.dw=this.data.branch[0]),this.data.order=T([].concat(this.vw).concat(this.dw)),this.callEvent("onBeforeRender",[this.data])){if(!this.Fm&&this.tt.innerHTML&&ne.isSupported()&&this.B.animate&&this.pw!=this.vw.length){if(this.callEvent("onBeforeRender",[this.data])){this.mw||(this.mw=[]);var o=this.tt.cloneNode(!1);o.innerHTML=this.data.getRange().map(this.Q,this).join("");var a=F.extend({},this.B.animate);a.direction=this._w?"left":"right";var u,c=[l(a),l(a)];this._w?this.mw.push(this.getScrollState()):u=this.mw.pop();var f=ne.formLine(o,this.tt,a);a.master=this,a.callback=function(){this.tt=o,this._w?this.scrollTo(0,0):u&&this.scrollTo(0,u.y),ne.breakLine(f),a.master=a.callback=null,this.Ni=this.Vd=null,a.wait_animation.resolve(),this.callEvent("onAfterRender",[])},ne(f,c),this.Vd=a.wait_animation=m.defer()}}else{if(t&&"delete"!==e&&-1===this.data.getIndexById(t))return;es.render.apply(this,arguments)}this.pw=this.vw.length}},templateBack_setter:function(t){this.type.templateBack=qt(t)},templateItem_setter:function(t){this.type.templateItem=qt(t)},templateGroup_setter:function(t){this.type.templateGroup=qt(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:qt('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>'),templateBack:qt("#value#"),templateItem:qt("#value#"),templateGroup:qt("#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.dw=this.data.branch[e||0],this.vw=[];e;)this.getItem(e).$template="Back",this.vw.unshift(e),e=this.getItem(e).$parent;this.Fm=!0,this.render(),this.Fm=!1,es.showItem.call(this,t)}};ii(F.protoUI(vh,Ye,Er.view),{});var _h={name:"unitlist",_id:"webix_item_id",uniteBy_setter:qt,render:function(t,i,e){var s=this.B;if(this.isVisible(s.id)&&s.uniteBy){if(t){var n=this.getItemNode(t);if(n&&"update"==e&&this.B.uniteBy.call(this,i)==this.getItem(t).$unitValue)return _t(this.Ni[t]=this.Hu(i),n),void vt(n)}this.callEvent("onBeforeRender",[this.data])&&(this.units=null,this.bw(),this.units&&(this.callEvent("onUnits",[]),this.tt.innerHTML=this.gw().map(this.Q,this).join(""),this.Ni=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},Q:function(t){var i=this.data.Nr[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)},gw:function(){var t=[],i=this.data.$min||0,
e=this.data.$max||Infinity,s=0;for(var n in this.units){t.push({$unit:n});for(var r=this.units[n],h=0;h<r.length;h++){if(s==i&&(t=[{$unit:n}]),t.push(this.getItem(r[h])),s==e)return T(t);s++}}return T(t)},bw:function(){var e=this;this.units={},this.data.each(function(t){var i=e.B.uniteBy.call(this,t);t.$unitValue=i,e.units[i]||(e.units[i]=[]),e.units[i].push(t.id)})},type:{headerHeight:20,classname:function(t,i,e){var s="webix_list_item";return i.css&&(s+=" webix_list_"+i.css+"_item"),e&&e.$css&&(s+=" "+e.$css),t.$css&&("object"==M(t.$css)&&(t.$css=ut(t.$css)),s+=" "+t.$css),s},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="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="'+i.classname(t,i,e)+'" style="'+s+'" '+i.aria(t,i,e)+">"},templateStartHeader:function(t,i,e){var s="webix_unit_header"+(i.css?" webix_unit_header_"+i.css+"_item":""),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(){Er.api.$skin.call(this),this.type.headerHeight=re.unitHeaderHeight}};F.protoUI(_h,Er.view);P.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 ph={name:"dbllist",defaults:{borderless:!0},$init:function(){this.ww={},this.xw=k(function(t){return this.ww[t.id]},this),this.yw=k(function(t){return!this.ww[t.id]},this),this.$view.className+=" webix_dbllist",this.$ready.unshift(this.Sm)},$onLoad:function(t,i){var e=this.$$("left"),s=this.$$("right");return this.Mw(function(){e.data.driver=i,e.parse(t),s.data.driver=i,s.parse(t)}),this.Sw=!0,this.kw(),!0},Cw:function(){if(!1===this.B.buttons)return{width:10};var t=P.dbllist,i=[this.$w("deselect_all",t.deselectAll),this.$w("select_all",t.selectAll),this.$w("deselect_one",t.deselectOne),this.$w("select_one",t.selectOne)];return i={width:120,template:i.join(""),onClick:{dbllist_button:function(t,i,e){this.getTopParentView().Dw(e.getAttribute("action"))}}},this.B.buttons&&(i.template=this.B.buttons),i},$w:function(t,i){return"<button class='dbllist_button' action='"+t+"'>"+i+"</button>"},Iw: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.B.action;s.select(t.source,n)}return!1},onItemDblClick:function(){return this.getTopParentView().Dw(this.config.action)}}};return this.B.list&&F.extend(n,this.B.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},Sm:function(){var t=[{margin:10,type:"clean",cols:[this.Iw("left","select_one",this.B.labelLeft,this.B.labelBottomLeft),this.Cw(),this.Iw("right","deselect_one",this.B.labelRight,this.B.labelBottomRight)]}];this.cols_setter(t)},Dw: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"!==M(t)&&(t=[t]),i)for(e=0;e<t.length;e++)this.ww[t[e]]=!0;else for(e=0;e<t.length;e++)delete this.ww[t[e]];this.kw(),this.callEvent("onChange",[])},Mw:function(t,i){di(k(t,this),!1),i&&(this.$$("left").B.autoheight||this.$$("right").B.autoheight)&&this.resize()},kw:function(){var t=this.$$("left"),i=this.$$("right");t&&this.Mw(function(){t.filter(this.yw),i.filter(this.xw)},!0)},focus:function(){if(!ji.canFocus(this))return!1;ji.setFocus(this)},
value_setter:function(t){this.setValue(t)},setValue:function(t){if(this.ww={},t){"object"!==M(t)&&(t=t.toString().split(","));for(var i=0;i<t.length;i++)this.ww[t[i]]=!0}this.kw()},getValue:function(){var t=[],i=this.$$("left");for(var e in this.ww)this.Sw&&!i.data.pull[e]||t.push(e);return t.join(",")}},mh=(F.protoUI(ph,Rt,Ge,An.view),{name:"tree",defaults:{scroll:"auto",navigation:!0},$init:function(){this.zt.className+=" webix_tree",F.extend(this.data,Ds,!0),F.extend(this.on_click,Ms),this.data.provideApi(this,!0),this.zt.setAttribute("role","tree")},_id:"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=" ");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.B.activeTitle&&(this.getItem(i).open?this.close(i):this.open(i));if(this.B.select)if("multiselect"==this.B.select||this.B.multiselect){var e=t.ctrlKey||t.metaKey||"touch"==this.B.multiselect;if("level"==this.B.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)}},ir:{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(){}},lo:!0,$dragHTML:function(t,i,e){var s="<div class='webix_tree_item'>"+this.type.template(t,this.type)+"</div>";return I(e.source)&&1<e.source.length&&(s=this.ro(s,e.source.length)),s},co:function(t){for(var i=t.source,e=0;e<i.length;e++)this.close(i[e])},uo:function(t,i){var e=this.getItemNode(t);e?e.parentNode.insertBefore(le._n[0],e):i.children[0].children[0].appendChild(le._n[0])},type:F.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"==M(t.$css)&&(t.$css=ut(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:qt("{common.icon()} {common.folder()} <span>#value#</span>"),templateStart:qt('<div webix_tm_id="#id#" class="{common.classname()}" {common.aria()}>'),templateEnd:qt("</div>"),templateCopy:qt("#value#")},As)}),bh=F.protoUI(mh,$s,Ye,ys,Pe,ks,ns,Xe,Je,ss,Ss,Rr.view,Cs,ye,b),gh={api:mh,view:bh};ii(bh,{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 r=i.Aw(t,i,n);r&&(e+="<div class='"+s+"webix_tree_img webix_tree_"+r+"'></div>")}return e},Aw:function(t,i,e){var s=i.Ac,n=Cs.Re;if(0===s&&n){var r=t.$level,h=t.id;for(s=[];r;){var o=n.getParentId(h),a=n.data.branch[o];a[a.length-1]==h&&(s[r]=!0),h=o,r--}i.Ac=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 wh={name:"treemap",defaults:{activeItem:!1,subRender:!0,header:!0,headerHeight:35,value:qt("#value#"),headerTemplate:"",navigation:!0},value_setter:qt,headerTemplate_setter:qt,header_setter:function(t){return t&&!0!==t&&(this.type.header=t),t},$init:function(){this.$view.className+=" webix_treemap",this.zt.setAttribute("role","tree"),this.Tw=document.createElement("DIV"),F.extend(this.data,Ds,!0),this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",k(function(){this.Yi="",this.$values={},this.$xy={}},this)),this.attachEvent("onKeyPress",this.De)},Cc:function(t){var i=this.data.Nr[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)},Fw:function(t){var i=this.getItem(t),e=this.B.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>"},zw:function(t){var i,e,s,n,r=[];if(!this.$width||!this.count())return this.Yi="",!1;if(t||(t=this.config.branch||0,this.Yi="",this.$values={},this.$xy={},this.$xy[t]={width:this.$width,height:this.$height,top:0,left:0},t&&this.B.header&&(this.$xy[t].height-=this.B.headerHeight,this.$xy[t].top=this.B.headerHeight,this.Yi+=this.Fw(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]&&r.push(S(t))},this),n=n||this.$values[t],r.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 h=e.dx*e.dy/n,o=0;o<r.length;o++)r[o].$value=this.$values[r[o].id]*h;r.sort(function(t,i){return t.$value>i.$value?-1:1});for(var a=Infinity,u=0;r[u];){var c=this.Pw(e,r[u]);if(c<a)e.sum+=r[u].$value,e.set.push(r[u]),a=c,u++;else{this.m_(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.m_(e)},m_:function(t){var i,e,s,n,r=t.top,h=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=r,this.$xy[e].left=h,t.mode?r+=n:h+=s,this.$xy[e].width=s,this.$xy[e].height=n,this.Yi+=this.Cc(this.getItem(e)),this.B.subRender&&this.data.branch[e]&&this.zw(e)},Pw: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},Hu:function(t){return this.Tw.innerHTML=this.Cc(t),this.Tw.firstChild},showBranch:function(t){this.B.branch=t,this.refresh()},render:function(t,i,e){if(this.isVisible(this.B.id)&&!this.$blockRender){if("update"==e){var s=this.getItemNode(t);if(s)_t(this.Ni[t]=this.Hu(i),s),vt(s)}else!this.data.branch||this.B.branch&&!this.data.branch[this.B.branch]||(this.Ni=null,this.callEvent("onBeforeRender",[]),this.zw(),this.tt.innerHTML=this.Yi,this.callEvent("onAfterRender",[]));return!0}},_id:"webix_dm_id",on_click:{webix_treemap_item:function(t,i){this.B.select&&("multiselect"==this.B.select||this.B.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.B.multiselect,t.shiftKey):this.select(i)),this.B.activeItem&&this.isBranch(i)&&this.showBranch(i)},webix_treemap_header_item:function(t){var i=pt(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:{},Vw:function(t){var i="";for(var e in t)i+=e+":"+t[e]+";";return i},type:{template:qt("#value#"),header:function(t,i){for(var e=t.id,s="<div role='button' tabindex='0' aria-label='"+P.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"==M(t.$css)&&(t.$css=ut(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 r=this.getParentId(t.id);if(
r&&r!=this.B.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 h=i.cssClass.call(this,t,i,e);h&&("object"==M(h)?s+=" "+ut(h):s+=" "+h)}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:qt("</div>")}},xh=(F.protoUI(wh,Ye,ys,ns,Xe,Je,ss,Ss,Rr.view,Cs,ye,b),{name:"dataview",$init:function(t){t.sizeToContent&&this.$ready.unshift(this.Mr);var i=t.type||t.item;t.prerender||this.defaults.prerender||i&&"auto"==i.width||"move"==t.drag||"order"==t.drag||t.autoheight||F.extend(this,Ps,!0),t.autoheight&&(t.scroll=!1),i&&"tiles"==i.type&&(this.mf=i.padding||this.type.padding,this.zt.firstChild.style["float"]="left",this.zt.firstChild.style.padding=this.mf/2+"px"),this.Ui.className+=" webix_dataview",this.zt.setAttribute("role","listbox")},Mr:function(){var t=lt("DIV",0,this.type.template({}));t.className="webix_dataview_item",t.style.position="absolute",document.body.appendChild(t),this.type.width=t.offsetWidth+this.mf,this.type.height=t.offsetHeight+this.mf,vt(t)},defaults:{scroll:!0,datafetch:50,navigation:!0},_id:"webix_l_id",vr:"webix_dataview_item",mf:0,vo:"x",on_click:{webix_dataview_item:function(t,i){this.B.select&&("multiselect"==this.B.select||this.B.multiselect?this.select(i,!1,"touch"==this.B.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i))}},on_dblclick:{},on_mouse_move:{},type:{template:qt("#value#"),templateLoading:qt("Loading..."),width:160,height:50,padding:8,classname:function(t,i,e){var s="webix_dataview_item";return i.css&&(s+=" "+i.css),i.type&&(s+=" "+i.type),t.$css&&("object"==M(t.$css)&&(t.$css=ut(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"')},templateStart:function(t,i,e){var s=i.width,n=i.height,r=0;return"tiles"==i.type&&(s-=i.padding,n-=i.padding,r=i.padding/2),'<div webix_l_id="'+t.id+'" class="'+i.classname(t,i,e)+'" '+i.aria(t,i,e)+' style="margin:'+r+"px; width:"+s+"px; height:"+n+'px; float:left; overflow:hidden;">'},templateEnd:qt("</div>")},$dropHTML:function(){var t=this.mf;return'<div class="webix_drop_area_inner" style="width:'.concat(this.type.width-t,"px; height:").concat(this.type.height-t,"px; margin:").concat(t/2,'px"></div>')},Hw:function(t){return this.B.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",k(this.resize,this)),this.Ui.style.overflowY="hidden"),t},$getSize:function(t,i){this.B.xCount&&"auto"!=this.type.width&&!this.Rw&&(this.B.width=this.type.width*this.B.xCount+this.mf+(this.ye?G.scrollSize:0)),this.B.yCount&&"auto"!=this.type.height&&!this.Bw&&(this.B.height=this.type.height*this.B.yCount+this.mf);var e=this.B.width||this.xe;return this.B.autoheight&&e&&(this.Ew(),this.Hw(e),this.scroll_setter(!1)),Qi.api.$getSize.call(this,t,i)},Ew:function(){return this.B.yCount&&(this.Bw||"auto"==this.type.height)&&(this.type.height=Math.floor((this.Me-this.mf)/this.B.yCount),this.Bw=this.B.yCount),this.B.xCount&&(this.Rw||"auto"==this.type.width)&&(this.type.width=Math.floor((this.xe-this.mf)/this.B.xCount),this.Rw=this.B.xCount),this.Bw||this.Rw},$setSize:function(t,i){var e=this.B;if(Qi.api.$setSize.call(this,t,i)){if(e.autoheight&&this.Hw()!=this.Me)return C(this.resize,this);(this.Ew()||this.af)&&this.render()}else(e.yCount&&e.yCount!=this.Bw||e.xCount&&e.xCount!=this.Rw)&&this.Ew()&&this.render()}});F.protoUI(xh,Ce,Pe,Je,Xe,ns,ss,Me,Rr.view);P.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 yh={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.B,this.tt=this.zt,this.zt.className+=" webix_pager"+(t.autowidth?" webix_pager_auto":""),!1!==t.master&&0!==t.master||this.$ready.push(this.jw)},jw: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.B.page+1;break;case"prev":t=this.B.page-1;break;case"first":t=0;break;case"last":t=this.B.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.B.animate&&this.Lw(i,1*t,this.B.animate)||this.$master.refresh()),this.callEvent("onAfterPageChange",[t]))},_id:"webix_p_id",template_setter:qt,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:P.aria.page+" "+(e+1)});return i},page:function(t){return t.page+1},first:function(){return this.button({id:"first",index:P.pager.first,selected:"",label:P.aria.pages[0]})},last:function(){return this.button({id:"last",index:P.pager.last,selected:"",label:P.aria.pages[3]})},prev:function(){return this.button({id:"prev",index:P.pager.prev,selected:"",label:P.aria.pages[1]})},next:function(){return this.button({id:"next",index:P.pager.next,selected:"",label:P.aria.pages[2]})},button:qt("<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=ni(t)),((this.Nw=t).$master=this).Ow()},refresh:function(){var t=this.B;t.limit=Math.ceil(t.count/t.size)||1;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.Ow(),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},Ow:function(){this.Nw&&(this.Nw.B.count=this.B.count,this.Nw.B.page=this.B.page,this.Nw.refresh())},Lw:function(t,i,e){if(t==i)return!1;if(this.Ww)return this.Yw&&window.clearTimeout(this.Yw),this.Yw=C(this.Lw,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,r=this.$master.tt,h=!!this.$master.st;h&&(n=(r=this.$master.st).offsetTop,Mt(this.$master.$view,"webix_animation"));var o,a=r.cloneNode(!0);a.style.width=r.style.width="100%",this.$master.refresh(),_t(a,r.nextSibling,r.parentNode),h&&(a.childNodes[1].scrollLeft=r.childNodes[1].scrollLeft);var u=!0!==e?e:{},c=F.extend({direction:s,callback:k(function(){c.callback=null,ne.breakLine(o),this.Ww=!1,this.$master.st&&St(this.$master.$view,"webix_animation")},this),top:n,keepViews:h},u);o=ne.formLine(r,a,c),ne([r,a],c),this.Ww=!0}},Mh=(F.protoUI(yh,Je,te,Qi.view,b),{name:"comments",defaults:{sendAction:"click",mode:"comments",highlight:!0},$init:function(t){this.$view.className+=" webix_comments",this.Vt=[],t.rows=[this.Uw(t)],t.moreButton||(t.moreButton=qt(P.comments.moreComments)),t.readonly||(t.rows.push(this.qw(t)),this.Gw()),this.Xw(t.users),this.$ready.push(this.Kw)},$exportView:function(){return this.Jw},Kw:function(){var e=this;this.Jw=this.queryView("list"),this.Gm=this.queryView("form"),this.Zw=this.queryView("button"),this.Qw=this.queryView({localId:"textarea"}),this.config.mentions&&this.tx(this.config.mentions),
this.Jw.data.provideApi(this,!0),this.serialize=function(){var t=e.Jw.serialize(),i=e.getIndexById("$more");return 0<=i&&t.splice(i,1),t},this.B.readonly||(this.ix=y("onClick",function(t){var i=ai(t);i==e.Qw?e.focus():i===e.Zw||i===e.ex||e.sx&&i===e.sx.getList()||t&&-1!==(t.target.className||"").toString().indexOf("webix_comments_menu")||e.nx()}),this.attachEvent("onDestruct",function(){V(this.ix)}),this.Jw.attachEvent("onAfterScroll",function(){e.ex.hide()}))},$onLoad:function(t,i){return this.rx(t,i)},rx:function(t,i){var e=this,s=this.Jw||this.queryView({view:"list"});s.data.driver=i;var n=!1;if(t="function"==typeof t.serialize?t.serialize():(n=t.more,i.getRecords(t)),this.hx){if(this.hx=!1,t.length){var r=s.data.order,h=1;if("chat"==this.B.mode)s.data.order=T([r[0]].concat(new Array(t.length),r.slice(1)));else{var o=s.getIndexById("$more");s.data.order=T(r.slice(0,o).concat(new Array(t.length),r.slice(o))),h=o}s.parse({data:t,pos:h}),n&&Ie(this.Jw).ignore(function(){e.Jw.updateItem("$more",{value:n})}),"chat"==this.B.mode&&s.showItem(s.getIdByIndex(t.length))}t.length&&n||Ie(this.Jw).ignore(function(){e.Jw.remove("$more")})}else n&&!s.exists("$more")&&(n={id:"$more",value:n,$css:"webix_comments_more_item"},"chat"==this.B.mode?t.unshift(n):t.push(n)),s.parse(t),"chat"==this.B.mode&&s.waitData.then(function(){return s.showItem(s.getLastId())});return!0},$skin:function(){An.api.$skin.call(this),this.np=re.inputHeight+6},getUsers:function(){return this.ox},getMenu:function(){return this.ex},setCurrentUser:function(t,i){this.config.currentUser=t,this.Gm.clear(i),this.Jw.refresh()},edit:function(t,i){if(!this.config.readonly&&this.callEvent("onBeforeEditStart",[t])){this.nx(!0);var e=this.Jw.getItem(t);this.Gm.setValues(e,!1,i),this.Gm.focus();var s=this.Gm.elements.text.getInputNode();s.scrollTop=s.scrollHeight,Dt(s,e.text.length),this.callEvent("onAfterEditStart",[t])}},ax:function(t){var i=this.Gm.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.Jw.showItem(i.id)),this.Gm.clear("user"),t&&(this.Qw.getInputNode().value=""))},ux:function(t){this.Gm.getValues().id==t&&this.Gm.clear("user"),this.remove(t)},nx:function(t){if(!G.touch&&!t!=!this.cx){var i=this.Qw;this.cx=t?(this.Zw.getParentView().show(),i.define({height:84}),!0):(ji.hasFocus(this.Zw)&&ji.setFocus(this.Jw),this.Zw.getParentView().hide(),i.define({height:this.np}),!1),i.resize()}},focus:function(){var t=this;this.nx(!0),C(function(){t.Qw.focus()})},fx:function(t){t||(t=this.Qw.getValue()),t&&!this.Zw.isEnabled()?this.Zw.enable():!t&&this.Zw.isEnabled()&&this.Zw.disable()},Gw:function(){var e=this;this.ex=ni({view:"contextmenu",autowidth:!0,point:!1,data:[{id:"edit",icon:"wxi-pencil",value:P.comments.edit},{id:"remove",icon:"wxi-trash",value:P.comments.remove}],on:{onShow:function(){var t=e.ex.getContext();e.Jw.addCss(t.id,"active_menu")},onHide:function(){var t=e.ex.getContext();e.Jw.removeCss(t.id,"active_menu")},onItemClick:function(t){var i=e.ex.getContext();e.callEvent("onBeforeMenuAction",[t,i.id])&&("edit"==t?e.edit(i.id,"user"):"remove"==t&&(P.comments.confirmMessage?Vi({text:P.comments.confirmMessage,callback:function(t){t&&e.ux(i.id)}}):e.ux(i.id)))}}}),this.Vt.push(this.ex)},qw:function(t){var n=this,i=P.comments,e={view:"textarea",localId:"textarea",css:"webix_comments_textarea",height:this.np,name:"text",placeholder:i.placeholder,keyPressTimeout:100,on:{onTimedKeyPress:function(){n.fx()},onChange:function(t){n.fx(t)},onKeyPress:function(t,i){if(13==t){var e=n.B.sendAction,s=i.shiftKey;("enter"==e&&!s||"enter"!==e&&s)&&(wt(i),n.ax(!0))}}}};return!1!==t.highlight&&F.extend(e,{view:"texthighlight",type:"textarea",highlight:function(t){return n.lx(qt.escape(t),!0)}},!0),{view:"form",minHeight:50,paddingX:10,elements:[e,{hidden:!G.touch,cols:[{},{view:"button",disabled:!0,css:"webix_comments_send webix_primary",value:i.send,autowidth:!0,click:function(){n.ax()}}]}]}},lx:function(t,n){var r,h=this;if(-1===t.indexOf("@"))return t;"users"===this.B.highlight&&(
r=this.sx&&this.sx.B.textValue||"value");var i=n?this.vx:this._x;return t.replace(i,function(t,i,e,s){return h.mx(t,s||i,r,n)})},mx:function(t,i,e,s){return e&&!this.ox.find(function(t){return t[e]==i},!0)?t:'<span class="webix_comments_mention">'.concat(s?t:"@"+i,"</span>")},Uw:function(i){var o=this,h="webix_comments_",e={height:"auto",templateStatus:function(t){return"<span class = '"+h+"status "+t.status+"'></span>"},templateUser:function(t){var i=o.getUsers(),e=i&&i.exists(t.user_id)?i.getItem(t.user_id):{};return"<span class = '"+h+"name'>"+(e.value||"")+"</span>"},templateMenu:function(){return o.config.readonly?"":"<span class='webix_icon wxi-dots "+h+"menu'></span>"},templateDate:function(t){var i=rn.dateToStr("%d %M, %H:%i");return t.date?"<span class='"+h+"date'>"+i(t.date)+"</span>":""},templateLinks:function(t){return t.text.replace(/(https?:\/\/[^\s]+)/g,function(t){var i="<a target='_blank' href='"+(t=qt.escape(t))+"'>";return t.match(/.(jpg|jpeg|png|gif)$/)?i+="<img class='webix_comments_image' src='"+t+"'/>":i+=t,i+"</a>"})},templateMentioned:function(t){var i=t.text;return o.B.mentions&&o.B.highlight&&(i=o.lx(t.text)),i},templateText:function(t){return"<div class = '"+h+"message'>"+t.text+"</div>"},templateAvatar:function(t,i){var e="<div class='"+h+"avatar'>",s=o.getUsers(),n=s&&s.exists(t.user_id)?s.getItem(t.user_id):{};if(n.status&&(e+=i.templateStatus(n)),e+="<div class='"+h+"avatar_image ",n.image)e+="'><img src = '"+n.image+"' class='"+h+"photo'>";else{var r=n.value?n.value[0].toUpperCase():"<span class='webix_icon wxi-user'></span>";e+=h+"avatar_text'>"+r}return e+="</div></div>"},template:function(t,i){var e;if("$more"==t.id)e="<div class='webix_comments_more'>"+o.B.moreButton(t)+"</div>";else{t=S(t);var s=i.templateAvatar(t,i),n=i.templateUser(t,i),r=i.templateDate(t,i),h=i.templateMenu(t,i);t.text=i.templateMentioned(t),t.text=i.templateLinks(t),e=s+n+h+r+i.templateText(t,i)}return e},classname:function(t,i,e){var s=Er.api.type.classname(t,i,e);return(t.user_id&&t.user_id==o.B.currentUser||!o.ox.count())&&(s+=" webix_comments_current"),s}};e=F.extend(e,i.listItem||{},!0);var s={$init:function(t){t.date&&(t.date=P.parseFormatDate(t.date))}};i.scheme&&Object.keys(i.scheme).forEach(function(t){s[t]=i.scheme[t]});var t={view:"list",navigation:!1,type:e,scheme:s,onClick:{webix_comments_menu:function(t,i){o.ex.isVisible()?o.ex.hide():(o.ex.setContext({obj:o,id:i}),o.ex.show(t.target,e.menuPosition||{pos:"left",y:30,x:10}))},webix_comments_more:function(){if(o.config.url&&o.callEvent("onDataRequest",[])){o.hx=!0;var t=o.Jw.getItem("$more").value,i="chat"==o.B.mode?t:o.Jw.getIndexById("$more"),e=Y.$parse(o.config.url),s={error:function(){o.hx=!1}};"string"==typeof e&&(e=e+(e.indexOf("?")<0?"?":"&")+"pos="+i+"&more="+t),o.load(e,s,{pos:i,more:t})}}}};return i.save&&(t.save=i.save),t},Xw:function(t){var i=this;t&&t.getItem?this.ox=t:(this.ox=new vr,this.Vt.push(this.ox),t&&"string"==typeof t?this.ox.load(t):this.ox.parse(t||[])),this.ox.data.attachEvent("onStoreUpdated",function(){return i.Jw.refresh()})},tx:function(t){var s=this,i=this.config.readonly;i||this.bx(t),this.config.highlight&&(i||(this.vx=new RegExp("@(("(.*?)")|([^\\s]{1,}))","g")),this._x=new RegExp('@(("(.*?)")|([^\\s]{1,}))',"g")),m.all([this.Jw.waitData,this.ox.waitData]).then(function(){s.Jw.refresh()}),this.Jw.data.attachEvent("onStoreUpdated",function(t,i,e){!t||"add"!==e&&"update"!==e||s.gx(i)})},bx:function(t){var i="object"!=M(t)?{}:t;"object"!==M(i.body)?i.body={data:this.ox}:i.body.data=this.ox,F.extend(i,{view:"mentionsuggest"},!0);var e=this.Qw.define("suggest",i);this.Qw.setValueHere=function(t,i,e){return-1!=t.indexOf(" ")&&(t='"'.concat(t,'"')),dr.api.setValueHere.apply(this,[t,i,e])},this.sx=ai(e)},gx:function(h){var o=this;if(-1!=h.text.indexOf("@")){var a=this.sx&&this.sx.B.textValue||"value",u={};h.text.replace(this._x,function(t,i,e,s){var n=s||i,r=o.ox.find(function(t){return t[a]==n},!0);return r&&!u[n]&&(o.callEvent("onUserMentioned",[r.id,h.id]),u[n]=!0),t})}}}),Sh=(F.protoUI(Mh,Rt,An.view),{
name:"timeline",defaults:{scroll:"auto"},$init:function(t){var s=this,i="x"===t.layout;if(i){var e=t.type;this.type.type=e&&e.type||"top",z(t.scroll)&&(t.scroll="x")}this.zt.className+=i?" webix_timeline_horizontal":" webix_timeline",this.$blockRender=!0,this.data.provideApi(this,!0),this.data.attachEvent("onStoreUpdated",function(t,i,e){return s.render(t,i,e)})},_id:"webix_tl_id",on_click:{},$setSize:function(t,i){this.$blockRender=!1,Ki.api.$setSize.call(this,t,i)&&this.refresh()},render:function(t,i,e){if(this.isVisible(this.B.id)&&!this.$blockRender){if("update"!=e)return this.callEvent("onBeforeRender",[this.data])&&(this.Ni=null,this.tt.innerHTML=this.data.getRange().map(this.Q,this).join(""),this.callEvent("onAfterRender",[])),!0;var s=this.getItemNode(t);return _t(this.Ni[t]=this.Hu(i),s),vt(s),!0}},Q:function(t){this.callEvent("onItemRender",[t]);var i=this.getIndexById(t.id);return this.type.templateStart.call(this,t,this.type,i)+this.type.template.call(this,t,this.type,i)+this.type.templateEnd.call(this)},type:{type:"left",classname:function(t,i,e){var s="webix_timeline_item";return"alternate"!==i.type?s+=" webix_timeline_"+i.type:"x"==this.B.layout?s+=" webix_timeline_"+(e%2?"bottom":"top"):s+=" webix_timeline_"+(e%2?"right":"left"),i.css&&(s+=" "+i.css),t.$css&&("object"==M(t.$css)&&(t.$css=ut(t.$css)),s+=" "+t.$css),s},lineColor:function(t){return t.color},templateValue:qt("#value#"),templateDetails:function(t){return t.details||""},templateDate:function(t){return rn.dateToStr("%d %M, %Y")(t.date)},template:function(t,i,e){var s,n,r,h,o,a,u,c,f=re.dataPadding,l="string"==typeof i.lineColor?i.lineColor:i.lineColor(t,i),d="stroke-width:".concat(2,"px; stroke:").concat(l||re.timelineColor,";"),v=i.type,_=e+1==this.count(),p="position:relative;",m="",b="",g=i.templateDate(t,i),w=i.templateDetails(t,i),x='<div class="webix_timeline_value">'.concat(i.templateValue(t,i),"</div>\n\t\t\t\t").concat(w?'<div class="webix_timeline_details">'.concat(w,"</div>"):"");if("x"==this.B.layout){var y=this.$height-2*f,M=re.listItemHeight,S=f,k=y-M-14,C=M+14+f,$="top";"bottom"==v?(S=(M=y-M)+14+f,C=y-M+f+14,$="bottom"):"alternate"==v&&(S=(k=(M=Math.round(.5*y))-14)+f-20,C=M+14+f,e%2&&(S=C,$="bottom"));var D=t.$width||i.width;"auto"==D&&(D=this.wx([{text:x,css:"webix_timeline_event",height:k},{text:g,css:"webix_timeline_date"}]).width+f),m="top:".concat(S,"px;"),b="".concat($,":").concat(C,"px; height:auto; max-height:").concat(k,"px; width:inherit;"),s=D,n=M+14,p+="left:1px;",r=13,o="100%",c=a=h=M,u=7}else{var I=this.B.scroll?G.scrollSize:0,A=this.$width-2*f-I,T=Math.floor(.35*A),F=f,z=Math.floor(.65*A)-14,P=T+14+f,V=T-14;"right"==v?(F=(T=A-P+14+f)+14+f,P=f):"alternate"==v&&(P=(T=Math.floor(.5*A))+14+f,V=z=T-14,e%2&&(F=P,P=f));var H=t.$height||i.height;"auto"==H&&(H=this.wx([{text:x,css:"webix_timeline_event",width:z},{text:g,css:"webix_timeline_date",width:V}]).height+f),m="left:".concat(F,"px; width:").concat(V,"px;"),b="left:".concat(P,"px; width:").concat(z,"px; height:").concat(H-f,"px;"),s=T+14,n=H,p+="top:3px;",h=13,a="100%",u=o=r=T,c=7}return'<div style="'.concat(m,'" class="webix_timeline_date">').concat(g,'</div>\n\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="').concat(s,'px" height="').concat(n,'px" style="').concat(p,'">\n\t\t\t\t\t\t').concat(_?"":'<line x1="'.concat(r,'" y1="').concat(h,'" x2="').concat(o,'" y2="').concat(a,'" class="webix_timeline_node" style="').concat(d,'"/>'),'\n\t\t\t\t\t\t<circle cx="').concat(u,'" cy="').concat(c,'" r="').concat(6,'" class="webix_timeline_node webix_timeline_point" style="').concat(d,' fill:transparent;" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<div class="webix_timeline_event" style="').concat(b,'">\n\t\t\t\t\t\t').concat(x,"\n\t\t\t\t\t</div>")},widthSize:function(t,i){var e=t.$width||i.width;return e+(-1<e?"px":"")},heightSize:function(t,i){var e=t.$height||i.height;return e+(-1<e?"px":"")},templateStart:function(t,i,e){return"x"==this.B.layout?"<div ".concat("webix_tl_id",'="',t.id,'" class="').concat(i.classname.call(this,t,i,e),'" style="width:').concat(i.widthSize(t
,i),';">'):"<div ".concat("webix_tl_id",'="',t.id,'" class="').concat(i.classname.call(this,t,i,e),'" style="height:').concat(i.heightSize(t,i),';">')},templateEnd:qt("</div>")},wx:function(t){var i=lt("DIV");i.style.cssText="visibility:hidden;position:absolute;top:0px;left:0px;overflow:hidden;",document.body.appendChild(i);for(var e=0,s=0,n=0;n<t.length;n++)i.className="webix_measure_size "+t[n].css,i.style.width=t[n].width?t[n].width+"px":"auto",i.style.height=t[n].height?t[n].height+"px":"auto",i.innerHTML=t[n].text,e=Math.max(e,i.offsetWidth+1),s=Math.max(s,i.offsetHeight+1);return vt(i),{width:e,height:s}},templateValue_setter:function(t){this.type.templateValue=qt(t)},templateDetails_setter:function(t){this.type.templateDetails=qt(t)},templateDate_setter:function(t){this.type.templateDate=qt(t)},$skin:function(){this.type.height=re.timelineItemHeight,this.type.width=3*re.timelineItemHeight}}),kh=(F.protoUI(Sh,ss,es,Fe,Je,b,ee,Ki.view),{name:"menu",Am:"webix_menu",$init:function(t){t.autowidth&&(this.xx=!0,delete t.autowidth),this.yx(),this.data.attachEvent("onStoreUpdated",k(function(){this.ja()},this)),this.attachEvent("onItemClick",function(t,i,e){var s=this.getItem(t);if(s){if(s.$template)return;var n=this.getTopMenu();if(!n.callEvent("onMenuItemClick",[t,i,e]))return void(i.showpopup=n.B.id);this!=n&&n.Vu(t,i,e),this.type.Mx(s)||n.Sx?((G.touch||this===n&&"click"==n.B.openAction)&&this.Oa(t,e),i.showpopup=n.B.id):(n.ja(!0),n.kx&&n.hide())}}),this.attachEvent("onKeyPress",function(t){if(9===t)this.getTopMenu().ja();else if(13===t||32===t){var i,e=this.getSelectedId();e&&(i=this.getItemNode(e)),i&&yt(i,"MouseEvents","click")}}),this.data.attachEvent("onClearAll",function(){this.Cx=[]}),this.data.Cx=[],this.zt.setAttribute("role","menubar"),this.Vt=[]},yx:function(){this.attachEvent("onMouseMove",function(t,i,e){this.$x()&&this.Oa(t,e)}),this.attachEvent("onMouseOut",function(t){this.$x()&&"click"==this.B.openAction||this.Dx||t.relatedTarget&&this.$view.contains(t.relatedTarget)||this.ja()})},sizeToContent:function(){if("y"==this.B.layout){var i=[],e=!1;this.data.each(function(t){i.push(this.Q(t)),t.submenu&&(e=!0)},this),this.config.width=kt(i,this.$view.className).width+16+2+(e?15:0),this.resize()}},getTopMenu:function(){for(var t=this;t.Ea;)t=ai(t.Ea);return t},Pm:function(t){this.B.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.B.autoheight||t++):e+=this.type.height}return this.ju(t&&t<i,"y"),e},on_mouse_move:{},type:{Mx: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.Mx(t)?'aria-haspopup="true"':"")+(t.disabled?' aria-disabled="true" webix_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 Er.api.type.templateStart(t,i,e).replace(/^<div/,"<a "+s)+(i.Mx(t)&&i.subsign?"<div class='webix_submenu_icon'></div>":"")},templateEnd:function(t){return"Separator"===t.$template||"Spacer"===t.$template?"</div>":"</a>"},templateSeparator:qt("<div class='sep_line'></div>"),templateSpacer:qt("<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.Ix(e).getMenu(t);if(s)return s}}},getSubMenu:function(t){var i=this.getMenu(t),e=i.getItem(t);return e.submenu?i.Ix(e):null},getMenuItem:function(t){return this.getMenu(t).getItem(t)},Ix:function(t){var i=ai(t.submenu);return i||(t.submenu=this.Ax(t),i=ai(t.submenu)),i},$x:function(){if(G.touch)return!1;var t=this.getTopMenu();if("click"!=t.B.openAction)return!0;var i=t.Tx;return!(!i||!ai(i).isVisible())},Oa:function(t,i){var e=this.getItem(t);if(e&&(this.Dx=null,this.Tx&&e.submenu!=this.Tx&&this.ja(!0
),this.type.Mx(e)&&!this.config.hidden)){var s=this.Ix(e);if(!this.isItemEnabled(t))return;s.show(i,{pos:this.B.subMenuPos}),s.Ea=this.B.id,this.Tx=e.submenu}},disableItem:function(t){var i=this.getMenu(t);i&&i.Hm(t,!0)},enableItem:function(t){var i=this.getMenu(t);i&&i.Hm(t,!1)},isItemEnabled:function(t){var i=this.getMenu(t);if(i)return Er.api.isItemEnabled.apply(i,arguments)},Fx:function(t,i){var e=this.data;e.Cx[t]!=i&&(e.Cx[t]=i,e.filter(function(t){return!e.Cx[t.id]}),this.resize())},hideItem:function(t){var i=this.getMenu(t);i&&i.Fx(t,!0)},showItem:function(t){var i=this.getMenu(t);if(i)return i.Fx(t,!1),Er.api.showItem.call(i,t)},ja:function(t){if(this.Tx){var i=ai(this.Tx);i.ja&&i.ja(t),!t&&i.Jn||(i.hide(),this.Tx=null)}},Ax:function(t){var i={view:"submenu",data:this.type.Mx(t)},e=this.getTopMenu().B.submenuConfig;e&&F.extend(i,e,!0);var s=this.getMenuItem(t.id);s&&s.config&&F.extend(i,s.config,!0);var n=ni(i);return this.Vt.push(n),n.Ea=this,n.B.id},La:function(t,i,e){var s=this.getItem(t);return"Separator"!=s.$template&&"Spacer"!=s.$template&&this.isItemEnabled(t)?t:(t=this.getNextId(t,e)||null)&&t!=i?this.La(t,i,e):i},$skin:function(){Er.api.$skin.call(this),this.type.height=re.menuHeight},defaults:{scroll:"",layout:"x",mouseEventDelay:100,subMenuPos:"bottom"}}),Ch={api:kh,view:F.protoUI(kh,Er.view)},$h={name:"submenu",$init:function(){this.$t=l(this.zx),(this.$t.Ht=this).attachEvent("onBeforeShow",function(){this.getTopMenu().xx&&this.sizeToContent&&!this.isVisible()&&this.sizeToContent()}),this.tt.setAttribute("role","menu")},$skin:function(){Ch.api.$skin.call(this),Nn.api.$skin.call(this),this.type.height=re.menuHeight},yx:function(){this.attachEvent("onMouseMove",function(t,i,e){this.$x()&&this.Oa(t,e)}),this.attachEvent("onMouseOut",function(t){"click"!=this.getTopMenu().B.openAction&&(this.Dx||this.Jn||!t.relatedTarget||this.$view.contains(t.relatedTarget)||this.hide())}),this.attachEvent("onMouseMoving",function(){this.Ea&&(ai(this.Ea).Dx=!0)})},zx:{$getSize:function(t,i){var e=1*this.Ht.B.height,s=1*this.Ht.B.width,n=Ch.api.$getSize.call(this.Ht,t,i);return this.Ht.B.height=e,this.Ht.B.width=s,n},$setSize:function(t,i){this.Ht.B.scroll&&(this.Ht.zn.style.height=i+"px")},destructor:function(){this.Ht=null}},body_setter:function(){},getChildViews:function(){return[]},defaults:{width:150,subMenuPos:"right",layout:"y",autoheight:!0},type:{height:re.menuHeight,subsign:!0}},Dh={api:$h,view:F.protoUI($h,Ch.view,Nn.view)},Ih={name:"sidemenu",defaults:{animate:!0,position:"left",width:200,borderless:!0},$init:function(){this.$view.className+=" webix_sidemenu"},$skin:function(){Nn.api.$skin.call(this),this.defaults.padding=0},position_setter:function(t){var i=this.B.position;return i&&St(this.$view," webix_sidemenu_"+i),Mt(this.$view," webix_sidemenu_"+t),t},$getSize:function(){var t=be.api.$getSize.apply(this,arguments);return this.Px=t},$setSize:function(t,i){Qi.api.$setSize.call(this,t,i),t=this.xe-2*this.B.padding,i=this.Me-2*this.B.padding,this.Ui.style.padding=this.B.padding+"px",this.mn.style.display="none",this.zn.style.height=i+"px",this.$t.$setSize(t,i)},show:function(){if(!this.callEvent("onBeforeShow",arguments))return!1;this.B.hidden=!1,this.zt.style.zIndex=pi(this.B.zIndex),(this.B.modal||this.Vn)&&(this.bn(!0),this.Vn=null),this.zt.style.display="block",this.Ce(),this.B.position&&this.ii(),this.En=1,C(function(){this.En=0},this,[],G.touch?400:100),this.config.autofocus&&(this.jn=ji.getFocus(),ji.setFocus(this)),-1==ei.kt.find(this)&&ei.kt.push(this),this.callEvent("onShow",[])},ii:function(t){var i,e,s,n,r,h=0,o=0,a={};this.$view.style.position="fixed",s=document.documentElement.offsetWidth,n=document.documentElement.offsetHeight,i=this.Px[0]||s,e=this.Px[2]||n,"top"==(r=this.B.position)?i=s:"right"==r?(e=n,h=s-i):"bottom"==r?(i=s,o=n-e):e=n,a={left:h,top:o,width:i,height:e,maxWidth:s,maxHeight:n},"function"==typeof this.B.state&&this.B.state.call(this,a),this.Vx=a,this.$setSize(a.width,a.height),void 0===t&&this.Hx()?(St(this.$view,"webix_animate"),this.Lw[this.B.position].beforeShow.call(this,
a),C(function(){Mt(this.$view,"webix_animate",!0)},this,null,1),C(function(){this.Lw[this.B.position].show.call(this,a)},this,null,10)):("right"===this.B.position&&(a.left=a.right?s-a.width-a.right:s-a.width),this.setPosition(a.left,a.top))},Vx:{},Hx:function(){return ne.isSupported()&&this.B.animate&&!(G.isIE&&-1!=navigator.appVersion.indexOf("MSIE 9"))},hidden_setter:function(t){return t?this.hide():this.show(),!!t},Lw:{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"}}},Nn:function(){var t=document.documentElement.offsetWidth,i=document.documentElement.offsetHeight;if(this.Hx()&&t==this.Vx.maxWidth&&i==this.Vx.maxHeight){this.Lw[this.B.position].hide.call(this,this.Vx);var e=Qt(this.$view,G.transitionEnd,k(function(){this.Wn(),ti(e)},this))}else this.Wn()}},Ah=(F.protoUI(Ih,Nn.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=re.sidebarTitleHeight},$init:function(t){this.Rx=z(t.width)?this.defaults.width:t.width,this.B.width=t.width=t.collapsed?t.collapsedWidth||this.defaults.collapsedWidth:this.Rx,this.$view.className+=" webix_sidebar",this.$ready.push(this.Bx),this.$ready.push(this.Ex),this.data.Zr=function(t){t.data?t.menu=S(t.data):t.item&&(t.menu=S(t.item.length?t.item:[t.item]))},t.multiselect=!1},on_context:{},on_mouse_move:{},Bx:function(){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){var s=this.getPopup();s&&!s.config.hidden&&(i.showpopup=s.config.id),G.touch&&this.jx(t,e)}),this.attachEvent("onBeforeSelect",function(t){return!this.getItem(t).$count&&(this.clearCss("webix_sidebar_selected"),!0)}),this.attachEvent("onAfterSelect",function(t){this.Lx(this,t,!re.sidebarMarkAll),this.getPopup().Ox(t)}),this.attachEvent("onAfterUnSelect",function(){this.clearCss("webix_sidebar_selected")}),this.attachEvent("onMouseMove",function(t,i,e){this.jx(t,e)}),this.attachEvent("onMouseOut",function(){this.config.collapsed&&(this.getPopup().masterId=null)})},jx:function(t,i){if(this.config.collapsed){var e=this.getPopup();e&&(this.Nx(t,e),this.Wx(t,e),e.masterId=t,e.show(i,{x:"left"==this.config.position?this.config.collapsedWidth:-e.config.width,y:-1}))}},Nx:function(t,i){var e=i.getBody().getChildViews()[0];e&&i.masterId!=t&&(e.parse(this.getItem(t)),this.getSelectedId()==t?Mt(e.$view,"webix_selected",!0):St(e.$view,"webix_selected"))},Wx:function(t,i){var e=i.getBody().getChildViews()[1];if(e&&i.masterId!=t){this.exists(i.masterId)&&this.getItem(i.masterId).menu&&this.updateItem(i.masterId,{menu:e.data.serialize()}),e.clearCss("webix_sidebar_selected"),e.unselectAll();var s=S(this.getItem(t).menu||[]);if(s.length){e.show(),e.data.importData(s);var n=this.getSelectedId();e.exists(n)?e.select(n):n&&this.Lx(e,n)}else e.hide(),e.data.clearAll()}},Ex:function(){
var e,n=this,s=n.config;if(s.popup&&(e=ai(s.popup)),!e){var t="left"==s.position?"webix_sidebar_popup_left":"webix_sidebar_popup_right",i="left"==s.position?"right":"left",r=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},h=s.css?" "+s.css:"",o={view:"popup",css:"webix_sidebar_popup "+t+h,autofit:!1,width:this.Rx-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.getValues().id;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+h,template:r,type:{subsign:!1},submenuConfig:{padding:0,subMenuPos:i,template:r,select:!0,type:{subsign:!1},css:"webix_sidebar_popup_list "+t+h,on:{onShow:function(){this.clearCss("webix_sidebar_selected"),this.unselectAll();var t=n.getSelectedId();t&&this.exists(t)?this.select(t):t&&n.Lx(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.Lx(s,t)),e=n.getParentId(e)}n.Lx(this,t)}}},on:{onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onMenuItemClick:function(t){this.getSubMenu(t)||n.select(t)}}}]}};F.extend(o,s.popup||{},!0),(e=ni(o)).Ox=function(t){if(n.config.collapsed&&1==n.getItem(t).$level){var i=e.getBody().getChildViews()[0];i&&Mt(i.$view,"webix_selected",!0)}},e.queryView({view:"menu"}).Sx=!0}e.attachEvent("onBeforeShow",function(){return s.collapsed}),this.Vt=[e],s.popupId=e.config.id,Zt(document.body,"mousemove",function(t){var i=t.target;e.config.hidden||e.$view.contains(i)||this.$view.firstChild.contains(i)||e.queryView({view:"menu"}).Tx||e.hide()},{bind:this})},Lx:function(i,e,s){var n="webix_sidebar_selected";i.data.each(function(t){!this.Yx(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)},Yx:function(t,i){var e=this.getParentId(t);return i==e||!!e&&this.Yx(e,i)},getPopup:function(){return ai(this.config.popupId)},position_setter:function(t){var i=t,e="left"==t?"right":"left";St(this.$view,"webix_sidebar_"+e),Mt(this.$view,"webix_sidebar_"+i,!0);var s=this.getPopup();if(s){var n=s.$view;St(n,"webix_sidebar_popup_"+e),Mt(n,"webix_sidebar_popup_"+i,!0)}return t},select:function(t){t&&(I(t)&&(t=t.pop()),gh.api.select.call(this,t))},selectAll:function(){},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.Rx,this.type.collapsed=!1,Mt(this.$view,"webix_sidebar_expanded",!0)),z(i)||i===this.config.width||(this.define("width",i),this.resize()),t},getState:function(){var t={collapsed:this.config.collapsed};return F.extend(t,ys.getState.call(this)),t},setState:function(t){ys.setState.call(this,t),this.define("collapsed",t.collapsed)}});ii(gh.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>"}});F.protoUI(Ah,gh.view),F.protoUI({name:"context"},ge,Nn.view);var Th={name:"contextmenu",kx:!0,$init:function(t){t.submenuConfig&&F.extend(t,t.submenuConfig)}},Fh=(F.protoUI(Th,ge,Dh.view),{name:"vscroll",$apiOnly:!0,defaults:{scroll:"x",scrollPos:0,
scrollSize:18,scrollVisible:1,zoom:1},$init:function(t){var i=t.scroll||"x",e=this.zt=D(t.container);e.className+=" webix_vscroll_"+i,e.innerHTML="<div class='webix_vscroll_body'></div>",Zt(e,"scroll",this.Ux,{bind:this}),this.qx=0},$skin:function(){this.defaults.scrollStep=re.rowHeight},reset:function(){this.config.scrollPos=0,this.zt["x"==this.config.scroll?"scrollLeft":"scrollTop"]=0},Gx:function(t){return 15e5<t?(this.B.zoom=t/1e6,t=1e6):this.B.zoom=1,t},scrollWidth_setter:function(t){return t=this.Gx(t),this.zt.firstChild.style.width=t+"px",t},scrollHeight_setter:function(t){return t=this.Gx(t),this.zt.firstChild.style.height=t+"px",t},sizeTo:function(t,i,e){t=t-(i||0)-(e||0);var s=this.B.scrollSize;G.isIE&&s&&(s+=1),s||!this.B.scrollVisible||G.$customScroll||(this.zt.style.pointerEvents="none",s=14),s?(this.zt.style.display="block",i&&(this.zt.style.marginTop=i+"px"),this.zt.style["x"==this.B.scroll?"width":"height"]=Math.max(0,t)+"px",this.zt.style["x"==this.B.scroll?"height":"width"]=s+"px"):this.zt.style.display="none",this.qx=t},getScroll:function(){return Math.round(this.B.scrollPos*this.B.zoom)},getSize:function(){return Math.round((this.B.scrollWidth||this.B.scrollHeight)*this.B.zoom)},Xx:function(){var t=this.getScroll(),i=Math.max(this.getSize()-this.qx,0);i<t&&this.scrollTo(i)},scrollTo:function(t){t<0&&(t=0);var i=this.B;if((t/=i.zoom)<0&&(t=0),t!=this.B.scrollPos)return this.zt["x"==i.scroll?"scrollLeft":"scrollTop"]=t,this.Kx(t,!0),!0},Ux:function(){var t=this.zt["x"==this.B.scroll?"scrollLeft":"scrollTop"];Math.floor(t)!=Math.floor(this.B.scrollPos)&&this.Kx(t,!1)},Kx:function(t,i){var e=this.B.scrollWidth||this.B.scrollHeight;t>=e-this.qx/(i?this.B.zoom:1)&&(t=Math.max(0,e-this.qx/this.B.zoom)),this.B.scrollPos=t||0,this.callEvent("onScroll",[this.getScroll()])},activeArea:function(t,i){this.Jx=i,Zt(t,"wheel",this.Zx,{bind:this,passive:!1}),this.Qx(t)},Qx:function(t){!G.touch&&window.navigator.pointerEnabled&&(Mt(t,"webix_scroll_touch_ie",!0),Zt(t,"pointerdown",function(t){"touch"!=t.pointerType&&"pen"!=t.pointerType||(this.Je=ue.Ns(t),this.ty=this.getScroll())},{bind:this}),Qt(document.body,"pointermove",function(t){var i;this.Je&&(this.Ze=ue.Ns(t),"x"==this.B.scroll?i=this.Ze.x-this.Je.x:"y"==this.B.scroll&&(i=this.Ze.y-this.Je.y),i&&5<Math.abs(i)&&this.scrollTo(this.ty-i))},{bind:this}),Qt(window,"pointerup",function(){this.Je&&(this.Je=this.Ze=null)},{bind:this}))},Zx:function(t){var i=0,e=0===t.deltaMode?30:1;return!t.ctrlKey&&(t.deltaX&&Math.abs(t.deltaX)>Math.abs(t.deltaY)?this.Jx&&this.B.scrollVisible&&(i=t.deltaX/e):!this.Jx&&this.B.scrollVisible&&(i=z(t.deltaY)?t.detail:t.deltaY/e),G.isSafari&&(this.iy=t.target),i&&this.scrollTo(this.getScroll()+i*this.B.scrollStep)?wt(t):void 0)}}),zh=(F.protoUI(Fh,b,Li),{filterByAll:function(){var t=this,o=!1;this.data.silent(function(){var r=this;this.filter();var h=!1,t=function(e){if(!r.isColumnVisible(e))return"continue";var t=r.Bh[e],i=t[2].getValue(t[0]),s=i;t[1].prepare&&(s=t[1].prepare.call(t[2],s,t[1],r)),t[1].value=i;var n=t[1].compare;if(!r.callEvent("onBeforeFilter",[e,s,t[1]]))return"continue";if(t[2].$server||o)o=!0;else{if(""===s)return"continue";n?(n=r.ey(e,n),r.filter(k(function(t,i){return!!t&&n(t[e],i,t)},r),s,h)):r.filter(e,s,h),h=!0}};for(var i in this.Bh)t(i)},this),o?this.Wh?this.Wh.filter=!0:this.loadNext(0,0,0,0,!0,!0).then(function(){return t.Gh()}):(this.refresh(),this.callEvent("onAfterFilter",[]))},ey:function(t,r){var i=this.getColumnConfig(t),h=i?i.optionslist:null;return h?("string"!=typeof h&&(h=","),function(t,i,e){if(!t)return!1;for(var s=t.toString().split(h),n=0;n<s.length;n++)if(r(s[n],i,e))return!0}):r},filterMode_setter:function(t){return F.extend(this.data.mh,t,!0)},getFilter:function(t){var i=this.Bh[t];return i&&i[2].sy?i[2].sy(i[0]):i&&i[2].getInputNode?i[2].getInputNode(i[0]):null},registerFilter:function(t,i,e){this.Bh[i.columnId]=[t,i,e]},collectValues:function(t,i){var e=this.getColumnConfig(t),s=i&&i.visible?null:e.collection,n={values:s?this.qf.call(s,"id","value"):this.qf(e.id,e.id)}
;return this.callEvent("onCollectValues",[t,n]),n.values},qf:function(e,s){var n={"":!0},r=[];if(this.data.each(function(t){var i=t?t[e]:"";0===i&&(i="0"),"object"==M(i)&&(i=String(i)),i===undefined||n[i]||(n[i]=!0,r.push({id:i,value:t[s]}))},this,!0),r.length){var t="string"==typeof r[0].value?"string":"raw";r.sort(this.data.sorting.create({as:t,by:"value",dir:"asc"}))}return r},Gh:function(){this.editStop&&this.editStop(),this.callEvent("onAfterFilter",[])}}),Ph={hover_setter:function(t){var s=this;return t&&!this.ny&&(this.ou(),this.config.experimental=!0,this.attachEvent("onMouseMoving",function(t){if(le.active)s.ry&&(s.ry=s.removeRowCss(s.ry,s.B.hover));else{var i=s.locate(t);!i&&G.isEdge&&t.relatedTarget&&(i=s.locate(t.relatedTarget));var e=i?i.row:null;s.ry!=e&&(s.ry&&s.removeRowCss(s.ry,s.B.hover),s.ry=e,s.ry&&s.addRowCss(s.ry,s.B.hover))}}),Zt(this.$view,"mouseout",function(t){var i=t.target;s.ry&&document.body.contains(i)&&((t.relatedTarget?s.locate(t.relatedTarget):null)||(s.removeRowCss(s.ry,s.B.hover),s.ry=null))}),this.ny=1),t},select_setter:function(t){return!this.select&&t&&(F.extend(this,this.oy.hy,!0),!0===t?t="row":"multiselect"==t&&(t="row",this.B.multiselect=!0),this.oy[t],F.extend(this,this.oy[t],!0)),t},getSelectedId:function(t){return t?[]:""},getSelectedItem:function(t){return ns.getSelectedItem.call(this,t)},oy:{hy:{ay:" webix_cell_select",$init:function(){this.uy(),this.on_click.webix_cell=k(this.cy,this),this.fy=this.Nu=function(){this.unselect()},this.data.attachEvent("onStoreUpdated",k(this.Lu,this)),this.data.attachEvent("onSyncApply",k(this.ly,this)),this.data.attachEvent("onClearAll",k(this.fy,this)),this.data.attachEvent("onAfterFilter",k(this.Nu,this)),this.data.attachEvent("onIdChange",k(this.Yu,this)),this.$ready.push(ns.Uu)},Yu:function(t,i){for(var e=0;e<this.vy.length;e++)this.vy[e]==t&&(this.vy[e]=i);for(var s=0;s<this._y.length;s++){var n=this._y[s];n.row==t&&(t=this.my(n),n.row=i,i=this.my(n),n.id=i,delete this.gy[t],this.gy[i]=!0)}},Lu:function(t,i,e){"delete"==e&&this.unselect(t)},ly:function(){for(var t=this._y.length-1;0<=t;t--){var i=this._y[t].row;this.exists(i)||(this._y.splice(t,1),delete this.gy[i])}},uy:function(){this._y=[],this.gy={},this.vy=[]},isSelected:function(t,i){var e;return e=z(i)?"object"===M(t)?this.my(t):t:this.my({row:t,column:i}),this.gy[e]},getSelectedId:function(t,i){var e;if(1<this._y.length||t){if(e=[].concat(this._y),i)for(var s=0;s<e.length;s++)e[s]=e[s].id}else if(e=this._y[0],i&&e)return e.id;return e},wy:function(){return this.row},Xh:function(t,i){var e=this.my(t);if(null!==e){if(-1===i)return this.xy(t);if(t.id=e,t.toString=this.wy,!this.callEvent("onBeforeSelect",[t,i]))return!1;if(!this.gy[e]||!i&&1!=this._y.length)return i||this.yy(),this._y.push(t),this.gy[e]=!0,this.callEvent("onAfterSelect",[t,i]),this.My(this.Sy(t)),!0}},yy:function(){if(!this._y.length)return!1;for(var t=0;t<this._y.length;t++)if(!this.callEvent("onBeforeUnSelect",[this._y[t]]))return!1;for(var i=0;i<this.vy.length;i++)this.data.removeMark(this.vy[i],"webix_selected",0,!0);var e=this.B.columns;if(e)for(var s=0;s<e.length;s++)e[s].$selected=null;var n=this._y;this.uy();for(var r=0;r<n.length;r++)this.callEvent("onAfterUnSelect",[n[r]]);return!0},unselectAll:function(){this.clearSelection()},selectAll:function(){this.selectRange()},clearSelection:function(){this.yy()&&(this.callEvent("onSelectChange",[]),this.render())},xy:function(t){var i=this.my(t);if(!i&&this._y.length&&(this.clearSelection(),this.callEvent("onSelectChange",[])),this.gy[i]){if(!this.callEvent("onBeforeUnSelect",[t]))return!1;for(var e=0;e<this._y.length;e++)if(this._y[e].id==i){this._y.splice(e,1);break}delete this.gy[i],this.callEvent("onAfterUnSelect",[t]),this.My(0,this.ky(t))}},Cy:function(t){var i=this.getItem(t);return this.data.addMark(i.id,"webix_selected",0,{$count:0},!0)},My:function(t){t&&this.vy.push(t),this.Gu||(this.render(),this.callEvent("onSelectChange",[]))},cy:function(t,i){var e=t.ctrlKey||t.metaKey||"touch"==this.B.multiselect,s=t.shiftKey;if(
this.B.multiselect||"multiselect"==this.B.select||"area"==this.B.select||(e=s=!1),s&&this._y.length){var n=this._y[this._y.length-1];this.$y(i,n)}else e&&this.gy[this.my(i)]?this.xy(i):this.Xh({row:i.row,column:i.column},e)},Dy:function(t,i,e){var s=this.B.columns;if(i){for(var n=[],r=0;r<s.length;r++)s[r].$selected&&n.push(s[r]);s=n}for(var h=this.data.order,o=0,a=0;a<h.length;a++){var u=this.getItem(h[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:h[a],column:d};u[d]=t(u[d],h[a],d,o,f),f++}}o++}}}}},row:{ay:" webix_row_select",my:function(t){return t.row},select:function(t,i){t&&(t=t.toString()),this.data.exists(t),this.Xh({row:t},i)},Sy:function(t){return this.Cy(t.row).$row=!0,t.row},unselect:function(t){this.xy({row:t})},ky:function(t){return this.data.removeMark(t.row,"webix_selected",0,!0),t.row},mapSelection:function(t){return this.Dy(t,!1,!0)},$y:function(t,i){return this.selectRange(t.row,i.row)},selectRange:function(t,i,e){z(e)&&(e=!0);var s=t?this.getIndexById(t):0,n=i?this.getIndexById(i):this.data.order.length-1;if(n<s){var r=s;s=n,n=r}this.Gu=!0;for(var h=s;h<=n;h++){var o=this.getIdByIndex(h);if(!o){t&&this.select(t);break}this.select(o,e)}this.Gu=!1,this.My()}},cell:{my:function(t){return t.column?t.row+"_"+t.column:null},select:function(t,i,e){this.data.exists(t),this.Xh({row:t,column:i},e)},Sy:function(t){var i=this.Cy(t.row);return i.$count++,i[t.column]=!0,t.row},unselect:function(t,i){this.xy({row:t,column:i})},ky:function(t){var i=this.Cy(t.row);return i.$count--,i[t.column]=!1,i.$count<=0&&this.data.removeMark(t.row,"webix_selected",0,!0),t.row},mapSelection:function(t){return this.Dy(t,!1,!1)},$y:function(t,i){return this.selectRange(t.row,t.column,i.row,i.column)},selectRange:function(t,i,e,s,n){z(n)&&(n=!0);var r=t?this.getIndexById(t):0,h=e?this.getIndexById(e):this.data.order.length-1,o=i?this.getColumnIndex(i):0,a=s?this.getColumnIndex(s):this.xf.length-1;if(h<r){var u=r;r=h,h=u}if(a<o){var c=o;o=a,a=c}this.Gu=!0;for(var f=r;f<=h;f++)for(var l=o;l<=a;l++)this.select(this.getIdByIndex(f),this.columnId(l),n);this.Gu=!1,this.My()}},column:{ay:" webix_column_select",my:function(t){return t.column},wy:function(){return this.column},select:function(t,i){this.Xh({column:t},i)},Sy:function(t){this.B.columns[this.getColumnIndex(t.column)].$selected=!0,this.Gu||this.Iy()},unselect:function(t){this.xy({column:t})},ky:function(t){this.B.columns[this.getColumnIndex(t.column)].$selected=null,this.Iy()},mapSelection:function(t){return this.Dy(t,!0,!1)},$y:function(t,i){return this.selectRange(t.column,i.column)},selectRange:function(t,i,e){z(e)&&(e=!0);var s=t?this.getColumnIndex(t):0,n=i?this.getColumnIndex(i):this.xf.length-1;if(n<s){var r=s;s=n,n=r}this.Gu=!0;for(var h=s;h<=n;h++)this.select(this.columnId(h),e);this.Gu=!1,this.Iy(),this.My()},ly:function(){}},area:{my: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 r=this.getColumnIndex(i.start.column),h=this.getColumnIndex(i.end.column),o=s;o<=n;o++)for(var a=r;a<=h;a++)e.push({row:this.getIdByIndex(o),column:this.columnId(a)})}return t?e:e[0]},unselect:function(){this.xy()},xy: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),r=this.getIndexById(i.end.row),h=n;h<=r;h++)for(var o=this.data.order[h],a=this.getItem(o),u=e;u<=s;u++){var c=this.xf[u].id;if(!t)return{row:o,column:c};a[c]=t(a[c],o,c,h-n,u-e)}},select:function(t,i,e){this.data.exists(t),this.Xh({row:t,column:i},e)},$y:function(t,i){this.Ay(t,i)},Xh:function(t){return this.addSelectArea(t,t,!1),!0},ly:function(){this._y.length&&this.refreshSelectArea()}}}},Vh={
blockselect_setter:function(t){return t&&this.Ty&&(G.touch?this.attachEvent("onLongTouch",this.Fy):Zt(this.zt,G.mouse.down,this.Fy,{bind:this}),Zt(this.zt,G.mouse.move,this.zy,{bind:this}),this.Ty=this.Py=this.Vy=!1,this.attachEvent("onAfterScroll",this.Hy),F.extend(this,Xt,!0),this.attachEvent("onBeforeAutoScroll",function(){return this.Vy})),t},Ty:!0,Ry:function(t,i){for(var e=t.target;e;){if(e.getAttribute&&e.getAttribute("webixignore"))return!1;if(e==i)return!0;e=e.parentNode}return!1},Fy:function(t){if((!this.B.subview||this==ai(t.target))&&this.Ry(t,this.st)){if(t.target&&"INPUT"==t.target.tagName||this.vd)return;this.By=mt(this.st);var i=G.touch?t:gt(t);this.Py=[i.x-this.By.x,i.y-this.By.y],wt(t),this.Ey()}},Ey:function(){var i=this,e=Qt(document.body,G.mouse.up,function(t){return ti(e),i.jy(t)})},jy:function(t){this.Ly&&(this.Oy("select",!0,t),this.Ly=vt(this.Ly)),St(document.body,"webix_noselect"),this.Py=this.Vy=!1,this.ht&&(this.ht=window.clearTimeout(this.ht))},Hy:function(){this.Vy&&C(this.Oy,this,[!1,!1])},Oy:function(t,i,e){var s;this.Py[2]||(this.Py[2]=this.Ny.apply(this,this.Py)),s=this.Py[2];var n=this.Ny.apply(this,this.Vy);if(this.callEvent("onBeforeBlockSelect",[s,n,i,e])){if((!this.Wy||!1!==this.Wy(s,n,i,e))&&s.row&&n.row)if("select"===t)this.yy(),this.$y(s,n);else{var r,h,o,a;if("box"===t)r=Math.min(this.Py[0],this.Vy[0]),o=Math.max(this.Py[0],this.Vy[0]),h=Math.min(this.Py[1],this.Vy[1]),a=Math.max(this.Py[1],this.Vy[1]);else{var u=this.at(s.row,s.column),c=this.at(n.row,n.column),f=this.getScrollState(),l=u.width,d=c.width;this.Yy&&this.Py[0]>this.Uy+this.qy?u.left+=this.Uy+this.qy:this.Uy?this.Py[0]>this.Uy&&(u.left<f.x?(l-=f.x-u.left,u.left=this.Uy):u.left+=this.Uy-f.x):u.left-=f.x,this.Yy&&this.Vy[0]>this.Uy+this.qy?c.left+=this.Uy+this.qy:this.Uy?this.Vy[0]>this.Uy&&(c.left<f.x?(d-=f.x-c.left,c.left=this.Uy):c.left+=this.Uy-f.x):c.left-=f.x,this.B.prerender&&(u.top-=this.Gy,c.top-=this.Gy),r=Math.min(u.left,c.left),o=Math.max(u.left+l,c.left+d),h=Math.min(u.top,c.top),a=Math.max(u.top+u.height,c.top+c.height),this.B.topSplit&&(h+=this.Xy(s)),this.ht&&(this.ht=window.clearTimeout(this.ht)),!e||G.touch&&!this.B.prerender||(this.ht=C(this.et,this,[gt(e)],250))}var v=this.Ly.style;v.left=r+"px",v.top=h+"px",v.width=o-r+"px",v.height=a-h+"px"}i&&this.callEvent("onAfterBlockSelect",[s,n])}},Ky:function(){this.Ly=lt("div",{"class":"webix_block_selection"},""),this.st.appendChild(this.Ly)},zy:function(t){if(!this.bd&&!1!==this.Py){this.Vy||Mt(document.body,"webix_noselect");var i=G.touch?G.mouse.context(t):gt(t),e=[i.x-this.By.x,i.y-this.By.y];if(Math.abs(this.Py[0]-e[0])<5&&Math.abs(this.Py[1]-e[1])<5)return;!1===this.Vy&&this.Ky(t),this.Vy=e,this.Oy(this.config.blockselect,!1,t),G.touch&&wt(t)}},Ny:function(t,i){var e=!1,s=null,n=null;if(this.Yy&&t>this.Uy+this.qy?t+=this.Jy.getSize()-this.qy-this.Uy-this.Yy:(!this.Uy||t>this.Uy)&&(t+=this.Jy.getScroll()),this.B.topSplit&&this.Zy>this.B.topSplit){var r=this.at(this.getIdByIndex(this.B.topSplit-1),this.columnId(0));r.top+r.height>i&&(e=!0)}e||(i+=this.getScrollState().y),t<0&&(t=0),i<0&&(i=0);for(var h=this.B.columns,o=this.data.order,a=0,u=0;u<h.length;u++)if(t<=(a+=h[u].width)){n=h[u].id;break}n||(n=h[h.length-1].id),a=0;var c=this.data.$min||0;if(this.B.fixedRowHeight)s=o[c+Math.floor(i/this.B.rowHeight)];else for(var f=c;f<o.length;f++)if(i<=(a+=this.Qy(f))){s=o[f];break}return s||(s=o[o.length-1]),{row:s,column:n}},Xy:function(t,i){var e=0,s=this.getIndexById(t.row);if(s>=this.B.topSplit){var n=this.at(this.getIdByIndex(s),t.column),r=this.at(this.getIdByIndex(this.B.topSplit-1),t.column);r.top+r.height>n.top&&(e=r.top+r.height-(0<n.top||!i?n.top:0))}return e}},Hh={resizeRow_setter:function(t){return this.B.scrollAlignY=!1,this.B.fixedRowHeight=!1,this.resizeColumn_setter(t)},resizeColumn_setter:function(t){var i=this;return t&&this.tM&&(Zt(this.zt,"mousemove",function(t){return i.iM(t)}),Zt(this.zt,"mousedown",function(t){return i.eM(t)}),Zt(this.zt,"mouseup",function(){return i.sM()}),this.tM=!1),t},tM:!0,eM:function(t){
!this.nM||this.B.subview&&this!=ai(t.target)||(this.vd=[gt(t),this.nM],Mt(document.body,"webix_noselect"),ht())},sM:function(){this.vd=!1,St(document.body,"webix_noselect"),ot()},rM:function(){var i=this;if(!this.bd){var t,e=a(this.vd[1],4),s=e[0],n=e[1],r=e[2],h=e[3],o=this.vd[0];o="x"==s?(t=mt(r).x+n-mt(this.st).x,o.x):(t=mt(r).y+n-mt(this.st).y+this.po,o.y),this.bd=[s,h,t],new ni.resizearea({container:this.zt,eventPos:o,start:t,dir:s,cursor:("x"==s?"col":"row")+"-resize"}).attachEvent("onResizeEnd",function(t){return i.hM(t)}),this.nM=!1}},hM:function(t){if(this.bd){var i=this.bd[1],e=t-this.bd[2];if("x"==this.bd[0]){this.B.rightSplit&&i.cind>=this.oM&&(e*=-1);var s=this.xf[i.cind],n=s.width;delete s.fillspace,delete s.adjust,this.Oh(i.cind,n+e,!0,!0),this.Nh()}else{var r=this.getIdByIndex(i.rind),h=this.aM(this.getItem(r));this.setRowHeight(r,h+e)}this.sM()}this.bd=null},iM:function(t){if(this.nM&&this.vd)return this.rM();var i=this.nM=!1,e=t.target,s=this.B,n=e.getAttribute("class")||"",r=-1!=n.indexOf("webix_cell");if(r&&s.drag)return this.uM(i);var h=-1!=n.indexOf("webix_hcell");if(r||h){var o=bt(t),a=this.Hs(e);i=this.cM(a,o,e,s.resizeColumn,r)||r&&this.fM(a,o,e,s.resizeRow)}this.uM(i)},cM:function(t,i,e,s,n){if(!s||n&&s.headerOnly)return!1;var r,h,o=e.offsetWidth;return s=s.size?s.size:3,i.x<s?(t.cind<this.oM&&(t.cind-=t.span||1),r=this.xf[t.cind],h=["x",0,e,t]):o-i.x<s+1&&(this.B.rightSplit&&t.cind+1>=this.oM&&t.cind++,(!this.B.rightSplit||t.cind<this.xf.length)&&(r=this.xf[t.cind],h=["x",o,e,t])),!(!r||!1===r.resize)&&(this.nM=h,"col-resize")},fM:function(t,i,e,s){if(!s||s.headerOnly&&0<t.cind)return!1;if(this.Vy)return!1;var n=e.offsetHeight;return s=s.size?s.size:3,i.y<s?0<t.rind&&(t.rind--,this.nM=["y",0,e,t]):n-i.y<s+1&&(this.nM=["y",n,e,t]),!!this.nM&&"row-resize"},uM:function(t){this.lM&&window.clearTimeout(this.lM),this.lM=C(this.dM,this,[t],t?100:0)},dM:function(t){this.vM!=t&&(this.vM=t,this.zt.style.cursor=t||"")}};y("onDataTable",function(t,i){G.touch&&(ue.$init(),i.scrollSize=0,ue.Te&&ue.limit(),t.$ready.push(t.$touch))});var Rh={$touch:function(){var t=this.B;t.scrollAlignY=!1,F.extend(this,!0===t.prerender?this._M:this.pM);var i="";t.autowidth||!1===t.scrollX||(i+="x"),t.autoheight||!1===t.scrollY||(i+="y"),this.st.setAttribute("touch_scroll",i),ue.zs(this.st.childNodes[1].firstChild),ue.xs(this.st.childNodes[1].firstChild,0,0,"0ms"),this.Ms(0,0,"0ms")},$hasYScroll:function(){return 2<this.mM-this.bM},_M:{gM:function(t,i){ue.xs(this.st.childNodes[1].firstChild,-t,-i,"0ms"),this.Ms(-t,-i,"0ms"),this.callEvent("onAfterScroll",[{e:-t,f:-i}])},wM:function(){var t=ue.bs(this.st.childNodes[1].firstChild);return{x:-t.e,y:-t.f}},$init:function(){this.attachEvent("onBeforeScroll",function(){ue.ss=this.st.childNodes[1].firstChild,ue.Ls(ue.ss),ue.ys=this}),this.attachEvent("onTouchEnd",function(){ue.ys=null}),this.attachEvent("onAfterScroll",function(t){t&&(this.xM=-t.e,this.Gy=-t.f,this.Jy&&(this.Jy.B.scrollPos=this.xM),this.yM&&(this.yM.B.scrollPos=this.Gy))})},Ms:function(t,i,e){ue.xs(this.st.childNodes[1].firstChild,t,i,e),this.B.leftSplit&&ue.xs(this.st.childNodes[0].firstChild,0,i,e),this.B.rightSplit&&ue.xs(this.st.childNodes[2].firstChild,0,i,e),this.B.header&&ue.xs(this.k.childNodes[1].firstChild,t,0,e),this.B.footer&&ue.xs(this.gf.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},Fs:function(){}},pM:{gM:function(t,i){C(function(){this.callEvent("onAfterScroll",[{e:-t,f:-i}])},this)},$scroll:{gravity:0,elastic:!1},$init:function(){this.attachEvent("onAfterColumnHide",function(){this.gM(0,0)}),this.attachEvent("onBeforeScroll",function(){var t=ue;t.ss=this.st.childNodes[1].firstChild,t.Ls(t.ss),t.ns.left=this.xM,t.ns.hidden=this.Jy.B.scrollVisible||this.yM.B.scrollVisible,t.ns.dy=this.mM,t.ys=this}),this.attachEvent("onAfterRender",function(){this.Jy&&this.B.scrollX&&this.Jy.Xx(),this.yM&&this.B.scrollY&&this.yM.Xx()}),this.attachEvent("onAfterScroll",function(t){if(t){var i=this.xM!=-t.e,e=this.Gy!=-t.f;ue.ys=null,ue.MM=null,this.Gy=0,this.xM=0;var s=ue.config.translate
;return ue.config.translate="translate",this.Ms(this.Jy?0:t.e,0,0),ue.config.translate=s,this.xM=-t.e,this.Gy=-t.f,this.SM(),this.render(),i&&(this.Jy&&this.Jy.scrollTo(this.xM),this.callEvent("onScrollX",[])),e&&(this.yM&&this.yM.scrollTo(this.Gy),this.callEvent("onScrollY",[])),!1}})},Ms:function(t,i,e){i+=this.Gy,t+=this.xM,ue.xs(this.st.childNodes[1].firstChild,t,i,e),this.B.leftSplit&&ue.xs(this.st.childNodes[0].firstChild,0,i,e),this.B.rightSplit&&ue.xs(this.st.childNodes[2].firstChild,0,i,e),this.B.header&&ue.xs(this.k.childNodes[1].firstChild,t,0,e),this.B.footer&&ue.xs(this.gf.childNodes[1].firstChild,t,0,e),this.callEvent("onSyncScroll",[t,i,e])},Fs:function(t){t.f-=this.Gy,t.e-=this.xM}}},Bh={$init:function(){this.data.attachEvent("onStoreUpdated",k(function(t){t||this.kM()},this)),this.attachEvent("onStructureLoad",this.kM),this.attachEvent("onStructureUpdate",this.CM),this.attachEvent("onColumnResize",function(t,i,e,s){s&&this.CM()}),this.attachEvent("onResize",this.CM)},kM:function(){for(var t=!1,i=this.xf,e=0;e<i.length;e++)i[e].adjust&&("header"==i[e].adjust||this.count())&&(t=this.$M(e,i[e].adjust,!0)||t);t&&(this.Nh(!0),this.CM())},CM:function(){var t=this.B.columns,i=[],e=0;if(t&&!this.B.autowidth)for(var s=0;s<t.length;s++){var n=t[s].fillspace;n&&(e+=1*(i[s]=n)||1)}e&&this.DM(i,e)},DM:function(t,i){var e=this.B.columns;if(e){var s=this.xe-this.IM,n=!1;if(0<s){for(var r=0;r<e.length;r++)t[r]||(s-=e[r].width||this.B.columnWidth);for(var h=0;h<t.length;h++)if(t[h]){var o=Math.min(s,Math.round(s*t[h]/i));n=this.Oh(h,o,!0)||n,s-=e[h].width,i-=t[h]}n&&this.Nh(!0)}}},AM:function(t,i){var e=this.B.columns[t],s=e.minWidth||this.B.minColumnWidth;if("header"!=i){var n=this.data.order.length;e.adjustBatch&&e.adjustBatch<n&&(n=e.adjustBatch);for(var r=this.data.order.slice(0,n),h=0;h<n;h++)r[h]=r[h]?this.TM(this.getItem(r[h]),e,0):"";s=Math.max(s,kt(r,"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.yf[c];var f="webix_table_cell webix_cell "+(a.css||"")+(a.rotate?"webix_measure_rotate":""),l=kt([a.text],f,u);s=Math.max(s,a.rotate?l.height:l.width)}}e.sort&&(s+=10)}return s+=G.isIE?re.layoutPadding.space:0,Math.min(s,e.maxWidth||this.B.maxColumnWidth||1e5)},$M:function(t,i,e){if(0<=t){var s=this.AM(t,i);return this.Oh(t,s,e)}},adjustColumn:function(t,i){this.$M(this.getColumnIndex(t),i)},adjustRowHeight:function(t,i){if(t)this.FM(t);else{for(var e={},s=this.B.columns,n=0;n<s.length;n++)this.FM(s[n].id,e);this.data.each(function(t){t.$height=e[t.id]})}i||this.refresh()},FM:function(t,e){var i,s=this.getColumnConfig(t),n=lt("DIV",{"class":"webix_table_cell webix_measure_size webix_cell"},"");n.style.cssText="width:"+s.width+"px; height:1px; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(n),n.offsetHeight<1&&(i=this.$view.cloneNode(!0),document.body.appendChild(i),i.appendChild(n)),this.data.each(function(t){var i;n.innerHTML=this.TM(t,s,0),i=Math.max(n.scrollHeight,this.B.rowHeight,this.B.minRowHeight||0),i=Math.min(i,this.B.maxRowHeight||1e5),e?e[t.id]=Math.max(i,e[t.id]||0):t.$height=i},this),n=vt(n),i&&vt(i)}},Eh={math_setter:function(t){return t&&this.zM(),t},PM:"$",zM:function(){G.strict||(this.data.attachEvent("onStoreUpdated",k(this.VM,this)),this.data.attachEvent("onStoreLoad",k(this.HM,this)),this.attachEvent("onStructureLoad",this.HM))},VM:function(t,i,e){if(t&&"paint"!=e)if("delete"==e)for(var s=0;s<this.xf.length;s++)this.RM(i,this.xf[s].id);else{"add"==e&&this.BM(i);for(var n=0;n<this.xf.length;n++)this.EM={},this.jM(t,this.xf[n].id);this.EM={}}},jM:function(t,i){var e,s=this.getItem(t);if((e=s[this.PM+i]||s[i])&&0<e.length&&"="===e.toString().substr(0,1)?(s[this.PM+i]=e,s[i]=this.LM(e,t,i)):("undefined"!=typeof s[this.PM+i]&&delete s[this.PM+i],this.RM(s,i)),"undefined"!=typeof s.depends&&"undefined"!=typeof s.depends[i])for(var n in s.depends[i]){var r=s.depends[i][n][0]+"__"+s.depends[i][n][1];"undefined"==typeof this.EM[r]&&(
this.EM[r]=!0,this.jM(s.depends[i][n][0],s.depends[i][n][1]))}},OM:function(t,i){var e=this.getItem(t);"undefined"!=typeof e[this.PM+i]&&(e[i]=e[this.PM+i])},HM:function(){if(this.xf&&this.count()){this.BM();for(var t=0;t<this.xf.length;t++){var i=this.columnId(t);this.data.each(function(t){this.EM={},this.jM(t.id,i)},this)}this.EM={}}},BM:function(t){for(var i=0;i<this.xf.length;i++)if(this.xf[i].math){var e=this.columnId(i),s="="+this.xf[i].math;s=s.replace(/\$c/g,"#$c#"),t?(t[e]=this.NM(s,t.id,e),delete t[this.PM+e],this.RM(t,e)):this.data.each(function(t){t[e]=this.NM(s,t.id,e),delete t[this.PM+e],this.RM(t,e)},this)}},NM:function(t,i,e){return qt(t)({$r:i,$c:e})},WM:function(t,i){var e;if(!this.exists(t))return"#out_of_range";var s=(e=this.getItem(t))[this.PM+i]||e[i]||0;return"="!==(s=s.toString()).substring(0,1)?s:("undefined"==typeof e[this.PM+i]&&(e[this.PM+i]=e[i]),e[i]=this.LM(s,t,i,!0),e[i])},LM:function(t,i,e,s){if(!0===s){if(this.YM(i,e))return"#selfreference"}else this.UM();this.qM(i,e);var n=this.getItem(i);t=t.substring(1);var r=this.GM(t),h=this.XM(t,i);t=r?(t=this.KM(t,h),this.JM(t,r)):this.KM(t,h,!0);var o=this.ZM(t);if(!1!==o)return o;this.QM(i,e),this.RM(n,e);for(var a=0;a<h.length;a++)this.tS([i,e],h[a]);return!1!==(o=this.ZM(t))?o:t?(t=this.iS(t.replace(/\$r/g,n.id)),!1!==(o=this.ZM(t))?o:t):t},GM:function(t){return t.replace(/\[[^)]*?\]/g,"").match(/(\+|-|\*|\/)/g)},XM:function(t,i){var e=t.match(/\[([^\]]+),([^\]]+)\]/g);null===e&&(e=[]);for(var s=0;s<e.length;s++){var n=e[s],r=n;(n=(n=n.substr(1,n.length-2)).split(","))[0]=this.eS(n[0]),n[1]=this.eS(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]=r,e[s]=n}return e},KM:function(t,i,e){var s="(",n=")";e&&(s=n="");for(var r=0;r<i.length;r++){var h=i[r],o=this.WM(h[0],h[1]);isNaN(o)&&(o='"'+o+'"'),t=t.replace(h[2],s+o+n)}return t},JM:function(t,i){for(var e=[],s=0;s<i.length;s++){var n=i[s],r=this.sS(t,n);e.push(r[0]),t=r[1]}e.push(t);for(var h=0;h<e.length;h++){var o=this.eS(e[h]);e[h]=o}for(var a="",u=0;u<e.length-1;u++)a+=e[u]+i[u];return a+=e[e.length-1]},iS:function(t){var i;try{i=window.eval(t)}catch(e){i=""}return i.toString()},sS:function(t,i){var e=t.indexOf(i);return[t.substr(0,e),t.substr(e+1)]},eS:function(t){return t=(t=t.replace(/^ */g,"")).replace(/ *$/g,"")},UM:function(){this.nS=[]},qM:function(t,i){this.nS[t+"__"+i]=!0},QM:function(t,i){"undefined"!=typeof this.nS[t+"__"+i]&&delete this.nS[t+"__"+i]},YM:function(t,i){return"undefined"!=typeof this.nS[t+"__"+i]},tS: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},RM: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]}},ZM:function(t){var i=t.match(/#\w+/);return null!==i&&0<i.length&&i[0]}},jh={Uo:function(t){return this.getColumnConfig(t.column).editor},getEditor:function(t,i){return t?(1==arguments.length&&(i=t.column,t=t.row),(this.Vo[t]||{})[i]):this.Li},sa:function(t){for(var i in this.Vo){var e=this.Vo[i];for(var s in e)"$count"!=s&&t.call(this,e[s])}},qo:function(t,i,e){var s=t.row,n=t.column,r=i.config=this.getColumnConfig(n);!1!==e&&this.showCell(s,n);var h=i.render();i.$inline&&(h=this.Eo(t)),i.node=h;var o,a=this.getItem(s),u=r.editFormat;return this.B.editMath&&(o=a["$"+n]),z(o=o||a[n])&&(o=""),i.setValue(u?u(o):o,a),i.value=a[n],this.Jo(t,i),i.$inline||(i.rS=this.Zo(t,h,!0)),i.afterRender&&i.afterRender(),this.B.liveValidation&&(Zt(i.node,"keyup",this.hS(t,this)),this.validateEditor(t)),h},hS:function(t,i){return function(){i.validateEditor(t)}},na:function(t){var i=this.getColumnConfig(t.column).editParse,e=t.getValue();return i?i(e):e},Wo:function(t,i,e){
var s=e?{}:this.getItem(t.row);return s[t.column]=i,this.B.editMath&&(s["$"+t.column]=null),s},Jo:function(t,i){var e=this.Vo[t.row]=this.Vo[t.row]||{};e.$count=(e.$count||0)+1,i.row=t.row,i.column=t.column,this.Li=e[t.column]=i,this.Fi++,this.oS=this.getScrollState()},ta:function(t){this.Li==t&&(this.Li=0),t.destroy&&t.destroy();var i=this.Vo[t.row];delete i[t.column],i.$count--,i.$count||delete this.Vo[t.row],this.Fi--},jo:function(t,i){var e=this.Vo[t];if(e)for(var s in this.Vo[i]=e,delete this.Vo[t],e)"$count"!=s&&(e[s].row=i)},Qo:function(t){var i,e,s,n,r,h=this.getColumnConfig(t.column),o=0;if(h&&h.node&&h.attached){if(s=this.getIndexById(t.row),this.Mf&&this.getSpan(t.row,t.column))for(e=0;e<3;e++)for(i=this.aS[e],n=0;!o&&n<i.childNodes.length;n++)(r=i.childNodes[n]).getAttribute("row")==s&&r.getAttribute("column")==this.getColumnIndex(t.column)&&(o=r);!o&&s>=h.uS-this.B.topSplit&&s<h.cS&&(o=h.node.childNodes[s-h.uS+this.B.topSplit])}return o},editCell:function(t,i,e,s){return i=i||this.B.columns[0].id,Le.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.Wr||e);for(var s=0;s<e.length;s++)t.call(this,e[s])},eachColumn:function(t,i){var e=this.Vh;if(i&&e.length)for(var s=0;s<e.length;s++){var n=this.getColumnConfig(e[s]);t.call(this,n.id,n)}else for(var r=[].concat(this.xf),h=0;h<r.length;h++){var o=r[h];t.call(this,o.id,o)}},ha:function(t){if(this.getSelectedId&&1==this.getSelectedId(!0).length)return this.Xh(t),!1},Ti:function(t,i){if(this.B.editable&&!this.Fi){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.B.select&&(s.column=this.B.columns[i.shiftKey?0:this.B.columns.length-1].id),this.editNext(t,s),!1}}return!0},ra:function(t,i,e){var s=this.getIndexById(t.row),n=this.getColumnIndex(t.column),r=this.data.order,h=this.xf;if(e)for(var o=s;o<r.length;o++){for(var a=n+1;a<h.length;a++){var u={row:r[o],column:h[a].id};if(i.call(this,u)&&(!this.fS||!this.fS(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:r[c],column:h[f].id};if(i.call(this,l))return l}n=h.length}return null},lS:function(){this.Fi&&(this.dS?this.dS=!1:(this.yM.scrollTo(this.getScrollState().y+this.st.childNodes[1].firstChild.scrollTop),this.st.childNodes[1].firstChild.scrollTop=0,this.dS=!0))},vS:function(){this.Fi&&this.Jy.scrollTo(this.st.childNodes[1].scrollLeft)},Oo:function(){this.attachEvent("onScrollY",this._S),this.attachEvent("onScrollX",this._S),this.attachEvent("onScrollY",this.Ho),this.attachEvent("onColumnResize",function(){this.editStop()}),this.attachEvent("onAfterFilter",function(){this.editStop()}),this.attachEvent("onRowResize",function(){this.editStop()}),this.attachEvent("onAfterScroll",function(){this.B.topSplit&&this.editStop()}),this.st.childNodes[1].firstChild.onscroll=k(this.lS,this),this.st.childNodes[1].onscroll=k(this.vS,this)},_S:function(){if(this.Fi){var t=this.oS;this.oS=this.getScrollState();var h=this.oS.y-t.y;this.sa(function(t){if(t.getPopup){var i=this.getItemNode(t),e=!1;if(this.B.prerender){var s=t.rS,n=s.top-this.Gy,r=s.left-this.xM;e=n<0||n+s.height>this.bM||r<0||r+s.width>this.$width-this.pS}!i||e?t.getPopup().show({x:-1e4,y:-1e4}):t.getPopup().show(i)}this.B.prerender||t.linkInput||t.$inline||(t.node.top-=h,t.node.style.top=t.node.top+"px")})}}},Lh={$init:function(){this.mS(),this.attachEvent("onStructureLoad",this.bS)},mS:function(){this.jh={},this.Vh=T(),this.Lh=[0,0,0]},bS:function(){for(var t=this.xf,i=0;i<t.length;i++)t[i].header&&this.gS(t,t[i].header),t[i].footer&&this.gS(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)},gS: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||-1==e)return!1;var s,n=this.Vh,r=this.B.columns,h=r.splice(e,1)[0];n.length&&(s=n.find(t),n.removeAt(s)),this.wS(e,s,-1);var o,a=i-(e<i?1:0);if(x.insertAt.call(r,h,a),n.length){var u=r[a-1];o=u&&u.id?n.find(u.id)+1:0,n.insertAt(h.id,o)}this.wS(a,o,1),this.xS()},yS:function(t,i){if(!t.length){for(var e=0;e<i.length;e++)t[e]=i[e].id;this.Lh=[this.B.leftSplit,this.oM,this.B.rightSplit]}},isColumnVisible:function(t){return!this.jh[t]},hideColumn:function(t,i,e,s){var n,r=this.B.columns,h=this.Vh,o=this.jh,a=1;if(i=i||{},!1!==s){var u=this.getColumnIndex(t);if(-1==u||!this.callEvent("onBeforeColumnHide",[t]))return;if(this.yS(h,r),i.spans)for(var c=r[u].header,f=0;f<c.length;f++)c[f]&&(a=Math.max(a,c[f].colspan||1));this.MS(u,a,-1);for(var l=u+a-1;u<=l;l--)this.SS(u),(o[(n=r.splice(u,1)[0]).id]=n).uS=-1,n.hidden=!0,delete this.kS[n.id];this.callEvent("onAfterColumnHide",[t])}else{if(!(n=o[t])||!this.callEvent("onBeforeColumnShow",[t]))return;for(var d=null,v=0,_=0;_<h.length;_++){if(h[_]==t){v=_;break}o[h[_]]||(d=h[_])}if(i.spans)for(var p=n.header,m=0;m<p.length;m++)p[m]&&(p[m].colspan=p[m].$colspan||p[m].colspan,a=Math.max(a,p[m].colspan||1));for(var b=d?this.getColumnIndex(d)+1:0,g=v+a-1;v<=g;g--){var w=o[h[g]];w?(x.insertAt.call(r,w,b),delete w.hidden,delete o[w.id],this.kS[w.id]=w):a--}this.MS(v,a,1,!0),this.callEvent("onAfterColumnShow",[t])}n.header&&this.CS(n,!1!==s?0:1,"header"),n.footer&&this.CS(n,!1!==s?0:1,"footer"),h.length===r.length&&this.mS(),e||this.xS()},showColumn:function(t,i,e){return this.hideColumn(t,i,e,!1)},MS:function(t,i,e,s){var n=a(s?this.Lh:[this.B.leftSplit,this.oM],2),r=n[0],h=n[1];t<r&&(this.B.leftSplit+=e*i),h<=t?this.B.rightSplit+=e*i:this.oM+=e*i},wS:function(t,i,e){0<=t&&(t<this.B.leftSplit&&(this.B.leftSplit+=e),this.B.rightSplit&&t>=this.oM?this.B.rightSplit+=e:this.oM+=e),this.Vh.length&&0<=i&&(i<this.Lh[0]&&(this.Lh[0]+=e),this.Lh[2]&&i>=this.Lh[1]?this.Lh[2]+=e:this.Lh[1]+=e)},CS:function(t,i,e){for(var s=t[e].length-1;0<=s;s--)for(var n,r=this.Vh,h=!1,o=0,a=0;a<r.length;a++){var u=this.getColumnConfig(r[a]),c=u[e][s];this.isColumnVisible(r[a])?(h&&0<o&&n&&0<n.colspan?n=c=u[e][s]=n:c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,n=c),h=null):(c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,h=n=c),n&&0<o&&n.colspan--),o--}},refreshColumns:function(t){this.$S=!0,t&&(this.mS(),this.Bh={}),this.kS={};for(var i=0;i<this.xf.length;i++){var e=this.xf[i];(this.kS[e.id]=e).attached=e.node=null}for(var s=0;s<3;s++)this.k.childNodes[s].innerHTML="",this.st.childNodes[s].firstChild.innerHTML="";this.xf=this.config.columns=t||this.config.columns,this.oM=this.xf.length-(this.config.rightSplit||0),this.Eh=0,this.DS(),this.IS(),this.callEvent("onStructureUpdate"),this.render(),this.$S=!1},xS:function(){this.Eh=0,this.callEvent("onStructureUpdate"),this.AS(),this.render()},showColumnBatch:function(r,h,t){var o=void 0!==h;h=!1!==h;var a=[];this.eachColumn(function(t,i){if(i.batch){var e=this.jh[i.id];h||(e=!e),i.batch==r&&e?this.hideColumn(i.id,{spans:!0},!0,!h):o||i.batch==r||e||this.hideColumn(i.id,{spans:!0},!0,h)}if(o&&h)for(var s=i.header,n=0;n<s.length;n++)s[n]&&s[n].batch&&s[n].closed&&a.push(s[n].batch)},!0);for(var i=0;i<a.length;i++)a[i]!=r&&this.showColumnBatch(a[i],!1,!0);t||this.xS()}},Oh={$init:function(t){this.attachEvent("onAfterScroll",this.Ha),this.attachEvent("onFocus",function(){Mt(this.$view,"webix_dtable_focused")}),this.attachEvent("onBlur",function(){St(this.$view,"webix_dtable_focused")}),"column"!=t.select&&(this.open||this.TS)&&this.attachEvent("onEnter",function(){var t=this.getSelectedId(!0);if(!(1!=t.length||this.getEditor&&this.getEditor())){var i=this.getItemNode(t[0]);t=t[0].row,("row"==this.config.select||i.querySelector(".webix_tree_open")||i.querySelector(".webix_tree_close"))&&(this.isBranchOpen(t)?this.close(t):this.open(t))}})},Ha:function(){if(!this.FS()){var t=this.tt.querySelector(".webix_cell");t&&t.setAttribute(
"tabindex","0")}},FS:function(){for(var t=this.getSelectedId(!0),i=0;i<t.length;i++)if(t[i].column&&this.isColumnVisible(t[i].column))return this.getItemNode(t[i]);return null},moveSelection:function(t,i,e){if(this.zS(),!this.B.disabled){i=i||{};var s=this.getSelectedId(!0),n=s.length-1,r=!(!this.B.multiselect&&!this.B.areaselect)&&i.shift;if(1<s.length&&"cell"!==this.B.select&&(s=s.sort(k(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 h=s[n].row,o=s[n].column;if("top"==t||"bottom"==t)h&&("top"==t?h=this.data.getFirstId():"bottom"==t&&(h=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(h){var a=this.getIndexById(h),u=1;"pgup"!=t&&"pgdown"!=t||(u=this.Au?this.Au.config.size:Math.round(this.bM/this.B.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),!(h=this.getIdByIndex(a))&&this.B.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.TS)&&"right"==t)return this.open?this.open(h):this.openSub(h);if((this.close||this.TS)&&"left"==t)return this.close?this.close(h):this.closeSub(h)}}if(h){this.showCell(h,o),this.select||(F.extend(this,this.oy.hy,!0),this.B.select=this.open||this.TS?"row":"cell",F.extend(this,this.oy[this.B.select],!0));var f={row:h,column:o};if(r&&"area"==this.B.select){var l=this._y[this._y.length-1];this.Ay(f,l,t,i)}else this.Xh(f,r);if(!this.B.clipboard&&!1!==e){var d=this.getItemNode(f);d&&d.focus()}}}return!1}}},Nh={uo:function(t){for(var i=0;i<this.xf.length;i++){var e=this.xf[i],s=this.getItemNode({row:t,cind:i});s?s.parentNode.insertBefore(le._n[i],s):e.node.appendChild(le._n[i])}},"do":function(){var t=[],i=this.xf.length,e=document.createElement("div");e.className="webix_drop_area",e.style.height=this.B.rowHeight+"px",e.innerHTML=this.$dropHTML();for(var s=0;s<i;s++)t.push(e.cloneNode(!0));return t}},Wh={drag_setter:function(t){return this.attachEvent("onBeforeDrag",function(t){return this.PS(t.source)}),this.attachEvent("onBeforeDragIn",function(t){var i=this.PS(t.target);return!i&&le._n&&(vt(le._n),this._o=le._n=null),i}),Pe.drag_setter.call(this,t),"order"!=t&&"move"!=t||F.extend(this,Nh,!0),t},ao:function(t,i,e){var s=le.Ks;this.B.prerender||e||(t=[s.start]);for(var n=0;n<t.length;n++){for(var r=0;r<this.xf.length;r++){var h=this.getItemNode({row:t[n],cind:r});h&&Mt(h,i)}this.data.addMark(t[n],i,1,1,!0)}},oo:function(t,i,e){var s=le.Ks;this.B.prerender||e||(t=[s.start]);for(var n=0;n<t.length;n++){for(var r=0;r<this.xf.length;r++){var h=this.getItemNode({row:t[n],cind:r});h&&St(h,i)}this.data.removeMark(t[n],i,1,!0)}},PS:function(t){var i,e,s=!1;if(this.B.topSplit&&t)for(I(t)||(t=[t]),i=0;!s&&i<t.length;i++)s=0<=(e=this.getIndexById(t[i]))&&e<this.B.topSplit;return!s},Q:function(t){for(var i="<div class='webix_dd_drag' style='width:"+(this.xe-this.IM)+"px;'>",e=this.B.columns,s=0;s<e.length;s++){var n=this.TM(t,e[s]);i+="<div style='width:"+e[s].width+"px;'>"+n+"</div>"}return i+"</div>"},getHeaderNode:function(t,i){return this.VS(t,i,this.k)},getFooterNode:function(t,i){return this.VS(t,i,this.gf)},VS:function(t,i,e){if(this.isColumnVisible(t)){var s=this.getColumnIndex(t),n=this.B.leftSplit>s?0:this.oM<=s?2:1;i=i||0;return e.childNodes[n].querySelector("div[".concat("column",'="').concat(s,'"][').concat("row",'="').concat(i,'"]'))}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.HS(),n=s[0]-this.B.topSplit;if(e<n&&e>s[1])return
;var r=this.RS(),h=this.B.leftSplit?0:r[0],o="number"==typeof t.cind;if((t.column||o)&&(h=o?t.cind:this.getColumnIndex(t.column))<this.oM&&h>=this.B.leftSplit&&(h<r[0]||h>r[1]))return;var a=this.B.columns[h];if(a&&a.attached&&a.node){if("$webix-drop"===i)return le._n[h];for(var u=e<this.B.topSplit||this.B.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]}}},BS:function(t){var i=t.target.nodeName;return"INPUT"!=i&&"TEXTAREA"!=i},dragColumn_setter:function(t){var h;return"order"==t?h={$drag:k(function(t,i){if(!this.BS(i)||this.vd)return!1;var e=this.locate(i);if(!e||!this.callEvent("onBeforeColumnDrag",[e.column,i]))return!1;le.Ks={from:h,start:e,custom:"column_dnd"};var s=this.getColumnConfig(e.column);return this.ES=bt(i),this.jS=s.width,this.Jh=!0,"<div class='webix_dd_drag_column' style='width:"+s.width+"px'>"+(s.header[0].text||" ")+"</div>"},this),$dragPos:k(function(t,i,e){var s=this,n=le.getContext(),r=mt(this.$view);e.style.display="none";var h=document.elementFromPoint(t.x,r.y+this.B.headerRowHeight/2),o=h?this.locate(h):null,a=le.getContext().start.column;if(o&&o.column!=a&&(!this.LS||o.column!=this.OS)&&"column_dnd"==n.custom&&ai(h)==this){if(!this.callEvent("onBeforeColumnDropOrder",[a,o.column,i]))return;var u=this.getColumnIndex(a),c=this.getColumnIndex(o.column);i.touches&&(this.NS=i.target,this.NS.style.display="none",this.$view.parentNode.appendChild(this.NS)),this.moveColumn(a,c+(u<c?1:0)),this.OS=o.column,this.LS=!0}if(o&&o.column==a&&(this.LS=!1),e.style.display="block",t.x=t.x-this.ES.x,t.y=r.y,t.x<r.x)t.x=r.x;else{var f=r.x+this.$view.offsetWidth-this.IM-this.jS;t.x>f&&(t.x=f)}le.an=!0,this.ht&&(this.ht=window.clearTimeout(this.ht)),!1!==this.B.dragscroll&&(this.ht=C(function(t){return s.ot(t)},this,[gt(i)],250))},this),$dragDestroy:k(function(t,i){this.Jh=null,this.ht&&(this.ht=window.clearTimeout(this.ht)),vt(i),this.NS&&vt(this.NS);var e=le.getContext().start;this.callEvent("onAfterColumnDropOrder",[e.column,this.OS,t])},this),$drop:function(){}}:t&&(h={Zh:!0,$drag:k(function(t,i){if(!this.BS(i)||this.vd)return!1;var e=this.locate(i);if(!e||!this.callEvent("onBeforeColumnDrag",[e.column,i]))return!1;le.Ks={from:h,start:e,custom:"column_dnd"};for(var s=this.getColumnConfig(e.column).header,n=" ",r=0;r<s.length;r++)if(s[r]){n=s[r].text;break}return this.Jh=!0,"<div class='webix_dd_drag_column'>"+n+"</div>"},this),$drop:k(function(t,i,e){var s=e;e.touches&&this.WS&&(s=this.WS);var n=this.locate(s);if(!n)return!1;var r=le.getContext().start.column;if(r!=n.column){if(!this.callEvent("onBeforeColumnDrop",[r,n.column,e]))return;var h=this.getColumnIndex(r),o=this.getColumnIndex(n.column);this.moveColumn(r,o+(h<o?1:0)),this.callEvent("onAfterColumnDrop",[r,n.column,e])}},this),$dragIn:k(function(t,i,e){var s=this,n=le.getContext();if("column_dnd"!=n.custom||n.from!=h)return!1;for(var r=e.target;-1==(r.className||"").indexOf("webix_hcell");)if(!(r=r.parentNode))return;return this.ht&&(this.ht=window.clearTimeout(this.ht)),!1!==this.B.dragscroll&&(this.ht=C(function(t){return s.ot(t)},this,[gt(e)],250)),r!=this.WS&&(this.WS&&St(this.WS,"webix_dd_over_column"),Mt(r,"webix_dd_over_column")),this.WS=r},this),$dragDestroy:k(function(t,i){this.Jh=null,this.ht&&(this.ht=window.clearTimeout(this.ht)),this.WS&&St(this.WS,"webix_dd_over_column"),vt(i)},this)}),t&&(le.addDrag(this.k,h),le.addDrop(this.k,h,!0),this.attachEvent("onDestruct",function(){return le.unlink(h)}),this.et||F.extend(this,Xt,!0)),t}},Yh={ar:function(t,i){if(t.scroll&&!i)return!0;t.header=z(t.header)?!!this.config.header:t.header,t.footer=z(t.footer)?!!this.config.footer:t.footer,t.xCorrection=t.xCorrection||0},n_:function(t,i){for(var e=-1,s=0;e<0&&s<t.length;s++)i(t[s])&&(e=s);return e},YS:function(e,c,f){var l={},d=0;return e.forEach(k(function(t,o){var i=t[0],a=[],u=i.length;i.forEach(k(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=S(n||{text:""}),l[o]&&l[o][s]&&0===i&&(n.colspan=l[o][s],l[o][s]=0),n.colspan){
var r=Math.min(n.colspan,u-i);l[o+1]=l[o+1]||{},l[o+1][s]=n.colspan-r,n.colspan=r}n.rowspan&&1===u&&(n.height=(n.height||this.config.headerRowHeight)*n.rowspan,n.rowspan=null);var h={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]=h}}},this)),e[o]="header"==f?a.concat(t):t.concat(a),d+=u},this)),e},ur:function(v,t,_){var p=this.config.columns,m=this.getSelectedId(!0),b="page"==v.fit?Infinity:this.fr(v),g=0,w=0,x=[],y=0,M=[];return _=_||0+v.xCorrection,t=t||[],this.eachRow(k(function(i){for(var t=0,e=this.getItem(i),s=this.getIndexById(i),n=[],r=!1,h=_;h<p.length;h++){var o=p[h].id,a=this.getColumnIndex(o)-_;if(p[h]){if(t+=p[h].width,0===s&&M.push(p[h].width),b<t&&_<h){y=h;break}if("selection"!==v.data||"selection"==v.data&&-1!==this.n_(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.kS[o]?this.getText(i,o):"",l=this.getCss(i,o)+" "+(p[h].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[h].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||0===f)&&(g=Math.max(a+1,g),w=Math.max(s+1,w)),r=r||!!f}else u&&(n.push({$inspan:!0}),g=Math.max(a+1,g),w=Math.max(s+1,w))}}}v.skiprows&&!r||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.ur(v,t,y):(v.footer&&(t=this.YS(t,p,"footer")),v.header&&(t=this.YS(t,p,"header")),"page"==v.fit&&this.US(t,M,g,v)),t},US:function(t,i,e,s){e&&s.trim&&(i.length=e);for(var n=0,r=0;r<i.length;r++)n+=i[r];n>this.fr(s)&&t[0].forEach(function(t){for(var i=0;i<t.length;i++)t[i]&&t[i].style&&t[i].style.width&&(t[i].style.width="auto")})},cr:function(n,r){var h=lt("div");return n.forEach(k(function(t,i){var e=lt("table",{"class":"webix_table_print "+this.$view.className+(r.borderless?" borderless":""),style:"border-collapse:collapse",id:this.$view.getAttribute("id")});if(t.forEach(function(t){var s=lt("tr");t.forEach(function(t){if(!t.$inspan){var i=lt("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)}),h.appendChild(e),i+1<n.length){var s=lt("DIV",{"class":"webix_print_pagebreak"});h.appendChild(s)}},this)),h}},Uh={$exportView:function(t){this.isBranchOpen&&F.extend(t,{filterHTML:!0});var i=t.export_mode;if("pdf"!=i&&"excel"!=i||t.dataOnly||!t.styles)return this;t.dataOnly=!0,t.heights=z(t.heights)?"all":t.heights;var e="pdf"==i?Ws(this,t):Zs(this,t);return e[0].styles=this.qS(t),delete t.dataOnly,e},qS:function(t){var u=t.export_mode,c=this.config.columns,f=[];return this.GS||(this.GS={}),this.GS[u]||(this.GS[u]={}),t.docHeader&&"excel"==u&&(f=[{0:this.XS(t.docHeader.css)},{0:{}}]),!1!==t.header&&(f=this.KS(t,"header",f,u)),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,r="",h=null,o=null;if(this.Mf&&(h=this.getSpan(t.id,c[e].id))?(o=this.getSpanNode({row:h[0],column:h[1]}),r="webix_dtable_span "+(h[5]||"")):o=this.getItemNode({row:t.id,column:c[e].id}),!o){o=lt("div",{"class":s,style:"visibility:hidden"});var a=c[e].node;c[e].attached||(a=lt("div",{"class":n,style:"visibility:hidden"}),this.st.appendChild(a)),a.appendChild(o)}i[e]=this.JS(o,[s,n,r].join(":"),u)}f[f.length]=i},this),
!1!==t.footer&&this.config.footer&&(f=this.KS(t,"footer",f,u)),t.docFooter&&"excel"==u&&(f=f.concat([{0:{}},{0:this.XS(t.docFooter.css)}])),f},KS:function(t,i,e,s){for(var n=this.config.columns,r=[],h=0;h<n[0][i].length;h++){for(var o={},a=0;a<n.length;a++){var u=n[a][i][h];if(u){var c=u.colspan?n[a+u.colspan-1].id:n[a].id,f="header"==i?this.getHeaderNode(c,h):this.getFooterNode(c,h);if(f){var l=[f.className,u.css||"",i];o[a]=this.JS(f,l.join(":"),s),(u.colspan||u.rowspan)&&r.push([h,a,{colspan:u.colspan-1||0,rowspan:u.rowspan-1||0},o[a]])}}else for(var d=0;d<r.length;d++){var v=r[d][2],_=r[d][1],p=r[d][0];_+v.colspan>=a&&p+v.rowspan>=h&&(o[a]=r[d][3])}}e[e.length]=o}return e},ZS:function(t,i,e){return"0px"==t["border-".concat(e,"-width")]?null:rs.rgbToHex(t["border-".concat(e,"-color")])||i},JS:function(t,i,e){if(this.GS[e][i])return this.GS[e][i];var s=this.QS(t),n=rs.rgbToHex(s["background-color"])||"FFFFFF",r={backgroundColor:n,fontSize:.75*s["font-size"].replace("px",""),color:rs.rgbToHex(s.color),textAlign:s["text-align"],borderRightColor:this.ZS(s,n,"right"),borderLeftColor:this.ZS(s,n,"left"),borderBottomColor:this.ZS(s,n,"bottom"),borderTopColor:this.ZS(s,n,"top")},h="pdf"==e?r:this.tk(s,t,r);return this.GS[e][i]=h},XS:function(t){t=F.extend(t||{},{visibility:"hidden","white-space":"nowrap","text-align":"left"});var i="";for(var e in t)i+=e+":"+t[e]+";";var s=lt("div",{style:i});this.st.appendChild(s);var n=this.JS(s,i);return vt(s),n},tk:function(t,i,e){var s={font:{},alignment:{},border:{}};return s.font.name=t["font-family"].replace(/,.*$/,""),s.font.sz=e.fontSize,s.font.color={rgb:e.color},"normal"!==t["font-weight"]&&400!=t["font-weight"]&&(s.font.bold=!0),"underline"===t["text-decoration-line"]&&(s.font.underline=!0),"italic"===t["font-style"]&&(s.font.italic=!0),"line-through"===t["text-decoration-line"]&&(s.font.strike=!0),s.alignment.horizontal=e.textAlign,s.alignment.vertical=t.height==t["line-height"]?"center":"top","normal"==t["white-space"]&&(s.alignment.wrapText=!0),i.firstChild&&i.firstChild.className&&-1!==i.firstChild.className.indexOf("webix_rotate")&&(s.alignment.textRotation=90),s.fill={fgColor:{rgb:e.backgroundColor}},e.borderRightColor&&(s.border.right={style:"thin",color:{rgb:e.borderRightColor}}),e.borderBottomColor&&(s.border.bottom={style:"thin",color:{rgb:e.borderBottomColor}}),e.borderLeftColor&&(s.border.left={style:"thin",color:{rgb:e.borderLeftColor}}),e.borderTopColor&&(s.border.top={style:"thin",color:{rgb:e.borderTopColor}}),s},QS:function(t){return window.getComputedStyle?window.getComputedStyle(t):t.currentStyle}},qh={name:"datatable",defaults:{leftSplit:0,rightSplit:0,topSplit:0,columnWidth:100,sort:!0,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=re.rowHeight,this.defaults.minRowHeight=re.rowHeight-6,this.defaults.headerRowHeight=re.barHeight-2*re.borderWidth,this.defaults.minColumnWidth=2*re.dataPadding+re.borderWidth},on_click:{webix_excel_filter:function(){return!1},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,r=("checkbox"==n.type?n.checked:e[i.column]!=s.checkValue)?s.checkValue:s.uncheckValue,h={};return h[i.column]=r,this.updateItem(i.row,h,this.B.checkboxRefresh?"update":"save"),this.callEvent("onCheck",[i.row,i.column,r]),!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=F.extend({},this.on_click)
;this.Ui.innerHTML="<div class='webix_ss_header' section='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' section='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.ik=this.Ui.id=this.name+$(),this.Ui.className+=" webix_dtable",this.tt=this.Ui,this.k=this.Ui.firstChild,this.st=this.k.nextSibling,this.gf=this.st.nextSibling.nextSibling,this.zt.setAttribute("role","grid"),t.editable||this.zt.setAttribute("aria-readonly","true"),this.data.provideApi(this,!0),this.data.attachEvent("onParse",k(this.ek,this)),this.$ready.push(this.sk),this.xf=[],this.yf=[],this.Sf=[],this.nk=[],this.Uh={},this.Bh={},this.rk={},this.hk=[],this.po=this.ak=0,this.Vt=[],this.data.attachEvent("onServerConfig",k(this.uk,this)),this.data.attachEvent("onServerOptions",k(this.ck,this)),this.attachEvent("onViewShow",function(){this.fk(),this.lk()}),this.data.attachEvent("onClearAll",k(function(t){t||(this.xM=this.Gy=0,this.Jy&&this.Jy.reset(),this.yM&&this.yM.reset(),this.dk(0))},this)),this.attachEvent("onDestruct",this.vk),this.attachEvent("onKeyPress",this.De),this.attachEvent("onScrollY",this._k),w("onDataTable",[this,t])},pk:function(){this.pS=this.IM=G.scrollSize;var t=this.B.headerRowHeight+1;ct("#"+this.ik+" .webix_cell { height:"+this.B.rowHeight+"px; line-height:"+(this.B.rowLineHeight||this.B.rowHeight)+"px;"+(this.B.fixedRowHeight?"":"white-space:normal;")+" }"),ct("#"+this.ik+" .webix_hcell { height:"+t+"px; line-height:"+t+"px;}"),this.pk=function(){}},sk:function(){this.data.attachEvent("onStoreLoad",k(this.lk,this)),this.data.attachEvent("onSyncApply",k(this.lk,this)),this.data.attachEvent("onStoreUpdated",k(function(){return this.render.apply(this,arguments)},this)),this.data.attachEvent("onStoreUpdated",k(this.mk,this)),this.render()},refresh:function(){this.render()},zS:function(){var t=this;clearTimeout(this.bk),this.bk=C(function(){t.bk=0,z(t.gk)||(t.dk(t.gk),delete t.gk),t.render()})},render:function(t,i,e){if("save"!=e&&!this.bk){if(!this.xf.length){var s=this.B.columns;if(!s||!s.length){if(!this.B.autoConfig||!this.data.order.length||this.Vh.length)return;this.Eh=0,this.wk()}this.DS()}if(!this.isVisible(this.B.id)||this.$blockRender)return this.pk();var n=this.config.experimental&&!this.B.subview;return!t||-1==i||"paint"!=e&&"update"!=e||n?(this.xk&&(clearTimeout(this.xk),this.xk=0),this.callEvent("onBeforeRender",[this.data])?(this.pk(),this.Eh||this.AS(),this.xe&&(n&&("paint"==e||"update"==e)&&t?this.yk(t):this.Mk(!0,!0)),t&&"update"==e||(this.mM=this.Sk(),this.kk()),this.zt.setAttribute("aria-colcount",Math.max(this.Vh.length,this.xf.length)),this.zt.setAttribute("aria-rowcount",this.data.count()),this.callEvent("onAfterRender",[this.data]),!0):void 0):(this.xk&&clearTimeout(this.xk),void(this.xk&&this.Ck!=t?(this.Ck=null,this.xk=C(function(){this.render()},this)):(this.Ck=t,this.xk=C(function(){this.render(t,-1,e)},this))))}},getColumns:function(t){var i=this.Vh;if(t&&i.length){for(var e=[],s=0;s<i.length;s++)e.push(this.getColumnConfig(i[s]));return e}return o(this.xf)},getColumnConfig:function(t){return this.kS[t]||this.jh[t]},ck:function(t){for(var i in t){var e=this.getColumnConfig(i),s=new vr({data:t[i]});this.Vt.push(s),this.Ja(s,e)}},uk:function(t){this.Wa(),t.columns&&this.Eh&&this.refreshColumns(t.columns)},DS:function(){if(this.B.columns){this.kS={},this.xf=this.B.columns,this.oM=this.xf.length-(this.config.rightSplit||0);for(
var t=0;t<this.xf.length;t++)this.$k(this.xf[t]);this.Dk("header",this.yf),this.Dk("footer",this.Sf),this.callEvent("onStructureLoad",[])}},$k:function(t){z((this.kS[t.id]=t).header)&&(t.header=t.id);var i=t.cssFormat;if(i&&(t.cssFormat=v(i,this.$scope)),t.width=this.Ik(t.width||this.B.columnWidth,t),"string"==typeof t.format&&(t.format=P[t.format]||window[t.format]),t.numberFormat){var e=t.numberFormat;"string"==typeof e&&(t.numberFormat=e=hn.getConfig(e)),t.format=hn.numToStr(e),t.editFormat=t.editFormat||function(t){return hn.format(t,e)},t.editParse=t.editParse||function(t){return hn.parse(t,e)}}z(t.checkValue)&&(t.checkValue=1),z(t.uncheckValue)&&(t.uncheckValue=0),t.css&&"object"==M(t.css)&&(t.css=ut(t.css));var s=t.template;s&&("string"==typeof s&&(s=s.replace(/#\$value#/g,"#"+t.id+"#")),t.template=qt(s))},Ak:function(){this.AS()},vk:function(){for(var t=0;t<this.xf.length;t++)delete this.xf[t].attached,delete this.xf[t].node},AS:function(){this.oM=this.xf.length-(this.config.rightSplit||0);for(var t=this.Tk=0;t<this.xf.length;t++){if(!this.xf[t].node){var i=lt("DIV");i.style.width=this.xf[t].width+"px",this.xf[t].node=i}t>=this.B.leftSplit&&t<this.oM&&(this.Tk+=this.xf[t].width)}var e=[];if(this.B.rightSplit){var s=this.xf.length-this.B.rightSplit;e[s]=" webix_first",e[s-1]=" webix_last"}if(this.B.leftSplit){var n=this.B.leftSplit;e[n]=" webix_first",e[n-1]=" webix_last"}e[0]=(e[0]||"")+" webix_first webix_select_mark";var r=this.xf.length-1;e[r]=(e[r]||"")+" webix_last";for(var h=0;h<this.xf.length;h++){var o=this.xf[h].node;o.setAttribute("column",h),o.className="webix_column "+(this.xf[h].css||"")+(e[h]||"")}this.Fk(),this.zk(),this.Pk(),this.Iy(),this.Eh=!0},zk:function(){for(var t=0,i=0;i<this.xf.length;i++){var e=this.xf[i];i!=this.B.leftSplit&&i!=this.oM||(t=0),e.node&&(e.node.style.left=t+"px",(this.B.leftSplit||this.B.rightSplit)&&(vt(e.node),e.attached=!1)),t+=e.width}},Iy:function(){this.Vk||(this.Vk=0),this.po=this.ak=0,this.B.header&&(this.Hk(this.k,0,1),this.Dk("header",this.yf),this.po=this.yf.Rk,this.Bk(this.k,"header",this.yf)),this.B.footer&&(this.Hk(this.gf,0,1),this.Dk("footer",this.Sf),this.ak=this.Sf.Rk,this.Bk(this.gf,"footer",this.Sf)),this.refreshHeaderContent(!1,!1),this.Ek();for(var t=0;t<this.hk.length;t++){var i=this.hk[t];this.jk(i,this.rk[i])}},Lk:function(t,i,e){var s=0,n=t.colspan||1,r="webix_hcell "+(t.css||"");if(t.rotate)r+=" webix_measure_rotate";else for(var h=0;h<n;h++)s+=this.xf[e+h]?this.xf[e+h].width:this.config.columnWidth;var o=kt([t.text],r,s);return(t.rotate?o.width:o.height)+1},Dk:function(t,i){for(var e=0,s=i.length=0;s<this.xf.length;s++){var n=this.xf[s][t]||"";I(n)||(n=[n]);for(var r=0;r<n.length;r++)"object"!=M(n[r])&&(n[r]={text:n[r]}),n[r]&&n[r].height&&(i[r]=Math.max(i[r]||0,n[r].height)),n[r]&&n[r].autoheight&&(i[r]=Math.max(i[r]||0,this.Lk(n[r],this.xf[s],s))),n[r]&&n[r].css&&"object"===M(n[r].css)&&(n[r].css=ut(n[r].css));e=Math.max(e,n.length),this.xf[s][t]=n}for(var h=(i.Rk=e)-1;0<=h;h--)i[h]=i[h]||this.B.headerRowHeight,i.Rk+=1*i[h];for(var o=0;o<this.xf.length;o++)for(var a=this.xf[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.xf[o+f][t][u]=null}for(var l=0;l<this.xf.length;l++){var d=this.xf[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},Ok:function(t,i){return t.querySelector("DIV[".concat("active_id",'="').concat(i,'"]'))},getHeaderContent:function(t){var i=this.Ok(this.k,t);if(i||(i=this.Ok(this.gf,t)),i){var e=this.Uh[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&&F.extend(n,s.getHelper(i,e)),n}},Nk:function(t,i){return"<div class='".concat(i,"' style='height:").concat(t,"px;'></div>")},Wk:function(t,i,e,s,n){if(t==i)return"";for(var r="",h='<div style="background:inherit;width:'.concat(e,'px;">'),o=this.xf[0][s].length,a=0,u=t;u<i;u++){var c=0,f=this.xf[u].width,
l=u==t?"position:static;":"position:absolute;top:".concat(c,"px;left:").concat(a,"px;");h+='<div class="webix_hcolumn" style="'.concat(l,"width:").concat(f,'px;overflow:hidden;">');for(var d=0;d<o;d++){var v=this.xf[u][s][d],_=n[d],p="webix_hcell";if(this.xf[u].$selected&&(p+=" webix_sel_hcell"),u==t&&(p+=" webix_first"),u==i-1&&(p+=" webix_last"),d==o-1&&(p+=" webix_last_row"),v){v.content&&(v.contentId=v.contentId||$(),v.columnId=this.xf[u].id,v.format=this.xf[u].format,xn[v.content],v.content,v.text=xn[v.content].render(this,v),this.Uh[v.contentId]=v,this.Yk=!0),v.css&&(p+=" "+v.css);var m="<div row='"+d+"'column='"+(v.colspan?v.colspan-1+u:u)+"'",b="";v.contentId&&(m+=" active_id='"+v.contentId+"'");var g=!1,w=_;if(v.colspan&&1<v.colspan||v.rowspan&&1<v.rowspan){var x=this.Uk(this.xf,u,v.colspan)||f;(w=this.qk(n,d,v.rowspan))<=0&&(w=_),h+=this.Nk(_+1,p),v.colspan&&u+v.colspan>=i&&(p+=" webix_last"),v.rowspan&&d+v.rowspan>=o&&(p+=" webix_last_row"),p+=" webix_span",g=!0,b=" colspan='".concat(v.colspan||1,"' rowspan='").concat(v.rowspan||1,"' style='position:absolute;top:").concat(c,"px;left:").concat(a,"px;line-height:").concat(w+1,"px;width:").concat(x,"px;height:").concat(w+1,"px;'")}else _!=this.B.headerRowHeight&&(b=" style='line-height:".concat(_+1,"px;height:").concat(_+1,"px;'"));m+=' class="'+p+'"',m+=" "+b+">";var y=""===v.text?" ":v.text;v.rotate&&(y="<div class='webix_rotate' style='width:"+(w-10)+"px;transform-origin:center "+(w-15)/2+"px;-webkit-transform-origin:center "+(w-15)/2+"px;'>"+y+"</div>"),m+=y+"</div>",g?r+=m:h+=m,c+=_+1}else h+=this.Nk(_+1,p),c+=_+1}a+=f,h+="</div>"}return h+r+"</div>"},qk:function(t,i,e){var s=-1;for(e+=i;i<e;i++)s+=t[i]+1;return s},Uk:function(t,i,e){var s=0;for(e+=i;i<e;i++)s+=t[i].width;return s},showItemByIndex:function(t,i){var e=this.B.pager;if(e&&t>=this.B.topSplit){var s=Math.floor(t/e.size);s!=e.page&&ai(e.id).select(s)}var n=this.getScrollState();if(t>=this.B.topSplit||this.B.prerender&&-1!=t){var r=this.HS();if(t<r[0]+1||t>=r[1]-1){var h=this.Gk(e?this.data.$min:0,t),o=this.bM+1,a=this.Qy(t);if(t<r[0]+1)h=Math.max(0,h)-this.Xk();else if(o<h+a){h+=a-o;for(var u=t;0<u&&0<o;u--)o-=this.Qy(u);0<t&&o&&(h+=this.Qy(t+1))}else h=n.y;n.y=h}}if(-1!=i){if(i<this.B.leftSplit||i>=this.oM)return this.scrollTo(n.x,n.y);var c=this.RS();if(i<c[0]+1||i>=c[1]-1){for(var f=0,l=this.B.leftSplit;l<i;l++)f+=this.xf[l].width;var d=this.xf[i].width;i<c[0]+1||(f+d>this.qy?f+=d-this.qy:f=n.x),n.x=f}}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.Jy){if(this.gM)return this.gM(t,i);null!==t&&this.Jy.scrollTo(t),null!==i&&this.yM.scrollTo(i)}},no:"touch",getScrollState:function(){if(this.wM)return this.wM();var t=this.Kk?0:this.Jk||0;return{x:this.xM||0,y:this.Gy+t}},showItem:function(t){this.showItemByIndex(this.getIndexById(t),-1)},Bk:function(t,i,e){var s=t.childNodes;s[0].innerHTML=this.Wk(0,this.B.leftSplit,this.Uy,i,e),s[1].innerHTML=this.Wk(this.B.leftSplit,this.oM,this.Tk,i,e),s[2].innerHTML=this.Wk(this.oM,this.xf.length,this.Yy,i,e),this.$S&&(s[1].scrollLeft=this.getScrollState().x),s[1].onscroll=k(this.Zk,this)},Zk:function(){var t=this.getScrollState().x,i=this.k.childNodes[1].scrollLeft;Math.ceil(i)!=Math.ceil(t)&&this.scrollTo(i,null)},mk:function(){this.refreshHeaderContent(!0,!0)},lk:function(){this.refreshHeaderContent(!1,!0)},refreshHeaderContent:function(t,i,e){this.B.header&&(i&&this.Hk(this.k,t,1,e),this.Hk(this.k,t,0,e)),this.B.footer&&(i&&this.Hk(this.gf,t,1,e),this.Hk(this.gf,t,0,e))},refreshFilter:function(t){this.refreshHeaderContent(!1,!0,t)},Hk:function(t,i,e,s){if(this.Yk&&t)for(var n=t.querySelectorAll("".concat("DIV","[").concat("active_id","]")),r=0;r<n.length;r++){var h=n[r].getAttribute("active_id");if(h){var o=this.Uh[h];if(s&&s!=o.columnId)continue;var a=xn[o.content];e?a.getValue&&(o.value=a.getValue(n[r])):i&&!a.trackCells||a.refresh(this,n[r],o)}}},
headerContent:[],Qk:function(t,i,e){if(this.IM){if(t.style.height=Math.max(i,1)-1+"px",t.style.width=(this.oM?0:e)+this.IM-1+"px",G.isWebKit)t.offsetWidth}else t.style.display="none"},Ek:function(){this.B.header&&this.Qk(this.tC,this.po,this.Vk),this.B.footer&&this.Qk(this.iC,this.ak,this.Vk)},IS:function(){var t=!(this.B.autowidth||!1===this.B.scrollX);this.pS=t?G.scrollSize:0;var i=!(this.B.autoheight||!1===this.B.scrollY);this.IM=i?G.scrollSize:0,G.touch&&(t=i=!1),this.Jy&&(this.Jy.B.scrollSize=this.pS,this.Jy.B.scrollVisible=t),this.yM&&(this.yM.B.scrollSize=this.IM,this.yM.B.scrollVisible=i)},Fk:function(){var t,i;if(this.Gy=0,this.xM=0,t=i=1,(this.B.autoheight||!1===this.B.scrollY)&&(i=this.IM=0),(this.B.autowidth||!1===this.B.scrollX)&&(t=this.pS=0),G.touch&&(t=i=0),this.Jy||(this.Jy=ni({view:"vscroll",container:this.gf.previousSibling,scrollWidth:this.Tk,scrollSize:this.pS,scrollVisible:t}),!t||this.pS||G.$customScroll||(this.Jy.zt.style.position="absolute"),this.Jy.attachEvent("onScroll",k(this.eC,this))),!this.yM){this.tC=this.gf.nextSibling;var e=this.tC.nextSibling;this.iC=e.nextSibling,this.yM=ni({view:"vscroll",container:e,scrollHeight:100,scroll:"y",scrollSize:this.IM,scrollVisible:i}),this.yM.activeArea(this.st),this.Jy.activeArea(this.st,!0),this.yM.attachEvent("onScroll",k(this.sC,this))}this.xe&&this.callEvent("onResize",[this.xe,this.Me]),G.$customScroll&&Se.enable(this),this.Fk=function(){}},columnId:function(t){return this.xf[t]&&this.xf[t].id},getColumnIndex:function(t){for(var i=0;i<this.xf.length;i++)if(this.xf[i].id==t)return i;return-1},nC:function(t,i){var e,s=0,n=0,r=0,h=0,o=0;for(e=0;e<this.xf.length&&(this.oM!=e&&this.B.leftSplit!=e||(s=0,o++),this.xf[e].id!=i);e++)s+=this.xf[e].width;for(n+=this.xf[e].width,e=0;e<this.data.order.length&&this.data.order[e]!=t;e++)h+=this.Qy(e);return r+=this.Qy(e),[s,n,h-this.Gy,r,this.st.childNodes[o]]},wy:function(){return this.row},locate:function(t,i){if(this!=ai(t))return null;for(t=t.target||t;t&&t.getAttribute&&t!==this.$view;){var e=$t(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.xf[s.cind].id,s.toString=this.wy,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"))}},SM:function(){for(var t=-this.qy,i=0;i<this.xf.length;i++)t+=this.xf[i].width;this.xM=Math.min(this.xM,Math.max(0,t))},Nh:function(t){this.Eh&&(this.SM(),this.zk(),this.Pk(),this.Iy(),this.kk(),t||this.Mk(!1,!1))},setColumnWidth:function(t,i,e){return this.Oh(this.getColumnIndex(t),i,e)},Oh:function(t,i,e,s){if(!(isNaN(i)||t<0)){var n=this.xf[t];i=this.Ik(i,n);var r=n.width;return r!=i&&(t>=this.B.leftSplit&&t<this.oM&&(this.Tk+=i-r),n.width=i,!!n.node&&(n.node.style.width=i+"px",e||this.Nh(),this.callEvent("onColumnResize",[n.id,i,r,!!s]),!0))}},Ik:function(t,i){return t=Math.max(t,i.minWidth||this.B.minColumnWidth||0),t=Math.min(t,i.maxWidth||this.B.maxColumnWidth||1e5)},aM:function(t){return(t.$height||this.B.rowHeight)+(t.$subopen?t.$subHeight:0)},Qy:function(t){var i=this.data.order[t];return i?this.aM(this.data.pull[i]):this.B.rowHeight},Gk:function(t,i){if(this.B.fixedRowHeight)return Math.max(i-t,0)*this.B.rowHeight;for(var e=0;t<i;t++)e+=this.Qy(t);return e},at:function(t,i,e){t.row&&(i=t.column,t=t.row);var s=this.getColumnConfig(i).width,n=this.getItem(t).$height||this.B.rowHeight;if(this.config.spans&&e){var r=this.getSpan(t,i);if(r){var h=this.getSpanNode({row:r[0],column:r[1]});s=h.offsetWidth,n=h.offsetHeight}}for(var o=0,a=0,u=0;u<this.xf.length;u++){u!=this.B.leftSplit&&u!=this.oM||(o=0);var c=this.xf[u];if(c.id==i){var f=u<this.B.leftSplit?0:u>=this.oM?2:1;a=this.st.childNodes[f].firstChild;break}
o+=c.width}var l,d=this.getIndexById(t);if(d<this.B.topSplit)l=this.Gk(0,d);else{var v=this.Zy||0;l=this.Gk(v,d)+(this.Kk||0)+(v<=d?this.Xk():0)}return{parent:a,top:l,left:o,width:s,height:n}},Xk:function(){return this.B.topSplit?this.Gk(0,this.B.topSplit):0},Sk:function(){var t=this.B.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.Gk(i,e)},setRowHeight:function(t,i){if(!isNaN(i)){i=Math.max(i,this.B.minRowHeight||0),i=Math.min(i,this.B.maxRowHeight||1e5);var e=this.getItem(t),s=e.$height||this.B.rowHeight;s!=i&&(e.$height=i,this.config.fixedRowHeight=!1,this.render(),this.callEvent("onRowResize",[t,i,s]))}},sC:function(t){var i=this.Gy!==t;if(this.Gy=t,this.B.prerender)for(var e=this.st.childNodes,s=0;s<e.length;s++)e[s].scrollTop=t;else this.Mk();G.$customScroll&&Se.IS(this.st),i&&(this.callEvent("onScrollY",[]),this.callEvent("onAfterScroll",[]))},dk:function(t){this.st.childNodes[1].scrollLeft=this.xM=t,this.B.header&&(this.k.childNodes[1].scrollLeft=t),this.B.footer&&(this.gf.childNodes[1].scrollLeft=t)},eC:function(t){var i=this.xM!==t;this.bk?this.gk=t:this.dk(t),!1===this.B.prerender&&this.Mk(!this.rC),G.$customScroll&&Se.IS(this.st),i&&(this.callEvent("onScrollX",[]),this.callEvent("onAfterScroll",[]))},RS:function(t){if(t)return[0,this.xf.length];for(var i=this.xM,e=this.B.leftSplit;0<i&&this.xf.length-1>e;)i-=this.xf[e].width,e++;var s=e;for(i&&0<e&&e--,i+=this.qy;0<i&&s<this.oM;)i-=this.xf[s].width,s++;return[e,s]},getVisibleCount:function(){return Math.floor(this.bM/this.config.rowHeight)},HS:function(t){var i=this.Gy,e=0,s=this.count(),n=this.B.pager;n&&(e=n.page*n.size,s=Math.min(s,e+n.size),n.level&&(e=this.data.$min,s=this.data.$max));var r=e+this.B.topSplit;if(t||this.B.autoheight)return[r,s,0];var h=this.B.fixedRowHeight?this.B.rowHeight:0;if(h){var o=Math.ceil(i/h);i-=o*h,r+=o}else for(;0<i;)i-=this.Qy(r),r++;var a=0<r&&i?-(this.Qy(r-1)+i):0,u=r;if(i&&r--,i+=(this.bM||this.Me)-this.Xk(),h){var c=Math.ceil(i/h);i-=c*h,u+=c}else for(;0<i&&u<s;)i-=this.Qy(u),u++;return s<u&&(u=s),[r,u,a]},yk:function(t){var i=this.getItem(t),e=this.getIndexById(t),s=this.HS(),n=this.B.topSplit,r="";if(n<=e){if(e<s[0]||e>=s[1])return;e-=s[0]-n}else r=e==n-1?" webix_topcell webix_last_topcell":" webix_topcell";for(var h=this.RS(),o=0;o<this.xf.length;o++){var a=this.xf[o];if(o<this.oM&&o>=this.B.leftSplit&&(o<h[0]||o>h[1])&&(a.uS=-999),a.attached&&a.node){var u=a.node.childNodes[e];if(!u)continue;var c=this.TM(i,this.xf[o],0);u.innerHTML=c,u.className=this.hC(this.xf[o],c,i,t)+r}}},Mk:function(t,i){if(this.xf.length&&!this.bk){i&&this.oC();var e=this.RS(this.B.prerender),s=this.HS(!0===this.B.prerender);if(t){for(var n=this.B.leftSplit;n<e[0];n++)this.SS(n,i);for(var r=e[1];r<this.oM;r++)this.SS(r,i)}this.aC=[];for(var h=0;h<this.B.leftSplit;h++)this.uC(h,s,i);for(var o=e[0];o<e[1];o++)this.uC(o,s,i,o==e[0]);for(var a=this.oM;a<this.xf.length;a++)this.uC(a,s,i);this.cC(s[0],s[1],i),this.fC(s)}},lC:function(t,i){this.dC=t,this.vC=i,vt(this.nk),this.nk=[]},_k:function(){if(this.B.prerender&&this._C){var t=this.getScrollState();this._C.style.top="-"+(t.y||0)+"px"}},cC:function(t,i,e){if(this._C&&(this._C.style.top=this.Kk+"px"),e||t!=this.dC||i!=this.vC){if(this.lC(t,i),this.pC){this.pC=!1;for(var s=0;s<this.aC.length;s++){var n,r=this.aC[s],h=this.getItem(r.id);n="function"==typeof h.$row?h.$row.call(this,h,this.type):this.TM(h,this.getColumnConfig(h.$row),s);var o=this.nk[s]=lt("DIV",null,n);o.className="webix_cell "+(h.$sub?"webix_dtable_sub"+(this.B.subview?"view":"row"):"webix_dtable_colrow"+(h.$row?" webix_topcell"+(this.data.getMark(h.id,"webix_selected")?" webix_selected":""):"")),o.setAttribute("column",0),o.setAttribute("row",r.index);var a=h.$height||this.B.rowHeight;h.$subopen?o.style.height=h.$subHeight+"px":o.style.height=a+"px",o.style.paddingRight=G.scrollSize+"px";var u=this.aC[s].index<this.config.topSplit?-this.Kk:0;o.style.top=u+r.top+(h.$subopen?a-1:0)+"px",this._C||(this._C=lt("DIV"),this._C.style.position="relative"
,this._C.style.top=this.Kk+"px",this.st.appendChild(this._C)),this._C.appendChild(o),this.attachEvent("onSyncScroll",function(t,i,e){ue.xs(this._C,0,i,e)}),this.B.subview&&this.callEvent("onSubViewRender",[h,o])}}}else if(this.config.topSplit)for(var c=0;c<this.aC.length;c++){var f=this.nk[c];this.aC[c].index<this.config.topSplit&&(f.style.top=this.aC[c].top-this.Kk+"px")}},fC:function(t){var i=this.B.pager,e=this.B.datafetch,s=!this.mC||t[0]>=this.mC;if(this.mC=t[0],this.bC){if(i&&(!e||e>=i.size)&&this.gC([0,i.size*i.page],Math.max(e,i.size),!0))return this.bC=null;this.wf(this.bC,s),this.bC=null}else this.B.loadahead&&this.gC(t,this.B.loadahead,s)},gC: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 r=!1,h=s;h<n;h++)this.data.order[h]||(r?(r.last=h,r.count=h-s):r={start:h,count:n-s});if(r)return this.wf(r,e),!0},wf:function(t,i){var e=Math.max(t.count,this.B.datafetch||this.B.loadahead||0),s=i?t.start:t.last-e+1;this.Fh(t.count,t.start)||this.loadNext(e,s)},wC:function(t){if(G.isSafari){var i,e,s,n,r=[this.Jy,this.yM];for(i=0;i<2;i++)(n=r[i])&&n.iy&&n.iy.parentNode==t&&(e=n.iy);e&&(this.xC&&vt(this.xC),s=(this.xC=e).cloneNode(!0),e.parentNode.insertBefore(s,e),this.xC.style.display="none",this.st.appendChild(this.xC))}},SS:function(t){var i=this.xf[t];this.wC(i.node),vt(i.node),i.attached=!1},oC:function(){for(var t=0;t<this.xf.length;t++)this.xf[t].uS=-1;this.nk.length&&(vt(this.nk),this.nk=[])},getText:function(t,i){return this.TM(this.getItem(t),this.getColumnConfig(i),0)},getCss:function(t,i){var e=this.getItem(t);return this.hC(this.getColumnConfig(i),e[i],e,t)},hC:function(t,i,e,s){var n="webix_cell";if(t.cssFormat){var r=t.cssFormat(i,e,s,t.id);r&&("object"==M(r)?n+=" "+ut(r):n+=" "+r)}var h=e.$css;h&&("object"==M(h)&&(e.$css=h=ut(h)),n+=" "+h);var o=this.data.Nr[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"==M(u)&&(u=ut(u)),n+=" "+u)}var c=this.data.getMark(e.id,"webix_selected");return(c&&(c.$row||c[t.id])||t.$selected)&&(n+=this.ay),n},TM: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=l(this.types[t]),this.type.css&&(this.Ui.className+=" "+this.type.css)):ii(this,t),this.type.on_click&&F.extend(this.on_click,this.type.on_click),t},uC:function(t,i,e,s){var n=this.xf[t];if(!n.attached){var r=t<this.B.leftSplit?0:t>=this.oM?2:1;this.st.childNodes[r].firstChild.appendChild(n.node),n.attached=!0,n.split=r}if(this.Zy=i[0],this.Kk=0,this.Jk=i[2],this.B.scrollAlignY?i[1]==this.data.order.length||this.data.$pagesize&&i[1]%this.data.$pagesize==0?n.node.style.top=(this.Kk=i[2])+"px":n.yC&&(n.node.style.top="0px"):(this.Kk=i[2],n.node.style.top=i[2]+"px"),!(e||n.uS!=i[0]||n.cS!=i[1]||this.B.topSplit&&n.Kk!=this.Kk))return 0;for(var h="",o=this.B.columns[t],a={row:this.B.rowHeight,total:0,single:s},u=0;u<this.B.topSplit;u++)h+=this.MC(u,o,i,a,-this.Kk,t);this.bC=null;for(var c=Math.max(i[0],this.B.topSplit);c<i[1];c++)h+=this.MC(c,o,i,a,-1,t);return this.wC(n.node),n.node.innerHTML=h,n.uS=i[0],n.cS=i[1],n.yC=i[2],n.Kk=this.Kk,1},MC:function(t,i,e,s,n,r){var h=this.data.order[t],o=this.data.getItem(h),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.pC=!0,this.aC.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.TM(o,i,t),l=this.hC(i,f,o,h),d=" aria-selected='true' tabindex='0'";if(-1!==l.indexOf("select"))if(-1!==l.indexOf("row"))this.RS()[0]===r&&(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.B.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.bC?this.bC.last=t:this.bC={start:t,count:e[1]-t};return s.total+=s.row,a},kk:function(){if(this.xf.length&&!isNaN(1*this.Me)){var t=this.mM+(this.pS?this.pS:0);if(!this.B.autoheight&&!this.B.yCount||!this.resize()){this.yM.sizeTo(this.Me,this.po,this.ak),this.yM.define("scrollHeight",t),this.bM=Math.max(0,this.Me-this.pS-this.po-this.ak);for(var i=0;i<3;i++)this.st.childNodes[i].style.height=this.bM+"px",this.B.prerender?this.st.childNodes[i].firstChild.style.height=this.mM+"px":this.st.childNodes[i].firstChild.style.height=this.bM+"px";this.k.style.height=this.po+"px"}}},Pk:function(){if(this.xf.length){var t=0;for(this.Uy=0,this.Yy=0,this.qy=0;t<this.B.leftSplit;)this.Uy+=this.xf[t].width,t++;for(t=this.xf.length-1;t>=this.oM;)this.Yy+=this.xf[t].width,t--;if(this.xe&&(!this.B.autowidth||!this.resize())){this.qy=this.xe-this.Yy-this.Uy-this.IM,this.st.childNodes[1].firstChild.style.width=this.Tk+"px",this.st.childNodes[0].style.width=this.Uy+"px",this.st.childNodes[1].style.width=this.qy+"px",this.st.childNodes[2].style.width=this.Yy+"px",this.k.childNodes[0].style.width=this.Uy+"px",this.k.childNodes[1].style.width=this.qy+"px",this.k.childNodes[2].style.width=this.Yy+"px",this.gf.childNodes[0].style.width=this.Uy+"px",this.gf.childNodes[1].style.width=this.qy+"px",this.gf.childNodes[2].style.width=this.Yy+"px";var i=this.qy-this.Tk;if(i<0&&(i=0),i!=this.Vk&&(this.Vk=i,this.Ek()),G.isWebKit){this.st.childNodes[0].offsetWidth;this.st.childNodes[1].offsetWidth,this.st.childNodes[1].firstChild.offsetWidth,this.st.childNodes[2].offsetWidth}this.Jy.sizeTo(this.xe-this.IM),this.Jy.define("scrollWidth",this.Tk+this.Uy+this.Yy)}}},$getSize:function(t,i){if((this.B.autoheight||this.B.yCount)&&this.B.columns){var e=(this.B.yCount||0)*this.B.rowHeight;e||(e=this.isVisible()?this.mM:this.count()*this.B.rowHeight),this.B.height=Math.max(e+(this.pS?this.pS:0)-1,this.B.minHeight||0)+this.po+this.ak}this.B.autowidth&&this.B.columns&&(this.B.width=Math.max(this.Tk+this.Uy+this.Yy+this.IM,this.B.minWidth||0));var s=this.Uy+this.Yy+this.IM,n=Qi.api.$getSize.call(this,t,i);return n[0]=Math.max(n[0]||s),n},fk:function(){if(this.Jy&&!G.touch){var t=this.getScrollState();this.Jy.config.scrollPos=this.yM.config.scrollPos=0,this.scrollTo(t.x,t.y)}},$setSize:function(){var t=this.xe,i=this.Me;Qi.api.$setSize.apply(this,arguments)&&(this.Eh&&(this.callEvent("onResize",[this.xe,this.Me,t,i]),this.Pk(),this.kk()),this.render())},SC:function(t,i){var e=this.getColumnConfig(t);if(this.B.sort&&e.sort){var s="asc";this.Rh[e.id]?s="asc"==this.Rh[e.id].dir?"desc":"asc":this.rk[e.id]&&(s="asc"==this.rk[e.id].getAttribute("webix_sort_dir")?"desc":"asc"),this.Yh(e.id,s,e.sort,i.ctrlKey||i.metaKey)}},markSorting:function(t,i,e){if(i=i||"asc",!e)for(var s in this.hk=[],this.rk)if(s!==t){var n=this.rk[s].parentNode;n&&(n.removeAttribute("aria-sort"),n.removeAttribute("tabindex")),vt(this.rk[s]),delete this.rk[s]}else this.hk.push(s),this.rk[s].firstChild.innerHTML="1";if(t){if(this.rk[t])this.rk[t].className="webix_ss_sort_".concat(i);else{var r=lt("div",{webix_sort_dir:i,"class":"webix_ss_sort_".concat(i)},'<div class="webix_ss_sort_num">'.concat(this.hk.length+1,"</div>"));this.jk(t,r,i),this.rk[t]=r,this.hk.push(t)}var h=this.rk[this.hk[0]];switch(this.hk.length){case 1:Mt(h,"webix_ss_sort_single");break
;case 2:St(h,"webix_ss_sort_single")}}},jk:function(t,i,e){e=e||i.getAttribute("webix_sort_dir");var s=this.kC(this.getColumnIndex(t));s&&("absolute"!=s.style.position&&(s.style.position="relative"),s.appendChild(i),s.setAttribute("aria-sort",e+"ending"),s.setAttribute("tabindex","0"))},scroll_setter:function(t){return"string"==typeof t?(this.B.scrollX=-1!=t.indexOf("x"),this.B.scrollY=-1!=t.indexOf("y"),t):this.B.scrollX=this.B.scrollY=t},kC:function(t){for(var i=this.k.querySelectorAll("div[".concat("column",'="').concat(t,'"]')),e=null,s=0;s<i.length;s++){var n=i[s].getAttribute("active_id");if(n&&!xn[this.Uh[n].content].$icon)return null;if(i[s].innerHTML&&(e=i[s],(i[s].colSpan||0)<2))return e}return e},Hh:[],Rh:{},Yh:function(t,i,e,s){var n=this;i=i||"asc",(s="multi"===this.B.sort&&s)||(this.Hh=[],this.Rh={});var r=this.getColumnConfig(t),h="function"==typeof r.sort?{as:r.sort,dir:i}:{by:r.id,dir:i,as:r.sort};if(this.Rh[r.id]||this.Hh.push(r.id),this.Rh[r.id]=h,"server"==e){var o=[r.id,i,e];1<this.Hh.length&&(o=[this.Hh.map(function(t){return n.Rh[t]})]),this.callEvent("onBeforeSort",o),this.Wh?this.Wh.$params=o:this.loadNext(0,0,0,0,!0,!0).then(function(){return n.qh(o)})}else{if("text"==e){var a="$text_"+r.id;this.data.each(function(t){t[a]=this.getText(t.id,r.id)},this),h.as="string",h.by=a}1<this.Hh.length?this.data.sort(this.Hh.map(function(t){return n.Rh[t]})):this.data.sort(h)}this.markSorting(r.id,h.dir,s)},qh:function(t){this.callEvent("onAfterSort",t)},CC:function(t,i,e,s){var n;if(t.length)for(n=0;n<t.length;n++)if(!1===v(t[n],this.$scope).call(this,i,e,s))return!1},fu:function(t,i,e,s){var n=(t=t||event).target;if(!this.B.subview||this==ai(n)){for(var r="",h=[],o=!1,a=null;n&&n.parentNode&&n!=this.zt.parentNode;){if(r=$t(n))for(var u=(r=r.toString().split(" ")).length-1;0<=u;u--)i[r[u]]&&h.push(i[r[u]]);if(n.parentNode.getAttribute&&!a){var c=n.parentNode.getAttribute("column")||n.getAttribute("column");if(c){var f=this.st.contains(n);if(!this.xf[c])return;if(o=!0,f){var l=n.parentNode.getAttribute("row")||n.getAttribute("row");if(!l){if(n.getAttribute("column"))return;if((l=at(n))>=this.B.topSplit)(this.B.pager||!this.B.prerender&&!this.B.autoheight)&&(l+=this.xf[c].uS-this.B.topSplit)}this.eu=a={row:this.data.order[l],column:this.xf[c].id},a.toString=this.wy}else this.eu=a={column:this.xf[c].id};if(!1===this.CC(h,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){this.k.contains(n)&&this.callEvent("onHeaderClick",[a,t,n])&&this.SC(a.column,t)}h=[]}}n=n.parentNode}return this.CC(h,t,a,this.$view),o}},Pe:function(t,i){var e=this.locate(i);if(!e)return null;var s,n=ui.Lt;if(e.header){for(var r,h=i.target,o=h,a=e.cind-(e.span?e.span-1:0),u=-1;o&&!r;)r=(o=o.parentNode).getAttribute("section");for(;h&&u<0;){var c=h.getAttribute("row");c&&(u=c),h=h.parentNode}var f=this.xf[a][r][u];if(!f.tooltip)return null;n.type.template=qt(!0===f.tooltip?"#text#":f.tooltip),s=f}else{var l=n.type.column=this.getColumnConfig(e.column);if(!l.tooltip&&l.tooltip!==undefined)return null;if(!0===l.tooltip||!l.tooltip&&z(this.B.tooltip.template))s=this.getText(e.row,e.column).toString();else if(l.tooltip){var d=i.target.getAttribute("webix_area");n.type.template=d?function(t,i){var e=t[l.id];return qt(l.tooltip).call(this,t,i,e[d],d)}:qt(l.tooltip)}else n.type.template=qt(this.B.tooltip.template)}return s!==undefined?s:this.getItem(e.row)},$tooltipOut:function(){return ui.Ut(),delete ui.Lt.type.column,null},showOverlay:function(t){if(!this.$C){var i=lt("DIV",{"class":"webix_overlay"},"");this.st.appendChild(i),this.$C=i}this.$C.innerHTML=t},hideOverlay:function(){this.$C&&(vt(this.$C),this.$C=null)},mapCells:function(t,i,e,s,n,r){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.B.columns.length),this.exists(t)&&(t=this.getIndexById(t),null!==(i=this.getColumnIndex(i))))for(var h=0;h<e&&t+h<this.data.order.length;h++){var o=t+h,a=this.data.order[o];if(a)for(var u=this.getItem(a
),c=0;c<s&&i+c<this.B.columns.length;c++){var f=i+c,l=this.columnId(f),d=n(u[l],a,l,h,c);r||(u[l]=d)}}},ek:function(t,i){!this.B.columns&&t.getConfig&&this.define("columns",t.getConfig(i))},wk:function(){var t=this.getItem(this.getFirstId()),i=this.B.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.B.select&&this.define("select","row")}},Gh={api:qh,view:F.protoUI(qh,{},ze,xs,Ce,Le,Xe,ts,Me,Yh,Fs,{clearValidation:function(){for(var t in this.data.Nr)this.DC(t);this.data.clearMark("webix_invalid",!0)},xr:function(t,i){for(var e in this.DC(t),i)this.addCellCss(t,e,"webix_invalid_cell");this.addCss(t,"webix_invalid")},mr:function(t){this.DC(t),this.removeCss(t,"webix_invalid")},DC: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"),r=n||{},h=r[i]||"";r[i]=h.replace(e,"").replace(" "," ")+" "+e,n||this.data.addMark(t,"$cellCss",!1,r,!0),s||this.refresh(t)},removeCellCss:function(t,i,e,s){var n=this.data.getMark(t,"$cellCss");if(n){var r=n[i]||"";r&&(n[i]=r.replace(e,"").replace(" "," ")),s||this.refresh(t)}}},Uh,Pe,Wh,Oh,Lh,jh,Eh,{},Bh,Rh,Hh,{},Vh,Ph,zh,{},{},ee,Ye,ke,Fe,Je,Ke,Qi.view,b,Li)},Xh={name:"treetable",$init:function(){for(var t in F.extend(this.data,Ds,!0),F.extend(this.type,As),F.extend(this,ks,!0),Ms)this.on_click[t]||(this.on_click[t]=this.IC(Ms[t]));this.type.treetable=qt("{common.space()}{common.icon()} {common.folder()}"),this.type.treecheckbox=function(t){return t.indeterminate&&!t.nocheckbox?"<div class='webix_tree_checkbox webix_indeterminate'></div>":As.checkbox.apply(this,arguments)},this.data.provideApi(this,!0),this.zt.setAttribute("role","treegrid")},lo:!1,IC:function(e){return function(t,i){return i=i.row,e.call(this,t,i)}},co:function(t){for(var i=this.B.prerender?t.source:[t.start],e=0;e<i.length;e++)this.close(i[e])},getState:function(){var t=ze.getState.call(this);return F.extend(t,ys.getState.call(this)),t},setState:function(t){ys.setState.call(this,t)&&ze.setState.call(this,t)},clipboard_setter:function(t){return F.extend(this.ir,Is),xs.clipboard_setter.call(this,t)},wf: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 Gh.api.wf.call(this,t,i)}};F.protoUI(Xh,ys,$s,Ss,Gh.view);F.protoUI({name:"filter",defaults:{template:"GPL version doesn't support filter <br> You need Webix PRO"}},Cn.view);var Kh=F.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(t){this.data=t||{};var i=t&&t.id?t.id:$();this.B={id:i},ni.views[i]=this},getValues:function(){return this.data},setValues:function(t,i,e){this.data=i?F.extend(this.data,t,!0):t,this.callEvent("onChange",[t,e])},refresh:function(){this.callEvent("onBindRequest")}},b,qi,Rt,Li),Jh=F.proto({name:"DataValue",isVisible:function(){return!0},$init:function(t){t&&!z(t.value)||(this.data=t||"");var i=t&&t.id?t.id:$();this.B={id:i},ni.views[i]=this},setValue:function(t,i){this.data=t,this.callEvent("onChange",[t,i])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},b,qi),Zh=F.proto({name:"TreeCollection",$init:function(){F.extend(this.data,Ds,!0),this.data.provideApi(this,!0),F.extend(this,ks,!0)}},Ss,vr);F.Date=rn,F.Number=hn,F.promise=m,F.DataCollection=vr,F.DataRecord=Kh,F.DataValue=Jh,F.TreeCollection=Zh,F.AtomDataLoader=Rt,F.AtomRender=Gt,F.AutoScroll=Xt,F.AutoTooltip=ee,F.BaseBind=qi,F.BindSource=Ui,F.Canvas=se,F.CodeParser=Bt,F.CollectionBind=Ni,F.ContextHelper=ge,F.CopyPaste=ye,F.CustomPrint=Me,F.CustomScroll=Se,F.DataMarks=ke,F.DataMove=Ce,F.DataLoader=Fe,F.DataState=ze,F.DataStore=Te,F.Destruction=Oi,F.DragControl=le,F.DragItem=Pe,F.DragOrder=Ve,F.EditAbility=Le,F.EventSystem=b,F.FlexLayout=Oe,F.Group=Ye,F.GroupMethods=Ne,F.GroupStore=We,F.HTMLOptions=Ue,
F.HtmlMap=qe,F.IdSpace=Ge,F.KeysNavigation=Xe,F.MapCollection=Ke,F.Modality=_e,F.MouseEvents=Je,F.Movable=de,F.NavigationButtons=Ze,F.OverlayBox=Qe,F.PagingAbility=ts,F.ProgressBar=is,F.RecordBind=Yi,F.RenderStack=es,F.ResizeArea=pe,F.SingleRender=te,F.Scrollable=ss,F.SelectionModel=ns,F.Settings=Li,F.Sparklines=ws,F.TablePaste=xs,F.TooltipControl=ui,F.Touch=ue,F.TreeAPI=ys,F.TreeClick=Ms,F.TreeDataLoader=Ss,F.TreeDataMove=ks,F.TreeRenderStack=Cs,F.TreeStateCheckbox=$s,F.TreeStore=Ds,F.TreeTablePaste=Is,F.TreeType=As,F.UIManager=ji,F.Undo=He,F.UploadDriver=Ts,F.ValidateCollection=Fs,F.ValidateData=$e,F.ValueBind=Wi,F.Values=zs,F.VirtualRenderStack=Ps,F.VRenderStack=Vs,F.html=_n,F.skin=ae,F.debug=function ro(t){if(t)if("object"!==M(t))h={events:!0};else for(var i in t)h[i]=t[i];else h={}},F.i18n=P,F.ready=mi,F.env=G,F.color=rs,F.csv=xe,F.clipbuffer=we,F.storage=an,F.template=qt,F.type=ii,F.editors=je,F.animate=ne,F.print=function(t,i){var e=ai(t);e&&e.$printView&&(e=e.$printView()),e&&(e.callEvent&&e.callEvent("onBeforePrint",[i]),function s(t){Mt(document.body,"webix_print"),t.docHeader&&dn("Header",t),t.docFooter&&dn("Footer",t),ct("@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){(t=t||{}).paper=un[(t.paper||"").toLowerCase()]||"A4",t.mode=fn[t.mode]?t.mode:"portrait",t.fit=cn[t.fit]?t.fit:"page",t.scroll=t.scroll||!1,t.size=ln[t.paper],t.margin=t.margin||0===t.margin?t.margin:{};var i=isNaN(1*t.margin)?G.printMargin:t.margin;return t.margin={top:t.margin.top||0===t.margin.top?t.margin.top:i,bottom:t.margin.bottom||0===t.margin.bottom?t.margin.bottom:i,right:t.margin.right||0===t.margin.right?t.margin.right:i,left:t.margin.left||0===t.margin.left?t.margin.left:i},t}(i)),e.$customPrint&&!0!==e.$customPrint(i)||function h(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 r=e.getElementsByTagName("canvas")[n].getContext("2d");r.drawImage(s[n],0,0)}_t(e,i.docFooter,document.body),Mt(e,"webix_ui_print"),!i.scroll&&(t.tt&&t.data&&t.data.pull||t.getBody)&&Mt(e,"webix_print_noscroll"),window.print(),vt(e)}(e,i),function r(t){St(document.body,"webix_print"),ft("print"),t.docHeader&&vt(t.docHeader),t.docFooter&&vt(t.docFooter)}(i))},F.rules=Mi,F.filters={number:{greater:function(t,i){return i<t},less:function(t,i){return t<i},greaterOrEqual:function(t,i){return i<=t},lessOrEqual:function(t,i){return t<=i},equal:function(t,i){return t==i},notEqual:function(t,i){return t!=i},contains:function(t,i){return-1!==t.toString().toLowerCase().indexOf(i.toString().toLowerCase())},notContains:function(t,i){return-1===t.toString().toLowerCase().indexOf(i.toString().toLowerCase())}},text:{equal:function(t,i){return t.toLowerCase()===i.toLowerCase()},notEqual:function(t,i){return t.toLowerCase()!==i.toLowerCase()},contains:function(t,i){return-1!==t.toLowerCase().indexOf(i.toLowerCase())},notContains:function(t,i){return-1===t.toLowerCase().indexOf(i.toLowerCase())},beginsWith:function(t,i){return 0===t.toLowerCase().lastIndexOf(i.toLowerCase(),0)},notBeginsWith:function(t,i){return 0!==t.toLowerCase().lastIndexOf(i.toLowerCase(),0)},endsWith:function(t,i){return-1!==t.toLowerCase().indexOf(i.toLowerCase(),t.length-i.length)},notEndsWith:function(t,i){return-1===t.toLowerCase().indexOf(i.toLowerCase(),t.length-i.length)}},date:{greater:function(t,i){return i<t},less:function(t,i){return t<i},greaterOrEqual:function(t,i){return i<=t},lessOrEqual:function(t,i){return t<=i},equal:function(t,i){return!(!t||!i)&&t.valueOf()===i.valueOf()},notEqual:function(t,i){return!t||!i||t.valueOf()!==i.valueOf()},between:function(t,i){return(!i.start||t>i.start)&&(!i.end||t<i.end)},notBetween:function(t,i){return!i.start||t<=i.start||!i.end||t>=i.end}}},F.patterns=vn,F.fullscreen=Ei,F.version="9.0.0",F.name="core",F.level_in=function ho(){0},F.level_out=function oo(){0},F.clone=l,F.copy=S,F.single=function ao(t){var i=null
;return function(){return i||(i=new t({})),i.AC&&i.AC.apply(i,arguments),i}},F.bind=k,F.exec=_,F.wrap=function uo(i,e){return i?function(){var t=i.apply(this,arguments);return e.apply(this,arguments),t}:e},F.isUndefined=z,F.delay=C,F.once=u,F.uid=$,F.toNode=D,F.toFunctor=v,F.isArray=I,F.isDate=A,F.TC=T,F.FC=x,F.zC=Jt,F.PC=Zt,F.event=Qt,F.eventRemove=ti,F.callEvent=w,F.attachEvent=y,F.detachEvent=V,F.blockEvent=function(){return g.blockEvent()},F.unblockEvent=function(){return g.unblockEvent()},F.mapEvent=function(t){return g.mapEvent(t)},F.hasEvent=function(t){return g.hasEvent(t)},F.stringify=p,F.toPNG=function(s,n){var r=m.defer();return zt(G.cdn+"/extras/html2canvas-1.0.min.js").then(function(){"string"==typeof n&&(n={filename:n}),(n=n||{}).export_mode="png";var t=ai(s);if(t&&t.$exportView&&(t=t.$exportView(n)),!t)return r.reject(Hs);var i=t?t.$view:D(s),e=Ls(n.filename,"png");return window.html2canvas(i,{background:"#fff",logging:!1,useCORS:!0}).then(function(t){var i=function(t){!1!==n.download&&Ct(t,e),r.resolve(t)};t.msToBlob?i(t.msToBlob()):t.toBlob(i,"image/png")}),r})},F.toCSV=function(t,i){i=i||{};var e=ai(t);if(e&&e.$exportView&&(e=e.$exportView(i)),!e)return m.reject(Hs);i.export_mode="csv",i.filterHTML=!0;var s=js(e,i),n=function o(t){return xe.stringify(t)}(Os(e,i,s)),r=Ls(i.filename,"csv"),h=new Blob(["\ufeff"+n],{type:"text/csv"});return!1!==i.download&&Ct(h,r),m.resolve(h)},F.toPDF=Ws,F.toExcel=Zs,F.alert=function co(){var t=Pi.apply(this,arguments);return t.type=t.type||"alert",Ai(t)},F.confirm=Vi,F.modalbox=Hi,F.prompt=function fo(){var t=Pi.apply(this,arguments);return t.type=t.type||"prompt",t.input=t.input||{},zi(t)},F.message=Ri,F.editStop=function lo(){w("onEditEnd",[])},F.ajax=B,F.DataDriver=Vt,F.dp=Ie,F.DataProcessor=Ae,F.remote=gn,F.require=zt,F.proxy=Y,F.send=function vo(t,i,e,s){var n=lt("FORM",{target:s||"_self",action:t,method:e||"POST"},"");for(var r in i){var h=lt("INPUT",{type:"hidden",name:r,value:i[r]},"");n.appendChild(h)}n.style.display="none",document.body.appendChild(n),n.submit(),document.body.removeChild(n)},F.ui=ni,F.$$=ai,Object.defineProperty(F,"VC",{value:!0})});
//# sourceMappingURL=webix.min.js.map