text: /**
   * @license
   * Webix UI v.6.4.1
   * This software is covered by Webix Trial License.
   * Usage without proper license is prohibited.
   * (c) XB Software Ltd.
   */
  
  !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.webix={})}(this,function(P){"use strict";var M={codebase:"./",cdn:"//cdn.webix.com",top_views:[],i:null,n:null,h:null,o:null,u:null,l:null,_:null,m:null,w:0,S:null,k:null,$:[],destructors:[],securityKey:"",D:null,I:0,T:null,noanimate:!1},S={cdn:"//cdn.webix.com/",codebase:"",zIndexBase:100,scrollSize:17};S.strict=!!window.webix_strict,S.https="https:"===document.location.protocol;var t=navigator.userAgent;if(S.isMac=-1!=t.indexOf("Mac"),-1==t.indexOf("Mobile")&&-1==t.indexOf("Windows Phone")||(S.mobile=!0),(S.mobile||-1!=t.indexOf("iPad")||-1!=t.indexOf("Android"))&&(S.touch=!0),-1!=t.indexOf("Opera"))S.isOpera=!0;else{if(S.isIE=!!document.all||-1!==t.indexOf("Trident"),S.isIE)8==parseFloat(navigator.appVersion.split("MSIE")[1])&&(S.isIE8=!0);S.isEdge=-1!=t.indexOf("Edge"),S.isFF=-1!=t.indexOf("Firefox"),S.isWebKit=-1!=t.indexOf("KHTML"),S.isSafari=S.isWebKit&&S.isMac&&-1==t.indexOf("Chrome"),(S.isIE||S.isEdge||S.isFF)&&(S.maxHTMLElementSize=1e7),S.isSafari&&(S.maxHTMLElementSize=1e8)}-1!=t.toLowerCase().indexOf("android")&&(S.isAndroid=!0,-1!=t.toLowerCase().indexOf("trident")&&(S.isAndroid=!1,S.isIEMobile=!0)),S.transform=!1,S.transition=!1;for(var i=-1,s=["","webkit","Moz","O","ms"],e=document.createElement("DIV"),n=0;n<s.length;n++){var h=s[n]?s[n]+"Transform":"transform";if("undefined"!=typeof e.style[h]){i=n;break}}if(-1<i){S.cssPrefix=["","-webkit-","-Moz-","-o-","-ms-"][i];var r=S.jsPrefix=s[i];S.transform=r?r+"Transform":"transform",S.transition=r?r+"Transition":"transition",S.transitionDuration=r?r+"TransitionDuration":"transitionDuration",e.style[S.transform]="translate3d(0,0,0)",S.translate=e.style[S.transform]?"translate3d":"translate",S.transitionEnd="-Moz-"==S.cssPrefix?"transitionend":r?r+"TransitionEnd":"transitionend"}S.pointerevents=!S.isIE||null!==new RegExp("Trident/.*rv:11").exec(t),S.passiveEventListeners=!1;try{var o=Object.defineProperty({},"passive",{get:function(){S.passiveEventListeners=!0}});window.addEventListener("testPassive",null,o),window.removeEventListener("testPassive",null,o)}catch(Bo){}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}S.svg=document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),S.svganimation=document.implementation.hasFeature("https://www.w3.org/TR/SVG11/feature#SVG-animation","1.1");var a={};function u(t,i){a[t]=i}function d(t){return a[t]}var c={};function f(t){var i=f.F;return i.prototype=t,new i}function m(t){var i,s=!!(window.Map&&window.Set&&window.WeakMap&&window.WeakSet);for(var e in 1<arguments.length?(i=arguments[0],t=arguments[1]):i=g(t)?[]:{},t){var n=t[e];!n||"object"!=k(n)||n instanceof RegExp?i[e]=n:y(n)?i[e]=new Date(n):s&&(n instanceof Map||n instanceof Set||n instanceof WeakMap||n instanceof WeakSet)?i[e]=n:(i[e]=g(n)?[]:{},m(i[e],n))}return i}function C(t,i){return function(){return t.apply(i,arguments)}}function _(t){window.execScript?window.execScript(t):window.eval(t)}function j(t){return void 0===t}function $(i,s,e,t){return window.setTimeout(function(){if(!s||!s.$destructed){var t=i.apply(s,e||[]);return i=s=e=null,t}},t||1)}function l(t){var i=!0;return function(){i&&(i=!1,t.apply(this,arguments))}}f.F=function(){},P.extend=function(t,i,s){if(t.$protoWait)return x.insertAt.call(t.$protoWait,i,1),t;for(var e in i)e in t&&!s||(t[e]=i[e]);return i.defaults&&P.extend(t.defaults,i.defaults),i.$init&&i.$init.call(t),t};var v=(new Date).valueOf();function z(){return++v}function D(t){return"string"==typeof t?document.getElementById(t):t}function p(t){return P.extend(t||[],x,!0)}function b(t,i){if("string"!=typeof t)return t;var s=t.replace("()","");return i&&i[s]?i[s]:window[s]||window.eval(t)}function g(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(
  t)}function y(t){return t instanceof Date}var x={removeAt:function(t,i){0<=t&&this.splice(t,i||1)},remove:function(t){this.removeAt(this.find(t))},insertAt:function(t,i){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 s=0;s<this.length;s++)t.call(i||this,this[s])},map:function(t,i){for(var s=0;s<this.length;s++)this[s]=t.call(i||this,this[s]);return this},filter:function(t,i){for(var s=0;s<this.length;s++)t.call(i||this,this[s])||(this.splice(s,1),s--);return this}},w={$init:function(){this.V||(this.V={},this.B={},this.H={})},blockEvent:function(){this.V.R=!0},unblockEvent:function(){this.V.R=!1},mapEvent:function(t){P.extend(this.H,t,!0)},on_setter:function(t){if(t)for(var i in t){var s=b(t[i],this.$scope),e=i.indexOf("->");-1!==e?this[i.substr(0,e)].attachEvent(i.substr(e+2),C(s,this)):this.attachEvent(i,s)}},callEvent:function(t,i){var s=this.P||this;if(this.V.R)return!0;t=t.toLowerCase();var e=this.V[t.toLowerCase()],n=!0;if(e)for(var h=0;h<e.length;h++)!1===e[h].apply(s,i||[])&&(n=!1);if(this.H[t]){var r=this.H[t];r.$eventSource=this,r.callEvent(t,i)||(n=!1),r.$eventSource=null}return n},attachEvent:function(t,i,s){t=t.toLowerCase(),s=s||z(),i=b(i,this.$scope);var e=this.V[t]||p();return arguments[3]?e.unshift(i):e.push(i),this.V[t]=e,this.B[s]={f:i,t:t},s},detachEvent:function(t){if(this.B[t]){var i=this.B[t].t,s=this.B[t].f;this.V[i].remove(s),delete this.B[t]}else{var e=(t+"").toLowerCase();this.V[e]&&(this.V[e]=p())}},hasEvent:function(t){t=t.toLowerCase();var i=this.V[t];if(i&&i.length)return!0;var s=this.H[t];return!!s&&s.hasEvent(t)}},I={};P.extend(I,w,!0);var A=function(t,i){return I.callEvent(t,i)},T=function(t,i,s,e){return I.attachEvent(t,i,s,e)},F=function(t){return I.detachEvent(t)},V=0,B={},H={};function R(){V||(V=document.onselectstart),document.onselectstart=tt}function E(){0!==V&&(document.onselectstart=V||null),V=0}function N(t){for(var i=0;t=t.previousSibling;)i++;return i}function L(t,i){var s="";for(var e in i=i||"",t)s+=e+":"+t[e]+";";var n=H[s+i];return n||(O("."+(n="s"+z())+(i||"")+"{"+s+"}"),H[s+i]=n),n}function O(t,i){var s=i?B[i]:B["default"];s||((s=document.createElement("style")).setAttribute("type","text/css"),s.setAttribute("media","screen,print"),document.getElementsByTagName("head")[0].appendChild(s),i?B[i]=s:B["default"]=s),s.styleSheet?s.styleSheet.cssText+=t:s.appendChild(document.createTextNode(t))}function U(t){var i=B[t||"default"];i&&(i.innerHTML="")}function Y(t,i,s){i=i||{};var e=document.createElement(t);for(var n in i)e.setAttribute(n,i[n]);return i.style&&(e.style.cssText=i.style),i["class"]&&(e.className=i["class"]),s&&(e.innerHTML=s),e}function W(t){return(t=D(t))?j(t.value)?t.innerHTML:t.value:""}function G(t){if(t instanceof Array)for(var i=0;i<t.length;i++)G(t[i]);else t&&t.parentNode&&t.parentNode.removeChild(t)}function X(t,i,s){t&&(i&&i.parentNode?i.parentNode.insertBefore(t,i):s.appendChild(t))}function J(t,i){var s;for(s=t.tagName?t:(t=t||event).target||t.srcElement;s;){if(s.getAttribute){var e=s.getAttribute(i);if(e)return e}s=s.parentNode}return null}function Z(t){if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),s=document.body,e=document.documentElement,n=window.pageYOffset||e.scrollTop||s.scrollTop,h=window.pageXOffset||e.scrollLeft||s.scrollLeft,r=e.clientTop||s.clientTop||0,o=e.clientLeft||s.clientLeft||0,a=i.top+n-r,u=i.left+h-o;return{y:Math.round(a),x:Math.round(u),width:t.offsetWidth,height:t.offsetHeight}}for(var c=0,f=0;t;)c+=parseInt(t.offsetTop,10),f+=parseInt(t.offsetLeft,10),t=t.offsetParent;return{y:c,x:f,width:t.offsetHeight,height:t.offsetWidth}}function q(t){return j((t=t||event).offsetX)?{x:t.layerX,y:t.layerY}:{x:t.offsetX,y:t.offsetY}}function K(t){if((t=t||event).touches&&t.touches[0]&&(t=t.touches[0]),t.pageX||t.pageY)return{x:t.pageX,y:t.pageY};var i=S.isIE&&"BackCompat"!=document.compatMode?document.documentElement:document.body;return{x:t.clientX+i.scrollLeft-i.clientLeft,y:t.clientY+i.scrollTop-i.clientTop}}function Q(t){
  return t&&t.preventDefault&&t.preventDefault(),t&&(t.returnValue=!1),tt(t)}function tt(t){return(t=t||event).stopPropagation&&t.stopPropagation(),!(t.cancelBubble=!0)}function it(t,i,s){if(document.createEventObject){var e=document.createEventObject();t.fireEvent&&t.fireEvent("on"+s,e)}else{var n=document.createEvent(i);n.initEvent(s,!0,!0),t.dispatchEvent&&t.dispatchEvent(n)}}function st(t,i,s){s&&-1!==t.className.indexOf(i)||(t.className+=" "+i)}function et(t,i){t.className=t.className.replace(RegExp(" "+i,"g"),"")}function nt(t,i,s){var e=Y("DIV",{"class":"webix_view webix_measure_size "+(i||"")},"");e.style.cssText="height:auto;visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;"+(s?"width:"+s+"px;":"width:auto;white-space:nowrap;"),document.body.appendChild(e);for(var n="object"!==k(t)?[t]:t,h=0,r=0,o=0;o<n.length;o++)e.innerHTML=n[o],h=Math.max(h,e.offsetWidth+1),r=Math.max(r,e.offsetHeight+1);return G(e),{width:h,height:r}}function ht(t,i){var s=!1;if("object"==k(t)){if(window.navigator.msSaveBlob)return window.navigator.msSaveBlob(t,i);t=window.URL.createObjectURL(t),s=!0}var e=document.createElement("a");e.href=t,e.download=i,document.body.appendChild(e),e.click(),$(function(){s&&window.URL.revokeObjectURL(t),document.body.removeChild(e),e.remove()})}function rt(t){if(!t)return"";var i=t.className||"";return i.baseVal&&(i=i.baseVal),i.indexOf||(i=""),i}function ot(t,i,s){if(i=i||0,s=s||i,t.focus(),t.setSelectionRange)t.setSelectionRange(i,s);else{var e=t.createTextRange();e.collapse(!0),e.moveEnd("character",s),e.moveStart("character",i),e.select()}}function at(t){if("selectionStart"in t)return{start:t.selectionStart||0,end:t.selectionEnd||0};t.focus();var i=document.selection.createRange().getBookmark(),s=t.createTextRange();s.moveToBookmark(i);var e=s.text.length;s.collapse(!0),s.moveStart("character",-t.value.length);var n=s.text.length;return{start:n,end:n+e}}function ut(t,i){document.getElementsByTagName("head").item(0).appendChild(Y("meta",{name:t,content:i}))}var ct={parseFormat:"%Y-%m-%d %H:%i:%s",parseTimeFormat:"%H:%i:%s"};function ft(t){var i,s=Date.prototype.toJSON;return Date.prototype.toJSON=function(){return ct.parseFormatStr(this)},i=t instanceof Date?t.toJSON():JSON.stringify(t),Date.prototype.toJSON=s,i}var lt=window,dt=1,vt={},_t=!1;function pt(t){lt.setImmediate?lt.setImmediate(t):lt.importScripts||!lt.addEventListener?setTimeout(t):(vt[++dt]=t,lt.postMessage(dt,"*"))}function mt(t){if("function"!=typeof t&&t!=undefined)throw TypeError();if("object"!=k(this)||this&&this.then)throw TypeError();var i,s,n=this,h=0,r=0,e=[];(n.promise=n).resolve=function(t){return i=n.fn,s=n.er,h||(r=t,h=1,pt(u)),n},n.reject=function(t){return i=n.fn,s=n.er,h||(r=t,h=2,pt(u)),n},n.j=1,n.then=function(t,i){if(1!=this.j)throw TypeError();var s=new mt;return s.fn=t,s.er=i,3==h?s.resolve(r):4==h?s.reject(r):e.push(s),s},n["finally"]=function(i){var s,t=function(t){return s=t,i()},e=function(){var t=new mt;return 4==h?t.reject(s):t.resolve(s)};return n.then(t,t).then(e,e)},n["catch"]=function(t){return n.then(null,t)},n.fail=function(t){return n.then(null,t)};var o=function(t){h=t||4;for(var i=0;i<e.length;i++){var s=e[i];3==h&&s.resolve(r)||s.reject(r)}};try{"function"==typeof t&&t(n.resolve,n.reject)}catch(Bo){n.reject(Bo)}return n;function a(t,i,s,e){if(2==h)return e();if("object"!=k(r)&&"function"!=typeof r||"function"!=typeof t)e();else try{var n=0;t.call(r,function(t){n++||(r=t,i())},function(t){n++||(r=t,s())})}catch(Bo){r=Bo,s()}}function u(){var t;try{t=r&&r.then}catch(Bo){return r=Bo,h=2,u()}a(t,function(){h=1,u()},function(){h=2,u()},function(){try{1==h&&"function"==typeof i?r=i(r):2==h&&"function"==typeof s&&(r=s(r),h=1)}catch(Bo){return r=Bo,o()}r==n?(r=TypeError(),o()):a(t,function(){o(3)},o,function(){o(1==h&&3)})})}}!lt.setImmediate&&lt.addEventListener&&lt.addEventListener("message",function(t){if(t.source==lt)if(_t)pt(vt[t.data]);else{_t=!0;try{vt[t.data]()}catch(t){}delete vt[t.data],_t=!1}}),mt.resolve=function(i){if(1!=this.j)throw TypeError();return i instanceof mt?i:new mt(
  function(t){t(i)})},mt.reject=function(s){if(1!=this.j)throw TypeError();return new mt(function(t,i){i(s)})},mt.all=function(s){if(1!=this.j)throw TypeError();if(!(s instanceof Array))return mt.reject(TypeError());var e=new mt;return function n(t,i){return i?e.resolve(i):t?e.reject(t):(0==s.reduce(function(t,i){return i&&i.then?t+1:t},0)&&e.resolve(s),void s.map(function(t,i){t&&t.then&&t.then(function(t){return s[i]=t,n(),t},n)}))}(),e},mt.race=function(s){if(1!=this.j)throw TypeError();if(!(s instanceof Array))return mt.reject(TypeError());if(0==s.length)return new mt;var e=new mt;return function n(t,i){return i?e.resolve(i):t?e.reject(t):(0==s.reduce(function(t,i){return i&&i.then?t+1:t},0)&&e.resolve(s),void s.map(function(t){t&&t.then&&t.then(function(t){n(null,t)},n)}))}(),e},mt.j=1;var bt={N:function(t){return t&&t.documentElement?t.getElementsByTagName("parsererror").length?null:t:null},toObject:function(t,i){var s=i?i.rawxml?i.rawxml():i:null;return this.N(s)?s:(s="string"==typeof t?this.fromString(t.replace(/^[\s]+/,"")):t,this.N(s)?s:null)},getRecords:function(t){return this.xpath(t,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(t){return this.tagToObject(t,{})},getOptions:function(){return!1},getInfo:function(t){var i=this.xpath(t,this.config);return i=i.length?this.assignTypes(this.tagToObject(i[0],{})):null,{size:t.documentElement.getAttribute("total_count")||0,from:t.documentElement.getAttribute("pos"),parent:t.documentElement.getAttribute("parent")||0,config:i,key:t.documentElement.getAttribute("webix_security")||null}},xpath:function(t,i){if(window.XPathResult){var s=t;-1==t.nodeName.indexOf("document")&&(t=t.ownerDocument);for(var e=[],n=t.evaluate(i,s,null,XPathResult.ANY_TYPE,null),h=n.iterateNext();h;)e.push(h),h=n.iterateNext();return e}var r=!0;try{"undefined"==typeof t.selectNodes&&(r=!1)}catch(Bo){}if(r)return t.selectNodes(i);var o=i.split("/").pop();return t.getElementsByTagName(o)},assignTypes:function(t){for(var i in t){var s=t[i];if("object"==k(s))this.assignTypes(s);else if("string"==typeof s){if(""===s)continue;"true"==s?t[i]=!0:"false"==s?t[i]=!1:s==1*s&&(t[i]=1*t[i])}}return t},tagToObject:function(t,i){var s=0;if(1==t.nodeType&&t.getAttribute("stack")){i=[];for(var e=t.childNodes,n=0;n<e.length;n++)1==e[n].nodeType&&i.push(this.tagToObject(e[n],{}))}else{i=i||{};var h=t.attributes;if(h&&h.length)for(var r=0;r<h.length;r++)i[h[r].name]=h[r].value,s=1;for(var o=t.childNodes,a=0;a<o.length;a++)if(1==o[a].nodeType){var u=o[a].tagName;i[u]?("function"!=typeof i[u].push&&(i[u]=[i[u]]),i[u].push(this.tagToObject(o[a],{}))):i[u]=this.tagToObject(o[a],{}),s=2}if(!s)return this.nodeValue(t);s<2&&(i.value=i.value||this.nodeValue(t))}return i},nodeValue:function(t){return t.firstChild?t.firstChild.wholeText||t.firstChild.data:""},fromString:function(t){try{if(window.DOMParser)return(new DOMParser).parseFromString(t,"text/xml");if(window.ActiveXObject){var i=new ActiveXObject("Microsoft.xmlDOM");return i.loadXML(t),i}}catch(Bo){return null}}},gt={toObject:function(t){if(!t)return null;if("string"==typeof t)try{if(this.parseDates){var s=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1-3})?Z/;t=JSON.parse(t,function(t,i){return"string"==typeof i&&s.test(i)?new Date(i):i})}else t=JSON.parse(t)}catch(Bo){return null}return t},getRecords:function(t){return t&&t.data&&(t=t.data),t&&!g(t)?[t]:t},getDetails:function(t){return"string"==typeof t?{id:t||z(),value:t}:t},getOptions:function(t){return t.collections},getInfo:function(t){return{size:t.total_count||0,from:t.pos,parent:t.parent||0,config:t.config,key:t.webix_security}},child:"data",parseDates:!(mt.defer=function(){return new mt(null)})};function wt(t,i,s){return 0!==arguments.length?(new wt).get(t,i,s):this&&this.getXHR?this:new wt}wt.count=0,wt.prototype={master:null,getXHR:function(){return new XMLHttpRequest},stringify:function(t){return ft(t)},O:function(t,i,e,s){var n;i&&(g(i)||"function"==typeof(i.success||i.error||i))&&(n=e,e=i,i=null);var h=mt.defer(),r=this.getXHR(),o=this.U||{};if(!A("onBeforeAjax",[s,t,i,r,o
  ,null,h]))return h.reject(r);var a=!1;if("GET"!==s){var u=!1;for(var c in o)"content-type"==c.toString().toLowerCase()&&(u=!0,"application/json"==o[c]&&(a=!0));u||window.FormData&&i instanceof window.FormData||(o["Content-Type"]="application/x-www-form-urlencoded")}if("object"==k(i)&&!(window.FormData&&i instanceof window.FormData))if(a)i=this.stringify(i);else{var f=[];for(var l in i){var d=i[l];null!==d&&d!==undefined||(d=""),"object"===k(d)&&(d=this.stringify(d)),f.push(l+"="+encodeURIComponent(d))}i=f.join("&")}i&&"GET"===s&&(t=t+(-1!=t.indexOf("?")?"&":"?")+i,i=null),r.open(s,t,!this.Y);var v=this.W;for(var _ in v&&(r.responseType=v),o)r.setRequestHeader(_,o[_]);var p=this;return this.master=this.master||n,r.onreadystatechange=function(){if(!r.readyState||4==r.readyState){wt.count++;var t,i,s=400<=r.status||0===r.status;i="blob"==r.responseType||"arraybuffer"==r.responseType?(t="",r.response):(t=r.responseText||"",p.G(r)),s?(A("onAjaxError",[r]),h.reject(r)):h.resolve(i),e&&wt.$callback(p.master||window,e,t,i,r,s)}},this.X&&(r.timeout=this.X),this.Y?r.send(i||null):setTimeout(function(){r.send(i||null)},1),this.master&&!this.Y&&h.then(function(t){return p.master=null,e=p=n=null,t}),this.Y?r:h},G:function(t){return{xml:function(){try{return bt.tagToObject(bt.toObject(t.responseText,this))}catch(Bo){t.responseText,Bo.toString()}},rawxml:function(){return window.XPathResult?t.responseXML:bt.fromString(t.responseText)},text:function(){return t.responseText},json:function(){return gt.toObject(t.responseText,!1)}}},get:function(t,i,s){return this.O(t,i,s,"GET")},post:function(t,i,s){return this.O(t,i,s,"POST")},put:function(t,i,s){return this.O(t,i,s,"PUT")},del:function(t,i,s){return this.O(t,i,s,"DELETE")},patch:function(t,i,s){return this.O(t,i,s,"PATCH")},sync:function(){return this.Y=!0,this},timeout:function(t){return this.X=t,this},response:function(t){return this.W=t,this},headers:function(t){return this.U=P.extend(this.U||{},t),this},bind:function(t){return this.master=t,this}},wt.$callback=function(t,i,s,e,n,h){if(!t.$destructed&&(h&&A("onAjaxError",[n]),i)){var r=i.success||i;h&&(r=i.error),r&&r.call&&r.call(t,s,e,n)}};var xt={collapseNames:function(t,i,s,e){if(s=s||{},i=i||"",e=e||function(){return!0},!t||"object"!=k(t))return null;for(var n in t){var h=t[n],r=i+n;h&&"object"==k(h)&&!y(h)&&!g(h)&&e(r,h)?xt.collapseNames(h,r+".",s,e):s[r]=h}return s},expandNames:function(t){var i,s,e,n,h,r={};for(h in t){for(s=(e=h.split(".")).length-1,n=r,i=0;i<s;i++)n[e[i]]||(n[e[i]]={}),n=n[e[i]];n[e[s]]=t[h]}return r}},yt={},Mt={},St=new RegExp("(\\r\\n|\\n)","g"),kt=new RegExp('(\\")',"g"),Ct=new RegExp("(\\\\)","g"),$t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Dt=/[&<>"'`]/g,It=function(t){return $t[t]||"&amp;"};function At(s){if("function"==typeof s)return s;if(yt[s])return yt[s];if(-1!=(s=(s||"").toString()).indexOf("->")){var t=s.split("->");switch(t[0]){case"html":s=W(t[1]);break;case"http":s=(new wt).sync().get(t[1],{uid:z()}).responseText}}if(s=(s||"").toString(),S.strict){if(!Mt[s]){Mt[s]=[];var h=[];if(s.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,function(t,i,s,e,n){h.push({pos:n,str:t,fn:function(t){return t[i]?s:e}})}),s.replace(/\{common\.([^}(]*)\}/g,function(t,s,i){h.push({pos:i,str:t,fn:function(t,i){return i[s]||""}})}),s.replace(/\{common\.([^}(]*)\(\)\}/g,function(t,s,i){h.push({pos:i,str:t,fn:function(t,i){return i[s]?i[s].apply(this,arguments):""}})}),s.replace(/\{obj\.([^:}]*)\}/g,function(t,i,s){h.push({pos:s,str:t,fn:function(t){return t[i]}})}),s.replace("{obj}",function(t,i){h.push({pos:i,str:t,fn:function(t){return t}})}),s.replace(/#([^#'";, ]+)#/gi,function(t,i,s){"!"==i.charAt(0)?(i=i.substr(1),h.push({pos:s,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=xt.collapseNames(t)),At.escape(t[i])}})):h.push({pos:s,str:t,fn:function(t){return-1!=i.indexOf(".")&&(t=xt.collapseNames(t)),t[i]}})}),h.sort(function(t,i){return t.pos>i.pos?1:-1}),h.length){for(var i=0,e=function(t,i,s){Mt[t].push(function(){return t.slice(i,s)})},n=0;n<h.length;n++){var r=h[n].pos;e(s,
  i,r),Mt[s].push(h[n].fn),i=r+h[n].str.length}e(s,i,s.length)}else Mt[s].push(function(){return s})}return function(){for(var t="",i=0;i<Mt[s].length;i++)t+=Mt[s][i].apply(this,arguments);return t}}var o=!1;s=(s=(s=(s=(s=(s=(s=(s=(s=s.replace(Ct,"\\\\")).replace(St,"\\n")).replace(kt,'\\"')).replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"')).replace(/\{common\.([^}(]*)\}/g,"\"+(common.$1||'')+\"")).replace(/\{common\.([^}(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"')).replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"')).replace("{obj}",'"+obj+"')).replace(/#([^#'";, ]+)#/gi,function(t,i){return"!"==i.charAt(0)?(o=!0,'"+template.escape(obj.'+i.substr(1)+')+"'):'"+(obj.'+i+')+"'});try{if(o){var a=Function("obj","common","marks","value","template",'return "'+s+'";');yt[s]=function(t,i,s,e){return a(t,i,s,e,At)}}else yt[s]=Function("obj","common",'return "'+s+'";')}catch(Bo){}return yt[s]}function Tt(t,i){if(t.$protoWait)return t.J||(t.J=[]),void t.J.push(i);"function"==typeof t&&(t=t.prototype),t.types||(t.types={"default":t.type},t.type.name="default");var s=i.name,e=t.type;for(var n in s&&(e=t.types[s]=f(i.baseType?t.types[i.baseType]:t.type)),i)0===n.indexOf("template")?e[n]=At(i[n]):e[n]=i[n];return s}At.escape=function(t){return t===undefined||null===t?"":(t.toString()||"").replace(Dt,It)},At.empty=function(){return""};var Ft={};function zt(t,i,s){var e;M.w++;var n=M.i;M.i=t.$scope||n;try{e=function l(t,i,s){var e,n=g(t),h=D(t.container||i||document.body);h.Z&&(s=function f(t,i,s){var e=[t];if(i)e=t.getChildViews();else if(t.q)e=[t.q];else{if("number"==typeof s)return s;if(s)return Bt(e=[Pt(s)]),e[0].config.id}return Bt(e),s}(h,n,s));var r=!1,o=h==document.body;t.Z||h&&n?(e=t,r=!0):(h&&o&&(t.$topView=!0),t.K||(t.K={}),i&&i.getParentView&&(M._=s||0===s?i:i.getParentView()),e=Rt(t));!o||e.setPosition||e.$apiOnly||d("_fixHeight")();if(e.Z&&e.Z.Q&&!h.$view)e.Z.tt=h;else if(!e.$apiOnly)if(h.appendChild)Vt(h,e,t);else if(h.destructor){var a=h;if(s||0===s||g(e)||(h=(s=h).getParentView()),h&&h.it){if(r&&e.getParentView){var u=e.getParentView();u&&u.st&&u.st(e),e._=h,e.$scope=h.$scope}h.it(e,s)}else{var c=a.$view.parentNode;a.destructor(),Vt(c,e,t)}}else t.container;return e}(t,i,s)}finally{M.w--,M.i=n}return e}function Vt(t,i,s){t.appendChild(i.et),i.getParentView()||(((!i.setPosition||i.Z.fullscreen)&&t==document.body||i.Z.position)&&M.top_views.push(i.nt),s.skipResize||i.adjust())}function Bt(t){for(var i=t.length-1;0<=i;i--){var s=t[i];delete Ft[s.config.id],s.config.id="x"+z(),(Ft[s.config.id]=s).getChildViews&&Bt(s.getChildViews()),s.ht&&Bt(s.ht)}}function Ht(t,i){var s=zt[t];return!!s&&(s.$protoWait&&(s=s.call(-1)),!!zt[t].prototype[i])}function Rt(t){if(t.view){var i=t.view;return new zt[i](t)}if(t.rows||t.cols){for(var s=t.rows||t.cols,e=!1,n=0;n<s.length;n++)!s[n].body||s[n].view||s[n].align||(e=!0);return e?new zt.headerlayout(t):new zt.layout(t)}return t.cells?new zt.multiview(t):t.template||t.content?new zt.template(t):t.align&&t.body?new zt.align(t):new zt.spacer(t)}function Pt(t){if(!t)return null;if(Ft[t])return Ft[t];var i=t;if("object"==k(t)){if(t.Z)return t;i=t.target||t.srcElement||t}return Ft[J({target:D(i)},"view_id")]}zt.views=Ft,zt.rt=Rt,"undefined"==typeof window.$$&&(window.$$=Pt),P.protoUI=function(){var h=arguments[0].name,r=function(t){if(!r)return zt[h].prototype;var i=r.$protoWait;if(i){for(var s=[i[0]],e=1;e<i.length;e++)s[e]=i[e],s[e].$protoWait&&(s[e]=s[e].call(-1,s[e].name)),s[e].prototype&&s[e].prototype.name&&(zt[s[e].prototype.name]=s[e]);if(zt[h]=P.proto.apply(-1,s),r.J)for(var n=0;n<r.J.length;n++)Tt(zt[h],r.J[n]);r=i=null}return-1!=this?new zt[h](t):zt[h]};return r.$protoWait=Array.prototype.slice.call(arguments,0),zt[h]=r},P.proto=function(){for(var t=arguments,i=t[0],s=!!i.$init,e=[],n=t.length-1;0<n;n--){if(t[n],"function"==typeof t[n]&&(t[n]=t[n].prototype),t[n].$init&&e.push(t[n].$init),t[n].defaults){var h=t[n].defaults;for(var r in i.defaults||(i.defaults={}),h)j(i.defaults[r])&&(i.defaults[r]=h[r])}if(t[n].type&&i.type)for(var o in t[n].type
  )i.type[o]||(i.type[o]=t[n].type[o]);for(var a in t[n])i[a]||!1===i[a]||(i[a]=t[n][a])}s&&e.push(i.$init),i.$init=function(){for(var t=0;t<e.length;t++)e[t].apply(this,arguments)},i.$skin&&i.$skin();var u=function(t){this.$ready=[],this.$init,this.$init(t),this.ot&&this.ot(t,this.defaults);for(var i=0;i<this.$ready.length;i++)this.$ready[i].call(this)};return u.prototype=i,i=t=null,u},T("onClick",function(t){var i=Pt(t);if(i&&i.touchable){d("UIManager").applyChanges(i),i.getNode(t);var s=t.target||t.srcElement;if(i.config.disabled)return;var e="";if(s.className&&0===s.className.toString().indexOf("webix_view"))return;for(i&&d("UIManager").at(i);s&&s.parentNode;){if(s.getAttribute){if(s.getAttribute("view_id"))break;if(e=s.className){e=e.toString().split(" ");for(var n=0;n<e.length;n++){if(i.on_click[e[n]])if(!1===i.on_click[e[n]].call(i,t,i.Z.id,s))return}}}s=s.parentNode}if(i.Z.click){var h=b(i.Z.click,i.$scope);h&&h.call&&h.call(i,i.Z.id,t)}var r=i.Z.popup;i.Z.popup&&!i.Z.readonly&&("object"!=k(r)||r.name||(r=i.Z.popup=zt(r).Z.id),(r=Pt(r)).isVisible()||(r.Z.master=i.Z.id,r.show(i.getInputNode()||i.getNode(),null,!0))),i.callEvent("onItemClick",[i.Z.id,t])}});var jt={};function Et(){for(var t in jt)Ot(t)}function Nt(t,i,s,e){(e=e||{}).inner=!0,Lt(t,i,s,e)}function Lt(t,i,s,e){e=e||{},t=D(t);var n=e.id||z();e.bind&&(s=C(s,e.bind));var h=[t,i,s,e.capture];e.inner||(jt[n]=h);var r=!!e.capture;return!j(e.passive)&&S.passiveEventListeners&&(r={passive:e.passive,capture:r}),t.addEventListener?t.addEventListener(i,s,r):t.attachEvent&&t.attachEvent("on"+i,h[2]=function(){return s.apply(t,arguments)}),n}function Ot(t){if(t){jt[t];var i=jt[t];i[0].removeEventListener?i[0].removeEventListener(i[1],i[2],!!i[3]):i[0].detachEvent&&i[0].detachEvent("on"+i[1],i[2]),delete jt[t]}}var Ut={$init:function(t){if(t.activeContent)for(var i in this.$ready.push(this.ut),this.ct={},this.ft={},this.lt={},this.dt={},t.activeContent)if(this[i]=this.vt(i),t.activeContent[i].earlyInit){var s=M._;M._=null,this[i].call(this,{},this,t.activeContent),M._=s}},_t:function(){for(var t in this.dt){var i=this.dt[t];i.destructor&&i.destructor()}},ut:function(){if(this.attachEvent("onDestruct",C(this._t,this)),Nt(this.$view,"blur",function(t){if("BUTTON"!=(t.target||t.srcElement).tagName){var i=Pt(t);if(i&&i!==this&&i.getValue&&i.setValue){i.getNode(t);var s=i.getValue();s!=i.Z.value&&i.setValue(s)}}},{bind:this,capture:!0}),this.filter){for(var t in this.Z.activeContent)this.type[t]=this[t],this[t]=this.pt(t);this.attachEvent("onBeforeRender",function(){this.type.masterUI=this}),this.type.masterUI=this}},pt:function(h){return function(t){for(var i=this.dt[h],s=i.Z.id,e=this.getItemNode(t).getElementsByTagName("DIV"),n=0;n<e.length;n++)if(e[n].getAttribute("view_id")==s){i.et=i.mt=e[n];break}return i}},bt:function(n,h,r){return function(t){if(t)for(var i=t.target||t.srcElement;i;){if(i.getAttribute&&i.getAttribute("view_id")){if(r.gt(n,i),r.locate){var s=r.locate(i.parentNode),e=r.lt[h][s];n.Z.value=e,n.Z.$masterId=s}return i}i=i.parentNode}return n.et}},wt:function(e,n){return function(t){var i=n.data;if(n.filter){var s=n.locate(this.et.parentNode);i=n.getItem(s),this.refresh(),n.ft[e][s]=this.et.outerHTML||(new XMLSerializer).serializeToString(this.et),n.lt[e][s]=t}i&&(i[e]=t)}},vt:function(o){return function(t,i,s){var e=i.ct?i:i.masterUI;if(!e.ct[o]){var n=document.createElement("DIV"),h=zt((s=s||e.Z.activeContent)[o],n);S.isIE8?n.firstChild.setAttribute("onclick","event.processed = true; event.srcElement.w_view = '"+h.Z.id+"';"):n.firstChild.setAttribute("onclick","event.processed = true; "),h.getNode=e.bt(h,o,e),h.attachEvent("onChange",e.wt(o,e)),e.dt[o]=h,e.ct[o]=n.innerHTML,e.ft[o]={},e.lt[o]={},h.$activeEl=h.$view}if(e.filter&&t[o]!=e.lt[o]&&!j(t[o])){var r=e.dt[o];r.blockEvent(),e.gt(r,r.$activeEl),r.$view.firstChild||r.refresh(),r.setValue(t[o]),r.refresh(),r.unblockEvent(),e.lt[o][t.id]=t[o],e.ft[o][t.id]=r.et.outerHTML||(new XMLSerializer).serializeToString(r.et)}return e.ft[o][t.id]||e.ct[o]}},gt:function(t,i){t.mt=t.et=t.$view=i}},Yt={
  $proxy:!0,load:function(){var i=this.source.split("@"),s=i[0].split(".").pop();return wt().response("arraybuffer").get(i[0]).then(function(t){return{data:t,options:{ext:s,dataurl:i[1]}}})}},Wt={$proxy:!0,connectorName:"!nativeeditor_status",load:function(){return wt(this.source)},saveAll:function(t,i){for(var s=this.source,e={},n=[],h=0;h<i.length;h++){var r=i[h];for(var o in n.push(r.id),r.data)0!==o.indexOf("$")&&(e[r.id+"_"+o]=r.data[o]);e[r.id+"_"+this.connectorName]=r.operation}return e.ids=n.join(","),e.webix_security=M.securityKey,s+=-1==s.indexOf("?")?"?":"&",s+="editing=true",wt().post(s,e).then(function(t){if(!(t=t.xml()))throw"Data loading error";var i=t.data.action;i.length||(i=[i]);for(var s=[],e=0;e<i.length;e++){var n=i[e];n.status=n.type,n.id=n.sid,n.newid=n.tid,s.push(n)}return s})}},Gt={$proxy:!0,load:function(){},save:function(t,i,s){$(function(){window.console.log("[DP] "+i.id+" -> "+i.operation,i.data);var t={id:i.data.id,newid:i.data.id,status:i.data.operation};s.processResult(t,t)})}},Xt={$proxy:!0,init:function(){this.clientId=this.clientId||z()},load:function(s){var t=this.clientId;this.client.subscribe(this.source,function(i){i.clientId!=t&&d("dp")(s).ignore(function(){if("delete"==i.operation)s.remove(i.data.id);else if("insert"==i.operation)s.add(i.data);else if("update"==i.operation){var t=s.getItem(i.data.id);t&&(P.extend(t,i.data,!0),s.refresh(t.id))}})})},save:function(t,i){i.clientId=this.clientId,this.client.publish(this.source,i)}},Jt={$proxy:!0,create:function(t,r,i,s){this.source=t+"/",this.xt(s,i,function(t){var i=t.target.result;for(var s in r)for(var e=r[s],n=i.createObjectStore(s,{keyPath:"id",autoIncrement:!0}),h=0;h<e.length;h++)n.put(e[h])})},xt:function(i,t,s){if(-1!=this.source.indexOf("/")){var e=this.source.split("/");this.source=e[1],t=t||e[2];var n,h=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB;n=t?h.open(e[0],t):h.open(e[0]),s&&(n.onupgradeneeded=s),n.onerror=function(){},n.onblocked=function(){},n.onsuccess=C(function(t){this.db=t.target.result,i&&i.call(this)},this)}else this.db?i.call(this):$(this.xt,this,[i],50)},load:function(){var e=mt.defer();return this.xt(function(){var t=this.db.transaction(this.source).objectStore(this.source),s=[],i=t.openCursor();i.onsuccess=function(t){var i=t.target.result;i?(s.push(i.value),i["continue"]()):e.resolve(s)},i.onerror=function(t){e.reject(t)}}),e},save:function(t,h){var r=mt.defer();return this.xt(function(){var t,s=h.operation,i=h.data,e=h.id,n=this.db.transaction([this.source],"readwrite").objectStore(this.source);"delete"==s?t=n["delete"](e):"update"==s?t=n.put(i):"insert"==s&&(delete i.id,t=n.add(i)),t.onsuccess=function(t){var i={status:s,id:h.id};"insert"==s&&(i.newid=t.target.result),r.resolve(i)},t.onerror=function(t){r.reject(t)}}),r}},Zt={$proxy:!0,load:function(){return wt(this.source)},save:function(t,i){return Zt.yt.call(this,i,wt())},yt:function(t,i){var s=this.source,e="",n=s.indexOf("?");-1!==n&&(e=s.substr(n),s=s.substr(0,n)),s+="/"==s.charAt(s.length-1)?"":"/";var h=t.operation,r=t.data;return"insert"==h&&delete r.id,"update"==h?i.put(s+r.id+e,r):"delete"==h?i.del(s+r.id+e,r):i.post(s+e,r)}},qt={$proxy:!0,load:function(){return wt(this.source)},save:function(t,i){var s=wt().headers({"Content-Type":"application/json"});return Zt.yt.call(this,i,s)}},Kt={$proxy:!0,load:function(t,i){return i=P.extend(i||{},this.params||{},!0),wt().post(this.source,i)}},Qt={toObject:function(t){return"string"==typeof t?JSON.parse(t):t},getRecords:function(t){return t&&t.data&&(t=t.data),t},getDetails:function(t){for(var i={},s=0;s<t.length;s++)i["data"+s]=t[s];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},getOptions:function(){return!1},getInfo:function(){return{size:0}},idColumn:null},ti={toObject:function(t){if("string"!=typeof t)return t;var i=null;return-1==t.indexOf("<")&&(i=D(t)),i||((i=document.createElement("DIV")).innerHTML=t),i.firstChild},getRecords:function(t){return t.getElementsByTagName(this.tag)},getDetails:function(t){return bt.tagToObject(t)},getOptions:function(){return!1},
  getInfo:function(){return{size:0}},tag:"LI"},ii={toObject:function(t){(t=D(t)).tagName.toLowerCase();var i=t.rows;return G(t),i},getRecords:function(t){for(var i=[],s=t[0]&&t[0].Mt?1:0;s<t.length;s++)i.push(t[s]);return i},getDetails:function(t){var i=t.getElementsByTagName("td");t={};for(var s=0;s<i.length;s++)t["data"+s]=i[s].innerHTML;return t},getInfo:function(){return{size:0}},getOptions:function(){},getConfig:function(t){var i=[],s=t[0].getElementsByTagName("th");s.length&&(t[0].Mt=!0);for(var e=0;e<s.length;e++){var n={id:"data"+e,header:this.St(s[e].innerHTML)},h=this.kt(s[e]);n=P.extend(n,h),i.push(n)}return i},St:function(t){var i=t.indexOf("json://");return-1!=i&&(t=JSON.parse(t.substr(i+7))),t},kt:function(t){for(var i=t.attributes,s={},e=0;e<i.length;e++)s[i[e].nodeName]=this.St(i[e].nodeValue);return s.width=parseInt(s.width,10),s}},si={};function ei(s,t,i){var e=mt.defer();if(t&&!0!==t&&(e=e.then(function(){t.call(i||this)})),ei.disabled)return e.resolve(),e;if("string"!=typeof s){var n=s.length||0;if(n){var h=function(){n?(n--,ei(s[s.length-n-1]).then(h,function(){return e.reject()})):e.resolve()};h()}else{for(var r in s)n++;var o=function(){0===--n&&e.resolve()};for(var a in s)ei(a).then(o,function(){return e.reject()})}return e}if(!0!==si[s]){var u=s;if(!0===t)return _(wt().sync().get(u).responseText),si[s]=!0,e.resolve();if(si[s])return si[s].push(e),e;si[s]=[e];var c=function(){var t=si[s];si[s]=!1;for(var i=0;i<t.length;i++)t[i].reject()},f=function(){var t=si[s];si[s]=!0;for(var i=0;i<t.length;i++)t[i].resolve()},l=s.split("?");if(".css"==l[0].substr(l[0].length-4)){var d=Y("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 e.resolve();return e}var ni=P.extend({toObject:function(t){if(t.excel)return t;var i=t.options||{};i.dataurl&&P.extend(i,this.Ct(i.dataurl)),t=t.data||t;var s=mt.defer();if(t.name){i.ext=t.name.split(".").pop();var e=new FileReader;e.onload=C(function(t){s.resolve(this.parseData(t.target.result,i))},this),e.readAsArrayBuffer(t)}else s.resolve(this.parseData(t,i));return s},parseData:function(t,s){t=new Uint8Array(t);for(var e=[],i=0;i!=t.length;++i)e[i]=String.fromCharCode(t[i]);var n=(s.ext||s).toLowerCase();return"xls"!=n&&(n="xlsx"),ei(S.cdn+"/extras/xlsx.core.styles.min.js").then(C(function(){var t="xls"==n?XLS.read(e.join(""),{type:"binary",cellStyles:!0,cellDates:!0}):XLSX.read(e.join(""),{type:"binary",cellStyles:!0,cellDates:!0}),i={sheets:t.Sheets,names:t.SheetNames,options:s,ranges:t.Workbook&&t.Workbook.Names||[]};return P.extend(this.getSheet(i,s),i)},this))},getSheet:function(t,i){var s=i.name||t.names[0];return t=this.sheetToArray(t.sheets[s],i),i.rows&&i.rows.length&&(t.data=t.data.splice(i.rows[0],Math.min(i.rows[1],t.data.length)-i.rows[0])),t},sheetToArray:function(t,i){var s=[],e=[],n=[],h=[];if(t&&t["!ref"]){var r,o,a,u=XLS.utils.decode_range(t["!ref"]),c=u.s.c,f=u.s.r+(i.rows?i.rows[0]:0);for(r=u.s.r;r<=u.e.r;r++){var l=[];for(o=u.s.c;o<=u.e.c;o++)if(a=t[XLS.utils.encode_cell({r:r,c:o})]){var d="";d=i.math&&a.f?"="==a.f.charAt(0)?a.f:"="+a.f:"d"==a.t&&y(a.v)?ct.dateFormatStr(a.v):a.v,l.push(d),a.s&&n.push([r-f,o-c,a.s])}else l.push("");s.push(l)}if(t["!merges"])for(var v=t["!merges"],_=0;_<v.length;_++){var p=v[_].s,m=v[_].e;(!i.rows||0<=p.r-f&&m.r-f<=i.rows[1])&&e.push([p.r-f,p.c-c,m.c-p.c+1,m.r-p.r+1])}if(t["!cols"])for(var b=t["!cols"],g=0;g<b.length;g++)b[g]&&h.push(["column",g-c,Math.round(b[g].wch/(8.43/70))]);if(t["!rows"])for(var w=t["!rows"],x=0;x<w.length;x++)w[x]&&h.push(["row",x-f,w[x].hpx])}return{data:s,spans:e,styles:n,sizes:h,excel:!0}},Ct:function(t){var i=t.split("["),s={};if(s.name=i[0],i[1]){var e=i[1].split(/[^0-9]+/g);e[0]=1*e[0]||0,e[1]=1*e[1]||9999999,s.rows=e}return s}},Qt),hi={json:gt,jsarray:Qt,xml:bt,csv:{toObject:function(t){return t},getRecords:function(t){return t.split(this.row)},getDetails:function(t){
  t=this.stringToArray(t);for(var i={},s=0;s<t.length;s++)i["data"+s]=t[s];return null!==this.idColumn&&(i.id=t[this.idColumn]),i},getOptions:function(){return!1},getInfo:function(){return{size:0}},stringToArray:function(t){t=t.split(this.cell);for(var i=0;i<t.length;i++)t[i]=t[i].replace(/^[ \t\n\r]*("|)/g,"").replace(/("|)[ \t\n\r]*$/g,"");return t},idColumn:null,row:"\n",cell:","},html:ti,htmltable:ii,excel:ni},ri={prefix:function(s,e){return s+=".",{put:function(t,i){return e.put(s+t,i)},get:function(t){return e.get(s+t)},remove:function(t){return e.remove(s+t)}}}};ri.local={put:function(t,i){t&&window.JSON&&window.localStorage&&window.localStorage.setItem(t,ft(i))},get:function(t){if(t&&window.JSON&&window.localStorage){var i=window.localStorage.getItem(t);return i?hi.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.localStorage&&window.localStorage.removeItem(t)},clear:function(){window.localStorage.clear()}},ri.session={put:function(t,i){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.setItem(t,ft(i))},get:function(t){if(t&&window.JSON&&window.sessionStorage){var i=window.sessionStorage.getItem(t);return i?hi.json.toObject(i):null}return null},remove:function(t){t&&window.JSON&&window.sessionStorage&&window.sessionStorage.removeItem(t)},clear:function(){window.sessionStorage.clear()}},ri.cookie={put:function(t,i,s,e){t&&window.JSON&&(document.cookie=t+"="+escape(ft(i))+(e&&e instanceof Date?";expires="+e.toUTCString():"")+(s?";domain="+s:"")+(S.https?";secure":""))},getRaw:function(t){for(var i=document.cookie.split(";"),s="",e="",n=0;n<i.length;n++){if((s=i[n].split("="))[0].replace(/^\s+|\s+$/g,"")==t)return!0,1<s.length&&(e=unescape(s[1].replace(/^\s+|\s+$/g,""))),e;s=null,""}return null},get:function(t){if(t&&window.JSON){var i=this.getRaw(t);return i?hi.json.toObject(unescape(i)):null}return null},remove:function(t,i){t&&this.getRaw(t)&&(document.cookie=t+"="+(i?";domain="+i:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT")},clear:function(t){for(var i=document.cookie.split(";"),s=0;s<i.length;s++)document.cookie=/^[^=]+/.exec(i[s])[0]+"="+(t?";domain="+t:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};var oi={$proxy:!0,storage:ri.local,cache:!1,local:!1,data:"",$t:function(){this.cache||S.offline||(A("onOfflineMode",[]),S.offline=!0)},Dt:function(){!this.cache&&S.offline&&(S.offline=!1,A("onOnlineMode",[]))},It:function(t){this.Dt(),this.setCache(t)},At:function(t){this.$t();var i=this.getCache()||this.data;t.parse(i)},load:function(t){var i,s=this;if(!this.cache||!this.getCache())return(i=this.source.$proxy?this.source.load(t):wt().get(this.source))&&i.then&&i.then(function(t){s.It(t.text())},function(){s.At(t)}),i;this.At(t)},getCache:function(){return this.storage.get(this.Tt())},clearCache:function(){this.storage.remove(this.Tt())},setCache:function(t){this.storage.put(this.Tt(),t)},Tt:function(){return this.source.$proxy?this.source.source+"_$proxy$_data":this.source+"_$proxy$_data"},save:function(t,i,s){if(!S.offline&&!this.cache)return this.source.$proxy?this.source.save(t,i,s):wt().post(this.source,i.data)},saveAll:function(t,i){this.setCache(t.serialize()),i=this.cache||S.offline?i:[];for(var s=0;s<i.length;s++)i[s]={id:i[s].id,status:i[s].operation};return mt.resolve(i)}},ai={init:function(){P.extend(this,oi)},cache:!0},ui={init:function(){P.extend(this,oi)},cache:!0,local:!0,data:[]};var ci={$proxy:!0,save:function(t){return this.load(t)},load:function(t){var i={query:this.source};return 1===arguments.length&&(i.variables=t),wt().headers({"Content-type":"application/json"}).post(this.url,i).then(function(t){return function n(t){if(!t||"object"===!k(t)||Array.isArray(t))return t;var i="",s=0;for(var e in t){if(2==++s)return t;i=e}return t[i]}(t.json().data)})}};function fi(t,i,s){var e=m(fi[t]);return e.source=i,s&&P.extend(e,s,!0),e.init&&e.init(),e}fi.$parse=function(t){if("string"!=typeof t||-1==t.indexOf("->"))return t;var i=t.split("->");return fi(i[0],i[1])},fi.binary=Yt,fi.connector=Wt,fi.debug=Gt,fi.faye=Xt,fi.indexdb=Jt,fi.json=qt,fi.post=Kt,fi.rest=Zt,
  fi.offline=oi,fi.cache=ai,fi.local=fi.local=ui,fi.GraphQL=ci;var li={$init:function(t){this.data={},this.waitData=mt.defer(),t&&(this.Z.datatype=t.datatype||"json"),this.$ready.push(this.Ft)},Ft:function(){this.zt=!0,this.Z.url&&this.url_setter(this.Z.url),this.Z.data&&this.data_setter(this.Z.data)},url_setter:function(t){return t=fi.$parse(t),this.zt&&this.load(t,this.Z.datatype),t},data_setter:function(t){return this.zt?(this.parse(t,this.Z.datatype),!0):t},load:function(t,i){var s,e=this,n=arguments[2]||null;if(!this.callEvent("onBeforeLoad",[]))return mt.reject();"string"==typeof i?(this.data.driver=hi[i],i=arguments[2]):this.data.driver||(this.data.driver=hi.json),(s=(t=fi.$parse(t)).$proxy&&t.load?t.load(this,n):"function"==typeof t?t.call(this,n):wt().bind(this).get(t))&&!s.then&&(s=mt.resolve(s));var h=this.Vt;return s&&s.then&&s.then(function(t){if(e.$destructed||h&&e.Vt!==h)return mt.reject();e.Bt(t),i&&wt.$callback(e,i,"",t,-1)},function(t){return e.Ht(t,h)}),s},parse:function(t,i){if(t&&"function"==typeof t.then){var s=this.Vt;return t.then(C(function(t){if(this.$destructed||s&&this.Vt!==s)return mt.reject();this.parse(t,i)},this))}if(t&&t.sync&&this.sync)this.Rt(t);else{if(!this.callEvent("onBeforeLoad",[]))return mt.reject();this.data.driver=hi[i||"json"],this.Bt(t)}return mt.resolve()},Rt:function(t){this.data&&this.data.attachEvent("onSyncApply",C(function(){this.Pt&&this.Pt()},this)),this.sync(t)},jt:function(t){var i,s,e=this.data.driver;i=(s=e.getRecords(t)[0])?e.getDetails(s):{},this.setValues?this.setValues(i):this.data=i},Et:function(t){t?this.$onLoad&&this.$onLoad(t,this.data.driver)||(this.data&&this.data.jt?this.data.jt(t):this.jt(t)):this.Ht(t),this.Pt&&this.Pt(),this.callEvent("onAfterLoad",[]),this.waitData.resolve()},Bt:function(t){var i=this;t&&"function"==typeof t.text&&(t=t.text()),(t=this.data.driver.toObject(t))&&t.then?t.then(function(t){return i.Et(t)}):this.Et(t)},Ht:function(t,i){return this.$destructed||i&&this.Vt!==i||(this.callEvent("onAfterLoad",[]),this.callEvent("onLoadError",arguments)),A("onLoadError",[t,this]),mt.reject(t)},Nt:function(t){if(!this.Z.dataFeed||this.Lt||!t)return!0;var i=this.Z.dataFeed;return"function"==typeof i?i.call(this,t.id||t,t):(i=i+(-1==i.indexOf("?")?"?":"&")+"action=get&id="+encodeURIComponent(t.id||t),this.callEvent("onBeforeLoad",[])&&wt(i,function(t,i,s){this.Lt=!0;var e=hi.json,n=e.toObject(t,i);n?this.setValues(e.getDetails(e.getRecords(n)[0])):this.Ht(s),this.Lt=!1,this.callEvent("onAfterLoad",[])},this),!1)}},di={Ot:function(t){return t.$empty?"":this.Z.template(t,this)},render:function(){var t=this.Z;return!!this.isVisible(t.id)&&(this.callEvent&&!this.callEvent("onBeforeRender",[this.data])||(this.data&&!t.content&&(this.mt.innerHTML="",this.mt.innerHTML=this.Ot(this.data)),this.callEvent&&this.callEvent("onAfterRender",[])),!0)},sync:function(i){this.Ut=!1,"DataStore"!=i.name&&(i.data&&"DataStore"==i.name?i=i.data:this.Ut=!0),this.Ut?i.bind("change",C(function(t){t.id==this.data.id&&(this.data=t.attributes,this.refresh())},this)):i.attachEvent("onStoreUpdated",C(function(t){t&&t!=this.data.id||(this.data=i.pull[t],this.refresh())},this))},template_setter:At},vi={Yt:function(t){var i,s,e=this.Z.dragscroll;"string"!=typeof e&&(e=this.Z.layout||"xy"),s=-1!==e.indexOf("x"),i=-1!==e.indexOf("y");var n=Z(this.Wt||this.$view),h=Math.max((this.Z.rowHeight||(this.type&&!isNaN(parseFloat(this.type.height))?this.type.height:0))+5,40),r=!1;i&&this.Gt(t,n,h)&&(r=!0),s&&this.Xt(t,n,h)&&(r=!0),r&&(this.Jt=$(this.Yt,this,[t],100))},Zt:function(t){var i=this.Z.dragscroll;if("string"!=typeof i||-1!==i.indexOf("x")){var s=Z(this.U||this.$view),e=Math.max(this.Z.headerRowHeight||0,40);this.Xt(t,s,e)&&(this.Jt=$(this.Zt,this,[t],100))}},Gt:function(t,i,s){var e=i.y,n=e+i.height,h=this.getScrollState(),r=this.Z;if(r.topSplit){var o=this.qt(this.getIdByIndex(r.topSplit-1),this.columnId(0));e+=o.top+o.height}return t.y<e+s?(this.Kt(h.x,h.y-2*s,t),!0):t.y>n-s&&(this.Kt(h.x,h.y+2*s,t),!0)},Xt:function(t,i,s){var e=i.x,n=e+i.width,h=this.getScrollState()
  ;return t.x<e+s?(this.Kt(h.x-2*s,h.y,t),!0):t.x>n-s&&(this.Kt(h.x+2*s,h.y,t),!0)},Kt:function(t,i,s){this.callEvent("onBeforeAutoScroll",[s])&&this.scrollTo(t,i)}},_i={Qt:p(["dummy"]),ti:0,delay:400,addTooltip:function(t,i){var s,e,n=this;(t=D(t))instanceof Element?(s=t,"string"==typeof i?s.setAttribute("webix_tooltip",i):e=i):(s=t.$view,e=t),e=e||this;var h=this.Qt.find(e);-1===h&&(h=this.Qt.length,this.Qt.push(e)),s.webix_tooltip=h,this.ti++,this.ii||(this.ii=new zt.tooltip({}),this.si=Lt(document,"mousemove",this.ei,{bind:this}),this.ni=Lt(document,"mouseleave",this.hi,{bind:this}),this.ri=T("onDragMode",function(){n.hi()}),this.oi=T("onClick",function(){n.hi()}))},getTooltip:function(){return this.ii},ei:function(t){for(var i,s=t.target||t.srcElement;s instanceof Element&&"HTML"!=s.tagName;){if(this.Qt[s.webix_tooltip])return this.ai&&this.ai!=s?(this.$tooltipOut(this.ai,s,t),void(this.ai=null)):(this.ai||(this.ai=this.$tooltipIn(s,t)),void this.$tooltipMove(s,t,i));i=i||s.getAttribute("webix_tooltip"),s=s.parentElement}this.ai&&(this.ai=this.$tooltipOut(this.ai,null,t))},hi:function(){clearTimeout(this.ci),this.ii.hide()},getMaster:function(t){return this.Qt[t.webix_tooltip]},removeTooltip:function(t){var i;(i=(t=D(t))instanceof Element?t:t.$view).webix_tooltip&&(this.ai==i&&(this.hi(),this.ai=null),delete i.webix_tooltip,this.ti--),!this.ti&&this.ii&&(this.si=Ot(this.si),this.ni=Ot(this.ni),this.ri=F(this.ri),this.oi=F(this.oi),this.ii.destructor(),this.ii=this.ai=null,this.Qt=p(["dummy"]))},$tooltipIn:function(t,i){var s=this.Qt[t.webix_tooltip];return s.$tooltipIn&&s!=this?s.$tooltipIn(t,i):(this.ii.define({dx:20,dy:0,template:t.getAttribute("webix_tooltip")||"",css:""}),t)},$tooltipOut:function(t,i,s){var e=this.Qt[t.webix_tooltip];return e.$tooltipOut&&e!=this?e.$tooltipOut(t,i,s):(this.hi(),null)},$tooltipMove:function(t,i,s){var e=this.Qt[t.webix_tooltip];if(e.$tooltipMove&&e!=this)return e.$tooltipMove(t,i,s);this.ii.hide(),clearTimeout(this.ci),this.ci=$(this.ii.show,this.ii,[s||{},K(i)],this.delay)}};function pi(t){return"$"+t+(mi[t]=(mi[t]||0)+1)}var mi={},bi=!1;function gi(t,i){bi=!0;var s=t();return s&&s.then?s=s.then(function(t){return(bi=!1)!==i&&wi(),t}):(bi=!1)!==i&&wi(),s}function wi(){if(d("UIManager").applyChanges(),A("onClick",[]),M.fi=!0,!bi)for(var t=M.top_views.length-1;0<=t;t--)M.top_views[t].obj&&M.top_views[t].obj.resize();M.fi=!1}function xi(t,i,s,e){if(t)for(var n=e?[t]:t.getChildViews(),h=0;h<n.length;h++)!1!==i.call(s,n[h])&&xi(n[h],i,s)}function yi(){return S.zIndexBase++}function Mi(t){Si?t.call():ki.push(t)}Lt(window,"resize",function(){S.touch&&M.m&&new Date-M.m<1e3||wi()});var Si=!1,ki=[],Ci=document.getElementsByTagName("SCRIPT");Ci.length,Ci.length&&((Ci=(Ci[Ci.length-1].getAttribute("src")||"").split("/")).splice(Ci.length-1,1),S.codebase=Ci.slice(0,Ci.length).join("/")+"/");var $i=function(){S.isIE&&(document.body.className+=" webix_ie"),A("onReady",[])},Di=function(){Si=!0,window.webix_ready&&g(webix_ready)&&(ki=webix_ready.concat(ki));for(var t=0;t<ki.length;t++)ki[t].call();ki=[]};T("onReady",function(t){t?Di():$(Di)}),"complete"==document.readyState?$i():Lt(window,"load",$i),Mi(function(){Lt(document.body,"click",function(t){A("onClick",[t||Lt])})});var Ii={rt:null,li:{},m:0,di:0,vi:0,_i:{enter:13,tab:9,esc:27,escape:27,up:38,down:40,left:37,right:39,pgdown:34,pagedown:34,pgup:33,pageup:33,end:35,home:36,insert:45,"delete":46,backspace:8,space:32,meta:91,win:91,mac:91,multiply:106,add:107,subtract:109,decimal:110,divide:111,scrollock:145,pausebreak:19,numlock:144,"5numlocked":12,shift:16,capslock:20},pi:{input:1,button:1,textarea:1,select:1},mi:function(){Lt(document.body,"click",C(this.bi,this)),Lt(document,"keydown",C(this.gi,this)),Nt(document.body,"mousedown",C(function(){this.vi=new Date},this)),document.body.addEventListener&&Lt(document.body,"focus",this.wi,{capture:!0,bind:this}),M.destructors.push({obj:this})},destructor:function(){Ii.rt=null},getFocus:function(){return this.rt},at:function(t){this.xi=this.xi||t.Z.id},setFocus:function(t,i,s){return(t=Pt(t)
  )&&!t.$view&&(t=null),this.m=M.m=new Date,this.rt===t||(this.rt&&this.rt.callEvent&&this.rt.callEvent("onBlur",[this.rt]),t&&t.callEvent&&(t.callEvent("onFocus",[t,this.rt]),s&&t.callEvent("onTabFocus",[t,this.rt])),A("onFocusChange",[t,this.rt]),this.rt&&this.rt.blur&&!i&&this.rt.blur(),(this.rt=t)&&t.focus&&!i&&t.focus()),!0},applyChanges:function(t){var i=this.getFocus();i&&i!=t&&i.yi&&i.yi(t)},hasFocus:function(t){return t===this.rt},Mi:function(t,i){var s=J(t,"view_id")||this.xi;if(s=Pt(s),this.xi=null,M.m=new Date,s!=this.rt)return i||(this.xi=null),s?(s=Pt(s),this.canFocus(s)&&(s.getNode&&s.getNode(t),this.setFocus(s))):i||this.setFocus(null),!0},bi:function(t){return new Date-this.m<100?(this.xi=null,!1):this.Mi(t)},wi:function(t){return!!this.pi[t.target.nodeName.toLowerCase()]&&this.Mi(t,!0)},Si:function(t){if(!document.querySelector(".webix_modal"))return!0;var i=t.queryView(function(t){return t.config.modal},"parent");return i&&i.$view.style.zIndex>=M.I},canFocus:function(t){return t.isVisible()&&t.isEnabled()&&!t.config.disabled&&this.Si(t)&&!t.queryView({disabled:!0},"parent")},ki:function(t){var i=this.getFocus();if(t&&!this.Ci(t,i))return!1;this.$i("getPrev",t)||(this.rt=null)},Di:{},Ci:function(t,i){if(!t)return!1;if(!i)return!1;for(;i;){if(i===t)return!0;i=i.getParentView()}return!1},Ii:function(){this&&this.callEvent&&this.callEvent("onTimedKeyPress",[])},Ai:function(t){return t<112&&105<t},gi:function(t){var i=t.which||t.keyCode;95<i&&i<106&&(i-=48),i=this.Di[i]||i;var s=t.ctrlKey,e=t.shiftKey,n=t.altKey,h=t.metaKey,r=this.Ti(i,s,e,n,h),o=this.getFocus();o&&o.callEvent&&(!1===o.callEvent("onKeyPress",[i,t])&&Q(t),o.hasEvent("onTimedKeyPress")&&(clearTimeout(o.Fi),o.Fi=$(this.Ii,o,[],o.Z.keyPressTimeout||250))),this.Ai(i)||(r=this.Ti(String.fromCharCode(i),s,e,n,h));var a=!s&&!n&&!h&&9!=i&&27!=i&&13!=i;if(!1===this.zi(r,a,t))return Q(t),!1},$i:function(t,i){var s=i||this.getFocus();if(s){t=t||"getNext";for(var e=s,n=z();;){if((s=this[t](s))&&this.canFocus(s))return this.setFocus(s);if(s===e||s.$fmarker==n)return i&&document.activeElement.blur(),null;s.$fmarker=n}}},Vi:function(t,i){var s=!i.shiftKey;if(Ii.di=new Date,t&&t.Bi&&!t.Bi(s,i))return!1;if(t&&t.Hi){if(t.editNext)return t.editNext(s);if(t.editStop)return t.editStop(),!0}else $(function(){if((t=Pt(document.activeElement))&&!Ii.canFocus(t))return Ii.$i(s?"getNext":"getPrev",t);Ii.setFocus(t,!0,!0)})},getTop:function(t){for(var i,s=Pt(t);s&&(i=s.getParentView());)s=i;return s},getNext:function(t,i){var s=t.getChildViews();if(s.length&&!i)for(var e=0;e<s.length;e++)if(this.canFocus(s[e]))return s[e];var n=t.getParentView();if(!n)return t;var h=n.getChildViews();if(h.length)for(var r=x.find.call(h,t)+1;r<h.length;){if(this.canFocus(h[r]))return h[r];r++}return this.getNext(n,!0)},getPrev:function(t,i){var s=t.getChildViews();if(s.length&&i)for(var e=s.length-1;0<=e;e--)if(this.canFocus(s[e]))return this.getPrev(s[e],!0);if(i&&this.canFocus(t))return t;var n=t.getParentView();if(!n)return this.canFocus(t)?this.getPrev(t,!0):t;var h=n.getChildViews();if(h)for(var r=x.find.call(h,t)-1;0<=r;){if(this.canFocus(h[r]))return this.getPrev(h[r],!0);r--}return this.getPrev(n,!0)},addHotKey:function(t,i,s){var e=this.Ri(t);e.letter,s||(s=null),e.handler=i,e.view=s;var n=this.Ti(e.letter,e.ctrl,e.shift,e.alt,e.meta);return this.li[n]||(this.li[n]=[]),this.li[n].push(e),t},removeHotKey:function(t,i,s){var e=this.Ri(t),n=this.Ti(e.letter,e.ctrl,e.shift,e.alt,e.meta);if(i||s){var h=this.li[n];if(h){for(var r=h.length-1;0<=r;r--)s&&h[r].view!==s||i&&h[r].handler!==i||h.splice(r,1);h.length||delete this.li[n]}}else delete this.li[n]},Ti:function(t,i,s,e,n){return t+"_"+["",i?"1":"0",s?"1":"0",e?"1":"0",n?"1":"0"].join("")},zi:function(t,i,s){var e=this.getFocus();return this.li[t]?this.Pi(this.li[t],e,s):!i||!this.li.ANY_0000||this.Pi(this.li.ANY_0000,e,s)},Pi:function(t,i,s){for(var e=0;e<t.length;e++){var n=t[e];if(null===n.view||i===n.view||"string"==typeof n.view&&i&&i.name===n.view){var h=n.handler(i,s);if(!!h===h)return h}}return!0},Ri:function(t){var i,s,e,n,
  h=this._i,r=t.toLowerCase().split(/[+\-_]/);i=s=e=n=0;for(var o="",a=0;a<r.length;a++)if("ctrl"===r[a])i=1;else if("shift"===r[a])s=1;else if("alt"===r[a])e=1;else if("command"===r[a])n=1;else if(h[r[a]]){var u=h[r[a]];o=this.Ai(u)?u.toString():String.fromCharCode(u)}else o=r[a];return{letter:o.toUpperCase(),ctrl:i,shift:s,alt:e,meta:n,debug:t}},getState:function(t,i){i=i||!1;var s={id:(t=Pt(t)).config.id,width:t.config.width,height:t.config.height,gravity:t.config.gravity};if(j(t.config.collapsed)||(s.collapsed=t.config.collapsed),"tabs"!==t.name&&"tabbar"!==t.name||(s.activeCell=t.getValue()),i&&(s=[s],t.ji))for(var e=0;e<t.ji.length;e++)s=s.concat(this.getState(t.ji[e],i));return s},setState:function(t){g(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i],e=Pt(s.id);e&&(j(s.collapsed)||e.define("collapsed",s.collapsed),j(s.activeCell)||e.setValue(s.activeCell),e.define("width",s.width),e.define("height",s.height),e.define("gravity",s.gravity))}var n=Pt(t[0].id);n&&n.resize()}};Mi(function(){Ii.mi(),Ii.addHotKey("enter",function(t,i){if(t&&t.callEvent&&t.callEvent("onEnter",[i]),t&&t.editStop&&t.Hi)return t.editStop(),!0;if(t&&t.touchable){var s=t.getFormView();s&&!t.Ei&&s.callEvent("onSubmit",[t,i])}}),Ii.addHotKey("esc",function(t){if(t){if(t.editCancel&&t.Hi)return t.editCancel(),!0;var i=t.getTopParentView();i&&i.setPosition&&i.Ni()}}),Ii.addHotKey("shift+tab",Ii.Vi),Ii.addHotKey("tab",Ii.Vi)}),u("UIManager",Ii);var Ai={$init:function(){this.Z=this.config={}},define:function(t,i){return"object"==k(t)?this.Li(t):this.Oi(t,i)},Oi:function(t,i){var s=this[t+"_setter"];return this.Z[t]=s?s.call(this,i,t):i},Li:function(t){if(t)for(var i in t)this.Oi(i,t[i])},ot:function(t,i){var s={};i&&(s=P.extend(s,i)),"object"!=k(t)||t.tagName||P.extend(s,t,!0),this.Li(s)},Ui:function(t,i){for(var s in i)switch(k(t[s])){case"object":t[s]=this.Ui(t[s]||{},i[s]);break;case"undefined":t[s]=i[s]}return t}},Ti={$init:function(){var t=this.nt={obj:this};M.destructors.push(t)},destructor:function(){var t=this.Z;if(this.Yi&&this.editCancel(),this.callEvent&&this.callEvent("onDestruct",[]),this.destructor=function(){},this.nt.obj=null,this.getChildViews){var i=this.getChildViews();if(i)for(var s=0;s<i.length;s++)i[s].destructor();if(this.ht)for(var e=0;e<this.ht.length;e++)this.ht[e].destructor()}if(delete zt.views[t.id],t.$id){var n=this.getTopParentView();n&&n.Wi&&n.Wi(t.$id)}this.Gi=null,this.Xi=null,this.Ji=null,this.Zi&&(this.Zi.innerHTML="",this.Zi.Gi=null),this.et&&this.et.parentNode&&this.et.parentNode.removeChild(this.et),this.data&&this.data.destructor&&this.data.destructor(),this.unbind&&this.unbind(),this.data=null,this.et=this.$view=this.Zi=this.mt=null,this.V=this.B={},Ii.rt==this&&(Ii.rt=null);var h=t.url;h&&h.$proxy&&h.release&&h.release(),this.$scope=null,this.$destructed=!0}};Lt(window,"unload",function(){A("unload",[]),M.k=!0;for(var t=0;t<M.destructors.length;t++){var i=M.destructors[t].obj;i&&i.destructor()}M.destructors=[],M.qi=p(),Et()});var Fi={$init:function(){this.Ki=null,this.attachEvent("onSelectChange",function(){var t=this.getSelectedId();this.setCursor(t?t.id||t:null)}),this.attachEvent("onAfterCursorChange",this.Qi),this.attachEvent("onAfterDelete",function(t){t==this.getCursor()&&this.setCursor(null)}),this.data.attachEvent("onStoreUpdated",C(function(t,i,s){t&&t==this.getCursor()&&"paint"!=s&&"delete"!=s&&this.Qi()},this)),this.data.attachEvent("onClearAll",C(function(){this.Ki=null},this)),this.data.attachEvent("onIdChange",C(function(t,i){this.Ki==t&&(this.Ki=i,this.Qi())},this))},refreshCursor:function(){this.Ki&&this.callEvent("onAfterCursorChange",[this.Ki])},setCursor:function(t){t==this.Ki||null!==t&&!this.getItem(t)||(this.callEvent("onBeforeCursorChange",[this.Ki]),this.Ki=t,this.callEvent("onAfterCursorChange",[t]))},getCursor:function(){return this.Ki},ts:function(t,i,s){if("$level"==i&&this.data.getBranch)return(t.data||t).importData(this.data.getBranch(this.getCursor()));var e=this.getItem(this.getCursor())||this.Z.defaultData||null;"$data"==i?("function"==typeof s?s.call(t,e,this
  ):t.data.importData(e?e[s]:[]),t.callEvent("onBindApply",[e,i,this])):(s&&(e=s(e)),this.ss(t,i,e))}},zi={$init:function(){this.attachEvent("onChange",this.Qi)},ts:function(t,i,s){i=i||"value";var e=this.getValue()||"";if(s&&(e=s(e)),t.setValue)t.setValue(e);else if(t.filter)t.data.silent(function(){this.filter(i,e)});else{var n={};n[i]=e,t.Nt(e)&&t.setValues(n)}t.callEvent("onBindApply",[e,i,this])}},Vi={$init:function(){this.attachEvent("onChange",this.Qi)},ts:function(t,i,s){var e=this.getValues()||null;s&&(e=s(e)),this.ss(t,i,e)}},Bi={$init:function(){this.es={},this.ns={},this.hs={},this.rs(this)},saveBatch:function(t){this.os=!0,t.call(this),this.os=!1,this.Qi()},setBindData:function(t,i){if(i&&(this.hs[i]=!0),this.setValue)this.setValue(t);else if(this.setValues)this.setValues(t);else{var s=this.getCursor();s?this.updateItem(s,t):this.add(t)}this.callEvent("onBindUpdate",[t,i]),this.save&&this.save(),i&&(this.hs[i]=!1)},getBindData:function(t,i){if(this.ns[t])return!1;var s=Pt(t);s.isVisible(s.Z.id)&&(this.ns[t]=!0,this.ts(s,this.es[t][0],this.es[t][1]),i&&s.filter&&s.refresh())},addBind:function(t,i,s){this.es[t]=[i,s]},removeBind:function(t){delete this.es[t],delete this.ns[t],delete this.hs[t]},rs:function(t){t.filter?P.extend(this,Fi):t.setValue?P.extend(this,zi):P.extend(this,Vi)},Qi:function(){if(!this.os)for(var t in this.es)this.hs[t]||(this.ns[t]=!1,this.getBindData(t,!0))},ss:function(t,i,s){t.setValue?t.setValue(s&&i?s[i]:s):t.filter?t.data.silent(function(){this.filter(i,s)}):!s&&t.clear?t.clear():t.Nt(s)&&t.setValues(f(s)),t.callEvent("onBindApply",[s,i,this])}},Hi={bind:function(t,i,s){this.attachEvent||P.extend(this,w),"string"==typeof t&&(t=Pt(t)),t.us&&t.us(),this.us&&this.us(),t.getBindData||P.extend(t,Bi),this.cs(),t.addBind(this.Z.id,i,s),this.fs=t.Z.id,this.ls=this.Z.id,this.ds=this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return t.getBindData(this.ls)}),this.refresh&&this.isVisible(this.ls)&&this.refresh()},unbind:function(){if(this.fs){var t=Pt(this.fs);t&&t.removeBind(this.ls),this.detachEvent(this.ds),this.fs=this.ds=null}},cs:function(){var t=this.Z;if(this.filter){var i=t.id;this.data.vs=C(function(){Pt(this.fs).ns[i]=!1},this)}var s=this.render;this.render=function(){if(!this._s){this._s=!0;var t=this.callEvent("onBindRequest");return this._s=!1,s.apply(this,!1===t?arguments:[])}},(this.getValue||this.getValues)&&(this.save=function(t){var i=Pt(this.fs);if(t)i.setBindData(t);else{if(this.validate&&!this.validate())return!1;var s=this.getValue?this.getValue:this.getValues();i.setBindData(s,this.Z.id),this.setDirty&&this.setDirty(!1)}}),this.cs=function(){}}},Ri=window.webix_view||{},Pi={name:"baseview",$init:function(t){t.id||(t.id=pi(this.name)),this._=M._,M._=null,this.$scope=t.$scope||(this._?this._.$scope:M.i),this.et||(this.Zi=this.et=Y("DIV",{"class":"webix_view"}),this.$view=this.et)},$skin:!1,defaults:{width:0,height:0,gravity:1},getNode:function(){return this.et},getParentView:function(){return this._||null},getTopParentView:function(){var t=this.getParentView();return t?t.getTopParentView():this},getFormView:function(){var t=this.getParentView();return!t||t.ps?t:t.getFormView()},getChildViews:function(){return[]},queryView:function(e,t){var i;if("string"==typeof e&&(e={view:e}),i="object"===k(e)?function(t){var i=t.config;for(var s in e)if(i[s]!=e[s])return!1;return!0}:e,"self"===t&&i(this))return this;var s="all"===t&&[],n="parent"===t?this.ms:this.bs,h=this.gs(i,n,s);return"all"===t?s:h},bs:function(t){return t.getChildViews()},ms:function(t){var i=t.getParentView();return i?[i]:[]},gs:function(t,i,s){for(var e=i(this),n=0;n<e.length;n++){if(t(e[n])){if(!s)return e[n];s.push(e[n])}var h=e[n].gs(t,i,s);if(h&&!s)return h}return null},isVisible:function(t){if(this.Z.hidden)return t&&(this.ws||(this.ws=[],this.xs={}),this.xs[t]||(this.xs[t]=!0,this.ws.push(t))),!1;var i=this.getParentView();return!i||i.isVisible(t,this.Z.id)},isEnabled:function(){if(this.ys)return!1;var t=this.getParentView();return!t||t.isEnabled()},disable:function(){G(this.ys),
  this.Z.disabled=!0,this.ys=Y("div",{"class":"webix_disabled"}),this.et.appendChild(this.ys),this.et.setAttribute("aria-disabled","true"),st(this.et,"webix_disabled_view",!0),Ii.ki(this)},enable:function(){this.Z.disabled=!1,this.ys&&(G(this.ys),et(this.et,"webix_disabled_view"),this.et.removeAttribute("aria-disabled"),this.ys=null)},disabled_setter:function(t){return t?this.disable():this.enable(),t},container_setter:function(t){return D(t),!0},css_setter:function(t){return"object"==k(t)&&(t=L(t)),this.et.className+=" "+t,t},id_setter:function(t){if(M.n&&(M.n!=this||this.Ms)){var i=this.config.$id=t;t=pi(((this.Ms||M.n).Ss[t]=this).name),(this.Ms||M.n).ks[t]=i}return zt.views[t],(zt.views[t]=this).et.setAttribute("view_id",t),t},$setSize:function(t,i){var s=this.Cs;return(!s||s[0]!=t||s[1]!=i)&&(this.Cs=[t,i],this.$width=this.$s=t-(this.Ds?S.scrollSize:0),this.$height=this.Is=i-(this.As?S.scrollSize:0),this.Z.flex||(this.et.style.width=t+"px",this.et.style.height=i+"px"),!0)},$getSize:function(t,i){var s=this.Z,e=[1*(s.width||s.minWidth||0),1*(s.width||s.maxWidth||1e5),1*(s.height||s.minHeight||0),1*(s.height||s.maxHeight||1e5),s.gravity];return(isNaN(e[0])||isNaN(e[1])||isNaN(e[2])||isNaN(e[3]))&&(this.Z.id,s.width=s.height=s.maxWidth=s.maxHeight=s.minWidth=s.minHeight=0,e=[0,0,1e5,1e5,1]),e[0]+=t,e[1]+=t,e[2]+=i,e[3]+=i,e},show:function(t,i){var s=this.getParentView(),e=!arguments[2];s?(!i&&!1!==i&&this.Z.animate&&s.Z.animate&&(i=P.extend(s.Z.animate?P.extend({},s.Z.animate):{},this.Z.animate,!0)),(e?s.Ts:s.Ni)&&(e?s.Ts:s.Ni).call(s,this,i),e&&this.Fs(),t&&e&&s.show(!s.$$&&t)):this.Z.hidden?e&&(D(this.Z.tt||document.body).appendChild(this.et),this.Z.hidden=!1,this.adjust(),this.Fs()):e||(this.Z.hidden=this.Z.Q=!0,this.et&&(this.Z.tt=this.et.parentNode,G(this.et)))},Fs:function(){if(this.ws){for(var t=0;t<this.ws.length;t++){var i=Pt(this.ws[t]);i&&i.render()}this.ws=[],this.xs={}}},zs:function(t,i){var s=i.srcElement||i.target,e=s.getAttribute("role");13!==t&&32!==t||"button"!=e&&"tab"!=e||this.Z.disabled||(it(s,"MouseEvents","click"),Q(i))},hidden_setter:function(t){return t&&this.hide(),this.Z.hidden},hide:function(){this.show(null,null,!0),Ii.ki(this)},adjust:function(){if(!this.et.parentNode)return!1;var t=this.et.parentNode.clientWidth||0,i=this.et.parentNode.clientHeight||0,s=this.$getSize(0,0),e=this.et.parentNode==document.body&&!this.setPosition;s[0]>t&&(t=s[0]),s[2]>i&&(i=s[2]),(!e||this.Z.width)&&t>s[1]&&(t=s[1]),(!e||this.Z.height)&&i>s[3]&&(i=s[3]),this.$setSize(t,i),M.o&&(M.o=!1,this.adjust())},resize:function(){if(!(M.h||M.l||M.u)){var t=this.getParentView();t?t.resizeChildren?t.resizeChildren():t.resize():(this.adjust(),A("onResize",[]))}}},ji={api:Pi,view:P.protoUI(Pi,Ai,Ti,Hi,Ri)},Ei={name:"view",$init:function(t){this.Vs(t)},Vs:function(t){var i=j(t.borderless);i&&!this.setPosition&&t.$topView&&(i=!(t.borderless=!0)),i&&this.defaults.borderless||t.borderless?t.K={top:!0,left:!0,bottom:!0,right:!0}:(t.K||(t.K={}),this.Zi.style.borderWidth="1px")},$getSize:function(t,i){var s=this.Z.K;return s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1)),ji.api.$getSize.call(this,t,i)},$setSize:function(t,i){var s=this.Z.K;return s&&(t-=(s.left?0:1)+(s.right?0:1),i-=(s.top?0:1)+(s.bottom?0:1)),ji.api.$setSize.call(this,t,i)}},Ni=P.protoUI(Ei,ji.view),Li={api:Ei,view:Ni};Ni.call(-1);var Oi=P.proto({template_setter:function(t){this.type.template=At(t)},Ot:function(t){var i=this.type;return(i.templateStart?i.templateStart(t,i):"")+i.template(t,i)+(i.templateEnd?i.templateEnd(t,i):"")},customize:function(t){Tt(this,t)}},di),Ui={name:"tooltip",defaults:{dy:0,dx:20},$init:function(t){"string"==typeof t&&(t={template:t}),this.$view=this.et=this.Zi=this.mt=Y("DIV",{role:"alert","aria-atomic":"true"}),this.Zi.className="webix_tooltip",X(this.Zi,document.body.firstChild,document.body)},adjust:function(){},isVisible:function(){return this.Bs},Hs:function(t){this.callEvent("onBeforeRender",[t])&&(this.mt.innerHTML="",this.mt.innerHTML=t,this.callEvent("onAfterRender",[]))},css_setter:function(t){
  return"object"===k(t)&&(t=L(t)),this.et.className="webix_tooltip "+t,t},show:function(t,i){if(!this.Rs)if(this.Bs=!0,"string"==typeof t?this.Hs(t):(this.data=P.extend({},t),this.render()),this.mt.firstChild){var s=Math.max(document.documentElement.clientWidth,window.innerWidth||0),e=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=s-i.x,h=e-i.y;this.Zi.style.display="block",n-this.Z.dx>this.Zi.offsetWidth?n=i.x:(n=i.x-2*this.Z.dx-this.Zi.offsetWidth)<0&&(n=0),h-this.Z.dy>this.Zi.offsetHeight?h=i.y:(h=i.y-2*this.Z.dy-this.Zi.offsetHeight)<0&&(h=0),this.Zi.style.left=n+this.Z.dx+"px",this.Zi.style.top=h+this.Z.dy+"px"}else this.hide()},hide:function(){this.Bs&&(this.data=null,this.Zi.style.display="none",this.Bs=!1)},disable:function(){this.Rs=!0},enable:function(){this.Rs=!1},type:{template:At("{obj.value}"),templateStart:At.empty,templateEnd:At.empty}},Yi=(P.protoUI(Ui,Oi,Ai,w,Li.view),{tooltip_setter:function(t){if(t)return"function"!=typeof t&&"string"!=typeof t||(t={template:t}),"object"!==k(t)&&(t={}),this.Ps(),t},Ps:function(){_i.addTooltip(this),this.attachEvent("onDestruct",function(){_i.removeTooltip(this)}),this.attachEvent("onAfterScroll",function(){_i.ti&&_i.hi()}),this.Ps=function(){}},$tooltipIn:function(t){var i=_i.ii,s=P.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.Z.tooltip,!0);return i.define(s),t},$tooltipOut:function(){return _i.hi(),null},$tooltipMove:function(t,i,s){_i.ii.hide(),clearTimeout(_i.ci),_i.ci=$(this.js,this,[t,i,s],_i.delay)},js:function(t,i,s){var e=s||this.Es(t,i);e&&this.isVisible()&&_i.ii.show(e,K(i))},Es:function(t,i){if(this.locate&&this.getItem){var s=this.locate(i);return s?this.getItem(s):null}return this.Z}}),Wi=P.proto({$init:function(t){this.Ns=[],this.Ls=j(t.series)?t.name:t.series,this.Os=D(t.container||t);var i=t.width*(window.devicePixelRatio||1),s=t.height*(window.devicePixelRatio||1),e=t.style||"";e+=";width:"+t.width+"px;height:"+t.height+"px;",this.Us(t.name,e,i,s,t.title)},Us:function(t,i,s,e,n){return this.Ys=Y("canvas",{title:n,width:s,height:e,canvas_id:t,style:i||""}),this.Os.appendChild(this.Ys),this.Ys.getContext||(S.isIE?(ei("legacy/excanvas/excanvas.js",!0),G_vmlCanvasManager.init_(document),G_vmlCanvasManager.initElement(this.Ys)):this.Ys.getContext),this.Ys},getCanvas:function(t){var i=(this.Ys||this.Us(this.Zi)).getContext(t||"2d");return this.Ws||(this.Ws=!0,i.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)),i},Gs:function(t,i){this.Ys&&(this.Ys.setAttribute("width",t*(window.devicePixelRatio||1)),this.Ys.setAttribute("height",i*(window.devicePixelRatio||1)),this.Ys.style.width=t+"px",this.Ys.style.height=i+"px",this.Ws=!1)},renderText:function(t,i,s,e,n){if(s){n&&(n=Math.max(n,0)),i&&(i=Math.max(i,0));var h=Y("DIV",{"class":"webix_canvas_text"+(e?" "+e:""),style:"left:"+t+"px; top:"+i+"px;","aria-hidden":"true"},s);return this.Os.appendChild(h),this.Ns.push(h),n&&(h.style.width=n+"px"),h}},renderTextAt:function(t,i,s,e,n,h,r){var o=this.renderText.call(this,s,e,n,h,r);return o&&(t&&(o.style.top="middle"==t?parseInt(e-o.offsetHeight/2,10)+"px":e-o.offsetHeight+"px"),i&&(o.style.left="left"==i?s-o.offsetWidth+"px":parseInt(s-o.offsetWidth/2,10)+"px")),o},clearCanvas:function(t){var i=[];if(G(this.Ns),this.Ns=[],!t&&this.Os.Gi){for(i=this.Xs();i.length;)i[0].parentNode.removeChild(i[0]),i.splice(0,1);i=null,this.Os.Gi.getElementsByTagName("AREA").length||(this.Os.Gi.parentNode.removeChild(this.Os.Gi),this.Os.Gi=null)}this.getCanvas().clearRect(0,0,this.Ys.offsetWidth||Math.floor(this.Ys.width/(window.devicePixelRatio||1)),this.Ys.offsetHeight||Math.floor(this.Ys.height/(window.devicePixelRatio||1)))},toggleCanvas:function(){this.Js("none"==this.Ys.style.display)},showCanvas:function(){this.Js(!0)},hideCanvas:function(){this.Js(!1)},Js:function(t){var i,s;for(s=0;s<this.Ns.length;s++)this.Ns[s].style.display=t?"":"none";if(this.Os.Gi)for(i=this.Xs(),s=0;s<i.length;s++)t?i[s].removeAttribute("disabled"):i[s].setAttribute("disabled","true");this.Ys.style.display=t?"":"none"},Xs:function(){var t,i,s=[];for(
  t=this.Os.Gi.getElementsByTagName("AREA"),i=0;i<t.length;i++)t[i].getAttribute("userdata")==this.Ls&&s.push(t[i]);return s}}),Gi=function(t,i){var s=i;if(g(t))for(var e=0;e<t.length;e++){if(g(i)&&(s=i[e]),"slide"==s.type){if("out"==s.subtype&&0===e)continue;if("in"==s.subtype&&1==e)continue}if("flip"!=s.type)Gi(t[e],s);else{var n=f(s);0===e&&(n.type="flipback"),1==e&&(n.callback=null),Gi(t[e],n)}}else{var h=D(t);h.Zs?Gi.end(h,s):Gi.start(h,s)}};Gi.end=function(t,i){t.style[S.transitionDuration]="1ms",t.Zs=null,M.T&&window.clearTimeout(M.T),M.T=$(Gi,this,[t,i],10)},Gi.isSupported=function(){return!M.noanimate&&S.transform&&S.transition&&!S.isOpera},Gi.formLine=function(t,i,s){var e=s.direction;i.parentNode&&(i.parentNode.style.position="relative"),i.style.position="absolute",t.style.position="absolute";var n=S.isFF?"top"==e||"left"==e?-1:1:0;return"top"==e||"bottom"==e?(t.style.left="0px",t.style.top=(s.top||n)+("top"==e?1:-1)*i.offsetHeight+"px"):(t.style.top=(s.top||0)+"px",t.style.left=n+("left"==e?1:-1)*i.offsetWidth+"px"),i.parentNode==t.parentNode&&s.keepViews?t.style.display="":X(t,i.nextSibling,i.parentNode),"slide"==s.type&&"out"==s.subtype&&(t.style.left="0px",t.style.top=(s.top||0)+"px",i.parentNode.removeChild(i),X(i,t.nextSibling,t.parentNode)),[t,i]},Gi.breakLine=function(t){arguments[1]?t[1].style.display="none":G(t[1]),Gi.clear(t[0]),Gi.clear(t[1]),t[0].style.position=""},Gi.clear=function(t){t.style[S.transform]="none",t.style[S.transition]="none",t.style.top=t.style.left=""},Gi.defaults={type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0},Gi.start=function(e,t){"string"==typeof t&&(t={type:t}),t=Ai.Ui(t,Gi.defaults);var i,s,n=S.cssPrefix,h=e.Zs=t;switch("slide"==h.type&&h.direction){case"right":h.x=e.offsetWidth;break;case"left":h.x=-e.offsetWidth;break;case"top":h.y=-e.offsetHeight;break;case"bottom":default:h.y=h.y||e.offsetHeight}"flip"!=h.type&&"flipback"!=h.type||(i=[0,0],s="scaleX","vertical"==h.subtype?(i[0]=20,s="scaleY"):i[1]=20,"right"!=h.direction&&"bottom"!=h.direction||(i[0]*=-1,i[1]*=-1));var r=h.duration+"ms "+h.timing+" "+h.delay+"ms",o=n+"TransformStyle: preserve-3d;",a="",u="";switch(h.type){case"fade":a="opacity "+r,o="opacity: 0;";break;case"show":a="opacity "+r,o="opacity: 1;";break;case"flip":r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",u="skew("+i[0]+"deg, "+i[1]+"deg) "+s+"(0.00001)",a="all "+r;break;case"flipback":h.delay+=h.duration/2,r=h.duration/2+"ms "+h.timing+" "+h.delay+"ms",e.style[S.transform]="skew("+-1*i[0]+"deg, "+-1*i[1]+"deg) "+s+"(0.00001)",e.style.left="0",u="skew(0deg, 0deg) "+s+"(1)",a="all "+r;break;case"slide":var c=h.x+"px",f=h.y+"px";u=S.translate+"("+c+", "+f+("translate3d"==S.translate?", 0":"")+")",a=n+"transform "+r}$(function(){e.style[S.transition]=a,$(function(){o&&(e.style.cssText+=o),u&&(e.style[S.transform]=u);var i=!1,s=Lt(e,S.transitionEnd,function(t){e.Zs=null,h.callback&&h.callback.call(h.master||window,e,h,t),i=!0,Ot(s)});window.setTimeout(function(){if(!i){var t=h.master||window;e.Zs=null,!t.$destructed&&h.callback&&h.callback.call(t,e,h),i=!0,Ot(s)}},1.3*(1*h.duration+1*h.delay))})})};var Xi,Ji;function Zi(t){if(qi[t],Ji!==t)for(var i in qi.$active=Xi=qi[t],qi.$name=Ji=t,zt){var s=zt[i];s&&s.prototype&&s.prototype.$skin&&s.prototype.$skin(s.prototype)}}var qi={set:Zi,material:{topLayout:"space",barHeight:44,tabbarHeight:42,sidebarTitleHeight:44,rowHeight:36,toolbarHeight:44,listItemHeight:36,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:36,labelTopHeight:22,propertyItemHeight:28,unitHeaderHeight:36,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:2},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:2,form:17,accordion:0},tabMargin:0,tabOffset:0,tabBottomOffset:0,tabTopOffset:0,tabBorder:!0,customCheckbox:!0,customRadio:!0,sidebarMarkAll:!0,popupNoPoint:!0,borderlessPopup:!0,popupPadding:0,dataPadding:12,calendar:{
  timepickerHeight:24},calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:32,organogramLineColor:"#CCD7E6"},mini:{topLayout:"space",barHeight:36,tabbarHeight:34,sidebarTitleHeight:36,rowHeight:28,toolbarHeight:36,listItemHeight:28,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,propertyItemHeight:24,unitHeaderHeight:28,inputSpacing:4,borderWidth:1,sliderHandleWidth:12,sliderPadding:10,sliderBorder:1,vSliderPadding:13,vSliderHeight:100,switchHeight:20,switchWidth:40,layoutMargin:{space:5,wide:5,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:2},layoutPadding:{space:5,wide:0,clean:0,head:0,line:0,toolbar:2,form:12,accordion:0},tabMargin:0,tabOffset:0,tabBottomOffset:0,tabTopOffset:0,tabBorder:!0,customCheckbox:!0,customRadio:!0,sidebarMarkAll:!0,popupNoPoint:!0,borderlessPopup:!0,popupPadding:0,dataPadding:12,calendar:{timepickerHeight:24},calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:24,organogramLineColor:"#CCD7E6"},flat:{topLayout:"space",barHeight:46,tabbarHeight:46,rowHeight:34,toolbarHeight:46,sidebarTitleHeight:45,listItemHeight:34,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:34,labelTopHeight:22,unitHeaderHeight:20,propertyItemHeight:28,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:4,form:8,accordion:10},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:3,form:17,accordion:0},tabMargin:4,tabOffset:0,tabBottomOffset:6,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,dataPadding:10,calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:32},compact:{topLayout:"space",barHeight:34,tabbarHeight:34,sidebarTitleHeight:34,rowHeight:24,toolbarHeight:34,listItemHeight:28,unitHeaderHeight:20,propertyItemHeight:24,inputHeight:30,buttonHeight:30,inputPadding:3,menuHeight:28,labelTopHeight:16,inputSpacing:4,borderWidth:1,sliderHandleWidth:12,sliderPadding:10,sliderBorder:1,vSliderPadding:13,vSliderHeight:100,switchHeight:20,switchWidth:40,layoutMargin:{space:5,wide:5,clean:0,head:4,line:-1,toolbar:4,form:4,accordion:5},layoutPadding:{space:5,wide:0,clean:0,head:0,line:0,toolbar:1,form:12,accordion:0},tabMargin:3,tabOffset:0,tabBottomOffset:3,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,dataPadding:10,calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:23},contrast:{topLayout:"space",barHeight:46,tabbarHeight:46,rowHeight:34,toolbarHeight:46,sidebarTitleHeight:45,listItemHeight:34,unitHeaderHeight:20,inputHeight:38,buttonHeight:38,inputPadding:3,menuHeight:34,labelTopHeight:22,propertyItemHeight:28,inputSpacing:4,borderWidth:1,sliderHandleWidth:14,sliderPadding:10,sliderBorder:1,vSliderPadding:15,vSliderHeight:100,switchHeight:22,switchWidth:50,layoutMargin:{space:10,wide:10,clean:0,head:4,line:-1,toolbar:8,form:8,accordion:10},layoutPadding:{space:10,wide:0,clean:0,head:0,line:0,toolbar:3,form:17,accordion:0},tabMargin:4,tabOffset:0,tabBottomOffset:6,tabTopOffset:1,customCheckbox:!0,customRadio:!0,popupPadding:8,dataPadding:10,calendarHeight:70,padding:0,accordionType:"accordion",optionHeight:32}};Zi(window.webix_skin||"material");var Ki={config:{longTouchDelay:1e3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500,ellastic:!0,fastClick:!0},limit:function(t){Ki.qs=!1!==t},disable:function(){Ki.Rs=!0},enable:function(){Ki.Rs=!1},$init:function(){Ki.$init=function(){},Lt(document.body,ts.down,Ki.Ks,{passive:!1}),Lt(document.body,ts.move,Ki.Qs,{passive:!1}),Lt(document.body,ts.up,Ki.te),Lt(document.body,"dragstart",function(t){if(!Ki.Rs&&!Ki.qs)return Q(t)}),Lt(document.body,"touchstart",function(t){if(!Ki.Rs&&!Ki.qs&&Ki.config.fastClick&&S.isSafari){var i=t.srcElement.tagName.toLowerCase();return"input"==i||"textarea"==i||"select"==i||"label"==i||(Ki.ie=!0,Q(t))}},{passive:!1}),Ki.se(),Ki.ee=[null,null],Ki.$active=!0},se:function(){Ki.ne=Ki.he=Ki.re=Ki.oe=null,Ki.ae=Ki.ue=Ki.ce=this.fe=null,Ki.le={de:0,ve:0,
  _e:0},Ki.pe&&(et(Ki.pe,"webix_touch"),Ki.pe=null),window.clearTimeout(Ki.me),Ki.be=!0,Ki.ge=!0,Ki.we=!0,Ki.xe||Ki.ye()},te:function(t){if(Ki.ne){if(Ki.ae){var i=Ki.Me(Ki.ue),s=i.e,e=i.f,n=Ki.config.finish,h=Ki.Se(t,!0),r=Pt(Ki.ue),o=r&&r.$scroll?r.$scroll.gravity:Ki.config.gravity;if(h._e){var a=s+o*h.de/h._e,u=e+o*h.ve/h._e,c=Ki.ee[0]?Ki.ke(a,!1,!1,Ki.ce.dx,Ki.ce.px):s,f=Ki.ee[1]?Ki.ke(u,!1,!1,Ki.ce.dy,Ki.ce.py):e,l=Math.max(Math.abs(c-s),Math.abs(f-e));l<150&&(n=n*l/150),c==s&&f==e||(n=Math.round(n*Math.max((c-s)/(a-s),(f-e)/(u-e))));var d={e:c,f:f};(r=Pt(Ki.ue))&&r.adjustScroll&&r.adjustScroll(d),n=Math.max(100,n),s!=d.e||e!=d.f?(Ki.Ce(Ki.ue,d.e,d.f,n+"ms"),Ki.$e&&Ki.$e.De(d.e,d.f,n+"ms"),Ki.Ie(d.e,d.f,n+"ms")):Ki.ye()}else Ki.ye()}else if(!this.fe)if(Ki.we&&!Ki.ge)Ki.Ae("onSwipeX");else if(Ki.ge&&!Ki.we)Ki.Ae("onSwipeY");else if(S.isSafari&&Ki.ie){Ki.ie=!1;var v=Ki.ne.target;$(function(){var t=document.createEvent("MouseEvents");t.initEvent("click",!0,!0),v.dispatchEvent(t)})}Ki.Ae("onTouchEnd"),Ki.se()}},Qs:function(t){if(Ki.oe&&Ki.ne){var i=Ki.Se(t);if(Ki.Ae("onTouchMove"),Ki.ae)Ki.Te(i);else if(Ki.ge=Ki.Fe(i.ze,"x",Ki.ge),Ki.we=Ki.Fe(i.Ve,"y",Ki.we),Ki.ae){var s=Ki.Be("onBeforeScroll",!0);if(s){var e={};s.callEvent("onBeforeScroll",[e]),e.update&&(Ki.config.speed=e.speed,Ki.config.scale=e.scale)}Ki.He(i)}return Q(t)}},Te:function(){if(Ki.ue){var t=Ki.Me(Ki.ue),i=Ki.re||Ki.ne,s=Pt(Ki.ue),e=s&&s.$scroll?s.$scroll.ellastic:Ki.config.ellastic;Ki.ee[0]&&(t.e=Ki.ke(t.e-i.x+Ki.he.x,e,t.e,Ki.ce.dx,Ki.ce.px)),Ki.ee[1]&&(t.f=Ki.ke(t.f-i.y+Ki.he.y,e,t.f,Ki.ce.dy,Ki.ce.py)),Ki.Ce(Ki.ue,t.e,t.f,"0ms"),Ki.$e&&Ki.$e.De(t.e,t.f,"0ms"),Ki.Ie(t.e,t.f,"0ms")}},Ie:function(t,i,s){var e=Ki.ce.px/Ki.ce.dx*-t,n=Ki.ce.py/Ki.ce.dy*-i;Ki.ee[0]&&Ki.Ce(Ki.ee[0],e,0,s),Ki.ee[1]&&Ki.Ce(Ki.ee[1],0,n,s)},scrollTo:function(t,i,s,e){Ki.Ce(t,i,s,e)},Ce:function(t,i,s,e){if(!Ki.Re&&window.setAnimationFrame&&window.setAnimationFrame(function(){return Ki.Re=!0,Ki.Ce(t,i,s,e)}),Ki.Re=null,Ki.xe=!0,t){var n=Ki.config.translate||S.translate;t.style[S.transform]=n+"("+Math.round(i)+"px, "+Math.round(s)+"px"+("translate3d"==n?", 0":"")+")",t.style[S.transitionDuration]=e}},Me:function(t){var i,s=window.getComputedStyle(t)[S.transform];if("none"==s)i={e:0,f:0};else if(window.WebKitCSSMatrix)i=new WebKitCSSMatrix(s);else if(window.MSCSSMatrix)i=new MSCSSMatrix(s);else{var e=s.replace(/(matrix\()(.*)(\))/gi,"$2");e=(e=e.replace(/\s/gi,"")).split(","),i={};for(var n=["a","b","c","d","e","f"],h=0;h<n.length;h++)i[n[h]]=parseInt(e[h],10)}return Ki.$e&&Ki.$e.Pe(i),i},ke:function(t,i,s,e,n){if(t===s)return t;var h=Math.abs(t-s);if(0<t)return i?s+h/(t-s)*Math.sqrt(h):0;var r=e-n;return r+t<0?i?s-Math.sqrt(-(t-s)):-r:t},je:function(t){if(!t.scroll_enabled){t.scroll_enabled=!0,t.parentNode.style.position="relative";var i=S.cssPrefix;t.style.cssText+=i+"transition: "+i+"transform; "+i+"user-select:none; "+i+"transform-style:flat;",t.addEventListener(S.transitionEnd,Ki.ye,!1)}},He:function(){-1!=Ki.ae.indexOf("x")&&(Ki.ee[0]=Ki.Ee("x",Ki.ce.dx,Ki.ce.px,"width")),-1!=Ki.ae.indexOf("y")&&(Ki.ee[1]=Ki.Ee("y",Ki.ce.dy,Ki.ce.py,"height")),Ki.je(Ki.ue),window.setTimeout(Ki.Te,1)},Ee:function(t,i,s,e){if(i-s<2){var n=Ki.Me(Ki.ue),h="y"==t?n.e:0,r="y"==t?0:n.f;return Ki.$e||Ki.Ce(Ki.ue,h,r,"0ms"),Ki.ae=Ki.ae.replace(t,""),""}var o=Y("DIV",{"class":"webix_scroll_"+t},"");return o.style[e]=Math.max(s*s/i-7,10)+"px",Ki.ce.left&&("x"===t?o.style.left=Ki.ce.left+"px":o.style.right=-Ki.ce.left+"px"),Ki.ce.hidden&&(o.style.visibility="hidden"),Ki.ue.parentNode.appendChild(o),o},Fe:function(t,i,s){return t>Ki.config.deltaStep?(Ki.be&&(Ki.Ne(i),Ki.Le(i),-1==(Ki.ae||"").indexOf(i)&&(Ki.ae="")),!1):s},ye:function(){var t,i,s;(s=Pt(Ki.ue||this))&&(Ki.ue?t=Ki.Me(Ki.ue):s.getScrollState&&(t={e:(i=s.getScrollState()).x,f:i.y}),A("onAfterScroll",[t]),s.callEvent&&s.callEvent("onAfterScroll",[t])),Ki.ae||(G(Ki.ee),Ki.ee=[null,null]),Ki.xe=!1},Ne:function(){window.clearTimeout(Ki.me),Ki.be=!1},Oe:function(t){if(!Ki.ee[0]&&!Ki.ee[1])return!0;Ki.Ue(t,Ki.ee[0]?"x":"y")},Ks:function(t){
  var i=t.target||Lt.srcElement;if(!(Ki.Rs||i.tagName&&"textarea"==i.tagName.toLowerCase()&&i.offsetHeight<i.scrollHeight)){Ki.fe=null,Ki.oe=Ki.ne=ts.context(t);var s=Pt(t);!Ki.qs||Ki.Ye()||s&&s.$touchCapture||(Ki.oe=null),Ki.Ae("onTouchStart"),Ki.Oe(t)&&(Ki.me=window.setTimeout(Ki.We,Ki.config.longTouchDelay)),!s||!s.touchable||i.className&&0===i.className.indexOf("webix_view")||(Ki.pe=s.getNode(t),st(Ki.pe,"webix_touch"))}},We:function(){Ki.ne&&(Ki.Ae("onLongTouch"),A("onClick",[Ki.ne]),Ki.fe=!0)},Ue:function(t,i){Ki.Le(i);var s=Ki.ee[0]||Ki.ee[1];if(s){var e=Ki.Be("onBeforeScroll",!0);e&&e.callEvent("onBeforeScroll",[Ki.ne,Ki.he])}!s||Ki.ue&&s.parentNode==Ki.ue.parentNode||(Ki.se(),Ki.ye(),Ki.ne=ts.context(t)),Ki.Qs(t)},Se:function(t){return Ki.re=Ki.he,Ki.he=ts.context(t),Ki.le.ze=Math.abs(Ki.ne.x-Ki.he.x),Ki.le.Ve=Math.abs(Ki.ne.y-Ki.he.y),Ki.re&&(Ki.he.time-Ki.re.time<Ki.config.scrollDelay?(Ki.le.de=Ki.le.de/1.3+Ki.he.x-Ki.re.x,Ki.le.ve=Ki.le.ve/1.3+Ki.he.y-Ki.re.y):Ki.le.ve=Ki.le.de=0,Ki.le._e=Ki.le._e/1.3+(Ki.he.time-Ki.re.time)),Ki.le},Ge:function(t){Ki.ce={dx:t.offsetWidth,dy:t.offsetHeight,px:t.parentNode.offsetWidth,py:t.parentNode.offsetHeight}},Ye:function(t){var i=Ki.ne.target;if(!S.touch&&!S.transition&&!S.transform)return null;for(;i&&"BODY"!=i.tagName;){if(i.getAttribute){var s=i.getAttribute("touch_scroll");if(s&&(!t||-1!=s.indexOf(t)))return[i,s]}i=i.parentNode}return null},Le:function(t){var i=this.Ye(t);return i&&(Ki.ae=i[1],Ki.ue=i[0],Ki.Ge(i[0])),i},Ae:function(t){A(t,[Ki.ne,Ki.he]);var i=Ki.Be(t);i&&i.callEvent(t,[Ki.ne,Ki.he])},Be:function(t,i){var s=Pt(i?Ki.ue:Ki.ne);if(!s)return null;for(;s;){if(s.hasEvent&&s.hasEvent(t))return s;s=s.getParentView()}return null},Xe: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=Ki.he;return i.time=new Date,i},Je:function(t){return{target:t.target||t.srcElement,x:t.pageX,y:t.pageY,time:new Date}}};function Qi(t){t.down="touchstart",t.move="touchmove",t.up="touchend",t.context=Ki.Xe}Mi(function Ho(){if(S.touch)Ki.$init(),-1==document.body.className.indexOf("webix_full_screen")&&Ki.limit(!0),window.MSCSSMatrix&&O(".webix_view{ -ms-touch-action: none; }");else var e=Lt(document.body,"touchstart",function(t){if(t.touches.length&&4<t.touches[0].radiusX)for(var i in S.touch=!0,Qi(ts),Ho(),zt.views){var s=zt.views[i];s&&s.$touch&&s.$touch()}Ot(e)},{capture:!0})});var ts=S.mouse={down:"mousedown",up:"mouseup",move:"mousemove",context:Ki.Je};window.navigator.pointerEnabled?(ts.down="pointerdown",ts.move="pointermove",ts.up="pointerup"):window.navigator.msPointerEnabled?(ts.down="MSPointerDown",ts.move="MSPointerMove",ts.up="MSPointerUp"):S.touch&&Qi(ts);var is={Ze:p(["dummy"]),addDrop:function(t,i,s){(t=D(t)).webix_drop=this.qe(i),s&&(t.webix_master=!0)},qe:function(t){t=t||is;var i=this.Ze.find(t);return i<0&&(i=this.Ze.length,this.Ze.push(t)),i},Ke:function(t){var i=is,s=this.Qe();if(s&&s.tn){i.Ji||i.createDrag(t);var e=i["in"];i.Ji.style.left=t.x+i.left+(e.x_offset||0)+"px",i.Ji.style.top=t.y+i.top+(e.y_offset||0)+"px"}},addDrag:function(t,i){(t=D(t)).webix_drag=this.qe(i),Nt(t,S.mouse.down,this.sn,{bind:t}),Nt(t,"dragstart",Q)},sn:function(t){if(is.en){if(is.nn==t)return;is.hn(),is.destroyDrag(t)}is.en=this;var i=S.mouse.context(t);is.rn=i,is.nn=t,is.an=Lt(document.body,S.mouse.move,is.un),is.cn=Lt(document,S.mouse.up,is.hn),st(document.body,"webix_noselect",1)},hn:function(){is.ln()},un:function(t){var i=S.mouse.context(t),s=is.Qe();if(!(s&&S.touch&&s.tn&&!Ki.fe||Math.abs(i.x-is.rn.x)<5&&Math.abs(i.y-is.rn.y)<5)&&(is.ln(!0),is.Ji||is.createDrag(is.nn)))return is.sendSignal("start"),is.an=Lt(document.body,S.mouse.move,is.dn),is.cn=Lt(document,S.mouse.up,is.vn),is.dn(t),S.touch?Q(t):void 0},vn:function(t){is.ln(),is.nn=null,is.ai&&(is.$drop(is.en,is.ai,t),is.$dragOut(is.en,is.ai,null,t)),is.destroyDrag(t),is.sendSignal("stop")},ln:function(t){this.an=Ot(this.an),this.cn=Ot(this.cn),t||et(document.body,"webix_noselect")},dn:function(e){var t=is,i=K(e),s=t.$dragPos(i,e),n=t["in"]
  ;t.Ji.style.top=i.y+t.top+(s||!n.y_offset?0:n.y_offset)+"px",t.Ji.style.left=i.x+t.left+(s||!n.x_offset?0:n.x_offset)+"px";var h=e;if(t._n)t._n=!1;else{if(S.touch){var r=S.mouse.context(e),o=document.elementFromPoint(r.x,r.y);h=new Proxy(e,{get:function(t,i){if("target"===i)return o;var s=t[i];return"function"==typeof s?s.bind(e):s}})}t.pn(h.target||h.srcElement,h)}return Q(e)},pn:function(t,i){for(;t&&"BODY"!=t.tagName;){if(t.webix_drop)return this.ai&&(this.ai!=t||t.webix_master)&&this.$dragOut(this.en,this.ai,t,i),!this.ai||this.ai!=t||t.webix_master?(this.ai=null,this.mn=this.$dragIn(is.en,t,i),void(this.mn&&(this.ai=t))):void 0;t=t.parentNode}this.ai&&(this.ai=this.mn=this.$dragOut(this.en,this.ai,null,i))},sendSignal:function(t){is.active="start"==t,A("onDragMode",[t])},getMaster:function(t){return this.Ze[t.webix_drag||t.webix_drop]},getContext:function(){return this["in"]},getNode:function(){return this.Ji},createDrag:function(t){var i=is,s=i.en;i["in"]={};var e,n=this.Ze[s.webix_drag];if(n.$dragCreate){if(!(e=n.$dragCreate(s,t)))return!1;this.bn(t),e.style.position="absolute"}else{var h=i.$drag(s,t);if(i.bn(t),!h)return!1;(e=document.createElement("DIV")).innerHTML=h,e.className="webix_drag_zone",document.body.appendChild(e);var r=i["in"];r.html&&S.pointerevents&&(r.x_offset=-Math.round(.5*e.offsetWidth),r.y_offset=-Math.round(.75*e.offsetHeight))}return e.style.zIndex=Math.max(e.style.zIndex,yi()),is.gn=Lt(e,S.mouse.move,is.wn),is["in"].from||(is["in"]={source:s,from:s}),is.Ji=e,!0},wn:function(){is._n=!0},destroyDrag:function(t){var i=is.en,s=this.Ze[i.webix_drag];s&&s.$dragDestroy?(is.gn=Ot(is.gn),is.Ji&&s.$dragDestroy(i,is.Ji,t)):G(is.Ji),s&&s.Jt&&(s.Jt=window.clearTimeout(s.Jt)),is.xn&&G(is.xn),is.mn=is.en=is.ai=is.Ji=is.xn=null},Qe:function(){return is.Ze[is.en.webix_drag]},top:0,left:0,bn:function(t){var i=is,s=i.rn,e=i["in"];if("undefined"!=typeof e.x_offset&&"undefined"!=typeof e.y_offset)return null;if(e.x_offset=e.y_offset=0,S.pointerevents){var n=is.Qe();if(n.tn&&n!==this){var h=n.tn(s,t);h&&(e.x_offset=h.x-s.x,e.y_offset=h.y-s.y)}}},$dragPos:function(t,i){var s=this.Ze[is.en.webix_drag];if(s.$dragPos&&s!=this)return s.$dragPos(t,i,is.Ji),!0},$dragIn:function(t,i,s){var e=this.Ze[i.webix_drop];return e.$dragIn&&e!=this?e.$dragIn(t,i,s):(i.className=i.className+" webix_drop_zone",i)},$dragOut:function(t,i,s,e){var n=this.Ze[i.webix_drop];return n.$dragOut&&n!=this?n.$dragOut(t,i,s,e):(i.className=i.className.replace("webix_drop_zone",""),null)},$drop:function(t,i,s){var e=this.Ze[i.webix_drop];if(is["in"].from=is.getMaster(t),e.$drop&&e!=this)return e.$drop(t,i,s);i.appendChild(t)},$drag:function(t,i){var s=this.Ze[t.webix_drag];return s.$drag&&s!=this?s.$drag(t,i):"<div style='"+t.style.cssText+"'>"+t.innerHTML+"</div>"}};T("onLongTouch",function(t){is.en&&is.Ke(t)});var ss={move_setter:function(t){return t&&(this.yn=f(this.yn),this.yn.master=this,is.addDrag(this.Mn?this.Mn:this.$view,this.yn)),t},yn:{$dragCreate:function(t,i){if(this.master.config.move){var s=Z(t),e=K(i);return is.top=s.y-e.y,is.left=s.x-e.x,D(this.master.et)}},$dragDestroy:function(t,i){var s=this.master;s.Z&&(s.Z.top=parseInt(i.style.top,10),s.Z.left=parseInt(i.style.left,10)),is.top=is.left=0,this.master.callEvent("onViewMoveEnd",[])},$dragPos:function(t,i){this.master.callEvent("onViewMove",[t,i])}}},es={Sn:function(t){if(t){if(!this.kn){this.kn=Y("div",{"class":"webix_modal"});var i=this.Z.zIndex||yi();this.Cn=M.I,M.I=i,this.kn.style.zIndex=i-1,this.et.style.zIndex=i,document.body.appendChild(this.kn),document.body.style.overflow="hidden",Nt(this.kn,"click",C(this.$n,this))}}else if(this.kn){G(this.kn),document.body.style.overflow="";var s=this.Cn;setTimeout(function(){M.I=s},1),this.kn=null}return t}},ns={resize_setter:function(t){return t&&!this.Dn&&this.In(),t},In:function(){if(!this.An){var t=this.et;t.firstChild&&((t=t.firstChild).style.position="relative"),this.An=Y("DIV",{"class":"webix_resize_handle",webix_disable_drag:"true"}),t.appendChild(this.An),Nt(this.An,S.mouse.down,this.Tn,{bind:this})}},Fn:function(t,i){if(
  !this.zn){this.zn=Y("div",{"class":"webix_resize_frame"},""),document.body.appendChild(this.zn);var s=Z(this.et);this.zn.style.left=s.x+"px",this.zn.style.top=s.y+"px",this.zn.style.zIndex=yi()}this.zn.style.width=t+"px",this.zn.style.height=i+"px"},Tn:function(){this.config.resize&&(st(document.body,"webix_noselect webix_resize_cursor"),this.Vn=Z(this.et),this.Bn=Lt(document.body,S.mouse.move,this.Hn,{bind:this}),this.Rn=Lt(document.body,S.mouse.up,this.Pn,{bind:this}))},Hn:function(t){if(!1!==this.Vn){var i=K(t),s={x:i.x-this.Vn.x,y:i.y-this.Vn.y};if(this.$resizeMove)this.$resizeMove(s);else{var e=this.config,n=e.minWidth||100,h=e.minHeight||100;s.x<n?s.x=n:s.x>e.maxWidth&&(s.x=e.maxWidth),s.y<h?s.y=h:s.y>e.maxHeight&&(s.y=e.maxHeight)}this.jn=s,this.Fn(s.x,s.y)}},Pn:function(){this.zn&&(this.zn=G(this.zn)),et(document.body,"webix_resize_cursor"),et(document.body,"webix_noselect"),Ot(this.Bn),Ot(this.Rn),this.jn&&(this.$resizeEnd?this.$resizeEnd(this.jn):(this.config.width=this.jn.x,this.config.height=this.jn.y,this.resize())),this.Vn=this.jn=!1,this.callEvent("onViewResize",[])}};M.qi=p();var hs={name:"window",$init:function(t){this.et.innerHTML="<div class='webix_win_content'><div class='webix_win_head'></div><div class='webix_win_body'></div></div>",this.Zi=this.et.firstChild,this.Mn=this.Zi.childNodes[0],this.mt=this.En=this.Zi.childNodes[1],this.et.className+=" webix_window",this.et.setAttribute("role","dialog"),this.et.setAttribute("tabindex","0"),this.Nn=this.q=null,t.K={top:!1,left:!1,right:!1,bottom:!1},t.id||(t.id=z()),Nt(this.Zi,"click",C(this.$n,this)),this.Zi.addEventListener&&Nt(this.Zi,"click",function(){!this.Z.zIndex&&this.Z.toFront&&(this.et.style.zIndex=yi())},{bind:this,capture:!0}),t.modal&&(this.Ln=!0),t.close&&(this.Z.close=t.close),this.attachEvent("onViewMoveEnd",function(){this.Z.position&&delete this.Z.position})},$n:function(t){var i=M.qi,s=i.find(this);-1==s&&(s=i.length-1),t.click_view=s,S.isIE8&&(t.srcElement.click_view=s)},getChildViews:function(){return this.Nn?[this.Nn,this.q]:[this.q]},zIndex_setter:function(t){return this.et.style.zIndex=t},st:function(){this.body_setter()},it:function(t,i){var s=(i=i||this.q)==this.q;i.destructor(),s?this.q=t:this.Nn=t,(s?this.En:this.Mn).appendChild(t.et);var e=t.et.style,n={top:!0,left:!0,right:!0,bottom:!0},h="0px";!1===t.config.borderless&&(n=f(this.Z.K),h="1px"),t.Z.K=n,e.borderTopWidth=e.borderBottomWidth=e.borderLeftWidth=e.borderRightWidth=h,this.resize(!0)},show:function(t,i,s){if(!0===t){if(!this.Z.hidden)return;t=null}if(!this.callEvent("onBeforeShow",arguments))return!1;var e,n,h;if(this.Z.hidden=!1,this.et.style.zIndex=this.Z.zIndex||yi(),(this.Z.modal||this.Ln)&&(this.Sn(!0),this.Ln=null),(i=i||{}).pos||(i.pos=this.Z.relative),t){"object"!=k(t)||t.tagName?e=Z(t=D(t)):t.target||t.srcElement?(e=K(t),n=20,h=5):e=t;var r=Math.max(window.innerWidth||0,document.body.offsetWidth),o=Math.max(window.innerHeight||0,document.body.offsetHeight);n=n||t.offsetWidth||0,h=h||t.offsetHeight||0;var a=this.Cs,u=e.x,c=e.y,f=0,l=0,d=0,v=0,_=this.Z.autofit;if(_){var p="node"===_,m=6,b=6,g=6;this.Z.point||(m=b=g=0),s="top",u=c=0,d=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,r-e.x-n<a[0]&&"right"==i.pos&&!p&&(i.pos="left"),l="right"==i.pos?(u=e.x+m+n,b=-h,s="left",f=Math.round(e.y+h/2),u-g):"left"==i.pos?(u=e.x-m-a[0]-1,b=-h,s="right",f=Math.round(e.y+h/2),u+a[0]+1):(u=e.x<d?d:r+d-e.x>a[0]?e.x:r+d-m-a[0],l=Math.round(e.x+n/2),Math.min(l,u+a[0]-3*g)),v=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,(!a[1]||o+v-h-e.y-b>a[1]||p)&&"top"!=i.pos?(c=h+e.y+b-(this.Z.point?4:0),f||(s="top",f=c-g)):(c=e.y-b-a[1])<0?(c=0,"top"==s&&(s=!1)):f||(s="bottom",f=--c+a[1]+1)}var w=i.x||0,x=i.y||0,y=this.On();y&&(c-=v,f-=v),this.setPosition(u+w,c+x),this.Un&&(s&&this.Z.point?this.Un(s,l+w,f+x,y):this.Yn())}else this.Wn(this.Z.left,this.Z.top);this.et.style.display="block",this.Gn=1,$(function(){this.Gn=0},this,[],S.touch?400:100),this.Fs(),this.config.autofocus&&(this.Xn=Ii.getFocus(),Ii.setFocus(this)),
  -1==M.qi.find(this)&&M.qi.push(this),this.callEvent("onShow",[])},Ni:function(t){if(!(this.Z.hidden||this.Z.modal||this.Gn||t&&t.showpopup||M.I&&this.Z.zIndex<=M.I)){if(t){var i=S.isIE8?t.srcElement.click_view:t.click_view;if(i||0===i||(i=-1),M.qi.find(this)<=i)return}this.Jn()}},hidden_setter:function(t){return t?this.hide():this.show(),!!t},hide:function(){var t=this.Jn();this.Zn(t)},Jn:function(){if(!this.$destructed&&!this.Z.hidden){if(this.Z.modal&&this.Sn(!1),this.qn(),this.Z.autofocus){var t=document.activeElement;t&&this.et&&(this.et.contains(t)||t===document.body)&&(Ii.setFocus(this.Xn),this.Xn=null)}var i=M.qi.find(this);return-1<i&&M.qi.removeAt(i),i}},qn:function(){"top"==this.Z.position?Gi(this.et,{type:"slide",x:0,y:-(this.Is+20),duration:300,callback:this.Kn,master:this}):this.Kn()},Zn:function(t){if(-1<t)for(var i=M.qi,s=i.length-1;t<=s;s--)i[s].Yn&&i[s].Jn()},destructor:function(){this.Sn(!1),G(this.et),this.Z.autofocus&&(M.k||Ii.setFocus(this.Xn),this.Xn=null),this.Zn(),this.Yn&&this.Yn(),Ti.destructor.apply(this,[])},Kn:function(){this.$destructed||(this.et.style.display="none",this.Z.hidden=!0,this.callEvent("onHide",[]))},close:function(){this.destructor()},Qn:function(t){"undefined"==typeof t.borderless&&(t.borderless=!0)},body_setter:function(t){return"object"!=k(t)&&(t={template:t}),this.Qn(t),(M._=this).q=zt.rt(t),this.En.appendChild(this.q.et),t},head_setter:function(t){var i=this;if(!1===t)return t;var s="string"==typeof t;return s&&(this.et.setAttribute("aria-label",t),t={template:t}),("template"==t.view||!t.view&&t.template)&&P.extend(t,{padding:0,css:"webix_win_title",type:"header",borderless:!0}),s&&this.config.close?t={padding:{left:Xi.inputHeight+2,right:2},cols:[t,{view:"icon",icon:"wxi-close",click:function(){i.hide()}}]}:P.extend(t,{borderless:!0}),(M._=this).Nn=zt.rt(t),this.Mn.appendChild(this.Nn.et),t},getBody:function(){return this.q},getHead:function(){return this.Nn},adjust:function(){return this.resize()},resizeChildren:function(){this.q&&this.resize()},resize:function(){ji.api.adjust.call(this),A("onResize",[]),this.isVisible()&&this.Wn(this.Z.left,this.Z.top)},On:function(){if(this.Z.master){var t=Pt(this.Z.master).getTopParentView().$view;return t&&"fixed"===t.style.position}return!1},Wn:function(t,i){if(this.Z.position||this.On()){this.$view.style.position="fixed";var s=this.$s,e=this.Is;if(s<=0||e<=0)return;var n=window.innerWidth||document.documentElement.offsetWidth,h=window.innerHeight||document.documentElement.offsetHeight,r=Math.round((n-s)/2),o=Math.round((h-e)/2);if("function"==typeof this.Z.position){var a={left:r,top:o,width:s,height:e,maxWidth:n,maxHeight:h};this.Z.position.call(this,a),a.width==s&&a.height==e||this.$setSize(a.width,a.height),this.setPosition(a.left,a.top)}else"top"==this.Z.position&&(o=Gi.isSupported()?-1*e:10),this.Z.position||(r=this.Z.left||r,o=this.Z.top||o),this.setPosition(r,o);"top"==this.Z.position&&Gi(this.et,{type:"slide",x:0,y:e-2*(this.Z.padding||0),duration:300,callback:this.th,master:this})}else this.setPosition(t,i)},th:function(t){Gi.clear(t),this.Z.top=-2*(this.Z.padding||0),this.setPosition(this.Z.left,this.Z.top)},setPosition:function(t,i){this.et.style.top=i+"px",this.et.style.left=t+"px",this.Z.left=t,this.Z.top=i},$getSize:function(t,i){var s=this.Z.K;s&&(t+=(s.left?0:1)+(s.right?0:1),i+=(s.top?0:1)+(s.bottom?0:1)),this.Z.head&&(i+=1);var e=this.q.$getSize(0,0),n=0;if(this.Nn){var h=this.Nn.$getSize(0,0);h[3]==h[2]&&(this.Z.headHeight=h[3]),i+=this.Z.headHeight,n=h[0]}if(this.Z.fullscreen){var r=window.innerWidth||document.body.clientWidth,o=window.innerHeight||document.body.clientHeight;return[r,r,o,o]}var a=Li.api.$getSize.call(this,0,0);return n&&1e5<e[1]&&(e[0]=Math.max(n,e[0])),a[1]=Math.min(a[1],(1e5<=e[1]&&1e5<=a[1]?Math.max(e[0],a[0]):e[1])+t),a[3]=Math.min(a[3],(1e5<=e[3]&&1e5<=a[3]?Math.max(e[2],a[2]):e[3])+i),a[0]=Math.min(Math.max(a[0],e[0]+t),a[1]),a[2]=Math.min(Math.max(a[2],e[2]+i),a[3]),a},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),t=this.$s,i=this.Is,!1===this.Z.head?(this.Mn.style.display="none",
  this.q.$setSize(t,i)):(this.Nn.$setSize(t,this.Z.headHeight),this.q.$setSize(t,i-this.Z.headHeight))},$skin:function(){this.defaults.headHeight=Xi.barHeight},defaults:{top:0,left:0,autofit:!0,relative:"bottom",body:"",head:"",hidden:!0,autofocus:!0,minWidth:300,minHeight:200}},rs={api:hs,view:P.protoUI(hs,Li.view,ss,es,w,ns)},os={defaults:{padding:"4",hidden:!0},body_setter:function(t){return t=rs.api.body_setter.call(this,t),this.q.et.style.borderWidth="0px",t},attachTo:function(t){var i;i=t.on_context?t.attachEvent("onAfterContextMenu",C(this.ih,this)):Lt(t,"contextmenu",this.sh,{bind:this}),this.attachEvent("onDestruct",function(){t.callEvent?t.detachEvent(i):Ot(i),t=null})},getContext:function(){return this.eh},setContext:function(t){this.eh=t},sh:function(t){return this.eh=D(t||Lt),this.nh(t)},ih:function(t,i){return this.eh={obj:Pt(i),id:t},this.nh(i)},nh:function(t){var i=this.show(t,null,!0);return!1===i?i:(A("onClick",[]),Q(t))},hh:!0,master_setter:function(t){return this.attachTo(t),null}},as={eh:null,rh:null,oh:0,init:function(){return null!==this.eh||(M.destructors.push({obj:this}),this.eh=document.createElement("textarea"),this.eh.className="webix_clipbuffer",this.eh.setAttribute("webixignore",1),this.eh.setAttribute("spellcheck","false"),this.eh.setAttribute("autocapitalize","off"),this.eh.setAttribute("autocorrect","off"),this.eh.setAttribute("autocomplete","off"),document.body.appendChild(this.eh),Lt(document.body,"keydown",C(function(t){var i=t.keyCode,s=!(!t.ctrlKey&&!t.metaKey);86===i&&s&&(this.eh.value="",$(this.ah,this,[t],100))},this))),this.eh},destructor:function(){this.eh=null},set:function(t){this.init(),t=""===t?"\n":t,this.eh.value=t,this.focus()},focus:function(){this.uh()||(this.init(),this.eh.focus(),this.eh.select())},uh: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},ah:function(t){if((t.target||t.srcElement)===this.eh){var i=this.eh.value,s=Ii.getFocus();!s||s.getEditor&&s.getEditor()||(s.callEvent("onPaste",[i]),this.eh.select())}}},us={clipboard_setter:function(t){return!0!==t&&1!==t||(t="modify"),this.attachEvent("onAfterSelect",function(t){var i=this.getItem(t),s=this.type.templateCopy(i);as.set(s,this),as.focus(),Ii.setFocus(this)}),this.attachEvent("onPaste",function(t){j(this.ah[this.Z.clipboard])||this.ah[this.Z.clipboard].call(this,t)}),this.attachEvent("onFocus",function(){as.focus()}),this.attachEvent("onItemClick",function(t){this.ch&&-1===this.ch.find(t)||(as.focus(),Ii.setFocus(this))}),t},ah:{insert:function(t){this.add({value:t})},modify:function(t){for(var i=this.getSelectedId(!0),s=0;s<i.length;s++)this.getItem(i[s]).value=t,this.refresh(i[s])},custom:function(){}},templateCopy_setter:function(t){this.type.templateCopy=At(t)},type:{templateCopy:function(t){return this.template(t)}}},cs={$customPrint:function(t,i){if(this.fh(t,i))return!0;var s=this.lh(t),e=this.dh(s,t);if(i)return e;var n=Y("div",{"class":"webix_ui_print"});n.appendChild(e),X(n,t.docFooter,document.body),window.print(),G(n)},fh:function(t,i){if(!i&&("y"==this.config.layout||t.scroll||this.config.prerender||this.config.autoheight))return!0;"x"==this.config.layout&&P.extend(t||{},{xCount:this.count(),nobreaks:!0},!0)},vh:function(t){if("page"==t.fit)return Infinity;var i=t.size["portrait"==t.mode?"width":"height"];return Math.min(i*S.printPPI-2*S.printMargin)},lh:function(t,i,s){var e,n,h=this.vh(t),r=t.xCount||this.ph()._h,o=[],a=[],u=0;s=s||0,i=i||[];for(var c=0;c<this.data.order.length;){var f=this.data.pull[this.data.order[c]];if(n=c-parseInt(c/r)*r,f&&s<=n){if(h<(u+=this.type.width)&&s<n){e=a.length+s,o.push(a),c+=r-a.length,a=[],u=0;continue}var l=this.type.template(f,this.type),d=this.mh,v={display:"table-cell",height:this.type.height+"px",width:this.type.width+"px"};a.push({txt:l,className:d+" "+(f.$css||""),style:v}),(c+1)%r==0&&(o.push(a),a=[],u=0)}c++}return i.push(o),e&&this.lh(t,i,e),i},dh:function(n,h){var r=Y("div")
  ;return n.forEach(C(function(t,i){var s=Y("table",{"class":"webix_table_print "+this.$view.className,style:"border-collapse:collapse"});if(t.forEach(function(t){var e=Y("tr");t.forEach(function(i){var s=Y("td");(i.txt&&(s.innerHTML=i.txt),i.className&&(s.className=i.className),i.style)&&Object.keys(i.style).forEach(function(t){i.style[t]&&(s.style[t]=i.style[t])});i.span&&(1<i.span.colspan&&(s.colSpan=i.span.colspan),1<i.span.rowspan&&(s.rowSpan=i.span.rowspan)),e.appendChild(s)}),s.appendChild(e)}),r.appendChild(s),!h.nobreaks&&i+1<n.length){var e=Y("DIV",{"class":"webix_print_pagebreak"});r.appendChild(e)}},this)),r}},fs={scrollStep:40,init:function(){this.bh(),S.$customScroll=!0,S.scrollSize=0,M.destructors.push({obj:{destructor:function(){this.gh=null}}}),T("onReconstruct",fs.wh),T("onResize",fs.wh),T("onClick",fs.wh)},resize:function(){this.wh()},xh:function(t){t.Wt.yh=t.Z.id,t.attachEvent("onAfterRender",function(){var t=fs.Mh(this),i=Math.max(t.dy-t.py,0),s=Math.max(t.dx-t.px,0);this.Sh&&this.kh>i?this.Sh.scrollTo(i):this.Ch&&this.$h>s&&this.Ch.scrollTo(s),fs.gh==this.Wt&&fs.wh()}),Nt(t.Wt,"mouseover",fs.Dh),Nt(t.Wt,"mouseout",fs.Ih)},enable:function(t,i){if(fs.bh(),t.mapCells)return this.xh(t);var s=t;t.mt&&(s=t.mt.parentNode),s.Ah=i||"xy",Nt(s,"mouseover",fs.Dh),Nt(s,"mouseout",fs.Ih),Nt(s,"mousewheel",fs.Th,{passive:!1}),Nt(s,"DOMMouseScroll",fs.Th,{passive:!1}),this.Fh(t)},wh:function(){var t=fs.gh;t&&t.zh&&(fs.Vh.call(t),fs.Dh.call(t))},bh:function(){Lt(document.body,"mousemove",function(t){fs.Bh&&fs.Hh(fs.Bh,fs.Bh.Rh,K(t))}),fs.bh=function(){}},Dh:function(){if(fs.gh=this,clearTimeout(this.Ph),!this.zh&&!fs.Bh){var t=Pt(this);if(!t||t.isEnabled()){var i;if(this.yh){if(!(t=Pt(this.yh)))return;i=fs.Mh(t)}else(i={dx:this.scrollWidth,dy:this.scrollHeight,px:this.clientWidth,py:this.clientHeight}).As=i.dx>i.px&&-1!=this.Ah.indexOf("x"),i.Ds=i.dy>i.py&&-1!=this.Ah.indexOf("y");(this.zh=i).As&&(i.jh=fs.Ee(this,"x",i.dx,i.px,"width","height"),i.Eh=i.px-i.jh.offsetWidth-4,i.Nh=i.dx-i.px,fs.trackBar&&(i.Lh=fs.Oh(this,"x"))),i.Ds&&(i.Uh=fs.Ee(this,"y",i.dy,i.py,"height","width"),i.Yh=i.py-i.Uh.offsetHeight-4,i.Wh=i.dy-i.py,fs.trackBar&&(i.Gh=fs.Oh(this,"y"))),fs.Xh(this)}}},Oh:function(t,i){var s=Y("DIV",{webixignore:"1","class":"webix_c_scroll_bar_"+i},"");return t.appendChild(s),s},Hh:function(t,i,s){var e=t.zh,n=t.yh;if(n&&(n=Pt(n)),e.jh==t.Jh){var h=(s.x-i.x)*e.Nh/e.Eh;n?n.Ch.scrollTo(n.$h+h):fs.Zh(t,"scrollLeft",h)}if(e.Uh==t.Jh){var r=(s.y-i.y)*e.Wh/e.Yh;n?n.Sh.scrollTo(n.kh+r):fs.Zh(t,"scrollTop",r)}t.Rh=s,fs.Xh(t)},Mh:function(t){var i={};return t.Ch&&t.Z.scrollX&&(i.dx=t.Ch.getSize(),i.px=t.Ch.qh||1,i.As=1<i.dx-i.px),t.Sh&&t.Z.scrollY&&(i.dy=t.Sh.getSize(),i.py=t.Sh.qh||1,i.Ds=1<i.dy-i.py),i},Ih:function(){clearTimeout(this.Ph),this.Ph=$(fs.Vh,this,[],200)},Kh:function(t){t&&(G(t),t.Qh&&(Ot(t.Qh),Ot(t.ir),Ot(t.sr)))},Vh:function(){if(this.zh){if(this.Jh)return void(this.nr=!0);var t=this.zh;fs.Kh(t.jh),fs.Kh(t.Uh),et(document.body,"webix_noselect"),t.Lh&&G(t.Lh),t.Gh&&G(t.Gh),this.zh=null}},Th:function(t){var i=this.zh,s=t.wheelDelta/-40,e=!1;if(!s&&t.detail&&j(t.wheelDelta)&&(s=t.detail),i){t.scrolledBy||(t.scrolledBy=i.Ds?"y":"x");var n=t.wheelDeltaX&&Math.abs(t.wheelDeltaX)>Math.abs(t.wheelDeltaY);if(i.jh&&("y"!==t.scrolledBy&&(t.wheelDeltaX||s)||n)){var h=t.wheelDeltaX/-40||s;e=fs.Zh(this,"scrollLeft",h*fs.scrollStep)}else!n&&s&&i.Uh&&(e=fs.Zh(this,"scrollTop",s*fs.scrollStep))}if(fs.Xh(this),!1!==e)return Q(t)},Zh:function(t,i,s){var e=t.zh,n="scrollLeft"==i?e.dx-e.px:e.dy-e.py,h=t[i];return n<h+s&&(s=n-h),!(!s||h+s<0&&0===h)&&(S.isIE&&fs.Xh(t,i,s+h),t[i]+=s,!0)},Ee:function(t,i,s,e,n){var h=Y("DIV",{webixignore:"1","class":"webix_c_scroll_"+i},"<div></div>");return h.style[n]=Math.max(e*e/s-7,40)+"px",h.style["height"==n?"top":"left"]="0px",t.style.position="relative",t.appendChild(h),t.Qh=Lt(h,"mousedown",fs.hr(t)),t.ir=Lt(document.body,"mouseup",C(fs.rr,t)),t.sr=Lt(document.body,"mouseleave",C(fs.rr,t)),h},hr:function(i){return function(t){st(document.body,"webix_noselect",1),
  this.className+=" webix_scroll_active",(fs.Bh=i).Jh=this,i.Rh=K(t)}},rr:function(){this.Jh&&(et(document.body,"webix_noselect"),this.Jh.className=this.Jh.className.toString().replace(" webix_scroll_active",""),this.Jh=!1,fs.Bh=0,this.nr&&(fs.Vh.call(this),this.nr=!1))},Xh:function(t,i,s){var e=t.zh;if(e&&(e.jh||e.Uh)){var n=t.yh,h="scrollLeft"==i?s:t.scrollLeft,r=n?Pt(n).$h:h,o=n?0:r,a="scrollTop"==i?s:t.scrollTop,u=n?Pt(n).kh:a,c=n?0:u;e.jh&&(e.jh.style.bottom=1-c+"px",e.jh.style.left=Math.round(e.Eh*r/(e.dx-e.px))+o+1+"px",e.Lh&&(e.Lh.style.bottom=1-c+"px",e.Lh.style.left=o+"px")),e.Uh&&(e.Uh.style.right=0-o+"px",e.Uh.style.top=Math.round(e.Yh*u/(e.dy-e.py))+c+1+"px",e.Gh&&(e.Gh.style.right=0-o+"px",e.Gh.style.top=c+"px"))}},Fh:function(i){i.data&&i.data.attachEvent&&i.data.attachEvent("onStoreUpdated",function(){var t=fs.gh;t&&i.$view.contains(t)?fs.resize():fs.Vh.call(i.$view)})}},ls={addCss:function(t,i,s){if(!this.addRowCss&&!s&&!this.hasCss(t,i)){var e=this.getItemNode(t);e&&(e.className+=" "+i,s=!0)}return this.data.addMark(t,i,1,1,s)},removeCss:function(t,i,s){if(!this.addRowCss&&!s&&this.hasCss(t,i)){var e=this.getItemNode(t);e&&(e.className=e.className.replace(i,"").replace("  "," "),s=!0)}return this.data.removeMark(t,i,1,s)},hasCss:function(t,i){return this.data.getMark(t,i)},clearCss:function(t,i){return this.data.clearMark(t,1,i)}},ds={copy:function(t,i,s,e){var n=(e=e||{}).newId||t;s=s||this;var h=this.getItem(t);return s&&(h=s.or(h)),s.data.add(s.or(h,n),i,e.parent||0)},ar:function(t,i,s){if(i&&t){var e=this.getIndexById(t);return e+(s==this&&s.getIndexById(i)<e?0:1)}},move:function(t,i,s,e){var n=(e=e||{}).newId||t;if((s=s||this).data,s.data){if(g(t)){3<t.length&&(this.$blockRender=s.$blockRender=!0);for(var h=0;h<t.length;h++){var r=this.move(t[h],i,s,e);i=s.ar(r,t[h+1],this)}return this.$blockRender=s.$blockRender=!1,void(3<t.length&&(this.refresh(),s!=this&&s.refresh()))}var o=t,a=this.getItem(t);return s&&s!=this?(o=s.data.add(s.or(a,n),i,e.parent||0),this.data.remove(t)):(i<0&&(i=this.data.order.length-1),this.data.move(this.getIndexById(t),i),this.data.callEvent("onDataMove",[t,i,null,this.data.order[i+1]])),o}},moveUp:function(t,i){var s=this.getIndexById(t)-(i||1);return this.move(t,s<0?0:s)},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)},or:function(t,i){var s=P.extend({},t);return s.id=!i||this.data.pull[i]?z():i,s.$template=null,this.Z.externalData&&(s=this.Z.externalData.call(this,s,i,t)),s}},vs={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}},_s={$init:function(){this.$&&this.attachEvent("onChange",this.clearValidation)},clearValidation:function(){if(this.elements)for(var t in this.elements)this.ur(t)},validate:function(t,i){this.callEvent,this.callEvent("onBeforeValidate",[]);var s=this.cr={},e=!0,n=this.Z.rules,h=this.isVisible&&!this.isVisible(),r=t&&t.hidden,o=t&&t.disabled,a={},u={};for(var c in this.elements){var f=this.elements[c].config.name;(h||this.elements[c].isVisible()||r)&&(this.elements[c].isEnabled()||o)?a[f]=this.elements[c]:u[f]=!0}if((n||a)&&!i&&this.getValues&&(i=this.getValues()),n){n.$obj&&(e=this.fr(n.$obj,i,i,"")&&e);var l=n.$all,d=i;if(this.Z.complexData&&(d=xt.collapseNames(i,"",{},function(t){return!n[t]})),l)for(var v in i)if(!u[v]){var _=this.fr(l,d[v],i,v);_||(s[v]=!0),e=_&&e}for(var p in n)if(!u[p]&&0!==p.indexOf("$")&&!s[p]){n[p];var m=this.fr(n[p],d[p],i,p);m||(s[p]=!0),e=m&&e}}if(a)for(var b in a)if(!s[b]){var g=a[b];if(g.validate){var w=g.validate();e=w&&e,w||(s[b]=!0)}else{var x=g.Z;if(x){var y=x.validate;if(!y&&x.required&&(y=n.isNotEmpty),y){var M=this.fr(y,i[b],i,b);M||(s[b]=!0),e=M&&e}}}}return this.callEvent("onAfterValidation",[e,this.cr]),e},fr:function(t,i,s,e){return"string"==typeof t&&(t=vs[t]),t.call(this,i,s,e)?(this.callEvent("onValidationSuccess",[e,s]
  )&&this.ur&&this.ur(e),!0):(this.callEvent("onValidationError",[e,s])&&this.lr&&this.lr(e),!1)}},ps={};function ms(t,i){if("object"==k(t)&&t.Z&&(t=t.Z.id),ps[t]||i)return ps[t];"string"!=typeof t&&"number"!=typeof t||(t={master:Pt(t)});var s=new bs(t),e=s.Z.master.Z.id;return ps[e]=s,Pt(e).attachEvent("onDestruct",function(){ps[this.Z.id]=null,delete ps[this.Z.id]}),s}u("dp",ms),ms.$$=function(t){return ps[t]};var bs=P.proto({defaults:{autoupdate:!0,updateFromResponse:!1,mode:"post",operationName:"webix_operation",trackMove:!1},$init:function(){this.reset(),this.dr=!1,this.name="DataProcessor",this.$ready.push(this.vr)},reset:function(){this._r=[]},url_setter:function(t){var i="";if("string"==typeof t){var s=t.split("->");1<s.length&&(t=s[1],i=s[0])}else t&&t.mode&&(i=t.mode,t=t.url);return i?fi(i,t):t},master_setter:function(t){var i=t;return"DataStore"!=t.name&&(i=t.data),this.Z.store=i,t},pr:function(t){var i=this.mr;this.mr=[],t();var s=Promise.all(this.mr);return(this.mr=i)&&i.push(s),s},vr:function(){var t=this.Z.store;t&&(t.attachEvent("onStoreUpdated",C(this.gr,this)),t.attachEvent("onDataMove",C(this.wr,this)))},ignore:function(t,i){var s=this.dr;this.dr=!0,t.call(i||this),this.dr=s},off:function(){this.dr=!0},on:function(){this.dr=!1},xr:function(t){var i={};for(var s in t)0!==s.indexOf("$")&&(i[s]=t[s]);return i},save:function(t,i,s){return i=i||"update",this.yr(t,s,i,!0)},yr:function(t,i,s,e){if("object"==k(t)&&(t=t.toString()),t&&!0!==this.dr&&s&&"paint"!=s){var n=this.Z.store;n&&(i=i||this.Z.store.getItem(t),n.Mr&&(i=n.Mr(i)));var h={id:t,data:this.xr(i),operation:s};if(j(i.$parent)||(h.data.parent=i.$parent),"delete"!=h.operation){var r=this.Z.master;r&&r.data&&r.data.getMark&&r.data.getMark(t,"webix_invalid")&&(h.Sr=!0),this.validate(null,h.data)||(h.Sr=!0)}return this.kr(h)&&this._r.push(h),this.Z.autoupdate||e?this.Cr(t):void 0}},wr:function(t,i,s,e){if(this.Z.trackMove){var n=m(this.Z.store.getItem(t));n.webix_move_index=i,n.webix_move_id=e,n.webix_move_parent=s,this.yr(t,n,"order")}},gr:function(t,i,s){switch(s){case"save":case"update":s="update";break;case"add":s="insert";break;case"delete":s="delete";break;default:return!0}return this.yr(t,i,s)},kr:function(t){for(var i=0;i<this._r.length;i++){var s=this._r[i];if(s.id==t.id&&!s.Dr)return"delete"==t.operation&&("insert"==s.operation?this._r.splice(i,1):s.operation="delete"),s.data=t.data,s.Sr=t.Sr,!1}return!0},send:function(){return this.Cr()},Cr:function(t){if(this.Z.url){for(var i,s=this._r,e=[],n=this.Z.url,h=0;h<s.length;h++){var r=s[h];if(!r.Dr&&!r.Sr){var o=r.id;if(this.Z.autoupdate||!t||t==o){var a=r.operation,u=fi.$parse("object"!=k(n)||n.$proxy?n:n[a]),c=u&&(u.$proxy||"function"==typeof u);if(u){var f=this.Z.store;if(f&&f.Ir&&f.Ir(r.data),this.callEvent("onBefore"+a,[o,r])){if(r.Dr=!0,!this.callEvent("onBeforeDataSend",[r]))return;r.data=this.Ar(r.data);var l=void 0;u.$proxy?(u.save&&(l=u.save(this.config.master,r,this)),e.push(r)):("insert"==a&&delete r.data.id,l=c?u.call(this.config.master,r.id,r.operation,r.data):(r.data[this.Z.operationName]=a,this.O(u,r.data,this.Z.mode))),l&&(l=this.Tr(l,{id:r.id,status:r.operation}),t&&o===t&&(i=l)),this.callEvent("onAfterDataSend",[r])}}}}}if(n.$proxy&&n.saveAll&&e.length){var d=n.saveAll(this.config.master,e,this);d&&(d=this.Tr(d,null),i||(i=d))}return i}},Tr:function(t,s){var e=this;if(t)return t.then||(t=mt.resolve(t)),t=t.then(function(t){var i;if(t&&"function"==typeof t.json&&(t=t.json()),!(i=null===s?e.Fr(t):e.Fr(s,"",t,-1)))throw i;return i},function(t){throw e.zr(s,"",null,t),t}),this.mr&&this.mr.push(t),t},Ar:function(t){var i={};for(var s in t)0!==s.indexOf("$")&&(i[s]=t[s]);return i},O:function(t,i,s){return wt()[s](t,i)},attachProgress:function(t,i,s){this.attachEvent("onBeforeDataSend",t),this.attachEvent("onAfterSync",i),this.attachEvent("onAfterSaveError",s),this.attachEvent("onLoadError",s)},zr:function(t,i,s,e){t?this.Vr(!0,t.id,!1,t.status,!1,{text:i,data:s,loader:e}):(this.callEvent("onLoadError",arguments),A("onLoadError",[i,s,e,this]))},Vr:function(t,i,s,e,n,h){
  var r=this.Z.master,o=this.getItemState(i);if(o.Dr=!1,!t){this.setItemState(i,!1);var a=this.Z.store;return a&&a.exists(i)&&(s&&i!=s&&a.changeId(i,s),n&&"delete"!=e&&this.Z.updateFromResponse&&this.ignore(function(){a.updateItem(s||i,n)})),this.Z.undoOnError&&r.Z.undo&&r.removeUndo(s||i),this.callEvent("onAfterSave",[n,i,h]),this.callEvent("onAfter"+e,[n,i,h]),n||{}}this.callEvent("onBeforeSaveError",[i,e,n,h])&&(o.Sr=!0,this.Z.undoOnError&&r.Z.undo&&(this.ignore(function(){r.undo(i)}),this.setItemState(i,!1)),this.callEvent("onAfterSaveError",[i,e,n,h]))},processResult:function(t,i,s){var e=i&&("error"==i.status||"invalid"==i.status),n=!!i&&(i.newid||i.id);return this.Vr(e,t.id,n,t.status,i,s)},Fr:function(t,i,s,e){var n,h=this;if(this.callEvent("onBeforeSync",[t,i,s,e]),g(t))n=[],t.forEach(function(t){n.push(h.processResult(t,t,{}))});else if(-1===e)n=this.processResult(t,s,{});else{var r,o=this.Z.url;if(o.$proxy&&o.result)n=o.result(t,this.Z.master,this,i,s,e)||{};else i&&(r=s.json(),i&&null==r&&(r={status:"error"})),n=this.processResult(t,r,{text:i,data:s,loader:e})}return this.callEvent("onAfterSync",[t,i,s,e]),n},escape:function(t){return this.Z.escape?this.Z.escape(t):encodeURIComponent(t)},getState:function(){if(!this._r.length)return!1;for(var t=this._r.length-1;0<=t;t--)if(this._r[t].Dr)return"saving";return!0},getItemState:function(t){var i=this.Br(t);return this._r[i]||null},setItemState:function(t,i){if(i)this.yr(t,null,"update");else{var s=this.Br(t);-1<s&&this._r.splice(s,1)}},Br:function(t){for(var i=-1,s=0;s<this._r.length;s++)if(this._r[s].id==t){i=s;break}return i}},Ai,w,_s);function gs(){this.name="DataStore",P.extend(this,w),this.setDriver("json"),this.pull={},this.order=p(),this.Hr={}}gs.prototype={setDriver:function(t){hi[t],this.driver=hi[t]},jt:function(t){this.callEvent("onParse",[this.driver,t]),this.Rr&&this.filter();var i=this.driver.getInfo(t);i.key&&(M.securityKey=i.key),i.config&&this.callEvent("onServerConfig",[i.config]);var s=this.driver.getOptions(t);s&&this.callEvent("onServerOptions",[s]);var e=this.driver.getRecords(t);this.Pr(i,e),this.jr&&this.Er&&!this.Nr&&this.Er(this.jr),this.Lr&&(this.blockEvent(),this.sort(this.Lr),this.unblockEvent()),this.callEvent("onStoreLoad",[this.driver,t]),this.refresh()},Pr:function(t,i){var s=t.from,e=!0,n=!1;if(!s&&0!==s&&this.order[0]){if(this.Or){n={};for(var h=0;h<this.order.length;h++)n[this.order[h]]=!0}e=!1,s=this.order.length}else s=1*(s||0);for(var r=0,o=0;o<i.length;o++){var a=this.driver.getDetails(i[o]),u=this.id(a);this.pull[u]?e&&this.order[r+s]&&r++:(this.order[r+s]=u,r++),this.pull[u]?(P.extend(this.pull[u],a,!0),this.Ur&&this.Ur(this.pull[u]),n&&delete n[u]):(this.pull[u]=a,this.Yr&&this.Yr(a))}if(n){for(var c in this.blockEvent(),n)this.remove(c);this.unblockEvent()}var f=1*t.size;f&&(this.order[f-1]||(this.order[f-1]=undefined),f<this.order.length&&(this.order=this.order.slice(0,f)))},id:function(t){return t.id||(t.id=z())},changeId:function(t,i){t!=i&&(this.pull[t]&&(this.pull[i]=this.pull[t]),this.pull[i].id=i,this.order[this.order.find(t)]=i,this.Rr&&(this.Rr[this.Rr.find(t)]=i),this.Hr[t]&&(this.Hr[i]=this.Hr[t],delete this.Hr[t]),this.callEvent("onIdChange",[t,i]),this.Wr&&this.Wr(t,i),delete this.pull[t])},getItem:function(t){return this.pull[t]},updateItem:function(t,i,s){"object"===k(t)&&(t=t.toString());var e=this.getItem(t),n=null,h=this.hasEvent("onDataUpdate");!i||!i.id||i.id,j(i)||e===i||(h&&(n=m(e)),t=e.id,P.extend(e,i,!0),e.id=t),this.Ur&&this.Ur(e),this.callEvent("onStoreUpdated",[t,e,s||"update"]),h&&this.callEvent("onDataUpdate",[t,e,n])},refresh:function(t){this.Gr||(t?this.exists(t)&&this.callEvent("onStoreUpdated",[t,this.pull[t],"paint"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(t,i){this.Gr=!0,t.call(i||this),this.Gr=!1},getRange:function(t,i){if(t=t?this.getIndexById(t):this.$min||this.startOffset||0,i?i=this.getIndexById(i):(i=0===this.$max?0:Math.min(this.$max?this.$max-1:this.endOffset||Infinity,this.count()-1))<0&&(i=0),i<t){var s=i;i=t,t=s}return this.getIndexRange(t,i)},
  getIndexRange:function(t,i){i=Math.min(0===i?0:i||Infinity,this.count()-1);for(var s=p(),e=t||0;e<=i;e++)s.push(this.getItem(this.order[e]));return s},count:function(){return this.order.length},exists:function(t){return!!this.pull[t]},move:function(t,i){if(t!=i){var s=this.getIdByIndex(t),e=this.getItem(s);this.Rr&&this.Xr(this.Rr,0,0,this.getIdByIndex(t),this.getIdByIndex(i)),this.Xr(this.order,t,i),this.callEvent("onStoreUpdated",[s,e,"move"])}},Xr:function(t,i,s,e,n){if(e||n){i=s=-1;for(var h=0;h<t.length;h++)t[h]==e&&i<0&&(i=h),t[h]==n&&s<0&&(s=h)}var r=t[i];t.removeAt(i),t.insertAt(r,Math.min(t.length,s))},scheme:function(t){for(var i in this.Jr={},this.Ir=t.$save,this.Yr=t.$init||t.$change,this.Ur=t.$update||t.$change,this.Mr=t.$serialize,this.jr=t.$group,this.Lr=t.$sort,this.Zr=t.$export,t)"$"!=i.substr(0,1)&&(this.Jr[i]=t[i])},importData:function(t,i){var s=t?t.data||t:[];if(this.Rr=null,"function"==typeof s.serialize){if(this.order=p([].concat(s.order)),this.qr){this.qr=!1;var e=this.pull;for(var n in this.pull={},s.pull){var h=e[n];this.pull[n]=m(s.pull[n]),h&&h.open&&(this.pull[n].open=!0)}}else for(var r in this.pull={},s.pull)this.pull[r]=s.pull[r];s.branch&&this.branch&&(this.branch=m(s.branch),this.Kr=null)}else{var o,a;if(this.order=p(),this.pull={},g(t))for(var u=0;u<t.length;u++)"object"==k(a=o=t[u])?a.id=a.id||z():a={id:o,value:o},this.order.push(a.id),this.Yr&&this.Yr(a),this.pull[a.id]=a;else for(var c in s)this.order.push(c),this.pull[c]={id:c,value:s[c]}}if(this.Qr&&!s.branch){this.branch={0:[]},this.io||this.so("data");for(var f=0;f<this.order.length;f++){var l=this.order[f];this.Qr(this.pull[l],0,0,!1)}}this.callEvent("onStoreLoad",[]),i||this.callEvent("onStoreUpdated",[])},sync:function(e,n,h){this.unsync();var t=k(e);if("string"==t&&(e=Pt(e)),"function"!=t&&"object"!=t&&(h=n,n=null),"DataStore"!=e.name&&"TreeStore"!=e.name){if(!e.data||"DataStore"!==e.data.name&&"TreeStore"!==e.data.name)return this.eo=e,A("onSyncUnknown",[this,e,n]);e=e.data}var i=C(function(t,i,s){this.no||(n&&this.branch&&(this.qr=!0),this.importData(e,!0),n&&this.silent(n),this.vs&&this.vs(),t&&i&&s||(this.Hr={}),"delete"==s&&this.Hr[t]&&delete this.Hr[t],this.callEvent("onSyncApply",[]),h?h=!1:this.refresh())},this);this.ho=[e.attachEvent("onStoreUpdated",i),e.attachEvent("onIdChange",C(function(t,i){this.changeId(t,i),this.refresh(i)},this))],this.eo=e,this.ro=this.attachEvent("onStoreUpdated",function(t,i,s){"update"!=s&&"save"!=s||(this.no=1,e.updateItem(t,i),this.no=0)}),i()},unsync:function(){if(this.eo){var t=this.eo;if("DataStore"==t.name||"TreeStore"==t.name||t.data&&"DataStore"==t.data.name&&"TreeStore"==t.data.name){for(var i=0;i<this.ho.length;i++)t.detachEvent(this.ho[i]);this.detachEvent(this.ro)}else A("onUnSyncUnknown",[this,t]);this.eo=null}},destructor:function(){this.unsync(),this.pull=this.order=this.Hr=null,this.V=this.B={}},add:function(t,i){if(this.Jr)for(var s in this.Jr)j(t[s])&&(t[s]=this.Jr[s]);this.Yr&&this.Yr(t);var e=this.id(t),n=arguments[2]||this.order,h=n.length;if((j(i)||i<0)&&(i=h),h<i&&(i=Math.min(n.length,i)),!1===this.callEvent("onBeforeAdd",[e,t,i]))return!1;if(this.exists(e),this.pull[e]=t,n.insertAt(e,i),this.Rr){var r=this.Rr.length;this.order.length&&(r=Math.min(i||0,r)),this.Rr.insertAt(e,r)}return this.callEvent("onStoreUpdated",[e,t,"add"]),this.callEvent("onAfterAdd",[e,i]),t.id},remove:function(t){if(g(t))for(var i=0;i<t.length;i++)this.remove(t[i]);else{if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.exists(t);var s=this.getItem(t);this.order.remove(t),this.Rr&&this.Rr.remove(t),delete this.pull[t],this.Hr[t]&&delete this.Hr[t],this.callEvent("onStoreUpdated",[t,s,"delete"]),this.callEvent("onAfterDelete",[t])}},clearAll:function(t){this.pull={},this.Hr={},this.order=p(),this.Rr=null,t||(this.url=null),this.callEvent("onClearAll",[t]),this.refresh()},getIdByIndex:function(t){return this.order[t]},getIndexById:function(t){return this.pull[t]?this.order.find(t):-1},getNextId:function(t,i){return this.order[this.getIndexById(t)+(i||1)]},getFirstId:function(){
  return this.order[0]},getLastId:function(){return this.order[this.order.length-1]},getPrevId:function(t,i){return this.order[this.getIndexById(t)-(i||1)]},sort:function(t,i,s){var e=t;"function"==typeof t?e={as:t,dir:i}:"string"==typeof t&&(e={by:t,dir:i,as:s}),"string"==typeof e.by&&(e.by=e.by.replace(/#/g,""));var n=[e.by,e.dir,e.as,e];this.callEvent("onBeforeSort",n)&&(this.order=this.oo(e,this.order),this.Rr&&this.Rr.length!=this.order.length&&(this.Rr=this.oo(e,this.Rr)),this.refresh(),this.callEvent("onAfterSort",n))},oo:function(t,i){var s=this.sorting.create(t);if(this.order.length){for(var e=i.splice(0,this.$freeze),n=p(),h=i.length-1;0<=h;h--)n[h]=this.pull[i[h]];return n.sort(s),p(e.concat(n.map(function(t){return this.id(t)},this)))}return i},ao:function(t){this.Rr&&!t&&(this.order=this.Rr,delete this.Rr)},uo:function(t,i,s){for(var e=p(),n=this.$freeze||0,h=0;h<this.order.length;h++){var r=this.order[h];(h<n||t(this.getItem(r),i))&&e.push(r)}s&&this.Rr||(this.Rr=this.order),this.order=e},find:function(t,i){var s=[];for(var e in this.pull){var n=this.pull[e],h=!0;if("object"==k(t)){for(var r in t)if(n[r]!=t[r]){h=!1;break}}else t(n)||(h=!1);if(h&&s.push(n),i&&s.length)return s[0]}return i?null:s},filter:function(s,i,t){if((s||this.Rr||this.Kr)&&this.callEvent("onBeforeFilter",[s,i])&&(this.ao(t),this.order.length)){if(s){var e=s;i=i||"","string"==typeof s&&(s=s.replace(/#/g,""),e="function"==typeof i?function(t){return i(t[s])}:(i=i.toString().toLowerCase(),function(t,i){return-1!=(t[s]||"").toString().toLowerCase().indexOf(i)})),this.uo(e,i,t,this.co)}this.refresh(),this.callEvent("onAfterFilter",[])}},fo:function(){for(var t=[],i=this.order.length-1;0<=i;i--)t[i]=this.pull[this.order[i]];return t},each:function(t,i,s){var e=this.order;s&&(e=this.Rr||e);for(var n=0;n<e.length;n++)e[n]&&t.call(i||this,this.getItem(e[n]),n)},lo:function(t,i){return function(){return t[i].apply(t,arguments)}},provideApi:function(t,i){i&&this.mapEvent({onbeforesort:t,onaftersort:t,onbeforeadd:t,onafteradd:t,onbeforedelete:t,onafterdelete:t,ondataupdate:t});for(var s=["sort","add","remove","exists","getIdByIndex","getIndexById","getItem","updateItem","refresh","count","filter","find","getNextId","getPrevId","clearAll","getFirstId","getLastId","serialize","sync"],e=0;e<s.length;e++)t[s[e]]=this.lo(this,s[e])},addMark:function(t,i,s,e,n){var h=this.Hr[t]||{};if(!(this.Hr[t]=h)[i]){if(h[i]=e||!0,s){var r=h.$css||"";h.$css=r+" "+i}n||this.refresh(t)}return h[i]},removeMark:function(t,i,s,e){var n=this.Hr[t];if(n){if(n[i]&&delete n[i],s){var h=n.$css;h&&(n.$css=h.replace(i,"").replace("  "," "))}e||this.refresh(t)}},getMark:function(t,i){var s=this.Hr[t];return!!s&&s[i]},clearMark:function(t,i,s){for(var e in this.Hr){var n=this.Hr[e];n[t]&&(delete n[t],i&&n.$css&&(n.$css=n.$css.replace(t,"").replace("  "," ")),s||this.refresh(e))}},serialize:function(t){var i=this.order;t&&this.Rr&&(i=this.Rr);for(var s=[],e=0;e<i.length;e++){var n=this.pull[i[e]];this.Mr&&!1===(n=this.Mr(n))||s.push(n)}return s},sorting:{create:function(t){return this["do"](t.dir,this.vo(t.by,t.as))},as:{server:function(){return!1},date:function(t,i){return(i-=0)<(t-=0)?1:t<i?-1:0},"int":function(t,i){return(i*=1)<(t*=1)?1:t<i?-1:0},string_strict:function(t,i){return t=t.toString(),(i=i.toString())<t?1:t<i?-1:0},string:function(t,i){return i?t?(t=t.toString().toLowerCase(),(i=i.toString().toLowerCase())<t?1:t<i?-1:0):-1:1},raw:function(t,i){return i<t?1:t<i?-1:0}},vo:function(s,e){return s?("function"!=typeof e&&(e=this.as[e||"string"]),function(t,i){return e(t[s],i[s])}):e},"do":function(t,s){return"asc"!=t&&t?function(t,i){return-1*s(t,i)}:s}}};var ws=P.proto({$init:function(t){t=t||"",this._o={},this.Vt=1,this.data=new gs,this.data.attachEvent("onClearAll",C(this.po,this)),this.data.attachEvent("onServerConfig",C(this.mo,this)),this.attachEvent("onDestruct",this.po),this.data.feed=this.bo,this.data.owner=t.id},bo:function(t,i,s,e){return this.go?(e=mt.defer(),this.go=[t,i,s,e],e):(this.go=!0,this._o.from=t,this._o.count=i,this.wo.call(this,t,i,s,!1,!1,e))},
  wo:function(t,i,s,e,n,h){var r=this,o=null;if(e=e||this.data.url,t<0&&(t=0),n||(n={start:t,count:i}),this.count()&&(n["continue"]="true"),this.getState&&(o=this.getState()),e&&"string"!=typeof e)return o&&(o.sort&&(n.sort=o.sort),o.filter&&(n.filter=o.filter)),this.load(e,0,n).then(function(t){return r.xo(t,s,h)},function(){return r.yo()});e+=-1==e.indexOf("?")?"?":"&";var a=[];for(var u in n)a.push(u+"="+n[u]);if(o&&(o.sort&&a.push("sort["+o.sort.id+"]="+encodeURIComponent(o.sort.dir)),o.filter))for(var c in o.filter){var f=o.filter[c];"object"==k(f)&&(f=wt().stringify(f)),a.push("filter["+c+"]="+encodeURIComponent(f))}return e+=a.join("&"),this._o.url!==e?(this._o.url=e,this.load(e).then(function(t){return r.xo(t,s,h)},function(){return r.yo()})):(this.go=!1,mt.reject())},xo:function(t,i,s){var e=this;return $(function(){return e.yo()},"","",100),i&&wt.$callback(this,i,t),s&&s.resolve(t),t},yo:function(){var t=this.go;this.go=!1,"object"==k(t)&&this.data.feed.apply(this,t)},load:function(t){t=fi.$parse(t);var i=li.load.apply(this,arguments);return this.data.url||(this.data.url=t),i},loadNext:function(t,i,s,e,n){var h=this.Z;if(!h.datathrottle||n)return i||0===i||(i=this.count()),t||(t=h.datafetch||this.count()),this.data.url=this.data.url||e,this.callEvent("onDataRequest",[i,t,s,e])&&this.data.url?this.data.feed.call(this,i,t,s):mt.reject();this.Mo&&window.clearTimeout(this.Mo);var r=mt.defer();return this.Mo=$(function(){r.resolve(this.loadNext(t,i,s,e,!0))},this,0,h.datathrottle),r},So:function(t,i){var s=this._o;return!!(this.go&&s.url&&s.from<=i&&s.count+s.from>=t+i)},removeMissed_setter:function(t){return this.data.Or=t},ko:function(){var t=this.Z.save;!0===t&&(t=this.Z.save=this.Z.url);var i={master:this};t&&t.url?P.extend(i,t):i.url=t,ms(i)},save_setter:function(t){return t&&this.$ready.push(this.ko),t},waitSave:function(t){var i=this;return ms(this).pr(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=fi.$parse(t),this.data.attachEvent("onBeforeFilter",C(function(t,i){var s=this;if("function"==typeof t)return!0;if(this.Z.dataFeed&&(t||i)){t=t||"id",i&&"object"==k(i)&&(i=i.id),this.clearAll();var e=this.Z.dataFeed;if("string"==typeof e){var n="filter["+t+"]="+encodeURIComponent(i);this.load(e+(e.indexOf("?")<0?"?":"&")+n,this.Z.datatype)}else{var h={};h[t]=i,"function"==typeof e?e.call(this,i,h):e.$proxy&&e.load&&e.load(this,{filter:h}).then(function(t){return s.Bt(t)},function(t){return s.Ht(t)})}return!1}},this)),t},Pt:function(){if(this.Z.ready&&!this.Co){var t=b(this.Z.ready,this.$scope);t&&$(t,this,arguments),this.callEvent&&$(this.callEvent,this,["onReady",[]]),this.Co=!0}},po:function(t){this.Vt++,t||(this.go=!1,this._o={},this.waitData=mt.defer())},mo:function(t){this.Li(t)}},li),xs={getState:function(){for(var t=this.config.columns.length,i=this.config.columns,s={ids:[],size:[],select:this.getSelectedId(!0),scroll:this.getScrollState()},e=0;e<t;e++){var n=i[e];s.ids.push(n.id),s.size.push(n.fillspace||n.adjust?-1:n.width)}if(s.order=[].concat(this.$o.length?this.$o:s.ids),this.Do&&(s.sort={id:this.Do,dir:this.Io}),this.Ao&&this.To){var h={},r=0;for(var o in this.Ao)if(!this.Fo[o]){var a=this.Ao[o];a[1].value=h[o]=a[2].getValue(a[0]),r=1}r&&(s.filter=h)}for(var u in s.hidden=[],this.Fo)s.hidden.push(u);return s},setState:function(t){var i=this.config.columns;if(t){if(this.Do=null,this.blockEvent(),t.order&&t.order.length&&(this.$o=[].concat(t.order),this.zo=[this.Z.leftSplit,t.order.length-this.Z.rightSplit]),t.hidden){for(var s={},e=0;e<t.hidden.length;e++)s[t.hidden[e]]=!0,this.$o.length||this.hideColumn(t.hidden[e]);if(this.$o.length)for(var n=0;n<this.$o.length;n++){var h=this.$o[n];!!s[h]==!this.Fo[h]&&this.hideColumn(h,{},!1,!!s[h])}}if(t.ids){for(var r=!1,o=this.config.columns,a=0;a<o.length;a++)o[a].id!=t.ids[a]&&(r=!0);if(r){for(var u=0;u<t.ids.length;u++)o[u]=this.getColumnConfig(t.ids[u])||o[u];this.refreshColumns()}}if(t.size)for(var c=Math.min(t.size.length,i.length),f=0;f<c;f++){var l=i[f]
  ;l&&0<t.size[f]&&l.width!=t.size[f]&&(delete l.fillspace,delete l.adjust,this.Vo(f,t.size[f],!0))}this.unblockEvent();var d=!(this.Z.leftSplit||this.Z.rightSplit);if(this.Bo(d),this.callEvent("onStructureUpdate",[]),t.sort){var v=i[this.getColumnIndex(t.sort.id)];v&&this.Ho(t.sort.id,t.sort.dir,v.sort)}if(t.filter){var _=this.filterByAll;for(var p in this.filterByAll=function(){},t.filter){var m=t.filter[p];if(m&&this.Ao[p]){var b=this.Ao[p];b[2].setValue(b[0],m);var g=b[1].contentId;g&&(this.Ro[g].value=m)}}for(var w in this.Ao)if(!t.filter[w]){var x=this.Ao[w];x[2].setValue(x[0],"")}this.filterByAll=_,this.filterByAll()}if(t.select&&this.select){var y=t.select;this.unselect();for(var M=0;M<y.length;M++)y[M].row&&!this.exists(y[M].row)||this.Po(y[M],!0)}t.scroll&&this.scrollTo(t.scroll.x,t.scroll.y)}}},ys={jo:function(t,i,s){i||is.addDrop(t.Zi,t,!0),s||is.addDrag(t.Zi,t),this.attachEvent("onDragOut",function(t,i){this.$dragMark(t,i)}),this.attachEvent("onBeforeAutoScroll",function(){var t=is.getContext();return!(!is.en||!t||t.to!==this&&!this.Eo)})},drag_setter:function(t){return t&&(P.extend(this,vi,!0),"order"!=t&&"move"!=t||P.extend(this,d("DragOrder"),!0),"inner"!=t&&"order"!=t||(this.No=!0),this.jo(this,"source"==t,"target"==t),delete this.drag_setter),t},$dragIn:function(t,i,s){var e=this.locate(s)||null,n=is["in"];if((this.No||n.from.No)&&n.from!==this)return!1;var h=is.getMaster(i),r=this.getItemNode(e,s)||this.mt;return r==is.mn?r:(n.target=e,n.to=h,this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),!1!==this.Z.dragscroll&&(this.Jt=$(function(t,i){this.Lo(i),this.Yt(t,i)},this,[K(s),e],250)),this.$dropAllow(n,s)&&this.callEvent("onBeforeDragIn",[n,s])?(this.$dragMark(n,s),r):(n.to=n.target=null,this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),null))},$dropAllow:function(){return!0},Lo:function(){},Oo:function(t){return t&&"object"===k(t)?t.toString():t},$dragOut:function(t,i,s,e){var n=(this.et.contains(s)?this.locate(e):null)||null,h=is["in"];return(h.target||"").toString()==(n||"").toString()||(this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),h.target=h.to=null,this.callEvent("onDragOut",[h,e])),null},$drop:function(t,i,s){var e=is["in"];(e.to=this).Uo(t,i,e),this.$dragMark({},s),e.from&&e.from!=e.to&&e.from.callEvent&&!e.from.callEvent("onBeforeDropOut",[e,s])||this.callEvent("onBeforeDrop",[e,s])&&(this.Yo(e,s),this.callEvent("onAfterDrop",[e,s]))},Uo:function(t,i,s){var e=this.Oo(s.target);this.getBranchIndex?s.index=e?(s.parent=this.getParentId(e),this.getBranchIndex(e)):-1:s.index=e?this.getIndexById(e):this.count()},Yo: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)}},tn:function(t,i){if(this.getItemNode){var s=this.locate(i,!0),e=s?this.getItemNode(s):null;return e?Z(e):e}},$drag:function(t,i){var s=this.locate(i,!0);if(s){var e=[s];if(this.getSelectedId){var n=this.getSelectedId(!0,!0);if(n&&1<n.length&&-1!=x.find.call(n,s)){var h={};e=[];for(var r=0;r<n.length;r++)h[n[r]]=!0;for(var o=0;o<this.data.order.length;o++){var a=this.data.order[o];h[a]&&e.push(a)}}}var u=is["in"]={source:e,start:s};if(u.fragile=this.addRowCss&&S.touch&&(S.isWebKit||S.isFF),(u.from=this).callEvent("onBeforeDrag",[u,i]))return Ki&&(Ki.ne=null),u.html||this.$dragHTML(this.getItem(s),i,u)}return null},$dragHTML:function(t,i,s){var e=this.Ot(t);return g(s.source)&&1<s.source.length&&(e=this.Wo(e,s.source.length)),e},Wo:function(t,i){var s="<div class='webix_drag_multiple'></div>";return 2<i&&(s="<div class='webix_drag_multiple_last'></div>"+s),s+(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.Oo(t.target)),this.Go&&this.Go!=i&&(t.fragile||this.Xo([this.Go],"webix_drag_over",!0),this.Go=null),!this.Go&&i?(this.Go=i,t.fragile||this.Jo([i],"webix_drag_over",!0),i):!!t.to},Jo:function(t,i){for(var s=0;s<t.length;s++)this.addCss(t[s],i)},Xo:function(t,i){for(var s=0;s<t.length;s++)this.removeCss(t[s],i)},$dropHTML:function(){return""},Zo:function(t,i){var s=this.getItemNode(t
  );s?s.parentNode.insertBefore(is.xn[0],s):i.children[0].appendChild(is.xn[0])}},Ms={$drag:function(t,i){var s=ys.$drag.apply(this,arguments);if(!s)return s;var e=is["in"];return this.qo&&this.qo(e),this.No&&this.getBranchIndex&&(this.Ko=this.Qo?20*(this.getItem(e.start).$level+1)+8:0),g(e.source)&&!e.fragile&&(is.bn(i),this.Jo(e.source,"webix_invisible")),s},$dragIn:function(t,i,s){var e=ys.$dragIn.apply(this,arguments);if(!e)return e;is.xn||(is.xn=this.ta());var n=is["in"],h="$webix-last";if(n.target&&(h=this.Oo(n.target)),"$webix-last"!=h&&"$webix-drop"!=h){var r={direction:this.Z.layout||this.ia||"y",x:"width",y:"height"},o=Z(e);2*(K(s)[r.direction]-o[r.direction])>o[r[r.direction]]&&(h=this.getNextId(h)||"$webix-last")}return h==this.sa||"$webix-drop"==h||(this.sa=h,this.Zo(h,i)),e},$dragPos:function(t){if(!this.No){var i=is["in"];return t.y+=i.y_offset,void(t.x+=i.x_offset)}var s=Z(this.$view);if("x"==this.Z.layout)if(s.x-=12,t.y=s.y-8,t.x=t.x-18,t.x<s.x)t.x=s.x;else{var e=s.x+s.width;t.x>e&&(t.x=e)}else if(s.y+=(this.ea||0)-12,t.x=s.x+8+(this.Ko||0),t.y=t.y-18,t.y<s.y)t.y=s.y;else{var n=s.y+s.height-(this.ea||0);t.y>n&&(t.y=n)}},$dragOut:function(t,i,s){return i!=s&&(G(is.xn),this.sa=is.xn=null),ys.$dragOut.apply(this,arguments)},Uo:function(t,i,s){var e="$webix-last"==this.sa?null:this.sa;this.getBranchIndex?e?(s.parent=this.getParentId(e),s.index=this.getBranchIndex(e),t==i&&this.getParentId(s.start)==s.parent&&this.getBranchIndex(s.start)<s.index&&(s.index-=1)):s.index=-1:(s.index=e?this.getIndexById(e):this.count(),s.index-=t==i&&this.getIndexById(s.start)<s.index?1:0)},$dragDestroy:function(){var t=is["in"];g(t.source)&&!t.fragile&&this.Xo(t.source,"webix_invisible"),G(is.Ji)},ta: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.na,"$webix-drop"),[t]},$dragMark:function(){return!1}};u("DragOrder",Ms);var Ss={$init:function(){this.ha=P.extend([],x,!0),this.ra=-1},undo_setter:function(t){return t&&(this.oa(),this.oa=function(){}),t},oa:function(){var n=this;this.attachEvent("onBeforeDrop",function(t){if(t.from==t.to){var i=n.aa=m(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.aa&&n.aa.id==t){var i=n.aa;n.aa=null,n.ua(t,i,"move")}}),this.data.attachEvent("onBeforeDelete",function(t){if(this.getItem(t)){var i=n.ca=m(this.getItem(t));this.branch?(i.$index=this.getBranchIndex(t),this.branch[t]&&(i.$branch=m(this.serialize(t)))):i.$index=this.getIndexById(t)}}),this.data.attachEvent("onDataUpdate",function(t,i,s){n.ua(t+"",s,"update")}),this.data.attachEvent("onStoreUpdated",function(t,i,s){var e=null;t&&("add"==s?e=m(i):"delete"==s&&(e=n.ca),e&&n.ua(t,e,s))}),this.data.attachEvent("onIdChange",function(t,i){"object"==k(t)&&(t=t.row);for(var s=0;s<n.ha.length;s++)n.ha[s].id==t&&(n.ha[s].id=i)})},ua:function(t,i,s){!this.fa&&this.Z.undo&&(this.ha.push({id:t,action:s,data:i}),20==this.ha.length&&this.ha.splice(0,1),this.la||(this.ra=this.ha.length-1))},ignoreUndo:function(t,i){this.fa=!0,t.call(i||this),this.fa=!1},removeUndo:function(t){for(var i=this.ha.length-1;0<=i;i--)this.ha[i].id==t&&("id"==this.ha[i].action&&(t=this.ha[i].data),this.ha.removeAt(i));this.ra=this.ha.length-1},undo:function(s){if(s)this.ignoreUndo(function(){var t,i;for(i=this.ha.length-1;!t&&0<=i;i--)this.ha[i].id==s&&(t=this.ha[i]);t&&(this.da(t),this.ha.removeAt(i+1),this.ra=this.ha.length-1)});else{var t=this.ha[this.ra];t&&(this.ignoreUndo(function(){this.da(t),this.ha.removeAt(this.ra)}),this.ra--)}},da:function(t){if("delete"==t.action){var i=null,s=t.data.$parent;t.data.$branch&&(i={parent:t.id,data:m(t.data.$branch)},delete t.data.$branch,s&&!this.data.branch[s]&&(s=0)),this.add(t.data,t.data.$index,s),i&&this.parse(i)}else"add"==t.action?this.remove(t.id):"update"==t.action?this.updateItem(t.id,t.data):"move"==t.action&&(t.data.$parent?this.getItem(t.data.$parent
  )&&this.move(t.id,t.data.$index,null,{parent:t.data.$parent}):this.move(t.id,t.data.$index))}};function ks(t){return"string"==typeof t?t:t.linkInput?t.Z.id:("object"==k(t)?(g(t)&&(t={data:t}),t.view=t.view||"suggest"):!0===t&&(t={view:"suggest"}),zt(t).config.id)}function Cs(t){return((t.header&&t.header[0]?t.header[0].text:t.editValue||t.label)||"").toString().replace(/<[^>]*>/g,"")}var $s={text:{focus:function(){this.getInputNode(this.node).focus(),this.getInputNode(this.node).select()},getValue:function(){return this.getInputNode(this.node).value},setValue:function(t){var i=this.getInputNode(this.node);i.value=t,function n(t,i){var s=t.config.suggest;if(s){var e=Pt(t.config.suggest=ks(s));e&&i&&e.linkInput(i)}}(this,i)},getInputNode:function(){return this.node.firstChild},render:function(){return Y("div",{"class":"webix_dt_editor"},"<input type='text' aria-label='"+Cs(this.config)+"'>")}},"inline-checkbox":{render:function(){return{}},getValue:function(){return this.node.checked},setValue:function(){},focus:function(){this.node.focus()},getInputNode:function(){},$inline:!0},"inline-text":{render:function(){return{}},getValue:function(){return this.node.value},setValue:function(){},focus:function(){try{this.node.select(),this.node.focus()}catch(Bo){}},getInputNode:function(){},$inline:!0},checkbox:{focus:function(){this.getInputNode().focus()},getValue:function(){return this.getInputNode().checked},setValue:function(t){this.getInputNode().checked=!!t},getInputNode:function(){return this.node.firstChild.firstChild},render:function(){return Y("div",{"class":"webix_dt_editor"},"<div><input type='checkbox' aria-label='"+Cs(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(g(t))for(var s=0;s<t.length;s++){var e=t[s],n=j(e.id),h=n?e:e.id,r=n?e:e.value;i+="<option value='"+h+"'>"+r+"</option>"}else for(var o in t)i+="<option value='"+o+"'>"+t[o]+"</option>";return Y("div",{"class":"webix_dt_editor"},"<select aria-label='"+Cs(this.config)+"'>"+i+"</select>")}},popup:{focus:function(){this.getInputNode().focus()},destroy:function(){this.getPopup().hide()},getValue:function(){return this.getInputNode().getValue()||""},setValue:function(t){this.getPopup().show(this.node),this.getInputNode().setValue(t)},getInputNode:function(){return this.getPopup().getChildViews()[0]},getPopup:function(){return this.config.$popup||(this.config.$popup=this.createPopup()),Pt(this.config.$popup)},createPopup:function(){var t,i=this.config.popup||this.config.suggest;if(i)return(t="object"!=k(i)||i.name?Pt(i):(i.view=i.view||"suggest",zt(m(i)))).va||(t.linkInput?t.linkInput(document.body):this.linkInput&&this.linkInput(document.body),t.va=!0),t;var s=$s.$popup[this.popupType];return"string"==typeof s||s.name||(s=$s.$popup[this.popupType]=zt(s),this.popupInit(s),s.linkInput||this.linkInput(document.body)),s.Z.id},linkInput:function(t){Nt(D(t),"keydown",C(function(t){if(this.config.$popup){var i,s=t.which||t.keyCode,e=this.getInputNode();if(e.isVisible())if(e.moveSelection&&s<41&&32<s)33==s&&(i="pgup"),34==s&&(i="pgdown"),35==s&&(i="bottom"),36==s&&(i="top"),37==s&&(i="left"),38==s&&(i="up"),39==s&&(i="right"),40==s&&(i="down"),e.moveSelection(i);else 13!==s||"TEXTAREA"===t.target.nodeName&&t.shiftKey||A("onEditEnd",[])}},this))},popupInit:function(){},popupType:"text",render:function(){return{}},$inline:!0}};$s.color=P.extend({focus:function(){},popupType:"color",popupInit:function(t){t.getChildViews()[0].attachEvent("onItemClick",function(t){A("onEditEnd",[t])})}},$s.popup),$s.date=P.extend({focus:function(){},popupType:"date",setValue:function(t){this._a=this.config.stringResult||t&&"string"==typeof t,$s.popup.setValue.call(this,t)},getValue:function(){return this.getInputNode(
  ).getValue(this._a?ct.parseFormatStr:"")||""},popupInit:function(t){t.getChildViews()[0].attachEvent("onDateSelect",function(t){A("onEditEnd",[t])})}},$s.popup),$s.combo=P.extend({pa:function(t){return this.config.popup?this.config.popup.config.id:t?ks(t):this.ma(t)},ma:function(){var t=$s.combo;return t.ba=t.ba||this.pa(!0)},render:function(){var t=Y("div",{"class":"webix_dt_editor"},"<input type='text' role='combobox' aria-label='"+Cs(this.config)+"'>"),i=this.config.suggest=this.pa(this.config.suggest);return i&&(Pt(i).linkInput(t.firstChild,!0),Nt(t.firstChild,"click",C(this.showPopup,this))),t},getPopup:function(){return Pt(this.config.suggest)},showPopup:function(){var t=this.getPopup(),i=t.getList(),s=this.getInputNode(),e=this.ga;t.show(s),s.setAttribute("aria-expanded","true"),e?(i.exists(e),i.exists(e)&&(i.select(e),i.showItem(e))):(i.unselect(),i.showItem(i.getFirstId())),t.wa=s},afterRender:function(){this.showPopup()},setValue:function(t){if(this.ga=t,this.config.suggest){var i=Pt(this.config.suggest),s=this.config.collection||this.config.options;s&&i.getList().data.importData(s),this.getInputNode(this.node).value=i.getItemText(t)}},getValue:function(){var t=this.getInputNode().value;if(this.config.suggest){var i=Pt(this.config.suggest),s=i.getList();(t||s.getSelectedId&&s.getSelectedId())&&(t=i.getSuggestion(t))}return t}},$s.text),$s.richselect=P.extend({focus:function(){},getValue:function(){return this.getPopup().getValue()},setValue:function(t){var i=this.config.collection||this.config.options;this.getInputNode(),i&&this.getPopup().getList().data.importData(i),this.getPopup().show(this.node),this.getPopup().setValue(t)},getInputNode:function(){return this.getPopup().getList()},popupInit:function(t){t.linkInput(document.body)},popupType:"richselect"},$s.popup),$s.password=P.extend({render:function(){return Y("div",{"class":"webix_dt_editor"},"<input type='password' aria-label='"+Cs(this.config)+"'>")}},$s.text),$s.$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 Ds={defaults:{editaction:"click"},$init:function(t){this.xa={},this.Hi=0,this.S=0,this.Zi.style.position="relative",t&&(t.onDblClick=t.onDblClick||{}),this.attachEvent("onAfterRender",this.ya),this.Z.editable&&this.Ma(),P.extend(this,Ss)},Sa:function(t){try{if("number"==typeof t.selectionStart)t.selectionStart=t.selectionEnd=t.value.length;else if("undefined"!=typeof t.createTextRange){var i=t.createTextRange();i.collapse(!1),i.select()}}catch(Bo){}},ya:function(){var t=this.getEditor();if(t&&t.$inline&&!t.getPopup){var i=this.ka(t);if(i&&i!=t.node){var s=t.node.value;(t.node=i).value=s,i.focus(),this.Sa(i)}else this.editStop()}},editable_setter:function(t){return t&&this.Ma(),t},Ma:function(){T("onEditEnd",C(function(){this.Hi&&this.editStop()},this)),T("onClick",C(function(t){this.Hi&&200<new Date-this.S&&(this.Yi&&!this.Yi.popupType&&t&&this.Yi.node&&this.Yi.node.contains(t.target||t.srcElement)||this.editStop())},this)),this.data.attachEvent&&this.data.attachEvent("onIdChange",C(function(t,i){this.Ca(t,i)},this)),this.attachEvent("onItemClick",function(t){this.Z.editable&&"click"==this.Z.editaction&&this.edit(t)}),this.attachEvent("onItemDblClick",function(t){this.Z.editable&&"dblclick"==this.Z.editaction&&this.edit(t)}),this.$a=C(function(){this.S=new Date},this),this.Ma=function(){},this.Da&&this.Da()},Ia:function(){$(function(){var t=this.getEditor();if(t&&t.config.liveEdit){var i={value:t.getValue(),old:t.value};if(i.value==i.old)return;t.value=i.value,this.Aa(t,i.value,!1),this.callEvent("onLiveEdit",[i,t])}},this)},Ta:function(t){var i=this.Z.form;"string"!=typeof i&&(this.Z.form=i=zt(i).config.id);var s=(i=Pt(i)).setValues?i:i.getChildViews()[0];s.setValues(this.getItem(t.row||t)),i.config.master=this.config.id,i.show(this.getItemNode(t))
  ;var e=s.getChildViews()[0];e.focus&&e.focus()},edit:function(t,i,s){if(this.Z.editable&&this.callEvent("onBeforeEditStart",[t])){if(this.Z.form)return this.Ta(t);var e=this.Fa(t);if(e){if(this.getEditor(t))return;i||this.editStop(),$s[e];var n=P.extend({},$s[e]),h=this.za(t,n,s);n.config.liveEdit&&(this.Va=this.attachEvent("onKeyPress",this.Ia));var r=n.getPopup?n.getPopup(h).et:h;return r&&Nt(r,"click",this.$a),h&&Nt(h,"change",this.Ba,{bind:{view:this,id:t}}),!1!==s&&n.focus(),this.$fixEditor&&this.$fixEditor(n),this.S=M.edit_open_time=new Date,Ii.setFocus(this,!0),this.callEvent("onAfterEditStart",[t]),n}return null}},getEditor:function(t){return t?this.xa[t]:this.Yi},Ca:function(t,i){var s=this.xa[t];s&&((this.xa[i]=s).id=i,delete this.xa[t])},Ba:function(){this.view.hasEvent("onEditorChange")&&this.view.callEvent("onEditorChange",[this.id,this.view.getEditorValue(this.id)])},Ha:function(){return this.Z},za:function(t,i,s){i.config=this.Ha(t);var e=i.render();i.$inline&&(e=this.ka(t)),i.node=e;var n=this.getItem(t),h=n[this.Z.editValue||"value"];return j(h)&&(h=""),i.setValue(h,n),i.value=h,this.Ra(t,i),!1!==s&&this.showItem(t),i.$inline||this.Pa(t,e,!0),i.afterRender&&i.afterRender(),e},ja:function(t){return this.getItemNode(t)},ka:function(t){var i=this.ja(t);return i&&(i=i.getElementsByTagName("input")[0]||i),i},Fa:function(){return this.Z.editor},Ra:function(t,i){i.id=t,this.xa[t]=this.Yi=i,this.Hi++},Ea:function(t){this.Yi==t&&(this.Yi=0),t.destroy&&t.destroy(),delete t.popup,delete t.node,delete this.xa[t.id],this.Hi--},focusEditor:function(){var t=this.getEditor.apply(this,arguments);t&&t.focus&&t.focus()},editCancel:function(){this.editStop(null,null,!0)},yi:function(t){if(t){var i=this.getEditor();if(i&&i.getPopup&&i.getPopup()==t.getTopParentView())return}this.editStop()},editStop:function(t){if(!this.Na){this.Na=1;var i=arguments[2],s=1;return t?s=this.La(this.xa[t],i):this.Oa(function(t){s*=this.La(t,i)}),this.Na=0,s}},qt:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Zi}},Pa:function(t,i,s){if(i.style){var e=this.qt(t);return i.style.top=e.top+"px",i.style.left=e.left+"px",i.style.width=e.width-1+"px",i.style.height=e.height-1+"px",i.top=e.top,s&&e.parent.appendChild(i),e}},Oa:function(t){for(var i in this.xa)t.call(this,this.xa[i])},La:function(t,i){if(t&&!M.k){var s={value:this.Ua(t),old:t.value};if(this.callEvent("onBeforeEditStop",[s,t,i])){if(!i){var e=s.old;if("string"==typeof s.value&&(e+=""),e!=s.value||t.config.liveEdit){var n=this.Aa(t,s.value,!0);this.updateItem(t.row||t.id,n)}}t.$inline?t.node=null:G(t.node);var h=t.config.suggest;return h&&"string"==typeof h&&Pt(h).hide(),this.Ea(t),this.Va&&this.detachEvent(this.Va),this.callEvent("onAfterEditStop",[s,t,i]),1}return 0}},validateEditor:function(t){var i=!0;if(this.Z.rules){var s=this.getEditor(t),e=s.column||this.Z.editValue||"value",n=this.Z.rules[e],h=this.Z.rules.$all;if(n||h){var r=this.data.getItem(s.row||s.id),o=s.getValue(),a=s.getInputNode();n&&(i=n.call(this,o,r,e)),h&&(i=h.call(this,o,r,e)&&i),i?et(a,"webix_invalid"):st(a,"webix_invalid"),A("onLiveValidation",[s,i,r,o])}}return i},getEditorValue:function(t){var i;if(i=0===arguments.length?this.Yi:this.getEditor(t))return i.getValue()},getEditState:function(){return this.Yi||!1},editNext:function(t,i){if(t=!1!==t,1==this.Hi||i){var s=this.Ya(this.Yi||i,function(t){return!!this.Fa(t)},t);if(this.editStop())return s&&(this.edit(s),this.Wa(s)),!1}},Wa:function(){},Ya:function(t,i,s){var e=this.getIndexById(t.id),n=this.data.order;if(s){for(var h=e+1;h<n.length;h++)if(i.call(this,n[h]))return n[h]}else for(var r=e-1;0<=r;r--)if(i.call(this,n[r]))return n[r];return null},Ua:function(t){return t.getValue()},Aa:function(t,i,s){var e=s?{}:this.getItem(t.id);return e[this.Z.editValue||"value"]=i,e}},Is={$init:function(){this.$view.className+=" webix_flexlayout"},Ga:function(){},Xa:function(){},Ja:function(){},$getSize:function(){var t=0,i=0,s=this.Z.gravity;this.Za=[];for(var e=0;e<this.ji.length;e++){
  var n=this.ji[e].$getSize(0,0);this.Za.push(n),t=Math.max(t,n[0]),i=Math.max(i,n[2])}return t+=this.qa.left+this.qa.right,i+=this.qa.top+this.qa.bottom,this.Z.width&&(t=Math.max(t,this.Z.width)),this.Z.height&&(i=Math.max(i,this.Z.height)),[t,1e5,i,1e5,s]},render:function(){this.resize()},Ka:function(){if(this.isVisible(this.Z.id)){var t=this.$view.style,i=Math.round(this.Qa/2);t.paddingTop=this.qa.top-i+"px",t.paddingBottom=this.qa.bottom-i+"px",t.paddingLeft=this.qa.left-i+"px",t.paddingRight=this.qa.right-i+"px";for(var s=0;s<this.ji.length;s++)if(!this.ji[s].Z.hidden){var e=this.ji[s].$view,n=this.Za[s],h=this.ji[s].Z;e&&(e.style.minWidth=n[0]+"px",n[1]<1e5&&n[1]!=n[0]&&(e.style.maxWidth=n[1]+"px"),e.style.flexBasis=h.flexBasis||n[0]+"px",e.style.flexGrow=h.flexGrow||(n[1]!=n[0]?n[4]:0),e.style.height=n[3]!=n[2]?"auto":n[2]+"px",e.style.minHeight=n[2]+"px",n[3]<1e5&&n[3]!=n[2]&&(e.style.maxHeight=n[3]+"px"),e.style.margin=i+"px")}for(var r=[],o=0;o<this.ji.length;o++)if(!this.ji[o].Z.hidden){var a=this.ji[o].$view;r[o]=[a.offsetWidth,a.offsetHeight]}for(var u=0;u<this.ji.length;u++)if(!this.ji[u].Z.hidden){var c=this.ji[u];if(c.$view){c.Z.flex=!0;var f=this.Za[u],l=f[2]==f[3]?f[2]:r[u][1];c.$setSize(r[u][0],l),c.Z.flex=!1}}this.$height=this.Is=this.$view.scrollHeight,this.$view.style.height=this.Is+"px"}}},As={sum:function(t,i){i=i||this;for(var s=0,e=0;e<i.length;e++){var n=parseFloat(t(i[e]),10);isNaN(n)||(s+=n)}return s},min:function(t,i){i=i||this;for(var s=Infinity,e=0;e<i.length;e++){var n=parseFloat(t(i[e]),10);isNaN(n)||n<s&&(s=n)}return s===Infinity?0:1*s},max:function(t,i){i=i||this;for(var s=-Infinity,e=0;e<i.length;e++){var n=parseFloat(t(i[e]),10);isNaN(n)||s<n&&(s=n)}return s===-Infinity?0:1*s},count:function(t,i){for(var s=0,e=0;e<i.length;e++){var n=t(i[e]);null!=n&&s++}return s},any:function(t,i){return t(i[0])},string:function(t){return t.$name}},Ts={$init:function(){this.attachEvent("onClearAll",this.tu),this.attachEvent("onSyncApply",this.tu)},tu:function(){this.getBranchIndex?this.iu=this.su=null:this.Nr=this.eu=null},ungroup:function(t){if(this.getBranchIndex)return this.nu.apply(this,arguments);this.Nr&&(this.order=this.Nr,this.pull=this.eu,this.eu=this.Nr=null),t||this.callEvent("onStoreUpdated",[])},Er:function(t){this.blockEvent(),this.group(t),this.unblockEvent()},hu:function(i){if("function"==typeof i)return i;var t=function(t){return t[i]};return t.$name=i,t},group:function(s,t){var i;if("string"==typeof s?(i=s,s={by:this.hu(s),map:{}}):"function"==typeof s?s={by:s,map:{}}:"string"==typeof s.by&&(i=s.by,s.by=this.hu(s.by)),s.map=s.map||{},i&&!s.map[i]&&(s.map[i]=[i]),s.missing=s.missing===undefined||s.missing,this.getBranchIndex)return this.ru(s,t);var e={},n=[],h=[];this.each(function(t){var i=s.by(t);if(!i&&0!==i){if(!1===s.missing)return;if(!0===s.missing)return void h.push(t);i=s.missing}e[i]||(n.push({id:i,value:i,$group:!0,$row:s.row}),e[i]=p()),e[i].push(t)});for(var r=0;r<n.length;r++){var o=n[r];this.ou(s.map,o,e[n[r].id]),this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[o.id,o.value,e[n[r].id]])}this.Nr||(this.Nr=this.order,this.eu=this.pull),this.order=p(),this.pull={},this.au(n),this.au(h),this.callEvent("onStoreUpdated",[])},au:function(t){for(var i=0;i<t.length;i++){var s=this.id(t[i]);this.pull[s]&&(s=t[i].id=z()),this.pull[s]=t[i],this.order.push(s),this.Yr&&this.Yr(t[i])}},ou:function(t,i,s){for(var e in t){var n=t[e][1]||"any",h=this.hu(t[e][0]);"function"!=typeof n&&(As[n],n=As[n]),i[e]=n.call(this,h,s)}},ru:function(t,i){var s=0;i?s=this.getItem(i).$level:i=0,this.iu||(this.iu=m(this.branch),this.su=[]);for(var e=[],n=[],h=[],r=this.branch[i],o=0;o<r.length;o++){var a=this.getItem(r[o]),u=t.by(a);if(!u&&0!==u){if(!1===t.missing)continue;if(!0===t.missing){h.push(a.id);continue}u=t.missing}var c=s+"$"+u,f=this.branch[c];if(!f){var l=this.pull[c]={id:c,value:u,$group:!0,$row:t.row};this.Yr&&this.Yr(l),n.push(l),(f=this.branch[c]=[]).uu=[],e.push(c)}f.push(a.id),f.uu.push(a)}this.su=this.su.concat(e),this.branch[i]=e.concat(h);for(var d=0;d<n.length;d++){
  var v=n[d];if(this.ou(t.map,v,this.branch[n[d].id].uu),this.hasEvent("onGroupCreated")&&this.callEvent("onGroupCreated",[v.id,v.value,this.branch[v.id].uu]),t.footer){var _="footer$"+v.id,p=this.pull[_]={id:_,$footer:!0,value:v.value,$level:s,$count:0,$parent:v.id,$row:t.footer.row};this.ou(t.footer,p,this.branch[n[d].id].uu),this.branch[v.id].push(p.id),this.callEvent("onGroupFooter",[p.id,p.value,this.branch[v.id].uu])}delete this.branch[v.id].uu}this.cu(this.branch[i],i,s+1),this.callEvent("onStoreUpdated",[])},nu:function(t){if(this.iu){for(this.branch=this.iu;this.su.length;)delete this.pull[this.su.pop()];this.iu=this.su=null,this.cu(this.branch[0],0,1)}t||this.callEvent("onStoreUpdated",[])},cu:function(t,i,s){i&&(this.getItem(i).$count=t.length);for(var e=0;e<t.length;e++){var n=this.pull[t[e]];n.$level=s,n.$parent=i;var h=this.branch[n.id];h&&this.cu(h,n.id,s+1)}}},Fs={$init:function(){P.extend(this.data,Ts)},group:function(t,i){i||0===i||this.data.ungroup(!0),this.data.group(t,i)},ungroup:function(t){this.data.ungroup(t)}},zs={$init:function(){var t=this;(Xi.customRadio||this.addOption)&&this.$ready.push(function(){Nt(t.$view,"keydown",t.fu,{bind:t})})},Mi:function(){if(!Ii.canFocus(this))return!1;var t=this.lu();if(t)for(var i=0;i<t.length;i++)"0"==t[i].getAttribute("tabindex")&&t[i].focus()},du:function(){var t=this.lu();if(t)for(var i=0;i<t.length;i++)"0"==t[i].getAttribute("tabindex")&&t[i].blur()},fu:function(t){var i=t.which||t.keyCode;if((this.addOption?34:36)<i&&i<41){var s;Q(t);var e=this.lu();if(35==i)s=e.length-1;else if(36===i)s=0;else for(var n=37===i||38===i?-1:1,h=0;h<e.length;h++)if("0"==e[h].getAttribute("tabindex")){(s=h+n)<0?s=e.length-1:s>=e.length&&(s=0);break}if(!j(s)){var r=e[s].getAttribute("button_id");this.setValue(r),e[s].focus()}}},Es:function(t,i){for(var s=i.target||i.srcElement;s&&!s.webix_tooltip;){var e=s.getAttribute("webix_t_id");if(e)return this.getOption(e);s=s.parentNode}return null},getOption:function(t){for(var i=this.vu(this.Z.options),s=0;s<i.length;s++)if(i[s].id==t)return i[s];return null}},Vs=P.proto({$init:function(t){this.na="map_"+z(),this._u=t,this.pu=[],this.mu=[]},addRect:function(t,i,s){this.bu(t,"RECT",i,s)},addPoly:function(t,i,s){this.bu(t,"POLY",i,s)},bu:function(t,i,s,e){var n="";4==arguments.length&&(n="userdata='"+e+"'"),this.pu.push("<area "+this._u+"='"+t+"' shape='"+i+"' coords='"+s.join()+"' "+n+"></area>"),this.mu.push({index:e,points:s})},addSector:function(t,i,s,e,n,h,r,o){var a=[];a.push(e),a.push(Math.floor(n*r));for(var u=i;u<s;u+=Math.PI/18)a.push(Math.floor(e+h*Math.cos(u))),a.push(Math.floor((n+h*Math.sin(u))*r));return a.push(Math.floor(e+h*Math.cos(s))),a.push(Math.floor((n+h*Math.sin(s))*r)),a.push(e),a.push(Math.floor(n*r)),this.addPoly(t,a,o)},hide:function(t,i,s){if(t.querySelectorAll)for(var e=t.querySelectorAll('area[userdata="'+i+'"]'),n=0;n<e.length;n++){var h=e[n];s?h.getAttribute("coords")&&(h.coordsdis=h.getAttribute("coords"),h.setAttribute("coords",""),h.coords=""):s||h.coordsdis&&(h.setAttribute("coords",h.coordsdis),h.coords=h.coordsdis,h.coordsdis=""),e[n].style.display=s?"none":""}},render:function(t){var i=Y("DIV");i.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;",t.appendChild(i);var s=S.isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";i.innerHTML="<map id='"+this.na+"' name='"+this.na+"'>"+this.pu.join("\n")+"</map><img "+s+" class='webix_map_img' usemap='#"+this.na+"'>",t.Gi=i,this.pu=[]}}),Bs={$init:function(){this.Ss={},this.ks={},this.getTopParentView=this.gu=C(function(){return this},this),this.wu(),this.$ready.push(this.xu)},$$:function(t){return this.Ss[t]},innerId:function(t){return this.ks[t]},wu:function(){this.Ms=M.n,M.n=this},xu:function(){for(var t in this.Ss){var i=this.Ss[t];this.callEvent&&i.mapEvent&&!i.H.onitemclick&&i.mapEvent({onitemclick:this}),i.getTopParentView=this.gu}M.n=this.Ms,this.Ms=0},Wi:function(t){delete this.Ss[t]},ui:function(){this.wu();var t=zt.apply(this,arguments);return this.xu(),t}},
  Hs={$init:function(){this.getSelectedId&&this.attachEvent("onAfterRender",this.yu),this.moveSelection&&this.attachEvent("onTabFocus",this.Mu)},Mu:function(){if(this.getSelectedId){var t=this.getSelectedId(!0);t.length&&this.getItemNode(t[0])||this.moveSelection("down")}},yu:function(){var t=this.getSelectedId(!0);if(!t.length||!this.getItemNode(t[0])){var i=this.mt.querySelector("["+this.na+"]");i&&i.setAttribute("tabindex","0")}},Su:function(n){return function(t,i){var s=i.srcElement||i.target;if(!s.getAttribute("webixignore")){var e=s.tagName;if("INPUT"==e||"TEXTAREA"==e||"SELECT"==e)return!0}return!(t&&t.moveSelection&&t.config.navigation&&!t.Hi)||(Q(i),t.moveSelection(n,{shift:i.shiftKey,ctrl:i.ctrlKey}))}},moveSelection:function(t,i,s){var e=this.Z;if(!e.disabled){var n=this.getSelectedId(!0),h=this.count&&("x"==e.layout||1<e.xCount);if(("right"==t||"left"==t)&&this.ku){var r=Pt(this.ku);return r.Cu(!0),void("x"===r.config.layout?r.moveSelection(t):Ii.setFocus(r))}if(!n.length&&this.count()){if("down"==t||"right"==t&&h)t="top";else{if(!("up"==t||"left"==t&&h))return;t="bottom"}n=[this.getFirstId()]}if(1==n.length){var o=n=n[0];if("left"==t&&this.close)return this.close(n);if("right"==t&&this.open)return this.open(n);if("top"==t)n=this.getFirstId();else if("bottom"==t)n=this.getLastId();else if("up"==t||"left"==t||"pgup"==t){var a=this.getIndexById(n),u="pgup"==t?10:1;n=this.getIdByIndex(Math.max(0,a-u))}else{if("down"!=t&&"right"!=t&&"pgdown"!=t)return;var c=this.getIndexById(n),f="pgdown"==t?10:1;n=this.getIdByIndex(Math.min(this.count()-1,c+f))}if(this.$u&&(n=this.$u(n,o,t)),this.showItem(n),this.select(n),this.getSubMenu&&this.getSubMenu(n)&&this.Du(n,this.getItemNode(n)),!this.config.clipboard&&!1!==s){var l=this.getItemNode(n);l&&l.focus()}}return!1}},navigation_setter:function(t){return t&&!Ii.Iu&&(Ii.Iu=!0,Ii.addHotKey("up",this.Su("up")),Ii.addHotKey("down",this.Su("down")),Ii.addHotKey("right",this.Su("right")),Ii.addHotKey("left",this.Su("left")),Ii.addHotKey("shift+up",this.Su("up")),Ii.addHotKey("shift+down",this.Su("down")),Ii.addHotKey("shift+right",this.Su("right")),Ii.addHotKey("shift+left",this.Su("left")),Ii.addHotKey("ctrl+shift+up",this.Su("up")),Ii.addHotKey("ctrl+shift+down",this.Su("down")),Ii.addHotKey("ctrl+shift+right",this.Su("right")),Ii.addHotKey("ctrl+shift+left",this.Su("left")),Ii.addHotKey("pageup",this.Su("pgup")),Ii.addHotKey("pagedown",this.Su("pgdown")),Ii.addHotKey("home",this.Su("top")),Ii.addHotKey("end",this.Su("bottom"))),t}},Rs={$init:function(){this.$ready.push(this.Au),this.attachEvent("onStructureUpdate",this.Au),this.attachEvent("onStructureLoad",function(){this.Tu.length||this.Au()})},Au:function(){var s=this.Tu=[],t=this.Z;t.columns&&this.Fu(t.columns),this.Z.map&&this.zu(t.map),s.length&&(this.data.Yr=function(t){for(var i=0;i<s.length;i++)s[i](t)})},zu:function(t){for(var i in t)this.Tu.push(this.Vu(i,t[i]))},Vu:function(s,t,i){var e,n=t.replace(/^(\s|)\((date|number)\)/,"");return e=""===n?function(t){return t[s]}:(-1===n.indexOf("#")&&-1===n.indexOf("{")&&(n="#"+n+"#"),At(n)),0===t.indexOf("(date)")?(i&&!i.format&&(i.format=ct.dateFormatStr),function(t){var i=(e(t)||"").toString();t[s]=ct.parseFormatDate(i)}):0===t.indexOf("(number)")?function(t){t[s]=1*e(t)}:function(t){t[s]=e(t)||""}},Fu:function(t){for(var i=0;i<t.length;i++){var s=t[i].map,e=t[i].id;e||(e=t[i].id="i"+z(),t[i].header||(t[i].header="")),s&&this.Tu.push(this.Vu(e,s,t[i])),this.Bu(t[i])}},Hu:function(t){if("string"==typeof t){var i=Pt(t);i?t=i:(t=new(d("DataCollection"))({url:t}),this.ht.push(t)),t.getBody&&(t=i.getBody())}else if("function"==typeof t||t.$proxy)t=new(d("DataCollection"))({url:t}),this.ht.push(t);else if(!t.loadNext){var s=g(t),e=[];if(s&&"object"!==k(t[0])){for(var n=0;n<t.length;n++)e.push({id:t[n],value:t[n]});t=e}else if(!s){for(var h in t)e.push({id:h,value:t[h]});t=e}t=new(d("DataCollection"))({data:t}),this.ht.push(t)}return t},Bu:function(t){var i=t.options||t.collection;i&&(i=this.Hu(i),this.Ru(i,t)),t.header&&(this.Pu(t.header),this.Pu(t.footer))},Pu:function(n){
  var h=this;n=n||[];for(var t=function(t){var i=n[t];if(i&&i.options){var s=i.options;s.loadNext||(s=i.options=h.Hu(s));var e=s.data.attachEvent("onStoreUpdated",function(){h.refreshFilter&&h.refreshFilter(i.columnId)});h.attachEvent("onDestruct",function(){s.$destructed||s.data.detachEvent(e)})}},i=0;i<n.length;i++)t(i)},Ru:function(t,i){var s=this;if(i){delete i.options,i.collection=t,i.template=i.template||this.ju(t,i.id,i.optionslist);var e=t.data.attachEvent("onStoreUpdated",function(){s.refresh(),s.refreshFilter&&s.refreshFilter(i.id)});this.attachEvent("onDestruct",function(){t.$destructed||t.data.detachEvent(e)})}},ju:function(h,r,t){if(r=this.getColumnConfig?r:"value",t){var o="string"==typeof t?t:",";return function(t){var i=t[r];if(!i)return"";for(var s=i.toString().split(o),e=0;e<s.length;e++){var n=h.data.pull[s[e]];s[e]=n&&n.value||""}return s.join(", ")}}return function(t){var i=h.data.pull[t[r]];return i&&(i.value||0===i.value)?i.value:""}}},Ps={$init:function(t){t=t||{},this.Eu=0,this.Nu=300,this.Lu=null,this.Ou(t.onClick,"on_click"),this.Ou(t.onContext,"on_context"),this.Ou(t.onDblClick,"on_dblclick"),this.Ou(t.onMouseMove,"on_mouse_move"),this.on_click&&(Nt(this.Zi,"click",this.Uu,{bind:this}),S.isIE8&&this.on_dblclick&&Nt(this.Zi,"dblclick",this.Yu,{bind:this})),this.on_context&&Nt(this.Zi,"contextmenu",this.Wu,{bind:this}),this.on_mouse_move&&this.Gu()},Gu:function(){this.Xu||(this.on_mouse_move=this.on_mouse_move||{},Nt(this.Zi,"mousemove",this.Ju,{bind:this}),Nt(this.Zi,S.isIE?"mouseleave":"mouseout",this.Ju,{bind:this}),this.Xu=1,this.attachEvent("onDestruct",function(){this.Zu&&window.clearTimeout(this.Zu)}))},Ou:function(t,i){if(t){var s=this[i],e=s?P.extend({},s):{};this[i]=P.extend(e,t)}},Uu:function(t){if(!this.isEnabled())return!1;if(Ii.at(this),this.on_dblclick){var i=(new Date).valueOf();if(i-this.Eu<=this.Nu&&this.locate)if(""+this.locate(t)==""+this.Lu)return this.Eu=0,this.Yu(t);this.Eu=i}return this.qu(t,this.on_click,"ItemClick")},Yu:function(t){return this.qu(t,this.on_dblclick,"ItemDblClick")},Wu:function(t){this.qu(t,this.on_context,"BeforeContextMenu","AfterContextMenu")},Ju:function(t){if(!this.$destructed){if(document.createEventObject)t=document.createEventObject(event);else if(!j(t.movementY)&&!t.movementY&&!t.movementX)return;this.Zu&&window.clearTimeout(this.Zu),this.callEvent("onMouseMoving",[t]),this.Zu=window.setTimeout(C(function(){"mousemove"==t.type?this.Ku(t):this.Qu(t)},this),this.Z.mouseEventDelay||500)}},Ku:function(t){this.qu(t,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[t||event])},Qu:function(t){this.callEvent("onMouseOut",[t||event])},qu:function(t,i,s,e){if(!(t=t||event).processed&&this.et){t.processed=!0;var n=t.target||t.srcElement;if(S.isIE8){var h=this.Z.id,r=n.w_view;if(r){if(r!==h)return}else n.w_view=h}for(var o="",a=null,u=!1;n&&n.parentNode&&this.et&&n!=this.et.parentNode;){if(!u&&n.getAttribute&&(a=n.getAttribute(this.na))){if(this.Lu=a,this.callEvent){if(!this.callEvent("on"+s,[a,t,n]))return;e&&this.callEvent("on"+e,[a,t,n])}u=!0}if(o=rt(n)){o=o.toString().split(" ");for(var c=0;c<o.length;c++){if(i[o[c]])if(!1===b(i[o[c]],this.$scope).call(this,t,a||J(t,this.na),n))return u}}n=n.parentNode}return u}}},js={$init:function(){this.$ready.push(function(){this.attachEvent("onKeyPress",this.zs)})},tc:function(t,i){if(37===t||39===t){Q(i),this.ic(37===t?-1:1);var s=this.sc.querySelector("[tabindex='0']");s&&s.focus()}},ec:function(){G(this.sc),this.sc=Y("DIV",{"class":"webix_nav_panel webix_nav_panel_"+this.Z.navigation.type,role:"tablist"},""),this.et.appendChild(this.sc),this.nc(),this.hc(),this.rc()},rc:function(){var i=[];this.sc&&(i[0]=Lt(this.sc,"click",C(function(t){for(var i=t.srcElement||t.target,s=!1;i!=this.sc&&!s;){var e=i.getAttribute(this.oc);e&&(s=!0,this.ac(e)),i=i.parentNode}},this))),this.uc&&(i[1]=Lt(this.uc,"click",C(function(){this.ic(-1)},this))),this.cc&&(i[1]=Lt(this.cc,"click",C(function(){this.ic(1)},this))),this.attachEvent("onDestruct",function(){for(var t=0;t<i.length;t++)this.detachEvent(i[t]);i=null})},
  ic:function(t){if(this.ji){var i=this.fc+t;(i>=this.ji.length||i<0)&&(i=i<0?this.ji.length-1:0),this.setActiveIndex(i)}},ac:function(t){this.ji&&Pt(t).show()},nc:function(){var t,i;if((i=this.Z.navigation).items){this.oc=i.linkAttr||"bind_id",this.sc?this.lc():this.ec();var s=this.ji?this.ji:this.data.order;if(1<s.length)for(var e=0;e<s.length;e++){t=Y("DIV",{"class":"webix_nav_item webix_nav_"+(e==this.fc?"active":"inactive"),role:"tab",tabindex:e==this.fc?"0":"-1"});var n=this.ji?this.ji[e].Z.id:s[e];n&&t.setAttribute(this.oc,n),this.sc.appendChild(t)}}},lc:function(){if(this.sc)for(var t=this.sc.childNodes,i=t.length-1;0<=i;i--)G(t[i])},hc:function(){var t=this.Z.navigation;t.buttons&&(this.uc&&G(this.uc),this.uc&&G(this.cc),this.uc=Y("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_prev "},'<div role="button" tabindex="0" aria-label="'+ct.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.et.appendChild(this.uc),this.cc=Y("DIV",{"class":"webix_nav_button_"+t.type+" webix_nav_button_next "},'<div role="button" tabindex="0" aria-label="'+ct.aria.prevTab+'" class="webix_nav_button_inner"></div>'),this.et.appendChild(this.cc))}},Es={showOverlay:function(t){this.dc?this.dc.innerHTML=t:(this.dc=Y("DIV",{"class":"webix_overlay"},t||""),X(this.dc,this.et.firstChild,this.et),this.et.style.position="relative")},hideOverlay:function(){this.dc&&(G(this.dc),this.dc=null)}},Ns={pager_setter:function(e){if("string"==typeof e){var t=Pt(e);if(!t)return this.$blockRender=!0,$(function(){var t=Pt(e);this.Z.pager=this.pager_setter(t);var i=t.Z;i.count=this.data.vc(i.level),t.refresh(),this.$blockRender=!1,this.render()},this),null;e=t}return this.attachEvent("onBeforeRender",function n(t){if(e.config.autosize&&this.getVisibleCount){var i=this.getVisibleCount();isNaN(i)?(e.config.size=1,$(n,this,[!0])):i!=e.config.size&&(e.config.size=i,e.refresh(),!0===t&&this.refresh())}var s=this.Z.pager;return-1!=s.page&&(this.data.$min=this._c(0,s.page*s.size),this.data.$max=this._c(this.data.$min,s.size),this.data.$pagesize=this.data.$max-this.data.$min,!0)}),e.$view||(e.view="pager",e=zt(e)),((this.pc=e).$master=this).data.attachEvent("onStoreUpdated",function(){var t=e.Z;t.count=this.vc(t.level),e.refresh()}),this.data.vc=this.vc,e.Z},vc:function(i){if(i&&0!==i){var s=0;return this.each(function(t){t.$level==i&&s++}),s}return this.count()},_c:function(t,i){var s=this.Z.pager;if(s.level&&0!==s.level){var e=t,n=this.data.order.length;if(i)for(;e<n;){if(this.data.order[e]&&this.data.getItem(this.data.order[e]).$level==s.level){if(0===i)break;i--}e++}return e}return t+i},setPage:function(t){this.pc&&this.pc.select(t)},getPage:function(){return this.pc.Z.page},getPager:function(){return this.pc}},Ls={$init:function(){var t=this;j(this.mc)&&this.attachEvent&&(this.attachEvent("onBeforeLoad",function(){return t.showProgress()}),this.attachEvent("onAfterLoad",function(){return t.hideProgress()}),this.mc=null)},showProgress:function(t){var i;if(!this.mc){var s="icon"==(t=P.extend({position:0,delay:2e3,type:"icon",icon:"wxi-sync",hide:!1},t||{},!0)).type?t.icon+" webix_spin":"";if(this.mc=Y("DIV",{"class":"webix_progress_"+t.type,role:"progressbar","aria-valuemin":"0","aria-valuemax":"100",tabindex:"0"},"<div class='webix_progress_state "+s+"'></div>"),this.setPosition||(this.et.style.position="relative"),X(this.mc,this.et.firstChild,this.et),this.et.setAttribute("aria-busy","true"),!Ki.$active&&this.getScrollState){var e=this.getScrollState();this.et.scrollWidth!=this.$width&&(this.mc.style.left=e.x+"px"),this.et.scrollHeight!=this.$height&&("bottom"!=t.type?this.mc.style.top=e.y+"px":this.mc.style.top=e.y+this.$height-this.mc.offsetHeight+"px")}this.bc="icon"!=t.type}if(t){if(this.bc){var n=t.position||1;if(this.mc.style[S.transitionDuration]===undefined&&t.delay){var h=0,r=0,o=n/t.delay*30,a=this;this.gc&&(window.clearInterval(this.gc),r=this.mc.firstChild.offsetWidth/this.mc.offsetWidth*100),this.gc=window.setInterval(function(){30*h==t.delay?window.clearInterval(a.gc):(a.mc&&a.mc.firstChild&&(
  a.mc.firstChild.style.width=r+h*o*n*100+"%"),h++)},30)}else t.delay&&(i=this.et.firstChild.offsetWidth,this.mc.firstChild.style[S.transitionDuration]=t.delay+"ms"),this.mc.firstChild.style.width=100*n+"%"}return this.wc&&clearTimeout(this.wc),t.hide&&(this.wc=$(this.hideProgress,this,[1],t.delay)),i}},hideProgress:function(t){this.mc&&(t||!this.bc?(this.gc&&window.clearInterval(this.gc),G(this.mc),this.mc=null,this.et.removeAttribute("aria-busy")):this.showProgress({position:1.1,delay:300,hide:!0}))}},Os={$init:function(){this.data,this.Ji=document.createElement("DIV"),this.data.attachEvent("onIdChange",C(this.Wr,this)),this.attachEvent("onItemClick",this.xc),this.types||(this.types={"default":this.type},this.type.name="default"),this.type=f(this.type)},customize:function(t){Tt(this,t)},item_setter:function(t){return this.type_setter(t)},type_setter:function(t){return this.types[t]?(this.type=f(this.types[t]),this.type.css&&(this.Zi.className+=" "+this.type.css)):this.customize(t),this.type.on_click&&P.extend(this.on_click,this.type.on_click),t},template_setter:function(t){this.type.template=At(t)},Ot:function(t){var i=this.data.Hr[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)},yc:function(t){return this.Ji.innerHTML=this.Ot(t),this.Ji.firstChild},Wr:function(t,i){var s=this.getItemNode(t);s&&(s.setAttribute(this.na,i),this.Gi[i]=this.Gi[t],delete this.Gi[t])},xc:function(){if(this.Z.click){var t=b(this.Z.click,this.$scope);t&&t.call&&t.apply(this,arguments)}},getItemNode:function(t){if(this.Gi)return this.Gi[t];this.Gi={};for(var i=this.mt.childNodes,s=0;s<i.length;s++){var e=i[s].getAttribute(this.na);e&&(this.Gi[e]=i[s])}return this.getItemNode(t)},locate:function(t){return J(t,this.na)},showItem:function(t){var i=this.getItemNode(t);if(i&&this.scrollTo){var s=i.offsetLeft,e=s+i.offsetWidth,n=i.offsetTop,h=n+i.offsetHeight,r=this.getScrollState(),o=r.x;(s<o||o+this.$s<e)&&(o=s);var a=r.y;(n<a||a+this.Is<h)&&(a=n),this.scrollTo(o,a),this.Mc&&this.Mc(t)}},render:function(t,i,s){if(this.isVisible(this.Z.id)&&!this.$blockRender)if(t){var e=this.getItemNode(t);switch(s){case"paint":case"update":if(!e)return;X(this.Gi[t]=this.yc(i),e),G(e);break;case"delete":if(!e)return;G(e),delete this.Gi[t];break;case"add":X(this.Gi[t]=this.yc(i),this.getItemNode(this.data.getNextId(t)),this.mt);break;case"move":X(this.getItemNode(t),this.getItemNode(this.data.getNextId(t)),this.mt)}}else this.callEvent("onBeforeRender",[this.data])&&((this.Sc||this.mt).innerHTML=this.data.getRange().map(this.Ot,this).join(""),this.Gi=null,this.callEvent("onAfterRender",[]))}},Us={$init:function(t){if(t&&!t.scroll&&this.kc)return this.mt=this.mt||this.Zi;(this.mt||this.Zi).appendChild(Y("DIV",{"class":"webix_scroll_cont"},"")),this.mt=(this.mt||this.Zi).firstChild,S.touch&&"native"!==S.touch||Nt(this.et,"scroll",C(function(){this.callEvent&&$(function(){this.callEvent("onAfterScroll",[])},this)},this))},scroll_setter:function(t){if(!t)return!1;var i="auto"===t,s="x"==t?"x":"xy"==t?"xy":i?"xy":"y";if(Ki.$active&&"native"!=S.touch)this.mt.setAttribute("touch_scroll",s),this.attachEvent&&this.attachEvent("onAfterRender",C(this.Cc,this)),this.Dc=!0;else if(S.$customScroll)fs.enable(this,s);else{var e=this.mt.parentNode.style;i?e.overflowX=e.overflowY="auto":(-1!=s.indexOf("x")&&(this.As=!0,e.overflowX="scroll"),-1!=s.indexOf("y")&&(this.Ds=!0,e.overflowY="scroll"))}return s},Ic:function(t,i){if(!!this.Z.scroll!=!!t){if(!S.$customScroll)this.mt.parentNode.style["x"===i?"overflowX":"overflowY"]=t?"auto":"hidden";"x"===i?this.As=t:this.Ds=t,this.Z.scroll=!!t&&i}},getScrollState:function(){if(Ki.$active){var t=Ki.Me(this.mt);return{x:-t.e,y:-t.f}}return{x:this.mt.parentNode.scrollLeft,y:this.mt.parentNode.scrollTop}},scrollTo:function(t,i){Ki.$active&&"native"!=S.touch?(i=Math.max(0,Math.min(i,this.mt.offsetHeight-this.Is)),t=Math.max(0,Math.min(t
  ,this.mt.offsetWidth-this.$s)),Ki.Ce(this.mt,-t,-i,this.Z.scrollSpeed||"100ms")):(this.mt.parentNode.scrollLeft=t,this.mt.parentNode.scrollTop=i)},Cc:function(){-1!=this.Z.scroll.toString().indexOf("x")&&(this.mt.scrollWidth&&(this.mt.style.width="100%",this.mt.style.width=this.mt.scrollWidth+"px"));if(Ki.$active&&this.Dc){Ki.se(),Ki.ye();var t=this.getScrollState(),i=this.mt.offsetWidth-this.$width-t.x,s=this.mt.offsetHeight-this.$height-t.y;if(i<0||s<0){var e=i<0?Math.min(-i-t.x,0):-t.x,n=s<0?Math.min(-s-t.y,0):-t.y;Ki.Ce(this.mt,e,n,0)}}}},Ys={$init:function(){this.ch=p(),this.data,this.data.attachEvent("onStoreUpdated",C(this.Ac,this)),this.data.attachEvent("onStoreLoad",C(this.Tc,this)),this.data.attachEvent("onAfterFilter",C(this.Fc,this)),this.data.attachEvent("onSyncApply",C(this.zc,this)),this.data.attachEvent("onIdChange",C(this.Vc,this)),this.$ready.push(this.Bc)},Bc:function(){("multiselect"==this.Z.select||this.Z.multiselect||"area"==this.Z.select)&&Nt(this.$view,"mousedown",function(t){(t||Lt).shiftKey&&st(M.D=this,"webix_noselect",1)})},Vc:function(t,i){for(var s=this.ch.length-1;0<=s;s--)this.ch[s]==t&&(this.ch[s]=i)},Fc:function(){for(var t=this.ch.length-1;0<=t;t--)if(this.data.getIndexById(this.ch[t])<0){var i=this.ch[t];this.removeCss(i,"webix_selected",!0),this.ch.splice(t,1),this.callEvent("onSelectChange",[i])}},Ac:function(t,i,s){"delete"==s?this.loadBranch?this.zc():this.ch.remove(t):t||this.data.count()||this.data.Rr||(this.ch=p())},Tc:function(){this.Z.select&&this.data.each(function(t){t&&t.$selected&&this.select(t.id)},this)},zc:function(){for(var t=this.ch.length-1;0<=t;t--)this.exists(this.ch[t])||this.ch.splice(t,1)},Hc:function(t,i,s,e){var n=i?"onBeforeSelect":"onBeforeUnSelect";if(!this.callEvent(n,[t,i]))return!1;e&&(this.Rc=!0,this.unselectAll(),this.Rc=!1),i?this.addCss(t,"webix_selected",!0):this.removeCss(t,"webix_selected",!0),s?s.push(t):(i?this.ch.push(t):this.ch.remove(t),this.Pc(t));var h=i?"onAfterSelect":"onAfterUnSelect";return this.callEvent(h,[t]),!0},select:function(t,i){var s=arguments[2],e=arguments[3];if(!t)return this.selectAll();if(g(t))for(var n=0;n<t.length;n++)this.select(t[n],n?1:i,s,e);else{if(this.data.exists(t),e&&this.ch.length)return this.selectAll(this.ch[this.ch.length-1],t);var h=!1;s||i||1==this.ch.length&&this.ch[0]==t||(h=!0),h||!this.isSelected(t)?this.Hc(t,!0,null,h):s&&this.unselect(t)}},unselect:function(t){if(!t)return this.unselectAll();this.isSelected(t)&&this.Hc(t,!1)},selectAll:function(t,i){var s=[];(t||i?this.data.getRange(t||null,i||null):this.data.getRange()).each(function(t){this.data.getMark(t.id,"webix_selected")||(this.ch.push(t.id),this.Hc(t.id,!0,s))},this),this.Pc(s)},unselectAll:function(){var i=[];this.ch.each(function(t){this.Hc(t,!1,i)},this),this.ch=p(),this.Pc(i)},isSelected:function(t){return-1!=this.ch.find(t)},getSelectedId:function(t){switch(this.ch.length){case 0:return t?[]:"";case 1:return t?[this.ch[0]]:this.ch[0];default:return[].concat(this.ch)}},getSelectedItem:function(t){var i=this.getSelectedId(!0);if(1<i.length||t){for(var s=i.length-1;0<=s;s--)i[s]=this.getItem(i[s]);return i}if(i.length)return this.getItem(i[0])},jc:function(t){return 100<t.length||t.length>this.data.count/2},Pc:function(t){if("object"!=k(t)&&(t=[t]),t.length){if(this.jc(t))this.data.refresh();else for(var i=0;i<t.length;i++)this.render(t[i],this.data.getItem(t[i]),"update");this.Rc||this.callEvent("onSelectChange",[t])}}};Mi(function(){Lt(document.body,"mouseup",function(){M.D&&(et(M.D,"webix_noselect"),M.D=null)})});var Ws={Ec:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],toHex:function(t,i){t=parseInt(t,10);for(var s="";0<t;)s=this.Ec[t%16]+s,t=Math.floor(t/16);for(;s.length<i;)s="0"+s;return s},rgbToHex:function(t){var i=[];return"string"==typeof t?t.replace(/[\d+.]+/g,function(t){i.push(parseFloat(t))}):g(t)&&(i=t),0===i[3]?"":i.slice(0,3).map(function(t){return Ws.toHex(Math.floor(t),2)}).join("")},hexToDec:function(t){return parseInt(t,16)},toRgb:function(t){var i,s,e,n;return e="string"!=typeof t?(i=t[0],s=t[1],
  t[2]):-1!=t.indexOf("rgb")?(i=(n=t.substr(t.indexOf("(")+1,t.lastIndexOf(")")-t.indexOf("(")-1).split(","))[0],s=n[1],n[2]):("#"==t.substr(0,1)&&(t=t.substr(1)),i=this.hexToDec(t.substr(0,2)),s=this.hexToDec(t.substr(2,2)),this.hexToDec(t.substr(4,2))),((i=parseInt(i,10)||0)<0||255<i)&&(i=0),((s=parseInt(s,10)||0)<0||255<s)&&(s=0),((e=parseInt(e,10)||0)<0||255<e)&&(e=0),[i,s,e]},hsvToRgb:function(t,i,s){var e,n,h,r,o,a,u,c;switch(h=s*(1-i),r=s*(1-(n=t/60-(e=Math.floor(t/60)%6))*i),o=s*(1-(1-n)*i),c=u=a=0,e){case 0:a=s,u=o,c=h;break;case 1:a=r,u=s,c=h;break;case 2:a=h,u=s,c=o;break;case 3:a=h,u=r,c=s;break;case 4:a=o,u=h,c=s;break;case 5:a=s,u=h,c=r}return[a=Math.floor(255*a),u=Math.floor(255*u),c=Math.floor(255*c)]},rgbToHsv:function(t,i,s){var e,n,h,r,o,a,u;return e=t/255,n=i/255,h=s/255,r=Math.min(e,n,h),a=0,(u=o=Math.max(e,n,h))==r?a=0:o==e&&h<=n?a=60*(n-h)/(o-r)+0:o==e&&n<h?a=60*(n-h)/(o-r)+360:o==n?a=60*(h-e)/(o-r)+120:o==h&&(a=60*(e-n)/(o-r)+240),[a,0===o?0:1-r/o,u]}};function Gs(t){var i=" ";if(t)for(var s in t)i+=s+'="'+t[s]+'" ';return i}var Xs={draw:function(t,i,s,e){return"<svg "+Gs({xmlns:"http://www.w3.org/2000/svg",version:"1.1",height:"100%",width:"100%",viewBox:"0 0 "+i+" "+s,"class":e||""})+">"+t+"</svg>"},styleMap:{lineColor:"stroke",color:"fill"},group:function(t){return"<g>"+t+"</g>"}};Xs.Nc={M:function(t){return" M "+t.x+" "+t.y},L:function(t){return" L "+t.x+" "+t.y},C:function(t,i,s){return" C "+t.x+" "+t.y+" "+i.x+" "+i.y+" "+s.x+" "+s.y},A:function(t,i,s,e){var n=t.x+Math.cos(e)*i,h=t.y+Math.sin(e)*i;return" A "+i+" "+i+" 0 "+(e-s>=Math.PI?1:0)+" 1 "+n+" "+h}},Xs.definePath=function(t,i){for(var s="",e=0;e<t.length;e++){t[e][0]&&t[e][0];var n=t[e][0].toUpperCase();this.Nc[n],s+=this.Nc[n].apply(this,t[e].slice(1))}return i&&(s+=" Z"),s},Xs.Lc=function(t){for(var i=[],s=0;s<t.length;s++)i.push([s?"L":"M",t[s]]);return i},Xs.setOpacity=function(t,i){var s=Ws.toRgb(t);return s.push(i),"rgba("+s.join(",")+")"},Xs.Oc=function(t){for(var i=[],s=0;s<t.length;s++){var e=t[s];s||i.push(["M",e[0]]),i.push(["C",e[1],e[2],e[3]])}return i},Xs.getPath=function(t,i,s){return'<path class="'+i+'" vector-effect="non-scaling-stroke" d="'+t+'" '+(s=Gs(s))+"/>"},Xs.getSector=function(t,i,s,e,n,h){h=Gs(h);var r=[["M",t],["L",{x:t.x+Math.cos(s)*i,y:t.y+Math.sin(s)*i}],["A",t,i,s,e],["L",t]];return'<path class="'+n+'" vector-effect="non-scaling-stroke" d="'+Xs.definePath(r,!0)+'" '+h+"/>"},Xs.getCurve=function(t,i,s){return s=Gs(s),'<path fill="none" class="'+i+'" vector-effect="non-scaling-stroke" d="'+this.definePath(this.Oc(t))+'" '+s+"/>"},Xs.getLine=function(t,i,s,e){return this.getPath(this.definePath(this.Lc([t,i]),!0),s,e)},Xs.getCircle=function(t,i,s,e){return e=Gs(e),'<circle class="'+s+'" cx="'+t.x+'" cy="'+t.y+'" r="'+i+'" '+e+"/>"},Xs.getRect=function(t,i,s,e,n,h){return'<rect class="'+n+'" rx="0" ry="0" x="'+t+'" y="'+i+'" width="'+s+'" height="'+e+'" '+(h=Gs(h))+"/>"};var Js={paddingX:6,paddingY:6,radius:2,minHeight:4,eventRadius:8};function Zs(t){this.config=P.extend(m(Js),t||{},!0)}Zs.prototype.draw=function(t,i,s){var e=this.getPoints(t,i,s),n=this.config,h=Xs,r=n.color?this.Uc(h,n.color):null,o=h.definePath(this.Yc(e)),a=h.group(h.getPath(o,"webix_sparklines_line"+(r?" "+r.line:"")));a+=this.Wc(h,e,n.radius,"webix_sparklines_item"+(r?" "+r.item:""));var u=Math.min(t.length?(i-2*(n.paddingX||0))/t.length:0,n.eventRadius);return a+=this.Gc(h,e,u),h.draw(a,i,s,"webix_sparklines_line_chart"+(n.css?" "+n.css:""))},Zs.prototype.Uc=function(t,i){var s={line:{},item:{}},e=t.styleMap;if(i)for(var n in s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},Zs.prototype.Wc=function(t,i,s,e,n){for(var h=[],r=0;r<i.length;r++)h.push(t.getCircle(i[r],s,e,n));return t.group(h.join(""))},Zs.prototype.Gc=function(t,i,s){for(var e=[],n=0;n<i.length;n++)e.push(t.getCircle(i[n],s,"webix_sparklines_event_area",{webix_area:n}));return t.group(e.join(""))},Zs.prototype.Yc=function(t){var i,s,e=[];for(i=0;i<t.length;i++)s=i?"L":"M",e.push([s,t[i]]);return e},Zs.prototype.getPoints=function(t,i,s){var e=this.config,
  n=Math.min.apply(null,t);"undefined"!=typeof e.origin&&(n=Math.min(e.origin,n));var h=Math.max.apply(null,t),r=[],o=e.paddingX||0,a=e.paddingY||0;i=(i||100)-2*o;var u=e.minHeight||0;if(s=(s||100)-2*a,t.length)if(1==t.length)r.push({x:i/2+o,y:s/2+o});else{var c=i/(t.length-1),f=e.scale||h-n,l=(s-u)/(f||1);f||(s/=2);for(var d=0;d<t.length;d++)r.push({x:Math.ceil(c*d)+o,y:s-Math.ceil(l*(t[d]-n))+a-u})}return r};var qs={paddingX:3,paddingY:4,radius:1,minHeight:4,eventRadius:8};function Ks(t){this.config=P.extend(m(qs),t||{},!0)}Ks.prototype.draw=function(t,i,s){var e,n,h,r,o,a=this.config,u=Zs.prototype,c=Xs;return r=this.getPoints(t,i,s),h=c.definePath(u.Yc(r),!0),a.color&&(o=this.Uc(c,a.color)),n=c.group(c.getPath(h,"webix_sparklines_area"+(o?" "+o.area:""))),r.splice(r.length-3,3),h=c.definePath(u.Yc(r)),n+=c.group(c.getPath(h,"webix_sparklines_line"+(o?" "+o.line:""))),n+=u.Wc(c,r,a.radius,"webix_sparklines_item"+(o?" "+o.item:"")),e=Math.min(t.length?(i-2*(a.paddingX||0))/t.length:0,a.eventRadius),n+=u.Gc(c,r,e),c.draw(n,i,s,"webix_sparklines_area_chart"+(a.css?" "+a.css:""))},Ks.prototype.Uc=function(t,i){var s={area:{},line:{},item:{}},e=t.styleMap;if(i)for(var n in s.area[e.color]=t.setOpacity(i,.2),s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},Ks.prototype.getPoints=function(t,i,s){var e=Zs.prototype.getPoints.call(this,t,i,s),n=this.config.paddingX||0,h=this.config.paddingY||0;return e.push({x:i-n,y:s-h},{x:n,y:s-h},{x:n,y:e[0].y}),e};var Qs={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 te(t){this.config=P.extend(m(Qs),t||{},!0)}te.prototype.draw=function(t,i,s){var e,n,h,r,o,a=this.config,u="",c=[],f=this.getPoints(t,i,s),l=Xs;for(e=0;e<f.length;e++)n="function"==typeof a.itemCss?a.itemCss.call(this,t[e]):a.itemCss||"",a.negativeColor&&t[e]<a.origin?n+=" "+this.Uc(l,a.negativeColor):a.color&&(n+=" "+this.Uc(l,a.color)),h=f[e],c.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_bar "+n));u+=l.group(c.join("")),r=parseInt(this.Xc(t,i,s),10)+.5,o=a.paddingX||0,u+=l.group(l.getLine({x:o,y:r},{x:i-o,y:r},"webix_sparklines_origin"));var d=this.Jc(t,i,s),v=[];for(e=0;e<d.length;e++)h=d[e],v.push(l.getRect(h.x,h.y,h.width,h.height,"webix_sparklines_event_area ",{webix_area:e}));return u+=l.group(v.join("")),l.draw(u,i,s,"webix_sparklines_bar_chart"+(a.css?" "+a.css:""))},te.prototype.Uc=function(t,i){var s={},e=t.styleMap;return i&&(s[e.color]=i),L(s)},te.prototype.Xc=function(t,i,s){var e=this.config,n=e.paddingY||0,h=n+(s=(s||100)-2*n);if(!1!==e.origin){var r=Math.min.apply(null,t),o=Math.max.apply(null,t),a=e.origin||-1e-6;if(o<=a)h=n;else if(r<a){h-=s/(o-r)*(a-r)}}return h},te.prototype.Jc=function(t,i,s){var e=[],n=this.config.paddingX||0,h=this.config.paddingY||0;if(i=(i||100)-2*n,s=(s||100)-2*h,t.length)for(var r=i/t.length,o=0;o<t.length;o++)e.push({x:Math.ceil(r*o)+n,y:h,height:s,width:r});return e},te.prototype.getPoints=function(t,i,s){var e=this.config,n=Math.min.apply(null,t);e.origin<n&&(n=e.origin);var h=Math.max.apply(null,t),r=[],o=e.paddingX,a=e.paddingY,u=e.margin,c=e.width||20,f=this.Xc(t,i,s);if(i=(i||100)-2*o,s=(s||100)-2*a,t.length){var l=i/t.length,d=e.scale||h-n;u=l-(c=Math.min(l-u,c));var v=0,_=n;!1!==e.origin&&e.origin>n?_=e.origin||0:v=e.minHeight;for(var p=(s-v)/(d||1),m=0;m<t.length;m++){var b=Math.ceil(p*(t[m]-_));r.push({x:Math.ceil(l*m)+o+u/2,y:f-(t[m]>=_?b:0)-v,height:Math.abs(b)+v,width:c})}}return r};var ie={paddingY:2};function se(t){this.config=P.extend(ie,t||{},!0)}se.prototype.Zc=0,se.prototype.qc=["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],se.prototype.Kc=function(t,i){var s=i.length,e=this.qc.length;return s<e?(t&&(t=t<e-s?this.Zc+2:this.Zc+1),this.Zc=t):t%=e,this.qc[t]},se.prototype.draw=function(t,i,s){var e,n,h,r,o=this.config,a=o.color||this.Kc,u=this.getAngles(t),c=Xs,f=s/2-(o.paddingY||0),l=i/2,d=s/2;for(
  "function"!=typeof a&&(a=function(){return a}),r="",h=0;h<u.length;h++)(e={})[c.styleMap.color]=a.call(this,h,t,this.Qc),r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_sector",e);for(n=c.group(r),r="",h=0;h<u.length;h++)r+=c.getSector({x:l,y:d},f,u[h][0],u[h][1],"webix_sparklines_event_area",{webix_area:h});return n+=c.group(r),c.draw(n,i,s,"webix_sparklines_pie_chart"+(o.css?" "+o.css:""))},se.prototype.getAngles=function(t){var i,s,e=-Math.PI/2,n=[],h=this.tf(t);for(s=0;s<t.length;s++)i=-Math.PI/2+h[s]-1e-4,n.push([e,i]),e=i;return n},se.prototype["if"]=function(t){for(var i=0,s=0;s<t.length;s++)i+=1*t[s];return i},se.prototype.tf=function(t){var i,s,e=[],n=0,h=this["if"](t);for(i=0;i<t.length;i++)s=1*t[i],e[i]=2*Math.PI*(h?(s+n)/h:1/t.length),n+=s;return e};var ee={paddingX:3,paddingY:6,radius:2,minHeight:4,eventRadius:8};function ne(t){this.config=P.extend(m(ee),t||{},!0)}ne.prototype.draw=function(t,i,s){var e=this.config,n="",h=Zs.prototype,r=this.getPoints(t,i,s),o=Xs,a=e.color?this.Uc(o,e.color):null;n+=o.group(o.getCurve(r,"webix_sparklines_line"+(a?" "+a.line:"")));var u=h.getPoints.call(this,t,i,s);n+=h.Wc(o,u,e.radius,"webix_sparklines_item"+(a?" "+a.item:""));var c=Math.min(t.length?(i-2*(e.paddingX||0))/t.length:0,e.eventRadius);return n+=h.Gc(o,u,c),o.draw(n,i,s,"webix_sparklines_line_chart"+(e.css?" "+e.css:""))},ne.prototype.Uc=function(t,i){var s={line:{},item:{}},e=t.styleMap;if(i)for(var n in s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},ne.prototype.getPoints=function(t,i,s){var e,n,h,r,o=[],a=[],u=[];for(n=Zs.prototype.getPoints.call(this,t,i,s),e=0;e<n.length;e++)a.push(n[e].x),u.push(n[e].y);for(h=this.sf(a),r=this.sf(u),e=0;e<n.length-1;e++)o.push([n[e],{x:h[0][e],y:r[0][e]},{x:h[1][e],y:r[1][e]},n[e+1]]);return o},ne.prototype.sf=function(t){var i,s,e=[],n=[],h=[],r=[],o=[],a=[],u=t.length-1;for(n[e[0]=0]=2,h[0]=1,r[0]=t[0]+2*t[1],i=1;i<u-1;i++)e[i]=1,n[i]=4,h[i]=1,r[i]=4*t[i]+2*t[i+1];for(e[u-1]=2,n[u-1]=7,h[u-1]=0,r[u-1]=8*t[u-1]+t[u],i=1;i<u;i++)s=e[i]/n[i-1],n[i]=n[i]-s*h[i-1],r[i]=r[i]-s*r[i-1];for(o[u-1]=r[u-1]/n[u-1],i=u-2;0<=i;--i)o[i]=(r[i]-h[i]*o[i+1])/n[i];for(i=0;i<u-1;i++)a[i]=2*t[i+1]-o[i+1];return a[u-1]=.5*(t[u]+o[u-1]),[o,a]};var he={paddingX:3,paddingY:6,radius:1,minHeight:4,eventRadius:8};function re(t){this.config=P.extend(m(he),t||{},!0)}function oe(){}(re.prototype=m(ne.prototype)).draw=function(t,i,s){var e=this.config,n=Zs.prototype,h=Xs,r=e.color?this.Uc(h,e.color):null,o=this.getPoints(t,i,s),a=o.splice(o.length-3,3),u=h.Lc(a);u[0][0]="L";var c=h.Oc(o).concat(u),f=h.group(h.getPath(h.definePath(c),"webix_sparklines_area"+(r?" "+r.area:""),!0));f+=h.group(h.getPath(h.definePath(h.Oc(o)),"webix_sparklines_line"+(r?" "+r.line:"")));var l=n.getPoints.call(this,t,i,s);f+=n.Wc(h,l,e.radius,"webix_sparklines_item"+(r?" "+r.item:""));var d=Math.min(t.length?(i-2*(e.paddingX||0))/t.length:0,e.eventRadius);return f+=n.Gc(h,l,d),h.draw(f,i,s,"webix_sparklines_splinearea_chart"+(e.css?" "+e.css:""))},re.prototype.Uc=function(t,i){var s={area:{},line:{},item:{}},e=t.styleMap;if(i)for(var n in s.area[e.color]=t.setOpacity(i,.2),s.line[e.lineColor]=i,s.item[e.color]=i,s)s[n]=L(s[n]);return s},re.prototype.getPoints=function(t,i,s){var e=ne.prototype.getPoints.call(this,t,i,s),n=this.config.paddingX||0,h=this.config.paddingY||0;return e.push({x:i-n,y:s-h},{x:n,y:s-h},{x:n,y:e[0][0].y}),e},oe.types={},oe.getTemplate=function(t){var i=t||{};"string"==typeof t&&(i={type:t}),P.extend(i,{type:"line"});var s=this.types[i.type];return C(this.ef,new s(i))},oe.ef=function(t,i,s,e){return e?this.draw(function n(t){for(var i=[],s=t.length-1;0<=s;s--){var e=t[s];i[s]="object"===k(e)?e.value:e}return i}(s),e.width,33):this.draw(t.data||t,i.width,i.height)},T("onDataTable",function(t){t.type.sparklines=oe.getTemplate()}),oe.types.area=Ks,oe.types.bar=te,oe.types.line=Zs,oe.types.pie=se,oe.types.spline=ne,oe.types.splineArea=re;var ae={escape:!0,delimiter:{rows:"\n",cols:"\t"},parse:function(t,i){if(i=i||this.delimiter,!this.escape)return this.nf(t,i);for(
  var s=t.replace(/\n$/,"").split(i.rows),e=0;e<s.length-1;)this.hf(s[e],'"')%2==1&&(s[e]+=i.rows+s[e+1],delete s[e+1],e++),e++;var n=[];for(e=0;e<s.length;e++)if("undefined"!=typeof s[e]){for(var h=s[e],r=0,o=[],a=!1,u=0;u<=h.length;u++){if(!a&&h[u]===i.cols||u===h.length){var c=h.substr(r,u-r);c[0]===c[c.length-1]&&'"'===c[0]&&(c=c.substr(1,c.length-2).replace('""','"')),o.push(c),r=u+1}'"'!==h[u]||(a=!a)}n.push(o)}return n},nf:function(t,i){for(var s=t.split(i.rows),e=0;e<s.length;e++)s[e]=s[e].split(i.cols);return s},hf:function(t,i){return t.split(i).length-1},stringify:function(t,i){if(i=i||this.delimiter,!this.escape){for(var s=0;s<t.length;s++)t[s]=t[s].join(i.cols);return t.join(i.rows)}for(var e=/\n|"|;|,/,n=0;n<t.length;n++){for(var h=0;h<t[n].length;h++){var r=t[n][h];r instanceof Date?t[n][h]=ct.parseFormatStr(r):e.test(r)&&(t[n][h]='"'+r.toString().replace(/"/g,'""')+'"')}t[n]=t[n].join(i.cols)}return t=t.join(i.rows)}},ue={clipboard_setter:function(t){return!0!==t&&1!==t||(t="block"),as.init(),this.attachEvent("onSelectChange",this.rf),this.attachEvent("onItemClick",function(){document.activeElement&&this.$view.contains(document.activeElement)&&(as.focus(),Ii.setFocus(this))}),this.attachEvent("onPaste",this.af),t},templateCopy_setter:At,rf:function(){var t=this.uf();as.set(t),Ii.setFocus(this)},uf:function(){var h=[],r=this.Z.templateCopy;return this.mapSelection(function(t,i,s,e){h[e]||(h[e]=[]);var n=r?r(t,i,s):t;return h[e].push(n),t}),1===h.length&&1===h[0].length?h[0][0]:ae.stringify(h,this.Z.delimiter)},af:function(t){if(!j(this.ah[this.Z.clipboard])){var i=ae.parse(t,this.Z.delimiter);this.ah[this.Z.clipboard].call(this,i)}},ah:{block:function(h){var t=this.mapSelection(null);t&&(this.mapCells(t.row,t.column,h.length,null,function(t,i,s,e,n){return h[e]&&h[e].length>n?h[e][n]:t}),this.render())},selection:function(h){this.mapSelection(function(t,i,s,e,n){return h[e]&&h[e].length>n?h[e][n]:t}),this.render()},repeat:function(h){this.mapSelection(function(t,i,s,e,n){return(i=h[e%h.length])[n%i.length]}),this.render()},custom:function(){}}},ce={open:function(t,i){if(t){var s=this.getItem(t);s.$count&&!s.open&&(this.callEvent("onBeforeOpen",[t])&&(s.open=!0,this.data.callEvent("onStoreUpdated",[t,0,"branch"]),this.callEvent("onAfterOpen",[t])),i&&"0"!=t&&this.open(this.getParentId(t),i))}},close:function(t){if(t){var i=this.getItem(t);i.open&&this.callEvent("onBeforeClose",[t])&&(i.open=!1,this.data.callEvent("onStoreUpdated",[t,0,"branch"]),this.callEvent("onAfterClose",[t]))}},openAll:function(t){this.data.eachSubItem(t||0,function(t,i){i&&(t.open=!0)}),this.data.refresh()},closeAll:function(t){this.data.eachSubItem(t||0,function(t,i){i&&(t.open=!1)}),this.data.refresh()},cf:function(t,i,s){if(this.Z.threeState)return this.ff(t,null!==i?i:"");var e,n=this.getItem(t),h=s?s.target||s.srcElement:null;e=h&&"checkbox"==h.type?!!h.checked:null!==i?i:!n.checked,n.checked=e,this.callEvent("onItemCheck",[t,n.checked,s])},isBranchOpen:function(t){if("0"==t)return!0;var i=this.getItem(t);return!!i.open&&this.isBranchOpen(i.$parent)},getOpenItems:function(){var t=[];for(var i in this.data.branch)this.exists(i)&&this.getItem(i).open&&t.push(i);return t},getState:function(){return{open:this.getOpenItems(),select:this.getSelectedId(!0)}},lf:function(t,i){var s=this.data.attachEvent("onStoreLoad",function(){t.setState.call(t,i),t.data.detachEvent(s),t=null})},setState:function(t){if(t.open){this.closeAll();for(var i=t.open,s=0;s<i.length;s++){var e=this.getItem(i[s]);if(e&&e.$count&&(e.open=!0,-1==e.$count))return this.lf(this,t),this.refresh(),0}this.refresh()}if(t.select&&this.select){var n=t.select;this.unselect();for(var h=0;h<n.length;h++)this.exists(n[h])&&this.select(n[h],!0)}return 1}},fe={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.cf(i,null,t),!1}},le={$init:function(){this.data.attachEvent("onStoreUpdated",C(this.df,this),null,!0),this.wo=this.vf},vf:function(t,i,s,e){var n=0===i?{
  parent:encodeURIComponent(t)}:null;return ws.prototype.wo.call(this,t,i,s,e,n)},loadBranch:function(t,i,s){return t=t||0,this.data.url=s||this.data.url,this.callEvent("onDataRequest",[t,i,this.data.url])&&this.data.url?this.data.feed.call(this,t,0,i,s):mt.reject()},df:function(t,i,s){s&&"add"!=s&&"delete"!=s&&"branch"!=s||this.data._f(this)}},de={$init:function(){this.data},copy:function(t,i,s,e){return(e=e||{}).copy=!0,this.move(t,i,s,e)},ar:function(t,i,s){if(i&&t){var e=this.getBranchIndex(t),n=this.getParentId(t)==this.getParentId(i);return e+(s==this&&n&&s.getBranchIndex(i)<e?0:1)}},pf:function(t,i){var s=this.data.branch[t];if(s&&s.length)for(var e=0;e<s.length;e++){if(s[e]==i)return!0;if(this.pf(s[e],i))return!0}return!1},mf:function(t){for(var i=0;i<t.length;i++)for(var s=t[i];this.getParentId(s);)s=this.getParentId(s),-1==x.find.call(t,s)||(t.splice(i,1),i--);return t},move:function(t,i,s,e){i=i||0;var n=(e=e||{}).newId||t,h=e.parent||0;if((s=s||this).data,s.data){if(!g(t)){if(this!=s||e.copy){if(n=s.data.add(s.or(this.getItem(t),n),i,h||0),this.data.branch[t]&&s.getBranchIndex){var r=this.data.Mr;this.data.Mr=function(t){var i=m(t);return delete i.$parent,delete i.$level,delete i.$child,s.data.pull[i.id]&&(i.id=z()),i};var o={data:this.serialize(t,!0),parent:n};this.data.Mr=r,s.parse(o)}e.copy||this.data.remove(t)}else{if(t==h||this.pf(t,h))return;var a=this.getItem(t),u=this.data.branch[h];u||(u=this.data.branch[h]=[]);var c=this.data.branch[a.$parent],f=x.find.call(c,t);if(i<0&&(i=u.length),c===u&&i===f)return;if(x.removeAt.call(c,f),x.insertAt.call(u,t,Math.min(u.length,i)),c.length||delete this.data.branch[a.$parent],a.$parent&&"0"!=a.$parent&&this.getItem(a.$parent).$count--,h&&"0"!=h){var l=s.getItem(h);l.$count++,this.bf(a,l.$level+1)}else this.bf(a,1);a.$parent=h,s.data.callEvent("onDataMove",[t,i,h,u[i+1]])}return this.refresh(),n}this.mf(t);for(var d=0;d<t.length;d++){var v=this.move(t[d],i,s,e);i=s.ar(v,t[d+1],this)}}},bf:function(t,i){t.$level=i;var s=this.data.branch[t.id];if(s)for(var e=0;e<s.length;e++)this.bf(this.getItem(s[e]),i+1)},Lo:function(t){t&&!t.header&&this.exists(t)&&this.Oo(t)!=is["in"].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.pf(t.source,t.target))return!1;return!0},or:function(t,i){var s=ds.or.call(this,t,i);return delete s.open,s}},ve={$init:function(){this.render},gf:function(t){var i=this.data.Hr[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()},wf:function(t){return this.Ji.innerHTML=this.gf(t),this.Ji.firstChild},Ot:function(t){!t.$template||this.type["template"+t.$template],t.$template;var i="<div role='presentation' class='webix_tree_branch_"+t.$level+"'>"+this.gf(t);return t.open&&(i+=this.xf(t.id)),i+="</div>"},xf:function(t){var i="",s=this.data.branch[t];if(s){i+="<div role='presentation' class='webix_tree_leaves'>";for(var e=s.length-1,n=0;n<=e;n++){var h=this.getItem(s[n]),r=this.type.yf;0!==r&&(r[h.$level]=n==e),i+=this.Ot(h)}i+="</div>"}return i},render:function(t,i,s){if((ve.Os=this).isVisible(this.Z.id)&&!this.$blockRender){if(t){var e,n,h=this.getItem(t);if("add"!=s&&!(e=this.getItemNode(t)))return;switch(s){case"branch":var r=e.parentNode;X(n=this.yc(h),r),G(r),this.Gi=null;break;case"paint":case"update":X(n=this.Gi[t]=this.wf(h),e),G(e);break;case"delete":G(e.parentNode);break;case"add":var o;if(0==h.$parent)o=this.mt.firstChild;else if(this.getItem(h.$parent).open&&(o=this.getItemNode(h.$parent))){if(!o.nextSibling){var a=Y("DIV",{"class":"webix_tree_leaves"},"");o.parentNode.appendChild(a)}o=o.nextSibling}if(o){var u=this.data.getNextSiblingId(t);(u=this.getItemNode(u))&&(u=u.parentNode),n=this.yc(h),this.Gi[t]=n.firstChild,X(n,u,o)}break;default:return!1}this.callEvent("onPartialRender",[t,i,s])}else this.callEvent("onBeforeRender",[this.data])&&(this.type.yf=[],this.mt.innerHTML=this.xf(0),this.Gi=null,this.callEvent("onAfterRender",
  []));return this.type.yf=0,!(ve.Os=null)}},getItemNode:function(t){if(this.Gi)return this.Gi[t];this.Gi={};for(var i=this.mt.getElementsByTagName("DIV"),s=0;s<i.length;s++){var e=i[s].getAttribute(this.na);e&&(this.Gi[e]=i[s])}return this.getItemNode(t)},Mf:1},_e={Sf:function(){if(this.Mf){var e=this.render;this.render=function(t,i){var s=e.apply(this,arguments);this.Z.threeState&&s&&"checkbox"!=i&&this.kf.apply(this,arguments)},this.Sf=function(){}}},threeState_setter:function(t){return t&&this.Sf(),t},kf:function(t){var i,s,e,n,h;if(e=[],h=this,t&&!h.data.pull[t]&&(t=0),!t||h.data.pull[t].$count)for((s=this.Cf(t)).sort(function(t,i){return h.data.pull[i].$level-h.data.pull[t].$level}),i=0;i<s.length;i++)i&&h.data.pull[s[i]].$parent==h.data.pull[s[i-1]].$parent||(e=e.concat(h.$f(s[i])));else e=e.concat(h.$f(t));for(n={},i=0;i<e.length;i++)n[e[i]]||(n[e[i]]=1,this.Df(e[i]));h=null},Df:function(t){var i;this.getItemNode(t)&&(this.render(t,"checkbox","update"),this.getItem(t).indeterminate&&(i=this.getItemNode(t).getElementsByTagName("input")[0])&&(i.indeterminate=this.getItem(t).indeterminate))},$f:function(t){var i,s,e,n,h,r,o;for(n=this.getParentId(t),h=[];n&&"0"!=n;){s=r=0,this.data.eachChild(n,function(t){t.indeterminate?r++:t.checked&&s++}),i=e=o=!1;var a=this.getItem(n);s==a.$count?i=!0:(0<s||0<r)&&(e=!0),(e||e!=a.indeterminate)&&(o=!0),a.indeterminate=e,(i||a.checked!=i)&&(o=!0),a.checked=i,n=o?(h.push(n),this.getParentId(n)):0}return h},getChecked:function(){var i=[],s=this;return this.data.eachSubItem(0,function(t){s.isChecked(t.id)&&i.push(t.id)}),i},ff:function(t,i){var s=this.getItem(t);if(s&&(""===i&&(i=!s.checked),s.checked!=i||s.indeterminate)){s.checked=i,this.If(t);var e=this.$f(t);if(this.Mf&&e.length<5)for(var n=0;n<e.length;n++)this.Df(e[n]);else this.refresh();this.callEvent("onItemCheck",[t,i])}},checkItem:function(t){this.cf(t,!0),this.updateItem(t)},uncheckItem:function(t){this.cf(t,!1),this.updateItem(t)},Af:function(t,i,s){var e=i?"checkItem":"uncheckItem";t?this[e](t):t=0,this.Z.threeState?t||this.data.eachChild(0,function(t){this[e](t.id)},this,s):this.data.each(function(t){this[e](t.id)},this,s,t)},checkAll:function(t,i){this.Af(t,!0,i)},uncheckAll:function(t,i){this.Af(t,!1,i)},If:function(t){var i,s=this.getItem(t);s.indeterminate=!1,i=s.checked,this.data.eachSubItem(t,function(t){t.indeterminate=!1,t.checked=i}),this.Mf&&this.isBranchOpen(s.$parent)&&this.render(t,0,"branch")},isChecked:function(t){return this.getItem(t).checked},Cf:function(t){var s=[];return this.data.eachSubItem(t,function(t,i){i||s.push(t.id)}),s}},pe={name:"TreeStore",$init:function(){this.co={showSubItems:!0},this.branch={0:[]},this.attachEvent("onParse",function(t){this.so(t.child)}),this.attachEvent("onClearAll",C(function(){this.Kr=null},this))},filterMode_setter:function(t){return P.extend(this.co,t,!0)},ao:function(t){if(this.Kr&&!t){for(var i in this.branch=this.Kr,this.order=p(m(this.branch[0])),this.branch)"0"!=i&&(this.getItem(i).$count=this.branch[i].length);delete this.Kr}},uo:function(t,i,s,e){s&&this.Kr||(this.Kr=this.branch,this.branch=f(this.branch)),this.branch[0]=this.Tf(t,i,this.branch[0],1,e||{})},Tf:function(t,i,s,e,n){for(var h=[],r=n.level&&n.level!=e,o=0;o<s.length;o++){var a=s[o],u=this.getItem(a),c=!1,f=this.branch[a];if(r)c=!0;else if(t(this.getItem(a),i)){if(h.push(a),!1!==n.openParents)for(var l=this.getParentId(a);l&&"0"!=l;)this.getItem(l).open=1,l=this.getParentId(l);if(n.level||n.showSubItems)continue}else c=!0;if((r||!n.level)&&f){var d=this.branch[a]=this.Tf(t,i,f,e+1,n);u.$count=d.length,c&&d.length&&h.push(a)}}return h},count:function(){if(this.order.length)return this.order.length;var t=0;return this.eachOpen(function(){t++}),t},Ff:function(t,i,s,e){if(t[s]){for(var n=t[e]=t[s],h=0;h<n.length;h++)this.getItem(n[h]).$parent=e;delete t[s]}if(t[i]){var r=x.find.call(t[i],s);0<=r&&(t[i][r]=e)}},changeId:function(t,i){if(t!=i){var s=this.getItem(t).$parent;return this.Ff(this.branch,s,t,i),this.Kr&&this.Ff(this.Kr,s,t,i),gs.prototype.changeId.call(this,t,i)}},clearAll:function(t){
  this.branch={0:[]},gs.prototype.clearAll.call(this,t)},getPrevSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],s=x.find.call(i,t)-1;return 0<=s?i[s]:null},getNextSiblingId:function(t){var i=this.branch[this.getItem(t).$parent],s=x.find.call(i,t)+1;return s<i.length?i[s]:null},getParentId:function(t){return this.getItem(t).$parent},getFirstChildId:function(t){var i=this.branch[t];return i&&i.length?i[0]:null},isBranch:function(t){return!!this.branch[t]},getBranchIndex:function(t){var i=this.branch[this.pull[t].$parent];return x.find.call(i,t)},so:function(s){this.io="string"==typeof s?function(t){var i=t[s];return i&&delete t[s],i}:s},Pr:function(t,i){for(var s=t.parent||0,e=0;e<i.length;e++){var n=this.driver.getDetails(i[e]),h=this.id(n),r=!!this.pull[h];r?(n=P.extend(this.pull[h],n,!0),this.Ur&&this.Ur(n)):(this.Yr&&this.Yr(n),this.pull[h]=n),this.Qr(n,s,0,r,t.from?1*t.from+e:0)}var o=this.pull[s]||{},a=this.branch[s]||[];o.$count=a.length,delete o.webix_kids,t.size&&t.size!=a.length&&(a[t.size-1]=undefined)},Qr:function(t,i,s,e,n){t.$count=0,t.$parent="0"!=i?i:0,t.$level=s||("0"!=i?this.pull[i].$level+1:1);var h=this.branch[t.$parent];(h||(h=this.branch[t.$parent]=[]),this.Kr&&(this.Kr[t.$parent]=h),e)||(h[n||h.length]=t.id);var r=this.io(t);if(t.webix_kids)return t.$count=-1;if(!r)return t.$count=0;g(r)||(r=[r]);for(var o=0;o<r.length;o++){var a=hi.json.getDetails(r[o]),u=this.id(a);(e=!!this.pull[u])?(a=P.extend(this.pull[u],a,!0),this.Ur&&this.Ur(a)):(this.Yr&&this.Yr(a),this.pull[u]=a),this.Qr(a,t.id,t.$level+1,e)}var c=this.branch[t.id];c&&(t.$count=c.length)},_f:function(t){this.order=p(),this.zf(this.order,0,t)},zf:function(t,i,s){for(var e=this.branch[i],n=0;n<e.length;n++){var h=e[n];t.push(h);var r=this.pull[h];r&&r.open&&(-1==r.$count?s.loadBranch(h):r.$count&&this.zf(t,h,s))}},provideApi:function(t,i){for(var s=["getPrevSiblingId","getNextSiblingId","getParentId","getFirstChildId","isBranch","getBranchIndex","filterMode_setter"],e=0;e<s.length;e++)t[s[e]]=this.lo(this,s[e]);t.getIndexById||gs.prototype.provideApi.call(this,t,i)},getTopRange:function(){return p([].concat(this.branch[0])).map(function(t){return this.getItem(t)},this)},eachChild:function(t,i,s,e){var n=this.branch;e&&this.Kr&&(n=this.Kr);var h=n[t];if(h)for(var r=0;r<h.length;r++)h[r]&&i.call(s||this,this.getItem(h[r]))},each:function(s,e,n,t){this.eachChild(t||0,function(t){var i=this.branch;s.call(e||this,t),n&&this.Kr&&(i=this.Kr),t&&i[t.id]&&this.each(s,e,n,t.id)},this,n)},eachOpen:function(i,s,t){this.eachChild(t||0,function(t){i.call(s||this,t),this.branch[t.id]&&t.open&&this.eachOpen(i,s,t.id)})},eachSubItem:function(t,i){var s=this.branch[t||0];if(s)for(var e=0;e<s.length;e++){var n=s[e];this.branch[n]?(i.call(this,this.getItem(n),!0),this.eachSubItem(n,i)):i.call(this,this.getItem(n),!1)}},eachLeaf:function(t,i){var s=this.branch[t||0];if(s)for(var e=0;e<s.length;e++){var n=s[e];this.branch[n]?this.eachLeaf(n,i):i.call(this,this.getItem(n),!1)}},oo:function(t,i){var s=this.sorting.create(t);for(var e in this.branch){for(var n=this.branch[e],h=[],r=0;r<n.length;r++)h.push(this.pull[n[r]]);h.sort(s);for(var o=0;o<n.length;o++)h[o]=h[o].id;this.branch[e]=h}return i},add:function(t,i,s){var e=!1,n=this.getItem(s||0);if(n&&(this.branch[n.id]||(e=!0),n.$count++,n.$count||(n.$count=1)),this.branch[s||0]=this.order=p(this.branch[s||0]),t.$count=t.webix_kids?-1:0,t.$level=n?n.$level+1:1,t.$parent=n?n.id:0,this.Kr){var h=this.Kr[s||0];if(h||(h=this.Kr[s]=this.order),this.order!==h){var r=h.length;!i&&this.branch[s||0].length&&(r=0),h=p(h),t.id=t.id||z(),h.insertAt(t.id,r)}}var o=gs.prototype.add.call(this,t,i);return e&&this.refresh(s),o},Vf:function(t){var i=this.pull[t];if(this.branch[i.id]&&0<this.branch[i.id].length)for(var s=this.branch[t],e=0;e<s.length;e++)this.Vf(s[e],!0);delete this.branch[t],this.Kr&&delete this.Kr[t],delete this.pull[t],this.Hr[t]&&delete this.Hr[t]},Bf:function(t,i,s){var e=t[i];1==e.length&&e[0]==s&&i?delete t[i]:p(e).remove(s)},remove:function(t){if(g(t))for(var i=0;i<t.length;i++)this.remove(t[i]
  );else{this.exists(t);var s=this.pull[t],e=s.$parent||0;if(!1===this.callEvent("onBeforeDelete",[t]))return!1;this.Vf(t),this.callEvent("onAfterDelete",[t]);var n=this.pull[e];this.Bf(this.branch,e,t),this.Kr&&this.Bf(this.Kr,e,t);var h=0;n&&(n.$count--,n.$count<=0&&(n.$count=0,n.open=0,h=1)),this.callEvent("onStoreUpdated",[t,s,"delete"]),h&&this.refresh(n.id)}},getBranch:function(t){var i=[],s=(this.Kr||this.branch)[t];if(s)for(var e=0;e<s.length;e++)i[e]=this.pull[s[e]];return i},serialize:function(t,i){var s=this.branch;i&&this.Kr&&(s=this.Kr);for(var e=s[t||0],n=[],h=0;h<e.length;h++){var r,o=this.pull[e[h]];if(this.Mr){if(!1===(r=this.Mr(o)))continue}else r=m(o);s[o.id]&&(r.data=this.serialize(o.id,i)),n.push(r)}return n}},me={insert:function(t){for(var i=this.getSelectedId(!0,!0),s=0;s<t.length;s++){for(var e={},n=0;n<this.Z.columns.length;n++)e[this.Z.columns[n].id]=t[s][n]||"";!j(e.id)&&this.exists(e.id)&&(e.id=z()),this.add(e,null,i[0])}}},be={space:function(t){for(var i="",s=1;s<t.$level;s++)i+="<div class='webix_tree_none'></div>";return i},icon:function(t){return t.$count?t.open?"<div class='webix_tree_open'></div>":"<div class='webix_tree_close'></div>":"<div class='webix_tree_none'></div>"},checkbox:function(t){return t.nocheckbox?"":"<input type='checkbox' class='webix_tree_checkbox' "+(t.checked?"checked":"")+(t.disabled?" disabled":"")+">"},folder:function(t){return t.icon?"<div class='webix_tree_file webix_tree_"+t.icon+"'></div>":t.$count?t.open?"<div class='webix_tree_folder_open'></div>":"<div class='webix_tree_folder'></div>":"<div class='webix_tree_file'></div>"}},ge={flash:{$render:function(){window.swfobject||ei("legacy/swfobject.js",!0);var t=this.Z;t.swfId=t.swfId||"webix_swf_"+z(),this.Hf().innerHTML+="<div class='webix_upload_flash'><div id='"+t.swfId+"'></div></div>",this.Rf=this.Hf().lastChild,swfobject.embedSWF(S.codebase+"/legacy/uploader.swf",t.swfId,"100%","100%","9",null,{uploaderId:t.id,ID:t.swfId,enableLogs:t.enableLogs?"1":"",paramName:t.inputName,multiple:t.multiple?"Y":""},{wmode:"transparent"}),Nt(this.et,"click",C(function(){250<new Date-(this.Pf||0)&&this.fileDialog()},this)),this.files.attachEvent("onBeforeDelete",C(this.jf,this))},$applyFlash:function(t,i){return this[t].apply(this,i)},getSwfObject:function(){return swfobject.getObjectById(this.Z.swfId)},fileDialog:function(){this.getSwfObject()&&this.getSwfObject().showDialog()},send:function(t){if("function"==typeof t&&(this.Ef=t,t=0),t){var i=this.files.getItem(t);if("client"!==i.status)return!1;if(i.status="transfer",this.getSwfObject()){var s=this.Nf(i),e=this.Z.formData||{};"function"==typeof e&&(e=e.call(this));var n=P.extend(i.formData||{},e);this.getSwfObject().upload(t,s,n)}return!0}var h=this.files.data.order,r=!0;if(h.length)for(var o=0;o<h.length;o++)r=this.send(h[o])&&r;r&&this.Lf()},$beforeAddFileToQueue:function(t,i,s){var e=i.split(".").pop(),n=this.Of(s);return this.callEvent("onBeforeFileAdd",[{id:t,name:i,size:s,sizetext:n,type:e}])},$addFileToQueue:function(t,i,s){if(this.files.exists(t))return!1;this.Z.multiple||this.files.clearAll();var e=i.split(".").pop(),n={name:i,id:t,size:s,sizetext:this.Of(s),type:e,status:"client"};this.files.add(n),this.callEvent("onAfterFileAdd",[n]),t&&this.Z.autosend&&this.send(t)},stopUpload:function(t){this.jf(t)},jf:function(t){var i=this.files.getItem(t);"transfer"==i.status&&(this.getSwfObject().uploadStop(t),i.status="client")},Uf:function(){},$onUploadComplete:function(){this.Z.autosend&&this.Lf()},$onUploadSuccess:function(t,i,s){var e=this.files.getItem(t);e&&(e.status="server",e.progress=100,s.text&&"string"==typeof s.text&&(hi.json.toObject(s.text),P.extend(e,s,!0)),this.callEvent("onFileUpload",[e,s]),this.callEvent("onChange",[]),this.files.updateItem(t))},$onUploadFail:function(t){var i=this.files.getItem(t);i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,""])}},html5:{$render:function(){if(this.Rf)this.Zi.firstChild.appendChild(this.Rf);else{this.files.attachEvent("onBeforeDelete",this.jf);var t={type:"file",
  "class":"webix_hidden_upload",tabindex:-1};this.Z.accept&&(t.accept=this.Z.accept),this.Z.multiple&&(t.multiple="true"),this.Z.directory&&(t.webkitdirectory="true",t.mozdirectory="true",t.directory="true");var i=Y("input",t);this.Rf=this.Zi.firstChild.appendChild(i),Nt(this.et,"drop",C(function(t){this.Uf(t),Q(t)},this)),Nt(i,"change",C(function(){if(this.Yf(i.files),S.isIE){var t=document.createElement("form");t.appendChild(this.Rf),t.reset(),this.Zi.firstChild.appendChild(i)}else i.value=""},this)),Nt(this.et,"click",C(function(){250<new Date-(this.Pf||0)&&this.fileDialog()},this)),Nt(this.et,"dragenter",Q),Nt(this.et,"dragexit",Q),Nt(this.et,"dragover",Q)}},Wf:function(t){return t.isDirectory},Gf:function(s,e,n){if(s.isFile)s.file(function(t){e.addFile(t,null,null,{name:n+"/"+t.name})});else if(s.isDirectory){s.createReader().readEntries(function(t){for(var i=0;i<t.length;i++)e.Gf(t[i],e,(n?n+"/":"")+s.name)})}},Uf:function(t){var i=t.dataTransfer.files,s=t.dataTransfer.items;if(this.callEvent("onBeforeFileDrop",[i,t])){s=s||i;for(var e=0;e<s.length;e++){var n=s[e];n.webkitGetAsEntry&&(n=n.webkitGetAsEntry()).isDirectory?this.Gf(n,this,""):this.addFile(i[e])}}this.callEvent("onAfterFileDrop",[i,t])},fileDialog:function(t){this.Pf=new Date,this.Xf=t;var i=this.et.getElementsByTagName("INPUT");i[i.length-1].click()},send:function(i){if("function"==typeof i&&(this.Ef=i,i=0),i){var t=this.files.getItem(i);if("client"!==t.status)return!1;this.Z.upload,t.status="transfer";var s=new FormData;s.append(this.config.inputName,t.file,t.name),s.append(this.config.inputName+"_fullpath",t.name);var e={},n=this.Z.formData||{};"function"==typeof n&&(n=n.call(this));var h=P.extend(t.formData||{},n),r=new XMLHttpRequest,o=this.Nf(t);if(A("onBeforeAjax",["POST",o,h,r,e,s])){for(var a in h)s.append(a,h[a]);for(var u in(t.xhr=r).upload.addEventListener("progress",C(function(t){this.$updateProgress(i,t.loaded/t.total*100)},this),!1),r.onload=C(function(){r.aborted||this.Jf(i)},this),r.open("POST",o,!0),e)r.setRequestHeader(u,e[u]);r.send(s)}return this.$updateProgress(i,0),!0}var c=this.files.data.order,f=!0;if(c.length)for(var l=0;l<c.length;l++)f=!this.send(c[l])&&f;f&&this.Lf()},Jf:function(t){var i=this.files.getItem(t);if(i){var s=null;if(i.xhr.status<400){var e=hi[this.Z.datatype||"json"];(s=e.toObject(i.xhr.responseText))&&(s=e.getDetails(s))}s&&"error"!=s.status?(!s.status||s.status,this.Zf(t,s)):(i.status="error",delete i.percent,this.files.updateItem(t),this.callEvent("onFileUploadError",[i,s])),delete i.xhr}},stopUpload:function(t){C(this.jf,this.files)(t)},jf:function(t){var i=this.getItem(t);"undefined"!=typeof i.xhr&&(i.xhr.aborted=!0,i.xhr.abort(),delete i.xhr,i.status="client")}}},we={qf:function(){this.data.attachEvent("onStoreUpdated",C(function(t,i,s){!t||"add"!=s&&"update"!=s||this.validate(t)},this)),this.data.attachEvent("onClearAll",C(this.clearValidation,this)),this.qf=function(){}},rules_setter:function(t){return t&&this.qf(),t},clearValidation:function(){this.data.clearMark("webix_invalid",!0)},validate:function(t){var i=!0;if(t){this.cr={};var s=this.getItem(t);(i=_s.validate.call(this,null,s))?this.callEvent("onValidationSuccess",[t,s])&&this.ur(t):this.callEvent("onValidationError",[t,s,this.cr])&&this.lr(t,this.cr)}else for(var e in this.data.pull)i=this.validate(e)&&i;return i},fr:function(t,i,s,e){"string"==typeof t&&(t=vs[t]);var n=t.call(this,i,s,e);return n||(this.cr[e]=!0),n},ur:function(t){this.data.removeMark(t,"webix_invalid",!0)},lr:function(t){this.data.addMark(t,"webix_invalid",!0)}},xe={$init:function(){this.elements={}},focus:function(t){if(t)this.elements[t],this.Mi(this.elements[t]);else for(var i in this.elements)if(!1!==this.Mi(this.elements[i]))return!0;return!1},Mi:function(t){return!(!t||!t.focus)&&t.focus()},setValues:function(t,i){var s=this;this.Z.complexData&&(t=xt.collapseNames(t,"",{},function(t){return j(s.Kf[t])})),this.Qf(t,i)},Qf:function(t,i){for(var s in this.tl=i,this.blockEvent(),i&&this.Kf||(this.Kf={}),t)this.elements[s]||(this.Kf[s]=t[s]);for(var e in this.elements){
  var n=this.elements[e];n&&(j(t[e])?!i&&n.$allowsClear&&n.setValue(""):n.setValue(t[e]),this.Kf[e]=n.getValue())}this.unblockEvent(),this.callEvent("onValues",[])},isDirty:function(){return!!this.tl||1===this.getDirtyValues(1)},setDirty:function(t){(this.tl=t)||(this.Kf=this.il())},getDirtyValues:function(){var t={};if(this.Kf)for(var i in this.elements){var s=this.elements[i].getValue();if(this.Kf[i]!=s&&(t[i]=s,arguments[0]))return 1}return t},getCleanValues:function(){return this.Kf},getValues:function(t){var i=this.il(t);return this.Z.complexData&&(i=xt.expandNames(i)),i},il:function(t){var i,s=null,e=this.Kf?m(this.Kf):{};for(var n in this.elements)s=this.elements[n],i=!0,t&&("object"==k(t)?(!1===t.hidden&&(i=s.isVisible()),i&&!1===t.disabled&&(i=s.isEnabled())):i=t.call(this,s)),i?e[n]=s.getValue():delete e[n];return e},clear:function(){this.tl=!1;var t={};for(var i in this.elements)this.elements[i].$allowsClear&&(t[i]="");this.Qf(t)},markInvalid:function(t,i){if(!1===i)this.ur(t);else{if("string"==typeof i){var s=this.elements[t];s&&(s.Z.invalidMessage=i)}this.cr&&(this.cr[t]=!0),this.lr(t)}},lr:function(t){var i=this.elements[t];t&&i&&(this.ur(t,!0),st(i.et,"webix_invalid"),i.Z.invalid=!0,"string"==typeof i.Z.invalidMessage&&i.setBottomText&&i.setBottomText())},ur:function(t,i){var s=this.elements[t];t&&s&&s.$view&&s.Z.invalid&&(et(s.et,"webix_invalid"),s.Z.invalid=!1,"string"==typeof s.Z.invalidMessage&&!i&&s.setBottomText&&s.setBottomText())}},ye={$init:function(){this.render,this.Gi={},Nt(this.et,"scroll",C(this.sl,this)),S.touch&&this.attachEvent("onAfterScroll",C(this.sl,this)),this.el=[]},getItemNode:function(t){return this.Gi[t]},showItem:function(t){var i=this.ph(),s=this.data.getIndexById(t),e=Math.floor(s/i._h)*i.Ve,n=this.getScrollState();(e<n.y||e+this.Z.height>=n.y+this.Is)&&this.scrollTo(0,e)},render:function(t,i,s){if(this.isVisible(this.Z.id)&&!this.$blockRender)if(t){var e=this.getItemNode(t);switch(s){case"update":if(!e)return;X(this.Gi[t]=this.yc(i),e),G(e);break;default:this.nl()}}else this.callEvent("onBeforeRender",[this.data])&&(this.Gi={},this.sl(null,!0),this.hl=!1,this.callEvent("onAfterRender",[]))},nl:function(){this.hl||(this.hl=!0,window.setTimeout(C(function(){this.render()},this),1))},rl:function(t){S.maxHTMLElementSize&&(t=Math.min(S.maxHTMLElementSize,t));var i=document.createElement("DIV");return i.style.cssText="height:"+t+"px; width:100%; overflow:hidden;",i},sl:function(t,i){this.el=[];var s=this.ph();this.mt.firstChild&&!i||(this.mt.innerHTML="",this.mt.appendChild(this.rl(s.ol)),this.Xi=[this.mt.firstChild]);for(var e=s.al;e<=s.ul;){for(;this.Xi[e]&&this.Xi[e].cl&&e<=s.ul;)e++;if(e>s.ul)break;for(var n=e;!this.Xi[n];)n--;var h=this.Xi[n],r=e*s._h+(this.data.$min||0);if(r>(this.data.$max||Infinity))break;var o=Math.min(r+s._h-1,this.data.$max?this.data.$max-1:Infinity),a=this.rl(s.Ve),u=this.data.getIndexRange(r,o);if(!u.length)break;for(var c={$template:"Loading"},f=0;f<u.length;f++)u[f]||this.el.push(r+f),u[f]=this.Ot(u[f]||c);a.innerHTML=u.join("");for(var l=0;l<u.length;l++)this.Gi[this.data.getIdByIndex(r+l)]=a.childNodes[l];var d=parseFloat(h.style.height,10),v=(e-n)*s.Ve,_=d-v-s.Ve;if(X(a,v?h.nextSibling:h,this.mt),(this.Xi[e]=a).cl=!0,v<=0&&0<_)h.style.height=_+"px",this.Xi[e+1]=h;else if(v<0?G(h):h.style.height=v+"px",0<_)X(this.Xi[e+1]=this.rl(_),a.nextSibling,this.mt);e++}if(this.el.length){var p=this.el[0],m=this.el.pop()+1;if(p<m){var b=m-p;if(this.So(b,p))return;b=Math.max(b,this.Z.datafetch||this.Z.loadahead||0),this.loadNext(b,p)}}},ph:function(){var t=this.getScrollState(),i=Math.max(0,t.y),s=this.$s,e=this.Is,n=this.type,h=Math.floor(s/n.width)||1,r=Math.floor(i/n.height),o=Math.ceil((e+i)/n.height)-1,a=this.data.$max?this.data.$max-this.data.$min:this.data.count();return{al:r,ul:o,fl:i,ol:Math.ceil(a/h)*n.height,Ve:n.height,_h:h}},qt:function(t){var i=this.getItemNode(t);return i||(this.showItem(t),this.sl(),i=this.getItemNode(t)),{left:i.offsetLeft,top:i.offsetTop,height:i.offsetHeight,width:i.offsetWidth,parent:this.Zi}}},Me={$init:function(){this.Gi={},
  Ki.$active?(this.attachEvent("onBeforeScroll",function(){this.ll=!0}),this.attachEvent("onAfterScroll",function(){this.render(null,null,"paint"),this.ll=!1}),this.attachEvent("onTouchMove",function(){this.ll&&(this.blockEvent(),this.render(null,null,"paint"),this.unblockEvent())})):Nt(this.et,"scroll",C(function(){this.render(null,null,"paint")},this))},De:function(t,i,s){this.Z.footer&&Ki.Ce(this.dl.childNodes[1].firstChild,t,0,s),this.callEvent("onSyncScroll",[t,i,s])},getItemNode:function(t){return this.Gi&&this.Gi[t]},showItem:function(t){var i=this.data.getIndexById(t);if(-1<i){var s=i*this.type.height,e=s+this.type.height,n=this.getScrollState(),h=Z(this.$view);s<n.y?this.scrollTo(0,s):e>n.y+h.height&&this.scrollTo(0,e-h.height)}},render:function(t,i,s){if(this.isVisible(this.Z.id)&&!this.$blockRender){var e=this.Sc||this.mt;if(!t||"paint"!=s&&"update"!=s){if("paint"!=s&&(this.Gi={},e.innerHTML=""),this.callEvent("onBeforeRender",[this.data])){var n=this.data.count(),h=this.getScrollState(),r=Z(this.et),o=Math.floor(h.y/this.type.height)-2,a=Math.ceil((h.y+r.height)/this.type.height)+2;o=Math.max(0,o),a=Math.min(this.data.count()-1,a);for(var u=[],c=o;c<=a;c++){var f=this.data.order[c];if(this.Gi[f])u.push("<div></div>");else{var l=this.data.getItem(f);if(!l){this.vl({count:a-c+(this.Z.loadahead||0),start:c});break}u.push(this.Ot(l))}}this.Ji.innerHTML=u.join(""),e.style.position="relative",e.style.height=n*this.type.height+"px";for(var d=this.Ji.childNodes,v=d.length-1;0<=v;v--){var _=d[v],p=_.getAttribute(this.na);p&&(_.style.position="absolute",_.style.top=(o+v)*this.type.height+"px",_.style.left=0,_.style.width="100%",e.appendChild(_),this.Gi[p]=_)}this.callEvent("onAfterRender",[])}}else{var m=this.getItemNode(t);if(m){var b=this.Gi[t]=this.yc(i);return b.style.top=m.style.top,b.style.position="absolute",b.style.left=0,b.style.width="100%",X(b,m),void G(m)}}}},$setSize:function(){Li.api.$setSize.apply(this,arguments)&&this.render(null,null,"paint")},vl:function(t){var i=Math.max(t.count,this.Z.datafetch||this.Z.loadahead||0);this.So(t.count,t.start)||this.loadNext(i,t.start)}},Se="non-existing view for export";function ke(i,s,t){return!t&&s.format?function(t){return s.format(t[i])}:function(t){return t[i]}}function Ce(t,i){var s,e=[],n=0,h=0,r=t.getColumnConfig,o=i.columns,a=!!i.rawValues,u="TreeStore"==t.data.name,c=i.treeLines;if((!0===c||j(c))&&(c="value"),e.heights={},o){if(!o.length){var f=[];for(var l in o)f.push(P.extend({id:l},P.extend({},o[l])));o=f}}else if(r)o=[].concat(t._l);else{o=[];var d=t.data.pull[t.data.order[0]];for(var v in d)"id"!==v&&"$"!=v[0]&&o.push({id:v,isTree:u&&v===c})}if(i.ignore)for(var _=o.length-1;0<=_;_--)i.ignore[o[_].id]&&o.splice(_,1);if(i.id&&e.push({id:"id",width:50,header:" ",template:function(t){return t.id}}),i.flatTree){for(var p=i.flatTree.id,m=[].concat(i.flatTree.columns),b=[],g=!!i.flatTree.fill,w=1;w<=m.length;w++)m[w-1].template=function(i){return function(t){return t.$level==i?b[i]=t[p]:g&&i<t.$level?b[i]:""}}(w);for(var x=0,y=o.length-1;0<=y;y--)o[y].id===p&&(x=y);o=[].concat(o.slice(0,x)).concat(m).concat(o.slice(x+1))}for(var M=0;M<o.length;M++){var S=o[M],k=S.id;if(!S.noExport){var C=a&&r;if(r){var $=t.pl[k];!S.template||$&&$.template==S.template||(C=!1),$&&(S=P.extend(P.extend({},S),$))}var D={id:S.id,template:C||!S.template?ke(k,S,a):S.template,width:(S.width||200)*("excel"===i.export_mode?8.43/70:1),header:!1!==S.header?S.header||k:""};u&&k===c&&(D.isTree=s=!0),"excel"===i.export_mode&&P.extend(D,{type:S.exportType||"",format:S.exportFormat||""}),"string"==typeof D.header?D.header=[{text:D.header}]:D.header=[].concat(D.header);for(var I=0;I<D.header.length;I++){var A=D.header[I]||{},T=A.contentId?t.getHeaderContent(A.contentId).getValue(!0):A.text;D.header[I]=(T||"").toString().replace(/<[^>]*>/gi,"")}if(n=Math.max(n,D.header.length),t.Z.footer){var F=S.footer||"";F="string"==typeof F?[{text:F}]:[].concat(F);for(var z=0;z<F.length;z++)F[z]?F[z]=F[z].contentId?t.getHeaderContent(F[z].contentId).getValue():F[z].text:F[z]="";D.footer=F,h=Math.max(h,
  D.footer.length)}e.push(D)}}!s&&u&&i.treeLines!=c&&e[0]&&(e[0].isTree=!0);for(var V=0;V<e.length;V++){for(var B=n-e[V].header.length,H=0;H<B;H++)e[V].header.push("");if(t.Z.footer){B=h-e[V].footer.length;for(var R=0;R<B;R++)e[V].footer.push("")}}return e}function $e(r,o,a){var t,i,u=!!o.filterHTML,c=/<[^>]*>/gi,f=[],l=o.export_mode;if("excel"!==l&&"csv"!=l||!o.docHeader||(f=[[(o.docHeader.text||o.docHeader).toString()],[""]],"excel"===l&&o.docHeader.height&&(a.heights[0]=o.docHeader.height)),!1!==o.header&&a.length)for(var s=0;s<a[0].header.length;s++){i=[];for(var e=0;e<a.length;e++)t="",a[e].header[s]&&(t=a[e].header[s],u&&(t=a[e].header[s]=t.replace(c,""))),i.push(t);"excel"!=l||!r._l||!1===o.heights||r.ml[s]===Xi.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.ml[s]),"pdf"!==l&&(f[f.length]=i)}o.yCorrection=(o.yCorrection||0)-f.length;var d=o.flatTree||o.plainOutput?"":"-";if(r.data.each(function(t){if(!o.filter||o.filter(t)){this.data.Zr&&(t=r.data.Zr(t));for(var i=[],s=0;s<a.length;s++){var e=a[s],n=null;if(o.math&&t["$"+e.id]&&"="==t["$"+e.id].charAt(0)&&!t["$"+e.id].match(/^=(image|link|sparkline)\(/i)&&(n=t["$"+e.id]),this.bl){var h=this.getSpan(t.id,e.id);h&&h[4]&&h[0]==t.id&&h[1]==e.id&&(n=h[4],u&&"string"==typeof n&&(n=n.replace(c,"")))}n||((n=e.template(t,r.type,t[e.id],e,s))||0===n||(n=""),e.isTree&&d&&(n=" "+Array(t.$level).join(d)+" "+n),u&&"string"==typeof n&&(n=n.replace(c,"")),"string"==typeof n&&"csv"===l&&(n=n.trim()),"string"!=typeof n||"excel"!==l&&"csv"!==l||(n=n.replace(/<br\s*\/?>/gm,"\n"))),i.push(n)}"excel"==l&&r._l&&!1!==o.heights&&(t.$height&&t.$height!==Xi.rowHeight||"all"==o.heights)&&(a.heights[f.length]=t.$height||this.config.rowHeight),f.push(i)}},r),!1!==o.footer)for(var n=a[0].footer?a[0].footer.length:0,h=0;h<n;h++){for(var v=[],_=0;_<a.length;_++){var p=a[_].footer[h];u&&(p=a[_].footer[h]=p.toString().replace(c,"")),v.push(p)}"excel"!=l||!r._l||!1===o.heights||r.gl[h]===Xi.barHeight&&"all"!=o.heights||(a.heights[f.length]=r.gl[h]),"pdf"!==l&&f.push(v)}return"excel"===l&&o.docFooter&&(f=f.concat([[],[(o.docFooter.text||o.docFooter).toString()]]),o.docFooter.height&&(a.heights[f.length-1]=o.docFooter.height)),f}var De={};function Ie(t,i){var s=(i.filename||"Data")+".pdf",e=new Blob([t.toString()],{type:"application/pdf"});return!1!==i.download&&ht(e,s),e}function Ae(e,n){for(var t,h=function o(t){var i=t.width||595.296,s=t.height||841.896;t.orientation&&"landscape"===t.orientation&&(s=[i,i=s][0]);return new pdfjs.Document({padding:40,font:t.wl,threshold:256,width:i,height:s})}(n),r=[],i=0;i<e.length;i++)e[i].node?r.push((t=e[i].node,window.html2canvas(t,{background:"#fff",logging:!1}).then(function(t){for(var i=t.toDataURL("image/jpeg"),s=window.atob(i.split("base64,")[1]),e=s.length,n=new Uint8Array(e),h=0;h<e;h++)n[h]=s.charCodeAt(h);return new pdfjs.Image(n.buffer)}))):r.push(mt.resolve());return mt.all(r).then(function(t){for(var i=0;i<r.length;i++){var s=e[i].viewOptions;s.textBefore&&Te(h,"before",s.textBefore),t[i]?h.image(t[i],{align:"center"}):ze(e[i].scheme,e[i].data,s,h),s.textAfter&&Te(h,"after",s.textAfter),i!=e.length-1&&h.pageBreak()}return function o(e,n){if(!1!==n.docFooter){var t=e.footer();t.text({color:6710886,textAlign:"center"}).append(ct.dataExport.page||"Page").pageNumber().append("  "+(ct.dataExport.of||"of")+"  ").pageCount()}var h={text:0,image:1};n.docHeader&&("string"==typeof n.docHeader&&(n.docHeader={text:n.docHeader}),P.extend(n.docHeader,{color:6710886,textAlign:"right",order:0}),h.text=n.docHeader.order);n.docHeaderImage&&("string"==typeof n.docHeaderImage&&(n.docHeaderImage={url:n.docHeaderImage}),P.extend(n.docHeaderImage,{align:"right",order:1}),h.image=n.docHeaderImage.order);n.docHeader&&h.image>h.text&&e.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader);{if(n.docHeaderImage){var r=mt.defer();return pdfjs.load(n.docHeaderImage.url,function(t,i){if(!t){var s=new pdfjs.Image(i);e.header({paddingBottom:10}).image(s,n.docHeaderImage),n.docHeader&&h.image<h.text&&e.header({paddingBottom:10}).text(n.docHeader.text,n.docHeader)}
  r.resolve(e.render())}),r}return mt.resolve(e.render())}}(h,n)})}function Te(t,i,s){"after"==i&&t.text().br(),"string"==typeof s&&(s={text:s}),t.text(s.text,s.options||{}),"before"==i&&t.text().br()}function Fe(t,i){for(var s=i.orientation&&"landscape"==i.orientation?"height":"width",e=80,n=0;n<t.length;n++)e+=t[n].width;i[s]=Math.max(i[s]||0,e)}function ze(t,i,s,e){s.header=j(s.header)||!0===s.header?{}:s.header,s.footer=j(s.footer)||!0===s.footer?{}:s.footer,s.table=s.table||{};for(var n=!1===s.header?0:t[0].header.length,h=!1!==s.footer&&t[0].footer?t[0].footer.length:0,r=[],o=0;o<t.length;o++)r[o]=t[o].width;var a=P.extend(s.table,{borderWidth:1,height:20,lineHeight:1.1,borderColor:15658734,backgroundColor:16777215,color:6710886,textAlign:"left",paddingRight:10,paddingLeft:10,headerRows:n,widths:r.length?r:["100%"]}),u=e.table(a);if(n)for(var c=P.extend(s.header,{borderRightColor:11587299,borderBottomColor:11587299,color:4868682,backgroundColor:13820911,height:27,lineHeight:1.2}),f=0;f<n;f++)for(var l=u.tr(c),d=0;d<t.length;d++)l.td(t[d].header[f].toString());for(var v=0;v<i.length;v++)for(var _=u.tr({}),p=0;p<i[v].length;p++)_.td(i[v][p]);if(h)for(var m=P.extend(s.footer,{borderRightColor:15658734,borderBottomColor:15658734,backgroundColor:16448250,color:6710886,height:27,lineHeight:1.2}),b=0;b<h;b++)for(var g=u.tr(m),w=0;w<t.length;w++)g.td(t[w].footer[b].toString())}var Ve=function(t,d){(d=d||{}).export_mode="excel",t=g(t)?t:[t];for(var v=[],i=0;i<t.length;i++){var s=Pt(t[i]);if(s&&s.$exportView&&(s=s.$exportView(d)),s&&(v=v.concat(s)),d.dataOnly){var e=Ce(s,d);v[i]={scheme:e,exportData:$e(s,d,e),spans:d.spans?je(s,d):[]}}}if(d.dataOnly)return v;var _=mt.defer();return ei(S.cdn+"/extras/xlsx.core.styles.min.js").then(function(){if(!v.length)return _.reject(Se);for(var t={SheetNames:[],Sheets:{},Workbook:{WBProps:{},Names:[]}},i=g(d.sheets)?d.sheets:[d.name||"Data"],s=0;s<v.length;s++){var e=v[s].scheme||Ce(v[s],d),n=v[s].exportData||$e(v[s],d,e),h=v[s].spans?v[s].spans:d.spans?je(v[s],d):[],r=v[s].ranges||[],o=Re(n,e,h,v[s].styles||[],d),a=(i[s]||"Data"+s).replace(/[*?:[\]\\/]/g,"").replace(/&/g,"&amp;").substring(0,31);t.SheetNames.push(a),t.Sheets[a]=o,t.Workbook.Names=t.Workbook.Names.concat(r)}var u=XLSX.write(t,{bookType:"xlsx",bookSST:!1,type:"binary"}),c=(d.filename||i.join(","))+".xlsx",f=new Blob([function l(t){for(var i=new ArrayBuffer(t.length),s=new Uint8Array(i),e=0;e!=t.length;++e)s[e]=255&t.charCodeAt(e);return i}(u)],{type:"application/xlsx"});return!1!==d.download&&ht(f,c),_.resolve(f),_})};var Be={number:"n",date:"n",string:"s","boolean":"b"},He="_table";function Re(t,i,s,e,n){for(var h,r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},a=0;a!=t.length;++a)for(var u=0;u!=t[a].length;++u){o.s.r>a&&(o.s.r=a),o.s.c>u&&(o.s.c=u),o.e.r<a&&(o.e.r=a),o.e.c<u&&(o.e.c=u);var c={v:t[a][u]};if(null!==c.v){var f=XLSX.utils.encode_cell({c:u,r:a}),l=c.v.toString(),d="="===l.charAt(0);if((n.docHeader?2:0)+i[0].header.length<=a&&!d){var v=i[u];v.type&&(c.t=Be[v.type]||""),v.format&&(c.z=v.format)}if(c.v instanceof Date?(c.t=c.t||"n",c.z=c.z||XLSX.SSF[He][14],c.v=(h=c.v,Math.round(25569+h/864e5))):c.t||("boolean"==typeof c.v?c.t="b":"number"==typeof c.v||parseFloat(c.v)==c.v?(c.v=1*c.v,c.t="n"):(c.v=l,d?(c.t="n",c.f=c.v,delete c.v):c.t="s")),e){var _=Pe(a,u,e);_.format&&(c.z=_.format,delete _.format),c.s=_}r[f]=c}}return o.s.c<1e7&&(r["!ref"]=XLSX.utils.encode_range(o)),r["!rows"]=function p(t){for(var i in t)t[i]={hpx:t[i],hpt:.75*t[i]};return t}(i.heights),r["!cols"]=function m(t){for(var i=[],s=0;s<t.length;s++)i.push({wch:t[s].width});return i}(i),s.length&&(r["!merges"]=s),r}function Pe(t,i,s){return s[t]&&s[t][i]?s[t][i]:""}function je(t,i){var s=t.getColumnConfig,e=t.bl,n=[];if(s){if(!1!==i.header&&(n=Ee(t,i,"header",n)),e){var h=i.xCorrection||0,r=i.yCorrection||0;for(var o in e){var a=e[o];for(var u in a){var c=t.getColumnIndex(u)-h,f=t.getIndexById(o)-r;if(!(c<0||f<0)){var l=c+a[u][0]-1,d=f+(a[u][1]-1);n.push({s:{c:c,r:f},e:{c:l,r:d}})}}}}!1!==i.footer&&(n=Ee(t,i,"footer",n))}return n}function Ee(t,i,s,e){for(
  var n=t.config.columns,h=(i.docHeader?2:0)+("header"==s?0:(!1!==i.header?t.ml.length:0)+t.count()),r=0;r<n.length;r++)for(var o=n[r][s],a=0;a<o.length;a++)o[a]&&(o[a].colspan||o[a].rowspan)&&e.push({s:{c:r,r:a+h},e:{c:r+(o[a].colspan||1)-1,r:a+(o[a].rowspan||1)-1+h}});return e}function Ne(t,i){-1!=t.type.indexOf("confirm")&&!1===i?t.pr.reject():t.pr.resolve(i);var s=t.callback;s&&s(i,t.details),qe.hide(t.id)}function Le(t){var i=qe.order.length;if(0<i&&Ke.keyboard){var s=(t=t||Lt).which||Lt.keyCode,e=qe.pull[qe.order[i-1]];return 13!=s&&32!=s||Ne(e,!0),27==s&&Ne(e,!1),t.preventDefault&&t.preventDefault(),!(t.cancelBubble=!0)}}function Oe(t,i){var s,e=i||document.body;if(j(e.modality)){if((s=Y("DIV",{"class":"webix_modal_cover",style:"position:"+(i?"absolute":"fixed")+";"})).onkeydown=Le,i){var n=window.getComputedStyle(i).position;"fixed"!=n&&"absolute"!=n&&"sticky"!=n&&"relative"!=n&&(e.style.position="relative")}e.appendChild(s),e.modality=1}else t?e.modality++:e.modality--;if(t&&1===e.modality||0===e.modality)if(s)s.style.display="inline-block";else{s=e.querySelectorAll(".webix_modal_cover");for(var h=0;h<s.length;h++)if(s[h].parentNode==e){s[h].style.display=1==e.modality?"inline-block":"none";break}}}function Ue(t,i,s){return"<div role='button' tabindex='0' aria-label='"+t+"' class='webix_popup_button"+(s?" "+s:"")+"' result='"+i+"' ><div>"+t+"</div></div>"}function Ye(t,i,s){var e=t.tagName?t:function a(e,t,i){var s=document.createElement("DIV"),n=e.css?" "+e.css:"";s.className="webix_modal_box webix_"+e.type+n,s.setAttribute("webixbox",1),s.setAttribute("role","alertdialog"),s.setAttribute("aria-label",e.title||""),s.setAttribute("tabindex","0");var h="";if(e.width&&(s.style.width=e.width+(vs.isNumber(e.width)?"px":"")),e.height&&(s.style.height=e.height+(vs.isNumber(e.height)?"px":"")),e.title&&(h+='<div class="webix_popup_title">'+e.title+"</div>"),h+='<div class="webix_popup_text"><span>'+(e.content?"":e.text)+'</span></div><div  class="webix_popup_controls">',i&&(h+=Ue(e.cancel||ct.message.cancel,!1)),t&&(h+=Ue(e.ok||ct.message.ok,!0,"confirm")),e.buttons&&!t&&!i)for(var r=0;r<e.buttons.length;r++)h+=Ue(e.buttons[r],r);if(h+="</div>",s.innerHTML=h,e.content){var o=e.content;"string"==typeof o&&(o=document.getElementById(o)),"none"==o.style.display&&(o.style.display=""),s.childNodes[e.title?1:0].appendChild(o)}return s.onclick=function(t){var i=(t=t||Lt).target||t.srcElement;if(i.className||(i=i.parentNode),-1!=i.className.indexOf("webix_popup_button")){var s=i.getAttribute("result");Ne(e,s="true"==s||"false"!=s&&s)}t.cancelBubble=!0},e.xl=s}(t,i,s),n=t.container?t.container.offsetWidth:window.innerWidth||document.documentElement.offsetWidth,h=t.container?t.container.offsetHeight:window.innerHeight||document.documentElement.offsetHeight;t.container&&(e.style.position="absolute"),D((t.container||document.body).appendChild(e)),Oe(!0,t.container);var r=t.left||Math.abs(Math.floor((n-e.offsetWidth)/2)),o=t.top||Math.abs(Math.floor((h-e.offsetHeight)/2));return"top"==t.position?e.style.top="-3px":e.style.top=o+"px",e.style.left=r+"px",e.onkeydown=Le,e.focus(),t.id?qe.pull[t.id]&&qe.hide(t.id):t.id=pi("modalbox"),qe.order.push(t.id),(qe.pull[t.id]=t).pr=mt.defer(),t.pr}function We(t){return Ye(t,!0)}function Ge(t){return Ye(t,!0,!0)}function Xe(t){return Ye(t)}function Je(t,i,s){return"object"!=k(t)&&("function"==typeof i&&(s=i,i=""),t={text:t,type:i,callback:s}),t}function Ze(){var t=Je.apply(this,arguments);return t.type=t.type||"confirm",Ge(t)}function qe(){var t=Je.apply(this,arguments);return t.type=t.type||"alert",Xe(t)}function Ke(t,i,s,e){switch((t=function n(t,i,s,e){return"object"!=k(t)&&(t={text:t,type:i,expire:s,id:e}),t.id=t.id||pi("message"),t.expire=t.expire||Qe.expire,t}.apply(this,arguments)).type=t.type||"info",t.type.split("-")[0]){case"alert":return We(t);case"confirm":return Ge(t);case"modalbox":return Xe(t);default:return function h(t){Qe.area||(Qe.area=document.createElement("DIV"),Qe.area.className="webix_message_area",Qe.area.style[Qe.position]="5px",document.body.appendChild(Qe.area)),
  Qe.area.setAttribute("role","alert"),Qe.area.setAttribute("aria-atomic",!0),Qe.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&&Qe.hide(t.id),t=null},"bottom"==Qe.position&&Qe.area.firstChild?Qe.area.insertBefore(i,Qe.area.firstChild):Qe.area.appendChild(i),0<t.expire&&(Qe.timers[t.id]=window.setTimeout(function(){Qe.hide(t.id)},t.expire)),i.style.height=i.offsetHeight-2+"px",Qe.pull[t.id]=i,i=null,t.id}(t)}}Lt(document,"keydown",Le,{capture:!0}),qe.pull={},qe.order=[],qe.hide=function(t){if(t&&qe.pull[t]){var i=qe.pull[t].xl;i&&(i.parentNode.removeChild(i),qe.order.splice(qe.order.indexOf(t),1),Oe(!1,qe.pull[t].container),delete qe.pull[t])}},qe.hideAll=function(){for(var t in qe.pull)this.hide(t)};var Qe=Ke;Qe.expire=4e3,Qe.keyboard=!0,Qe.position="top",Qe.pull={},Qe.timers={},Qe.hideAll=function(){for(var t in Qe.pull)Qe.hide(t)},Qe.hide=function(t){var i=Qe.pull[t];i&&i.parentNode&&(window.setTimeout(function(){i.parentNode.removeChild(i),i=null},2e3),i.style.height=0,i.className+=" hidden",Qe.area.removeAttribute("role"),Qe.timers[t]&&window.clearTimeout(Qe.timers[t]),delete Qe.pull[t])},u("message",Ke);window.atob&&new Date>new Date(2019,7,13)&&setTimeout(function(){Ke({type:"error",expire:-1,text:atob("VGhpcyBhcHAgdXNlcyBhIHRyaWFsIHZlcnNpb24gb2YgV2ViaXggVUkuIFRoZSB0cmlhbCBwZXJpb2QgaGFzIGV4cGlyZWQuIDxicj4gSWYgeW91ciB3YW50IHRvIGNvbnRpbnVlIHVzaW5nIFdlYml4IFVJLCBwbGVhc2UgdXBncmFkZSB0byBDb21tZXJjaWFsIG9yIEdQTCBlZGl0aW9uLg==")})},Math.floor(5e3*Math.random())+1e3),S.isIE8&&(Object.defineProperty=function(t,i,s){t[i]=s.value});var tn={startOnMonday:!1,toFixed:function(t,i){return t<10&&(t="0"+t),i&&t<100&&(t="0"+t),t},weekStart:function(t){var i=(t=this.copy(t)).getDay();return this.startOnMonday&&(0===i?i=6:i--),this.datePart(this.add(t,-1*i,"day"))},monthStart:function(t){return(t=this.copy(t)).setDate(1),this.datePart(t)},yearStart:function(t){return(t=this.copy(t)).setMonth(0),this.monthStart(t)},dayStart:function(t){return this.datePart(t,!0)},dateToStr:function(h,s){if("function"==typeof h)return h;if(S.strict)return function(i){if(!i)return"";i.getMonth||(i=ct.parseFormatDate(i));var e="",n=0;return h.replace(/%[a-zA-Z]/g,function(s,t){e+=h.slice(n,t);e+=function(t){if("%d"==s)return tn.toFixed(t.getDate());if("%m"==s)return tn.toFixed(t.getMonth()+1);if("%j"==s)return t.getDate();if("%n"==s)return t.getMonth()+1;if("%y"==s)return tn.toFixed(t.getFullYear()%100);if("%Y"==s)return t.getFullYear();if("%D"==s)return ct.calendar.dayShort[t.getDay()];if("%l"==s)return ct.calendar.dayFull[t.getDay()];if("%M"==s)return ct.calendar.monthShort[t.getMonth()];if("%F"==s)return ct.calendar.monthFull[t.getMonth()];if("%h"==s)return tn.toFixed((t.getHours()+11)%12+1);if("%g"==s)return(t.getHours()+11)%12+1;if("%G"==s)return t.getHours();if("%H"==s)return tn.toFixed(t.getHours());if("%i"==s)return tn.toFixed(t.getMinutes());if("%a"==s)return 11<t.getHours()?ct.pm[0]:ct.am[0];if("%A"==s)return 11<t.getHours()?ct.pm[1]:ct.am[1];if("%s"==s)return tn.toFixed(t.getSeconds());if("%S"==s)return tn.toFixed(t.getMilliseconds(),!0);if("%W"==s)return tn.toFixed(Date.getISOWeek(t));if("%c"!=s)return s;var i=t.getFullYear();return i+="-"+tn.toFixed(t.getMonth()+1),i+="-"+tn.toFixed(t.getDate()),i+="T",i+=tn.toFixed(t.getHours()),i+=":"+tn.toFixed(t.getMinutes()),i+=":"+tn.toFixed(t.getSeconds())}(i),n=t+2}),e+=h.slice(n,h.length)};h=h.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+wDate.toFixed(date.getDate())+"';case"%m":return'"+wDate.toFixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+wDate.toFixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+i18n.calendar.dayShort[date.getDay()]+"';case"%l":return'"+i18n.calendar.dayFull[date.getDay()]+"';case"%M":return'"+i18n.calendar.monthShort[date.getMonth()]+"';case"%F":return'"+i18n.calendar.monthFull[date.getMonth()]+"';case"%h":
  return'"+wDate.toFixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+wDate.toFixed(date.getHours())+"';case"%i":return'"+wDate.toFixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?i18n.pm[0]:i18n.am[0])+"';case"%A":return'"+(date.getHours()>11?i18n.pm[1]:i18n.am[1])+"';case"%s":return'"+wDate.toFixed(date.getSeconds())+"';case"%S":return'"+wDate.toFixed(date.getMilliseconds(), true)+"';case"%W":return'"+wDate.toFixed(wDate.getISOWeek(date))+"';case"%c":var i='"+date.getFullYear()+"';return i+='-"+wDate.toFixed((date.getMonth()+1))+"',i+='-"+wDate.toFixed(date.getDate())+"',i+="T",i+='"+wDate.toFixed(date.getHours())+"',i+=':"+wDate.toFixed(date.getMinutes())+"',i+=':"+wDate.toFixed(date.getSeconds())+"',!0===s&&(i+="Z"),i;default:return t}}),!0===s&&(h=h.replace(/date\.get/g,"date.getUTC"));var i=new Function("date","i18n","wDate","if (!date) return ''; if (!date.getMonth) date=i18n.parseFormatDate(date);  return \""+h+'";');return function(t){return i(t,ct,tn)}},strToDate:function(t,h){if("function"==typeof t)return t;var r,i,s,o=t.match(/%[a-zA-Z]/g),e="var temp=date.split(/[^0-9a-zA-Z]+/g);";if(!ct.calendar.monthShort_hash){for(s=ct.calendar.monthShort,i=ct.calendar.monthShort_hash={},r=0;r<s.length;r++)i[s[r]]=r;for(s=ct.calendar.monthFull,i=ct.calendar.monthFull_hash={},r=0;r<s.length;r++)i[s[r]]=r}if(S.strict)return function(t){if(!t)return"";if("object"==k(t))return t;var i=t.split(/[^0-9a-zA-Z]+/g),s=[0,0,1,0,0,0,0];for(r=0;r<o.length;r++){var e=o[r];if("%y"==e)s[0]=1*i[r]+(30<i[r]?1900:2e3);else if("%Y"==e)s[0]=1*(i[r]||0),s[0]<30&&(s[0]+=2e3);else if("%n"==e||"%m"==e)s[1]=(i[r]||1)-1;else if("%M"==e)s[1]=ct.calendar.monthShort_hash[i[r]]||0;else if("%F"==e)s[1]=ct.calendar.monthFull_hash[i[r]]||0;else if("%j"==e||"%d"==e)s[2]=i[r]||1;else if("%g"==e||"%G"==e||"%h"==e||"%H"==e)s[3]=i[r]||0;else if("%a"==e)s[3]=s[3]%12+((i[r]||"")==ct.am[0]?0:12);else if("%A"==e)s[3]=s[3]%12+((i[r]||"")==ct.am[1]?0:12);else if("%i"==e)s[4]=i[r]||0;else if("%s"==e)s[5]=i[r]||0;else if("%S"==e)s[6]=i[r]||0;else if("%c"==e){var n=/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(\+.*|)/g.exec(t);s[0]=1*(n[1]||0),s[0]<30&&(s[0]+=2e3),s[1]=(n[2]||1)-1,s[2]=n[3]||1,s[3]=n[4]||0,s[4]=n[5]||0,s[5]=n[6]||0}}return h?new Date(Date.UTC(s[0],s[1],s[2],s[3],s[4],s[5],s[6])):new Date(s[0],s[1],s[2],s[3],s[4],s[5],s[6])};for(r=0;r<o.length;r++)switch(o[r]){case"%j":case"%d":e+="set[2]=temp["+r+"]||1;";break;case"%n":case"%m":e+="set[1]=(temp["+r+"]||1)-1;";break;case"%y":e+="set[0]=temp["+r+"]*1+(temp["+r+"]>30?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":e+="set[3]=temp["+r+"]||0;";break;case"%i":e+="set[4]=temp["+r+"]||0;";break;case"%Y":e+="set[0]=(temp["+r+"]||0)*1; if (set[0]<30) set[0]+=2000;";break;case"%a":e+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[0]?0:12);";break;case"%A":e+="set[3]=set[3]%12+(temp["+r+"]==i18n.am[1]?0:12);";break;case"%s":e+="set[5]=temp["+r+"]||0;";break;case"%S":e+="set[6]=temp["+r+"]||0;";break;case"%M":e+="set[1]=i18n.calendar.monthShort_hash[temp["+r+"]]||0;";break;case"%F":e+="set[1]=i18n.calendar.monthFull_hash[temp["+r+"]]||0;";break;case"%c":e+="var res = date.split('T');",e+="if(res[0]){ var d = res[0].split('-');",e+="set[0]= (d[0]||0)*1; if (set[0]<30) set[0]+=2000;",e+="set[1]= (d[1]||1)-1;",e+="set[2]= d[2]||1;}",e+="if(res[1]){ var t = res[1].split(':');",e+="set[3]= t[0]||0;",e+="set[4]= t[1]||0;",e+="set[5]= parseInt(t[2])||0;}"}var n="set[0],set[1],set[2],set[3],set[4],set[5], set[6]";h&&(n=" Date.UTC("+n+")");var a=new Function("date","i18n","if (!date) return ''; if (typeof date == 'object') return date; var set=[0,0,1,0,0,0,0]; "+e+" return new Date("+n+");");return function(t){return a(t,ct)}},getISOWeek:function(t){if(!t)return!1;var i=t.getDay();0===i&&(i=7);var s=new Date(t.valueOf());s.setDate(t.getDate()+(4-i));var e=s.getFullYear(),n=Math.floor((s.getTime()-new Date(e,0,1).getTime())/864e5);return 1+Math.floor(n/7)},getUTCISOWeek:function(t){return this.getISOWeek(t)},yl:function(t,i,s,e){
  if(s){var n=e(t,i);if(n)for(var h=0<s?1:-1;n;)t.setHours(t.getHours()+h),n=e(t,i),h+=0<s?1:-1}},add:function(t,i,s,e){e&&(t=this.copy(t));var n=tn.copy(t);switch(s){case"day":t.setDate(t.getDate()+i),this.yl(t,n,i,function(t,i){return tn.datePart(i,!0).valueOf()==tn.datePart(t,!0).valueOf()});break;case"week":t.setDate(t.getDate()+7*i),this.yl(t,n,7*i,function(t,i){return tn.datePart(i,!0).valueOf()==tn.datePart(t,!0).valueOf()});break;case"month":t.setMonth(t.getMonth()+i),this.yl(t,n,i,function(t,i){return i.getMonth()==t.getMonth()&&i.getYear()==t.getYear()});break;case"year":t.setYear(t.getFullYear()+i),this.yl(t,n,i,function(t,i){return i.getFullYear()==t.getFullYear()});break;case"hour":t.setHours(t.getHours()+i),this.yl(t,n,i,function(t,i){return i.getHours()==t.getHours()&&Date.datePart(i,!0)==Date.datePart(t,!0)});break;case"minute":t.setMinutes(t.getMinutes()+i);break;default:tn.add[s](t,i,s)}return t},datePart:function(t,i){i&&(t=this.copy(t));var s=this.copy(t);return s.setHours(0),s.getDate()!=t.getDate()?t.setHours(1):t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},timePart:function(t,i){return i&&(t=this.copy(t)),(t.valueOf()/1e3-60*t.getTimezoneOffset())%86400},copy:function(t){return new Date(t.valueOf())},equal:function(t,i){return!(!t||!i)&&t.valueOf()===i.valueOf()},isHoliday:function(t){if(0===(t=t.getDay())||6==t)return"webix_cal_event"}},sn={getConfig:function(t){var i={decimalSize:0,groupSize:999,prefix:"",sufix:""},s=t.split(/[0-9].*[0-9]/g);s[0].length&&(i.prefix=s[0]),s[1].length&&(i.sufix=s[1]),(i.prefix||i.sufix)&&(t=t.substr(i.prefix.length,t.length-i.prefix.length-i.sufix.length));var e=t.indexOf("1");0<e&&(i.prefix=t.substr(0,e),t=t.substr(e));var n=t.indexOf("0");0<n&&(i.decimalSize=t.length-n,i.decimalDelimiter=t[n-1],t=t.substr(0,n-1));var h=t.match(/[^0-9]/);return h&&(i.groupSize=t.length-h.index-1,i.groupDelimiter=t[h.index]),i},parse:function(t,i){if(!t||"string"!=typeof t)return t;i.prefix&&(t=t.toLowerCase().replace(i.prefix.toLowerCase()||"","")),i.sufix&&(t=t.toLowerCase().replace(i.sufix.toLowerCase()||"",""));var s="";if(i.decimalDelimiter){var e=t.indexOf(i.decimalDelimiter);-1<e&&(s=(s=t.substr(e+1).replace(/[^0-9]/g,"")).substr(0,Math.min(s.length,i.decimalSize)),t=t.substr(0,e))}var n="-"===t[0]?-1:1;return(t=t.replace(/[^0-9]/g,""))||(t="0"),s&&(t+="."+s),parseFloat(t)*n},format:function(t,i){if(""===t||void 0===t)return t;i=i||ct;var s=(t=parseFloat(t))<0?"-":"";t=Math.abs(t),i.decimalOptional||(t=t.toFixed(i.decimalSize));var e=t.toString();e=e.split(".");var n="";if(i.groupSize){var h=i.groupSize,r=e[0].length;do{n=(0<(r-=h)?e[0].substr(r,h):e[0].substr(0,h+r))+(n?i.groupDelimiter+n:"")}while(0<r)}else n=e[0];return e=i.decimalSize?s+n+(e[1]?i.decimalDelimiter+e[1]:""):s+n,i.prefix||i.sufix?i.prefix+e+i.sufix:e},numToStr:function(i){return function(t){return sn.format(t,i)}}};var en=["fullDateFormat","timeFormat","dateFormat","longDateFormat","parseFormat","parseTimeFormat"];ct.setLocale=function(t){"string"==typeof t&&(t=ct.locales[t]),t&&(t.priceSettings=m(t.priceSettings||t),function r(t,i){for(var s in i)"object"!=k(i[s])||g(i[s])?t[s]=i[s]:(t[s]||(t[s]={}),r(t[s],i[s]))}(ct,t));for(var i=0;i<en.length;i++){var s=en[i],e=ct[s+"UTC"];ct[s+"Str"]=tn.dateToStr(ct[s],e),ct[s+"Date"]=tn.strToDate(ct[s],e)}var n=At(ct.price),h=ct.priceSettings||ct;ct.intFormat=sn.numToStr({groupSize:ct.groupSize,groupDelimiter:ct.groupDelimiter,decimalSize:0}),ct.priceFormat=function(t){return n(sn.format(t,h))},ct.numberFormat=sn.format},ct.locales={"en-US":{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%m/%d/%Y",timeFormat:"%h:%i %A",longDateFormat:"%d %F %Y",fullDateFormat:"%m/%d/%Y %h:%i %A",am:["am","AM"],pm:["pm","PM"],price:"${obj}",priceSettings:{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2},fileSize:["b","Kb","Mb","Gb","Tb","Pb","Eb"],calendar:{monthFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShort:["Jan","Feb","Mar","Apr","May"
  ,"Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],hours:"Hours",minutes:"Minutes",done:"Done",clear:"Clear",today:"Today"},dataExport:{page:"Page",of:"of"},PDFviewer:{of:"of",automaticZoom:"Automatic Zoom",actualSize:"Actual Size",pageFit:"Page Fit",pageWidth:"Page Width",pageHeight:"Page Height",enterPassword:"Enter password",passwordError:"Wrong password"},aria:{calendar:"Calendar",increaseValue:"Increase value",decreaseValue:"Decrease value",navMonth:["Previous month","Next month"],navYear:["Previous year","Next year"],navDecade:["Previous decade","Next decade"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Hours: %h %A",minuteFormat:"Minutes: %i",removeItem:"Remove item",pages:["First page","Previous page","Next page","Last page"],page:"Page",headermenu:"Header menu",openGroup:"Open column group",closeGroup:"Close column group",closeTab:"Close tab",showTabs:"Show more tabs",resetTreeMap:"Reset tree map",navTreeMap:"Level up",nextTab:"Next tab",prevTab:"Previous tab",multitextSection:"Add section",multitextextraSection:"Remove section",showChart:"Show chart",hideChart:"Hide chart",resizeChart:"Resize chart"},richtext:{underline:"Underline",bold:"Bold",italic:"Italic"},combo:{select:"Select",selectAll:"Select all",unselectAll:"Unselect all"},message:{ok:"OK",cancel:"Cancel"},comments:{send:"Send",confirmMessage:"The comment will be removed. Are you sure?",edit:"Edit",remove:"Remove",placeholder:"Type here..",moreComments:"More comments"}}},ct.setLocale("en-US");var nn={track:function(t,i){if(this.Ml(t,i),this.Sl&&Pt(this.kl).detachEvent(this.Sl),t){var s=Pt(this.kl=t),e=function(){nn.Cl||s.getValue&&nn.push(t,s.getValue())};s.getActiveId?this.Sl=s.attachEvent("onViewChange",e):this.Sl=s.attachEvent("onChange",e)}},$l:function(t,i){nn.Cl=1,(t=Pt(t)).callEvent("onBeforeHistoryNav",[i])&&t.setValue&&t.setValue(i),nn.Cl=0},push:function(t,i,s){t=Pt(t);var e="";i&&(e="#!/"+i),j(s)&&(s=t.getValue?t.getValue():i),window.history.pushState({webix:!0,id:t.Z.id,value:s},"",e)},Ml:function(t,i){Lt(window,"popstate",function(t){t.state&&t.state.webix&&nn.$l(t.state.id,t.state.value)});var s=window.location.hash;M.noanimate=!0,s&&0===s.indexOf("#!/")?nn.$l(t,s.replace("#!/","")):i&&(nn.push(t,i),nn.$l(t,i)),M.noanimate=!1,this.Ml=function(){}}},hn={namespace:"x",attribute:"data-",dataTag:"li",Dl:/-([a-z])/g,Il:function(t){return t[1].toUpperCase()},Al:{width:!0,height:!0,gravity:!0,margin:!0,padding:!0,paddingX:!0,paddingY:!0,minWidth:!0,maxWidth:!0,minHeight:!0,maxHeight:!0,headerRowHeight:!0},Tl:{disabled:!0,hidden:!0},Fl:function(t,i){return Ht(t,i)},init:function(t,i,s){t=t||document.body;for(var e=[],n=this.zl(t),h=n.html,r=null,o=n.length-1;0<=o;o--)e[o]=n[o];for(var a=0;a<e.length;a++){var u;(u=this.Vl(e[a],h)).$scope=s,r=this.Bl(u,e[a],h,i)}return r},parse:function(t,i){"string"==typeof t&&(t=hi[i||"xml"].toObject(t,t));var s=this.zl(t,i);return this.Vl(s[0],s.html)},Bl:function(t,i,s,e){return e?t.container=e:(t.container=i.parentNode,G(i)),this.Fl(t.view,"setPosition")&&delete t.container,zt(t)},zl:function(t){this.Hl=this.namespace?this.namespace+":":"",this.Rl=this.Hl+"ui";var i=t.getElementsByTagName(this.Rl);return!i.length&&t.documentElement&&t.documentElement.tagName==this.Rl&&(i=[t.documentElement]),!i.length&&this.namespace&&!(i=t.getElementsByTagName("ui")).length&&t.documentElement&&"ui"==t.documentElement.tagName&&(i=[t.documentElement]),i.length||((i=this.Pl(t)).html=!0),i},Pl:function(t){if(t.getAttribute&&t.getAttribute(this.attribute+"view"))return[t];for(var i=t.querySelectorAll("["+this.attribute+"view]"),s=[],e=0;e<i.length;e++)i[e].parentNode.getAttribute(this.attribute+"view")||s.push(i[e]);return s},Vl:function(t,i,s){var e=!1;if(!s){var n=this.jl(t,i);if("ui"==n)for(var h=t.childNodes,r=0;r<h.length;r++)if(1==h[r].nodeType)return this.Vl(h[r],i);s={view:n},i&&"table"==t.tagName.toLowerCase()&&(s.data=t,s.datatype="htmltable",e=!0)}for(
  var o="cols"==s.view||"rows"==s.view||this.Fl(s.view,"addView"),a=[],u=0,c=!(i||t.style),f=t.firstChild;f;){if(1==f.nodeType){var l=this.jl(f,i);if("data"==l){u=1;var d=f;f=f.nextSibling,s.data=this.El(d,i);continue}if("config"==l){this.Nl(f,s,i);var v=f;f=f.nextSibling,G(v);continue}if("column"==l){u=1;var _=this.Ll(f,i);_.header=_.header||_.value,_.width=1*_.width||"",s.columns=s.columns||[],s.columns.push(_)}else if(l||o&&i){var p=this.Vl(f,i,{view:l});"head"==p.view?s.head=p.rows?p.rows[0]:p.template:"body"==p.view?this.Fl(s.view,"addView")?a.push({body:p.rows?p.rows[0]:p.value,header:p.header||""}):s.body=p.rows?1==p.rows.length?p.rows[0]:{rows:p.rows}:p.value:a.push(p)}else if(c){u=1;var m=f.tagName;i&&(m=m.toLowerCase().replace(this.Dl,this.Il)),s[m]=hi.xml.tagToObject(f)}}f=f.nextSibling}if(this.Ol(t,s,i),a.length)s.stack?s[s.stack]=a:s.subui?s[s.subui]=a[0]:this.Fl(s.view,"setValues")?s.elements=a:"rows"==s.view?(s.view="layout",s.rows=a):"cols"==s.view?(s.view="layout",s.cols=a):this.Fl(s.view,"setValue")?s.cells=a:this.Fl(s.view,"getBody")?s.body=1==a.length?a[0]:{rows:a}:s.rows=a;else if(!e&&!u)if(!i||s.template||s.view&&"template"!=s.view){var b=this.Ul(t,i);if(b){var g="template";this.Fl(s.view,"setValue")&&(g="value"),s[g]=s[g]||b}}else s.view="template",s.content=t;return s},Yl:function(t){return!(0<t.replace(/\s+/gm,"").length)},Wl:{body:1,head:1,data:1,rows:1,cols:1,cells:1,elements:1,ui:1,column:1,config:1},Nl:function(t,i,s){var e=this.Ol(t,{});e.name?delete(i[e.name]=e).name:e.stack?i[e.stack]=[]:i=e;for(var n=t.childNodes,h=0;h<n.length;h++){var r=null;1==n[h].nodeType&&"config"==n[h].tagName.toLowerCase()&&n[h].attributes.length?r=this.Nl(n[h],e,s):1==n[h].nodeType&&"data"==n[h].tagName.toLowerCase()?(r=this.El(n[h],s),e.stack||(e.data=r)):r=n[h].innerHTML,e.stack&&r&&i[e.stack].push(r)}return i},jl:function(t,i){if(i)return t.getAttribute(this.attribute+"view")||("config"==t.tagName.toLowerCase()?"config":null);var s=t.tagName.toLowerCase();if(this.namespace){if(0===s.indexOf(this.Hl)||t.scopeName==this.namespace)return s.replace(this.Hl,"")}else if(zt[s]||this.Wl[s])return s;return 0},El:function(t,i){for(var s=[],e=t.getElementsByTagName(hn.dataTag),n=0;n<e.length;n++){var h=e[n];if(h.parentNode.parentNode.tagName!=hn.dataTag){var r=this.Ll(h,i);h.className&&(r.$css=h.className),s.push(r)}}return G(t),s},Ul:function(t){return t.style?t.innerHTML:t.firstChild&&(t.firstChild.wholeText||t.firstChild.data)||""},Ll:function(t,i){if(!i)return hi.xml.tagToObject(t);var s=this.Ol(t,{},i);return!s.value&&t.childNodes.length&&(s.value=this.Ul(t,i)),s},Ol:function(t,i,s){for(var e=t.attributes,n=0;n<e.length;n++){var h=e[n].name;if(s){if(0!==h.indexOf(this.attribute))continue;h=h.replace(this.attribute,"").replace(this.Dl,this.Il)}var r=e[n].value;-1!=r.indexOf("json://")&&(r=JSON.parse(r.replace("json://",""))),this.Al[h]?r=parseInt(r,10):this.Tl[h]&&(r=r&&"false"!==r&&"0"!=r),i[h]=r}return i}};S.printPPI=96,S.printMargin=.75*S.printPPI;var rn=S.printMargin,on={a4:"A4",a3:"A3",letter:"letter"},an={page:!0,data:!0},un={portrait:!0,landscape:!0},cn={A3:{width:11.7,height:16.5},A4:{width:8.27,height:11.7},letter:{width:8.5,height:11}};function fn(t,i){var s=Y("div",{"class":"webix_view webix_print_"+t.toLowerCase(),style:"height:0px;visibility:hidden;"},i["doc"+t]);"Header"===t?X(s,document.body.firstChild):document.body.appendChild(s),i["doc"+t]=s}var ln={phone:{mask:"+# (###) ###-####",allow:/[0-9]/g},card:{mask:"#### #### #### ####",allow:/[0-9]/g},date:{mask:"####-##-## ##:##",allow:/[0-9]/g}},dn={set:function(t,i){i=i||{},this.rt&&this.exit(),Pt(t)?t=Pt(t):("string"==typeof t&&(t=document.getElementById(t)),t instanceof Element&&(t={$view:t,$html:!0}));var s=(this.rt=t).config;t.setPosition?(this.Gl={left:t.config.left,top:t.config.top},t.setPosition(0,0),s.fullscreen=!0,t.resize()):(this.Xl=zt({view:"window",head:this.Jl(i),fullscreen:!0,body:{rows:[]}}),s&&(this.Za={width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,height:s.height,minHeight:s.minHeight,maxHeight:s.maxHeight}),
  t.getParentView&&t.getParentView()?(this.Zl=t.getParentView(),this.Zl.index&&(this.Gl={index:this.Zl.index(t),active:!!this.Zl.getActiveId&&this.Zl.getActiveId()==s.id})):(this.Zl=t.$view.parentNode,this.Gl=Y("div"),this.Zl.replaceChild(this.Gl,t.$view)),this.Xl.getBody().addView(t.$html?{view:"template",content:t.$view,css:"webix_fullscreen_html"}:t),this.Xl.show(),this.ql(t))},exit:function(){if(this.rt){var t=this.rt.config;this.rt.setPosition?(t.fullscreen=!1,this.rt.setPosition(this.Gl.left,this.Gl.top),this.rt.resize()):(this.Zl instanceof Element?(this.rt._=null,this.rt.Vs&&this.rt.Vs(this.rt.config),this.Zl.replaceChild(this.rt.$view,this.Gl)):j(this.Gl)?(this.rt._=this.Zl,this.Zl.it(this.rt)):(this.Zl.addView(this.rt,this.Gl.index),this.Gl.active&&this.rt.show(!1,!1)),this.ql(this.rt,this.Za),this.rt.$html||(this.Xl.getBody().ji=[]),this.Xl.close()),this.Kl()}},Kl:function(){delete this.Zl,delete this.rt,delete this.Za,delete this.Gl},ql:function(t,i){t.$html||(i=i||{height:0,minHeight:0,maxHeight:0,width:0,minWidth:0,maxWidth:0},t.define(i),t.resize())},Jl:function(t){var i=this;return!1===t.head||"object"==k(t.head)?t.head:{cols:[{template:t.head||"",type:"header",borderless:!0},{view:"icon",icon:"wxi-close",click:function(){i.exit()}}]}}},vn={denySelect:R,allowSelect:E,index:N,createCss:L,addStyle:O,removeStyle:U,create:Y,getValue:W,remove:G,insertBefore:X,locate:J,offset:Z,posRelative:q,pos:K,preventEvent:Q,stopEvent:tt,triggerEvent:it,addCss:st,removeCss:et,getTextSize:nt,download:ht,Ql:rt,setSelectionRange:ot,getSelectionRange:at,addMeta:ut},_n={};function pn(t,i,s,e){var n=mt.defer(),h="webix_jsonp_"+z(),r=document.createElement("script");r.id=h,r.type="text/javascript";var o=document.getElementsByTagName("head")[0];"function"==typeof i&&(e=s,s=i,i={}),i||(i={}),i.jsonp=h,window[h]=function(){s&&s.apply(e||window,arguments),n.resolve(arguments[0]),window.clearTimeout(_n[h]),delete _n[h],r.parentNode.removeChild(r),s=o=e=r=null,delete window[h]},_n[h]=window.setTimeout(function(){n.reject(),delete window[h]},pn.timer);var a=[];for(var u in i)a.push(u+"="+encodeURIComponent(i[u]));return t+=(-1==t.indexOf("?")?"?":"&")+a.join("&"),r.src=t,o.appendChild(r),n}pn.timer=3e3;var mn="__webix_remote_error";function bn(t,i){this.sd={},this.ed=[],this.nd=t,this._u="",i?this.hd(i):this.rd=wt(t).then(function(t){return t.text()}).then(C(function(t){return t=t.split("/*api*/")[1],this.hd(JSON.parse(t)),this.sd},this))}function gn(t,i){var s=new bn(t,i).od();for(var e in s)wn[e]=s[e];return s}bn.prototype={hd:function(t){if(t.$key&&(this._u=t.$key),t.$vars)for(var i in t.$vars)this.sd[i]=t.$vars[i];this.jt(t,this.sd,"")},jt:function(t,i,s){for(var e in t)if("$key"!==e&&"$vars"!==e){var n=t[e];if("object"==k(n)){var h=i[e]={};this.jt(n,h,s+e+".")}else i[e]=this.ad(this,s+e)}},ud:function(t,i){var s=this.cd(this,t,i);return this.ed.push(s),this.fd(),s},fd:function(){this.ld||(this.ld=setTimeout(C(this.dd,this),1))},dd:function(){for(var t=[],h=this.ed,i=0;i<this.ed.length;i++){var s=this.ed[i];s.$sync?(h.splice(i,1),i--):t.push({name:s.$name,args:s.$args})}if(h.length){var e=wt(),n=this.vd(t);A("onBeforeRemoteCall",[e,n,{}]);var r=e.post(this.nd,n).then(function(t){for(var i=t.json().data,s=0;s<i.length;s++){var e=i[s],n=i[s]&&i[s][mn];n?(A("onRemoteError",[n]),h[s].reject(n)):h[s].resolve(e)}},function(t){for(var i=0;i<h.length;i++)h[i].reject(t);throw t});A("onAfterRemoteCall",[r])}this.ed=[],this.ld=null},Y:function(){var t=null;this.$sync=!0;var i=[{name:this.$name,args:this.$args}];try{var s=wt(),e=this.$context.vd(i);A("onBeforeRemoteCall",[s,e,{sync:!0}]);var n=s.sync().post(this.$context.nd,e);A("onAfterRemoteCall",[null]),(t=JSON.parse(n.responseText).data[0])[mn]&&(t=null)}catch(Bo){}return t},cd:function(t,i,s){var e=mt.defer();return e.sync=t.Y,e.$name=i,e.$args=s,e.$context=this,e},ad:function(t,i){return function(){return t.ud(i,[].slice.call(arguments))}},od:function(){return this.rd||this.sd},vd:function(t){return{key:this._u,payload:t}}};var wn=function(t,i){if("object"!==k(t))return gn(t,i)
  ;var s=document.getElementsByTagName("script");return i=t,gn(t=s[s.length-1].src,i)};function xn(){var t=!!(window.orientation%180);M.orientation!==t&&(M.orientation=t,A("onRotate",[t]))}S.touch&&(M.orientation=!!((j(window.orientation)?90:window.orientation)%180),Lt(window,"onorientationchange"in window?"orientationchange":"resize",xn));var yn={textWaitDelay:500,summColumn:{getValue:function(t){return t.firstChild.innerHTML},setValue:function(){},refresh:function(t,i,s){var e=0;t.mapCells(null,s.columnId,null,1,function(t){t*=1,isNaN(t)||(e+=t)},!0),s.format&&(e=s.format(e)),s.template&&(e=s.template({value:e})),i.firstChild.innerHTML=e},trackCells:!0,render:function(t,i){return i.template&&(i.template=At(i.template)),""}},masterCheckbox:{getValue:function(){},setValue:function(){},getHelper:function(t,i){return{check:function(){i.checked=!1,t.onclick()},uncheck:function(){i.checked=!0,t.onclick()},isChecked:function(){return i.checked}}},refresh:function(s,t,e){t.onclick=function(){this.getElementsByTagName("input")[0].checked=e.checked=!e.checked;var t=s.getColumnConfig(e.columnId),i=e.checked?t.checkValue:t.uncheckValue;s.data.each(function(t){t[e.columnId]=i,s.callEvent("onCheck",[t.id,e.columnId,i]),this.callEvent("onStoreUpdated",[t.id,t,"save"])}),s.refresh()}},render:function(t,i){return"<input type='checkbox' "+(i.checked?"checked='1'":"")+">"}},textFilter:{getInputNode:function(t){return t.firstChild?t.firstChild.firstChild:{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(t,i,s){i.component=t.Z.id,t.registerFilter(i,s,this),i._d=t.Z.id,s.value&&this.getValue(i)!=s.value&&this.setValue(i,s.value),i.onclick=Q,Nt(i,"keydown",this.pd)},render:function(t,i){return this.init&&this.init(i),i.css="webix_ss_filter","<input "+(i.placeholder?'placeholder="'+i.placeholder+'" ':"")+"type='text'>"},pd:function(t){var i=this._d;9!=(t.which||t.keyCode)&&(this.md&&window.clearTimeout(this.md),this.md=window.setTimeout(function(){var t=Pt(i);t&&t.filterByAll()},yn.textWaitDelay))}},selectFilter:{getInputNode:function(t){return t.firstChild?t.firstChild.firstChild:{value:null}},getValue:function(t){return this.getInputNode(t).value},setValue:function(t,i){this.getInputNode(t).value=i},refresh:function(t,i,s){s.compare=s.compare||function(t,i){return t==i},i.component=t.Z.id,t.registerFilter(i,s,this);var e=yn.bd(t,s);!1!==s.emptyOption&&e.unshift({id:"",value:s.emptyOption||""});for(var n=document.createElement("select"),h=0;h<e.length;h++){var r=document.createElement("option");r.value=e[h].id,r.text=e[h].value,n.add(r)}i.firstChild.innerHTML="",i.firstChild.appendChild(n),s.value&&this.setValue(i,s.value),i.onclick=Q,n._d=t.Z.id,Nt(n,"change",this.gd)},render:function(t,i){return this.init&&this.init(i),i.css="webix_ss_filter",""},gd:function(){Pt(this._d).filterByAll()}},bd:function(t,i){var s=i.options;return s?t.wd.call(s,"id","value"):t.collectValues(i.columnId,i.collect)}};yn.serverFilter=P.extend({$server:!0,pd:function(t){var i=this._d,s=t.which||t.keyCode;9==s||33<=s&&s<=40||(this.md&&window.clearTimeout(this.md),this.md=window.setTimeout(function(){Pt(i).filterByAll()},yn.textWaitDelay))}},yn.textFilter),yn.serverSelectFilter=P.extend({$server:!0,gd:function(){Pt(this._d).filterByAll()}},yn.selectFilter),yn.numberFilter=P.extend({init:function(h){h.prepare=function(t){var s,e=this,i=-1!=t.indexOf("="),n=this.format(t);return""===n?"":(-1!=t.indexOf(">")?s=this.xd:-1!=t.indexOf("<")&&(s=this.yd),h.compare=s&&i?function(t,i){return e.Md(t,i)||s(t,i)}:s||this.Md,n)}},format:function(t){return t.replace(/[^\-.0-9]/g,"")},xd:function(t,i){return i<1*t},yd:function(t,i){return""!==t&&1*t<i},Md:function(t,i){return""!==t&&1*t==i}},yn.textFilter),yn.dateFilter=P.extend({format:function(t){if(""===t)return"";var i=new Date;if(-1!=t.indexOf("today"))i=tn.dayStart(i);else if(-1==t.indexOf("now")){var s=t.match(/[0-9]+/g);if(!s||!s.length)return"";i=s.length<3?(s.reverse(),new Date(s[0],(s[1]||1)-1,1)):ct.dateFormatDate(t.replace(/^[>< =]+/
  ,""))}return i.valueOf()}},yn.numberFilter);var Mn={name:"baselayout",restore:function(t,i,s){var e=this.Sd(m(t),i);if(s)return e;zt(e.cols||e.rows,this)},Sd:function(t,i){if(!t.$layout)return i.call(this,t);for(var s=t.cols||t.rows,e=0;e<s.length;e++)s[e]=this.Sd(s[e],i);return t},serialize:function(t){for(var i=[],s=this.getChildViews(),e=0;e<s.length;e++){var n=s[e];if(n.movePortlet){var h=n.getChildViews();i.push(t.call(this,h[h.length-1]))}else n.serialize?i.push(n.serialize(t,!0)):i.push(t.call(this,n))}var r={$layout:!0,type:this.config.type};return this.config.rows?r.rows=i:r.cols=i,r},$init:function(t){this.$ready.push(this.kd),this.mt=this.Zi,this.Cd=[],this.$d=[],this.qa={top:0,left:0,right:0,bottom:0},t.$topView&&(t.borderless=!0,t.K={top:!0,left:!0,bottom:!0,right:!0}),t.isolate&&P.extend(this,Bs)},rows_setter:function(t){return this.Dd=1,this.Id=t,!0},cols_setter:function(t){return this.Dd=0,this.$view.style.whiteSpace="nowrap",this.Id=t,!0},st:function(t){var i=x.find.call(this.ji,t);this.Ad&&this.Ad(i),x.removeAt.call(this.ji,i),this.resizeChildren(!0)},it:function(t,i){if(j(i)){for(var s=0;s<this.ji.length;s++)this.ji[s].destructor();this.Id=t,this.kd()}else{var e;"number"==typeof i?((i<0||i>this.ji.length)&&(i=this.ji.length),x.insertAt.call(this.ji,t,i),t.Z.hidden||this.Td(t,this.ji[i])):(e=Pt(i),i=x.find.call(this.ji,e),t.Z.hidden||this.Td(t,e),e.destructor(),this.ji[i]=t),this.Dd||this.Ga(t)}this.resizeChildren(!0);var n=this.elements?this:this.getFormView();n&&n.ps(),A("onReconstruct",[this])},Ga:function(t){t.et.style.display="inline-block",t.et.style.verticalAlign="top"},addView:function(t,i){j(i)&&(i=this.ji.length);var s=this.$$?this:this.getTopParentView();M._=this;var e=s&&s.ui?s.ui(t,this,i):zt(t,this,i);return M._=null,e.Z.id},removeView:function(t){var i;i="object"!=k(t)?Pt(t)||(this.$$?this.$$(t):null):t;var s=x.find.call(this.ji,i);if(0<=s){this.Ad&&this.Ad(s,i);var e=this.elements?this:this.getFormView();this.ji.splice(s,1),e&&zt.each(i,function(t){t.name&&delete e.getCleanValues()[t.config.name]},e,!0),i.destructor(),this.resizeChildren(!0),e&&e.ps()}A("onReconstruct",[this])},reconstruct:function(){this.Fd=0,this.it(this.Id)},Ni:function(t,i,s){t.Z.hidden||(t.Z.hidden=!0,G(t.et),this.Fd++,s||M.w||this.resizeChildren(!0))},zd:function(t){t.callEvent&&t.callEvent("onViewShow",[])},resizeChildren:function(){if(!M.l&&this.Cd){var t=this.getParentView();if(t)return t.resizeChildren?t.resizeChildren():t.resize();var i,s,e,n,h=this.$getSize(0,0);if(e=i=this.Cd[0]||0,n=s=this.Cd[1]||0,(1e5<=h[1]||1e5<=h[3])&&this.et.parentNode&&(e=i=Math.max(h[0],this.Z.width||this.et.parentNode.offsetWidth||i||0),n=s=Math.max(h[2],this.Z.height||this.et.parentNode.offsetHeight||s||0)),t)this.Ka(i,s);else{h[0]>i&&(e=h[0]),h[2]>s&&(n=h[2]);var r=this.et.parentNode==document.body&&!this.setPosition;!r&&i>h[1]&&(e=h[1]),!r&&s>h[3]&&(n=h[3]),this.$setSize(e,n)}M.o&&(M.o=!1,this.resizeChildren()),A("onResize",[])}},getChildViews:function(){return this.ji},index:function(t){t.Z&&(t=t.Z.id);for(var i=0;i<this.ji.length;i++)if(this.ji[i].Z.id==t)return i;return-1},Td:function(t,i){if(i)if(i.Z.hidden||t===i){for(var s=this.index(i)+1;this.ji[s]&&this.ji[s].Z.hidden;)s++;i=this.ji[s]?this.ji[s].et:null}else i=i.et;X(t.et,i,this.mt||this.et)},Ts:function(t,i,s){t.Z.hidden&&(this.Td(t,t),t.Z.hidden=!1,this.Fd--,s||(this.resizeChildren(!0),t.refresh&&t.refresh()),t.callEvent&&(t.callEvent("onViewShow",[]),zt.each(t,this.zd)))},showBatch:function(t,i){var s=void 0!==i;if(i=!1!==i,s)this.Z.visibleBatch="";else{if(this.Z.visibleBatch==t)return;this.Z.visibleBatch=t}for(var e=[],n=0;n<this.ji.length;n++)this.ji[n].Z.batch||this.ji[n].Z.hidden?this.ji[n].Z.batch==t?i?e.push(this.ji[n]):this.Ni(this.ji[n],null,!0):s||this.Ni(this.ji[n],null,!0):e.push(this.ji[n]);for(var h=0;h<e.length;h++)this.Ts(e[h],null,!0),e[h].Fs();this.resizeChildren(!0)},kd:function(t){this.ji=[],this.name;for(var i=0;i<t.length;i++)M._=this,t[i].K||(t[i].borderless=!0),this.ji[i]=zt.rt(t[i],this),this.Dd||this.Ga(this.ji[i]),
  this.Z.visibleBatch&&this.Z.visibleBatch!=this.ji[i].Z.batch&&this.ji[i].Z.batch&&(this.ji[i].Z.hidden=!0,this.Fd++),this.ji[i].Z.hidden||((this.mt||this.Zi).appendChild(this.ji[i].et),this.ji[i].$nospace&&this.Fd++);this.Vd&&this.Vd(t)},Bd:function(t,i){i.top&&(t.borderTopWidth="0px"),i.left&&(t.borderLeftWidth="0px"),i.right&&(t.borderRightWidth="0px"),i.bottom&&(t.borderBottomWidth="0px")},Hd:function(t,i,s){if(this.Dd!=s)for(var e=0;e<this.ji.length;e++)this.ji[e].Z[t]=i,this.ji[e].Hd&&this.ji[e].Hd(t,i,s)},$getSize:function(t,i){var s=0,e=1e5,n=1e5,h=0;this.Dd?n=0:e=0;var r=0,o=0,a=0;this.Za=[];for(var u=0;u<this.ji.length;u++)if(!this.ji[u].Z.hidden){var c=this.Za[u]=this.ji[u].$getSize(0,0);this.ji[u].$nospace?o++:this.Dd?(c[0]>s&&(s=c[0]),c[1]<e&&(e=c[1]),h+=c[2],n+=c[3],c[2]==c[3]&&-1!=c[2]?(r+=c[2],o++):a+=c[4]):(c[2]>h&&(h=c[2]),c[3]<n&&(n=c[3]),s+=c[0],e+=c[1],c[0]==c[1]&&-1!=c[0]?(r+=c[0],o++):a+=c[4])}n<h&&(n=h),e<s&&(e=s),this.Rd=[r,this.ji.length-o,a],this.Pd=[s+t,h+i];var f=ji.api.$getSize.call(this,0,0);return 1e5<=f[1]&&(f[1]=0),1e5<=f[3]&&(f[3]=0),f[0]=(f[0]||s)+t,f[1]=Math.max(f[0],(f[1]||e)+t),f[2]=(f[2]||h)+i,f[3]=Math.max(f[2],(f[3]||n)+i),!this.Dd&&this.Z.responsive&&(f[0]=0),f},$setSize:function(t,i){this.Cd=[t,i],ji.api.$setSize.call(this,t,i),this.Ka(t,i)},jd:function(t,i,s){var e=i=t[i];if(i!=(s=t[s])){var n=this.Ed*t[4]/this.Nd;if(n<i)e=i,this.Nd-=t[4],this.Ed-=e;else{if(!(s<n))return-1;e=s,this.Nd-=t[4],this.Ed-=e}}return e},Ld:function(t,i){var s=Pt(i);"hide"!==s&&s?(s||(s=zt({view:"popup",body:[{}]})),t.Od=t.Z.width,t.Ud=t.Z.height,t.Yd=s.Z.id,t.Z.width=0,t.Z.height||(t.Z.autoheight=!0),zt(t,s,this.$d.length)):(t.hide(),t.Yd="hide"),this.$d.push(t)},Wd:function(t){var i=t.Yd;if(t.Yd=0,"hide"!==i&&i){t.Z.width=t.Od,t.Z.height=t.Ud,delete t.Z.autoheight;for(var s=0;this.ji[s]&&!1===this.ji[s].Z.responsiveCell;)s++;zt(t,this,s)}else t.show();this.$d.pop()},Gd:function(t){if(M.u=!0,t+this.qa.left+this.qa.right+this.Qa*(this.ji.length-1)<this.Pd[0])for(var i=this.ji.length-1,s=0;s<i;s++){var e=this.ji[s];if(!e.Yd){if(!1!==e.Z.responsiveCell){this.Ld(e,this.Z.responsive),A("onResponsiveHide",[e.Z.id]),M.o=!0;break}i=this.ji.length}}else if(this.$d.length){var n=this.$d[this.$d.length-1],h="hide"==n.Yd?0:n.Od;n.$getSize(h,0)[0]+this.Pd[0]+this.Qa+20<=t&&(this.Wd(n),A("onResponsiveShow",[n.Z.id]),M.o=!0)}M.u=!1},Ka:function(t,i){M.h=(M.h||0)+1,!this.Dd&&this.Z.responsive&&this.Gd(t,i),this.Ed=(this.Dd?i:t)-this.Rd[0],this.Nd=this.Rd[2];for(var s=t,e=i,n=[],h=0;h<this.ji.length;h++)if(!this.ji[h].Z.hidden&&this.Za[h]){var r=this.Za[h];if(this.Dd){if((e=this.jd(r,2,3))<0){n.push({oldIndex:h,view:this.ji[h]});continue}}else if((s=this.jd(r,0,1))<0){n.push({oldIndex:h,view:this.ji[h]});continue}this.ji[h].$setSize(s,e)}for(var o=0;o<n.length;o++){var a=n[o].oldIndex,u=this.Za[a],c=Math.round(this.Ed*u[4]/this.Nd);this.Ed-=c,this.Nd-=u[4],this.Dd?e=c:s=c,n[o].view.$setSize(s,e)}M.h-=1},Xd:function(t,i){var s=this.index(t);return-1==s?null:this.ji[s+i]},Jd:function(){return this.ji[0]}},Sn={api:Mn,view:P.protoUI(Mn,w,ji.view)},kn={name:"layout",$init:function(){this.Fd=0},defaults:{type:"line"},kd:function(){this.Zd&&(t=this.Zd(t)),this.qd||(this.et.className+=" webix_layout_"+(this.Z.type||""),this.qd=1),this.Z.margin!==undefined&&(this.Qa=this.Z.margin),this.Z.padding!==undefined&&"object"!==k(this.Z.padding)&&(this.qa.left=this.qa.right=this.qa.top=this.qa.bottom=this.Z.padding),this.Z.paddingX!==undefined&&(this.qa.left=this.qa.right=this.Z.paddingX),this.Z.paddingY!==undefined&&(this.qa.top=this.qa.bottom=this.Z.paddingY),"object"===k(this.Z.padding)&&P.extend(this.qa,this.Z.padding,!0),(this.qa.left||this.qa.right||this.qa.top||this.qa.bottom)&&(this.qa.defined=!0),this.Kd()&&!this.Z.borderless&&(this.Zi.style.borderWidth="1px",this.Qd=!0);var t=this.Id;this.Z.borderless&&(this.Z.K={top:!0,left:!0,right:!0,bottom:!0}),this.Xa(t),Sn.api.kd.call(this,t),this.Ja(t)},$getSize:function(t,i){t=t||0,i=i||0;var s=this.Qa*(this.ji.length-this.Fd-1);if(this.Qd||this.Kd()){var e=this.Z.K;e&&(t+=(e.left?0:1
  )+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1))}return this.Z.height||(i+=this.qa.top+this.qa.bottom+(this.Dd?s:0)),this.Z.width||(t+=this.qa.left+this.qa.right+(this.Dd?0:s)),Sn.api.$getSize.call(this,t,i)},$setSize:function(t,i){this.Cd=[t,i],this.Kd()||this.Qd?Li.api.$setSize.call(this,t,i):ji.api.$setSize.call(this,t,i),i=this.Is,t=this.$s,this.Z.scroll&&(i=Math.max(i,this.Pd[1]),t=Math.max(t,this.Pd[0])),this.Ka(t,i)},Ka:function(t,i){var s=this.Qa*(this.ji.length-this.Fd-1);return i-=this.qa.top+this.qa.bottom,t-=this.qa.left+this.qa.right,this.Dd?i-=s:t-=s,Sn.api.Ka.call(this,t,i)},resizeChildren:function(t){if(t){this.Cs=null;for(var i=[],s=0;s<this.ji.length;s++){var e=this.ji[s];i[s]=e.Z;var n=e.Cd&&!e.Qd||e.Z.borderless?"0px":"1px";e.et.style.borderTopWidth=e.et.style.borderBottomWidth=e.et.style.borderLeftWidth=e.et.style.borderRightWidth=n}this.Xa(i);for(var h=0;h<i.length;h++)i[h].borderless&&this.ji[h].Vs&&this.ji[h].Vs(i[h]);this.Ja(this.ji)}M.u||Sn.api.resizeChildren.call(this)},Kd:function(){return this.qa.defined&&0<this.Qa&&!this.tv},Xa:function(t){if(!this.Kd()||this.Z.borderless&&"space"!=this.Z.type){for(var i=0;i<t.length;i++)t[i].K=f(this.Z.K);var s=!1;this.tv&&(s=!0);var e=t.length;if(this.Dd){for(var n=1;n<e-1;n++)t[n].K.top=t[n].K.bottom=s;if(1<e){for("head"!=this.Z.type&&(t[0].K.bottom=s);t[e-1].hidden&&1<e;)e--;0<e&&(t[e-1].K.top=s)}}else{for(var h=1;h<e-1;h++)t[h].K.left=t[h].K.right=s;if(1<e){for("head"!=this.Z.type&&(t[0].K.right=s),t[e-1].K.left=s;1<e&&t[e-1].hidden;)e--;0<e&&(t[e-1].K.left=s)}}}else for(var r=0;r<t.length;r++)t[r].K&&t[r].borderless||(t[r].K={top:!1,left:!1,right:!1,bottom:!1})},Ja:function(t){for(var i=0,s=0;s<t.length;s++){var e=this.ji[s],n=e.Z.K;if(e.Z.hidden&&this.ji[s+1]){var h=this.ji[s+1].Z.K;n.top||(h.top=!1),n.left||(h.left=!1),s==i&&i++}this.Bd(e.et.style,e.Z.K)}for(var r=this.Dd?"marginLeft":"marginTop",o=this.Dd?"marginTop":"marginLeft",a=this.Dd?this.qa.left:this.qa.top,u=this.Dd?this.qa.top:this.qa.left,c=0;c<t.length;c++)this.ji[c].et.style[r]=a+"px";this.ji.length&&(this.ji[i].et.style[o]=u+"px");for(var f=i+1;f<t.length;f++)this.ji[f].et.style[o]=this.Qa+"px"},type_setter:function(t){return this.Qa="undefined"!=typeof this.iv[t]?this.iv[t]:this.iv.line,this.qa.left=this.qa.right=this.qa.top=this.qa.bottom="undefined"!=typeof this.iv[t]?this.sv[t]:this.sv.line,this.tv="material"==t||"clean"==t,"material"==t&&(this.Z.borderless=!0),t},$skin:function(){this.iv=Xi.layoutMargin,this.sv=Xi.layoutPadding}},Cn=P.protoUI(kn,Sn.view),$n={api:kn,view:Cn};Cn.call(-1);var Dn={name:"daterange",defaults:{button:!1,icons:!1,calendarCount:2,borderless:!1},$init:function(t){t.calendar=t.calendar||{},t.value=this.ev(t.value),delete t.calendar.type,this.et.className+=" webix_daterange",this.nv=this.hv[t.calendar.type]||0;for(var i=[],s=Xi.calendar,e=s&&s.height?s.height:0,n=s&&s.width?s.width:0,h=e||250,r=n||250,o=P.extend({view:"calendar",width:n,height:e},t.calendar||{},!0),a=t.calendarCount=0===this.nv&&t.calendarCount||this.defaults.calendarCount,u=(o.css?o.css+" ":"")+"webix_range_",c=t.value.start||new Date,f=0;f<a;f++){var l=tn.add(c,this.rv[this.nv]*f,"month",!0);P.extend(o,{events:C(this.ov,this),css:u+(1===a?"":0===f?"0":f+1==a?"N":"1"),monthSelect:0===f||f+1===a,timepicker:0===this.nv&&t.timepicker,borderless:!0,date:l},!0),i.push(m(o))}t.rows=[{type:"clean",cols:i}],(t.button||t.icons)&&t.rows.push(this.av(t,r*a)),t.height=j(t.height)?h+(t.icons||t.button?30:0):t.height,t.width=j(t.width)?r*a:t.width,t.type="line",this.$ready.push(this.uv),Lt(this.$view,"keydown",C(function(t){this.zs(t.which||t.keyCode,t)},this))},value_setter:function(t){return this.ev(t)},getValue:function(){return this.Z.value},setValue:function(t,i){t=this.ev(t);var s=(this.Z.value=t).start||t.end||new Date;if(!i){this.cv[0].showCalendar(t.start);for(var e=1;e<this.cv.length;e++)this.cv[e].Z.date=s,this.fv(this.cv[e],1,e)}this.callEvent("onChange",[t]),this.refresh()},refresh:function(){for(var t=0;t<this.cv.length;t++)if(this.cv[t].nv===this.nv){et(this.cv[t].$view,"webix_cal_timepicker")
  ,et(this.cv[t].$view,"webix_range_timepicker");var i=this.lv(this.cv[t].getVisibleDate());if(i.start||i.end){if(this.cv[t].Z.date=i.start||i.end,this.Z.timepicker){var s="webix_"+(i.start&&i.end?"range":"cal")+"_timepicker";st(this.cv[t].$view,s)}}else tn.datePart(this.cv[t].Z.date);this.cv[t].refresh()}},addToRange:function(t){var i=this.dv(this.vv(t));this.setValue(i)},_v:[{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+ct.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date;this.Z.timepicker||(t=tn.datePart(t)),this.addToRange(t),this.callEvent("onTodaySet",[this.getValue()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+ct.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue(""),this.callEvent("onDateClear",[])}}}],pv:function(t){if(t){t="object"==k(t)?t:this._v;for(var i={css:"webix_cal_footer ",borderless:!0,template:"<div class='webix_cal_icons'>",onClick:{}},s=0;s<t.length;s++){if(t[s].template){var e="function"==typeof t[s].template?t[s].template:At(t[s].template);i.template+=e.call(this)}if(t[s].on_click)for(var n in t[s].on_click)i.onClick[n]=C(t[s].on_click[n],this)}return i.template+="</div>",i.width=nt(i.template).width+30,i}return{width:0}},av:function(t,i){var s={view:"button",value:ct.calendar.done,minWidth:100,maxWidth:230,align:"center",click:function(){this.getParentView().getParentView().hide()}},e=this.pv(t.icons),n={css:"webix_range_footer",height:30,cols:[{width:e.width}]};return(t.button||t.icons)&&2*e.width+s.minWidth>i&&(n.cols[0].width=0),n.cols.push(t.button?s:{}),n.cols.push(e),n},hv:{time:-1,month:1,year:2},rv:{0:1,1:12,2:120},ev:function(t){return t||(t={start:null,end:null}),t.start||t.end||(t={start:t}),t.end=this.vv(t.end)||null,t.start=this.vv(t.start)||null,(t.end&&t.end<t.start||!t.start)&&(t.end=[t.start,t.start=t.end][0]),t},vv:function(t){return"string"==typeof t&&(t=ct.parseFormatDate(t)),isNaN(1*t)?null:t},ov:function(t,i){if(!i){var s=this.Z.value,e=s.start?tn.datePart(tn.copy(s.start)):null,n=s.end?tn.datePart(tn.copy(s.end)):null,h=tn.datePart(t),r=tn.add(h,1,"day",!0),o=tn.add(h,-1,"day",!0),a="";return e<=h&&n&&h<=n&&(a="webix_cal_range",tn.equal(o,e)&&(a+=" webix_cal_range_first"),tn.equal(r,n)&&(a+=" webix_cal_range_last")),tn.equal(h,e)&&(a="webix_cal_range_start"),tn.equal(h,n)&&(a="webix_cal_range_end"),a+" "+(tn.isHoliday(t)+" "||"")}},uv:function(){var t=this.cv=this.getChildViews()[0].getChildViews(),s=this,i=this.config.id;this.mv={};for(var e=0;e<t.length;e++)t[e].config.master=i,t[this.mv[t[e].config.id]=e].attachEvent("onBeforeDateSelect",function(t){return s.bv(this,t)}),t[e].attachEvent("onBeforeZoom",function(t){return s.gv(this,t)}),0!==e&&e!==t.length-1||(t[e].attachEvent("onAfterMonthChange",C(this.wv,this)),t[e].attachEvent("onAfterZoom",function(t,i){s.xv(this,t,i)}));this.Z.timepicker&&this.refresh()},gv:function(t,i){var s=this.yv(t.config.id);if(0<=i&&0<s&&s!==this.cv.length-1)return!1;if(-1===i){var e=this.lv(t.getVisibleDate());e.start&&e.end&&(t.Z.date=e[this.Mv])}return!0},wv:function(t,i){var s=i<t?1:-1,e=i<t?this.cv[this.cv.length-1]:this.cv[0],n=e.kv[e.nv].Sv;this.Cv(s,n,e),this.refresh()},xv:function(t,i,s){var e=t.kv[t.nv].Sv,n=this.yv(t.config.id),h=0===n?1:-1;if(this.cv[n+h]){var r=this.cv[n+h].Z.date;if(i<s&&0<=i){var o=0;if(1===i){var a=r.getFullYear();(this.nv||-1===h&&11===r.getMonth()||1===h&&0===r.getMonth())&&(a-=h),o=t.Z.date.getFullYear()-a}else if(0===i){var u=r.getMonth()-h;12!==u&&-1!=u||(u=-1===u?11:0),o=t.Z.date.getMonth()-u}this.Cv(o,e,t),this.refresh()}}},fv:function(t,i,s){t.blockEvent(),0<=t.nv&&t.$v(i,s),t.unblockEvent()},yv:function(t){return this.mv[t]},Cv:function(t,i,s){for(var e=0;e<this.cv.length;e++){var n=this.cv[e];s&&n.config.id===s.config.id||this.fv(n,t,i)}},lv:function(t){var i=this.Z.value,s={};return i.start&&i.start.getYear()===t.getYear()&&i.start.getMonth()===t.getMonth()&&(s.start=i.start),i.end&&i.end.getYear()===t.getYear(
  )&&i.end.getMonth()===t.getMonth()&&(s.end=i.end),s},Dv:function(t,i){t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds()),t.setMilliseconds(i.getMilliseconds())},dv:function(t,i){var s=m(this.Z.value);0===this.nv||j(i)?s.start&&!s.end?s.end=t:(s.start=t,s.end=null):s[i?"end":"start"]=t;return s},bv:function(t,i){if(this.callEvent("onBeforeDateSelect",[i])){var s=this.Z.value;if(t.nv<0){var e,n=m(this.lv(i));(e=n.start&&n.end?n[this.Mv]:n.start||n.end)&&this.Dv(e,i),t.nv=0,s=P.extend(m(s),n,!0)}else{var h=t.getVisibleDate(),r=this.yv(t.config.id);if(i.getMonth()!==h.getMonth()&&(0===r||r===this.cv.length-1)){var o=h<i?1:-1;this.Cv(o,1)}s=this.dv(i,r)}t.nv!==this.nv&&t.showCalendar(i),this.setValue(s,!0),this.callEvent("onAfterDateSelect",[this.getValue()])}return!1}},In={api:Dn,view:P.protoUI(Dn,$n.view)};yn.richSelectFilter={getInputNode:function(t){return Pt(t.$webix)||null},getValue:function(t,i){var s=this.getInputNode(t);return i&&s.getText?s.getText():s?s.getValue():""},setValue:function(t,i){var s=this.getInputNode(t);return s?s.setValue(i):""},compare:function(t,i){return t==i},refresh:function(t,i,s){if(!t.$destructed){var e=Pt(s.richselect);if(!e.$view.parentNode)Y("div",{"class":"webix_richfilter"}).appendChild(e.$view);i.$webix=s.richselect,i.style.marginLeft="-10px",s.compare=s.compare||this.compare,s.prepare=s.prepare||this.prepare,t.registerFilter(i,s,this);var n=yn.bd(t,s),h=e.getPopup().getList();if(i.firstChild.appendChild(e.$view.parentNode),h.parse&&(h.clearAll(),h.parse(n),!this.$noEmptyOption&&!1!==s.emptyOption||s.emptyOption)){var r={id:"$webix_empty",value:s.emptyOption||"",$empty:!0};h.add(r,0)}s.value&&this.setValue(i,s.value),e.render(),$(e.resize,e)}},render:function(t,i){if(!i.richselect){var s={container:Y("div",{"class":"webix_richfilter"}),view:this.inputtype,options:[]},e=P.extend(this.inputConfig||{},i.inputConfig||{},!0);P.extend(s,e),i.separator&&(s.separator=i.separator),i.suggest&&(s.suggest=i.suggest);var n=zt(s);n.attachEvent("onChange",function(){t.filterByAll()}),i.richselect=n.Z.id,t.ht.push(n)}return i.css="webix_div_filter"," "},inputtype:"richselect"},yn.serverRichSelectFilter=P.extend({$server:!0},yn.richSelectFilter),yn.multiSelectFilter=P.extend({$noEmptyOption:!0,inputtype:"multiselect",prepare:function(t,i){if(!t)return t;for(var s={},e=t.toString().split(i.separator||","),n=0;n<e.length;n++)s[e[n]]=1;return s},compare:function(t,i){return!i||i[t]}},yn.richSelectFilter),yn.serverMultiSelectFilter=P.extend({$server:!0,gd:function(){Pt(this._d).filterByAll()}},yn.multiSelectFilter),yn.multiComboFilter=P.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},yn.multiSelectFilter),yn.serverMultiComboFilter=P.extend({inputtype:"multicombo",inputConfig:{tagMode:!1}},yn.serverMultiSelectFilter),yn.datepickerFilter=P.extend({prepare:function(t){return t||""},compare:function(t,i){return 1*t==1*i},inputtype:"datepicker"},yn.richSelectFilter),yn.columnGroup={getValue:function(t){return t.innerHTML},setValue:function(){},getHelper:function(t,i){return{open:function(){i.closed=!0,t.onclick()},close:function(){i.closed=!1,t.onclick()},isOpened:function(){return i.closed}}},refresh:function(s,t,e){t.onclick=function(t){tt(t);var i=this.firstChild.firstChild;e.closed?(e.closed=!1,i.className="webix_tree_open"):(e.closed=!0,i.className="webix_tree_close"),$(function(){s.callEvent("onColumnGroupCollapse",[e.columnId,e.batch,!e.closed]),s.showColumnBatch(e.batch,!e.closed)})},e.firstRun||(e.firstRun=1,e.closed&&s.showColumnBatch(e.batch,!1))},render:function(t,i){return"<div role='button' tabindex='0' aria-label='"+ct.aria[i.closed?"openGroup":"closeGroup"]+"' class='"+(i.closed?"webix_tree_close":"webix_tree_open")+"'></div>"+(i.groupText||"")}},yn.dateRangeFilter=P.extend({prepare:function(t){return t.start||t.end?In.api.ev(t):""},compare:function(t,i){return(!i.start||t>=i.start)&&(!i.end||t<=i.end)},inputtype:"daterangepicker"},yn.richSelectFilter),yn.serverDateRangeFilter=P.extend({$server:!0},yn.dateRangeFilter),
  S.scrollSize=S.touch||S.$customScroll?0:17,Mi(function(){var t=function e(){var t=Y("div");t.className="webix_skin_mark",t.style.cssText="position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;min-height:100px;overflow-y:scroll;",document.body.appendChild(t);var i=t.offsetWidth-t.clientWidth,s={200:"flat",210:"compact",230:"contrast",240:"material",250:"mini"}[10*Math.floor(t.offsetHeight/10)];document.body.removeChild(t),s&&Zi(s);return S.$customScroll?0:i}();S.scrollSize=S.touch?0:t});var An=!1;u("_fixHeight",function Ro(){An||(O("html, body{ height:100%; }"),document.body.className+=" webix_full_screen",Ki.limit(!1),An=!0)}),zt.animate=function Po(t,i,s){var e=Pt(i);if(e){var n=s||{type:"slide",direction:"left"},h=e.et.cloneNode(!0),r=zt(t,i);r.et.parentNode.appendChild(h);var o=Gi.formLine(r.et,h,n);return n.callback=function(){Gi.breakLine(o)},Gi(o,n),r}},zt.animateView=function jo(i,t,s){if(i=Pt(i)){s=s||{type:"slide",direction:"left"};for(var e=function(t){var i=t.et,s=i.className,e=i.innerHTML;return"<div class='"+s+"' style='width:"+i.offsetWidth+"px;height:"+i.offsetHeight+"px;'>"+e+"</div>"},n=[],h=0;h<i.et.childNodes.length;h++){var r=i.et.childNodes[h],o=r.currentStyle?r.currentStyle.display:getComputedStyle(r,null).display;n.push(o||"")}var a=e(i);"function"==typeof t&&t.call(this);for(var u=e(i),c=i.et.insertBefore(Y("DIV",{"class":"webix_view_animate",style:"width:"+i.et.offsetWidth+"px;height:"+i.et.offsetHeight+"px;"},u+a),i.et.firstChild),f=1;f<i.et.childNodes.length;f++)i.et.childNodes[f].style.display="none";var l=Gi.formLine(c.childNodes[0],c.childNodes[1],s);return s.callback=function(){if(c){i.et.removeChild(c),c=null;for(var t=0;t<i.et.childNodes.length;t++)i.et.childNodes[t].style.display=n[t]}},Gi(l,s),i}},zt.freeze=gi,zt.resize=wi,zt.each=xi,zt.zIndex=yi,zt.hasMethod=Ht,zt.datafilter=yn,zt.fullScreen=function Eo(){if(S.touch){ut("apple-mobile-web-app-capable","yes"),ut("viewport","initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no");var t=function(){var t=window.innerWidth,i=window.innerHeight;i&&(document.body.style.height=i+"px",document.body.style.width=t+"px"),M.l=!1,wi()},i=function(){M.l=!0,$(t,null,[],500)};T("onRotate",i),xn(),$(i)}};ct.locales["de-DE"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%n.%Y",timeFormat:"%H:%i",longDateFormat:"%j. %F %Y",fullDateFormat:"%j. %F %Y %H:%i",am:null,pm:null,price:"{obj} €",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthShort:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayFull:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayShort:["So","Mo","Di","Mi","Do","Fr","Sa"],hours:"Stunden",minutes:"Minuten",done:"Fertig",clear:"Entfernen",today:"Heute"},dataExport:{page:"Seite",of:"aus"},PDFviewer:{of:"aus",automaticZoom:"Automatisch Zoom",actualSize:"Aktuelles Ausmaß",pageFit:"Seite Ausmaß",pageWidth:"Seite Breite",pageHeight:"Seite Höhe",enterPassword:"Passwort eingeben",passwordError:"Falsches passwort"},aria:{calendar:"Kalender",increaseValue:"Wert erhöhen",decreaseValue:"Wert verringern",navMonth:["Vorheriger Monat","Nächsten Monat"],navYear:["Vorheriges Jahr","Nächstes Jahr"],navDecade:["Zurück Jahrzehnt","Als nächstes Jahrzehnt"],dateFormat:"%j. %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Stunden: %H",minuteFormat:"Minuten: %i",removeItem:"Element entfernen",pages:["Erste Seite","Vorherige Seite","Folgeseite","Letzte Seite"],page:"Seite",headermenu:"Titelmenü",openGroup:"Öffnen Spaltengruppe ",closeGroup:"Schließen Spaltengruppe ",closeTab:"Tab schließen",showTabs:"Weitere Tabs",resetTreeMap:"Zurück zur ursprünglichen Ansicht",navTreeMap:"Aufleveln",nextTab:"Weiter tab",prevTab:"Zurück tab",multitextSection:"Element hinzufügen",multitextextraSection:"Element entfernen",showChart:"Chart anzeigen",hideChart:"Chart verstecken",
  resizeChart:"Chart Größe ändern"},richtext:{underline:"Unterstreichen",bold:"Fettgedruckt",italic:"Kursiv"},combo:{select:"Auswählen",selectAll:"Alles auswählen",unselectAll:"Alles widerrufen"},message:{ok:"OK",cancel:"Abbrechen"},comments:{send:"Absenden",confirmMessage:"Der Kommentar wird entfernt. Sind Sie sicher?",edit:"Redigieren",remove:"Löschen",placeholder:"Geben Sie hier ein..",moreComments:"Mehr Kommentare"}},ct.locales["es-ES"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%n/%Y",timeFormat:"%G:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d %F %Y %G:%i",am:null,pm:null,price:"{obj} €",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayFull:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayShort:["dom","lun","mar","mié","jue","vie","sáb"],hours:"Horas",minutes:"Minutos",done:"Listo",clear:"Reinicio",today:"Hoy"},dataExport:{page:"Página",of:"de"},PDFviewer:{of:"de",automaticZoom:"Zoom automático",actualSize:"Tamaño real",pageFit:"Tamaño de página",pageWidth:"Ancho de página",pageHeight:"Altura de la página",enterPassword:"Introduzca la contraseña",passwordError:"Contraseña incorrecta"},aria:{calendar:"Сalendario",increaseValue:"Aumentar el valor",decreaseValue:"Disminuye el valor",navMonth:["Mes anterior","Próximo mes"],navYear:["Año anterior","Próximo año"],navDecade:["Década anterior","Próxima década"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Horas: %G",minuteFormat:"Minutos: %i",removeItem:"Retire el elemento",pages:["Primera página","Pagina anterior","Siguiente página","Última página"],page:"Página",headermenu:"Menú de títulos",openGroup:"Grupo de columnas abiertas",closeGroup:"Primer grupo de columnas",closeTab:"Cerrar tab",showTabs:"Mostrar más tabs",resetTreeMap:"Volver a la vista original",navTreeMap:"Elevar a mismo nivel",nextTab:"Siguiente tab",prevTab:"Tab anterior",multitextSection:"Añadir elemento",multitextextraSection:"Retire el elemento",showChart:"Espectáculo chart",hideChart:"Esconder chart",resizeChart:"Cambiar el tamaño el chart"},richtext:{underline:"Subrayar",bold:"Negrita",italic:"Itálico"},combo:{select:"Seleccionar",selectAll:"Seleccionar todo",unselectAll:"Deselecciona todo"},message:{ok:"OK",cancel:"Cancelar"},comments:{send:"Enviar",confirmMessage:"El comentario será eliminado. Estás seguro?",edit:"Corregir",remove:"Suprimir",placeholder:"Escriba aquí..",moreComments:"Más comentarios"}},ct.locales["fr-FR"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} €",priceSettings:null,calendar:{monthFull:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aôu","Sep","Oct","Nov","Déc"],dayFull:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],hours:"Heures",minutes:"Minutes",done:"Fini",clear:"Effacer",today:"Aujourd'hui"},dataExport:{page:"Page",of:"sur"},PDFviewer:{of:"sur",automaticZoom:"Zoom automatique",actualSize:"Taille actuelle",pageFit:"Taille de la page",pageWidth:"Largeur de la page",pageHeight:"Hauteur de page",enterPassword:"Entrez le mot de passe",passwordError:"Mauvais mot de passe"},aria:{calendar:"Сalendrier",increaseValue:"Augmenter la valeur",decreaseValue:"Diminution de la valeur",navMonth:["Le mois précédent","Le mois prochain"],navYear:["Année précédente","L'année prochaine"],navDecade:["Décennie précédente","Suivant décennie"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Heures: %H",minuteFormat:"Minutes: %i",removeItem:"Retirer l'élément",pages:["Première page","Page précédente","Page suivante",
  "Dernière page"],page:"Page",headermenu:"Menu de titre",openGroup:"Ouvrir groupe de colonnes ",closeGroup:"Fermer groupe de colonnes",closeTab:"Fermer tab",showTabs:"Montrer plus tabs",resetTreeMap:"Revenir à la vue originale",navTreeMap:"Niveau supérieur",nextTab:"Prochain tab",prevTab:"Précédent tab",multitextSection:"Ajouter l'élément",multitextextraSection:"Retirer l'élément",showChart:"Montrer chart",hideChart:"Cacher chart",resizeChart:"Redimensionner chart"},richtext:{underline:"Souligner",bold:"Gras",italic:"Italique"},combo:{select:"Sélectionner",selectAll:"Tout sélectionner",unselectAll:"Tout déselectionner"},message:{ok:"OK",cancel:"Annuler"},comments:{send:"Envoyer",confirmMessage:"Le commentaire sera supprimé. Êtes-vous sûr?",edit:"Modifier",remove:"Effacer",placeholder:"Écrivez ici..",moreComments:"Plus de commentaires"}},ct.locales["it-IT"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%H:%i",longDateFormat:"%j %F %Y",fullDateFormat:"%j %F %Y %H:%i",am:null,pm:null,price:"€ {obj}",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},calendar:{monthFull:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dayFull:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],dayShort:["dom","lun","mar","mer","gio","ven","sab"],hours:"Orario",minutes:"Minuti",done:"Pronto",clear:"Pulisci",today:"Oggi"},dataExport:{page:"Pagina",of:"di"},PDFviewer:{of:"di",automaticZoom:"Zoom automatico",actualSize:"Dimensione reale",pageFit:"Dimensioni della pagina",pageWidth:"Larghezza della pagina",pageHeight:"Altezza della pagina",enterPassword:"Inserisci la password",passwordError:"Password errata"},aria:{calendar:"Calendario",increaseValue:"Aumenta il valore",decreaseValue:"Riduci il valore",navMonth:["Il mese scorso","Il prossimo mese"],navYear:["L'anno scorso","L'anno prossimo"],navDecade:["Decennio precedente","Prossimo decennio"],dateFormat:"%j %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Orario: %H",minuteFormat:"Minuti: %i",removeItem:"Rimuovere l'elemento",pages:["Prima pagina","Pagina precedente","Pagina successiva","Ultima pagina"],page:"Pagina",headermenu:"Menu del titolo",openGroup:"Aperto gruppo di colonne",closeGroup:"Chiudi gruppo di colonne",closeTab:"Chiudi tab",showTabs:"Mostra più tabs",resetTreeMap:"Tornare alla vista originale",navTreeMap:"Livello superiore",nextTab:"Tab successivo",prevTab:"Tab precedente",multitextSection:"Aggiungi elemento",multitextextraSection:"Rimuovere l'elemento",showChart:"Mostrare grafico",hideChart:"Nascondere grafico",resizeChart:"Ridimensionare grafico"},richtext:{underline:"Sottolineare",bold:"Grassetto",italic:"Corsivo"},combo:{select:"Selezionare",selectAll:"Seleziona tutto",unselectAll:"Deseleziona tutto"},message:{ok:"OK",cancel:"Annullare"},comments:{send:"Inviare",confirmMessage:"Il commento verrà rimosso. Sei sicuro?",edit:"Correggere",remove:"Elimina",placeholder:"Digitare qui..",moreComments:"Altri commenti"}},ct.locales["ja-JP"]={groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%Y.%m.%d",timeFormat:"%H:%i",longDateFormat:"%Y年%m月%d日",fullDateFormat:"%Y.%m.%d %H:%i",price:"¥{obj}",priceSettings:{groupSize:3,groupDelimiter:",",decimalDelimiter:"",decimalSize:0},calendar:{monthFull:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayFull:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayShort:["日","月","火","水","木","金","土"],hours:"営業時間",minutes:"分",done:"レディー",clear:"削除する",today:"今日"},dataExport:{page:"ページ",of:"から"},PDFviewer:{of:"から",automaticZoom:"自動ズーム",actualSize:"実サイズ",pageFit:"ページサイズ",pageWidth:"ページ幅",pageHeight:"ページの高さ",enterPassword:"パスワードを入力する",passwordError:"間違ったパスワード"},aria:{calendar:"カレンダー",increaseValue:"増加値",decreaseValue:"数字を小さく",navMonth:["前の月","来月"],navYear:["前年","来年"],navDecade:[
  "前の十年","次の10年"],dateFormat:"%Y年%m月%d日",monthFormat:"%Y年%m月",yearFormat:"%Y年",hourFormat:"営業時間: %H",minuteFormat:"分: %i",removeItem:"要素を削除します",pages:["一ページ目","前のページ","次のページ","最後のページ"],page:"ページ",headermenu:"ヘッダメニュー",openGroup:"オープン列グループ",closeGroup:"閉じる列グループ",closeTab:"タブを閉じます",showTabs:"複数のタブを表示します",resetTreeMap:"元の表示に戻ります",navTreeMap:"レベルパック",nextTab:"次のタブ",prevTab:"前のタブ",multitextSection:"要素を追加します。",multitextextraSection:"要素を削除します",showChart:"靴チャート",hideChart:"隠すチャート",resizeChart:"グラフのサイズを変更"},richtext:{underline:"アンダーライン",bold:"大胆な",italic:"イタリック"},combo:{select:"選択する",selectAll:"すべて選択",unselectAll:"すべての選択を解除する"},message:{ok:"OK",cancel:"取り消す"},comments:{send:"送信",confirmMessage:"コメントは削除されます. 本気ですか？",edit:"編集",remove:"削除",placeholder:"ここに入力..",moreComments:"その他のコメント"}},ct.locales["pt-BR"]={groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d/%m/%Y",timeFormat:"%G:%i",longDateFormat:"%d de %F de %Y",fullDateFormat:"%d de %F de %Y %G:%i",am:null,pm:null,price:"R$ {obj}",priceSettings:{groupDelimiter:".",groupSize:3,decimalDelimiter:",",decimalSize:2},fileSize:["b","Kb","Mb","Gb","Tb","Pb","Eb"],calendar:{monthFull:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayFull:["Domingo","Segunda-Feira","Terça-Feira","Quarta-Feira","Quinta-Feira","Sexta-Feira","Sábado"],dayShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],hours:"Horas",minutes:"Minutos",done:"Feito",clear:"Limpar",today:"Hoje"},dataExport:{page:"Página",of:"de"},PDFviewer:{of:"de",automaticZoom:"Zoom automático",actualSize:"Tamanho atual",pageFit:"Tamanho da página",pageWidth:"Largura da página",pageHeight:"Altura da página",enterPassword:"Digite a senha",passwordError:"Senha incorreta"},aria:{calendar:"Calendário",increaseValue:"Aumentar o valor",decreaseValue:"Diminuir o valor",navMonth:["Mês anterior","Próximo mês"],navYear:["Ano anterior","Próximo ano"],navDecade:["Década anterior","Próxima década"],dateFormat:"%d de %F de %Y",monthFormat:"%F de %Y",yearFormat:"%Y",hourFormat:"Horas: %G",minuteFormat:"Minutos: %i",removeItem:"Remover elemento",pages:["Primeira página","Página anterior","Próxima página","Última página"],page:"Página",headermenu:"Menu de títulos",openGroup:"Grupo coluna aberta",closeGroup:"Fechar grupo de colunas",closeTab:"Fechar tab",showTabs:"Mostre mais tabs",resetTreeMap:"Мoltar à vista original",navTreeMap:"Upar",nextTab:"Próximo tab",prevTab:"Anterior tab",multitextSection:"Adicionar elemento",multitextextraSection:"Remover elemento",showChart:"Exposição chart",hideChart:"Esconder chart",resizeChart:"Redimensionar chart"},richtext:{underline:"Sublinhado",bold:"Negrito",italic:"itálico"},combo:{select:"Selecionar",selectAll:"Selecionar tudo",unselectAll:"Desmarque todos"},message:{ok:"OK",cancel:"Cancelar"},comments:{send:"Enviar",confirmMessage:"Comentário será removido. Você tem certeza?",edit:"Editar",remove:"Excluir",placeholder:"Digite aqui..",moreComments:"Mais comentários"}},ct.locales["zh-CN"]={groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2,dateFormat:"%Y/%m/%j",timeFormat:"%G:%i",longDateFormat:"%Y'年'%m'月'%j'日'",fullDateFormat:"%Y'年'%m'月'%j'日' %G:%i",am:["上午","上午"],pm:["下午","下午"],price:"¥{obj}",priceSettings:{groupDelimiter:",",groupSize:3,decimalDelimiter:".",decimalSize:2},calendar:{monthFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayShort:["周日","周一","周二","周三","周四","周五","周六"],hours:"小时",minutes:"分钟",done:"完成",clear:"清除",today:"今天"},dataExport:{page:"页",of:"从"},PDFviewer:{of:"从",automaticZoom:"自动设置页面大小",actualSize:"实际尺寸",pageFit:"页面大小",pageWidth:"页面宽度",pageHeight:"页面高度",enterPassword:"输入密码",passwordError:"密码错误"},aria:{calendar:"日历",increaseValue:"增加值",decreaseValue:"减少值",navMonth:["上个月","下个月"],navYear:["上年","明年"],navDecade:["过去十年","下个十年"],dateFormat:"%Y'年'%m'月'%j'日'",
  monthFormat:"%Y'年'%m'月",yearFormat:"%Y'年",hourFormat:"小时: %G",minuteFormat:"分钟: %i",removeItem:"删除元素",pages:["第一页","上一页","下一页","最后一页"],page:"页",headermenu:"标题菜单",openGroup:"打开栏目组",closeGroup:"关闭栏目组",closeTab:"关闭标签",showTabs:"显示更多选项卡",resetTreeMap:"回到原来的视图",navTreeMap:"升级",nextTab:"下一个标签",prevTab:"前一个标签",multitextSection:"加元",multitextextraSection:"删除元素",showChart:"显示图表",hideChart:"隐藏图表",resizeChart:"调整图"},richtext:{underline:"强调",bold:"粗體",italic:"斜体"},combo:{select:"选择",selectAll:"全选",unselectAll:"全部取消选择"},message:{ok:"好",cancel:"取消"},comments:{send:"发送",confirmMessage:"评论将被删除. 你确定吗?",edit:"编辑",remove:"去掉",placeholder:"在此输入..",moreComments:"更多评论"}},ct.locales["ru-RU"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} руб.",priceSettings:null,calendar:{monthFull:["Январь","Февраль","Март","Апрель","Maй","Июнь","Июль","Август","Сентябрь","Oктябрь","Ноябрь","Декабрь"],monthShort:["Янв","Фев","Maр","Aпр","Maй","Июн","Июл","Aвг","Сен","Окт","Ноя","Дек"],dayFull:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],dayShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],hours:"Часы",minutes:"Минуты",done:"Гoтовo",clear:"Очистить",today:"Сегодня"},dataExport:{page:"Страница",of:"из"},PDFviewer:{of:"из",automaticZoom:"Автоматический зум",actualSize:"Настоящий размер",pageFit:"Размер страницы",pageWidth:"Ширина страницы",pageHeight:"Высота страницы",enterPassword:"Введите пароль",passwordError:"Неверный пароль"},aria:{calendar:"Календарь",increaseValue:"Увеличить значение",decreaseValue:"Уменьшить значение",navMonth:["Предыдущий месяц","Следующий месяц"],navYear:["Предыдущий год","Следующий год"],navDecade:["Предыдущие десять лет","Следующие десять лет"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Часы: %H",minuteFormat:"Минуты: %i",removeItem:"Удалить элемент",pages:["Первая страница","Предыдущая страница","Следующая страница","Последняя страница"],page:"Страница",headermenu:"Меню шапки таблицы",openGroup:"Развернуть группу столбцов",closeGroup:"Свернуть группу столбцов",closeTab:"Закрыть вкладку",showTabs:"Показать больше вкладок",resetTreeMap:"Вернуться к первоначальному представлению",navTreeMap:"Перейти на уровень выше",nextTab:"Следующая вкладка",prevTab:"Предыдущая вкладка",multitextSection:"Добавить элемент",multitextextraSection:"Удалить элемент",showChart:"Показать чарт",hideChart:"Спрятать чарт",resizeChart:"Изменить размер чарта"},richtext:{underline:"Подчеркивание",bold:"Жирный",italic:"Курсив"},combo:{select:"Выбрать",selectAll:"Выбрать все",unselectAll:"Сброс выбора"},message:{ok:"OK",cancel:"Отмена"},comments:{send:"Отправить",confirmMessage:"Комментарий будет удален. Вы уверены?",edit:"Редактировать",remove:"Удалить",placeholder:"Введите текст..",moreComments:"Больше комментариев"}},ct.locales["be-BY"]={groupDelimiter:" ",groupSize:3,decimalDelimiter:",",decimalSize:2,dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%d %F %Y",fullDateFormat:"%d.%m.%Y %H:%i",price:"{obj} руб.",priceSettings:{groupSize:3,groupDelimiter:" ",decimalDelimiter:"",decimalSize:0},calendar:{monthFull:["Студзень","Люты","Сакавік","Красавік","Травень","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань"],monthShort:["Студз","Лют","Сак","Крас","Трав","Чэр","Ліп","Жнів","Вер","Каст","Ліст","Снеж"],dayFull:["Нядзеля","Панядзелак","Аўторак","Серада","Чацвер","Пятніца","Субота"],dayShort:["Нд","Пн","Аўт","Ср","Чцв","Пт","Сб"],hours:"Гадзіны",minutes:"Хвіліны",done:"Гатова",today:"Cёння",clear:"Ачысціць"},dataExport:{page:"Старонка",of:"з"},PDFviewer:{of:"з",automaticZoom:"Аўтаматычны зум",actualSize:"Сапраўдны памер",pageFit:"Памер старонкі",pageWidth:"Шырыня старонкі",pageHeight:"Вышыня старонкі",enterPassword:"Увядзіце пароль",passwordError:"Няправільны пароль"},aria:{calendar:"Каляндар",increaseValue:"Павялічыць значэнне",decreaseValue:"Паменшыць значэнне",navMonth:["Папярэдні месяц","Наступны месяц"],navYear:["Папярэдні год","Наступны год"],
  navDecade:["Папярэднія дзесяць год","Наступныя дзесяць год"],dateFormat:"%d %F %Y",monthFormat:"%F %Y",yearFormat:"%Y",hourFormat:"Hours: %h",minuteFormat:"Гадзіны: %i",removeItem:"Прыбраць элемент",pages:["Першая старонка","Папярэдняя старонка","Наступная старонка","Апошняя старонка"],page:"Старонка",headermenu:"Меню загалоўка",openGroup:"Адкрыць групу слупкоў",closeGroup:"Закрыць групу слупкоў",closeTab:"Закрыць укладку",showTabs:"Паказаць больш укладак",resetTreeMap:"Вярнуцца да першапачатковага выгляду",navTreeMap:"Падняцца на ўзровень вышэй",nextTab:"Наступная ўкладка",prevTab:"Папярэдняя ўкладка",multitextSection:"Дадаць элемент",multitextextraSection:"Прыбраць элемент",showChart:"Паказаць графік",hideChart:"Схаваць графік",resizeChart:"Змяніць памер графіка"},richtext:{underline:"Падкрэсліванне",bold:"Паўтлусты",italic:"Курсіў"},combo:{select:"Абраць",selectAll:"Абраць усё",unselectAll:"Ачысціць ўсе"},message:{ok:"ОК",cancel:"Адмена"},comments:{send:"Даслаць",confirmMessage:"Каментарый будзе выдалены. Вы ўпэўнены?",edit:"Рэдагаваць",remove:"Выдаліць",placeholder:"Пішыце тут..",moreComments:"Больш каментарыяў"}};P.protoUI({name:"spacer",defaults:{borderless:!0},$init:function(){this.et.className+=" webix_spacer"}},Li.view);var Tn={name:"template",$init:function(t){var i=this.Iv[t.type];i&&(i.css&&t.css&&(this.et.className+=" "+i.css),P.extend(t,i),t.borderless&&(delete t.K,this.Vs(t))),this.mt==this.et?(this.mt=Y("DIV"),this.mt.className=" webix_template",this.et.appendChild(this.mt)):this.mt.className+=" webix_template",this.attachEvent("onAfterRender",this.Av)},setValues:function(t,i){this.data=i?P.extend(this.data,t,!0):t,this.render()},getValues:function(){return this.data},$skin:function(){this.Iv.header.height=Xi.barHeight-2*Xi.borderWidth,this.Iv.section.height=Xi.barHeight},Iv:{header:{css:"webix_header"},section:{css:"webix_section",borderless:!0},clean:{css:"webix_clean",borderless:!0}},onClick_setter:function(t){return this.on_click=P.extend(this.on_click||{},t,!0),this.Uu||P.extend(this,Ps),t},defaults:{template:At.empty},Tv:function(){this.Fv=!1,this.zv(),this.resize()},zv:function(){this.Fv||(this.Fv=!0,this.render())},src_setter:function(t){return this.Fv=!0,this.callEvent("onBeforeLoad",[])?(wt(t,C(function(t){this.Z.template=At(t),this.Tv(),this.callEvent("onAfterLoad",[])},this)),t):""},Av:function(){this.Z.autoheight&&(this.Cs=null,this.resize()),this.Z.scroll&&-1!=this.Z.scroll.indexOf("x")&&(this.mt.style.width=this.mt.scrollWidth+"px")},content_setter:function(t){t&&(this.Fv=!0,this.render=function(){},this.mt.appendChild(D(t)),$(this.Av,this))},refresh:function(){this.render()},setHTML:function(t){this.Z.template=function(){return t},this.refresh()},setContent:function(t){this.mt.innerHTML="",this.content_setter(t)},$setSize:function(t,i){if(Li.api.$setSize.call(this,t,i)){if(this.zv(),this.Z.autoheight){var s=this.getTopParentView();clearTimeout(s.Vv),s.Vv=$(this.resize,this)}return!0}},$getSize:function(t,i){return!this.Z.autoheight||this.Z.type&&"clean"!=this.Z.type||(this.Z.height=this.Bv()),Li.api.$getSize.call(this,t,i)},Bv:function(){var t,i=Xi.layoutPadding.space;return this.zv(),this.isVisible()?(this.mt.style.height="auto",t=this.mt.scrollHeight,this.mt.style.height=""):t=nt(this.Ot(this.data)||this.mt.innerHTML,"webix_template",(this.$width||(this.getParentView()?this.getParentView().$width:0))-i).height,t},kc:!0},Fn={api:Tn,view:P.protoUI(Tn,Us,Yi,li,di,w,Li.view)},zn={name:"scrollview",defaults:{scroll:"y",scrollSpeed:"0ms"},$init:function(){this.et.className+=" webix_scrollview"},body_setter:function(t){t.borderless=!0,(M._=this).q=zt.rt(t),this.mt.appendChild(this.q.et)},getChildViews:function(){return[this.q]},getBody:function(){return this.q},resizeChildren:function(){this.q&&(this.Pd=this.q.$getSize(0,0),this.Hv(),A("onResize",[]))},Hv:function(){var t=Math.max(this.$s,this.Pd[0]),i=Math.max(this.Is,this.Pd[2]);if(this.q.$setSize(t,i),this.mt.style.width=this.q.$s+"px",this.mt.style.height=this.q.Is+"px",S.touch){var s=this.getScrollState(),e=this.q.Is-this.Is
  ;e<s.y&&this.scrollTo(null,e)}M.o&&(M.o=!1,this.Pd=this.q.$getSize(0,0),this.Hv())},$getSize:function(t,i){var s=this.Pd=this.q.$getSize(0,0),e=Li.api.$getSize.call(this,t,i),n=this.Rv||S.scrollSize;return"x"==this.Z.scroll?(e[2]=Math.max(e[2],s[2])+n,e[3]=Math.min(e[3],s[3])+n):"y"==this.Z.scroll&&(e[0]=Math.max(e[0],s[0])+n,e[1]=Math.min(e[1],s[1])+n),e},$setSize:function(t,i){var s=S.scrollSize;S.scrollSize=this.Rv||s,(Li.api.$setSize.call(this,t,i)||M.fi)&&this.Hv(),S.scrollSize=s},scroll_setter:function(t){var i=S.$customScroll;return"string"==typeof t&&0===t.indexOf("native-")&&(this.Rv=17,t=t.replace("native-"),S.$customScroll=!1),t=Us.scroll_setter.call(this,t),S.$customScroll=i,t},it:function(t){this.q.destructor(),this.q=t,this.En.appendChild(this.q.et),this.resize()},showView:function(t){var i=Pt(t).$view.offsetTop-Pt(t).$view.parentNode.offsetTop;this.scrollTo(0,i)}},Vn=(P.protoUI(zn,Us,w,Li.view),P.protoUI({name:"iframe",$init:function(){this.mt=this.Zi,this.Zi.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.Zi.getElementsByTagName("iframe")[0]},getWindow:function(){return this.getIframe().contentWindow}},Li.view,w),{name:"accordion",defaults:{panelClass:"accordionitem",multi:!1,collapsed:!1},$init:function(){this.et.setAttribute("role","tablist"),this.et.setAttribute("aria-multiselectable","true")},it:function(t){$n.api.it.apply(this,arguments),t.collapsed_setter&&t.refresh&&t.refresh()},kd:function(){for(var t=this.Z.panelClass,i=this.Id,s=0;s<i.length;s++)!i[s].body&&!i[s].header||i[s].view||i[s].align||(i[s].view=t),j(i[s].collapsed)&&(i[s].collapsed=this.Z.collapsed);this.Pv=!0,$n.api.kd.call(this),this.Pv=!1;for(var e=0;e<this.ji.length;e++)this.ji[e].name==t&&this.ji[e].refresh(),this.ji[e].jv=!1;for(var n=!1,h=this.ji.length-1;0<=h&&!n;h--)this.ji[h].Z.hidden||(n=this.ji[h].jv=!0)},Ev:function(t){if(!1===this.Z.multi&&!0!==this.Pv)for(var i=0;i<this.ji.length;i++)t!=this.ji[i]&&!this.ji[i].Z.collapsed&&this.ji[i].collapse&&this.ji[i].collapse();t.callEvent&&(t.callEvent("onViewShow",[]),xi(t,this.zd))},Nv:function(t){if(!0===this.Z.multi||this.Pv)return!0;for(var i=0;i<this.ji.length;i++)if(t!=this.ji[i]&&!this.ji[i].Z.collapsed&&this.ji[i].isVisible()&&!this.ji[i].$nospace)return!0;return!1},$skin:function(){var t=this.defaults;Xi.accordionType&&(t.type=Xi.accordionType)}}),Bn={api:Vn,view:P.protoUI(Vn,$n.view)},Hn=(P.protoUI({name:"headerlayout",defaults:{type:"accordion",multi:"mixed",collapsed:!1}},Bn.view),{name:"accordionitem",$init:function(t){this.et.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.Zi=this.et,this.Mn=this.Zi.childNodes[0],t.header||(this.Mn.style.display="none"),this.Lv=this.Zi.childNodes[0].childNodes[1],this.Ov=this.Zi.childNodes[0].childNodes[0],this.En=this.Zi.childNodes[1],this.et.className+=" webix_accordionitem",this.Nn=this.q=null,this.ji=!0,this.En.setAttribute("role","tabpanel"),this.Mn.setAttribute("role","tab"),this.attachEvent("onKeyPress",this.zs)},st:function(){this.body_setter()},it:function(t){this.q.destructor(),this.q=t,this.En.appendChild(this.q.et),this.resize()},na:"webix_ai_id",getChildViews:function(){return[this.q]},body_setter:function(t){return"object"!=k(t)&&(t={template:t}),t.K={top:!0,left:!0,right:!0,bottom:!0},(M._=this).q=zt.rt(t),this.En.appendChild(this.q.et),t},header_setter:function(t){return t&&(t=At(t)),t},headerAlt_setter:function(t){return t&&(t=At(t)),t},$getSize:function(t,i){var s=this.q.$getSize(0,0),e=this.Z.K;e&&(t+=(e.left?0:1)+(e.right?0:1),i+=(e.top?0:1)+(e.bottom?0:1));var n=0,h=ji.api.$getSize.call(this,0,0);h[0]=(h[0]||s[0])+t,
  1e5<=h[1]&&(h[1]=s[1]),h[1]+=t,h[2]=(h[2]||s[2])+i;var r=h[3]<1e5;return r||(h[3]=s[3]),h[3]+=i,this.getParentView().Dd?this.Z.collapsed?h[2]=h[3]=this.Uv()+i:this.Z.header&&(n=this.Z.headerHeight):(this.Z.collapsed&&(h[0]=h[1]=this.Uv()+t),this.Z.header&&(n=this.Z.headerHeight)),r||(h[2]+=n,h[3]+=n),h},on_click:{webix_accordionitem_header:function(t){return this.Yv(t),!1},webix_accordionitem_header_v:function(t){return this.Yv(t),!1}},Yv:function(){this.define("collapsed",!this.Z.collapsed)},collapsed_setter:function(t){if(!1!==this.Z.header){var i=this.getParentView();if(i){if(t)if(i.Nv(this))this.Wv();else{var s=0;if(1<i.ji.length)for(var e=0;e<i.ji.length;e++){var n=i.ji[e];if(this!=n&&n.isVisible()&&n.expand){n.expand(),this.Wv(),s=1;break}}if(!s)return}else this.Gv();(this.Z.collapsed=t)||i.Ev(this),this.refresh(),M.w||this.resize(),i.callEvent("onAfter"+(t?"Collapse":"Expand"),[this.Z.id]),this.Z.$noresize=t}return t}},collapse:function(){this.define("collapsed",!0),Ii.ki(this)},expand:function(){this.define("collapsed",!1)},Ts:function(){this.show()},Ni:function(){this.hide()},Gv:function(){this.En.style.display="",et(this.$view,"collapsed"),et(this.Mn,"collapsed"),this.Mn.setAttribute("aria-expanded","true")},Wv:function(){this.Z.headerAlt&&(this.Lv.innerHTML=this.Z.headerAlt()),this.En.style.display="none",st(this.$view,"collapsed"),st(this.Mn,"collapsed"),this.Mn.setAttribute("aria-expanded","false")},refresh:function(){var t=this.Z[this.Z.collapsed?"headerAlt":"header"]||this.Z.header;t&&(this.Lv.innerHTML=t(),this.Ov.setAttribute("aria-label",t()));var i=this.getParentView().Dd?"vertical":"horizontal";this.et.className.indexOf(" "+i)<0&&st(this.et,i),S.transform||st(this.et,"webix_ie",!0)},Uv:function(){return this.Z.collapsed?this.Z.headerAltHeight:this.Z.headerHeight},$setSize:function(t,i){if(Li.api.$setSize.call(this,t,i)||this.Uv()!=this.Xv){t=this.$s,i=this.Is;var s=this.Xv=this.Uv();if(this.Z.header)if(this.Mn.style.height=s+"px",this.Mn.style.width="auto",this.Mn.style[S.transform]="",this.Mn.style.borderBottomWidth=(this.Z.collapsed?0:1)+"px",this.getParentView().Dd||!this.Z.collapsed)i-=this.Uv();else if(this.Z.collapsed)if(Gi.isSupported()){this.Mn.style.width=i+"px",this.Mn.style.height=t+3+"px";var e=Math.floor(i/2-t/2)+(t-this.Z.headerAltHeight)/2;this.Mn.style[S.transform]="rotate(90deg) translate("+e+"px, "+(e+1)+"px)"}else this.Mn.style.width=t+"px",this.Mn.style.height=i+3+"px";this.Z.collapsed||(this.q.$setSize(t,i),this.Jv=i)}else if(!this.Z.collapsed){var n=this.q;this.Jv&&n.$setSize(this.$s,this.Jv)}},$skin:function(){var t=this.defaults;t.headerAltHeight=t.headerHeight=Xi.barHeight-2*Xi.borderWidth},defaults:{header:!1,headerAlt:!1,body:""}}),Rn=(P.protoUI(Hn,Ps,w,Li.view),{name:"resizearea",defaults:{dir:"x"},$init:function(t){var i=t.dir||"x",s=D(t.container),e="x"==i?"width":"height",n=t.margin?t.margin+"px":0;this.Zv="x"==i?"left":"top",this.et=Y("DIV",{"class":"webix_resize_area webix_dir_"+i}),Nt(this.et,S.mouse.down,tt),n&&(n="x"==i?n+" 0 "+n:"0 "+n+" 0 "+n),this.qv=Y("DIV",{"class":"webix_resize_handle_"+i,style:n?"padding:"+n:""},"<div class='webix_handle_content'></div>"),this.Kv=Y("DIV",{"class":"webix_resize_origin_"+i}),t[e]&&(this.Kv.style[e]=t[e]+(t.border?1:0)+"px",this.qv.style[e]=t[e]+"px"),t.cursor&&(this.qv.style.cursor=this.Kv.style.cursor=this.et.style.cursor=t.cursor),this.Qv=Lt(s,S.mouse.move,this.t_,{bind:this}),this.i_=Lt(document.body,S.mouse.up,this.s_,{bind:this}),this.qv.style[this.Zv]=this.Kv.style[this.Zv]=t.start+"px",s.appendChild(this.et),s.appendChild(this.qv),s.appendChild(this.Kv)},s_:function(){this.callEvent("onResizeEnd",[this.e_]),Ot(this.Qv),Ot(this.i_),G(this.et),G(this.qv),G(this.Kv),this.et=this.qv=this.Kv=null},t_:function(t){var i=K(t);this.e_=("x"==this.Z.dir?i.x:i.y)+this.Z.start-this.Z.eventPos,this.qv.style[this.Zv]=this.e_+"px",this.callEvent("onResize",[this.e_])}}),Pn=(P.protoUI(Rn,w,Ai),{name:"resizer",defaults:{width:7,height:7},$init:function(t){this.getParentView(),this.et.className+=" webix_resizer";var i=this.getParentView(
  ).Qa;Nt(this.et,S.mouse.down,this.n_,{bind:this}),Lt(document.body,S.mouse.up,this.h_,{bind:this});var s=this.r_();this.o_=!1,this.a_=s,this.u_="x"==s?"width":"height","x"==s?t.height=0:t.width=0,0<i?(this.et.className+=" webix_resizer_v"+s,this.et.style.marginRight="-"+i+"px","x"==s?t.width=i:t.height=i,this.$nospace=!0):this.et.className+=" webix_resizer_"+s,this.et.innerHTML="<div class='webix_resizer_content'></div>","y"==s&&0<i&&(this.et.style.marginBottom="-"+(t.height||this.defaults.height)+"px"),this.et.setAttribute("webix_disable_drag","true"),this.et.setAttribute("tabindex","-1"),this.et.setAttribute("aria-grabbed","false")},n_:function(t){var i=this.c_();if(i&&!this.Z.disabled){t=t||Lt,this.o_=!0,this.f_=K(t),this.l_=[],this.et.setAttribute("aria-grabbed","true");for(var s=0;s<2;s++)i[s].$view.setAttribute("aria-dropeffect","move");this.et.setAttribute("aria-dropeffect","move"),this.d_(t,i[0])}},h_:function(){this.o_=!1,this.f_=!1},d_:function(t,i){var s,e,n,h,r;t=t||Lt,s=this.a_,this.getParentView().et.style.position="relative",n=Z(this.et),h=Z(this.getParentView().et),r=n[s]-h[s],e=Z(i.$view)[s]-Z(this.getParentView().$view)[s],this.v_=[s,i,r,e],this.__=new zt.resizearea({container:this.getParentView().et,dir:s,eventPos:this.f_[s],start:r-1,height:this.$height,width:this.$width,border:1,margin:this.getParentView().qa["x"===s?"left":"top"]}),this.__.attachEvent("onResizeEnd",C(this.p_,this)),this.__.attachEvent("onResize",C(this.m_,this)),st(document.body,"webix_noselect",1)},r_:function(){return this.getParentView().Dd?"y":"x"},m_:function(){var t,i,s,e,n,h,r,o,a,u;if(this.v_)for(t=this.c_(),n=this.v_[0],e=this.__.e_-this.v_[2],a=this.b_(t,n,e),u=t[0]["$"+this.u_]+t[1]["$"+this.u_],r="y"==n?["minHeight","maxHeight"]:["minWidth","maxWidth"],h=0;h<2;h++){s=h?-e:e;var c=(i=t[h].Z)[r[0]],f=i[r[1]];if(0<s&&f&&f<=a[h]||s<0&&(c||3)>=a[h])return this.l_[h]=0<s?f:c||3,o=this.g_(t,n),void(this.__.qv.style["y"==n?"top":"left"]=this.v_[3]+o[0]+"px");a[h]<3?this.__.qv.style["y"==n?"top":"left"]=this.v_[3]+h*u+1+"px":this.l_[h]=null}},c_:function(){var t,i,s;for(t=this.getParentView().ji,i=0;i<t.length;i++)if(t[i]==this)return(s=[this.w_(t,i,1,-1),this.w_(t,i,1,1)])[0]&&s[1]||(s=null),s},w_:function(t,i,s,e){var n=t[i+e*s];return n&&n.Z.hidden?this.w_(t,i,s+1,e):n&&n.Z.$noresize?null:n},p_:function(t){if(void 0!==t){var i,s,e,n,h=this.getParentView().Dd;if(this.x_=null,this.v_){if(s=this.v_[0],e=t-this.v_[2],(i=this.c_())[0]&&i[1]){n=this.y_(i,s,e);for(var r=0;r<2;r++){var o=i[r].$getSize(0,0);if(h?o[2]==o[3]:Math.abs(o[1]-o[0])<3)i[r].Z[this.u_]=n[r],i[r].Hd&&i[r].Hd(this.u_,n[r],h);else{var a=i[r].$view[h?"offsetHeight":"offsetWidth"];i[r].Z.gravity=n[r]/a*i[r].Z.gravity}}i[0].resize();for(var u=0;u<2;u++)i[u].callEvent&&i[u].callEvent("onViewResize",[]),i[u].$view.removeAttribute("aria-dropeffect");A("onLayoutResize",[i])}this.v_=!1}this.v_=!1,this.o_=!1,this.l_=null,et(document.body,"webix_noselect"),this.et.setAttribute("aria-grabbed","false"),this.et.removeAttribute("aria-dropeffect")}},g_:function(t){var i,s,e;return e=t[0]["$"+this.u_]+t[1]["$"+this.u_],this.l_[0]?s=e-(i=this.l_[0]):this.l_[1]&&(i=e-(s=this.l_[1])),[i,s]},b_:function(t,i,s){for(var e=[],n="height"==this.u_?"offsetHeight":"offsetWidth",h=0;h<2;h++)e[h]=t[h].$view[n]+(h?-1:1)*s;return e},y_:function(t,i,s){var e,n,h;if(this.l_[0]||this.l_[1])n=this.g_(t,i);else for(n=this.b_(t,i,s),e=0;e<2;e++)n[e]<0&&(h=n[0]+n[1],n[e]=1,n[1-e]=h-1);return n}}),jn=(P.protoUI(Pn,Ps,Ti,Li.view),{name:"align",defaults:{borderless:!0,left:0,top:0,right:0,bottom:0},$init:function(){this.et.className+=" webix_view_align"},getChildViews:function(){return[this.q]},body_setter:function(t){return t.K={top:!1,left:!1,right:!1,bottom:!1},(M._=this).q=zt.rt(t),this.et.appendChild(this.q.et),t},align_setter:function(t){"string"==typeof t&&(t=t.split(",")),this.M_=this.S_=this.k_="";for(var i=0;i<t.length;i++){var s=t[i];"center"!==s&&"left"!==s&&"right"!==s||(this.M_=s),"top"!==s&&"bottom"!==s&&"middle"!==s||(this.S_=s),"absolute"===s&&(this.M_=this.S_=this.k_="precise")}return t
  },getBody:function(){return this.q},$setSize:function(t,i){var s,e;Li.api.$setSize.call(this,t,i),e=this.k_?(s=t-this.Z.left-this.Z.right,i-this.Z.top-this.Z.bottom):(s=this.Pd[0]||t,this.Pd[2]||i),this.q.$setSize(s,e);var n=this.q.et;"center"==this.M_?n.style.marginLeft=Math.ceil((t-s)/2)+"px":"right"==this.M_?n.style.marginLeft=t-s+"px":n.style.marginLeft=(this.k_?this.Z.left:0)+"px","middle"==this.S_?n.style.marginTop=Math.ceil((i-e)/2)+"px":"bottom"==this.S_?n.style.marginTop=i-e+"px":n.style.marginTop=(this.k_?this.Z.top:0)+"px"},$getSize:function(t,i){var s=this.Pd=this.q.$getSize(0,0),e=ji.api.$getSize.call(this,0,0);return this.k_&&(t+=this.Z.left+this.Z.right,i+=this.Z.top+this.Z.bottom),!this.M_||this.k_?(e[0]=s[0]+t,e[1]=s[1]+t):(e[0]=(e[0]||s[0])+i,e[1]+=t),!this.S_||this.k_?(e[2]=s[2]+i,e[3]=s[3]+i):(e[2]=(e[2]||s[2])+i,e[3]+=i),e}}),En=(P.protoUI(jn,Li.view),{name:"multiview",defaults:{animate:{}},setValue:function(t){Pt(t).show()},getValue:function(){return this.getActiveId()},$init:function(){this.fc=0,this.Dd=1,this.et.style.position="relative",this.et.className+=" webix_multiview",this.C_=[]},D_:function(t,i){var s=Pt(t);s.I_||(s.A_=[],s.I_={}),s.I_[i]||(s.I_[i]=!0,s.A_.push(i))},T_:function(t){var i=Pt(t);if(this.Z.keepViews&&(i.et.style.display=""),this.C_[this.C_.length-2]!=t?(10==this.C_.length&&this.C_.splice(0,1),this.C_.push(t)):this.C_.splice(this.C_.length-1,1),i.I_){for(var s=0;s<i.A_.length;s++){var e=Pt(i.A_[s]);e&&e.render()}i.A_=[],i.I_={}}},addView:function(t,i){var s=!j(i)&&i<=this.fc?1:0,e=Sn.api.addView.apply(this,arguments);return 1<this.ji.length&&(this.Z.keepViews?Pt(e).et.style.display="none":G(Pt(e).et),this.fc+=s),e},it:function(t){if(!t.Z.borderless){var i=f(this.Z.K);t.Z.K=i;var s=t.et.style;s.borderTopWidth=s.borderBottomWidth=s.borderLeftWidth=s.borderRightWidth="1px",this.Bd(s,i)}Sn.api.it.apply(this,arguments)},Ad:function(t){if(t==this.fc){var i=t?t-1:1;this.ji[i]&&(this.F_=!1,this.Ts(this.ji[i],!1))}t<this.fc&&this.fc--},Ni:function(){},kd:function(t){t=t||this.Id;for(var i=0;i<t.length;i++)t[i].K=this.Z.borderless?{top:1,left:1,right:1,bottom:1}:this.Z.K||{};Sn.api.kd.call(this,t);for(var s=1;s<this.ji.length;s++)this.Z.keepViews?this.ji[s].et.style.display="none":G(this.ji[s].et);for(var e=0;e<t.length;e++){var n=this.ji[e];n.ji&&!n.Qd||(this.Bd(n.et.style,n.Z.K),n.et.setAttribute("role","tabpanel"))}this.T_(this.getActiveId())},cells_setter:function(t){t&&t.length,this.Id=t},z_:function(t,i){var s=(this.Z.animate||{}).direction,e="top"==s||"bottom"==s;return t<i?e?"bottom":"right":e?"top":"left"},Ts:function(t,i){var s=this.getParentView();if(s&&s.getTabbar&&s.getTabbar().setValue(t.Z.$id||t.Z.id),this.F_)return $(this.Ts,this,[t,i],100);for(var e=-1,n=0;n<this.ji.length;n++)if(this.ji[n]==t){e=n;break}if(!(e<0||e==this.fc)){var h=this.ji[this.fc],r=this.ji[e];if(h.$getSize(0,0),(i||void 0===i)&&Gi.isSupported()&&this.Z.animate){var o=P.extend({},this.Z.animate);this.Z.keepViews&&(o.keepViews=!0),o.direction=this.z_(e,this.fc),o=Ai.Ui(i||{},o);var a=Gi.formLine(r.et,h.et,o);r.$getSize(0,0),r.$setSize(this.$s,this.Is);var u=o.callback;o.callback=function(){Gi.breakLine(a,this.Z.keepViews),this.F_=!1,u&&u.call(this),u=o.master=o.callback=null,this.resize()},(o.master=this).fc=e,this.T_(this.getActiveId()),Gi(a,o),this.F_=!0}else this.Z.keepViews?h.et.style.display="none":(G(h.et),this.et.appendChild(this.ji[n].et)),this.fc=e,this.resizeChildren(),this.T_(this.getActiveId());r.callEvent&&(r.callEvent("onViewShow",[]),xi(r,this.zd)),this.callEvent("onViewChange",[h.Z.id,r.Z.id])}},$getSize:function(t,i){if(!this.ji.length)return ji.api.$getSize.call(this,0,0);var s=this.ji[this.fc].$getSize(0,0);if(this.Z.fitBiggest)for(var e=0;e<this.ji.length;e++)if(e!=this.fc)for(var n=this.ji[e].$getSize(0,0),h=0;h<4;h++)s[h]=Math.max(s[h],n[h]);var r=ji.api.$getSize.call(this,0,0);return 1e5<=r[1]&&(r[1]=0),1e5<=r[3]&&(r[3]=0),r[0]=(r[0]||s[0])+t,r[1]=(r[1]||s[1])+t,r[2]=(r[2]||s[2])+i,r[3]=(r[3]||s[3])+i,r},$setSize:function(t,i){this.ji.length&&(this.Cd=[t,i],ji.api.$setSize.call(
  this,t,i),this.ji[this.fc].$setSize(t,i))},isVisible:function(t,i){return i&&i!=this.getActiveId()?(t&&this.D_(i,t),!1):Li.api.isVisible.call(this,t,this.Z.id)},getActiveId:function(){return this.ji.length?this.ji[this.fc].Z.id:null},back:function(t){if(t=t||1,this.callEvent("onBeforeBack",[this.getActiveId(),t])){if(this.C_.length>t){var i=this.C_[this.C_.length-t-1];return Pt(i).show(),i}return null}return null},Td:function(t,i){!this.Z.keepViews&&i&&i!=this.ji[this.fc]||Sn.api.Td.call(this,t,i)}}),Nn=(P.protoUI(En,Sn.view),{name:"tabview",setValue:function(t){this.ji[0].setValue(t)},getValue:function(){return this.ji[0].getValue()},getTabbar:function(){return this.ji[0]},getMultiview:function(){return this.ji[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.V_);var i=t.cells,s=[];i&&i.length;for(var e=i.length-1;0<=e;e--){var n=i[e].body||i[e];n.id||(n.id="view"+z()),s[e]={value:i[e].header,id:n.id,close:i[e].close,width:i[e].width,hidden:!!i[e].hidden},i[e]=n}var h={view:"tabbar",multiview:!0},r={view:"multiview",cells:i,animate:!!t.animate};t.value&&(h.value=t.value),t.tabbar&&P.extend(h,t.tabbar,!0),t.multiview&&P.extend(r,t.multiview,!0),h.options=h.options||s,t.rows=[h,r],delete t.cells,delete t.tabs},V_:function(){this.getTabbar().attachEvent("onOptionRemove",function(t){var i=Pt(t);if(i){var s=i.getParentView();s&&s.removeView(i)}})}}),Ln=(P.protoUI(Nn,$n.view),{name:"carousel",defaults:{scrollSpeed:"300ms",type:"clean",navigation:{},animate:!0},$init:function(){this.et.className+=" webix_carousel",this.B_=null,this.mt=null,this.fc=0,this.$ready.unshift(this.H_),this.$ready.push(this.vr)},addView:function(t,i){var s=this.B_.addView(t,i);return this.R_(),s},removeView:function(t){this.B_.removeView(t),this.R_()},it:function(t,i){this.B_.it(t,i),this.R_()},R_:function(){this.ji=this.B_.ji,this.ec(),this.setActiveIndex(Math.min(this.fc,this.ji.length-1))},H_:function(){this.B_&&this.B_.destructor&&this.B_.destructor();var t="";this.config.cols?(t="cols",this.Dd=0):(t="rows",this.Dd=1);var i={borderless:!0,type:"clean"};i[t]=m(this.Z[t]);for(var s=["type","margin","marginX","marginY","padding","paddingX","paddingY"],e={},n=0;n<s.length;n++)this.Z[s[n]]&&(e[s[n]]=this.Z[s[n]]);P.extend(i,e,!0),(M._=this).B_=zt.rt(i),this.et.appendChild(this.B_.et),this.ji=this.B_.ji,this.B_.Ts=C(Ln.Ts,this),this.B_.adjustScroll=C(Ln.adjustScroll,this),T("onReconstruct",C(function(t){t==this.B_&&this.P_()},this)),this.Zi=this.et.firstChild},zs:function(t,i){this.Z.navigation.items&&"tab"===i.target.getAttribute("role")&&this.tc(t,i),ji.api.zs.call(this,t,i)},getChildViews:function(){return[this.B_]},getLayout:function(){return this.B_},vr:function(){this.Zi.setAttribute("touch_scroll",this.Dd?"y":"x"),this.B_.attachEvent("onAfterScroll",C(function(){this.callEvent("onShow",[this.getActiveId()])},this)),xi(this.B_,function(t){t.et.setAttribute("role","tabpanel")})},adjustScroll:function(t){var i,s=this.Dd?this.Is:this.$s;return this.Dd?(i=Math.round(t.f/s),t.f=i*s):(i=Math.round(t.e/s),t.e=i*s),this.fc=-i,this.Z.navigation&&this.nc(),!0},Ts:function(t){var i,s,e,n,h,r;for(e=-1,s=this.B_,i=0;i<s.ji.length;i++)if(s.ji[i]==t){e=i;break}e<0||e==this.fc||(this.fc=e,n=s.Dd?this.Is:this.$s,h=-(s.Dd?0:e*n),r=-(s.Dd?e*n:0),this.scrollTo(h,r),this.callEvent("onShow",[s.ji[this.fc].Z.id]),this.Z.navigation&&this.ec())},scrollTo:function(t,i){Ki&&Gi.isSupported()&&this.Z.animate?Ki.Ce(this.Zi,t,i,this.Z.scrollSpeed||"100ms"):(this.Zi.style.marginLeft=t+"px",this.Zi.style.marginTop=i+"px")},navigation_setter:function(t){return this.Ui(t,{type:"corner",buttons:!0,items:!0}),t},showNext:function(){this.fc<this.B_.ji.length-1&&this.setActiveIndex(this.fc+1)},showPrev:function(){0<this.fc&&this.setActiveIndex(this.fc-1)},setActiveIndex:function(t){this.B_.ji.length,Pt(this.B_.ji[t].Z.id).show()},getActiveIndex:function(){
  return this.fc},$getSize:function(t,i){var s=this.B_.$getSize(0,0),e=Li.api.$getSize.call(this,t,i);return this.B_.Dd?(e[0]=Math.max(e[0],s[0]),e[1]=Math.min(e[1],s[1])):(e[2]=Math.max(e[2],s[2]),e[3]=Math.min(e[3],s[3])),e},$setSize:function(t,i){var s=this.B_,e=s.ji.length,n=Li.api.$setSize.call(this,t,i),h=this.Is*(s.Dd?e:1),r=this.$s*(s.Dd?1:e);n?(this.Zi.style.height=h+"px",this.Zi.style.width=r+"px",s.$setSize(r,h),this.P_()):s.$setSize(r,h)},P_:function(){var t=this.B_,i=this.fc||0,s=t.Dd?this.Is:this.$s,e=-(t.Dd?0:i*s),n=-(t.Dd?i*s:0);this.scrollTo(e,n),this.Z.navigation&&this.ec()},getActiveId:function(){var t=this.B_.ji[this.fc];return t?t.Z.id:null},setActive:function(t){Pt(t).show()}}),On=(P.protoUI(Ln,w,js,Li.view),{name:"proxy",body_setter:function(t){return(M._=this).q=zt.rt(t),this.et.appendChild(this.q.et),t},getChildViews:function(){return[this.q]},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),this.q.$setSize(this.$width,this.$height)},$getSize:function(t,i){var s=Li.api.$getSize.call(this,t,i),e=this.q.$getSize(t,i);return e[0]=Math.max(s[0],e[0]),e[1]=Math.min(s[1],e[1]),e[2]=Math.max(s[2],e[2]),e[3]=Math.min(s[3],e[3]),e[4]=Math.max(s[4],e[4]),e},it:function(t){this.q.destructor(),this.q=t,this.et.appendChild(t.et),this.resize()}}),Un=(P.protoUI(On,Li.view),{name:"portlet",defaults:{layoutType:"wide",icon:"wxi-drag"},$init:function(t){this.et.style.position="relative",t.header&&t.body&&(t.body=[{template:t.header,type:"header"},t.body]),this.$ready.push(this.j_),T("onAfterPortletMove",this.E_)},E_:function(t){xi(t,function(t){t.N_&&t.N_()})},j_:function(){var t=this.getChildViews();if(1<t.length)is.addDrag(t[0].$view,this);else if(this.Z.icon){var i=Y("div",{"class":"portlet_drag"},"<span class='webix_icon "+this.Z.icon+"'></span>");this.et.appendChild(i),is.addDrag(i,this)}else is.addDrag(this.$view,this)},body_setter:function(t){return this.rows_setter(g(t)?t:[t])},markDropArea:function(t,i){if(!t)return G(this.L_);t=Pt(t),this.L_||(this.L_=Y("div",null,"&nbsp;")),t.$view.appendChild(this.L_),this.L_.className="portlet_marker"+i},movePortlet:function(t,i){var s=t.getParentView(),e=this.getParentView(),n=s.index(t),h=e.index(this);if(A("onBeforePortletMove",[e,s,this,t,i])){M.l=!0;var r=e!=s?1:0,o=s.Dd;"top"==i||"bottom"==i?(1!==o&&(zt(t,s=zt({type:t.Z.layoutType,rows:[]},s,n+r),0),n=0,r=1),"bottom"==i&&(r+=1)):"left"!=i&&"right"!=i||(0!==o&&(zt(t,s=zt({type:t.Z.layoutType,cols:[]},s,n+r),0),n=0,r=1),"right"==i&&(r+=1)),h<n&&(r-=1),zt(this,s,n+r),"replace"==i&&zt(t,e,h),this.O_(e),M.l=!1,t.resize(),e.resize(),A("onAfterPortletMove",[e,s,this,t,i])}},O_:function(t){for(var i,s=0;t.getChildViews().length<=s;)t=(i=t).getParentView(),s=1;s&&t.removeView(i)},$drag:function(t){return st(this.et,"portlet_in_drag"),is["in"]={source:t,from:t},this.et.innerHTML},$dragDestroy:function(t,i){et(this.et,"portlet_in_drag"),G(i),this.U_&&(this.movePortlet(this.U_,this.Y_),this.markDropArea(),this.U_=null)},tn:function(){return Z(this.$view)},$dragPos:function(t,i,s){s.style.left="-10000px";var e=S.mouse.context(i),n=document.body.scrollTop||document.documentElement.scrollTop||0,h=document.body.scrollLeft||document.documentElement.scrollLeft||0,r=document.elementFromPoint(e.x-h,e.y-n),o=null;r&&(o=Pt(r)),this.U_=this.W_(o),this.Y_=this.G_(this.U_,i),t.x=t.x-this.$s+10,t.y=t.y-20,is._n=!0},G_:function(t,i){var s="",e="";if(i&&t){var n=Z(t.$view),h=K(i),r=h.x-n.x-n.width/2,o=h.y-n.y-n.height/2;(e=t.Z.mode)||(e=Math.abs(r)*(n.height/n.width)>Math.abs(o)?"cols":"rows"),"cols"==e?s=0<=r?"right":"left":"rows"==e&&(s=0<=o?"bottom":"top"),this.markDropArea(t,s)}return this.markDropArea(t,s),s||e},W_:function(t){for(;t;){if(t.movePortlet)return t;t=t.getParentView()}}}),Yn=(P.protoUI(Un,$n.view),{name:"abslayout",$init:function(){this.$view.className+=" webix_abslayout",delete this.rows_setter,delete this.cols_setter,this.Id=[]},cells_setter:function(t){this.Id=t},kd:function(){Sn.api.kd.call(this,this.Id)},$getSize:function(){for(var t=ji.api.$getSize.call(this,0,0),i=null,s=0;s<this.ji.length;s++
  )this.ji[s].Z.relative&&(i=this.ji[s].$getSize(0,0));return i&&(1e5<=t[1]&&(t[1]=0),1e5<=t[3]&&(t[3]=0),t[0]=Math.max(t[0],i[0]),t[1]=Math.max(t[1],i[1]),t[2]=Math.max(t[2],i[2]),t[3]=Math.max(t[3],i[3])),t},$setSize:function(t,i){this.Cd=[t,i],ji.api.$setSize.call(this,t,i),this.Ka(t,i)},Ka:function(t,i){for(var s=0;s<this.ji.length;s++){var e=this.ji[s],n=e.Z,h=e.$getSize(0,0);n.relative?(n.left=n.top=0,e.$setSize(t,i)):e.$setSize(h[0],h[2]);for(var r=e.$view,o=["left","right","top","bottom"],a=0;a<o.length;a++){var u=o[a];u in n&&(r.style[u]=n[u]+"px")}}}}),Wn={api:Yn,view:P.protoUI(Yn,Sn.view)},Gn={name:"gridlayout",defaults:{autoplace:!0,gridColumns:2,gridRows:2,margin:10,padding:10},gridRows_setter:function(t){return this.X_=t},kd:function(){for(var t=0;t<this.Id.length;t++)this.Id[t].K={};Sn.api.kd.call(this,this.Id)},removeView:function(t){Wn.api.removeView.call(this,t),this.J_(),this.callEvent("onChange",[])},Z_:function(t){if(t.dx=t.dx||1,t.dy=t.dy||1,j(t.y)||j(t.x)){for(var i=this.q_(),s=0;s<this.X_;s++)for(var e=0;e<this.Z.gridColumns;e++)if(!i[e][s]&&this.K_(i,e,s,e+t.dx,s+t.dy))return t.x=e,void(t.y=s);t.x=0,t.y=this.X_}var n=t.x+t.dx-this.Z.gridColumns;0<n&&(t.dx-=n)},it:function(t){this.Z_(t.config),this.ji.push(t),this.$view.appendChild(t.et),this.Q_(t.config,t.config.id),this.J_(!0),this.tp||this.callEvent("onChange",[])},K_:function(t,i,s,e,n){for(var h=i;h<e;h++)for(var r=s;r<n;r++)if(!t[h]||t[h][r])return!1;return!0},ip:function(t,i,s){for(var e=0;e<i.dx;e++)for(var n=0;n<i.dy;n++)t[e+i.x][n+i.y]=s},sp:function(t,i,s){for(var e=this.Z.gridColumns,n=i.x+i.dx;n+s.dx<=e;n++)if(this.K_(t,n,s.y,n+s.dx,s.y+s.dy))return n-s.x;return 0},ep:function(t,i,s){for(var e=i.x-s.dx;0<=e;e--)if(this.K_(t,e,s.y,e+s.dx,s.y+s.dy))return s.x-e;return 0},np:function(t,i,s){for(var e=i.y-s.dy;0<=e;e--)if(this.K_(t,s.x,e,s.x+s.dx,e+s.dy))return s.y-e;return 0},q_:function(t){for(var i=[],s=0;s<this.Z.gridColumns;s++)i[s]=[];for(var e=0;e<this.ji.length;e++){var n=this.ji[e].config;n.id===t||n.hidden||this.ip(i,n,n.id)}return i},J_:function(t){(this.hp()||t)&&this.rp()},hp:function(){if(!this.Z.autoplace)return!1;var t=this.Z.gridColumns,i=this.X_,s=this.q_(),e=!1;t:for(var n=i-1;0<=n;n--){for(var h=t-1;0<=h;h--)if(s[h][n])continue t;e=!0;for(var r=0;r<this.ji.length;r++){var o=this.ji[r].config;!o.hidden&&o.y>=n&&(o.y-=1)}}return e},Q_:function(t,i){if(t.x-=Math.max(0,t.x+t.dx-this.Z.gridColumns),this.Z.autoplace){for(var s=[],e=this.q_(i),n=0;n<this.ji.length;n++){var h=this.ji[n].config;h.id===i||h.hidden||h.y<t.y+t.dy&&h.y+h.dy>t.y&&h.x<t.x+t.dx&&h.x+h.dx>t.x&&s.push(h)}for(var r=[],o=0;o<s.length;o++){var a=s[o];this.ip(e,a,0);var u=this.sp(e,t,a);if(u)a.x+=u;else{var c=this.ep(e,t,a);if(c)a.x-=c;else{var f=this.np(e,t,a);f?a.y-=f:(a.y=t.y+t.dy,r.push(a))}}this.ip(e,a,a.id)}for(var l=0;l<r.length;l++)this.Q_(r[l],r[l].id)}else t.y-=Math.max(0,t.y+t.dy-this.Z.gridRows)},rp:function(){for(var t=this.Z.gridRows,i=0;i<this.ji.length;i++){var s=this.ji[i].config;s.hidden||(t=Math.max(t,s.y+s.dy))}this.X_!=t&&(this.X_=t,this.resize()),this.Ka()},moveView:function(t,i){i=P.extend(Pt(t).config,i,!0),this.Q_(i,t),this.J_(!0),this.callEvent("onChange",[])},serialize:function(t){for(var i=[],s=0;s<this.ji.length;s++)if(t)i.push(t.call(this,this.ji[s]));else{var e=this.ji[s].config;i.push({id:e.id,name:e.name,x:e.x,y:e.y,dx:e.dx,dy:e.dy})}return i},clearAll:function(){for(var t=0;t<this.ji.length;t++)this.ji[t].destructor();this.ji=[],this.callEvent("onChange",[])},restore:function(t,i){i=i||this.Z.factory,t=m(t),this.tp=!0;for(var s={},e=0;e<t.length;e++){var n=t[e],h=Pt(n.id);s[h?(P.extend(h.config,n,!0),h.config.id):(h=i.call(this,n),this.addView(h))]=1}for(var r=this.ji.length-1;0<=r;r--)s[this.ji[r].config.id]||(this.ji[r].destructor(),this.ji.splice(r,1));this.rp(),this.tp=!1},$getSize:function(){for(var t=ji.api.$getSize.call(this,0,0),i=0;i<this.ji.length;i++)this.ji[i].$getSize(0,0);var s=this.Z.cellWidth,e=this.Z.cellHeight,n=this.op(0,0,this.Z.gridColumns,this.X_);return s&&(t[0]=n.dx+2*n.x),e&&(t[2]=n.dy+2*n.y),t},
  op:function(t,i,s,e){var n=this.Z.margin,h=this.Z.paddingX||this.Z.padding,r=this.Z.paddingY||this.Z.padding,o=this.Z.cellWidth;o||(o=(this.$width-2*h+n)/this.Z.gridColumns-n);var a=this.Z.cellHeight;return a||(a=(this.$height-2*r+n)/this.X_-n),{x:h+(o+n)*t,y:r+(a+n)*i,dx:Math.ceil(o+(o+n)*(s-1)),dy:Math.ceil(a+(a+n)*(e-1))}},Ka:function(){for(var t=0;t<this.ji.length;t++){var i=this.ji[t],s=i.Z,e=this.op(s.x,s.y,s.dx,s.dy);i.$getSize(0,0),i.$setSize(e.dx,e.dy);var n=i.$view;n.style.left=e.x+"px",n.style.top=e.y+"px"}}},Xn={api:Gn,view:P.protoUI(Gn,Wn.view)},Jn={name:"dashboard",$init:function(){is.addDrag(this.$view,this),is.addDrop(this.$view,this,!0)},ap:function(t){return!(!t.getAttribute||t.getAttribute("webix_disable_drag")||t.getAttribute("webixignore"))&&(-1!=(t.className||"").toString().indexOf("panel_drag")?t:!(!t.parentNode||t==this.$view)&&this.ap(t.parentNode))},$dragCreate:function(t,i){if(i.target){if(!this.ap(i.target))return!1;var s=Pt(i);s.$resizeMove||(s=s.queryView(function(t){return!!t.config.dx},"parent"));var e=Z(this.$view),n=K(i),h=is["in"]={source:s,from:this,dashboard:{sx:n.x-e.x-parseInt(s.$view.style.left)+this.Z.margin/2,sy:n.y-e.y-parseInt(s.$view.style.top)+this.Z.margin/2}};return this.callEvent("onBeforeDrag",[h,i])?(this.cp(s.Z.dx,s.Z.dy),s.$view):void 0}},cp:function(t,i){var s=this.fp=Y("div",{"class":"panel_target"}),e=this.op(0,0,t,i);s.style.width=e.dx+"px",s.style.height=e.dy+"px",this.$view.appendChild(this.fp)},$drop:function(t,i,s){var e=is["in"],n={x:e.dashboard.x,y:e.dashboard.y};if(this.callEvent("onBeforeDrop",[e,s])){if(e.from===this){var h=e.source.config;this.moveView(h.id,n)}else{if(!(e.from&&e.from.callEvent&&e.from.callEvent("onBeforeDropOut",[e,s])))return;n.name=e.source[0],n.dx=e.dashboard.dx,n.dy=e.dashboard.dy,n.id=n.name+":"+z(),(n=this.Z.factory.call(this,n))&&this.addView(n)}this.callEvent("onAfterDrop",[e,s])}},$dragDestroy:function(t,i){i.style.zIndex=1,G(this.fp),this.fp=null,this.rp()},lp:function(t,i){var s=this.Z.margin,e=this.Z.paddingX||this.Z.padding,n=this.Z.paddingY||this.Z.padding,h=this.Z.cellWidth;h||(h=(this.$width-2*e+s)/this.Z.gridColumns-s);var r=this.Z.cellHeight;return r||(r=(this.$height-2*n+s)/this.X_-s),t=Math.round((t-e)/(h+s/2)-.2),i=Math.round((i-e)/(r+s/2)-.2),{x:t=Math.max(0,Math.min(t,this.Z.gridColumns)),y:i=Math.max(0,Math.min(i,this.X_)),width:h,height:r,margin:s,rx:t*h+s*t+e,ry:i*r+s*i+n}},$dragOut:function(t,i,s,e){var n=is["in"];this.callEvent("onDragOut",[n,e]),this.fp&&n.external&&(G(this.fp),this.fp=null)},$dragIn:function(t,i,s){var e=is["in"];if(this.callEvent("onBeforeDragIn",[e,s])){if(!this.fp){if(!e.from||!e.from.getItem)return!1;if(!this.Z.factory)return!1;e.external=!0;var n=e.from.getItem(e.source);e.dashboard={dx:n.dx,dy:n.dy},this.cp(n.dx,n.dy)}if(e.external){var h=this.fp,r=S.mouse.context(s),o=Z(this.$view),a=this.lp(r.x-o.x,r.y-o.y);P.extend(e.dashboard,a,!0),h.style.left=a.rx+"px",h.style.top=a.ry+"px"}return!0}},$dragPos:function(t,i,s){var e=is["in"];s.style.left="-10000px";var n=S.mouse.context(i),h=Z(this.$view),r=e.dashboard,o=this.lp(n.x-h.x-r.sx,n.y-h.y-r.sy);t.x=n.x-r.sx-h.x,t.y=n.y-r.sy-h.y;var a=this.fp;a.style.left=o.rx+"px",a.style.top=o.ry+"px",P.extend(r,o,!0)}},Zn=(P.protoUI(Jn,Xn.view),{name:"panel",$init:function(t){if(t.header&&t.body){var i=t.header;"object"!==k(i)&&(i={template:t.header,type:"header",css:"webix_header"}),t.body=[i,t.body]}st(this.$view,"panel_drag_view"),this.$ready.push(this.j_)},j_:function(){var t=this.getChildViews(),i=1===t.length?this:t[1];if(this.Z.icon){var s=Y("div",{"class":"panel_icon"},"<span class='webix_icon "+this.Z.icon+" panel_icon_span'></span>");i!=this&&(i.$view.style.position="relative"),i.$view.appendChild(s)}},body_setter:function(t){return this.rows_setter(g(t)?t:[t])},$resizeEnd:function(t){var i=this.getParentView();if(i&&i.lp){var s=i.lp(t.x,t.y),e=Math.max(s.x,1),n=Math.max(s.y,1);i.moveView(this.Z.id,{dx:e,dy:n})}},$resizeMove:function(t){var i=this.getParentView();if(i&&i.lp){var s=i.lp(t.x,t.y);t.x=s.width*s.x+s.margin*(s.x-1),
  t.y=s.height*s.y+s.margin*(s.y-1)}}}),qn=(P.protoUI(Zn,$n.view,ns),{$init:function(){P.extend(this,Is,!0)},name:"flexlayout"}),Kn=(P.protoUI(qn,$n.view),{name:"datalayout",$init:function(){this.data.provideApi(this,!0),this.data.attachEvent("onStoreUpdated",C(this.render,this))},kd:function(){return this.vp||(this.vp=this.Id,this.Id=[{}]),$n.api.kd.call(this,this.Id)},setValue:function(t){this.parse(t)},getValue:function(){for(var t=this.vp.length,i=0;i<this.ji.length;i++){var s=this.data.order[Math.floor(i/t)],e=this.data.getItem(s);this._p(this.ji[i],e)}return this.data.serialize()},_p:function(t,i){var s=t.Z.name;if(s){var e=null;t.getValues?e=t.getValues():t.getValue?e=t.getValue():t.serialize&&(e=t.serialize()),"$value"==s?P.extend(i,e,!0):i[s]=e}else{var n=t.ji;if(n)for(var h=0;h<n.length;h++)this._p(n[h],i)}},pp:function(t,i){var s,e=t.Z.name;if(e)s="$value"==e?i:i[e],t.setValues?t.setValues(s):t.setValue?t.setValue(s):t.parse&&(t.openAll&&(s=m(s)),t.parse(s));else{var n=t.ji;if(n)for(var h=0;h<n.length;h++)this.pp(n[h],i)}},render:function(t,i,s){var e=this.vp.length;if(t&&"update"===s)for(var n=this.getItem(t),h=this.getIndexById(t),r=0;r<e;r++)this.pp(this.ji[h*e+r],n);else{for(var o=this.Id=[],a=this.data.order,u=0;u<a.length;u++)if(e)for(var c=0;c<e;c++)o.push(m(this.vp[c]));else o.push(this.getItem(a[u]));if(o.length||o.push({}),this.reconstruct(),e)for(var f=0;f<a.length;f++)for(var l=this.getItem(a[f]),d=0;d<e;d++){var v=this.ji[f*e+d];this.pp(v,l)}}}}),Qn={api:Kn,view:P.protoUI(Kn,ws,$n.view)},th={$init:function(){P.extend(this,Is,!0)},name:"flexdatalayout"},ih=(P.protoUI(th,Qn.view),{name:"popup",$init:function(){var i=this;this.Z.head=!1,this.$view.className+=" webix_popup",T("onClick",function(t){return i.Ni(t)}),this.attachEvent("onHide",this.Yn)},$skin:function(){this.defaults.headHeight=Xi.barHeight,this.defaults.padding=Xi.popupPadding,this.defaults.point=!Xi.popupNoPoint,this.defaults.borderless=Xi.borderlessPopup},close:function(){G(this.mp),rs.api.close.call(this)},$getSize:function(t,i){return rs.api.$getSize.call(this,t+2*this.Z.padding,i+2*this.Z.padding)},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),t=this.$s-2*this.Z.padding,i=this.Is-2*this.Z.padding,this.Zi.style.padding=this.Z.padding+"px",this.Mn.style.display="none",this.q.$setSize(t,i)},Qn:function(t){"undefined"==typeof t.borderless&&(t.borderless=!1)},head_setter:function(){},Un:function(t,i,s,e){this.Yn(),document.body.appendChild(this.mp=Y("DIV",{"class":"webix_point_"+t},"")),this.mp.style.zIndex=yi(),this.mp.style.position=e?"fixed":"absolute",this.mp.style.top=s+"px",this.mp.style.left=i+"px"},Yn:function(){this.mp=G(this.mp)}}),sh={api:ih,view:P.protoUI(ih,rs.view)},eh={name:"toolbar",defaults:{type:"toolbar"},Qd:!0,bp:"webix_toolbar",gp:!1,$init:function(t){t.borderless||(this.Zi.style.borderWidth="1px",this.Z.K={top:!1,left:!1,right:!1,bottom:!1}),this.Zi.className+=" "+this.bp,this.et.setAttribute("role","toolbar")},ps:function(){var i=this;i.elements={},xi(this,function(t){if(t.Z.name&&t.getValue&&t.setValue&&(i.elements[t.Z.name]=t).mapEvent&&t.mapEvent({onbeforetabclick:i,onaftertabclick:i,onitemclick:i,onchange:i}),t.setValues)return!1});var t=this.Kf;if(this.setDirty(!1),t){var s=this.Kf;for(var e in i.elements)t[e]&&s[e]!=t[e]&&(s[e]=t[e],this.setDirty(!0))}},Vd:function(){this.ps()},Zd:function(t){var i=this.Z;return i.elements&&!t&&(this.Id=t=i.elements,this.Dd=this.gp,delete i.elements),this.Z.elementsConfig&&this.wp(this.Id,i.elementsConfig),t},wp:function(t,i){for(var s=0;s<t.length;s++){var e=t[s];P.extend(e,i);var n,h=i;e.elementsConfig&&(h=P.extend(P.extend({},e.elementsConfig),i)),(n=e.body?[e.body]:e.rows||e.cols||e.cells||e.body)&&this.wp(n,h)}},$getSize:function(t,i){var s=$n.api.$getSize.call(this,t,i),e=this.getParentView(),n=this.Dd?3:1;return e&&this.Dd!=e.Dd&&(s[n]+=1e5),s},render:function(){},refresh:function(){this.render()}},nh={api:eh,view:P.protoUI(eh,Us,li,xe,$n.view,_s)},hh={name:"form",defaults:{type:"form",autoheight:!0},xp:-1,bp:"webix_form",gp:!0,$init:function(){
  this.et.setAttribute("role","form")},$getSize:function(t,i){this.Ds&&!this.Z.width&&(t+=S.scrollSize);var s=$n.api.$getSize.call(this,t,i);return!this.Z.scroll&&this.Z.autoheight||(s[2]=this.Z.height||this.Z.minHeight||0,s[3]=this.Z.height||1e5),s}},rh=(P.protoUI(hh,nh.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.et.className+=" "+i,this.et.innerHTML="<fieldset><legend class='"+i+"_label"+(t.required?" webix_required":"")+"'></legend><div class='"+i+"_body'></div></fieldset>"},label_setter:function(t){return this.et.firstChild.childNodes[0].innerHTML=t},getChildViews:function(){return[this.yp]},body_setter:function(t){return(M._=this).yp=zt(t,this.et.firstChild.childNodes[1]),t},getBody:function(){return this.yp},resizeChildren:function(){if(this.yp){var t=this.$width-this.Z.paddingX,i=this.$height-this.Z.paddingY,s=this.yp.$getSize(0,0);s[0]>t&&(t=s[0]),s[2]>i&&(i=s[2]),this.yp.$setSize(t,i),this.resize()}},$getSize:function(t,i){t+=this.Z.paddingX,i+=this.Z.paddingY;var s=this.yp.$getSize(t,i),e=this.Mp=Li.api.$getSize.call(this,t,i);return e[0]<s[0]&&(e[0]=s[0]),e[2]<s[2]&&(e[2]=s[2]),e[1]>s[1]&&(e[1]=s[1]),e[3]>s[3]&&(e[3]=s[3]),e[1]<e[0]&&(e[1]=e[0]),e[3]<e[2]&&(e[3]=e[2]),e},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(t=Math.min(this.Mp[1],t),i=Math.min(this.Mp[3],i),this.yp.$setSize(t-this.Z.paddingX,i-this.Z.paddingY))}}),oh={api:rh,view:P.protoUI(rh,Li.view)},ah={name:"forminput",defaults:{$cssName:"webix_forminput",labelWidth:80,labelAlign:"left",paddingY:0,paddingX:0},setValue:function(t){this.yp.setValue?this.yp.setValue(t):this.yp.setValues&&this.yp.setValues(t)},focus:function(){return!!this.yp.focus&&this.yp.focus()},getValue:function(){return this.yp.getValue?this.yp.getValue():this.yp.getValues?this.yp.getValues():void 0},getBody:function(){return this.yp},$skin:function(){this.Sp=Xi.inputPadding,this.kp=Xi.inputSpacing,this.Cp=Xi.labelTopHeight||15},$init:function(t){if(this.$ready.push(function(){var t=this.et.firstChild.childNodes[0];if(!this.Z.label||!this.Z.labelWidth)return t.style.display="none",void(this.Z.paddingX=this.Z.paddingY=0);"top"==this.Z.labelPosition?(t.style.lineHeight=this.Cp-this.Sp+"px",t.className+=" "+this.defaults.$cssName+"_label_top"):t.style.width=this.Z.paddingX+"px",t.style.textAlign=this.Z.labelAlign,this.Z.value&&this.setValue(this.Z.value)}),"top"!=t.labelPosition){var i=j(t.labelWidth)?this.defaults.labelWidth:t.labelWidth;t.paddingX=i-2*this.Sp+2*this.kp}else t.paddingY=this.Cp},setBottomText:function(t){var i=this.Z;if(void 0!==t){if(i.bottomLabel==t)return;i.bottomLabel=t}var s=(i.invalid?i.invalidMessage:"")||i.bottomLabel;this.$p&&G(this.$p),s&&(this.$view.style.position="relative",this.$p=Y("div",{"class":"webix_inp_bottom_label",role:i.invalid?"alert":"","aria-relevant":"all",style:"position:absolute; bottom:0px; padding:2px; background: white; left:"+this.Z.labelWidth+"px; "},s),this.et.appendChild(this.$p))}};P.protoUI(ah,oh.view);function uh(t){return t.tagName?t.tagName.toLowerCase():null}function ch(t,i){if(!t.getAttribute)return null;var s=t.getAttribute(i);return s?s.toLowerCase():null}function fh(){var t=uh(this);return lh[t]?lh[t](this):lh.other(this)}var lh={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"===ch(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 dh(t){var i=uh(this);return vh[i]?vh[i](this,t):vh.other(this,t)}var vh={radio:function(t,i){for(var s=0;s<t.length;s++)t[s].checked=t[s].value==i},input:function(t,i){"checkbox"===ch(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}},_h={name:"htmlform",$init:function(t){this.elements={},this.Dp=!1,t.content&&(
  t.container==t.content||!t.container&&t.content==document.body)&&(this.Ip=!0)},content_setter:function(t){if(t=D(t),this.Ip)for(;1<t.childNodes.length;)this.et.childNodes[0].appendChild(t.childNodes[0]);else this.et.childNodes[0].appendChild(t);return this.Ap(),!0},render:function(){Fn.api.render.apply(this,arguments),this.Ap()},Ap:function(){var t=this.et.querySelectorAll("[name]");this.elements={};for(var i=0;i<t.length;i++){var s=t[i],e=ch(s,"name");if(e){var n="button"===uh(s),h=ch(s,"type"),r=n||"button"===h||"submit"===h;if("radio"===h){var o=this.elements[e]||[];o.tagName="radio",o.push(s),s=o}(this.elements[e]=s).getValue=fh,s.setValue=dh,s.$allowsClear=!r}}return this.elements},lr:function(t,i){this.ur(t,i);var s=this.et.querySelector('[name="'+t+'"]');s&&st(s,"invalid")},ur:function(t){var i=this.et.querySelector('[name="'+t+'"]');i&&et(i,"invalid")},focus:function(t){if(!t&&this.$view.contains(document.activeElement))return!1;xe.focus.apply(this,arguments)}},ph=(P.protoUI(_h,Fn.view,xe),{name:"property",$init:function(){this.Zi.className+=" webix_property",this.Zi.setAttribute("role","listbox"),this.ht=[],this.attachEvent("onAfterEditStart",function(t){st(this.getItemNode(t),"webix_focused")}),this.attachEvent("onAfterEditStop",function(t,i){et(this.getItemNode(i.config.id),"webix_focused")})},defaults:{nameWidth:100,editable:!0},on_render:{checkbox:function(t){return"<input type='checkbox' class='webix_property_check' "+(t?"checked":"")+">"},color:function(t){return'<div class="webix_property_col_val"><div class=\'webix_property_col_ind\' style="background-color:'+(t||"#FFFFFF")+';"></div><span>'+t+"</span></div>"}},on_edit:{label:!1},na:"webix_f_id",on_click:{webix_property_check:function(t){var i=this.locate(t);return this.getItem(i).value=!this.getItem(i).value,this.callEvent("onCheck",[i,this.getItem(i).value]),!1}},on_dblclick:{},registerType:function(t,i){if(i.template&&(this.on_render[t]=i.template),i.editor&&(this.on_edit[t]=i.editor),i.click)for(var s in i.click)this.on_click[s]=i.click[s]},elements_setter:function(t){this.Tp={};for(var i=0;i<t.length;i++){var s=t[i];"multiselect"==s.type&&(s.optionslist=!0),s.id=s.id||z(),s.label=s.label||"",s.value=s.value||"",this.Tp[s.id]=i,this.Bu(t[i])}return t},showItem:function(t){Os.showItem.call(this,t)},locate:function(){return J(arguments[0],this.na)},getItemNode:function(t){return this.mt.childNodes[this.Tp[t]]},getItem:function(t){return this.Z.elements[this.Tp[t]]},Fa:function(t){var i=this.getItem(t).type;if("checkbox"==i)return"inline-checkbox";var s=this.on_edit[i];return!1!==s&&(s||i)},Ha:function(t){return this.getItem(t)},Ya:function(t,i,s){var e=this.Tp[t.id],n=this.Z.elements;if(s){for(var h=e+1;h<n.length;h++)if(i.call(this,n[h].id))return n[h].id}else for(var r=e-1;0<=r;r--)if(i.call(this,n[r].id))return n[r].id;return null},updateItem:function(t,i){i=i||{};var s=this.getItem(t);s&&P.extend(s,i,!0),this.refresh()},qt:function(t){var i=this.getItemNode(t);return{left:i.offsetLeft+this.Z.nameWidth,top:i.offsetTop,height:i.firstChild.offsetHeight,width:this.Fp,parent:this.Zi}},zp:function(){for(var t=this.Z.elements,i=0;i<t.length;i++)t[i].value=""},clear:function(){this.zp(),this.Vp={},this.refresh()},setValues:function(t,i){var s=this;for(var e in this.Z.complexData&&(t=xt.collapseNames(t,"",{},function(t){return j(s.Tp[t])})),i||this.zp(),t){var n=this.getItem(e);n&&(n.value=t[e])}this.Vp=t,this.refresh()},getValues:function(){for(var t=f(this.Vp||{}),i=0;i<this.Z.elements.length;i++){var s=this.Z.elements[i];"label"!=s.type&&(t[s.id]=s.value)}return this.Z.complexData&&(t=xt.expandNames(t)),t},refresh:function(){this.render()},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(this.Fp=this.$s-this.Z.nameWidth,this.render())},$getSize:function(t,i){if(this.Z.autoheight){var s=this.Z.elements.length;this.Z.height=Math.max(this.type.height*s,this.Z.minHeight||0)}return Li.api.$getSize.call(this,t,i)},Ot:function(){var t=[],i=this.Z.elements;if(i)for(var s=0;s<i.length;s++){var e=i[s];e.css&&"object"==k(e.css)&&(e.css=L(e.css))
  ;var n='<div webix_f_id="'+e.id+'"'+("label"!==e.type?'role="option" tabindex="0"':"")+' class="webix_property_line '+(e.css||"")+'">';if("label"==e.type)t[s]=n+"<div class='webix_property_label_line'>"+e.label+"</div></div>";else{var h,r=this.on_render[e.type],o="<div class='webix_property_label' style='width:"+this.Z.nameWidth+"px'>"+e.label+"</div><div class='webix_property_value' style='width:"+this.Fp+"px'>";h=e.collection||e.options?e.template(e):e.format?e.format(e.value):e.value,r&&(h=r.call(this,e.value,e)),t[s]=n+o+h+"</div></div>"}}return t.join("")},type:{height:24,templateStart:At(""),templateEnd:At("</div>")},$skin:function(){this.type.height=Xi.propertyItemHeight}}),mh=(P.protoUI(ph,Yi,Ds,Rs,Ps,Us,Oi,li,w,Li.view),{name:"calendar",defaults:{date:new Date,select:!1,navigation:!0,monthSelect:!0,weekHeader:!0,monthHeader:!0,weekNumber:!1,skipEmptyWeeks:!1,calendarHeader:"%F %Y",events:tn.isHoliday,minuteStep:5,timeIcon:"wxi-clock",icons:!1,timepickerHeight:30,headerHeight:70,dayTemplate:function(t){return t.getDate()},width:260,height:250},dayTemplate_setter:At,calendarHeader_setter:tn.dateToStr,calendarTime_setter:function(t){return this.Bp=t,tn.dateToStr(t)},date_setter:function(t){return this.vv(t)},maxDate_setter:function(t){return this.vv(t)},minDate_setter:function(t){return this.vv(t)},minTime_setter:function(t){return"string"==typeof t&&(t=[(t=ct.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},maxTime_setter:function(t){return"string"==typeof t&&(t=[(t=ct.parseTimeFormatDate(t)).getHours(),t.getMinutes()]),t},Hp:function(){var t="focus"+(S.isIE?"in":"");S.touch||Nt(this.$view,t,C(function(t){var i=t.target.className,s=-1!==i.indexOf("webix_cal_day")?"webix_cal_day":-1!==i.indexOf("webix_cal_block")?"webix_cal_block":"";if(300<new Date-Ii.di&&100<new Date-Ii.vi&&s){var e=t.relatedTarget;if(e&&!j(e.className)){var n="webix_cal_day"==s?this.Rp(t.target):this.Pp(t.target);this.fu(n)}}},this),{capture:!S.isIE})},$init:function(){this.et.className+=" webix_calendar",this.et.setAttribute("role","region"),this.et.setAttribute("aria-label",ct.aria.calendar),this.jp={},this.Ep={},this.nv=0,this.Hp(),this.attachEvent("onKeyPress",this.zs),this.attachEvent("onAfterZoom",function(t){0<=t&&this.$view.querySelector(".webix_cal_month_name").blur()})},minuteStep_setter:function(t){return Math.max(Math.min(t,60),this.defaults.minuteStep)},type_setter:function(t){return"time"==t?(this.Np=!0,this.nv=-1):"year"==t&&(this.Lp=!0),t},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},$getSize:function(t,i){if(this.Z.cellHeight){var s=this.Op(this.Z.date);this.Z.height=this.Z.cellHeight*s.Up+(Xi.calendarHeight||70)}return Li.api.$getSize.call(this,t,i)},moveSelection:function(t,i,s){if(!this.config.master){var e=this.getSelectedDate();this.config.multiselect&&(e=e[0]);var n=tn.copy(e||this.getVisibleDate());this.fu(n,t,s)}},fu:function(t,i,s){var e=this.kv[this.nv].Yp(t,i,this);if(!1!==s){var n=this.et.querySelector("."+e+"[tabindex='0']");n&&n.focus()}},Op:function(t,i){if(!this.Wp||i){var s=t.getMonth(),e=t.getFullYear(),n=new Date(e,s+1,1),h=tn.weekStart(new Date(e,s,1)),r=Math.round((n.valueOf()-h.valueOf())/864e5),o=this.Z.skipEmptyWeeks?Math.ceil(r/7):6;this.Wp={Gp:s,Xp:h,Xd:n,Up:o}}return this.Wp},$skin:function(){Xi.calendar&&(Xi.calendar.width&&(this.defaults.width=Xi.calendar.width),Xi.calendar.height&&(this.defaults.height=Xi.calendar.height),Xi.calendar.headerHeight&&(this.defaults.headerHeight=Xi.calendar.headerHeight),Xi.calendar.timepickerHeight&&(this.defaults.timepickerHeight=Xi.calendar.timepickerHeight))},Jp:function(t){for(var i=this.Op(t),s=this.Z,e=[],n=[],h=Infinity,r=this.$s-36,o=this.Is-this.Z.headerHeight-10-(this.Z.timepicker||this._v?this.Z.timepickerHeight:0),a=s.weekNumber?8:7,u=0;u<a;u++)n[u]=Math.ceil(r/(a-u)),r-=n[u],h=Math.min(h,n[u]);for(var c=i.Up,f=0;f<c;f++)e[f]=Math.ceil(o/(c-f)),o-=e[f],h=Math.min(h,e[f]);return[n,e,h]},icons_setter:function(t){t?"object"==k(t)?this._v=t:this._v=this.Zp:this._v=null},_v:[],Zp:[{template:function(){
  return"<span role='button' tabindex='0' class='webix_cal_icon_today webix_cal_icon'>"+ct.calendar.today+"</span>"},on_click:{webix_cal_icon_today:function(){var t=new Date;this.Z.timepicker||(t=tn.datePart(t)),this.setValue(t),this.callEvent("onTodaySet",[this.getSelectedDate()])}}},{template:function(){return"<span role='button' tabindex='0' class='webix_cal_icon_clear webix_cal_icon'>"+ct.calendar.clear+"</span>"},on_click:{webix_cal_icon_clear:function(){this.setValue(""),this.callEvent("onDateClear",[this.getSelectedDate()])}}}],refresh:function(){this.render()},render:function(){this.nv=0,this.qp=!1;var t=this.Z;if(this.isVisible(t.id)){this.Kp=tn.datePart(new Date),this.callEvent("onBeforeRender",[]);var i=this.Z.date,s=this.Op(i,!0),e=this.Jp(i),n=e[0],h=e[1],r="";if(t.monthHeader&&(r+="<div class='webix_cal_month'><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&&(r+="<div role='button' tabindex='0' aria-label='"+ct.aria.navMonth[0]+"' class='webix_cal_prev_button'></div><div role='button' tabindex='0' aria-label='"+ct.aria.navMonth[1]+"' class='webix_cal_next_button'></div>"),r+="</div>"),t.weekHeader&&(r+="<div class='webix_cal_header' aria-hidden='true'>"+this.Qp(n)+"</div>"),r+="<div class='webix_cal_body'>"+this.tm(n,h,s,e[2])+"</div>",(this.Z.timepicker||this._v)&&(r+="<div class='webix_cal_footer'>",this.Z.timepicker&&(r+=this.im(i)),this._v&&(r+=this.pv()),r+="</div>"),this.Zi.innerHTML=r,"time"==this.Z.type){var o=this.Z.date;o&&("string"==typeof o?i=ct.parseTimeFormatDate(o):g(o)&&(i.setHours(o[0]),i.setMinutes(o[1]))),this.sm(-1,i)}else"month"==this.Z.type?this.sm(1,i):"year"==this.Z.type&&this.sm(2,i);this.callEvent("onAfterRender",[])}},pv:function(t){for(var i="<div class='webix_cal_icons'>",s=this._v,e=0;e<s.length;e++){if(s[e].template){var n="function"==typeof s[e].template?s[e].template:n(s[e].template);i+=n.call(this,t)}s[e].on_click&&P.extend(this.on_click,s[e].on_click)}return i+="</div>"},im:function(t){var i=this.Z.calendarTime||ct.timeFormatStr,s=this.Z.timeIcon,e="";if(this.Z.master){var n=m(Pt(this.Z.master).Z.value);for(var h in tn.equal(n.end,t)&&(n.start=n.end),n)e+="<div role='button' tabindex='0' class='webix_range_time_"+h+" webix_cal_time'><span class='webix_icon "+s+"'></span> "+i(n[h])+"</div>"}else e="<div role='button' tabindex='0' class='webix_cal_time"+(this._v?" webix_cal_time_icons":"")+"'><span class='webix_icon "+s+"'></span> "+i(t)+"</div>";return e},Qp:function(t){var i=this.Z,s="",e=0;i.weekNumber&&(e=1,s+="<div class='webix_cal_week_header' style='width: "+t[0]+"px;' >"+(i.calendarWeekHeader||"")+"</div>");for(var n=tn.startOnMonday?1:0,h=0;h<7;h++){var r=(n+h)%7,o=ct.calendar.dayShort[r];s+="<div day='"+r+"' style='width: "+t[h+e]+"px;' >"+o+"</div>"}return s},blockDates_setter:function(t){return b(t,this.$scope)},em:function(t,i){var s="",e=!1;return tn.equal(t,this.Kp)&&(s+=" webix_cal_today"),this.nm(t)||(s+=" webix_cal_day_disabled"),t.getMonth()!=i.Gp&&(e=!0,s+=" webix_cal_outside"),!e&&this.hm(t)&&(s+=" webix_cal_select"),this.Z.events&&(s+=" "+(this.Z.events(t,e)||"")),s+=" webix_cal_day"},tm:function(t,i,s,e){for(var n=this.Z,h="",r=tn.datePart(tn.copy(s.Xp)),o=n.weekNumber?1:0,a=tn.getISOWeek(tn.add(r,2,"day",!0)),u=0;u<i.length;u++){h+="<div class='webix_cal_row' style='height:"+i[u]+"px;line-height:"+i[u]+"px'>",o&&(!r.getMonth()&&r.getDate()<7&&(a=tn.getISOWeek(tn.add(r,2,"day",!0))),h+="<div class='webix_cal_week_num' aria-hidden='true' style='width:"+t[0]+"px'>"+a+"</div>");for(var c=o;c<t.length;c++){var f=this.em(r,s),l=this.Z.dayTemplate.call(this,r),d=this.hm(r),v="",_=r.getMonth()!=s.Gp;"object"==k(l)?(v=l.aria||v,l=l.text):v=tn.dateToStr(ct.aria.dateFormat)(r),h+="<div day='"+c+"' role='gridcell' "+(_?"aria-hidden='true'":"")+" aria-label='"+v+"' tabindex='"+(d&&!_?"0":"-1")+"' aria-selected='"+(d&&!_?"true":"false"
  )+"' class='"+f+"' style='text-align:center; width:"+t[c]+"px'><span aria-hidden='true' class='webix_cal_day_inner' style='display:inline-block; "+this.rm(e,e)+"'>"+l+"</span></div>",(r=tn.add(r,1,"day")).getHours()&&(r=tn.datePart(r))}h+="</div>",a++}return h},$v:function(t,i){var s=this.Z.date;i||(i=this.kv[this.nv].Sv),this.nv||(s=tn.copy(s)).setDate(1);var e=tn.add(s,t*i,"month",!0);this.om(s,e)},om:function(t,i){this.callEvent("onBeforeMonthChange",[t,i])&&(this.nv?this.um(i):this.showCalendar(i),this.callEvent("onAfterMonthChange",[i,t]))},kv:{"-2":{cm:function(t){var i=this.Z,s=i.date,e=!1,n=i.minTime?i.minTime[0]:0,h=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24,r=i.minTime&&s.getHours()==n?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&s.getHours()==h-1?i.maxTime[1]:60;if(this.Z.blockTime){var a=tn.copy(s);a.setMinutes(t),e=this.Z.blockTime(a)}return t<r||o<=t||e},fm:function(t,i){t.setMinutes(i)},lm:function(t,i,s){if(!this.cm.call(s,t.getMinutes()))return t;var e=s.Z.minuteStep,n=tn.add(t,"right"==i?e:-e,"minute",!0);return t.getHours()===n.getHours()?this.lm(n,i,s):void 0}},"-1":{cm:function(t){var i=this.Z,s=i.date,e=i.minTime?i.minTime[0]:0,n=i.maxTime?i.maxTime[0]+(i.maxTime[1]?1:0):24;if(t<e||n<=t)return!0;if(i.blockTime){var h=tn.copy(s);h.setHours(t);for(var r=i.minTime&&t==e?i.minTime[1]:0,o=i.maxTime&&i.maxTime[1]&&t==n-1?i.maxTime[1]:60,a=r;a<o;a+=i.minuteStep)if(h.setMinutes(a),!i.blockTime(h))return!1;return!0}},fm:function(t,i){t.setHours(i)},Yp:function(t,i,s){var e,n,h=s.Z.minuteStep;return"bottom"===i||"top"===i?(t.setHours("bottom"===i?23:0),t.setMinutes("bottom"===i?55:0),t.setSeconds(0),t.setMilliseconds(0),e=t):"left"===i||"right"===i?(n="right"===i?h:-h,"left"===i&&t.getMinutes()<h&&(n=60-h),"right"===i&&t.getMinutes()>=60-h&&(n=h-60),n-=t.getMinutes()%h,e=s.kv[-2].lm(tn.add(t,n,"minute"),i,s)):"up"===i||"down"===i?(n="down"===i?1:-1,"down"===i&&23===t.getHours()&&(n=-23),"up"===i&&0===t.getHours()&&(n=23),e=this.lm(tn.add(t,n,"hour"),i,s)):!1===i&&(e=this.lm(t,i,s)),s.selectDate(e,!1),e&&(s.um(e),s.selectDate(e,!1)),"webix_cal_block"+("left"===i||"right"===i?"_min":"")},lm:function(t,i,s){if(!this.cm.call(s,t.getHours()))return t;var e=tn.add(t,"down"==i?1:-1,"hour",!0);return t.getDate()===e.getDate()?this.lm(e,i,s):void 0}},0:{Sv:1,Yp:function(t,i,s){var e=t;return"pgup"===i||"pgdown"===i?e=tn.add(t,"pgdown"===i?1:-1,"month"):"bottom"===i?e=new Date(t.getFullYear(),t.getMonth()+1,0):"top"===i?e=new Date(t.setDate(1)):"left"===i||"right"===i?e=tn.add(t,"right"===i?1:-1,"day"):"up"!==i&&"down"!==i||(e=tn.add(t,"down"===i?1:-1,"week")),s.nm(e)||(e=s.lm(t,i)),e&&s.selectDate(e,!0),"webix_cal_day"}},1:{cm:function(t,i){var s=!1,e=i.Z.minDate,n=i.Z.maxDate,h=i.Z.date.getFullYear();if(e){var r=e.getFullYear();s=h<r||h==r&&e.getMonth()>t}if(n&&!s){var o=n.getFullYear();s=o<h||h==o&&n.getMonth()<t}return s},yl:function(t,i){return t<i.Z.minDate?t=tn.copy(i.Z.minDate):t>i.Z.maxDate&&(t=tn.copy(i.Z.maxDate)),tn.monthStart(t)},dm:function(t){return t.getFullYear()},vm:function(t){return ct.calendar.monthShort[t]},fm:function(t,i){i!=t.getMonth()&&t.setDate(1),t.setMonth(i)},Sv:12,Yp:function(t,i,s){var e=t;return"pgup"===i||"pgdown"===i?e=tn.add(t,"pgdown"===i?1:-1,"year"):"bottom"===i?e=new Date(t.setMonth(11)):"top"===i?e=new Date(t.setMonth(0)):"left"===i||"right"===i?e=tn.add(t,"right"===i?1:-1,"month"):"up"!==i&&"down"!==i||(e=tn.add(t,"down"===i?4:-4,"month")),s.nm(e)||(e=s.lm(t,i)),e&&(s.um(e),s.selectDate(e,!1)),"webix_cal_block"}},2:{cm:function(t,i){t+=i._m;var s=i.Z.minDate,e=i.Z.maxDate;return!!(s&&s.getFullYear()>t||e&&e.getFullYear()<t)},yl:function(t,i){return t<i.Z.minDate?t=tn.copy(i.Z.minDate):t>i.Z.maxDate&&(t=tn.copy(i.Z.maxDate)),tn.yearStart(t)},dm:function(t,i){var s=t.getFullYear();return i._m=s=s-s%10-1,s+" - "+(s+10+1)},vm:function(t,i){return i._m+t},fm:function(t,i,s){t.setFullYear(s._m+i)},Sv:120,Yp:function(t,i,s){var e=t;return"pgup"===i||"pgdown"===i?e=tn.add(t,"pgdown"===i?10:-10,"year"):"bottom"===i?e=new Date(t.setYear(s._m+10)):"top"===i?e=new Date(t.setYear(s._m)
  ):"left"===i||"right"===i?e=tn.add(t,"right"===i?1:-1,"year"):"up"!==i&&"down"!==i||(e=tn.add(t,"down"===i?4:-4,"year")),s.nm(e)||(e=s.lm(t,i)),e&&(s.um(e),s.selectDate(e,!1)),"webix_cal_block"}}},mm:function(){var t;if(this.kv[-1].cm.call(this,this.Z.date.getHours()))for(t=0;t<24;t++)if(!this.kv[-1].cm.call(this,t)){this.Z.date.setHours(t);break}if(this.kv[-2].cm.call(this,this.Z.date.getMinutes()))for(t=0;t<60;t+=this.Z.minuteStep)if(!this.kv[-2].cm.call(this,t)){this.Z.date.setMinutes(t);break}},um:function(t){var i,s,e,n,h,r,o,a,u,c,f,l,d="";if(h=(i=this.Z).weekHeader?2:1,c=this.kv[this.nv],r=this.Zi.childNodes,t&&(i.date=t),a=i.type,this.qp||(this.bm=this.Zi.offsetHeight-i.headerHeight,"year"!=a&&"month"!=a?this.bm-=i.timepickerHeight:this._v&&(this.bm-=10),this.gm=r[h].offsetWidth,this.qp=1),this.Np){e=this.bm/6;var v=6,_=(this.Bp||ct.timeFormat).match(/%([a,A])/);for(_&&v++,u=parseInt((this.gm-3)/v,10),l=Math.min(u,e),d+="<div class='webix_time_header'>"+this.wm(u,_)+"</div>",d+="<div  class='webix_cal_body' style='height:"+this.bm+"px'>",this.mm(),d+="<div class='webix_hours'>",o=i.date.getHours(),f=tn.copy(i.date),n=0;n<24;n++){if(s="",_&&n%4==0){var p=n?12==n?ct.pm[0]:"":ct.am[0];d+="<div class='webix_cal_block_empty"+s+"' style='"+this.rm(u,e)+"clear:both;'>"+p+"</div>"}this.kv[-1].cm.call(this,n)?s+=" webix_cal_day_disabled":o==n&&(s+=" webix_selected"),f.setHours(n),d+="<div aria-label='"+tn.dateToStr(ct.aria.hourFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block"+s+"' data-value='"+n+"' style='"+this.rm(u,e)+(n%4!=0||_?"":"clear:both;")+"'><span style='display:inline-block; "+this.rm(l,l)+"'>"+tn.toFixed(_?n&&12!=n?n%12:12:n)+"</span></div>"}for(d+="</div>",d+="<div class='webix_minutes'>",o=i.date.getMinutes(),f=tn.copy(i.date),n=0;n<60;n+=i.minuteStep)s="",this.kv[-2].cm.call(this,n)?s=" webix_cal_day_disabled":o==n&&(s=" webix_selected"),f.setMinutes(n),d+="<div aria-label='"+tn.dateToStr(ct.aria.minuteFormat)(f)+"' role='gridcell' tabindex='"+(o==n?"0":"-1")+"' aria-selected='"+(o==n?"true":"false")+"' class='webix_cal_block webix_cal_block_min"+s+"' data-value='"+n+"' style='"+this.rm(u,e)+(n/i.minuteStep%2==0?"clear:both;":"")+"'><span style='display:inline-block; "+this.rm(l,l)+"'>"+tn.toFixed(n)+"</span></div>";d+="</div>",d+="</div>",d+="<div  class='webix_time_footer'>"+this.xm()+"</div>",this.Zi.innerHTML=d}else{var m=r[0].childNodes,b=ct.aria["nav"+(1==this.nv?"Year":"Decade")];for(m[0].innerHTML=c.dm(i.date,this),i.navigation&&(m[1].setAttribute("aria-label",b[0]),m[2].setAttribute("aria-label",b[1])),e=Math.floor(this.bm/3),u=Math.floor(this.gm/4),l=Math.min(e,u),this.nm(i.date)&&(o=1==this.nv?i.date.getMonth():i.date.getFullYear()),n=0;n<12;n++){s=o==(1==this.nv?n:c.vm(n,this))?" webix_selected":"",c.cm(n,this)&&(s+=" webix_cal_day_disabled");var g=ct.aria[(1==this.nv?"month":"year")+"Format"];d+="<div role='gridcell' aria-label='"+tn.dateToStr(g)(i.date)+"' tabindex='"+(-1!==s.indexOf("selected")?"0":"-1")+"' aria-selected='"+(-1!==s.indexOf("selected")?"true":"false")+"' class='webix_cal_block"+s+"' data-value='"+n+"' style='"+this.rm(u,e)+"'><span style='display:inline-block; "+this.rm(l,l)+"'>"+c.vm(n,this)+"</span></div>"}h-1&&(r[h-1].style.display="none"),r[h].innerHTML=d,"year"!=a&&"month"!=a&&(r[h+1]?r[h+1].innerHTML=this.xm():this.Zi.innerHTML+="<div  class='webix_time_footer'>"+this.xm()+"</div>"),r[h].style.height=this.bm+"px"}},rm:function(t,i){return"width:"+t+"px; height:"+i+"px; line-height:"+i+"px;"},xm:function(){return"<input type='button' style='width:100%' class='webix_cal_done' value='"+ct.calendar.done+"'>"},wm:function(t,i){var s=2*t;return"<div class='webix_cal_hours' style='width:"+t*(i?5:4)+"px'>"+ct.calendar.hours+"</div><div class='webix_cal_minutes' style='width:"+s+"px'>"+ct.calendar.minutes+"</div>"},sm:function(t,i){var s=this.nv;this.callEvent("onBeforeZoom",[t,s])&&((this.nv=t)?this.um(i):this.showCalendar(i),this.callEvent("onAfterZoom",[t,s]))},yl:function(t){return!this.nm(t
  )&&this.kv[this.nv].yl&&(t=this.kv[this.nv].yl(t,this)),t},ym:function(t){var i=this.Pp(t),s=this.nv-(this.Lp?0:1);if(i=this.yl(i),this.nm(i)){this.sm(s,i);var e=this.Z.type;"month"!=e&&"year"!=e||this.Mm(i)}},Mm:function(t,i){this.callEvent("onBeforeDateSelect",[t])&&(this.selectDate(t,!0,i),this.callEvent("onDateSelect",[t]),this.callEvent("onAfterDateSelect",[t]))},Rp:function(t){var i=N(t)-(this.Z.weekNumber?1:0),s=N(t.parentNode),e=tn.add(this.Op().Xp,i+7*s,"day",!0);return this.Z.timepicker&&(e.setHours(this.Z.date.getHours()),e.setMinutes(this.Z.date.getMinutes())),e},Pp:function(t){var i=1*t.getAttribute("data-value"),s=-1!=t.className.indexOf("webix_cal_block_min")?this.nv-1:this.nv,e=this.Z.date,n=tn.copy(e);return this.kv[s].fm(n,i,this),n},on_click:{webix_cal_prev_button:function(){this.$v(-1)},webix_cal_next_button:function(){this.$v(1)},webix_cal_day_disabled:function(){return!1},webix_cal_outside:function(){if(!this.Z.navigation)return!1},webix_cal_day:function(t,i,s){var e=this.Rp(s),n="touch"===this.Z.multiselect||t.ctrlKey||t.metaKey;this.Mm(e,n)},webix_cal_time:function(){if(this.kv[this.nv-1]){this.Np=!0;var t=this.nv-1;this.sm(t)}},webix_range_time_start:function(){Pt(this.Z.master).Mv="start"},webix_range_time_end:function(){Pt(this.Z.master).Mv="end"},webix_cal_done:function(){var t=tn.copy(this.Z.date);t=this.yl(t),this.Mm(t)},webix_cal_month_name:function(){if(this.Z.navigation&&(this.Np=!1,2!=this.nv&&this.Z.monthSelect)){var t=Math.max(this.nv,0)+1;this.sm(t)}},webix_cal_block:function(t,i,s){if(this.Np){if(-1!==s.className.indexOf("webix_cal_day_disabled"))return!1;var e=this.Pp(s);this.um(e)}else-1==s.className.indexOf("webix_cal_day_disabled")&&this.ym(s)}},vv:function(t,i){return t?("string"==typeof t&&(t=i?tn.strToDate(i)(t):ct.parseFormatDate(t)),t):tn.datePart(new Date)},nm:function(t){var i=this.Z.blockDates&&this.Z.blockDates.call(this,t),s=this.Z.minDate,e=this.Z.maxDate;return!i&&!(t<s||e<t)},lm:function(t,i){var s,e="top"===i||"left"===i||"pgup"===i||"up"===i?-1:1,n=tn.add(t,e,"day",!0);return this.nm(n)?n:(0===this.nv?s=t.getMonth()===n.getMonth():1===this.nv?s=t.getFullYear()===n.getFullYear():2===this.nv&&(s=n.getFullYear()>this._m&&n.getFullYear()<this._m+10),s?this.lm(n,i):void 0)},showCalendar:function(t){t=this.vv(t),this.Z.date=t,this.render(),this.resize()},hm:function(t){return t&&this.Ep[t.valueOf()]},getSelectedDate:function(){var t=[];for(var i in this.Ep)t.push(tn.copy(this.Ep[i]));return this.config.multiselect?t:t[0]||null},getVisibleDate:function(){return tn.copy(this.Z.date)},setValue:function(t){this.selectDate(t,!0)},getValue:function(t){var i=this.getSelectedDate();return t&&(i=tn.dateToStr(t)(i)),i},selectDate:function(t,i,s){if(t&&s&&this.config.multiselect||(this.Ep={}),t){g(t)||(t=[t]);for(var e=0;e<t.length;e++){var n=this.vv(t[e]),h=tn.datePart(tn.copy(n)).valueOf();if(this.Ep[h]&&s?delete this.Ep[h]:this.Ep[h]=n,!this.config.multiselect)break}t.length&&i&&this.showCalendar(t[0])}!1!==i&&this.render(),this.callEvent("onChange",[t])},locate:function(){return null}}),bh=(P.protoUI(mh,Hs,Ps,Li.view,w),{name:"colorboard",defaults:{template:'<div style="width:100%;height:100%;background-color:{obj.val}"></div>',palette:null,height:220,width:220,cols:12,rows:10,minLightness:.15,maxLightness:1,navigation:!0},$init:function(){Nt(this.et,"click",C(function(t){var i=J(t,"webix_val");i&&(this.setValue(i),this.callEvent("onItemClick",[this.Z.value,t]),this.callEvent("onSelect",[this.Z.value]))},this)),this.$view.setAttribute("role","grid"),this.et.setAttribute("aria-readonly","true")},Mu:function(){this.getValue()||this.moveSelection("up")},Sm:function(t){var i=this.Z.palette;t=(t||"").toUpperCase();for(var s=0,e=i.length;s<e;s++)for(var n=0,h=i[s].length;n<h;n++)if(i[s][n].toUpperCase()==t)return{row:s,col:n};return null},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},getValue:function(){return this.Z.value},Hf:function(){return this.et.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){t=this.$prepareValue(t);var i=this.Z.value;return this.Z.value=t,this.$setValue(t,i),t},km:null,Cm:function(){if(this.km&&this.km.parentNode)return this.km;var t=this.km=document.createElement("div");return t.className="webix_color_selector",this.et.lastChild.appendChild(t),t},$setValue:function(t,i){if(this.isVisible(this.Z.id)){var s,e,n,h,r,o=0,a=0;if(i&&(n=this.Sm(i)),n||(n={row:0,col:0}),this.et.lastChild.childNodes[n.row].childNodes[n.col].setAttribute("tabindex","-1"),(n=this.Sm(t))&&(s=this.et.lastChild.childNodes[n.row].childNodes[n.col]),!(s&&s.parentNode&&s.parentNode.parentNode))return this.km&&(this.km.style.left="-100px"),void this.et.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0");h=s.parentNode,o=s.offsetLeft-h.offsetLeft,a=-(this.$height-(s.offsetTop-h.parentNode.offsetTop)),s.setAttribute("tabindex","0"),s.setAttribute("aria-selected","true"),s.setAttribute("tabindex","0"),s.setAttribute("aria-selected","true"),e=this.Cm(),r=["left:"+o+"px","top:"+a+"px","width:"+s.style.width,"height:"+s.style.height].join(";"),"undefined"!=typeof e.style.cssText?e.style.cssText=r:e.setAttribute("style",r)}},$m:function(t){function e(t){return Ws.toHex(t,2)}function h(t,i,s){return"#"+e(Math.floor(t))+e(Math.floor(i))+e(Math.floor(s))}function i(t,i,s){var e,n,h;if(i){var r=s<.5?s*(1+i):s+i-s*i,o=2*s-r;e=a(o,r,t+1/3),n=a(o,r,t),h=a(o,r,t-1/3)}else e=n=h=s;return{r:255*e,g:255*n,b:255*h}}function a(t,i,s){return s<0&&(s+=1),1<s&&(s-=1),s<1/6?t+6*(i-t)*s:s<=.5?i:s<2/3?t+(i-t)*(2/3-s)*6:t}var s=[],n=t.rows-1,r=1/t.cols,o=(t.maxLightness-t.minLightness)/n,u=null;s.push(function _(t){for(var i=[],s=255,e=s/t,n=0;n<t;n++)s=Math.round(0<s?s:0),i.push(h(s,s,s)),s-=e;return i[i.length-1]="#000000",i}(t.cols));for(var c=0,f=t.minLightness;c<n;c++){u=[];for(var l=0,d=0;l<t.cols;l++){var v=i(d,1,f);u.push(h(v.r,v.g,v.b)),d+=r}s.push(u),f+=o}this.Z.palette=s},moveSelection:function(t,i,s){var e,n,h=this.getValue();if(h&&(e=this.Sm(h)),e||(e={row:0,col:0}),e&&("up"==t||"down"==t?e.row=e.row+("up"==t?-1:1):"right"==t||"left"==t?e.col=e.col+("right"==t?1:-1):"top"==t?e.row=e.col=0:"bottom"==t&&(e.row=this.et.lastChild.querySelectorAll(".webix_color_row").length-1,e.col=this.et.lastChild.childNodes[e.row].childNodes.length-1),e.row=Math.max(e.row,0),0<=e.row&&(n=this.et.lastChild.childNodes[e.row].childNodes[e.col]),n&&(h=n.getAttribute("webix_val"),this.setValue(h),this.callEvent("onSelect",[this.Z.value]),!1!==s))){var r=this.et.querySelector("div[tabindex='0']");r&&r.focus()}},render:function(){if(this.isVisible(this.Z.id)){this.Z.palette||this.$m(this.Z);var t=this.Z.palette;this.callEvent("onBeforeRender",[]);for(var h=At('<div role=\'gridcell\' tabindex=\'-1\' aria-label="{obj.val}" style="width:{obj.width}px;height:{obj.height}px;" webix_val="{obj.val}">'+(this.Z.template||"")+"</div>"),r={width:0,height:0,val:0},i=this.$width,s=this.$height,e=[],n='<div class="webix_color_palette"role="rowgroup">',o="object"==k(t[0])?t[0]:t,a=0;a<o.length;a++)e[a]=Math.floor(i/(o.length-a)),i-=e[a];if("object"==k(t[0]))for(var u=0;u<t.length;u++){var c=Math.floor(s/(t.length-u));s-=c,n+=f(t[u],e,c)}else n+=f(t,e,s);n+="</div>",this.et.innerHTML=n,this.km=null,this.Z.value?this.$setValue(this.Z.value):this.et.lastChild.childNodes[0].childNodes[0].setAttribute("tabindex","0"),this.callEvent("onAfterRender",[])}function f(t,i,s){for(var e='<div class="webix_color_row" role="row">',n=0;n<t.length;n++)r.width=i[n],r.height=s,r.val=t[n],e+=h(r);return e+="</div>"}},refresh:function(){this.render()}}),gh=(P.protoUI(bh,Hs,Li.view,w),{name:"button",touchable:!0,$skin:function(){this.defaults.height=Xi.buttonHeight||Xi.inputHeight,this.Cp=Xi.labelTopHeight||15,this.Dm=Xi.borderWidth},defaults:{template:function(t,i){var s=i.$renderInput(t,i);return(t.badge||0===t.badge)&&(s=s.replace("</button>","<span class='webix_badge'>"+t.badge+"</span></button>")),"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+s+"</div>"
  },label:"",borderless:!0},$renderInput:function(t){return"<button type='button' "+(t.popup?"aria-haspopup='true'":"")+" class='webix_button'>"+(t.label||this.Im(t.value))+"</button>"},$init:function(t){this.et.className+=" webix_control webix_el_"+(this.$cssName||this.name),this.Am(t),this.data=this.Z,this.mt=this.et,this.$ready.push(function(){this.Tm(this.config)})},hotkey_setter:function(t){var s=this;this.Fm(t,function(t,i){s.isVisible()&&(it(s.$view.firstChild,"MouseEvents","click"),Q(i))})},Am:function(t){t.type&&this.zm[t.type]?this.et.className+=" "+this.zm[t.type]:t.css&&this.Vm(t.css)&&(!this.defaults.css||this.Vm(this.defaults.css))||(this.et.className+=" webix_secondary")},Vm: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},zm:{form:"webix_primary",danger:"webix_danger"},Bm:{imageButton:"image",imageButtonTop:"imageTop",iconButton:"icon",iconButtonTop:"iconTop"},Fm:function(t,i,s){var e=Ii.addHotKey(t,i,s);this.attachEvent("onDestruct",function(){Ii.removeHotKey(e,i,s)})},type_setter:function(t){return this.Bm[t]&&(t=this.Bm[t]),this.hv[t]&&(this.$renderInput=At(this.hv[t])),t},Hm:!1,hv:{htmlbutton:"<button type='button' class='webix_button'>#label#</button>",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'><div class='webix_image' style='width:100%;height:100%;background-image:url(#image#);'></div><div class='webix_img_btn_text'>#label#</div></button>",icon:"<button type='button' class='webix_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>"},Rm:function(){for(var t=[],i=["input","select","textarea","button"],s=0;s<i.length;s++)for(var e=this.$view.getElementsByTagName(i[s]),n=0;n<e.length;n++)t.push(e[n]);return t},disable:function(){var t,i,s=this.Hf();if(ji.api.disable.apply(this,arguments),s&&-1==s.className.indexOf(" webix_disabled_box")){s.className+=" webix_disabled_box";var e=this.Rm();for(t=0;t<e.length;t++)e[t].setAttribute("disabled",!0);if((i=this.getInputNode())&&"div"==i.tagName.toLowerCase()&&(this.Pm=i.getAttribute("tabIndex"),i.removeAttribute("tabIndex")),"top"==this.Z.labelPosition){var n=this.mt.firstChild;n&&(n.className+=" webix_disabled_top_label")}}},enable:function(){ji.api.enable.apply(this,arguments);var t,i=this.Hf();if(i){i.className=i.className.replace(" webix_disabled_box","");for(var s=this.Rm(),e=0;e<s.length;e++)s[e].removeAttribute("disabled");if((t=this.getInputNode())&&!j(this.Pm)&&t.setAttribute("tabIndex",this.Pm),"top"==this.Z.labelPosition){var n=this.mt.firstChild;n&&(n.className=n.className.replace(" webix_disabled_top_label",""))}}},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},setValue:function(t){t=this.$prepareValue(t);var i=this.Z.value;if(this.$compareValue(i,t))return this.jm&&t!=this.$getValue()&&this.$setValue(t),!1;this.Z.value=t,this.jm&&this.$setValue(t),this.callEvent("onChange",[t,i])},$compareValue:function(t,i){return"number"==typeof i&&(i=i.toString()),"number"==typeof t&&(t=t.toString()),t==i},$prepareValue:function(t){return this.Im(t,!1)},Im:function(t){return 0===t?"0":(t||"").toString()},$setValue:function(t){var i=this.getInputNode();i&&!this.hv[this.Z.type]&&(t=this.Z.label||t,"BUTTON"==i.tagName?i.innerHTML=t:i.value=t)},getValue:function(){var t=this.jm?this.$getValue():this.Z.value;return void 0===t?"":t},$getValue:function(){return this.Z.value||""},focus:function(){if(!Ii.canFocus(this))return!1;var t=this.getInputNode();t&&t.focus&&t.focus()},blur:function(){var t=this.getInputNode()
  ;t&&t.blur&&t.blur()},getInputNode:function(){return this.mt.getElementsByTagName("input")[0]||this.mt.getElementsByTagName("button")[0]},Hf:function(){for(var t=0;t<this.mt.childNodes.length;t++)if(0<=this.mt.childNodes[t].className.indexOf("webix_el_box"))return this.mt.childNodes[t];return null},Es:function(t,i){var s=i.target||i.srcElement,e=this.Hf();return e&&e.contains(s)?this.Z:null},Em:Math.sqrt(2),Tm:function(t){if((t=t||this.Z).autowidth){var i=nt(t.value||t.label||"","webixbutton").width+(t.badge||0===t.badge?2*nt(t.badge,"webix_badge").width-32:0)+("iconButton"===t.type||"icon"===t.type?24:0)+("imageButton"===t.type||"image"===t.type?t.height-Xi.inputPadding:0);i=Math.max(t.minWidth||0,i),t.width=Math.min(t.maxWidth||Infinity,i)}},Nm:function(){this.Lm=this.Z.inputWidth||(2<this.$s-this.Z.width?this.Z.width:0)||this.$s,this.Om=this.Z.inputHeight||this.Um||0},resize:function(){return this.Tm(),Li.api.resize.apply(this,arguments)},render:function(){if(this.Nm(),this.Z.awidth=this.Lm||this.$s,this.Z.aheight=this.Om||this.Is,this.Z.bheight=this.Z.aheight+2,this.Z.cheight=this.Z.aheight-2*Xi.inputPadding,this.Z.dheight=this.Z.cheight-2,di.render.call(this)){if(this.jm=!0,this.Hm&&this.Hm(),this.Z.align){var t=this.mt.firstChild;switch("top"==this.Z.labelPosition&&t.nextSibling&&(t=t.nextSibling),this.Z.align){case"right":t.style.cssFloat="right",t.style.textAlign="right";break;case"center":t.style.display="inline-block",t.parentNode.style.textAlign="center";break;case"middle":t.style.marginTop=Math.round((this.Is-this.Om)/2)+"px";break;case"bottom":t.style.marginTop=this.Is-this.Om+"px";break;case"left":t.style.cssFloat="left";break;default:this.Z.align}}this.$render&&this.$render(this.data),this.Z.disabled&&this.disable(),this.bh&&(this.bh(this.data),this.bh=0)}},refresh:function(){this.render()},on_click:{Ym:function(t){var i=J(t,"button_id");i&&this.callEvent("onBeforeTabClick",[i,t])&&(this.setValue(i),this.callEvent("onAfterTabClick",[i,t]))},webix_all_segments:function(t,i){this.on_click.Ym.call(this,t,i)},webix_all_tabs:function(t,i){this.on_click.Ym.call(this,t,i)},webix_inp_counter_next:function(){this.Z.readonly||this.next()},webix_inp_counter_prev:function(){this.Z.readonly||this.prev()},webix_input_icon:function(){this.getInputNode().focus()},webix_inp_checkbox_border:function(t){this.Z.disabled||"DIV"==(t.target||t.srcElement).tagName||this.Z.readonly||this.toggle()},webix_inp_checkbox_label:function(){this.Z.readonly||this.toggle()},webix_inp_radio_border:function(t){var i=J(t,"radio_id");this.setValue(i),this.focus()},webix_inp_radio_label:function(t,i,s){return s=s.parentNode.getElementsByTagName("input")[0],this.on_click.webix_inp_radio_border.call(this,s,i,s)},webix_tab_more_icon:function(t,i,s){this.getPopup().resize(),this.getPopup().show(s,null,!0)},webix_tab_close:function(t){var i=J(t,"button_id");i&&this.callEvent("onBeforeTabClose",[i,t])&&this.removeOption(i)}},vu:function(t){this.name;for(var i=0;i<t.length;i++)t[i].text,t[i].label,"string"==typeof t[i]?t[i]={id:t[i],value:t[i]}:(j(t[i].id)&&(t[i].id=t[i].value),j(t[i].value)&&(t[i].value=t[i].id));return t},Wm:function(t){var i=t?t.placeholder:this.Z.placeholder;return i?"<span class='webix_placeholder'>"+i+"</span>":""}}),wh={api:gh,view:P.protoUI(gh,Li.view,Yi,di,Ai,w)},xh={name:"label",defaults:{template:"<div class='webix_el_box' style='width:#awidth#px;height:#aheight#px;line-height:#cheight#px'>#label#</div>"},$skin:function(){this.defaults.height=Xi.inputHeight},focus:function(){return!1},Hf:function(){return this.mt.firstChild},setHTML:function(t){this.Z.label=t,this.refresh()},setValue:function(t){this.Z.label=t,wh.api.setValue.apply(this,arguments)},$setValue:function(t){this.mt.firstChild.innerHTML=t},Hm:!1,Am:function(){},Tm:function(t){var i="webix_el_box webixlabel"+(this.queryView("toolbar","parent")?" webixtoolbarlabel":"");(t=t||this.Z).autowidth&&(t.width=nt(t.label,i).width)}},yh=(P.protoUI(xh,wh.view),{});for(var Mh in Ii._i)yh[Ii._i[Mh]]=Mh;var Sh={9:"tab",38:"up",40:"down",37:"left",39:"right"},kh={$init:function(
  t){var i=this.defaults.pattern||t.pattern,s=this.defaults.format||t.format;t.value=j(t.value)?"":t.value,(i||s&&!this.format_setter)&&(this.attachEvent("onKeyPress",function(t,i){i.ctrlKey||i.altKey||this.Z.readonly||this.Gm||(105<t&&t<112&&(t-=64),yh[t]&&8!==t&&46!==t?Sh[t]||Q(i):(Q(i),this.Xm(i,t)))}),this.attachEvent("onAfterRender",this.Jm),this.getText=function(){return this.getInputNode().value},this.Im=function(t,i){return!1===i?this.Zm(t):this.qm(t)},s&&("object"===k(s)?this.Gm=s:(s=sn.getConfig(s),this.Gm={parse:function(t){return sn.parse(t,s)},edit:function(t){return sn.format(t,s)}})))},pattern_setter:function(t){var i=ln[t]||t;return"string"==typeof i&&(i={mask:i}),i.allow=i.allow||/[A-Za-z0-9]/g,this.Km(i),i},Qm:function(){this.config.validate=this.config.validate||C(function(){var t=this.getText(),i=t.replace(this.tb,"");return(t.toString().match(this.ib)||[]).join("").length==i.length&&t.length==this.Z.pattern.mask.length},this)},Jm:function(){var t=S.isIE8?"propertychange":"input";this.Gm||Nt(this.getInputNode(),t,function(){var t=(new Date).valueOf();this.$view.offsetWidth;(!this.sb||100<t-this.sb)&&(this.sb=t,this.$setValue(this.getText()))},{bind:this}),Nt(this.getInputNode(),"blur",function(){this.yi()},{bind:this})},Km:function(t){for(var i=t.mask,s={},e="",n=0,h=0;h<i.length;h++)"#"===i[h]?(s[h]=n,n++):(s[h]=!1,-1===e.indexOf(i[h])&&(e+="\\"+i[h]));this.ib=t.allow,this.tb=new RegExp("["+e+"]","g"),this.eb=s,this.Qm()},Xm:function(t,i){var s=this.getInputNode(),e=s.value,n=at(s),h="";8==i||46==i?n.start==n.end&&(8==i?n.start--:n.end++):(h=String.fromCharCode(i),t.shiftKey||(h=h.toLowerCase())),e=e.substr(0,n.start)+h+e.substr(n.end),n=this.nb(h,e.length,n.start,i),this.hb=i,this.$setValue(e),ot(s,n)},nb:function(t,i,s,e){if(t&&t.match(this.ib)||8==e||46==e)s=t?s+1:s,s=this.rb(s,e);else if(i-1==s&&8!==e&&46!==e){var n=this.Z.pattern.mask.indexOf("#",s);0<n&&(s+=n)}return s},rb:function(t,i){var s=t-1*(46!==i);return!1===this.eb[s]?(t+=8==i?-1:1,this.rb(t,i)):!1===this.eb[t]&&8!==i?this.rb(t+1,i)-1:t},Zm:function(t){return this.Gm?this.Gm.parse(t):((t=t||0===t?t:"").toString().match(this.ib)||[]).join("").replace(this.tb,"")},qm:function(t){if(this.Gm)return this.Gm.edit(this.Gm.parse(t));var i=this.Zm(t),s=this.Z.pattern.mask,e=this.Z.pattern.mask,n=this.eb,h=!1,r=0,o=0,a=0;for(var u in n)if(!1!==n[u]){if(!h){r=1*u;var c=i[o=n[u]]||"",f=i[o+1];s=(c?s.substr(0,r):"")+c+(c&&f?s.substr(r+1):""),f||(h=!0)}a++}var l=this.hb;if(l&&8!==l||!l&&a-1===o&&s.length<e.length)if(i){var d=r+1;if("#"!==e.charAt(d)&&s.length<e.length){var v=e.indexOf("#",d);v<0&&(v=e.length),s+=e.substr(d,v-d)}}else 46!==l&&(s+=e.substr(0,e.indexOf("#")));return this.hb=null,s}},Ch={name:"text",$allowsClear:!0,ob:function(){this.$allowsClear&&(this.ab||Nt(this.getInputNode(),"change",this.yi,{bind:this}),this.Z.suggest&&Pt(this.Z.suggest).linkInput(this))},yi:function(){var t=this.getValue(),i=this.setValue(t,!0);this.Gm&&!1===i&&this.$setValue(t)},$skin:function(){this.defaults.height=Xi.inputHeight,this.defaults.inputPadding=Xi.inputPadding,this.kp=Xi.inputSpacing},$init:function(t){"top"==t.labelPosition&&j(t.height)&&this.defaults.height&&(t.height=this.defaults.height+(t.label?this.Cp:0)),this.ht=[],this.attachEvent("onAfterRender",this.ob),this.attachEvent("onBlur",function(){this.ab&&this.ab()})},$renderIcon:function(){var t=this.Z;if(t.icon){var i=t.aheight-2*t.inputPadding,s=(i-18)/2-1,e=this.addSection?"role='button' tabindex='0' aria-label='"+ct.aria["multitext"+(t.mode||"")+"Section"]+"'":"";return"<span style='height:"+(i-s)+"px;padding-top:"+s+"px;' class='webix_input_icon "+t.icon+"' "+e+"></span>"}return""},relatedView_setter:function(t){return this.attachEvent("onChange",function(){var t=this.getValue(),i=this.Z.relatedAction,s=this.Z.relatedView,e=Pt(s);if(!e){var n=this.getTopParentView();n&&n.$$&&(e=n.$$(s))}"enable"==i?t?e.enable():e.disable():t?e.show():e.hide()}),t},validateEvent_setter:function(t){return"blur"==t&&this.attachEvent("onBlur",this.validate),"key"==t&&this.attachEvent("onTimedKeyPress",
  this.validate),t},validate:function(){var t=this.Z.validate;!t&&this.Z.required&&(t=vs.isNotEmpty);var i=this.getFormView(),s=this.Z.name,e=this.getValue(),n={};return n[s]=e,!(t&&!i.fr(t,e,n,s))},bottomLabel_setter:function(t){return this.Z.bottomPadding||(this.Z.bottomPadding=18),t},ub:function(){var t=this.Z.invalidMessage;return"function"==typeof t&&t.call(this),t},setBottomText:function(t,i){var s=this.Z;if(void 0!==t){if(s.bottomLabel==t)return;s.bottomLabel=t}var e=(s.invalid?s.invalidMessage:"")||s.bottomLabel;e||s.bottomPadding||(s.inputHeight=0),e&&!s.bottomPadding?(this.cb=1,s.bottomPadding=s.bottomPadding||i||18,this.render(),this.adjust(),this.resize()):!e&&this.cb?(s.bottomPadding=this.cb=0,s.height||this.render(),this.adjust(),this.resize()):this.render()},$getSize:function(){var t=Li.api.$getSize.apply(this,arguments),i=this.config.bottomPadding;return i&&(t[2]+=i,t[3]+=i),t},$setSize:function(t,i){var s=this.Z;if(Li.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==s.labelPosition?(s.inputHeight||(this.Um=this.Is-(s.label?this.Cp:0)-(this.config.bottomPadding||0)),s.labelWidth=0):s.bottomPadding&&(s.inputHeight=this.Is-this.config.bottomPadding),this.render()}},fb:function(t){var i=(this.Lm||0)-(t.label?this.Z.labelWidth:0)-this.kp-(t.iconWidth||0);return i<0?0:i},lb:function(t,i){var s="x"+z(),e=i.fb(t),n=t.inputAlign||"left",h=this.Z.aheight-2*Xi.inputPadding-2*this.Dm,r=t.text||t.value||this.Wm(t),o="<div class='webix_inp_static' role='combobox' aria-label='"+At.escape(t.label)+"' tabindex='0'"+(t.readonly?" aria-readonly='true'":"")+(t.invalid?"aria-invalid='true'":"")+" onclick='' style='line-height:"+h+"px;width: "+e+"px; text-align: "+n+";' >"+r+"</div>";return i.$renderInput(t,o,s)},vb:function(t){var i="<"+t+(this.Z.placeholder?" placeholder='"+this.Z.placeholder+"' ":" ");this.Z.readonly&&(i+="readonly='true' aria-readonly=''"),this.Z.required&&(i+="aria-required='true'"),this.Z.invalid&&(i+="aria-invalid='true'");var s=this.Z.attributes;if(s)for(var e in s)i+=e+"='"+s[e]+"' ";return i},$renderLabel:function(t,i){var s="";if(t.label){var e=t.labelAlign||"left",n="top"==this.Z.labelPosition;s="<label style='"+(n?"display:block;":"width: "+this.Z.labelWidth+"px;")+"text-align: "+e+";line-height:"+this._b(n)+"px;' onclick='' for='"+i+"' class='webix_inp_"+(n?"top_":"")+"label "+(t.required?"webix_required":"")+"'>"+(t.label||"")+"</label>"}return s},_b:function(t){return t?this.Cp-this.Z.inputPadding:this.Z.aheight-2*this.Z.inputPadding},$renderInput:function(t,i,s){var e=t.inputAlign||"left",n="top"==t.labelPosition,h=this.fb(t);s=s||z();var r=this.$renderLabel(t,s),o="";if(i)o+=i;else{var a=At.escape(t.text||this.Im(t.value));o+=this.vb("input")+"id='"+s+"' type='"+(t.type||this.name)+"'"+(t.editable?" role='combobox'":"")+" value='"+a+"' style='width: "+h+"px; text-align: "+e+";'";var u=t.attributes;if(u)for(var c in u)o+=" "+c+"='"+u[c]+"'";o+=" />"}o+=this.$renderIcon?this.$renderIcon(t):"";var f="";f=n?r+"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+o+"</div>":"<div class='webix_el_box' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+r+o+"</div>";var l=t.awidth-h-2*Xi.inputPadding,d=(t.invalid?t.invalidMessage:"")||t.bottomLabel;return d&&(f+="<div class='webix_inp_bottom_label'"+(t.invalid?"role='alert' aria-relevant='all'":"")+" style='width:"+(h||t.awidth)+"px;margin-left:"+Math.max(l,Xi.inputPadding)+"px;'>"+d+"</div>"),f},defaults:{template:function(t,i){return i.$renderInput(t)},label:"",labelWidth:80},type_setter:function(t){return t},Hm:!1,Am:function(){},$setValue:function(t){this.getInputNode().value=this.Im(t)},$getValue:function(){return this.Im(this.getInputNode().value,!1)},suggest_setter:function(t){if(t){if("string"==typeof t){if(Pt(t))return Pt(t).Z.id;t={body:{url:t,dataFeed:t}}}else t.getItem?t={body:{data:t}}:g(t)?t={body:{data:this.vu(t)}}:t.body||(t.body={});P.extend(t,{view:"suggest"});var i=zt(t);return this.ht.push(i),i.Z.id}return!1}},$h={api:Ch,view:P.protoUI(Ch,kh,wh.view)},Dh=P.proto({name:"DataCollection",
  isVisible:function(){return!!(this.data.order.length||this.data.Rr||this.Z.dataFeed)},$init:function(t){this.data.provideApi(this,!0);var i=t&&t.id?t.id:z();this.Z.id=i,(zt.views[i]=this).data.attachEvent("onStoreLoad",C(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},ds,Fi,Bi,we,ws,Rs,w,Hi,Ti,Ai);u("DataCollection",Dh);var Ih={name:"select",defaults:{template:function(i,t){var s=t.vu(i.options),e="x"+z(),n=t.vb("select")+"id='"+e+"' style='width:"+t.fb(i)+"px;'>",h=Pt(s);if(h&&h.data&&h.data.each)h.data.each(function(t){n+="<option"+(t.id==i.value?" selected='true'":"")+" value='"+t.id+"'>"+t.value+"</option>"});else for(var r=0;r<s.length;r++)n+="<option"+(s[r].id==i.value?" selected='true'":"")+" value='"+s[r].id+"'>"+s[r].value+"</option>";return n+="</select>",t.$renderInput(i,n,e)}},options_setter:function(t){if(t){if("string"!=typeof t)return t;var i=new Dh({url:t});return i.data.attachEvent("onStoreLoad",C(this.refresh,this)),i}},getInputNode:function(){return this.mt.getElementsByTagName("select")[0]}},Ah=(P.protoUI(Ih,$h.view),{name:"checkbox",defaults:{checkValue:1,uncheckValue:0,template:function(t,i){var s="x"+z(),e="";t.labelRight&&(e="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||"&nbsp;"));var n=t.checkValue==t.value,h=Math.floor((i.Z.aheight-16)/2),r=i.vb("input")+"style='margin-top:"+h+"px;"+(t.customCheckbox?"display:none":"")+"' id='"+s+"' type='checkbox' "+(n?"checked='1'":"")+(t.labelRight?" aria-label='"+At.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"+At.escape(t.labelRight||t.label))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false")));var u="<div style='line-height:"+i.Z.cheight+"px' class='"+o+"'>"+r+a+e+"</div>";return i.$renderInput(t,u,s)}},customCheckbox_setter:function(t){return!0===t&&Xi.customCheckbox&&(t="<a role='presentation' onclick='javascript:void(0)'><button role='checkbox' aria-checked='false' aria-label='' type='button' aria-invalid='' class='webix_custom_checkbox'></button></a>"),t},blur:function(){var t=this.getInputNode();t&&t.blur()},Im:function(t){return t},ob:function(){},$setValue:function(t){var i=t==this.Z.checkValue,s=this.$view.getElementsByTagName("input")[0],e=s?s.parentNode:null;if(e&&this.Z.customCheckbox){var n=e.getElementsByTagName("BUTTON");n[0]&&n[0].setAttribute("aria-checked",i?"true":"false")}e&&(e.className=e.className.replace(/(webix_checkbox_)\d/,"$1"+(i?1:0))),s.checked=i},toggle:function(){var t=this.getValue()!=this.Z.checkValue?this.Z.checkValue:this.Z.uncheckValue;this.setValue(t)},getValue:function(){return this.Z.value==this.Z.checkValue?this.Z.checkValue:this.Z.uncheckValue},getInputNode:function(){return this.$view.getElementsByTagName(this.Z.customCheckbox?"button":"input")[0]},$skin:function(){this.defaults.customCheckbox=!!Xi.customCheckbox}}),Th={api:Ah,view:P.protoUI(Ah,$h.view)},Fh={name:"radio",defaults:{template:function(t,i){for(var s,e=i.vu(t.options),n=[],h=0;h<e.length;h++){var r="x"+z();s=s||r,h&&(e[h].newline||t.vertical)&&n.push("<div class='webix_line_break'></div>");var o=e[h].id==t.value,a=e[h].value||"",u=t.tooltip?" webix_t_id='"+e[h].id+"'":"",c=t.customRadio||"";if(c){var f=(0===h?t.label+" ":"")+a;c=(c=(c=(c=(c=c.replace(/(aria-label=')\w*(?=')/,"$1"+At.escape(f))).replace(/(aria-checked=')\w*(?=')/,"$1"+(o?"true":"false"))).replace(/(tabindex=')\w*(?=')/,"$1"+(o||0===h&&!t.value?"0":"-1"))).replace(/(aria-invalid=')\w*(?=')/,"$1"+(t.invalid?"true":"false"))).replace(/(button_id=')\w*(?=')/,"$1"+e[h].id)}var l=i.vb("input")+" name='"+(t.name||t.id)+"' type='radio' "+(o?"checked='1'":"")+"tabindex="+(o||0===h&&!t.value?"0":"-1")+" value='"+e[h].id+"' id='"+r+"' style='"+(c?"display:none":"")+"' />",d="<div radio_id='"+e[h].id+"' class='webix_inp_radio_border webix_radio_"+(o?"1":"0"
  )+"' role='presentation'>"+l+c+"</div>";a&&(a="<label for='"+r+"' class='webix_label_right'>"+a+"</label>"),n.push("<div class='webix_radio_option' role='presentation'"+u+">"+d+a+"</div>")}return n="<div class='webix_el_group' role='radiogroup' style='margin-left:"+(t.label?t.labelWidth:0)+"px;'>"+n.join("")+"</div>",i.$renderInput(t,n,s)}},refresh:function(){this.render(),this.Cs&&this.$getSize(0,0)[2]!=this.Cs[1]&&this.resize()},$getSize:function(t,i){var s=wh.api.$getSize.call(this,t,i);if(this.Z.options){for(var e=this.Z.vertical?0:1,n=0;n<this.Z.options.length;n++)(this.Z.vertical||this.Z.options[n].newline)&&e++;s[3]=s[2]=Math.max(s[2],(this.Z.optionHeight||25)*e+2*this.Z.inputPadding+("top"==this.Z.labelPosition?this.Cp:0))}var h=this.config.bottomPadding;return h&&(s[2]+=h,s[3]+=h),s},lu:function(){return this.mt.getElementsByTagName(this.Z.customRadio?"button":"input")},$setValue:function(t){for(var i=this.mt.getElementsByTagName("input"),s=0;s<i.length;s++){i[s].parentNode.getAttribute("radio_id")==t?(i[s].checked=!0,i[s].setAttribute("tabindex","0")):(i[s].checked=!1,i[s].setAttribute("tabindex","-1"));var e=i[s]?i[s].parentNode:null;if(e&&(e.className=e.className.replace(/(webix_radio_)\d/,"$1"+(i[s].checked?1:0)),this.Z.customRadio)){var n=e.getElementsByTagName("BUTTON");n[0]&&(n[0].setAttribute("aria-checked",i[s].checked?"true":"false"),n[0].setAttribute("tabindex",i[s].checked?"0":"-1"))}}},getValue:function(){return this.Z.value},focus:function(){return this.Mi()},blur:function(){this.du()},customRadio_setter:function(t){return!0===t&&Xi.customRadio&&(t="<a role='presentation' onclick='javascript:void(0)'><button type='button' class='webix_custom_radio' button_id='' role='radio' aria-checked='false' aria-label='' aria-invalid='' tabindex=''></button></a>"),t},$skin:function(){this.defaults.customRadio=!!Xi.customRadio,Xi.optionHeight&&(this.defaults.optionHeight=Xi.optionHeight)}},zh=(P.protoUI(Fh,$h.view,zs),{name:"datepicker",$init:function(){this.$ready.push(this.pb)},defaults:{template:function(t,i){"time"==i.Z.type&&(i.Z.icon=i.Z.timeIcon);var s=t.type;t.type="";var e=t.editable?i.$renderInput(t):i.lb(t,i);return t.type=s,e},stringResult:!1,timepicker:!1,icon:"wxi-calendar",icons:!0,timeIcon:"wxi-clock",separator:", "},ab:function(){var t=this.getText();if(this.Z.text!=t&&(!j(this.Z.text)||t)){var i=this.Z.editable?this.getValue():this.getPopup().getValue();this.setValue(i||"")}},$skin:function(){this.defaults.inputPadding=Xi.inputPadding,this.defaults.point=!Xi.popupNoPoint},getPopup:function(){return Pt(this.Z.popup)},pb:function(){var t=this.Z;if(t.suggest)t.popup=t.suggest;else if(!t.popup){var i=this.Z.timepicker;t.popup=t.suggest=this.suggest_setter({type:"calendar",point:!1!==this.Z.point,padding:0,body:{height:240+(i||this.Z.icons?30:0),width:250,multiselect:this.Z.multiselect,timepicker:i,type:this.Z.type,icons:this.Z.icons,timeIcon:this.Z.timeIcon}})}this.bh=function(){}},$render:function(t){j(t.value)||(t.value=this.$prepareValue(t.value),this.$setValue(t.value))},$prepareValue:function(t){if(this.Z.multiselect){"string"==typeof t?t=t.split(this.Z.separator):t instanceof Date?t=[t]:t||(t=[]);for(var i=0;i<t.length;i++)t[i]=this.mb(t[i]);return t}return this.mb(t)},mb:function(t){var i=this.Z.type,s="time"==i;if(isNaN(parseFloat(t))||(t=""+t),"string"==typeof t&&t){t=("month"!=i&&"year"!=i||!this.bb?s?ct.parseTimeFormatDate:ct.parseFormatDate:this.bb)(t)}if(t){if(s&&g(t)){var e=new Date;e.setHours(t[0]),e.setMinutes(t[1]),t=e}isNaN(t.getTime())&&(t="")}return t},gb:function(t){return this.Z.multiselect?[].concat(t).map(function(t){return this.wb(t)}.bind(this)).join(this.config.separator):this.wb(t)},wb:function(t){var i="time"==this.Z.type,s=this.config.timepicker;return(this.xb||(i?ct.timeFormatStr:s?ct.fullDateFormatStr:ct.dateFormatStr))(t)},yb:function(){var t=this.getInputNode();t.value==undefined?t.innerHTML=this.Z.text||this.Wm():t.value=this.Z.text||""},$compareValue:function(t,i){return!t&&!i||tn.equal(t,i)},$setValue:function(t){this.Z.text=t?this.gb(t):"",this.yb()},
  format_setter:function(t){return t?"function"==typeof t?this.xb=t:(this.xb=tn.dateToStr(t),this.bb=tn.strToDate(t)):this.xb=this.bb=null,t},getInputNode:function(){return this.Z.editable?this.mt.getElementsByTagName("input")[0]:this.mt.getElementsByTagName("DIV")[1]},getValue:function(){if(this.Z.multiselect){var t=this.Z.value;if(!t)return[];var i=[].concat(t).map(function(t){return this.Mb(t)}.bind(this));return this.Z.stringResult?i.join(this.Z.separator):i}return this.Mb(this.Z.value)},Mb:function(t){var i=this.Z.type,s="time"==i,e=this.config.timepicker;if(this.jm){if(this.Z.editable){t=(this.bb||(s?ct.timeFormatDate:e?ct.fullDateFormatDate:ct.dateFormatDate))(this.getInputNode().value)}}else t=this.$prepareValue(t)||null;if(this.Z.stringResult){var n=ct.parseFormatStr;return s&&(n=ct.parseTimeFormatStr),!this.xb||"month"!=i&&"year"!=i||(n=this.xb),this.Z.multiselect?[].concat(t).map(function(t){return t?n(t):""}):t?n(t):""}return t||null},getText:function(){var t=this.getInputNode();return t?"undefined"==typeof t.value?this.getValue()?t.innerHTML:"":t.value:""}}),Vh={api:zh,view:P.protoUI(zh,$h.view)},Bh={name:"colorpicker",$init:function(){this.$ready.push(this.pb)},defaults:{icon:!0},pb:function(){var t=this.Z;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({type:"colorboard",height:200})),this.bh=function(){}},$render:function(t){j(t.value)||(t.value=this.$prepareValue(t.value),this.$setValue(t.value))},getValue:function(){return this.jm&&this.Z.editable?this.getInputNode().value:this.Z.value},$prepareValue:function(t){return(t=t?t.toString(16):"")&&"#"!=t.charAt(0)&&/^[0-9a-fA-F]+$/.test(t)&&(t="#"+t),t},Sb:function(){return this.$view.getElementsByTagName("DIV")[this.Z.editable?1:2]},gb:function(t){return t},$compareValue:function(t,i){return t==i},$setValue:function(t){this.Sb().style.backgroundColor=t,this.Z.text=t;var i=this.getInputNode();i.value==undefined?i.innerHTML=t:i.value=t},$renderIcon:function(){return'<div class="webix_input_icon" style="background-color:'+this.config.value+';"> </div>'}},Hh=(P.protoUI(Bh,Vh.view),{name:"richselect",defaults:{template:function(t,i){return i.lb(t,i)},popupWidth:200,icon:"wxi-menu-down"},ab:function(){if(this.Z.text!=this.getText()&&(!j(this.Z.text)||this.getText())){var t=this.getPopup(),i=this.getInputNode().value,s=t.getSuggestion(i),e=this.getValue();!s||s==e||""===i&&""!==t.getItemText(s)?""===i?this.setValue(""):this.kb&&this.kb():this.setValue(s)}},suggest_setter:function(t){return this.options_setter(t)},options_setter:function(t){t=this.Cb?this.Cb(t):t;var i=this.Z.popup=this.Z.suggest=$h.api.suggest_setter.call(this,t),s=Pt(i).getList();return s&&s.attachEvent("onAfterLoad",C(this.$b,this)),i},getList:function(){var t=Pt(this.Z.suggest);return t.getList()},Im:function(t){return t},$b:function(){var t=this.Z.value;j(t)||this.getPopup().isVisible()||this.Z.text||!this.mt.firstChild||this.$setValue(t)},$skin:function(){this.defaults.inputPadding=Xi.inputPadding},$render:function(t){j(t.value)||this.$setValue(t.value)},getInputNode:function(){return this.mt.getElementsByTagName("DIV")[1]},getPopup:function(){return Pt(this.Z.popup)},getText:function(){var t=this.Z.value,i=this.getInputNode();return i?"undefined"==typeof i.value?i.firstChild&&"webix_placeholder"===i.firstChild.className?"":i.innerHTML:i.value:t?this.getPopup().getItemText(t):""},$setValue:function(t){if(this.jm){var i=t;if(this.getPopup()&&(i=this.getPopup().getItemText(t)),!i&&t&&t.id){var s=this.getPopup(),e=s.getList(),n=e.exists(t.id);n||e.add(t),i=s.getItemText(t.id),e.Z.dynamic&&!n&&e.remove(t.id),this.Z.value=t.id}var h=this.getInputNode();j(h.value)?h.innerHTML=i||this.Wm():h.value=i=i.replace(/<[^>]*>/g,""),this.Z.text=i}},getValue:function(){return this.Z.value||""},Db:function(t){this.focus(),Q(t)}}),Rh={api:Hh,view:P.protoUI(Hh,$h.view)},Ph={name:"combo",getInputNode:function(){return this.mt.getElementsByTagName("input")[0]},$render:function(t){j(t.value)||this.$setValue(t.value)},kb:function(){if(!this.Z.editable){var t=this.getValue();this.$setValue(
  j(t)?"":t)}},yi:function(){var t=this.getInputNode(),i="",s=this.getPopup();t.value&&(i=this.Z.value,s.getItemText(i)!=this.getText()&&(i=s.getSuggestion()||i)),i!=this.Z.value?this.setValue(i,!0):this.$setValue(i)},$compareValue:function(t){var i=Rh.api.$compareValue.apply(this,arguments);return i&&t!=this.getText()&&this.kb(),i},defaults:{template:function(t,i){return i.$renderInput(t).replace(/(<input)\s*(?=\w)/,"$1 role='combobox'")},icon:"wxi-menu-down"},on_click:{webix_inp_label:function(t){this.Db(t)},webix_inp_top_label:function(t){this.Db(t)}}},jh=(P.protoUI(Ph,Rh.view),{name:"counter",defaults:{template:function(t,i){var s=t.value,e="x"+z(),n="<div role='spinbutton' aria-label='"+At.escape(t.label)+"' aria-valuemin='"+t.min+"' aria-valuemax='"+t.max+"' aria-valuenow='"+t.value+"' class='webix_el_group' style='width:"+i.fb(t)+"px'>";return n+="<button type='button' class='webix_inp_counter_prev' tabindex='-1' aria-label='"+ct.aria.decreaseValue+"'>-</button>",n+=i.vb("input")+" id='"+e+"' type='text' class='webix_inp_counter_value' aria-live='assertive' value='"+s+"'></input>",n+="<button type='button' class='webix_inp_counter_next' tabindex='-1' aria-label='"+ct.aria.increaseValue+"'>+</button></div>",i.$renderInput(t,n,e)},min:0,max:Infinity,value:0,step:1},$init:function(){Nt(this.$view,"keydown",this.Yp,{bind:this})},Yp:function(t){var i=t.which||t.keyCode,s=this.Z,e=this.getValue();32<i&&i<41&&(36===i?e=s.min:35===i?e=s.max===Infinity?1e6:s.max:33===i?this.next():34===i?this.prev():e+=37===i||40===i?-1:1,34<i&&e>=s.min&&e<=s.max&&this.setValue(e))},$setValue:function(t){this.getInputNode().value=t},$prepareValue:function(t){return t=parseFloat(t),isNaN(t)?0:t},value_setter:function(t){return this.$prepareValue(t)},getInputNode:function(){return this.mt.getElementsByTagName("input")[0]},getValue:function(){return 1*wh.api.getValue.apply(this,arguments)},next:function(t){t=1*(t||this.Z.step),this.shift(t)},prev:function(t){t=-1*(t||this.Z.step),this.shift(t)},shift:function(t){var i=this.Z.min,s=this.Z.max,e=this.getValue()+t;i<=e&&e<=s&&this.setValue(e)}}),Eh=(P.protoUI(jh,$h.view),{name:"icon",$skin:function(){this.defaults.height=Xi.inputHeight,this.defaults.width=Xi.inputHeight},defaults:{template:function(t,i){var s=Math.min(t.awidth,t.aheight),e=Math.round((i.Is-t.aheight)/2),n="<button type='button' style='height:"+s+"px;width:"+s+"px;' class='webix_icon_button'><span class='webix_icon "+t.icon+"'></span></button>";return"<div class='webix_el_box' style='width:"+t.awidth+"px;height:"+t.aheight+"px;line-height:"+t.aheight+"px;margin-top:"+e+"px'>"+n+(t.badge||0===t.badge?"<span class='webix_badge'>"+t.badge+"</span>":"")+"</div>"}},Hm:!1,Am:function(){},$setValue:function(){}}),Nh=(P.protoUI(Eh,wh.view),{name:"search",on_click:{webix_input_icon:function(t){this.getInputNode().focus(),this.callEvent("onSearchIconClick",[t])}},$skin:function(){this.defaults.inputPadding=Xi.inputPadding},defaults:{type:"text",icon:"wxi-search"}}),Lh=(P.protoUI(Nh,$h.view),{name:"segmented",$allowsClear:!1,$init:function(){this.attachEvent("onChange",function(t){this.Z.multiview&&this.Ib(t)}),this.attachEvent("onAfterRender",l(function(){this.Z.multiview&&this.Z.value&&this.Ib(this.Z.value)}))},Ib:function(t){var i=this.getTopParentView(),s=null;i&&i.$$&&(s=i.$$(t)),s||(s=Pt(t)),s&&s.show&&s.show()},defaults:{template:function(t,i){t.options;var s=t.options;i.vu(s),s=i.Ab(s);var e,n=i.fb(t),h=z(),r="<div style='width:"+n+"px' class='webix_all_segments' role='tablist' aria-label='"+At.escape(t.label)+"'>",o=t.optionWidth||Math.floor(n/s.length);t.value||(t.value=s[0].id);for(var a=0;a<s.length;a++)e=t.tooltip?" webix_t_id='"+s[a].id+"'":"",r+="<button type='button' style='width:"+(s[a].width||o)+"px' role='tab' aria-selected='"+(t.value==s[a].id?"true":"false")+"' tabindex='"+(t.value==s[a].id?"0":"-1")+"'",r+="class='webix_segment_"+(a==s.length-1?"N":0<a?1:0)+(t.value==s[a].id?" webix_selected ":"")+"' button_id='"+s[a].id+"'"+e+">",r+=s[a].value+"</button>";return i.$renderInput(t,r+"</div>",h)}},lu:function(){
  return this.$view.getElementsByTagName("BUTTON")},focus:function(){return this.Mi()},blur:function(){this.du()},$setValue:function(t){for(var i=this.lu(),s=0;s<i.length;s++){var e=i[s].getAttribute("button_id");i[s].setAttribute("aria-selected",t==e?"true":"false"),i[s].setAttribute("tabindex",t==e?"0":"-1"),t==e?st(i[s],"webix_selected"):et(i[s],"webix_selected")}var n=this.config.tabbarPopup;n&&Pt(n)&&Pt(n).getBody().exists(t)&&this.refresh()},getValue:function(){return this.Z.value},getInputNode:function(){return null},optionIndex:function(t){for(var i=this.Z.options,s=0;s<i.length;s++)if(i[s].id==t)return s;return-1},addOption:function(t,i,s,e){var n=t;"object"!=k(t)?n={id:t,value:i=i||t}:(t=n.id,e=s,s=i),this.optionIndex(t)<0&&x.insertAt.call(this.Z.options,n,e),this.refresh(),s&&this.setValue(t)},removeOption:function(t){var i=this.optionIndex(t),s=this.Z.options;0<=i&&x.removeAt.call(s,i),this.Z.value==t&&this.Tb(s,i),this.refresh(),this.callEvent("onOptionRemove",[t,this.Z.value])},Tb:function(t,i){var s=t.length;if(s){for(var e=i=Math.min(i,s-1);e<s;e++)if(!t[e].hidden)return this.setValue(t[e].id);for(var n=i;0<=n;n--)if(!t[n].hidden)return this.setValue(t[n].id)}this.setValue("")},Ab:function(t){for(var i=[],s=0;s<t.length;s++)t[s].hidden||i.push(t[s]);return i},Fb:function(t,i){var s=this.Z.options,e=this.optionIndex(t),n=s[e];n&&i==!!n.hidden&&(n.hidden=!i,i||this.Z.value!=t?this.refresh():this.Tb(s,e))},hideOption:function(t){this.Fb(t,!1)},showOption:function(t){this.Fb(t,!0)},Hm:!1}),Oh={api:Lh,view:P.protoUI(Lh,$h.view,zs)},Uh={name:"textarea",defaults:{template:function(t,i){var s=t.name||t.id,e="x"+z(),n=i.vb("textarea")+"style='width:"+i.fb(t)+"px;'";return n+=" id='"+e+"' name='"+s+"' class='webix_inp_textarea'>"+i.Im(t.value)+"</textarea>",i.$renderInput(t,n,e)},height:0,minHeight:60},$skin:function(){this.defaults.inputPadding=Xi.inputPadding,this.kp=Xi.inputSpacing},Ei:!0,_b:function(t){return t?this.Cp-this.Z.inputPadding:""},getInputNode:function(){return this.mt.getElementsByTagName("textarea")[0]}},Yh=(P.protoUI(Uh,$h.view),{name:"toggle",$allowsClear:!0,$init:function(){this.attachEvent("onItemClick",function(){this.toggle()})},$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(),s=this.Z,e=t&&"0"!=t,n=(e?s.onLabel:s.offLabel)||s.label,h=i.firstChild;i.setAttribute("aria-pressed",e?"true":"false"),i.innerHTML=n,h&&this.hv[s.type]&&"htmlbutton"!==s.type&&("SPAN"===h.nodeName&&s.onIcon&&s.offIcon&&s.onIcon!==s.offIcon&&(h.className=h.className.replace(e?s.offIcon:s.onIcon,e?s.onIcon:s.offIcon)),i.insertBefore(h,i.firstChild)),(e?st:et)(i.parentNode,"webix_pressed")},toggle:function(){this.setValue(!this.getValue())},getValue:function(){var t=this.Z.value;return t&&"0"!=t?1:0},defaults:{template:function(t,i){var s=t.value&&"0"!=t.value,e=s?" webix_pressed":"";t.label=(s?t.onLabel:t.offLabel)||t.label,t.icon=(s?t.onIcon:t.offIcon)||t.icon;var n="<div class='webix_el_box"+e+"' style='width:"+t.awidth+"px; height:"+t.aheight+"px'>"+i.$renderInput(t,i)+"</div>";return n=n.replace(/(button)\s*(?=\w)/,"$1 aria-pressed='"+(s?"true":"false")+"' "),(t.badge||0===t.badge)&&(n=n.replace(/<\/div>$/,"<span class='webix_badge'>"+t.badge+"</span></div>")),n}},Hm:!1}),Wh=(P.protoUI(Yh,wh.view),{name:"multitext",$cssName:"text",defaults:{icon:"wxi-plus-circle",iconWidth:25,separator:", "},getValueHere:function(){return $h.api.getValue.call(this)},setValueHere:function(t){return $h.api.$setValue.call(this,t)},getValue:function(){if("extra"==this.config.mode)return this.getValueHere();if(this.zb)return this.zb;for(var t=[this.getValueHere(this)],i=0;i<this.Vb.length;i++){var s=Pt(this.Vb[i]).getValueHere();s&&t.push(s)}return t.join(this.config.separator)},$setValue:function(t){if(t=t||"","extra"==this.config.mode)return this.setValueHere(t);var i=(this.zb=t).split(this.config.separator);if(i.length!=this.Vb.length+1){this.removeSection(),this.setValueHere.call(this,i[0]);for(
  var s=1;s<i.length;s++)this.addSection(i[s]);this.zb=""}else{this.setValueHere(i[0]);for(var e=0;e<this.Vb.length;e++)Pt(this.Vb[e]).setValueHere(i[e+1]);this.zb=""}},Bb:function(){var t=this.config.master?Pt(this.config.master):this,i=t.getValue(),s=t.Z.value;i!==s&&(t.Z.value=i,t.callEvent("onChange",[i,s]))},addSection:function(t){var i=this.config,s={labelWidth:i.labelWidth,inputWidth:i.inputWidth,width:i.width,label:i.label?"&nbsp;":"",view:this.name,mode:"extra",value:t||"",icon:"wxi-minus-circle",tooltip:i.tooltip,suggest:i.suggest||null,master:i.id};P.extend(s,i.subConfig||{},!0);var e=this.getParentView().addView(s);return Pt(e).attachEvent("onChange",this.Bb),this.Vb.push(e),this.callEvent("onSectionAdd",[e,this.Vb.length]),e},removeSection:function(t){for(var i=this.config.master?Pt(this.config.master):this,s=i.Vb.length-1;0<=s;s--){var e=i.Vb[s];t&&e!=t||(i.Vb.removeAt(s),this.getParentView().removeView(e),i.callEvent("onSectionRemove",[e,s+1]))}},on_click:{webix_input_icon:function(){if("extra"==this.config.mode){this.removeSection(this.config.id);var t=this.getParentView().getChildViews();t[t.length-1].focus(),this.Bb()}else Pt(this.addSection()).focus();return!1}},$init:function(){this.Vb=p([]),this.attachEvent("onKeyPress",this.zs)},$render:function(t){this.$setValue(t.value)}}),Gh=(P.protoUI(Wh,$h.view),{name:"proto",$init:function(){this.data.provideApi(this,!0),this.mt=this.mt||this.Zi,this.data.attachEvent("onStoreUpdated",C(function(){this.render.apply(this,arguments)},this))},$setSize:function(){Li.api.$setSize.apply(this,arguments)&&this.render()},na:"webix_item",on_mouse_move:{},type:{}}),Xh={api:Gh,view:P.protoUI(Gh,Ns,ls,Yi,we,Os,ws,Li.view,w,Ai)},Jh={name:"list",Hb:"webix_list",mh:"webix_list_item",$init:function(t){st(this.et,this.Hb+("x"==(t.layout||this.defaults.layout)?"-x":"")),this.data.provideApi(this,!0),this.Rb=C(this.Rb,this),this.data.attachEvent("onStoreUpdated",this.Rb),this.data.attachEvent("onSyncApply",this.Rb),this.attachEvent("onAfterRender",this.Av),this.et.setAttribute("role","listbox")},dynamic_setter:function(t){return t&&P.extend(this,Me,!0),t},$dragHTML:function(t,i,s){var e;return"y"==this.Z.layout&&"auto"==this.type.width?(this.type.width=this.$s,e=this.Ot(t),this.type.width="auto"):e=this.Ot(t),g(s.source)&&1<s.source.length&&(e=this.Wo(e,s.source.length)),e},defaults:{select:!1,scroll:!0,layout:"y",navigation:!0,datafetch:50},na:"webix_l_id",on_click:{webix_list_item:function(t,i){this.Z.select&&(this.Pb=!0,"multiselect"==this.Z.select||this.Z.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.Z.multiselect,t.shiftKey):this.select(i),this.Pb=!1)}},on_dblclick:{},getVisibleCount:function(){return Math.floor(this.Is/this.jb())},Rb:function(){(this.Z.autoheight||this.Z.autowidth)&&this.resize()},Eb:function(t){var i=this.data.$pagesize||this.count();this.Ic(t&&t<i,"y"),this.Z.autoheight&&i<(t||Infinity)&&(t=i);var s=this.jb()*t+(this.type.margin||0);return this.getUnits&&(s+=this.getUnits().length*this.type.headerHeight),Math.max(s,this.Z.minHeight||0)},jb:function(){return this.type.height+(this.type.margin||0)},Nb:function(t){var i=this.data.$pagesize||this.count();return this.Ic(t&&t<i,"x"),this.Z.autowidth&&i<(t||Infinity)&&(t=i),this.type.width*t},Av:function(){"x"==this.Z.layout&&(this.mt.style.width="auto"!=this.type.width?this.type.width*this.count()+"px":"auto")},$getSize:function(t,i){return"y"==this.Z.layout?("auto"!=this.type.width&&(this.Z.width=this.type.width+(this.Ds?S.scrollSize:0)),(this.Z.yCount||this.Z.autoheight)&&(this.Z.height=this.Eb(this.Z.yCount)||1)):("auto"!=this.type.height&&(this.Z.height=this.jb()+(this.As?S.scrollSize:0)),(this.Z.xCount||this.Z.autowidth)&&(this.Z.width=this.Nb(this.Z.xCount)||1)),Li.api.$getSize.call(this,t,i)},$setSize:function(){Li.api.$setSize.apply(this,arguments)},type:{css:"",widthSize:function(t,i){return i.width+(-1<i.width?"px":"")},heightSize:function(t,i){return i.height+(-1<i.height?"px":"")},classname:function(t,i,s){var e="webix_list_item";return i.css&&(e+=" "+i.css),t.$css&&("object"==k(
  t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.$css&&(e+=" "+s.$css),e},aria:function(t,i,s){return'role="option"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count&&t.$template?'aria-expanded="true"':"")},template:function(t){return(t.icon?"<span class='webix_list_icon webix_icon "+t.icon+"'></span>":"")+t.value+(t.badge||0===t.badge?"<div class='webix_badge'>"+t.badge+"</div>":"")},width:"auto",templateStart:At('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>'),templateEnd:At("</div>")},$skin:function(){this.type.height=Xi.listItemHeight}},Zh={api:Jh,view:P.protoUI(Jh,cs,Hs,ds,ys,Ps,Ys,Us,Xh.view,us)},qh={name:"multiselect",$cssName:"richselect",defaults:{separator:","},Cb:function(t){var i=!g(t)&&"object"==k(t)&&!t.name,s={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button};this.Z.optionWidth?s.width=this.Z.optionWidth:s.fitMaster=!0,i&&P.extend(s,t,!0);var e=zt(s),n=e.getList();return"string"==typeof t?n.load(t):i||n.parse(t),e.attachEvent("onShow",function(){e.setValue(Pt(e.Z.master).config.value)}),e},$setValue:function(t){if(this.jm){var i=this.getPopup(),s="";i&&"object"==k(s=i.setValue(t))&&(s=s.join(this.config.separator+" ")),this.Z.text=s,this.getInputNode().innerHTML=s||this.Wm()}},getValue:function(){return this.Z.value||""}};$s.multiselect=P.extend({popupType:"multiselect"},$s.richselect),Tt(Zh.view,{name:"multilist",templateStart:At('<div webix_l_id="#!id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden;" {common.aria()}>')}),Tt(Zh.view,{name:"checklist",templateStart:At('<div webix_l_id="#!id#" {common.aria()} class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()}; overflow:hidden; white-space:nowrap;">{common.checkbox()}'),checkbox:function(t){var i=t.$checked?"wxi-checkbox-marked":"wxi-checkbox-blank";return"<span role='checkbox' tabindex='-1' aria-checked='"+(t.$checked?"true":"false")+"' class='webix_icon "+i+"'></span>"},aria:function(t){return"role='option' tabindex='-1' "+(t.$checked?"aria-selected='true'":"")},template:At("#value#")});P.protoUI(qh,Rh.view);var Kh={name:"multicombo",$cssName:"text",defaults:{keepText:!1,separator:",",icon:!1,iconWidth:0,tagMode:!0,tagTemplate:function(t){return t.length?t.length+" item(s)":""},template:function(t,i){return i.Lb(t,i)}},$init:function(){this.$view.className+=" webix_multicombo",this.attachEvent("onBeforeRender",function(){return this.Um||(this.Um=Xi.inputHeight),!0}),this.attachEvent("onAfterRender",function(){this.Cs=null})},on_click:{webix_multicombo_delete:function(t,i,s){var e;return!this.Z.readonly&&s&&(e=s.parentNode.getAttribute("optvalue"))&&this.Ob(e),!1},webix_inp_label:function(t){this.Db(t)},webix_inp_top_label:function(t){this.Db(t)}},ab:function(){var t=this.getInputNode().value;t&&this.Z.newValues&&100<new Date-(this.getPopup().Ub||0)&&this.Yb(t),this.Z.keepText||(this.Wb=""),this.refresh()},Ob:function(t){var i=this.Z.value,s=Pt(this.config.suggest);"string"==typeof i&&(i=i.split(this.Z.separator)),(i=p(m(i))).remove(t),this.setValue(i.join(this.Z.separator)),s&&s.Z.selectAll&&s.getBody().ji[0].setValue(0)},Gb:function(t){var i=Pt(this.config.suggest);if(i.getList().getItem(t)){var s=i.getValue();s&&"string"==typeof s&&(s=s.split(i.config.separator)),(s=p(s||[])).find(t)<0&&(s.push(t),i.setValue(s),this.setValue(i.getValue()))}},Yb:function(t){var i,s=Pt(this.config.suggest),e=s.getList();if(t=t.replace(/^\s+|\s+$/g,""))for(var n in e.data.pull)s.getItemText(n)==t&&(i=n);!i&&t&&(i=e.add({id:t,value:t})),this.Gb(i)},Cb:function(t){var i=!g(t)&&"object"==k(t)&&!t.name,s={view:"checksuggest",separator:this.config.separator,buttonText:this.config.buttonText,button:this.config.button},e=this;i&&P.extend(s,t,!0),!s.width&&this.Z.optionWidth&&P.extend(s,{width:this.Z.optionWidth,fitMaster:!1},!0),s.width=s.fitMaster||j(s.fitMaster)?0:s.width
  ;var n=zt(s);s.width||(n.$customWidth=function(){this.config.width=e.fb(e.Z)}),n.attachEvent("onBeforeShow",function(t,i,s){if(this.Z.master&&(this.setValue(Pt(this.Z.master).config.value),Pt(this.Z.master).getInputNode().value||this.isVisible()?(this.getList().refresh(),this.Xb=!0):this.getList().filter(),t.tagName&&"input"==t.tagName.toLowerCase()))return sh.api.show.apply(this,[t.parentNode,i,s]),!1});var h=n.getList();return"string"==typeof t?h.load(t):i||h.parse(t),n.Jb=function(){},n},Lb:function(t,i){var s,e,n,h,r,o,a,u,c,f,l,d,v="",_="top"==this.Z.labelPosition;return s="x"+z(),d=i.fb(t),e=t.inputAlign||"left",r=this.Um-2*Xi.inputPadding-2,h=this.Wb||"",u="<ul class='webix_multicombo_listbox' style='line-height:"+r+"px'></ul>",n="width: "+Math.min(d,i.Zb||7)+"px;height:"+r+"px;max-width:"+(d-20)+"px",l=t.readonly?" readonly ":"",o="<div class='webix_inp_static' onclick='' style='line-height:"+r+"px;width: "+d+"px;  text-align: "+e+";height:auto' >"+u+("<input id='"+s+"' role='combobox' aria-multiline='true' aria-label='"+At.escape(t.label)+"' tabindex='0' type='text' class='webix_multicombo_input' "+l+" style='"+n+"' value='"+h+"'/>")+"</div>",a=i.$renderLabel(t,s),f=this.Z.awidth-d-2*Xi.inputPadding,(c=(t.invalid?t.invalidMessage:"")||t.bottomLabel)&&(v="<div class='webix_inp_bottom_label' style='width:"+d+"px;margin-left:"+Math.max(f,Xi.inputPadding)+"px;'>"+c+"</div>"),_?a+"<div class='webix_el_box' style='width:"+this.Z.awidth+"px; '>"+o+v+"</div>":"<div class='webix_el_box' style='width:"+this.Z.awidth+"px; min-height:"+this.Z.aheight+"px;'>"+a+o+v+"</div>"},qb:function(){return this.Hf().getElementsByTagName("UL")[0]},Hm:function(){var t=this.getPopup();if(t){var i=t?t.setValue(this.Z.value):null;t.Kb&&(this.Z.value=t.Kb(this.Z.value));var s="",e=this.qb(),n=i&&i.length;if(n){var h=this.Um-2*Xi.inputPadding-8,r=this.Z.value;if("string"==typeof r&&(r=r.split(this.Z.separator)),this.Z.tagMode)for(var o=0;o<i.length;o++){var a="<span>"+i[o]+"</span><span class='webix_multicombo_delete' role='button' aria-label='"+ct.aria.removeItem+"'>x</span>";s+="<li class='webix_multicombo_value' style='line-height:"+h+"px;' optvalue='"+r[o]+"'>"+a+"</li>"}else s+="<li class='webix_multicombo_tag' style='line-height:"+h+"px;'><span>"+this.Z.tagTemplate(r)+"</span></li>"}e.innerHTML=s;var u=this.getInputNode();this.Z.placeholder&&(n?(u.placeholder="",!u.value&&20<u.offsetWidth&&(u.style.width="20px")):u.value||(u.placeholder=this.Z.placeholder,u.style.width=this.fb(this.Z)+"px")),!this.Z.tagMode&&e.firstChild&&(u.style.width=this.Qb()+"px")}this.tg()},ig:function(t){if(t=t||this.getInputNode())if(t.value.length){if(t.createTextRange){var i=t.createTextRange();i.moveStart("character",t.value.length),i.collapse(),i.select()}else if(t.selectionStart||"0"==t.selectionStart){var s=t.value.length;t.selectionStart=s,t.selectionEnd=s,t.focus()}}else t.focus()},tg:function(){var t="top"==this.Z.labelPosition,i=this.sg(),s=Math.max(i.offsetHeight+2*Xi.inputPadding,this.Um);if(t&&(s+=this.Cp),(s+=this.Z.bottomPadding||0)!=this.$getSize(0,0)[2]){var e=i.offsetHeight+(t?this.Cp:0),n=this.getTopParentView();clearTimeout(n.Vv),n.Vv=$(function(){var t=e+2*Xi.inputPadding;this.config.height!=t&&(this.config.height=t,this.resize()),this.eg&&(this.ig(this.getInputNode()),this.eg=!1),this.ng&&(this.Z.keepText?this.getInputNode().select():this.getInputNode().value="",this.ng=!1),(this.getPopup().isVisible()||this.eg)&&this.getPopup().show(this.sg())},this)}this.ng&&this.getInputNode().select()},sg:function(){for(var t=this.Hf(),i=t.childNodes,s=0;s<i.length;s++)if(i[s].className&&-1!=i[s].className.indexOf("webix_inp_static"))return i[s];return t},getInputNode:function(){return this.Hf().getElementsByTagName("INPUT")[0]},$setValue:function(){this.jm&&this.Hm()},getValue:function(t){if("object"==k(t)&&t.options)return this.hg();var i=this.Z.value;return i?"string"!=typeof i?i.join(this.Z.separator):i:""},getText:function(){var t=this.Z.value;if(!t)return"";"string"==typeof t&&(t=t.split(this.Z.separator));for(var i=[],s=0;s<t.length;s++)i.push(
  this.getPopup().getItemText(t[s]));return i.join(this.Z.separator)},hg:function(){var t,i,s,e=[],n=this.Z.value;if(!n)return[];for("string"==typeof n&&(n=n.split(this.Z.separator)),s=this.getPopup(),t=0;t<n.length;t++)(i=s.getList().getItem(n[t])||(s.rg?s.rg[n[t]]:null))&&e.push(i);return e},$setSize:function(t,i){var s=this.Z;if(Li.api.$setSize.call(this,t,i)){if(!t||!i)return;"top"==s.labelPosition&&(s.labelWidth=0),this.render()}},og:function(t){var i=document.createElement("span");i.className="webix_multicombo_input",i.style.visibility="visible",i.style.height="0px",i.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),document.body.appendChild(i);var s=i.offsetWidth+10;return document.body.removeChild(i),s},Qb:function(){var t=this.qb(),i=t.offsetWidth-t.firstChild.offsetWidth;return i<=25?t.offsetWidth-12:i-15},ob:function(){Nt(this.Hf(),"click",function(){this.getInputNode().focus()},{bind:this}),Nt(this.getInputNode(),"focus",function(){-1==this.Hf().className.indexOf("webix_focused")&&(this.Hf().className+=" webix_focused")},{bind:this}),Nt(this.getInputNode(),"blur",function(){this.Hf().className=this.Hf().className.replace(" webix_focused","")},{bind:this}),Nt(this.getInputNode(),"input",function(){!this.getInputNode().value&&this.Wb&&(this.getInputNode().style.width="20px",this.Zb=20,this.Wb="",this.eg=!0,this.getPopup().show(this.sg()),this.tg())},{bind:this}),Nt(this.getInputNode(),"keyup",function(t){var i,s,e=this.getInputNode();if(t=t||event,!this.Z.placeholder||this.Z.value||e.value?(s=i=this.og(e.value),!this.Z.tagMode&&this.qb().firstChild&&(s=this.Qb())):s=this.fb(this.Z),e.style.width=s+"px",i!=this.Zb?(this.Z.keepText||13!=t.keyCode?this.Wb=e.value:this.Wb=!1,this.eg=!0,this.Zb&&this.getPopup().show(this.sg()),this.Zb=i||s,this.tg()):this.ag!=this.getPopup().$height&&this.getPopup().show(this.sg()),-1<e.value.indexOf(this.Z.separator)&&this.Z.tagMode){var n=e.value.replace(this.Z.separator,"");if(n)if(this.Z.newValues)this.ng=!0,this.Yb(n);else{var h=this.getPopup().getItemId(n);h&&this.Gb(h)}this.Z.keepText?(this.Wb=n,e.value=n,this.ng=!0,this.eg=!0,this.tg()):e.value=""}},{bind:this}),Nt(this.getInputNode(),"keydown",function(t){if(this.ng=!1,this.isVisible()){t=t||event;var i=this.qb().lastChild;if(this.ag=this.getPopup().$height,8==t.keyCode&&i&&(!this.getInputNode().value&&100<(new Date).valueOf()-(this.ug||0)?(this.eg=!0,this.Ob(i.getAttribute("optvalue"))):this.ug=(new Date).valueOf()),13==t.keyCode||9==t.keyCode){var s=this.getInputNode(),e="",n=Pt(this.Z.suggest);n.getList().getSelectedId()||(s.value&&(e=n.getSuggestion(s.value)),this.Z.newValues?(13==t.keyCode&&(this.ng=!0),this.Yb(s.value),this.Z.keepText?this.Wb=s.value:s.value=""):e&&(9==t.keyCode?(this.eg=!1,this.Wb="",this.Zb=10,s.value="",this.Gb(e)):(this.ng=!0,this.Gb(e),this.Z.keepText?this.Wb=s.value:s.value=""))),13==t.keyCode&&(this.ng=!0,this.eg=!0,this.Z.keepText?this.Wb=s.value:s.value="")}}},{bind:this}),Pt(this.Z.suggest).linkInput(this)}},Qh=(P.protoUI(Kh,Rh.view),{name:"slider",$touchCapture:!0,defaults:{min:0,max:100,value:50,step:1,title:!1,moveTitle:!0,template:function(t,i){var s=i.cg="x"+z(),e="",n="<div class='webix_slider_title"+(t.moveTitle?" webix_slider_move":"")+"'"+(!t.moveTitle&&t.vertical?" style='line-height:"+(t.aheight-2*t.inputPadding)+"px;'":"")+">&nbsp;</div>",h="<div class='webix_slider_left'>&nbsp;</div>",r="<div class='webix_slider_right'></div>",o="<div class='webix_slider_handle' webix_disable_drag='true' role='slider' aria-label='"+t.label+(t.title?" "+t.title(t):"")+"' aria-valuemax='"+t.max+"' aria-valuemin='"+t.min+"' aria-valuenow='"+t.value+"' tabindex='0' id='"+s+"'>&nbsp;</div>";return e=t.vertical?"<div class='webix_slider_box'>"+r+h+o+"</div>"+n:n+"<div class='webix_slider_box'>"+h+r+o+"</div>",i.$renderInput(t,e,s)}},type_setter:function(t){this.et.className+=" webix_slider_"+t},title_setter:function(t){return"string"==typeof t?At(t):t},fg:function(){return this.$view.querySelector(".webix_slider_handle")},Hm:function(){var t=this.fg(),i=this.Z;if(t){
  var s=i.vertical?this.Is:this.fb(i),e=i.value%i.step?Math.round(i.value/i.step)*i.step:i.value,n=i.max-i.min;e=Math.max(Math.min(e,i.max),i.min),e=i.vertical?n-(e-i.min):e-i.min;var h=Math.ceil((s-2*this.lg)*e/n),r=s-2*this.lg-h,o=i.vertical?"top":"left",a=i.vertical?"height":"width";t.style[o]=this.lg+h-this.dg/2+"px",t.parentNode.style[a]=s+"px",r=Math.min(Math.max(r,2*this.vg),s-2*this.lg-2*this.vg),h=Math.min(Math.max(h,2*this.vg),s-2*this.lg-2*this.vg);var u=t.previousSibling;u.style[a]=r+"px",u.previousSibling.style[a]=h+"px",this._g(t,h,r,o)}},_g:function(t,i,s,e){var n=this.Z;if(this.Z.title){var h=t.parentNode[n.vertical?"nextSibling":"previousSibling"];if(h.innerHTML=this.Z.title(this.Z,this),this.Z.moveTitle){var r=0;if(n.vertical)r=i+2*this.vg-this.dg/2;else{var o=h.clientWidth/2,a=i<o?o-i-2*this.vg:0,u=s<o?o-s-2*this.vg-this.dg/2:0;r=this.lg+i-o+a-u}h.style[e]=r+"px"}}},pg:function(){this.fg().setAttribute("aria-valuenow",this.Z.value)},refresh:function(){var t=this.fg();t&&(this.pg(),this.Z.title&&t.setAttribute("aria-label",this.Z.label+" "+this.Z.title(this.Z,this)),this.Hm())},value_setter:function(t){return this.$prepareValue(t)},$setValue:function(){this.refresh()},$getValue:function(){return this.Z.value},$prepareValue:function(t){return t=parseFloat(t),isNaN(t)?0:t},$init:function(t){S.touch?this.attachEvent("onTouchStart",C(this.mg,this)):Nt(this.et,"mousedown",C(this.mg,this)),Nt(this.$view,"keydown",C(this.gg,this)),t.vertical&&(t.height=t.height||Xi.vSliderHeight,this.et.className+=" webix_slider_vertical",this.lg=Xi.vSliderPadding)},$skin:function(){this.dg=Xi.sliderHandleWidth,this.lg=Xi.sliderPadding,this.vg=Xi.sliderBorder},gg:function(t){var i=t.keyCode,s=this.Z,e=s.value;if(32<i&&i<41){Q(t);var n=t.target||t.srcElement,h=/webix_slider_handle_(\d)/.exec(n.className);if(this.wg=h?parseInt(h[1],10):-1,h&&(e=s.value[this.wg]),e=e<s.min?s.min:e>s.max?s.max:e,36===i)e=s.min;else if(35===i)e=s.max;else{var r=37===i||40===i||34===i?-1:1;(33===i||34===i||1<s.step)&&(r*=s.step),e=1*e+r}if(h){var o=s.value[this.wg?0:1];e=this.wg&&e<=o||!this.wg&&o<=e?o:e}if(e>=s.min&&e<=s.max){if(h){for(var a=[],u=0;u<s.value.length;u++)a[u]=u===this.wg?e:s.value[u];e=a}this.setValue(e),this.wg=-1}}},mg:function(t){if(!this.xg){var i=t.target||t.srcElement;this.yg&&this.yg(t);var s=this.Z.value;if(g(s)&&(s=m(s)),-1!=i.className.indexOf("webix_slider_handle"))return this.Mg=s,this.Sg.apply(this,arguments);-1!=i.className.indexOf("webix_slider")&&(this.Mg=s,this.Z.value=this.kg.apply(this,arguments),this.Sg(t))}},Sg:function(){S.touch?this.xg=[this.attachEvent("onTouchMove",C(this.Cg,this)),this.attachEvent("onTouchEnd",C(this.$g,this))]:this.xg=[Lt(document.body,"mousemove",C(this.Cg,this)),Lt(window,"mouseup",C(this.$g,this))],st(document.body,"webix_noselect")},$g:function(){this.xg&&(S.touch?(this.detachEvent(this.xg[0]),this.detachEvent(this.xg[1])):(Ot(this.xg[0]),Ot(this.xg[1])),this.xg=null),et(document.body,"webix_noselect");var t=this.Z.value;g(t)&&(t=m(t)),this.Z.value=this.Mg,this.setValue(t),this.fg(this.wg).focus(),this.wg=-1},Cg:function(){this.Z.value=this.kg.apply(this,arguments),this.refresh(),this.callEvent("onSliderDrag",[])},kg:function(t,i){var s=0,e=this.Z.vertical?"y":"x";return s=S.touch?i?i[e]:t[e]:K(t)[e],this.Dg(s)},Dg:function(t){var i=this.Z,s=i.max-i.min,e=i.vertical?"y":"x",n=Z(this.fg().parentNode)[e]+this.lg,h=(i.vertical?this.Is:this.fb(i))-2*this.lg,r=h?(t-n)*s/h:0;return i.vertical&&(r=s-r),r=Math.round((r+1*i.min)/i.step)*i.step,Math.max(Math.min(r,i.max),i.min)},ob:function(){}}),tr={api:Qh,view:P.protoUI(Qh,$h.view)},ir={name:"rangeslider",$cssName:"slider webix_rangeslider",defaults:{separator:",",value:[20,80],template:function(t,i){var s="x"+z();i.cg=[s+"_0",s+"_1"];var e="role='slider' aria-label='"+t.label+(t.title?" "+t.title(t):"")+"' aria-valuemax='"+t.max+"' aria-valuemin='"+t.min+"' tabindex='0'",n="<div class='webix_slider_handle webix_slider_handle_0' webix_disable_drag='true' id='"+i.cg[0]+"' "+e+" aria-valuenow='"+t.value[0]+"'>&nbsp;</div>"
  ;n+="<div class='webix_slider_handle webix_slider_handle_1' webix_disable_drag='true' id='"+i.cg[1]+"' "+e+" aria-valuenow='"+t.value[1]+"'>&nbsp;</div>";var h="<div class='webix_slider_title"+(t.moveTitle?" webix_slider_move":"")+"'"+(!t.moveTitle&&t.vertical?" style='line-height:"+(t.aheight-i.lg-2*t.inputPadding)+"px;'":"")+">&nbsp;</div>";t.moveTitle&&(h="<div class='webix_slider_title_box'>"+(h+h)+"</div>");var r="<div class='webix_slider_right'>&nbsp;</div><div class='webix_slider_left'></div>",o="";return o=t.vertical?"<div class='webix_slider_box'>"+r+n+"</div>"+h:h+"<div class='webix_slider_box'>"+r+n+"</div>",i.$renderInput(t,o,s)}},$prepareValue:function(t){if(g(t)||(t=(t||"").toString().split(this.Z.separator)),t[0]=parseFloat(t[0]),t[0]=isNaN(t[0])?0:t[0],t.length<2?t[1]=t[0]:(t[1]=parseFloat(t[1]),t[1]=isNaN(t[1])?0:t[1]),t[0]>t[1]){var i=[t[1],t[0]];t[0]=i[0],t[1]=i[1]}return t},fg:function(t){return t=t&&0<=t?t:0,this.$view.querySelector(".webix_slider_handle_"+(t||0))},Ig:function(t,i){var s,e,n;return e=(s=this.Z).max-s.min,n=s.value[i]%s.step?Math.round(s.value[i]/s.step)*s.step:s.value[i],n=Math.max(Math.min(n,s.max),s.min),Math.ceil((t-2*this.lg)*(n-s.min)/e)},Ag:function(t,i,s){var e=this.lg+i-this.dg/2*(s?-1:1);return(e=s?t-e:e)+"px"},Tg:function(t,i,s,e){var n=i+this.lg+2*this.vg;return e&&(n=t-n-s),n+"px"},Hm:function(){var t,i,s,e,n,h,r,o,a,u,c;i=this.fg(0),s=this.fg(1),g((t=this.Z).value)||this.define("value",t.value),i&&(a=t.vertical?"height":"width",c=t.vertical?"top":"left",h=(u=t.vertical?this.Is:this.fb(t))-2*this.lg-2*this.vg,e=this.Ig(u,0),r=(n=this.Ig(u,1))-e,i.style[c]=this.Ag(u,e,t.vertical),s.style[c]=this.Ag(u,n,t.vertical),(o=i.parentNode).style[a]=u+"px",o.firstChild.style[a]=h+"px",o.childNodes[1].style[a]=r+"px",o.childNodes[1].style[c]=this.Tg(u,e,r,t.vertical),this._g(i,[e,n],h,c))},Fg:0,zg:function(t,i){j(this.Fg)||(t[this.Fg].style.visibility="visible"),j(i)||(t[i].style.visibility="hidden",this.Fg=i)},_g:function(t,i,s,e){var n=this.Z;if(this.Z.title){var h=t.parentNode,r=n.vertical?"nextSibling":"previousSibling";if(n.moveTitle){for(var o=h[r].childNodes,a=[],u=0;u<2;u++)a.push(this.Vg(o[u],n.value[u],i[u],s,e,u));var c=n.vertical?a[0]-a[1]-this.dg:a[1]-a[0],f=n.vertical?"clientHeight":"clientWidth";o[0][f]/2+o[1][f]/2>c?this.zg(o,j(this.wg)?0:this.wg?0:1):this.zg(o);for(var l=0;l<2;l++)o[l].style[e]=a[l]+"px"}else h[r].innerHTML=this.Z.title(this.Z,this)}},Vg:function(t,i,s,e,n,h){t.innerHTML=this.Z.title({value:i},this);var r=t.clientWidth/2,o=0;return o=this.Z.vertical?e-s-this.dg/2-(h?this.lg:0)+2*this.vg:(o=s+this.dg/2+2*this.vg-r,o=s<r?r-s+o:o,h&&e<r+s?o-r+(e-s):o)},pg:function(){for(var t=0;t<2;t++)this.fg(t).setAttribute("aria-valuenow",this.Z.value[t])},yg:function(t){var i=t.target||t.srcElement,s=/webix_slider_handle_(\d)/.exec(i.className);this.wg=s?parseInt(s[1],10):-1,s&&this.Bg(this.wg)},$compareValue:function(t,i){return i=this.$prepareValue(i),t[0]===i[0]&&t[1]===i[1]},$getValue:function(){var t=this.Z.value;return this.Z.stringResult?t.join(this.Z.separator):t},Bg:function(t){var i=this.fg(t),s=this.fg(1-t);-1==i.className.indexOf("webix_slider_active")&&(i.className+=" webix_slider_active"),s.className=s.className.replace(" webix_slider_active",""),i.focus()},Dg:function(t){var i=this.Z,s=i.value,e=i.max-i.min,n=i.vertical?"y":"x",h=Z(this.fg().parentNode)[n],r=Math.ceil((t-h)*e/(i.vertical?this.Is:this.fb(i)));r=Math.round((r+1*i.min)/i.step)*i.step,i.vertical&&(r=e-r);var o=null,a=Z(this.fg(0))[n],u=Z(this.fg(1))[n];a!=u||i.value[0]!=i.min&&i.value[0]!=i.max?0<=this.wg?o=this.wg:a==u?o=t<a?0:1:(o=Math.abs(a-t)<Math.abs(u-t)?0:1,this.wg=o):(this.wg=o=i.value[0]==i.min?1:0,this.Bg(o));return s[o]=o?Math.max(Math.min(r,i.max),s[0]):Math.max(Math.min(r,s[1]),i.min),s}},sr=(P.protoUI(ir,tr.view),{name:"switch",defaults:{template:function(t,i){i.Hg();var s=t.name||"x"+z(),e="";t.labelRight&&(e="<label class='webix_label_right'>"+t.labelRight+"</label>",t.labelWidth&&(t.label=t.label||"&nbsp;"));var n=t.checkValue==t.value,h='aria-label="'+(
  t.label||t.labelRight||"")+'" role="checkbox" tabindex="0" aria-checked="'+(n?"true":"false")+'" '+(t.readonly?"aria-readonly='true'":"")+'"',r='<div class="webix_switch_box '+(n?" webix_switch_on":"")+'" style="width:'+i.Rg+'px"><span class="webix_switch_text">'+((n?t.onLabel:t.offLabel)||"")+'</span><button class="webix_switch_handle" '+h+' style="left:'+(n?i.Rg-i.Pg:0)+'px;"><input  id="'+s+'" class="webix_switch_toggle" type="checkbox" '+(n?"checked":"")+"></button></div>"+e;return i.$renderInput(t,r,s)}},$skin:function(){this.Pg=Xi.switchHeight,this.Rg=Xi.switchWidth},$setValue:function(t){var i=this.Z,s=t==i.checkValue,e=this.$view.querySelector(".webix_switch_box");if(e){var n=e.childNodes[1],h=(s?i.onLabel:i.offLabel)||"";s?st(e,"webix_switch_on"):et(e,"webix_switch_on"),n.style.left=(s?this.Rg-this.Pg:0)+"px",n.firstChild.checked=s,n.setAttribute("aria-checked",s?"true":"false"),h&&(e.childNodes[0].innerHTML=h)}},Hg:function(){var t=this.Z;if(t.onLabel||t.offLabel){var i=t.onLabel?nt(t.onLabel,"webix_switch_text").width:0,s=t.onLabel?nt(t.offLabel,"webix_switch_text").width:0;this.Rg=Math.max(i,s)+this.Pg}},on_click:{webix_switch_box:function(){this.Z.readonly||this.toggle()},webix_label_right:function(){this.Z.readonly||this.toggle()}}}),er=(P.protoUI(sr,Th.view),{name:"tabbar",$init:function(){this.attachEvent("onKeyPress",this.zs)},$skin:function(){var t=Xi,i=this.defaults;i.topOffset=t.tabTopOffset||0,i.tabOffset="undefined"!=typeof t.tabOffset?t.tabOffset:10,i.bottomOffset=t.tabBottomOffset||0,i.height=t.tabbarHeight,i.tabMargin=t.tabMargin,i.inputPadding=t.inputPadding,i.tabMinWidth=t.tabMinWidth||100,i.tabMoreWidth=t.tabMoreWidth||40,i.borderless=!t.tabBorder},jg:function(){var t,i,s=this.Z,e=this.Eg||s.options,n=this.Lm-2*s.tabOffset,h=s.optionWidth||s.tabMinWidth;if(i=e.length,s.tabMinWidth&&n/i<h)return{max:parseInt(n/h,10)||1};if(!s.optionWidth)for(t=0;t<i;t++)e[t].width&&(n-=e[t].width+(t||s.type?0:s.tabMargin),i--);return{width:i?n/i:s.tabMinWidth}},pb:function(){var t=this.Z;if(!t.tabbarPopup){var i=zt({view:"popup",width:t.popupWidth||200,body:{view:"list",borderless:!0,select:!0,css:"webix_tab_list",autoheight:!0,yCount:t.yCount,type:{template:t.popupTemplate}}});i.getBody().attachEvent("onBeforeSelect",C(function(t){if(t&&this.callEvent("onBeforeTabClick",[t]))return this.setValue(t),Pt(this.Z.tabbarPopup).hide(),this.callEvent("onAfterTabClick",[t]),!0},this)),i.getBody().attachEvent("onAfterSelect",C(function(){this.refresh()},this)),t.tabbarPopup=i.Z.id,this.ht.push(i)}this.pb=function(){}},getPopup:function(){return this.pb(),Pt(this.Z.tabbarPopup)},moreTemplate_setter:At,popupTemplate_setter:At,defaults:{popupWidth:200,popupTemplate:"#value#",yCount:7,moreTemplate:'<span class="webix_icon wxi-dots"></span>',template:function(t,i){var s,e,n,h,r,o,a,u,c;if(i.Eg=a=i.Ab(t.options),a.length){i.vu(a),!t.value&&a.length&&(t.value=a[0].id),s="",t.tabOffset&&(s+="<div class='webix_tab_filler' style='width:"+t.tabOffset+"px;'>&nbsp;</div>"),i.Lm-2*t.tabOffset-(t.type?0:t.tabMargin*(a.length-1)),u=t.topOffset+t.bottomOffset;var f=i.jg();if(f.max&&f.max<a.length){var l=i.getPopup();l.hide();var d=l.getBody()||null;if(d)if(f.max){var v=!1;for(e=0;e<a.length&&!v;e++)if(a[e].id==t.value&&(v=!0,e+1>f.max)){var _=a.splice(e,1);a=a.splice(0,f.max-1).concat(_).concat(a)}d.clearAll(),d.parse(a.slice(f.max))}else d.clearAll()}else i.Z.tabbarPopup&&Pt(i.Z.tabbarPopup).hide();o=t.tabOffset;var p=!1;for(e=0;e<a.length&&!p;e++)c=f&&f.max?(f.max==e+1&&(p=!0),(i.Lm-2*t.tabOffset-(!t.type&&1<f.max?t.tabMargin*(f.max-1):0)-t.tabMoreWidth)/f.max):f.width,o+=(c=a[e].width||t.optionWidth||c)+(e&&!t.type?t.tabMargin:0),0<t.tabMargin&&e&&!t.type&&(s+="<div class='webix_tab_filler' style='width:"+t.tabMargin+"px;'></div>"),s+=i.Ng(a[e],c),p&&(s+='<div role="button" tabindex="0" aria-label="'+ct.aria.showTabs+'" class="webix_tab_more_icon" style="width:'+t.tabMoreWidth+'px;">'+t.moreTemplate(t,i)+"</div>",o+=t.tabMoreWidth);0<(n=i.$s-o)&&!t.type&&(s+="<div class='webix_tab_filler' style='width:"+n+"px;'>&nbsp;</div>")
  }else s="<div class='webix_tab_filler' style='width:"+i.Lm+"px; border-right:0px;'></div>";return h="",r=u&&!t.type?"height:"+(i.Is-u)+"px":"",t.topOffset&&!t.type&&(h+="<div class='webix_before_all_tabs' style='width:100%;height:"+t.topOffset+"px'></div>"),h+="<div style='"+r+"' role='tablist' class='webix_all_tabs "+(t.type?"webixtype_"+t.type:"")+"'>"+s+"</div>",t.bottomOffset&&!t.type&&(h+="<div class='webix_after_all_tabs' style='width:100%;height:"+t.bottomOffset+"px'></div>"),h}},lu:function(){return this.$view.querySelectorAll(".webix_item_tab")},Ng:function(t,i){var s,e="",n="",h=this.config;if(t.id==h.value&&(e=" webix_selected"),t.css&&(e+=" "+t.css),h.tooltip&&(n=" webix_t_id='"+t.id+"'"),i=t.width||i,s='<div class="webix_item_tab'+e+'" button_id="'+t.id+'" role="tab" aria-selected="'+(t.id==h.value?"true":"false")+'" tabindex="'+(t.id==h.value?"0":"-1")+'" style="width:'+i+'px;"'+n+">",this.Lg){var r=this.Is-2*h.inputPadding-2,o=this.Is-2,a=P.extend({cheight:r,aheight:o},t);s+=this.Lg(a)}else{s+=(t.icon?"<span class='webix_icon "+t.icon+"'></span> ":"")+t.value}return(t.close||h.close)&&(s+="<span role='button' tabindex='0' aria-label='"+ct.aria.closeTab+"' class='webix_tab_close webix_icon wxi-close'></span>"),s+="</div>"},Hf:function(){return this.mt.firstChild},hv:{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.Z.tabOffset=0,this.hv[t]&&(this.Lg=At(this.hv[t])),t}}),nr=(P.protoUI(er,Oh.view),{name:"richtext",defaults:{label:"",labelWidth:80,labelPosition:"left"},$init:function(){this.et.className+=" webix_richtext",this.$ready.unshift(this.Og)},getInputNode:function(){return this.$view.querySelector(".webix_richtext_editor")},Ug:function(t){return{view:"toggle",type:"iconButton",icon:"wxi-"+t,name:t,id:t,label:ct.richtext[t],autowidth:!0,action:t,click:this.Yg}},Og: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.jm=!0,t.refresh(),Nt(t.getInputNode(),"blur",function(){t.Wg(this.innerHTML)}),Nt(t.getInputNode(),"keyup",function(){t.Gg()})}},onClick:{webix_richtext_editor:function(){t.Gg()}}},s={view:"toolbar",id:"toolbar",elements:[this.Ug("underline"),this.Ug("bold"),this.Ug("italic"),{}]},e=[s,i];"top"!==this.config.labelPosition&&this.config.labelWidth?(this.config.borderless=!0,this.cols_setter([{template:this.config.label||" ",css:"webix_richtext_inp_label"+(this.config.required?" webix_required":""),borderless:!0,width:this.config.labelWidth},{rows:e}])):(s.elements.concat([{view:"label",label:this.config.label,align:"right"},{width:4}]),this.rows_setter(e))},Gg:function(){var t;this.$$("toolbar").setValues({italic:!1,underline:!1,bold:!1}),t=window.getSelection?window.getSelection():document.selection.createRange();for(var i=0;i<t.rangeCount;++i)this.$view.contains(this.getInputNode())&&(document.queryCommandState("bold")&&this.$$("bold").setValue(!0),document.queryCommandState("underline")&&this.$$("underline").setValue(!0),document.queryCommandState("italic")&&this.$$("italic").setValue(!0))},refresh:function(){this.jm&&(this.getInputNode().innerHTML=this.config.value||"")},Xg:function(t){var i,s;if(window.getSelection){s=(i=window.getSelection()).toString().length;var e=this.getInputNode();if(e.contains(i.anchorNode)&&e.contains(i.focusNode)&&0<s)for(var n=0;n<i.rangeCount;++n){var h=i.getRangeAt(n);if(i.isCollapsed){var r=i.focusNode.textContent,o=i.focusNode,a=i.anchorOffset,u=r.substring(0,a).match(/[A-Za-z]*$/
  )[0],c=r.substring(a).match(/^[A-Za-z]*/)[0],f=a-u.length,l=a+c.length;h.setStart(o,f),h.setEnd(o,l),i.removeAllRanges(),i.addRange(h),document.execCommand(t,!1,"")}else document.execCommand(t,!1,"")}}},Yg:function(){this.getTopParentView().Xg(this.config.action)},focus:function(){if(!Ii.canFocus(this))return!1;this.getInputNode().focus()},Wg:function(t){var i=this.config.value;this.config.value=t||"",i!==t&&this.callEvent("onChange",[t,i])},setValue:function(t){this.Wg(t),this.refresh()},getValue:function(){this.getInputNode()&&(this.config.value=this.getInputNode().innerHTML);var t=this.config.value;return t||(0===t?"0":"")}});P.protoUI(nr,Bs,$n.view);Tt(Zh.view,{name:"uploader",template:"{common.removeIcon()}{common.percent()}<div style='float:right'>#sizetext#</div>{common.fileName()}",percent:function(t){return"transfer"==t.status?"<div style='width:60px; text-align:center; float:right'>"+t.percent+"%</div>":"<div class='webix_upload_"+t.status+"'><span class='"+("error"==t.status?"error_icon":"webix_icon wxi-check")+"'></span></div>"},removeIcon:function(){return"<div class='webix_remove_upload'><span class='cancel_icon'></span></div>"},fileName:function(t){return"<div style='text-overflow:ellipsis; white-space:nowrap; overflow:hidden; padding-right:8px;'>"+t.name+"</div>"},on_click:{webix_remove_upload:function(t,i){Pt(this.config.uploader).files.remove(i)}}});var hr={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(){"material"!=Ji&&"mini"!=Ji||(this.defaults.css="webix_primary")},$init:function(){var t=ge.html5;this.files=new Dh,this.ht=[this.files],(j(XMLHttpRequest)||j((new XMLHttpRequest).upload))&&(t=ge.flash),P.extend(this,t,!0)},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()},apiOnly_setter:function(t){return $(this.render,this),this.$apiOnly=t},Yf:function(t){for(var i=0;i<t.length;i++)this.addFile(t[i])},link_setter:function(t){return t&&$(function(){var t=Pt(this.Z.link);if(!t){var i=this.getTopParentView();i.$$&&(t=i.$$(this.Z.link))}t.sync&&t.filter?t.sync(this.files):t.setValues&&this.files.data.attachEvent("onStoreUpdated",function(){t.setValues(this)}),t.Z.uploader=this.Z.id},this),t},addFile:function(t,i,s,e){var n=null;"object"==k(t)&&(t=(n=t).name,i=n.size);var h=this.Of(i);s=s||t.split(".").pop();var r={file:n,name:t,id:z(),size:i,sizetext:h,type:s,context:this.Xf,status:"client"};if(n&&n.webkitRelativePath&&(r.name=n.webkitRelativePath),e&&P.extend(r,e,!0),this.callEvent("onBeforeFileAdd",[r])){this.Z.multiple||this.files.clearAll();var o=this.files.add(r);this.callEvent("onAfterFileAdd",[r]),o&&this.Z.autosend&&this.send(o)}return r},Nf:function(t){var i=this.Z.upload,s=P.extend(t.urlData||{},this.Z.urlData||{});if(i&&s){var e=[];for(var n in s)e.push(encodeURIComponent(n)+"="+encodeURIComponent(s[n]));e.length&&(i+=(-1==i.indexOf("?")?"?":"&")+e.join("&"))}return i},addDropZone:function(t,i){var s=D(t),e="";i&&(e=" "+L({content:'"'+i+'"'},":before"));var n="webix_drop_file"+e,h=null;Nt(s,"dragover",Q),Nt(s,"dragover",function(){st(s,n,!0),h&&(clearTimeout(h),h=null)}),Nt(s,"dragleave",function(){h=setTimeout(function(){et(s,n)},150)}),Nt(s,"drop",C(function(t){return et(s,n),this.Uf(t),Q(t)},this))},Of:function(t){for(var i=0;1024<t;)i++,t/=1024;return Math.round(100*t)/100+" "+ct.fileSize[i]},Zf:function(t,i){var s=this.files.getItem(t);P.extend(s,i,!0),s.status="server",s.progress=100,this.callEvent("onFileUpload",[s,i]),this.callEvent("onChange",[]),this.files.updateItem(t),this.isUploaded()&&this.Lf(i)},Lf:function(t){this.callEvent("onUploadComplete",[t]),this.Ef&&(this.Ef.call(this,t),this.Ef=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(",")}},rr=(P.protoUI(hr,wh.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:At,filter_setter:function(t){return b(t,this.$scope)},Jg:!0,$init:function(t){var i={};P.extend(i,m(this.defaults.body)),i.view=t.type||this.defaults.type;var s=this.Zg(i);t.body&&P.extend(s,t.body,!0),t.data&&(s.data=t.data),t.url&&(s.url=t.url),t.datatype&&(s.datatype=t.datatype),t.id&&(i.id=i.id||t.id+"_"+i.view),t.body=i,this.$ready.push(this.qg),this.attachEvent("onShow",function(){if(this.Z.master){var t=Pt(this.Z.master);if(t)(t.sg?t.sg():t.getInputNode()).setAttribute("aria-expanded","true")}this.Kg()}),this.attachEvent("onHide",function(){if(this.Z.master){var t=Pt(this.Z.master);if(t)(t.sg?t.sg():t.getInputNode()).setAttribute("aria-expanded","false")}}),this.Qg={}},Zg:function(t){return t},tw:function(t){var i;if(t&&this.Z.master){var s=Pt(this.Z.master),e=t.id?this.getItemText(t.id):t.text||t.value;(i=s.getInputNode())&&s.$setValueHere?s.$setValueHere(e):i&&(s.options_setter?e=this.getItemText(t.id):t.value&&(e=s.gb?s.gb(t.value):t.value.toString()),j(i.value)?i.innerHTML=e:i.value=e.replace(/<[^>]*>/g,""))}(i=i||this.wa)&&i.focus()},setMasterValue:function(t,i){var s=t.id?this.getItemText(t.id):t.text||t.value;if(this.Z.master){var e=Pt(this.Z.master);i&&t.id?e.refresh():e.options_setter?e.setValue(t.$empty?"":t.id):e.setValueHere?e.setValueHere(s):e.setValue(s)}else this.wa&&(this.wa.value=s);i||(this.hide(),this.wa&&this.wa.focus()),this.callEvent("onValueSuggest",[t,s]),$(function(){A("onEditEnd",[])})},getMasterValue:function(){return this.Z.master?Pt(this.Z.master).getValue():null},getItemId:function(t){var i=this.getList();for(var s in i.data.pull){var e=i.getItem(s);if(this.Z.filter.call(this,e,t))return e.id}},getItemText:function(t){var i=this.getList().getItem(t);if(!i)return this.Qg[t]||"";if(this.Z.template)return this.Z.template.call(this,i,this.type);if(this.Z.textValue)return""+i[this.Z.textValue];var s=this.getList().type,e=s.template.call(s,i,s);return this.Qg[t]=e},getSuggestion:function(t){var i,s=this.getList(),e=s.data.order;return s.getSelectedId&&(i=s.getSelectedId()),t&&e.length&&(!i||e.find(i)<0)&&(i=e[0],!s.config.dataFeed&&!this.config.filter.call(this,s.data.pull[i],t))?null:(i&&"object"==k(i)&&(i+=""),i)},getList:function(){return this.q},qg:function(){var i=this.getList(),t=this.Z.type;i.count?(i.attachEvent("onItemClick",C(function(t){this.setMasterValue(i.getItem(t))},this)),i.data.attachEvent("onstoreupdated",C(function(t,i,s){"delete"==s&&t==this.getMasterValue()?this.setMasterValue({id:"",text:""},1):"update"==s&&t==this.getMasterValue()&&this.setMasterValue(i,1)},this)),i.data.attachEvent("onAfterFilter",C(this.Jb,this)),i.data.attachEvent("onStoreLoad",C(this.Jb,this)),j(this.Z.fitMaster)&&(this.Z.fitMaster=!0)):"calendar"==t?(i.attachEvent("onDateSelect",function(){this.getParentView().setMasterValue({value:i.getSelectedDate()},i.config.multiselect)}),i.attachEvent("onTodaySet",function(t){this.getParentView().setMasterValue({value:t})}),i.attachEvent("onDateClear",function(t){this.getParentView().setMasterValue({value:t})})):"colorboard"==t&&i.attachEvent("onItemClick",function(t){this.getParentView().setMasterValue({value:t})})},input_setter:function(t){return this.linkInput(t),0},linkInput:function(i){var s;i.getInputNode?(s=i.getInputNode()).webix_master_id=i.Z.id:s=D(i),Nt(s,"keydown",function(t){s==document.body&&!this.isVisible()||(i.config?i.config.readonly:s.getAttribute("readonly"))||this.iw(t)},{bind:this}),i.sg&&(s=i.sg()),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-expanded","false"),
  "DIV"===s.tagName&&(s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true")),this.sw=!0},iw:function(t){t=t||event;var s=this.getList(),e=t.target||t.srcElement;if((e!=document.body||this.isVisible())&&"webix_clipbuffer"!=e.className){this.wa=e,this.Z.master=e.webix_master_id,window.clearTimeout(this.ew);var i=t.keyCode;if(16!=i&&17!=i)return 9==i?this.nw(this,s):27==i?this.hw(this,s):13==i?(this.isVisible()&&Q(t),this.$enterKey(this,s)):this.rw(t)&&this.isVisible()?(Q(t),!1):void(j(e.value)||(clearTimeout(this.ow),this.ow=$(function(){if(this.sw||Ii.getFocus()==Pt(this.Z.master)){this.aw=!0;var i=e.value;s.config.dataFeed?s.filter("value",i):s.filter&&s.filter(C(function(t){return this.Z.filter.call(this,t,i)},this))}},this,[],this.Z.keyPressTimeout)))}},Jb:function(){if(!this.aw)return!0;this.aw=!1,0<this.getList().count()?(this.adjust(),this.isVisible()||(this.Xb=!0),this.show(this.wa,null,!0),this.Xb=!1):(this.hide(),this.wa=null)},show:function(t){if(!this.isVisible()){var i=this.getList();i.filter&&!this.Xb&&i.filter(""),this.$customWidth?this.$customWidth(t):t.tagName&&this.Z.fitMaster&&(this.Z.width=t.offsetWidth-2),i.nv&&i.render(),this.adjust(),"INPUT"==t.tagName&&(this.wa=t)}sh.api.show.apply(this,arguments)},Kg:function(t){t=t||this.getList();var i=this.getMasterValue();t.select&&t.showItem?i&&t.exists&&t.exists(i)?(t.select(i),t.showItem(i)):(t.unselect(),t.showItem(t.getFirstId())):t.setValue&&(this.Z.master&&(i=Pt(this.Z.master).$prepareValue(i)),t.setValue(i))},$enterKey:function(t,i){var s,e,n=t.isVisible();this.Z.master&&(e=Pt(this.Z.master)),e&&e.Z.editable&&e.yi?e.yi():(i.count&&i.count()?(s=i.getSelectedId(!1,!0),1==i.count()&&i.getFirstId()!=s&&(s=i.getFirstId()),s&&(s=i.getItem(s))):i.getSelectedDate&&i.getSelectedDate()?s={value:i.getSelectedDate()}:i.getValue&&i.getValue()&&(s={value:i.getValue()}),s&&this.setMasterValue(s)),n?t.hide():this.Jg&&t.show(this.wa)},hw:function(t){return t.hide()},nw:function(t){return t.hide()},rw:function(t){var i,s=this.getList(),e=t.keyCode;if(!(s.moveSelection&&e<41&&32<e)||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return!1;if(40===e||38===e){this.Jg&&!this.isVisible()&&this.show(this.wa);var n=38===e?"up":"down";s.moveSelection(n,!1,!1)}else{if(s.count||!s.count&&!s.isVisible())return!1;var h;33==e&&(h="pgup"),34==e&&(h="pgdown"),35==e&&(h="bottom"),36==e&&(h="top"),37==e&&(h="left"),39==e&&(h="right"),s.moveSelection(h,!1,!1)}return s.count?i=s.getSelectedItem():s.getSelectedDate?i={value:s.getVisibleDate()}:s.getValue&&(i={value:s.getValue()}),this.isVisible()&&this.tw(i),!0},getValue:function(){var t=this.getList(),i=(t.getValue?t.getValue():t.getSelectedId())||"";if(i=i.id||i,t.getItem){var s=t.getItem(i);if(s&&s.$empty)return""}return i},setValue:function(t){var i=this.getList();t?i.exists(t)&&(i.select(t),i.showItem(t)):(i.unselect(),i.showItem(i.getFirstId()))}}),or={api:rr,view:P.protoUI(rr,sh.view)},ar={name:"multisuggest",defaults:{separator:",",type:"layout",button:!0,width:0,filter:function(t,i){return-1<this.getItemText(t.id).toString().toLowerCase().indexOf(i.toLowerCase())},body:{rows:[{view:"list",type:"multilist",borderless:!0,autoheight:!0,yCount:5,multiselect:"touch",select:!0,on:{onItemClick:function(t){var i=this.getParentView().getParentView();$(function(){i.uw(t)})}}},{view:"button",click:function(){this.getParentView().getParentView().hide(),$(function(){A("onEditEnd",[])})}}]}},uw:function(t,i,s){var e=this.getValue(),n=s||p(e?this.getValue().split(this.Z.separator):[]),h=Pt(this.Z.master);s||(n.find(t)<0?n.push(t):n.remove(t));var r=n.join(this.Z.separator),o=this.setValue(n).join(this.Z.separator);if(h?h.setValue(r):this.wa&&(this.wa.value=o),this.callEvent("onValueSuggest",[{id:r,text:o}]),i){var a=this.getList().getItemNode(t).getElementsByTagName("SPAN");a&&a.length&&a[0].focus()}},Zg:function(t){return t.rows[0]},qg:function(){var t=this.getButton(),i=this.Z.button?this.Z.buttonText||ct.combo.select:0;if(t&&(i?(t.Z.value=i,t.refresh()):t.hide()),this.Z.selectAll)return this.getBody().getChildViews()[0].show()
  ;this.getList().data.attachEvent("onAfterFilter",C(function(){return this.Jb()},this))},Kg:function(){var t=this.getList(),i=this.getMasterValue();if(i&&(i=i.toString().split(this.config.separator))[0])for(var s=0;s<i.length;s++)t.exists(i[s])&&t.select(i[s],!0)},getButton:function(){return this.getBody().getChildViews()[1]},getList:function(){return this.getBody().getChildViews()[0]},setValue:function(t){var i=[],s=this.getList();if(s.unselect(),t&&(g(t)||(t=t.toString().split(this.config.separator)),t[0]))for(var e=0;e<t.length;e++)s.getItem(t[e])&&(s.exists(t[e])&&s.select(t[e],!0),i.push(this.getItemText(t[e])));return this.Z.value=t?t.join(this.config.separator):"",i},getValue:function(){return this.Z.value}},ur={api:ar,view:P.protoUI(ar,or.view)},cr={name:"checksuggest",defaults:{button:!1,selectAll:!1,body:{rows:[{view:"checkbox",hidden:!0,customCheckbox:!1,borderless:!1,css:"webix_checksuggest_select_all",labelRight:ct.combo.selectAll,labelWidth:0,height:28,inputHeight:20,on:{onItemClick:function(t){for(var i=this.getParentView().getParentView(),s=i.getList(),e=s.data.order,n=0;n<e.length;n++){s.getItem(e[n]).$checked=this.getValue()}var h=this.getValue()?[].concat(e):[];i.uw(e[0],t,h),s.refresh()},onChange:function(){var t=this.$view.querySelector("label"),i=ct.combo;t.textContent=this.getValue()?i.unselectAll:i.selectAll},onAfterRender:function(){var t=this.getParentView().getParentView();this.setValue(1*t.cw())}}},{view:"list",css:"webix_multilist",borderless:!0,autoheight:!0,yCount:5,type:"checklist",on:{onItemClick:function(t,i){var s=this.getItem(t);s.$checked=s.$checked?0:1,this.refresh(t);var e=this.getParentView().getParentView();e.Ub=new Date,e.uw(t,i),e.config.selectAll&&(s.$checked?e.cw()&&e.getBody().ji[0].setValue(1):e.getBody().ji[0].setValue(0))}}},{view:"button",click:function(){this.getParentView().getParentView().hide(),$(function(){A("onEditEnd",[])})}}]}},cw:function(){return(this.getValue()||"").split(this.config.separator).length===this.getList().count()},Zg:function(t){return t.rows[1]},getButton:function(){return this.getBody().getChildViews()[2]},getList:function(){return this.getBody().getChildViews()[1]},$init:function(){this.rg={},this.$ready.push(this.lw)},lw:function(){var t=this.getList();if(t.config.dataFeed){var i=this;t.attachEvent("onAfterLoad",function(){i.setValue(i.Z.value)}),t.getItem=function(t){return this.data.pull[t]||i.rg[t]}}this.config.master&&!this.config.selectAll&&this.getBody().getChildViews()[0].hide()},$enterKey:function(t,i){if(i.count&&i.count())if(t.isVisible()){var s=i.getSelectedId(!1,!0);s&&this.uw(s),t.hide()}else t.show(this.wa);else t.isVisible()&&t.hide()},Kg:function(){var t=this.getList();t.select&&t.unselect()},setValue:function(t){var i,s=this.getList(),e=[],n={},h=[];for(g(t=t||[])?s.config.dataFeed&&(t=this.Kb(t)):t=t.toString().split(this.config.separator),i=0;i<t.length;i++)n[t[i]]=1,s.getItem(t[i])&&(this.rg&&(this.rg[t[i]]=m(s.getItem(t[i]))),e.push(this.getItemText(t[i])));for(s.data.each(function(t){t.$checked?n[t.id]||(t.$checked=0,h.push(t.id)):n[t.id]&&(t.$checked=1,h.push(t.id))},this,!0),i=0;i<h.length;i++)s.refresh(h[i]);return this.Z.value=t.length?t.join(this.config.separator):"",e},getValue:function(){return this.Z.value},tw:function(){var t;this.Z.master&&(t=Pt(this.Z.master).getInputNode()),(t=t||this.wa)&&t.focus()},Kb:function(t){if(t&&g(t)){for(var i=[],s=0;s<t.length;s++)t[s].id?(this.rg[t[s].id]=m(t[s]),i.push(t[s].id)):i.push(t[s]);t=i}return t}},fr=(P.protoUI(cr,ur.view),P.protoUI({name:"datasuggest",defaults:{type:"dataview",fitMaster:!1,width:0,body:{xCount:3,autoheight:!0,select:!0}}},or.view),{name:"gridsuggest",defaults:{type:"datatable",fitMaster:!1,width:0,body:{navigation:!0,autoheight:!0,autowidth:!0,select:!0},filter:function(t,i){return 0===this.config.template(t).toString().toLowerCase().indexOf(i.toLowerCase())}},$init:function(t){t.body.columns||(t.body.autoConfig=!0),t.template||(t.template=C(this.dw,this))},dw:function(t){var i=this.getBody(),s=this.config.textValue||i.config.columns[0].id
  ;return i.getText(t.id,s)}}),lr=(P.protoUI(fr,or.view),{name:"daterangesuggest",defaults:{type:"daterange",body:{view:"daterange",icons:!0,button:!0,borderless:!0}},getValue:function(){return this.getRange().getValue()},setValue:function(t){this.getRange().setValue(m(t))},getRange:function(){return this.getBody()},getButton:function(){return this.getBody().getChildViews()[1].getChildViews()[1]},vw:function(t,i){var s=Pt(this.Z.master);s?(s.setValue(t),i&&this.hide()):this.setValue(t)},qg:function(){var t=this.getRange();t.attachEvent("onAfterDateSelect",C(function(t){this.vw(t)},this)),t.attachEvent("onDateClear",C(function(t){this.vw(t)},this)),t.attachEvent("onTodaySet",C(function(t){this.vw(t)},this))}}),dr=(P.protoUI(lr,or.view),{$cssName:"datepicker",name:"daterangepicker",$init:function(t){this.Z.value={},delete t.type,delete t.multiselect},defaults:{separator:" - "},pb:function(){var t=this.Z;t.suggest?t.popup=t.suggest:t.popup||(t.popup=t.suggest=this.suggest_setter({view:"daterangesuggest",body:{timepicker:t.timepicker,calendarCount:t.calendarCount,height:250+(t.button||t.icons?30:0)}})),this.bh=function(){}},$prepareValue:function(t){return(t=t||{}).start=Vh.api.$prepareValue.call(this,t.start?t.start:null),t.end=Vh.api.$prepareValue.call(this,t.end?t.end:null),m(Pt(this.Z.popup).getRange().ev(t))},$compareValue:function(t,i){var s=Vh.api.$compareValue,e=s.call(this,t.start,i.start),n=s.call(this,t.end,i.end);return e&&n},$setValue:function(t){t=t||{},this.Z.text=(t.start?this.gb(t.start):"")+(t.end?this.Z.separator+this.gb(t.end):""),this.yb()},$render:function(t){t.value=this.$prepareValue(t.value),this.$setValue(t.value)},getValue:function(){var t=this.Z.value;if(this.jm){if(this.Z.editable){var i=this.bb||ct.dateFormatDate,s=(this.getInputNode().value||"").split(this.Z.separator);t=this._w(i,{start:s[0],end:s[1]})}}else t=this.$prepareValue(t)||null;if(this.Z.stringResult){var e=ct.parseFormatStr;return this._w(e,t)}return t||null},_w:function(t,i){return i.start&&(i.start=t(i.start)),i.end&&(i.end=t(i.end)),i}}),vr=(P.protoUI(dr,Vh.view),P.protoUI({name:"excelbar",defaults:{padding:0,type:"line"},$init:function(t){t.cols=[{view:"tabbar",options:[""],optionWidth:200,borderless:!0,on:{onaftertabclick:function(){this.getParentView().callEvent("onExcelSheetSelect",[this.getValue()])}}}]},getValue:function(){return this.getInput().getValue()},setValue:function(t){return this.getInput().setValue(t)},getInput:function(){return this.getChildViews()[0]},setSheets:function(t){var i=this.getInput();i.config.options=t,i.refresh()}},nh.view),{name:"vscroll",$apiOnly:!0,defaults:{scroll:"x",scrollStep:40,scrollPos:0,scrollSize:18,scrollVisible:1,zoom:1},$init:function(t){var i=t.scroll||"x",s=this.et=D(t.container);s.className+=" webix_vscroll_"+i,s.innerHTML="<div class='webix_vscroll_body'></div>",Nt(s,"scroll",this.pw,{bind:this}),this.qh=0},reset:function(){this.config.scrollPos=0,this.et["x"==this.config.scroll?"scrollLeft":"scrollTop"]=0},mw:function(t){return 15e5<t?(this.Z.zoom=t/1e6,t=1e6):this.Z.zoom=1,t},scrollWidth_setter:function(t){return t=this.mw(t),this.et.firstChild.style.width=t+"px",t},scrollHeight_setter:function(t){return t=this.mw(t),this.et.firstChild.style.height=t+"px",t},sizeTo:function(t,i,s){t=t-(i||0)-(s||0);var e=this.Z.scrollSize;S.isIE&&e&&(e+=1),e||!this.Z.scrollVisible||S.$customScroll||(this.et.style.pointerEvents="none",e=14),e?(this.et.style.display="block",i&&(this.et.style.marginTop=i+"px"),this.et.style["x"==this.Z.scroll?"width":"height"]=Math.max(0,t)+"px",this.et.style["x"==this.Z.scroll?"height":"width"]=e+"px"):this.et.style.display="none",this.qh=t},getScroll:function(){return Math.round(this.Z.scrollPos*this.Z.zoom)},getSize:function(){return Math.round((this.Z.scrollWidth||this.Z.scrollHeight)*this.Z.zoom)},scrollTo:function(t){t<0&&(t=0);var i=this.Z;if((t/=i.zoom)<0&&(t=0),t!=this.Z.scrollPos)return this.et["x"==i.scroll?"scrollLeft":"scrollTop"]=t,this.bw(t,!0),!0},pw:function(){var t=this.et["x"==this.Z.scroll?"scrollLeft":"scrollTop"];Math.floor(t)!=Math.floor(
  this.Z.scrollPos)&&this.bw(t,!1)},bw:function(t,i){var s=this.Z.scrollWidth||this.Z.scrollHeight;t>=s-this.qh/(i?this.Z.zoom:1)&&(t=Math.max(0,s-this.qh/this.Z.zoom)),this.Z.scrollPos=t||0,this.callEvent("onScroll",[this.getScroll()])},activeArea:function(t,i){this.gw=i,Nt(t,S.isIE8?"mousewheel":"wheel",this.ww,{bind:this,passive:!1}),this.xw(t)},xw:function(t){!S.touch&&window.navigator.pointerEnabled&&(st(t,"webix_scroll_touch_ie",!0),Nt(t,"pointerdown",function(t){"touch"!=t.pointerType&&"pen"!=t.pointerType||(this.ne=Ki.Je(t),this.yw=this.getScroll())},{bind:this}),Lt(document.body,"pointermove",function(t){var i;this.ne&&(this.he=Ki.Je(t),"x"==this.Z.scroll?i=this.he.x-this.ne.x:"y"==this.Z.scroll&&(i=this.he.y-this.ne.y),i&&5<Math.abs(i)&&this.scrollTo(this.yw-i))},{bind:this}),Lt(window,"pointerup",function(){this.ne&&(this.ne=this.he=null)},{bind:this}))},ww:function(t){var i=0,s=0===t.deltaMode?30:1;if(S.isIE8&&(i=t.detail=-t.wheelDelta/30),t.deltaX&&Math.abs(t.deltaX)>Math.abs(t.deltaY)?this.gw&&this.Z.scrollVisible&&(i=t.deltaX/s):!this.gw&&this.Z.scrollVisible&&(i=j(t.deltaY)?t.detail:t.deltaY/s),S.isSafari&&(this.Mw=t.target||t.srcElement),i&&this.scrollTo(this.getScroll()+i*this.Z.scrollStep))return Q(t)}}),_r=(P.protoUI(vr,w,Ai),{Sw:function(){this.kw=!0,this.Cw={},this.define("select","area"),this.attachEvent("onAfterScroll",function(){this.refreshSelectArea()}),this.attachEvent("onAfterRender",function(){this.refreshSelectArea(),this.$w()}),this.attachEvent("onColumnResize",function(){this.refreshSelectArea()}),this.attachEvent("onBeforeColumnHide",function(t){this.Dw=this.getColumnIndex(t)}),this.attachEvent("onAfterColumnHide",function(){this.Iw(this.Dw)}),this.Aw=function(t,i,s,e){if(t.row&&i.row){if(s)return this.addSelectArea(t,i,!0),!(this.kw=!0);if(!this.callEvent("onAreaDrag",[t,i,e]))return!1;this.Tw||!this.kw||this.Z.multiselect&&e&&e.ctrlKey||(this.removeSelectArea(),this.kw=!1)}},this.attachEvent("onBeforeAreaAdd",this.Fw),Nt(this.Wt,"mousedown",this.zw,{bind:this})},Vw:!0,Iw:function(t){var i=this.Cw;for(var s in i){var e=i[s];if(this.getColumnIndex(e.start.column)<0)if(e.start.column==e.end.column)this.removeSelectArea(e.name);else{var n=this.columnId(t);n&&this.Bw(e.name,{row:e.start.row,column:n},null)}else if(this.getColumnIndex(e.end.column)<0){var h=this.columnId(t-1);h&&this.Bw(e.name,null,{row:e.end.row,column:h})}}},Hw:function(t,i,s,e){var n,h,r,o,a,u,c,f;if(i){n=this.getColumnIndex(i.start.column),h=this.getColumnIndex(i.end.column),r=this.getIndexById(i.start.row),o=this.getIndexById(i.end.row),a=this.getColumnIndex(t.column),u=this.getIndexById(t.row),c=this.getIndexById(i.init.row),f=this.getColumnIndex(i.init.column),a<n||"left"==s?"left"===s&&e.ctrl?(n=this.Rw(c,n,s),h=f):"left"===s&&f<h?h--:n=a:(h<=a||"right"==s)&&("right"==s&&e.ctrl?(h=this.Rw(c,h,s),n=f):"right"==s&&n<f?n++:h=a),u<r||"up"==s?"up"==s&&e.ctrl?(r=this.Rw(r,f,s),o=c):"up"==s&&c<o?o--:r=u:(o<u||"down"==s)&&("down"==s&&e.ctrl?(o=this.Rw(o,f,s),r=c):"down"==s&&r<c?r++:o=u);var l={row:this.getIdByIndex(r),column:this.columnId(n)},d={row:this.getIdByIndex(o),column:this.columnId(h)};this.callEvent("onBeforeBlockSelect",[l,d,!0])&&(this.Bw(i.name,l,d),this.callEvent("onSelectChange",[]),this.callEvent("onAfterBlockSelect",[l,d]))}},Rw:function(t,i,s){var e=this.config.columns,n=this.data.order,h=this.data.pull[n[t]],r=e[i].id,o=0;if("right"==s)for(var a=i+1;a<e.length;a++){if(h[e[a].id]){o=a;break}o=a}else if("left"==s){for(var u=i-1;0<=u;u--)if(h[e[u].id]){o=u;break}}else if("down"==s)for(var c=t+1;c<n.length;c++){if(this.getItem(n[c])[r]){o=c;break}o=c}else if("up"==s)for(var f=t-1;0<=f;f--)if(this.getItem(n[f])[r]){o=f;break}return o},Bw:function(t,i,s,e){var n=this.Cw[t];if(!n)return!1;var h=m(n),r={start:i||n.start,end:s||n.end};this.Fw(r),P.extend(n,r,!0),this.refreshSelectArea(),this.$w(h),e&&this.callEvent("onSelectChange",[])},areaselect_setter:function(t){return t&&(this.Sw(),this.Sw=function(){}),this.define("blockselect",t),t},addSelectArea:function(t,i,s,e,n,h){var r,o,a,u,c;r=this.getIndexById(t.row),
  o=this.getIndexById(i.row),a=this.getColumnIndex(t.column),o<r&&(c=r,r=o,o=c),(u=this.getColumnIndex(i.column))<a&&(c=a,a=u,u=c),e=e||this.Tw||z(),this.Tw=null;var f={start:{row:this.getIdByIndex(r),column:this.columnId(a)},end:{row:this.getIdByIndex(o),column:this.columnId(u)}};if(n&&(f.css=n),(h||!1===h)&&(f.handle=h),this.Cw[e])return this.Bw(e,f.start,f.end,!0);f.handle=!0,f.name=e,f.init=f.start,this.callEvent("onBeforeAreaAdd",[f])&&(this.Pw=e,s||this.removeSelectArea(),this.Cw[f.name]=f,this.jw.push(f),this.refreshSelectArea(),this.$w(),this.callEvent("onAfterAreaAdd",[f]),this.callEvent("onSelectChange",[]))},Ew:function(){var t=Y("DIV");return t.className="webix_area_selection_layer",t.style.top=this.Nw+"px",t},refreshSelectArea:function(){var t,i,s,e,n=null,h=null,r=null,o=this.Z.prerender;if(this.Lw){t=this.Ow(o),i=this.Uw(!0===o),this.Yw||(this.Yw=this.Ew(),this.Wt.childNodes[1].appendChild(this.Yw),this.Ww=this.Ew(),this.Wt.childNodes[0].appendChild(this.Ww),this.Gw=this.Ew(),this.Wt.childNodes[2].appendChild(this.Gw)),this.Yw.innerHTML="",this.Ww.innerHTML="",this.Gw.innerHTML="";var a=this.Z.leftSplit,u=this.Z.rightSplit;for(s in this.Cw){e=this.Cw[s];var c=this.Xw(e,t,i);if(null!==c){var f=this.getColumnIndex(e.start.column),l=this.getColumnIndex(e.end.column);if(c.r0<=c.r1){if(this.Z.topSplit&&this.Z.topSplit<=void 0&&void 0<this.Jw)return!1;f<a&&(h=this.Zw(c.r0,f,c.r1,Math.min(l,a-1))),c.c0<=c.c1&&(n=this.Zw(c.r0,c.c0,c.r1,c.c1)),u&&l>=this.qw&&(r=this.Zw(c.r0,Math.max(f,this.qw),c.r1,l)),(h||n||r)&&this.Kw(h,n,r,s,e.css,e.handle)}}else this.removeSelectArea(s)}}},Xw:function(t,i,s){var e,n,h=this.getIndexById(t.start.row),r=this.getIndexById(t.end.row),o=this.getColumnIndex(t.start.column),a=this.getColumnIndex(t.end.column);if(-1===o||-1===a)return null;if(-1===h||-1===r)return null;if(n=Math.min(s[1],r),this.Z.topSplit){if((e=h)>=this.Z.topSplit&&(e=Math.max(s[0]-this.Z.topSplit,h)),n>=this.Z.topSplit){var u=this.qt(this.getIdByIndex(r),t.end.column),c=this.qt(this.getIdByIndex(this.Z.topSplit-1),t.end.column);c.top+c.height>u.top+u.height&&(n=this.Z.topSplit-1)}}else e=Math.max(s[0],this.getIndexById(t.start.row));return{r0:e,r1:n,c0:Math.max(i[0],o),c1:Math.min(this.qw?i[1]-1:i[1],a)}},Zw:function(t,i,s,e){return[this.qt(this.getIdByIndex(t),this.columnId(i)),this.qt(this.getIdByIndex(s),this.columnId(e))]},Kw:function(t,i,s,d,v,e){var n,h,r=this.Cw[d],_=0;this.Z.topSplit&&(_=this.Qw(r.start,!0));var o=function(t,i,s,e,n){var h,r,o,a,u,c,f={top:1,right:1,bottom:1,left:1};for(h in e&&delete f.left,n&&delete f.right,r=s.top-i.top+s.height-1,o=s.left-i.left+s.width,f){a=i.top+_,"bottom"==h&&(a=s.top+s.height),u=i.left,"right"==h&&(u=s.left+s.width),c="top"==h||"bottom"==h,t.appendChild(Y("DIV",{"class":"webix_area_selection webix_area_selection_"+h+(v?" "+v:""),style:"left:"+u+"px;top:"+a+"px;"+(c?"width:"+o+"px;":"height:"+(r-_)+"px;"),webix_area_name:d},""));var l=t.lastChild;"right"==h&&(l.style.left=u-l.offsetWidth+"px"),"bottom"==h&&(l.style.top=a-l.offsetHeight+"px"),_&&("top"==h&&(l.style.display="none"),s.height==_&&"bottom"==h&&(l.style.display="none"))}};s&&o(this.Gw,s[0],s[1],!!i,!1),i&&o(this.Yw,i[0],i[1],!!t,!!s),t&&o(this.Ww,t[0],t[1],!1,!!i),e&&(h=s?s[1]:i?i[1]:t[1],(n=s?this.Gw:i?this.Yw:this.Ww).appendChild(Y("DIV",{"class":"webix_area_selection_handle"+(v?" "+v:""),style:"left:"+(h.left+h.width)+"px;top:"+(h.top+h.height)+"px;",webix_area_name:d},"")),_&&h.height==_&&(n.lastChild.style.display="none"))},tx:function(e){if(e){var t=function(t){for(var i=t.childNodes,s=i.length-1;0<=s;s--)i[s].getAttribute("webix_area_name")==e&&t.removeChild(i[s])};t(this.Yw),t(this.Ww),t(this.Gw)}},removeSelectArea:function(t){if(t&&this.Cw[t]){if(this.callEvent("onBeforeAreaRemove",[t])){for(var i in this.$w(m(this.Cw[t]),!0),delete this.Cw[t],this.tx(t),this.jw=[],this.Cw)this.jw.push(this.Cw[i]);this.callEvent("onAfterAreaRemove",[t])}}else for(var s in this.Cw)this.removeSelectArea(s)},zw:function(t){var i=t.target||t.srcElement,s=rt(i);if(s&&-1!=s.indexOf("webix_area_selection_handle")){
  var e=i.getAttribute("webix_area_name");this.Tw=e;var n=this.Cw[e],h=this.qt(n.start.row,n.start.column),r=this.qt(n.end.row,n.end.column),o=this.Z.prerender,a=this.getColumnIndex(n.start.column)<this.Z.leftSplit?0:this.ix,u=this.getColumnIndex(n.end.column)<this.Z.leftSplit?0:this.ix;return this.nx=[h.left+1+a-this.$h,h.top+1-(o?this.kh:0),{row:n.start.row,column:n.start.column}],this.hx=Z(this.Wt),this.ox(t),this.ax=[r.left+1+u-this.$h,r.top+1-(o?this.kh:0)],this.ux(!1,!1,t),Q(t)}},getSelectArea:function(t){return this.Cw[t||this.Pw]},getAllSelectAreas:function(){return this.Cw},Fw:function(t,i){var s,e,n,h,r,o,a,u,c,f,l,d,v,_=!1,p=t.start,m=t.end;for(f=r=this.getIndexById(p.row),l=n=this.getColumnIndex(p.column),d=o=this.getIndexById(m.row),v=h=this.getColumnIndex(m.column),s=r;s<=o;s++){if(this.getItem(this.getIdByIndex(s)).$row&&!i)_=!0,v=this._l.length-1;else if(this.config.spans)for(e=n;e<=h;e++)(a=this.getSpan(this.getIdByIndex(s),this.columnId(e)))&&((u=this.getIndexById(a[0]))<f&&(f=u,_=!0),(c=this.getColumnIndex(a[1]))<l&&(_=!0,l=c),u+a[3]-1>d&&(_=!0,d=u+a[3]-1),c+a[2]-1>v&&(_=!0,v=c+a[2]-1))}_&&(t.start={row:this.getIdByIndex(f),column:this.columnId(l)},t.end={row:this.getIdByIndex(d),column:this.columnId(v)},this.Fw(t,!0))},$w:function(t,i){var s;if(t&&(s=this.getItemNode({row:t.start.row,column:t.start.column}))&&s.removeAttribute("tabindex"),!i&&this.jw.length){var e=this.getSelectedId(!0)[0];(s=this.getItemNode(e))&&s.setAttribute("tabindex","1")}}}),pr={filterByAll:function(){var r=!1;this.data.silent(function(){this.filter();var t=!1;for(var s in this.Ao)if(this.isColumnVisible(s)){var i=this.Ao[s],e=i[2].getValue(i[0]),n=e;i[1].prepare&&(n=i[1].prepare.call(i[2],n,i[1],this)),i[1].value=e;var h=i[1].compare;if(this.callEvent("onBeforeFilter",[s,n,i[1]]))if(i[2].$server||r)r=!0;else{if(""===n)continue;h?(h=this.cx(s,h),this.filter(C(function(t,i){return!!t&&h(t[s],i,t)},this),n,t)):this.filter(s,n,t),t=!0}}r&&this.vx()},this),r||(this.refresh(),this.callEvent("onAfterFilter",[]))},cx:function(t,h){var i=this.getColumnConfig(t),r=i?i.optionslist:null;return r?("string"!=typeof r&&(r=","),function(t,i,s){if(!t)return!0;for(var e=t.split(r),n=0;n<e.length;n++)if(h(e[n],i,s))return!0}):h},filterMode_setter:function(t){return P.extend(this.data.co,t,!0)},getFilter:function(t){var i=this.Ao[t];return i&&i[2].getInputNode?i[2].getInputNode(i[0]):null},registerFilter:function(t,i,s){this.Ao[i.columnId]=[t,i,s]},collectValues:function(t,i){var s=this.getColumnConfig(t),e=i&&i.visible?null:s.collection,n={values:e?this.wd.call(e,"id","value"):this.wd(s.id,s.id)};return this.callEvent("onCollectValues",[t,n]),n.values},wd:function(e,n){var h={"":!0},r=[];if(this.data.each(function(t){var i=t?t[e]:"";if(i!==undefined&&!h[i]){h[i]=!0;var s=t[e];0===s&&(s="0"),r.push({id:s,value:t[n]})}},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},vx:function(){var i=this;this.loadNext(0,0,0,0,1).then(function(t){i.editStop&&i.editStop(),i.clearAll(!0),i.parse(t),i.callEvent("onAfterFilter",[])})}},mr={hover_setter:function(t){return t&&!this._x&&(this.Gu(),this.config.experimental=!0,this.attachEvent("onMouseMoving",function(){var t=this.locate(arguments[0]);t=t?t.row:null,this.mx!=t&&(this.mx&&this.removeRowCss(this.mx,this.Z.hover),this.mx=t,this.mx&&this.addRowCss(this.mx,this.Z.hover))}),Lt(this.$view,"mouseout",C(function(t){this.mx&&document.body.contains(t.target)&&(this.removeRowCss(this.mx,this.Z.hover),this.mx=null)},this)),this._x=1),t},select_setter:function(t){return!this.select&&t&&(P.extend(this,this.gx.bx,!0),!0===t?t="row":"multiselect"==t&&(t="row",this.Z.multiselect=!0),this.gx[t],P.extend(this,this.gx[t],!0)),t},getSelectedId:function(t){return t?[]:""},getSelectedItem:function(t){return Ys.getSelectedItem.call(this,t)},gx:{bx:{wx:" webix_cell_select",$init:function(){this.xx(),this.on_click.webix_cell=C(this.yx,this),this.Mx=this.Fc=function(){this.unselect()},this.data.attachEvent("onStoreUpdated",C(this.Ac,this)),
  this.data.attachEvent("onSyncApply",C(this.Sx,this)),this.data.attachEvent("onClearAll",C(this.Mx,this)),this.data.attachEvent("onAfterFilter",C(this.Fc,this)),this.data.attachEvent("onIdChange",C(this.Vc,this)),this.$ready.push(Ys.Bc)},Vc:function(t,i){for(var s=0;s<this.kx.length;s++)this.kx[s]==t&&(this.kx[s]=i);for(var e=0;e<this.jw.length;e++){var n=this.jw[e];n.row==t&&(t=this.Cx(n),n.row=i,i=this.Cx(n),n.id=i,delete this.$x[t],this.$x[i]=!0)}},Ac:function(t,i,s){"delete"==s&&this.unselect(t)},Sx:function(){for(var t=this.jw.length-1;0<=t;t--){var i=this.jw[t].row;this.exists(i)||(this.jw.splice(t,1),delete this.$x[i])}},xx:function(){this.jw=[],this.$x={},this.kx=[]},isSelected:function(t,i){var s;return s=j(i)?"object"===k(t)?this.Cx(t):t:this.Cx({row:t,column:i}),this.$x[s]},getSelectedId:function(t,i){var s;if(1<this.jw.length||t){if(s=[].concat(this.jw),i)for(var e=0;e<s.length;e++)s[e]=s[e].id}else if(s=this.jw[0],i&&s)return s.id;return s},Dx:function(){return this.row},Po:function(t,i){var s=this.Cx(t);if(null!==s){if(-1===i)return this.Ix(t);if(t.id=s,t.toString=this.Dx,!this.callEvent("onBeforeSelect",[t,i]))return!1;if(!this.$x[s]||!i&&1!=this.jw.length)return i||this.Ax(),this.jw.push(t),this.$x[s]=!0,this.callEvent("onAfterSelect",[t,i]),this.Tx(this.Fx(t)),!0}},Ax:function(){if(!this.jw.length)return!1;for(var t=0;t<this.jw.length;t++)if(!this.callEvent("onBeforeUnSelect",[this.jw[t]]))return!1;for(var i=0;i<this.kx.length;i++)this.data.removeMark(this.kx[i],"webix_selected");var s=this.Z.columns;if(s)for(var e=0;e<s.length;e++)s[e].$selected=null;var n=this.jw;this.xx();for(var h=0;h<n.length;h++)this.callEvent("onAfterUnSelect",[n[h]]);return!0},unselectAll:function(){this.clearSelection()},selectAll:function(){this.selectRange()},clearSelection:function(){this.Ax()&&(this.callEvent("onSelectChange",[]),this.render())},Ix:function(t){var i=this.Cx(t);if(!i&&this.jw.length&&(this.clearSelection(),this.callEvent("onSelectChange",[])),this.$x[i]){if(!this.callEvent("onBeforeUnSelect",[t]))return!1;for(var s=0;s<this.jw.length;s++)if(this.jw[s].id==i){this.jw.splice(s,1);break}delete this.$x[i],this.callEvent("onAfterUnSelect",[t]),this.Tx(0,this.zx(t))}},Vx:function(t){var i=this.getItem(t);return this.data.addMark(i.id,"webix_selected",0,{$count:0},!0)},Tx:function(t){t&&this.kx.push(t),this.Rc||(this.render(),this.callEvent("onSelectChange",[]))},yx:function(t,i){var s=t.ctrlKey||t.metaKey||"touch"==this.Z.multiselect,e=t.shiftKey;if(this.Z.multiselect||"multiselect"==this.Z.select||"area"==this.Z.select||(s=e=!1),e&&this.jw.length){var n=this.jw[this.jw.length-1];this.Bx(i,n)}else s&&this.$x[this.Cx(i)]?this.Ix(i):this.Po({row:i.row,column:i.column},s)},Hx:function(t,i,s){var e=this.Z.columns;if(i){for(var n=[],h=0;h<e.length;h++)e[h].$selected&&n.push(e[h]);e=n}for(var r=this.data.order,o=0,a=0;a<r.length;a++){var u=this.getItem(r[a]);if(u){var c=this.data.getMark(u.id,"webix_selected");if(c||i){for(var f=0,l=0;l<e.length;l++){var d=e[l].id;if(s||i||c[d]){if(!t)return{row:r[a],column:d};u[d]=t(u[d],r[a],d,o,f),f++}}o++}}}}},row:{wx:" webix_row_select",Cx:function(t){return t.row},select:function(t,i){t&&(t=t.toString()),this.data.exists(t),this.Po({row:t},i)},Fx:function(t){return this.Vx(t.row).$row=!0,t.row},unselect:function(t){this.Ix({row:t})},zx:function(t){return this.data.removeMark(t.row,"webix_selected",0,1),t.row},mapSelection:function(t){return this.Hx(t,!1,!0)},Bx:function(t,i){return this.selectRange(t.row,i.row)},selectRange:function(t,i,s){j(s)&&(s=!0);var e=t?this.getIndexById(t):0,n=i?this.getIndexById(i):this.data.order.length-1;if(n<e){var h=e;e=n,n=h}this.Rc=!0;for(var r=e;r<=n;r++){var o=this.getIdByIndex(r);if(!o){t&&this.select(t);break}this.select(o,s)}this.Rc=!1,this.Tx()}},cell:{Cx:function(t){return t.column?t.row+"_"+t.column:null},select:function(t,i,s){this.data.exists(t),this.Po({row:t,column:i},s)},Fx:function(t){var i=this.Vx(t.row);return i.$count++,i[t.column]=!0,t.row},unselect:function(t,i){this.Ix({row:t,column:i})},zx:function(t){var i=this.Vx(t.row)
  ;return i.$count--,i[t.column]=!1,i.$count<=0&&this.data.removeMark(t.row,"webix_selected"),t.row},mapSelection:function(t){return this.Hx(t,!1,!1)},Bx:function(t,i){return this.selectRange(t.row,t.column,i.row,i.column)},selectRange:function(t,i,s,e,n){j(n)&&(n=!0);var h=t?this.getIndexById(t):0,r=s?this.getIndexById(s):this.data.order.length-1,o=i?this.getColumnIndex(i):0,a=e?this.getColumnIndex(e):this._l.length-1;if(r<h){var u=h;h=r,r=u}if(a<o){var c=o;o=a,a=c}this.Rc=!0;for(var f=h;f<=r;f++)for(var l=o;l<=a;l++)this.select(this.getIdByIndex(f),this.columnId(l),n);this.Rc=!1,this.Tx()}},column:{wx:" webix_column_select",Cx:function(t){return t.column},Dx:function(){return this.column},select:function(t,i){this.Po({column:t},i)},Fx:function(t){this.Z.columns[this.getColumnIndex(t.column)].$selected=!0,this.Rc||this.Rx()},unselect:function(t){this.Ix({column:t})},zx:function(t){this.Z.columns[this.getColumnIndex(t.column)].$selected=null,this.Rx()},mapSelection:function(t){return this.Hx(t,!0,!1)},Bx:function(t,i){return this.selectRange(t.column,i.column)},selectRange:function(t,i,s){j(s)&&(s=!0);var e=t?this.getColumnIndex(t):0,n=i?this.getColumnIndex(i):this._l.length-1;if(n<e){var h=e;e=n,n=h}this.Rc=!0;for(var r=e;r<=n;r++)this.select(this.columnId(r),s);this.Rc=!1,this.Rx(),this.Tx()},Sx:function(){}},area:{Cx:function(t){return t.row+"_"+t.column},getSelectedId:function(t){var i=this.getSelectArea(),s=[];if(i)if(!t||i.start.row==i.end.row&&i.start.column==i.end.column)s.push(i.end);else{var e=this.getIndexById(i.start.row),n=this.getIndexById(i.end.row);if(-1==e||-1==n)return s;for(var h=this.getColumnIndex(i.start.column),r=this.getColumnIndex(i.end.column),o=e;o<=n;o++)for(var a=h;a<=r;a++)s.push({row:this.getIdByIndex(o),column:this.columnId(a)})}return t?s:s[0]},unselect:function(){this.Ix()},Ix:function(){this.removeSelectArea(),this.callEvent("onSelectChange",[])},mapSelection:function(t){var i=this.getSelectArea();if(i)for(var s=this.getColumnIndex(i.start.column),e=this.getColumnIndex(i.end.column),n=this.getIndexById(i.start.row),h=this.getIndexById(i.end.row),r=n;r<=h;r++)for(var o=this.data.order[r],a=this.getItem(o),u=s;u<=e;u++){var c=this._l[u].id;if(!t)return{row:o,column:c};a[c]=t(a[c],o,c,r-n,u-s)}},select:function(t,i,s){this.data.exists(t),this.Po({row:t,column:i},s)},Bx:function(t,i){this.Hw(t,i)},Po:function(t){return this.addSelectArea(t,t,!1),!0},Sx:function(){this.jw.length&&this.refreshSelectArea()}}}},br={blockselect_setter:function(t){return t&&this.Vw&&(Nt(this.et,S.mouse.move,this.Px,{bind:this}),Nt(this.et,S.mouse.down,this.jx,{bind:this}),Lt(document.body,S.mouse.up,this.Ex,{bind:this}),this.Vw=this.nx=this.ax=!1,this.attachEvent("onAfterScroll",function(){this.Nx()}),P.extend(this,vi,!0),this.attachEvent("onBeforeAutoScroll",function(){return this.ax})),t},Vw:!0,Lx:function(t,i){for(var s=t.target||t.srcElement;s;){if(s.getAttribute&&s.getAttribute("webixignore"))return!1;if(s==i)return!0;s=s.parentNode}return!1},jx:function(t){if((!this.Z.subview||this==Pt(t.target||t.srcElement))&&this.Lx(t,this.Wt)){if(t.target&&"INPUT"==t.target.tagName||this.f_)return;this.hx=Z(this.Wt);var i=K(t);this.nx=[i.x-this.hx.x,i.y-this.hx.y],Q(t)}},Ex:function(t){this.Ox&&(this.ux("select",!0,t),this.Ox=G(this.Ox)),et(document.body,"webix_noselect"),this.nx=this.ax=!1,this.Jt&&(this.Jt=window.clearTimeout(this.Jt))},Nx:function(){this.ax&&this.ux(!1,!1)},ux:function(t,i,s){var e;this.nx[2]||(this.nx[2]=this.Ux.apply(this,this.nx)),e=this.nx[2];var n=this.Ux.apply(this,this.ax);if(this.callEvent("onBeforeBlockSelect",[e,n,i,s])){if((!this.Aw||!1!==this.Aw(e,n,i,s))&&e.row&&n.row)if("select"===t)this.Ax(),this.Bx(e,n);else{var h,r,o,a;if("box"===t)h=Math.min(this.nx[0],this.ax[0]),o=Math.max(this.nx[0],this.ax[0]),r=Math.min(this.nx[1],this.ax[1]),a=Math.max(this.nx[1],this.ax[1]);else{var u=this.qt(e.row,e.column),c=this.qt(n.row,n.column),f=this.getScrollState(),l=u.width,d=c.width;this.Yx&&this.nx[0]>this.ix+this.Wx?u.left+=this.ix+this.Wx:this.ix?this.nx[0]>this.ix&&(u.left<f.x?(l-=f.x-u.left,
  u.left=this.ix):u.left+=this.ix-f.x):u.left-=f.x,this.Yx&&this.ax[0]>this.ix+this.Wx?c.left+=this.ix+this.Wx:this.ix?this.ax[0]>this.ix&&(c.left<f.x?(d-=f.x-c.left,c.left=this.ix):c.left+=this.ix-f.x):c.left-=f.x,this.Z.prerender&&(u.top-=this.kh,c.top-=this.kh),h=Math.min(u.left,c.left),o=Math.max(u.left+l,c.left+d),r=Math.min(u.top,c.top),a=Math.max(u.top+u.height,c.top+c.height),this.Z.topSplit&&(r+=this.Qw(e)),this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),s&&(this.Jt=$(this.Yt,this,[K(s)],250))}var v=this.Ox.style;v.left=h+"px",v.top=r+"px",v.width=o-h+"px",v.height=a-r+"px"}i&&this.callEvent("onAfterBlockSelect",[e,n])}},ox:function(){this.Ox=Y("div",{"class":"webix_block_selection"},""),this.Wt.appendChild(this.Ox)},Px:function(t){if(!1!==this.nx){this.ax||st(document.body,"webix_noselect");var i=K(t),s=[i.x-this.hx.x,i.y-this.hx.y];if(Math.abs(this.nx[0]-s[0])<5&&Math.abs(this.nx[1]-s[1])<5)return;!1===this.ax&&this.ox(t),this.ax=s,this.ux(this.config.blockselect,!1,t)}},Ux:function(t,i){var s=!1,e=null,n=null;if(this.Yx&&t>this.ix+this.Wx?t+=this.Ch.getSize()-this.Wx-this.ix-this.Yx:(!this.ix||t>this.ix)&&(t+=this.Ch.getScroll()),this.Z.topSplit&&this.Jw>this.Z.topSplit){var h=this.qt(this.getIdByIndex(this.Z.topSplit-1),this.columnId(0));h.top+h.height>i&&(s=!0)}s||(i+=this.getScrollState().y),t<0&&(t=0),i<0&&(i=0);for(var r=this.Z.columns,o=this.data.order,a=0,u=0;u<r.length;u++)if(t<=(a+=r[u].width)){n=r[u].id;break}n||(n=r[r.length-1].id),a=0;var c=this.data.$min||0;if(this.Z.fixedRowHeight)e=o[c+Math.floor(i/this.Z.rowHeight)];else for(var f=c;f<o.length;f++)if(i<=(a+=this.Gx(f))){e=o[f];break}return e||(e=o[o.length-1]),{row:e,column:n}},Qw:function(t,i){var s=0,e=this.getIndexById(t.row);if(e>=this.Z.topSplit){var n=this.qt(this.getIdByIndex(e),t.column),h=this.qt(this.getIdByIndex(this.Z.topSplit-1),t.column);0<h.top+h.height-n.top&&(s=h.top+h.height-(0<n.top||!i?n.top:0))}return s}},gr={resizeRow_setter:function(t){return this.Z.scrollAlignY=!1,this.Z.fixedRowHeight=!1,this.resizeColumn_setter(t)},resizeColumn_setter:function(t){return t&&this.Xx&&(Nt(this.et,"mousemove",this.Jx,{bind:this}),Nt(this.et,"mousedown",this.Zx,{bind:this}),Nt(this.et,"mouseup",this.qx,{bind:this}),this.Xx=!1),t},Xx:!0,Zx:function(t){this.Z.subview&&this!=Pt(t.target||t.srcElement)||this.Kx&&(this.f_=[K(t),this.Kx[2]],st(document.body,"webix_noselect"),R())},qx:function(){this.f_=!1,et(document.body,"webix_noselect"),E()},Qx:function(){if(!this.v_){var t=this.Kx[0],i=this.f_[1],s=this.Le(i);if(s){var e,n=this.f_[0];if("x"==t?(e=Z(i).x+this.Kx[1]-Z(this.Wt).x,n=n.x,this.Kx[1]||(s.cind-=i.parentNode.colSpan||1)):(e=Z(i).y+this.Kx[1]-Z(this.Wt).y+this.ea,n=n.y,this.Kx[1]||s.rind--),0<=s.cind&&0<=s.rind)this.v_=[t,s,e],new zt.resizearea({container:this.et,dir:t,eventPos:n,start:e,cursor:("x"==t?"col":"row")+"-resize"}).attachEvent("onResizeEnd",C(this.ty,this));this.Zx=this.Kx=!1}}},ty:function(t){if(this.v_){var i=this.v_[0],s=this.v_[1],e=t-this.v_[2];if("x"==i){this.Z.rightSplit&&s.cind+1>=this.qw&&s.cind!==this._l.length-1&&(s.cind++,e*=-1);var n=this._l[s.cind],h=n.width;delete n.fillspace,delete n.adjust,this.Vo(s.cind,h+e,!0,!0),this.Bo()}else{var r=this.getIdByIndex(s.rind),o=this.iy(this.getItem(r));this.setRowHeight(r,o+e)}this.qx()}this.v_=null},Jx:function(t){var i=null,s=this.Z;if(this.Kx&&this.f_)return this.Qx(t);var e=(t=t||event).target||t.srcElement,n=!1;if("TD"!=e.tagName&&"TABLE"!=e.tagName){var h=e.className||"",r="string"==typeof h&&-1!=h.indexOf("webix_cell");if(!r||!s.drag){var o="string"==typeof h&&-1!=h.indexOf("webix_hcell");if(this.Kx=!1,r||o){var a=e.offsetWidth,u=e.offsetHeight,c=q(t),f=s.resizeRow;"object"==k(f)&&f.headerOnly&&0<(i=this.Le(e)).cind&&(f=!1),r&&f&&(f="object"==k(f)&&f.size?f.size:3,c.y<f?(i||(i=this.Le(e)),i.rind&&(this.Kx=["y",0,e],n="row-resize")):u-c.y<f+1&&(this.Kx=["y",u,e],n="row-resize"));var l=s.resizeColumn;"object"==k(l)&&l.headerOnly&&r&&(l=!1),l&&(l="object"==k(l)&&l.size?l.size:3,c.x<l?(this.Kx=["x",0,e],n="col-resize"):a-c.x<l+1&&(this.Kx=["x",a,e],n="col-resize"))}
  this.ey&&window.clearTimeout(this.ey),this.ey=$(this.ny,this,[n],n?100:0)}}},ny:function(t){this.hy!=t&&(this.hy=t,this.et.style.cursor=t||"default")}};T("onDataTable",function(t,i){S.touch&&(Ki.$init(),i.scrollSize=0,Ki.Rs&&Ki.limit(),t.$ready.push(t.$touch))});var wr={$touch:function(){var t=this.Z;t.scrollAlignY=!1,P.extend(this,!0===t.prerender?this.oy:this.ay);var i="";t.autowidth||!1===t.scrollX||(i+="x"),t.autoheight||!1===t.scrollY||(i+="y"),this.Wt.setAttribute("touch_scroll",i),Ki.je(this.Wt.childNodes[1].firstChild),Ki.Ce(this.Wt.childNodes[1].firstChild,0,0,"0ms"),this.De(0,0,"0ms")},oy:{uy:function(t,i){Ki.Ce(this.Wt.childNodes[1].firstChild,-t,-i,"0ms"),this.De(-t,-i,"0ms")},cy:function(){var t=Ki.Me(this.Wt.childNodes[1].firstChild);return{x:-t.e,y:-t.f}},$init:function(){this.attachEvent("onBeforeScroll",function(){Ki.ue=this.Wt.childNodes[1].firstChild,Ki.Ge(Ki.ue),Ki.$e=this}),this.attachEvent("onTouchEnd",function(){Ki.$e=null})},De:function(t,i,s){this.Z.leftSplit&&Ki.Ce(this.Wt.childNodes[0].firstChild,0,i,s),this.Z.rightSplit&&Ki.Ce(this.Wt.childNodes[2].firstChild,0,i,s),this.Z.header&&Ki.Ce(this.U.childNodes[1].firstChild,t,0,s),this.Z.footer&&Ki.Ce(this.dl.childNodes[1].firstChild,t,0,s),this.callEvent("onSyncScroll",[t,i,s])},Pe:function(){}},ay:{uy:function(t,i){$(function(){this.callEvent("onAfterScroll",[{e:-t,f:-i}])},this)},$scroll:{gravity:0,elastic:!1},$init:function(){this.attachEvent("onAfterColumnHide",function(){this.uy(0,0)}),this.attachEvent("onBeforeScroll",function(){var t=Ki;t.ue=this.Wt.childNodes[1].firstChild,t.Ge(t.ue),t.ce.left=this.$h,t.ce.hidden=this.Ch.Z.scrollVisible||this.Sh.Z.scrollVisible,t.ce.dy=this.fy,t.$e=this}),this.attachEvent("onAfterScroll",function(t){if(t){var i=this.$h!=-t.e,s=this.kh!=-t.f;Ki.$e=null,Ki.ly=null,this.kh=0,this.$h=0;var e=Ki.config.translate;return Ki.config.translate="translate",this.De(this.Ch?0:t.e,0,"0ms"),Ki.config.translate=e,this.$h=-t.e,this.kh=-t.f,this.vy(),this.render(),i&&(this.Ch&&this.Ch.scrollTo(this.$h),this.callEvent("onScrollX",[])),s&&(this.Sh&&this.Sh.scrollTo(this.kh),this.callEvent("onScrollY",[])),!1}})},De:function(t,i,s){i+=this.kh,t+=this.$h,Ki.Ce(this.Wt.childNodes[1].firstChild,t,i,s),this.Z.leftSplit&&Ki.Ce(this.Wt.childNodes[0].firstChild,0,i,s),this.Z.rightSplit&&Ki.Ce(this.Wt.childNodes[2].firstChild,0,i,s),this.Z.header&&Ki.Ce(this.U.childNodes[1].firstChild,t,0,s),this.Z.footer&&Ki.Ce(this.dl.childNodes[1].firstChild,t,0,s),this.callEvent("onSyncScroll",[t,i,s])},Pe:function(t){t.f-=this.kh,t.e-=this.$h}}},xr={$init:function(){this.data.attachEvent("onStoreUpdated",C(function(t){t||this._y()},this)),this.attachEvent("onStructureLoad",this._y),this.attachEvent("onStructureUpdate",this.my),this.attachEvent("onColumnResize",function(t,i,s,e){e&&this.my()}),this.attachEvent("onResize",this.my)},_y:function(){for(var t=!1,i=this._l,s=0;s<i.length;s++)i[s].adjust&&("header"==i[s].adjust||this.count())&&(t=this.gy(s,i[s].adjust,!0)||t);t&&(this.Bo(!0),this.my())},my:function(){var t=this.Z.columns,i=[],s=0;if(t&&!this.Z.autowidth)for(var e=0;e<t.length;e++){var n=t[e].fillspace;n&&(s+=1*(i[e]=n)||1)}s&&this.wy(i,s)},wy:function(t,i){var s=this.Z.columns;if(s){var e=this.$s-this.xy,n=!1;if(0<e){for(var h=0;h<s.length;h++)t[h]||(e-=s[h].width||this.config.columnWidth);for(var r=0;r<t.length;r++)if(t[r]){var o=Math.min(e,Math.round(e*t[r]/i));n=this.Vo(r,o,!0)||n,e-=s[r].width,i-=t[r]}n&&this.Bo(!0)}}},yy:function(t,i){var s=this.Z.columns[t],e=s.minColumnWidth||10;if("header"!=i){var n=this.data.order.length;s.adjustBatch&&s.adjustBatch<n&&(n=s.adjustBatch);for(var h=this.data.order.slice(0,n),r=0;r<n;r++)h[r]=h[r]?this.My(this.getItem(h[r]),s,0):"";e=Math.max(e,nt(h,"webix_table_cell webix_cell").width)}if("data"!=i){for(var o=0;o<s.header.length;o++){var a=s.header[o];if(a){var u=0;if(a.rotate)for(var c=0;c<(a.rowspan||1);c++)u+=this.ml[c];var f="webix_table_cell webix_cell "+(a.css||"")+(a.rotate?"webix_measure_rotate":""),l=nt([a.text],f,u);e=Math.max(e,a.rotate?l.height:l.width)}}s.sort&&(e+=10)}return e+1+(
  S.isIE?Xi.layoutPadding.space:0)},gy:function(t,i,s){if(0<=t){var e=this.yy(t,i);return this.Vo(t,e,s)}},adjustColumn:function(t,i){this.gy(this.getColumnIndex(t),i)},adjustRowHeight:function(t,i){var s=this;if(t){var e,n=this.getColumnConfig(t),h=Y("DIV",{"class":"webix_table_cell webix_measure_size webix_cell"},"");h.style.cssText="width:"+n.width+"px; height:1px; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(h),h.offsetHeight<1&&(e=this.$view.cloneNode(!0),document.body.appendChild(e),e.appendChild(h)),this.data.each(function(t){h.innerHTML=this.My(t,n,0),t.$height=Math.max(h.scrollHeight,this.Z.rowHeight)},this),h=G(h),e&&G(e)}else{var r=new Array(this.data.order.length),o=this.config.columns,a=0;for(var u in this.data.pull)r[a]=0,a++;for(var c=function(t){s.adjustRowHeight(o[t].id,!0);var i=0;s.data.each(function(t){t.$height>r[i]&&(r[i]=t.$height),t.$height=r[i],i++})},f=0;f<o.length;f++)c(f)}i||this.refresh()}},yr={math_setter:function(t){return t&&this.Sy(),t},ky:"$",Sy:function(){S.strict||(this.data.attachEvent("onStoreUpdated",C(this.Cy,this)),this.data.attachEvent("onStoreLoad",C(this.$y,this)),this.attachEvent("onStructureLoad",this.$y))},Cy:function(t,i,s){if(t&&"paint"!=s)if("delete"==s)for(var e=0;e<this._l.length;e++)this.Dy(i,this._l[e].id);else{"add"==s&&this.Iy(i);for(var n=0;n<this._l.length;n++)this.Ay={},this.Ty(t,this._l[n].id);this.Ay={}}},Ty:function(t,i){var s,e=this.getItem(t);if((s=e[this.ky+i]||e[i])&&0<s.length&&"="===s.toString().substr(0,1)?(e[this.ky+i]=s,e[i]=this.Fy(s,t,i)):("undefined"!=typeof e[this.ky+i]&&delete e[this.ky+i],this.Dy(e,i)),"undefined"!=typeof e.depends&&"undefined"!=typeof e.depends[i])for(var n in e.depends[i]){var h=e.depends[i][n][0]+"__"+e.depends[i][n][1];"undefined"==typeof this.Ay[h]&&(this.Ay[h]=!0,this.Ty(e.depends[i][n][0],e.depends[i][n][1]))}},zy:function(t,i){var s=this.getItem(t);"undefined"!=typeof s[this.ky+i]&&(s[i]=s[this.ky+i])},$y:function(){if(this._l&&this.count()){this.Iy();for(var t=0;t<this._l.length;t++){var i=this.columnId(t);this.data.each(function(t){this.Ay={},this.Ty(t.id,i)},this)}this.Ay={}}},Iy:function(t){for(var i=0;i<this._l.length;i++)if(this._l[i].math){var s=this.columnId(i),e="="+this._l[i].math;e=e.replace(/\$c/g,"#$c#"),t?(t[s]=this.Vy(e,t.id,s),delete t[this.ky+s],this.Dy(t,s)):this.data.each(function(t){t[s]=this.Vy(e,t.id,s),delete t[this.ky+s],this.Dy(t,s)},this)}},Vy:function(t,i,s){return At(t)({$r:i,$c:s})},By:function(t,i){var s;if(!this.exists(t))return"#out_of_range";var e=(s=this.getItem(t))[this.ky+i]||s[i]||0;return"="!==(e=e.toString()).substring(0,1)?e:("undefined"==typeof s[this.ky+i]&&(s[this.ky+i]=s[i]),s[i]=this.Fy(e,t,i,!0),s[i])},Fy:function(t,i,s,e){if(!0===e){if(this.Hy(i,s))return"#selfreference"}else this.Ry();this.Py(i,s);var n=this.getItem(i);t=t.substring(1);var h=this.jy(t),r=this.Ey(t,i);t=h?(t=this.Ny(t,r),this.Ly(t,h)):this.Ny(t,r,!0);var o=this.Oy(t);if(!1!==o)return o;this.Uy(i,s),this.Dy(n,s);for(var a=0;a<r.length;a++)this.Yy([i,s],r[a]);return!1!==(o=this.Oy(t))?o:t?(t=this.Wy(t.replace(/\$r/g,n.id)),!1!==(o=this.Oy(t))?o:t):t},jy:function(t){return t.replace(/\[[^)]*?\]/g,"").match(/(\+|-|\*|\/)/g)},Ey:function(t,i){var s=t.match(/\[([^\]]+),([^\]]+)\]/g);null===s&&(s=[]);for(var e=0;e<s.length;e++){var n=s[e],h=n;(n=(n=n.substr(1,n.length-2)).split(","))[0]=this.Gy(n[0]),n[1]=this.Gy(n[1]),":"===n[0].substr(0,1)&&(n[0]=this.getIdByIndex(n[0].substr(1))),"$r"===n[0]&&(n[0]=i),":"===n[1].substr(0,1)&&(n[1]=this.columnId(n[1].substr(1))),n[2]=h,s[e]=n}return s},Ny:function(t,i,s){var e="(",n=")";s&&(e=n="");for(var h=0;h<i.length;h++){var r=i[h],o=this.By(r[0],r[1]);isNaN(o)&&(o='"'+o+'"'),t=t.replace(r[2],e+o+n)}return t},Ly:function(t,i){for(var s=[],e=0;e<i.length;e++){var n=i[e],h=this.Xy(t,n);s.push(h[0]),t=h[1]}s.push(t);for(var r=0;r<s.length;r++){var o=this.Gy(s[r]);s[r]=o}for(var a="",u=0;u<s.length-1;u++)a+=s[u]+i[u];return a+=s[s.length-1]},Wy:function(t){var i;try{i=window.eval(t)}catch(s){i=""}return i.toString()},
  Xy:function(t,i){var s=t.indexOf(i);return[t.substr(0,s),t.substr(s+1)]},Gy:function(t){return t=(t=t.replace(/^ */g,"")).replace(/ *$/g,"")},Ry:function(){this.Jy=[]},Py:function(t,i){this.Jy[t+"__"+i]=!0},Uy:function(t,i){"undefined"!=typeof this.Jy[t+"__"+i]&&delete this.Jy[t+"__"+i]},Hy:function(t,i){return"undefined"!=typeof this.Jy[t+"__"+i]},Yy:function(t,i){var s=this.getItem(i[0]);"undefined"==typeof s.depends&&(s.depends={}),"undefined"==typeof s.depends[i[1]]&&(s.depends[i[1]]={}),s.depends[i[1]][t[0]+"__"+t[1]]=t,"undefined"==typeof(s=this.getItem(t[0])).triggers&&(s.triggers={}),"undefined"==typeof s.triggers[t[1]]&&(s.triggers[t[1]]={}),s.triggers[t[1]][i[0]+"__"+i[1]]=i},Dy:function(t,i){if(t&&"undefined"!=typeof t.triggers)for(var s in t.triggers[i]){var e=t.triggers[i][s],n=this.getItem(e[0]);n&&delete n.depends[e[1]][t.id+"__"+i]}},Oy:function(t){var i=t.match(/#\w+/);return null!==i&&0<i.length&&i[0]}},Mr={headermenu_setter:function(t){return t&&(t.data&&(this.Zy=!0),t=this.qy(t)),t},qy:function(n){var t={view:"contextmenu",template:"<span class='webix_icon {common.hidden()}'></span> &nbsp; #value#",type:{hidden:function(t){return t.hidden?"wxi-eye-slash":"wxi-eye"}},on:{onMenuItemClick:C(function(t){var i=Pt(this.Z.headermenu),s=i.getItem(t).hidden;i.getItem(t).hidden=!s,i.refresh(t),i.$blockRender=!0;var e={spans:"object"==k(n)&&n.spans};return s?this.showColumn(t,e):this.hideColumn(t,e),i.$blockRender=!1},this)},data:[]};"object"==k(n)&&P.extend(t,n,!0);var i=zt(t);return i.attachTo(this.U),this.ht.push(i),this.attachEvent("onStructureLoad",this.Ky),this.attachEvent("onStructureUpdate",this.Ky),this.qy=function(t){return t},i.Z.id},Ky:function(){var t=Pt(this.Z.headermenu),i=this.Fo;if(!t.$blockRender){if(this.Zy)return t.data.each(function(t){t.hidden=!!i[t.id]}),void t.refresh();var s=[],e=this.$o;e.length||(e=this._l);for(var n=0;n<e.length;n++){var h=this.getColumnConfig(e[n].id||e[n]),r=h.header[0],o=!!i[h.id];!1!==h.headermenu&&r&&s.push({id:h.id,value:o?r.text:r.groupText||r.text,hidden:o})}s.length&&t.data.importData(s)}}};yn.headerMenu={getValue:function(){},setValue:function(){},refresh:function(t,i){t.Z.headermenu||(t.define("headermenu",!0),t.Ky()),i.onclick=function(){Pt(t.config.headermenu).show(i)}},render:function(){return"<span class='webix_icon wxi-columns' role='button' tabindex='0' aria-label='"+ct.aria.headermenu+"'>"}};var Sr={Fa:function(t){return this.getColumnConfig(t.column).editor},getEditor:function(t,i){return t?(1==arguments.length&&(i=t.column,t=t.row),(this.xa[t]||{})[i]):this.Yi},Oa:function(t){for(var i in this.xa){var s=this.xa[i];for(var e in s)"$count"!=e&&t.call(this,s[e])}},za:function(t,i,s){var e=t.row,n=t.column,h=i.config=this.getColumnConfig(n);!1!==s&&this.showCell(e,n);var r=i.render();i.$inline&&(r=this.ka(t)),i.node=r;var o,a=this.getItem(e),u=h.editFormat;return this.Z.editMath&&(o=a["$"+n]),j(o=o||a[n])&&(o=""),i.setValue(u?u(o):o,a),i.value=a[n],this.Ra(t,i),i.$inline||(i.Qy=this.Pa(t,r,!0)),i.afterRender&&i.afterRender(),this.Z.liveValidation&&(Nt(i.node,"keyup",this.tM(t,this)),this.validateEditor(t)),r},tM:function(t,i){return function(){i.validateEditor(t)}},Ua:function(t){var i=this.getColumnConfig(t.column).editParse,s=t.getValue();return i?i(s):s},Aa:function(t,i,s){var e=s?{}:this.getItem(t.row);return e[t.column]=i,this.Z.editMath&&(e["$"+t.column]=null),e},Ra:function(t,i){var s=this.xa[t.row]=this.xa[t.row]||{};s.$count=(s.$count||0)+1,i.row=t.row,i.column=t.column,this.Yi=s[t.column]=i,this.Hi++,this.iM=this.getScrollState()},Ea:function(t){this.Yi==t&&(this.Yi=0),t.destroy&&t.destroy();var i=this.xa[t.row];delete i[t.column],i.$count--,i.$count||delete this.xa[t.row],this.Hi--},Ca:function(t,i){var s=this.xa[t];if(s)for(var e in this.xa[i]=s,delete this.xa[t],s)"$count"!=e&&(s[e].row=i)},ja:function(t){var i,s,e,n,h,r=this.getColumnConfig(t.column),o=0;if(r&&r.node&&r.attached){if(e=this.getIndexById(t.row),this.bl&&this.getSpan(t.row,t.column))for(s=0;s<3;s++)for(i=this.sM[s],n=0;!o&&n<i.childNodes.length;n++)(h=i.childNodes[n]
  ).getAttribute("row")==e&&h.getAttribute("column")==this.getColumnIndex(t.column)&&(o=h);!o&&e>=r.eM-this.Z.topSplit&&e<r.nM&&(o=r.node.childNodes[e-r.eM+this.Z.topSplit])}return o},editCell:function(t,i,s,e){return i=i||this.Z.columns[0].id,Ds.edit.call(this,{row:t,column:i},s,e)},editRow:function(i){i&&i.row&&(i=i.row);var s=!1;this.eachColumn(function(t){this.edit({row:i,column:t},s,!s),s=!0})},editColumn:function(i){i&&i.column&&(i=i.column);var s=!1;this.eachRow(function(t){this.edit({row:t,column:i},s,!s),s=!0})},eachRow:function(t,i){var s=this.data.order;i&&(s=this.data.Rr||s);for(var e=0;e<s.length;e++)t.call(this,s[e])},eachColumn:function(t,i){for(var s in this.pl){var e=this.pl[s];t.call(this,e.id,e)}if(i)for(var n in this.Fo){var h=this.Fo[n];t.call(this,h.id,h)}},Wa:function(t){if(this.getSelectedId&&1==this.getSelectedId(!0).length)return this.Po(t),!1},Bi:function(t,i){if(this.Z.editable&&!this.Hi){if(i.target&&"INPUT"==i.target.tagName)return!0;var s=this.getSelectedId(!0);if(1==s.length){var e=s[0];return"row"==this.Z.select&&(e.column=this.Z.columns[i.shiftKey?0:this.Z.columns.length-1].id),this.editNext(t,e),!1}}return!0},Ya:function(t,i,s){var e=this.getIndexById(t.row),n=this.getColumnIndex(t.column),h=this.data.order,r=this._l;if(s)for(var o=e;o<h.length;o++){for(var a=n+1;a<r.length;a++){var u={row:h[o],column:r[a].id};if(i.call(this,u)&&(!this.hM||!this.hM(t,u)))return u}n=-1}else for(var c=e;0<=c;c--){for(var f=n-1;0<=f;f--){var l={row:h[c],column:r[f].id};if(i.call(this,l))return l}n=r.length}return null},rM:function(){this.Hi&&(this.oM?this.oM=!1:(this.Sh.scrollTo(this.getScrollState().y+this.Wt.childNodes[1].firstChild.scrollTop),this.Wt.childNodes[1].firstChild.scrollTop=0,this.oM=!0))},aM:function(){this.Hi&&this.Ch.scrollTo(this.Wt.childNodes[1].scrollLeft)},Da:function(){this.attachEvent("onScrollY",this.uM),this.attachEvent("onScrollX",this.uM),this.attachEvent("onScrollY",this.ya),this.attachEvent("onColumnResize",function(){this.editStop()}),this.attachEvent("onAfterFilter",function(){this.editStop()}),this.attachEvent("onRowResize",function(){this.editStop()}),this.attachEvent("onAfterScroll",function(){this.Z.topSplit&&this.editStop()}),this.Wt.childNodes[1].firstChild.onscroll=C(this.rM,this),this.Wt.childNodes[1].onscroll=C(this.aM,this)},uM:function(){if(this.Hi){var t=this.iM;this.iM=this.getScrollState();var r=this.iM.y-t.y;this.Oa(function(t){if(t.getPopup){var i=this.getItemNode(t),s=!1;if(this.Z.prerender){var e=t.Qy,n=e.top-this.kh,h=e.left-this.$h;s=n<0||n+e.height>this.cM||h<0||h+e.width>this.$width-this.fM}!i||s?t.getPopup().show({x:-1e4,y:-1e4}):t.getPopup().show(i)}this.Z.prerender||t.linkInput||t.$inline||(t.node.top-=r,t.node.style.top=t.node.top+"px")})}}},kr={$init:function(){this.lM(),this.attachEvent("onStructureLoad",this.dM)},lM:function(){this.Fo={},this.$o=p(),this.zo=[0,0]},dM:function(){for(var t=this._l,i=0;i<t.length;i++)t[i].header&&this.vM(t,t[i].header),t[i].footer&&this.vM(t,t[i].footer);for(var s=t.length-1;0<=s;s--)t[s].hidden?this.hideColumn(t[s].id,{},!0,!0):t[s].batch&&this.config.visibleBatch&&t[s].batch!=this.config.visibleBatch&&this.hideColumn(t[s].id,{},!0,!0)},vM:function(t,i){for(var s=0;s<i.length;s++){var e=i[s];e&&e.colspan&&!e.$colspan&&(e.$colspan=e.colspan)}},moveColumn:function(t,i){var s=this.getColumnIndex(t);if(s!=i){var e=this.Z.columns,n=e.splice(s,1),h=i-(s<i?1:0);x.insertAt.call(e,n[0],h);var r=this.$o;if(r.length){var o=(r=p(r)).find(t);r.removeAt(o),0===h?r.unshift(t):r.insertAt(t,r.find(e[h-1].id)+1)}this._M()}},pM:function(){var t=this.$o,i=this.Z.columns;if(!t.length){for(var s=0;s<i.length;s++)t[s]=i[s].id;this.zo=[this.Z.leftSplit,this.qw]}},isColumnVisible:function(t){return!this.Fo[t]},hideColumn:function(t,i,s,e){var n,h=this.Z.columns,r=this.$o,o=this.Fo,a=1;if(i=i||{},!1!==e){var u=this.getColumnIndex(t);if(-1===u||!this.callEvent("onBeforeColumnHide",[t]))return;if(-1==u)return;if(this.pM(),i.spans)for(var c=h[u].header,f=0;f<c.length;f++)c[f]&&(c[f].$groupSpan=c[f].colspan||1,a=Math.max(a,c[f].$groupSpan))
  ;u<this.Z.leftSplit&&(this.Z.leftSplit-=a),u>=this.qw?this.Z.rightSplit-=a:this.qw-=a;for(var l=u+a-1;u<=l;l--)this.mM(u),(o[(n=h.splice(u,1)[0]).id]=n).eM=-1,delete this.pl[n.id];this.callEvent("onAfterColumnHide",[t])}else{if(!(n=o[t])||!this.callEvent("onBeforeColumnShow",[t]))return;for(var d=null,v=0,_=0;v<r.length;v++){if(r[v]==t){_=v;break}o[r[v]]||(d=r[v])}var p=d?this.getColumnIndex(d)+1:0;if(i.spans)for(var m=n.header,b=0;b<m.length;b++)m[b]&&(m[b].colspan=m[b].$groupSpan||m[b].colspan,delete m[b].$groupSpan,a=Math.max(a,m[b].colspan||1));for(var g=_+a-1;_<=g;g--){var w=o[r[g]];w?(x.insertAt.call(h,w,p),delete w.hidden,delete o[w.id],this.pl[w.id]=w):a--}_<this.zo[0]&&(this.Z.leftSplit+=a),_>=this.zo[1]?this.Z.rightSplit+=a:this.qw+=a,this.callEvent("onAfterColumnShow",[t])}n.header&&this.bM(n,!1!==e?0:1,"header"),n.footer&&this.bM(n,!1!==e?0:1,"footer"),s||this._M()},bM:function(t,i,s){for(var e=t[s].length-1;0<=e;e--)for(var n,h=this.$o,r=!1,o=0,a=0;a<h.length;a++){var u=this.getColumnConfig(h[a]),c=u[s][e];this.isColumnVisible(h[a])?(r&&0<o&&n&&0<n.colspan?n=c=u[s][e]=n:c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,n=c),r=null):(c&&c.$colspan&&o<=0&&(o=c.colspan=c.$colspan,r=n=c),n&&0<o&&n.colspan--),o--}},refreshColumns:function(t,i){this.gM=!0,(t&&t!=this.config.columns||i)&&(this.lM(),this.Ao={},t&&(this.qw=t.length-(this.config.rightSplit||0))),this.pl={};for(var s=0;s<this._l.length;s++){var e=this._l[s];(this.pl[e.id]=e).attached=e.node=null}for(var n=0;n<3;n++)this.U.childNodes[n].innerHTML="",this.Wt.childNodes[n].firstChild.innerHTML="";this._l=this.config.columns=t||this.config.columns,this.qw=this._l.length-this.Z.rightSplit,this.To=0,this.wM(),this.Xh(),this.callEvent("onStructureUpdate"),this.render(),this.gM=0},_M:function(){this.To=0,this.callEvent("onStructureUpdate"),this.xM(),this.render()},showColumn:function(t,i,s){return this.hideColumn(t,i,s,!1)},showColumnBatch:function(e,n){var h=void 0!==n;n=!1!==n,this.eachColumn(function(t,i){if(i.batch){var s=this.Fo[i.id];n||(s=!s),i.batch==e&&s?this.hideColumn(i.id,{spans:!0},!0,!n):h||i.batch==e||s||this.hideColumn(i.id,{spans:!0},!0,n)}},!0),this._M()}},Cr={$init:function(){this.attachEvent("onAfterScroll",this.yu),this.attachEvent("onFocus",function(){st(this.$view,"webix_dtable_focused")}),this.attachEvent("onBlur",function(){et(this.$view,"webix_dtable_focused")})},yu:function(){if(!this.yM()){var t=this.mt.querySelector(".webix_cell");t&&t.setAttribute("tabindex","0")}},yM:function(){for(var t=this.getSelectedId(!0),i=0;i<t.length;i++)if(this.isColumnVisible(t[i].column))return this.getItemNode(t[i]);return null},moveSelection:function(t,i,s){if(this.delayRender(),!this.Z.disabled){i=i||{};var e=this.getSelectedId(!0),n=e.length-1,h=!(!this.Z.multiselect&&!this.Z.areaselect)&&i.shift;if(1<e.length&&"cell"!==this.Z.select&&(e=e.sort(C(function(t,i){return this.getIndexById(t.row)>this.getIndexById(i.row)||this.getColumnIndex(t.column)>this.getColumnIndex(i.column)?1:-1},this)),"up"!=t&&"left"!=t&&"top"!=t&&"pgup"!=t||(n=0)),n<0&&this.count()){if("down"==t||"right"==t)t="top";else{if("up"!=t&&"left"!=t)return;t="bottom"}n=0,e=[{row:1,column:1}]}if(0<=n){var r=e[n].row,o=e[n].column;if("top"==t||"bottom"==t)r&&("top"==t?r=this.data.getFirstId():"bottom"==t&&(r=this.data.getLastId())),o&&(n=0,"bottom"==t&&(n=this.config.columns.length-1),o=this.columnId(n));else if("up"==t||"down"==t||"pgup"==t||"pgdown"==t){if(r){var a=this.getIndexById(r),u=1;"pgup"!=t&&"pgdown"!=t||(u=this.pc?this.pc.config.size:Math.round(this.cM/this.Z.rowHeight)),"up"==t||"pgup"==t?a-=u:"down"!=t&&"pgdown"!=t||(a+=u),a<0&&(a=0),a>=this.data.order.length&&(a=this.data.order.length-1),!(r=this.getIdByIndex(a))&&this.Z.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.MM)&&"right"==t)return this.open?this.open(r):this.openSub(r);if((
  this.close||this.MM)&&"left"==t)return this.close?this.close(r):this.closeSub(r)}}if(r){this.showCell(r,o),this.select||(P.extend(this,this.gx.bx,!0),this.Z.select=this.open||this.MM?"row":"cell",P.extend(this,this.gx[this.Z.select],!0));var f={row:r,column:o};if(h&&"area"==this.Z.select){var l=this.jw[this.jw.length-1];this.Hw(f,l,t,i)}else this.Po(f,h);if(!this.Z.clipboard&&!1!==s){var d=this.getItemNode(f);d&&d.focus()}}}return!1}}},$r={Zo:function(t){for(var i=0;i<this._l.length;i++){var s=this._l[i],e=this.getItemNode({row:t,cind:i});e?e.parentNode.insertBefore(is.xn[i],e):s.node.appendChild(is.xn[i])}},ta:function(){var t=[],i=this._l.length,s=document.createElement("div");s.className="webix_drop_area",s.style.height=this.Z.rowHeight+"px",s.innerHTML=this.$dropHTML();for(var e=0;e<i;e++)t.push(s.cloneNode(!0));return t}},Dr={drag_setter:function(t){return this.attachEvent("onBeforeDrag",function(t){return this.SM(t.source)}),this.attachEvent("onBeforeDragIn",function(t){var i=this.SM(t.target);return!i&&is.xn&&(G(is.xn),this.sa=is.xn=null),i}),ys.drag_setter.call(this,t),"order"!=t&&"move"!=t||P.extend(this,$r,!0),t},Jo:function(t,i,s){var e=is["in"];this.Z.prerender||s||(t=[e.start]);for(var n=0;n<t.length;n++){for(var h=0;h<this._l.length;h++){var r=this.getItemNode({row:t[n],cind:h});r&&st(r,i)}this.data.addMark(t[n],i,1,1,!0)}},Xo:function(t,i,s){var e=is["in"];this.Z.prerender||s||(t=[e.start]);for(var n=0;n<t.length;n++){for(var h=0;h<this._l.length;h++){var r=this.getItemNode({row:t[n],cind:h});r&&et(r,i)}this.data.removeMark(t[n],i,1,!0)}},SM:function(t){var i,s,e=!1;if(this.Z.topSplit&&t)for(g(t)||(t=[t]),i=0;!e&&i<t.length;i++)e=0<=(s=this.getIndexById(t[i]))&&s<this.Z.topSplit;return!e},Ot:function(t){for(var i="<div class='webix_dd_drag' style='width:"+(this.$s-this.xy)+"px;'>",s=this.Z.columns,e=0;e<s.length;e++){var n=this.My(t,s[e]);i+="<div style='width:"+s[e].width+"px;'>"+n+"</div>"}return i+"</div>"},getHeaderNode:function(t,i){return this.kM(t,i,this.U)},getFooterNode:function(t,i){return this.kM(t,i,this.dl)},kM:function(t,i,s){if(this.isColumnVisible(t)){var e=this.getColumnIndex(t),n=this.Z.leftSplit>e?0:this.qw<=e?2:1;i=i||0;var h=s.childNodes[n].getElementsByTagName("TR");if(h.length)for(var r=h[i+1].childNodes,o=0;o<r.length;o++)if(r[o].getAttribute("column")==e)return r[o].firstChild}return null},getItemNode:function(t){if(t&&!t.header){var i=t.row||t,s="number"==typeof t.rind?t.rind:this.getIndexById(i),e=this.Uw(),n=e[0]-this.Z.topSplit;if(s<n&&s>e[1])return;var h=this.Ow(),r=this.Z.leftSplit?0:h[0],o="number"==typeof t.cind;if((t.column||o)&&(r=o?t.cind:this.getColumnIndex(t.column))<this.qw&&r>=this.Z.leftSplit&&(r<h[0]||r>h[1]))return;var a=this.Z.columns[r];if(a.attached&&a.node){if("$webix-drop"===i)return is.xn[r];for(var u=s<this.Z.topSplit||this.Z.prerender?s:s-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]}}},CM:function(t){var i=(t.target||t.srcElement).nodeName;return"INPUT"!=i&&"TEXTAREA"!=i},dragColumn_setter:function(t){var r;"order"==t?r={$drag:C(function(t,i){if(!this.CM(i)||this.f_)return!1;var s=this.locate(i);if(!s||!this.callEvent("onBeforeColumnDrag",[s.column,i]))return!1;is["in"]={from:r,start:s,custom:"column_dnd"};var e=this.getColumnConfig(s.column);return this.$M=q(i),this.DM=e.width,this.Eo=!0,"<div class='webix_dd_drag_column' style='width:"+e.width+"px'>"+(e.header[0].text||"&nbsp;")+"</div>"},this),$dragPos:C(function(t,i,s){var e=this,n=is.getContext(),h=Z(this.$view);s.style.display="none";var r=document.elementFromPoint(t.x,h.y+1),o=r?this.locate(r):null,a=is.getContext().start.column;if(o&&o.column!=a&&(!this.IM||o.column!=this.AM)&&"column_dnd"==n.custom&&Pt(r)==this){if(!this.callEvent("onBeforeColumnDropOrder",[a,o.column,i]))return;var u=this.getColumnIndex(a),c=this.getColumnIndex(o.column);i.touches&&(this.TM=i.target,this.TM.style.display="none",this.$view.parentNode.appendChild(this.TM)),this.moveColumn(a,c+(u<c?1:0)),this.AM=o.column,this.IM=!0}if(o&&o.column==a&&(this.IM=!1),
  s.style.display="block",t.x=t.x-this.$M.x,t.y=h.y,t.x<h.x)t.x=h.x;else{var f=h.x+this.$view.offsetWidth-this.xy-this.DM;t.x>f&&(t.x=f)}is._n=!0,this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),!1!==this.Z.dragscroll&&(this.Jt=$(function(t){return e.Zt(t)},this,[K(i)],250))},this),$dragDestroy:C(function(t,i){this.Eo=null,this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),G(i),this.TM&&G(this.TM);var s=is.getContext().start;this.callEvent("onAfterColumnDropOrder",[s.column,this.AM,t])},this),$drop:function(){}}:t&&(r={No:!0,$drag:C(function(t,i){if(!this.CM(i)||this.f_)return!1;var s=this.locate(i);if(!s||!this.callEvent("onBeforeColumnDrag",[s.column,i]))return!1;is["in"]={from:r,start:s,custom:"column_dnd"};for(var e=this.getColumnConfig(s.column).header,n="&nbsp;",h=0;h<e.length;h++)if(e[h]){n=e[h].text;break}return this.Eo=!0,"<div class='webix_dd_drag_column'>"+n+"</div>"},this),$drop:C(function(t,i,s){var e=s;s.touches&&this.FM&&(e=this.FM);var n=this.locate(e);if(!n)return!1;var h=is.getContext().start.column;if(h!=n.column){if(!this.callEvent("onBeforeColumnDrop",[h,n.column,s]))return;var r=this.getColumnIndex(h),o=this.getColumnIndex(n.column);this.moveColumn(h,o+(r<o?1:0)),this.callEvent("onAfterColumnDrop",[h,n.column,s])}},this),$dragIn:C(function(t,i,s){var e=this,n=is.getContext();if("column_dnd"!=n.custom||n.from!=r)return!1;for(var h=s.target||s.srcElement;-1==(h.className||"").indexOf("webix_hcell");)if(!(h=h.parentNode))return;return this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),!1!==this.Z.dragscroll&&(this.Jt=$(function(t){return e.Zt(t)},this,[K(s)],250)),h!=this.FM&&(this.FM&&et(this.FM,"webix_dd_over_column"),st(h,"webix_dd_over_column")),this.FM=h},this),$dragDestroy:C(function(t,i){this.Eo=null,this.Jt&&(this.Jt=window.clearTimeout(this.Jt)),this.FM&&et(this.FM,"webix_dd_over_column"),G(i)},this)}),t&&(is.addDrag(this.U,r),is.addDrop(this.U,r,!0),this.Yt||P.extend(this,vi,!0))}},Ir={fh:function(t,i){if(t.scroll&&!i)return!0;t.header=j(t.header)?!!this.config.header:t.header,t.footer=j(t.footer)?!!this.config.footer:t.footer,t.xCorrection=t.xCorrection||0},Sm:function(t,i){for(var s=-1,e=0;s<0&&e<t.length;e++)i(t[e])&&(s=e);return s},zM:function(s,c,f){var l={},d=0;return s.forEach(C(function(t,o){var i=t[0],a=[],u=i.length;i.forEach(C(function(t,i){for(var s=c[i+d],e=0;e<s[f].length;e++){var n=s[f][e];if(n||l[o]&&l[o][e]){if(n=m(n||{text:""}),l[o]&&l[o][e]&&0===i&&(n.colspan=l[o][e],l[o][e]=0),n.colspan){var h=Math.min(n.colspan,u-i);l[o+1]=l[o+1]||{},l[o+1][e]=n.colspan-h,n.colspan=h}n.rowspan&&1===u&&(n.height=(n.height||this.config.headerRowHeight)*n.rowspan,n.rowspan=null);var r={txt:n.rotate?this.getHeaderNode(s.id,e).innerHTML:n.text||(n.contentId?this.getHeaderContent(n.contentId).getValue():""),className:"webix_hcell webix_"+f+"_cell "+(n.css||""),style:{height:(n.height||this.config.headerRowHeight)+"px",width:n.colspan?"auto":s.width+"px"},span:n.colspan||n.rowspan?{colspan:n.colspan||1,rowspan:n.rowspan||1}:null};a[e]=a[e]||[],a[e][i]=r}}},this)),s[o]="header"==f?a.concat(t):t.concat(a),d+=u},this)),s},lh:function(v,t,_){var p=this.config.columns,m=this.getSelectedId(!0),b=this.vh(v),g=0,w=0,x=[],y=0;return _=_||0+v.xCorrection,t=t||[],this.eachRow(C(function(i){for(var t=0,s=this.getItem(i),e=this.getIndexById(i),n=[],h=!1,r=_;r<p.length;r++){var o=p[r].id,a=this.getColumnIndex(o)-_;if(p[r]){if(t+=p[r].width,b<t&&_<r){y=r;break}if("selection"!==v.data||"selection"==v.data&&-1!==this.Sm(m,function(t){return t.column==o&&t.row==i})){var u;if(this.getSpan&&(u=this.getSpan(i,o)),u&&this.getColumnIndex(o)===_){var c=this.getColumnIndex(u[1]);c<_&&(u[2]=u[2]-(_-c),u[4]=u[4]?u[4]:s[u[1]]?this.getText(i,u[1]):null,u[1]=o)}if(!u||u&&u[0]==i&&u[1]==o){var f=u&&u[4]?u[4]:this.pl[o]?this.getText(i,o):"",l=this.getCss(i,o)+" "+(p[r].css||"")+(u?" webix_dtable_span "+(u[5]||""):""),d={height:u&&1<u[3]?"auto":(s.$height||this.config.rowHeight)+"px",width:u&&1<u[2]?"auto":p[r].width+"px"};n.push({txt:f,className:l,style:d,span:u?{colspan:u[2],spanStart:this.getColumnIndex(u[1]),rowspan:u[3]}:null}),
  f&&(g=Math.max(a+1,g),w=Math.max(e+1,w)),h=h||!!f}else u&&(n.push({$inspan:!0}),g=Math.max(a+1,g),w=Math.max(e+1,w))}}}v.skiprows&&!h||x.push(n)},this)),w&&g&&(v.trim&&(x.length=w,x=x.map(function(t){for(var i=t.length-1;0<=i;i--)if(t[i].span&&t[i].span.colspan){t[i].span.colspan=Math.min(t[i].span.colspan,t.length-i);break}return t.length=g,t})),t.push(x)),y?this.lh(v,t,y):(v.footer&&(t=this.zM(t,p,"footer")),v.header&&(t=this.zM(t,p,"header"))),t},dh:function(n,h){var r=Y("div");return n.forEach(C(function(t,i){var s=Y("table",{"class":"webix_table_print "+this.$view.className+(h.borderless?" borderless":""),style:"border-collapse:collapse",id:this.$view.getAttribute("id")});if(t.forEach(function(t){var e=Y("tr");t.forEach(function(t){if(!t.$inspan){var i=Y("td");for(var s in i.innerHTML=t.txt,i.className=t.className,t.style)i.style[s]=t.style[s];t.span&&(i.colSpan=t.span.colspan,i.rowSpan=t.span.rowspan),e.appendChild(i)}}),s.appendChild(e)}),r.appendChild(s),i+1<n.length){var e=Y("DIV",{"class":"webix_print_pagebreak"});r.appendChild(e)}},this)),r}},Ar={$exportView:function(t){if(this.isBranchOpen&&P.extend(t,{filterHTML:!0}),"excel"!==t.export_mode||t.dataOnly||!t.styles)return this;t.dataOnly=!0,t.heights=j(t.heights)?"all":t.heights;var i=Ve(this,t);return i[0].styles=this.VM(t),delete t.dataOnly,i},VM:function(t){var c=this.config.columns,f=[];return this.BM=this.BM||{},t.docHeader&&(f=[{0:this.HM(t.docHeader.css)},{0:{}}]),!1!==t.header&&(f=this.RM(t,"header",f)),this.data.each(function(t){for(var i={},s=0;s<c.length;s++){var e=this.getCss(t.id,c[s].id),n=c[s].node.className,h="",r=this.getIndexById(t.id)%2?"even":"odd",o=null,a=null;if(this.bl&&(o=this.getSpan(t.id,c[s].id))?(a=this.getSpanNode({row:o[0],column:o[1]}),h="webix_dtable_span "+(o[5]||"")):a=this.getItemNode({row:t.id,column:c[s].id}),!a){a=Y("div",{"class":e,style:"visibility:hidden"});var u=c[s].node;c[s].attached||(u=Y("div",{"class":n,style:"visibility:hidden"}),this.Wt.appendChild(u)),u.appendChild(a)}i[s]=this.PM(a,[e,n,h,r].join(":"))}f[f.length]=i},this),!1!==t.footer&&this.config.footer&&(f=this.RM(t,"footer",f)),t.docFooter&&(f=f.concat([{0:{}},{0:this.HM(t.docFooter.css)}])),f},RM:function(t,i,s){for(var e=this.config.columns,n=[],h=0;h<e[0][i].length;h++){for(var r={},o=0;o<e.length;o++){var a=e[o][i][h];if(a){var u=a.colspan?e[o+a.colspan-1].id:e[o].id,c="header"==i?this.getHeaderNode(u,h):this.getFooterNode(u,h);if(c){var f=[c.parentNode.className,a.css||"","webix_hcell",i];r[o]=this.PM(c,f.join(":")),(a.colspan||a.rowspan)&&n.push([h,o,{colspan:a.colspan-1||0,rowspan:a.rowspan-1||0},r[o]])}}else for(var l=0;l<n.length;l++){var d=n[l][2],v=n[l][1],_=n[l][0];v+d.colspan>=o&&_+d.rowspan>=h&&(r[o]=n[l][3])}}s[s.length]=r}return s},PM:function(t,i){if(this.BM[i])return this.BM[i];var s=this.jM(t),e={font:{},alignment:{},border:{}};e.font.name=s["font-family"].replace(/,.*$/,""),e.font.sz=.75*s["font-size"].replace("px",""),e.font.color={rgb:Ws.rgbToHex(s.color)},"normal"!==s["font-weight"]&&400!=s["font-weight"]&&(e.font.bold=!0),"underline"===s["text-decoration-line"]&&(e.font.underline=!0),"italic"===s["font-style"]&&(e.font.italic=!0),"line-through"===s["text-decoration-line"]&&(e.font.strike=!0),e.alignment.horizontal=s["text-align"],e.alignment.vertical=s.height==s["line-height"]?"center":"top","normal"==s["white-space"]&&(e.alignment.wrapText=!0),t.firstChild&&t.firstChild.className&&-1!==t.firstChild.className.indexOf("webix_rotate")&&(e.alignment.textRotation=90);var n=Ws.rgbToHex(s["background-color"])||"FFFFFF";return e.fill={fgColor:{rgb:n}},-1!==s["background-image"].indexOf("gradient")&&(e.fill={fgColor:{rgb:Ws.rgbToHex(s["background-image"].substring(s["background-image"].lastIndexOf("(")))}}),t.parentNode&&"TD"==t.parentNode.nodeName&&(s=this.jM(t.parentNode)),"0px"!==s["border-right-width"]&&(e.border.right={style:"thin",color:{rgb:Ws.rgbToHex(s["border-right-color"])||n}}),"0px"!==s["border-bottom-width"]&&(e.border.bottom={style:"thin",color:{rgb:Ws.rgbToHex(s["border-bottom-color"])||n}}),
  "0px"!==s["border-left-width"]&&(e.border.left={style:"thin",color:{rgb:Ws.rgbToHex(s["border-left-color"])||n}}),"0px"!==s["border-top-width"]&&(e.border.top={style:"thin",color:{rgb:Ws.rgbToHex(s["border-top-color"])||n}}),this.BM[i]=e},HM:function(t){t=P.extend(t||{},{visibility:"hidden","white-space":"nowrap","text-align":"left"});var i="";for(var s in t)i+=s+":"+t[s]+";";var e=Y("div",{style:i});this.Wt.appendChild(e);var n=this.PM(e,i);return G(e),n},jM:function(t){return window.getComputedStyle?window.getComputedStyle(t):t.currentStyle}},Tr={subrow_setter:function(t){return!!t&&(this.EM(),this.Z.fixedRowHeight=!1,At(t))},subview_setter:function(t){return t&&(this.Z.subrow=this.subrow_setter("<div></div>")),t},defaults:{subRowHeight:35},NM:function(){this.data.each(function(t){t&&(t.$sub=this.Z.subrow(t,this.type))},this),this.LM()},LM:function(t){if("auto"===this.Z.subRowHeight&&this.$s&&this.OM(),t&&this.Z.subview)for(var i in this.MM){var s=Pt(this.MM[i]);s.Z.hidden||s.adjust()}},UM:function(t){var i=this.getItem(t);i.$sub=this.Z.subrow(i,this.type),"auto"===this.Z.subRowHeight&&this.OM(i.id,i.$sub)},$init:function(){this.EM=l(function(){var t="#"+this.YM+" .webix_cell.webix_dtable_subview { line-height:normal;}";this.Z.fixedRowHeight&&(t+="#"+this.YM+" .webix_column .webix_cell { white-space: nowrap;}"),O(t),this.MM={},this.attachEvent("onSubViewRender",this.WM),this.data.attachEvent("onStoreUpdated",C(function(t,i,s){t?"update"==s||"add"==s?this.UM(t):"delete"==s&&i.$subContent&&(Pt(i.$subContent).destructor(),delete this.MM[i.$subContent]):this.NM()},this)),this.attachEvent("onResize",function(t,i,s){s!=t&&this.LM(!0)})}),this.type.subrow=function(t){return t.$sub?t.$subopen?"<div class='webix_tree_open webix_sub_open'></div>":"<div class='webix_tree_close webix_sub_close'></div>":"<div class='webix_tree_none'></div>"},this.on_click.webix_sub_open=function(t,i){return this.closeSub(i),!1},this.on_click.webix_sub_close=function(t,i){return this.openSub(i),!1}},openSub:function(t){var i=this.getItem(t);if(!i.$subopen){i.$row=this.Z.subrow,i.$subHeight=i.$subHeight||this.Z.subRowHeight,i.$subopen=!0;var s=this.MM[i.$subContent];s&&(s.repaintMe=!0),this.refresh(t),this.callEvent("onSubViewOpen",[t])}},getSubView:function(t){var i=this.getItem(t);if(i){var s=this.MM[i.$subContent];if(s)return Pt(s)}return null},resizeSubView:function(t){var i=this.getSubView(t);i&&this.GM(this.getItem(t),i)},GM:function(t,i){var s=i.$getSize(0,0)[2],e=t.$subHeight||this.Z.subRowHeight;2<Math.abs(s-(e||0))&&(t.$subHeight=s,this.refresh(t.id))},XM:function(t){var i=t.$width;if(t.Cd){var s=t.ji.length-t.Fd;t.Dd?i-=t.qa.left+t.qa.right+2:i-=t.Qa*(s-1)+t.qa.left+t.qa.right+2*s}return 0<i},WM:function(n,t){var i,s=this.MM[n.$subContent];if(s)t.firstChild.appendChild(s),i=Pt(n.$subContent),this.XM(i)||i.adjust(),s.repaintMe&&(delete s.repaintMe,i.config.hidden=!1,i.Fs());else{var e,h=this.Z.subview;(i="function"==typeof h?h.call(this,n,t.firstChild):((e=m(h)).$scope=this.$scope,zt(e,t.firstChild))).getMasterView=C(function(){return this},this),n.$subContent=i.config.id,this.MM[n.$subContent]=i.$view,this.ht.push(i),i.attachEvent("onResize",C(function(t,i,s,e){i&&i!=e&&this.refresh(n.id)},this)),this.callEvent("onSubViewCreate",[i,n])}this.GM(n,i||Pt(s))},OM:function(i,s){var e=Y("DIV",{"class":"webix_measure_size webix_cell webix_dtable_subrow"},"");e.style.cssText="width:"+this.$s+"px; height:auto; visibility:hidden; position:absolute; top:0px; left:0px; overflow:hidden;",this.$view.appendChild(e),this.data.each(function(t){(t&&!i||t.id==i&&t.$sub)&&(e.innerHTML=s||this.Z.subrow(t,this.type),t.$subHeight=e.offsetHeight)},this),e=G(e)},closeSub:function(t){var i=this.getItem(t);if(i.$subopen){i.$row=!1,i.$subopen=!1;var s=this.MM[i.$subContent];s&&(Pt(s).config.hidden=!0),this.refresh(t),this.callEvent("onSubViewClose",[t])}}},Fr={spans_setter:function(t){return t&&!this.bl&&this.JM(),t},JM:function(){this.bl={},this.sM=[],this.data.attachEvent("onStoreLoad",C(function(t,i){i&&i.spans&&this.addSpan(i.spans)},this)),this.data.attachEvent(
  "onClearAll",C(function(){this.bl={}},this)),this.attachEvent("onSyncScroll",function(t,i,s){for(var e=0;e<3;e++)Ki.Ce(this.sM[e],1==e?t:0,i,s)}),this.attachEvent("onScrollY",this.ZM),this.attachEvent("onScrollX",this.ZM),this.attachEvent("onAfterRender",this.qM),this.attachEvent("onColumnResize",this.qM),this.attachEvent("onSelectChange",this.KM)},addSpan:function(t,i,s,e,n,h){if("object"!=k(t))e=e||1,s=s||1,this.bl[t]||(this.bl[t]={}),this.bl[t][i]=[s,e,n,h];else for(var r=0;r<t.length;r++)this.addSpan.apply(this,t[r])},removeSpan:function(t,i){arguments.length||(this.bl={});var s=this.bl[t];s&&delete s[i]},getSpan:function(t,i){if(!t)return this.bl;var s,e,n,h,r,o=this.bl;for(t in s=this.getIndexById(t),n=this.getColumnIndex(i),o)for(i in o[t])if(r=o[t][i],e=this.getIndexById(t),0<=(h=this.getColumnIndex(i))&&0<=e&&!(s>e+r[1]-1||s<e||n>h+r[0]-1||n<h))return[t,i].concat(r);return null},qM:function(){var t,i,s=this._l.length-this.Z.rightSplit;for(G(this.sM),i=0;i<3;i++)t=this.sM[i]=Y("DIV",{"class":"webix_span_layer"}),this.Wt.childNodes[i].appendChild(t);this.ZM(),this.Z.leftSplit&&this.QM(this.sM[0],0,this.Z.leftSplit),this.Z.rightSplit&&this.QM(this.sM[2],s,this._l.length),this.QM(this.sM[1],this.Z.leftSplit,s),this.Z.topSplit&&!S.touch&&this.tS()},iS:function(){for(var t,i=0,s=0,e=0,n=0;i<this.Z.leftSplit;)s+=this._l[i].width,i++;for(t=(i=this._l.length-1)-this.Z.rightSplit;t<=i;)n+=this._l[i].width,i--;for(i=this.Z.leftSplit;i<this._l.length-this.Z.rightSplit;i++)e+=this._l[i].width;return[s,e,n]},tS:function(){var t,i,s,e=this._l.length-this.Z.rightSplit;for(i=3;i<6;i++)t=this.sM[i]=Y("DIV",{"class":"webix_span_layer_top"}),this.Wt.childNodes[i-3].appendChild(t);s=this.iS(),this.Z.leftSplit&&(this.sM[3].style.width=s[0]+"px",this.QM(this.sM[3],0,this.Z.leftSplit,!0)),this.Z.rightSplit&&(this.sM[5].style.width=s[2]+"px",this.QM(this.sM[5],e,this._l.length,!0)),this.sM[4].style.width=s[1]+"px",this.QM(this.sM[4],this.Z.leftSplit,e,!0)},QM:function(t,i,s,e){for(var n=0,h=this.data.$min||0,r=this.data.$max||this.data.order.length,o=h;o<r;o++){var a=this.data.order[o];if(a){var u=this.bl[a];if(u&&(!e||o<this.Z.topSplit))for(var c=i;c<s;c++){var f=this._l[c].id;u[f]&&this.sS(t,o,c,u,n,i,a,f)}n+=this.iy(this.getItem(a))}}},KM:function(){for(var t=this.config.select,i="cell"==t||"column"==t,s=this.getSelectedId(!0),e=[],n=this.eS||[],h=z()+"",r=!1,o=0;o<s.length;o++){var a=this.bl[s[o]];!a||i&&!a[s[o].column]||(a.$selected&&a.$selected.id==s[o].id||(r=!0),a.$selected=s[o],a.$time=h,e.push(s[o].id))}for(var u=0;u<n.length;u++){var c=this.bl[n[u]];c&&c.$time!==h&&(delete c.$selected,r=!0)}this.eS=[].concat(s),r&&this.qM()},nS:function(t,i){for(var s=0,e=t;e<i;e++){var n=this._l[e];s+=n?n.width:0}return s},hS:function(t,i){for(var s=0,e=t;e<i;e++){var n=this.getItem(this.data.order[e]);s+=n?this.iy(n):this.Z.rowHeight}return s},sS:function(t,i,s,e,n,h,r,o){var a=e[o],u=a[2]||this.getText(r,o),c="";!e.$selected||"row"!==this.Z.select&&e.$selected.column!==o||(c="webix_selected ");var f={column:s,row:i,"class":c+"webix_cell webix_table_cell webix_dtable_span "+(a[3]||""),"aria-colindex":s+1,"aria-rowindex":i+1};1<a[0]&&(f["aria-colspan"]=a[0]),1<a[1]&&(f["aria-rowspan"]=a[1]);var l=Y("DIV",f,""+u);l.style.top=n+"px",l.style.left=this.nS(h,s)+"px",l.style.width=this.nS(s,s+a[0])+"px",l.style.height=this.hS(i,i+a[1])+"px",t.appendChild(l)},ZM:function(){if(!this.Z.prerender)for(var t=this.getScrollState(),i=0;i<3;i++)this.sM[i].style.top="-"+(t.y||0)+"px"},hM:function(t,i){var s,e,n=!1;return this.bl&&(s=this.getSpan(t.row,t.column),e=this.getSpan(i.row,i.column),s&&e&&s[0]==e[0]&&s[1]==e[1]&&(n=!0)),n},getSpanNode:function(t){for(var i=this.sM,s=this.getIndexById(t.row),e=this.getColumnIndex(t.column),n=0;n<i.length;n++)for(var h=i[n].childNodes,r=0;r<h.length;r++)if(h[r].getAttribute("row")==s&&h[r].getAttribute("column")==e)return h[r];return null}},zr={name:"datatable",defaults:{leftSplit:0,rightSplit:0,topSplit:0,columnWidth:100,prerender:!1,autoheight:!1,autowidth:!1,header:!0,fixedRowHeight:!0,scrollAlignY:!0,scrollX:!0,
  scrollY:!0,datafetch:50,navigation:!0},$skin:function(){this.defaults.rowHeight=Xi.rowHeight,this.defaults.minRowHeight=Xi.rowHeight-6,this.defaults.headerRowHeight=Xi.barHeight-2*Xi.borderWidth,this.defaults.minColumnWidth=2*Xi.dataPadding},on_click:{webix_richfilter:function(){return!1},webix_table_checkbox:function(t,i){i=this.locate(t);var s=this.getItem(i.row),e=this.getColumnConfig(i.column),n=t.target||t.srcElement,h=("checkbox"==n.type?n.checked:s[i.column]!=e.checkValue)?e.checkValue:e.uncheckValue,r={};return r[i.column]=h,this.updateItem(i.row,r,this.Z.checkboxRefresh?"update":"save"),this.callEvent("onCheck",[i.row,i.column,h]),!1},webix_table_radio:function(t){var s=this.locate(t),i=this.getItem(s.row),e=this.getColumnConfig(s.column);return this.eachRow(function(t){var i=this.data.pull[t];i&&i[s.column]==e.checkValue&&(i[s.column]=e.uncheckValue)}),i[s.column]=e.checkValue,this.callEvent("onCheck",[s.row,s.column,!0]),this.refresh(),!1}},on_dblclick:{webix_table_checkbox:function(){return this.on_click.webix_table_checkbox.apply(this,arguments)}},on_context:{},$init:function(t){this.on_click=P.extend({},this.on_click);this.Zi.innerHTML="<div class='webix_ss_header'><div class='webix_hs_left'></div><div class='webix_hs_center'></div><div class='webix_hs_right'></div></div><div class='webix_ss_body'><div class='webix_ss_left'><div class='webix_ss_center_scroll'></div></div><div class='webix_ss_center'><div class='webix_ss_center_scroll' role='rowgroup'></div></div><div class='webix_ss_right'><div class='webix_ss_center_scroll'></div></div></div><div class='webix_ss_hscroll' role='scrollbar' aria-orientation='horizontal'></div><div class='webix_ss_footer'><div class='webix_hs_left'></div><div class='webix_hs_center'></div><div class='webix_hs_right'></div></div><div class='webix_ss_vscroll_header'></div><div class='webix_ss_vscroll' role='scrollbar' aria-orientation='vertical'></div><div class='webix_ss_vscroll_footer'></div>",this.YM=this.Zi.id=this.name+z(),this.Zi.className+=" webix_dtable",this.mt=this.Zi,this.U=this.Zi.firstChild,this.Wt=this.U.nextSibling,this.dl=this.Wt.nextSibling.nextSibling,this.et.setAttribute("role","grid"),t.editable||this.et.setAttribute("aria-readonly","true"),this.data.provideApi(this,!0),this.data.attachEvent("onParse",C(this.rS,this)),this.$ready.push(this.oS),this._l=[],this.$o=[],this.ml=[],this.gl=[],this.aS=[],this.Ro={},this.Ao={},this.ea=this.uS=0,this.ht=[],this.data.attachEvent("onServerConfig",C(this.cS,this)),this.data.attachEvent("onServerOptions",C(this.fS,this)),this.attachEvent("onViewShow",function(){this.N_(),this.lS()}),this.data.attachEvent("onClearAll",C(function(t){t||(this.$h=this.kh=0,this.Ch&&this.Ch.reset(),this.Sh&&this.Sh.reset(),this.dS(0))},this)),this.attachEvent("onDestruct",this.vS),this.attachEvent("onKeyPress",this.zs),this.attachEvent("onScrollY",this._S),A("onDataTable",[this,t])},pS:function(){this.fM=this.xy=S.scrollSize,O("#"+this.YM+" .webix_cell { height:"+this.Z.rowHeight+"px; line-height:"+(this.Z.rowLineHeight||this.Z.rowHeight)+"px;"+(this.Z.fixedRowHeight?"":"white-space:normal;")+" }"),O("#"+this.YM+" .webix_hcell { height:"+this.Z.headerRowHeight+"px; line-height:"+this.Z.headerRowHeight+"px;}"),this.pS=function(){}},oS:function(){this.data.attachEvent("onStoreLoad",C(this.lS,this)),this.data.attachEvent("onSyncApply",C(this.lS,this)),this.data.attachEvent("onStoreUpdated",C(function(){return this.render.apply(this,arguments)},this)),this.data.attachEvent("onStoreUpdated",C(this.mS,this)),this.render()},refresh:function(){this.render()},delayRender:function(){var t=this;clearTimeout(this.bS),this.bS=$(function(){t.bS=0,j(t.gS)||(t.dS(t.gS),delete t.gS),t.render()})},render:function(t,i,s){if("save"!=s&&!this.bS){if("move"==s){var e=is.getContext();if(e&&e.fragile)return}if(!this._l.length){var n=this.Z.columns;if(!n||!n.length){if(!this.Z.autoConfig||!this.data.order.length||this.$o.length)return;this.To=0,this.wS()}this.wM()}if(!this.isVisible(this.Z.id)||this.$blockRender)return this.pS()
  ;var h=this.config.experimental&&!this.Z.subview;return!t||-1==i||"paint"!=s&&"update"!=s||h?(this.xS&&(clearTimeout(this.xS),this.xS=0),this.callEvent("onBeforeRender",[this.data])?(this.pS(),this.To||this.xM(),this.$s&&(h&&("paint"==s||"update"==s)&&t?this.yS(t):this.MS(!0,!0)),t&&"update"==s||(this.fy=this.SS(),this.kS()),this.et.setAttribute("aria-colcount",Math.max(this.$o.length,this._l.length)),this.et.setAttribute("aria-rowcount",this.data.count()),this.callEvent("onAfterRender",[this.data]),!0):void 0):(this.xS&&clearTimeout(this.xS),void(this.xS&&this.CS!=t?(this.CS=null,this.xS=$(function(){this.render()},this)):(this.CS=t,this.xS=$(function(){this.render(t,-1,s)},this))))}},getColumnConfig:function(t){return this.pl[t]||this.Fo[t]},fS:function(t){for(var i in t){var s=this.getColumnConfig(i),e=new Dh({data:t[i]});this.ht.push(e),this.Ru(e,s)}},cS:function(t){t.columns&&this.To&&this.refreshColumns(null,!0)},wM:function(){if(this.Z.columns){this._l=this.Z.columns,this.pl={};for(var t=0;t<this._l.length;t++){var i=this._l[t],s=(this.pl[i.id]=i).cssFormat;if(s&&(i.cssFormat=b(s,this.$scope)),i.width=i.width||this.Z.columnWidth,"string"==typeof i.format&&(i.format=ct[i.format]||window[i.format]),i.numberFormat){var e=i.numberFormat;"string"==typeof e&&(i.numberFormat=e=sn.getConfig(e)),i.format=sn.numToStr(e),i.editFormat=i.editFormat||function(t){return sn.format(t,e)},i.editParse=i.editParse||function(t){return sn.parse(t,e)}}j(i.checkValue)&&(i.checkValue=1),j(i.uncheckValue)&&(i.uncheckValue=0),i.css&&"object"==k(i.css)&&(i.css=L(i.css));var n=i.template;n&&("string"==typeof n&&(n=n.replace(/#\$value#/g,"#"+i.id+"#")),i.template=At(n))}this.$S("header",this.ml),this.$S("footer",this.gl),this.callEvent("onStructureLoad",[])}},DS:function(){this.xM()},vS:function(){for(var t=0;t<this._l.length;t++)delete this._l[t].attached,delete this._l[t].node},xM:function(){this.qw=this._l.length-this.Z.rightSplit;for(var t=this.IS=0;t<this._l.length;t++){if(!this._l[t].node){var i=Y("DIV");i.style.width=this._l[t].width+"px",this._l[t].node=i}t>=this.Z.leftSplit&&t<this.qw&&(this.IS+=this._l[t].width)}var s=[];if(this.Z.rightSplit){var e=this._l.length-this.Z.rightSplit;s[e]=" webix_first",s[e-1]=" webix_last"}if(this.Z.leftSplit){var n=this.Z.leftSplit;s[n]=" webix_first",s[n-1]=" webix_last"}s[0]=(s[0]||"")+" webix_first webix_select_mark";var h=this._l.length-1;s[h]=(s[h]||"")+" webix_last";for(var r=0;r<this._l.length;r++){var o=this._l[r].node;o.setAttribute("column",r),o.className="webix_column "+(this._l[r].css||"")+(s[r]||"")}this.AS(),this.TS(),this.FS(),this.Rx(),this.To=!0},TS:function(){for(var t=0,i=0;i<this._l.length;i++){var s=this._l[i];i!=this.Z.leftSplit&&i!=this.qw||(t=0),s.node&&(s.node.style.left=t+"px",(this.Z.leftSplit||this.Z.rightSplit)&&(G(s.node),s.attached=!1)),t+=s.width}},Rx:function(){this.zS||(this.zS=0),this.ea=this.uS=0,this.Z.header&&(this.VS(this.U,0,1),this.$S("header",this.ml),this.ea=this.ml.BS,this.HS(this.U,"header",this.ml)),this.Z.footer&&(this.VS(this.dl,0,1),this.$S("footer",this.gl),this.uS=this.gl.BS,this.HS(this.dl,"footer",this.gl)),this.refreshHeaderContent(!1,!1),this.RS(),this.Do&&this.markSorting(this.Do,this.Io)},PS:function(t,i,s){var e=0,n=t.colspan||1,h="webix_hcell "+(t.css||"");if(t.rotate)h+=" webix_measure_rotate";else for(var r=0;r<n;r++)e+=this._l[s+r]?this._l[s+r].width:this.config.columnWidth;var o=nt([t.text],h,e);return(t.rotate?o.width:o.height)+1},$S:function(t,i){for(var s=0,e=0;e<this._l.length;e++){var n=this._l[e][t];n&&"object"==k(n)&&n.length||(j(n)&&(n="header"==t?this._l[e].id:""),n=[n]);for(var h=0;h<n.length;h++)"object"!=k(n[h])&&(n[h]={text:n[h]}),n[h]&&n[h].height&&(i[h]=n[h].height),n[h]&&n[h].autoheight&&(i[h]=this.PS(n[h],this._l[e],e));s=Math.max(s,n.length),this._l[e][t]=n}for(var r=(i.BS=s)-1;0<=r;r--)i[r]=i[r]||this.Z.headerRowHeight,i.BS+=1*i[r];for(var o=0;o<this._l.length;o++)for(var a=this._l[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._l[o+f][t][u]=null}for(var l=0;l<this._l.length;l++){var d=this._l[l][t];if(d.length<s){var v=d.length-1;d[v].rowspan=s-d.length+1;for(var _=v+1;_<s;_++)d[_]=null}}return s},jS:function(t,i){for(var s=t.getElementsByTagName("TD"),e=0;e<s.length;e++)if(s[e].getAttribute("active_id")==i)return s[e]},getHeaderContent:function(t){var i=this.jS(this.U,t);if(i||(i=this.jS(this.dl,t)),i){var s=this.Ro[t],e=yn[s.content],n={type:e,getValue:function(t){return e.getValue(i,t)},setValue:function(t){return e.setValue(i,t)}};return e.getHelper&&P.extend(n,e.getHelper(i,s)),n}},ES:function(t,i,s){var e=s?-1:0;for(s+=i;i<s;i++)e+=t[i]+1;return e},NS:function(t,i,s,e,n){if(t==i)return"";var h="<table role='presentation' style='width:"+s+"px' cellspacing='0' cellpadding='0'>";h+="<tr class='webix_size_row'>";for(var r=t;r<i;r++)h+="<td style='width:"+this._l[r].width+"px;'></td>";h+="</tr>";for(var o=this._l[0][e].length,a=0;a<o;a++){h+="<tr section='"+e+"' role='row'>";for(var u=t;u<i;u++){var c=this._l[u][e][a];if(null!==c){c.content&&(c.contentId=c.contentId||z(),c.columnId=this._l[u].id,c.format=this._l[u].format,yn[c.content],c.content,c.text=yn[c.content].render(this,c),this.Ro[c.contentId]=c,this.LS=!0),h+="<td  role='presentation' column='"+(c.colspan?c.colspan-1+u:u)+"'";var f="";u==t&&(f+="webix_first"),i-1<=u+(c.colspan?c.colspan-1:0)&&(f+=" webix_last"),(c.rowspan&&a+c.rowspan===o||a===o-1)&&(f+=" webix_last_row"),f&&(h+=' class="'+f+'"');var l=n[a],d="";c.contentId&&(h+=" active_id='"+c.contentId+"'"),c.colspan&&(h+=" colspan='"+c.colspan+"'"),c.rowspan&&(h+=" rowspan='"+c.rowspan+"'",l=this.ES(this.ml,a,c.rowspan)),l!=this.Z.headerRowHeight&&(d=" style='line-height:"+l+"px; height:"+l+"px;'");var v="webix_hcell",_=c.css;_&&("object"==k(_)&&(c.css=_=L(_)),v+=" "+_),this._l[u].$selected&&(v+=" webix_sel_hcell"),h+="><div role='columnheader' class='"+v+"'"+d+">";var p=""===c.text?"&nbsp;":c.text;c.rotate&&(p="<div class='webix_rotate' style='width:"+(l-10)+"px; transform-origin:center "+(l-15)/2+"px;-webkit-transform-origin:center "+(l-15)/2+"px;'>"+p+"</div>"),h+=p+"</div></td>"}}h+="</tr>"}return h+="</tr></table>"},showItemByIndex:function(t,i){var s=this.Z.pager;if(s){var e=Math.floor(t/s.size);e!=s.page&&Pt(s.id).select(e)}var n=this.getScrollState();if(-1!=t){var h=this.Uw();if(t<h[0]+1||t>=h[1]-1){var r=this.OS(s?this.data.$min:0,t),o=this.cM+1,a=this.Gx(t);if(t<h[0]+1)r=Math.max(0,r)-this.US;else if(o<r+a){r+=a-o;for(var u=t;0<u&&0<o;u--)o-=this.Gx(u);0<t&&o&&(r+=this.Gx(t+1))}else r=n.y;n.y=r}}if(-1!=i){if(i<this.Z.leftSplit||i>=this.qw)return this.scrollTo(n.x,n.y);var c=this.Ow();if(i<c[0]+1||i>=c[1]-1){for(var f=0,l=this.Z.leftSplit;l<i;l++)f+=this._l[l].width;var d=this._l[i].width;i<c[0]+1||(f+d>this.Wx?f+=d-this.Wx:f=n.x),n.x=f}}this.scrollTo(n.x,n.y)},showCell:function(t,i){if(!i||!t){var s=this.getSelectedId(!0);1==s.length&&(i=i||s[0].column,t=t||s[0].row)}i=i?this.getColumnIndex(i):-1,t=t?this.getIndexById(t):-1,this.showItemByIndex(t,i)},scrollTo:function(t,i){if(this.Ch){if(this.uy)return this.uy(t,i);null!==t&&this.Ch.scrollTo(t),null!==i&&this.Sh.scrollTo(i)}},getScrollState:function(){if(this.cy)return this.cy();var t=this.Nw?0:this.YS||0;return{x:this.$h||0,y:this.kh+t}},showItem:function(t){this.showItemByIndex(this.getIndexById(t),-1)},HS:function(t,i,s){var e=t.childNodes;e[0].innerHTML=this.NS(0,this.Z.leftSplit,this.ix,i,s),e[1].innerHTML=this.NS(this.Z.leftSplit,this.qw,this.IS,i,s),e[2].innerHTML=this.NS(this.qw,this._l.length,this.Yx,i,s),this.gM&&(e[1].scrollLeft=this.getScrollState().x),e[1].onscroll=C(this.WS,this)},WS:function(){var t=this.getScrollState().x,i=this.U.childNodes[1].scrollLeft;i!=t&&this.scrollTo(i,null)},mS:function(){this.refreshHeaderContent(!0,!0)},lS:function(){this.refreshHeaderContent(!1,!0)},refreshHeaderContent:function(t,i,s){this.Z.header&&(i&&this.VS(this.U,t,1,s),this.VS(this.U,t,0,s)),this.Z.footer&&(i&&this.VS(this.dl,t,1,s),this.VS(this.dl,t,0,s))},refreshFilter:function(t){this.refreshHeaderContent(!1,!0,t)},VS:function(t,i,s,e
  ){if(this.LS&&t)for(var n=t.getElementsByTagName("TD"),h=0;h<n.length;h++)if(n[h].getAttribute("active_id")){var r=this.Ro[n[h].getAttribute("active_id")];if(e&&e!=r.columnId)continue;var o=yn[r.content];s?o.getValue&&(r.value=o.getValue(n[h])):i&&!o.trackCells||o.refresh(this,n[h],r)}},headerContent:[],GS:function(t,i,s){if(this.xy){if(t.style.height=Math.max(i,1)-1+"px",t.style.width=(this.qw?0:s)+this.xy-1+"px",S.isWebKit)t.offsetWidth}else t.style.display="none"},RS:function(){this.Z.header&&this.GS(this.XS,this.ea,this.zS),this.Z.footer&&this.GS(this.JS,this.uS,this.zS)},Xh:function(){var t=!(this.Z.autowidth||!1===this.Z.scrollX);this.fM=t?S.scrollSize:0;var i=!(this.Z.autoheight||!1===this.Z.scrollY);this.xy=i?S.scrollSize:0,S.touch&&(t=i=!1),this.Ch&&(this.Ch.Z.scrollSize=this.fM,this.Ch.Z.scrollVisible=t),this.Sh&&(this.Sh.Z.scrollSize=this.xy,this.Sh.Z.scrollVisible=i)},AS:function(){var t,i;if(this.kh=0,this.$h=0,t=i=1,(this.Z.autoheight||!1===this.Z.scrollY)&&(i=this.xy=0),(this.Z.autowidth||!1===this.Z.scrollX)&&(t=this.fM=0),S.touch&&(t=i=0),this.Ch||(this.Ch=zt({view:"vscroll",container:this.dl.previousSibling,scrollWidth:this.IS,scrollSize:this.fM,scrollVisible:t}),!t||this.fM||S.$customScroll||(this.Ch.et.style.position="absolute"),this.Ch.attachEvent("onScroll",C(this.ZS,this))),!this.Sh){this.XS=this.dl.nextSibling;var s=this.XS.nextSibling;this.JS=s.nextSibling,this.Sh=zt({view:"vscroll",container:s,scrollHeight:100,scroll:"y",scrollSize:this.xy,scrollVisible:i}),this.Sh.activeArea(this.Wt),this.Ch.activeArea(this.Wt,!0),this.Sh.attachEvent("onScroll",C(this.qS,this))}this.$s&&this.callEvent("onResize",[this.$s,this.Is]),S.$customScroll&&fs.enable(this),this.AS=function(){}},columnId:function(t){return this._l[t].id},getColumnIndex:function(t){for(var i=0;i<this._l.length;i++)if(this._l[i].id==t)return i;return-1},KS:function(t,i){var s,e=0,n=0,h=0,r=0,o=0;for(s=0;s<this._l.length&&(this.qw!=s&&this.Z.leftSplit!=s||(e=0,o++),this._l[s].id!=i);s++)e+=this._l[s].width;for(n+=this._l[s].width,s=0;s<this.data.order.length&&this.data.order[s]!=t;s++)r+=this.Gx(s);return h+=this.Gx(s),[e,n,r-this.kh,h,this.Wt.childNodes[o]]},Dx:function(){return this.row},locate:function(t,i){if(this.Z.subview&&this!=Pt(t))return null;for(t=t.target||t.srcElement||t;t&&t.getAttribute&&t!==this.$view;){var s=rt(t).toString(),e=null;if(-1!=s.indexOf("webix_cell")&&(e=this.Le(t))&&(e.row=this.data.order[e.rind]),-1!=s.indexOf("webix_hcell")&&(e=this.Le(t))&&(e.header=!0),-1!=s.indexOf("webix_drop_area")&&(e=this.Le(t))&&(e.row=e.rind="$webix-drop"),e)return i?e.header?null:e.row:(e.column=this._l[e.cind].id,e.toString=this.Dx,e);t=t.parentNode}return null},Le:function(t){var i=t.parentNode;if(!i)return null;var s=1*(t.getAttribute("column")||i.getAttribute("column")),e=t.getAttribute("aria-rowindex");return{rind:t.getAttribute("row")||(e?e-1:0),cind:s,span:1*(t.getAttribute("colspan")||i.getAttribute("colspan"))}},vy:function(){for(var t=-this.Wx,i=0;i<this._l.length;i++)t+=this._l[i].width;this.$h=Math.min(this.$h,Math.max(0,t))},Bo:function(t){this.To&&(this.vy(),this.TS(),this.FS(),this.Rx(),t||this.MS(!1,!1))},setColumnWidth:function(t,i,s){return this.Vo(this.getColumnIndex(t),i,s)},Vo:function(t,i,s,e){if(!(isNaN(i)||t<0)){var n=this._l[t];n.minWidth&&i<n.minWidth?i=n.minWidth:i<this.Z.minColumnWidth&&(i=this.Z.minColumnWidth);var h=n.width;return h!=i&&(t>=this.Z.leftSplit&&t<this.qw&&(this.IS+=i-h),n.width=i,!!n.node&&(n.node.style.width=i+"px",s||this.Bo(),this.callEvent("onColumnResize",[n.id,i,h,!!e]),!0))}},iy:function(t){return(t.$height||this.Z.rowHeight)+(t.$subopen?t.$subHeight:0)},Gx:function(t){var i=this.data.order[t];return i?this.iy(this.data.pull[i]):this.Z.rowHeight},OS:function(t,i){if(this.Z.fixedRowHeight)return(i-t)*this.Z.rowHeight;for(var s=0;t<i;t++)s+=this.Gx(t);return s},qt:function(t,i){1==arguments.length&&(i=t.column,t=t.row);for(var s=this.getItem(t),e=this.getColumnConfig(i),n=0,h=0,r=0;r<this._l.length;r++){r!=this.Z.leftSplit&&r!=this.qw||(n=0);var o=this._l[r];if(o.id==i){
  var a=r<this.Z.leftSplit?0:r>=this.qw?2:1;h=this.Wt.childNodes[a].firstChild;break}n+=o.width}return{parent:h,top:this.getIndexById(t)<this.Z.topSplit?this.OS(0,this.getIndexById(t)):this.OS((this.Jw||0)-this.Z.topSplit,this.getIndexById(t))+(this.Nw||0),left:n,width:e.width,height:s.$height||this.Z.rowHeight}},SS:function(){var t=this.Z.pager,i=0,s=this.data.order.length;return t&&(i=t.size*t.page,s=Math.min(s,i+t.size),t.level&&(i=this.data.$min,s=this.data.$max)),this.OS(i,s)},setRowHeight:function(t,i){if(!isNaN(i)){i<this.Z.minRowHeight&&(i=this.Z.minRowHeight);var s=this.getItem(t),e=s.$height||this.Z.rowHeight;e!=i&&(s.$height=i,this.config.fixedRowHeight=!1,this.render(),this.callEvent("onRowResize",[t,i,e]))}},qS:function(t){var i=this.kh!==t;if(this.kh=t,this.Z.prerender)for(var s=this.Wt.childNodes,e=0;e<s.length;e++)s[e].scrollTop=t;else this.MS();S.$customScroll&&fs.Xh(this.Wt),i&&(this.callEvent("onScrollY",[]),this.callEvent("onAfterScroll",[]))},dS:function(t){this.Wt.childNodes[1].scrollLeft=this.$h=t,this.Z.header&&(this.U.childNodes[1].scrollLeft=t),this.Z.footer&&(this.dl.childNodes[1].scrollLeft=t)},ZS:function(t){var i=this.$h!==t;this.bS?this.gS=t:this.dS(t),!1===this.Z.prerender&&this.MS(!this.QS),S.$customScroll&&fs.Xh(this.Wt),i&&(this.callEvent("onScrollX",[]),this.callEvent("onAfterScroll",[]))},Ow:function(t){if(t)return[0,this._l.length];for(var i=this.$h,s=this.Z.leftSplit;0<i&&this._l.length-1>s;)i-=this._l[s].width,s++;var e=s;for(i&&0<s&&s--,i+=this.Wx;0<i&&e<this.qw;)i-=this._l[e].width,e++;return[s,e]},getVisibleCount:function(){return Math.floor(this.cM/this.config.rowHeight)},Uw:function(t){var i=this.kh,s=0,e=this.count(),n=this.Z.pager;if(n&&(s=n.page*n.size,e=Math.min(e,s+n.size),n.level&&(s=this.data.$min,e=this.data.$max)),this.Z.autoheight)return[s,e,0];if(t)return[s,e,0];var h=s,r=this.Z.topSplit||0;r&&(h+=r);var o=this.Z.fixedRowHeight?this.Z.rowHeight:0;if(o){var a=Math.ceil(i/o);i-=a*o,h+=a}else for(;0<i;)i-=this.Gx(h),h++;var u=0<h&&i?-(this.Gx(h-1)+i):0,c=h;if(i&&h--,i+=(this.cM||this.Is)-(this.US||0),o){var f=Math.ceil(i/o);i-=f*o,c+=f}else for(;0<i&&c<e;)i-=this.Gx(c),c++;return e<c&&(c=e),[h,c,u]},yS:function(t){var i=this.getItem(t),s=this.getIndexById(t),e=this.Uw(),n=this.config.topSplit,h="";if(n<=s){if(s<e[0]||s>=e[1])return;s-=e[0]-n}else h=s==n-1?" webix_topcell webix_last_topcell":" webix_topcell";for(var r=this.Ow(),o=0;o<this._l.length;o++){var a=this._l[o];if(o<this.qw&&o>=this.Z.leftSplit&&(o<r[0]||o>r[1])&&(a.eM=-999),a.attached&&a.node){var u=a.node.childNodes[s];if(!u)continue;var c=this.My(i,this._l[o],0);u.innerHTML=c,u.className=this.tk(this._l[o],c,i,t)+h}}},MS:function(t,i){if(this._l.length&&!this.bS){i&&this.ik();var s=this.Ow(this.Z.prerender),e=this.Uw(!0===this.Z.prerender);if(t){for(var n=this.Z.leftSplit;n<s[0];n++)this.mM(n,i);for(var h=s[1];h<this.qw;h++)this.mM(h,i)}this.Lw=[];for(var r=0;r<this.Z.leftSplit;r++)this.sk(r,e,i);for(var o=s[0];o<s[1];o++)this.sk(o,e,i,o==s[0]);for(var a=this.qw;a<this._l.length;a++)this.sk(a,e,i);this.ek(e[0],e[1],i),this.nk(e)}},hk:function(t,i){this.rk=t,this.ak=i,G(this.aS),this.aS=[]},_S:function(){if(this.Z.prerender&&this.uk){var t=this.getScrollState();this.uk.style.top="-"+(t.y||0)+"px"}},ek:function(t,i,s){if(this.uk&&(this.uk.style.top=this.Nw+"px"),s||t!=this.rk||i!=this.ak){if(this.hk(t,i),this.ck){this.ck=!1;for(var e=0;e<this.Lw.length;e++){var n,h=this.Lw[e],r=this.getItem(h.id);n="function"==typeof r.$row?r.$row.call(this,r,this.type):this.My(r,this.getColumnConfig(r.$row),e);var o=this.aS[e]=Y("DIV",null,n);o.className="webix_cell "+(r.$sub?"webix_dtable_sub"+(this.Z.subview?"view":"row"):"webix_dtable_colrow"+(r.$row?" webix_topcell"+(this.data.getMark(r.id,"webix_selected")?" webix_selected":""):"")),o.setAttribute("column",0),o.setAttribute("row",h.index);var a=r.$height||this.Z.rowHeight;r.$subopen?o.style.height=r.$subHeight+"px":o.style.height=a+"px",o.style.paddingRight=S.scrollSize+"px";var u=this.Lw[e].index<this.config.topSplit?-this.Nw:0;o.style.top=u+h.top+(r.$subopen?a-1:0)+"px",
  this.uk||(this.uk=Y("DIV"),this.uk.style.position="relative",this.uk.style.top=this.Nw+"px",this.Wt.appendChild(this.uk)),this.uk.appendChild(o),this.attachEvent("onSyncScroll",function(t,i,s){Ki.Ce(this.uk,0,i,s)}),this.Z.subview&&this.callEvent("onSubViewRender",[r,o])}}}else if(this.config.topSplit)for(var c=0;c<this.Lw.length;c++){var f=this.aS[c];this.Lw[c].index<this.config.topSplit&&(f.style.top=this.Lw[c].top-this.Nw+"px")}},nk:function(t){var i=this.Z.pager,s=this.Z.datafetch,e=!this.fk||t[0]>=this.fk;if(this.fk=t[0],this.lk){if(i&&(!s||s>=i.size)&&this.dk([0,i.size*i.page],Math.max(s,i.size),!0))return this.lk=null;this.vl(this.lk,e),this.lk=null}else this.Z.loadahead&&this.dk(t,this.Z.loadahead,e)},dk:function(t,i,s){var e=t[1],n=e+i;s||(e=t[0]-i,n=t[0]),e<0&&(e=0),n=Math.min(n,this.data.order.length-1);for(var h=!1,r=e;r<n;r++)this.data.order[r]||(h?(h.last=r,h.count=r-e):h={start:r,count:n-e});if(h)return this.vl(h,s),!0},vl:function(t,i){var s=Math.max(t.count,this.Z.datafetch||this.Z.loadahead||0),e=i?t.start:t.last-s+1;this.So(t.count,t.start)||this.loadNext(s,e)},vk:function(t){if(S.isSafari){var i,s,e,n,h=[this.Ch,this.Sh];for(i=0;i<2;i++)(n=h[i])&&n.Mw&&n.Mw.parentNode==t&&(s=n.Mw);s&&(this._k&&G(this._k),e=(this._k=s).cloneNode(!0),s.parentNode.insertBefore(e,s),this._k.style.display="none",this.Wt.appendChild(this._k))}},mM:function(t){var i=this._l[t];this.vk(i.node),G(i.node),i.attached=!1},ik:function(){for(var t=0;t<this._l.length;t++)this._l[t].eM=-1;this.aS.length&&(G(this.aS),this.aS=[])},getText:function(t,i){return this.My(this.getItem(t),this.getColumnConfig(i),0)},getCss:function(t,i){var s=this.getItem(t);return this.tk(this.getColumnConfig(i),s[i],s,t)},tk:function(t,i,s,e){var n="webix_cell";if(t.cssFormat){var h=t.cssFormat(i,s,e,t.id);h&&("object"==k(h)?n+=" "+L(h):n+=" "+h)}var r=s.$css;r&&("object"==k(r)&&(s.$css=r=L(r)),n+=" "+r);var o=this.data.Hr[e];if(o&&(o.$css&&(n+=" "+o.$css),o.$cellCss)){var a=o.$cellCss[t.id];a&&(n+=" "+a)}if(s.$cellCss){var u=s.$cellCss[t.id];u&&("object"==k(u)&&(u=L(u)),n+=" "+u)}var c=this.data.getMark(s.id,"webix_selected");return(c&&(c.$row||c[t.id])||t.$selected)&&(n+=this.wx),n},My:function(t,i,s){return t?((e=t[i.id])!==undefined&&null!==e||(e=""),i.format&&(e=i.format(e)),i.template&&(e=i.template(t,this.type,e,i,s)),e):"";var e},type:{checkbox:function(t,i,s,e){return"<input class='webix_table_checkbox' type='checkbox' "+(s==e.checkValue?'checked="true"':"")+">"},radio:function(t,i,s,e){return"<input class='webix_table_radio' type='radio' "+(s==e.checkValue?'checked="true"':"")+">"},editIcon:function(){return"<span class='webix_icon wxi-pencil'></span>"},trashIcon:function(){return"<span class='webix_icon wxi-trash'></span>"}},type_setter:function(t){return this.types&&this.types[t]?(this.type=f(this.types[t]),this.type.css&&(this.Zi.className+=" "+this.type.css)):Tt(this,t),this.type.on_click&&P.extend(this.on_click,this.type.on_click),t},sk:function(t,i,s,e){var n=this._l[t];if(!n.attached){var h=t<this.Z.leftSplit?0:t>=this.qw?2:1;this.Wt.childNodes[h].firstChild.appendChild(n.node),n.attached=!0,n.split=h}if(this.Jw=i[0],this.Nw=0,this.YS=i[2],this.Z.scrollAlignY?i[1]==this.data.order.length||this.data.$pagesize&&i[1]%this.data.$pagesize==0?n.node.style.top=(this.Nw=i[2])+"px":n.pk&&(n.node.style.top="0px"):(this.Nw=i[2],n.node.style.top=i[2]+"px"),!(s||n.eM!=i[0]||n.nM!=i[1]||this.Z.topSplit&&n.Nw!=this.Nw))return 0;for(var r="",o=this.Z.columns[t],a={row:this.Z.rowHeight,total:0,single:e},u=0;u<this.Z.topSplit;u++)r+=this.mk(u,o,i,a,-this.Nw,t);this.lk=null;for(var c=Math.max(i[0],this.Z.topSplit);c<i[1];c++)r+=this.mk(c,o,i,a,-1,t);return this.vk(n.node),n.node.innerHTML=r,n.eM=i[0],n.nM=i[1],n.pk=i[2],n.Nw=this.Nw,1},mk:function(t,i,s,e,n,h){var r=this.data.order[t],o=this.data.getItem(r),a="";if(o){var u=" role='gridcell' aria-rowindex='"+(t+1)+"' aria-colindex='"+(this.getColumnIndex(i.id)+1)+"'"+(o.$count||o.$sub?" aria-expanded='"+(o.open||o.$subopen?"true":"false")+"'":"")+(o.$level?" aria-level='"+o.$level+"'":"");if(
  e.single&&o.$row&&(this.ck=!0,this.Lw.push({top:e.total,id:o.id,index:t}),!o.$sub)){var c=o.$height||e.row;return e.total+=c,"<div"+u+" class='webix_cell' style='height:"+c+"px;'></div>"}var f=this.My(o,i,t),l=this.tk(i,f,o,r),d=" aria-selected='true' tabindex='0'";if(-1!==l.indexOf("select"))if(-1!==l.indexOf("row"))this.Ow()[0]===h&&(u+=d);else-1!==l.indexOf("col")?t===s[0]&&(u+=d):u+=d;var v=!!o.$subopen,_=v?"margin-bottom:"+o.$subHeight+"px;":"";0<=n&&(0<n&&(_+="top:"+n+"px;'"),l="webix_topcell "+l,t==this.Z.topSplit-1&&(l="webix_last_topcell "+l)),o.$height?(a="<div"+u+" class='"+l+"' style='height:"+o.$height+"px;"+_+"'>"+f+"</div>",e.total+=o.$height-e.row):a="<div"+u+" class='"+l+"'"+(_?" style='"+_+"'":"")+">"+f+"</div>",v&&(e.total+=o.$subHeight)}else a="<div role='gridcell' class='webix_cell'></div>",this.lk?this.lk.last=t:this.lk={start:t,count:s[1]-t};return e.total+=e.row,a},kS:function(){if(this._l.length&&!isNaN(1*this.Is)){var t=this.fy+(this.fM?this.fM:0);if(!this.Z.autoheight&&!this.Z.yCount||!this.resize()){this.Sh.sizeTo(this.Is,this.ea,this.uS),this.Sh.define("scrollHeight",t),this.US=this.Z.topSplit?this.OS(0,this.Z.topSplit):0,this.cM=Math.max(0,this.Is-this.fM-this.ea-this.uS);for(var i=0;i<3;i++)this.Wt.childNodes[i].style.height=this.cM+"px",this.Z.prerender?this.Wt.childNodes[i].firstChild.style.height=this.fy+"px":this.Wt.childNodes[i].firstChild.style.height=this.cM+"px";this.U.style.height=this.ea+"px"}}},FS:function(){if(this._l.length){var t=0;for(this.ix=0,this.Yx=0,this.Wx=0;t<this.Z.leftSplit;)this.ix+=this._l[t].width,t++;for(t=this._l.length-1;t>=this.qw;)this.Yx+=this._l[t].width,t--;if(this.$s&&(!this.Z.autowidth||!this.resize())){this.Wx=this.$s-this.Yx-this.ix-this.xy,this.Wt.childNodes[1].firstChild.style.width=this.IS+"px",this.Wt.childNodes[0].style.width=this.ix+"px",this.Wt.childNodes[1].style.width=this.Wx+"px",this.Wt.childNodes[2].style.width=this.Yx+"px",this.U.childNodes[0].style.width=this.ix+"px",this.U.childNodes[1].style.width=this.Wx+"px",this.U.childNodes[2].style.width=this.Yx+"px",this.dl.childNodes[0].style.width=this.ix+"px",this.dl.childNodes[1].style.width=this.Wx+"px",this.dl.childNodes[2].style.width=this.Yx+"px";var i=this.Wx-this.IS;if(i<0&&(i=0),i!=this.zS&&(this.zS=i,this.RS()),S.isWebKit){this.Wt.childNodes[0].offsetWidth;this.Wt.childNodes[1].offsetWidth,this.Wt.childNodes[1].firstChild.offsetWidth,this.Wt.childNodes[2].offsetWidth}this.Ch.sizeTo(this.$s-this.xy),this.Ch.define("scrollWidth",this.IS+this.ix+this.Yx)}}},$getSize:function(t,i){if((this.Z.autoheight||this.Z.yCount)&&this.Z.columns){var s=(this.Z.yCount||0)*this.Z.rowHeight;s||(s=this.isVisible()?this.fy:this.count()*this.Z.rowHeight),this.Z.height=Math.max(s+(this.fM?this.fM:0)-1,this.Z.minHeight||0)+this.ea+this.uS}this.Z.autowidth&&this.Z.columns&&(this.Z.width=Math.max(this.IS+this.ix+this.Yx+this.xy,this.Z.minWidth||0));var e=this.ix+this.Yx+this.xy,n=Li.api.$getSize.call(this,t,i);return n[0]=Math.max(n[0]||e),n},N_:function(){if(this.Ch&&!S.touch){var t=this.getScrollState();this.Ch.bk=this.Sh.bk=-1,this.scrollTo(t.x,t.y)}},$setSize:function(){var t=this.$s,i=this.Is;Li.api.$setSize.apply(this,arguments)&&(this.To&&(this.callEvent("onResize",[this.$s,this.Is,t,i]),this.FS(),this.kS()),this.render())},gk:function(t){var i=this.getColumnConfig(t);if(i.sort){var s="asc";i.id==this.Do&&(s="asc"==this.Io?"desc":"asc"),this.Ho(i.id,s,i.sort)}},markSorting:function(t,i){this.wk||(this.wk=Y("DIV"));var s=this.wk.parentNode;if(s&&(s.removeAttribute("aria-sort"),s.removeAttribute("tabindex")),G(this.wk),i){var e=this.xk(this.getColumnIndex(t));e&&(this.wk.className="webix_ss_sort_"+i,e.style.position="relative",e.appendChild(this.wk),e.setAttribute("aria-sort",i+"ending"),e.setAttribute("tabindex","0")),this.Do=t,this.Io=i}else this.Do=this.Io=null},scroll_setter:function(t){return"string"==typeof t?(this.Z.scrollX=-1!=t.indexOf("x"),this.Z.scrollY=-1!=t.indexOf("y"),t):this.Z.scrollX=this.Z.scrollY=t},xk:function(t){for(var i=this.U.getElementsByTagName("TD"),s=null,e=0;e<i.length;e++)if(
  i[e].getAttribute("column")==t&&!i[e].getAttribute("active_id")&&(s=i[e].firstChild,(i[e].colSpan||0)<2))return s;return s},Ho:function(i,s,e){var n=this;s=s||"asc",this.markSorting(i,s),"server"==e?(this.callEvent("onBeforeSort",[i,s,e]),this.loadNext(0,0,0,0,1).then(function(t){n.clearAll(!0),n.parse(t),n.callEvent("onAfterSort",[i,s,e])})):("text"==e&&(this.data.each(function(t){t.$text=this.getText(t.id,i)},this),e="string",i="$text"),"function"==typeof e?this.data.sort(e,s):this.data.sort(i,s,e||"string"))},yk:function(t,i,s,e){var n;if(t.length)for(n=0;n<t.length;n++)if(!1===b(t[n],this.$scope).call(this,i,s,e))return!1},qu:function(t,i,s,e){var n=(t=t||event).target||t.srcElement;if(!this.Z.subview||this==Pt(n)){for(var h="",r=[],o=!1,a=null;n&&n.parentNode&&n!=this.et.parentNode;){if(h=rt(n))for(var u=(h=h.toString().split(" ")).length-1;0<=u;u--)i[h[u]]&&r.push(i[h[u]]);if(n.parentNode.getAttribute&&!a){var c=n.parentNode.getAttribute("column")||n.getAttribute("column");if(c){var f="DIV"==n.parentNode.tagName;if(!this._l[c])return;if(o=!0,f){var l=n.parentNode.getAttribute("row")||n.getAttribute("row");if(!l){if(n.getAttribute("column"))return;(l=N(n))>=this.Z.topSplit&&!this.Z.prerender&&(l+=this._l[c].eM-this.Z.topSplit)}this.Lu=a={row:this.data.order[l],column:this._l[c].id},a.toString=this.Dx}else this.Lu=a={column:this._l[c].id};if(!1===this.yk(r,t,a,n))return;if(f)this.callEvent("on"+s,[a,t,n])&&e&&this.callEvent("on"+e,[a,t,n]);else if("ItemClick"==s){"header"==n.parentNode.parentNode.getAttribute("section")&&this.callEvent("onHeaderClick",[a,t,n])&&this.gk(a.column)}r=[]}}n=n.parentNode}return this.yk(r,t,a,this.$view),o}},Es:function(t,i){var s=this.locate(i);if(!s)return null;var e,n=_i.ii;if(s.header){for(var h,r=i.target||i.srcElement,o=s.cind-(s.span?s.span-1:0),a=-1;r&&!h;)h=(r=r.parentNode).getAttribute("section");for(;null!==(r=r.previousSibling);)a++;var u=this._l[o][h][a];if(!u.tooltip)return null;n.type.template=At(!0===u.tooltip?"#text#":u.tooltip),e=u}else{var c=n.type.column=this.getColumnConfig(s.column);if(!c.tooltip&&c.tooltip!==undefined)return null;if(!0===c.tooltip||!c.tooltip&&j(this.Z.tooltip.template))e=this.getText(s.row,s.column).toString();else if(c.tooltip){var f=(i.target||i.srcElement).getAttribute("webix_area");n.type.template=f?function(t,i){var s=t[c.id];return At(c.tooltip).call(this,t,i,s[f],f)}:At(c.tooltip)}else n.type.template=At(this.Z.tooltip.template)}return e!==undefined?e:this.getItem(s.row)},$tooltipOut:function(){return _i.hi(),delete _i.ii.type.column,null},showOverlay:function(t){if(!this.Mk){var i=Y("DIV",{"class":"webix_overlay"},"");this.Wt.appendChild(i),this.Mk=i}this.Mk.innerHTML=t},hideOverlay:function(){this.Mk&&(G(this.Mk),this.Mk=null)},mapCells:function(t,i,s,e,n,h){if(null===t&&0<this.data.order.length&&(t=this.data.order[0]),null===i&&(i=this.columnId(0)),null===s&&(s=this.data.order.length),null===e&&(e=this.Z.columns.length),this.exists(t)&&(t=this.getIndexById(t),null!==(i=this.getColumnIndex(i))))for(var r=0;r<s&&t+r<this.data.order.length;r++){var o=t+r,a=this.data.order[o];if(a)for(var u=this.getItem(a),c=0;c<e&&i+c<this.Z.columns.length;c++){var f=i+c,l=this.columnId(f),d=n(u[l],a,l,r,c);h||(u[l]=d)}}},rS:function(t,i){!this.Z.columns&&t.getConfig&&this.define("columns",t.getConfig(i))},wS:function(){var t=this.getItem(this.getFirstId()),i=this.Z.columns=[];for(var s in t)"id"!=s&&"$"!=s[0]&&i.push({id:s,header:s[0].toUpperCase()+s.substr(1),sort:"string",editor:"text"});i.length&&(i[0].fillspace=!0),"undefined"==typeof this.Z.select&&this.define("select","row")}},Vr={api:zr,view:P.protoUI(zr,_r,xs,ue,ds,Ds,Hs,Ns,cs,Ir,we,{clearValidation:function(){for(var t in this.data.Hr)this.Sk(t);this.data.clearMark("webix_invalid",!0)},lr:function(t,i){for(var s in this.Sk(t),i)this.addCellCss(t,s,"webix_invalid_cell");this.addCss(t,"webix_invalid")},ur:function(t){this.Sk(t),this.removeCss(t,"webix_invalid")},Sk:function(t){var i=this.data.getMark(t,"$cellCss");if(i)for(var s in i)i[s]=i[s].replace("webix_invalid_cell","").replace("  "," ")},
  addRowCss:function(t,i,s){this.addCss(t,i,s)},removeRowCss:function(t,i,s){this.removeCss(t,i,s)},addCellCss:function(t,i,s,e){var n=this.data.getMark(t,"$cellCss"),h=n||{},r=h[i]||"";h[i]=r.replace(s,"").replace("  "," ")+" "+s,n||this.data.addMark(t,"$cellCss",!1,h,!0),e||this.refresh(t)},removeCellCss:function(t,i,s,e){var n=this.data.getMark(t,"$cellCss");if(n){var h=n[i]||"";h&&(n[i]=h.replace(s,"").replace("  "," ")),e||this.refresh(t)}}},Ar,ys,Dr,Cr,kr,Sr,yr,Mr,xr,wr,gr,Tr,br,mr,pr,{topSplit_setter:function(t){return this.data&&(this.data.$freeze=t),t},freezeRow:function(t,i){var r=this.Z.topSplit,s=this.data.order,e=this.data.Rr;function n(t,i,s,e,n){var h;if(s&&r<=t){for(n||r++,h=t;r<=h;h--)e[h]=e[h-1];e[r-1]=i}if(!s&&t<r){for(n||r--,h=t;h<r;h++)e[h]=e[h+1];e[r]=i}}t?(n(this.getIndexById(t),t=t.toString(),i,s),e&&n(e.find(t),t,i,e,!0)):i||(r=0),this.define("topSplit",r),this.refresh()}},Fr,Yi,Fs,ls,ws,Ps,Rs,Li.view,w,Ai)},Br={name:"excelviewer",$init:function(){this.$ready.push(function(){this.Z.toolbar&&Pt(this.Z.toolbar).attachEvent("onExcelSheetSelect",C(this.showSheet,this))})},defaults:{datatype:"excel"},$onLoad:function(t){if(t.sheets){this.kk=t,this.Z.toolbar&&Pt(this.Z.toolbar).setSheets(t.names);var i=t.names[0];return this.showSheet(i.id||i),!0}return!1},$exportView:function(t){if("excel"!==t.export_mode||t.dataOnly)return this;!0===t.sheets?t.sheets=this.getSheets():t.sheets&&t.sheets.length?"string"==typeof t.sheets&&(t.sheets=[t.sheets]):t.sheets=[this.Ck],t.dataOnly=!0,t.heights=j(t.heights)&&t.styles?"all":t.heights;for(var i=[],s=this.Ck,e=0;e<t.sheets.length;e++)this.showSheet(t.sheets[e]),i=i.concat(Ve(this,t)),t.styles&&(i[e].styles=this.VM(t));return this.showSheet(s),delete t.dataOnly,i},showSheet:function(t){this.clearAll();var i=this.data.driver.sheetToArray(this.kk.sheets[t],{spans:this.Z.spans}),s=this.Z.excelHeader,e={},n={};if(i.sizes)for(var h=0;h<i.sizes.length;h++)"column"==i.sizes[h][0]?e[i.sizes[h][1]]=Math.round(i.sizes[h][2]):"row"==i.sizes[h][0]&&(n[i.sizes[h][1]]=Math.round(i.sizes[h][2]));if(s)if(!0===s){s=i.data.splice(0,1)[0];for(var r=0;r<s.length;r++)s[r]={header:s[r],id:"data"+r,width:e[r],adjust:!e[r],editor:"text",sort:"string"}}else s=m(s);else{s=m(i.data[0]);for(var o=0;o<s.length;o++)s[o]={header:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[o],id:"data"+o,width:e[o],adjust:!e[o],editor:"text",sort:"string"}}this.config.columns=s,this.refreshColumns(),this.parse(i,this.Z.datatype),this.Ck=t;var a=this.$k(i.spans),u=this.Dk(n),c=this.Ik(i.styles,a);(a||u||c)&&this.refresh()},getSheets:function(){return this.kk.names},Ak:function(t,i,s,e){for(var n=!1,h=0;h<t.length;h++)if(t[h][0]===i&&t[h][1]===s){t[h][5]=L(this.Tk(e)),this.addSpan(t[h][0],t[h][1],t[h][2],t[h][3],t[h][4],t[h][5]),n=!0;break}return n},Ik:function(t,i){var s=0;if(t&&t.length){for(var e=0;e<t.length;e++){var n=t[e][0]-(this.config.excelHeader?1:0);if(0<=n){var h=this.getIdByIndex(n);if(this.exists(h)){var r=this.getItem(h),o=this.columnId(t[e][1]);o&&(i.length&&this.Ak(i,h,o,t[e][2])||(r.$cellCss=r.$cellCss||{},r.$cellCss[o]=this.Tk(t[e][2])),s++)}}}return s}return!1},Fk:function(t){return 8===(t=t||"000000").length&&(t=t.substring(2)),"#"+t},Tk:function(t){var i={};if(t.fill&&t.fill.fgColor&&(i["background-color"]=this.Fk(t.fill.fgColor.rgb)),t.font){var s=t.font;s.name&&(i["font-family"]=s.name),s.sz&&(i["font-size"]=s.sz/.75+"px"),s.color&&s.color.rgb&&(i.color=this.Fk(s.color.rgb)),s.bold&&(i["font-weight"]="bold"),s.underline&&(i["text-decoration"]="underline"),s.italic&&(i["font-style"]="italic"),s.strike&&(i["text-decoration"]="line-through")}if(t.alignment){var e=t.alignment;e.vertical&&"center"==e.vertical&&(i.display="flex",i["justify-content"]="flex-start",i["align-items"]="center"),e.vertical&&"bottom"==e.vertical&&(i.display="flex",i["justify-content"]="flex-end",i["align-items"]="flex-end"),e.horizontal&&(!e.vertical||"center"!=e.vertical&&"bottom"!=e.vertical?i["text-align"]=e.horizontal:i["justify-content"]="center"),e.wrapText&&(i["white-space"]="normal")}if(t.border){var n=t.border;n.top&&(
  i["border-top"]="1px solid "+this.Fk(n.top.color.rgb)),n.bottom&&(i["border-bottom"]="1px solid "+this.Fk(n.bottom.color.rgb)+" !important"),n.left&&(i["border-left"]="1px solid "+this.Fk(n.left.color.rgb)),n.right&&(i["border-right"]="1px solid "+this.Fk(n.right.color.rgb)+" !important")}return i},Dk:function(t){var i=0;for(var s in t){var e=this.config.excelHeader?s-1:s;if(0<=e){var n=this.getIdByIndex(e);this.exists(n)&&(this.getItem(n).$height=t[s],i++)}}return this.config.fixedRowHeight=!i,i},$k:function(t){var i=[];if(this.Z.spans&&t&&t.length){this.bl={};for(var s=0;s<t.length;s++)this.config.excelHeader&&t[s][0]--,0<=t[s][0]&&(t[s][0]=this.getIdByIndex(t[s][0]),t[s][1]="data"+t[s][1],i.push(t[s]));return this.addSpan(i),i}return!1}},Hr=(P.protoUI(Br,Vr.view),{name:"pdfbar",reset:function(){this.setPage(0),this.setValues(0,"auto")},$init:function(t){this.$view.className+=" pdf_bar",t.cols=[{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-angle-left",width:35,click:function(){this.getParentView().rw("prev")}},{view:"text",width:70,value:"0",on:{onBlur:function(){this.getParentView().rw(this.getValue())},onKeyPress:function(t){13===t&&this.getParentView().rw(this.getValue())}}},{template:ct.PDFviewer.of+" #limit#",width:70,data:{limit:0},borderless:!0},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-angle-right",width:35,click:function(){this.getParentView().rw("next")}},{},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-minus",width:35,click:function(){this.getParentView().zoom("out")}},{view:"richselect",options:[],maxWidth:195,suggest:{padding:0,css:"pdf_opt_list",borderless:!0,body:{type:{height:25},scroll:!1,yCount:13}},on:{onChange:function(){this.getParentView().setMasterScale(this.getValue())}}},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-plus",width:35,click:function(){this.getParentView().zoom("in")}},{view:"button",type:"icon",css:"webix_transparent",icon:"wxi-download",width:35,click:function(){this.getParentView().download()}}],this.$ready.push(this.zk)},zk:function(){var t=this.getChildViews()[6].getPopup().getBody();t.clearAll(),t.parse([{id:"auto",value:ct.PDFviewer.automaticZoom},{id:"page-actual",value:ct.PDFviewer.actualSize},{id:"page-fit",value:ct.PDFviewer.pageFit},{id:"page-width",value:ct.PDFviewer.pageWidth},{id:"page-height",value:ct.PDFviewer.pageHeight},{id:"0.5",value:"50%"},{id:"0.75",value:"75%"},{id:"1",value:"100%"},{id:"1.25",value:"125%"},{id:"1.5",value:"150%"},{id:"2",value:"200%"},{id:"3",value:"300%"},{id:"4",value:"400%"}]);var i=0;t.data.each(function(t){i=Math.max(nt(t.value,"webixbutton").width,i)}),this.getChildViews()[6].define("width",i+20),this.getChildViews()[6].resize()},rw:function(t){this.setMasterPage(t),this.setPage(this.$master.$pageNum)},setScale:function(t){var i=this.getChildViews()[6];i.blockEvent(),i.getPopup().getList().exists(t)?i.setValue(t):(i.setValue(""),i.getInputNode().innerHTML=(100*t).toFixed(0)+"%"),i.unblockEvent()},setMasterScale:function(t){this.$master&&this.$master.setScale(t)},setMasterPage:function(t){this.$master&&("prev"===t?this.$master.prevPage():"next"===t?this.$master.nextPage():isNaN(parseInt(t))||this.$master.renderPage(parseInt(t)))},zoom:function(t){this.$master&&("out"===t?this.$master.zoomOut():"in"===t&&this.$master.zoomIn())},setPage:function(t){this.getChildViews()[1].setValue(t)},setValues:function(t,i){this.getChildViews()[2].data.limit=t,this.getChildViews()[2].refresh(),this.setScale(i)},download:function(){this.$master&&this.$master.download()}}),Rr=(P.protoUI(Hr,nh.view),{name:"pdfviewer",defaults:{scale:"auto"},$init:function(t){this.$view.className+=" webix_pdf";var i=document.createElement("DIV");i.className="canvas_wrapper";var s=document.createElement("canvas");this.Vk=this.$view,this.tt=this.$view.appendChild(i),this.Ys=this.tt.appendChild(s),this.$pdfDoc=null,this.$pageNum=0,this.$numPages=0,this.Bk=!1,this.Hk=null,this.Rk=this.Ys.getContext("2d"),this.Pk=.1,this.jk=t.scaleDelta||1.1,this.Ek=t.minScale||.25,this.Nk=t.maxScale||10,this.Lk=1.25,this.Ok=40,
  this.Uk=10,this.ht=[],this.$ready.push(this.Yk)},toolbar_setter:function(t){if("string"==typeof t){var i=Pt(t);return i&&(i.$master=this,i.refresh()),this.attachEvent("onDocumentReady",function(){i?(i.setPage(this.$pageNum),i.setValues(this.$numPages,this.Z.scale)):this.toolbar_setter(t)}),t}},Yk:function(){if(delete this.Z.datatype,this.attachEvent("onScaleChange",function(t){this.Z.toolbar&&Pt(this.Z.toolbar).setScale&&Pt(this.Z.toolbar).setScale(t)}),this.attachEvent("onPageRender",function(t){this.Z.toolbar&&Pt(this.Z.toolbar).setPage&&Pt(this.Z.toolbar).setPage(t)}),S.touch)this.Wk=!1,Nt(this.et,"touchstart",C(function(t){var i=t.targetTouches;2===i.length&&(Q(t),this.Wk=Math.abs(i[0].pageY-i[1].pageY))},this)),Nt(this.$view,"touchmove",C(function(t){var i=t.targetTouches;2===i.length&&!1!==this.Wk&&(Q(t),Math.abs(i[0].pageY-i[1].pageY)>this.Wk?this.zoomIn():this.zoomOut(),this.Wk=!1)},this)),this.attachEvent("onSwipeX",function(t,i){this.$view.scrollLeft=this.$view.scrollLeft-(i.x-t.x)}),this.attachEvent("onSwipeY",function(t,i){var s=this.$view.clientHeight,e=this.$view.scrollHeight,n=this.$view.offsetHeight,h=this.$view.scrollTop,r=i.y-t.y;if(s===e||r<0&&e-n<h||0<r&&0===h){var o=this.$pageNum+(0<r?-1:1);0<o&&o<=this.$numPages&&(this.$pageNum=o,this.Gk(this.$pageNum),this.$view.scrollTop=0<r?e:0)}else this.$view.scrollTop=h-r});else{var t=S.isFF?"DOMMouseScroll":"mousewheel";Lt(window,t,function(t){var i=("DOMMouseScroll"===t.type?-t.detail:t.wheelDelta)<0?"out":"in";t.ctrlKey&&(Q(t),"in"==i?this.zoomIn():this.zoomOut())},{bind:this,passive:!1})}},$onLoad:function(t){return window.PDFJS?this.Xk(t):ei([S.cdn+"/extras/pdfjs/compatibility.min.js",S.cdn+"/extras/pdfjs/pdf.min.js"],function(){PDFJS.workerSrc=S.cdn+"/extras/pdfjs/pdf.worker.min.js",this.Xk(t)},this),!0},Xk:function(t){if(t.name){var i=new FileReader;i.onload=C(function(t){this.Xk({data:t.target.result})},this),i.readAsArrayBuffer(t)}else this.Jk({data:t.data})},Jk:function(i){var s=this;return PDFJS.getDocument({data:i.data,password:i.password}).then(function(t){s.clear(),s.$pdfDoc=t,s.$numPages=s.$pdfDoc.numPages,s.$pageNum=1,s.Zk(s.$pageNum).then(function(){s.callEvent("onDocumentReady")})})["catch"](function(t){"PasswordException"==t.name&&s.qk(i)})},getPopup:function(){var s=this;return this.Kk||(this.Kk=zt({view:"window",position:"center",modal:!0,head:ct.PDFviewer.enterPassword,body:{view:"form",elements:[{view:"text",name:"password",type:"password",invalidMessage:ct.PDFviewer.passwordError,required:!0},{cols:[{view:"button",value:ct.message.cancel,hotkey:"esc",click:function(){s.getPopup().hide()}},{view:"button",type:"form",value:ct.message.ok,hotkey:"enter",click:function(){var t=s.getPopup(),i=t.getBody();i.validate()?(s.Jk({data:s.Qk,password:i.getValues().password}),t.hide()):i.focus()}}]}]},on:{onHide:function(){var t=s.getPopup().getBody();t.clear(),t.clearValidation(),delete s.Qk}}}),this.ht.push(this.Kk)),this.Kk},qk:function(t){var i=this.getPopup(),s=i.getBody();this.Qk=t.data,t.password&&(s.markInvalid("password"),s.setValues({password:t.password})),i.show(),s.focus()},tC:function(t,i){var s=t.getViewport(i);return this.Ys.height=s.height,this.Ys.width=s.width,this.tt.style.width=s.width+"px",this.tt.style.height=s.height+"px",s},Zk:function(t){var n=this;return n.Bk=!0,this.$pdfDoc.getPage(t).then(function(t){var i=isNaN(parseFloat(n.Z.scale))?n.Pk:n.Z.scale,s=n.tC(t,i);i!==n.Z.scale&&(i=n.iC(n.Z.scale),s=n.tC(t,i),n.Z.scale=i);var e={canvasContext:n.Rk,viewport:s};return t.cleanupAfterRender=!0,t.render(e).promise.then(function(){n.callEvent("onPageRender",[n.$pageNum]),n.Bk=!1,null!==n.Hk&&(n.Zk(n.Hk),n.Hk=null)})})},Gk:function(t){this.Bk?this.Hk=t:this.Zk(t)},renderPage:function(t){!this.$pdfDoc||t<0||t>this.$numPages||(this.$pageNum=t,this.Gk(this.$pageNum))},prevPage:function(){this.$pageNum<=1||(this.$pageNum--,this.Gk(this.$pageNum))},nextPage:function(){this.$pageNum>=this.$numPages||(this.$pageNum++,this.Gk(this.$pageNum))},zoomIn:function(){var t=this.Z.scale;t=(t*this.jk).toFixed(2),t=Math.ceil(10*t)/10,t=Math.min(this.Nk
  ,t),this.setScale(t)},zoomOut:function(){var t=this.Z.scale;t=(t/this.jk).toFixed(2),t=Math.floor(10*t)/10,t=Math.max(this.Ek,t),this.setScale(t)},iC:function(t){if(!isNaN(parseFloat(t)))return t;isNaN(parseFloat(this.Z.scale))&&(this.Z.scale=this.Pk);var i=1,s=((this.Vk.clientWidth-this.Ok)*this.Z.scale/this.Ys.clientWidth).toFixed(2),e=((this.Vk.clientHeight-this.Uk)*this.Z.scale/this.Ys.clientHeight).toFixed(2);switch(t){case"page-actual":i=1;break;case"page-width":i=s;break;case"page-height":i=e;break;case"page-fit":i=Math.min(s,e);break;case"auto":var n=this.Vk.clientWidth>this.Vk.clientHeight?Math.min(e,s):s;i=Math.min(this.Lk,n)}return i},setScale:function(t){if(isNaN(parseFloat(t))){var i=this.iC(t);this.sC(i)}else this.sC(t)},sC:function(t){this.Z.scale=t,this.renderPage(this.$pageNum),this.callEvent("onScaleChange",[t])},download:function(){if(this.$pdfDoc){var i=(this.Z.downloadName||"document")+".pdf";this.$pdfDoc.getData().then(function(t){ht(PDFJS.createBlob(t,"application/pdf"),i)})}},clear:function(){this.$pdfDoc&&(this.Rk.clearRect(0,0,this.Ys.width,this.Ys.height),this.tt.style.height=this.tt.style.width=this.Ys.width=this.Ys.height=0,this.Z.scale="auto",this.$pageNum=this.$numPages=0,this.$pdfDoc.transport.startCleanup(),this.$pdfDoc.destroy(),this.$pdfDoc=null,this.Z.toolbar&&Pt(this.Z.toolbar)&&Pt(this.Z.toolbar).reset())}}),Pr=(P.protoUI(Rr,w,li,Li.view),{name:"video",$init:function(t){t.id||(t.id=z()),this.$ready.push(this.eC)},eC:function(){var t=this.Z;if(this.Zi=Y("video",{"class":"webix_view_video",style:"width:100%;height:100%;",autobuffer:"autobuffer"},""),t.poster&&(this.Zi.poster=t.poster),t.src){"object"!=k(t.src)&&(t.src=[t.src]);for(var i=0;i<t.src.length;i++)this.Zi.innerHTML+=' <source src="'+t.src[i]+'">'}t.controls&&(this.Zi.controls=!0),t.autoplay&&(this.Zi.autoplay=!0),this.et.appendChild(this.Zi)},getVideo:function(){return this.Zi},defaults:{src:"",controls:!0}}),jr=(P.protoUI(Pr,Li.view),{name:"gage",defaults:{value:0,minRange:0,maxRange:100,minWidth:250,minHeight:200,smoothFlow:!0,scale:3,stroke:7},$init:function(){this.$ready.push(C(this.nC,this)),this.attachEvent("onDestruct",function(){this.hC=this.rC=this.oC=null})},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.aC()},aC:function(){this.uC=this.config.value;var t=this.$view.querySelector(".webix_gage_curves"),i=this.$view.querySelector(".webix_gage_info"),s=this.config.scale,e=Math.min(this.$width,this.$height),n=e/100*this.config.stroke,h=e/s;t.setAttribute("r",h),t.setAttribute("strokeDasharray",Math.round(Math.PI*h)),t.style.r=h,t.style.strokeDasharray=Math.round(Math.PI*h),t.style["stroke-width"]=n+"px",i.setAttribute("style","width: "+Math.round(2*h)+"px;"),this.oC.setAttribute("style","height: "+Math.round(h+n)+"px;"),this.hC.setAttribute("r",h),this.hC.setAttribute("style","stroke-dasharray: "+Math.round(this.gradientLength*Math.PI*h)+", 1900; stroke-width:"+n+"px"),this.cC(h),this.fC()},lC:function(t){return Math.min(Math.max(t,this.Z.minRange),this.Z.maxRange)},cC:function(t){var i=this.$width,s=Math.min(this.$width,this.$height)/100*this.config.stroke;this.rC.style.transformOrigin=i/2+"px 0 0",this.rC.setAttribute("y1","0"),this.rC.setAttribute("x1",Math.round(i)/2+s),this.rC.setAttribute("y2","0"),this.rC.setAttribute("x2",Math.round((i+s)/2+t))},fC:function(){var t=this.config.value,i=this.$view.querySelector(".webix_gage_value"),s=this.lC(t)-this.config.minRange,e=Math.round(180*s/(this.config.maxRange-this.config.minRange)),n=Math.min(this.$width,this.$height);this.$view.style.fontSize=Math.floor(n/8)+"px",i.innerHTML=t,this.hC.style.stroke=this.color,this.hC.setAttribute("stroke",this.color),this.rC.setAttribute("transform","rotate("+e+" "+n/2+" 0)"),this.rC.style.transform="rotate("+e+"deg)"},dC:function(){this.config.minRange,this.config.maxRange,this.gradientLength=(this.lC(this.config.value)-this.config.minRange)/(this.config.maxRange-this.config.minRange);var t=this.config.color;this.color=t?"function"==typeof t?t.call(this,this.config.value):t:"hsl("+(120-Math.round(120*this.gradientLength)
  )+", 100%, 50%)",!0===this.config.animation?this.defaultColor="hsl(125, 100%, 50%)":this.defaultColor="hsl("+(120-Math.round(120*this.gradientLength))+", 100%, 50%)"},nC:function(){this.gradientLength=0,this.dC(),this.$view.innerHTML='<div class="webix_gage_box"><div>\n\t\t\t<div class="webix_gage_label"><span>'.concat(this.config.label||"",'</span></div>\n\t\t\t<svg class="webix_gage_body" style="height:300px; position: relative;">\n\t\t\t\t<circle class="webix_gage_curves" r="0" cx="50%" cy="0" stroke="#EEEEEE" fill="none"></circle>\n\t\t\t\t<circle class="webix_gage_gradient" r="0" stroke=').concat(this.defaultColor,' cx="50%" cy="0" fill="none" style="stroke-dasharray: 0, 1900;"></circle>\n\t\t\t\t<line class="webix_gage_gradient_point" x1="0" x2="0" y1="0" y2="0" style="stroke:#B0B0B0; stroke-width:4;"></line>\n\t\t\t</svg>\n\t\t\t<div class="webix_gage_info">\n\t\t\t\t<div class="webix_gage_min_range">').concat(this.config.minRange,'</div>\n\t\t\t\t<div class="webix_gage_max_range">').concat(this.config.maxRange,'</div>\n\t\t\t\t<div class="webix_gage_placeholder">\n\t\t\t\t\t<div class="webix_gage_value">').concat(this.config.value,'</div>\n\t\t\t\t\t<div class="webix_gage_range_info">').concat(this.config.placeholder||"","</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div></div>"),this.hC=this.$view.querySelector(".webix_gage_gradient"),this.rC=this.$view.querySelector(".webix_gage_gradient_point"),this.oC=this.$view.querySelector(".webix_gage_body"),!0===this.isVisible()&&!0===this.config.smoothFlow&&S.svganimation&&!S.isEdge&&(this.hC.setAttribute("class","webix_gage_gradient webix_gage_animated"),this.rC.setAttribute("class","webix_gage_gradient_point webix_gage_gradient_point_animated"))},refresh:function(){var t=this.config.value;this.config.smoothFlow&&t!=this.uC&&(this.config.value=this.uC),this.nC(),this.aC(),this.uC!=t&&this.et.parentNode.clientHeight&&this.setValue(t)},setValue:function(t){this.config.value=t,this.dC(),this.aC()},getValue:function(){return this.config.value}}),Er=(P.protoUI(jr,w,Li.view),{name:"barcode",defaults:{type:"ean13",height:160,width:220,paddingY:10,paddingX:20,textHeight:20,color:"#000",ariaLabel:"bars"},$init:function(){this.$view.className+=" webix_barcode",this.types||(this.types={"default":this.type},this.type.name="default")},type:{},render:function(){this.isVisible(this.Z.id)&&(this.canvas&&this.canvas.clearCanvas(!0),this.$view.innerHTML="",this.vC())},vC:function(){this.canvas=new Wi({container:this.$view,name:this.name,title:this.Z.ariaLabel,width:this.$width,height:this.$height}),this._C()},_C:function(){var t,i,s,e,n=this.Z.value,h=this.Z.type;if(!h||!this.types[h]||!n)return!1;if(e=(t=this.type.encode(n)).length,i=this.canvas.getCanvas(),e){var r=(this.$width-2*this.config.paddingX)/e,o=0;for(s=0;s<e;s++){parseInt(t.charAt(s),10)?(o++,s==e-1&&this.pC(i,s+1,r,o,e)):o&&(this.pC(i,s,r,o,e),o=0)}this.mC(n,r)}},pC:function(t,i,s,e,n){var h,r,o,a;r=parseInt(i*s+this.config.paddingX,10),h=parseInt(r-e*s,10),o=this.config.paddingY,a=this.$height-this.config.paddingY-this.config.textHeight,this.bC()&&(i<4||n-4<i||i<n/2+2&&n/2-2<i)&&(a+=this.config.textHeight/2),t.fillStyle=this.config.color,t.beginPath(),t.moveTo(h,o),t.lineTo(r,o),t.lineTo(r,a),t.lineTo(h,a),t.lineTo(h,o),t.fill()},mC:function(t,i){var s,e,n;if(this.type.template&&(t=this.type.template(t)),this.bC()){if(this.type.firstDigit&&(this.canvas.renderTextAt(!0,"left",this.config.paddingX,this.$height-this.config.paddingY,t.charAt(0)),t=t.slice(1)),e=t.length,this.type.lastDigit&&e--,e){var h=(this.$width-2*this.config.paddingX-11*i)/e;for(s=0;s<e;s++)n=this.config.paddingX+s*h+(s<e/2?3:8)*i+h/2,this.canvas.renderTextAt(!0,!0,n,this.$height-this.config.paddingY,t.charAt(s));this.type.lastDigit&&(n=this.config.paddingX+e*h+11*i,this.canvas.renderTextAt(!0,!1,n,this.$height-this.config.paddingY,t.charAt(e)))}}else this.canvas.renderTextAt(!0,!0,this.$width/2,this.$height-this.config.paddingY,t)},setValue:function(t){return this.Z.value=t,this.render(),t},getValue:function(){var t=this.Z.value
  ;return this.type.template?this.type.template(t):t},type_setter:function(t){return this.types[t]?(this.type=f(this.types[t]),this.type.css&&(this.Zi.className+=" "+this.type.css)):this.customize(t),t},bC:function(){var t=this.config.type;return 0===t.indexOf("ean")||-1!=t.indexOf("upcA")},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&this.render()}}),Nr=P.protoUI(Er,Li.view);Tt(Nr,{name:"upcA",firstDigit:!0,lastDigit:!0,encode:function(t){return t.length<12&&(t="0"+t),Lr.encode(t)},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,11)+this.checksum(t)},checksum:function(t){return t.length<12&&(t="0"+t),Lr.checksum(t)}}),Tt(Nr,{name:"ean8",encodings:[["0001101","1110010"],["0011001","1100110"],["0010011","1101100"],["0111101","1000010"],["0100011","1011100"],["0110001","1001110"],["0101111","1010000"],["0111011","1000100"],["0110111","1001000"],["0001011","1110100"]],encode:function(t){var i,s;if(7!=(t=t.replace(/[^0-9]/g,"").substring(0,7)).length)return"";for(t+=this.checksum(t),i="101",s=0;s<4;s++)i+=this.encodings[parseInt(t.charAt(s),10)][0];for(i+="01010",s=4;s<8;s++)i+=this.encodings[parseInt(t.charAt(s),10)][1];return i+="101"},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,7)+this.checksum(t)},checksum:function(t){t=t.substring(0,7);var i,s=!0,e=0;for(i=0;i<7;i++)e+=(s?3:1)*parseInt(t.charAt(i),10),s=!s;return((10-e%10)%10).toString()}});var Lr={name:"ean13",firstDigit:!0,encodings:[["0001101","0100111","1110010","000000"],["0011001","0110011","1100110","001011"],["0010011","0011011","1101100","001101"],["0111101","0100001","1000010","001110"],["0100011","0011101","1011100","010011"],["0110001","0111001","1001110","011001"],["0101111","0000101","1010000","011100"],["0111011","0010001","1000100","010101"],["0110111","0001001","1001000","010110"],["0001011","0010111","1110100","011010"]],encode:function(t){var i,s,e;if(12!=(t=t.replace(/[^0-9]/g,"").substring(0,12)).length)return"";for(t+=this.checksum(t),i="101",s=this.encodings[parseInt(t.charAt(0),10)][3],e=1;e<7;e++)i+=this.encodings[parseInt(t.charAt(e),10)][parseInt(s.charAt(e-1),10)];for(i+="01010",e=7;e<13;e++)i+=this.encodings[parseInt(t.charAt(e),10)][2];return i+="101"},template:function(t){return t.replace(/[^0-9]/g,"").substring(0,12)+this.checksum(t)},checksum:function(t){var i,s=!1,e=0;for(t=t.substring(0,12),i=0;i<12;i++)e+=(s?3:1)*parseInt(t.charAt(i),10),s=!s;return((10-e%10)%10).toString()}};Tt(Nr,Lr);var Or,Ur,Yr,Wr,Gr={name:"bullet",defaults:{color:"#394646",marker:!1,layout:"x",barWidth:40,flowTime:500,labelWidth:150,minRange:0,maxRange:100,stroke:8,value:0,smoothFlow:!0,tickSize:10,bands:[{value:100,color:"#5be5d6"},{value:80,color:"#fff07e"},{value:60,color:"#fd8b8c"}],scale:{step:10}},label_setter:At,placeholder_setter:At,$init:function(t){var i="undefined"!=typeof t.tickSize?t.tickSize:this.defaults.tickSize;t&&(t.layout&&"x"!==t.layout||!j(t.height)||(t.height=!1===t.scale?60:i?76+i:74),"y"===t.layout&&j(t.width)&&(t.width=!1===t.scale?60:i?87+i:87))},scale_setter:function(t){return t&&(t.step=t.step||10,t.template=At(t.template||"#value#")),t},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(this.nC("y"===this.Z.layout?i:t),(this.Z.value||0===this.Z.value)&&this.fC(0,this.Z.value))},lC:function(t){return Math.min(Math.max(t,this.Z.minRange),this.Z.maxRange)-this.Z.minRange},gC:function(t){var i;this.wC=t-(this._e||t),this._e=t,(1e3<(i=this.Z.flowTime>this.wC?this.Z.flowTime/this.wC:this.Z.flowTime)||i<5)&&(i=30);var s=(this.Z.value-this.xC)/i;this.yC+=s,Math.abs(this.yC-this.Z.value)<Math.abs(s)&&(this.yC=this.Z.value),this.yC!=this.Z.value?this.MC=requestAnimationFrame(this.gC.bind(this)):(cancelAnimationFrame(this.MC),this.MC=null),this.SC.setAttribute("width",Math.floor(this.lC(this.yC)*this.kC)),this.SC.style.fill=this.Kc()},fC:function(t,i){this.xC=this.yC=t,this.Z.value=this.uC=i,!0===this.isVisible()&&!0===this.Z.smoothFlow&&window.requestAnimationFrame?this.MC||(this.MC=requestAnimationFrame(this.gC.bind(this))):(this.SC.setAttribute("width",Math.floor(this.lC(i)*this.kC)),
  this.SC.style.fill=this.Kc())},Kc:function(){var t=this.Z.color;return"function"==typeof t?t(this.uC):t},CC:function(t,i,s){for(var e=0;e<i.length;e++)t.setAttribute(i[e],s[e])},$C:function(t,i,s){var e=document.createElementNS("http://www.w3.org/2000/svg",t);return i&&this.CC(e,i,s),e},DC:function(t){var i=this.$C(t[0],t[1],t[2]),s=t[3];if(s)for(var e=0;e<s.length;e++)i.appendChild(this.DC(s[e]));return i},IC:function(){var t="d"+z(),i=this.$C("svg",["class"],["webix_bullet_graph_svg"]),s=this.$C("g"),e=this.$C("g"),n=this.$C("rect",["x","y","width","height","class","style"],[this.AC,this.TC,100,this.Z.stroke,"webix_bullet_value","filter:url(#"+t+");fill:"+this.Kc()]),h=this.$C("rect",["x","y","width","height","fill"],[0,5,3,this.Z.barWidth-10,"rgba(0,0,0,0.5)"]),r=this.$C("g",["stroke","stroke-width","fill"],["#8b94ac","2","none"]),o=this.$C("text",["text-anchor","stroke","fill"],["end","none","#8b94ac"]),a="y"==this.Z.layout?"50%":this.AC-10,u="y"==this.Z.layout?11:17,c=this.$C("tspan",["x","y","class"],[a,u,"webix_bullet_header"]),f=this.$C("tspan",["x","y","class"],[a,u+17,"webix_bullet_subheader"]),l=this.$C("text",["text-anchor","stroke","class","fill"],["middle","none","webix_bullet_scale","#8b94ac"]),d=this.DC(["filter",["id","x","y","width","height"],[t,"0","-150%","110%","400%"],[["feOffset",["in","dx","dy"],["SourceAlpha",0,0]],["feGaussianBlur",["stdDeviation"],["2"]],["feComponentTransfer",0,0,[["feFuncA",["type","slope"],["linear","0.5"]]]],["feMerge",0,0,[["feMergeNode"],["feMergeNode",["in"],["SourceGraphic"]]]]]]);i.appendChild(d);var v=document.createElement("div");s.appendChild(e),!1!==this.Z.marker&&(h.setAttribute("x",this.AC+this.lC(this.Z.marker)*this.kC-2),s.appendChild(h)),s.appendChild(n),o.appendChild(c),o.appendChild(f),i.appendChild(o);var _="y"===this.Z.layout,p=this.Z.tickSize;if(this.Z.scale){for(var m=this.AC,b=this.Z.minRange;b<=this.Z.maxRange;b+=this.Z.scale.step){var g=Math.max(b-this.Z.minRange,0),w=Math.floor(g*this.kC-(g?.1:-1)),x=_?(this.$width-this.Z.barWidth)/2+(p?2-p:4):w+m,y=_?this.FC+m-w+6:this.Z.barWidth+(p?16+p:14),M=_?-4:this.Z.barWidth+3+p,S=_?"end":"middle",k=this.$C("tspan",["x","y","text-anchor"],[x,y,S]),C=this.$C("line",["x1","y1","x2","y2","stroke-width"],[w+m,M,w+m,M-p,1]);v.innerHTML=this.Z.scale.template({value:b}),k.appendChild(v.childNodes[0]),l.appendChild(k),r.appendChild(C)}s.appendChild(r),i.appendChild(l)}for(var $=0;$<this.Z.bands.length;$++){var D=this.Z.bands[$],I=this.$C("path"),A=this.lC(D.value)*this.kC;I.setAttribute("d","M "+this.AC+",0 l "+A+",0 l 0,"+this.Z.barWidth+" l -"+A+",0 z"),I.setAttribute("fill",D.color),e.appendChild(I)}if(i.appendChild(s),"y"===this.Z.layout){var T=this.Z.scale?this.$width/2-10:0,F=this.$height+this.AC-28;s.setAttribute("transform","translate("+T+", "+F+") rotate(270)"),o.setAttribute("text-anchor","middle"),o.childNodes[0].setAttribute("x","55%"),o.childNodes[1].setAttribute("x","55%"),l.setAttribute("text-anchor","right")}return i.setAttribute("viewBox","0 0 "+this.$width+" "+this.$height),i},nC:function(t){this.config.minRange,this.config.maxRange,t=t||("x"==this.Z.layout?this.$width:this.$height);var i=this.$view;i.innerHTML="";var s=this.Z,e=s.label&&s.label(s)||s.placeholder&&s.placeholder(s);this.AC=e?s.labelHeight||s.labelWidth:7,this.TC=Math.floor((this.Z.barWidth-this.Z.stroke)/2),this.FC=t-this.AC-30,this.kC=this.FC/(this.Z.maxRange-this.Z.minRange);var n=this.IC();n.setAttribute("height",this.$height),n.setAttribute("width",this.$width),i.appendChild(n),this.SC=i.querySelector(".webix_bullet_value");var h=this.Z.label;h&&(this.$view.querySelector(".webix_bullet_header").textContent=h(this.Z));var r=this.Z.placeholder;r&&(this.$view.querySelector(".webix_bullet_subheader").textContent=r(this.Z))},refresh:function(){this.nC(),this.fC(this.uC,this.Z.value)},setValue:function(t){this.Z.value!=t&&this.fC(this.Z.value,t)},getValue:function(){return this.Z.value}},Xr=(P.protoUI(Gr,Li.view),{name:"geochart",defaults:{chart:{displayMode:"auto",region:"world",resolution:"countries"}},$init:function(t){
  this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.Zi=this.$view.firstChild,this.zC=mt.defer(),t.chart=P.extend(t.chart||{},this.defaults.chart),this.data.provideApi(this,!0),this.$ready.push(this.render),this.data.attachEvent("onClearAll",C(this.VC,this)),this.data.attachEvent("onStoreUpdated",C(this.BC,this))},getMap:function(t){return t?this.zC:this.pu},HC:function(t){return C(function(){"function"==typeof t&&t(),Or=Or||window.google,this.RC()},this)},render:function(){"undefined"==typeof window.google||"undefined"==typeof window.google.charts?(Ur||((Ur=document.createElement("script")).type="text/javascript",Ur.src="//www.gstatic.com/charts/loader.js",document.getElementsByTagName("head")[0].appendChild(Ur)),Ur.onload=this.HC(Ur.onload)):this.HC()()},RC:function(){Or.visualization&&Or.visualization.GeoChart?(this.pu=new Or.visualization.GeoChart(this.Zi),this.PC(),this.zC.resolve(this.pu)):(Or.charts.load("current",{packages:["geochart"],mapsApiKey:this.Z.key}),Or.charts.setOnLoadCallback(C(function(){this.RC()},this)))},$onLoad:function(t){return!this.pu&&(this.zC.then(C(function(){this.parse(t,this.Z.datatype)},this)),!0)},BC:function(){if(this.pu){var n=this._l&&this._l.length?this._l:this.jC(),h=[];if(this.data.each(function(t){for(var i=[],s=0;s<n.length;s++){var e=t[n[s].label];"number"==n[s].type?e*=1:"tooltip"==n[s].role&&(e=this.Z.tooltip(t)),i.push(e)}h.push(i)},this),n.length){for(var t=new Or.visualization.DataTable,i=0;i<n.length;i++)t.addColumn(n[i]);t.addRows(h);var s=new Or.visualization.DataView(t);this.pu.draw(s,this.Z.chart)}else this.pu.draw(Or.visualization.arrayToDataTable([["",""]]),{})}else this.pu||this.zC.then(C(this.BC,this))},setDisplayMode:function(t){this.Z.chart.displayMode=t,this.refresh()},setRegion:function(t){this.Z.chart.region=t,this.refresh()},refresh:function(){this.pu.clearChart(),this.BC()},tooltip_setter:function(t){var i=this.Z.chart.tooltip;return this.Z.chart.tooltip=P.extend(i||{},{isHtml:!0}),At(t)},$setSize:function(t,i){Li.api.$setSize.apply(this,arguments)&&this.pu&&(P.extend(this.Z,{width:t,height:i}),this.refresh())},VC:function(){this._l=null,this.BC()},EC:function(t,i){if(!t||j(t[i]))return"string";var s=k(t[i]);return"string"!=s||isNaN(1*t[i])||(s="number"),s},jC:function(){var t=this.Z.columns||[],i=this.data.pull[this.data.order[0]];if(!t.length&&i)for(var s in i)"id"!==s&&t.push(s);for(var e=0;e<t.length;e++)"object"!==k(t[e])&&(t[e]={type:this.EC(i,t[e]),label:t[e]});return this.Z.tooltip&&t.push({type:"string",role:"tooltip",p:{html:!0}}),this._l=t},PC:function(){Or.visualization.events.addListener(this.pu,"error",C(function(){this.callEvent("onMapError",arguments)},this)),Or.visualization.events.addListener(this.pu,"ready",C(function(){this.callEvent("onMapReady",arguments)},this)),Or.visualization.events.addListener(this.pu,"regionClick",C(function(){this.callEvent("onRegionClick",arguments)},this)),Or.visualization.events.addListener(this.pu,"select",C(function(){var t=this.pu.getSelection()[0],i=t||this.NC;if(i){var s=this.data.order[i.row];this.NC=i,this.callEvent("onItemClick",[s,!!t])}},this))}}),Jr=(P.protoUI(Xr,ws,w,Li.view),{name:"google-map",$init:function(){this.$view.innerHTML="<div class='webix_map_content' style='width:100%;height:100%'></div>",this.Zi=this.$view.firstChild,this.zC=mt.defer(),this.data.provideApi(this,!0),this.$ready.push(this.render)},getMap:function(t){return t?this.zC:this.pu},HC:function(t){return C(function(){"function"==typeof t&&t(),Yr=Yr||window.google,this.RC.call(this)},this)},render:function(){if("undefined"==typeof window.google||"undefined"==typeof window.google.maps){if(!Wr){(Wr=document.createElement("script")).type="text/javascript";var t=this.Z,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),Wr.src=i,document.getElementsByTagName("head")[0].appendChild(Wr)}Wr.onload=this.HC(Wr.onload)}else this.HC()()},RC:function(){var t=this.config;this.isVisible(t.id)&&(
  this.pu=new Yr.maps.Map(this.Zi,{zoom:t.zoom,center:new Yr.maps.LatLng(t.center[0],t.center[1]),mapTypeId:Yr.maps.MapTypeId[t.mapType]}),this.zC.resolve(this.pu),this.Zi.firstChild.setAttribute("webix_disable_drag","true"))},center_setter:function(t){return this.pu&&this.pu.setCenter(new Yr.maps.LatLng(t[0],t[1])),t},mapType_setter:function(t){return this.pu&&this.pu.setMapTypeId(Yr.maps.MapTypeId[t]),t},zoom_setter:function(t){return this.pu&&this.pu.setZoom(t),t},layerType_setter:function(t){return"heatmap"==t&&(this.config.libraries="visualization"),this.LC[t]&&(P.extend(this,this.LC[t],!0),this.data.attachEvent("onStoreUpdated",C(function(){this.zC.then(C(function(){this.drawData.call(this,arguments)},this))},this))),t},defaults:{zoom:5,center:[39.5,-98.5],mapType:"ROADMAP",layerType:"marker"},$setSize:function(){Li.api.$setSize.apply(this,arguments),this.pu&&Yr.maps.event.trigger(this.pu,"resize")},$onLoad:function(t){return!this.pu&&(this.zC.then(C(function(){this.parse(t)},this)),!0)},LC:{marker:{drawData:function(t,i,s){switch(s){case"add":case"update":i.$marker=this.OC(i);break;case"delete":i.$marker.setMap(null);break;default:this.data.each(function(t){t.$marker=this.OC(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.pu.setCenter(new Yr.maps.LatLng(i.lat,i.lng))},OC:function(t){var i={};for(var s in t)i[s]=t[s];i.position=new Yr.maps.LatLng(t.lat,t.lng),i.map=t.hidden?null:this.pu;var e=t.$marker;return e?t.$marker.setMap(i.map):(e=new Yr.maps.Marker(i),this.$(e)),this.callEvent("onItemRender",[t]),e},$:function(t){var i=this;t.addListener("click",function(){i.callEvent("onItemClick",[this.id,this])}),t.getDraggable()&&(t.addListener("dragend",function(){i.UC(this,!0)}),t.addListener("drag",function(){i.UC(this)}))},UC:function(t,i){var s=this.getItem(t.id),e=t.getPosition(),n=i?"onAfterDrop":"onDrag";s.lat=e.lat(),s.lng=e.lng(),this.callEvent(n,[s.id,s])}},heatmap:{heatmapConfig_setter:function(t){return t=t||{}},drawData:function(){this.YC&&(this.YC.setMap(null),this.YC=null);var i=[];if(this.data.each(function(t){i.push(this.WC(t))},this),i.length){var t=P.extend(this.config.heatmapConfig,{data:i,map:this.pu},!0);this.YC=new Yr.maps.visualization.HeatmapLayer(t),this.callEvent("onHeatMapRender",[this.YC])}},getHeatmap:function(){return this.YC},WC:function(t){var i={};for(var s in t)i[s]=t[s];return i.location=new Yr.maps.LatLng(t.lat,t.lng),i}}}}),Zr=(P.protoUI(Jr,ws,w,Li.view),{name:"organogram",defaults:{scroll:"auto",ariaLabel:"lines"},$init:function(){this.et.className+=" webix_organogram",this.Ji=document.createElement("DIV"),this.$ready.push(this.GC),P.extend(this.data,pe,!0),this.data.provideApi(this,!0)},na:"webix_dg_id",on_click:{webix_organogram_item:function(t,i){this.Z.select&&("multiselect"==this.Z.select||this.Z.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.Z.multiselect,t.shiftKey):this.select(i),this.Pb=!1)}},on_context:{},on_dblclick:{},GC:function(){this.mt.style.position="relative",this.data.attachEvent("onStoreUpdated",C(this.render,this))},gf:function(t){var i=this.data.Hr[t.id];return this.callEvent("onItemRender",[t]),this.type.templateStart.call(this,t,this.type,i)+(t.$template?this.type["template"+t.$template].call(this,t,this.type,i):this.type.template.call(this,t,this.type,i))+this.type.templateEnd.call(this)},Ot:function(t){var i=this.gf(t);return this.data.branch[t.id]&&(i+=this.XC(t.id)),i},JC:function(){return this.type.listMarginX||this.type.listMarginY},XC:function(t,i){var s,e,n,h,r="",o=this.data.branch[t],a=this.data.Hr[t],u=this.getItem(t),c=!!u&&u.$type;if(i=i||0,"list"===c&&(i+=this.type.listMarginX),t||(this.ZC=[],this.$xy={},h=this.$width-2*this.type.padding,this.$xy[0]={totalWidth:h,start:this.type.padding,width:0,height:0,left:h/2,top:this.type.padding||0}),o){n=this.$xy[t],"list"!=c||this.JC()||(r+=this.type.templateListStart.call(this,u,this.type,a));var f=0,l=0;for(s=0;s<o.length;s++){e=o[s],h=this.qC[e];var d=this.getItem(e)
  ;d.open==undefined&&(d.open=!0),"list"==c&&this.data.addMark(e,"list_item","",1,!0);var v=this.KC(e);if("list"==c){var _=0;this.JC()?_=this.type.listMarginY:s||(_=this.type.marginY),this.$xy[e]={totalWidth:h,start:n.start,width:this.type.width,height:v,left:n.start+h/2-this.type.width/2+i,top:s?this.$xy[o[s-1]].top+this.$xy[o[s-1]].height+_+l:n.top+n.height+_},l=this.data.branch[e]?this.QC(e):0}else this.$xy[e]={totalWidth:h,start:n.start+f,width:this.type.width,height:v,left:n.start+f+h/2-this.type.width/2,top:n.top+n.height+(t?this.type.marginY:0)};r+=this.gf(d),f+=h}for(s=0;s<o.length;s++)e=o[s],this.data.branch[e]&&this.getItem(e).open?r+=this.XC(e,i):u&&("list"!=u.$type?this.ZC.push(this.$xy[e].top+this.$xy[e].height):s==o.length-1&&this.ZC.push(this.$xy[e].top+this.$xy[e].height));var p=0;for(var m in this.$xy){var b=this.$xy[m];p=Math.max(b.left+b.width,p)}this.mt.style.width=p+this.type.padding+this.type.marginX/2+"px","list"!=c||this.JC()||(r+=this.type.templateListEnd(u,this.type,a))}return r},QC:function(t){for(var i=this.data.branch[t],s=0,e=0;e<i.length;e++)s+=this.KC(i[e])+this.type.listMarginY,this.data.branch[i[e]]&&(s+=this.QC(i[e]));return s+this.type.marginY},KC:function(t){var i=this.getItem(t),s=this.type.height;return"function"==typeof s&&(s=s.call(i,this.type,this.data.Hr[t])),this.t$||(this.t$=Y("div"),this.mt.appendChild(this.t$)),this.t$.className=this.type.classname(i,this.type,this.data.Hr[t]),this.t$.style.cssText="width:"+this.type.width+"px;height:"+s+("auto"==s?"":"px")+";",this.t$.innerHTML=this.type.template.call(this,i,this.type,this.data.Hr[t]),this.t$.scrollHeight},i$:function(){var n={},h=this.type.width,r=this.type.marginX;return this.data.each(function(t){n[t.id]=h+r;var i=this.getParentId(t.id);if(i&&"list"!=this.getItem(i).$type)for(;i;){for(var s=this.branch[i],e=n[i]=0;e<s.length;e++)n[i]+=n[s[e]]||0;i=this.getParentId(i)}}),this.qC=n},getItemNode:function(t){if(this.Gi)return this.Gi[t];this.Gi={};for(var i=this.mt.childNodes,s=0;s<i.length;s++){var e=i[s].getAttribute(this.na);if(e&&(this.Gi[e]=i[s]),-1!=i[s].className.indexOf("webix_organogram_list")&&!this.JC())for(var n=i[s].childNodes,h=0;h<n.length;h++)(e=n[h].getAttribute(this.na))&&(this.Gi[e]=n[h])}return this.getItemNode(t)},yc:function(t){return this.Ji.innerHTML=this.gf(t),this.Ji.firstChild},render:function(t,i,s){if(this.isVisible(this.Z.id)&&!this.$blockRender){if("update"!=s)return this.callEvent("onBeforeRender",[this.data])&&(this.i$(),this.Gi=null,this.mt.innerHTML=this.XC(0),this.t$=null,this.mt.style.height=Math.max.apply(Math,this.ZC)+this.type.padding+"px",this.vC(),this.resize(),this.callEvent("onAfterRender",[])),!0;var e=this.getItemNode(t);return X(this.Gi[t]=this.yc(i),e),G(e),!0}},vC:function(){this.canvas&&this.canvas.clearCanvas(!0),this.canvas=new Wi({container:this.mt,name:this.name,title:this.Z.ariaLabel,width:this.mt.offsetWidth,height:this.mt.offsetHeight}),this.s$(0)},e$:function(t,i,s,e,n,h,r){t.strokeStyle=h,t.lineCap="square",t.lineWidth=r,t.beginPath(),t.moveTo(i,s),t.lineTo(e,n),t.stroke(),t.lineWidth=1},s$:function(t,i){var s,e,n,h,r,o,a,u,c,f;if(i||(i=this.canvas.getCanvas()),this.$xy&&(t=t||0,n=this.data.branch[t],e=this.getItem(t),n&&n.length)){if(h=this.$xy[t],t)if(o=parseInt(h.left+h.width/2,10)+.5,a=parseInt(h.top+h.height,10),u=parseInt(h.top+h.height+this.type.marginY/2,10),"list"==e.$type){if(!this.JC())return u=parseInt(h.top+h.height+this.type.marginY,10),void this.e$(i,o,a,o,u,this.type.lineColor)}else this.e$(i,o,a,o,u,this.type.lineColor);for(a=parseInt(h.top+h.height+this.type.marginY/2,10)+.5,s=0;s<n.length;s++)t&&(r=this.$xy[n[s]],"list"==e.$type&&this.JC()?(o=parseInt(h.left+this.type.listMarginX/2,10)+.5,s?s==n.length-1&&(f=o):c=o,u=parseInt(r.top+r.height/2,10),this.e$(i,o,a-this.type.marginY/2,o,u,this.type.lineColor),this.e$(i,o,u,o+this.type.listMarginX/2,u,this.type.lineColor)):(o=parseInt(r.left+r.width/2,10)+.5,s?s==n.length-1&&(f=o):c=o,u=parseInt(r.top,10),this.e$(i,o,a,o,u,this.type.lineColor))),this.getItem(n[s]).open&&this.s$(n[s],i);t&&this.e$(i,c,a,f,a
  ,this.type.lineColor)}},$getSize:function(t,i){var s=this.Z.autowidth,e=this.Z.autoheight;return s&&(t=this.mt.offsetWidth+(this.mt.offsetHeight>i&&!e?S.scrollSize:0)),e&&(i=this.mt.offsetHeight+(this.mt.offsetWidth>t&&!s?S.scrollSize:0)),Li.api.$getSize.call(this,t,i)},$setSize:function(t,i){Li.api.$setSize.call(this,t,i)&&(this.mt.style.width=this.$width+"px",this.mt.style.height=this.$height+"px",this.render())},type:{width:120,height:"auto",padding:20,marginX:20,marginY:20,listMarginX:0,listMarginY:0,lineColor:Xi.organogramLineColor||"#90caf9",classname:function(t,i,s){var e="webix_organogram_item";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.list_item&&(e+=" webix_organogram_list_item"),s&&s.$css&&(e+=s.$css),e+=" webix_organogram_level_"+t.$level,i.css&&(e+=" "+i.css),e},listClassName:function(t){var i="webix_organogram_list webix_organogram_list_"+t.$level;return t.$listCss&&("object"==k(t.$listCss)&&(t.$listCss=L(t.$listCss)),i+=" "+t.$listCss),i},template:At("#value#"),templateStart:function(t,i,s){var e="";if((!s||!s.list_item||i.listMarginX||i.listMarginY)&&this.$xy){var n=this.$xy[t.id];e+="width: "+n.width+"px; height: "+n.height+"px;",e+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div webix_dg_id="'+t.id+'" class="'+i.classname.call(this,t,i,s)+'"'+(e?'style="'+e+'"':"")+'">'},templateEnd:At("</div>"),templateListStart:function(t,i,s){var e="";if(this.$xy){var n=this.$xy[t.id];e+="width: "+n.width+"px;",e+="top: "+(n.top+n.height+i.marginY)+"px; left: "+n.left+"px;"}return'<div class="'+i.listClassName.call(this,t,i,s)+'"'+(e?'style="'+e+'"':"")+'">'},templateListEnd:At("</div>")}}),qr=(P.protoUI(Zr,Yi,Fs,ce,ls,Ys,Ps,Us,Os,le,ws,Li.view,w),{$render_pie:function(t,i,s,e,n,h){this.n$(t,i,s,e,1,h,n)},n$:function(t,i,s,e,n,h,r){if(i.length){var o=this.h$(s,e),a=this.Z.radius?this.Z.radius:o.radius;if(!(a<0)){var u=this.r$(i),c=this["if"](u),f=this.tf(u,c),l=this.Z.x?this.Z.x:o.x,d=this.Z.y?this.Z.y:o.y;1==n&&this.Z.shadow&&this.o$(t,l,d,a),d/=n;var v,_=-Math.PI/2,p=[];if(t.scale(1,n),this.Z.gradient){var m=1!=n?l+a/3:l,b=1!=n?d+a/3:d;this.a$(t,l,d,a,m,b)}for(var g=0;g<i.length;g++)if(u[g]){t.strokeStyle=this.Z.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.Z.color.call(this,i[g]);t.fillStyle=x,t.fill(),this.Z.pieInnerText&&this.u$(l,d,5*a/6,_,w,n,this.Z.pieInnerText(i[g],c),!0),this.Z.label&&this.u$(l,d,a+this.Z.labelOffset,_,w,n,this.Z.label(i[g])),1!=n&&(this.c$(t,l,d,_,w,a,!0),t.fillStyle="#000000",t.globalAlpha=.2,this.c$(t,l,d,_,w,a,!1),t.globalAlpha=1,t.fillStyle=x),h.addSector(i[g].id,_,w,l-s.x,d-s.y/n,a,n,r),_=w}for(t.globalAlpha=.8,g=0;g<p.length;g++)v=this.f$(p[g],l,d,a),this.e$(t,l,d,v.x,v.y,this.Z.lineColor.call(this,i[g]),2);(t.globalAlpha=1)==n&&this.Z.border&&(t.lineWidth=this.Z.borderWidth||2,t.strokeStyle=this.Z.borderColor?this.Z.borderColor.call(this):"#ffffff",t.beginPath(),t.arc(l,d,a+1,0,2*Math.PI,!1),t.stroke()),t.scale(1,1/n)}}},r$:function(t){for(var i=[],s=0;s<t.length;s++)i.push(Math.abs(parseFloat(this.Z.value(t[s])||0)));return i},"if":function(t){for(var i=0,s=0;s<t.length;s++)i+=t[s];return i},tf:function(t,i){var s,e=[],n=0;i=i||this["if"](t);for(var h=0;h<t.length;h++)s=t[h],e[h]=2*Math.PI*(i?(s+n)/i:1/t.length),n+=s;return e},h$:function(t,i){var s=i.x-t.x,e=i.y-t.y;return{x:t.x+s/2,y:t.y+e/2,radius:Math.min(s/2,e/2)}},c$:function(t,i,s,e,n,h,r){if(t.lineWidth=1,e<=0&&0<=n||0<=e&&n<=Math.PI||.003<Math.abs(e-Math.PI)&&e<=Math.PI&&n>=Math.PI){e<=0&&0<=n&&(e=0,r=!1,this.l$(t,i,s,h,e,n)),e<=Math.PI&&n>=Math.PI&&(n=Math.PI,r=!1,this.l$(t,i,s,h,e,n));var o=(this.Z.pieHeight||Math.floor(h/4))/this.Z.cant;t.beginPath(),t.arc(i,s,h,e,n,!1),t.lineTo(i+h*Math.cos(n),s+h*Math.sin(n)+o),t.arc(i,s+o,h,n,e,!0),t.lineTo(i+h*Math.cos(e),s+h*Math.sin(e)),t.fill(),r&&t.stroke()}},l$:function(t,i,s,e,n,h){t.beginPath(),t.arc(i,s,e,n,h,!1),t.stroke()},o$:function(t,i,s,e){t.globalAlpha=.5;for(var n=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee",
  "#f5f5f5","#f8f8f8"],h=n.length-1;-1<h;h--)t.beginPath(),t.fillStyle=n[h],t.arc(i+1,s+1,e+h,0,2*Math.PI,!0),t.fill();t.globalAlpha=1},d$:function(t){return t.addColorStop(0,"#ffffff"),t.addColorStop(.7,"#7a7a7a"),t.addColorStop(1,"#000000"),t},a$:function(t,i,s,e,n,h){var r;t.beginPath(),r="function"!=typeof this.Z.gradient?(r=t.createRadialGradient(n,h,e/4,i,s,e),this.d$(r)):this.Z.gradient(r),t.fillStyle=r,t.arc(i,s,e,0,2*Math.PI,!0),t.fill(),t.globalAlpha=.7},u$:function(t,i,s,e,n,h,r,o){var a=this.canvases[0].renderText(0,0,r,0,1);if(a){var u=a.scrollWidth;a.style.width=u+"px",t<u&&(u=t);var c=n-e<.2?4:8;o&&(c=u/1.8);var f=e+(n-e)/2;s-=(c-8)/2;var l=-c,d="right";(f>=Math.PI/2&&f<Math.PI||f<=3*Math.PI/2&&f>=Math.PI)&&(l=-u-l+1,d="left");var v=0;!o&&h<1&&0<f&&f<Math.PI&&(v=(this.Z.height||Math.floor(s/4))/h);var _=(i+Math.floor((s+v)*Math.sin(f)))*h-8,p=t+Math.floor((s+c/2)*Math.cos(f))+l,m=n<Math.PI/2+.01,b=e<Math.PI/2;b&&m?p=Math.max(p,t+3):b||m?!o&&(f>=Math.PI/2&&f<Math.PI||f<=3*Math.PI/2&&f>=Math.PI)&&(p+=u/3):p=Math.min(p,t-u),a.style.top=_+"px",a.style.left=p+"px",a.style.width=u+"px",a.style.textAlign=d,a.style.whiteSpace="nowrap"}},$render_pie3D:function(t,i,s,e,n,h){this.n$(t,i,s,e,this.Z.cant,h)},$render_donut:function(t,i,s,e,n,h){if(i.length){this.n$(t,i,s,e,1,h,n);var r=this.Z,o=this.h$(s,e),a=r.radius?r.radius:o.radius;if(!(a<=0)){var u=r.innerRadius&&r.innerRadius<a?r.innerRadius:a/3,c=r.x?r.x:o.x,f=r.y?r.y:o.y;t.fillStyle="#ffffff",t.beginPath(),t.arc(c,f,u,0,2*Math.PI,!0),t.fill()}}}}),Kr={$render_bar:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g=e.y-s.y;b=!!this.Z.yAxis,m=!!this.Z.xAxis,c=(u=this.v$()).max,f=u.min,o=(e.x-s.x)/i.length,n||"auto"!=this.Z.origin&&!b||this._$(i,s,e,f,c,o),b&&(c=parseFloat(this.Z.yAxis.end),f=parseFloat(this.Z.yAxis.start)),l=(v=this.p$(f,c))[0],d=v[1],p=l?g/l:l,b||"auto"!=this.Z.origin&&m||(_=10,p=l?(g-_)/l:_),!n&&"auto"!=this.Z.origin&&!b&&this.Z.origin>f&&this.m$(t,i,s,e,o,e.y-p*(this.Z.origin-f)),r=parseInt(this.Z.barWidth,10);var w=0,x=0;for(a=0;a<this.b$.length;a++)a==n&&(x=w),"bar"==this.b$[a].type&&w++;this.b$&&o<r*w+4&&(r=parseInt(o/w-4,10));var y=(o-r*w)/2,M="undefined"!=typeof this.Z.radius?parseInt(this.Z.radius,10):Math.round(r/5),S=!1,k=this.Z.gradient;for(k&&"function"!=typeof k?(S=k,k=!1):k&&(k=t.createLinearGradient(0,e.y,0,s.y),this.Z.gradient(k)),m||this.e$(t,s.x,e.y+.5,e.x,e.y+.5,"#edeff0",1),a=0;a<i.length;a++){var C=parseFloat(this.Z.value(i[a])||0);this.g$&&(C=this.w$(C)),c<C&&(C=c),C-=f,C*=d;var $=s.x+y+a*o+(r+1)*x,D=e.y,I=k||this.Z.color.call(this,i[a]),A=this.Z.border?1:0,T=this.Z.label(i[a]);C==this.Z.origin||"auto"==this.Z.origin&&this.Z.value(i[a])==f?(A=0,T=""):C<0||this.Z.yAxis&&0===C&&!("auto"!=this.Z.origin&&this.Z.origin>f)?(C=A=0,T=""):b||"auto"!=this.Z.origin&&m||(C+=_/p),t.globalAlpha=this.Z.alpha.call(this,i[a]);var F=this.pC(t,s,$,D,r,f,M,p,C,I,k,S,A);S&&this.x$(t,$,D,r,f,M,p,C,I,S,A),A&&this.y$(t,$,D,r,f,M,p,C,I),t.globalAlpha=1,F[0]!=$?this.canvases[n].renderTextAt(!1,!0,$+Math.floor(r/2),F[1],T):this.canvases[n].renderTextAt(!0,!0,$+Math.floor(r/2),F[3],T),h.addRect(i[a].id,[$-s.x,F[3]-s.y,F[2]-s.x,F[1]-s.y],n)}},M$:function(t,i,s,e,n,h,r){var o=s;return this.Z.xAxis&&"auto"!=this.Z.origin&&this.Z.origin>r&&(o=s-=(this.Z.origin-r)*n,(e-=this.Z.origin-r)<0&&(e*=-1,t.translate(i+h,s),t.rotate(Math.PI),s=i=0),s-=.5),{value:e,x0:i,y0:s,start:o}},pC:function(t,i,s,e,n,h,r,o,a,u,c,f,l){t.save(),t.fillStyle=u;var d=this.M$(t,s,e,a,o,n,h),v=this.S$(t,d.x0,d.y0,n,r,o,d.value,l);c&&!f&&t.lineTo(d.x0+l,i.y),t.fill(),t.restore();var _=d.x0,p=d.x0!=s?s+v[0]:v[0];return[_,d.x0!=s?d.start-v[1]-d.y0:d.y0,p,d.x0!=s?d.start-d.y0:v[1]]},k$:function(t,i){var s,e;e=Ws.toRgb(i),(s=Ws.rgbToHsv(e[0],e[1],e[2]))[2]/=1.4;var n="rgb("+Ws.hsvToRgb(s[0],s[1],s[2])+")";t.strokeStyle=n,1==t.globalAlpha&&(t.globalAlpha=.9)},y$:function(t,i,s,e,n,h,r,o,a){var u;t.save(),u=this.M$(t,i,s,o,r,e,n),this.k$(t,a),this.S$(t,u.x0,u.y0,e,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},x$:function(t,i,s,e,n,h,r,o,a,u,c){t.save();var f=this.M$(t,i,s,o,r,e,n),
  l=this.C$(t,f.x0,f.y0,f.x0+e,f.y0-r*f.value+2,u,a,"y");t.fillStyle=l.gradient,this.S$(t,f.x0+l.offset,f.y0,e-2*l.offset,h,r,f.value,l.offset+c),t.fill(),t.restore()},S$:function(t,i,s,e,n,h,r,o,a){t.beginPath();var u=0;if(h*r<n){var c=(n-h*r)/n;c<=1&&-1<=c&&(u=-Math.acos(c)+Math.PI/2)}t.moveTo(i+o,s);var f=s-Math.floor(h*r)+n+(n?0:o);n<h*r&&t.lineTo(i+o,f);var l=i+n;n&&0<n&&t.arc(l,f,Math.max(n-o,0),-Math.PI+u,-Math.PI/2,!1);var d=i+e-n-o,v=f-n+(n?o:0);t.lineTo(d,v),n&&0<n&&t.arc(d+o,f,Math.max(n-o,0),-Math.PI/2,0-u,!1);var _=i+e-o;return t.lineTo(_,s),a||t.lineTo(i+o,s),[_,v]}},Qr={$render_line:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m;if(u=this.D$(t,i,s,e,n),r=this.Z,i.length){for(c=r.offset?s.x+.5*u.cellWidth:s.x,a=[],o=0;o<i.length;o++)if((m=this.I$(i[o],s,e,u))||"0"==m){if(l=o?u.cellWidth*o-.5+c:c,v="object"==k(m)?m.y0:m,o&&this.Z.fixOverflow){if((p=this.I$(i[o-1],s,e,u)).out&&p.out==m.out)continue;f=u.cellWidth*(o-1)-.5+c,d="object"==k(p)?p.y0:p,p.out&&(_="min"==p.out?e.y:s.y,a.push({x:this.A$(f,l,d,v,_),y:_})),m.out&&(_="min"==m.out?e.y:s.y,a.push({x:this.A$(f,l,d,v,_),y:_}))}m.out||a.push({x:l,y:m,index:o})}for(this.T$=s,o=1;o<=a.length;o++)f=a[o-1].x,d=a[o-1].y,o<a.length&&(l=a[o].x,v=a[o].y,this.e$(t,f,d,l,v,r.line.color.call(this,i[o-1]),r.line.width),r.line&&r.line.shadow&&(t.globalAlpha=.3,this.e$(t,f+2,d+r.line.width+8,l+2,v+r.line.width+8,"#eeeeee",r.line.width+3),t.globalAlpha=1)),"undefined"!=typeof a[o-1].index&&this.F$(t,f,d,i[a[o-1].index],r.label(i[a[o-1].index]),n,h,s)}},A$:function(t,i,s,e,n){return t+(n-s)*(i-t)/(e-s)},F$:function(t,i,s,e,n,h,r){var o=this.Z.item,a=parseInt(o.radius.call(this,e),10)||0,u=this.T$,c=o.type.call(this,e);if(a){if(t.save(),o.shadow){t.lineWidth=1,t.strokeStyle="#bdbdbd",t.fillStyle="#bdbdbd";for(var f=[.1,.2,.3],l=f.length-1;0<=l;l--)t.globalAlpha=f[l],t.strokeStyle="#d0d0d0",t.beginPath(),this.z$(t,i,s+2*a/3,a+l+1,c),t.stroke();t.beginPath(),t.globalAlpha=.3,t.fillStyle="#bdbdbd",this.z$(t,i,s+2*a/3,a+1,c),t.fill()}t.restore(),t.lineWidth=o.borderWidth,t.fillStyle=o.color.call(this,e),t.strokeStyle=o.borderColor.call(this,e),t.globalAlpha=o.alpha.call(this,e),t.beginPath(),this.z$(t,i,s,a+1,c),t.fill(),t.stroke(),t.globalAlpha=1}if(n&&this.canvases[h].renderTextAt(!1,!0,i,s-a-this.Z.labelOffset,this.Z.label.call(this,e)),r){var d=this.Z.eventRadius||a+1;r.addRect(e.id,[i-d-u.x,s-d-u.y,i+d-u.x,s+d-u.y],h)}},z$:function(t,i,s,e,n){var h=[];if(!n||"square"!=n&&"s"!=n)if(!n||"diamond"!=n&&"d"!=n)h=!n||"triangle"!=n&&"t"!=n?[[i,s,e,0,2*Math.PI,!0]]:[[i,s-e],[i+Math.sqrt(3)*e/2,s+e/2],[i-Math.sqrt(3)*e/2,s+e/2],[i,s-e]];else{var r=1<t.lineWidth?t.lineWidth*Math.sqrt(2)/4:0;h=[[i,s-e],[i+e,s],[i,s+e],[i-e,s],[i+r,s-e-r]]}else h=[[i-(e*=Math.sqrt(2)/2)-t.lineWidth/2,s-e],[i+e,s-e],[i+e,s+e],[i-e,s+e],[i-e,s-e]];this.V$(t,h)},I$:function(t,i,s,e){var n=e.minValue,h=e.maxValue,r=e.unit,o=e.valueFactor,a=this.Z.value(t);this.g$&&(a=this.w$(a));var u=(parseFloat(a||0)-n)*o;this.Z.yAxis||(u+=e.startValue/r);var c=s.y-r*u;return!this.Z.fixOverflow||"line"!=this.Z.type&&"area"!=this.Z.type?(h<a&&(c=i.y),(u<0||a<n)&&(c=s.y)):h<a?c={y:i.y,y0:c,out:"max"}:(u<0||a<n)&&(c={y:s.y,y0:c,out:"min"}),c},D$:function(t,i,s,e,n){var h,r={};r.totalHeight=e.y-s.y,this.Z.cellWidth?r.cellWidth=Math.min(e.x-s.x,this.Z.cellWidth):r.cellWidth=(e.x-s.x)/(this.Z.offset?i.length:i.length-1);var o=!!this.Z.yAxis,a=-1!=this.Z.type.indexOf("stacked")?this.B$(i):this.v$();r.maxValue=a.max,r.minValue=a.min,n||this._$(i,s,e,r.minValue,r.maxValue,r.cellWidth),o&&(r.maxValue=parseFloat(this.Z.yAxis.end),r.minValue=parseFloat(this.Z.yAxis.start));var u=this.p$(r.minValue,r.maxValue);return h=u[0],r.valueFactor=u[1],r.unit=h?r.totalHeight/h:10,r.startValue=0,o||(r.startValue=10,r.unit!=r.totalHeight&&(r.unit=h?(r.totalHeight-r.startValue)/h:10)),r}},to={$render_barH:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w,x,y,M,S,k,C;for(a=(e.y-s.y)/i.length,d=(l=this.v$("h")).max,v=l.min,x=e.x-s.x,C=!!this.Z.xAxis,n||this.H$(t,i,s,e,v,d,a),C&&(d=parseFloat(this.Z.xAxis.end),v=parseFloat(this.Z.xAxis.start))
  ,m=(g=this.p$(v,d))[0],p=g[1],M=m?x/m:10,C||(w=10,M=m?(x-w)/m:10),(o=parseInt(this.Z.barWidth,10))*this.b$.length+4>a&&(o=a/this.b$.length-4),r=Math.floor((a-o*this.b$.length)/2),b="undefined"!=typeof this.Z.radius?parseInt(this.Z.radius,10):Math.round(o/5),_=!1,(c=this.Z.gradient)&&"function"!=typeof c?(_=c,c=!1):c&&(c=t.createLinearGradient(s.x,s.y,e.x,s.y),this.Z.gradient(c)),C||this.e$(t,s.x-.5,s.y,s.x-.5,e.y,"#edeff0",1),f=0;f<i.length;f++)if(y=parseFloat(this.Z.value(i[f]||0)),this.g$&&(y=this.w$(y)),y&&!isNaN(y))if(d<y&&(y=d),y-=v,y*=p,S=s.x,k=s.y+r+f*a+(o+1)*n,y<0&&"auto"==this.Z.origin||this.Z.xAxis&&0===y&&!("auto"!=this.Z.origin&&this.Z.origin>v))this.canvases[n].renderTextAt("middle","right",S+10,k+o/2+r,this.Z.label(i[f]));else{y<0&&"auto"!=this.Z.origin&&this.Z.origin>v&&(y=0),C||(y+=w/M),u=c||this.Z.color.call(this,i[f]),this.Z.border&&this.R$(t,S,k,o,v,b,M,y,u),t.globalAlpha=this.Z.alpha.call(this,i[f]);var $=this.P$(t,e,S,k,o,v,b,M,y,u,c,_);_&&this.j$(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.Z.label(i[f])),h.addRect(i[f].id,[$[0]-s.x,$[3]-s.y,$[2]-s.x,$[3]+o-s.y],n)):(this.canvases[n].renderTextAt("middle",!1,$[2]+5,$[1]+Math.floor(o/2),this.Z.label(i[f])),h.addRect(i[f].id,[$[0]-s.x,k-s.y,$[2]-s.x,$[3]-s.y],n))}},E$:function(t,i,s,e,n,h,r,o,a){var u=0;if(h*r<n){var c=(n-h*r)/n;u=-Math.asin(c)+Math.PI/2}t.moveTo(i,s+o);var f=i+h*r-n-(n?0:o);f=Math.max(i,f),n<h*r&&t.lineTo(f,s+o);var l=s+n;n&&0<n&&t.arc(f,l,n-o,-Math.PI/2+u,0,!1);var d=s+e-n-(n?0:o),v=f+n-(n?o:0);t.lineTo(v,d),n&&0<n&&t.arc(f,d,n-o,0,Math.PI/2-u,!1);var _=s+e-o;return t.lineTo(i,_),a||t.lineTo(i,s+o),[v,_]},H$:function(t,i,s,e,n,h,r){var o=0;this.Z.xAxis&&(this.canvases.x||(this.canvases.x=this.N$("axis_x")),o=this.L$(this.canvases.x.getCanvas(),i,s,e,n,h)),this.Z.yAxis&&(this.canvases.y||(this.canvases.y=this.N$("axis_y")),this.O$(this.canvases.y.getCanvas(),i,s,e,r,o))},O$:function(t,i,s,e,n,h){if(this.Z.yAxis){var r,o=parseInt(h||s.x,10)-.5,a=e.y+.5,u=s.y;this.e$(t,o,a,o,u,this.Z.yAxis.color,1);for(var c=0;c<i.length;c++){var f="auto"!=this.Z.origin&&"barH"==this.Z.type&&parseFloat(this.Z.value(i[c]))<this.Z.origin;r=u+n/2+c*n,this.canvases.y.renderTextAt("middle",!f&&"left",f?o+5:o-5,r,this.Z.yAxis.template(i[c]),"webix_axis_item_y",f?0:o-10),this.Z.yAxis.lines.call(this,i[c])&&this.e$(t,s.x,r,e.x,r,this.Z.yAxis.lineColor.call(this,i[c]),1)}this.Z.yAxis.lines.call(this,{})&&this.e$(t,s.x+.5,u+.5,e.x,u+.5,this.Z.yAxis.lineColor.call(this,{}),1),this.U$(s,e)}},L$:function(t,i,s,e,n,h){var r,o={},a=this.Z.xAxis;if(a){var u=e.y+.5,c=s.x-.5,f=e.x-.5,l=s.x;if(this.e$(t,c,u,f,u,a.color,1),a.step&&(r=parseFloat(a.step)),"undefined"!=typeof this.Y$.step&&"undefined"!=typeof this.Y$.start&&"undefined"!=typeof this.Y$.end||(n=(o=this.W$(n,h)).start,h=o.end,r=o.step,this.Z.xAxis.end=h,this.Z.xAxis.start=n,this.Z.xAxis.step=r),0!==r){for(var d=(f-c)*r/(h-n),v=0,_=n;_<=h;_+=r){var p=this.g$?Math.pow(10,_):_;o.fixNum&&(p=parseFloat(p).toFixed(o.fixNum));var m=Math.floor(c+v*d)+.5;if(_==n&&"auto"==this.Z.origin||!a.lines.call(this,_)||this.e$(t,m,u,m,s.y,this.Z.xAxis.lineColor.call(this,_),1),_==this.Z.origin&&(l=m+1),r<1&&!this.g$){var b=Math.min(Math.floor(this.w$(r)),n<=0?0:Math.floor(this.w$(n))),g=Math.pow(10,-b);_=p=Math.round(p*g)/g}this.canvases.x.renderTextAt(!1,!0,m,u+2,a.template(p.toString()),"webix_axis_item_x"),v++}return this.canvases.x.renderTextAt(!0,!1,c,e.y+this.Z.padding.bottom-3,this.Z.xAxis.title,"webix_axis_title_x",e.x-s.x),l}}},G$:function(t,i,s,e,n,h,r){var o=i;return this.Z.yAxis&&"auto"!=this.Z.origin&&this.Z.origin>r&&(o=i+=(this.Z.origin-r)*n,(e-=this.Z.origin-r)<0&&(e*=-1,t.translate(i,s+h),t.rotate(Math.PI),i=.5,s=0),i+=.5),{value:e,x0:i,y0:s,start:o}},P$:function(t,i,s,e,n,h,r,o,a,u,c,f){t.save();var l=this.G$(t,s,e,a,o,n,h);t.fillStyle=u,t.beginPath();var d=this.E$(t,l.x0,l.y0,n,r,o,l.value,this.Z.border?1:0);c&&!f&&t.lineTo(i.x,l.y0+(this.Z.border?1:0)),t.fill(),t.restore();var v=l.y0,_=l.y0!=e?e:d[1];return[
  l.y0!=e?l.start-d[0]:l.start,v,l.y0!=e?l.start:d[0],_]},R$:function(t,i,s,e,n,h,r,o,a){t.save();var u=this.G$(t,i,s,o,r,e,n);t.beginPath(),this.k$(t,a),t.globalAlpha=.9,this.E$(t,u.x0,u.y0,e,h,r,u.value,t.lineWidth/2,1),t.stroke(),t.restore()},j$:function(t,i,s,e,n,h,r,o,a,u){t.save();var c=this.G$(t,i,s,o,r,e,n),f=this.C$(t,c.x0,c.y0+e,c.x0+r*c.value,c.y0,u,a,"x");t.fillStyle=f.gradient,t.beginPath(),this.E$(t,c.x0,c.y0+f.offset,e-2*f.offset,h,r,c.value,f.offset),t.fill(),t.globalAlpha=1,t.restore()}},io={$render_stackedBar:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d=this.Z,v=e.y-s.y,_=!!d.yAxis,p=!!d.xAxis,m=this.B$(i),b=0===d.origin;r=m.max,o=m.min;var g=Math.floor((e.x-s.x)/i.length);n||(a=this._$(i,s,e,o,r,g)),_&&(r=parseFloat(d.yAxis.end),o=parseFloat(d.yAxis.start));var w=this.p$(o,r);l=w[0],f=w[1];var x=l?v/l:10,y=parseInt(d.barWidth,10);g<y+4&&(y=g-4);var M=Math.floor((g-y)/2),S=!!d.gradient&&d.gradient;p||this.e$(t,s.x,e.y+.5,e.x,e.y+.5,"#edeff0",1);for(var k=0;k<i.length;k++){var C=Math.abs(parseFloat(d.value(i[k]||0)));this.g$&&(C=this.w$(C)),u=s.x+M+k*g;var $=b&&C<0;if(n?c=$?i[k].$startYN:i[k].$startY:(c=a-1,i[k].$startY=c,b&&($&&(c=a+1),i[k].$startYN=a+1)),C&&!isNaN(C)&&(n||b||(C-=o),C*=f,!(c<s.y+1))){var D=this.Z.color.call(this,i[k]),I=Math.abs(c-(b?e.y+o*x:e.y))<3;t.globalAlpha=d.alpha.call(this,i[k]),t.fillStyle=t.strokeStyle=d.color.call(this,i[k]),t.beginPath();var A=c-x*C+(I?$?-1:1:0),T=this.X$(t,u-(d.border?.5:0),c,y+(d.border?.5:0),A,0,s.y);if(t.fill(),t.stroke(),S){t.save();var F=this.C$(t,u,c,u+y,T[1],S,D,"y");t.fillStyle=F.gradient,t.beginPath(),T=this.X$(t,u+F.offset,c,y-2*F.offset,A,d.border?1:0,s.y),t.fill(),t.restore()}d.border&&(t.save(),"string"==typeof d.border?t.strokeStyle=d.border:this.k$(t,D),t.beginPath(),this.X$(t,u-.5,parseInt(c,10)+.5,y+1,parseInt(A,10)+.5,0,s.y,I),t.stroke(),t.restore()),t.globalAlpha=1,this.canvases[n].renderTextAt(!1,!0,u+Math.floor(y/2),T[1]+(c-T[1])/2-7,this.Z.label(i[k])),h.addRect(i[k].id,[u-s.x,T[1]-s.y,T[0]-s.x,i[k][$?"$startYN":"$startY"]-s.y],n),i[k][$?"$startYN":"$startY"]=T[1]}}},X$:function(t,i,s,e,n,h,r,o){t.moveTo(i,s),n<r&&(n=r),t.lineTo(i,n);var a=i+e,u=n;t.lineTo(a,u);var c=i+e;return t.lineTo(c,s),o||t.lineTo(i,s),[c,u]}},so={$render_stackedBarH:function(t,i,s,e,n,h){var r,o,a,u,c=e.x-s.x,f=!!this.Z.yAxis,l=this.B$(i);r=l.max,o=l.min;var d=Math.floor((e.y-s.y)/i.length);n||this.H$(t,i,s,e,o,r,d),f&&(r=parseFloat(this.Z.xAxis.end),o=parseFloat(this.Z.xAxis.start));var v=this.p$(o,r);u=v[0],a=v[1];var _=u?c/u:10,p=0;f||(p=10,_=u?(c-p)/u:10);var m=parseInt(this.Z.barWidth,10);d<m+4&&(m=d-4);var b=(d-m)/2,g=!1,w=this.Z.gradient;w&&(g=!0),f||this.e$(t,s.x-.5,s.y,s.x-.5,e.y,"#edeff0",1);var x=0,y=0;for(M=0;M<this.b$.length;M++)M==n&&(y=x),"stackedBarH"==this.b$[M].type&&x++;for(var M=0;M<i.length;M++){y||(i[M].$startX=s.x);var S=Math.abs(parseFloat(this.Z.value(i[M]||0)));r<S&&(S=r),S-=o,S*=a;var k=s.x,C=s.y+b+M*d;if(y?k=i[M].$startX:i[M].$startX=k,S&&!isNaN(S)){f||(S+=p/_);var $=this.Z.color.call(this,i[M]);t.globalAlpha=this.Z.alpha.call(this,i[M]),t.fillStyle=this.Z.color.call(this,i[M]),t.beginPath();var D=this.E$(t,k,C,m,0,_,S,0);if(w&&!g&&t.lineTo(s.x+c,C+(this.Z.border?1:0)),t.fill(),g){var I=this.C$(t,k,C+m,k,C,g,$,"x");t.fillStyle=I.gradient,t.beginPath(),D=this.E$(t,k,C,m,0,_,S,0),t.fill()}this.Z.border&&this.R$(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.Z.label(i[M])),h.addRect(i[M].id,[i[M].$startX-s.x,C-s.y,D[0]-s.x,D[1]-s.y],n),i[M].$startX=D[0]}}}},eo={$render_area:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w;if(f=this.D$(t,i,s,e,n),u=(o=this.Z).eventRadius||Math.floor(f.cellWidth/2),i.length){for(l=[],_=o.offset?s.x+.5*f.cellWidth:s.x,a=0;a<i.length;a++)if(c=i[a],v=this.I$(c,s,e,f),b=_+f.cellWidth*a,v){if(g="object"==k(v)?v.y0:v,a&&this.Z.fixOverflow){if((d=this.I$(i[a-1],s,e,f)).out&&d.out==v.out)continue;p=f.cellWidth*(a-1)-.5+_,m="object"==k(d)?d.y0:d,d.out&&(w="min"==d.out?e.y:s.y,l.push([this.A$(p,b,m,g,w),w])),v.out&&(
  w="min"==v.out?e.y:s.y,l.push([this.A$(p,b,m,g,w),w]),a==i.length-1&&w==s.y&&l.push([b,s.y]))}v.out||(l.push([b,g]),h.addRect(c.id,[b-u-s.x,g-u-s.y,b+u-s.x,g+u-s.y],n)),o.yAxis||(r=o.offset||a!=i.length-1?"center":"left",this.canvases[n].renderTextAt(!1,r,b,g-o.labelOffset,o.label(c)))}l.length&&(l.push([b,e.y]),l.push([l[0][0],e.y])),t.globalAlpha=this.Z.alpha.call(this,i[0]),t.fillStyle=this.Z.color.call(this,i[0]),t.beginPath(),this.V$(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.k$(t,t.fillStyle),t.beginPath(),this.V$(t,l),t.stroke())}},$render_stackedArea:function(t,s,i,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g,w,x,y;if(v=this.D$(t,s,i,e,n),l=(u=this.Z).eventRadius||Math.floor(v.cellWidth/2),s.length){_=[],b=[],p=u.offset?i.x+.5*v.cellWidth:i.x;var M=function(t,i){return n?s[t].$startY?i-e.y+s[t].$startY:0:i};for(c=0;c<s.length;c++)d=s[c],c?p+=v.cellWidth:(m=M(c,e.y),_.push([p,m])),m=M(c,this.I$(d,i,e,v)),b.push(isNaN(m)&&!c?s[c].$startY||e.y:m),m&&(_.push([p,m]),h.addRect(d.id,[p-l-i.x,m-l-i.y,p+l-i.x,m+l-i.y],n),u.yAxis||(u.offset,a="center",this.canvases[n].renderTextAt(!1,a,p,m-u.labelOffset,u.label(d))));if(_.push([p,M(c-1,e.y)]),n)for(c=s.length-2;0<c;c--)p-=v.cellWidth,(m=s[c].$startY)&&_.push([p,m]);for(_.push([_[0][0],_[0][1]]),t.globalAlpha=this.Z.alpha.call(this,s[0]),t.fillStyle=this.Z.color.call(this,s[0]),t.beginPath(),this.V$(t,_),t.fill(),c=0;c<s.length;c++){if(!(m=b[c]))for(c==s.length-1&&(m=s[c].$startY),f=c+1;f<s.length;f++)if(b[f]){r={x:i.x,y:b[0]},o={x:i.x+v.cellWidth*f,y:b[f]},g=i.x+v.cellWidth*c,void 0,m=(y=((x=o).y-(w=r).y)/(x.x-w.x))*g+w.y-y*w.x;break}s[c].$startY=m}}}},no={$render_radar:function(t,i,s,e,n,h){this.J$(t,i,s,e,n,h)},J$:function(t,i,s,e,n,h){if(i.length){for(var r=this.h$(s,e),o=this.Z.radius?this.Z.radius:r.radius,a=this.Z.x?this.Z.x:r.x,u=this.Z.y?this.Z.y:r.y,c=[],f=0;f<i.length;f++)c.push(1);var l=this.tf(c,i.length);this.T$=s,n||this.Z$(l,a,u,o,i),this.q$(t,l,a,u,o,i,n,h)}},q$:function(t,i,s,e,n,h,r,o){var a,u,c,f,l,d,v,_,p,m,b,g,w,x,y,M,S,k,C;for(l=(c=this.Z).yAxis.start,d=c.yAxis.end,k=(g=(C=this.p$(l,d))[0])?n/g:n/2,S=C[1],a=u=w=-Math.PI/2,p=[],f=_=0;f<h.length;f++)y=M||(x=c.value(h[f]),this.g$&&(x=this.w$(x)),(parseFloat(x||0)-l)*S),m=Math.floor(k*y),x=c.value(f!=h.length-1?h[f+1]:h[0]),this.g$&&(x=this.w$(x)),M=(parseFloat(x||0)-l)*S,b=Math.floor(k*M),a=u,u=f!=h.length-1?w+i[f]-1e-4:w,v=_||this.f$(a,s,e,m),_=this.f$(u,s,e,b),p.push(v);c.fill&&this.K$(t,p,h),!c.disableLines&&2<h.length&&this.Q$(t,p,h),(!c.disableItems||h.length<3)&&this.tD(t,p,h,r,o),p=null},tD:function(t,i,s,e,n){for(var h=0;h<i.length;h++)this.F$(t,i[h].x,i[h].y,s[h],this.Z.label.call(this,s),e,n)},K$:function(t,i,s){var e,n;t.globalAlpha=this.Z.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.Z.fill.call(this,s[h]),e=i[h],n=i[h+1]||i[0],h||t.moveTo(e.x,e.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},Q$:function(t,i,s){for(var e,n,h=0;h<i.length;h++)e=i[h],n=i[h+1]||i[0],this.e$(t,e.x,e.y,n.x,n.y,this.Z.line.color.call(this,s[h]),this.Z.line.width)},Z$:function(t,i,s,e,n){var h=this.Z.yAxis,r=this.Z.xAxis,o=h.start,a=h.end,u=h.step,c={},f=this.iD;if("undefined"==typeof f.step||"undefined"==typeof f.start||"undefined"==typeof f.end){var l=this.v$();o=(c=this.W$(l.min,l.max)).start,a=c.end,u=c.step,h.end=a,h.start=o}var d,v,_,p,m,b=[],g=0,w=e*u/(a-o);u<1&&(p=Math.min(this.w$(u),o<=0?0:this.w$(o)),m=Math.pow(10,-p));var x=[];this.canvases.scale||(this.canvases.scale=this.N$("radar_scale"));var y=this.canvases.scale.getCanvas();for(d=a;o<=d;d-=u){var M=this.g$?Math.pow(10,d):d;c.fixNum&&(M=parseFloat(d).toFixed(c.fixNum)),b.push(Math.floor(g*w)+.5),m&&!this.g$&&(d=M=Math.round(M*m)/m);var S=s-e+b[b.length-1];if(this.canvases.scale.renderTextAt("middle","left",i,S,h.template(M.toString()),"webix_axis_item_y webix_radar"),t.length<2)return void this.sD(y,"arc",i,s,e-b[b.length-1],-Math.PI/2,3*Math.PI/2,d);var k,C=-Math.PI/2,$=C;for(v=0;v<t.length;v++)g||x.push($),k=C+t[v]-1e-4,
  this.sD(y,2<t.length?f.lineShape||"line":"arc",i,s,e-b[b.length-1],$,k,d,v,n[d]),$=k;g++}for(d=0;d<x.length;d++)_=this.f$(x[d],i,s,e),r.lines.call(this,n[d],d)&&this.e$(y,i,s,_.x,_.y,r?r.lineColor.call(this,n[d]):"#cfcfcf",1),this.eD(y,i,s,e,x[d],r?r.template.call(this,n[d]):"&nbsp;")},sD:function(t,i,s,e,n,h,r,o,a){var u,c;if(n<0)return!1;u=this.f$(h,s,e,n),c=this.f$(r,s,e,n);var f=this.Z.yAxis;f.bg&&(t.beginPath(),t.moveTo(s,e),"arc"==i?t.arc(s,e,n,h,r,!1):(t.lineTo(u.x,u.y),t.lineTo(c.x,c.y)),t.fillStyle=f.bg(o,a),t.moveTo(s,e),t.fill(),t.closePath()),f.lines.call(this,o)&&(t.lineWidth=1,t.beginPath(),"arc"==i?t.arc(s,e,n,h,r,!1):(t.moveTo(u.x,u.y),t.lineTo(c.x,c.y)),t.strokeStyle=f.lineColor.call(this,o),t.stroke())},eD:function(t,i,s,e,n,h){if(!h)return!1;var r=this.canvases.scale.renderText(0,0,h,"webix_axis_radar_title",1),o=r.scrollWidth,a=r.offsetHeight,u=this.f$(n,i,s,e+5),c=0,f=0;(n<0||n>Math.PI)&&(f=-a),n>Math.PI/2&&(c=-o),Math.abs(n+Math.PI/2)<.001||Math.abs(n-Math.PI/2)<.001?c=-o/2:(Math.abs(n)<.001||Math.abs(n-Math.PI)<.001)&&(f=-a/2),r.style.top=u.y+f+"px",r.style.left=u.x+c+"px",r.style.width=o+"px",r.style.whiteSpace="nowrap"}},ho={$render_scatter:function(t,i,s,e,n,h){if(this.Z.xValue){var r=this.Z,o=!(r.disableLines||"undefined"==typeof r.disableLines),a=this.v$(),u=this.v$("h","xValue");n||(this.canvases.x||(this.canvases.x=this.N$("axis_x")),this.canvases.y||(this.canvases.y=this.N$("axis_y")),this.nD(this.canvases.y.getCanvas(),i,s,e,a.min,a.max),this.L$(this.canvases.x.getCanvas(),i,s,e,u.min,u.max)),a={min:r.yAxis.start,max:r.yAxis.end},u={min:r.xAxis.start,max:r.xAxis.end};var c=this.hD(t,i,s,e,u,a);this.T$=s;for(var f,l,d,v,_,p=[],m=0;m<i.length;m++){var b=this.rD(c,e,s,u,i[m],"X"),g=this.rD(c,s,e,a,i[m],"Y");isNaN(b)||isNaN(g)||p.push({x:b,y:g,index:m})}for(var w=0;w<p.length;w++){if(_=p[w].index,o){var x=r.line.color.call(this,i[_]);f=p[w].x,l=p[w].y,w==p.length-1?r.shape&&2<p.length&&(this.e$(t,d,v,p[0].x,p[0].y,x,r.line.width),r.disableItems||this.oD(t,h,p[0],i[0],n),r.fill&&this.aD(t,p,i)):(d=p[w+1].x,v=p[w+1].y,this.e$(t,f,l,d,v,x,r.line.width))}!r.disableItems&&p[w]&&this.oD(t,h,p[w],i[_],n)}}},aD:function(t,i,s){var e,n;t.globalAlpha=this.Z.alpha.call(this,{}),t.beginPath();for(var h=0;h<i.length;h++)t.fillStyle=this.Z.fill.call(this,s[h]),e=i[h],n=i[h+1]||i[0],h||t.moveTo(e.x,e.y),t.lineTo(n.x,n.y);t.fill(),t.globalAlpha=1},hD:function(t,i,s,e,n,h){var r={};return r.totalHeight=e.y-s.y,r.totalWidth=e.x-s.x,this.uD(r,n.min,n.max,r.totalWidth,"X"),this.uD(r,h.min,h.max,r.totalHeight,"Y"),r},oD:function(t,i,s,e,n){this.F$(t,s.x,s.y,e,this.Z.label.call(this,e),n,i)},rD:function(t,i,s,e,n,h){var r=this.Z["X"==h?"xValue":"value"].call(this,n),o=t["valueFactor"+h],a=(parseFloat(r||0)-e.min)*o,u=t["unit"+h],c=s[h.toLowerCase()]-("X"==h?-1:1)*Math.floor(u*a);return a<0&&(c=s[h.toLowerCase()]),r>e.max&&(c=i[h.toLowerCase()]),r<e.min&&(c=s[h.toLowerCase()]),c},uD:function(t,i,s,e,n){var h=this.p$(i,s);t["relValue"+(n=n||"")]=h[0],t["valueFactor"+n]=h[1],t["unit"+n]=t["relValue"+n]?e/t["relValue"+n]:10}},ro={$render_splineArea:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b,g=this.Z,w=[];if(f=this.D$(t,i,s,e,n),c=g.eventRadius||Math.floor(f.cellWidth/2),a=[],i.length){for(v=s.x,o=0;o<i.length;o++)((m=this.I$(i[o],s,e,f))||"0"==m)&&(d=o?f.cellWidth*o-.5+v:v,a.push({x:d,y:m,index:o}),h.addRect(i[o].id,[d-c-s.x,m-c-s.y,d+c-s.x,m+c-s.y],n));for(l=this.cD(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.fD(u,_,o,l.a,l.b,l.c,l.d);x<s.y&&(x=s.y),x>e.y&&(x=e.y);var y=this.fD(u+1,_,o,l.a,l.b,l.c,l.d);y<s.y&&(y=s.y),y>e.y&&(y=e.y),w.push([u,x]),w.push([u+1,y])}w.push([p,b])}r=this.Z.color.call(this,i[0]),w.length&&(w.push([p,e.y]),w.push([w[0][0],e.y])),t.globalAlpha=this.Z.alpha.call(this,i[0]),t.fillStyle=r,t.beginPath(),this.V$(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.k$(t,r),t.beginPath(),w.splice(w.length-3),this.V$(t,w),t.stroke())}}},oo={
  dynamic_setter:function(t){return t&&function i(r){if(r.lD)return;var o=r.Z;o.cellWidth||(o.cellWidth=30);o.animateDuration||(o.animateDuration=400);o.offset=!1,r.lD=r.attachEvent("onBeforeRender",function(t,i){var s=r.dD(r.$s,r.Is);!function e(s){uo(s,function(t,i){i.Gs(s.$s+2*s.Z.cellWidth,s.Is)})}(r),function h(t,i,s,e){if(e&&t.length){var n=Math.ceil((s.x-i.x)/e);t.length>n+1&&t.splice(0,t.length-n-1)}}(t,s.start,s.end,o.cellWidth),"add"==i&&function n(i){var t=i.Z.cellWidth;i.vD!=t&&(i.vD=t,i.render());i.vD=0,i._D=null,window.requestAnimationFrame&&!document.hidden&&window.requestAnimationFrame(function(t){!function h(i,t){var s,e=i.Z.animateDuration,n=i.Z.cellWidth;n&&1<i.count()&&(i._D||(i._D=t),s=t-i._D,i.vD=Math.min(Math.max(s/e*n,1),n),i.render(),s<e&&window.requestAnimationFrame(function(t){h(i,t)}))}(i,t)});i.pD||(i.pD=i.attachEvent("onAfterRender",function(t){!function h(t,c){var f=t.count(),s=t.dD(t.$s,t.Is),l=t.Z.cellWidth,d=t.vD||0,i=c.length<f||(c.length-1)*l>s.end.x-s.start.x;function e(t,i,s,e){var n=t.getCanvas(),h=t.Ys,r=t.Ns,o=t.Ls;if(d&&(c.length<f||(c.length-1)*l>s-i)?(h.style.left=-d+"px",1<c.length&&(!function u(t,i,s){if(t.length){G(t[0]);for(var e=1;e<t.length;e++)ao(s,t[e])||(t[e].style.left=t[e].offsetLeft-i+"px")}}(r,d,o),n.clearRect(0,0,i+d,h.offsetHeight),n.clearRect(s+d,0,h.offsetWidth,h.offsetHeight))):(h.style.left="0px",e||d==l||n.clearRect(i+(c.length-1)*l-l+d,0,h.offsetWidth,h.offsetHeight)),1<r.length&&d&&d!=l){var a=r.length-1;ao(o,r[a])&&(a-=1),r[a].style.display="none"}}uo(t,function(t,i){e(i,s.start.x,s.end.x,"x"==t)}),function n(t,i,s){t.Zi.Gi.style.left=i.start.x-s+"px",t.Zi.Gi.style.width=i.end.x-i.start.x+s+"px"}(t,s,i?d:0)}(i,t)}))}(r)}),r.mD=r.attachEvent("onBeforeXAxis",function(t,i,s,e,n,h){return function _(t,i,s,e,n,h,r){var o,a,u,c,f=t.Z,l=e.x-.5,d=parseInt(r||n.y,10)+.5,v=n.x;if(!f.dynamic)return!1;for(u=(s.length-1)*h>v-l||s.length<t.count(),a=0;a<s.length;a++)c=l+a*h,o=u?1<a:!!a,c=Math.ceil(c)-.5,t.bD(c,d,s[a],o),a&&f.xAxis.lines.call(t,s[a])&&t.gD(i,c,n.y,e.y,s[a]);t.canvases.x.renderTextAt(!0,!1,l,n.y+f.padding.bottom-3,f.xAxis.title,"webix_axis_title_x",n.x-e.x),t.e$(i,l,d,v+(u?t.vD:0),d,f.xAxis.color,1)}(r,t,i,s,e,n,h),!1})}(this),t}};function ao(t,i){return"axis_x"===t&&-1!==i.className.indexOf("webix_axis_title_x")}function uo(t,i){if(t.canvases){for(var s=0;s<t.b$.length;s++)t.canvases[s]&&i(s,t.canvases[s]);t.canvases.x&&i("x",t.canvases.x)}}var co={name:"chart",$init:function(t){if(this.b$=[this.Z],this.wD=[],this.Zi.className+=" webix_chart",this.$ready.push(this.vr),t.preset&&this.xD(t),t.series){var i=t.series;delete t.series,t.series=i}this.data.provideApi(this,!0)},vr:function(){this.data.attachEvent("onStoreUpdated",C(function(){this.render.apply(this,arguments)},this))},defaults:{ariaLabel:"chart",color:"default",alpha:"1",radius:0,label:!1,value:"{obj.value}",padding:{},type:"pie",lineColor:"#ffffff",cant:.5,barWidth:30,line:{width:2,color:"#1ca1c1"},item:{radius:3,borderColor:"#1ca1c1",borderWidth:2,color:"#ffffff",alpha:1,type:"r",shadow:!1},shadow:!1,gradient:!1,border:!1,labelOffset:20,origin:"auto",scale:"linear"},na:"webix_area_id",on_click:{webix_chart_legend_item:function(t,i,s){var e=s.getAttribute("series_id");if(this.callEvent("onLegendClick",[t,e,s])&&void 0!==e&&1<this.b$.length){var n=this.Z,h=n.legend.values;(h&&h[e].toggle||n.legend.toggle)&&(-1!=s.className.indexOf("hidden")?this.showSeries(e):this.hideSeries(e))}}},on_dblclick:{},on_mouse_move:{},locate:function(t){return J(t,this.na)},$setSize:function(t,i){var s=Li.api.$setSize.call(this,t,i);if(s){for(var e in this.canvases)this.canvases[e].Gs(this.$s,this.Is);this.render()}return s},type_setter:function(t){return this["$render_"+t],"undefined"==typeof this.Z.offset&&(this.Z.offset=!(-1!=t.toLowerCase().indexOf("area"))),"radar"!=t||this.Z.yAxis||this.define("yAxis",{}),"scatter"==t&&(this.Z.yAxis||this.define("yAxis",{}),this.Z.xAxis||this.define("xAxis",{})),t},destructor:function(){this.removeAllSeries(),Ti.destructor.apply(this,arguments)},removeAllSeries:function(){
  this.clearCanvas(),this.yD&&(this.yD.innerHTML="",this.yD.parentNode.removeChild(this.yD),this.yD=null),this.canvases&&(this.canvases={}),this.Zi.innerHTML="",this.b$=[]},clearCanvas:function(){if(this.canvases&&"object"==k(this.canvases))for(var t in this.canvases)this.canvases[t].clearCanvas()},render:function(t,i,s){var e,n,h,r;if(this.isVisible(this.Z.id)&&(n=this.MD(),this.callEvent("onBeforeRender",[n,s]))){if(this.canvases&&"object"==k(this.canvases))for(var o in this.canvases)this.canvases[o].clearCanvas();else this.canvases={};if(this.Z.legend&&(this.canvases.legend||(this.canvases.legend=this.N$("legend")),this.SD(this.data.getRange(),this.$s,this.Is)),this.pu=h=new Vs(this.na),r=this.Z,e=this.dD(this.$s,this.Is),this.b$)for(var a=0;a<this.b$.length;a++)this.Z=this.b$[a],this.canvases[a]||(this.canvases[a]=this.N$(this.name+" "+a,"z-index:"+(2+a),null,a,this.Z.ariaLabel)),this["$render_"+this.Z.type](this.canvases[a].getCanvas(),n,e.start,e.end,a,h);if(h.render(this.Zi),this.Zi.lastChild.style.zIndex=100,this.kD(this.Zi.lastChild,e),this.callEvent("onAfterRender",[n]),this.Z=r,this.Z.legend&&this.Z.legend.values)for(var u=this.Z.legend.values,c=0;c<u.length;c++)u[c].$hidden&&this.hideSeries(c)}},kD:function(t,i){var s={};for(var e in s.left=i.start.x,s.top=i.start.y,s.width=i.end.x-i.start.x,s.height=i.end.y-i.start.y,s)t.style[e]=s[e]+"px"},MD:function(){var t,i,s,e,n,h,r,o,a,u;if(e=this.data.getRange(),t=-1!=this.Z.type.toLowerCase().indexOf("barh")?"yAxis":"xAxis",(i=this.Z[t])&&i.units&&"object"==k(i.units)){if(o=[],"undefined"!=typeof(s=i.units).start&&"undefined"!=typeof s.end&&"undefined"!=typeof s.next)for(r=s.start;r<=s.end;)o.push(r),r=s.next.call(this,r);else"[object Array]"===Object.prototype.toString.call(s)&&(o=s);if(h=[],o.length){for(a=i.value,u={},n=0;n<e.length;n++)u[a(e[n])]=n;for(n=0;n<o.length;n++)"undefined"!=typeof u[o[n]]?(e[u[o[n]]].$unit=o[n],h.push(e[u[o[n]]])):h.push({$unit:o[n]})}return h}return e},series_setter:function(t){if(t&&"object"==k(t)){this.ot(t.length?t[0]:t),this.b$=[this.Z];for(var i=1;i<t.length;i++)this.addSeries(t[i])}else;return t},value_setter:At,xValue_setter:At,yValue_setter:function(t){this.define("value",t)},alpha_setter:At,label_setter:At,lineColor_setter:At,borderColor_setter:At,pieInnerText_setter:At,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.CD[Math.floor(i/256)](i%256)},"default":function(t){var i=this.count(),s=this.qc.length,e=this.getIndexById(t.id);return i<s?(e&&(e=e<s-i?this.Zc+2:this.Zc+1),this.Zc=e):e%=s,this.qc[e]}},color_setter:function(t){return this.colormap[t]||At(t)},fill_setter:function(t){return!(!t||"0"==t)&&At(t)},xD:function(t){this.define("preset",t.preset),delete t.preset},preset_setter:function(t){var i,s,e;if(this.defaults=P.extend({},this.defaults),"object"!=k(e=this.presets[t]))return!1;for(i in e)if("object"==k(e[i]))if(this.defaults[i]&&"object"==k(this.defaults[i]))for(s in this.defaults[i]=P.extend({},this.defaults[i]),e[i])this.defaults[i][s]=e[i][s];else this.defaults[i]=P.extend({},e[i]);else this.defaults[i]=e[i];return t},legend_setter:function(t){return t?("object"!=k(t)&&(t={template:t}),this.Ui(t,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:-1!=this.Z.type.toLowerCase().indexOf("stacked")?"":"hide",marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3}),t.template=At(t.template),t):(this.yD&&(this.yD.innerHTML="",this.yD=null),!1)},item_setter:function(t){"object"!=k(t)&&(t={color:t,borderColor:t}),this.Ui(t,P.extend({},this.defaults.item));return this.$D(["alpha","borderColor","color","radius","type"],t),t},line_setter:function(t){return"object"!=k(t)&&(t={color:t}),(t=P.extend(t,this.defaults.line)).color=At(t.color),t},padding_setter:function(t){return"object"!=k(t)&&(t={left:t,right:t,top:t,bottom:t}),this.Ui(t,{left:50,right:20,top:35,bottom:40}),t},xAxis_setter:function(t){if(!t)return!1;"object"!=k(t)&&(t={
  template:t}),this.Ui(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0});return this.$D(["lineColor","template","lines"],t),this.Y$=P.extend({},t),t},yAxis_setter:function(t){this.Ui(t,{title:"",color:"#edeff0",lineColor:"#edeff0",template:"{obj}",lines:!0,bg:"#ffffff"});return this.$D(["lineColor","template","lines","bg"],t),this.iD=P.extend({},t),t},$D:function(t,i){for(var s=0;s<t.length;s++)i[t[s]]=At(i[t[s]])},N$:function(t,i,s,e,n){var h={container:s||this.Zi,name:t,title:j(n)?t:n||"",series:e,style:i||"",width:this.$s,height:this.Is};return new Wi(h)},_$:function(t,i,s,e,n,h){var r,o=0;return this.Z.yAxis&&(this.canvases.y||(this.canvases.y=this.N$("axis_y")),o=this.nD(this.canvases.y.getCanvas(),t,i,s,e,n)),this.Z.xAxis&&(this.canvases.x||(this.canvases.x=this.N$("axis_x")),r=this.canvases.x.getCanvas(),this.callEvent("onBeforeXAxis",[r,t,i,s,h,o])&&this.m$(r,t,i,s,h,o)),o},m$:function(t,i,s,e,n,h){var r,o,a=this.Z,u=s.x-.5,c=parseInt(h||e.y,10)+.5,f=e.x,l=!0,d="stackedBar"==a.type?e.y+.5:c;for(r=0;r<i.length;r++){!0===a.offset?o=u+n/2+r*n:(o=r!=i.length-1||a.cellWidth?u+r*n:e.x,l=!!r),o=Math.ceil(o)-.5;var v="auto"!=a.origin&&"bar"==a.type&&parseFloat(a.value(i[r]))<a.origin;this.bD(o,d,i[r],l,v),(a.offset||r||a.cellWidth)&&a.xAxis.lines.call(this,i[r])&&this.gD(t,o,e.y,s.y,i[r])}this.canvases.x.renderTextAt(!0,!1,u,e.y+a.padding.bottom-3,a.xAxis.title,"webix_axis_title_x",e.x-s.x),this.e$(t,u,c,f,c,a.xAxis.color,1),a.xAxis.lines.call(this,{})&&a.offset&&this.e$(t,f+.5,e.y,f+.5,s.y+.5,a.xAxis.lineColor.call(this,{}),1)},nD:function(t,i,s,e,n,h){var r,o={};if(this.Z.yAxis){var a=s.x-.5,u=e.y,c=s.y,f=e.y+.5;if(this.Z.yAxis.step&&(r=parseFloat(this.Z.yAxis.step)),"undefined"==typeof this.iD.step||"undefined"==typeof this.iD.start||"undefined"==typeof this.iD.end?(n=(o=this.W$(n,h)).start,h=o.end,r=o.step,this.Z.yAxis.end=h,this.Z.yAxis.start=n):"logarithmic"==this.config.scale&&(this.g$=!0),this.U$(s,e),0!==r){if(h==n)return u;for(var l=(u-c)*r/(h-n),d=0,v=n;v<=h;v+=r){var _=this.g$?Math.pow(10,v):v;o.fixNum&&(_=parseFloat(_).toFixed(o.fixNum));var p=Math.floor(u-d*l)+.5;if(v==n&&"auto"==this.Z.origin||!this.Z.yAxis.lines.call(this,v)||this.e$(t,a,p,e.x,p,this.Z.yAxis.lineColor.call(this,v),1),v==this.Z.origin&&(f=p),r<1&&!this.g$){var m=Math.min(Math.floor(this.w$(r)),n<=0?0:Math.floor(this.w$(n))),b=Math.pow(10,-m);v=_=Math.round(_*b)/b}this.canvases.y.renderText(0,p-5,this.Z.yAxis.template(_.toString()),"webix_axis_item_y",s.x-5),d++}return this.e$(t,a,u+1,a,c,this.Z.yAxis.color,1),f}}},U$:function(t,i){var s=this.canvases.y.renderTextAt("middle",!1,0,parseInt((i.y-t.y)/2+t.y,10),this.Z.yAxis.title,"webix_axis_title_y");s&&(s.style.left=(S.transform?(s.offsetHeight-s.offsetWidth)/2:0)+"px")},DD:function(t,i){return{start:Math.floor(this.w$(t)),step:1,end:Math.ceil(this.w$(i))}},AD:function(t){var i=Math.floor(this.w$(t)),s=Math.pow(10,i),e=t/s;return e=5<e?10:5,parseInt(e,10)*s},W$:function(t,i){if(this.g$=!1,"logarithmic"==this.Z.scale){var s=Math.floor(this.w$(t)),e=Math.ceil(this.w$(i));if(0<t&&0<i&&1<e-s)return this.g$=!0,this.DD(t,i)}var n,h;"auto"!=this.Z.origin&&this.Z.origin<t&&(t=this.Z.origin);var r=this.AD((i-t)/8||1),o=Math.floor(this.w$(r));if(r>Math.abs(t))n=t<0?-r:0;else{var a=Math.abs(t),u=Math.floor(this.w$(a)),c=a/Math.pow(10,u);for(n=0!=u||.1<=r?Math.ceil(10*c)/10*Math.pow(10,u)-r:a,1<a&&.1<r&&(n=Math.ceil(n));t<0?n<=t:t<=n;)n-=r;t<0&&(n=-n-2*r),n-=n%r,n=parseFloat((1*n).toFixed(Math.abs(o)))}for(10<i-n&&(r=this.AD((i-n)/8||1)),h=n;h<i;)h+=r,h=parseFloat((1*h).toFixed(Math.abs(o)));return{start:n,end:h,step:r,fixNum:o<0?Math.abs(o):0}},v$:function(t,i){var s,e,n=this.data.fo(),h=arguments.length&&"h"==t?this.Y$:this.iD;if(i=i||"value",h&&"undefined"!=typeof h.end&&"undefined"!=typeof h.start&&h.step)s=parseFloat(h.end),e=parseFloat(h.start);else if(s=As.max(this.b$[0][i],n),e=h&&"undefined"!=typeof h.start?parseFloat(h.start):As.min(this.b$[0][i],n),1<this.b$.length)for(var r=1;r<this.b$.length;r++){var o=As.max(this.b$[r][i],n),a=As.min(this.b$[r][i],n);s<o&&(s=o),
  a<e&&(e=a)}return{max:s,min:e}},w$:function(t){return Math.log(t)/Math.LN10},bD:function(t,i,s,e,n){if(this.Z.xAxis){var h=this.canvases.x.renderTextAt(n,e,t,i-(n?2:0),this.Z.xAxis.template(s));h&&(h.className+=" webix_axis_item_x")}},gD:function(t,i,s,e,n){this.Z.xAxis&&this.Z.xAxis.lines&&this.e$(t,i,s,i,e,this.Z.xAxis.lineColor.call(this,n),1)},e$:function(t,i,s,e,n,h,r){t.strokeStyle=h,t.lineWidth=r,t.beginPath(),t.moveTo(i,s),t.lineTo(e,n),t.stroke(),t.lineWidth=1},p$:function(t,i){return[i!=t?i-t:t,1]},CD:[function(t){return"#FF"+Ws.toHex(t/2,2)+"00"},function(t){return"#FF"+Ws.toHex(t/2+128,2)+"00"},function(t){return"#"+Ws.toHex(255-t,2)+"FF00"},function(t){return"#00FF"+Ws.toHex(t,2)},function(t){return"#00"+Ws.toHex(255-t,2)+"FF"},function(t){return"#"+Ws.toHex(t,2)+"00FF"}],qc:["#f55b50","#ff6d3f","#ffa521","#ffc927","#ffee54","#d3e153","#9acb61","#63b967","#21a497","#21c5da","#3ea4f5","#5868bf","#7b53c0","#a943ba","#ec3b77","#9eb0b8"],Zc:0,addSeries:function(t){var i=P.extend({},this.Z);this.Z=P.extend({},i),this.ot(t),this.b$.push(this.Z),this.Z=i},$tooltipIn:function(t){return t},Es:function(t,i){var s=this.locate(i);if(!s)return null;var e=this.TD(i),n=P.extend({dx:20,dy:0,template:"{obj.value}",css:""},this.b$[e].tooltip||{template:""},!0);return _i.ii.define(n),this.getItem(s)},TD:function(t){var i,s,e,n,h,r,o,a;for(s=this.pu.mu,n=Z(this.Zi.Gi),o=(h=K(t)).x-n.x,a=h.y-n.y,e=0;e<s.length;e++)o<=(i=s[e].points)[2]&&o>=i[0]&&a<=i[3]&&a>=i[1]&&(r?s[e].index>r.index&&(r=s[e]):r=s[e]);return r?r.index:0},hideSeries:function(t){this.canvases[t].hideCanvas();var i=this.Z.legend;i&&i.values&&i.values[t]&&(i.values[t].$hidden=!0,this.SD()),this.pu.hide(this.Zi,t,!0)},showSeries:function(t){this.canvases[t].showCanvas();var i=this.Z.legend;i&&i.values&&i.values[t]&&(delete i.values[t].$hidden,this.SD()),this.pu.hide(this.Zi,t,!1)},SD:function(t,i){var s,e,n,h,r,o,a,u,c,f,l,d=0,v=0;if(t=t||[],i=i||this.$s,u=this.canvases.legend.getCanvas(),e=this.Z.legend,a="x"!=this.Z.legend.layout?"width:"+e.width+"px":"",this.yD&&(this.yD.innerHTML="",this.yD.parentNode.removeChild(this.yD)),this.canvases.legend.clearCanvas(!0),n=Y("DIV",{"class":"webix_chart_legend",style:"left:"+d+"px; top:"+v+"px;"+a},""),e.padding&&(n.style.padding=e.padding+"px"),this.yD=n,this.Zi.appendChild(n),r=[],e.values)for(s=0;s<e.values.length;s++)r.push(this.FD(n,e.values[s].text,"undefined"!=typeof e.values[s].id?k(e.values[s].id):s,e.values[s].$hidden));else for(s=0;s<t.length;s++)r.push(this.FD(n,e.template(t[s]),t[s].id));for(0===n.offsetWidth&&(n.style.width="auto"),o=n.offsetWidth,h=n.offsetHeight,o<i&&("x"==e.layout&&"center"==e.align&&(d=(i-o)/2),"right"==e.align&&(d=i-o),e.margin&&"center"!=e.align&&(d+=("left"==e.align?1:-1)*e.margin)),h<this.Is&&("middle"==e.valign&&"center"!=e.align&&"x"!=e.layout?v=(this.Is-h)/2:"bottom"==e.valign&&(v=this.Is-h),e.margin&&"middle"!=e.valign&&(v+=("top"==e.valign?1:-1)*e.margin)),n.style.left=d+"px",n.style.top=v+"px",u.save(),s=0;s<r.length;s++)l=r[s],c=e.values&&e.values[s].$hidden?(f=!0,e.values[s].disableColor?e.values[s].disableColor:"#edeff0"):(f=!1,e.values?e.values[s].color:this.Z.color.call(this,t[s])),this.zD(u,l.offsetLeft+d,l.offsetTop+v,c,l.offsetHeight,f,s);u.restore(),r=null},FD:function(t,i,s,e){var n="";"x"==this.Z.legend.layout&&(n="float:left;");var h=Y("DIV",{style:n+"padding-left:"+(10+this.Z.legend.marker.width)+"px","class":"webix_chart_legend_item"+(e?" hidden":""),role:"button",tabindex:"0","aria-label":ct.aria[(e?"show":"hide")+"Chart"]+" "+i},i);return 2<arguments.length&&h.setAttribute("series_id",s),t.appendChild(h),h},zD:function(t,i,s,e,n,h,r){var o=[],a=this.Z.legend.marker,u=this.Z.legend.values,c=u&&u[r].markerType?u[r].markerType:a.type;if(e&&(t.strokeStyle=t.fillStyle=e),"round"!=c&&a.radius)if("item"==c){if(this.Z.line&&"scatter"!=this.Z.type&&!this.Z.disableLines){t.beginPath(),t.lineWidth=this.b$[r].line.width,t.strokeStyle=h?e:this.b$[r].line.color.call(this,{});var f=i+5,l=s+n/2;t.moveTo(f,l);var d=f+a.width;t.lineTo(d,l),t.stroke()}var v=this.b$[r].item,
  _=parseInt(v.radius.call(this,{}),10)||0,p=v.type.call(this,{});_&&(t.beginPath(),h?(t.lineWidth=v.borderWidth,t.strokeStyle=e,t.fillStyle=e):(t.lineWidth=v.borderWidth,t.fillStyle=v.color.call(this,{}),t.strokeStyle=v.borderColor.call(this,{}),t.globalAlpha=v.alpha.call(this,{})),t.beginPath(),i+=a.width/2+5,s+=n/2,this.z$(t,i,s,_+1,p),t.fill(),t.stroke()),t.globalAlpha=1}else t.beginPath(),t.lineWidth=1,i+=5,s+=n/2-a.height/2,o=[[i+a.radius,s+a.radius,a.radius,Math.PI,3*Math.PI/2,!1],[i+a.width-a.radius,s],[i+a.width-a.radius,s+a.radius,a.radius,-Math.PI/2,0,!1],[i+a.width,s+a.height-a.radius],[i+a.width-a.radius,s+a.height-a.radius,a.radius,0,Math.PI/2,!1],[i+a.radius,s+a.height],[i+a.radius,s+a.height-a.radius,a.radius,Math.PI/2,Math.PI,!1],[i,s+a.radius]],this.V$(t,o),t.stroke(),t.fill();else{t.beginPath(),t.lineWidth=a.height,t.lineCap=a.type,i+=t.lineWidth/2+5,s+=n/2,t.moveTo(i,s);var m=i+a.width-a.height+1;t.lineTo(m,s),t.stroke(),t.fill()}},dD:function(t,i){var s,e,n,h;if(s=this.Z.padding.left,e=this.Z.padding.top,n=t-this.Z.padding.right,h=i-this.Z.padding.bottom,this.Z.legend){var r=this.Z.legend,o=this.Z.legend.width,a=this.Z.legend.height;"x"==r.layout?"center"==r.valign?"right"==r.align?n-=o:"left"==r.align&&(s+=o):"bottom"==r.valign?h-=a:e+=a:"right"==r.align?n-=o:"left"==r.align&&(s+=o)}return{start:{x:s,y:e},end:{x:n,y:h}}},B$:function(t){var i,s,e,n,h;if(this.Z.yAxis&&"undefined"!=typeof this.Z.yAxis.end&&"undefined"!=typeof this.Z.yAxis.start&&this.Z.yAxis.step)e=parseFloat(this.Z.yAxis.end),n=parseFloat(this.Z.yAxis.start);else{for(i=0;i<t.length;i++)for(t[i].$sum=0,t[i].$min=Infinity,s=0;s<this.b$.length;s++)h=Math.abs(parseFloat(this.b$[s].value(t[i])||0)),isNaN(h)||(-1!=this.b$[s].type.toLowerCase().indexOf("stacked")&&(t[i].$sum+=h),h<t[i].$min&&(t[i].$min=h));for(e=-Infinity,n=Infinity,i=0;i<t.length;i++)t[i].$sum>e&&(e=t[i].$sum),t[i].$min<n&&(n=t[i].$min);0<n&&(n=0)}return{max:e,min:n}},C$:function(t,i,s,e,n,h,r,o){var a,u,c,f,l,d;return"light"==h?(a="x"==o?t.createLinearGradient(i,s,e,s):t.createLinearGradient(i,s,i,n),d=[[0,"#FFFFFF"],[.9,r],[1,r]],u=2):"falling"==h||"rising"==h?(a="x"==o?t.createLinearGradient(i,s,e,s):t.createLinearGradient(i,s,i,n),c=Ws.toRgb(r),(f=Ws.rgbToHsv(c[0],c[1],c[2]))[1]*=.5,l="rgb("+Ws.hsvToRgb(f[0],f[1],f[2])+")","falling"==h?d=[[0,l],[.7,r],[1,r]]:"rising"==h&&(d=[[0,r],[.3,r],[1,l]]),u=0):(t.globalAlpha=.37,u=0,a="x"==o?t.createLinearGradient(i,n,i,s):t.createLinearGradient(i,s,e,s),d=[[0,"#9d9d9d"],[.3,"#e8e8e8"],[.45,"#ffffff"],[.55,"#ffffff"],[.7,"#e8e8e8"],[1,"#9d9d9d"]]),this.VD(a,d),{gradient:a,offset:u}},f$:function(t,i,s,e){return t*=-1,{x:i+=Math.cos(t)*e,y:s-=Math.sin(t)*e}},VD:function(t,i){for(var s=0;s<i.length;s++)t.addColorStop(i[s][0],i[s][1])},V$:function(t,i){var s,e;for(s=0;s<i.length;s++)e=s?"lineTo":"moveTo",2<i[s].length&&(e="arc"),t[e].apply(t,i[s])},BD:function(t,i,s,e,n){t.addRect(i,[s[0].x-e.x,s[0].y-e.y,s[1].x-e.x,s[1].y-e.y],n)}},fo={api:co,view:P.protoUI(co,qr,Kr,Qr,to,io,so,{$render_spline:function(t,i,s,e,n,h){var r,o,a,u,c,f,l,d,v,_,p,m,b;if(c=this.D$(t,i,s,e,n),r=this.Z,this.T$=s,a=[],i.length){for(d=r.offset?s.x+.5*c.cellWidth:s.x,o=0;o<i.length;o++)((p=this.I$(i[o],s,e,c))||"0"==p)&&(l=o?c.cellWidth*o-.5+d:d,a.push({x:l,y:p,v:this.Z.value(i[o]),index:o}));for(f=this.cD(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.fD(u,v,o,f.a,f.b,f.c,f.d);g<s.y&&(g=s.y),g>e.y&&(g=e.y);var w=this.fD(u+1,v,o,f.a,f.b,f.c,f.d);w<s.y&&(w=s.y),w>e.y&&(w=e.y),this.e$(t,u,g,u+1,w,r.line.color(i[o]),r.line.width)}this.e$(t,_-1,this.fD(u,v,o,f.a,f.b,f.c,f.d),_,b,r.line.color(i[o]),r.line.width)}this.F$(t,v,m,i[a[o].index],r.label(i[a[o].index]),n,h)}}},cD:function(t){var i,s,e,n,h,r,o,a,u=[],c=[],f=t.length;for(h=0;h<f-1;h++)u[h]=t[h+1].x-t[h].x,c[h]=(t[h+1].y-t[h].y)/u[h];for(a=[],(o=[])[0]=0,o[1]=2*(u[0]+u[1]),a[0]=0,a[1]=6*(c[1]-c[0]),h=2;h<f-1;h++)o[h]=2*(u[h-1]+u[h])-u[h-1]*u[h-1]/o[h-1],a[h]=6*(c[h]-c[h-1])-u[h-1]*a[h-1]/o[h-1];for((r=[])[f-1]=r[0]=0,h=f-2;1<=h;h--)r[h]=(
  a[h]-u[h]*r[h+1])/o[h];for(i=[],s=[],e=[],n=[],h=0;h<f-1;h++)i[h]=t[h].y,s[h]=-u[h]*r[h+1]/6-u[h]*r[h]/3+(t[h+1].y-t[h].y)/u[h],e[h]=r[h]/2,n[h]=(r[h+1]-r[h])/(6*u[h]);for(h=0;h<t.length-1;h++)0===t[h].v&&0===t[h+1].v&&(i[h]=t[h].y,n[h]=e[h]=s[h]=0);return{a:i,b:s,c:e,d:n}},fD:function(t,i,s,e,n,h,r){return e[s]+(t-i)*(n[s]+(t-i)*(h[s]+(t-i)*r[s]))}},eo,no,ho,{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}}},ro,oo,Fs,Yi,ws,Ps,w,Li.view)},lo={name:"rangechart",$init:function(){this.attachEvent("onAfterRender",this.HD),this.RD()},HD:function(){if(-1===this.Z.type.indexOf("pie")&&"radar"!==this.Z.type&&this.Z.type,this.pu.mu.length&&!this.PD){this.jD(),this.ED=(this.pu.mu[0].points[2]-this.pu.mu[0].points[0])/2;var t={webix_disable_drag:"true",tabindex:"0",role:"button","aria-label":ct.aria.resizeChart};this.ND=Y("div",P.extend({"class":"webix_chart_resizer right"},t)),this.LD=Y("div",P.extend({"class":"webix_chart_resizer left"},t)),this.PD=Y("div",{"class":"webix_chart_frame",webix_disable_drag:"true"}),this.et.appendChild(this.LD),this.et.appendChild(this.PD),this.et.appendChild(this.ND),this.OD(),Nt(this.ND,S.mouse.down,this.UD,{bind:this}),Nt(this.LD,S.mouse.down,this.UD,{bind:this}),Nt(this.PD,S.mouse.down,this.UD,{bind:this}),Nt(D(this.ND),"keydown",this.YD,{bind:this}),Nt(D(this.LD),"keydown",this.YD,{bind:this}),this.uC&&(this.Z.range=this.RD(this.uC)),this.WD(),this.callEvent("onAfterRangeChange",[this.uC]),this.data.attachEvent("onStoreUpdated",C(this.WD,this))}else this.OD(!0)},$setSize:function(t,i){fo.api.$setSize.call(this,t,i)&&(this.jD(),this.WD())},OD:function(t){this.ND&&!this.GD&&(this.GD=this.ND.clientWidth/2,t&&this.WD())},jD:function(){var t=this.dD(this.$s,this.Is);this.T$=t.start,this.XD=t.end},removeAllSeries:function(){this.PD=this.ND=this.LD=null,fo.api.removeAllSeries.apply(this,arguments)},YD:function(t){var i=t.which||t.keyCode;if(37===i||39===i){Q(t);var s=-1!==t.target.className.indexOf("right")?"eindex":"sindex",e=-1!==t.target.className.indexOf("right")?"end":"start",n=this.uC;n[s]=n[s]+(37===i?-1:1),this.pu.mu[n[s]]&&(n[e]=this.JD(n[s]),this.setFrameRange(n))}},UD:function(t){if(-1!==t.target.className.indexOf("webix_chart_resizer"))this.ZD=t.target;else if(this.pu.mu.length){var i=this.pu.mu[this.uC.sindex].points[2]-this.ED,s=this.pu.mu[this.uC.eindex].points[2]-this.ED;this.qD={ex:K(t).x,fx:i+this.T$.x,fw:s-i}}st(this.et,"webix_noselect webix_wresize_cursor"),this.KD(),this.QD=Lt(document.body,S.mouse.move,this.tI,{bind:this}),this.iI=Lt(document.body,S.mouse.up,this.sI,{bind:this})},KD:function(){M.$[this.QD]&&(Ot(this.QD),Ot(this.iI))},tI:function(t){if(this.ZD){var i=K(t).x-Z(this.$view).x;i>=this.T$.x&&i<=this.XD.x&&(-1!==this.ZD.className.indexOf("left")?i<this.ND.offsetLeft&&(this.ZD.style.left=i-this.GD+"px",this.PD.style.left=i+"px",this.PD.style.width=this.ND.offsetLeft-this.LD.offsetLeft-1+"px"
  ):i>this.LD.offsetLeft+this.GD&&(this.ZD.style.left=i-this.GD+"px",this.PD.style.width=this.ND.offsetLeft-this.LD.offsetLeft-1+"px"))}else if(this.qD){var s=K(t).x-this.qD.ex,e=this.qD.fx+s,n=e+this.qD.fw;this.T$.x<=e&&this.XD.x>=n&&(P.extend(this.qD,{lx:e,rx:n},!0),this.LD.style.left=e-this.GD+"px",this.ND.style.left=n-this.GD+"px",this.PD.style.left=e+"px")}},sI:function(t){if(this.KD(),et(this.et,"webix_noselect"),et(this.et,"webix_wresize_cursor"),this.count()){if(this.ZD){var i=S.touch?t.changedTouches[0].pageX:K(t).x;i-=Z(this.$view).x+this.T$.x;var s=this.eI(i),e=this.JD(s);this.ZD===this.LD?(s>=this.uC.eindex&&(s=this.uC.eindex,e=this.JD(s)),this.uC.start=e,this.uC.sindex=s):(s<=this.uC.sindex&&(s=this.uC.sindex,e=this.JD(s)),this.uC.end=e,this.uC.eindex=s),this.ZD=null}else if(this.qD&&this.qD.lx){var n=this.uC.sindex=this.eI(this.qD.lx-this.T$.x),h=this.uC.eindex=this.eI(this.qD.rx-this.T$.x);this.uC.start=this.JD(n),this.uC.end=this.JD(h),this.qD=null}this.WD(),this.callEvent("onAfterRangeChange",[this.uC.start,this.uC.end])}},JD:function(t){return t>=this.data.order.length&&(t=this.data.order.length-1),this.getItem(this.data.order[t])[this.Z.frameId||"id"]},eI:function(t){for(var i=this.pu.mu,s=0;s<i.length;s++)if(t<=i[s].points[2]-this.ED)return s;return i.length-1},nI:function(t){for(var i=this.Z.frameId||"id",s=0;s<this.data.order.length;s++)if(this.getItem(this.data.order[s])[i]==t)return s;return-1},RD:function(t){t?(t.start&&(t.sindex=this.nI(t.start)),t.end&&(t.eindex=this.nI(t.end)),t.start=t.start||this.JD(t.sindex),t.end=t.end||this.JD(t.eindex)):t={start:0,end:0,sindex:0,eindex:0},this.uC=t},range_setter:function(t){return this.RD(t),this.uC},getFrameData:function(){for(var t=[],i=this.uC.sindex;i<=this.uC.eindex;i++){var s=this.getItem(this.data.order[i]);s&&t.push(s)}return t},setFrameRange:function(t){this.RD(t),this.WD(),this.callEvent("onAfterRangeChange",[t])},WD:function(){if(this.pu){var t=this.pu.mu;if(t.length){var i=t[this.uC.sindex].points[0]+this.T$.x+this.ED-1,s=t[this.uC.eindex].points[0]+this.T$.x+this.ED-1;this.LD.style.left=i-this.GD+"px",this.ND.style.left=s-this.GD+"px",this.PD.style.left=i+"px",this.PD.style.width=s-i+"px",this.Z.range=this.uC}}},getFrameRange:function(){return this.Z.range}},vo=(P.protoUI(lo,fo.view),{name:"grouplist",defaults:{animate:{}},Hb:"webix_grouplist",$init:function(){P.extend(this.data,pe,!0),this.data.count=function(){return this.order.length},this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",C(this.hI,this)),this.hI()},hI:function(){this.rI=[],this.oI=[]},$setSize:function(){Li.api.$setSize.apply(this,arguments)&&(this.mt.style.width=this.$s)},on_click:{webix_list_item:function(t,i){if(this.F_)return!1;for(var s=0;s<this.oI.length;s++)if(this.oI[s]==i){for(var e=s;e<this.oI.length;e++)this.data.getItem(this.oI[e]).$template="";return s?(this.rI=this.data.branch[this.oI[s-1]],this.oI.splice(s)):(this.rI=this.data.branch[0],this.oI=[]),this.aI=!1,this.render()}var n=this.getItem(i);if(n.$count)return this.aI=!0,this.oI.push(i),n.$template="Back",this.rI=this.data.branch[n.id],this.render();this.Z.select&&(this.Pb=!0,"multiselect"==this.Z.select||this.Z.multiselect?this.select(i,!1,"touch"==this.Z.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i),this.Pb=!1)}},getOpenState:function(){return{parents:this.oI,branch:this.rI}},render:function(){var t,i;if(this.oI=m(this.oI),this.rI=m(this.rI),this.oI.length)for(t=0;t<this.oI.length;t++)this.data.branch[this.oI[t]]||(this.oI.splice(t,1),t--);if(i=this.oI.length?this.oI[this.oI.length-1]:0,this.rI=m(this.data.branch[i]),!this.rI.length&&this.oI.length&&(this.rI=[i],this.oI.pop()),this.F_)return $(this.render,this,arguments,100);for(t=0;t<this.rI.length;t++)this.data.getItem(this.rI[t]).$template="";if(this.rI.length||(this.rI=this.data.branch[0]),this.data.order=p([].concat(this.oI).concat(this.rI)),this.callEvent("onBeforeRender",[this.data])){if(!this.Pb&&this.mt.innerHTML&&Gi.isSupported()&&this.Z.animate&&this.uI!=this.oI.length){if(this.callEvent("onBeforeRender",[this.data])
  ){this.cI||(this.cI=[]);var s=this.mt.cloneNode(!1);s.innerHTML=this.data.getRange().map(this.Ot,this).join("");var e=P.extend({},this.Z.animate);e.direction=this.aI?"left":"right";var n=[f(e),f(e)];if(this.aI)this.cI.push(this.getScrollState()),Ki&&Ki.$active&&(n[0].y=0,n[1].y=-this.getScrollState().y);else{var h=this.cI.pop();Ki&&Ki.$active&&(n[0].y=-h.y,n[1].y=-this.getScrollState().y)}var r=Gi.formLine(s,this.mt,e);Ki&&Ki.$active&&Ki.Ce(s,0,this.aI?0:n[0].y,"0ms"),e.master=this,e.callback=function(){this.mt=s,this.aI?Ki&&Ki.$active||this.scrollTo(0,0):Ki&&Ki.$active?$(function(){Ki.Ce(s,0,n[0].y,"0ms")},this):h&&this.scrollTo(0,h.y),Gi.breakLine(r),e.master=e.callback=null,this.Gi=null,this.F_=!1,this.callEvent("onAfterRender",[])},this.F_=!0,Gi(r,n)}}else Os.render.apply(this,arguments);this.uI=this.oI.length}},templateBack_setter:function(t){this.type.templateBack=At(t)},templateItem_setter:function(t){this.type.templateItem=At(t)},templateGroup_setter:function(t){this.type.templateGroup=At(t)},type:{template:function(t,i){return t.$count?i.templateGroup(t,i):i.templateItem(t,i)},css:"group",classname:function(t,i,s){return"webix_list_item webix_"+(t.$count?"group":"item")+(t.$template?"_back":"")+(s&&s.webix_selected?" webix_selected":"")+(i.css?" "+i.css:"")+(t.$css?" "+t.$css:"")},templateStart:At('<div webix_l_id="#id#" class="{common.classname()}" style="width:{common.widthSize()}; height:{common.heightSize()};  overflow:hidden;" {common.aria()}>'),templateBack:At("#value#"),templateItem:At("#value#"),templateGroup:At("#value#"),templateEnd:function(t){var i="";return t.$count&&(i+="<div class='webix_arrow_icon'></div>"),i+="</div>"}},showItem:function(t){var i,s;for(t&&(s=(i=this.getItem(t)).$parent,i.$count&&(s=i.id)),this.rI=this.data.branch[s||0],this.oI=[];s;)this.getItem(s).$template="Back",this.oI.unshift(s),s=this.getItem(s).$parent;this.Pb=!0,this.render(),this.Pb=!1,Os.showItem.call(this,t)}});Tt(P.protoUI(vo,Fs,Zh.view),{});var _o={name:"unitlist",na:"webix_item_id",uniteBy_setter:At,render:function(t,i,s){var e=this.Z;if(this.isVisible(e.id)&&e.uniteBy){if(t){var n=this.getItemNode(t);if(n&&"update"==s&&this.Z.uniteBy.call(this,i)==this.getItem(t).$unitValue)return X(this.Gi[t]=this.yc(i),n),void G(n)}this.callEvent("onBeforeRender",[this.data])&&(this.units=null,this.fI(),this.units&&(this.mt.innerHTML=this.lI().map(this.Ot,this).join(""),this.Gi=null),this.callEvent("onAfterRender",[]))}},getUnits:function(){var t=[];if(this.units)for(var i in this.units)t.push(i);return t},getUnitList:function(t){return this.units?this.units[t]:null},Ot:function(t){var i=this.data.Hr[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)},lI:function(){var t,i,s,e;t=[];var n=this.data.$min||0,h=this.data.$max||Infinity,r=0;for(s in this.units)for(t.push({$unit:s}),e=this.units[s],i=0;i<e.length;i++){if(r==n&&(t=[{$unit:s}]),t.push(this.getItem(e[i])),r==h)return p(t);r++}return p(t)},fI:function(){var s=this;this.units={},this.data.each(function(t){var i=s.Z.uniteBy.call(this,t);t.$unitValue=i,s.units[i]||(s.units[i]=[]),s.units[i].push(t.id)})},type:{headerHeight:20,templateHeader:function(t){return"<span class='webix_unit_header_inner'>"+t+"</span>"},templateStart:function(t,i,s){if(t.$unit)return i.templateStartHeader.apply(this,arguments);var e="webix_list_item webix_list_"+i.css+"_item"+(s&&s.webix_selected?" webix_selected":"")+(t.$css?t.$css:""),n="width:"+i.widthSize(t,i,s)+"; height:"+i.heightSize(t,i,s)+"; overflow:hidden;"+(i.layout&&"x"==i.layout?"float:left;":"");return'<div webix_item_id="'+t.id+'" class="'+e+'" style="'+n+'" '+i.aria(t,i,s)+">"},templateStartHeader:function(t,i,s){var e="webix_unit_header webix_unit_"+i.css+"_header"+(t.$selected?"_selected":""),
  n="width:"+i.widthSize(t,i,s)+"; height:"+i.headerHeight+"px; overflow:hidden;";return'<div webix_unit_id="'+t.$unit+'" class="'+e+'" style="'+n+'">'}},$skin:function(){this.type.headerHeight=Xi.unitHeaderHeight}};P.protoUI(_o,Zh.view);ct.dbllist={selectAll:"<span class='webix_icon wxi-angle-double-right'></span>",selectOne:"<span class='webix_icon wxi-angle-right'></span>",deselectAll:"<span class='webix_icon wxi-angle-double-left'></span>",deselectOne:"<span class='webix_icon wxi-angle-left'></span>"};var po={name:"dbllist",defaults:{borderless:!0},$init:function(){this.dI={},this.vI=C(function(t){return this.dI[t.id]},this),this._I=C(function(t){return!this.dI[t.id]},this),this.$view.className+=" webix_dbllist",this.$ready.unshift(this.Og)},$onLoad:function(t,i){var s=this.$$("left"),e=this.$$("right");return this.pI(function(){s.data.driver=i,s.parse(t),e.data.driver=i,e.parse(t)}),this.mI=!0,this.aC(),!0},bI:function(){if(!1===this.Z.buttons)return{width:10};var t=ct.dbllist,i=[this.gI("deselect_all",t.deselectAll),this.gI("select_all",t.selectAll),this.gI("deselect_one",t.deselectOne),this.gI("select_one",t.selectOne)];return i={width:120,template:i.join(""),onClick:{dbllist_button:function(t,i,s){this.getTopParentView().wI(s.getAttribute("action"))}}},this.Z.buttons&&(i.template=this.Z.buttons),i},gI:function(t,i){return"<button class='dbllist_button' action='"+t+"'>"+i+"</button>"},xI:function(t,i,s,e){var n={view:"list",select:"multiselect",multiselect:"touch",id:t,action:i,drag:!0,type:{margin:3,id:t},on:{onBeforeDrop:function(t){var i=t.from,s=t.to,e=i.getTopParentView();if(e===this.getTopParentView()){var n="select_one"!=s.Z.action;e.select(t.source,n)}return!1},onItemDblClick:function(){return this.getTopParentView().wI(this.config.action)}}};return this.Z.list&&P.extend(n,this.Z.list,!0),s&&(n={rows:[{view:"label",label:s,css:"webix_inp_top_label"},n]}),e?{rows:[n,{view:"label",height:20,label:e,css:"bottom_label"}]}:n},Og:function(){var t=[{margin:10,type:"clean",cols:[this.xI("left","select_one",this.Z.labelLeft,this.Z.labelBottomLeft),this.bI(),this.xI("right","deselect_one",this.Z.labelRight,this.Z.labelBottomRight)]}];this.cols_setter(t)},wI:function(t){var i=null,s=!1;"select_all"===t?(i=this.$$("left").data.order,s=!0):"select_one"===t?(i=this.$$("left").getSelectedId(!0),s=!0):"deselect_all"===t?(i=this.$$("right").data.order,s=!1):"deselect_one"===t&&(i=this.$$("right").getSelectedId(!0),s=!1),this.select(i,s)},select:function(t,i){var s;if("object"!==k(t)&&(t=[t]),i)for(s=0;s<t.length;s++)this.dI[t[s]]=!0;else for(s=0;s<t.length;s++)delete this.dI[t[s]];this.aC(),this.callEvent("onChange",[])},pI:function(t,i){gi(C(t,this),!1),i&&(this.$$("left").Z.autoheight||this.$$("right").Z.autoheight)&&this.resize()},aC:function(){var t=this.$$("left"),i=this.$$("right");t&&this.pI(function(){t.filter(this._I),i.filter(this.vI)},!0)},focus:function(){if(!Ii.canFocus(this))return!1;Ii.setFocus(this)},value_setter:function(t){this.setValue(t)},setValue:function(t){if(this.dI={},t){"object"!==k(t)&&(t=t.toString().split(","));for(var i=0;i<t.length;i++)this.dI[t[i]]=!0}this.aC()},getValue:function(){var t=[],i=this.$$("left");for(var s in this.dI)this.mI&&!i.data.pull[s]||t.push(s);return t.join(",")}},mo=(P.protoUI(po,li,Bs,$n.view),{name:"tree",defaults:{scroll:"auto",navigation:!0},$init:function(){this.et.className+=" webix_tree",P.extend(this.data,pe,!0),P.extend(this.on_click,fe),this.attachEvent("onAfterRender",this.Cc),this.attachEvent("onPartialRender",this.Cc),this.data.provideApi(this,!0),this.et.setAttribute("role","tree")},na:"webix_tm_id",on_context:{},on_dblclick:{webix_tree_checkbox:function(){if(this.on_click.webix_tree_checkbox)return this.on_click.webix_tree_checkbox.apply(this,arguments)}},$fixEditor:function(t){var i=this.getItemNode(t.id).querySelector("span");if(i){""===i.innerHTML&&(i.innerHTML="&nbsp;");var s=i.offsetLeft;t.node.style.width=this.$view.scrollWidth-s-10+"px",t.node.style.marginLeft=s+"px",t.node.style.left="0px"}},on_click:{webix_tree_item:function(t,i){
  this.Z.activeTitle&&(this.getItem(i).open?this.close(i):this.open(i));if(this.Z.select)if("multiselect"==this.Z.select||this.Z.multiselect){var s=t.ctrlKey||t.metaKey||"touch"==this.Z.multiselect;if("level"==this.Z.multiselect&&(s||t.shiftKey)){var e=this.getSelectedId(!0)[0];if(e&&this.getParentId(i)!=this.getParentId(e))return}this.select(i,!1,s,t.shiftKey)}else this.select(i)}},ah:{insert:function(t){var i=this.getSelectedId()||"0";this.add({value:t},null,i)},modify:function(t){for(var i=this.getSelectedId(!0),s=0;s<i.length;s++)this.getItem(i[s]).value=t,this.refresh(i[s])},custom:function(){}},Qo:!0,$dragHTML:function(t,i,s){var e="<div class='webix_tree_item'>"+this.type.template(t,this.type)+"</div>";return g(s.source)&&1<s.source.length&&(e=this.Wo(e,s.source.length)),e},qo:function(t){for(var i=t.source,s=0;s<i.length;s++)this.close(i[s])},Zo:function(t,i){var s=this.getItemNode(t);s?s.parentNode.insertBefore(is.xn[0],s):i.children[0].children[0].appendChild(is.xn[0])},type:P.extend({template:function(t,i){return(i["template"+t.level]||i.templateCommon).apply(this,arguments)},classname:function(t,i,s){var e="webix_tree_item";return t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.$css&&(e+=" "+s.$css),i.css&&(e+=" "+i.css),e},aria:function(t,i,s){return'role="treeitem"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')+(t.$count?'aria-expanded="'+(t.open?"true":"false")+'"':"")+'aria-level="'+t.$level+'"'},templateCommon:At("{common.icon()} {common.folder()} <span>#value#</span>"),templateStart:At('<div webix_tm_id="#id#" class="{common.classname()}" {common.aria()}>'),templateEnd:At("</div>"),templateCopy:At("#value#")},be)}),bo=P.protoUI(mo,_e,Fs,ce,ys,de,Ys,Hs,Ps,Us,le,Xh.view,ve,us,w),go={api:mo,view:bo};Tt(bo,{name:"lineTree",css:"webixLineTree",icon:function(t,i){for(var s="",e="",n=1;n<=t.$level;n++){n==t.$level&&(e=t.$count?t.open?"webix_tree_open ":"webix_tree_close ":"webix_tree_none ");var h=i.yI(t,i,n);h&&(s+="<div class='"+e+"webix_tree_img webix_tree_"+h+"'></div>")}return s},yI:function(t,i,s){var e=i.yf,n=ve.Os;if(0===e&&n){var h=t.$level,r=t.id;for(e=[];h;){var o=n.getParentId(r),a=n.data.branch[o];a[a.length-1]==r&&(e[h]=!0),r=o,h--}i.yf=e}if(!e)return 0;if(s!=t.$level)return e[s]?"blank":"line1";var u=3;return t.$parent||0===t.$index&&(u=4),e[t.$level]&&(u=2),t.$count?t.open?"minus"+u:"plus"+u:"line"+u}});var wo={name:"treemap",defaults:{activeItem:!1,subRender:!0,header:!0,headerHeight:35,value:At("#value#"),headerTemplate:"",navigation:!0},value_setter:At,headerTemplate_setter:At,header_setter:function(t){return t&&!0!==t&&(this.type.header=t),t},$init:function(){this.$view.className+=" webix_treemap",this.et.setAttribute("role","tree"),this.MI=document.createElement("DIV"),P.extend(this.data,pe,!0),this.data.provideApi(this,!0),this.data.attachEvent("onClearAll",C(function(){this.Ji="",this.$values={},this.$xy={}},this)),this.attachEvent("onKeyPress",this.zs)},gf:function(t){var i=this.data.Hr[t.id];this.callEvent("onItemRender",[t]);var s=t.$template?this.type["template"+t.$template].call(this,t,this.type,i):this.type.template.call(this,t,this.type,i);return this.type.templateStart.call(this,t,this.type,i)+s+this.type.templateEnd.call(this)},SI:function(t){var i=this.getItem(t),s=this.Z.headerHeight,e="<div class='webix_treemap_header' style='height:"+s+"px;line-height:"+s+"px;'>";return e+=this.type.header.call(this,i,this.type),e+="</div>"},XC:function(t){var i,s,e,n,h=[];if(!this.$width||!this.count())return this.Ji="",!1;if(t||(t=this.config.branch||0,this.Ji="",this.$values={},this.$xy={},this.$xy[t]={width:this.$width,height:this.$height,top:0,left:0},t&&this.Z.header&&(this.$xy[t].height-=this.Z.headerHeight,this.$xy[t].top=this.Z.headerHeight,this.Ji+=this.SI(t)),n=0,this.data.each(function(t){var i=this.getParentId(t.id);if(!this.data.branch[t.id]&&(e=1*this.config.value.call(this,t),!isNaN(e)&&e))for(this.$values[t.id]=e,n+=e;i;)this.$values[i]||(this.$values[i]=0),this.$values[i]+=e,i=this.getParentId(i)},this,!1,t)),
  this.data.eachChild(t,function(t){this.$values[t.id]&&h.push(m(t))},this),n=n||this.$values[t],h.length&&n){(s={top:(i=this.$xy[t]).top,left:i.left,dx:i.width,dy:i.height,set:[],sum:0}).dim=Math.min(s.dx,s.dy);for(var r=s.dx*s.dy/n,o=0;o<h.length;o++)h[o].$value=this.$values[h[o].id]*r;h.sort(function(t,i){return t.$value>i.$value?-1:1});for(var a=Infinity,u=0;h[u];){var c=this.kI(s,h[u]);if(c<a)s.sum+=h[u].$value,s.set.push(h[u]),a=c,u++;else{this.CI(s);var f={top:s.top,left:s.left,dx:s.dx,dy:s.dy,set:[],sum:0},l=s.sum/s.dim;s.dx>s.dy?(f.left+=l,f.dx-=l):(f.top+=l,f.dy-=l),(s=f).dim=Math.min(s.dx,s.dy),a=Infinity}}}s&&this.CI(s)},CI:function(t){var i,s,e,n,h=t.top,r=t.left;for(t.mode=t.dy<t.dx,t.contra=t.sum/t.dim,i=0;i<t.set.length;i++)s=t.set[i].id,n=t.mode?(e=t.contra,t.set[i].$value/t.contra):(e=t.set[i].$value/t.contra,t.contra),this.$xy[s]={},this.$xy[s].top=h,this.$xy[s].left=r,t.mode?h+=n:r+=e,this.$xy[s].width=e,this.$xy[s].height=n,this.Ji+=this.gf(this.getItem(s)),this.Z.subRender&&this.data.branch[s]&&this.XC(s)},kI:function(t,i){var s=t.sum+i.$value,e=s*s/(t.dim*t.dim*i.$value);return t.set.length&&(e=Math.max(t.dim*t.dim*t.set[0].$value/(s*s),e)),1<e?e:1/e},yc:function(t){return this.MI.innerHTML=this.gf(t),this.MI.firstChild},showBranch:function(t){this.Z.branch=t,this.refresh()},render:function(t,i,s){if(this.isVisible(this.Z.id)&&!this.$blockRender){if("update"==s){var e=this.getItemNode(t);if(e)X(this.Gi[t]=this.yc(i),e),G(e)}else!this.data.branch||this.Z.branch&&!this.data.branch[this.Z.branch]||(this.Gi=null,this.callEvent("onBeforeRender",[]),this.XC(),this.mt.innerHTML=this.Ji,this.callEvent("onAfterRender",[]));return!0}},na:"webix_dm_id",on_click:{webix_treemap_item:function(t,i){this.Z.select&&("multiselect"==this.Z.select||this.Z.multiselect?this.select(i,!1,t.ctrlKey||t.metaKey||"touch"==this.Z.multiselect,t.shiftKey):this.select(i)),this.Z.activeItem&&this.isBranch(i)&&this.showBranch(i)},webix_treemap_header_item:function(t){var i=J(t,"webix_dm_header_id");this.define("branch",i),this.refresh()},webix_treemap_reset:function(){this.define("branch",0),this.refresh()}},on_dblclick:{},on_mouse_move:{},$I:function(t){var i="";for(var s in t)i+=s+":"+t[s]+";";return i},type:{template:At("#value#"),header:function(t,i){for(var s=t.id,e="<div role='button' tabindex='0' aria-label='"+ct.aria.resetTreeMap+"' class='webix_treemap_reset'></div>",n=[];s;)t=this.getItem(s),n.push(i.headerItem.call(this,t,i)),s=this.getParentId(s);return n.reverse(),e+n.join("<span class='webix_icon wxi-angle-right webix_treemap_path_icon'></span>")},headerItem:function(t){var i=this.config.headerTemplate(t),s='<a role="button" tabindex="0" aria-label="'+i+'" webix_dm_header_id="'+t.id+'" class="webix_treemap_header_item">';return s+=i,s+="</a>"},classname:function(t,i,s){var e="webix_treemap_item";i.css&&(e+=" "+i.css),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css);var n=this.$xy[t.id];s&&s.$css&&(e+=" "+s.$css),e+=" webix_treemap_level_"+this.getItem(t.id).$level;var h=this.getParentId(t.id);if(h&&h!=this.Z.branch||(e+=" webix_treemap_level_top"),this.$height-n.top-n.height<1&&(e+=" webix_treemap_item_bottom"),this.$width-n.left-n.width<1&&(e+=" webix_treemap_item_right"),i.cssClass){var r=i.cssClass.call(this,t,i,s);r&&("object"==k(r)?e+=" "+L(r):e+=" "+r)}return e},templateStart:function(t,i,s){var e="";if(this.$xy){var n=this.$xy[t.id];e+="width: "+n.width+"px; height: "+n.height+"px;",e+="top: "+n.top+"px; left: "+n.left+"px;"}return'<div role="treeitem" aria-level="'+t.$level+'" '+(s&&s.webix_selected?'aria-selected="true" tabindex="0"':"")+' webix_dm_id="'+t.id+'" class="'+i.classname.call(this,t,i,s)+'" style="'+e+'">'},templateEnd:At("</div>")}},xo=(P.protoUI(wo,Fs,ce,Ys,Hs,Ps,Us,le,Xh.view,ve,us,w),{name:"dataview",$init:function(t){t.sizeToContent&&this.$ready.unshift(this.vr);var i=t.type||t.item;t.prerender||this.defaults.prerender||i&&"auto"==i.width||"move"==t.drag||"order"==t.drag||t.autoheight||P.extend(this,ye,!0),t.autoheight&&(t.scroll=!1),i&&"tiles"==i.type&&(
  this.et.firstChild.style.padding="8px",this.DI=8),this.Zi.className+=" webix_dataview",this.et.setAttribute("role","listbox")},vr:function(){var t=Y("DIV",0,this.type.template({}));t.style.position="absolute",document.body.appendChild(t),this.type.width=t.offsetWidth,this.type.height=t.offsetHeight,G(t)},defaults:{scroll:!0,datafetch:50,navigation:!0},na:"webix_l_id",mh:"webix_dataview_item",DI:0,ia:"x",on_click:{webix_dataview_item:function(t,i){this.Z.select&&("multiselect"==this.Z.select||this.Z.multiselect?this.select(i,!1,"touch"==this.Z.multiselect||t.ctrlKey||t.metaKey,t.shiftKey):this.select(i))}},on_dblclick:{},on_mouse_move:{},type:{template:At("#value#"),templateLoading:At("Loading..."),width:160,height:50,classname:function(t,i,s){var e="webix_dataview_item";return i.css&&(e+=" "+i.css),i.type&&"tiles"==i.type.toString()&&(e+=" tiles "),t.$css&&("object"==k(t.$css)&&(t.$css=L(t.$css)),e+=" "+t.$css),s&&s.$css&&(e+=" "+s.$css),e},tilesStart:function(t,i){return"tiles"==i.type?'<div class="webix_dataview_inner_item" style="box-sizing:border-box; overflow:hidden;">':""},tilesEnd:function(t,i){return"tiles"==i.type?"</div>":""},aria:function(t,i,s){return'role="option"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':' tabindex="-1"')},templateStart:At('<div webix_l_id="#id#" class="{common.classname()}" {common.aria()} style="width:{common.width}px; height:{common.height}px; float:left; overflow:hidden;">{common.tilesStart()}'),templateEnd:At("{common.tilesEnd()}</div>")},II:function(t){return this.Z.height=this.type.height*Math.ceil(this.data.count()/Math.floor(t/this.type.width))},autoheight_setter:function(t){return t&&(this.data.attachEvent("onStoreLoad",C(this.resize,this)),this.Zi.style.overflowY="hidden"),t},$getSize:function(t,i){0<this.Z.xCount&&"auto"!=this.type.width&&!this.AI&&(this.Z.width=this.type.width*this.Z.xCount+(this.Ds?S.scrollSize:0)),this.Z.yCount&&"auto"!=this.type.height&&(this.Z.height=this.type.height*this.Z.yCount);var s=this.Z.width||this.$s;return this.Z.autoheight&&s&&(this.II(s),this.scroll_setter(!1)),Li.api.$getSize.call(this,t,i)},TI:function(){var t=!1;return this.Z.yCount&&"auto"==this.type.height&&(this.type.height=Math.floor((this.Is-this.DI)/this.Z.yCount),t=!0),this.Z.xCount&&("auto"==this.type.width||this.AI)?(this.AI=!0,this.type.width=Math.floor((this.$s-2*this.DI)/this.Z.xCount),t=!0):this.AI=!1,t},$setSize:function(t,i){if(Li.api.$setSize.call(this,t,i)){if(this.Z.autoheight&&this.II()!=this.Is)return $(this.resize,this);(this.TI()||this.sl)&&this.render()}}});P.protoUI(xo,ds,ys,Ps,Hs,Ys,Us,cs,Xh.view);ct.pager={first:"<span class='webix_icon wxi-angle-double-left'></span>",last:"<span class='webix_icon wxi-angle-double-right'></span>",next:"<span class='webix_icon wxi-angle-right'></span>",prev:"<span class='webix_icon wxi-angle-left'></span>"};var yo={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.Z,this.mt=this.et,this.et.className+=" webix_pager"+(t.autowidth?" webix_pager_auto":""),!1!==t.master&&0!==t.master||this.$ready.push(this.FI)},FI: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.Z.page+1;break;case"prev":t=this.Z.page-1;break;case"first":t=0;break;case"last":t=this.Z.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.Z.animate&&this.fC(i,1*t,this.Z.animate)||this.$master.refresh()),this.callEvent("onAfterPageChange",[t]))},na:"webix_p_id",template_setter:At,type:{template:function(t,i){return t.template.call(this,t,i)},pages:function(t){var i="";if(-1==t.page)return"";t.$min=t.page-Math.round((t.group-1)/2),t.$max=t.$min+1*t.group-1,t.$min<0&&(t.$max+=-1*t.$min,t.$min=0),t.$max>=t.limit&&(t.$min-=Math.min(t.$min,
  t.$max-t.limit+1),t.$max=t.limit-1);for(var s=t.$min||0;s<=t.$max;s++)i+=this.button({id:s,index:s+1,selected:s==t.page?"_selected":"",label:ct.aria.page+" "+(s+1)});return i},page:function(t){return t.page+1},first:function(){return this.button({id:"first",index:ct.pager.first,selected:"",label:ct.aria.pages[0]})},last:function(){return this.button({id:"last",index:ct.pager.last,selected:"",label:ct.aria.pages[3]})},prev:function(){return this.button({id:"prev",index:ct.pager.prev,selected:"",label:ct.aria.pages[1]})},next:function(){return this.button({id:"next",index:ct.pager.next,selected:"",label:ct.aria.pages[2]})},button:At("<button type='button' webix_p_id='{obj.id}' class='webix_pager_item{obj.selected}' aria-label='{obj.label}'>{obj.index}</button>")},clone:function(t){t.$view||(t.view="pager",t=zt(t)),((this.VI=t).$master=this).zI()},refresh:function(){var t=this.Z;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.zI(),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},zI:function(){this.VI&&(this.VI.Z.count=this.Z.count,this.VI.Z.page=this.Z.page,this.VI.refresh())},fC:function(t,i,s){if(t==i)return!1;if(this.BI)return this.HI&&window.clearTimeout(this.HI),this.HI=$(this.fC,this,[t,i,s],100);var e=t<i?"left":"right";"top"!=s.direction&&"bottom"!=s.direction||(e=t<i?"top":"bottom"),s.flip&&(e="");var n=0,h=this.$master.mt,r=!!this.$master.Wt;r&&(n=(h=this.$master.Wt).offsetTop,st(this.$master.$view,"webix_animation"));var o,a=h.cloneNode(!0);a.style.width=h.style.width="100%",this.$master.refresh(),X(a,h.nextSibling,h.parentNode),r&&(a.childNodes[1].scrollLeft=h.childNodes[1].scrollLeft);var u=!0!==s?s:{},c=P.extend({direction:e,callback:C(function(){c.callback=null,Gi.breakLine(o),this.BI=!1,this.$master.Wt&&et(this.$master.$view,"webix_animation")},this),top:n,keepViews:r},u);o=Gi.formLine(h,a,c),Gi([h,a],c),this.BI=!0}},Mo=(P.protoUI(yo,Ps,Oi,Li.view,w),{name:"comments",defaults:{sendAction:"click",mode:"comments"},$init:function(t){this.$view.className+=" webix_comments",t.rows=[this.RI(t)],t.readonly||t.rows.push(this.jI()),t.moreButton||(t.moreButton=At(ct.comments.moreComments)),this.ht=[],this.EI(t.users),this.NI(),this.$ready.push(this.GC)},$exportView:function(){return this.LI},GC:function(){var s=this;this.LI=this.queryView({view:"list"}),this.OI=this.queryView({view:"form"}),this.UI=this.queryView({view:"button"}),this.YI=this.queryView({view:"textarea"}),this.config.mentions&&this.WI(this.config.mentions),this.LI.data.provideApi(this,!0),this.serialize=function(){var t=s.LI.serialize(),i=s.getIndexById("$more");return 0<=i&&t.splice(i,1),t},this.GI=T("onClick",function(t){var i=Pt(t);i==s.YI?(s.XI(!0),$(function(){s.YI.focus()})):i===s.UI||i===s.JI||s.ZI&&i===s.ZI.getList()||t&&-1!==(t.target.className||"").toString().indexOf("webix_comments_menu")||s.XI()}),this.attachEvent("onDestruct",function(){F(this.GI)})},$onLoad:function(t,i){this.qI(t,i)},qI:function(t,i){var s=this,e=this.LI||this.queryView({view:"list"});e.data.driver=i;var n=t.more;if(t=i.getRecords(t),this.KI){if(this.KI=!1,t.length){var h=e.data.order,r=1;if("chat"==this.Z.mode)e.data.order=p([h[0]].concat(new Array(t.length),h.slice(1)));else{var o=e.getIndexById("$more");e.data.order=p(h.slice(0,o).concat(new Array(t.length),h.slice(o))),r=o}e.parse({data:t,pos:r}),n&&ms(this.LI).ignore(function(){s.LI.updateItem("$more",{value:n})}),"chat"==this.Z.mode&&e.showItem(e.getIdByIndex(t.length))}t.length&&n||ms(this.LI).ignore(function(){s.LI.remove("$more")})}else n&&!e.exists("$more")&&(n={id:"$more",value:n,$css:"webix_comments_more_item"},"chat"==this.Z.mode?t.unshift(n):t.push(n)),e.parse(t),"chat"==this.Z.mode&&e.showItem(e.getLastId())},$skin:function(){this.Um=Xi.inputHeight+6},getUsers:function(){return this.QI},getMenu:function(){return this.JI},setCurrentUser:function(t){this.config.currentUser=t,
  this.OI.clear(),this.LI.refresh()},edit:function(t){if(this.callEvent("onBeforeEditStart",[t])){this.XI(!0);var i=this.LI.getItem(t);this.OI.setValues(i),this.OI.focus();var s=this.OI.elements.text.getInputNode();s.scrollTop=s.scrollHeight,ot(s,i.text.length),this.callEvent("onAfterEditStart",[t])}},tA:function(t){var i=this.OI.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.LI.scrollTo(0,this.LI.getLastId())),this.OI.clear(),t&&(this.YI.getInputNode().value=""))},iA:function(t){this.OI.getValues().id==t&&this.OI.clear(),this.remove(t)},XI:function(t){if(!S.touch){var i=this.YI;t?(this.UI.getParentView().show(),i.define({height:84})):(Ii.hasFocus(this.UI)&&Ii.setFocus(this.LI),this.UI.getParentView().hide(),i.define({height:this.Um})),i.resize()}},sA:function(t){t||(t=this.YI.getValue()),t&&!this.UI.isEnabled()?this.UI.enable():!t&&this.UI.isEnabled()&&this.UI.disable()},NI:function(){var s=this;this.JI=zt({view:"contextmenu",autowidth:!0,point:!1,data:[{id:"edit",icon:"wxi-pencil",value:ct.comments.edit},{id:"remove",icon:"wxi-trash",value:ct.comments.remove}],on:{onShow:function(){var t=s.JI.getContext();s.LI.addCss(t.id,"active_menu")},onHide:function(){var t=s.JI.getContext();s.LI.removeCss(t.id,"active_menu")},onItemClick:function(t){var i=s.JI.getContext();s.callEvent("onBeforeMenuAction",[t,i.id])&&("edit"==t?s.edit(i.id):"remove"==t&&(ct.comments.confirmMessage?Ze({text:ct.comments.confirmMessage,callback:function(t){t&&s.iA(i.id)}}):s.iA(i.id)))}}}),this.ht.push(this.JI)},jI:function(){var n=this,t=ct.comments;return{view:"form",minHeight:50,paddingX:10,elements:[{view:"textarea",css:"webix_comments_textarea",height:this.Um,name:"text",placeholder:t.placeholder,keyPressTimeout:100,on:{onTimedKeyPress:function(){n.sA()},onChange:function(t){n.sA(t)},onKeyPress:function(t,i){if(13==t){var s=n.Z.sendAction,e=i.shiftKey;("enter"==s&&!e||"enter"!==s&&e)&&(Q(i),n.tA(!0))}}}},{hidden:!S.touch,cols:[{},{view:"button",disabled:!0,css:"webix_comments_send",type:"form",value:t.send,autowidth:!0,click:function(){n.tA()}}]}]}},RI:function(t){var r=this,o="webix_comments_",s={height:"auto",templateStatus:function(t){return"<span class = '"+o+"status "+t.status+"'></span>"},templateUser:function(t){var i=r.getUsers(),s=i&&i.exists(t.user_id)?i.getItem(t.user_id):{};return"<span class = '"+o+"name'>"+(s.value||"")+"</span>"},templateMenu:function(){return"<span class='webix_icon wxi-dots "+o+"menu'></span>"},templateDate:function(t){var i=tn.dateToStr("%d %M, %H:%i");return t.date?"<span class='"+o+"date'>"+i(t.date)+"</span>":""},templateLinks:function(t){return t.text.replace(/(https?:\/\/[^\s]+)/g,function(t){var i="<a target='_blank' href='"+(t=At.escape(t))+"'>";return t.match(/.(jpg|jpeg|png|gif)$/)?i+="<img class='webix_comments_image' src='"+t+"'/>":i+=t,i+"</a>"})},templateMentioned:function(t){if(!r.eA[t.id])return t.text;for(var i=r.ZI.Z.textValue||"value",s=r.eA[t.id],e=0;e<s.length;e++){var n=r.QI.getItem(s[e])[i];t.text=t.text.replace(new RegExp("@"+n,"g"),"<span class='webix_comments_mention'>@"+n+"</span>")}return t.text},templateText:function(t,i){return r.Z.mentions&&r.eA&&((t=m(t)).text=i.templateMentioned(t,i)),"<div class = '"+o+"message'>"+i.templateLinks(t)+"</div>"},templateAvatar:function(t,i){var s="<div class='"+o+"avatar'>",e=r.getUsers(),n=e&&e.exists(t.user_id)?e.getItem(t.user_id):{};if(n.status&&(s+=i.templateStatus(n)),s+="<div class='"+o+"avatar_image ",n.image)s+="'><img src = '"+n.image+"' class='"+o+"photo'>";else{var h=n.value?n.value[0].toUpperCase():"<span class='webix_icon wxi-user'></span>";s+=o+"avatar_text'>"+h}return s+="</div></div>"},template:function(t,i){var s;if("$more"==t.id)s="<div class='webix_comments_more'>"+r.Z.moreButton(t)+"</div>";else{var e=i.templateAvatar(t,i),n=i.templateUser(t,i),h=i.templateDate(t,i);s=e+n+i.templateMenu(t,i)+h+i.templateText(t,i)}return s},classname:function(t,i,s){var e=Zh.api.type.classname(t,i,s);return(
  t.user_id&&t.user_id==r.Z.currentUser||!r.QI.count())&&(e+=" webix_comments_current"),e}};s=P.extend(s,t.listItem||{},!0);var i={$init:function(t){t.date&&(t.date=ct.parseFormatDate(t.date))}};i=P.extend(i,t.scheme||{},!0);var e={view:"list",navigation:!1,type:s,scheme:i,onClick:{webix_comments_menu:function(t,i){r.JI.isVisible()?r.JI.hide():(r.JI.setContext({obj:r,id:i}),r.JI.show(t.target,s.menuPosition||{pos:"left",y:30,x:10}))},webix_comments_more:function(){if(r.config.url&&r.callEvent("onDataRequest",[])){r.KI=!0;var t=r.LI.getItem("$more").value,i="chat"==r.Z.mode?t:r.LI.getIndexById("$more"),s=fi.$parse(r.config.url),e={error:function(){r.KI=!1}};"string"==typeof s&&(s=s+(s.indexOf("?")<0?"?":"&")+"pos="+i+"&more="+t),r.load(s,e,{pos:i,more:t})}}},on:{onAfterScroll:C(function(){this.JI.hide()},this)}};return t.save&&(e.save=t.save),e},EI:function(t){var e=this;t&&t.getItem?this.QI=t:(this.QI=new Dh,this.ht.push(this.QI),t&&"string"==typeof t?this.QI.load(t):this.QI.parse(t||[])),this.QI.data.attachEvent("onStoreUpdated",function(t,i,s){e.Z.mentions&&s&&"paint"!==s&&e.LI.data.each(function(t){e.nA(t,!0)}),e.LI.refresh()})},WI:function(t){var e=this;this.eA={},this.hA(t),mt.all([this.LI.waitData,this.QI.waitData]).then(function(){e.LI.data.each(function(t){return e.nA(t)}),e.LI.refresh()}),this.LI.data.attachEvent("onStoreUpdated",function(t,i,s){!t||"add"!==s&&"update"!==s||(e.nA(i,!0),e.LI.refresh(t))})},hA:function(t){var e=this,i="object"!=k(t)?{}:t;"object"!==k((i=P.extend({view:"suggest",filter:function(t,i){if(-1===(i=i.substring(0,e.rA)).indexOf("@"))return!1;if((i=i.substring(i.lastIndexOf("@")+1)).length){var s=e.ZI.getList().type;return-1!==s.template(t,s).toString().toLowerCase().indexOf(i.toLowerCase())}return!1}},i)).body)?i.body={data:this.QI}:i.body.data=this.QI,this.ZI=zt(i),this.ZI.Jg=!1,this.YI.$setValueHere=function(){},this.YI.setValueHere=function(t){if(t){var i=e.YI.getValue(),s=i.substring(e.rA);i=(i=i.substring(0,e.rA)).substring(0,i.lastIndexOf("@")+1)+t,e.YI.setValue(i+s),ot(e.YI.getInputNode(),i.length),e.rA=i.length}},this.ht.push(this.ZI),this.YI.attachEvent("onAfterRender",function(){e.ZI.linkInput(e.YI),e.ZI.getList().data.attachEvent("onBeforeFilter",function(){e.rA=at(e.YI.getInputNode()).start})})},nA:function(o,t){var a=this,i=o.id,u={},c=this.ZI.Z.textValue||"value";this.QI.data.each(function(t){for(var i="@"+t[c],s=o.text,e=s.indexOf(i),n=0;-1!==e;){var h=n+e;if(u[h]){var r=a.QI.getItem(u[h])[c];i.length>r.length+1&&(u[h]=t.id)}else u[h]=t.id;n+=e+i.length,e=(s=s.substring(e+i.length)).indexOf(i)}});var s=this.eA[i],e=[];for(var n in u)-1===e.indexOf(u[n])&&(e.push(u[n]),!t||s&&-1!==s.indexOf(u[n])||this.callEvent("onUserMentioned",[u[n],i]));e.length?(this.eA[i]=e).sort(function(t,i){return t=a.QI.getItem(t)[c],i=a.QI.getItem(i)[c],t.length===i.length?0:t.length>i.length?-1:1}):delete this.eA[i]}}),So=(P.protoUI(Mo,li,$n.view),{name:"menu",Hb:"webix_menu",$init:function(t){this.data.Yr=C(function(t){t.disabled&&this.data.addMark(t.id,"webix_disabled",!0,1,!0)},this),t.autowidth&&(this.oA=!0,delete t.autowidth),this.data.attachEvent("onStoreUpdated",C(function(){this.Cu()},this)),this.attachEvent("onMouseMove",this.aA),this.attachEvent("onMouseOut",function(t){this.uA()&&"click"==this.Z.openAction||!this.cA&&t.relatedTarget&&this.Cu()}),this.attachEvent("onItemClick",function(t,i,s){var e=this.getItem(t);if(e){if(e.$template)return;var n=this.getTopMenu();if(!this.data.getMark(t,"webix_disabled")){if(!n.callEvent("onMenuItemClick",[t,i,s]))return void(i.showpopup=!0);this!=n&&n.xc(t,i,s),e.submenu||n.fA?((S.touch||this===n&&"click"==n.Z.openAction)&&this.Du(t,s),i.showpopup=!0):(n.Cu(!0),n.lA&&n.hide())}}}),this.attachEvent("onKeyPress",function(t){if(9===t)this.getTopMenu().Cu();else if(13===t||32===t){var i,s=this.getSelectedId();s&&(i=this.getItemNode(s)),i&&it(i,"MouseEvents","click")}}),this.data.attachEvent("onClearAll",function(){this.dA=[]}),this.data.dA=[],this.et.setAttribute("role","menubar"),this.ht=[]},sizeToContent:function(){if("y"==this.Z.layout){var i=[],s=!1
  ;this.data.each(function(t){i.push(this.Ot(t)),t.submenu&&(s=!0)},this),this.config.width=nt(i,this.$view.className).width+16+2+(s?15:0),this.resize()}},getTopMenu:function(){for(var t=this;t.ku;)t=Pt(t.ku);return t},Eb:function(t){this.Z.autoheight&&(t=this.count());for(var i=this.count(),s=0,e=0;e<t;e++){var n=this.data.pull[this.data.order[e]];n&&"Separator"==n.$template?(s+=4,this.Z.autoheight||t++):s+=this.type.height}return this.Ic(t&&t<i,"y"),s},on_mouse_move:{},type:{vA:function(t){return t.submenu||t.data||t.item},css:"menu",width:"auto",aria:function(t,i,s){return'role="menuitem"'+(s&&s.webix_selected?' aria-selected="true" tabindex="0"':'tabindex="-1"')+(i.vA(t)?'aria-haspopup="true"':"")+(s&&s.webix_disabled?' aria-disabled="true"':"")},templateStart:function(t,i,s){if("Separator"===t.$template||"Spacer"===t.$template)return'<div webix_l_id="#id#" role="separator" tabindex="-1" class="webix_context_'+t.$template.toLowerCase()+'">';var e=(t.href?" href='"+t.href+"' ":"")+(t.target?" target='"+t.target+"' ":"");return Zh.api.type.templateStart(t,i,s).replace(/^<div/,"<a "+e)+(i.vA(t)&&i.subsign?"<div class='webix_submenu_icon'></div>":"")},templateEnd:function(t){return"Separator"===t.$template||"Spacer"===t.$template?"</div>":"</a>"},templateSeparator:At("<div class='sep_line'></div>"),templateSpacer:At("<div></div>")},getMenu:function(t){if(this.data.pull[t])return this;for(var i in this.data.pull){var s=this.getItem(i);if(s.submenu){var e=this._A(s).getMenu(t);if(e)return e}}},getSubMenu:function(t){var i=this.getMenu(t),s=i.getItem(t);return s.submenu?i._A(s):null},getMenuItem:function(t){return this.getMenu(t).getItem(t)},_A:function(t){var i=Pt(t.submenu);return i||(t.submenu=this.pA(t),i=Pt(t.submenu)),i},aA:function(t,i,s){this.uA()&&this.Du(t,s)},uA:function(){if(S.touch)return!1;var t=this.getTopMenu();if("click"!=t.Z.openAction)return!0;var i=t.mA;return!(!i||!Pt(i).isVisible())},Du:function(t,i){var s=this.getItem(t);if(s&&(this.cA=null,this.mA&&s.submenu!=this.mA&&this.Cu(!0),this.type.vA(s)&&!this.config.hidden)){var e=this._A(s);if(this.data.getMark(t,"webix_disabled"))return;e.show(i,{pos:this.Z.subMenuPos}),e.ku=this.Z.id,this.mA=s.submenu}},disableItem:function(t){this.getMenu(t).addCss(t,"webix_disabled")},enableItem:function(t){this.getMenu(t).removeCss(t,"webix_disabled")},bA:function(t,i){var s=this.data;s.dA[t]!=i&&(s.dA[t]=i,s.filter(function(t){return!s.dA[t.id]}),this.resize())},hideItem:function(t){var i=this.getMenu(t);i&&i.bA(t,!0)},showItem:function(t){var i=this.getMenu(t);if(i)return i.bA(t,!1),Zh.api.showItem.call(i,t)},Cu:function(t){if(this.mA){var i=Pt(this.mA);i.Cu&&i.Cu(t),!t&&i.hh||(i.hide(),this.mA=null)}},pA:function(t){var i={view:"submenu",data:this.type.vA(t)},s=this.getTopMenu().Z.submenuConfig;s&&P.extend(i,s,!0);var e=this.getMenuItem(t.id);e&&e.config&&P.extend(i,e.config,!0);var n=zt(i);return this.ht.push(n),n.ku=this,n.Z.id},$u:function(t,i,s){var e=this.getItem(t);if("Separator"==e.$template||"Spacer"==e.$template||this.data.getMark(t,"webix_disabled")){var n=this.getIndexById(t)+("up"==s?-1:1);return(t=0<=n?this.getIdByIndex(n):null)?this.$u(t,i,s):i}return t},$skin:function(){Zh.api.$skin.call(this),this.type.height=Xi.menuHeight},defaults:{scroll:"",layout:"x",mouseEventDelay:100,subMenuPos:"bottom"}}),ko={api:So,view:P.protoUI(So,Zh.view)},Co={name:"submenu",$init:function(){this.q=f(this.gA),(this.q.rt=this).attachEvent("onMouseOut",function(t){"click"!=this.getTopMenu().Z.openAction&&(this.cA||this.hh||!t.relatedTarget||this.hide())}),this.attachEvent("onMouseMoving",function(){this.ku&&(Pt(this.ku).cA=!0)}),this.attachEvent("onBeforeShow",function(){this.getTopMenu().oA&&this.sizeToContent&&!this.isVisible()&&this.sizeToContent()}),this.mt.setAttribute("role","menu")},$skin:function(){ko.api.$skin.call(this),sh.api.$skin.call(this),this.type.height=Xi.menuHeight},gA:{$getSize:function(t,i){var s=1*this.rt.Z.height,e=1*this.rt.Z.width,n=ko.api.$getSize.call(this.rt,t,i);return this.rt.Z.height=s,this.rt.Z.width=e,n},$setSize:function(t,i){
  this.rt.Z.scroll&&(this.rt.En.style.height=i+"px")},destructor:function(){this.rt=null}},body_setter:function(){},getChildViews:function(){return[]},defaults:{width:150,subMenuPos:"right",layout:"y",autoheight:!0},type:{height:Xi.menuHeight,subsign:!0}},$o={api:Co,view:P.protoUI(Co,ko.view,sh.view)},Do={name:"sidemenu",defaults:{animate:!0,position:"left",width:200,borderless:!0},$init:function(){this.$view.className+=" webix_sidemenu"},$skin:function(){this.defaults.padding=0},position_setter:function(t){var i=this.Z.position;return i&&et(this.$view," webix_sidemenu_"+i),st(this.$view," webix_sidemenu_"+t),t},$getSize:function(){var t=rs.api.$getSize.apply(this,arguments);return this.wA=t},$setSize:function(t,i){Li.api.$setSize.call(this,t,i),t=this.$s-2*this.Z.padding,i=this.Is-2*this.Z.padding,this.Zi.style.padding=this.Z.padding+"px",this.Mn.style.display="none",this.En.style.height=i+"px",this.q.$setSize(t,i)},show:function(){if(!this.callEvent("onBeforeShow",arguments))return!1;this.Z.hidden=!1,this.et.style.zIndex=this.Z.zIndex||yi(),(this.Z.modal||this.Ln)&&(this.Sn(!0),this.Ln=null),this.et.style.display="block",this.Fs(),this.Z.position&&this.Wn(),this.Gn=1,$(function(){this.Gn=0},this,[],S.touch?400:100),this.config.autofocus&&(this.Xn=Ii.getFocus(),Ii.setFocus(this)),-1==M.qi.find(this)&&M.qi.push(this),this.callEvent("onShow",[])},Wn:function(t){var i,s,e,n,h,r=0,o=0,a={};this.$view.style.position="fixed",e=document.documentElement.offsetWidth,n=document.documentElement.offsetHeight,i=this.wA[0]||e,s=this.wA[2]||n,"top"==(h=this.Z.position)?i=e:"right"==h?(s=n,r=e-i):"bottom"==h?(i=e,o=n-s):s=n,a={left:r,top:o,width:i,height:s,maxWidth:e,maxHeight:n},"function"==typeof this.Z.state&&this.Z.state.call(this,a),this.xA=a,this.$setSize(a.width,a.height),void 0===t&&this.yA()?(et(this.$view,"webix_animate"),this.fC[this.Z.position].beforeShow.call(this,a),$(function(){st(this.$view,"webix_animate",!0)},this,null,1),$(function(){this.fC[this.Z.position].show.call(this,a)},this,null,10)):("right"===this.Z.position&&(a.left=a.right?e-a.width-a.right:e-a.width),this.setPosition(a.left,a.top))},xA:{},yA:function(){return Gi.isSupported()&&this.Z.animate&&!(S.isIE&&-1!=navigator.appVersion.indexOf("MSIE 9"))},hidden_setter:function(t){return t?this.hide():this.show(),!!t},fC:{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.En.style.height="0px"},show:function(t){this.$view.style.height=t.height+"px",this.En.style.height=t.height+"px"},hide:function(){this.$view.style.height="0px",this.En.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"}}},qn:function(){var t=document.documentElement.offsetWidth,i=document.documentElement.offsetHeight;if(this.yA()&&t==this.xA.maxWidth&&i==this.xA.maxHeight){this.fC[this.Z.position].hide.call(this,this.xA);var s=Lt(this.$view,S.transitionEnd,C(function(){this.Kn(),Ot(s)},this))}else this.Kn()}},Io=(P.protoUI(Do,sh.view),{name:"sidebar",defaults:{type:"sideBar",activeTitle:!0,select:!0,scroll:!1,collapsed:!1,collapsedWidth:44,position:"left",width:250,mouseEventDelay:10},$skin:function(){this.defaults.titleHeight=Xi.sidebarTitleHeight},$init:function(){this.$view.className+=" webix_sidebar",this.$ready.push(this.MA),this.$ready.push(this.SA),this.data.Yr=function(t){t.data?t.menu=m(t.data
  ):t.item&&(t.menu=m(t.item.length?t.item:[t.item]))}},on_context:{},on_mouse_move:{},MA:function(){this.kA=this.config.width,this.attachEvent("onBeforeOpen",function(t){if(!this.config.multipleOpen)for(var i=this.getOpenItems(),s=0;s<i.length;s++)this.getParentId(t)==this.getParentId(i[s])&&this.close(i[s]);return!this.config.collapsed}),this.attachEvent("onItemClick",function(t,i,s){this.getPopup()&&!this.getPopup().config.hidden&&(i.showpopup=!0),S.touch&&this.CA(t,s)}),this.attachEvent("onBeforeSelect",function(t){return!this.getItem(t).$count&&(this.clearCss("webix_sidebar_selected"),!0)}),this.attachEvent("onAfterSelect",function(t){this.$A(this,t,!Xi.sidebarMarkAll),this.getPopup().DA(t)}),this.attachEvent("onMouseMove",function(t,i,s){this.CA(t,s)}),this.config.collapsed&&this.collapse()},CA:function(t,i){if(this.config.collapsed){var s=this.getPopup();s&&(this.IA(t),this.AA(t),s.show(i,{x:"left"==this.config.position?this.config.collapsedWidth:-s.config.width,y:-1}))}},IA:function(t){var i=this.getPopup().getBody().getChildViews()[0];if(i&&i.masterId!=t){var s=this.getSelectedId();i.masterId=t,i.parse(this.getItem(t)),s&&this.getParentId(s)==t?st(i.$view,"webix_sidebar_selected",!0):et(i.$view,"webix_sidebar_selected"),s==t?st(i.$view,"webix_selected",!0):et(i.$view,"webix_selected")}},AA:function(t){var i=this.getPopup().getBody().getChildViews()[1];if(i&&i.masterId!=t){this.exists(i.masterId)&&this.getItem(i.masterId).menu&&this.updateItem(i.masterId,{menu:i.data.serialize()}),i.clearCss("webix_sidebar_selected"),i.masterId=t;var s=this.getSelectedId(),e=m(this.getItem(t).menu||[]);i.unselect(),e.length?(i.show(),i.data.importData(e),i.exists(s)?i.select(s):s&&this.$A(i,s)):(i.hide(),i.data.clearAll())}},SA:function(){var s,n=this,e=n.config;if(e.popup&&(s=Pt(e.popup)),!s){var t="left"==e.position?"webix_sidebar_popup_left":"webix_sidebar_popup_right",i="left"==e.position?"right":"left",h=function(t){var i="wxi-angle-"+("left"==e.position?"right":"left");return(t.submenu||t.data||t.item?'<div class="webix_icon '+i+'"></div>':"")+t.value},r=e.css?" "+e.css:"",o={view:"popup",css:"webix_sidebar_popup "+t+r,autofit:!1,width:this.kA-this.config.collapsedWidth,borderless:!0,padding:0,body:{rows:[{view:"template",borderless:!0,css:"webix_sidebar_popup_title",template:"#value#",height:this.config.titleHeight+2,onClick:{webix_template:function(){var t=this.masterId;n.getItem(t).$count||n.select(t)}}},{view:"menu",submenu:"data",layout:"y",subMenuPos:i,select:!0,borderless:!0,autoheight:!0,css:"webix_sidebar_popup_list "+t+r,template:h,type:{subsign:!1},submenuConfig:{padding:0,subMenuPos:i,template:h,select:!0,type:{subsign:!1},css:"webix_sidebar_popup_list "+t+r,on:{onShow:function(){this.clearCss("webix_sidebar_selected"),this.unselectAll();var t=n.getSelectedId();t&&this.exists(t)?this.select(t):t&&n.$A(this,t)},onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onAfterSelect:function(t){for(var i=n.getPopup().queryView({view:"menu"}),s=n.getParentId(t);s;){var e=i.getMenu(s);e&&(e.unselectAll(),n.$A(e,t)),s=n.getParentId(s)}n.$A(this,t)}}},on:{onBeforeSelect:function(t){if(this.getSubMenu(t))return!1},onMenuItemClick:function(t){this.getSubMenu(t)||n.select(t)}}}]}};P.extend(o,e.popup||{},!0),(s=zt(o)).DA=function(t){if(n&&n.getParentId(t)==this.masterId&&st(this.$view,"webix_sidebar_selected",!0),n.config.collapsed&&1==n.getItem(t).$level){var i=s.getBody().getChildViews()[0];i&&st(i.$view,"webix_selected",!0)}},s.queryView({view:"menu"}).fA=!0}s.attachEvent("onBeforeShow",function(){return e.collapsed}),this.ht=[s],e.popupId=s.config.id,Nt(document.body,"mousemove",function(t){var i=t.target||t.srcElement;s.config.hidden||s.$view.contains(i)||this.$view.firstChild.contains(i)||s.queryView({view:"menu"}).mA||s.hide()},{bind:this})},$A:function(i,s,e){var n="webix_sidebar_selected";i.data.each(function(t){!this.TA(s,t.id)||e&&"0"!=this.getParentId(t.id)?i.hasCss(t.id,n)&&i.removeCss(t.id,n):i.addCss(t.id,n)},this)},TA:function(t,i){var s=this.getParentId(t);return i==s||!!s&&this.TA(s,i)},getPopup:function(
  ){return Pt(this.config.popupId)},position_setter:function(t){var i=t,s="left"==t?"right":"left";et(this.$view,"webix_sidebar_"+s),st(this.$view,"webix_sidebar_"+i,!0);var e=this.getPopup();if(e){var n=e.$view;et(n,"webix_sidebar_popup_"+s),st(n,"webix_sidebar_popup_"+i,!0)}return t},collapse:function(){this.define("collapsed",!0)},expand:function(){this.define("collapsed",!1)},toggle:function(){var t=!this.config.collapsed;this.define("collapsed",t)},collapsed_setter:function(t){var i;return t?(i=this.config.collapsedWidth,this.closeAll(),this.type.collapsed=!0,et(this.$view,"webix_sidebar_expanded")):(i=this.kA,this.type.collapsed=!1,st(this.$view,"webix_sidebar_expanded",!0)),this.define("width",i),this.resize(),t},getState:function(){var t={collapsed:this.config.collapsed};return P.extend(t,ce.getState.call(this)),t},setState:function(t){ce.setState.call(this,t),this.define("collapsed",t.collapsed)}});Tt(go.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="",s=1;s<=t.$level;s++){if(s==t.$level&&t.$count)i+="<span class='"+("webix_sidebar_dir_icon webix_icon "+("wxi-angle-"+(t.open?"down":"left")))+"'></span>"}return i},icon:function(t){var i="";return 2<t.$level&&(i='style="padding-left:'+40*(t.$level-2)+'px"'),t.icon?"<span class='webix_icon webix_sidebar_icon "+t.icon+"' "+i+"></span>":"<span "+i+"></span>"}});P.protoUI(Io,go.view),P.protoUI({name:"context"},os,sh.view);var Ao={name:"contextmenu",lA:!0,$init:function(t){t.submenuConfig&&P.extend(t,t.submenuConfig)}},To=(P.protoUI(Ao,os,$o.view),{name:"treetable",$init:function(){for(var t in P.extend(this.data,pe,!0),P.extend(this.type,be),P.extend(this,de,!0),fe)this.on_click[t]||(this.on_click[t]=this.FA(fe[t]));this.type.treetable=At("{common.space()}{common.icon()} {common.folder()}"),this.type.treecheckbox=function(t){return t.indeterminate&&!t.nocheckbox?"<div class='webix_tree_checkbox webix_indeterminate'></div>":be.checkbox.apply(this,arguments)},this.data.provideApi(this,!0),this.et.setAttribute("role","treegrid")},Qo:!1,FA:function(s){return function(t,i){return i=i.row,s.call(this,t,i)}},qo:function(t){for(var i=this.Z.prerender?t.source:[t.start],s=0;s<i.length;s++)this.close(i[s])},getState:function(){var t=xs.getState.call(this);return P.extend(t,ce.getState.call(this)),t},setState:function(t){ce.setState.call(this,t)&&xs.setState.call(this,t)},clipboard_setter:function(t){return P.extend(this.ah,me),ue.clipboard_setter.call(this,t)},vl:function(t,i){for(var s=0;s<t.start;s++){var e=this.data.order[s];e&&1!=this.getItem(e).$level&&t.start--}return Vr.api.vl.call(this,t,i)}}),Fo=(P.protoUI(To,ce,_e,le,Vr.view),P.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(t){this.data=t||{};var i=t&&t.id?t.id:z();this.Z={id:i},zt.views[i]=this},getValues:function(){return this.data},setValues:function(t,i){this.data=i?P.extend(this.data,t,!0):t,this.callEvent("onChange",[t])},refresh:function(){this.callEvent("onBindRequest")}},w,Hi,li,Ai)),zo=P.proto({name:"DataValue",isVisible:function(){return!0},$init:function(t){t&&!j(t.value)||(this.data=t||"");var i=t&&t.id?t.id:z();this.Z={id:i},zt.views[i]=this},setValue:function(t){this.data=t,this.callEvent("onChange",[t])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},w,Hi),Vo=P.proto({name:"TreeCollection",$init:function(){P.extend(this.data,pe,!0),this.data.provideApi(this,!0),P.extend(this,de,!0)}},le,Dh);P.Date=tn,P.Number=sn,P.promise=mt,P.DataCollection=Dh,P.DataRecord=Fo,P.DataValue=zo,P.TreeCollection=Vo,P.ActiveContent=Ut,P.AtomDataLoader=li,P.AtomRender=di,P.AutoScroll=vi,P.AutoTooltip=Yi,P.BaseBind=Hi,P.BindSource=Bi,P.Canvas=Wi,P.CodeParser=xt,P.CollectionBind=Fi,P.ContextHelper=os,P.CopyPaste=us,P.CustomPrint=cs,P.CustomScroll=fs,P.DataMarks=ls,P.DataMove=ds,P.DataLoader=ws,P.DataState=xs,P.DataStore=gs,P.Destruction=Ti,P.DragControl=is,P.DragItem=ys,P.DragOrder=Ms,P.EditAbility=Ds,P.EventSystem=w,P.FlexLayout=Is,
  P.Group=Fs,P.GroupMethods=As,P.GroupStore=Ts,P.HTMLOptions=zs,P.HtmlMap=Vs,P.IdSpace=Bs,P.KeysNavigation=Hs,P.MapCollection=Rs,P.Modality=es,P.MouseEvents=Ps,P.Movable=ss,P.NavigationButtons=js,P.OverlayBox=Es,P.PagingAbility=Ns,P.ProgressBar=Ls,P.RecordBind=Vi,P.RenderStack=Os,P.ResizeArea=ns,P.SingleRender=Oi,P.Scrollable=Us,P.SelectionModel=Ys,P.Settings=Ai,P.Sparklines=oe,P.TablePaste=ue,P.TooltipControl=_i,P.Touch=Ki,P.TreeAPI=ce,P.TreeClick=fe,P.TreeDataLoader=le,P.TreeDataMove=de,P.TreeRenderStack=ve,P.TreeStateCheckbox=_e,P.TreeStore=pe,P.TreeTablePaste=me,P.TreeType=be,P.UIManager=Ii,P.Undo=Ss,P.UploadDriver=ge,P.ValidateCollection=we,P.ValidateData=_s,P.ValueBind=zi,P.Values=xe,P.VirtualRenderStack=ye,P.VRenderStack=Me,P.html=vn,P.skin=qi,P.debug=function No(t){if(t)if("object"!==k(t))c={events:!0};else for(var i in t)c[i]=t[i];else c={}},P.i18n=ct,P.ready=Mi,P.env=S,P.color=Ws,P.csv=ae,P.clipbuffer=as,P.history=nn,P.storage=ri,P.template=At,P.type=Tt,P.markup=hn,P.editors=$s,P.animate=Gi,P.print=function(t,i){var s=Pt(t);s&&s.$printView&&(s=s.$printView()),s&&(s.callEvent&&s.callEvent("onBeforePrint",[i]),function e(t){st(document.body,"webix_print"),t.docHeader&&fn("Header",t),t.docFooter&&fn("Footer",t),O("@media print { @page{ size:"+t.paper+" "+t.mode+";margin-top:"+t.margin.top+"px;margin-bottom:"+t.margin.bottom+"px;margin-right:"+t.margin.right+"px;margin-left:"+t.margin.left+"px;}}","print")}(i=function n(t){return(t=t||{}).paper=on[(t.paper||"").toLowerCase()]||"A4",t.mode=un[t.mode]?t.mode:"portrait",t.fit=an[t.fit]?t.fit:"page",t.scroll=t.scroll||!1,t.size=cn[t.paper],t.margin=t.margin||0===t.margin?t.margin:{},rn=isNaN(1*t.margin)?rn:t.margin,t.margin={top:t.margin.top||0===t.margin.top?t.margin.top:rn,bottom:t.margin.bottom||0===t.margin.bottom?t.margin.bottom:rn,right:t.margin.right||0===t.margin.right?t.margin.right:rn,left:t.margin.left||0===t.margin.left?t.margin.left:rn},t}(i)),s.$customPrint&&!0!==s.$customPrint(i)||function r(t,i){var s=t.$view.cloneNode(!0),e=t.$view.getElementsByTagName("canvas");if(e.length)for(var n=e.length-1;0<=n;n--){var h=s.getElementsByTagName("canvas")[n].getContext("2d");h.drawImage(e[n],0,0)}X(s,i.docFooter,document.body),st(s,"webix_ui_print"),!i.scroll&&(t.mt&&t.data&&t.data.pull||t.getBody)&&st(s,"webix_print_noscroll"),window.print(),G(s)}(s,i),function h(t){et(document.body,"webix_print"),U("print"),t.docHeader&&G(t.docHeader),t.docFooter&&G(t.docFooter)}(i))},P.rules=vs,P.patterns=ln,P.fullscreen=dn,P.version="6.4.1",P.name="core",P.level_in=function Lo(){0},P.level_out=function Oo(){0},P.clone=f,P.copy=m,P.single=function Uo(t){var i=null;return function(){return i||(i=new t({})),i.zA&&i.zA.apply(i,arguments),i}},P.bind=C,P.exec=_,P.wrap=function Yo(i,s){return i?function(){var t=i.apply(this,arguments);return s.apply(this,arguments),t}:s},P.isUndefined=j,P.delay=$,P.once=l,P.uid=z,P.toNode=D,P.toArray=p,P.toFunctor=b,P.isArray=g,P.isDate=y,P.PowerArray=x,P.VA=Et,P.BA=Nt,P.event=Lt,P.eventRemove=Ot,P.callEvent=A,P.attachEvent=T,P.detachEvent=F,P.blockEvent=function(){return I.blockEvent()},P.unblockEvent=function(){return I.unblockEvent()},P.mapEvent=function(t){return I.mapEvent(t)},P.hasEvent=function(t){return I.hasEvent(t)},P.stringify=ft,P.toPNG=function(e,n){var h=mt.defer();return ei(S.cdn+"/extras/html2canvas-1.0.min.js").then(function(){"string"==typeof n&&(n={filename:n}),n=n||{};var t=Pt(e);if(t&&t.$exportView&&(t=t.$exportView(n)),!t)return h.reject(Se);var i=t?t.$view:D(e),s=(n.filename||"Data")+".png";return window.html2canvas(i,{background:"#fff",logging:!1}).then(function(i){var t=function(t){!1!==n.download&&ht(t,s),i.remove(),h.resolve(t)};i.msToBlob?t(i.msToBlob()):i.toBlob(t,"image/png")}),h})},P.toCSV=function(t,i){i=i||{};var s=Pt(t);if(s&&s.$exportView&&(s=s.$exportView(i)),!s)return mt.reject(Se);i.export_mode="csv",i.filterHTML=!0;var e=Ce(s,i),n=function o(t){return ae.stringify(t)}($e(s,i,e)),h=(i.filename||"Data")+".csv",r=new Blob(["\ufeff"+n],{type:"text/csv"});return!1!==i.download&&ht(r,h),mt.resolve(r)},P.toPDF=function(r,
  o){return ei([S.cdn+"/extras/pdfjs.js",S.cdn+"/extras/html2canvas-1.0.min.js"]).then(function(){(o=o||{}).export_mode="pdf",o.wl=De,o.fontName=o.fontName||"pt-sans.regular",o.display=o.display||"table",r=g(r)?r:[r];for(var s=[],t=0;t<r.length;t++){r[t].id||(r[t]={id:r[t]});var i=Pt(r[t].id),e=P.extend(r[t].options||{},o);if(i&&i.$exportView&&(i=i.$exportView(e)),i&&("table"!==e.display&&(s.push({node:i.$view,viewOptions:e}),o.autowidth&&(o.width=Math.max(o.width||0,i.$view.$width))),"image"!==e.display&&i.data&&i.data.pull)){var n=Ce(i,e);s.push({scheme:n,data:$e(i,e,n),viewOptions:e}),o.autowidth&&Fe(n,o)}}if(0==s.length)return mt.reject(Se);if(De[o.fontName])return o.wl=De[o.fontName],Ae(s,o).then(function(t){return Ie(t,o)});var h=mt.defer();return pdfjs.load(S.cdn+"/extras/"+o.fontName+".ttf",function(t,i){if(t)throw t;o.wl=De[o.fontName]=new pdfjs.TTFFont(i),h.resolve(Ae(s,o).then(function(t){return Ie(t,o)}))}),h})},P.toExcel=Ve,P.alert=function Wo(){var t=Je.apply(this,arguments);return t.type=t.type||"alert",We(t)},P.confirm=Ze,P.modalbox=qe,P.message=Ke,P.editStop=function Go(){A("onEditEnd",[])},P.ajax=wt,P.jsonp=pn,P.DataDriver=hi,P.dp=ms,P.DataProcessor=bs,P.remote=wn,P.require=ei,P.proxy=fi,P.send=function Xo(t,i,s,e){var n=Y("FORM",{target:e||"_self",action:t,method:s||"POST"},"");for(var h in i){var r=Y("INPUT",{type:"hidden",name:h,value:i[h]},"");n.appendChild(r)}n.style.display="none",document.body.appendChild(n),n.submit(),document.body.removeChild(n)},P.ui=zt,P.$$=Pt,Object.defineProperty(P,"HA",{value:!0})});
  //# sourceMappingURL=webix.js.map
  