/*
    *
    * Wijmo Library 5.20173.409
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();define(["require","exports","wijmo/wijmo"],function(t,e,n){"use strict";function r(t,e){return null==t?null:o(e)?c(t.implementsInterface)&&t.implementsInterface(e)?t:null:t instanceof e?t:null}function i(t){return o(t)||s(t)||u(t)||h(t)}function o(t){return"string"==typeof t}function s(t){return"number"==typeof t}function a(t){return s(t)&&t==Math.round(t)}function u(t){return"boolean"==typeof t}function c(t){return"function"==typeof t}function h(t){return t instanceof Date&&!isNaN(t.getTime())}function l(t){return t instanceof Array||Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)}function p(t){return null!=t&&"object"==typeof t&&!h(t)&&!l(t)}function f(t){for(var e=t,n=0;null!=document.getElementById(e);n++)e=t+n;return e}function d(t,e,n){if(null!=t){if(o(t))switch(e){case tt.Number:var r=st.parseFloat(t,n);return isNaN(r)?t:r;case tt.Date:var i=st.parseDate(t,n);return i||n||!t||(i=new Date(t)),i&&isFinite(i.getTime())?i:t;case tt.Boolean:switch(t.toLowerCase()){case"true":return!0;case"false":return!1}return t}if(e==tt.String)return st.format(t,n)}return t}function g(t,e,n){if(n){var r=(i=t.toString()).indexOf(".");i.indexOf("e")<0&&r>-1&&(i=i.substr(0,r+1+e),t=parseFloat(i))}else{var i=t.toFixed(e);t=parseFloat(i)}return t}function _(t,e,n){return null!=t&&(null!=n&&t>n&&(t=n),null!=e&&t<e&&(t=e)),t}function m(t,e){if(e)for(var n in e)if("_"!=n[0]){v(n in t,'Unknown property "'+n+'".');var r=e[n];t._copy&&t._copy(n,r)||(t[n]instanceof ct&&c(r)?t[n].addHandler(r):!p(r)||r instanceof Element||!t[n]||"itemsSource"==n?t[n]=r:m(t[n],r))}}function v(t,e){if(!t)throw"** Assertion failed in Wijmo: "+e}function y(t,e){return void 0===e&&(e=!0),v(e&&null==t||o(t),"String expected."),t}function b(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),v(e&&null==t||s(t),"Number expected."),n&&t&&t<0)throw"Positive number expected.";return t}function C(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),v(e&&null==t||a(t),"Integer expected."),n&&t&&t<0)throw"Positive integer expected.";return t}function w(t,e){return void 0===e&&(e=!1),v(e&&null==t||u(t),"Boolean expected."),t}function E(t,e){if(void 0===e&&(e=!1),o(t)){var n=d(t,tt.Date,"r");h(n)&&(t=n)}return v(e&&null==t||h(t),"Date expected."),t}function A(t,e){return void 0===e&&(e=!0),v(e&&null==t||c(t),"Function expected."),t}function x(t,e){return void 0===e&&(e=!0),v(e&&null==t||l(t),"Array expected."),t}function M(t,e,n){return void 0===n&&(n=!1),t=r(t,e),v(n||null!=t,e+" expected."),t}function P(t,e,n){if(void 0===n&&(n=!1),null==t&&n)return null;var r=e[t];return v(null!=r,"Invalid enum value."),s(r)?r:t}function O(t,e){if(t&&t.getAttribute){var n=new RegExp("(\\s|^)"+e+"(\\s|$)");return t&&n.test(t.getAttribute("class"))}return!1}function F(t,e){if(t&&e&&t.setAttribute)for(var n=e.split(" "),r=0;r<n.length;r++){var i=n[r];if(O(t,i)){var o=new RegExp("((\\s|^)"+i+"(\\s|$))","g"),s=t.getAttribute("class");(s=s.replace(o," ").replace(/ +/g," ").trim())?t.setAttribute("class",s):t.removeAttribute("class")}}}function T(t,e){if(t&&e&&t.setAttribute)for(var n=e.split(" "),r=0;r<n.length;r++){var i=n[r];if(!O(t,i)){var o=t.getAttribute("class");t.setAttribute("class",o?o+" "+i:i)}}}function I(t,e,n){null==n&&(n=!O(t,e)),n?T(t,e):F(t,e)}function S(t,e,n,r){null!=n?r&&t.getAttribute(e)||t.setAttribute(e,n.toString()):t.removeAttribute(e)}function D(t,e,n){if(void 0===n&&(n=e),t=M(t,HTMLInputElement),H(document.body,t)&&!t.disabled&&"none"!=t.style.display)try{t.setSelectionRange(b(e),b(n),X()?null:"backward"),t.focus()}catch(t){}}function L(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function k(){var t=document.activeElement;if(t){var e=t.shadowRoot;e&&e.activeElement&&(t=e.activeElement)}return t}function R(t){for(var e=[],n=t.querySelectorAll("input,select,textarea,button,a,div"),r=0;r<n.length;r++){var i=n[r];if(i.offsetHeight>0&&i.tabIndex>-1&&!i.disabled&&!V(i,"[disabled],.wj-state-disabled")){if(X()&&!i.hasAttribute("tabindex")){if(i instanceof HTMLDivElement)continue;var o=dt.getControl(V(i,".wj-flexgrid"));if(o&&0==o.keyActionTab)continue}!dt.getControl(i)&&R(i).length||e.push(i)}}return e}function j(t){return t instanceof Element?t:o(t)?document.querySelector(t):t&&t.jquery?t[0]:null}function N(t,e){var n=document.createElement("div");return n.innerHTML=t,1==n.children.length&&(n=n.children[0]),e&&e.appendChild(n),n}function H(t,e){for(var n=e;n&&t;){if(n===t)return!0;n=n.parentNode||n.host}return!1}function V(t,e){var n=t?t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector:null;if(n)for(;t;t=t.parentNode)if(t instanceof Element&&n.call(t,e))return t;return null}function B(t,e){var n=!e;I(t,"wj-state-disabled",n),S(t,"disabled",n?"true":null);for(var r=t.querySelectorAll("input"),i=0;i<r.length;i++){var o=r[i];e?o.removeAttribute("disabled"):o.setAttribute("disabled","true")}}function z(t,e){if(t instanceof Array)for(var n=0;n<t.length;n++)z(t[n],e);else if(t&&t.style){var r=t.style;for(var i in e){var o=e[i];"number"==typeof o&&i.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(o+="px"),r[i]!=o&&(r[i]=o.toString())}}}function G(t,e,n){void 0===e&&(e=dt._ANIM_DEF_DURATION),void 0===n&&(n=dt._ANIM_DEF_STEP),t=A(t),e=b(e,!1,!0),n=b(n,!1,!0);var r=Date.now(),i=setInterval(function(){var n=Math.min(1,(Date.now()-r)/e);n=Math.sin(n*Math.PI/2),n*=n,requestAnimationFrame(function(){t(n)}),n>=1&&clearInterval(i)},n);return i}function U(t,e){e||(e={});var n=e.method?y(e.method).toUpperCase():"GET",r=null==e.async||w(e.async),i=e.data;if(null!=i&&"GET"==n){var a=[];for(var u in i){var l=i[u];h(l)&&(l=l.toJSON()),a.push(u+"="+l)}a.length&&(t+=(t.indexOf("?")<0?"?":"&")+a.join("&")),i=null}var f=new XMLHttpRequest;f.URL_DEBUG=t;var d=!1;if(null==i||o(i)||(d=p(i),i=JSON.stringify(i)),f.onload=function(){4==f.readyState&&(f.status<300?e.success&&A(e.success)(f):e.error&&A(e.error)(f),e.complete&&A(e.complete)(f))},f.onerror=function(){if(!c(e.error))throw"HttpRequest Error: "+f.status+" "+f.statusText;e.error(f)},f.open(n,t,r,e.user,e.password),e.user&&e.password&&f.setRequestHeader("Authorization","Basic "+btoa(e.user+":"+e.password)),d&&f.setRequestHeader("Content-Type","application/json"),e.requestHeaders)for(var g in e.requestHeaders)f.setRequestHeader(g,e.requestHeaders[g]);return s(e.timeout)&&(f.timeout=e.timeout),c(e.beforeSend)&&e.beforeSend(f),f.send(i),f}function Y(t,e,n){var r=0,i=0,o=0,a=0,c=null,h=null,l=null,p=n?new at(n):null;if((t=P(t,gt))==gt.CntAll)return e.length;for(var f=0;f<e.length;f++){var d=e[f];if(p&&(d=p.getValue(d)),t==gt.First)return d;null!=d&&(r++,(null==c||d<c)&&(c=d),(null==h||d>h)&&(h=d),l=d,s(d)&&!isNaN(d)?(i++,o+=d,a+=d*d):u(d)&&(i++,1==d&&(o++,a++)))}var g=0==i?0:o/i;switch(t){case gt.Avg:return g;case gt.Cnt:return r;case gt.Max:return h;case gt.Min:return c;case gt.Rng:return h-c;case gt.Sum:return o;case gt.VarPop:return i<=1?0:a/i-g*g;case gt.StdPop:return i<=1?0:Math.sqrt(a/i-g*g);case gt.Var:return i<=1?0:(a/i-g*g)*i/(i-1);case gt.Std:return i<=1?0:Math.sqrt((a/i-g*g)*i/(i-1));case gt.Last:return l}throw"Invalid aggregate type."}function q(t,e,n,r,i){void 0===e&&(e=null),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!0);var o=document.body;if(e instanceof HTMLElement){if(!H(document.body,e))return;for(var s=e;s;s=s.parentElement)if("dialog"==s.getAttribute("role")||"fixed"==getComputedStyle(s).position){o=s;break}}t.offsetHeight&&t.offsetWidth&&H(o,t)||o.lastChild!=t&&o.appendChild(t);var a=new nt(pageXOffset,pageYOffset),u=document.documentElement,c=u.clientWidth/window.innerWidth;if(o!=document.body||c>1.005){var h=o==document.body?document.documentElement:t.offsetParent,l=h.getBoundingClientRect();a=new nt(h.scrollLeft-l.left,h.scrollTop-l.top)}if(e instanceof HTMLElement&&i){var p=getComputedStyle(e);new Tt(p.backgroundColor).a&&z(t,{color:p.color,backgroundColor:p.backgroundColor,fontFamily:p.fontFamily,fontSize:p.fontSize,fontWeight:p.fontWeight,fontStyle:p.fontStyle})}z(t,{position:"absolute",display:""}),dt.refreshAll(t);var f=getComputedStyle(t),d=parseFloat(f.marginTop)+parseFloat(f.marginBottom),g=parseFloat(f.marginLeft)+parseFloat(f.marginRight),_=new rt(t.offsetWidth+g,t.offsetHeight+d),m=new nt,v=null,y=u.clientWidth,b=u.clientHeight;if(e&&null!=e.clientX&&null!=e.clientY&&null!=e.pageX&&null!=e.pageY)e.clientX<=0&&e.clientY<=0&&e.target?v=e.target.getBoundingClientRect():(m.x=Math.max(0,e.pageX-pageXOffset),m.y=Math.max(0,e.pageY-pageYOffset));else if(e instanceof nt)m=e;else if(e instanceof HTMLElement)v=e.getBoundingClientRect();else if(e&&null!=e.top&&null!=e.left)v=e;else{if(null!=e)throw"Invalid ref parameter.";m.x=Math.max(0,(y-_.width)/2),m.y=Math.max(0,Math.round((b-_.height)/2*.7))}var C=parseFloat(f.minWidth);if(v){var w=v.top,E=b-v.bottom,A="rtl"==getComputedStyle(t).direction;m.x=A?Math.max(0,v.right-_.width):Math.max(0,Math.min(v.left,y-_.width)),m.y=n?w>_.height||w>E?Math.max(0,v.top-_.height):v.bottom:E>_.height||E>w?v.bottom:Math.max(0,v.top-_.height),C=Math.max(C,v.width),X()&&(C-=t.offsetWidth-(t.clientWidth+parseInt(f.borderLeftWidth)+parseInt(f.borderRightWidth)))}else{m.y+_.height>b-20&&(m.y=Math.max(0,b-20-_.height)),m.x+_.width>y-20&&(m.x=Math.max(0,y-20-_.width))}var x={left:m.x+a.x,top:m.y+a.y,minWidth:C,zIndex:1500},M=null;r&&(t.style.opacity="0",M=G(function(e){t.style.opacity=1==e?"":e.toString()})),e instanceof HTMLElement&&(t[dt._OWNR_KEY]=e),z(t,x);var P=e instanceof MouseEvent?e.target:e;if(P instanceof HTMLElement&&P.parentElement!=document.body){var O=Date.now(),F=P.getBoundingClientRect(),T=new dt(document.createElement("div"));t[dt._SCRL_KEY]=T,T.addEventListener(document,"scroll",function(n){if(Date.now()-O>100&&H(document,P)&&!H(t,n.target)&&(n.target!=document||null!=e&&"fixed"==t.style.position)){var r=P.getBoundingClientRect(),i=Math.abs(r.left-F.left),o=Math.abs(r.top-F.top);(i>1||o>1)&&K(t,!0)}},!0)}return M}function K(t,e){t.style.display="none",e&&t.parentElement&&setTimeout(function(){"none"==t.style.display&&(L(t),c(e)&&e())},2*dt._FOCUS_INTERVAL);var n=t[dt._SCRL_KEY];n instanceof dt&&n.dispose(),delete t[dt._SCRL_KEY],delete t[dt._OWNR_KEY]}function W(){return jt}function X(){return Ht}function $(t,e){return Bt?{capture:t,passive:e}:t}Object.defineProperty(e,"__esModule",{value:!0});var J=window.wijmo&&window.wijmo.culture;window.wijmo=n,e.culture=J;var Z="5.20173.409";e.getVersion=function(){return Z};var Q;!function(t){t[t.Back=8]="Back",t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.Left=37]="Left",t[t.Up=38]="Up",t[t.Right=39]="Right",t[t.Down=40]="Down",t[t.Delete=46]="Delete",t[t.F1=112]="F1",t[t.F2=113]="F2",t[t.F3=114]="F3",t[t.F4=115]="F4",t[t.F5=116]="F5",t[t.F6=117]="F6",t[t.F7=118]="F7",t[t.F8=119]="F8",t[t.F9=120]="F9",t[t.F10=121]="F10",t[t.F11=122]="F11",t[t.F12=123]="F12"}(Q=e.Key||(e.Key={}));var tt;!function(t){t[t.Object=0]="Object",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=3]="Boolean",t[t.Date=4]="Date",t[t.Array=5]="Array"}(tt=e.DataType||(e.DataType={})),e.tryCast=r,e.isPrimitive=i,e.isString=o,e.isNullOrWhiteSpace=function(t){return null==t||t.replace(/\s/g,"").length<1},e.isNumber=s,e.isInt=a,e.isBoolean=u,e.isFunction=c,e.isUndefined=function(t){return void 0===t},e.isDate=h,e.isArray=l,e.isObject=p,e.isEmpty=function(t){for(var e in t)return!1;return!0},e.getUniqueId=f,e.mouseToPage=function(t){if(t instanceof nt)return t;if(t.touches&&t.touches.length>0&&(t=t.touches[0]),s(t.clientX)&&s(t.clientY))return new nt(t.clientX+pageXOffset,t.clientY+pageYOffset);throw"Mouse or touch event expected."},e.getType=function(t){return s(t)?tt.Number:u(t)?tt.Boolean:h(t)?tt.Date:o(t)?tt.String:l(t)?tt.Array:tt.Object},e.changeType=d,e.toFixed=g,e.format=function(t,e,n){if((t=y(t)).match(/\{.*"count".*:.*"when".*:.*\}/))try{var r=JSON.parse(t);if(o(r.count)){var i=e[r.count],a=r.when;if(s(i)&&p(a)){var u=a[i]||a.other;o(u)&&(t=u)}}}catch(t){}return t.replace(/\{(.*?)(:(.*?))?\}/g,function(t,r,i,o){var s=t;return r&&"{"!=r[0]&&e&&(s=e[r],o&&(s=st.format(s,o)),n&&(s=n(e,r,o,s))),null==s?"":s})},e.clamp=_,e.copy=m,e.assert=v,e._deprecated=function(t,e){console.error('** WARNING: "'+t+'" has been deprecated; please use "'+e+'" instead.')},e.asString=y,e.asNumber=b,e.asInt=C,e.asBoolean=w,e.asDate=E,e.asFunction=A,e.asArray=x,e.asType=M,e.asEnum=P,e.asCollectionView=function(t,e){if(void 0===e&&(e=!0),null==t&&e)return null;var n=r(t,"ICollectionView");return null!=n?n:(l(t)||v(!1,"Array or ICollectionView expected."),new Mt(t))},e.hasItems=function(t){return null!=t&&null!=t.items&&t.items.length>0},e.toHeaderCase=function(t){return t&&t.length?t[0].toUpperCase()+t.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""},e.escapeHtml=function(t){return o(t)&&(t=t.replace(/[&<>"'\/]/g,function(t){return et[t]})),t};var et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};e.hasClass=O,e.removeClass=F,e.addClass=T,e.toggleClass=I,e.setAttribute=S,e.setSelectionRange=D,e.removeChild=L,e.getActiveElement=k,e.moveFocus=function(t,e){var n=R(t),r=0;if(e){var i=n.indexOf(k());i>-1&&(r=(i+e+n.length)%n.length)}if(r<n.length){var o=n[r];o.focus(),o instanceof HTMLInputElement&&o.select()}},e.getElement=j,e.createElement=N,e.setText=function(t,e){t.textContent=e||""},e.contains=H,e.closest=V,e.closestClass=function(t,e){return V(t,"."+e)},e.enable=B,e.getElementRect=function(t){var e=t.getBoundingClientRect();return new it(e.left+pageXOffset,e.top+pageYOffset,e.width,e.height)},e.setCss=z,e.animate=G;var nt=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=b(t),this.y=b(e)}return t.prototype.equals=function(e){return e instanceof t&&this.x==e.x&&this.y==e.y},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Point=nt;var rt=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.width=b(t),this.height=b(e)}return t.prototype.equals=function(e){return e instanceof t&&this.width==e.width&&this.height==e.height},t.prototype.clone=function(){return new t(this.width,this.height)},t}();e.Size=rt;var it=function(){function t(t,e,n,r){this.left=b(t),this.top=b(e),this.width=b(n),this.height=b(r)}return Object.defineProperty(t.prototype,"right",{get:function(){return this.left+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.top+this.height},enumerable:!0,configurable:!0}),t.prototype.equals=function(e){return e instanceof t&&this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height},t.prototype.clone=function(){return new t(this.left,this.top,this.width,this.height)},t.fromBoundingRect=function(e){return null!=e.left?new t(e.left,e.top,e.width,e.height):null!=e.x?new t(e.x,e.y,e.width,e.height):void v(!1,"Invalid source rectangle.")},t.union=function(e,n){var r=Math.min(e.left,n.left),i=Math.min(e.top,n.top);return new t(r,i,Math.max(e.right,n.right)-r,Math.max(e.bottom,n.bottom)-i)},t.intersection=function(e,n){var r=Math.max(e.left,n.left),i=Math.max(e.top,n.top);return new t(r,i,Math.min(e.right,n.right)-r,Math.min(e.bottom,n.bottom)-i)},t.prototype.contains=function(e){if(e instanceof nt)return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom;if(e instanceof t){var n=e;return n.left>=this.left&&n.right<=this.right&&n.top>=this.top&&n.bottom<=this.bottom}v(!1,"Point or Rect expected.")},t.prototype.inflate=function(e,n){return new t(this.left-e,this.top-n,this.width+2*e,this.height+2*n)},t}();e.Rect=it;var ot=function(){function t(){}return t.addDays=function(e,n){return t.newDate(e.getFullYear(),e.getMonth(),e.getDate()+n)},t.addMonths=function(e,n){return t.newDate(e.getFullYear(),e.getMonth()+n,e.getDate())},t.addYears=function(e,n){return t.newDate(e.getFullYear()+n,e.getMonth(),e.getDate())},t.addHours=function(e,n){return t.newDate(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()+n)},t.addMinutes=function(e,n){return t.newDate(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes()+n)},t.addSeconds=function(e,n){return t.newDate(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()+n)},t.sameDate=function(t,e){return h(t)&&h(e)&&t.getFullYear()==e.getFullYear()&&t.getMonth()==e.getMonth()&&t.getDate()==e.getDate()},t.sameTime=function(t,e){return h(t)&&h(e)&&t.getHours()==e.getHours()&&t.getMinutes()==e.getMinutes()&&t.getSeconds()==e.getSeconds()},t.equals=function(t,e){return h(t)&&h(e)&&t.getTime()==e.getTime()},t.fromDateTime=function(e,n){return e||n?(e||(e=n),n||(n=e),t.newDate(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())):null},t.toFiscal=function(n,r){var i=e.culture.Globalize.calendar;return l(i.fiscalYearOffsets)?t.addMonths(n,-i.fiscalYearOffsets[r?0:1]):n},t.fromFiscal=function(n,r){var i=e.culture.Globalize.calendar;return l(i.fiscalYearOffsets)?t.addMonths(n,+i.fiscalYearOffsets[r?0:1]):n},t.newDate=function(t,e,n,r,i,o,s){if(null==t||null==e||null==n){var a=new Date;null==t&&(t=a.getFullYear()),null==e&&(e=a.getMonth()),null==n&&(n=a.getDate())}null==r&&(r=0),null==i&&(i=0),null==o&&(o=0),null==s&&(s=0);var u=new Date(t,e,n,r,i,o,s),c=u.getFullYear();return t<100&&c>=1900&&u.setFullYear(u.getFullYear()-1900),u},t.clone=function(e){return t.fromDateTime(e,e)},t}();e.DateTime=ot,e.httpRequest=U,e.culture=window.wijmo.culture||{Globalize:{numberFormat:{".":".",",":",",percent:{pattern:["-n %","n %"]},currency:{decimals:2,symbol:"$",pattern:["($n)","$n"]}},calendar:{"/":"/",":":":",firstDay:0,days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],am:["AM","A"],pm:["PM","P"],eras:["A.D.","B.C."],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",t:"h:mm tt",T:"h:mm:ss tt",M:"MMMM d",m:"MMMM d",Y:"MMMM, yyyy",y:"MMMM, yyyy",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",s:'yyyy"-"MM"-"dd"T"HH":"mm":"ss',o:'yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffffK',O:'yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffffK',U:"dddd, MMMM dd, yyyy h:mm:ss tt"},fiscalYearOffsets:[-3,-3]}}};var st=function(){function t(){}return t.format=function(e,n,r,i){return o(e)?e:s(e)?(n=n||(e==Math.round(e)?"n0":"n2"),t.formatNumber(e,n,r,i)):h(e)?(n=n||"d",t.formatDate(e,n)):null!=e?e.toString():""},t.formatNumber=function(n,r,i,o){n=b(n),r=y(r);var s,a=e.culture.Globalize.numberFormat,u=r?r.match(/([a-z])(\d*)(,*)(.*)/i):null,c=u?u[1].toLowerCase():"n",h=u&&u[2]?parseInt(u[2]):"c"==c?a.currency.decimals:n==Math.round(n)?0:2,l=u&&u[3]?3*u[3].length:0,p=u&&u[4]?u[4]:a.currency.symbol,f=a["."],d=a[","];if(l&&(n/=Math.pow(10,l)),"d"==c||"x"==c){for(s=Math.round(Math.abs(n)).toString("d"==c?10:16);s.length<h;)s="0"+s;return n<0&&(s="-"+s),r&&"X"==r[0]&&(s=s.toUpperCase()),s}if("p"==c&&(n=g(n=t._mul100(n),h,o)),o&&"p"!=c&&(n=g(n,h,!0)),s=t._toFixedStr("c"==c||"p"==c?Math.abs(n):n,h),(i||"g"==c)&&s.indexOf(".")>-1&&(s=(s=s.replace(/(\.[0-9]*?)0+$/g,"$1")).replace(/\.$/,"")),"."!=f&&(s=s.replace(".",f)),d&&("n"==c||"c"==c||"p"==c)){var _=s.indexOf(f),m=/\B(?=(\d\d\d)+(?!\d))/g;s=_>-1?s.substr(0,_).replace(m,d)+s.substr(_):s.replace(m,d)}if("c"==c){var v=a.currency.pattern[n<0?0:1];"​"==p&&(p=""),s=v.replace("n",s).replace("$",p)}return"p"==c&&(s=(v=a.percent.pattern[n<0?0:1]).replace("n",s)),s},t.formatDate=function(e,n){switch(e=E(e),n){case"r":case"R":return e.toUTCString();case"u":return e.toISOString().replace(/\.\d{3}/,"")}n=t._expandFormat(n);for(var r=t._parseDateFormat(n),i="",o=0;o<r.length;o++)i+=t._formatDatePart(e,n,r[o]);return i},t.parseInt=function(e,n){return Math.round(t.parseFloat(e,n))},t.parseFloat=function(t,n){var r=t.indexOf("-")>-1||t.indexOf("(")>-1&&t.indexOf(")")>-1?-1:1,i=t.indexOf("%")>-1?.01:1,o=n?n.match(/,+/):null,s=o?3*o[0].length:0;if(n&&("x"==n[0]||"X"==n[0]))return t=t.replace(/[^0-9a-f]+.*$/gi,""),parseInt(t,16)*r*i*Math.pow(10,s);var a=e.culture.Globalize.numberFormat["."],u=new RegExp("[^\\d\\"+a+"]","g"),c=t.replace(u,"").replace(a,".");return parseFloat(c)*r*i*Math.pow(10,s)},t.parseDate=function(n,r){if(!(n=y(n)))return null;if("u"==r)return new Date(n);var i;if("R"==r||"r"==r){var o=/(([0-9]+)\-([0-9]+)\-([0-9]+))?\s?(([0-9]+):([0-9]+)(:([0-9]+))?)?/,a=n.match(o);return a[1]||a[5]?(i=a[1]?new Date(parseInt(a[2]),parseInt(a[3])-1,parseInt(a[4])):new Date,a[5]&&(i.setHours(parseInt(a[6])),i.setMinutes(parseInt(a[7])),i.setSeconds(a[8]?parseInt(a[9]):0))):i=new Date(n),isNaN(i.getTime())?null:i}r=t._expandFormat(r||"d");var u,c,h,p,f,d,g=e.culture.Globalize.calendar,_=t._CJK,m=new RegExp("(\\"+g["/"]+")|(\\"+g[":"]+")|(\\d+)|(["+_+"\\.]{2,})|(["+_+"]+)","gi"),v=n.match(m),b=t._parseDateFormat(r),C=0,w=-1,E=0,A=1,x=0,M=0,P=0,O=0,F=-1;if(!(v&&v.length&&b&&b.length))return null;for(var T=0;T<b.length&&v;T++){var I=T-C,S=I>-1&&I<v.length?v[I]:"",D=b[T].length;switch(b[T]){case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":d=b[T];case"yyyy":case"yyy":case"yy":case"y":D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),w=parseInt(S),f=4==S.length;break;case"MMMM":case"MMM":p=!0;var L=S.toLowerCase();E=-1;for(var k=0;k<12;k++)if(0==g.months[k].toLowerCase().indexOf(L)){E=k;break}if(E>-1)break;case"MM":case"M":p=!0,D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),E=parseInt(S)-1;break;case"dddd":case"ddd":u=!0;break;case"dd":case"d":D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),A=parseInt(S),c=!0;break;case"hh":case"h":D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),x=12==(x=parseInt(S))?0:x;break;case"HH":D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),x=parseInt(S);break;case"H":x=parseInt(S);break;case"mm":case"m":D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),M=parseInt(S);break;case"ss":case"s":D>1&&S.length>D&&(v[I]=S.substr(D),S=S.substr(0,D),C++),P=parseInt(S);break;case"fffffff":case"FFFFFFF":case"ffffff":case"FFFFFF":case"fffff":case"FFFFF":case"ffff":case"FFFF":case"fff":case"FFF":case"ff":case"FF":case"f":case"F":O=parseInt(S)/Math.pow(10,D-3);break;case"tt":case"t":S=S.toUpperCase(),x<12&&g.pm.indexOf(S)>-1&&(x+=12);break;case"q":case"Q":case"u":case"U":h=!0;break;case"ggg":case"gg":case"g":F=g.eras.length>1?t._getEra(S,g):-1;break;case g["/"]:case g[":"]:if(S&&S!=b[T])return null;break;case"K":break;default:t._unquote(b[T]).trim()!=S.trim()&&C++}}if(p&&c&&(isNaN(x)&&(x=0),isNaN(M)&&(M=0),isNaN(P)&&(P=0)),E<0||E>11||isNaN(E)||A<0||A>31||isNaN(A)||x<0||x>24||isNaN(x)||M<0||M>60||isNaN(M)||P<0||P>60||isNaN(P))return null;if(d){if(!p)return null;var R=e.culture.Globalize.calendar;if(l(R.fiscalYearOffsets)){var j="E"==d[0],N=E-R.fiscalYearOffsets[j?0:1];w+=N>11?-1:N<0?1:0}}return u&&!c?null:h&&!p?null:(w<0&&(w=(new Date).getFullYear()),F>-1?w=w+g.eras[F].start.getFullYear()-1:w<100&&!f&&(w+=w+2e3<(s(g.twoDigitYearMax)?g.twoDigitYearMax:2029)?2e3:1900),i=ot.newDate(w,E,A,x,M+0,P,O),isNaN(i.getTime())?null:i)},t.getFirstDayOfWeek=function(){var t=e.culture.Globalize.calendar.firstDay;return t||0},t.getNumberDecimalSeparator=function(){var t=e.culture.Globalize.numberFormat["."];return t||"."},t._toFixedStr=function(t,e){var n=t.toString(),r=n.indexOf("."),i=e-(n.length-r)+1;return n.indexOf("e")<0&&r>-1&&i>=0?n+Array(i+1).join("0"):t.toFixed(e)},t._unquote=function(t){return t.length>1&&t[0]==t[t.length-1]&&("'"==t[0]||'"'==t[0])?t.substr(1,t.length-2):t},t._parseDateFormat=function(e){if(e in t._dateFormatParts)return t._dateFormatParts[e];var n,r,i=[];if(e)for(n=0;n>-1&&n<e.length;n++){var o=e[n];if(("'"==o||'"'==o)&&(r=e.indexOf(o,n+1))>-1)i.push(e.substring(n,r+1)),n=r;else{for(r=n+1;r<e.length&&e[r]==o;r++);i.push(e.substring(n,r)),n=r-1}}return t._dateFormatParts[e]=i,i},t._formatDatePart=function(n,r,i){var o,s=e.culture.Globalize.calendar,a=0,u=0,c=0,h=i.length;switch(i){case"yyyy":case"yyy":case"yy":case"y":case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":u=(o="E"==i[0]?ot.toFiscal(n,!0):"e"==i[0]?ot.toFiscal(n,!1):n).getFullYear(),s.eras.length>1&&r.indexOf("g")>-1&&(a=t._getEra(n,s))>-1&&(u=u-s.eras[a].start.getFullYear()+1);var l=i.length<3?u%100:3==i.length?u%1e3:u;return t._zeroPad(l,i.length);case"MMMMM":return s.monthsAbbr[n.getMonth()][0];case"MMMM":return s.months[n.getMonth()];case"MMM":return s.monthsAbbr[n.getMonth()];case"MM":case"M":return t._zeroPad(n.getMonth()+1,h);case"dddd":return s.days[n.getDay()];case"ddd":return s.daysAbbr[n.getDay()];case"dd":return t._zeroPad(n.getDate(),2);case"d":return n.getDate().toString();case"hh":case"h":return t._zeroPad(t._h12(n),h);case"HH":case"H":return t._zeroPad(n.getHours(),h);case"mm":case"m":return t._zeroPad(n.getMinutes(),h);case"ss":case"s":return t._zeroPad(n.getSeconds(),h);case"fffffff":case"FFFFFFF":case"ffffff":case"FFFFFF":case"fffff":case"FFFFF":case"ffff":case"FFFF":case"fff":case"FFF":case"ff":case"FF":case"f":case"F":return c=n.getMilliseconds()*Math.pow(10,h-3),"f"==i[0]?t._zeroPad(c,h):c.toFixed(0);case"tt":return n.getHours()<12?s.am[0]:s.pm[0];case"t":return n.getHours()<12?s.am[1]:s.pm[1];case"q":case"Q":return(Math.floor(n.getMonth()/3)+1).toString();case"u":case"U":return o=ot.toFiscal(n,"U"==i),(Math.floor(o.getMonth()/3)+1).toString();case"ggg":case"gg":case"g":return s.eras.length>1&&(a=t._getEra(n,s))>-1?"ggg"==i?s.eras[a].name:"gg"==i?s.eras[a].name[0]:s.eras[a].symbol:s.eras[0];case":":case"/":return s[i];case"K":var p=n.toString().match(/(\+|\-)(\d{2})(\d{2})/);return p?p[1]+p[2]+p[3]:"";case"zzz":case"zz":case"z":var f=-n.getTimezoneOffset(),d=void 0;switch(i){case"zzz":d=t.format(f/60,"d2",!1,!0)+s[":"]+t.format(f%60,"d2",!1,!0);break;case"zz":d=t.format(f/60,"d2",!1,!0);break;case"z":d=t.format(f/60,"d",!1,!0)}return f>=0?"+"+d:d}return h>1&&i[0]==i[h-1]&&('"'==i[0]||"'"==i[0])?i.substr(1,h-2):i},t._getEra=function(t,e){if(h(t)){for(n=0;n<e.eras.length;n++)if(t>=e.eras[n].start)return n}else if(o(t))for(var n=0;n<e.eras.length;n++)if(e.eras[n].name&&(0==e.eras[n].name.indexOf(t)||0==e.eras[n].symbol.indexOf(t)))return n;return-1},t._expandFormat=function(t){var n=e.culture.Globalize.calendar.patterns[t];return n||t},t._zeroPad=function(t,e){var n=t.toFixed(0),r=e-n.length+1;return r>0?Array(r).join("0")+n:n},t._h12=function(t){var n=e.culture.Globalize.calendar,r=t.getHours();return n.am&&n.am[0]&&0==(r%=12)&&(r=12),r},t._mul100=function(t){var e=t.toString(),n=e.indexOf(".");return e.indexOf("e")>-1?100*t:(n<0?e+="00":(n+=2,e=(e=e.replace(".","")+"00").substr(0,n)+"."+e.substr(n)),parseFloat(e))},t._CJK="a-z"+"u00c0-u017fu3000-u30ffu4e00-u9faf".replace(/u/g,"\\u")+"u1100-u11ffu3130-u318fua960-ua97fuac00-ud7afud7b0-ud7ff".replace(/u/g,"\\u"),t._dateFormatParts={},t}();e.Globalize=st,e._updateCulture=function(){e.culture=window.wijmo.culture};var at=function(){function t(t){this.path=t}return Object.defineProperty(t.prototype,"path",{get:function(){return this._path},set:function(t){this._path=t,this._parts=t?t.split("."):[];for(var e=0;e<this._parts.length;e++){var n=this._parts[e],r=n.indexOf("[");r>-1&&(this._parts[e]=n.substr(0,r),this._parts.splice(++e,0,parseInt(n.substr(r+1))))}this._key=1==this._parts.length?this._parts[0]:null},enumerable:!0,configurable:!0}),t.prototype.getValue=function(t){if(t){if(this._key)return t[this._key];if(this._path&&this._path in t)return t[this._path];for(var e=0;e<this._parts.length&&t;e++)t=t[this._parts[e]]}return t},t.prototype.setValue=function(t,e){if(t){if(this._path in t)return void(t[this._path]=e);for(var n=0;n<this._parts.length-1;n++)if(null==(t=t[this._parts[n]]))return;t[this._parts[this._parts.length-1]]=e}},t}();e.Binding=at;var ut=function(){return function(t,e){this.handler=t,this.self=e}}(),ct=function(){function t(){this._handlers=[]}return t.prototype.addHandler=function(t,e){t=A(t),this._handlers.push(new ut(t,e))},t.prototype.removeHandler=function(t,e){t=A(t);for(var n=0;n<this._handlers.length;n++){var r=this._handlers[n];if((r.handler==t||null==t)&&(r.self==e||null==e)&&(this._handlers.splice(n,1),t&&e))break}},t.prototype.removeAllHandlers=function(){this._handlers.length=0},t.prototype.raise=function(t,e){void 0===e&&(e=ht.empty);for(var n=0;n<this._handlers.length;n++){var r=this._handlers[n];r.handler.call(r.self,t,e)}},Object.defineProperty(t.prototype,"hasHandlers",{get:function(){return this._handlers.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"handlerCount",{get:function(){return this._handlers.length},enumerable:!0,configurable:!0}),t}();e.Event=ct;var ht=function(){function t(){}return t.empty=new t,t}();e.EventArgs=ht;var lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cancel=!1,e}return __extends(e,t),e}(ht);e.CancelEventArgs=lt;var pt=function(t){function e(e,n,r){var i=t.call(this)||this;return i._name=e,i._oldVal=n,i._newVal=r,i}return __extends(e,t),Object.defineProperty(e.prototype,"propertyName",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._oldVal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"newValue",{get:function(){return this._newVal},enumerable:!0,configurable:!0}),e}(ht);e.PropertyChangedEventArgs=pt;var ft=function(t){function e(e,n){var r=t.call(this)||this;return r._xhr=e,r._msg=n,r}return __extends(e,t),Object.defineProperty(e.prototype,"request",{get:function(){return this._xhr},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._msg},set:function(t){this._msg=t},enumerable:!0,configurable:!0}),e}(lt);e.RequestErrorEventArgs=ft;var dt=function(){function t(e,n,r){void 0===n&&(n=null),void 0===r&&(r=!1);var i=this;this._pristine=!0,this._focus=!1,this._updating=0,this._fullUpdate=!1,this.gotFocus=new ct,this.lostFocus=new ct,this.refreshing=new ct,this.refreshed=new ct,t._updateWme(),v(null==t.getControl(e),"Element is already hosting a control.");var o=j(e);if(v(null!=o,"Cannot find the host element."),this._orgOuter=o.outerHTML,this._orgTag=o.tagName,this._orgAtts=o.attributes,"INPUT"!=o.tagName&&"SELECT"!=o.tagName||(o=this._replaceWithDiv(o)),this._e=o,o[t._CTRL_KEY]=this,1==r){this._szCtl=new rt(o.offsetWidth,o.offsetHeight);var s=this._handleResize.bind(this);this.addEventListener(window,"resize",s)}var a;this.addEventListener(o,"focus",function(e){a&&clearTimeout(a),a=setTimeout(function(){a=null,i._updateFocusState()},t._FOCUS_INTERVAL)},!0),this.addEventListener(o,"blur",function(e){a&&clearTimeout(a),a=setTimeout(function(){a=null,i._updateFocusState()},t._FOCUS_INTERVAL)},!0);var u=this._handleDisabled.bind(this);if(this.addEventListener(o,"mousedown",u,!0),this.addEventListener(o,"mouseup",u,!0),this.addEventListener(o,"click",u,!0),this.addEventListener(o,"dblclick",u,!0),this.addEventListener(o,"keydown",u,!0),this.addEventListener(o,"wheel",u,$(!0,!0)),null==t._touching&&(t._touching=!1,"ontouchstart"in window||"onpointerdown"in window)){var c=document.body,h=this._handleTouchStart,l=this._handleTouchEnd,p=$(!0,!0);"ontouchstart"in window?(c.addEventListener("touchstart",h,p),c.addEventListener("touchend",l,p),c.addEventListener("touchcancel",l,p),c.addEventListener("touchleave",l,p)):"onpointerdown"in window&&(c.addEventListener("pointerdown",h,p),c.addEventListener("pointerup",l,p),c.addEventListener("pointerout",l,p),c.addEventListener("pointercancel",l,p),c.addEventListener("pointerleave",l,p))}}return t.prototype.getTemplate=function(){for(var t=Object.getPrototypeOf(this);t;t=Object.getPrototypeOf(t)){var e=t.constructor.controlTemplate;if(e)return e}return null},t.prototype.applyTemplate=function(e,n,r,i){var o=this,s=this._e;e&&T(s,e);var a=null;n&&(a=N(n,s));var u=s.querySelectorAll("input"),c=1==u.length?u[0]:null;if(c&&(this._copyAttributes(c,s.attributes,t._rxInputAtts),this._copyAttributes(c,this._orgAtts,t._rxInputAtts)),c&&s.id){for(var h=s;h.parentElement;)h=h.parentElement;var l=h.querySelector('label[for="'+s.id+'"]');if(l instanceof HTMLLabelElement){var p=f(s.id+"_input");c.id=p,l.htmlFor=p}}if(c){var d=document.createEvent("HTMLEvents"),g=c.value;d.initEvent("change",!0,!1),this.addEventListener(c,"input",function(){o._pristine=!1,g=c.value},!0),this.gotFocus.addHandler(function(){g=c.value}),this.lostFocus.addHandler(function(){o._pristine&&(o._pristine=!1,o._updateState()),g!=c.value&&c.dispatchEvent(d)})}if(c?s.tabIndex=-1:s.getAttribute("tabindex")||(s.tabIndex=0),this._updateState(),r)for(var _ in r){var m=r[_];if(this[_]=a.querySelector('[wj-part="'+m+'"]'),null==this[_]&&a.getAttribute("wj-part")==m&&(this[_]=a),null==this[_])throw'Missing template part: "'+m+'"';if(m==i){var v="name",y=s.attributes[v];y&&y.value&&this[_].setAttribute(v,y.value),v="accesskey",(y=s.attributes[v])&&y.value&&(this[_].setAttribute(v,y.value),s.removeAttribute(v))}}return a},t.prototype.dispose=function(){for(var e=this._e.querySelectorAll(".wj-control"),n=0;n<e.length;n++){var r=t.getControl(e[n]);r&&r.dispose()}this._toInv&&(clearTimeout(this._toInv),this._toInv=null),this.removeEventListener();for(var i in this)i.length>2&&0==i.indexOf("on")&&(s=this[i[2].toLowerCase()+i.substr(3)])instanceof ct&&s.removeAllHandlers();var o=this.collectionView;if(o instanceof Mt)for(var i in o){var s=o[i];s instanceof ct&&s.removeHandler(null,this)}this._e.parentNode&&(this._e.outerHTML=this._orgOuter),this._e[t._CTRL_KEY]=null,this._e=this._orgOuter=this._orgTag=null},t.getControl=function(e){var n=j(e);return n?M(n[t._CTRL_KEY],t,!0):null},Object.defineProperty(t.prototype,"hostElement",{get:function(){return this._e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rightToLeft",{get:function(){return null==this._rtlDir&&(this._rtlDir=!!this._e&&"rtl"==getComputedStyle(this._e).direction),this._rtlDir},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this._e&&this._e.focus()},t.prototype.containsFocus=function(){var e=this._e,n=k();if(!e)return!1;for(var r=n;r;){if(r==e)return!0;r=r[t._OWNR_KEY]||r.parentElement}return!1},t.prototype.invalidate=function(e){var n=this;void 0===e&&(e=!0),this._rtlDir=null,this._fullUpdate=this._fullUpdate||e,this._toInv&&(clearTimeout(this._toInv),this._toInv=null),this.isUpdating||(this._toInv=setTimeout(function(){n.refresh(n._fullUpdate),n._toInv=null},t._REFRESH_INTERVAL))},t.prototype.refresh=function(e){var n=this;void 0===e&&(e=!0),this.isUpdating||(this.onRefreshing(),setTimeout(function(){n.onRefreshed()})),!this.isUpdating&&this._toInv&&(clearTimeout(this._toInv),this._toInv=null,this._rtlDir=null,this._fullUpdate=!1,t._updateWme())},t.invalidateAll=function(e){if(e||(e=document.body),e.children)for(var n=0;n<e.children.length;n++)t.invalidateAll(e.children[n]);var r=t.getControl(e);r&&r.invalidate()},t.refreshAll=function(e){if(e||(e=document.body),e.children)for(var n=0;n<e.children.length;n++)t.refreshAll(e.children[n]);var r=t.getControl(e);r&&r.refresh()},t.disposeAll=function(e){var n=t.getControl(e);if(n)n.dispose();else if(e.children)for(var r=0;r<e.children.length;r++)t.disposeAll(e.children[r])},t.prototype.beginUpdate=function(){this._updating++},t.prototype.endUpdate=function(){this._updating--,this._updating<=0&&this.invalidate()},Object.defineProperty(t.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0}),t.prototype.deferUpdate=function(t){try{this.beginUpdate(),t()}finally{this.endUpdate()}},Object.defineProperty(t.prototype,"isTouching",{get:function(){return t._touching},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this._e&&null!=this._e.getAttribute("disabled")},set:function(t){(t=w(t,!0))!=this.isDisabled&&B(this._e,!t)},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){t&&m(this,t)},t.prototype.addEventListener=function(t,e,n,r){void 0===r&&(r=!1),t&&(t.addEventListener(e,n,r),null==this._listeners&&(this._listeners=[]),this._listeners.push({target:t,type:e,fn:n,capture:r}))},t.prototype.removeEventListener=function(t,e,n,r){var i=0;if(this._listeners)for(var o=0;o<this._listeners.length;o++){var s=this._listeners[o];null!=t&&t!=s.target||null!=e&&e!=s.type||null!=n&&n!=s.fn||null!=r&&r!=s.capture||(s.target.removeEventListener(s.type,s.fn,s.capture),this._listeners.splice(o,1),o--,i++)}return i},t.prototype.onGotFocus=function(t){this.gotFocus.raise(this,t)},t.prototype.onLostFocus=function(t){this.lostFocus.raise(this,t)},t.prototype.onRefreshing=function(t){this.refreshing.raise(this,t)},t.prototype.onRefreshed=function(t){this.refreshed.raise(this,t)},t.prototype._hasPendingUpdates=function(){return null!=this._toInv},t._updateWme=function(){},t.prototype._handleResize=function(){if(this._e.parentElement){var t=new rt(this._e.offsetWidth,this._e.offsetHeight);t.equals(this._szCtl)||(this._szCtl=t,this.invalidate())}},t.prototype._updateFocusState=function(){setTimeout(function(){for(var e=ht.empty,n=document.body.querySelectorAll(".wj-state-focused"),r=0;r<n.length;r++)(s=t.getControl(n[r]))&&s._focus&&!s.containsFocus()&&(s._focus=!1,s._updateState(),s.onLostFocus(e));var i=k();if(i)for(var o=i;o;){var s=t.getControl(o);s&&!s._focus&&s.containsFocus()&&(s._focus=!0,s._updateState(),s.onGotFocus(e)),o=o[t._OWNR_KEY]||o.parentElement}})},t.prototype._updateState=function(){var t=this.hostElement;if(t){I(t,"wj-state-focused",this._focus);var e=t.querySelector("input");if(e instanceof HTMLInputElement){I(t,"wj-state-empty",0==e.value.length),I(t,"wj-state-readonly",e.readOnly);var n=e.validationMessage;I(t,"wj-state-invalid",!this._pristine&&null!=n&&n.length>0)}}},t.prototype._handleTouchStart=function(e){null!=e.pointerType&&"touch"!=e.pointerType||(t._touching=!0)},t.prototype._handleTouchEnd=function(e){null!=e.pointerType&&"touch"!=e.pointerType||setTimeout(function(){t._touching=!1},400)},t.prototype._handleDisabled=function(t){this.isDisabled&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())},t.prototype._replaceWithDiv=function(t){var e=document.createElement("div");return t.parentElement.replaceChild(e,t),e.innerHTML=t.innerHTML,this._copyAttributes(e,t.attributes,/id|style|class/i),e},t.prototype._copyAttributes=function(t,e,n){if(t)for(var r=0;r<e.length;r++){var i=e[r].name;i.match(n)&&t.setAttribute(i,e[r].value)}},t._REFRESH_INTERVAL=10,t._FOCUS_INTERVAL=20,t._ANIM_DEF_DURATION=400,t._ANIM_DEF_STEP=35,t._CLICK_DELAY=800,t._CLICK_REPEAT=75,t._CLIPBOARD_DELAY=100,t._CTRL_KEY="$WJ-CTRL",t._OWNR_KEY="$WJ-OWNR",t._SCRL_KEY="$WJ-SCRL",t._rxInputAtts=/name|tabindex|placeholder|autofocus|autocomplete|autocorrect|autocapitalize|spellcheck|readonly|minlength|maxlength|pattern|type/i,t}();e.Control=dt;var gt;!function(t){t[t.None=0]="None",t[t.Sum=1]="Sum",t[t.Cnt=2]="Cnt",t[t.Avg=3]="Avg",t[t.Max=4]="Max",t[t.Min=5]="Min",t[t.Rng=6]="Rng",t[t.Std=7]="Std",t[t.Var=8]="Var",t[t.StdPop=9]="StdPop",t[t.VarPop=10]="VarPop",t[t.CntAll=11]="CntAll",t[t.First=12]="First",t[t.Last=13]="Last"}(gt=e.Aggregate||(e.Aggregate={})),e.getAggregate=Y;var _t;!function(t){t[t.Add=0]="Add",t[t.Remove=1]="Remove",t[t.Change=2]="Change",t[t.Reset=3]="Reset"}(_t=e.NotifyCollectionChangedAction||(e.NotifyCollectionChangedAction={}));var mt=function(t){function e(e,n,r){void 0===e&&(e=_t.Reset),void 0===n&&(n=null),void 0===r&&(r=-1);var i=t.call(this)||this;return i.action=e,i.item=n,i.index=r,i}return __extends(e,t),e.reset=new e(_t.Reset),e}(ht);e.NotifyCollectionChangedEventArgs=mt;var vt=function(){function t(t,e){this._bnd=new at(t),this._asc=e}return Object.defineProperty(t.prototype,"property",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ascending",{get:function(){return this._asc},enumerable:!0,configurable:!0}),t}();e.SortDescription=vt;var yt=function(t){function e(e){var n=t.call(this)||this;return n.newPageIndex=e,n}return __extends(e,t),e}(lt);e.PageChangingEventArgs=yt;var bt=function(){function t(){}return t.prototype.groupNameFromItem=function(t,e){return""},t.prototype.namesMatch=function(t,e){return t===e},t}();e.GroupDescription=bt;var Ct=function(t){function e(e,n){var r=t.call(this)||this;return r._bnd=new at(e),r._converter=n,r}return __extends(e,t),Object.defineProperty(e.prototype,"propertyName",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0}),e.prototype.groupNameFromItem=function(t,e){return this._converter?this._converter(t,this.propertyName):this._bnd.getValue(t)},e.prototype.namesMatch=function(t,e){return t===e},e}(bt);e.PropertyGroupDescription=Ct;var wt=function(t){function e(){var e=this;return Et?e.length=0:e=t.call(this)||this,e}return __extends(e,t),e}(Array);e.ArrayBase=wt;var Et=!0;try{wt.prototype=Array.prototype,Et=wt.prototype===Array.prototype}catch(t){Et=!1}var At=window.Symbol;!Et&&At&&At.species&&Object.defineProperty(wt,At.species,{get:function(){return Array},enumerable:!1,configurable:!1});var xt=function(t){function e(e){var n=t.call(this)||this;if(n._updating=0,n.collectionChanged=new ct,e){e=x(e),n._updating++;for(var r=0;r<e.length;r++)n.push(e[r]);n._updating--}return n}return __extends(e,t),e.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r=this.length,i=0;e&&i<e.length;i++)r=t.prototype.push.call(this,e[i]),this._updating||this._raiseCollectionChanged(_t.Add,e[i],r-1);return r},e.prototype.pop=function(){var e=t.prototype.pop.call(this);return this._raiseCollectionChanged(_t.Remove,e,this.length),e},e.prototype.splice=function(e,n,r){var i;return n&&r?(i=t.prototype.splice.call(this,e,n,r),1==n?this._raiseCollectionChanged(_t.Change,r,e):this._raiseCollectionChanged(),i):r?(i=t.prototype.splice.call(this,e,0,r),this._raiseCollectionChanged(_t.Add,r,e),i):(i=t.prototype.splice.call(this,e,n),1==n?this._raiseCollectionChanged(_t.Remove,i[0],e):this._raiseCollectionChanged(),i)},e.prototype.slice=function(e,n){return t.prototype.slice.call(this,e,n)},e.prototype.indexOf=function(e,n){return t.prototype.indexOf.call(this,e,n)},e.prototype.sort=function(e){var n=t.prototype.sort.call(this,e);return this._raiseCollectionChanged(),n},e.prototype.insert=function(t,e){this.splice(t,0,e)},e.prototype.remove=function(t){var e=this.indexOf(t);return e>-1&&(this.removeAt(e),!0)},e.prototype.removeAt=function(t){this.splice(t,1)},e.prototype.setAt=function(t,e){t>this.length&&(this.length=t),this.splice(t,1,e)},e.prototype.clear=function(){0!==this.length&&(this.splice(0,this.length),this._raiseCollectionChanged())},e.prototype.beginUpdate=function(){this._updating++},e.prototype.endUpdate=function(){this._updating>0&&(this._updating--,0==this._updating&&this._raiseCollectionChanged())},Object.defineProperty(e.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0}),e.prototype.deferUpdate=function(t){try{this.beginUpdate(),t()}finally{this.endUpdate()}},e.prototype.implementsInterface=function(t){return"INotifyCollectionChanged"==t},e.prototype.onCollectionChanged=function(t){void 0===t&&(t=mt.reset),this.isUpdating||this.collectionChanged.raise(this,t)},e.prototype._raiseCollectionChanged=function(t,e,n){if(void 0===t&&(t=_t.Reset),!this.isUpdating){var r=new mt(t,e,n);this.onCollectionChanged(r)}},e}(wt);e.ObservableArray=xt;var Mt=function(){function t(t,e){var n=this;this._idx=-1,this._srtDsc=new xt,this._grpDesc=new xt,this._newItem=null,this._edtItem=null,this._pgSz=0,this._pgIdx=0,this._updating=0,this._stableSort=!1,this._canFilter=!0,this._canGroup=!0,this._canSort=!0,this._canAddNew=!0,this._canCancelEdit=!0,this._canRemove=!0,this._canChangePage=!0,this._trackChanges=!1,this._chgAdded=new xt,this._chgRemoved=new xt,this._chgEdited=new xt,this.collectionChanged=new ct,this.sourceCollectionChanging=new ct,this.sourceCollectionChanged=new ct,this.currentChanged=new ct,this.currentChanging=new ct,this.pageChanged=new ct,this.pageChanging=new ct,this._srtDsc.collectionChanged.addHandler(function(){for(var t=n._srtDsc,e=0;e<t.length;e++)v(t[e]instanceof vt,"sortDescriptions array must contain SortDescription objects.");n.canSort&&n.refresh()}),this._grpDesc.collectionChanged.addHandler(function(){for(var t=n._grpDesc,e=0;e<t.length;e++)v(t[e]instanceof bt,"groupDescriptions array must contain GroupDescription objects.");n.canGroup&&n.refresh()}),this.sourceCollection=t||new xt,e&&(this.beginUpdate(),m(this,e),this.endUpdate())}return t.prototype._copy=function(t,e){if("sortDescriptions"==t){this.sortDescriptions.clear();for(var n=x(e),r=0;r<n.length;r++)o(i=n[r])&&(i=new vt(i,!0)),this.sortDescriptions.push(i);return!0}if("groupDescriptions"==t){this.groupDescriptions.clear();for(var n=x(e),r=0;r<n.length;r++){var i=n[r];o(i)&&(i=new Ct(i)),this.groupDescriptions.push(i)}return!0}return!1},Object.defineProperty(t.prototype,"newItemCreator",{get:function(){return this._itemCreator},set:function(t){this._itemCreator=A(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sortConverter",{get:function(){return this._srtCvt},set:function(t){t!=this._srtCvt&&(this._srtCvt=A(t,!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sortComparer",{get:function(){return this._srtCmp},set:function(t){t!=this._srtCmp&&(this._srtCmp=A(t,!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useStableSort",{get:function(){return this._stableSort},set:function(t){this._stableSort=w(t)},enumerable:!0,configurable:!0}),t.prototype.getAggregate=function(t,e,n){return Y(t,n?this._pgView:this._view,e)},Object.defineProperty(t.prototype,"trackChanges",{get:function(){return this._trackChanges},set:function(t){this._trackChanges=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsAdded",{get:function(){return this._chgAdded},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsRemoved",{get:function(){return this._chgRemoved},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsEdited",{get:function(){return this._chgEdited},enumerable:!0,configurable:!0}),t.prototype.clearChanges=function(){this._chgAdded.clear(),this._chgRemoved.clear(),this._chgEdited.clear()},t.prototype.implementsInterface=function(t){switch(t){case"ICollectionView":case"IEditableCollectionView":case"IPagedCollectionView":case"INotifyCollectionChanged":return!0}return!1},Object.defineProperty(t.prototype,"getError",{get:function(){return this._getError},set:function(t){this._getError=A(t)},enumerable:!0,configurable:!0}),t.prototype.onCollectionChanged=function(t){void 0===t&&(t=mt.reset),t.action!=_t.Change||this._committing||this._canceling||t.item==this.currentEditItem||t.item==this.currentAddItem||this._trackItemChanged(t.item),this.collectionChanged.raise(this,t)},t.prototype._raiseCollectionChanged=function(t,e,n){void 0===t&&(t=_t.Reset);var r=new mt(t,e,n);this.onCollectionChanged(r)},t.prototype._notifyItemChanged=function(t){var e=new mt(_t.Change,t,this.items.indexOf(t));this.onCollectionChanged(e)},t.prototype.onSourceCollectionChanging=function(t){return this.sourceCollectionChanging.raise(this,t),!t.cancel},t.prototype.onSourceCollectionChanged=function(t){this.sourceCollectionChanged.raise(this,t)},Object.defineProperty(t.prototype,"canFilter",{get:function(){return this._canFilter},set:function(t){this._canFilter=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canGroup",{get:function(){return this._canGroup},set:function(t){this._canGroup=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canSort",{get:function(){return this._canSort},set:function(t){this._canSort=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentItem",{get:function(){return this._pgView&&this._idx>-1&&this._idx<this._pgView.length?this._pgView[this._idx]:null},set:function(t){this.moveCurrentTo(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._idx},set:function(t){this.moveCurrentToPosition(b(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filter",{get:function(){return this._filter},set:function(t){this._filter!=t&&(this._filter=A(t),this.canFilter&&this.refresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groupDescriptions",{get:function(){return this._grpDesc},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEmpty",{get:function(){return!this._pgView||!this._pgView.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sortDescriptions",{get:function(){return this._srtDsc},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sourceCollection",{get:function(){return this._src},set:function(t){if(t!=this._src){if(!this.onSourceCollectionChanging(new lt))return;var e=this.currentPosition;this.commitEdit(),this.commitNew(),null!=this._ncc&&this._ncc.collectionChanged.removeHandler(this._sourceChanged),this._src=x(t,!1),this._ncc=r(this._src,"INotifyCollectionChanged"),this._ncc&&this._ncc.collectionChanged.addHandler(this._sourceChanged,this),this.clearChanges(),this.refresh(),this.moveCurrentToFirst(),this.onSourceCollectionChanged(),this.currentPosition<0&&e>-1&&this.onCurrentChanged()}},enumerable:!0,configurable:!0}),t.prototype._sourceChanged=function(t,e){this._updating<=0&&this.refresh()},t.prototype.contains=function(t){return this._pgView.indexOf(t)>-1},t.prototype.moveCurrentTo=function(t){return this.moveCurrentToPosition(this._pgView.indexOf(t))},t.prototype.moveCurrentToFirst=function(){return this.moveCurrentToPosition(0)},t.prototype.moveCurrentToLast=function(){return this.moveCurrentToPosition(this._pgView.length-1)},t.prototype.moveCurrentToPrevious=function(){return this._idx>0&&this.moveCurrentToPosition(this._idx-1)},t.prototype.moveCurrentToNext=function(){return this.moveCurrentToPosition(this._idx+1)},t.prototype.moveCurrentToPosition=function(t){if(t>=-1&&t<this._pgView.length&&t!=this._idx){var e=new lt;if(this.onCurrentChanging(e)){var n=this._pgView[t];this._edtItem&&n!=this._edtItem&&this.commitEdit(),this._newItem&&n!=this._newItem&&this.commitNew(),this._idx=t,this.onCurrentChanged()}}return this._idx==t},t.prototype.refresh=function(){this._updating>0||this._newItem||this._edtItem||(this._performRefresh(),this.onCollectionChanged())},t.prototype._performRefresh=function(){if(!(this._updating>0)){var t=this.currentItem;this._view=this._src?this._performFilter(this._src):[],this.canSort&&this._srtDsc.length>0&&(this._view==this._src&&(this._view=this._src.slice()),this._performSort(this._view)),this._groups=this.canGroup?this._createGroups(this._view):null,this._fullGroups=this._groups,this._groups&&(this._view=this._mergeGroupItems(this._groups)),this._pgIdx=_(this._pgIdx,0,this.pageCount-1),this._pgView=this._getPageView(),this._groups&&this.pageCount>1&&(this._groups=this._createGroups(this._pgView),this._mergeGroupItems(this._groups));var e=this._pgView.indexOf(t);e<0&&(e=Math.min(this._idx,this._pgView.length-1)),this._idx=e,this._digest=this._getGroupsDigest(this.groups),this.currentItem!==t&&this.onCurrentChanged()}},t.prototype._performSort=function(t){if(this._stableSort){var e=t.map(function(t,e){return{item:t,index:e}}),n=this._compareItems();e.sort(function(t,e){var r=n(t.item,e.item);return 0==r?t.index-e.index:r});for(var r=0;r<t.length;r++)t[r]=e[r].item}else t.sort(this._compareItems())},t.prototype._compareItems=function(){var t=this._srtDsc,e=this._srtCvt,n=this._srtCmp,r=!0,i=0;return function(o,s){for(var a=0;a<t.length;a++){var u=t[a],c=u._bnd.getValue(o),h=u._bnd.getValue(s);if(e&&(c=e(u,o,c,r),h=e(u,s,h,!1),r=!1),n&&null!=(i=n(c,h)))return u.ascending?+i:-i;if(c!==c&&(c=null),h!==h&&(h=null),"string"==typeof c&&"string"==typeof h){var l=c.toLowerCase(),p=h.toLowerCase();l!=p&&(c=l,h=p)}if(null!=c&&null==h)return-1;if(null==c&&null!=h)return 1;if(0!=(i=c<h?-1:c>h?1:0))return u.ascending?+i:-i}return 0}},t.prototype._performFilter=function(t){return this.canFilter&&this._filter?t.filter(this._filter,this):t},t.prototype.onCurrentChanged=function(t){void 0===t&&(t=ht.empty),this.currentChanged.raise(this,t)},t.prototype.onCurrentChanging=function(t){return this.currentChanging.raise(this,t),!t.cancel},Object.defineProperty(t.prototype,"items",{get:function(){return this._pgView},enumerable:!0,configurable:!0}),t.prototype.beginUpdate=function(){this._updating++},t.prototype.endUpdate=function(){this._updating--,this._updating<=0&&this.refresh()},Object.defineProperty(t.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0}),t.prototype.deferUpdate=function(t){try{this.beginUpdate(),t()}finally{this.endUpdate()}},Object.defineProperty(t.prototype,"canAddNew",{get:function(){return this._canAddNew},set:function(t){this._canAddNew=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canCancelEdit",{get:function(){return this._canCancelEdit},set:function(t){this._canCancelEdit=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canRemove",{get:function(){return this._canRemove},set:function(t){this._canRemove=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentAddItem",{get:function(){return this._newItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentEditItem",{get:function(){return this._edtItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAddingNew",{get:function(){return null!=this._newItem},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEditingItem",{get:function(){return null!=this._edtItem},enumerable:!0,configurable:!0}),t.prototype.editItem=function(t){t!=this._edtItem&&this.moveCurrentTo(t)&&(this.commitEdit(),this._edtItem=t,this._edtClone={},this._extend(this._edtClone,this._edtItem))},t.prototype.commitEdit=function(){var t=this._edtItem;if(null!=t){this._committing=!0;var e=this._sameContent(t,this._edtClone);this._edtItem=null,this._edtClone=null;var n=this._pgView.indexOf(t),r=this._digest;this._performRefresh(),e||this._trackItemChanged(t),this._pgView.indexOf(t)==n&&r==this._digest?this._raiseCollectionChanged(_t.Change,t,n):this._raiseCollectionChanged(),this._committing=!1}},t.prototype.cancelEdit=function(){var t=this._edtItem;if(null!=t){if(this._edtItem=null,!this.canCancelEdit)return void v(!1,"cannot cancel edits (canCancelEdit == false).");var e=this._src.indexOf(t);if(e<0||!this._edtClone)return;this._extend(this._src[e],this._edtClone),this._edtClone=null,this._canceling=!0,this._raiseCollectionChanged(_t.Change,t,e),this._canceling=!1}},t.prototype.addNew=function(){if(arguments.length>0&&v(!1,"addNew does not take any parameters, it creates the new items."),this.commitEdit(),this.commitNew(),!this.canAddNew)return v(!1,"cannot add items (canAddNew == false)."),null;var t=null,e=this.sourceCollection;if(null!=(t=this.newItemCreator?this.newItemCreator():e&&e.length?new e[0].constructor:{})){if(this._newItem=t,this._updating++,this._src.push(t),this._updating--,this._pgView!=this._src&&this._pgView.push(t),this.groups&&this.groups.length){var n=this.groups[this.groups.length-1];for(n.items.push(t);n.groups&&n.groups.length;)(n=n.groups[n.groups.length-1]).items.push(t)}this._raiseCollectionChanged(_t.Add,t,this._pgView.length-1),this.moveCurrentTo(t)}return this._newItem},t.prototype.commitNew=function(){var t=this._newItem;if(null!=t){this._newItem=null;var e=this._pgView.indexOf(t),n=this._digest;if(this._performRefresh(),this._trackChanges){var r=this._chgEdited.indexOf(t);r>-1&&this._chgEdited.removeAt(r),this._chgAdded.indexOf(t)<0&&this._chgAdded.push(t)}this._pgView.indexOf(t)==e&&n==this._digest?this._raiseCollectionChanged(_t.Change,t,e):this._raiseCollectionChanged()}},t.prototype.cancelNew=function(){var t=this._newItem;null!=t&&this.remove(t)},t.prototype.remove=function(t){var e=t==this._newItem;if(e&&(this._newItem=null),t==this._edtItem&&this.cancelEdit(),this.canRemove){var n=this._src.indexOf(t);if(n>-1){var r=this.currentItem;this._updating++,this._src.splice(n,1),this._updating--;var i=this._digest;if(this._performRefresh(),this._trackChanges){var o=this._chgAdded.indexOf(t);o>-1&&this._chgAdded.removeAt(o);var s=this._chgEdited.indexOf(t);s>-1&&this._chgEdited.removeAt(s),this._chgRemoved.indexOf(t)<0&&!e&&o<0&&this._chgRemoved.push(t)}var a=this.sortDescriptions.length>0,u=this.pageSize>0&&this._pgIdx>-1;a||u||i!=this._getGroupsDigest(this.groups)?this._raiseCollectionChanged():this._raiseCollectionChanged(_t.Remove,t,n),this.currentItem!==r&&this.onCurrentChanged()}}else v(!1,"cannot remove items (canRemove == false).")},t.prototype.removeAt=function(t){t=C(t),this.remove(this._pgView[t])},t.prototype._trackItemChanged=function(t){if(this._trackChanges){var e=this.sourceCollection;if(e&&e.indexOf(t)>-1){var n=this._chgEdited.indexOf(t),r=_t.Change;if(n<0&&this._chgAdded.indexOf(t)<0)this._chgEdited.push(t);else if(n>-1){i=new mt(r,t,n);this._chgEdited.onCollectionChanged(i)}else if((n=this._chgAdded.indexOf(t))>-1){var i=new mt(r,t,n);this._chgAdded.onCollectionChanged(i)}}}},t.prototype._extend=function(t,e){for(var n in e)t[n]=e[n]},t.prototype._sameContent=function(t,e){for(var n in e)if(!this._sameValue(t[n],e[n]))return!1;for(var n in t)if(!this._sameValue(t[n],e[n]))return!1;return!0},t.prototype._sameValue=function(t,e){return t===e||ot.equals(t,e)},Object.defineProperty(t.prototype,"canChangePage",{get:function(){return this._canChangePage},set:function(t){this._canChangePage=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPageChanging",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemCount",{get:function(){return this._pgView.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageIndex",{get:function(){return this._pgIdx},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageSize",{get:function(){return this._pgSz},set:function(t){t!=this._pgSz&&(this._pgSz=C(t),this.refresh())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalItemCount",{get:function(){return this._view.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageCount",{get:function(){return this.pageSize?Math.ceil(this.totalItemCount/this.pageSize):1},enumerable:!0,configurable:!0}),t.prototype.moveToFirstPage=function(){return this.moveToPage(0)},t.prototype.moveToLastPage=function(){return this.moveToPage(this.pageCount-1)},t.prototype.moveToPreviousPage=function(){return this.moveToPage(this.pageIndex-1)},t.prototype.moveToNextPage=function(){return this.moveToPage(this.pageIndex+1)},t.prototype.moveToPage=function(t){var e=_(t,0,this.pageCount-1);if(e!=this._pgIdx){this.canChangePage||v(!1,"cannot change pages (canChangePage == false).");var n=new yt(e);this.onPageChanging(n)&&(this._pgIdx=e,this._pgView=this._getPageView(),this._idx=0,this.groupDescriptions&&0!=this.groupDescriptions.length?this.refresh():this.onCollectionChanged(),this.onPageChanged())}return this._pgIdx==t},t.prototype.onPageChanged=function(t){void 0===t&&(t=ht.empty),this.pageChanged.raise(this,t)},t.prototype.onPageChanging=function(t){return this.pageChanging.raise(this,t),!t.cancel},t.prototype._getFullGroup=function(t){var e=this._getGroupByPath(this._fullGroups,t.level,t._path);return null!=e&&(t=e),t},t.prototype._getGroupByPath=function(t,e,n){for(var r=0;r<t.length;r++){var i=t[r];if(i.level==e&&i._path==n)return i;if(i.level<e&&0==n.indexOf(i._path)&&null!=(i=this._getGroupByPath(i.groups,e,n)))return i}return null},t.prototype._getPageView=function(){if(this.pageSize<=0||this._pgIdx<0)return this._view;var t=this._pgSz*this._pgIdx,e=Math.min(t+this._pgSz,this._view.length);return this._view.slice(t,e)},t.prototype._createGroups=function(t){if(!this._grpDesc||!this._grpDesc.length)return null;for(var e=[],n={},r=null,o=0;o<t.length;o++)for(var s=t[o],a=e,u=this._grpDesc.length,c="",h=0;h<u;h++){var l=this._grpDesc[h],p=l.groupNameFromItem(s,h),f=h==u-1;!(r=n[c])&&i(p)&&(r={},n[c]=r);var d=this._getGroup(l,a,r,p,h,f);c+="/"+p,d._path=c,f&&d.items.push(s),a=d.groups}return e},t.prototype._getGroupsDigest=function(t){for(var e="",n=0;null!=t&&n<t.length;n++){var r=t[n];e+="{"+r.name+":"+(r.items?r.items.length:"*"),r.groups.length>0&&(e+=",",e+=this._getGroupsDigest(r.groups)),e+="}"}return e},t.prototype._mergeGroupItems=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r._isBottomLevel)for(var i=this._mergeGroupItems(r.groups),o=0,s=i.length;o<s;o++)r._items.push(i[o]);for(var o=0,s=r._items.length;o<s;o++)e.push(r._items[o])}return e},t.prototype._getGroup=function(t,e,n,r,o,s){var a;if(n&&i(r)){if(a=n[r])return a}else for(var u=0;u<e.length;u++)if(t.namesMatch(e[u].name,r))return e[u];var c=new Pt(t,r,o,s);return e.push(c),n&&(n[r]=c),c},t}();e.CollectionView=Mt;var Pt=function(){function t(t,e,n,r){this._gd=t,this._name=e,this._level=n,this._isBottomLevel=r,this._groups=[],this._items=[]}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBottomLevel",{get:function(){return this._isBottomLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groupDescription",{get:function(){return this._gd},enumerable:!0,configurable:!0}),t.prototype.getAggregate=function(t,e,n){var i=r(n,Mt);return Y(t,(i?i._getFullGroup(this):this).items,e)},t}();e.CollectionViewGroup=Pt;var Ot=function(){function t(t){this._showAutoTipBnd=this._showAutoTip.bind(this),this._hideAutoTipBnd=this._hideAutoTip.bind(this),this._html=!0,this._gap=6,this._showAtMouse=!1,this._showDelay=500,this._hideDelay=0,this._tips=[],this.popup=new ct,m(this,t)}return t.prototype.setTooltip=function(t,e){t=j(t),e=this._getContent(e);var n=this._indexOf(t);n>-1&&(this._detach(t),this._tips.splice(n,1)),e&&(this._attach(t),this._tips.push({element:t,content:e}))},t.prototype.getTooltip=function(t){t=j(t);for(var e=this._tips,n=0;n<e.length;n++)if(e[n].element==t)return e[n].content;return null},t.prototype.show=function(e,n,r){e=j(e),n=this._getContent(n),r||(r=it.fromBoundingRect(e.getBoundingClientRect()));var i=t._eTip;i||(T(i=t._eTip=document.createElement("div"),"wj-tooltip"),i.style.visibility="none"),this._setContent(n);var o=new Ft(n);this.onPopup(o),o.content&&!o.cancel&&(document.body.appendChild(i),this._setContent(o.content),i.style.minWidth="",q(i,r=new it(r.left-(i.offsetWidth-r.width)/2,r.top-this.gap,i.offsetWidth,r.height+2*this.gap),!0),document.addEventListener("mousedown",this._hideAutoTipBnd))},t.prototype.hide=function(){var e=t._eTip;e&&(L(e),e.innerHTML=""),document.removeEventListener("mousedown",this._hideAutoTipBnd)},t.prototype.dispose=function(){var t=this;this._tips.forEach(function(e){t._detach(e.element)}),this._tips.splice(0,this._tips.length)},Object.defineProperty(t.prototype,"isVisible",{get:function(){var e=t._eTip;return null!=e&&null!=e.parentElement&&e.offsetWidth>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isContentHtml",{get:function(){return this._html},set:function(t){this._html=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gap",{get:function(){return this._gap},set:function(t){this._gap=b(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showAtMouse",{get:function(){return this._showAtMouse},set:function(t){this._showAtMouse=w(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showDelay",{get:function(){return this._showDelay},set:function(t){this._showDelay=C(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideDelay",{get:function(){return this._hideDelay},set:function(t){this._hideDelay=C(t)},enumerable:!0,configurable:!0}),t.prototype.onPopup=function(t){return this.popup&&this.popup.raise(this,t),!t.cancel},t.prototype._indexOf=function(t){for(var e=0;e<this._tips.length;e++)if(this._tips[e].element==t)return e;return-1},t.prototype._attach=function(t){t.addEventListener("mouseenter",this._showAutoTipBnd),t.addEventListener("mouseleave",this._hideAutoTipBnd),t.addEventListener("click",this._showAutoTipBnd)},t.prototype._detach=function(t){t.removeEventListener("mouseenter",this._showAutoTipBnd),t.removeEventListener("mouseleave",this._hideAutoTipBnd),t.removeEventListener("click",this._showAutoTipBnd)},t.prototype._showAutoTip=function(t){var e=this;if(!t.defaultPrevented)if("click"!=t.type||dt._touching){var n="mouseenter"==t.type?this._showDelay:0;this._clearTimeouts(),this._toShow=setTimeout(function(){var n=e._indexOf(t.target);if(n>-1){var r=e._tips[n],i=e._showAtMouse?new it(t.clientX,t.clientY,0,0):null;e.show(r.element,r.content,i),e._hideDelay>0&&(e._toHide=setTimeout(function(){e.hide()},e._hideDelay))}},n)}else this._hideAutoTip()},t.prototype._hideAutoTip=function(){this._clearTimeouts(),this.hide()},t.prototype._clearTimeouts=function(){this._toShow&&(clearTimeout(this._toShow),this._toShow=null),this._toHide&&(clearTimeout(this._toHide),this._toHide=null)},t.prototype._getContent=function(t){if((t=y(t))&&"#"==t[0]){var e=j(t);e&&(t=e.innerHTML)}return t},t.prototype._setContent=function(e){var n=t._eTip;n&&(this.isContentHtml?n.innerHTML=e:n.textContent=e)},t}();e.Tooltip=Ot;var Ft=function(t){function e(e){var n=t.call(this)||this;return n._content=y(e),n}return __extends(e,t),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){this._content=y(t)},enumerable:!0,configurable:!0}),e}(lt);e.TooltipEventArgs=Ft;var Tt=function(){function t(t){this._r=0,this._g=0,this._b=0,this._a=1,t&&this._parse(t)}return Object.defineProperty(t.prototype,"r",{get:function(){return this._r},set:function(t){this._r=_(b(t),0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._g},set:function(t){this._g=_(b(t),0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b=_(b(t),0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a=_(b(t),0,1)},enumerable:!0,configurable:!0}),t.prototype.equals=function(e){return e instanceof t&&this.r==e.r&&this.g==e.g&&this.b==e.b&&this.a==e.a},t.prototype.toString=function(){var t=Math.round(100*this.a);return t>99?"#"+((1<<24)+(this.r<<16)+(this.g<<8)+this.b).toString(16).slice(1):"rgba("+this.r+","+this.g+","+this.b+","+t/100+")"},t.fromRgba=function(e,n,r,i){void 0===i&&(i=1);var o=new t(null);return o.r=Math.round(_(b(e),0,255)),o.g=Math.round(_(b(n),0,255)),o.b=Math.round(_(b(r),0,255)),o.a=_(b(i),0,1),o},t.fromHsb=function(e,n,r,i){void 0===i&&(i=1);var o=t._hsbToRgb(_(b(e),0,1),_(b(n),0,1),_(b(r),0,1));return t.fromRgba(o[0],o[1],o[2],i)},t.fromHsl=function(e,n,r,i){void 0===i&&(i=1);var o=t._hslToRgb(_(b(e),0,1),_(b(n),0,1),_(b(r),0,1));return t.fromRgba(o[0],o[1],o[2],i)},t.fromString=function(e){var n=new t(null);return n._parse(y(e))?n:null},t.prototype.getHsb=function(){return t._rgbToHsb(this.r,this.g,this.b)},t.prototype.getHsl=function(){return t._rgbToHsl(this.r,this.g,this.b)},t.interpolate=function(e,n,r){r=_(b(r),0,1);var i=t._rgbToHsl(e.r,e.g,e.b),o=t._rgbToHsl(n.r,n.g,n.b),s=1-r,a=e.a*s+n.a*r,u=[i[0]*s+o[0]*r,i[1]*s+o[1]*r,i[2]*s+o[2]*r],c=t._hslToRgb(u[0],u[1],u[2]);return t.fromRgba(c[0],c[1],c[2],a)},t.toOpaque=function(e,n){if(1==(e=o(e)?t.fromString(e):M(e,t)).a)return e;n=null==n?t.fromRgba(255,255,255,1):o(n)?t.fromString(n):M(n,t);var r=e.a,i=1-r;return t.fromRgba(e.r*r+n.r*i,e.g*r+n.g*i,e.b*r+n.b*i)},t.prototype._parse=function(e){if("transparent"==(e=e.toLowerCase()))return this._r=this._g=this._b=this._a=0,!0;if(e&&0!=e.indexOf("#")&&0!=e.indexOf("rgb")&&0!=e.indexOf("hsl")){var n=document.createElement("div");n.style.color=e;var r=n.style.color;r==e&&((r=window.getComputedStyle(n).color)||(document.body.appendChild(n),r=window.getComputedStyle(n).color,L(n))),e=r.toLowerCase()}if(0==e.indexOf("#"))return 4==e.length?(this.r=parseInt(e[1]+e[1],16),this.g=parseInt(e[2]+e[2],16),this.b=parseInt(e[3]+e[3],16),this.a=1,!0):7==e.length&&(this.r=parseInt(e.substr(1,2),16),this.g=parseInt(e.substr(3,2),16),this.b=parseInt(e.substr(5,2),16),this.a=1,!0);if(0==e.indexOf("rgb")){var i=e.indexOf("("),o=e.indexOf(")");if(i>-1&&o>-1&&(s=e.substr(i+1,o-(i+1)).split(",")).length>2)return this.r=parseInt(s[0]),this.g=parseInt(s[1]),this.b=parseInt(s[2]),this.a=s.length>3?parseFloat(s[3]):1,!0}if(0==e.indexOf("hsl")){var i=e.indexOf("("),o=e.indexOf(")");if(i>-1&&o>-1){var s=e.substr(i+1,o-(i+1)).split(",");if(s.length>2){var a=parseInt(s[0])/360,u=parseInt(s[1]),c=parseInt(s[2]);s[1].indexOf("%")>-1&&(u/=100),s[2].indexOf("%")>-1&&(c/=100);var h=t._hslToRgb(a,u,c);return this.r=h[0],this.g=h[1],this.b=h[2],this.a=s.length>3?parseFloat(s[3]):1,!0}}}return!1},t._hslToRgb=function(e,n,r){v(e>=0&&e<=1&&n>=0&&n<=1&&r>=0&&r<=1,"bad HSL values");var i,o,s;if(0==n)i=o=s=r;else{var a=r<.5?r*(1+n):r+n-r*n,u=2*r-a;i=t._hue2rgb(u,a,e+1/3),o=t._hue2rgb(u,a,e),s=t._hue2rgb(u,a,e-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*s)]},t._hue2rgb=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},t._rgbToHsl=function(t,e,n){v(t>=0&&t<=255&&e>=0&&e<=255&&n>=0&&n<=255,"bad RGB values"),t/=255,e/=255,n/=255;var r,i,o=Math.max(t,e,n),s=Math.min(t,e,n),a=(o+s)/2;if(o==s)r=i=0;else{var u=o-s;switch(i=a>.5?u/(2-o-s):u/(o+s),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return[r,i,a]},t._rgbToHsb=function(e,n,r){v(e>=0&&e<=255&&n>=0&&n<=255&&r>=0&&r<=255,"bad RGB values");var i=t._rgbToHsl(e,n,r);return t._hslToHsb(i[0],i[1],i[2])},t._hsbToRgb=function(e,n,r){var i=t._hsbToHsl(e,n,r);return t._hslToRgb(i[0],i[1],i[2])},t._hsbToHsl=function(t,e,n){v(t>=0&&t<=1&&e>=0&&e<=1&&n>=0&&n<=1,"bad HSB values");var r=_(n*(2-e)/2,0,1),i=1-Math.abs(2*r-1),o=_(i>0?n*e/i:e,0,1);return v(!isNaN(r)&&!isNaN(o),"bad conversion to HSL"),[t,o,r]},t._hslToHsb=function(t,e,n){v(t>=0&&t<=1&&e>=0&&e<=1&&n>=0&&n<=1,"bad HSL values");var r=_(1==n?1:(2*n+e*(1-Math.abs(2*n-1)))/2,0,1),i=_(r>0?2*(r-n)/r:e,0,1);return v(!isNaN(r)&&!isNaN(i),"bad conversion to HSB"),[t,i,r]},t}();e.Color=Tt;var It=function(){function t(){}return t.copy=function(e){t._copyPaste(y(e),null)},t.paste=function(e){t._copyPaste(null,A(e))},t._copyPaste=function(t,e){for(var n=k(),r=V(n,".wj-control");r&&dt.getControl(r);)r=r.parentElement;if(r=r||document.body){var i=N('<textarea class="wj-clipboard" style="position:fixed;opacity:0"/>',r);o(t)&&(i.value=t),i.select(),i.onkeydown=function(t){t.preventDefault()},setTimeout(function(){n.focus(),L(i),c(e)&&e(i.value)},dt._CLIPBOARD_DELAY)}},t}();e.Clipboard=It,e.showPopup=q,e.hidePopup=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=!1);var r=null;return n?r=G(function(n){t.style.opacity=(1-n).toString(),1==n&&(K(t,e),t.style.opacity="")}):K(t,e),r};var St=function(){function t(t){this._copyCss=!0,null!=t&&m(this,t)}return Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(t){this._title=y(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"copyCss",{get:function(){return this._copyCss},set:function(t){this._copyCss=w(t)},enumerable:!0,configurable:!0}),t.prototype.addCSS=function(t){this._css||(this._css=[]),this._css.push(t)},t.prototype.append=function(t){var e=this._getDocument(),n=e.body,r=!1;if(n)if(o(t))n.appendChild(N(t));else if(t instanceof Node){i=this._cloneNode(t);n.appendChild(i)}else r=!0;else if(o(t))e.write(t);else if(t instanceof HTMLElement){var i=this._cloneNode(t);e.write(i.outerHTML)}else r=!0;r&&v(!1,"child parameter should be an HTML node or an HTML string.")},t.prototype.print=function(){var t=this;this._iframe&&(this._close(),setTimeout(function(){var e=t._iframe.contentWindow,n="onafterprint"in e&&!W();n&&(e.onafterprint=function(){L(t._iframe),t._iframe=null}),document.queryCommandSupported("print")?e.document.execCommand("print",!1,null):(e.focus(),e.print()),n||(L(t._iframe),t._iframe=null)},100))},t.prototype._cloneNode=function(t){var e=t.cloneNode(!0);return t instanceof HTMLElement&&e instanceof HTMLElement&&["select","textarea"].forEach(function(n){for(var r=t.querySelectorAll(n),i=e.querySelectorAll(n),o=0;o<r.length;o++)i[o].value=r[o].value}),e},t.prototype._getDocument=function(){return this._iframe||(this._iframe=document.createElement("iframe"),T(this._iframe,"wj-printdocument"),z(this._iframe,{position:"fixed",left:1e4,top:1e4}),document.body.appendChild(this._iframe),this._iframe.contentDocument.write('<body style="position:static"/>')),this._iframe.contentDocument},t.prototype._close=function(){var t=this._getDocument();if(t.close(),t.title=null!=this.title?this.title:document.title,t.title&&t.title.trim()||(t.title=" "),this._copyCss){for(var e=document.head.querySelectorAll("link"),n=0;n<e.length;n++){var r=e[n];if(r.href.match(/\.css$/i)&&r.rel.match(/stylesheet/i)){s=U(r.href,{async:!1});this._addStyle(s.responseText)}}for(var i=document.head.querySelectorAll("STYLE"),n=0;n<i.length;n++)this._addStyle(i[n].textContent)}if(this._css)for(n=0;n<this._css.length;n++){var o=t.createElement("style"),s=U(this._css[n],{async:!1});o.textContent=s.responseText,t.head.appendChild(o)}},t.prototype._addStyle=function(t){var e=this._getDocument(),n=e.createElement("style");n.textContent=t,e.head.appendChild(n)},t}();e.PrintDocument=St;var Dt=function(){function t(t,e,n){void 0===e&&(e=null),void 0===n&&(n="_"),this._promptChar="_",this._mskArr=[],this._full=!0,this._hbInput=this._input.bind(this),this._hbKeyDown=this._keydown.bind(this),this._hbKeyPress=this._keypress.bind(this),this._hbCompositionStart=this._compositionstart.bind(this),this._hbCompositionEnd=this._compositionend.bind(this),this.mask=e,this.input=t,this.promptChar=n,this._connect(!0),this._evtInput=document.createEvent("HTMLEvents"),this._evtInput.initEvent("input",!0,!1)}return Object.defineProperty(t.prototype,"input",{get:function(){return this._tbx},set:function(t){this._connect(!1),this._tbx=t,this._connect(!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mask",{get:function(){return this._msk},set:function(t){t!=this._msk&&(this._msk=y(t,!0),this._parseMask(),this._valueChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"promptChar",{get:function(){return this._promptChar},set:function(t){t!=this._promptChar&&(this._promptChar=y(t,!1),v(1==this._promptChar.length,"promptChar must be a string with length 1."),this._valueChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maskFull",{get:function(){return this._full},enumerable:!0,configurable:!0}),t.prototype.getMaskRange=function(){return this._mskArr.length?[this._firstPos,this._lastPos]:[0,this._tbx.value.length-1]},t.prototype.getRawValue=function(){var t=this._tbx.value,e="";if(!this.mask)return t;for(var n=0;n<this._mskArr.length&&n<t.length;n++)this._mskArr[n].literal||t[n]==this._promptChar||(e+=t[n]);return e},t.prototype.refresh=function(){this._parseMask(),this._valueChanged()},t.prototype._input=function(t){var e=this;this._composing?t.stopImmediatePropagation():setTimeout(function(){e._valueChanged()})},t.prototype._keydown=function(t){if(t.keyCode==Q.Back){var e=this._tbx.selectionStart,n=this._tbx.selectionEnd;if(e<=this._firstPos&&n==e)return t.preventDefault(),void(this._backSpace=!1)}this._backSpace=t.keyCode==Q.Back},t.prototype._keypress=function(t){t.ctrlKey||t.metaKey||t.altKey||this._composing||!this._preventKey(t.charCode)||t.preventDefault()},t.prototype._compositionstart=function(t){this._composing=!0},t.prototype._compositionend=function(t){var e=this;this._composing&&(this._composing=!1,setTimeout(function(){e._valueChanged()&&e._tbx.dispatchEvent(e._evtInput)}))},t.prototype._preventKey=function(t){if(t&&this._mskArr.length){var e=this._tbx,n=e.selectionStart,r=String.fromCharCode(t);if(n<this._firstPos&&D(e,n=this._firstPos),n>=this._mskArr.length)return!0;var i=this._mskArr[n];if(i.literal)this._validatePosition(n);else if(i.wildCard!=r&&!this._isCharValid(i.wildCard,r))return!0}return!1},t.prototype._connect=function(t){var e=this._tbx;e&&(t?(this._autoComplete=e.autocomplete,this._spellCheck=e.spellcheck,e.autocomplete="off",e.spellcheck=!1,e.addEventListener("input",this._hbInput),e.addEventListener("keydown",this._hbKeyDown,!0),e.addEventListener("keypress",this._hbKeyPress,!0),e.addEventListener("compositionstart",this._hbCompositionStart,!0),e.addEventListener("compositionend",this._hbCompositionEnd,!0),e.addEventListener("blur",this._hbCompositionEnd,!0),this._valueChanged()):(e.autocomplete=this._autoComplete,e.spellcheck=this._spellCheck,e.removeEventListener("input",this._hbInput),e.removeEventListener("keydown",this._hbKeyDown,!0),e.removeEventListener("keypress",this._hbKeyPress,!0),e.removeEventListener("compositionstart",this._hbCompositionStart,!0),e.removeEventListener("compositionend",this._hbCompositionEnd,!0),e.removeEventListener("blur",this._hbCompositionEnd,!0)))},t.prototype._valueChanged=function(){if(!this._tbx||!this._msk)return!1;var t=this._tbx,e=t.value.length<2,n=t.selectionStart,r=n>0?t.value[n-1]:"",i=t.value;t.value=this._applyMask(),e&&(n=this._firstPos+1);var o=n>0?t.value[n-1]:"";return n>0&&o==this._promptChar&&r!=this.promptChar&&n--,n==i.length&&(n=this._matchEnd),this._validatePosition(n),i!=t.value},t.prototype._applyMask=function(){this._full=!0,this._matchEnd=0;var t=this._tbx.value;if(!this._msk)return t;if(!t&&!this._tbx.required)return t;var e="",n=0,r=this._promptChar;t=this._handleVagueLiterals(t);for(var i=0;i<this._mskArr.length;i++){var o=this._mskArr[i],s=o.literal;if(s&&s==t[n]&&n++,o.wildCard){if(s=r,t){for(var a=n;a<t.length;a++)if(this._isCharValid(o.wildCard,t[a])){switch(s=t[a],o.charCase){case">":s=s.toUpperCase();break;case"<":s=s.toLowerCase()}s!=r&&(this._matchEnd=e.length+1);break}n=a+1}s==r&&(this._full=!1)}e+=s}return e},t.prototype._handleVagueLiterals=function(t){if(t.length>this._mskArr.length+1)return t;var e=t.length-this._mskArr.length;if(0!=e&&t.length>1){for(var n=-1,r=Math.max(0,this._tbx.selectionStart-e);r<this._mskArr.length;r++)if(this._mskArr[r].vague){n=r;break}if(n>-1)if(e<0){var i=Array(1-e).join(this._promptChar),o=n+e;o>-1&&(t=t.substr(0,o)+i+t.substr(o))}else{for(;n>0&&this._mskArr[n-1].literal;)n--;t=t.substr(0,n)+t.substr(n+e)}}return t},t.prototype._isCharValid=function(e,n){var r=this._promptChar;switch(e){case"0":return n>="0"&&n<="9"||n==r;case"9":return n>="0"&&n<="9"||" "==n||n==r;case"#":return n>="0"&&n<="9"||" "==n||"+"==n||"-"==n||n==r;case"L":return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==r;case"l":return n>="a"&&n<="z"||n>="A"&&n<="Z"||" "==n||n==r;case"A":return n>="0"&&n<="9"||n>="a"&&n<="z"||n>="A"&&n<="Z"||n==r;case"a":return n>="0"&&n<="9"||n>="a"&&n<="z"||n>="A"&&n<="Z"||" "==n||n==r;case"９":return n>="０"&&n<="９"||n==r;case"Ｊ":case"Ｇ":return!("Ｇ"==e&&t._X_DBCS_BIG_HIRA.indexOf(n)>-1)&&(n>="ぁ"&&n<="ゖ"||n==r);case"Ｋ":case"Ｎ":return!("Ｎ"==e&&t._X_DBCS_BIG_KATA.indexOf(n)>-1)&&(n>="ァ"&&n<="ヺ"||n==r);case"Ｚ":return n<="!"||n>="ÿ"||n==r;case"H":return n>="!"&&n<="ÿ"||n==r;case"K":case"N":return!("N"==e&&t._X_SBCS_BIG_KATA.indexOf(n)>-1)&&(n>="ｦ"&&n<="ﾟ"||n==r)}return!1},t.prototype._validatePosition=function(t){var e=this._mskArr;if(this._backSpace)for(;t>0&&t<e.length&&e[t-1].literal;)t--;if(0==t||!this._backSpace)for(;t<e.length&&e[t].literal;)t++;k()==this._tbx&&D(this._tbx,t),this._backSpace=!1},t.prototype._parseMask=function(){this._mskArr=[],this._firstPos=-1,this._lastPos=-1;for(var t,n=this._msk,r="|",i=0;n&&i<n.length;i++)switch(n[i]){case"0":case"9":case"#":case"A":case"a":case"L":case"l":case"９":case"Ｊ":case"Ｇ":case"Ｋ":case"Ｎ":case"Ｚ":case"K":case"N":case"H":this._firstPos<0&&(this._firstPos=this._mskArr.length),this._lastPos=this._mskArr.length,this._mskArr.push(new Lt(n[i],r));break;case".":case",":case":":case"/":case"$":switch(n[i]){case".":case",":t=e.culture.Globalize.numberFormat[n[i]];break;case":":case"/":t=e.culture.Globalize.calendar[n[i]];break;case"$":t=e.culture.Globalize.numberFormat.currency.symbol}for(s=0;s<t.length;s++)this._mskArr.push(new Lt(t[s]));break;case"<":case">":case"|":r=n[i];break;case"\\":i<n.length-1&&i++,this._mskArr.push(new Lt(n[i]));break;default:this._mskArr.push(new Lt(n[i]))}for(i=0;i<this._mskArr.length;i++){var o=this._mskArr[i];if(o.literal)for(var s=0;s<i;s++){var a=this._mskArr[s];if(a.wildCard&&this._isCharValid(a.wildCard,o.literal)){o.vague=!0;break}}}},t._X_DBCS_BIG_HIRA="ぁぃぅぇぉっゃゅょゎゕゖ",t._X_DBCS_BIG_KATA="ァィゥェォッャュョヮヵヶ",t._X_SBCS_BIG_KATA="ｧｨｩｪｫｬｭｮｯ",t}();e._MaskProvider=Dt;var Lt=function(){return function(t,e){e?(this.wildCard=t,this.charCase=e):this.literal=t}}();e._MaskElement=Lt;var kt=function(){function t(t){this._isDown=!1,this._mousedownBnd=this._mousedown.bind(this),this._mouseupBnd=this._mouseup.bind(this),this._onClickBnd=this._onClick.bind(this),this.element=t,this._connect(!0)}return Object.defineProperty(t.prototype,"element",{get:function(){return this._e},set:function(t){this._connect(!1),this._e=M(t,HTMLElement,!0),this._connect(!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=w(t)},enumerable:!0,configurable:!0}),t.prototype._connect=function(t){if(this._e){t?this._e.addEventListener("mousedown",this._mousedownBnd):this._e.removeEventListener("mousedown",this._mousedownBnd)}},t.prototype._clearTimeouts=function(){this._toRepeat&&(clearInterval(this._toRepeat),this._toRepeat=null),this._toDelay&&(clearInterval(this._toDelay),this._toDelay=null)},t.prototype._mousedown=function(e){var n=this;this._isDown&&this._mouseup(null),this._disabled||(this._isDown=!0,t._stopEvents.forEach(function(t){document.addEventListener(t,n._mouseupBnd)}),this._clearTimeouts(),this._toDelay=setTimeout(function(){n._isDown&&(n._onClick(),n._toRepeat=setTimeout(n._onClickBnd,dt._CLICK_REPEAT))},dt._CLICK_DELAY))},t.prototype._mouseup=function(e){var n=this;this._isDown&&e&&"mouseup"==e.type&&e.preventDefault(),t._stopEvents.forEach(function(t){document.removeEventListener(t,n._mouseupBnd)}),this._clearTimeouts(),this._isDown=!1},t.prototype._onClick=function(){this._e.click(),this._clearTimeouts(),this._isDown&&(this._toRepeat=setTimeout(this._onClickBnd,dt._CLICK_REPEAT))},t._stopEvents=["mouseup","mouseout","keydown"],t}();e._ClickRepeater=kt;var Rt=null!=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i);e.isMobile=function(){return Rt};var jt=null!=navigator.userAgent.match(/Firefox\//);e.isFirefox=W;var Nt=null!=navigator.userAgent.match(/^((?!chrome|android).)*safari/i);e.isSafari=function(){return Nt};var Ht=null!=navigator.userAgent.match(/MSIE |Trident\/|Edge\//);e.isIE=X;var Vt=!1;e.isIE9=function(){return Vt};var Bt=!1;document.addEventListener("test",function(t){},{get passive(){return Bt=!0,!0}}),e.getEventOptions=$,e._startDrag=function(t,e){t.effectAllowed=e,W()&&t.setData("text","")},document.doctype&&navigator.appVersion.indexOf("MSIE 9")>-1&&(Vt=!0,document.addEventListener("mousemove",function(t){if(1==t.which){var e=V(t.target,".wj-control");if(e&&!e.style.cursor)for(var n=t.target;n;n=n.parentNode)if(n.attributes&&n.attributes.draggable)return n.dragDrop(),!1}}));var zt="requestAnimationFrame";if(!window[zt]){var Gt=0;window[zt]=function(t){var e=Date.now(),n=16-(e-Gt),r=n>0?n:0;return Gt=e+r,setTimeout(function(){t(Gt)},r)},window.cancelAnimationFrame=clearTimeout}});