@mescius/wijmo 5.20251.42-rc → 5.20252.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20251.42
3
+ * Wijmo Library 5.20252.42
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- "use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t;return e},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var selfModule=__importStar(require("@mescius/wijmo")),Binding=function(){function Binding(e){this.path=e}Object.defineProperty(Binding.prototype,"path",{get:function(){return this._path},set:function(e){this._path=e;this._parts=e?e.split("."):[];for(var t=0;t<this._parts.length;t++){var n=this._parts[t],r=n.indexOf("[");if(r>-1){this._parts[t]=n.substr(0,r);this._parts.splice(++t,0,parseInt(n.substr(r+1)))}}this._key=1==this._parts.length?this._parts[0]:null},enumerable:!0,configurable:!0});Binding.prototype.getValue=function(e){if(e){if(this._key)return e[this._key];if(this._path&&this._path in e)return e[this._path];for(var t=0;t<this._parts.length&&e;t++)e=e[this._parts[t]]}return e};Binding.prototype.setValue=function(e,t){if(e)try{var n=this._path;if(n in e){e[n]=t;return e[n]==t}for(var r=0;r<this._parts.length-1;r++)if(null==(e=e[this._parts[r]]))return!1;e[n=this._parts[this._parts.length-1]]=t;return e[n]==t}catch(e){return!1}return!1};return Binding}();exports.Binding=Binding;var EventHandler=function EventHandler(e,t){this.handler=e;this.self=t},Event=function(){function Event(e){this._handlers=[];this._handlersChanged=e}Event.prototype.addHandler=function(e,t){e=asFunction(e);this._handlers.push(new EventHandler(e,t));isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.getHandler=function(e){void 0===e&&(e=0);var t=this._handlers[e];if(t)return t.handler};Event.prototype.removeHandler=function(e,t){var n=!1;e=asFunction(e);for(var r=0;r<this._handlers.length;r++){var i=this._handlers[r];if(!(i.handler!=e&&null!=e||i.self!=t&&null!=t)){this._handlers.splice(r--,1);n=!0;if(e&&t)break}}n&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.removeAllHandlers=function(){var e=this._handlers.length>0;this._handlers.length=0;e&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.raise=function(e,t){void 0===t&&(t=EventArgs.empty);for(var n=this._handlers,r=0;r<n.length;r++){var i=n[r];i.handler.call(i.self,e,t);n[r]!==i&&r--}};Object.defineProperty(Event.prototype,"hasHandlers",{get:function(){return this._handlers.length>0},enumerable:!0,configurable:!0});Object.defineProperty(Event.prototype,"handlerCount",{get:function(){return this._handlers.length},enumerable:!0,configurable:!0});return Event}();exports.Event=Event;var EventArgs=function(){function EventArgs(){}EventArgs.empty=new EventArgs;return EventArgs}();exports.EventArgs=EventArgs;var CancelEventArgs=function(e){__extends(CancelEventArgs,e);function CancelEventArgs(){var t=null!==e&&e.apply(this,arguments)||this;t.cancel=!1;return t}return CancelEventArgs}(EventArgs);exports.CancelEventArgs=CancelEventArgs;var PropertyChangedEventArgs=function(e){__extends(PropertyChangedEventArgs,e);function PropertyChangedEventArgs(t,n,r){var i=e.call(this)||this;i._name=t;i._oldVal=n;i._newVal=r;return i}Object.defineProperty(PropertyChangedEventArgs.prototype,"propertyName",{get:function(){return this._name},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"oldValue",{get:function(){return this._oldVal},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"newValue",{get:function(){return this._newVal},enumerable:!0,configurable:!0});return PropertyChangedEventArgs}(EventArgs);exports.PropertyChangedEventArgs=PropertyChangedEventArgs;var NotifyCollectionChangedAction,RequestErrorEventArgs=function(e){__extends(RequestErrorEventArgs,e);function RequestErrorEventArgs(t,n){var r=e.call(this)||this;r._xhr=t;r._msg=n;return r}Object.defineProperty(RequestErrorEventArgs.prototype,"request",{get:function(){return this._xhr},enumerable:!0,configurable:!0});Object.defineProperty(RequestErrorEventArgs.prototype,"message",{get:function(){return this._msg},set:function(e){this._msg=e},enumerable:!0,configurable:!0});return RequestErrorEventArgs}(CancelEventArgs);exports.RequestErrorEventArgs=RequestErrorEventArgs;!function(e){e[e.Add=0]="Add";e[e.Remove=1]="Remove";e[e.Change=2]="Change";e[e.Reset=3]="Reset"}(NotifyCollectionChangedAction=exports.NotifyCollectionChangedAction||(exports.NotifyCollectionChangedAction={}));var NotifyCollectionChangedEventArgs=function(e){__extends(NotifyCollectionChangedEventArgs,e);function NotifyCollectionChangedEventArgs(t,n,r){void 0===t&&(t=NotifyCollectionChangedAction.Reset);void 0===n&&(n=null);void 0===r&&(r=-1);var i=e.call(this)||this;i.action=t;i.item=n;i.index=r;return i}NotifyCollectionChangedEventArgs.reset=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);return NotifyCollectionChangedEventArgs}(EventArgs);exports.NotifyCollectionChangedEventArgs=NotifyCollectionChangedEventArgs;var SortDescription=function(){function SortDescription(e,t){this._bnd=new Binding(e);this._asc=t}Object.defineProperty(SortDescription.prototype,"property",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});Object.defineProperty(SortDescription.prototype,"ascending",{get:function(){return this._asc},enumerable:!0,configurable:!0});return SortDescription}();exports.SortDescription=SortDescription;var PageChangingEventArgs=function(e){__extends(PageChangingEventArgs,e);function PageChangingEventArgs(t){var n=e.call(this)||this;n.newPageIndex=t;return n}return PageChangingEventArgs}(CancelEventArgs);exports.PageChangingEventArgs=PageChangingEventArgs;var GroupDescription=function(){function GroupDescription(){}GroupDescription.prototype.groupNameFromItem=function(e,t){return""};GroupDescription.prototype.namesMatch=function(e,t){return e===t};return GroupDescription}();exports.GroupDescription=GroupDescription;var PropertyGroupDescription=function(e){__extends(PropertyGroupDescription,e);function PropertyGroupDescription(t,n){var r=e.call(this)||this;r._bnd=new Binding(t);r._converter=n;return r}Object.defineProperty(PropertyGroupDescription.prototype,"propertyName",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});PropertyGroupDescription.prototype.groupNameFromItem=function(e,t){return this._converter?this._converter(e,this.propertyName):this._bnd.getValue(e)};PropertyGroupDescription.prototype.namesMatch=function(e,t){return e===t};return PropertyGroupDescription}(GroupDescription);exports.PropertyGroupDescription=PropertyGroupDescription;exports.empty={};exports.ClipboardClsNames={clipboard:"wj-clipboard"};exports.ControlClsNames={content:"wj-content",hostElement:"wj-control",template:"wj-template"};exports.ControlStateClsNames={active:"wj-state-active",checked:"wj-state-checked",collapsed:"wj-state-collapsed",collapsing:"wj-state-collapsing",disabled:"wj-state-disabled",dragSrc:"wj-state-dragsrc",empty:"wj-state-empty",focus:"wj-state-focus",focused:"wj-state-focused",invalid:"wj-state-invalid",lastSelected:"wj-state-last-selected",loading:"wj-state-loading",match:"wj-state-match",exactMatchSpace:"wj-state-exact-match-space",measuring:"wj-state-measuring",multiSelected:"wj-state-multi-selected",pinned:"wj-state-pinned",readOnly:"wj-state-readonly",selected:"wj-state-selected",sticky:"wj-state-sticky",updating:"wj-state-updating",labeledInput:".wj-labeled-input",wjError:".wj-error",errorVisible:"wj-error-visible"};exports.GlyphClsNames={backward:"wj-glyph-backward",btnGlyph:"wj-btn-glyph",calendar:"wj-glyph-calendar",circle:"wj-glyph-circle",clock:"wj-glyph-clock",down:"wj-glyph-down",downLeft:"wj-glyph-down-left",drag:"wj-glyph-drag",file:"wj-glyph-file",filter:"wj-glyph-filter",forward:"wj-glyph-forward",glyph:"wj-glyph",left:"wj-glyph-left",minus:"wj-glyph-minus",plus:"wj-glyph-plus",right:"wj-glyph-right",stepBackward:"wj-glyph-step-backward",stepForward:"wj-glyph-step-forward",up:"wj-glyph-up"};exports.InputFormElementsClsNames={btn:"wj-btn",btnDefault:"wj-btn-default",btnGroup:"wj-btn-group",btnGroupVertical:"wj-btn-group-vertical",btnsOutside:"wj-btns-outside",formControl:"wj-form-control",svgBtn:"wj-svg-btn"};exports.PrintDocumentClsNames={printDocument:"wj-printdocument"};exports.TooltipClsNames={hostElement:"wj-tooltip"};exports.UtilitesClsNames={align:"wj-align",alignVCenter:"wj-align-vcenter",animated:"wj-animated",centerVert:"wj-center-vert",close:"wj-close",hide:"wj-hide",hideOk:"wj-hide-ok",remove:"wj-remove",right:"wj-right",rtl:"wj-rtl",separator:"wj-separator"};exports.ForeignClsNames={InputClsNames:{input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"},SelectorClsNames:{columnSelector:"wj-column-selector",columnSelectorGroup:"wj-column-selector-group"}};var _agent="undefined"!=typeof navigator?navigator.userAgent:"";function isMobile(){var e=_agent.toLowerCase(),t=["android","webos","iphone","ipad","ipod","blackberry","windows phone","mobile","mobi","tablet"].some((function(t){return e.includes(t)})),n="ontouchstart"in window||navigator.maxTouchPoints>0;return t||n}exports.isMobile=isMobile;var _isiOS=null!=_agent.match(/iPad|iPhone|iPod/i);function isiOS(){return _isiOS}exports.isiOS=isiOS;var _isFF=null!=_agent.match(/Firefox\//);function isFirefox(){return _isFF}exports.isFirefox=isFirefox;var _isSafari=null!=_agent.match(/^((?!Chrome|Android).)*safari/i);function isSafari(){return _isSafari}exports.isSafari=isSafari;var _isEdge=null!=_agent.match(/Edge\/|Edg\//);function isEdge(){return _isEdge}exports.isEdge=isEdge;var _isIE=null!=_agent.match(/MSIE |Trident\/|Edge\//);function isIE(){return _isIE}exports.isIE=isIE;var _isIE9=!1;function isIE9(){return _isIE9}exports.isIE9=isIE9;var _isIE10=!1;function isIE10(){return _isIE10}exports.isIE10=isIE10;var _isChromiumBased=null;function isChromiumBased(){if(null!=_isChromiumBased)return _isChromiumBased;_isChromiumBased=!1;var e="undefined"!=typeof navigator?navigator.userAgentData:null;if(e&&e.brands)for(var t=0,n=e.brands;t<n.length;t++){if("Chromium"==n[t].brand){_isChromiumBased=!0;break}}return _isChromiumBased}exports.isChromiumBased=isChromiumBased;var _supportsPassive=!1;"undefined"!=typeof document&&document.addEventListener("test",(function(e){}),{get passive(){_supportsPassive=!0;return!0}});function getEventOptions(e,t){return _supportsPassive?{capture:e,passive:t}:e}exports.getEventOptions=getEventOptions;var _supportsFocusOptions=!1;"undefined"!=typeof document&&document.createElement("div").focus({get preventScroll(){_supportsFocusOptions=!0;return!0}});function supportsFocusOptions(){return _supportsFocusOptions}exports.supportsFocusOptions=supportsFocusOptions;function _startDrag(e,t){e.effectAllowed=t;isFirefox()&&e.setData("text","")}exports._startDrag=_startDrag;if("undefined"!=typeof document&&document.doctype){navigator.appVersion.indexOf("MSIE 10")>-1&&(_isIE10=!0);if(navigator.appVersion.indexOf("MSIE 9")>-1){_isIE9=!0;document.addEventListener("mousemove",(function(e){if(1==e.which){var t=closest(e.target,"."+exports.ControlClsNames.hostElement);if(t&&!t.style.cursor)for(var n=e.target;n;n=n.parentElement)if(n.attributes&&n.attributes.draggable){n.dragDrop();return!1}}}))}}if("undefined"!=typeof window){var raf="requestAnimationFrame",caf="cancelAnimationFrame";if(!window[raf]){var expectedTime_1=0;window[raf]=function(e){var t=Date.now(),n=16-(t-expectedTime_1),r=n>0?n:0;expectedTime_1=t+r;return setTimeout((function(){e(expectedTime_1)}),r)};window[caf]=clearTimeout}if(!window.atob){var keys_1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",keysRe_1=new RegExp("[^"+keys_1+"]");window.atob=function(e){var t,n,r,i,o=[],s=0,a=e.length;if(keysRe_1.test(e)||/=/.test(e)&&(/=[^=]/.test(e)||/={3}/.test(e)))throw new Error("Invalid base64 data");a%4>0&&(a=(e+=Array(4-a%4+1).join("=")).length);for(;s<a;){for(n=[],i=s;s<i+4;)n.push(keys_1.indexOf(e.charAt(s++)));r=[((t=(n[0]<<18)+(n[1]<<12)+((63&n[2])<<6)+(63&n[3]))&255<<16)>>16,64===n[2]?-1:(65280&t)>>8,64===n[3]?-1:255&t];for(i=0;i<3;++i)(r[i]>=0||0===i)&&o.push(String.fromCharCode(r[i]))}return o.join("")};window.btoa=function(e){for(var t,n,r=[],i=0,o=e.length;i<o;){t=((n=[e.charCodeAt(i++),e.charCodeAt(i++),e.charCodeAt(i++)])[0]<<16)+((n[1]||0)<<8)+(n[2]||0);r.push(keys_1.charAt((t&63<<18)>>18),keys_1.charAt((258048&t)>>12),keys_1.charAt(isNaN(n[1])?64:(4032&t)>>6),keys_1.charAt(isNaN(n[2])?64:63&t))}return r.join("")}}}var _FocusService=function(){function _FocusService(){this._hasDoc="undefined"!=typeof Document;this._ae=this._nativeAe();var e=window,t=this._onBlur.bind(this),n=this._onFocus.bind(this);e.addEventListener("focusout",t,!0);e.addEventListener("focusin",n,!0);if(!isIE()){e.addEventListener("blur",t,!0);e.addEventListener("focus",n,!0)}}Object.defineProperty(_FocusService.prototype,"activeElement",{get:function(){var e=this._ae,t=this._nativeAe();e===_FocusService._noAe?e=this._ae=t:e!=t&&(this._isSpecialRoot(e)||document.body.contains(e)||(e=this._ae=t));return e!==_FocusService._noAe?e:null},enumerable:!0,configurable:!0});_FocusService.prototype._onBlur=function(e){if(e.isTrusted){var t=e.relatedTarget;this._ae=this._isSpecialRoot(t)?this._nativeAe():t}};_FocusService.prototype._onFocus=function(e){e.isTrusted&&(this._ae=this._nativeAe())};_FocusService.prototype._isSpecialRoot=function(e){return null==e||e===document.body||this._hasDoc&&e instanceof Document};_FocusService.prototype._nativeAe=function(){var e;try{e="unknown"!=typeof document.activeElement?document.activeElement:_FocusService._noAe}catch(t){e=_FocusService._noAe}return e};_FocusService.prototype.dispose=function(){if(!isIE()){window.removeEventListener("blur",this._onBlur,!0);window.removeEventListener("focus",this._onFocus,!0)}window.removeEventListener("focusout",this._onBlur,!0);window.removeEventListener("focusin",this._onFocus,!0)};_FocusService._noAe={};return _FocusService}();exports._FocusService=_FocusService;var _getProxyTarget="undefined"!=typeof window&&window.Symbol?Symbol("_getProxyTarget"):"\t_get\tProxy\tTarget\t";function _getCalculatedArray(e,t,n){var r=new WeakMap;if(!n){var i={};if(e.length){var o=e[0];for(var s in o){var a=typeof o[s];i[s]="string"==a?"":"number"==a?0:null}n=i}}return new Proxy(e,{get:function(e,i){if(i===_getProxyTarget)return e;if("string"==typeof i||"number"==typeof i){if("indexOf"==i)return function(t,n){var r=e.indexOf(t,n);r<0&&t&&(t=t[_getProxyTarget])&&(r=e.indexOf(t,n));return r};var o=parseInt(i);if(!isNaN(o)){var s=e[o];if(s&&!s[_getProxyTarget]){var a=r.get(s);if(!a){a=_createItemProxy(s,t,n);r.set(s,a)}s=a}return s}}return Reflect.get(e,i)}})}exports._getCalculatedArray=_getCalculatedArray;function _createItemProxy(e,t,n){if(!e[_getProxyTarget]){if(isIE())for(var r in t)e[r]=null;var i={get:function(e,r,i){if(r===_getProxyTarget)return e;if("constructor"===r)return function(){return Object.assign({},n||{})};var o=t[r];if(o)switch(typeof o){case"function":return o(i);case"string":return _eval(o,i)}return e[r]}};if(!isIE()){i.ownKeys=function(e){return Object.keys(e).concat(Object.keys(t))};i.getOwnPropertyDescriptor=function(e,n){return n in t?{enumerable:!0,configurable:!0,writable:!1}:Reflect.getOwnPropertyDescriptor(e,n)}}e=new Proxy(e,i)}return e}function _getTargetObject(e){return(e?e[_getProxyTarget]:null)||e}exports._getTargetObject=_getTargetObject;function _eval(e,t){var n=[t];return(new(Function.bind.apply(Function,[void 0].concat(["$"],["return "+e])))).apply(void 0,n)}var Key,DataType,_VERSION="5.20251.42";exports._CLS_STATE_DISABLED=exports.ControlStateClsNames.disabled;function getVersion(){return _VERSION}exports.getVersion=getVersion;function setLicenseKey(e){Control._licKey=e}exports.setLicenseKey=setLicenseKey;!function(e){e[e.Back=8]="Back";e[e.Tab=9]="Tab";e[e.Enter=13]="Enter";e[e.Escape=27]="Escape";e[e.Space=32]="Space";e[e.PageUp=33]="PageUp";e[e.PageDown=34]="PageDown";e[e.End=35]="End";e[e.Home=36]="Home";e[e.Left=37]="Left";e[e.Up=38]="Up";e[e.Right=39]="Right";e[e.Down=40]="Down";e[e.Delete=46]="Delete";e[e.X=88]="X";e[e.F1=112]="F1";e[e.F2=113]="F2";e[e.F3=114]="F3";e[e.F4=115]="F4";e[e.F5=116]="F5";e[e.F6=117]="F6";e[e.F7=118]="F7";e[e.F8=119]="F8";e[e.F9=120]="F9";e[e.F10=121]="F10";e[e.F11=122]="F11";e[e.F12=123]="F12";e[e.PlusKey=107]="PlusKey";e[e.EqualPlusKey=187]="EqualPlusKey";e[e.MinusKey=109]="MinusKey";e[e.HyphenMinusKey=189]="HyphenMinusKey";e[e.S=83]="S";e[e.P=80]="P";e[e.F=70]="F"}(Key=exports.Key||(exports.Key={}));!function(e){e[e.Object=0]="Object";e[e.String=1]="String";e[e.Number=2]="Number";e[e.Boolean=3]="Boolean";e[e.Date=4]="Date";e[e.Array=5]="Array"}(DataType=exports.DataType||(exports.DataType={}));function tryCast(e,t){return null==e?null:isString(t)?isFunction(e.implementsInterface)&&e.implementsInterface(t)?e:null:e instanceof t?e:null}exports.tryCast=tryCast;function isPrimitive(e){return isString(e)||isNumber(e)||isBoolean(e)||isDate(e)}exports.isPrimitive=isPrimitive;function isString(e){return"string"==typeof e}exports.isString=isString;function isNullOrWhiteSpace(e){return!e||!/\S/.test(e)}exports.isNullOrWhiteSpace=isNullOrWhiteSpace;function isNumber(e){return"number"==typeof e}exports.isNumber=isNumber;function isInt(e){return isNumber(e)&&e==Math.round(e)}exports.isInt=isInt;function isBoolean(e){return"boolean"==typeof e}exports.isBoolean=isBoolean;function isFunction(e){return"function"==typeof e}exports.isFunction=isFunction;function isUndefined(e){return void 0===e}exports.isUndefined=isUndefined;function isNullOrUndefined(e){return null==e}exports.isNullOrUndefined=isNullOrUndefined;function isDate(e){return(e instanceof Date||"[object Date]"===Object.prototype.toString.call(e))&&!isNaN(e.getTime())}exports.isDate=isDate;function isArray(e){return e instanceof Array||Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)}exports.isArray=isArray;function _isPlainArray(e){return Array.isArray(e)}exports._isPlainArray=_isPlainArray;function isObject(e){return null!=e&&"object"==typeof e&&!isDate(e)&&!isArray(e)}exports.isObject=isObject;function isEmpty(e){for(var t in e)return!1;return!0}exports.isEmpty=isEmpty;function _areObjectsEqual(e,t){var n=Object.entries(e),r=Object.entries(t);if(n.length!==r.length)return!1;for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1];if(!t.hasOwnProperty(a)||t[a]!==l)return!1}return!0}exports._areObjectsEqual=_areObjectsEqual;function getUniqueId(e){for(var t=e,n=0;null!=document.getElementById(t);n++)t=e+n;return t}exports.getUniqueId=getUniqueId;function getSafeUniqueId(e,t,n){void 0===t&&(t="wj");var r=e;(r=(r=(r=r.trim().toLowerCase()).replace(/[^a-z0-9_-]+/g,"-")).replace(/-+/g,"-").replace(/^-|-$/g,""))?/^[a-z]/.test(r)&&!n||(r=t+"-"+r):r=t+"-"+Date.now();for(var i=0;null!=document.getElementById(r);i++)r+=i;return r}exports.getSafeUniqueId=getSafeUniqueId;function uidGenerator(){for(var e="",t="0123456789abcdef".split(""),n=0;n<32;n++){var r=Math.floor(16*Math.random());switch(n){case 8:e+="-";break;case 12:r=4;e+="-";break;case 16:r=3&r|8;e+="-";break;case 20:e+="-"}e+=t[r]}return e}exports.uidGenerator=uidGenerator;function mouseToPage(e){if(e instanceof Point)return e;e&&e.touches&&e.touches.length>0&&(e=e.touches[0]);if(isNumber(e.clientX)&&isNumber(e.clientY))return new Point(e.clientX+pageXOffset,e.clientY+pageYOffset);throw"Mouse or touch event expected."}exports.mouseToPage=mouseToPage;function getType(e){return isNumber(e)?DataType.Number:isBoolean(e)?DataType.Boolean:isDate(e)?DataType.Date:isString(e)?DataType.String:isArray(e)?DataType.Array:DataType.Object}exports.getType=getType;function getTypes(e,t){void 0===t&&(t=1e3);if(!e)return[];var n=e.length;(t<=0||n<t)&&(t=n);var r=[];if(t){for(var i=Object.keys(e[0]),o={},s=i.slice(),a=0;a<t;a++){for(var l=e[a],u=s.length-1;u>=0;u--){var c=s[u],p=l[c];if(isPrimitive(p)){var h=Object.getOwnPropertyDescriptor(e[a],c);o[c]={binding:c,dataType:getType(p),isReadOnly:h&&!h.writable&&!h.set};s.splice(u,1)}}if(!s.length)break}for(a=0;a<i.length;a++){var f=o[i[a]];f&&r.push(f)}}return r}exports.getTypes=getTypes;function changeType(e,t,n,r){if(null!=e){var i=DataType;if(isString(e))switch(t){case i.Number:var o=Globalize.parseFloat(e,n);return isNaN(o)?e:o;case i.Date:var s=Globalize.parseDate(e,n,isDate(r)?r:null);s||n||!e||(s=new Date(e));return s&&isFinite(s.getTime())?s:e;case i.Boolean:switch(e.toLowerCase()){case"true":return!0;case"false":return!1}return e;case i.Array:try{var a=e.split(",").map((function(e){return(e=e.trim()).match(/^(\+|\-)?\d+\.?\d*$/)?e:'"'+e+'"'}));return JSON.parse("["+a.join(",")+"]")}catch(e){}}if(t==DataType.String)return Globalize.format(e,n)}return e}exports.changeType=changeType;function toFixed(e,t,n){if(n){var r=e.toString(),i=r.indexOf("e"),o=r.indexOf(".");if(i>-1){if("-"===r[i+1]){var s=parseFloat(r.substr(i+2)),a=r.substr(0,i);o>-1&&(a=a.substr(0,o)+a.substr(o+1));r="0."+(Array(s).join("0")+a).substr(0,t);e=parseFloat(r)}}else if(o>-1){r=r.substr(0,o+1+t);e=parseFloat(r)}}else{var l=Math.pow(10,t);e=Math.round(e*l)/l}return e}exports.toFixed=toFixed;function format(e,t,n){if((e=asString(e)).match(/\{.*"count".*:.*"when".*:.*\}/))try{var r=JSON.parse(e);if(isString(r.count)){var i=t[r.count],o=r.when;if(isNumber(i)&&isObject(o)){var s=o[i]||o.other;isString(s)&&(e=s)}}}catch(e){}return e.replace(/\{(.*?)(:(.*?))?\}/g,(function(e,r,i,o){var s=e;if(r&&"{"!=r[0]&&t){s=new Binding(r).getValue(t);o&&(s=Globalize.format(s,o));n&&(s=n(t,r,o,s))}return null==s?"":s}))}exports.format=format;function glbz(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[],r=-1;e[0].forEach((function(t,i){if(i>0&&i!=r){var o=e[i],s=t.match(/^:([a-z][0-9]*\b)/i)||t.match(/^:'(.+?)'/)||t.match(/^:"(.+?)"/);if(s){o=Globalize.format(o,s[1]);t=t.substr(s[0].length)}else if(":"==t&&i<e.length-1&&(isNumber(o)||isDate(o))){o=Globalize.format(o,e[i+1]);t="";r=i+1}n.push(o)}t&&n.push(t)}));return n.join("")}exports.glbz=glbz;function evalTemplate(e,t){if(isIE()){return(e=e.replace(/:\${([^}]*)}/g,(function(e,n){return":"+_evalExpression(n,t)}))).replace(/\${([^}]*)}(:(([A-Za-z]\d*)|"([^"]+)"|'([^']+)'))?/g,(function(e,n,r,i,o,s,a){var l=_evalExpression(n,t);return i?Globalize.format(l,o||s||a):l}))}return _evalExpression(e,t)}exports.evalTemplate=evalTemplate;function _evalExpression(e,t){(t=t||{}).glbz=glbz;var n=parseTpl(e,t);return isIE()?n:glbz(templateObject_1||(templateObject_1=__makeTemplateObject(["",""],["",""])),n)}function get(e,t,n){void 0===n&&(n="${"+e+"}");return e.split(".").reduce((function(e,t){return null!=e&&null!=e[t]?e[t]:n}),t)}function parseTpl(e,t,n){return e.replace(/\$\{.+?}/g,(function(e){return get(e.substr(2,e.length-3).trim(),t,n)}))}function clamp(e,t,n){if(null!=e){null!=n&&e>n&&(e=n);null!=t&&e<t&&(e=t)}return e}exports.clamp=clamp;function copy(e,t,n,r){void 0===n&&(n=!0);void 0===r&&(r=!1);if(t)for(var i in t)if("_"!=i[0]){assert(i in e,'Unknown property "'+i+'".');var o=t[i];if(!e._copy||!e._copy(i,o)){var s=e[i];e[i]instanceof Event?isFunction(o)&&e[i].addHandler(o):!n||!isObject(o)||"undefined"!=typeof Element&&o instanceof Element||!s||!isObject(s)||Object.getPrototypeOf(s).constructor==Object.prototype.constructor&&isWritable(e,i)||"itemsSource"==i?r&&isObject(o)&&Object.getPrototypeOf(o).isPrototypeOf(Object)&&isObject(s)&&!Object.getPrototypeOf(s).isPrototypeOf(Object)?copy(s,o):e[i]=o:copy(s,o)}}return e}exports.copy=copy;function _isPlainObject(e){return isObject(e)&&Object.getPrototypeOf(e).isPrototypeOf(Object)}exports._isPlainObject=_isPlainObject;function isWritable(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||{};return!!n.writable||isFunction(n.set)}exports.isWritable=isWritable;function deepClone(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){return e.map((function(e){return deepClone(e)}))}var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=deepClone(e[n]));return t}exports.deepClone=deepClone;function assert(e,t,n){void 0===n&&(n=!0);if(!e){t="** Assertion failed in Wijmo: "+t;var r=new Error;isString(r.stack)&&n&&(t+=" "+r.stack);throw t}}exports.assert=assert;function _deprecated(e,t){console.error('** WARNING: "'+e+'" has been deprecated; please use "'+t+'" instead.')}exports._deprecated=_deprecated;function _warning(e){console.error('** WARNING: "'+e)}exports._warning=_warning;function asString(e,t){void 0===t&&(t=!0);isUndefined(e)&&(e=null);assert(t&&null==e||isString(e),"String expected.");return e}exports.asString=asString;function asNumber(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!1);assert(t&&null==e||isNumber(e),"Number expected.");if(n&&e&&e<0)throw"Positive number expected.";return e}exports.asNumber=asNumber;function asInt(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!1);assert(t&&null==e||isInt(e),"Integer expected.");if(n&&e&&e<0)throw"Positive integer expected.";return e}exports.asInt=asInt;function asBoolean(e,t){void 0===t&&(t=!1);assert(t&&null==e||isBoolean(e),"Boolean expected.");return e}exports.asBoolean=asBoolean;function asDate(e,t){void 0===t&&(t=!1);if(isString(e)){var n=changeType(e,DataType.Date,"r");isDate(n)&&(e=n)}assert(t&&null==e||isDate(e),"Date expected.");return e}exports.asDate=asDate;function asFunction(e,t){void 0===t&&(t=!0);assert(t&&null==e||isFunction(e),"Function expected.");return e}exports.asFunction=asFunction;function asArray(e,t){void 0===t&&(t=!0);assert(t&&null==e||isArray(e),"Array expected.");return e}exports.asArray=asArray;function asType(e,t,n){void 0===n&&(n=!1);e=tryCast(e,t);assert(n||null!=e,t+" expected.");return e}exports.asType=asType;function asEnum(e,t,n){void 0===n&&(n=!1);if(null==e&&n)return null;var r=isString(e)?t[e]:e;assert(null!=r,'Invalid enum value: "'+e+'"');return isNumber(r)?r:e}exports.asEnum=asEnum;function asCollectionView(e,t){void 0===t&&(t=!0);if(null==e&&t)return null;var n=tryCast(e,"ICollectionView");if(null!=n)return n;isArray(e)||assert(!1,"Array or ICollectionView expected.");return new CollectionView(e)}exports.asCollectionView=asCollectionView;function hasItems(e){return null!=e&&null!=e.items&&e.items.length>0}exports.hasItems=hasItems;function toHeaderCase(e){return e&&e.length?e[0].toUpperCase()+e.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""}exports.toHeaderCase=toHeaderCase;function escapeHtml(e){e&&isString(e)&&(e=e.replace(/[&<>]/g,(function(e){return _ENTITYMAP[e]})));return null!=e?e.toString():""}exports.escapeHtml=escapeHtml;var _plainText,_ENTITYMAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_specialCharsRegex=/"(.*?)"|[^\w]|_/g;function getSpecialCharsRegex(){return _specialCharsRegex}exports.getSpecialCharsRegex=getSpecialCharsRegex;function escapeRegExp(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}exports.escapeRegExp=escapeRegExp;function toPlainText(e){var t=asString(e);if(isString(t)&&t.indexOf("<")>-1){_plainText||(_plainText=document.createElement("div"));_plainText.innerHTML=t;t=_plainText.textContent}return t}exports.toPlainText=toPlainText;function hasClass(e,t){if(e&&t){if(e instanceof HTMLElement&&e.classList&&!isIE9())return e.classList.contains(t);if(e.getAttribute){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");return e&&n.test(e.getAttribute("class"))}}return!1}exports.hasClass=hasClass;function addClass(e,t){void 0===t&&(t="");if(e&&t){var n=t.trim();if(e instanceof HTMLElement&&e.classList&&!isIE9()){n.indexOf(" ")<0?e.classList.add(n):n.split(" ").forEach((function(t){t.length>0&&e.classList.add(t)}));return}e.setAttribute&&n.split(" ").forEach((function(t){if(t.length>0&&!hasClass(e,t)){var n=e.getAttribute("class");e.setAttribute("class",n?n+" "+t:t)}}))}}exports.addClass=addClass;function removeClass(e,t){if(e&&t){var n=t.trim();if(e instanceof HTMLElement&&e.classList&&!isIE9()){n.indexOf(" ")<0?e.classList.remove(n):n.split(" ").forEach((function(t){t.length>0&&e.classList.remove(t)}));0===e.classList.length&&e.removeAttribute("class");return}e.setAttribute&&n.split(" ").forEach((function(t){if(hasClass(e,t)){var n=new RegExp("((\\s|^)"+t+"(\\s|$))","g"),r=e.getAttribute("class");(r=r.replace(n," ").replace(/ +/g," ").trim())?e.setAttribute("class",r):e.removeAttribute("class")}}))}}exports.removeClass=removeClass;function toggleClass(e,t,n){null==n&&(n=!hasClass(e,t));n?addClass(e,t):removeClass(e,t)}exports.toggleClass=toggleClass;function setAttribute(e,t,n,r){e&&(null!=n?r&&e.getAttribute(t)||e.setAttribute(t,n.toString()):e.removeAttribute(t))}exports.setAttribute=setAttribute;function setChecked(e,t){var n=null==t;e.checked=isIE()?t||n:t;e.indeterminate=n}exports.setChecked=setChecked;function setAriaLabel(e,t){setAttribute(e,"aria-label",t)}exports.setAriaLabel=setAriaLabel;function setSelectionRange(e,t,n,r){void 0===n&&(n=t);void 0===r&&(r=!0);assert(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected");if(contains(document.body,e)&&!e.disabled&&e.offsetHeight){try{e.setSelectionRange(t,n,"backward")}catch(e){}if(r)try{e.focus();return!0}catch(e){}}return!1}exports.setSelectionRange=setSelectionRange;function disableAutoComplete(e){var t="autocomplete",n=e.getAttribute(t);n&&"on"!=n||e.setAttribute(t,"off");"autocorrect,autocapitalize,spellcheck".split(",").forEach((function(t){e.setAttribute(t,"spellcheck"==t?"false":"off")}))}exports.disableAutoComplete=disableAutoComplete;function removeChild(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}exports.removeChild=removeChild;function getActiveElement(){var e=document.activeElement;if(e){var t=e.shadowRoot;t&&t.activeElement&&(e=t.activeElement)}return e}exports.getActiveElement=getActiveElement;function _getActiveElement(e){var t=e;if(t){var n=t.shadowRoot;n&&n.activeElement&&(t=n.activeElement)}return t}exports._getActiveElement=_getActiveElement;function moveFocus(e,t){var n=_getFocusableElements(e,t<0),r=0;if(t){var i=n.indexOf(getActiveElement());i>-1&&(r=(i+t+n.length)%n.length)}if(r<n.length){var o=n[r];o.focus();o instanceof HTMLInputElement&&o.select();return!0}return!1}exports.moveFocus=moveFocus;function _getFocusableElements(e,t){void 0===t&&(t=!1);var n=[],r=Array.prototype.slice.call(e.querySelectorAll("input,select,textarea,button,a,div,label,[tabindex]")),i={};r=r.filter((function(e){return-1!==e.tabIndex}));var isRb=function(e){return e instanceof HTMLInputElement&&"radio"===e.type};r.forEach((function(e){isRb(e)&&e.checked&&(i[e.name||""]=!0)}));(r=r.filter((function(e){return!isRb(e)||e.checked||!i[e.name||""]}))).sort((function(e,t){return e.tabIndex===t.tabIndex?0:0===e.tabIndex?1:0===t.tabIndex?-1:e.tabIndex-t.tabIndex}));for(var o=0;o<r.length;o++){var s=r[o];if(s.offsetHeight>0&&s.tabIndex>-1&&!s.disabled&&"hidden"!==window.getComputedStyle(s).visibility&&!closest(s,"[disabled],."+exports.ControlStateClsNames.disabled)){if(s instanceof HTMLAnchorElement&&!s.hasAttribute("href"))continue;if(isIE()&&!s.hasAttribute("tabindex")){if(s instanceof HTMLDivElement)continue;var a=Control.getControl(closest(s,".wj-flexgrid"));if(a&&0==a.keyActionTab)continue}if("radio"===s.type&&!s.checked&&n.length>0){var l=n[n.length-1],u=getActiveElement();if("radio"===l.type&&l.name===s.name){t&&l!=u&&(n[n.length-1]=s);continue}}(Control.getControl(s)||!_getFocusableElements(s).length||s.classList.contains("wj-detail"))&&n.push(s)}}return n}exports._getFocusableElements=_getFocusableElements;function saveFile(e,t,n){void 0===n&&(n="text/plain");var r=e instanceof Blob;r||!n.match(/\bcsv\b/i)&&!t.match(/\.csv$/i)||(e="\ufeff"+e);var i=r?e:new Blob([e],{type:n}),o=navigator;if(isFunction(o.msSaveOrOpenBlob))o.msSaveOrOpenBlob(i,t);else{var s=document.createElement("a"),click=function(e){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null);e.dispatchEvent(t)};if("download"in s){var a=window.URL||window.webkitURL,l=a.createObjectURL(i);s.href=l;s.target="_blank";s.download=t;click(s);s=null;window.setTimeout((function(){a.revokeObjectURL(l)}),3e4)}else{var u=new FileReader;u.onloadend=function(){s.href=u.result;s.download=t;click(s);s=null};u.readAsDataURL(i)}}}exports.saveFile=saveFile;function getElement(e){if(e instanceof Element||e&&e.appendChild&&e.appendChild instanceof Function)return e;if(isString(e))try{return document.querySelector(e)}catch(e){}return e&&e.jquery?e[0]:null}exports.getElement=getElement;function processStyleProperty(e){var t=(e=e.replace(";base64,","_wj_")).split(";"),n=[];t.forEach((function(e){var t=[];e.indexOf("_wj_")>-1?2==(t=(e=e.replace("_wj_",";base64,").replace("data:image","_wjimg_")).split(":")).length&&(t[1]=t[1].replace("_wjimg_","data:image")):t=e.split(":");n.push(t)}));return n}function createElement(e,t,n){e=e.replace(/\bstyle\s*=\s*"/g,'_wj-style="');var r=document.createElement("div");r.innerHTML=e;if(e.indexOf("_wj-style")>-1)for(var i=r.querySelectorAll("[_wj-style]"),_loop_1=function(e){var t=i[e],n=t.getAttribute("_wj-style"),r=[];if(n.indexOf(";base64,")>-1)r=processStyleProperty(n);else{n.split(";").forEach((function(e){r.push(e.split(":"))}))}r.forEach((function(e){2==e.length&&(t.style[e[0].trim()]=e[1].trim())}));t.removeAttribute("_wj-style")},o=0;o<i.length;o++)_loop_1(o);1==r.children.length&&(r=r.children[0]);n&&setCss(r,n);t&&(t=getElement(t)).appendChild(r);return r}exports.createElement=createElement;function setText(e,t){e.textContent=t||""}exports.setText=setText;function contains(e,t,n){for(var r=t;r&&e;){if(r===e)return!0;r=(n?r[Control._OWNR_KEY]:null)||r.parentNode||r.host}return!1}exports.contains=contains;function closest(e,t){if(e){if(isFunction(e.closest))return e.closest(t);var n=e.matches||e.webkitMatchesSelector||e.msMatchesSelector||e.mozMatchesSelector;if(n)for(;e&&1===e.nodeType;e=e.parentElement||e.parentNode)if(n.call(e,t))return e}return null}exports.closest=closest;function closestClass(e,t){return closest(e,"."+t)}exports.closestClass=closestClass;function enable(e,t){var n=!t,r="disabled";toggleClass(e,exports.ControlStateClsNames.disabled,n);setAttribute(e,r,n?r:null);for(var i=e.querySelectorAll("input,button"),o=0;o<i.length;o++)setAttribute(i[o],r,n?r:null)}exports.enable=enable;function getElementRect(e){var t=e.getBoundingClientRect();return new Rect(t.left+pageXOffset,t.top+pageYOffset,t.width,t.height)}exports.getElementRect=getElementRect;function setCss(e,t){assert(isObject(t),"css parameter should be an object");if(e instanceof Array)for(var n=0;n<e.length;n++)setCss(e[n],t);else if(e&&e.style){var r=e.style;for(var i in t){var o=t[i];"number"==typeof o&&i.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(o+="px");r[i]!==o&&(r[i]=o)}}}exports.setCss=setCss;function animate(e,t,n){null==t&&(t=Control._ANIM_DEF_DURATION);null==n&&(n=Control._ANIM_DEF_STEP);e=asFunction(e);t=asNumber(t,!1,!0);n=asNumber(n,!1,!0);var r,i=Date.now(),o=setInterval((function(){var n=Math.min(1,(Date.now()-i)/t);n=Math.sin(n*Math.PI/2);n*=n;r&&cancelAnimationFrame(r);r=requestAnimationFrame((function(){r=null;e(n)}));n>=1&&clearInterval(o)}),n);return o}exports.animate=animate;var Point=function(){function Point(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.x=asNumber(e);this.y=asNumber(t)}Point.prototype.equals=function(e,t,n){void 0===t&&(t=0);void 0===n&&(n=0);return e instanceof Point&&Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=n};Point.prototype.clone=function(){return new Point(this.x,this.y)};return Point}();exports.Point=Point;var Size=function(){function Size(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.width=asNumber(e);this.height=asNumber(t)}Size.prototype.equals=function(e){return e instanceof Size&&this.width==e.width&&this.height==e.height};Size.prototype.clone=function(){return new Size(this.width,this.height)};return Size}();exports.Size=Size;var Rect=function(){function Rect(e,t,n,r){this.left=asNumber(e);this.top=asNumber(t);this.width=asNumber(n);this.height=asNumber(r)}Object.defineProperty(Rect.prototype,"right",{get:function(){return this.left+this.width},enumerable:!0,configurable:!0});Object.defineProperty(Rect.prototype,"bottom",{get:function(){return this.top+this.height},enumerable:!0,configurable:!0});Rect.prototype.equals=function(e){return e instanceof Rect&&this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height};Rect.prototype.clone=function(){return new Rect(this.left,this.top,this.width,this.height)};Rect.fromBoundingRect=function(e){if(null!=e.left)return new Rect(e.left,e.top,e.width,e.height);if(null!=e.x)return new Rect(e.x,e.y,e.width,e.height);assert(!1,"Invalid source rectangle.")};Rect.union=function(e,t){var n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return new Rect(n,r,Math.max(e.right,t.right)-n,Math.max(e.bottom,t.bottom)-r)};Rect.intersection=function(e,t){var n=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return new Rect(n,r,Math.min(e.right,t.right)-n,Math.min(e.bottom,t.bottom)-r)};Rect.prototype.contains=function(e){if(e instanceof Point)return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom;if(e instanceof Rect){var t=e;return t.left>=this.left&&t.right<=this.right&&t.top>=this.top&&t.bottom<=this.bottom}assert(!1,"Point or Rect expected.")};Rect.prototype.inflate=function(e,t,n,r){return null!=n&&null!=r?new Rect(this.left-e,this.top-t,this.width+e+n,this.height+t+r):new Rect(this.left-e,this.top-t,this.width+2*e,this.height+2*t)};return Rect}();exports.Rect=Rect;var DateTime=function(){function DateTime(){}DateTime.addDays=function(e,t){(e=new Date(e.getTime())).setDate(e.getDate()+t);return e};DateTime.addMonths=function(e,t){var n=(e=new Date(e.getTime())).getDate();e.setMonth(e.getMonth()+t);e.getDate()!=n&&e.setDate(0);return e};DateTime.addYears=function(e,t){(e=new Date(e.getTime())).setFullYear(e.getFullYear()+t);return e};DateTime.addHours=function(e,t){(e=new Date(e.getTime())).setHours(e.getHours()+t);return e};DateTime.addMinutes=function(e,t){(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t);return e};DateTime.addSeconds=function(e,t){(e=new Date(e.getTime())).setSeconds(e.getSeconds()+t);return e};DateTime.weekFirst=function(e,t){void 0===t&&(t=Globalize.getFirstDayOfWeek());return DateTime.addDays(e,-(e.getDay()-t))};DateTime.weekLast=function(e,t){void 0===t&&(t=Globalize.getFirstDayOfWeek());e=DateTime.weekFirst(e,t);return DateTime.addDays(e,6)};DateTime.monthFirst=function(e){return DateTime.addDays(e,1-e.getDate())};DateTime.monthLast=function(e){e=DateTime.monthFirst(e);e=DateTime.addMonths(e,1);return DateTime.addDays(e,-1)};DateTime.yearFirst=function(e){return new Date(e.getFullYear(),0,1)};DateTime.yearLast=function(e){return new Date(e.getFullYear(),11,31)};DateTime.sameDate=function(e,t){return isDate(e)&&isDate(t)&&e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()};DateTime.sameTime=function(e,t){return isDate(e)&&isDate(t)&&e.getHours()==t.getHours()&&e.getMinutes()==t.getMinutes()&&e.getSeconds()==t.getSeconds()&&e.getMilliseconds()==t.getMilliseconds()};DateTime.equals=function(e,t){return null==e&&null==t||isDate(e)&&isDate(t)&&e.getTime()==t.getTime()};DateTime.fromDateTime=function(e,t){if(!e&&!t)return null;e||(e=t);t||(t=e);return DateTime.newDate(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())};DateTime.toFiscal=function(e,t){var n=exports.culture.Globalize.calendar;return isArray(n.fiscalYearOffsets)?DateTime.addMonths(e,-n.fiscalYearOffsets[t?0:1]):e};DateTime.fromFiscal=function(e,t){var n=exports.culture.Globalize.calendar;return isArray(n.fiscalYearOffsets)?DateTime.addMonths(e,+n.fiscalYearOffsets[t?0:1]):e};DateTime.newDate=function(e,t,n,r,i,o,s){if(null==e||null==t||null==n){var a=new Date;null==e&&(e=a.getFullYear());null==t&&(t=a.getMonth());null==n&&(n=a.getDate())}null==r&&(r=0);null==i&&(i=0);null==o&&(o=0);null==s&&(s=0);var l=new Date(e,t,n,r,i,o,s),u=l.getFullYear();e<100&&u>=1900&&l.setFullYear(l.getFullYear()-1900);return l};DateTime.clone=function(e){return DateTime.fromDateTime(e,e)};return DateTime}();exports.DateTime=DateTime;function httpRequest(e,t){var n=t||{},r=n.method?asString(n.method).toUpperCase():"GET",i=null==n.async||asBoolean(n.async),o=n.data;if(null!=o&&"GET"==r){var s=[];for(var a in o){var l=o[a];isDate(l)&&(l=l.toJSON());s.push(a+"="+encodeURIComponent(l))}if(s.length){var u=e.indexOf("?")<0?"?":"&";e+=u+s.join("&")}o=null}var c=new XMLHttpRequest;c.URL_DEBUG=e;var p=!1;if(null!=o&&!isString(o)){p=isObject(o);o=JSON.stringify(o)}c.onload=function(){if(4==c.readyState){c.status<300?n.success&&asFunction(n.success)(c):n.error&&asFunction(n.error)(c);n.complete&&asFunction(n.complete)(c)}};c.onerror=function(){if(!isFunction(n.error))throw"HttpRequest Error: "+c.status+" "+c.statusText;n.error(c)};c.open(r,e,i,n.user,n.password);n.user&&n.password&&c.setRequestHeader("Authorization","Basic "+btoa(n.user+":"+n.password));p&&function(){for(var e in n.requestHeaders)if("content-type"===e.toLowerCase())return!1;return!0}()&&c.setRequestHeader("Content-Type","application/json");if(n.requestHeaders)for(var h in n.requestHeaders)c.setRequestHeader(h,n.requestHeaders[h]);isNumber(n.timeout)&&(c.timeout=n.timeout);isFunction(n.beforeSend)&&n.beforeSend(c);c.send(o);return c}exports.httpRequest=httpRequest;var _modules={};function _registerModule(e,t){_modules[e]=t;if("wijmo"===e){var n="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;n&&(n.wijmo=t)}}exports._registerModule=_registerModule;function _getModule(e){return _modules[e]}exports._getModule=_getModule;function focusFirst(e,t){var n=e.querySelectorAll(t||'button, [href], input, [tabindex]:not([tabindex="-1"])'),r=Array.from(n).filter((function(e){return e.offsetWidth>0&&e.offsetHeight>0&&!e.hasAttribute("disabled")&&e.tabIndex>=0}));if(r.length>0){r[0].focus();return!0}return!1}exports.focusFirst=focusFirst;exports.cellCoordinateParserRegex=new RegExp(/(\'?\w+\'?\!)?(\$?[A-Za-z]+)(\$?\d+)/,"g");function getScrollableParent(e){for(var t=document.scrollingElement,n="absolute"==getComputedStyle(e).position?e.offsetParent:e.parentElement;n&&n!=t;){if(n.clientHeight!=n.scrollHeight)return n;e=n="absolute"==getComputedStyle(n).position?n.offsetParent:n.parentElement}return t}exports.getScrollableParent=getScrollableParent;function getOffsetFromAncestor(e,t){for(var n=0,r=0,i=0,o=0;e;){r+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}for(;t;){o+=t.offsetLeft;i+=t.offsetTop;t=t.offsetParent}return{top:n-i,left:r-o}}exports.getOffsetFromAncestor=getOffsetFromAncestor;function _isMacOS(){return-1!==navigator.userAgent.indexOf("Mac")}exports._isMacOS=_isMacOS;function _setAriaLabelBy(e,t,n,r){var i=""===n?null:n;if(i!==e.ariaLabelledBy){e._ariaLabelledby=i;setAttribute(t,"aria-labelledby",i);r&&r()}}exports._setAriaLabelBy=_setAriaLabelBy;function deepElementFromPoint(e,t){for(var n=document.elementFromPoint(e,t);n&&n.shadowRoot;){var r=n.shadowRoot.elementFromPoint(e,t);if(!r||r===n)break;n=r}return n}exports.deepElementFromPoint=deepElementFromPoint;function roundTo(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}exports.roundTo=roundTo;function addAttributeValueToElement(e,t,n){var r=e.getAttribute(t);if(r){if(!r.split(/\s+/).includes(n)){setAttribute(e,t,r+" "+n)}}else setAttribute(e,t,n)}exports.addAttributeValueToElement=addAttributeValueToElement;function removeAttributeValueFromElement(e,t,n){var r=e.getAttribute(t);if(r){var i=n.toString(),o=r.split(/\s+/).filter((function(e){return e!==i}));o.length>0?e.setAttribute(t,o.join(" ")):e.removeAttribute(t)}}exports.removeAttributeValueFromElement=removeAttributeValueFromElement;function replaceItems(e,t){var n=new Map(t.map((function(e){return[""+e.value,e]})));return e.map((function(e){var t=""+e.value;return n.has(t)?n.get(t):e}))}exports.replaceItems=replaceItems;var _Map=function(){function _Map(e){void 0===e&&(e=!0);if(e)this._h={};else{var t=_getGlobal(),n=t&&t.Map;this._m=n&&new Map||new _ArrayMap}}Object.defineProperty(_Map.prototype,"isPojoHash",{get:function(){return null!=this._h},enumerable:!0,configurable:!0});Object.defineProperty(_Map.prototype,"size",{get:function(){return this._h&&Object.keys(this._h).length||this._m.size},enumerable:!0,configurable:!0});_Map.prototype.clear=function(){this._h?this._h={}:this._m.clear()};_Map.prototype.delete=function(e){this._h?delete this._h[e]:this._m.delete(e)};_Map.prototype.get=function(e){return this._h?this._h[e]:this._m.get(e)};_Map.prototype.has=function(e){return this._h?e in this._h:this._m.has(e)};_Map.prototype.set=function(e,t){this._h?this._h[e]=t:this._m.set(e,t);return this};return _Map}();exports._Map=_Map;var _ArrayMap=function(){function _ArrayMap(){this._d=[]}Object.defineProperty(_ArrayMap.prototype,"size",{get:function(){return this._d.length},enumerable:!0,configurable:!0});_ArrayMap.prototype.clear=function(){this._d=[]};_ArrayMap.prototype.delete=function(e){var t=this._kIdx(e);if(t>-1){this._d.splice(t,1);return!0}return!1};_ArrayMap.prototype.get=function(e){var t=this._kIdx(e);return t>-1?this._d[t].v:void 0};_ArrayMap.prototype.has=function(e){return this._kIdx(e)>-1};_ArrayMap.prototype.set=function(e,t){var n=this._kIdx(e);n>-1?this._d[n].v=t:this._d.push({k:e,v:t});return this};_ArrayMap.prototype._kIdx=function(e){var t=this._d,n=t.length;if(e==e){for(var r=0;r<n;r++)if(t[r].k===e)return r}else for(r=0;r<n;r++){var i=t[r].k;if(i!=i)return r}return-1};return _ArrayMap}();function _getGlobal(){var e=null;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self);return e}var Color=function(){function Color(e){this._r=0;this._g=0;this._b=0;this._a=1;e&&this._parse(e)}Object.defineProperty(Color.prototype,"r",{get:function(){return this._r},set:function(e){this._r=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"g",{get:function(){return this._g},set:function(e){this._g=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"b",{get:function(){return this._b},set:function(e){this._b=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"a",{get:function(){return this._a},set:function(e){this._a=clamp(asNumber(e),0,1)},enumerable:!0,configurable:!0});Color.prototype.equals=function(e){return e instanceof Color&&this.r==e.r&&this.g==e.g&&this.b==e.b&&this.a==e.a};Color.prototype.toString=function(){var e=Math.round(100*this.a);return e>99?"#"+((1<<24)+(this.r<<16)+(this.g<<8)+this.b).toString(16).slice(1):"rgba("+this.r+","+this.g+","+this.b+","+e/100+")"};Color.fromRgba=function(e,t,n,r){void 0===r&&(r=1);var i=new Color(null);i.r=Math.round(clamp(asNumber(e),0,255));i.g=Math.round(clamp(asNumber(t),0,255));i.b=Math.round(clamp(asNumber(n),0,255));i.a=clamp(asNumber(r),0,1);return i};Color.fromHsb=function(e,t,n,r){void 0===r&&(r=1);var i=Color._hsbToRgb(clamp(asNumber(e),0,1),clamp(asNumber(t),0,1),clamp(asNumber(n),0,1));return Color.fromRgba(i[0],i[1],i[2],r)};Color.fromHsl=function(e,t,n,r){void 0===r&&(r=1);var i=Color._hslToRgb(clamp(asNumber(e),0,1),clamp(asNumber(t),0,1),clamp(asNumber(n),0,1));return Color.fromRgba(i[0],i[1],i[2],r)};Color.fromString=function(e){var t=new Color(null);return t._parse(asString(e))?t:null};Color.prototype.getHsb=function(){return Color._rgbToHsb(this.r,this.g,this.b)};Color.prototype.getHsl=function(){return Color._rgbToHsl(this.r,this.g,this.b)};Color.interpolate=function(e,t,n){n=clamp(asNumber(n),0,1);var r=Color._rgbToHsl(e.r,e.g,e.b),i=Color._rgbToHsl(t.r,t.g,t.b),o=1-n,s=e.a*o+t.a*n,a=[r[0]*o+i[0]*n,r[1]*o+i[1]*n,r[2]*o+i[2]*n],l=Color._hslToRgb(a[0],a[1],a[2]);return Color.fromRgba(l[0],l[1],l[2],s)};Color.toOpaque=function(e,t){if(1==(e=isString(e)?Color.fromString(e):asType(e,Color)).a)return e;t=null==t?Color.fromRgba(255,255,255,1):isString(t)?Color.fromString(t):asType(t,Color);var n=e.a,r=1-n;return Color.fromRgba(e.r*n+t.r*r,e.g*n+t.g*r,e.b*n+t.b*r)};Color.prototype._parse=function(e){if("transparent"==(e=e.toLowerCase())){this._r=this._g=this._b=this._a=0;return!0}if(e&&0!=e.indexOf("#")&&0!=e.indexOf("rgb")&&0!=e.indexOf("hsl")){var t=document.createElement("div");t.style.color=e;var n=t.style.color;if(n==e&&!(n=window.getComputedStyle(t).color)){document.body.appendChild(t);n=window.getComputedStyle(t).color;removeChild(t)}e=n.toLowerCase()}if(0==e.indexOf("#")){if(this._isValidHexColor(e)){if(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;return!0}if(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;return!0}}return!1}if(0==e.indexOf("rgb")){var r=e.indexOf("("),i=e.indexOf(")");if(r>-1&&i>-1){if((o=e.substr(r+1,i-(r+1)).split(",")).length>2){this.r=parseInt(o[0]);this.g=parseInt(o[1]);this.b=parseInt(o[2]);this.a=o.length>3?parseFloat(o[3]):1;return!0}}}if(0==e.indexOf("hsl")){r=e.indexOf("("),i=e.indexOf(")");if(r>-1&&i>-1){var o;if((o=e.substr(r+1,i-(r+1)).split(",")).length>2){var s=parseInt(o[0])/360,a=parseInt(o[1]),l=parseInt(o[2]);o[1].indexOf("%")>-1&&(a/=100);o[2].indexOf("%")>-1&&(l/=100);var u=Color._hslToRgb(s,a,l);this.r=u[0];this.g=u[1];this.b=u[2];this.a=o.length>3?parseFloat(o[3]):1;return!0}}}return!1};Color.prototype._isValidHexColor=function(e){return/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)};Color._hslToRgb=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSL values");var r,i,o;if(0==t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=Color._hue2rgb(a,s,e+1/3);i=Color._hue2rgb(a,s,e);o=Color._hue2rgb(a,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*o)]};Color._hue2rgb=function(e,t,n){n<0&&(n+=1);n>1&&(n-=1);return n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e};Color._rgbToHsl=function(e,t,n){assert(e>=0&&e<=255&&t>=0&&t<=255&&n>=0&&n<=255,"bad RGB values");e/=255,t/=255,n/=255;var r,i,o=Math.max(e,t,n),s=Math.min(e,t,n),a=(o+s)/2;if(o==s)r=i=0;else{var l=o-s;i=a>.5?l/(2-o-s):l/(o+s);switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[r,i,a]};Color._rgbToHsb=function(e,t,n){assert(e>=0&&e<=255&&t>=0&&t<=255&&n>=0&&n<=255,"bad RGB values");var r=Color._rgbToHsl(e,t,n);return Color._hslToHsb(r[0],r[1],r[2])};Color._hsbToRgb=function(e,t,n){var r=Color._hsbToHsl(e,t,n);return Color._hslToRgb(r[0],r[1],r[2])};Color._hsbToHsl=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSB values");var r=clamp(n*(2-t)/2,0,1),i=1-Math.abs(2*r-1),o=clamp(i>0?n*t/i:t,0,1);assert(!isNaN(r)&&!isNaN(o),"bad conversion to HSL");return[e,o,r]};Color._hslToHsb=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSL values");var r=clamp(1==n?1:(2*n+t*(1-Math.abs(2*n-1)))/2,0,1),i=clamp(r>0?2*(r-n)/r:t,0,1);assert(!isNaN(r)&&!isNaN(i),"bad conversion to HSB");return[e,i,r]};return Color}();exports.Color=Color;exports.culture="undefined"!=typeof window&&window.wijmo&&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 Globalize=function(){function Globalize(){}Globalize.format=function(e,t,n,r,i){if(isString(e))return e;if(isNumber(e)){t=t||(e==Math.round(e)?"n0":"n2");return Globalize.formatNumber(e,t,n,r,i)}if(isDate(e)){t=t||"d";return Globalize.formatDate(e,t)}return null!=e?e.toString():""};Globalize.formatNumber=function(e,t,n,r,i){e=asNumber(e);t=asString(t);var o,s=exports.culture.Globalize.numberFormat,a=Globalize._parseNumericFormat(t),l=a.spec,u=a.prec,c=s["."]||".",p=s[","]||",",h=s["-"]||"-",f=Math;null==u&&(u=null!=i?i:"c"==l?s.currency.decimals:"e"==l?6:"r"==l?15:e==f.round(e)?0:2);a.scale&&(e/=f.pow(10,a.scale));if("d"==l||"x"==l){o=(r?f.floor:f.round)(f.abs(e)).toString("d"==l?10:16);for(;o.length<u;)o="0"+o;e<0&&(o=h+o);return"X"==a.specRaw?o.toUpperCase():o}r&&"p"!=l&&"e"!=l&&(e=toFixed(e,u,!0));switch(l){case"e":o=e.toExponential(u);"E"==a.specRaw&&(o=o.replace("e","E"));break;case"c":o=Globalize._toFixedStr(f.abs(e),u);break;case"p":e=Globalize._shiftDecimal(e,2,14);r&&(e=toFixed(e,u,r));o=Globalize._toFixedStr(f.abs(e),u);break;default:"-"!=(o=Globalize._toFixedStr(e,u))[0]||o.match(/[1-9]/)||(o=o.substr(1))}(n||"g"==l||"r"==l)&&o.indexOf(".")>-1&&(o=o.replace(/(\.\d*?)0+$/g,"$1").replace(/\.$/,""));"."!=c&&(o=o.replace(".",c));"-"!=h&&(o=o.replace("-",h));if(p&&("n"==l||"c"==l||"p"==a.specRaw||"F"==a.specRaw||"G"==a.specRaw)){var d=o.indexOf(c),g=/\B(?=(\d\d\d)+(?!\d))/g;o=d>-1?o.substr(0,d).replace(g,p)+o.substr(d):o.replace(g,p)}if("c"==l){var _=e<0&&o.match(/[1-9]/)?0:1,m=s.currency.pattern[_],v=a.curr||s.currency.symbol;"​"==v&&(v="");o=m.replace("n",o).replace("$",v)}if("p"==l){_=e<0&&o.match(/[1-9]/)?0:1,m=s.percent.pattern[_];var b=s["%"]||"%";o=m.replace("n",o);"%"!=b&&(o=o.replace("%",b));"-"!=h&&0==_&&(o=o.replace("-",h))}return a.prefix||a.suffix?a.prefix+o+a.suffix:o};Globalize.formatDate=function(e,t){e=asDate(e);switch(t){case"r":case"R":return e.toUTCString();case"u":return e.toISOString().replace(/\.\d{3}/,"")}t=Globalize._expandFormat(t);return Globalize._parseDateFormat(t).map((function(n){return Globalize._formatDatePart(e,t,n)})).join("")};Globalize.parseInt=function(e,t){return Math.round(Globalize.parseFloat(e,t))};Globalize.parseFloat=function(e,t){var n=Globalize._parseNumericFormat(t),r=n.prefix;r&&0==e.indexOf(r)&&(e=e.substring(r.length));var i=n.suffix;if(i){var o=e.lastIndexOf(i);o>-1&&o==e.length-i.length&&(e=e.substring(0,e.length-i.length))}var s=exports.culture.Globalize.numberFormat,a=s["."]||".",l=s[","]||",",u=s["-"]||"-",c=s["%"]||"%",p=n.curr||s.currency.symbol||"$",h=e.indexOf(c)>-1,f=e.indexOf("(")>-1&&e.indexOf(")")>-1,d=0;if("x"==n.spec)d=parseInt(e,16);else{[p,c,"(",")"].forEach((function(t){e=e.replace(t,"")}));/\s/.test(l)&&(e=e.replace(/\s+/g,""));var g=(e=e.replace(new RegExp("\\"+l,"g"),"").replace(new RegExp("\\"+u,"g"),"-").replace(/(\+|\-)\s+/g,"$1").replace(a,".").trim()).length;if(!f&&g&&"-"==e[g-1]){f=!0;e=e.substring(0,g-1)}d=/^\s*(\+|\-)?\d*(\.\d*)?(\s*E(\+|\-)?\d+)?\s*$/i.test(e)?parseFloat(e):Number.NaN}if(!isNaN(d)){f=f||d<0;d=Math.abs(d);h&&(d=Globalize._shiftDecimal(d,-2));f&&(d=-d);n.scale&&(d*=Math.pow(10,n.scale))}return d};Globalize.parseDate=function(e,t,n){if(!(e=asString(e)))return null;if("u"==t)return new Date(e);var r;if("R"==t||"r"==t){var i=e.match(/((\d+)\-(\d+)\-(\d+))?\s?((\d+):(\d+)(:(\d+))?)?/);if(i[1]||i[5]){r=i[1]?new Date(parseInt(i[2]),parseInt(i[3])-1,parseInt(i[4])):new Date;if(i[5]){r.setHours(parseInt(i[6]));r.setMinutes(parseInt(i[7]));r.setSeconds(i[8]?parseInt(i[9]):0)}}else r=new Date(e);return isNaN(r.getTime())?null:r}t=Globalize._expandFormat(t||"d");var o=exports.culture.Globalize.calendar,s=Globalize._CJK,a=new RegExp("(\\"+o["/"]+")|(\\"+o[":"]+")|(\\d+)|(["+s+"\\.]{2,})|(["+s+"]+)","gi"),l=e.match(a),u=Globalize._parseDateFormat(t),c=0;if(!(l&&l.length&&u&&u.length))return null;var p,h,f,d,g,_=-1,m=0,v=1,b=0,y=0,C=0,w=0,E=-1,A=null;if(n=asDate(n,!0)){m=n.getMonth();v=n.getDate();b=n.getHours();y=n.getMinutes();C=n.getSeconds();w=n.getMilliseconds()}for(var x=0;x<u.length&&l;x++){var T=x-c,P=T>-1&&T<l.length?l[T]:"",S=u[x].length;switch(u[x]){case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":g=u[x];case"yyyy":case"yyy":case"yy":case"y":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}_=parseInt(P);d=4==P.length;break;case"MMMM":case"MMM":f=!0;m=-1;for(var O=P.toLowerCase(),D="MMMM"==u[x]?o.months:o.monthsAbbr,F=0;F<12;F++)if(0==D[F].toLowerCase().indexOf(O)){m=F;break}if(m>-1)break;case"MM":case"M":f=!0;if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}m=parseInt(P)-1;break;case"dddd":case"ddd":p=!0;break;case"dd":case"d":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}v=parseInt(P);h=!0;break;case"hh":case"h":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}b=12==(b=parseInt(P))?0:b;break;case"HH":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}b=parseInt(P);break;case"H":b=parseInt(P);break;case"mm":case"m":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}y=parseInt(P);break;case"ss":case"s":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}C=parseInt(P);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":w=parseInt(P)/Math.pow(10,S-3);break;case"tt":case"t":P=P.toUpperCase();b<12&&o.pm.indexOf(P)>-1&&(b+=12);break;case"q":case"Q":case"u":case"U":E=parseInt(P);break;case"ggg":case"gg":case"g":case'"г."':A=o.eras.length>1?Globalize._getEra(P,o):o.eras.length>0?o.eras[0]:null;if(o.eras.length>0&&!A)return null;break;case"/":case":":if(P&&P!=o[u[x]])return null;break;case o["/"]:case o[":"]:if(P&&P!=u[x])return null;break;case"K":break;default:Globalize._unquote(u[x]).trim()!=P.trim()&&c++}}if(f&&h){isNaN(b)&&(b=0);isNaN(y)&&(y=0);isNaN(C)&&(C=0)}if(m<0||m>11||isNaN(m)||v<1||v>31||isNaN(v)||b<0||b>=24||isNaN(b)||y<0||y>=60||isNaN(y)||C<0||C>=60||isNaN(C))return null;if(l.length+c>u.length)return null;if(g){if(!f)return null;var k=exports.culture.Globalize.calendar;if(isArray(k.fiscalYearOffsets)){var I="E"==g[0],M=m-k.fiscalYearOffsets[I?0:1];_+=M>11?-1:M<0?1:0}}if(p&&!h)return null;!f&&E>=1&&E<=4&&(m=3*(E-1));if(isNaN(_)||_<0)_=n?n.getFullYear():(new Date).getFullYear();else if(A&&A.start)_=_+A.start.getFullYear()-1;else if(_<100&&!d){var R=isNumber(o.twoDigitYearMax)?o.twoDigitYearMax:2029;R>99&&(_+=_+2e3<=R?2e3:1900)}return(r=DateTime.newDate(_,m,v,b,y+0,C,w)).getMonth()!=m||r.getDate()!=v?null:isNaN(r.getTime())?null:r};Globalize.getFullFormat=function(e){return Globalize._expandFormat(e)};Globalize.getFirstDayOfWeek=function(){var e=exports.culture.Globalize.calendar.firstDay;return e||0};Globalize.getNumberDecimalSeparator=function(){var e=exports.culture.Globalize.numberFormat["."];return e||"."};Globalize._toFixedStr=function(e,t){var n=e.toString(),r=n.indexOf("."),i=t-(n.length-r)+1,o=n.indexOf("e")>-1;if(!o&&r>-1&&i>=0)return n+Array(i+1).join("0");if(r>-1&&!o&&"5"==n[n.length-1]){e=+(Math.round(+(Math.abs(e)+"e"+t))+"e"+-t)*(e<0?-1:1)}return e.toFixed(t)};Globalize._unquote=function(e){return e.length>1&&e[0]==e[e.length-1]&&("'"==e[0]||'"'==e[0])?e.substr(1,e.length-2):e};Globalize._parseNumericFormat=function(e){var t=Globalize._numFormatInfo[e];if(!t){var n=e&&e.match(/(\"(.*?)\"\s*)?([a-z]+)\s*(\d*)\s*(,*)(\s*\"(.*?)\"\s*)?(.*)/i)||[],r=n[3]?n[3]:"n";if(r.length>1){n=[];r="n"}t={prefix:n[2]||"",spec:r.toLowerCase(),specRaw:r,prec:n[4]?parseInt(n[4]):null,scale:n[5]?3*n[5].length:0,suffix:n[7]||"",curr:n[8]||null};Globalize._numFormatInfo[e]=t}return t};Globalize._parseDateFormat=function(e){var t=Globalize._dateFormatParts[e];if(!t){t=[];if(e){var n=void 0,r=void 0;for(n=0;n>-1&&n<e.length;n++){var i=e[n];if(("'"==i||'"'==i)&&(r=e.indexOf(i,n+1))>-1){t.push(e.substring(n,r+1));n=r}else if("\\"==i&&n<e.length-1){n++;t.push('"'+e[n]+'"')}else{r=n+1;for(;r<e.length&&e[r]==i;r++);t.push(e.substring(n,r));n=r-1}}}Globalize._dateFormatParts[e]=t}return t};Globalize._formatDatePart=function(e,t,n){var r,i=exports.culture.Globalize.calendar,o=null,s=0,a=0,l=n.length;switch(n){case"yyyy":case"yyy":case"yy":case"y":case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":s=(r="E"==n[0]?DateTime.toFiscal(e,!0):"e"==n[0]?DateTime.toFiscal(e,!1):e).getFullYear();i.eras.length>1&&t.indexOf("g")>-1&&(o=Globalize._getEra(e,i))&&(s=isDate(o.start)?s-o.start.getFullYear()+1:Math.abs(s));var u=n.length<3?s%100:3==n.length?s%1e3:s;return Globalize._zeroPad(u,n.length);case"MMMMM":return i.monthsAbbr[e.getMonth()][0];case"MMMM":return i.months[e.getMonth()];case"MMM":return i.monthsAbbr[e.getMonth()];case"MM":case"M":return Globalize._zeroPad(e.getMonth()+1,l);case"dddd":return i.days[e.getDay()];case"ddd":return i.daysAbbr[e.getDay()];case"dd":return Globalize._zeroPad(e.getDate(),2);case"d":return e.getDate().toString();case"hh":case"h":return Globalize._zeroPad(Globalize._h12(e),l);case"HH":case"H":return Globalize._zeroPad(e.getHours(),l);case"mm":case"m":return Globalize._zeroPad(e.getMinutes(),l);case"ss":case"s":return Globalize._zeroPad(e.getSeconds(),l);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":a=e.getMilliseconds()*Math.pow(10,l-3);return"f"==n[0]?Globalize._zeroPad(a,l):a.toFixed(0);case"tt":return e.getHours()<12?i.am[0]:i.pm[0];case"t":return e.getHours()<12?i.am[1]:i.pm[1];case"q":case"Q":return(Math.floor(e.getMonth()/3)+1).toString();case"u":case"U":r=DateTime.toFiscal(e,"U"==n);return(Math.floor(r.getMonth()/3)+1).toString();case"ggg":case"gg":case"g":if(i.eras.length>1&&(o=Globalize._getEra(e,i))){if(isString(o))return o;switch(n){case"gg":return o.name[0];case"g":return o.symbol;default:return o.name}}return i.eras[0];case":":case"/":return i[n];case"K":var c=e.toString().match(/(\+|\-)(\d{2})(\d{2})/);return c?c[1]+c[2]+c[3]:"";case"zzz":case"zz":case"z":var p=-e.getTimezoneOffset(),h=Math.abs(p),f=Globalize.formatNumber,d=void 0;switch(n){case"zzz":d=f(h/60,"d2",!1,!0)+i[":"]+f(h%60,"d2",!1,!0);break;case"zz":d=f(h/60,"d2",!1,!0);break;case"z":d=f(h/60,"d1",!1,!0)}return(p>=0?"+":"-")+d}return l>1&&n[0]==n[l-1]&&('"'==n[0]||"'"==n[0])?n.substr(1,l-2):n};Globalize._getEra=function(e,t){if(t.eras){var n=t.eras,r=t.eras.length;if(isDate(e)){if(isString(n[0]))return n[e.getFullYear()>=0?0:1];if(isDate(n[0].start)){for(var i=0;i<r;i++)if(e>=n[i].start)return n[i];return n[r-1]}}else if(isString(e)&&e.length>0){e=e.toLowerCase();for(i=0;i<r;i++){var o=n[i];if(isString(o)){if(0==o.toLowerCase().indexOf(e))return o}else if(o.name&&0==o.name.toLowerCase().indexOf(e)||o.symbol&&0==o.symbol.toLowerCase().indexOf(e))return o}}}return null};Globalize._expandFormat=function(e){var t=exports.culture.Globalize.calendar.patterns[e];return t||e};Globalize._zeroPad=function(e,t){var n=e.toFixed(0),r=t-n.length+1;return r>0?Array(r).join("0")+n:n};Globalize._h12=function(e){var t=exports.culture.Globalize.calendar,n=e.getHours();t.am&&t.am[0]&&0==(n%=12)&&(n=12);return n};Globalize._shiftDecimal=function(e,t,n){if(0==t||isNaN(e))return e;var r=e.toString();if(r.indexOf("e")>-1){var i=e*Math.pow(10,t);null!=n&&(i=parseFloat(i.toFixed(n)));return i}var o=Array(Math.abs(t)+1).join("0");t<0&&(r=o+r);var s=r.indexOf(".");s<0&&(s=(r+=".").indexOf("."));t>0&&(r+=o);s+=t;r=(r=r.replace(".","")).substr(0,s)+"."+r.substr(s);return parseFloat(r)};Globalize._CJK="a-z"+"u00c0-u017fu3000-u30ffu4e00-u9faf".replace(/u/g,"\\u")+"u1100-u11ffu3130-u318fua960-ua97fuac00-ud7afud7b0-ud7ff".replace(/u/g,"\\u");Globalize._numFormatInfo={};Globalize._dateFormatParts={};return Globalize}();exports.Globalize=Globalize;exports._loadedCultures="undefined"!=typeof window&&window.wijmo&&window.wijmo._loadedCultures||{};function _updateCulture(e){exports.culture=e;exports._loadedCultures[e.Globalize.name]=e}exports._updateCulture=_updateCulture;function _addCultureInfo(e,t){var n="undefined"!=typeof window?window.wijmo:null,r=n?n.culture:null,i=r?r[e]:null;exports.culture[e]=i||t}exports._addCultureInfo=_addCultureInfo;exports.changeCultureSync=function(e,t){for(var n=document.getElementsByTagName("script"),r=0;r<n.length;r++){var i=n[r];if(i.src.indexOf("wijmo.culture.")>-1){i.parentElement.removeChild(i);break}}var o=exports._loadedCultures[e]||void 0;if(o){var s=window.wijmo._updateCulture;s?s(o):window.wijmo.culture=o;t&&t();window.wijmo.Control.invalidateAll()}return o};exports.changeCulture=function(e){return new Promise((function(t,n){var r=exports.changeCultureSync(e);r?t(r):n()}))};var _MaskProvider=function(){function _MaskProvider(e,t,n){void 0===t&&(t="");void 0===n&&(n="_");this._promptChar="_";this._mskArr=[];this._overWrite=!1;this._full=!0;this._inputBnd=this._input.bind(this);this._keydownBnd=this._keydown.bind(this);this._keypressBnd=this._keypress.bind(this);this._cmpstartBnd=this._cmpstart.bind(this);this._cmpendBnd=this._cmpend.bind(this);this.mask=asString(t);this.input=e;this.promptChar=asString(n,!1);this._connect(!0);(this._evtInput=document.createEvent("HTMLEvents")).initEvent("input",!0,!1)}Object.defineProperty(_MaskProvider.prototype,"input",{get:function(){return this._tbx},set:function(e){this._connect(!1);this._tbx=e;this._connect(!0)},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"mask",{get:function(){return this._msk},set:function(e){if(e!=this._msk){this._msk=asString(e,!0);this._parseMask();this._valueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"promptChar",{get:function(){return this._promptChar},set:function(e){if(e!=this._promptChar){assert(1==(e=asString(e,!1)).length,"promptChar must be a string with length 1.");for(var t=this._tbx,n=t.value,r="",i=this._mskArr,o=this._promptChar,s=0;s<n.length;s++){var a=i[s],l=n[s];a&&a.literal||l!==o||(l=e);r+=l}t.value=r;this._promptChar=e}},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"overwriteMode",{get:function(){return this._overWrite},set:function(e){this._overWrite=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"maskFull",{get:function(){return this._full},enumerable:!0,configurable:!0});_MaskProvider.prototype.getMaskRange=function(){return this._mskArr.length?[this._firstPos,this._lastPos]:[0,this._tbx.value.length-1]};_MaskProvider.prototype.getRawValue=function(){var e=this._tbx?this._tbx.value:"";if(!this.mask)return e;for(var t="",n=0;n<this._mskArr.length&&n<e.length;n++)this._mskArr[n].literal||e[n]==this._promptChar||(t+=e[n]);return t};_MaskProvider.prototype.refresh=function(){this._parseMask();this._valueChanged()};_MaskProvider.prototype._input=function(e){var t=this;if(this._msk&&!this._composing&&e!=this._evtInput){e.preventDefault();e.stopImmediatePropagation();setTimeout((function(){t._valueChanged();t._tbx&&t._tbx.dispatchEvent(t._evtInput)}))}};_MaskProvider.prototype._keydown=function(e){if(e.keyCode==Key.Back){var t=this._tbx.selectionStart,n=this._tbx.selectionEnd;if(t<=this._firstPos&&n==t){e.preventDefault();this._backSpace=!1;return}}this._backSpace=e.keyCode==Key.Back};_MaskProvider.prototype._keypress=function(e){e.ctrlKey||e.metaKey||e.altKey||this._composing||!this._preventKey(e.charCode)||e.preventDefault()};_MaskProvider.prototype._cmpstart=function(e){this._composing=!0};_MaskProvider.prototype._cmpend=function(e){var t=this;if(this._composing){this._composing=!1;setTimeout((function(){var e=t._tbx;e&&t._valueChanged()&&e.dispatchEvent(t._evtInput)}))}};_MaskProvider.prototype._preventKey=function(e){if(e&&this._mskArr.length){var t=this._tbx,n=t.selectionStart,r=String.fromCharCode(e);n<this._firstPos&&setSelectionRange(t,n=this._firstPos);if(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};_MaskProvider.prototype._connect=function(e){var t=this._tbx;if(t){assert(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected.");if(e){this._autoComplete=t.autocomplete;this._spellCheck=t.spellcheck;t.autocomplete="off";t.spellcheck=!1;t.addEventListener("input",this._inputBnd,!0);t.addEventListener("keydown",this._keydownBnd,!0);t.addEventListener("keypress",this._keypressBnd,!0);t.addEventListener("compositionstart",this._cmpstartBnd,!0);t.addEventListener("compositionend",this._cmpendBnd,!0);t.addEventListener("blur",this._cmpendBnd,!0);this._valueChanged()}else{t.autocomplete=this._autoComplete;t.spellcheck=this._spellCheck;t.removeEventListener("input",this._inputBnd,!0);t.removeEventListener("keydown",this._keydownBnd,!0);t.removeEventListener("keypress",this._keypressBnd,!0);t.removeEventListener("compositionstart",this._cmpstartBnd,!0);t.removeEventListener("compositionend",this._cmpendBnd,!0);t.removeEventListener("blur",this._cmpendBnd,!0)}}};_MaskProvider.prototype._valueChanged=function(){if(!this._tbx||!this._msk)return!1;var e=this._tbx,t=e.selectionStart,n=t>0?e.value[t-1]:"",r=e.value;e.value=this._applyMask();""==r&&(t=this._firstPos+1);var i=t>0?e.value[t-1]:"";t>0&&i==this._promptChar&&n!=this.promptChar&&t--;t==r.length&&(t=this._matchEnd);this._validatePosition(t);return r!=e.value};_MaskProvider.prototype._applyMask=function(){var e=this._tbx,t=e.value;this._full=!0;this._matchEnd=0;if(!this._msk)return t;if(!t&&!e.required)return t;if(this._overWrite){var n=e.selectionStart;e==document.activeElement&&e.selectionEnd==n&&t.length>this.mask.length&&(t=t.substr(0,n)+t.substr(n+t.length-this.mask.length))}t=this._handleVagueLiterals(t);for(var r="",i=0,o=this._promptChar,s=0;s<this._mskArr.length;s++){var a=this._mskArr[s],l=a.literal;l&&l==t[i]&&i++;if(a.wildCard){l=o;if(t){for(var u=i;u<t.length;u++)if(this._isCharValid(a.wildCard,t[u])){l=t[u];switch(a.charCase){case">":l=l.toUpperCase();break;case"<":l=l.toLowerCase()}l!=o&&(this._matchEnd=r.length+1);break}i=u+1}l==o&&(this._full=!1)}r+=l}return r};_MaskProvider.prototype._handleVagueLiterals=function(e){if(e.length>this._mskArr.length+1)return e;var t=e.length-this._mskArr.length;if(0!=t&&e.length>1){for(var n=-1,r=this._backSpace,i=this._tbx,o=i==getActiveElement()?i.selectionStart:i.value.length,s=Math.max(0,o-t);s<this._mskArr.length;s++)if(this._mskArr[s].vague){n=s;break}if(n>-1)if(t<0){if(r)for(;n>0&&this._mskArr[n-1].literal;)n--;var a=Array(1-t).join(this._promptChar),l=n+t;l>-1&&(e=e.substr(0,l)+a+e.substr(l-t))}else{for(;n>0&&this._mskArr[n-1].literal;)n--;e=e.substr(0,n)+e.substr(n+t)}}return e};_MaskProvider.prototype._isCharValid=function(e,t){if(t==this._promptChar)return!0;switch(e){case"0":return this._isDigit(t);case"9":return this._isDigit(t)||" "==t;case"#":return this._isDigit(t)||" "==t||"+"==t||"-"==t;case"L":return this._isLetter(t);case"l":return this._isLetter(t)||" "==t;case"A":return this._isDigit(t)||this._isLetter(t);case"a":return this._isDigit(t)||this._isLetter(t)||" "==t;case"9":return t>="0"&&t<="9";case"J":case"G":return!("G"==e&&_MaskProvider._X_DBCS_BIG_HIRA.indexOf(t)>-1)&&(t>="ぁ"&&t<="ゟ");case"K":case"N":return!("N"==e&&_MaskProvider._X_DBCS_BIG_KATA.indexOf(t)>-1)&&(t>="゠"&&t<="ヿ");case"Z":return!(t>="ヲ"&&t<="゚")&&(t<" "||t>"ÿ");case"H":return t>="!"&&t<="ÿ"||t>="ヲ"&&t<="゚";case"K":case"N":return!("N"==e&&_MaskProvider._X_SBCS_BIG_KATA.indexOf(t)>-1)&&(t>="ヲ"&&t<="゚")}return!1};_MaskProvider.prototype._isDigit=function(e){return e>="0"&&e<="9"};_MaskProvider.prototype._isLetter=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"};_MaskProvider.prototype._validatePosition=function(e){var t=this._mskArr;if(this._backSpace)for(;e>0&&e<t.length&&t[e-1].literal;)e--;if(0==e||!this._backSpace)for(;e<t.length&&t[e].literal;)e++;getActiveElement()==this._tbx&&setSelectionRange(this._tbx,e);this._backSpace=!1};_MaskProvider.prototype._parseMask=function(){this._mskArr=[];this._firstPos=-1;this._lastPos=-1;for(var e,t=this._msk,n="|",r=0;t&&r<t.length;r++)switch(t[r]){case"0":case"9":case"#":case"A":case"a":case"L":case"l":case"9":case"J":case"G":case"K":case"N":case"Z":case"K":case"N":case"H":this._firstPos<0&&(this._firstPos=this._mskArr.length);this._lastPos=this._mskArr.length;this._mskArr.push(new _MaskElement(t[r],n));break;case".":case",":case":":case"/":case"$":switch(t[r]){case".":case",":e=exports.culture.Globalize.numberFormat[t[r]];break;case":":case"/":e=exports.culture.Globalize.calendar[t[r]];break;case"$":e=exports.culture.Globalize.numberFormat.currency.symbol}for(var i=0;i<e.length;i++)this._mskArr.push(new _MaskElement(e[i]));break;case"<":case">":case"|":n=t[r];break;case"\\":r<t.length-1&&r++;this._mskArr.push(new _MaskElement(t[r]));break;default:this._mskArr.push(new _MaskElement(t[r]))}for(r=0;r<this._mskArr.length;r++){var o=this._mskArr[r];if(o.literal)for(i=0;i<this._mskArr.length;i++){var s=this._mskArr[i];if(s.wildCard&&this._isCharValid(s.wildCard,o.literal)){o.vague=!0;break}}}};_MaskProvider.prototype.dispose=function(){this._connect(!1);this._tbx=null;this._inputBnd=null;this._keydownBnd=null;this._keypressBnd=null;this._cmpstartBnd=null;this._cmpendBnd=null;this._mskArr=null;this._evtInput=null};_MaskProvider._X_DBCS_BIG_HIRA="ぁぃぅぇぉっゃゅょゎゕゖ";_MaskProvider._X_DBCS_BIG_KATA="ァィゥェォッャュョヮヵヶ";_MaskProvider._X_SBCS_BIG_KATA="ァィゥェォャュョッ";return _MaskProvider}();exports._MaskProvider=_MaskProvider;var Aggregate,_MaskElement=function _MaskElement(e,t){if(t){this.wildCard=e;this.charCase=t}else this.literal=e};exports._MaskElement=_MaskElement;!function(e){e[e.None=0]="None";e[e.Sum=1]="Sum";e[e.Cnt=2]="Cnt";e[e.Avg=3]="Avg";e[e.Max=4]="Max";e[e.Min=5]="Min";e[e.Rng=6]="Rng";e[e.Std=7]="Std";e[e.Var=8]="Var";e[e.StdPop=9]="StdPop";e[e.VarPop=10]="VarPop";e[e.CntAll=11]="CntAll";e[e.First=12]="First";e[e.Last=13]="Last"}(Aggregate=exports.Aggregate||(exports.Aggregate={}));function getAggregate(e,t,n,r){var i=0,o=0,s=0,a=0,l=null,u=null,c=null,p=n?new Binding(n):null;if((e=asEnum(e,Aggregate))==Aggregate.CntAll)return t.length;for(var h=0;h<t.length;h++){var f=t[h];p&&(f=p.getValue(f));if(null!=f){if(e==Aggregate.First)return f;i++;(null==l||f<l)&&(l=f);(null==u||f>u)&&(u=f);c=f;f&&"string"==typeof f&&f.length>1&&"="===f[0]&&"="!==f[1]&&r&&"function"==typeof r.evaluate&&(f=r.evaluate(f));if(isNumber(f)&&!isNaN(f)){o++;s+=f;a+=f*f}else if(isBoolean(f)){o++;if(1==f){s++;a++}}}}var d=0==o?0:s/o;switch(e){case Aggregate.Avg:return d;case Aggregate.Cnt:return i;case Aggregate.Max:return u;case Aggregate.Min:return l;case Aggregate.Rng:return u-l;case Aggregate.Sum:return s;case Aggregate.VarPop:return o<=1?0:a/o-d*d;case Aggregate.StdPop:return o<=1?0:Math.sqrt(a/o-d*d);case Aggregate.Var:return o<=1?0:(a/o-d*d)*o/(o-1);case Aggregate.Std:return o<=1?0:Math.sqrt((a/o-d*d)*o/(o-1));case Aggregate.Last:return c;case Aggregate.First:return null}throw"Invalid aggregate type."}exports.getAggregate=getAggregate;function extend(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var ArrayBase=function(e){__extends(ArrayBase,e);function ArrayBase(){var t=this;canChangePrototype?t.length=0:t=e.call(this)||this;return t}return ArrayBase}(Array);exports.ArrayBase=ArrayBase;var canChangePrototype=!0;try{extend(ArrayBase.prototype,Array.prototype);canChangePrototype=ArrayBase.prototype.length===Array.prototype.length}catch(e){canChangePrototype=!1}var symb="undefined"!=typeof window?window.Symbol:null;!canChangePrototype&&symb&&symb.species&&Object.defineProperty(ArrayBase,symb.species,{get:function(){return Array},enumerable:!1,configurable:!1});var SortNulls,ObservableArray=function(e){__extends(ObservableArray,e);function ObservableArray(t){var n=e.call(this)||this;n._updating=0;n.collectionChanged=new Event;if(t){t=asArray(t);n._updating++;for(var r=0;r<t.length;r++)n.push(t[r]);n._updating--}return n}ObservableArray.prototype.push=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];n.forEach((function(n){e.prototype.push.call(t,n);t._raiseCollectionChanged(NotifyCollectionChangedAction.Add,n,t.length-1)}));return this.length};ObservableArray.prototype.shift=function(){var t=e.prototype.shift.call(this);this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,0);return t};ObservableArray.prototype.unshift=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.prototype.unshift.apply(this,t);1==t.length?this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t[0],0):this._raiseCollectionChanged();return r};ObservableArray.prototype.pop=function(){var t=e.prototype.pop.call(this);this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,this.length);return t};ObservableArray.prototype.splice=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o,s=NotifyCollectionChangedAction,a=this._raiseCollectionChanged.bind(this);if(n&&r.length){o=e.prototype.splice.apply(this,[t,n].concat(r));1==n&&1==r.length?a(s.Change,r[0],t):a()}else if(r.length){o=e.prototype.splice.apply(this,[t,0].concat(r));1==r.length?a(s.Add,r[0],t):a()}else{o=e.prototype.splice.call(this,t,n);1==n?a(s.Remove,o[0],t):a()}return o};ObservableArray.prototype.slice=function(t,n){return e.prototype.slice.call(this,t,n)};ObservableArray.prototype.indexOf=function(t,n){return e.prototype.indexOf.call(this,t,n)};ObservableArray.prototype.sort=function(t){var n=e.prototype.sort.call(this,t);this._raiseCollectionChanged();return n};ObservableArray.prototype.insert=function(e,t){this.splice(e,0,t)};ObservableArray.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.removeAt(t);return t>-1};ObservableArray.prototype.removeAt=function(e){this.splice(e,1)};ObservableArray.prototype.setAt=function(e,t){e>=this.length&&(this.length=e+1);this.splice(e,1,t)};ObservableArray.prototype.clear=function(){this.length&&this.splice(0,this.length)};ObservableArray.prototype.beginUpdate=function(){this._updating++};ObservableArray.prototype.endUpdate=function(e){void 0===e&&(e=!1);this._updating--;this._updating<=0&&!e&&this._raiseCollectionChanged()};Object.defineProperty(ObservableArray.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0});ObservableArray.prototype.deferUpdate=function(e){try{this.beginUpdate();e()}finally{this.endUpdate()}};ObservableArray.prototype.implementsInterface=function(e){return"INotifyCollectionChanged"==e};ObservableArray.prototype.onCollectionChanged=function(e){void 0===e&&(e=NotifyCollectionChangedEventArgs.reset);this.isUpdating||this.collectionChanged.raise(this,e)};ObservableArray.prototype._raiseCollectionChanged=function(e,t,n){void 0===e&&(e=NotifyCollectionChangedAction.Reset);if(!this.isUpdating){var r=new NotifyCollectionChangedEventArgs(e,t,n);this.onCollectionChanged(r)}};return ObservableArray}(ArrayBase);exports.ObservableArray=ObservableArray;!function(e){e[e.Natural=0]="Natural";e[e.First=1]="First";e[e.Last=2]="Last"}(SortNulls=exports.SortNulls||(exports.SortNulls={}));var _OBJ_DEPTH=2,CollectionView=function(){function CollectionView(e,t){var n=this;this._srcRaw=null;this._src=null;this._ncc=null;this._view=null;this._pgView=null;this._groups=null;this._fullGroups=null;this._digest="";this._idx=-1;this._filter=null;this._filters=new ObservableArray;this._srtDsc=new ObservableArray;this._grpDesc=new ObservableArray;this._newItem=null;this._edtItem=null;this._edtClone=null;this._committing=!1;this._canceling=!1;this._pendingRefresh=!1;this._pendingRemove=!1;this._pgSz=0;this._pgIdx=0;this._updating=0;this._stableSort=!1;this._srtNulls=SortNulls.Last;this._canFilter=!0;this._canGroup=!0;this._canSort=!0;this._canAddNew=!0;this._canCancelEdit=!0;this._canRemove=!0;this._canChangePage=!0;this._refreshOnEdit=!0;this._trackChanges=!1;this._chgAdded=new ObservableArray;this._chgRemoved=new ObservableArray;this._chgEdited=new ObservableArray;this._orgVals=window.Map?new Map:null;this._srtCvt=null;this._srtCmp=null;this._getError=null;this._keepCurrentItem=null;this._initializing=!1;this.collectionChanged=new Event;this.sourceCollectionChanging=new Event;this.sourceCollectionChanged=new Event;this.currentChanged=new Event;this.currentChanging=new Event;this.pageChanged=new Event;this.pageChanging=new Event;this._srtDsc.collectionChanged.addHandler((function(){n._srtDsc.forEach((function(e){assert(e instanceof SortDescription,"sortDescriptions array must contain SortDescription objects.")}));n.canSort&&n._commitAndRefresh()}));this._grpDesc.collectionChanged.addHandler((function(){n._grpDesc.forEach((function(e){assert(e instanceof GroupDescription,"groupDescriptions array must contain GroupDescription objects.")}));n.canGroup&&n._commitAndRefresh()}));this._filters.collectionChanged.addHandler((function(){n._filters.forEach((function(e){assert(isFunction(e),"filters array must contain IPredicate functions.")}));n.canFilter&&n._commitAndRefresh()}));this._chgEdited.collectionChanged.addHandler((function(e,t){if(t&&t.action&&n._orgVals&&0!==n._orgVals.size)switch(t.action){case NotifyCollectionChangedAction.Remove:n._orgVals.delete(t.item);break;case NotifyCollectionChangedAction.Reset:n._orgVals.clear()}}));this.sourceCollection=e||new ObservableArray;if(t){this._initializing=!0;this.deferUpdate((function(){copy(n,t)}));this._initializing=!1}null==this._keepCurrentItem&&(this._keepCurrentItem=!0)}CollectionView.prototype._copy=function(e,t){switch(e){case"sortDescriptions":var n=this.sortDescriptions;n.deferUpdate((function(){n.clear();asArray(t).forEach((function(e){isString(e)?e=new SortDescription(e,!0):e instanceof SortDescription||!e.property||(e=new SortDescription(e.property,e.ascending));n.push(e)}))}));return!0;case"groupDescriptions":var r=this.groupDescriptions;r.deferUpdate((function(){r.clear();t.forEach((function(e){isString(e)&&(e=new PropertyGroupDescription(e));r.push(e)}))}));return!0;case"currentItem":this.currentItem=t;return!0}return!1};Object.defineProperty(CollectionView.prototype,"calculatedFields",{get:function(){return this._calcFields},set:function(e){if(e&&!window.Proxy){console.warn("** Calculated fields require Proxy (see https://www.npmjs.com/package/proxy-polyfill).");e=null}if(e!=this._calcFields){this._calcFields=e;var t=this._srcRaw;this._srcRaw=null;this.sourceCollection=t}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"newItemCreator",{get:function(){return this._itemCreator},set:function(e){this._itemCreator=asFunction(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortConverter",{get:function(){return this._srtCvt},set:function(e){e!=this._srtCvt&&(this._srtCvt=asFunction(e,!0))},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortComparer",{get:function(){return this._srtCmp},set:function(e){e!=this._srtCmp&&(this._srtCmp=asFunction(e,!0))},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"useStableSort",{get:function(){return this._stableSort},set:function(e){if(e!=this._stableSort){this._stableSort=asBoolean(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortNulls",{get:function(){return this._srtNulls},set:function(e){if((e=asEnum(e,SortNulls))!=this._srtNulls){this._srtNulls=e;this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortNullsFirst",{get:function(){return this.sortNulls!=SortNulls.Last},set:function(e){_deprecated("sortNullsFirst","sortNulls");this.sortNulls=asBoolean(e)?SortNulls.First:SortNulls.Last},enumerable:!0,configurable:!0});CollectionView.prototype.getAggregate=function(e,t,n){return getAggregate(e,n?this._pgView:this._view,t)};Object.defineProperty(CollectionView.prototype,"trackChanges",{get:function(){return this._trackChanges},set:function(e){this._trackChanges=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"refreshOnEdit",{get:function(){return this._refreshOnEdit},set:function(e){this._refreshOnEdit=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemsAdded",{get:function(){return this._chgAdded},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemsRemoved",{get:function(){return this._chgRemoved},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemsEdited",{get:function(){return this._chgEdited},enumerable:!0,configurable:!0});CollectionView.prototype.clearChanges=function(){this._chgAdded.clear();this._chgRemoved.clear();this._chgEdited.clear();this._orgVals&&this._orgVals.clear()};CollectionView.prototype.implementsInterface=function(e){switch(e){case"ICollectionView":case"IEditableCollectionView":case"IPagedCollectionView":case"INotifyCollectionChanged":return!0}return!1};Object.defineProperty(CollectionView.prototype,"getError",{get:function(){return this._getError},set:function(e){if(this._getError!=e){this._getError=asFunction(e);this._raiseCollectionChanged()}},enumerable:!0,configurable:!0});CollectionView.prototype.onCollectionChanged=function(e,t){void 0===e&&(e=NotifyCollectionChangedEventArgs.reset);e.action!=NotifyCollectionChangedAction.Change||this._committing||this._canceling||e.item==this.currentEditItem||e.item==this.currentAddItem||this._trackItemChanged(e.item,t);this._updating||this.collectionChanged.raise(this,e)};CollectionView.prototype._raiseCollectionChanged=function(e,t,n){void 0===e&&(e=NotifyCollectionChangedAction.Reset);var r=new NotifyCollectionChangedEventArgs(e,t,n);this.onCollectionChanged(r)};CollectionView.prototype.onSourceCollectionChanging=function(e){this.sourceCollectionChanging.raise(this,e);return!e.cancel};CollectionView.prototype.onSourceCollectionChanged=function(e){this.sourceCollectionChanged.raise(this,e)};Object.defineProperty(CollectionView.prototype,"canFilter",{get:function(){return this._canFilter},set:function(e){this._canFilter=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canGroup",{get:function(){return this._canGroup},set:function(e){this._canGroup=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canSort",{get:function(){return this._canSort},set:function(e){this._canSort=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentItem",{get:function(){return this._pgView&&this._idx>-1&&this._idx<this._pgView.length?this._pgView[this._idx]:null},set:function(e){this.moveCurrentTo(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentPosition",{get:function(){return this._idx},set:function(e){this.moveCurrentToPosition(asNumber(e))},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"filter",{get:function(){return this._filter},set:function(e){if(this._filter!=e){this._filter=asFunction(e);this.canFilter&&this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"filters",{get:function(){return this._filters},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"groupDescriptions",{get:function(){return this._grpDesc},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isEmpty",{get:function(){return!this._pgView||!this._pgView.length},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortDescriptions",{get:function(){return this._srtDsc},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sourceCollection",{get:function(){return this._src},set:function(e){if(e!=this._srcRaw){if(!this.onSourceCollectionChanging(new CancelEventArgs))return;var t=this.currentPosition;this.commitEdit();null!=this._ncc&&this._ncc.collectionChanged.removeHandler(this._sourceChanged);this._srcRaw=e;this._src=asArray(e,!1);this._calcFields&&(this._src=_getCalculatedArray(this._src,this._calcFields));this._ncc=tryCast(this._src,"INotifyCollectionChanged");this._ncc&&this._ncc.collectionChanged.addHandler(this._sourceChanged,this);this.clearChanges();this.refresh();this.moveCurrentToFirst();this.onSourceCollectionChanged();this.currentPosition<0&&t>-1&&this.onCurrentChanged()}},enumerable:!0,configurable:!0});CollectionView.prototype._sourceChanged=function(e,t){this._updating<=0&&this.refresh()};CollectionView.prototype.contains=function(e){return this._pgView.indexOf(e)>-1};CollectionView.prototype.moveCurrentTo=function(e){return this.moveCurrentToPosition(this._pgView.indexOf(e))};CollectionView.prototype.moveCurrentToFirst=function(){return this.moveCurrentToPosition(0)};CollectionView.prototype.moveCurrentToLast=function(){return this.moveCurrentToPosition(this._pgView.length-1)};CollectionView.prototype.moveCurrentToPrevious=function(){return this._idx>0&&this.moveCurrentToPosition(this._idx-1)};CollectionView.prototype.moveCurrentToNext=function(){return this.moveCurrentToPosition(this._idx+1)};CollectionView.prototype.moveCurrentToPosition=function(e){if(e>=-1&&e<this._pgView.length&&e!=this._idx){var t=new CancelEventArgs;if(this.onCurrentChanging(t)){var n=this._pgView[e],r=_getTargetObject(n),i=this._edtItem,o=this._newItem;i&&i!=n&&i!=r?this.commitEdit():o&&o!=n&&o!=r&&this.commitNew();this._idx=e;this.onCurrentChanged()}}return this._idx==e};CollectionView.prototype.refresh=function(){if(this._newItem||this._edtItem||this._updating>0)this._pendingRefresh=!0;else{var e=this.currentItem;this._performRefresh();this.onCollectionChanged();e==this.currentItem||this._initializing||this.onCurrentChanged()}};CollectionView.prototype._commitAndRefresh=function(){if(this.currentEditItem||this.currentAddItem){this._pendingRefresh=!0;this.commitEdit()}else this.refresh()};CollectionView.prototype._performRefresh=function(){if(this._updating>0)this._pendingRefresh=!0;else{this._pendingRefresh=!1;this._pendingRemove=!1;var e=this.currentItem;this._view=this._src?this._performFilter(this._src):[];if(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=clamp(this._pgIdx,0,this.pageCount-1);this._pgView=this._getPageView();if(this._groups&&this.pageCount>1){this._groups=this._createGroups(this._pgView);this._mergeGroupItems(this._groups)}var t=this._keepCurrentItem&&null!=e?this._pgView.indexOf(e):-1;t<0&&(t=Math.min(this._idx,this._pgView.length-1));this._idx=t;this._digest=this._getGroupsDigest(this.groups)}};CollectionView.prototype._performSort=function(e){if(this._stableSort){var t=e.map((function(e,t){return{item:e,index:t}})),n=this._compareItems();t.sort((function(e,t){var r=n(e.item,t.item);return 0==r?e.index-t.index:r}));for(var r=0;r<e.length;r++)e[r]=t[r].item}else e.sort(this._compareItems())};CollectionView.prototype._compareItems=function(){var e=this,t=this._srtDsc,n=this._srtCvt,r=this._srtCmp,i=CollectionView._collator,o=!0,s=0;return function(a,l){for(var u=0;u<t.length;u++){var c=t[u],p=c._bnd.getValue(a),h=c._bnd.getValue(l);if(n){p=n(c,a,p,o);h=n(c,l,h,!1);o=!1}if(r&&null!=(s=r(p,h))){if(0!=s)return c.ascending?+s:-s}else{p!=p&&(p=null);h!=h&&(h=null);if(p!==h&&(null==p||null==h))switch(e._srtNulls){case SortNulls.First:return null==p?-1:1;case SortNulls.Last:return null==p?1:-1;default:s=null==p?-1:1;return c.ascending?+s:-s}if("string"==typeof p&&"string"==typeof h){if(i){if(0!=(s=i.compare(p,h)))return c.ascending?+s:-s;continue}var f=p.toLowerCase(),d=h.toLowerCase();if(f!=d){p=f;h=d}}if(0!=(s=p<h?-1:p>h?1:0))return c.ascending?+s:-s}}return 0}};CollectionView.prototype._performFilter=function(e){return this.canFilter&&this._filter||this._filters.length?e.filter(this._filterItem,this):e};CollectionView.prototype._filterItem=function(e){for(var t=!this.canFilter||!this._filter||this._filter(e),n=0;n<this._filters.length&&t;n++)t=this._filters[n](e);return t};CollectionView.prototype.onCurrentChanged=function(e){this.currentChanged.raise(this,e)};CollectionView.prototype.onCurrentChanging=function(e){this.currentChanging.raise(this,e);return!e.cancel};Object.defineProperty(CollectionView.prototype,"items",{get:function(){return this._pgView},enumerable:!0,configurable:!0});CollectionView.prototype.beginUpdate=function(){this._updating++};CollectionView.prototype.endUpdate=function(e){void 0===e&&(e=!0);this._updating--;e&&(this._pendingRefresh=!0);if(this._updating<=0){this._pendingRefresh&&this.refresh();if(this._pendingRemove){this._pendingRemove=!1;this._raiseCollectionChanged()}}};Object.defineProperty(CollectionView.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0});CollectionView.prototype.deferUpdate=function(e,t){void 0===t&&(t=!0);try{this.beginUpdate();e()}finally{this.endUpdate(t)}};Object.defineProperty(CollectionView.prototype,"canAddNew",{get:function(){return this._canAddNew},set:function(e){if(e!=this._canAddNew){this._canAddNew=asBoolean(e);this._raiseCollectionChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canCancelEdit",{get:function(){return this._canCancelEdit},set:function(e){this._canCancelEdit=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canRemove",{get:function(){return this._canRemove},set:function(e){this._canRemove=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentAddItem",{get:function(){return this._newItem},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentEditItem",{get:function(){return this._edtItem},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isAddingNew",{get:function(){return null!=this._newItem},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isEditingItem",{get:function(){return null!=this._edtItem},enumerable:!0,configurable:!0});CollectionView.prototype.editItem=function(e){if(e!=this._edtItem&&this.moveCurrentTo(e)){this.commitEdit();this._edtItem=e;this._edtClone=this._extend({},this._edtItem)}};CollectionView.prototype.commitEdit=function(){var e=this._edtItem,t=this._edtClone;if(null!=e){this._committing=!0;var n=this._getChangedFields(e,t),r=this._pendingRefresh;this._edtItem=null;this._edtClone=null;var i=this._pgView.indexOf(e),o=this._digest;this._needRefresh(n)&&this._refreshOnEdit&&this._performRefresh();this._trackItemChanged(e,t);this._pgView.indexOf(e)!=i||o!=this._digest||r?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,e,i);this.commitNew();this._committing=!1;if(this.sourceCollection instanceof ObservableArray){this._updating++;var s=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,e);this.sourceCollection.onCollectionChanged(s);this._updating--}}};CollectionView.prototype.cancelEdit=function(){var e=this._edtItem;if(null!=e){this._edtItem=null;if(!this.canCancelEdit)return;var t=this._src.indexOf(e);if(t>=0&&this._edtClone){this._extend(this._src[t],this._edtClone);this._edtClone=null;this._canceling=!0;this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,e,t);this._canceling=!1;if(this._pendingRefresh&&this._refreshOnEdit){this._performRefresh();this._raiseCollectionChanged()}}}};CollectionView.prototype.addNew=function(e,t){void 0===t&&(t=!1);this.commitEdit();if(!this.canAddNew)return null;var n=this.sourceCollection;null==e&&(e=this.newItemCreator?this.newItemCreator():n&&n.length?new n[0].constructor:{});if(null!=e){this._updating++;n.push(e);this._updating--;e=n[n.length-1];this._newItem=e;this._pgView!=this._src&&this._pgView.push(e);if(this.groups&&this.groups.length){var r=this.groups[this.groups.length-1];r.items.push(e);for(;r.groups&&r.groups.length;)(r=r.groups[r.groups.length-1]).items.push(e)}this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,e,this._pgView.length-1);this.moveCurrentTo(e);t&&this.commitNew()}return this._newItem};CollectionView.prototype.commitNew=function(){var e=this._newItem;if(null!=e){this._newItem=null;var t=this._pgView.indexOf(e),n=this._digest;this._refreshOnEdit&&this._performRefresh();if(this._trackChanges){var r=this._chgEdited.indexOf(e);r>-1&&this._chgEdited.removeAt(r);this._chgAdded.indexOf(e)<0&&this._chgAdded.push(e)}this._pgView.indexOf(e)!=t||n!=this._digest||this.calculatedFields?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,e,t)}};CollectionView.prototype.cancelNew=function(){var e=this._newItem;null!=e&&this.remove(e)};CollectionView.prototype.remove=function(e){var t=e==this._newItem;t&&(this._newItem=null);e==this._edtItem&&this.cancelEdit();if(this.canRemove){var n=this._src.indexOf(e);if(n>-1){var r=this._view.indexOf(e)<0,i=this.currentItem;this._updating++;this._src.splice(n,1);this._updating--;var o=this._digest;if(this._refreshOnEdit)this._performRefresh();else{this._updating>0&&(this._pendingRemove=!0);var s=this._pgView.indexOf(e);s>=0&&this._pgView.splice(s,1)}if(this._trackChanges){var a=this._chgAdded.indexOf(e);a>-1&&this._chgAdded.removeAt(a);var l=this._chgEdited.indexOf(e);l>-1&&this._chgEdited.removeAt(l);this._chgRemoved.indexOf(e)<0&&!t&&a<0&&this._chgRemoved.push(e)}var u=this.sortDescriptions.length>0,c=this.pageSize>0&&this._pgIdx>-1;u||c||o!=this._getGroupsDigest(this.groups)?this._raiseCollectionChanged():r||this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,e,n);this.currentItem!==i&&this.onCurrentChanged()}}};CollectionView.prototype.removeAt=function(e){e=asInt(e);this.remove(this._pgView[e])};CollectionView.prototype._trackItemChanged=function(e,t){if(this._trackChanges){var n=this.sourceCollection;if(n&&n.indexOf(e)>-1){var r=this._orgVals,i=r?r.get(e):null;if(t&&!i){r.set(e,t);i=t}var o=this._chgEdited.indexOf(e),s=NotifyCollectionChangedAction.Change;if(i&&this._sameContent(e,i)){o>-1&&this._chgEdited.removeAt(o);return}if(o<0&&this._chgAdded.indexOf(e)<0)this._chgEdited.push(e);else if(o>-1){var a=new NotifyCollectionChangedEventArgs(s,e,o);this._chgEdited.onCollectionChanged(a)}else if((o=this._chgAdded.indexOf(e))>-1){a=new NotifyCollectionChangedEventArgs(s,e,o);this._chgAdded.onCollectionChanged(a)}}}};CollectionView.prototype._extend=function(e,t,n){void 0===n&&(n=_OBJ_DEPTH);for(var r in t)try{var i=t[r];if(n>0&&isObject(i))if("Map"===i.constructor.name)e[r]=i;else{e[r]={};this._extend(e[r],i,n-1)}else e[r]=i}catch(e){}return e};CollectionView.prototype._getChangedFields=function(e,t,n){void 0===n&&(n=_OBJ_DEPTH);assert(null!=t&&null!=e,"Two objects expected.");var r={};for(var i in t)try{this._sameValue(e[i],t[i],n)||(r[i]=!0)}catch(e){}for(var i in e)try{r[i]||this._sameValue(e[i],t[i],n)||(r[i]=!0)}catch(e){}var o=Object.keys(r);return o.length?o:null};CollectionView.prototype._sameValue=function(e,t,n){void 0===n&&(n=_OBJ_DEPTH);return!!(e===t||DateTime.equals(e,t)||Number.isNaN(e)&&Number.isNaN(t))||!(!isObject(e)||!isObject(t))&&(!(n>0)||null==this._getChangedFields(e,t,n-1))};CollectionView.prototype._sameContent=function(e,t){return null==this._getChangedFields(e,t)};CollectionView.prototype._needRefresh=function(e){if(this._pendingRefresh)return!0;if(!e)return!1;if(this._filter)return!0;for(var t=0;t<this._srtDsc.length;t++){var n=this._getBindingRoot(this._srtDsc[t].property);if(e.indexOf(n)>-1)return!0}for(t=0;t<this._grpDesc.length;t++){var r=this._grpDesc[t];if(!(r instanceof PropertyGroupDescription))return!0;n=this._getBindingRoot(r.propertyName);if(e.indexOf(n)>-1)return!0}return!1};CollectionView.prototype._getBindingRoot=function(e){var t=e.indexOf(".");return t>-1?e.substr(0,t):e};Object.defineProperty(CollectionView.prototype,"canChangePage",{get:function(){return this._canChangePage},set:function(e){this._canChangePage=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isPageChanging",{get:function(){return!1},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemCount",{get:function(){return this._pgView.length},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"pageIndex",{get:function(){return this._pgIdx},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"pageSize",{get:function(){return this._pgSz},set:function(e){if(e!=this._pgSz){this._pgSz=asInt(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"totalItemCount",{get:function(){return this._view.length},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"pageCount",{get:function(){return this.pageSize?Math.ceil(this.totalItemCount/this.pageSize):1},enumerable:!0,configurable:!0});CollectionView.prototype.moveToFirstPage=function(){return this.moveToPage(0)};CollectionView.prototype.moveToLastPage=function(){return this.moveToPage(this.pageCount-1)};CollectionView.prototype.moveToPreviousPage=function(){return this.moveToPage(this.pageIndex-1)};CollectionView.prototype.moveToNextPage=function(){return this.moveToPage(this.pageIndex+1)};CollectionView.prototype.moveToPage=function(e){var t=clamp(e,0,this.pageCount-1);if(t!=this._pgIdx){if(!this.canChangePage)return!1;var n=new PageChangingEventArgs(t);if(this.onPageChanging(n)&&this.onCurrentChanging(n)){this.commitEdit();this.commitNew();var r=this.currentItem;this._pgIdx=t;this._pgView=this._getPageView();this._idx=0;if(this.groupDescriptions&&0!=this.groupDescriptions.length)this.refresh();else{this.onCollectionChanged();r!=this.currentItem&&this.onCurrentChanged()}this.onPageChanged()}}return this._pgIdx==e};CollectionView.prototype.onPageChanged=function(e){this.pageChanged.raise(this,e)};CollectionView.prototype.onPageChanging=function(e){this.pageChanging.raise(this,e);return!e.cancel};CollectionView.prototype._getFullGroup=function(e){var t=this._getGroupByPath(this._fullGroups,e.level,e._path);null!=t&&(e=t);return e};CollectionView.prototype._getGroupByPath=function(e,t,n){if(e)for(var r=0;r<e.length;r++){var i=e[r];if(i.level==t&&i._path==n)return i;if(i.level<t&&0==n.indexOf(i._path)&&null!=(i=this._getGroupByPath(i.groups,t,n)))return i}return null};CollectionView.prototype._getPageView=function(){if(this.pageSize<=0||this._pgIdx<0)return this._view;var e=this._pgSz*this._pgIdx,t=Math.min(e+this._pgSz,this._view.length);return this._view.slice(e,t)};CollectionView.prototype._createGroups=function(e){var t=this;if(!this._grpDesc||!this._grpDesc.length)return null;var n=[],r={},i=null;e.forEach((function(e){for(var o=n,s=t._grpDesc.length,a="",l=0;l<s;l++){var u=t._grpDesc[l],c=u.groupNameFromItem(e,l),p=l==s-1;if(!(i=r[a])&&isPrimitive(c)){i={};r[a]=i}var h=t._getGroup(u,o,i,c,l,p);a+="/"+c;h._path=a;p&&h.items.push(e);o=h.groups}}));return n};CollectionView.prototype._getGroupsDigest=function(e){for(var t="",n=0;null!=e&&n<e.length;n++){var r=e[n];t+="{"+r.name+":"+(r.items?r.items.length:"*");if(r.groups.length>0){t+=",";t+=this._getGroupsDigest(r.groups)}t+="}"}return t};CollectionView.prototype._mergeGroupItems=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[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(o=0,s=r._items.length;o<s;o++)t.push(r._items[o])}return t};CollectionView.prototype._getGroup=function(e,t,n,r,i,o){var s;if(n&&isPrimitive(r)){if(s=n[r])return s}else for(var a=0;a<t.length;a++)if(e.namesMatch(t[a].name,r))return t[a];var l=new CollectionViewGroup(e,r,i,o);t.push(l);n&&(n[r]=l);return l};CollectionView._collator="undefined"!=typeof window&&window.Intl&&Intl.Collator?new Intl.Collator:null;return CollectionView}();exports.CollectionView=CollectionView;var CollectionViewGroup=function(){function CollectionViewGroup(e,t,n,r){this._gd=e;this._name=t;this._level=n;this._isBottomLevel=r;this._groups=[];this._items=[]}Object.defineProperty(CollectionViewGroup.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"isBottomLevel",{get:function(){return this._isBottomLevel},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"groupDescription",{get:function(){return this._gd},enumerable:!0,configurable:!0});CollectionViewGroup.prototype.getAggregate=function(e,t,n,r){var i=tryCast(n,CollectionView);return getAggregate(e,(i?i._getFullGroup(this):this).items,t,r)};CollectionViewGroup.prototype._clone=function(){var e=new CollectionViewGroup(this.groupDescription,this.name,this.level,this.isBottomLevel);e._path=this._path;if(this.groups.length)for(var t=0;t<this.groups.length;t++)e.groups.push(this.groups[t]);if(this.items.length)for(t=0;t<this.items.length;t++)e.items.push(this.items[t]);return e};return CollectionViewGroup}();exports.CollectionViewGroup=CollectionViewGroup;var _NullValue=function _NullValue(e){this._id=e};exports._NullValue=_NullValue;exports.controlBaseClass="undefined"!=typeof window&&window["wj-control-is-element"]?HTMLElement:Object;var __isES6Mode=!1;try{var f=function __c(){};f.prototype=Array.prototype;__isES6Mode=f.prototype!==Array.prototype}catch(e){__isES6Mode=!0}var __callSuper=__isES6Mode||exports.controlBaseClass!==Object,ControlBase=function(e){__extends(ControlBase,e);function ControlBase(){var t=this;__callSuper&&(t=e.call(this)||this);return t}return ControlBase}(exports.controlBaseClass);exports.ControlBase=ControlBase;var Control=function(e){__extends(Control,e);function Control(t,n,r){void 0===n&&(n=null);void 0===r&&(r=!1);var i=e.call(this)||this;i.workingAs="PureJs";i.disposed=!1;i._orgAttributes=[];i._listeners=[];i._pristine=!0;i._focus=!1;i._updating=0;i._fullUpdate=!1;i._listenResizeEvents=!0;i.gotFocus=new Event;i.lostFocus=new Event;i.invalidInput=new Event;i.refreshing=new Event;i.refreshed=new Event;i._updateWme();assert(null==Control.getControl(t),"Element is already hosting a control.");var o=getElement(t);assert(null!=o,"Cannot find the host element.");i._orgTabIndex=o.hasAttribute("tabindex")?o.tabIndex:0;for(var s=0;s<o.attributes.length;s++){var a=o.attributes[s];i._orgAttributes.push({name:a.name,value:a.textContent})}i._orgInner=o.innerHTML;i._orgTag=o.tagName;i._orgAtts=o.attributes;"INPUT"!=o.tagName&&"SELECT"!=o.tagName||(o=i._replaceWithDiv(o));i._e=o;o[Control._CTRL_KEY]=i;var l=i.addEventListener.bind(i);if(1==r){i._szCtl=new Size(o.offsetWidth,o.offsetHeight);var u=window.ResizeObserver,c=null;u&&(c=i._szObserver=new u((function(e){return i._resizeObserverCallback(e)})));c?c.observe(o):l(window,"resize",i._handleResize.bind(i))}var p=i._handleFocusBlur.bind(i);l(o,"focus",p,!0);l(o,"blur",p,!0);var h=i._handleDisabled.bind(i);l(o,"mousedown",h,!0);l(o,"mouseup",h,!0);l(o,"click",h,!0);l(o,"dblclick",h,!0);l(o,"wheel",h,getEventOptions(!0,!0));l(o,"keydown",(function(e){i.isDisabled&&e.keyCode!=Key.Tab&&e.preventDefault()}));0==Control._ctlCnt&&_detectTouch(!0);Control._ctlCnt++;return i}Control.prototype.getTemplate=function(){for(var e=Object.getPrototypeOf(this);e;e=Object.getPrototypeOf(e)){var t=e.constructor.controlTemplate;if(t)return t}return null};Control.prototype.applyTemplate=function(e,t,n,r){var i=this,o=this._e;e&&addClass(o,e);var s=null;t&&(s=createElement(t,o));for(var a=o.querySelectorAll("a."+exports.InputFormElementsClsNames.btn),l=0;l<a.length;l++){var u=a[l];setAttribute(u,"role","button",!0);setAttribute(u,"href","",!0);setAttribute(u,"draggable",!1,!0)}var c=o.querySelectorAll("button");for(l=0;l<c.length;l++)setAttribute(c[l],"type","button",!0);var p=o.querySelectorAll("input"),h=1==p.length?p[0]:null;if(h){var f=Control._rxInputAtts;this._copyAttributes(h,o.attributes,f);this._copyAttributes(h,this._orgAtts,f)}if(h&&o.id){for(var d=o;d.parentElement;)d=d.parentElement;var g=d.querySelector('label[for="'+o.id+'"]');if(g instanceof HTMLLabelElement){var _=getUniqueId(o.id+"_input");h.id=_;g.htmlFor=_}}if(h){var m=h.value,v=!0,b=!1,y=document.createEvent("HTMLEvents");y.initEvent("change",!0,!1);this.gotFocus.addHandler((function(){v=!1;b=!0;m=h.value}));this.addEventListener(o,"focusin",(function(e){if(v){b=!0;v=!1;m=h.value}}));this.addEventListener(h,"input",(function(){i._pristine=!1;i._getInputValueTimer=setTimeout((function(){m=h.value}))}));this.addEventListener(h,"change",(function(e){e.isTrusted&&(m=h.value)}));var leave_1=function(){if(!i._containsFocus()){v=!0;if(i._pristine){i._pristine=!1;i._updateState()}if(b&&m!=h.value){m=h.value;h.dispatchEvent(y)}b=!1}};this.addEventListener(o,"blur",(function(){leave_1()}));this.lostFocus.addHandler((function(){leave_1()}))}h?o.tabIndex=-1:o.getAttribute("tabindex")||(o.tabIndex=0);this._updateState();if(n)for(var C in n){var w=n[C];this[C]=s.querySelector('[wj-part="'+w+'"]');null==this[C]&&s.getAttribute("wj-part")==w&&(this[C]=s);if(null==this[C])throw'Missing template part: "'+w+'"';if(w==r){var E="name",A=o.attributes[E];A&&A.value&&this[C].setAttribute(E,A.value);E="accesskey";if((A=o.attributes[E])&&A.value){this[C].setAttribute(E,A.value);o.removeAttribute(E)}}}return s};Control.prototype.dispose=function(){if(this._e){this.disposed=!0;for(var e=this._e.querySelectorAll("."+exports.ControlClsNames.hostElement),t=0;t<e.length;t++){var n=Control.getControl(e[t]);n&&n.dispose()}if(this._toInv){clearTimeout(this._toInv);this._toInv=null}if(this._toFocus){clearTimeout(this._toFocus);this._toFocus=null}if(this._getInputValueTimer){clearTimeout(this._getInputValueTimer);this._getInputValueTimer=null}if(this._updateFocusStateTimer){clearTimeout(this._updateFocusStateTimer);this._updateFocusStateTimer=null}if(this.focusService){this.focusService.dispose();this.focusService=null}var r=this._szObserver;r&&r.disconnect();this.removeEventListener();for(var i in this)if(i.length>2&&0==i.indexOf("on")){(s=this[i[2].toLowerCase()+i.substr(3)])instanceof Event&&s.removeAllHandlers()}var o=this.collectionView;if(o instanceof CollectionView)for(var i in o){var s;(s=o[i])instanceof Event&&s.removeHandler(null,this)}if(this._e.parentNode){for(;this._e.attributes.length>0;)this._e.removeAttribute(this._e.attributes[0].name);for(var a=0,l=this._orgAttributes;a<l.length;a++){var u=l[a];this._e.setAttribute(u.name,u.value)}this._e.innerHTML=this._orgInner}this._e[Control._CTRL_KEY]=null;this._e=this._orgTag=this._szObserver=null;Control._ctlCnt--;0==Control._ctlCnt&&_detectTouch(!1);if(Control._ctlInvalidInput===this){if(Control._toInvalidInput){clearTimeout(Control._toInvalidInput);Control._toInvalidInput=null}if(Control._toClearCtlInvalid){clearTimeout(Control._toClearCtlInvalid);Control._toClearCtlInvalid=null}Control._ctlInvalidInput=null}if(Control._toTouch){clearTimeout(Control._toTouch);Control._toTouch=null}}};Control.getControl=function(e){var t=getElement(e);return t?asType(t[Control._CTRL_KEY],Control,!0):null};Object.defineProperty(Control.prototype,"hostElement",{get:function(){return this._e},enumerable:!0,configurable:!0});Object.defineProperty(Control.prototype,"rightToLeft",{get:function(){null==this._rtlDir&&(this._rtlDir=!!this._e&&"rtl"==getComputedStyle(this._e).direction);return this._rtlDir},enumerable:!0,configurable:!0});Control.prototype.focus=function(){var e=this._e;e&&e.offsetHeight&&(this.isDisabled||!(e.tabIndex>=0)&&moveFocus(e,0)||e.focus())};Control.prototype.containsFocus=function(){return this._containsFocusImpl(getActiveElement())};Control.prototype._containsFocus=function(){this.focusService||(this.focusService=new _FocusService);return this._containsFocusImpl(_getActiveElement(this.focusService.activeElement))};Control.prototype._containsFocusImpl=function(e){return contains(this._e,e,!0)};Control.prototype.invalidate=function(e){var t=this;void 0===e&&(e=!0);this._rtlDir=null;this._fullUpdate=this._fullUpdate||e;if(this._toInv){clearTimeout(this._toInv);this._toInv=null}this.isUpdating||this.disposed||(this._toInv=setTimeout((function(){t.refresh(t._fullUpdate);t._toInv=null}),Control._REFRESH_INTERVAL))};Control.prototype.refresh=function(e){var t=this;void 0===e&&(e=!0);if(!this.isUpdating&&!this.disposed){this.onRefreshing();this.refreshed.hasHandlers&&setTimeout((function(){t.onRefreshed()}))}if(!this.isUpdating&&this._toInv){clearTimeout(this._toInv);this._toInv=null;this._fullUpdate=!1}this._updateState();this._updateWme()};Control.invalidateAll=function(e){e||(e=document.body);var t=e.children;if(t)for(var n=0;n<t.length;n++)Control.invalidateAll(t[n]);var r=Control.getControl(e);r&&r.invalidate()};Control.refreshAll=function(e){e||(e=document.body);if(e.children)for(var t=0;t<e.children.length;t++)Control.refreshAll(e.children[t]);var n=Control.getControl(e);n&&n.refresh()};Control.disposeAll=function(e){var t=Control.getControl(e);if(t)t.dispose();else if(e.children)for(var n=0;n<e.children.length;n++)Control.disposeAll(e.children[n])};Control.prototype.beginUpdate=function(){this._updating++};Control.prototype.endUpdate=function(e){void 0===e&&(e=!0);this._updating--;this._updating<=0&&e&&this.invalidate()};Object.defineProperty(Control.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0});Control.prototype.deferUpdate=function(e){try{this.beginUpdate();e()}finally{this.endUpdate()}};Object.defineProperty(Control.prototype,"isTouching",{get:function(){return Control._touching},enumerable:!0,configurable:!0});Object.defineProperty(Control.prototype,"tabOrder",{get:function(){return this._orgTabIndex},set:function(e){this._setTabOrder(e)},enumerable:!0,configurable:!0});Control.prototype._setTabOrder=function(e){var t=this._e;this._orgTabIndex=e;var n=t.querySelectorAll("input"),r=1===n.length?n[0]:null;t.tabIndex=this.isDisabled||r?-1:this._orgTabIndex;r&&(r.tabIndex=this._orgTabIndex)};Object.defineProperty(Control.prototype,"isDisabled",{get:function(){return this._e&&null!=this._e.getAttribute("disabled")},set:function(e){this._setIsDisabled(e)},enumerable:!0,configurable:!0});Control.prototype._setIsDisabled=function(e){if((e=!!asBoolean(e,!0))!=this.isDisabled){var t=this._e;if(t){toggleClass(t,exports.ControlStateClsNames.disabled,e);setAttribute(t,"disabled",e?"disabled":null);setAttribute(t,"aria-disabled",e);if(t.id){var n=document.querySelector("[dropdown-id="+t.id+"]");n&&toggleClass(n,exports.ControlStateClsNames.disabled,e)}t.tabIndex=this.isDisabled||1===t.querySelectorAll("input").length?-1:this._orgTabIndex;for(var r=t.querySelectorAll("input,textarea,button,command,fieldset,keygen,optgroup,option,select"),i=Control._DSBL_KEY,o=0;o<r.length;o++){var s=r[o];if(e){s[i]=s.disabled;s.disabled=!0}else{if(!!closest(s,"."+exports.ControlClsNames.hostElement+"."+exports.ControlStateClsNames.disabled)){s[i]=s.disabled;s.disabled=!0}else{var a=s[i];isBoolean(a)||(a=!1);s.disabled=a;delete s[i]}}}}}};Control.prototype.initialize=function(e){copy(this,e)};Control.prototype.addEventListener=function(e,t,n,r,i){if(e){null==r&&(r=!1);isBoolean(r)&&null==i&&(t.indexOf("touch")>-1||t.indexOf("wheel")>-1)&&(i=!1);var o=isBoolean(r)&&isBoolean(i)?getEventOptions(r,i):r;e.addEventListener(t,n,o);this._listeners.push({target:e,type:t,fn:n,capture:r})}};Control.prototype.removeEventListener=function(e,t,n,r){for(var i=0,o=0;o<this._listeners.length;o++){var s=this._listeners[o];if(!(null!=e&&e!=s.target||null!=t&&t!=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};Control.prototype.onGotFocus=function(e){this.gotFocus.raise(this,e)};Control.prototype.onLostFocus=function(e){this.lostFocus.raise(this,e)};Control.prototype.onInvalidInput=function(e){this.invalidInput.raise(this,e);var t=this;if(e.cancel){var n=Control._FOCUS_INTERVAL+50;if(null==Control._ctlInvalidInput||Control._ctlInvalidInput===this){Control._ctlInvalidInput=this;Control._toInvalidInput&&clearTimeout(Control._toInvalidInput);Control._toClearCtlInvalid&&clearTimeout(Control._toClearCtlInvalid);Control._toInvalidInput=setTimeout((function(){Control._toInvalidInput=null;t.containsFocus()||"isDroppedDown"in t&&"_isDropdownOpened"in t&&t._isDropdownOpened&&(t.isDroppedDown=t._isDropdownOpened);t.focus();Control._toClearCtlInvalid=setTimeout((function(){Control._ctlInvalidInput=null;Control._toClearCtlInvalid=null}),n)}),n)}}else Control._ctlInvalidInput=null;this._updateState();return!e.cancel};Control.prototype.onRefreshing=function(e){this.refreshing.raise(this,e)};Control.prototype.onRefreshed=function(e){this.refreshed.raise(this,e)};Control.prototype._getProductInfo=function(){return"B0C3,Control"};Control.prototype._getFocusedElements=function(e){for(var t=e;t;){if(!t.parentNode)return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&void 0!==t.host?t.querySelectorAll("."+exports.ControlStateClsNames.focused):document.body.querySelectorAll("."+exports.ControlStateClsNames.focused);t=t.parentNode}return[]};Control.prototype._updateWme=function(){var e=this._getProductInfo(),t=Control._toWme,n=_updateWme;if(isFunction(n)&&!t[e]){t[e]=!0;n(this,Control._licKey)}};Control.prototype._hasPendingUpdates=function(){return null!=this._toInv};Control.prototype._handleResize=function(){if(this._e.parentElement||this._e.parentNode){var e=new Size(this._e.offsetWidth,this._e.offsetHeight);if(!e.equals(this._szCtl)){this._szCtl=e;this._listenResizeEvents&&(e.width||e.height)&&this.invalidate()}}};Control.prototype._resizeObserverCallback=function(e){e.forEach((function(e){var t=Control.getControl(e.target);t&&t._handleResize()}))};Control.prototype._handleFocusBlur=function(){var e=this;this._toFocus||(this._toFocus=setTimeout((function(){e._toFocus=null;e._updateFocusState()}),Control._FOCUS_INTERVAL))};Control.prototype._updateFocusState=function(){var e=this;this._updateFocusStateTimer=setTimeout((function(){for(var t=EventArgs.empty,n=e._getFocusedElements(e.hostElement),r=0;r<n.length;r++){if((a=Control.getControl(n[r]))&&a._focus&&!a.containsFocus()){removeClass(a._e,exports.ControlStateClsNames.focus);a._focus=!1;a._updateState();a.onLostFocus(t)}}var i=getActiveElement();if(i)for(var o=!0,s=i;s;){var a;if((a=Control.getControl(s))&&!a._focus&&a.containsFocus()){if(o){addClass(s,exports.ControlStateClsNames.focus);o=!1}a._focus=!0;a._updateState();a.onGotFocus(t)}s=s[Control._OWNR_KEY]||s.parentNode}}))};Control.prototype._updateState=function(){var e=this.hostElement;if(e){toggleClass(e,exports.ControlStateClsNames.focused,this._focus);this._rtlDir="rtl"==getComputedStyle(e).direction;toggleClass(e,exports.UtilitesClsNames.rtl,this._rtlDir);var t=e.querySelector("input");if(t instanceof HTMLInputElement){toggleClass(e,exports.ControlStateClsNames.empty,0==t.value.length);toggleClass(e,exports.ControlStateClsNames.readOnly,t.readOnly);var n=t.validationMessage;toggleClass(e,exports.ControlStateClsNames.invalid,!this._pristine&&null!=n&&n.length>0);var r=closest(this.hostElement,exports.ControlStateClsNames.labeledInput),i=r&&r.querySelector(exports.ControlStateClsNames.wjError);if(i){var o=this.hostElement.classList.contains(exports.ControlStateClsNames.invalid);toggleClass(i,exports.ControlStateClsNames.errorVisible,o)}}}};Control.prototype._handleDisabled=function(e){if(this.isDisabled||closest(e.target,"."+exports.ControlStateClsNames.disabled)){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation()}};Control.prototype._replaceWithDiv=function(e){var t=document.createElement("div");e.parentElement.replaceChild(t,e);t.innerHTML=e.innerHTML;this._copyAttributes(t,e.attributes,/id|style|class/i);return t};Control.prototype._copyAttributes=function(e,t,n){if(e)for(var r=0;r<t.length;r++){var i=t[r].name;i.match(n)&&e.setAttribute(i,t[r].value)}};Control.prototype._getKeyCode=function(e){var t=e.keyCode;if(this.rightToLeft)switch(t){case Key.Right:t=Key.Left;break;case Key.Left:t=Key.Right}return t};Control.prototype._getCodeAsPerRTL=function(e){var t=e.code;if(this.rightToLeft)switch(t){case"ArrowRight":return"ArrowLeft";case"ArrowLeft":return"ArrowRight"}return t};Control.sharedState={};Control._toWme={};Control._ctlCnt=0;Control._touching=!1;Control._REFRESH_INTERVAL=10;Control._FOCUS_INTERVAL=5;Control._ANIM_DEF_DURATION=400;Control._ANIM_DEF_STEP=35;Control._CLICK_DELAY=800;Control._CLICK_REPEAT=75;Control._CLIPBOARD_DELAY=100;Control._POPUP_ZINDEX=1500;Control._SEARCH_DELAY=500;Control._HOVER_DELAY=400;Control._LEAVE_DELAY=600;Control._DRAG_SCROLL_EDGE=15;Control._DRAG_SCROLL_STEP=20;Control._CTRL_KEY="$WJ-CTRL";Control._OWNR_KEY="$WJ-OWNR";Control._SCRL_KEY="$WJ-SCRL";Control._TTIP_KEY="$WJ-TTIP";Control._DSBL_KEY="$WJ-DSBL";Control._rxInputAtts=/name|tabindex|placeholder|autofocus|autocomplete|autocorrect|autocapitalize|spellcheck|readonly|minlength|maxlength|pattern|type|aria-.+/i;return Control}(ControlBase);exports.Control=Control;function _detectTouch(e){if("ontouchstart"in window||"onpointerdown"in window){var t=document,n=getEventOptions(!0,!0),r=_handleTouchStart,i=_handleTouchEnd,o=e?t.addEventListener.bind(t):t.removeEventListener.bind(t);if("ontouchstart"in window){o("touchstart",r,n);o("touchend",i,n);o("touchcancel",i,n)}else if("onpointerdown"in window){o("pointerdown",r,n);o("pointerup",i,n);o("pointercancel",i,n)}}}function _handleTouchStart(e){if(null==e.pointerType||"touch"==e.pointerType){if(Control._toTouch){clearTimeout(Control._toTouch);Control._toTouch=null}Control._touching=!0}}function _handleTouchEnd(e){if(null==e.pointerType||"touch"==e.pointerType){Control._toTouch=setTimeout((function(){Control._toTouch=null;Control._touching=!1}),900);if(document.querySelector("ion-app")){var t=e.target;if(closest(t,".wj-dropdown-panel,.wj-dropdown")){t.focus();e.stopPropagation();e.stopImmediatePropagation()}}}}var PrintDocument=function(){function PrintDocument(e){this._title=null;this._copyCss=!0;null!=e&&copy(this,e)}Object.defineProperty(PrintDocument.prototype,"title",{get:function(){return this._title},set:function(e){this._title=asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(PrintDocument.prototype,"copyCss",{get:function(){return this._copyCss},set:function(e){this._copyCss=asBoolean(e)},enumerable:!0,configurable:!0});PrintDocument.prototype.addCSS=function(e){this._css||(this._css=[]);this._css.push(e)};PrintDocument.prototype.append=function(e){var t=this._getDocument();if(isString(e))t.write(e);else if(e instanceof Element){e instanceof HTMLElement&&Control.refreshAll(e);for(var n=e.cloneNode(!0),r=n.querySelectorAll("input"),i=0;i<r.length;i++){var o=r[i];switch(o.type){case"checkbox":setAttribute(o,"checked",!!o.checked||null);setAttribute(o,"indeterminate",!!o.indeterminate||null);break;case"radio":setAttribute(o,"checked",!!o.checked||null);break;default:setAttribute(o,"value",o.value||null)}}t.write(n.outerHTML)}else assert(!1,"content should be an HTML string or an Element.")};PrintDocument.prototype.print=function(e){var t=this;if(this._iframe){this._close();setTimeout((function(){var n=t._iframe.contentWindow,r="onafterprint"in n&&!isFirefox();r&&(n.onafterprint=function(){t._afterPrint(e)});if(!(isIE()&&null==n.document.body)&&document.queryCommandSupported("print"))n.document.execCommand("print",!0,null);else{n.focus();n.print()}r||t._afterPrint(e)}),100)}};PrintDocument.prototype._afterPrint=function(e){document.body.removeChild(this._iframe);this._iframe=null;isFunction(e)&&e()};PrintDocument.prototype._getDocument=function(){if(!this._iframe){var e=this._iframe=document.createElement("iframe");addClass(e,exports.PrintDocumentClsNames.printDocument);setCss(e,{position:"fixed",left:32e3,top:32e3});document.body.appendChild(e)}return this._iframe.contentDocument};PrintDocument.prototype._close=function(){var e=this,t=this._getDocument();t.close();t.title=null!=this.title?this.title:document.title;t.title&&t.title.trim()||(t.title=" ");this._copyCss&&[document.head,document.body].forEach((function(t){for(var n=t.querySelectorAll("LINK"),r=0;r<n.length;r++){var i=n[r];if(i.rel.match(/stylesheet/i)&&(!i.type||i.type.match(/text\/css/i))){var o=httpRequest(i.href,{async:!1});e._addStyle(o.responseText)}}var s=t.querySelectorAll("STYLE");for(r=0;r<s.length;r++)e._addStyle(s[r].textContent)}));if(this._css)for(var n=0;n<this._css.length;n++){var r=t.createElement("style"),i=httpRequest(this._css[n],{async:!1});r.textContent=i.responseText;t.head.appendChild(r)}};PrintDocument.prototype._addStyle=function(e){var t=this._getDocument(),n=t.createElement("style");n.textContent=e;t.head.appendChild(n)};return PrintDocument}();exports.PrintDocument=PrintDocument;var Clipboard=function(){function Clipboard(){}Clipboard.copy=function(e){Clipboard._copyPaste(asString(e),null)};Clipboard.paste=function(e){e=asFunction(e);Clipboard._copyPaste(null,e)};Clipboard._copyPaste=function(e,t){for(var n=getActiveElement(),r=closest(n,"."+exports.ControlClsNames.hostElement);r&&Control.getControl(r);)r=r.parentElement;if(r=r||document.body){var i=!1,o=createElement('<textarea class="'+exports.ClipboardClsNames.clipboard+'">',r,{position:"fixed",opacity:"0"});o.onkeydown=function(e){return e.preventDefault()};o.onchange=function(e){return e.stopImmediatePropagation()};if(isString(e)){o.value=e;o.select();document.execCommand("copy")&&(i=!0)}else{o.select();if(isFunction(t)&&document.execCommand("paste")){t(o.value);i=!0}}setTimeout((function(){n.focus({preventScroll:!0});(isIE()?setTimeout:function(e,t){return e()})((function(){return removeChild(o)}),500);!i&&isFunction(t)&&t(o.value)}),Control._CLIPBOARD_DELAY)}};return Clipboard}();exports.Clipboard=Clipboard;var PopupPosition,TooltipTrigger,_ClickRepeater=function(){function _ClickRepeater(e){this._isDown=!1;this._mousedownBnd=this._mousedown.bind(this);this._mouseupBnd=this._mouseup.bind(this);this._clickBnd=this._click.bind(this);this.element=e;this._connect(!0)}Object.defineProperty(_ClickRepeater.prototype,"element",{get:function(){return this._e},set:function(e){this._connect(!1);this._e=asType(e,HTMLElement,!0);this._connect(!0)},enumerable:!0,configurable:!0});Object.defineProperty(_ClickRepeater.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=asBoolean(e)},enumerable:!0,configurable:!0});_ClickRepeater.prototype._connect=function(e){var t=this;this._e&&_ClickRepeater._startEvents.forEach((function(n){e?t._e.addEventListener(n,t._mousedownBnd,{passive:!0}):t._e.removeEventListener(n,t._mousedownBnd)}))};_ClickRepeater.prototype._clearTimeouts=function(){if(this._toRepeat){clearTimeout(this._toRepeat);this._toRepeat=null}if(this._toDelay){clearTimeout(this._toDelay);this._toDelay=null}};_ClickRepeater.prototype._mousedown=function(e){var t=this;this._isDown&&this._mouseup(null);if(!this._disabled){this._isDown=!0;_ClickRepeater._stopEvents.forEach((function(e){document.addEventListener(e,t._mouseupBnd)}));this._clearTimeouts();this._toDelay=setTimeout((function(){if(t._isDown){t._click();t._toRepeat=setTimeout(t._clickBnd,Control._CLICK_REPEAT)}}),Control._CLICK_DELAY)}};_ClickRepeater.prototype._mouseup=function(e){var t=this;this._isDown&&e&&"keydown"!=e.type&&this._clicked&&e.preventDefault();_ClickRepeater._stopEvents.forEach((function(e){document.removeEventListener(e,t._mouseupBnd)}));this._clearTimeouts();this._isDown=!1;this._clicked=!1};_ClickRepeater.prototype._click=function(){this._clicked=!0;this._clearTimeouts();if(this._e){this._e.click();this._isDown&&(this._toRepeat=setTimeout(this._clickBnd,Control._CLICK_REPEAT))}};_ClickRepeater._startEvents=["mousedown","touchstart"];_ClickRepeater._stopEvents=["mouseup","mouseout","keydown","touchend","touchcancel"];return _ClickRepeater}();exports._ClickRepeater=_ClickRepeater;!function(e){e[e.Above=0]="Above";e[e.AboveRight=1]="AboveRight";e[e.RightTop=2]="RightTop";e[e.Right=3]="Right";e[e.RightBottom=4]="RightBottom";e[e.BelowRight=5]="BelowRight";e[e.Below=6]="Below";e[e.BelowLeft=7]="BelowLeft";e[e.LeftBottom=8]="LeftBottom";e[e.Left=9]="Left";e[e.LeftTop=10]="LeftTop";e[e.AboveLeft=11]="AboveLeft"}(PopupPosition=exports.PopupPosition||(exports.PopupPosition={}));function showPopup(e,t,n,r,i,o){void 0===i&&(i=!0);var s=e.offsetHeight||e.offsetWidth,a=n;(isBoolean(n)||null==n)&&(a=n?PopupPosition.AboveLeft:PopupPosition.BelowLeft);var l=_getPopupParent(t);_addPopupToDOM(e,l);_copyPopupStyles(e,t,i);Control.refreshAll(e);_updatePopupPosition(e,t,a);isFirefox()&&requestAnimationFrame((function(){_updatePopupPosition(e,t,a)}));t instanceof HTMLElement&&(e[Control._OWNR_KEY]=t);if(!s){_hidePopupOnscroll(e,t,o);if(r)return animate((function(t){return e.style.opacity=t<1?t.toString():""}));e.style.opacity=""}return null}exports.showPopup=showPopup;function hidePopup(e,t,n){void 0===t&&(t=!0);void 0===n&&(n=!1);var r=null;n?r=animate((function(n){e.style.opacity=(1-n).toString();if(1==n){_hidePopup(e,t);e.style.opacity=""}})):_hidePopup(e,t);return r}exports.hidePopup=hidePopup;function _updatePopupPosition(e,t,n){var r=_getReferenceRect(e,t),i=_getPopupOffset(e),o=_getPopupPosition(e,r,n,i),s={position:"absolute",zIndex:Control._POPUP_ZINDEX},a=0==i.x;if(a){s.left=o.x;s.top=o.y}else s.transform="translate("+o.x+"px, "+o.y+"px)";var l=e.getBoundingClientRect().width;setCss(e,s);if(a){var u=l-e.getBoundingClientRect().width;u>0&&(e.style.left=o.x-Math.ceil(u)+"px")}}exports._updatePopupPosition=_updatePopupPosition;function _hidePopup(e,t){e.style.display="none";t&&e.parentElement&&setTimeout((function(){if("none"==e.style.display){removeChild(e);isFunction(t)&&t()}}),Control._FOCUS_INTERVAL+50);var n=e[Control._SCRL_KEY];n instanceof Control&&n.dispose();delete e[Control._SCRL_KEY];delete e[Control._OWNR_KEY]}function _isjQueryDialog(e){var t=window.jQuery,n=isFunction(t)?t(e):null;return n&&isFunction(n.dialog)&&hasClass(e,"ui-dialog")}function _getPopupParent(e){var t=document.body;if(e instanceof HTMLElement){if(!contains(document.body,e))return t;for(var n=e;n;n=n.parentElement){if("DIALOG"==n.tagName||"ION-CONTENT"==n.tagName||"fixed"==getComputedStyle(n).position){t=n;break}if(_isjQueryDialog(n)){t=n.querySelector(".ui-dialog-content")||n;break}}}return t}function _addPopupToDOM(e,t){if(!e.offsetHeight||!e.offsetWidth||e.parentElement!=t){setCss(e,{opacity:"0",position:"fixed",left:0,top:0,transform:"",display:""});t.appendChild(e)}}function _getPopupOffset(e){var t=document.body,n=document.documentElement,r=e.parentElement,i=new Point(t.scrollLeft||pageXOffset,t.scrollTop||pageYOffset);if(r!=t){var o=r==t?n:e.offsetParent||r;o==t&&(o=r);if(o){var s=o.getBoundingClientRect();i=new Point(o.scrollLeft-s.left,o.scrollTop-s.top)}}if(r instanceof HTMLElement){var a=getComputedStyle(r);i.x-=parseFloat(a.borderLeftWidth);i.y-=parseFloat(a.borderTopWidth)}return i}function _copyPopupStyles(e,t,n){if(t instanceof HTMLElement&&n){var r=n instanceof HTMLElement?n:t,i=getComputedStyle(r);1==new Color(i.backgroundColor).a&&setCss(e,{color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle})}}function _hidePopupOnscroll(e,t,n){var r=t instanceof MouseEvent?t.target:t;if(r instanceof HTMLElement&&r.parentElement!=document.body){var i=Date.now(),o=r.getBoundingClientRect(),s=new Control(document.createElement("div"));e[Control._SCRL_KEY]=s;s.addEventListener(document,"scroll",(function(a){if(a.target!=e.parentElement&&Date.now()-i>100&&contains(document,r)&&!contains(e,a.target)&&(a.target!=document||null!=t&&"fixed"==e.style.position)){var l=r.getBoundingClientRect(),u=Math.abs(l.left-o.left),c=Math.abs(l.top-o.top);if(u>1||c>1){isFunction(n)&&n();_hidePopup(e,!0);s.dispose()}}}),!0)}}function _getPopupPosition(e,t,n,r){var i=document.documentElement,o=i.clientWidth,s=i.clientHeight,a=PopupPosition;switch(n){case a.AboveLeft:case a.AboveRight:case a.BelowLeft:case a.BelowRight:if(t){var l=t.width;if(l){isIE()&&(l-=e.offsetWidth-e.clientWidth);e.style.minWidth=l+"px"}}}var u=getComputedStyle(e),c=parseFloat(u.marginTop)+parseFloat(u.marginBottom),p=parseFloat(u.marginLeft)+parseFloat(u.marginRight),h=new Size(e.offsetWidth+p,e.offsetHeight+c),f=new Point((o-h.width)/2,Math.round((s-h.height)/2*.7));if(t){"rtl"==u.direction&&(n=_getRtlPosition(n));var d=t.left,g=o-t.right;f.x=t.left;switch(n){case a.Above:case a.Below:f.x=t.left+(t.width-h.width)/2;break;case a.AboveLeft:case a.BelowLeft:f.x=t.left;break;case a.AboveRight:case a.BelowRight:f.x=t.right-h.width;break;case a.Left:case a.LeftTop:case a.LeftBottom:f.x=d>=h.width||d>=g?t.left-h.width:t.right;break;case a.RightTop:case a.RightBottom:case a.Right:f.x=g>=h.width||g>=d?t.right:t.left-h.width}var _=t.top,m=s-t.bottom;switch(n){case a.Above:case a.AboveLeft:case a.AboveRight:f.y=_>h.height||_>m?t.top-h.height:t.bottom;break;case a.Below:case a.BelowLeft:case a.BelowRight:f.y=m>h.height||m>_?t.bottom:t.top-h.height;break;case a.LeftTop:case a.RightTop:f.y=t.top;break;case a.LeftBottom:case a.RightBottom:f.y=t.bottom-h.height;break;case a.Left:case a.Right:f.y=t.bottom-h.height+(h.height-t.height)/2}}f.x=Math.min(f.x,o-h.width);f.y=Math.min(f.y,s-h.height);f.x=Math.max(0,f.x)+r.x;f.y=Math.max(0,f.y)+r.y;return f}function _getRtlPosition(e){var t=PopupPosition;switch(e){case t.AboveLeft:return t.AboveRight;case t.AboveRight:return t.AboveLeft;case t.BelowLeft:return t.BelowRight;case t.BelowRight:return t.BelowLeft;case t.Left:return t.Right;case t.LeftTop:return t.RightTop;case t.LeftBottom:return t.RightBottom;case t.Right:return t.Left;case t.RightTop:return t.LeftTop;case t.RightBottom:return t.LeftBottom}return e}function _getReferenceRect(e,t){return t instanceof MouseEvent?t.clientX<=0&&t.clientY<=0&&t.target instanceof HTMLElement?Rect.fromBoundingRect(t.target.getBoundingClientRect()):new Rect(t.pageX-pageXOffset,t.pageY-pageYOffset,0,0):t instanceof Point?new Rect(t.x,t.y,0,0):t instanceof HTMLElement?Rect.fromBoundingRect(t.getBoundingClientRect()):t&&null!=t.top&&null!=t.left?t:null}!function(e){e[e.Focus=0]="Focus";e[e.Hover=1]="Hover";e[e.Both=2]="Both"}(TooltipTrigger=exports.TooltipTrigger||(exports.TooltipTrigger={}));var Tooltip=function(){function Tooltip(e){this._showAutoTipBnd=this._showAutoTip.bind(this);this._hideAutoTipBnd=this._hideAutoTip.bind(this);this._mousemoveBnd=this._mousemove.bind(this);this._focusBnd=this._focus.bind(this);this._mousemovedocBnd=this._mousemovedoc.bind(this);this._keydownBnd=this._keydown.bind(this);this._keydownHandleBnd=this.keydownHandle.bind(this);this._html=!0;this._cssClass="";this._gap=6;this._isAnimated=!1;this._position=PopupPosition.Above;this._trigger=TooltipTrigger.Hover;this._showAtMouse=!1;this._showDelay=500;this._hideDelay=0;this._tooltipVisibleOnHover=!0;this._tips=[];this._forceRecreate=!1;this.popup=new Event;copy(this,e)}Object.defineProperty(Tooltip.prototype,"position",{get:function(){return this._position},set:function(e){this._position=asEnum(e,PopupPosition)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"trigger",{get:function(){return this._trigger},set:function(e){var t=this;this._trigger=asEnum(e,TooltipTrigger);this._tips.forEach((function(e){t._detach(e.element);t._attach(e.element)}))},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"isAnimated",{get:function(){return this._isAnimated},set:function(e){this._isAnimated=asBoolean(e)},enumerable:!0,configurable:!0});Tooltip.prototype.setTooltip=function(e,t,n){e=getElement(e);t=this._getContent(t);var r=this._indexOf(e);if(r>-1){this._detach(e);this._tips.splice(r,1)}if(t){this._attach(e);this._tips.push({element:e,content:t,position:n})}var i=Tooltip._eTip;i&&i[Control._TTIP_KEY]==e&&(t?this._setContent(t):this._hideAutoTip())};Tooltip.prototype.getTooltip=function(e){e=getElement(e);for(var t=this._tips,n=0;n<t.length;n++)if(t[n].element==e)return t[n].content;return null};Tooltip.prototype.show=function(e,t,n,r){e=getElement(e);t=this._getContent(t);if(e){null==r&&(r=this.position);document.addEventListener("keydown",this._keydownHandleBnd);var i=Tooltip._eTip;this.forceRecreate&&i&&i.remove();if(!i||this.forceRecreate){addClass(i=Tooltip._eTip=document.createElement("div"),exports.TooltipClsNames.hostElement);setAttribute(i,"aria-live","polite");i.style.visibility="none"}if(!i.isConnected){i.id=getUniqueId(e.id+"_toolTip");addAttributeValueToElement(e,"aria-describedby",i.id)}i.setAttribute("class",exports.TooltipClsNames.hostElement);this._tooltipVisibleOnHover&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&i.addEventListener("mouseleave",this._hideAutoTipBnd);addClass(i,this.cssClass);hasClass(e,exports.ControlStateClsNames.invalid)?i.setAttribute("role","alert"):i.setAttribute("role","tooltip");this._setContent(t);i[Control._TTIP_KEY]=e;var o=new TooltipEventArgs(t,e);this.onPopup(o);if(o.content&&!o.cancel){this._setContent(o.content);n||(n=Rect.fromBoundingRect(e.getBoundingClientRect()));var s=this.gap,a=PopupPosition;if(s)switch(r){case a.Above:case a.AboveLeft:case a.AboveRight:case a.Below:case a.BelowLeft:case a.BelowRight:n=n.inflate(0,s);break;default:n=n.inflate(s,0)}showPopup(i,n,r,this.isAnimated);document.addEventListener("mousedown",this._hideAutoTipBnd)}}};Tooltip.prototype.hide=function(){var e=Tooltip._eTip;if(e){removeChild(e);removeClass(e,this.cssClass);e.innerHTML="";this._tooltipVisibleOnHover&&e.removeEventListener("mouseleave",this._hideAutoTipBnd);removeAttributeValueFromElement(e[Control._TTIP_KEY],"aria-describedby",e.id)}document.removeEventListener("mousedown",this._hideAutoTipBnd);document.removeEventListener("keydown",this._keydownHandleBnd);this._tooltipVisibleOnHover&&document.removeEventListener("mousemove",this._mousemovedocBnd)};Tooltip.prototype.dispose=function(){var e=this;this.hide();var t=this._tips;if(t.length){t.forEach((function(t){e._detach(t.element)}));t.splice(0,t.length)}if(Tooltip._eTip){Tooltip._eTip[Control._TTIP_KEY]=null;Tooltip._eTip=null}this._clearTimeouts()};Object.defineProperty(Tooltip.prototype,"isVisible",{get:function(){var e=Tooltip._eTip;return null!=e&&null!=e.parentElement&&e.offsetWidth>0},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"isContentHtml",{get:function(){return this._html},set:function(e){this._html=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"cssClass",{get:function(){return this._cssClass},set:function(e){this._cssClass=asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"gap",{get:function(){return this._gap},set:function(e){this._gap=asNumber(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"showAtMouse",{get:function(){return this._showAtMouse},set:function(e){this._showAtMouse=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"showDelay",{get:function(){return this._showDelay},set:function(e){this._showDelay=asInt(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"hideDelay",{get:function(){return this._hideDelay},set:function(e){this._hideDelay=asInt(e)},enumerable:!0,configurable:!0});Tooltip.prototype.onPopup=function(e){this.popup&&this.popup.raise(this,e);return!e.cancel};Tooltip.prototype.keydownHandle=function(e){"Escape"===e.key&&this.hide()};Tooltip.prototype._indexOf=function(e){for(var t=0;t<this._tips.length;t++)if(this._tips[t].element==e)return t;return-1};Tooltip.prototype._attach=function(e){if(this._tooltipVisibleOnHover)switch(this._trigger){case TooltipTrigger.Focus:e.addEventListener("focus",this._focusBnd);e.addEventListener("keydown",this._keydownBnd);e.addEventListener("blur",this._hideAutoTipBnd);break;case TooltipTrigger.Both:e.addEventListener("mouseenter",this._showAutoTipBnd);e.addEventListener("mouseleave",this._hideAutoTipBnd);e.addEventListener("focus",this._focusBnd);e.addEventListener("keydown",this._keydownBnd);e.addEventListener("blur",this._hideAutoTipBnd);break;default:e.addEventListener("mouseenter",this._showAutoTipBnd);e.addEventListener("mouseleave",this._hideAutoTipBnd)}else{e.addEventListener("mouseenter",this._showAutoTipBnd);e.addEventListener("mouseleave",this._hideAutoTipBnd)}e.addEventListener("click",this._showAutoTipBnd);this.showAtMouse&&e.addEventListener("mousemove",this._mousemoveBnd)};Tooltip.prototype._detach=function(e){e.removeEventListener("focus",this._focusBnd);e.removeEventListener("mouseenter",this._showAutoTipBnd);e.removeEventListener("mouseleave",this._hideAutoTipBnd);e.removeEventListener("click",this._showAutoTipBnd);e.removeEventListener("mousemove",this._mousemoveBnd);e.removeEventListener("keydown",this._keydownBnd);e.removeEventListener("blur",this._hideAutoTipBnd);e.removeEventListener("mousedown",this._hideAutoTipBnd)};Tooltip.prototype._keydown=function(e,t){if("Tab"==e.key){this._clearTimeouts();this.hide()}};Tooltip.prototype._focus=function(e){e&&e.target&&this._showAutoTip(void 0,e.target)};Tooltip.prototype._showAutoTip=function(e,t){var n=this,r=this._hideDelay;if(e&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)){if(e.defaultPrevented)return;if("click"==e.type&&!Control._touching){this._hideAutoTip(e);return}var i=e&&"mouseenter"==e.type?this._showDelay:0;this._clearTimeouts();this._eMouse=e;var o=e.target;this._toShow=setTimeout((function(){var e=n._indexOf(o);if(e>-1){var t=n._tips[e],i=n._eMouse,s=n._showAtMouse?new Rect(i.clientX,i.clientY,0,0):null,a=t&&t.element;if(a&&n._hasOffset(a)){var l=Control.getControl(t.element);if(null==l||0!=l.isVisible){n.show(t.element,t.content,s,t.position);r>0&&(n._toHide=setTimeout((function(){n.hide()}),r))}}}}),i)}if(t&&[TooltipTrigger.Focus,TooltipTrigger.Both].includes(this.trigger)){i=this._showDelay;this._toShow=setTimeout((function(){var e=n._indexOf(t);if(e>-1){var i=n._tips[e],o=i&&i.element;if(o&&n._hasOffset(o)){var s=Control.getControl(i.element);if(null==s||0!=s.isVisible){n.show(i.element,i.content,null,i.position);r>0&&(n._toHide=setTimeout((function(){n.hide()}),r))}}}}),i)}};Tooltip.prototype._mousemove=function(e){this._eMouse=e};Tooltip.prototype._mousemovedoc=function(e){[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&this._checkBoundsAndHide(e,!1)};Tooltip.prototype._hideAutoTip=function(e){if(e){if(Tooltip._eTip)if(this._tooltipVisibleOnHover){"mouseleave"==e.type&&document.addEventListener("mousemove",this._mousemovedocBnd);this._checkBoundsAndHide(e,!0)}else if((this.trigger==TooltipTrigger.Hover||this.trigger==TooltipTrigger.Both)&&e&&"click"!=e.type&&"mousedown"!=e.type){this._clearTimeouts();this.hide()}}};Tooltip.prototype._checkBoundsAndHide=function(e,t){var n=Tooltip._eTip;if(n){var r=n[Control._TTIP_KEY],i=Rect.fromBoundingRect(n.getBoundingClientRect()),o=Rect.fromBoundingRect(r.getBoundingClientRect()),s=this.gap+2,a=PopupPosition,l=0;if(e){var u=this._indexOf(r);u>-1&&(l=this._tips[u]&&this._tips[u].position?this._tips[u].position:this.position);switch(l){case a.Above:case a.AboveLeft:case a.AboveRight:o=o.inflate(0,s,0,0);break;case a.Below:case a.BelowLeft:case a.BelowRight:o=o.inflate(0,0,0,s);break;case a.Left:case a.LeftTop:case a.LeftBottom:o=o.inflate(s,0,0,0);break;case a.Right:case a.RightTop:case a.RightBottom:o=o.inflate(0,0,s,0)}var c=e,p=!0;n.getClientRects().length>0&&null!=c&&(p=!(c.clientX>=i.left&&c.clientX<=i.right&&c.clientY>=i.top&&c.clientY<=i.bottom));var h=!0;null!=c&&(h=!(c.clientX>=o.left&&c.clientX<=o.right&&c.clientY>=o.top&&c.clientY<=o.bottom));if(p&&h||"blur"==e.type){t&&this._clearTimeouts();this.hide()}}}};Tooltip.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHide){clearTimeout(this._toHide);this._toHide=null}if(this._forScreenReader){clearTimeout(this._forScreenReader);this._forScreenReader=null}};Tooltip.prototype._getContent=function(e){if((e=asString(e))&&"#"==e[0]){var t=getElement(e);t&&(e=t.innerHTML)}return e};Tooltip.prototype._setContent=function(e){var t=Tooltip._eTip;t&&(this._html?t.innerHTML=e:t.textContent=e)};Tooltip.prototype._hasOffset=function(e){var t=new Size(e.offsetWidth,e.offsetHeight);if(e instanceof SVGGraphicsElement){var n=e.getBBox();t.width=n.width;t.height=n.height}return t.width>0||t.height>0};Object.defineProperty(Tooltip.prototype,"forceRecreate",{get:function(){return this._forceRecreate},set:function(e){this._forceRecreate=e},enumerable:!0,configurable:!0});return Tooltip}();exports.Tooltip=Tooltip;var TooltipEventArgs=function(e){__extends(TooltipEventArgs,e);function TooltipEventArgs(t,n){var r=e.call(this)||this;r._content=asString(t);r._e=n;return r}Object.defineProperty(TooltipEventArgs.prototype,"tip",{get:function(){return Tooltip._eTip},enumerable:!0,configurable:!0});Object.defineProperty(TooltipEventArgs.prototype,"element",{get:function(){return this._e},enumerable:!0,configurable:!0});Object.defineProperty(TooltipEventArgs.prototype,"content",{get:function(){return this._content},set:function(e){this._content=asString(e)},enumerable:!0,configurable:!0});return TooltipEventArgs}(CancelEventArgs);exports.TooltipEventArgs=TooltipEventArgs;_registerModule("wijmo",selfModule);var theLic="The Wijmo license in this application ",_licStr={evl:"Wijmo Evaluation Version ({version})",prd:theLic+"is not valid for the <b>{control}</b> control.",ver:theLic+"is not valid for the version in use. The license version is <b>{licVer}</b>; the product version is <b>{version}</b>.",dmn:theLic+"is not valid for the current domain. The license domain is <b>{licDomain}</b>; the current domain is <b>{domain}</b>.",exp:theLic+"has expired. The license expiration date is <b>{expDate:d}</b>.",lic:theLic+"is invalid.",mss:theLic+"is not set.",ctc:'If you are a customer, you can <a target="_blank" rel="noopener" href="https://developer.mescius.com/licensing/wijmo?utm_source=Wijmo-In-App&utm_medium=Click-to-Site&utm_campaign=Wijmo-User-Analysis">create a license</a> online. Otherwise, you can <a target="_blank" rel="noopener" href="https://developer.mescius.com/wijmo/request-trial-key?utm_source=Wijmo-In-App&utm_medium=Click-to-Site&utm_campaign=Wijmo-User-Analysis">generate a 30-day license</a> for free. For further assistance, contact MESCIUS: <a href="mailto:us.sales@mescius.com">us.sales@mescius.com</a>.',hdr:"Wijmo License",cls:"CLOSE"},_codes={};function _updateWme(e,t){var n=Control._wme;if(!(n&&contains(document.body,n)&&n.offsetWidth&&n.offsetHeight))if(t){var r=_getControlCode(e);if(!_codes[r]){_codes[r]=!0;_attorn(t,{algorithmCode:"B0",publicKey:"l6/zrbWoSbcLFwEetFh38rH3ErBZE9H+Cqix3R+wTlfA1wD5B+lUcCQn+EJ60I4RGrm0x1sFjkiLWwB0jAn6BWZv0W4WbqAKriOdeoivxDp1Wmjs3qkEDhvbsjPtfvwx2BHil6o+/tDrdMJQSGs18WZm2PoQLQuL+9VhZ4FNRHUQU3Jtioke/OZEGHJOdYVwvCGalzBad6QFOiVbDBQPePpS3++GJzOxN8SN/7lyS5/IdKiy3WJRaVGkB370+HbN6hKraDfUgReLX26yxRaKC/5aWnGAJ2NnWLoGyAGRcwT9dVjo4bcAZNrrA0U9JVKQxaSskhdv2p49XzJkltXx5w=="},(function(n){_checkLicense(e,t,n);delete _codes[r]}),(function(){_checkLicense(e,t,null);delete _codes[r]}))}}else _checkLicense(e,null,null)}exports._updateWme=_updateWme;function _getControlCode(e){return e._getProductInfo().split(",")[0]}function _getControlName(e){return e._getProductInfo().split(",")[1]}function _checkLicense(e,t,n){var r=exports.culture.Licensing||_licStr,i=null;n?_checkExpiration(e,n)?_checkVersion(e,n)?_checkDomain(e,n)?_checkProductCode(e,n)?_checkEval(e,n)&&(i=r.evl):i=r.prd:i=r.dmn:i=r.ver:i=r.exp:i=t?r.lic:r.mss;i&&_addWme(e,i+="<br/><br/>"+r.ctc,n)}function _checkProductCode(e,t){var n=_getControlCode(e);if(n&&n.length>=4)for(var r=0;r<t.Prd.length;r++)if(t.Prd[r].C.indexOf(n)>-1)return!0;return!1}function _checkExpiration(e,t){if(t.Exp){var n=t.Exp,r=new Date(parseInt(n.substr(0,4))||0,parseInt(n.substr(4,2))-1||0,parseInt(n.substr(6,2))||0);if(Math.ceil((r.valueOf()-Date.now())/864e5)<=0)return!1}return!0}function _checkVersion(e,t){var n=t.Anl?t.Anl.ver:null,r=getVersion();if(n&&r){return parseInt(n.replace("v",""))+10>=parseInt(r.split(".")[1])}return!0}function _checkDomain(e,t){if(_isLocalHost()||!t.Dms)return!0;for(var n=location.hostname,r=t.Dms.split(","),i=0;i<r.length;i++)if(_checkHost(n,r[i]))return!0;return!1}function _checkHost(e,t){var n="^"+t.replace(/\./g,"\\.").replace(/\*/g,"(.*)")+"$",r=new RegExp(n,"i").test(e);return r||"*."!=t.substr(0,2)?r:_checkHost(e,t.substr(2))}function _checkEval(e,t){return!!t&&t.Evl}function _isLocalHost(){var e=location,t=atob("Xih8bG9jYWxob3N0fGZpZGRsZS5qc2hlbGwubmV0fHJ1bi5wbG5rci5jb3xzLmNvZGVwZW4uaW98bnVsbC5qc2Jpbi5jb218Lio/LnN0YWNrYmxpdHouaW98MTI3LjAuMC4xfFt3LV0rLmxvY2FsfFt3LV0rfDo6MSkk");return"file:"==e.protocol||new RegExp(t,"i").test(e.hostname)}function _addWme(e,t,n){t=_getMessage(e,t,n);if(!_codes[" "]&&!_isLocalHost()&&!_checkEval(e,n)){_codes[" "]=!0;var r=exports.culture.Licensing||_licStr,i=createElement('<div style="position:fixed;background:rgba(0,0,0,0.3);left:0;top:0;width:100%;height:100%;font-family: sans-serif;z-index:10000;"><div style="position:relative;overflow:auto;background:white;width:450px;padding:36pt;left:50%;top:50%;transform:translate(-50%,-50%)"><div><p style="font-size:150%;font-weight:bold">'+r.hdr+"</p><p>"+t+'</p></div><div style="text-align:right;margin-top:24pt"><button style="border:none;background:rgba(158,158,158,.2);padding:8px 16px">'+r.cls+"</button></div></div></div>",document.body);i.addEventListener("click",(function(e){e.target instanceof HTMLButtonElement&&removeChild(i)}))}if(!Control._wme){var o=createElement('<div><a href="'+_getWmeHref()+'" target="_blank" rel="noopener">'+_getMessage(e)+"</a></div>"),s={position:"fixed",display:"block",visibility:"visible",background:"rgba(240,240,240,.9)",padding:"8px 12px",margin:"6px",fontFamily:"sans-serif",fontSize:"14pt",fontWeight:"bold",zIndex:1e4,opacity:.8,height:"auto",width:"auto",transform:"none"};switch(Math.round(100*Math.random())%3){case 0:s.right=s.bottom=0;break;case 1:s.left=s.bottom=0;break;case 2:s.right=s.top=0}setCss(o,s);document.body.appendChild(o);Control._wme=o;_addClickableTooltip(o,t)}}function _addClickableTooltip(e,t){var n,r=createElement(t);r.className=exports.TooltipClsNames.hostElement;setCss(r,{pointerEvents:"auto",padding:"10px",margin:"6px"});[e,r].forEach((function(e){e.addEventListener("mouseenter",(function(){return trackMouse(!0)}));e.addEventListener("mouseleave",(function(){return trackMouse(!1)}))}));var i=0;function trackMouse(t){i+=t?1:-1;n&&clearTimeout(n);n=setTimeout((function(){n=null;1==i?showPopup(r,e.getBoundingClientRect()):i<1&&hidePopup(r)}),500)}}function _getWmeHref(){switch(exports.culture.Globalize.name){case"ja":return"https://developer.mescius.jp/wijmo/about-license";case"ko":return"https://www.mescius.co.kr/wijmo#price";default:return"https://developer.mescius.com/licensing/wijmo?utm_source=Wijmo-In-App&utm_medium=Click-to-Site&utm_campaign=Wijmo-User-Analysis"}}function _getMessage(e,t,n){if(!t||t.trim().length<15){t=(exports.culture.Licensing||_licStr).evl}(!t||t.trim().length<15)&&(t=atob("V2lqbW8gRXZhbHVhdGlvbiBWZXJzaW9uICh7dmVyc2lvbn0p"));var r=null;if(n&&n.Exp){var i=n.Exp;r=new Date(parseInt(i.substr(0,4))||0,parseInt(i.substr(4,2))-1||0,parseInt(i.substr(6,2))||0)}return t=format(t,{version:getVersion(),domain:location.hostname,control:_getControlName(e),licVer:n&&n.Anl?"5."+n.Anl.ver.replace("v","")+".*":null,licDomain:n?n.Dms:null,expDate:r})}function _attorn(e,t,n,r){var i=parseKeyData(e,t.algorithmCode);if(!i)return r();var o=i.lic,s=i.prefix+"#"+t.algorithmCode;if(tripleHash(s+JSON.stringify(o.D))!=o.H)return r();var a=window.msCrypto||window.crypto,l=a?a.subtle:null;if(!l||!location.protocol.match(/^https/i))return n(o.D);var u={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},c={alg:"RS256",e:"AQAB",kty:"RSA",n:str64ToJwkBase64(t.publicKey)};c=window.msCrypto?str2ArrayBuffer(JSON.stringify(c)):c;try{asPromise(l.importKey("jwk",c,u,!1,["verify"])).then((function(e){var t=arrayBuffer2Str(str64ToArrayBuffer(str64EncodeUnicode(s+JSON.stringify(o.D))));asPromise(l.verify(u,e,str64ToArrayBuffer(o.S),str2ArrayBuffer(t))).then((function(e){return e?n(o.D):r()}))}),(function(){return n(o.D)}))}catch(e){return n(o.D)}}var templateObject_1,uint8Array="undefined"==typeof window?null:window.Uint8Array||window.TypedArray;function parseKeyData(e,t){try{t="#"+t;var n=e.indexOf(t);if(n>-1)return{prefix:e.substring(0,n),lic:JSON.parse(decode(e.substr(n+t.length)))}}catch(e){}return null}function decode(e){if(!e)return"";var t=unshiftString(e);t=reverseString(t);var n=Math.ceil(t.length/2);return str64DecodeUnicode(t=(t=(t=t.substr(n)+t.substr(0,n)).replace("#","=")).replace("&","=="))}function unshiftString(e){for(var t=e.split(""),n=t.length-5;n>=0;n--){swapArrayElements(t,n+1,n+3,unshiftChar);swapArrayElements(t,n,n+2,unshiftChar)}return t.join("")}function swapArrayElements(e,t,n,r){e.length>1&&e.splice(n,1,r(e.splice(t,1,r(e[n]))[0]))}function shiftChar(e,t){var n=e.charCodeAt(0);return n>=65&&n<=90?e.toLowerCase():n>=97&&n<=122?e.toUpperCase():n>=48&&n<=57?String.fromCharCode(48+(n-48+10+t)%10):e}function unshiftChar(e){return shiftChar(e,-1)}function reverseString(e){return e.split("").reverse().join("")}function str64DecodeUnicode(e){for(var t=atob(e),n="",r=0;r<t.length;r++)n+="%"+("00"+t.charCodeAt(r).toString(16)).slice(-2);return decodeURIComponent(n)}function arrayBuffer2Str(e){return String.fromCharCode.apply(null,new uint8Array(e))}function str64ToArrayBuffer(e){for(var t=atob(e),n=t.length,r=new uint8Array(n),i=0;i<n;i++)r[i]=t.charCodeAt(i);return r.buffer}function str64EncodeUnicode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})))}function str64ToJwkBase64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")}function str2ArrayBuffer(e){for(var t=new ArrayBuffer(e.length),n=new uint8Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}function tripleHash(e){for(var t=0,n=5381,r=0,i=e.length-1;i>=0;i--){var o=e.charCodeAt(i);t=o+(t<<6)+(t<<16)-t;n=o+((n<<5)+n);r=o+((r<<5)-r)}var s=t^n^r;s<0&&(s=~s);return s.toString(16).toUpperCase()}function asPromise(e){if("oncomplete"in e){e.then=function(t,n){e.resolve=t;e.reject=n};e.oncomplete=function(t){e.resolve(e.result)};e.onerror=function(t){e.reject()}}return e}
14
+ "use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t;return e},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var selfModule=__importStar(require("@mescius/wijmo")),Binding=function(){function Binding(e){this.path=e}Object.defineProperty(Binding.prototype,"path",{get:function(){return this._path},set:function(e){this._path=e;this._parts=e?e.split("."):[];for(var t=0;t<this._parts.length;t++){var n=this._parts[t],r=n.indexOf("[");if(r>-1){this._parts[t]=n.substr(0,r);this._parts.splice(++t,0,parseInt(n.substr(r+1)))}}this._key=1==this._parts.length?this._parts[0]:null},enumerable:!0,configurable:!0});Binding.prototype.getValue=function(e){if(e){if(this._key)return e[this._key];if(this._path&&this._path in e)return e[this._path];for(var t=0;t<this._parts.length&&e;t++)e=e[this._parts[t]]}return e};Binding.prototype.setValue=function(e,t){if(e)try{var n=this._path;if(n in e){e[n]=t;return e[n]==t}for(var r=0;r<this._parts.length-1;r++)if(null==(e=e[this._parts[r]]))return!1;e[n=this._parts[this._parts.length-1]]=t;return e[n]==t}catch(e){return!1}return!1};return Binding}();exports.Binding=Binding;var EventHandler=function EventHandler(e,t){this.handler=e;this.self=t},Event=function(){function Event(e){this._handlers=[];this._handlersChanged=e}Event.prototype.addHandler=function(e,t){e=asFunction(e);this._handlers.push(new EventHandler(e,t));isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.getHandler=function(e){void 0===e&&(e=0);var t=this._handlers[e];if(t)return t.handler};Event.prototype.removeHandler=function(e,t){var n=!1;e=asFunction(e);for(var r=0;r<this._handlers.length;r++){var i=this._handlers[r];if(!(i.handler!=e&&null!=e||i.self!=t&&null!=t)){this._handlers.splice(r--,1);n=!0;if(e&&t)break}}n&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.removeAllHandlers=function(){var e=this._handlers.length>0;this._handlers.length=0;e&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.raise=function(e,t){void 0===t&&(t=EventArgs.empty);for(var n=this._handlers,r=0;r<n.length;r++){var i=n[r];i.handler.call(i.self,e,t);n[r]!==i&&r--}};Object.defineProperty(Event.prototype,"hasHandlers",{get:function(){return this._handlers.length>0},enumerable:!0,configurable:!0});Object.defineProperty(Event.prototype,"handlerCount",{get:function(){return this._handlers.length},enumerable:!0,configurable:!0});return Event}();exports.Event=Event;var EventArgs=function(){function EventArgs(){}EventArgs.empty=new EventArgs;return EventArgs}();exports.EventArgs=EventArgs;var CancelEventArgs=function(e){__extends(CancelEventArgs,e);function CancelEventArgs(){var t=null!==e&&e.apply(this,arguments)||this;t.cancel=!1;return t}return CancelEventArgs}(EventArgs);exports.CancelEventArgs=CancelEventArgs;var PropertyChangedEventArgs=function(e){__extends(PropertyChangedEventArgs,e);function PropertyChangedEventArgs(t,n,r){var i=e.call(this)||this;i._name=t;i._oldVal=n;i._newVal=r;return i}Object.defineProperty(PropertyChangedEventArgs.prototype,"propertyName",{get:function(){return this._name},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"oldValue",{get:function(){return this._oldVal},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"newValue",{get:function(){return this._newVal},enumerable:!0,configurable:!0});return PropertyChangedEventArgs}(EventArgs);exports.PropertyChangedEventArgs=PropertyChangedEventArgs;var NotifyCollectionChangedAction,RequestErrorEventArgs=function(e){__extends(RequestErrorEventArgs,e);function RequestErrorEventArgs(t,n){var r=e.call(this)||this;r._xhr=t;r._msg=n;return r}Object.defineProperty(RequestErrorEventArgs.prototype,"request",{get:function(){return this._xhr},enumerable:!0,configurable:!0});Object.defineProperty(RequestErrorEventArgs.prototype,"message",{get:function(){return this._msg},set:function(e){this._msg=e},enumerable:!0,configurable:!0});return RequestErrorEventArgs}(CancelEventArgs);exports.RequestErrorEventArgs=RequestErrorEventArgs;!function(e){e[e.Add=0]="Add";e[e.Remove=1]="Remove";e[e.Change=2]="Change";e[e.Reset=3]="Reset"}(NotifyCollectionChangedAction=exports.NotifyCollectionChangedAction||(exports.NotifyCollectionChangedAction={}));var NotifyCollectionChangedEventArgs=function(e){__extends(NotifyCollectionChangedEventArgs,e);function NotifyCollectionChangedEventArgs(t,n,r){void 0===t&&(t=NotifyCollectionChangedAction.Reset);void 0===n&&(n=null);void 0===r&&(r=-1);var i=e.call(this)||this;i.action=t;i.item=n;i.index=r;return i}NotifyCollectionChangedEventArgs.reset=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);return NotifyCollectionChangedEventArgs}(EventArgs);exports.NotifyCollectionChangedEventArgs=NotifyCollectionChangedEventArgs;var SortDescription=function(){function SortDescription(e,t){this._bnd=new Binding(e);this._asc=t}Object.defineProperty(SortDescription.prototype,"property",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});Object.defineProperty(SortDescription.prototype,"ascending",{get:function(){return this._asc},enumerable:!0,configurable:!0});return SortDescription}();exports.SortDescription=SortDescription;var PageChangingEventArgs=function(e){__extends(PageChangingEventArgs,e);function PageChangingEventArgs(t){var n=e.call(this)||this;n.newPageIndex=t;return n}return PageChangingEventArgs}(CancelEventArgs);exports.PageChangingEventArgs=PageChangingEventArgs;var GroupDescription=function(){function GroupDescription(){}GroupDescription.prototype.groupNameFromItem=function(e,t){return""};GroupDescription.prototype.namesMatch=function(e,t){return e===t};return GroupDescription}();exports.GroupDescription=GroupDescription;var PropertyGroupDescription=function(e){__extends(PropertyGroupDescription,e);function PropertyGroupDescription(t,n){var r=e.call(this)||this;r._bnd=new Binding(t);r._converter=n;return r}Object.defineProperty(PropertyGroupDescription.prototype,"propertyName",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});PropertyGroupDescription.prototype.groupNameFromItem=function(e,t){return this._converter?this._converter(e,this.propertyName):this._bnd.getValue(e)};PropertyGroupDescription.prototype.namesMatch=function(e,t){return e===t};return PropertyGroupDescription}(GroupDescription);exports.PropertyGroupDescription=PropertyGroupDescription;exports.empty={};exports.ClipboardClsNames={clipboard:"wj-clipboard"};exports.ControlClsNames={content:"wj-content",hostElement:"wj-control",template:"wj-template"};exports.ControlStateClsNames={active:"wj-state-active",checked:"wj-state-checked",collapsed:"wj-state-collapsed",collapsing:"wj-state-collapsing",disabled:"wj-state-disabled",dragSrc:"wj-state-dragsrc",empty:"wj-state-empty",focus:"wj-state-focus",focused:"wj-state-focused",invalid:"wj-state-invalid",lastSelected:"wj-state-last-selected",loading:"wj-state-loading",match:"wj-state-match",exactMatchSpace:"wj-state-exact-match-space",measuring:"wj-state-measuring",multiSelected:"wj-state-multi-selected",pinned:"wj-state-pinned",readOnly:"wj-state-readonly",selected:"wj-state-selected",sticky:"wj-state-sticky",updating:"wj-state-updating",labeledInput:".wj-labeled-input",wjError:".wj-error",errorVisible:"wj-error-visible"};exports.GlyphClsNames={backward:"wj-glyph-backward",btnGlyph:"wj-btn-glyph",calendar:"wj-glyph-calendar",circle:"wj-glyph-circle",clock:"wj-glyph-clock",down:"wj-glyph-down",downLeft:"wj-glyph-down-left",drag:"wj-glyph-drag",file:"wj-glyph-file",filter:"wj-glyph-filter",forward:"wj-glyph-forward",glyph:"wj-glyph",left:"wj-glyph-left",minus:"wj-glyph-minus",plus:"wj-glyph-plus",right:"wj-glyph-right",stepBackward:"wj-glyph-step-backward",stepForward:"wj-glyph-step-forward",up:"wj-glyph-up"};exports.InputFormElementsClsNames={btn:"wj-btn",btnDefault:"wj-btn-default",btnGroup:"wj-btn-group",btnGroupVertical:"wj-btn-group-vertical",btnsOutside:"wj-btns-outside",formControl:"wj-form-control",svgBtn:"wj-svg-btn"};exports.PrintDocumentClsNames={printDocument:"wj-printdocument"};exports.TooltipClsNames={hostElement:"wj-tooltip"};exports.UtilitesClsNames={align:"wj-align",alignVCenter:"wj-align-vcenter",animated:"wj-animated",centerVert:"wj-center-vert",close:"wj-close",hide:"wj-hide",hideOk:"wj-hide-ok",remove:"wj-remove",right:"wj-right",rtl:"wj-rtl",separator:"wj-separator"};exports.ForeignClsNames={InputClsNames:{input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"},SelectorClsNames:{columnSelector:"wj-column-selector",columnSelectorGroup:"wj-column-selector-group"}};var _agent="undefined"!=typeof navigator?navigator.userAgent:"";function isMobile(){var e=_agent.toLowerCase(),t=["android","webos","iphone","ipad","ipod","blackberry","windows phone","mobile","mobi","tablet"].some((function(t){return e.includes(t)})),n="ontouchstart"in window||navigator.maxTouchPoints>0;return t||n}exports.isMobile=isMobile;var _isiOS=null!=_agent.match(/iPad|iPhone|iPod/i);function isiOS(){return _isiOS}exports.isiOS=isiOS;var _isFF=null!=_agent.match(/Firefox\//);function isFirefox(){return _isFF}exports.isFirefox=isFirefox;var _isSafari=null!=_agent.match(/^((?!Chrome|Android).)*safari/i);function isSafari(){return _isSafari}exports.isSafari=isSafari;var _isEdge=null!=_agent.match(/Edge\/|Edg\//);function isEdge(){return _isEdge}exports.isEdge=isEdge;var _isIE=null!=_agent.match(/MSIE |Trident\/|Edge\//);function isIE(){return _isIE}exports.isIE=isIE;var _isIE9=!1;function isIE9(){return _isIE9}exports.isIE9=isIE9;var _isIE10=!1;function isIE10(){return _isIE10}exports.isIE10=isIE10;var _isChromiumBased=null;function isChromiumBased(){if(null!=_isChromiumBased)return _isChromiumBased;_isChromiumBased=!1;var e="undefined"!=typeof navigator?navigator.userAgentData:null;if(e&&e.brands)for(var t=0,n=e.brands;t<n.length;t++){if("Chromium"==n[t].brand){_isChromiumBased=!0;break}}return _isChromiumBased}exports.isChromiumBased=isChromiumBased;var _supportsPassive=!1;"undefined"!=typeof document&&document.addEventListener("test",(function(e){}),{get passive(){_supportsPassive=!0;return!0}});function getEventOptions(e,t){return _supportsPassive?{capture:e,passive:t}:e}exports.getEventOptions=getEventOptions;var _supportsFocusOptions=!1;"undefined"!=typeof document&&document.createElement("div").focus({get preventScroll(){_supportsFocusOptions=!0;return!0}});function supportsFocusOptions(){return _supportsFocusOptions}exports.supportsFocusOptions=supportsFocusOptions;function _startDrag(e,t){e.effectAllowed=t;isFirefox()&&e.setData("text","")}exports._startDrag=_startDrag;if("undefined"!=typeof document&&document.doctype){navigator.appVersion.indexOf("MSIE 10")>-1&&(_isIE10=!0);if(navigator.appVersion.indexOf("MSIE 9")>-1){_isIE9=!0;document.addEventListener("mousemove",(function(e){if(1==e.which){var t=closest(e.target,"."+exports.ControlClsNames.hostElement);if(t&&!t.style.cursor)for(var n=e.target;n;n=n.parentElement)if(n.attributes&&n.attributes.draggable){n.dragDrop();return!1}}}))}}if("undefined"!=typeof window){var raf="requestAnimationFrame",caf="cancelAnimationFrame";if(!window[raf]){var expectedTime_1=0;window[raf]=function(e){var t=Date.now(),n=16-(t-expectedTime_1),r=n>0?n:0;expectedTime_1=t+r;return setTimeout((function(){e(expectedTime_1)}),r)};window[caf]=clearTimeout}if(!window.atob){var keys_1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",keysRe_1=new RegExp("[^"+keys_1+"]");window.atob=function(e){var t,n,r,i,o=[],s=0,a=e.length;if(keysRe_1.test(e)||/=/.test(e)&&(/=[^=]/.test(e)||/={3}/.test(e)))throw new Error("Invalid base64 data");a%4>0&&(a=(e+=Array(4-a%4+1).join("=")).length);for(;s<a;){for(n=[],i=s;s<i+4;)n.push(keys_1.indexOf(e.charAt(s++)));r=[((t=(n[0]<<18)+(n[1]<<12)+((63&n[2])<<6)+(63&n[3]))&255<<16)>>16,64===n[2]?-1:(65280&t)>>8,64===n[3]?-1:255&t];for(i=0;i<3;++i)(r[i]>=0||0===i)&&o.push(String.fromCharCode(r[i]))}return o.join("")};window.btoa=function(e){for(var t,n,r=[],i=0,o=e.length;i<o;){t=((n=[e.charCodeAt(i++),e.charCodeAt(i++),e.charCodeAt(i++)])[0]<<16)+((n[1]||0)<<8)+(n[2]||0);r.push(keys_1.charAt((t&63<<18)>>18),keys_1.charAt((258048&t)>>12),keys_1.charAt(isNaN(n[1])?64:(4032&t)>>6),keys_1.charAt(isNaN(n[2])?64:63&t))}return r.join("")}}}var _FocusService=function(){function _FocusService(){this._hasDoc="undefined"!=typeof Document;this._ae=this._nativeAe();var e=window,t=this._onBlur.bind(this),n=this._onFocus.bind(this);e.addEventListener("focusout",t,!0);e.addEventListener("focusin",n,!0);if(!isIE()){e.addEventListener("blur",t,!0);e.addEventListener("focus",n,!0)}}Object.defineProperty(_FocusService.prototype,"activeElement",{get:function(){var e=this._ae,t=this._nativeAe();e===_FocusService._noAe?e=this._ae=t:e!=t&&(this._isSpecialRoot(e)||document.body.contains(e)||(e=this._ae=t));return e!==_FocusService._noAe?e:null},enumerable:!0,configurable:!0});_FocusService.prototype._onBlur=function(e){if(e.isTrusted){var t=e.relatedTarget;this._ae=this._isSpecialRoot(t)?this._nativeAe():t}};_FocusService.prototype._onFocus=function(e){e.isTrusted&&(this._ae=this._nativeAe())};_FocusService.prototype._isSpecialRoot=function(e){return null==e||e===document.body||this._hasDoc&&e instanceof Document};_FocusService.prototype._nativeAe=function(){var e;try{e="unknown"!=typeof document.activeElement?document.activeElement:_FocusService._noAe}catch(t){e=_FocusService._noAe}return e};_FocusService.prototype.dispose=function(){if(!isIE()){window.removeEventListener("blur",this._onBlur,!0);window.removeEventListener("focus",this._onFocus,!0)}window.removeEventListener("focusout",this._onBlur,!0);window.removeEventListener("focusin",this._onFocus,!0)};_FocusService._noAe={};return _FocusService}();exports._FocusService=_FocusService;var _getProxyTarget="undefined"!=typeof window&&window.Symbol?Symbol("_getProxyTarget"):"\t_get\tProxy\tTarget\t";function _getCalculatedArray(e,t,n){var r=new WeakMap;if(!n){var i={};if(e.length){var o=e[0];for(var s in o){var a=typeof o[s];i[s]="string"==a?"":"number"==a?0:null}n=i}}return new Proxy(e,{get:function(e,i){if(i===_getProxyTarget)return e;if("string"==typeof i||"number"==typeof i){if("indexOf"==i)return function(t,n){var r=e.indexOf(t,n);r<0&&t&&(t=t[_getProxyTarget])&&(r=e.indexOf(t,n));return r};var o=parseInt(i);if(!isNaN(o)){var s=e[o];if(s&&!s[_getProxyTarget]){var a=r.get(s);if(!a){a=_createItemProxy(s,t,n);r.set(s,a)}s=a}return s}}return Reflect.get(e,i)}})}exports._getCalculatedArray=_getCalculatedArray;function _createItemProxy(e,t,n){if(!e[_getProxyTarget]){if(isIE())for(var r in t)e[r]=null;var i={get:function(e,r,i){if(r===_getProxyTarget)return e;if("constructor"===r)return function(){return Object.assign({},n||{})};var o=t[r];if(o)switch(typeof o){case"function":return o(i);case"string":return _eval(o,i)}return e[r]}};if(!isIE()){i.ownKeys=function(e){return Object.keys(e).concat(Object.keys(t))};i.getOwnPropertyDescriptor=function(e,n){return n in t?{enumerable:!0,configurable:!0,writable:!1}:Reflect.getOwnPropertyDescriptor(e,n)}}e=new Proxy(e,i)}return e}function _getTargetObject(e){return(e?e[_getProxyTarget]:null)||e}exports._getTargetObject=_getTargetObject;function _eval(e,t){var n=[t];return(new(Function.bind.apply(Function,[void 0].concat(["$"],["return "+e])))).apply(void 0,n)}var Key,DataType,_VERSION="5.20252.42";exports._CLS_STATE_DISABLED=exports.ControlStateClsNames.disabled;function getVersion(){return _VERSION}exports.getVersion=getVersion;function setLicenseKey(e){Control._licKey=e}exports.setLicenseKey=setLicenseKey;!function(e){e[e.Back=8]="Back";e[e.Tab=9]="Tab";e[e.Enter=13]="Enter";e[e.Escape=27]="Escape";e[e.Space=32]="Space";e[e.PageUp=33]="PageUp";e[e.PageDown=34]="PageDown";e[e.End=35]="End";e[e.Home=36]="Home";e[e.Left=37]="Left";e[e.Up=38]="Up";e[e.Right=39]="Right";e[e.Down=40]="Down";e[e.Delete=46]="Delete";e[e.X=88]="X";e[e.F1=112]="F1";e[e.F2=113]="F2";e[e.F3=114]="F3";e[e.F4=115]="F4";e[e.F5=116]="F5";e[e.F6=117]="F6";e[e.F7=118]="F7";e[e.F8=119]="F8";e[e.F9=120]="F9";e[e.F10=121]="F10";e[e.F11=122]="F11";e[e.F12=123]="F12";e[e.PlusKey=107]="PlusKey";e[e.EqualPlusKey=187]="EqualPlusKey";e[e.MinusKey=109]="MinusKey";e[e.HyphenMinusKey=189]="HyphenMinusKey";e[e.S=83]="S";e[e.P=80]="P";e[e.F=70]="F"}(Key=exports.Key||(exports.Key={}));!function(e){e[e.Object=0]="Object";e[e.String=1]="String";e[e.Number=2]="Number";e[e.Boolean=3]="Boolean";e[e.Date=4]="Date";e[e.Array=5]="Array"}(DataType=exports.DataType||(exports.DataType={}));function tryCast(e,t){return null==e?null:isString(t)?isFunction(e.implementsInterface)&&e.implementsInterface(t)?e:null:e instanceof t?e:null}exports.tryCast=tryCast;function isPrimitive(e){return isString(e)||isNumber(e)||isBoolean(e)||isDate(e)}exports.isPrimitive=isPrimitive;function isString(e){return"string"==typeof e}exports.isString=isString;function isNullOrWhiteSpace(e){return!e||!/\S/.test(e)}exports.isNullOrWhiteSpace=isNullOrWhiteSpace;function isNumber(e){return"number"==typeof e}exports.isNumber=isNumber;function isInt(e){return isNumber(e)&&e==Math.round(e)}exports.isInt=isInt;function isBoolean(e){return"boolean"==typeof e}exports.isBoolean=isBoolean;function isFunction(e){return"function"==typeof e}exports.isFunction=isFunction;function isUndefined(e){return void 0===e}exports.isUndefined=isUndefined;function isNullOrUndefined(e){return null==e}exports.isNullOrUndefined=isNullOrUndefined;function isDate(e){return(e instanceof Date||"[object Date]"===Object.prototype.toString.call(e))&&!isNaN(e.getTime())}exports.isDate=isDate;function isArray(e){return e instanceof Array||Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)}exports.isArray=isArray;function _isPlainArray(e){return Array.isArray(e)}exports._isPlainArray=_isPlainArray;function isObject(e){return null!=e&&"object"==typeof e&&!isDate(e)&&!isArray(e)}exports.isObject=isObject;function isEmpty(e){for(var t in e)return!1;return!0}exports.isEmpty=isEmpty;function _areObjectsEqual(e,t){var n=Object.entries(e),r=Object.entries(t);if(n.length!==r.length)return!1;for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1];if(!t.hasOwnProperty(a)||t[a]!==l)return!1}return!0}exports._areObjectsEqual=_areObjectsEqual;function getUniqueId(e){for(var t=e,n=0;null!=document.getElementById(t);n++)t=e+n;return t}exports.getUniqueId=getUniqueId;function getSafeUniqueId(e,t,n){void 0===t&&(t="wj");var r=e;(r=(r=(r=r.trim().toLowerCase()).replace(/[^a-z0-9_-]+/g,"-")).replace(/-+/g,"-").replace(/^-|-$/g,""))?/^[a-z]/.test(r)&&!n||(r=t+"-"+r):r=t+"-"+Date.now();for(var i=0;null!=document.getElementById(r);i++)r+=i;return r}exports.getSafeUniqueId=getSafeUniqueId;function uidGenerator(){for(var e="",t="0123456789abcdef".split(""),n=0;n<32;n++){var r=Math.floor(16*Math.random());switch(n){case 8:e+="-";break;case 12:r=4;e+="-";break;case 16:r=3&r|8;e+="-";break;case 20:e+="-"}e+=t[r]}return e}exports.uidGenerator=uidGenerator;function mouseToPage(e){if(e instanceof Point)return e;e&&e.touches&&e.touches.length>0&&(e=e.touches[0]);if(isNumber(e.clientX)&&isNumber(e.clientY))return new Point(e.clientX+pageXOffset,e.clientY+pageYOffset);throw"Mouse or touch event expected."}exports.mouseToPage=mouseToPage;function getType(e){return isNumber(e)?DataType.Number:isBoolean(e)?DataType.Boolean:isDate(e)?DataType.Date:isString(e)?DataType.String:isArray(e)?DataType.Array:DataType.Object}exports.getType=getType;function getTypes(e,t){void 0===t&&(t=1e3);if(!e)return[];var n=e.length;(t<=0||n<t)&&(t=n);var r=[];if(t){for(var i=Object.keys(e[0]),o={},s=i.slice(),a=0;a<t;a++){for(var l=e[a],u=s.length-1;u>=0;u--){var c=s[u],p=l[c];if(isPrimitive(p)){var h=Object.getOwnPropertyDescriptor(e[a],c);o[c]={binding:c,dataType:getType(p),isReadOnly:h&&!h.writable&&!h.set};s.splice(u,1)}}if(!s.length)break}for(a=0;a<i.length;a++){var f=o[i[a]];f&&r.push(f)}}return r}exports.getTypes=getTypes;function changeType(e,t,n,r){if(null!=e){var i=DataType;if(isString(e))switch(t){case i.Number:var o=Globalize.parseFloat(e,n);return isNaN(o)?e:o;case i.Date:var s=Globalize.parseDate(e,n,isDate(r)?r:null);s||n||!e||(s=new Date(e));return s&&isFinite(s.getTime())?s:e;case i.Boolean:switch(e.toLowerCase()){case"true":return!0;case"false":return!1}return e;case i.Array:try{var a=e.split(",").map((function(e){return(e=e.trim()).match(/^(\+|\-)?\d+\.?\d*$/)?e:'"'+e+'"'}));return JSON.parse("["+a.join(",")+"]")}catch(e){}}if(t==DataType.String)return Globalize.format(e,n)}return e}exports.changeType=changeType;function toFixed(e,t,n){if(n){var r=e.toString(),i=r.indexOf("e"),o=r.indexOf(".");if(i>-1){if("-"===r[i+1]){var s=parseFloat(r.substr(i+2)),a=r.substr(0,i);o>-1&&(a=a.substr(0,o)+a.substr(o+1));r="0."+(Array(s).join("0")+a).substr(0,t);e=parseFloat(r)}}else if(o>-1){r=r.substr(0,o+1+t);e=parseFloat(r)}}else{var l=Math.pow(10,t);e=Math.round(e*l)/l}return e}exports.toFixed=toFixed;function format(e,t,n){if((e=asString(e)).match(/\{.*"count".*:.*"when".*:.*\}/))try{var r=JSON.parse(e);if(isString(r.count)){var i=t[r.count],o=r.when;if(isNumber(i)&&isObject(o)){var s=o[i]||o.other;isString(s)&&(e=s)}}}catch(e){}return e.replace(/\{(.*?)(:(.*?))?\}/g,(function(e,r,i,o){var s=e;if(r&&"{"!=r[0]&&t){s=new Binding(r).getValue(t);o&&(s=Globalize.format(s,o));n&&(s=n(t,r,o,s))}return null==s?"":s}))}exports.format=format;function glbz(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[],r=-1;e[0].forEach((function(t,i){if(i>0&&i!=r){var o=e[i],s=t.match(/^:([a-z][0-9]*\b)/i)||t.match(/^:'(.+?)'/)||t.match(/^:"(.+?)"/);if(s){o=Globalize.format(o,s[1]);t=t.substr(s[0].length)}else if(":"==t&&i<e.length-1&&(isNumber(o)||isDate(o))){o=Globalize.format(o,e[i+1]);t="";r=i+1}n.push(o)}t&&n.push(t)}));return n.join("")}exports.glbz=glbz;function evalTemplate(e,t){if(isIE()){return(e=e.replace(/:\${([^}]*)}/g,(function(e,n){return":"+_evalExpression(n,t)}))).replace(/\${([^}]*)}(:(([A-Za-z]\d*)|"([^"]+)"|'([^']+)'))?/g,(function(e,n,r,i,o,s,a){var l=_evalExpression(n,t);return i?Globalize.format(l,o||s||a):l}))}return _evalExpression(e,t)}exports.evalTemplate=evalTemplate;function _evalExpression(e,t){(t=t||{}).glbz=glbz;var n=parseTpl(e,t);return isIE()?n:glbz(templateObject_1||(templateObject_1=__makeTemplateObject(["",""],["",""])),n)}function get(e,t,n){void 0===n&&(n="${"+e+"}");return e.split(".").reduce((function(e,t){return null!=e&&null!=e[t]?e[t]:n}),t)}function parseTpl(e,t,n){return e.replace(/\$\{.+?}/g,(function(e){return get(e.substr(2,e.length-3).trim(),t,n)}))}function clamp(e,t,n){if(null!=e){null!=n&&e>n&&(e=n);null!=t&&e<t&&(e=t)}return e}exports.clamp=clamp;function copy(e,t,n,r){void 0===n&&(n=!0);void 0===r&&(r=!1);if(t)for(var i in t)if("_"!=i[0]){assert(i in e,'Unknown property "'+i+'".');var o=t[i];if(!e._copy||!e._copy(i,o)){var s=e[i];e[i]instanceof Event?isFunction(o)&&e[i].addHandler(o):!n||!isObject(o)||"undefined"!=typeof Element&&o instanceof Element||!s||!isObject(s)||Object.getPrototypeOf(s).constructor==Object.prototype.constructor&&isWritable(e,i)||"itemsSource"==i?r&&isObject(o)&&Object.getPrototypeOf(o).isPrototypeOf(Object)&&isObject(s)&&!Object.getPrototypeOf(s).isPrototypeOf(Object)?copy(s,o):e[i]=o:copy(s,o)}}return e}exports.copy=copy;function _isPlainObject(e){return isObject(e)&&Object.getPrototypeOf(e).isPrototypeOf(Object)}exports._isPlainObject=_isPlainObject;function isWritable(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||{};return!!n.writable||isFunction(n.set)}exports.isWritable=isWritable;function deepClone(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){return e.map((function(e){return deepClone(e)}))}var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=deepClone(e[n]));return t}exports.deepClone=deepClone;function assert(e,t,n){void 0===n&&(n=!0);if(!e){t="** Assertion failed in Wijmo: "+t;var r=new Error;isString(r.stack)&&n&&(t+=" "+r.stack);throw t}}exports.assert=assert;function _deprecated(e,t){console.error('** WARNING: "'+e+'" has been deprecated; please use "'+t+'" instead.')}exports._deprecated=_deprecated;function _warning(e){console.error('** WARNING: "'+e)}exports._warning=_warning;function asString(e,t){void 0===t&&(t=!0);isUndefined(e)&&(e=null);assert(t&&null==e||isString(e),"String expected.");return e}exports.asString=asString;function asNumber(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!1);assert(t&&null==e||isNumber(e),"Number expected.");if(n&&e&&e<0)throw"Positive number expected.";return e}exports.asNumber=asNumber;function asInt(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!1);assert(t&&null==e||isInt(e),"Integer expected.");if(n&&e&&e<0)throw"Positive integer expected.";return e}exports.asInt=asInt;function asBoolean(e,t){void 0===t&&(t=!1);assert(t&&null==e||isBoolean(e),"Boolean expected.");return e}exports.asBoolean=asBoolean;function asDate(e,t){void 0===t&&(t=!1);if(isString(e)){var n=changeType(e,DataType.Date,"r");isDate(n)&&(e=n)}assert(t&&null==e||isDate(e),"Date expected.");return e}exports.asDate=asDate;function asFunction(e,t){void 0===t&&(t=!0);assert(t&&null==e||isFunction(e),"Function expected.");return e}exports.asFunction=asFunction;function asArray(e,t){void 0===t&&(t=!0);assert(t&&null==e||isArray(e),"Array expected.");return e}exports.asArray=asArray;function asType(e,t,n){void 0===n&&(n=!1);e=tryCast(e,t);assert(n||null!=e,t+" expected.");return e}exports.asType=asType;function asEnum(e,t,n){void 0===n&&(n=!1);if(null==e&&n)return null;var r=isString(e)?t[e]:e;assert(null!=r,'Invalid enum value: "'+e+'"');return isNumber(r)?r:e}exports.asEnum=asEnum;function asCollectionView(e,t){void 0===t&&(t=!0);if(null==e&&t)return null;var n=tryCast(e,"ICollectionView");if(null!=n)return n;isArray(e)||assert(!1,"Array or ICollectionView expected.");return new CollectionView(e)}exports.asCollectionView=asCollectionView;function hasItems(e){return null!=e&&null!=e.items&&e.items.length>0}exports.hasItems=hasItems;function toHeaderCase(e){return e&&e.length?e[0].toUpperCase()+e.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""}exports.toHeaderCase=toHeaderCase;function escapeHtml(e){e&&isString(e)&&(e=e.replace(/[&<>]/g,(function(e){return _ENTITYMAP[e]})));return null!=e?e.toString():""}exports.escapeHtml=escapeHtml;var _plainText,_ENTITYMAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_specialCharsRegex=/"(.*?)"|[^\w]|_/g;function getSpecialCharsRegex(){return _specialCharsRegex}exports.getSpecialCharsRegex=getSpecialCharsRegex;function escapeRegExp(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}exports.escapeRegExp=escapeRegExp;function toPlainText(e){var t=asString(e);if(isString(t)&&t.indexOf("<")>-1){_plainText||(_plainText=document.createElement("div"));_plainText.innerHTML=t;t=_plainText.textContent}return t}exports.toPlainText=toPlainText;function hasClass(e,t){if(e&&t){if(e instanceof HTMLElement&&e.classList&&!isIE9())return e.classList.contains(t);if(e.getAttribute){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");return e&&n.test(e.getAttribute("class"))}}return!1}exports.hasClass=hasClass;function addClass(e,t){void 0===t&&(t="");if(e&&t){var n=t.trim();if(e instanceof HTMLElement&&e.classList&&!isIE9()){n.indexOf(" ")<0?e.classList.add(n):n.split(" ").forEach((function(t){t.length>0&&e.classList.add(t)}));return}e.setAttribute&&n.split(" ").forEach((function(t){if(t.length>0&&!hasClass(e,t)){var n=e.getAttribute("class");e.setAttribute("class",n?n+" "+t:t)}}))}}exports.addClass=addClass;function removeClass(e,t){if(e&&t){var n=t.trim();if(e instanceof HTMLElement&&e.classList&&!isIE9()){n.indexOf(" ")<0?e.classList.remove(n):n.split(" ").forEach((function(t){t.length>0&&e.classList.remove(t)}));0===e.classList.length&&e.removeAttribute("class");return}e.setAttribute&&n.split(" ").forEach((function(t){if(hasClass(e,t)){var n=new RegExp("((\\s|^)"+t+"(\\s|$))","g"),r=e.getAttribute("class");(r=r.replace(n," ").replace(/ +/g," ").trim())?e.setAttribute("class",r):e.removeAttribute("class")}}))}}exports.removeClass=removeClass;function toggleClass(e,t,n){null==n&&(n=!hasClass(e,t));n?addClass(e,t):removeClass(e,t)}exports.toggleClass=toggleClass;function setAttribute(e,t,n,r){e&&(null!=n?r&&e.getAttribute(t)||e.setAttribute(t,n.toString()):e.removeAttribute(t))}exports.setAttribute=setAttribute;function setChecked(e,t){var n=null==t;e.checked=isIE()?t||n:t;e.indeterminate=n}exports.setChecked=setChecked;function setAriaLabel(e,t){setAttribute(e,"aria-label",t)}exports.setAriaLabel=setAriaLabel;function setSelectionRange(e,t,n,r){void 0===n&&(n=t);void 0===r&&(r=!0);assert(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected");if(contains(document.body,e)&&!e.disabled&&e.offsetHeight){try{e.setSelectionRange(t,n,"backward")}catch(e){}if(r)try{e.focus();return!0}catch(e){}}return!1}exports.setSelectionRange=setSelectionRange;function disableAutoComplete(e){var t="autocomplete",n=e.getAttribute(t);n&&"on"!=n||e.setAttribute(t,"off");"autocorrect,autocapitalize,spellcheck".split(",").forEach((function(t){e.setAttribute(t,"spellcheck"==t?"false":"off")}))}exports.disableAutoComplete=disableAutoComplete;function removeChild(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}exports.removeChild=removeChild;function getActiveElement(){var e=document.activeElement;if(e){var t=e.shadowRoot;t&&t.activeElement&&(e=t.activeElement)}return e}exports.getActiveElement=getActiveElement;function _getActiveElement(e){var t=e;if(t){var n=t.shadowRoot;n&&n.activeElement&&(t=n.activeElement)}return t}exports._getActiveElement=_getActiveElement;function moveFocus(e,t){var n=_getFocusableElements(e,t<0),r=0;if(t){var i=n.indexOf(getActiveElement());i>-1&&(r=(i+t+n.length)%n.length)}if(r<n.length){var o=n[r];o.focus();o instanceof HTMLInputElement&&o.select();return!0}return!1}exports.moveFocus=moveFocus;function _getFocusableElements(e,t){void 0===t&&(t=!1);var n=[],r=Array.prototype.slice.call(e.querySelectorAll("input,select,textarea,button,a,div,label,[tabindex]")),i={};r=r.filter((function(e){return-1!==e.tabIndex}));var isRb=function(e){return e instanceof HTMLInputElement&&"radio"===e.type};r.forEach((function(e){isRb(e)&&e.checked&&(i[e.name||""]=!0)}));(r=r.filter((function(e){return!isRb(e)||e.checked||!i[e.name||""]}))).sort((function(e,t){return e.tabIndex===t.tabIndex?0:0===e.tabIndex?1:0===t.tabIndex?-1:e.tabIndex-t.tabIndex}));for(var o=0;o<r.length;o++){var s=r[o];if(s.offsetHeight>0&&s.tabIndex>-1&&!s.disabled&&"hidden"!==window.getComputedStyle(s).visibility&&!closest(s,"[disabled],."+exports.ControlStateClsNames.disabled)){if(s instanceof HTMLAnchorElement&&!s.hasAttribute("href"))continue;if(isIE()&&!s.hasAttribute("tabindex")){if(s instanceof HTMLDivElement)continue;var a=Control.getControl(closest(s,".wj-flexgrid"));if(a&&0==a.keyActionTab)continue}if("radio"===s.type&&!s.checked&&n.length>0){var l=n[n.length-1],u=getActiveElement();if("radio"===l.type&&l.name===s.name){t&&l!=u&&(n[n.length-1]=s);continue}}(Control.getControl(s)||!_getFocusableElements(s).length||s.classList.contains("wj-detail"))&&n.push(s)}}return n}exports._getFocusableElements=_getFocusableElements;function saveFile(e,t,n){void 0===n&&(n="text/plain");var r=e instanceof Blob;r||!n.match(/\bcsv\b/i)&&!t.match(/\.csv$/i)||(e="\ufeff"+e);var i=r?e:new Blob([e],{type:n}),o=navigator;if(isFunction(o.msSaveOrOpenBlob))o.msSaveOrOpenBlob(i,t);else{var s=document.createElement("a"),click=function(e){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null);e.dispatchEvent(t)};if("download"in s){var a=window.URL||window.webkitURL,l=a.createObjectURL(i);s.href=l;s.target="_blank";s.download=t;click(s);s=null;window.setTimeout((function(){a.revokeObjectURL(l)}),3e4)}else{var u=new FileReader;u.onloadend=function(){s.href=u.result;s.download=t;click(s);s=null};u.readAsDataURL(i)}}}exports.saveFile=saveFile;function getElement(e){if(e instanceof Element||e&&e.appendChild&&e.appendChild instanceof Function)return e;if(isString(e))try{return document.querySelector(e)}catch(e){}return e&&e.jquery?e[0]:null}exports.getElement=getElement;function processStyleProperty(e){var t=(e=e.replace(";base64,","_wj_")).split(";"),n=[];t.forEach((function(e){var t=[];e.indexOf("_wj_")>-1?2==(t=(e=e.replace("_wj_",";base64,").replace("data:image","_wjimg_")).split(":")).length&&(t[1]=t[1].replace("_wjimg_","data:image")):t=e.split(":");n.push(t)}));return n}function createElement(e,t,n){e=e.replace(/\bstyle\s*=\s*"/g,'_wj-style="');var r=document.createElement("div");r.innerHTML=e;if(e.indexOf("_wj-style")>-1)for(var i=r.querySelectorAll("[_wj-style]"),_loop_1=function(e){var t=i[e],n=t.getAttribute("_wj-style"),r=[];if(n.indexOf(";base64,")>-1)r=processStyleProperty(n);else{n.split(";").forEach((function(e){r.push(e.split(":"))}))}r.forEach((function(e){2==e.length&&(t.style[e[0].trim()]=e[1].trim())}));t.removeAttribute("_wj-style")},o=0;o<i.length;o++)_loop_1(o);1==r.children.length&&(r=r.children[0]);n&&setCss(r,n);t&&(t=getElement(t)).appendChild(r);return r}exports.createElement=createElement;function setText(e,t){e.textContent=t||""}exports.setText=setText;function contains(e,t,n){for(var r=t;r&&e;){if(r===e)return!0;r=(n?r[Control._OWNR_KEY]:null)||r.parentNode||r.host}return!1}exports.contains=contains;function closest(e,t){if(e){if(isFunction(e.closest))return e.closest(t);var n=e.matches||e.webkitMatchesSelector||e.msMatchesSelector||e.mozMatchesSelector;if(n)for(;e&&1===e.nodeType;e=e.parentElement||e.parentNode)if(n.call(e,t))return e}return null}exports.closest=closest;function closestClass(e,t){return closest(e,"."+t)}exports.closestClass=closestClass;function enable(e,t){var n=!t,r="disabled";toggleClass(e,exports.ControlStateClsNames.disabled,n);setAttribute(e,r,n?r:null);for(var i=e.querySelectorAll("input,button"),o=0;o<i.length;o++)setAttribute(i[o],r,n?r:null)}exports.enable=enable;function getElementRect(e){var t=e.getBoundingClientRect();return new Rect(t.left+pageXOffset,t.top+pageYOffset,t.width,t.height)}exports.getElementRect=getElementRect;function setCss(e,t){assert(isObject(t),"css parameter should be an object");if(e instanceof Array)for(var n=0;n<e.length;n++)setCss(e[n],t);else if(e&&e.style){var r=e.style;for(var i in t){var o=t[i];"number"==typeof o&&i.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(o+="px");r[i]!==o&&(r[i]=o)}}}exports.setCss=setCss;function animate(e,t,n){null==t&&(t=Control._ANIM_DEF_DURATION);null==n&&(n=Control._ANIM_DEF_STEP);e=asFunction(e);t=asNumber(t,!1,!0);n=asNumber(n,!1,!0);var r,i=Date.now(),o=setInterval((function(){var n=Math.min(1,(Date.now()-i)/t);n=Math.sin(n*Math.PI/2);n*=n;r&&cancelAnimationFrame(r);r=requestAnimationFrame((function(){r=null;e(n)}));n>=1&&clearInterval(o)}),n);return o}exports.animate=animate;var Point=function(){function Point(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.x=asNumber(e);this.y=asNumber(t)}Point.prototype.equals=function(e,t,n){void 0===t&&(t=0);void 0===n&&(n=0);return e instanceof Point&&Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=n};Point.prototype.clone=function(){return new Point(this.x,this.y)};return Point}();exports.Point=Point;var Size=function(){function Size(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.width=asNumber(e);this.height=asNumber(t)}Size.prototype.equals=function(e){return e instanceof Size&&this.width==e.width&&this.height==e.height};Size.prototype.clone=function(){return new Size(this.width,this.height)};return Size}();exports.Size=Size;var Rect=function(){function Rect(e,t,n,r){this.left=asNumber(e);this.top=asNumber(t);this.width=asNumber(n);this.height=asNumber(r)}Object.defineProperty(Rect.prototype,"right",{get:function(){return this.left+this.width},enumerable:!0,configurable:!0});Object.defineProperty(Rect.prototype,"bottom",{get:function(){return this.top+this.height},enumerable:!0,configurable:!0});Rect.prototype.equals=function(e){return e instanceof Rect&&this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height};Rect.prototype.clone=function(){return new Rect(this.left,this.top,this.width,this.height)};Rect.fromBoundingRect=function(e){if(null!=e.left)return new Rect(e.left,e.top,e.width,e.height);if(null!=e.x)return new Rect(e.x,e.y,e.width,e.height);assert(!1,"Invalid source rectangle.")};Rect.union=function(e,t){var n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return new Rect(n,r,Math.max(e.right,t.right)-n,Math.max(e.bottom,t.bottom)-r)};Rect.intersection=function(e,t){var n=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return new Rect(n,r,Math.min(e.right,t.right)-n,Math.min(e.bottom,t.bottom)-r)};Rect.prototype.contains=function(e){if(e instanceof Point)return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom;if(e instanceof Rect){var t=e;return t.left>=this.left&&t.right<=this.right&&t.top>=this.top&&t.bottom<=this.bottom}assert(!1,"Point or Rect expected.")};Rect.prototype.inflate=function(e,t,n,r){return null!=n&&null!=r?new Rect(this.left-e,this.top-t,this.width+e+n,this.height+t+r):new Rect(this.left-e,this.top-t,this.width+2*e,this.height+2*t)};return Rect}();exports.Rect=Rect;var DateTime=function(){function DateTime(){}DateTime.addDays=function(e,t){(e=new Date(e.getTime())).setDate(e.getDate()+t);return e};DateTime.addMonths=function(e,t){var n=(e=new Date(e.getTime())).getDate();e.setMonth(e.getMonth()+t);e.getDate()!=n&&e.setDate(0);return e};DateTime.addYears=function(e,t){(e=new Date(e.getTime())).setFullYear(e.getFullYear()+t);return e};DateTime.addHours=function(e,t){(e=new Date(e.getTime())).setHours(e.getHours()+t);return e};DateTime.addMinutes=function(e,t){(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t);return e};DateTime.addSeconds=function(e,t){(e=new Date(e.getTime())).setSeconds(e.getSeconds()+t);return e};DateTime.weekFirst=function(e,t){void 0===t&&(t=Globalize.getFirstDayOfWeek());return DateTime.addDays(e,-(e.getDay()-t))};DateTime.weekLast=function(e,t){void 0===t&&(t=Globalize.getFirstDayOfWeek());e=DateTime.weekFirst(e,t);return DateTime.addDays(e,6)};DateTime.monthFirst=function(e){return DateTime.addDays(e,1-e.getDate())};DateTime.monthLast=function(e){e=DateTime.monthFirst(e);e=DateTime.addMonths(e,1);return DateTime.addDays(e,-1)};DateTime.yearFirst=function(e){return new Date(e.getFullYear(),0,1)};DateTime.yearLast=function(e){return new Date(e.getFullYear(),11,31)};DateTime.sameDate=function(e,t){return isDate(e)&&isDate(t)&&e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()};DateTime.sameTime=function(e,t){return isDate(e)&&isDate(t)&&e.getHours()==t.getHours()&&e.getMinutes()==t.getMinutes()&&e.getSeconds()==t.getSeconds()&&e.getMilliseconds()==t.getMilliseconds()};DateTime.equals=function(e,t){return null==e&&null==t||isDate(e)&&isDate(t)&&e.getTime()==t.getTime()};DateTime.fromDateTime=function(e,t){if(!e&&!t)return null;e||(e=t);t||(t=e);return DateTime.newDate(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())};DateTime.toFiscal=function(e,t){var n=exports.culture.Globalize.calendar;return isArray(n.fiscalYearOffsets)?DateTime.addMonths(e,-n.fiscalYearOffsets[t?0:1]):e};DateTime.fromFiscal=function(e,t){var n=exports.culture.Globalize.calendar;return isArray(n.fiscalYearOffsets)?DateTime.addMonths(e,+n.fiscalYearOffsets[t?0:1]):e};DateTime.newDate=function(e,t,n,r,i,o,s){if(null==e||null==t||null==n){var a=new Date;null==e&&(e=a.getFullYear());null==t&&(t=a.getMonth());null==n&&(n=a.getDate())}null==r&&(r=0);null==i&&(i=0);null==o&&(o=0);null==s&&(s=0);var l=new Date(e,t,n,r,i,o,s),u=l.getFullYear();e<100&&u>=1900&&l.setFullYear(l.getFullYear()-1900);return l};DateTime.clone=function(e){return DateTime.fromDateTime(e,e)};return DateTime}();exports.DateTime=DateTime;function httpRequest(e,t){var n=t||{},r=n.method?asString(n.method).toUpperCase():"GET",i=null==n.async||asBoolean(n.async),o=n.data;if(null!=o&&"GET"==r){var s=[];for(var a in o){var l=o[a];isDate(l)&&(l=l.toJSON());s.push(a+"="+encodeURIComponent(l))}if(s.length){var u=e.indexOf("?")<0?"?":"&";e+=u+s.join("&")}o=null}var c=new XMLHttpRequest;c.URL_DEBUG=e;var p=!1;if(null!=o&&!isString(o)){p=isObject(o);o=JSON.stringify(o)}c.onload=function(){if(4==c.readyState){c.status<300?n.success&&asFunction(n.success)(c):n.error&&asFunction(n.error)(c);n.complete&&asFunction(n.complete)(c)}};c.onerror=function(){if(!isFunction(n.error))throw"HttpRequest Error: "+c.status+" "+c.statusText;n.error(c)};c.open(r,e,i,n.user,n.password);n.user&&n.password&&c.setRequestHeader("Authorization","Basic "+btoa(n.user+":"+n.password));p&&function(){for(var e in n.requestHeaders)if("content-type"===e.toLowerCase())return!1;return!0}()&&c.setRequestHeader("Content-Type","application/json");if(n.requestHeaders)for(var h in n.requestHeaders)c.setRequestHeader(h,n.requestHeaders[h]);isNumber(n.timeout)&&(c.timeout=n.timeout);isFunction(n.beforeSend)&&n.beforeSend(c);c.send(o);return c}exports.httpRequest=httpRequest;var _modules={};function _registerModule(e,t){_modules[e]=t;if("wijmo"===e){var n="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;n&&(n.wijmo=t)}}exports._registerModule=_registerModule;function _getModule(e){return _modules[e]}exports._getModule=_getModule;function focusFirst(e,t){var n=e.querySelectorAll(t||'button, [href], input, [tabindex]:not([tabindex="-1"])'),r=Array.from(n).filter((function(e){return e.offsetWidth>0&&e.offsetHeight>0&&!e.hasAttribute("disabled")&&e.tabIndex>=0}));if(r.length>0){r[0].focus();return!0}return!1}exports.focusFirst=focusFirst;exports.cellCoordinateParserRegex=new RegExp(/(\'?\w+\'?\!)?(\$?[A-Za-z]+)(\$?\d+)/,"g");function getScrollableParent(e){for(var t=document.scrollingElement,n="absolute"==getComputedStyle(e).position?e.offsetParent:e.parentElement;n&&n!=t;){if(n.clientHeight!=n.scrollHeight)return n;e=n="absolute"==getComputedStyle(n).position?n.offsetParent:n.parentElement}return t}exports.getScrollableParent=getScrollableParent;function getOffsetFromAncestor(e,t){for(var n=0,r=0,i=0,o=0;e;){r+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}for(;t;){o+=t.offsetLeft;i+=t.offsetTop;t=t.offsetParent}return{top:n-i,left:r-o}}exports.getOffsetFromAncestor=getOffsetFromAncestor;function _isMacOS(){return-1!==navigator.userAgent.indexOf("Mac")}exports._isMacOS=_isMacOS;function _setAriaLabelBy(e,t,n,r){var i=""===n?null:n;if(i!==e.ariaLabelledBy){e._ariaLabelledby=i;setAttribute(t,"aria-labelledby",i);r&&r()}}exports._setAriaLabelBy=_setAriaLabelBy;function deepElementFromPoint(e,t){for(var n=document.elementFromPoint(e,t);n&&n.shadowRoot;){var r=n.shadowRoot.elementFromPoint(e,t);if(!r||r===n)break;n=r}return n}exports.deepElementFromPoint=deepElementFromPoint;function roundTo(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}exports.roundTo=roundTo;function addAttributeValueToElement(e,t,n){var r=e.getAttribute(t);if(r){if(!r.split(/\s+/).includes(n)){setAttribute(e,t,r+" "+n)}}else setAttribute(e,t,n)}exports.addAttributeValueToElement=addAttributeValueToElement;function removeAttributeValueFromElement(e,t,n){var r=e.getAttribute(t);if(r){var i=n.toString(),o=r.split(/\s+/).filter((function(e){return e!==i}));o.length>0?e.setAttribute(t,o.join(" ")):e.removeAttribute(t)}}exports.removeAttributeValueFromElement=removeAttributeValueFromElement;function replaceItems(e,t){var n=new Map(t.map((function(e){return[""+e.value,e]})));return e.map((function(e){var t=""+e.value;return n.has(t)?n.get(t):e}))}exports.replaceItems=replaceItems;var _Map=function(){function _Map(e){void 0===e&&(e=!0);if(e)this._h={};else{var t=_getGlobal(),n=t&&t.Map;this._m=n&&new Map||new _ArrayMap}}Object.defineProperty(_Map.prototype,"isPojoHash",{get:function(){return null!=this._h},enumerable:!0,configurable:!0});Object.defineProperty(_Map.prototype,"size",{get:function(){return this._h&&Object.keys(this._h).length||this._m.size},enumerable:!0,configurable:!0});_Map.prototype.clear=function(){this._h?this._h={}:this._m.clear()};_Map.prototype.delete=function(e){this._h?delete this._h[e]:this._m.delete(e)};_Map.prototype.get=function(e){return this._h?this._h[e]:this._m.get(e)};_Map.prototype.has=function(e){return this._h?e in this._h:this._m.has(e)};_Map.prototype.set=function(e,t){this._h?this._h[e]=t:this._m.set(e,t);return this};return _Map}();exports._Map=_Map;var _ArrayMap=function(){function _ArrayMap(){this._d=[]}Object.defineProperty(_ArrayMap.prototype,"size",{get:function(){return this._d.length},enumerable:!0,configurable:!0});_ArrayMap.prototype.clear=function(){this._d=[]};_ArrayMap.prototype.delete=function(e){var t=this._kIdx(e);if(t>-1){this._d.splice(t,1);return!0}return!1};_ArrayMap.prototype.get=function(e){var t=this._kIdx(e);return t>-1?this._d[t].v:void 0};_ArrayMap.prototype.has=function(e){return this._kIdx(e)>-1};_ArrayMap.prototype.set=function(e,t){var n=this._kIdx(e);n>-1?this._d[n].v=t:this._d.push({k:e,v:t});return this};_ArrayMap.prototype._kIdx=function(e){var t=this._d,n=t.length;if(e==e){for(var r=0;r<n;r++)if(t[r].k===e)return r}else for(r=0;r<n;r++){var i=t[r].k;if(i!=i)return r}return-1};return _ArrayMap}();function _getGlobal(){var e=null;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self);return e}var Color=function(){function Color(e){this._r=0;this._g=0;this._b=0;this._a=1;e&&this._parse(e)}Object.defineProperty(Color.prototype,"r",{get:function(){return this._r},set:function(e){this._r=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"g",{get:function(){return this._g},set:function(e){this._g=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"b",{get:function(){return this._b},set:function(e){this._b=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"a",{get:function(){return this._a},set:function(e){this._a=clamp(asNumber(e),0,1)},enumerable:!0,configurable:!0});Color.prototype.equals=function(e){return e instanceof Color&&this.r==e.r&&this.g==e.g&&this.b==e.b&&this.a==e.a};Color.prototype.toString=function(){var e=Math.round(100*this.a);return e>99?"#"+((1<<24)+(this.r<<16)+(this.g<<8)+this.b).toString(16).slice(1):"rgba("+this.r+","+this.g+","+this.b+","+e/100+")"};Color.fromRgba=function(e,t,n,r){void 0===r&&(r=1);var i=new Color(null);i.r=Math.round(clamp(asNumber(e),0,255));i.g=Math.round(clamp(asNumber(t),0,255));i.b=Math.round(clamp(asNumber(n),0,255));i.a=clamp(asNumber(r),0,1);return i};Color.fromHsb=function(e,t,n,r){void 0===r&&(r=1);var i=Color._hsbToRgb(clamp(asNumber(e),0,1),clamp(asNumber(t),0,1),clamp(asNumber(n),0,1));return Color.fromRgba(i[0],i[1],i[2],r)};Color.fromHsl=function(e,t,n,r){void 0===r&&(r=1);var i=Color._hslToRgb(clamp(asNumber(e),0,1),clamp(asNumber(t),0,1),clamp(asNumber(n),0,1));return Color.fromRgba(i[0],i[1],i[2],r)};Color.fromString=function(e){var t=new Color(null);return t._parse(asString(e))?t:null};Color.prototype.getHsb=function(){return Color._rgbToHsb(this.r,this.g,this.b)};Color.prototype.getHsl=function(){return Color._rgbToHsl(this.r,this.g,this.b)};Color.interpolate=function(e,t,n){n=clamp(asNumber(n),0,1);var r=Color._rgbToHsl(e.r,e.g,e.b),i=Color._rgbToHsl(t.r,t.g,t.b),o=1-n,s=e.a*o+t.a*n,a=[r[0]*o+i[0]*n,r[1]*o+i[1]*n,r[2]*o+i[2]*n],l=Color._hslToRgb(a[0],a[1],a[2]);return Color.fromRgba(l[0],l[1],l[2],s)};Color.toOpaque=function(e,t){if(1==(e=isString(e)?Color.fromString(e):asType(e,Color)).a)return e;t=null==t?Color.fromRgba(255,255,255,1):isString(t)?Color.fromString(t):asType(t,Color);var n=e.a,r=1-n;return Color.fromRgba(e.r*n+t.r*r,e.g*n+t.g*r,e.b*n+t.b*r)};Color.prototype._parse=function(e){if("transparent"==(e=e.toLowerCase())){this._r=this._g=this._b=this._a=0;return!0}if(e&&0!=e.indexOf("#")&&0!=e.indexOf("rgb")&&0!=e.indexOf("hsl")){var t=document.createElement("div");t.style.color=e;var n=t.style.color;if(n==e&&!(n=window.getComputedStyle(t).color)){document.body.appendChild(t);n=window.getComputedStyle(t).color;removeChild(t)}e=n.toLowerCase()}if(0==e.indexOf("#")){if(this._isValidHexColor(e)){if(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;return!0}if(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;return!0}}return!1}if(0==e.indexOf("rgb")){var r=e.indexOf("("),i=e.indexOf(")");if(r>-1&&i>-1){if((o=e.substr(r+1,i-(r+1)).split(",")).length>2){this.r=parseInt(o[0]);this.g=parseInt(o[1]);this.b=parseInt(o[2]);this.a=o.length>3?parseFloat(o[3]):1;return!0}}}if(0==e.indexOf("hsl")){r=e.indexOf("("),i=e.indexOf(")");if(r>-1&&i>-1){var o;if((o=e.substr(r+1,i-(r+1)).split(",")).length>2){var s=parseInt(o[0])/360,a=parseInt(o[1]),l=parseInt(o[2]);o[1].indexOf("%")>-1&&(a/=100);o[2].indexOf("%")>-1&&(l/=100);var u=Color._hslToRgb(s,a,l);this.r=u[0];this.g=u[1];this.b=u[2];this.a=o.length>3?parseFloat(o[3]):1;return!0}}}return!1};Color.prototype._isValidHexColor=function(e){return/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)};Color._hslToRgb=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSL values");var r,i,o;if(0==t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=Color._hue2rgb(a,s,e+1/3);i=Color._hue2rgb(a,s,e);o=Color._hue2rgb(a,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*o)]};Color._hue2rgb=function(e,t,n){n<0&&(n+=1);n>1&&(n-=1);return n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e};Color._rgbToHsl=function(e,t,n){assert(e>=0&&e<=255&&t>=0&&t<=255&&n>=0&&n<=255,"bad RGB values");e/=255,t/=255,n/=255;var r,i,o=Math.max(e,t,n),s=Math.min(e,t,n),a=(o+s)/2;if(o==s)r=i=0;else{var l=o-s;i=a>.5?l/(2-o-s):l/(o+s);switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[r,i,a]};Color._rgbToHsb=function(e,t,n){assert(e>=0&&e<=255&&t>=0&&t<=255&&n>=0&&n<=255,"bad RGB values");var r=Color._rgbToHsl(e,t,n);return Color._hslToHsb(r[0],r[1],r[2])};Color._hsbToRgb=function(e,t,n){var r=Color._hsbToHsl(e,t,n);return Color._hslToRgb(r[0],r[1],r[2])};Color._hsbToHsl=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSB values");var r=clamp(n*(2-t)/2,0,1),i=1-Math.abs(2*r-1),o=clamp(i>0?n*t/i:t,0,1);assert(!isNaN(r)&&!isNaN(o),"bad conversion to HSL");return[e,o,r]};Color._hslToHsb=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSL values");var r=clamp(1==n?1:(2*n+t*(1-Math.abs(2*n-1)))/2,0,1),i=clamp(r>0?2*(r-n)/r:t,0,1);assert(!isNaN(r)&&!isNaN(i),"bad conversion to HSB");return[e,i,r]};return Color}();exports.Color=Color;exports.culture="undefined"!=typeof window&&window.wijmo&&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 Globalize=function(){function Globalize(){}Globalize.format=function(e,t,n,r,i){if(isString(e))return e;if(isNumber(e)){t=t||(e==Math.round(e)?"n0":"n2");return Globalize.formatNumber(e,t,n,r,i)}if(isDate(e)){t=t||"d";return Globalize.formatDate(e,t)}return null!=e?e.toString():""};Globalize.formatNumber=function(e,t,n,r,i){e=asNumber(e);t=asString(t);var o,s=exports.culture.Globalize.numberFormat,a=Globalize._parseNumericFormat(t),l=a.spec,u=a.prec,c=s["."]||".",p=s[","]||",",h=s["-"]||"-",f=Math;null==u&&(u=null!=i?i:"c"==l?s.currency.decimals:"e"==l?6:"r"==l?15:e==f.round(e)?0:2);a.scale&&(e/=f.pow(10,a.scale));if("d"==l||"x"==l){o=(r?f.floor:f.round)(f.abs(e)).toString("d"==l?10:16);for(;o.length<u;)o="0"+o;e<0&&(o=h+o);return"X"==a.specRaw?o.toUpperCase():o}r&&"p"!=l&&"e"!=l&&(e=toFixed(e,u,!0));switch(l){case"e":o=e.toExponential(u);"E"==a.specRaw&&(o=o.replace("e","E"));break;case"c":o=Globalize._toFixedStr(f.abs(e),u);break;case"p":e=Globalize._shiftDecimal(e,2,14);r&&(e=toFixed(e,u,r));o=Globalize._toFixedStr(f.abs(e),u);break;default:"-"!=(o=Globalize._toFixedStr(e,u))[0]||o.match(/[1-9]/)||(o=o.substr(1))}(n||"g"==l||"r"==l)&&o.indexOf(".")>-1&&(o=o.replace(/(\.\d*?)0+$/g,"$1").replace(/\.$/,""));"."!=c&&(o=o.replace(".",c));"-"!=h&&(o=o.replace("-",h));if(p&&("n"==l||"c"==l||"p"==a.specRaw||"F"==a.specRaw||"G"==a.specRaw)){var d=o.indexOf(c),g=/\B(?=(\d\d\d)+(?!\d))/g;o=d>-1?o.substr(0,d).replace(g,p)+o.substr(d):o.replace(g,p)}if("c"==l){var _=e<0&&o.match(/[1-9]/)?0:1,m=s.currency.pattern[_],v=a.curr||s.currency.symbol;"​"==v&&(v="");o=m.replace("n",o).replace("$",v)}if("p"==l){_=e<0&&o.match(/[1-9]/)?0:1,m=s.percent.pattern[_];var b=s["%"]||"%";o=m.replace("n",o);"%"!=b&&(o=o.replace("%",b));"-"!=h&&0==_&&(o=o.replace("-",h))}return a.prefix||a.suffix?a.prefix+o+a.suffix:o};Globalize.formatDate=function(e,t){e=asDate(e);switch(t){case"r":case"R":return e.toUTCString();case"u":return e.toISOString().replace(/\.\d{3}/,"")}t=Globalize._expandFormat(t);return Globalize._parseDateFormat(t).map((function(n){return Globalize._formatDatePart(e,t,n)})).join("")};Globalize.parseInt=function(e,t){return Math.round(Globalize.parseFloat(e,t))};Globalize.parseFloat=function(e,t){var n=Globalize._parseNumericFormat(t),r=n.prefix;r&&0==e.indexOf(r)&&(e=e.substring(r.length));var i=n.suffix;if(i){var o=e.lastIndexOf(i);o>-1&&o==e.length-i.length&&(e=e.substring(0,e.length-i.length))}var s=exports.culture.Globalize.numberFormat,a=s["."]||".",l=s[","]||",",u=s["-"]||"-",c=s["%"]||"%",p=n.curr||s.currency.symbol||"$",h=e.indexOf(c)>-1,f=e.indexOf("(")>-1&&e.indexOf(")")>-1,d=0;if("x"==n.spec)d=parseInt(e,16);else{[p,c,"(",")"].forEach((function(t){e=e.replace(t,"")}));/\s/.test(l)&&(e=e.replace(/\s+/g,""));var g=(e=e.replace(new RegExp("\\"+l,"g"),"").replace(new RegExp("\\"+u,"g"),"-").replace(/(\+|\-)\s+/g,"$1").replace(a,".").trim()).length;if(!f&&g&&"-"==e[g-1]){f=!0;e=e.substring(0,g-1)}d=/^\s*(\+|\-)?\d*(\.\d*)?(\s*E(\+|\-)?\d+)?\s*$/i.test(e)?parseFloat(e):Number.NaN}if(!isNaN(d)){f=f||d<0;d=Math.abs(d);h&&(d=Globalize._shiftDecimal(d,-2));f&&(d=-d);n.scale&&(d*=Math.pow(10,n.scale))}return d};Globalize.parseDate=function(e,t,n){if(!(e=asString(e)))return null;if("u"==t)return new Date(e);var r;if("R"==t||"r"==t){var i=e.match(/((\d+)\-(\d+)\-(\d+))?\s?((\d+):(\d+)(:(\d+))?)?/);if(i[1]||i[5]){r=i[1]?new Date(parseInt(i[2]),parseInt(i[3])-1,parseInt(i[4])):new Date;if(i[5]){r.setHours(parseInt(i[6]));r.setMinutes(parseInt(i[7]));r.setSeconds(i[8]?parseInt(i[9]):0)}}else r=new Date(e);return isNaN(r.getTime())?null:r}t=Globalize._expandFormat(t||"d");var o=exports.culture.Globalize.calendar,s=Globalize._CJK,a=new RegExp("(\\"+o["/"]+")|(\\"+o[":"]+")|(\\d+)|(["+s+"\\.]{2,})|(["+s+"]+)","gi"),l=e.match(a),u=Globalize._parseDateFormat(t),c=0;if(!(l&&l.length&&u&&u.length))return null;var p,h,f,d,g,_=-1,m=0,v=1,b=0,y=0,C=0,w=0,E=-1,A=null;if(n=asDate(n,!0)){m=n.getMonth();v=n.getDate();b=n.getHours();y=n.getMinutes();C=n.getSeconds();w=n.getMilliseconds()}for(var x=0;x<u.length&&l;x++){var T=x-c,P=T>-1&&T<l.length?l[T]:"",S=u[x].length;switch(u[x]){case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":g=u[x];case"yyyy":case"yyy":case"yy":case"y":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}_=parseInt(P);d=4==P.length;break;case"MMMM":case"MMM":f=!0;m=-1;for(var O=P.toLowerCase(),D="MMMM"==u[x]?o.months:o.monthsAbbr,F=0;F<12;F++)if(0==D[F].toLowerCase().indexOf(O)){m=F;break}if(m>-1)break;case"MM":case"M":f=!0;if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}m=parseInt(P)-1;break;case"dddd":case"ddd":p=!0;break;case"dd":case"d":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}v=parseInt(P);h=!0;break;case"hh":case"h":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}b=12==(b=parseInt(P))?0:b;break;case"HH":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}b=parseInt(P);break;case"H":b=parseInt(P);break;case"mm":case"m":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}y=parseInt(P);break;case"ss":case"s":if(S>1&&P.length>S){l[T]=P.substr(S);P=P.substr(0,S);c++}C=parseInt(P);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":w=parseInt(P)/Math.pow(10,S-3);break;case"tt":case"t":P=P.toUpperCase();b<12&&o.pm.indexOf(P)>-1&&(b+=12);break;case"q":case"Q":case"u":case"U":E=parseInt(P);break;case"ggg":case"gg":case"g":case'"г."':A=o.eras.length>1?Globalize._getEra(P,o):o.eras.length>0?o.eras[0]:null;if(o.eras.length>0&&!A)return null;break;case"/":case":":if(P&&P!=o[u[x]])return null;break;case o["/"]:case o[":"]:if(P&&P!=u[x])return null;break;case"K":break;default:Globalize._unquote(u[x]).trim()!=P.trim()&&c++}}if(f&&h){isNaN(b)&&(b=0);isNaN(y)&&(y=0);isNaN(C)&&(C=0)}if(m<0||m>11||isNaN(m)||v<1||v>31||isNaN(v)||b<0||b>=24||isNaN(b)||y<0||y>=60||isNaN(y)||C<0||C>=60||isNaN(C))return null;if(l.length+c>u.length)return null;if(g){if(!f)return null;var k=exports.culture.Globalize.calendar;if(isArray(k.fiscalYearOffsets)){var I="E"==g[0],M=m-k.fiscalYearOffsets[I?0:1];_+=M>11?-1:M<0?1:0}}if(p&&!h)return null;!f&&E>=1&&E<=4&&(m=3*(E-1));if(isNaN(_)||_<0)_=n?n.getFullYear():(new Date).getFullYear();else if(A&&A.start)_=_+A.start.getFullYear()-1;else if(_<100&&!d){var R=isNumber(o.twoDigitYearMax)?o.twoDigitYearMax:2029;R>99&&(_+=_+2e3<=R?2e3:1900)}return(r=DateTime.newDate(_,m,v,b,y+0,C,w)).getMonth()!=m||r.getDate()!=v?null:isNaN(r.getTime())?null:r};Globalize.getFullFormat=function(e){return Globalize._expandFormat(e)};Globalize.getFirstDayOfWeek=function(){var e=exports.culture.Globalize.calendar.firstDay;return e||0};Globalize.getNumberDecimalSeparator=function(){var e=exports.culture.Globalize.numberFormat["."];return e||"."};Globalize._toFixedStr=function(e,t){var n=e.toString(),r=n.indexOf("."),i=t-(n.length-r)+1,o=n.indexOf("e")>-1;if(!o&&r>-1&&i>=0)return n+Array(i+1).join("0");if(r>-1&&!o&&"5"==n[n.length-1]){e=+(Math.round(+(Math.abs(e)+"e"+t))+"e"+-t)*(e<0?-1:1)}return e.toFixed(t)};Globalize._unquote=function(e){return e.length>1&&e[0]==e[e.length-1]&&("'"==e[0]||'"'==e[0])?e.substr(1,e.length-2):e};Globalize._parseNumericFormat=function(e){var t=Globalize._numFormatInfo[e];if(!t){var n=e&&e.match(/(\"(.*?)\"\s*)?([a-z]+)\s*(\d*)\s*(,*)(\s*\"(.*?)\"\s*)?(.*)/i)||[],r=n[3]?n[3]:"n";if(r.length>1){n=[];r="n"}t={prefix:n[2]||"",spec:r.toLowerCase(),specRaw:r,prec:n[4]?parseInt(n[4]):null,scale:n[5]?3*n[5].length:0,suffix:n[7]||"",curr:n[8]||null};Globalize._numFormatInfo[e]=t}return t};Globalize._parseDateFormat=function(e){var t=Globalize._dateFormatParts[e];if(!t){t=[];if(e){var n=void 0,r=void 0;for(n=0;n>-1&&n<e.length;n++){var i=e[n];if(("'"==i||'"'==i)&&(r=e.indexOf(i,n+1))>-1){t.push(e.substring(n,r+1));n=r}else if("\\"==i&&n<e.length-1){n++;t.push('"'+e[n]+'"')}else{r=n+1;for(;r<e.length&&e[r]==i;r++);t.push(e.substring(n,r));n=r-1}}}Globalize._dateFormatParts[e]=t}return t};Globalize._formatDatePart=function(e,t,n){var r,i=exports.culture.Globalize.calendar,o=null,s=0,a=0,l=n.length;switch(n){case"yyyy":case"yyy":case"yy":case"y":case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":s=(r="E"==n[0]?DateTime.toFiscal(e,!0):"e"==n[0]?DateTime.toFiscal(e,!1):e).getFullYear();i.eras.length>1&&t.indexOf("g")>-1&&(o=Globalize._getEra(e,i))&&(s=isDate(o.start)?s-o.start.getFullYear()+1:Math.abs(s));var u=n.length<3?s%100:3==n.length?s%1e3:s;return Globalize._zeroPad(u,n.length);case"MMMMM":return i.monthsAbbr[e.getMonth()][0];case"MMMM":return i.months[e.getMonth()];case"MMM":return i.monthsAbbr[e.getMonth()];case"MM":case"M":return Globalize._zeroPad(e.getMonth()+1,l);case"dddd":return i.days[e.getDay()];case"ddd":return i.daysAbbr[e.getDay()];case"dd":return Globalize._zeroPad(e.getDate(),2);case"d":return e.getDate().toString();case"hh":case"h":return Globalize._zeroPad(Globalize._h12(e),l);case"HH":case"H":return Globalize._zeroPad(e.getHours(),l);case"mm":case"m":return Globalize._zeroPad(e.getMinutes(),l);case"ss":case"s":return Globalize._zeroPad(e.getSeconds(),l);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":a=e.getMilliseconds()*Math.pow(10,l-3);return"f"==n[0]?Globalize._zeroPad(a,l):a.toFixed(0);case"tt":return e.getHours()<12?i.am[0]:i.pm[0];case"t":return e.getHours()<12?i.am[1]:i.pm[1];case"q":case"Q":return(Math.floor(e.getMonth()/3)+1).toString();case"u":case"U":r=DateTime.toFiscal(e,"U"==n);return(Math.floor(r.getMonth()/3)+1).toString();case"ggg":case"gg":case"g":if(i.eras.length>1&&(o=Globalize._getEra(e,i))){if(isString(o))return o;switch(n){case"gg":return o.name[0];case"g":return o.symbol;default:return o.name}}return i.eras[0];case":":case"/":return i[n];case"K":var c=e.toString().match(/(\+|\-)(\d{2})(\d{2})/);return c?c[1]+c[2]+c[3]:"";case"zzz":case"zz":case"z":var p=-e.getTimezoneOffset(),h=Math.abs(p),f=Globalize.formatNumber,d=void 0;switch(n){case"zzz":d=f(h/60,"d2",!1,!0)+i[":"]+f(h%60,"d2",!1,!0);break;case"zz":d=f(h/60,"d2",!1,!0);break;case"z":d=f(h/60,"d1",!1,!0)}return(p>=0?"+":"-")+d}return l>1&&n[0]==n[l-1]&&('"'==n[0]||"'"==n[0])?n.substr(1,l-2):n};Globalize._getEra=function(e,t){if(t.eras){var n=t.eras,r=t.eras.length;if(isDate(e)){if(isString(n[0]))return n[e.getFullYear()>=0?0:1];if(isDate(n[0].start)){for(var i=0;i<r;i++)if(e>=n[i].start)return n[i];return n[r-1]}}else if(isString(e)&&e.length>0){e=e.toLowerCase();for(i=0;i<r;i++){var o=n[i];if(isString(o)){if(0==o.toLowerCase().indexOf(e))return o}else if(o.name&&0==o.name.toLowerCase().indexOf(e)||o.symbol&&0==o.symbol.toLowerCase().indexOf(e))return o}}}return null};Globalize._expandFormat=function(e){var t=exports.culture.Globalize.calendar.patterns[e];return t||e};Globalize._zeroPad=function(e,t){var n=e.toFixed(0),r=t-n.length+1;return r>0?Array(r).join("0")+n:n};Globalize._h12=function(e){var t=exports.culture.Globalize.calendar,n=e.getHours();t.am&&t.am[0]&&0==(n%=12)&&(n=12);return n};Globalize._shiftDecimal=function(e,t,n){if(0==t||isNaN(e))return e;var r=e.toString();if(r.indexOf("e")>-1){var i=e*Math.pow(10,t);null!=n&&(i=parseFloat(i.toFixed(n)));return i}var o=Array(Math.abs(t)+1).join("0");t<0&&(r=o+r);var s=r.indexOf(".");s<0&&(s=(r+=".").indexOf("."));t>0&&(r+=o);s+=t;r=(r=r.replace(".","")).substr(0,s)+"."+r.substr(s);return parseFloat(r)};Globalize._CJK="a-z"+"u00c0-u017fu3000-u30ffu4e00-u9faf".replace(/u/g,"\\u")+"u1100-u11ffu3130-u318fua960-ua97fuac00-ud7afud7b0-ud7ff".replace(/u/g,"\\u");Globalize._numFormatInfo={};Globalize._dateFormatParts={};return Globalize}();exports.Globalize=Globalize;exports._loadedCultures="undefined"!=typeof window&&window.wijmo&&window.wijmo._loadedCultures||{};function _updateCulture(e){exports.culture=e;exports._loadedCultures[e.Globalize.name]=e}exports._updateCulture=_updateCulture;function _addCultureInfo(e,t){var n="undefined"!=typeof window?window.wijmo:null,r=n?n.culture:null,i=r?r[e]:null;exports.culture[e]=i||t}exports._addCultureInfo=_addCultureInfo;exports.changeCultureSync=function(e,t){for(var n=document.getElementsByTagName("script"),r=0;r<n.length;r++){var i=n[r];if(i.src.indexOf("wijmo.culture.")>-1){i.parentElement.removeChild(i);break}}var o=exports._loadedCultures[e]||void 0;if(o){var s=window.wijmo._updateCulture;s?s(o):window.wijmo.culture=o;t&&t();window.wijmo.Control.invalidateAll()}return o};exports.changeCulture=function(e){return new Promise((function(t,n){var r=exports.changeCultureSync(e);r?t(r):n()}))};var _MaskProvider=function(){function _MaskProvider(e,t,n){void 0===t&&(t="");void 0===n&&(n="_");this._promptChar="_";this._mskArr=[];this._overWrite=!1;this._full=!0;this._inputBnd=this._input.bind(this);this._keydownBnd=this._keydown.bind(this);this._keypressBnd=this._keypress.bind(this);this._cmpstartBnd=this._cmpstart.bind(this);this._cmpendBnd=this._cmpend.bind(this);this.mask=asString(t);this.input=e;this.promptChar=asString(n,!1);this._connect(!0);(this._evtInput=document.createEvent("HTMLEvents")).initEvent("input",!0,!1)}Object.defineProperty(_MaskProvider.prototype,"input",{get:function(){return this._tbx},set:function(e){this._connect(!1);this._tbx=e;this._connect(!0)},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"mask",{get:function(){return this._msk},set:function(e){if(e!=this._msk){this._msk=asString(e,!0);this._parseMask();this._valueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"promptChar",{get:function(){return this._promptChar},set:function(e){if(e!=this._promptChar){assert(1==(e=asString(e,!1)).length,"promptChar must be a string with length 1.");for(var t=this._tbx,n=t.value,r="",i=this._mskArr,o=this._promptChar,s=0;s<n.length;s++){var a=i[s],l=n[s];a&&a.literal||l!==o||(l=e);r+=l}t.value=r;this._promptChar=e}},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"overwriteMode",{get:function(){return this._overWrite},set:function(e){this._overWrite=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(_MaskProvider.prototype,"maskFull",{get:function(){return this._full},enumerable:!0,configurable:!0});_MaskProvider.prototype.getMaskRange=function(){return this._mskArr.length?[this._firstPos,this._lastPos]:[0,this._tbx.value.length-1]};_MaskProvider.prototype.getRawValue=function(){var e=this._tbx?this._tbx.value:"";if(!this.mask)return e;for(var t="",n=0;n<this._mskArr.length&&n<e.length;n++)this._mskArr[n].literal||e[n]==this._promptChar||(t+=e[n]);return t};_MaskProvider.prototype.refresh=function(){this._parseMask();this._valueChanged()};_MaskProvider.prototype._input=function(e){var t=this;if(this._msk&&!this._composing&&e!=this._evtInput){e.preventDefault();e.stopImmediatePropagation();setTimeout((function(){t._valueChanged();t._tbx&&t._tbx.dispatchEvent(t._evtInput)}))}};_MaskProvider.prototype._keydown=function(e){if(e.keyCode==Key.Back){var t=this._tbx.selectionStart,n=this._tbx.selectionEnd;if(t<=this._firstPos&&n==t){e.preventDefault();this._backSpace=!1;return}}this._backSpace=e.keyCode==Key.Back};_MaskProvider.prototype._keypress=function(e){e.ctrlKey||e.metaKey||e.altKey||this._composing||!this._preventKey(e.charCode)||e.preventDefault()};_MaskProvider.prototype._cmpstart=function(e){this._composing=!0};_MaskProvider.prototype._cmpend=function(e){var t=this;if(this._composing){this._composing=!1;setTimeout((function(){var e=t._tbx;e&&t._valueChanged()&&e.dispatchEvent(t._evtInput)}))}};_MaskProvider.prototype._preventKey=function(e){if(e&&this._mskArr.length){var t=this._tbx,n=t.selectionStart,r=String.fromCharCode(e);n<this._firstPos&&setSelectionRange(t,n=this._firstPos);if(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};_MaskProvider.prototype._connect=function(e){var t=this._tbx;if(t){assert(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected.");if(e){this._autoComplete=t.autocomplete;this._spellCheck=t.spellcheck;t.autocomplete="off";t.spellcheck=!1;t.addEventListener("input",this._inputBnd,!0);t.addEventListener("keydown",this._keydownBnd,!0);t.addEventListener("keypress",this._keypressBnd,!0);t.addEventListener("compositionstart",this._cmpstartBnd,!0);t.addEventListener("compositionend",this._cmpendBnd,!0);t.addEventListener("blur",this._cmpendBnd,!0);this._valueChanged()}else{t.autocomplete=this._autoComplete;t.spellcheck=this._spellCheck;t.removeEventListener("input",this._inputBnd,!0);t.removeEventListener("keydown",this._keydownBnd,!0);t.removeEventListener("keypress",this._keypressBnd,!0);t.removeEventListener("compositionstart",this._cmpstartBnd,!0);t.removeEventListener("compositionend",this._cmpendBnd,!0);t.removeEventListener("blur",this._cmpendBnd,!0)}}};_MaskProvider.prototype._valueChanged=function(){if(!this._tbx||!this._msk)return!1;var e=this._tbx,t=e.selectionStart,n=t>0?e.value[t-1]:"",r=e.value;e.value=this._applyMask();""==r&&(t=this._firstPos+1);var i=t>0?e.value[t-1]:"";t>0&&i==this._promptChar&&n!=this.promptChar&&t--;t==r.length&&(t=this._matchEnd);this._validatePosition(t);return r!=e.value};_MaskProvider.prototype._applyMask=function(){var e=this._tbx,t=e.value;this._full=!0;this._matchEnd=0;if(!this._msk)return t;if(!t&&!e.required)return t;if(this._overWrite){var n=e.selectionStart;e==document.activeElement&&e.selectionEnd==n&&t.length>this.mask.length&&(t=t.substr(0,n)+t.substr(n+t.length-this.mask.length))}t=this._handleVagueLiterals(t);for(var r="",i=0,o=this._promptChar,s=0;s<this._mskArr.length;s++){var a=this._mskArr[s],l=a.literal;l&&l==t[i]&&i++;if(a.wildCard){l=o;if(t){for(var u=i;u<t.length;u++)if(this._isCharValid(a.wildCard,t[u])){l=t[u];switch(a.charCase){case">":l=l.toUpperCase();break;case"<":l=l.toLowerCase()}l!=o&&(this._matchEnd=r.length+1);break}i=u+1}l==o&&(this._full=!1)}r+=l}return r};_MaskProvider.prototype._handleVagueLiterals=function(e){if(e.length>this._mskArr.length+1)return e;var t=e.length-this._mskArr.length;if(0!=t&&e.length>1){for(var n=-1,r=this._backSpace,i=this._tbx,o=i==getActiveElement()?i.selectionStart:i.value.length,s=Math.max(0,o-t);s<this._mskArr.length;s++)if(this._mskArr[s].vague){n=s;break}if(n>-1)if(t<0){if(r)for(;n>0&&this._mskArr[n-1].literal;)n--;var a=Array(1-t).join(this._promptChar),l=n+t;l>-1&&(e=e.substr(0,l)+a+e.substr(l-t))}else{for(;n>0&&this._mskArr[n-1].literal;)n--;e=e.substr(0,n)+e.substr(n+t)}}return e};_MaskProvider.prototype._isCharValid=function(e,t){if(t==this._promptChar)return!0;switch(e){case"0":return this._isDigit(t);case"9":return this._isDigit(t)||" "==t;case"#":return this._isDigit(t)||" "==t||"+"==t||"-"==t;case"L":return this._isLetter(t);case"l":return this._isLetter(t)||" "==t;case"A":return this._isDigit(t)||this._isLetter(t);case"a":return this._isDigit(t)||this._isLetter(t)||" "==t;case"9":return t>="0"&&t<="9";case"J":case"G":return!("G"==e&&_MaskProvider._X_DBCS_BIG_HIRA.indexOf(t)>-1)&&(t>="ぁ"&&t<="ゟ");case"K":case"N":return!("N"==e&&_MaskProvider._X_DBCS_BIG_KATA.indexOf(t)>-1)&&(t>="゠"&&t<="ヿ");case"Z":return!(t>="ヲ"&&t<="゚")&&(t<" "||t>"ÿ");case"H":return t>="!"&&t<="ÿ"||t>="ヲ"&&t<="゚";case"K":case"N":return!("N"==e&&_MaskProvider._X_SBCS_BIG_KATA.indexOf(t)>-1)&&(t>="ヲ"&&t<="゚")}return!1};_MaskProvider.prototype._isDigit=function(e){return e>="0"&&e<="9"};_MaskProvider.prototype._isLetter=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"};_MaskProvider.prototype._validatePosition=function(e){var t=this._mskArr;if(this._backSpace)for(;e>0&&e<t.length&&t[e-1].literal;)e--;if(0==e||!this._backSpace)for(;e<t.length&&t[e].literal;)e++;getActiveElement()==this._tbx&&setSelectionRange(this._tbx,e);this._backSpace=!1};_MaskProvider.prototype._parseMask=function(){this._mskArr=[];this._firstPos=-1;this._lastPos=-1;for(var e,t=this._msk,n="|",r=0;t&&r<t.length;r++)switch(t[r]){case"0":case"9":case"#":case"A":case"a":case"L":case"l":case"9":case"J":case"G":case"K":case"N":case"Z":case"K":case"N":case"H":this._firstPos<0&&(this._firstPos=this._mskArr.length);this._lastPos=this._mskArr.length;this._mskArr.push(new _MaskElement(t[r],n));break;case".":case",":case":":case"/":case"$":switch(t[r]){case".":case",":e=exports.culture.Globalize.numberFormat[t[r]];break;case":":case"/":e=exports.culture.Globalize.calendar[t[r]];break;case"$":e=exports.culture.Globalize.numberFormat.currency.symbol}for(var i=0;i<e.length;i++)this._mskArr.push(new _MaskElement(e[i]));break;case"<":case">":case"|":n=t[r];break;case"\\":r<t.length-1&&r++;this._mskArr.push(new _MaskElement(t[r]));break;default:this._mskArr.push(new _MaskElement(t[r]))}for(r=0;r<this._mskArr.length;r++){var o=this._mskArr[r];if(o.literal)for(i=0;i<this._mskArr.length;i++){var s=this._mskArr[i];if(s.wildCard&&this._isCharValid(s.wildCard,o.literal)){o.vague=!0;break}}}};_MaskProvider.prototype.dispose=function(){this._connect(!1);this._tbx=null;this._inputBnd=null;this._keydownBnd=null;this._keypressBnd=null;this._cmpstartBnd=null;this._cmpendBnd=null;this._mskArr=null;this._evtInput=null};_MaskProvider._X_DBCS_BIG_HIRA="ぁぃぅぇぉっゃゅょゎゕゖ";_MaskProvider._X_DBCS_BIG_KATA="ァィゥェォッャュョヮヵヶ";_MaskProvider._X_SBCS_BIG_KATA="ァィゥェォャュョッ";return _MaskProvider}();exports._MaskProvider=_MaskProvider;var Aggregate,_MaskElement=function _MaskElement(e,t){if(t){this.wildCard=e;this.charCase=t}else this.literal=e};exports._MaskElement=_MaskElement;!function(e){e[e.None=0]="None";e[e.Sum=1]="Sum";e[e.Cnt=2]="Cnt";e[e.Avg=3]="Avg";e[e.Max=4]="Max";e[e.Min=5]="Min";e[e.Rng=6]="Rng";e[e.Std=7]="Std";e[e.Var=8]="Var";e[e.StdPop=9]="StdPop";e[e.VarPop=10]="VarPop";e[e.CntAll=11]="CntAll";e[e.First=12]="First";e[e.Last=13]="Last"}(Aggregate=exports.Aggregate||(exports.Aggregate={}));function getAggregate(e,t,n,r){var i=0,o=0,s=0,a=0,l=null,u=null,c=null,p=n?new Binding(n):null;if((e=asEnum(e,Aggregate))==Aggregate.CntAll)return t.length;for(var h=0;h<t.length;h++){var f=t[h];p&&(f=p.getValue(f));if(null!=f){if(e==Aggregate.First)return f;i++;(null==l||f<l)&&(l=f);(null==u||f>u)&&(u=f);c=f;f&&"string"==typeof f&&f.length>1&&"="===f[0]&&"="!==f[1]&&r&&"function"==typeof r.evaluate&&(f=r.evaluate(f));if(isNumber(f)&&!isNaN(f)){o++;s+=f;a+=f*f}else if(isBoolean(f)){o++;if(1==f){s++;a++}}}}var d=0==o?0:s/o;switch(e){case Aggregate.Avg:return d;case Aggregate.Cnt:return i;case Aggregate.Max:return u;case Aggregate.Min:return l;case Aggregate.Rng:return u-l;case Aggregate.Sum:return s;case Aggregate.VarPop:return o<=1?0:a/o-d*d;case Aggregate.StdPop:return o<=1?0:Math.sqrt(a/o-d*d);case Aggregate.Var:return o<=1?0:(a/o-d*d)*o/(o-1);case Aggregate.Std:return o<=1?0:Math.sqrt((a/o-d*d)*o/(o-1));case Aggregate.Last:return c;case Aggregate.First:return null}throw"Invalid aggregate type."}exports.getAggregate=getAggregate;function extend(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var ArrayBase=function(e){__extends(ArrayBase,e);function ArrayBase(){var t=this;canChangePrototype?t.length=0:t=e.call(this)||this;return t}return ArrayBase}(Array);exports.ArrayBase=ArrayBase;var canChangePrototype=!0;try{extend(ArrayBase.prototype,Array.prototype);canChangePrototype=ArrayBase.prototype.length===Array.prototype.length}catch(e){canChangePrototype=!1}var symb="undefined"!=typeof window?window.Symbol:null;!canChangePrototype&&symb&&symb.species&&Object.defineProperty(ArrayBase,symb.species,{get:function(){return Array},enumerable:!1,configurable:!1});var SortNulls,ObservableArray=function(e){__extends(ObservableArray,e);function ObservableArray(t){var n=e.call(this)||this;n._updating=0;n.collectionChanged=new Event;if(t){t=asArray(t);n._updating++;for(var r=0;r<t.length;r++)n.push(t[r]);n._updating--}return n}ObservableArray.prototype.push=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];n.forEach((function(n){e.prototype.push.call(t,n);t._raiseCollectionChanged(NotifyCollectionChangedAction.Add,n,t.length-1)}));return this.length};ObservableArray.prototype.shift=function(){var t=e.prototype.shift.call(this);this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,0);return t};ObservableArray.prototype.unshift=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.prototype.unshift.apply(this,t);1==t.length?this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t[0],0):this._raiseCollectionChanged();return r};ObservableArray.prototype.pop=function(){var t=e.prototype.pop.call(this);this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,this.length);return t};ObservableArray.prototype.splice=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o,s=NotifyCollectionChangedAction,a=this._raiseCollectionChanged.bind(this);if(n&&r.length){o=e.prototype.splice.apply(this,[t,n].concat(r));1==n&&1==r.length?a(s.Change,r[0],t):a()}else if(r.length){o=e.prototype.splice.apply(this,[t,0].concat(r));1==r.length?a(s.Add,r[0],t):a()}else{o=e.prototype.splice.call(this,t,n);1==n?a(s.Remove,o[0],t):a()}return o};ObservableArray.prototype.slice=function(t,n){return e.prototype.slice.call(this,t,n)};ObservableArray.prototype.indexOf=function(t,n){return e.prototype.indexOf.call(this,t,n)};ObservableArray.prototype.sort=function(t){var n=e.prototype.sort.call(this,t);this._raiseCollectionChanged();return n};ObservableArray.prototype.insert=function(e,t){this.splice(e,0,t)};ObservableArray.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.removeAt(t);return t>-1};ObservableArray.prototype.removeAt=function(e){this.splice(e,1)};ObservableArray.prototype.setAt=function(e,t){e>=this.length&&(this.length=e+1);this.splice(e,1,t)};ObservableArray.prototype.clear=function(){this.length&&this.splice(0,this.length)};ObservableArray.prototype.beginUpdate=function(){this._updating++};ObservableArray.prototype.endUpdate=function(e){void 0===e&&(e=!1);this._updating--;this._updating<=0&&!e&&this._raiseCollectionChanged()};Object.defineProperty(ObservableArray.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0});ObservableArray.prototype.deferUpdate=function(e){try{this.beginUpdate();e()}finally{this.endUpdate()}};ObservableArray.prototype.implementsInterface=function(e){return"INotifyCollectionChanged"==e};ObservableArray.prototype.onCollectionChanged=function(e){void 0===e&&(e=NotifyCollectionChangedEventArgs.reset);this.isUpdating||this.collectionChanged.raise(this,e)};ObservableArray.prototype._raiseCollectionChanged=function(e,t,n){void 0===e&&(e=NotifyCollectionChangedAction.Reset);if(!this.isUpdating){var r=new NotifyCollectionChangedEventArgs(e,t,n);this.onCollectionChanged(r)}};return ObservableArray}(ArrayBase);exports.ObservableArray=ObservableArray;!function(e){e[e.Natural=0]="Natural";e[e.First=1]="First";e[e.Last=2]="Last"}(SortNulls=exports.SortNulls||(exports.SortNulls={}));var _OBJ_DEPTH=2,CollectionView=function(){function CollectionView(e,t){var n=this;this._srcRaw=null;this._src=null;this._ncc=null;this._view=null;this._pgView=null;this._groups=null;this._fullGroups=null;this._digest="";this._idx=-1;this._filter=null;this._filters=new ObservableArray;this._srtDsc=new ObservableArray;this._grpDesc=new ObservableArray;this._newItem=null;this._edtItem=null;this._edtClone=null;this._committing=!1;this._canceling=!1;this._pendingRefresh=!1;this._pendingRemove=!1;this._pgSz=0;this._pgIdx=0;this._updating=0;this._stableSort=!1;this._srtNulls=SortNulls.Last;this._canFilter=!0;this._canGroup=!0;this._canSort=!0;this._canAddNew=!0;this._canCancelEdit=!0;this._canRemove=!0;this._canChangePage=!0;this._refreshOnEdit=!0;this._trackChanges=!1;this._chgAdded=new ObservableArray;this._chgRemoved=new ObservableArray;this._chgEdited=new ObservableArray;this._orgVals=window.Map?new Map:null;this._srtCvt=null;this._srtCmp=null;this._getError=null;this._keepCurrentItem=null;this._initializing=!1;this.collectionChanged=new Event;this.sourceCollectionChanging=new Event;this.sourceCollectionChanged=new Event;this.currentChanged=new Event;this.currentChanging=new Event;this.pageChanged=new Event;this.pageChanging=new Event;this._srtDsc.collectionChanged.addHandler((function(){n._srtDsc.forEach((function(e){assert(e instanceof SortDescription,"sortDescriptions array must contain SortDescription objects.")}));n.canSort&&n._commitAndRefresh()}));this._grpDesc.collectionChanged.addHandler((function(){n._grpDesc.forEach((function(e){assert(e instanceof GroupDescription,"groupDescriptions array must contain GroupDescription objects.")}));n.canGroup&&n._commitAndRefresh()}));this._filters.collectionChanged.addHandler((function(){n._filters.forEach((function(e){assert(isFunction(e),"filters array must contain IPredicate functions.")}));n.canFilter&&n._commitAndRefresh()}));this._chgEdited.collectionChanged.addHandler((function(e,t){if(t&&t.action&&n._orgVals&&0!==n._orgVals.size)switch(t.action){case NotifyCollectionChangedAction.Remove:n._orgVals.delete(t.item);break;case NotifyCollectionChangedAction.Reset:n._orgVals.clear()}}));this.sourceCollection=e||new ObservableArray;if(t){this._initializing=!0;this.deferUpdate((function(){copy(n,t)}));this._initializing=!1}null==this._keepCurrentItem&&(this._keepCurrentItem=!0)}CollectionView.prototype._copy=function(e,t){switch(e){case"sortDescriptions":var n=this.sortDescriptions;n.deferUpdate((function(){n.clear();asArray(t).forEach((function(e){isString(e)?e=new SortDescription(e,!0):e instanceof SortDescription||!e.property||(e=new SortDescription(e.property,e.ascending));n.push(e)}))}));return!0;case"groupDescriptions":var r=this.groupDescriptions;r.deferUpdate((function(){r.clear();t.forEach((function(e){isString(e)&&(e=new PropertyGroupDescription(e));r.push(e)}))}));return!0;case"currentItem":this.currentItem=t;return!0}return!1};Object.defineProperty(CollectionView.prototype,"calculatedFields",{get:function(){return this._calcFields},set:function(e){if(e&&!window.Proxy){console.warn("** Calculated fields require Proxy (see https://www.npmjs.com/package/proxy-polyfill).");e=null}if(e!=this._calcFields){this._calcFields=e;var t=this._srcRaw;this._srcRaw=null;this.sourceCollection=t}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"newItemCreator",{get:function(){return this._itemCreator},set:function(e){this._itemCreator=asFunction(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortConverter",{get:function(){return this._srtCvt},set:function(e){e!=this._srtCvt&&(this._srtCvt=asFunction(e,!0))},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortComparer",{get:function(){return this._srtCmp},set:function(e){e!=this._srtCmp&&(this._srtCmp=asFunction(e,!0))},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"useStableSort",{get:function(){return this._stableSort},set:function(e){if(e!=this._stableSort){this._stableSort=asBoolean(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortNulls",{get:function(){return this._srtNulls},set:function(e){if((e=asEnum(e,SortNulls))!=this._srtNulls){this._srtNulls=e;this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortNullsFirst",{get:function(){return this.sortNulls!=SortNulls.Last},set:function(e){_deprecated("sortNullsFirst","sortNulls");this.sortNulls=asBoolean(e)?SortNulls.First:SortNulls.Last},enumerable:!0,configurable:!0});CollectionView.prototype.getAggregate=function(e,t,n){return getAggregate(e,n?this._pgView:this._view,t)};Object.defineProperty(CollectionView.prototype,"trackChanges",{get:function(){return this._trackChanges},set:function(e){this._trackChanges=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"refreshOnEdit",{get:function(){return this._refreshOnEdit},set:function(e){this._refreshOnEdit=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemsAdded",{get:function(){return this._chgAdded},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemsRemoved",{get:function(){return this._chgRemoved},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemsEdited",{get:function(){return this._chgEdited},enumerable:!0,configurable:!0});CollectionView.prototype.clearChanges=function(){this._chgAdded.clear();this._chgRemoved.clear();this._chgEdited.clear();this._orgVals&&this._orgVals.clear()};CollectionView.prototype.implementsInterface=function(e){switch(e){case"ICollectionView":case"IEditableCollectionView":case"IPagedCollectionView":case"INotifyCollectionChanged":return!0}return!1};Object.defineProperty(CollectionView.prototype,"getError",{get:function(){return this._getError},set:function(e){if(this._getError!=e){this._getError=asFunction(e);this._raiseCollectionChanged()}},enumerable:!0,configurable:!0});CollectionView.prototype.onCollectionChanged=function(e,t){void 0===e&&(e=NotifyCollectionChangedEventArgs.reset);e.action!=NotifyCollectionChangedAction.Change||this._committing||this._canceling||e.item==this.currentEditItem||e.item==this.currentAddItem||this._trackItemChanged(e.item,t);this._updating||this.collectionChanged.raise(this,e)};CollectionView.prototype._raiseCollectionChanged=function(e,t,n){void 0===e&&(e=NotifyCollectionChangedAction.Reset);var r=new NotifyCollectionChangedEventArgs(e,t,n);this.onCollectionChanged(r)};CollectionView.prototype.onSourceCollectionChanging=function(e){this.sourceCollectionChanging.raise(this,e);return!e.cancel};CollectionView.prototype.onSourceCollectionChanged=function(e){this.sourceCollectionChanged.raise(this,e)};Object.defineProperty(CollectionView.prototype,"canFilter",{get:function(){return this._canFilter},set:function(e){this._canFilter=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canGroup",{get:function(){return this._canGroup},set:function(e){this._canGroup=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canSort",{get:function(){return this._canSort},set:function(e){this._canSort=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentItem",{get:function(){return this._pgView&&this._idx>-1&&this._idx<this._pgView.length?this._pgView[this._idx]:null},set:function(e){this.moveCurrentTo(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentPosition",{get:function(){return this._idx},set:function(e){this.moveCurrentToPosition(asNumber(e))},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"filter",{get:function(){return this._filter},set:function(e){if(this._filter!=e){this._filter=asFunction(e);this.canFilter&&this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"filters",{get:function(){return this._filters},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"groupDescriptions",{get:function(){return this._grpDesc},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isEmpty",{get:function(){return!this._pgView||!this._pgView.length},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sortDescriptions",{get:function(){return this._srtDsc},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"sourceCollection",{get:function(){return this._src},set:function(e){if(e!=this._srcRaw){if(!this.onSourceCollectionChanging(new CancelEventArgs))return;var t=this.currentPosition;this.commitEdit();null!=this._ncc&&this._ncc.collectionChanged.removeHandler(this._sourceChanged);this._srcRaw=e;this._src=asArray(e,!1);this._calcFields&&(this._src=_getCalculatedArray(this._src,this._calcFields));this._ncc=tryCast(this._src,"INotifyCollectionChanged");this._ncc&&this._ncc.collectionChanged.addHandler(this._sourceChanged,this);this.clearChanges();this.refresh();this.moveCurrentToFirst();this.onSourceCollectionChanged();this.currentPosition<0&&t>-1&&this.onCurrentChanged()}},enumerable:!0,configurable:!0});CollectionView.prototype._sourceChanged=function(e,t){this._updating<=0&&this.refresh()};CollectionView.prototype.contains=function(e){return this._pgView.indexOf(e)>-1};CollectionView.prototype.moveCurrentTo=function(e){return this.moveCurrentToPosition(this._pgView.indexOf(e))};CollectionView.prototype.moveCurrentToFirst=function(){return this.moveCurrentToPosition(0)};CollectionView.prototype.moveCurrentToLast=function(){return this.moveCurrentToPosition(this._pgView.length-1)};CollectionView.prototype.moveCurrentToPrevious=function(){return this._idx>0&&this.moveCurrentToPosition(this._idx-1)};CollectionView.prototype.moveCurrentToNext=function(){return this.moveCurrentToPosition(this._idx+1)};CollectionView.prototype.moveCurrentToPosition=function(e){if(e>=-1&&e<this._pgView.length&&e!=this._idx){var t=new CancelEventArgs;if(this.onCurrentChanging(t)){var n=this._pgView[e],r=_getTargetObject(n),i=this._edtItem,o=this._newItem;i&&i!=n&&i!=r?this.commitEdit():o&&o!=n&&o!=r&&this.commitNew();this._idx=e;this.onCurrentChanged()}}return this._idx==e};CollectionView.prototype.refresh=function(){if(this._newItem||this._edtItem||this._updating>0)this._pendingRefresh=!0;else{var e=this.currentItem;this._performRefresh();this.onCollectionChanged();e==this.currentItem||this._initializing||this.onCurrentChanged()}};CollectionView.prototype._commitAndRefresh=function(){if(this.currentEditItem||this.currentAddItem){this._pendingRefresh=!0;this.commitEdit()}else this.refresh()};CollectionView.prototype._performRefresh=function(){if(this._updating>0)this._pendingRefresh=!0;else{this._pendingRefresh=!1;this._pendingRemove=!1;var e=this.currentItem;this._view=this._src?this._performFilter(this._src):[];if(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=clamp(this._pgIdx,0,this.pageCount-1);this._pgView=this._getPageView();if(this._groups&&this.pageCount>1){this._groups=this._createGroups(this._pgView);this._mergeGroupItems(this._groups)}var t=this._keepCurrentItem&&null!=e?this._pgView.indexOf(e):-1;t<0&&(t=Math.min(this._idx,this._pgView.length-1));this._idx=t;this._digest=this._getGroupsDigest(this.groups)}};CollectionView.prototype._performSort=function(e){if(this._stableSort){var t=e.map((function(e,t){return{item:e,index:t}})),n=this._compareItems();t.sort((function(e,t){var r=n(e.item,t.item);return 0==r?e.index-t.index:r}));for(var r=0;r<e.length;r++)e[r]=t[r].item}else e.sort(this._compareItems())};CollectionView.prototype._compareItems=function(){var e=this,t=this._srtDsc,n=this._srtCvt,r=this._srtCmp,i=CollectionView._collator,o=!0,s=0;return function(a,l){for(var u=0;u<t.length;u++){var c=t[u],p=c._bnd.getValue(a),h=c._bnd.getValue(l);if(n){p=n(c,a,p,o);h=n(c,l,h,!1);o=!1}if(r&&null!=(s=r(p,h))){if(0!=s)return c.ascending?+s:-s}else{p!=p&&(p=null);h!=h&&(h=null);if(p!==h&&(null==p||null==h))switch(e._srtNulls){case SortNulls.First:return null==p?-1:1;case SortNulls.Last:return null==p?1:-1;default:s=null==p?-1:1;return c.ascending?+s:-s}if("string"==typeof p&&"string"==typeof h){if(i){if(0!=(s=i.compare(p,h)))return c.ascending?+s:-s;continue}var f=p.toLowerCase(),d=h.toLowerCase();if(f!=d){p=f;h=d}}if(0!=(s=p<h?-1:p>h?1:0))return c.ascending?+s:-s}}return 0}};CollectionView.prototype._performFilter=function(e){return this.canFilter&&this._filter||this._filters.length?e.filter(this._filterItem,this):e};CollectionView.prototype._filterItem=function(e){for(var t=!this.canFilter||!this._filter||this._filter(e),n=0;n<this._filters.length&&t;n++)t=this._filters[n](e);return t};CollectionView.prototype.onCurrentChanged=function(e){this.currentChanged.raise(this,e)};CollectionView.prototype.onCurrentChanging=function(e){this.currentChanging.raise(this,e);return!e.cancel};Object.defineProperty(CollectionView.prototype,"items",{get:function(){return this._pgView},enumerable:!0,configurable:!0});CollectionView.prototype.beginUpdate=function(){this._updating++};CollectionView.prototype.endUpdate=function(e){void 0===e&&(e=!0);this._updating--;e&&(this._pendingRefresh=!0);if(this._updating<=0){this._pendingRefresh&&this.refresh();if(this._pendingRemove){this._pendingRemove=!1;this._raiseCollectionChanged()}}};Object.defineProperty(CollectionView.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0});CollectionView.prototype.deferUpdate=function(e,t){void 0===t&&(t=!0);try{this.beginUpdate();e()}finally{this.endUpdate(t)}};Object.defineProperty(CollectionView.prototype,"canAddNew",{get:function(){return this._canAddNew},set:function(e){if(e!=this._canAddNew){this._canAddNew=asBoolean(e);this._raiseCollectionChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canCancelEdit",{get:function(){return this._canCancelEdit},set:function(e){this._canCancelEdit=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"canRemove",{get:function(){return this._canRemove},set:function(e){this._canRemove=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentAddItem",{get:function(){return this._newItem},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"currentEditItem",{get:function(){return this._edtItem},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isAddingNew",{get:function(){return null!=this._newItem},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isEditingItem",{get:function(){return null!=this._edtItem},enumerable:!0,configurable:!0});CollectionView.prototype.editItem=function(e){if(e!=this._edtItem&&this.moveCurrentTo(e)){this.commitEdit();this._edtItem=e;this._edtClone=this._extend({},this._edtItem)}};CollectionView.prototype.commitEdit=function(){var e=this._edtItem,t=this._edtClone;if(null!=e){this._committing=!0;var n=this._getChangedFields(e,t),r=this._pendingRefresh;this._edtItem=null;this._edtClone=null;var i=this._pgView.indexOf(e),o=this._digest;this._needRefresh(n)&&this._refreshOnEdit&&this._performRefresh();this._trackItemChanged(e,t);this._pgView.indexOf(e)!=i||o!=this._digest||r?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,e,i);this.commitNew();this._committing=!1;if(this.sourceCollection instanceof ObservableArray){this._updating++;var s=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,e);this.sourceCollection.onCollectionChanged(s);this._updating--}}};CollectionView.prototype.cancelEdit=function(){var e=this._edtItem;if(null!=e){this._edtItem=null;if(!this.canCancelEdit)return;var t=this._src.indexOf(e);if(t>=0&&this._edtClone){this._extend(this._src[t],this._edtClone);this._edtClone=null;this._canceling=!0;this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,e,t);this._canceling=!1;if(this._pendingRefresh&&this._refreshOnEdit){this._performRefresh();this._raiseCollectionChanged()}}}};CollectionView.prototype.addNew=function(e,t){void 0===t&&(t=!1);this.commitEdit();if(!this.canAddNew)return null;var n=this.sourceCollection;null==e&&(e=this.newItemCreator?this.newItemCreator():n&&n.length?new n[0].constructor:{});if(null!=e){this._updating++;n.push(e);this._updating--;e=n[n.length-1];this._newItem=e;this._pgView!=this._src&&this._pgView.push(e);if(this.groups&&this.groups.length){var r=this.groups[this.groups.length-1];r.items.push(e);for(;r.groups&&r.groups.length;)(r=r.groups[r.groups.length-1]).items.push(e)}this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,e,this._pgView.length-1);this.moveCurrentTo(e);t&&this.commitNew()}return this._newItem};CollectionView.prototype.commitNew=function(){var e=this._newItem;if(null!=e){this._newItem=null;var t=this._pgView.indexOf(e),n=this._digest;this._refreshOnEdit&&this._performRefresh();if(this._trackChanges){var r=this._chgEdited.indexOf(e);r>-1&&this._chgEdited.removeAt(r);this._chgAdded.indexOf(e)<0&&this._chgAdded.push(e)}this._pgView.indexOf(e)!=t||n!=this._digest||this.calculatedFields?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,e,t)}};CollectionView.prototype.cancelNew=function(){var e=this._newItem;null!=e&&this.remove(e)};CollectionView.prototype.remove=function(e){var t=e==this._newItem;t&&(this._newItem=null);e==this._edtItem&&this.cancelEdit();if(this.canRemove){var n=this._src.indexOf(e);if(n>-1){var r=this._view.indexOf(e)<0,i=this.currentItem;this._updating++;this._src.splice(n,1);this._updating--;var o=this._digest;if(this._refreshOnEdit)this._performRefresh();else{this._updating>0&&(this._pendingRemove=!0);var s=this._pgView.indexOf(e);s>=0&&this._pgView.splice(s,1)}if(this._trackChanges){var a=this._chgAdded.indexOf(e);a>-1&&this._chgAdded.removeAt(a);var l=this._chgEdited.indexOf(e);l>-1&&this._chgEdited.removeAt(l);this._chgRemoved.indexOf(e)<0&&!t&&a<0&&this._chgRemoved.push(e)}var u=this.sortDescriptions.length>0,c=this.pageSize>0&&this._pgIdx>-1;u||c||o!=this._getGroupsDigest(this.groups)?this._raiseCollectionChanged():r||this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,e,n);this.currentItem!==i&&this.onCurrentChanged()}}};CollectionView.prototype.removeAt=function(e){e=asInt(e);this.remove(this._pgView[e])};CollectionView.prototype._trackItemChanged=function(e,t){if(this._trackChanges){var n=this.sourceCollection;if(n&&n.indexOf(e)>-1){var r=this._orgVals,i=r?r.get(e):null;if(t&&!i){r.set(e,t);i=t}var o=this._chgEdited.indexOf(e),s=NotifyCollectionChangedAction.Change;if(i&&this._sameContent(e,i)){o>-1&&this._chgEdited.removeAt(o);return}if(o<0&&this._chgAdded.indexOf(e)<0)this._chgEdited.push(e);else if(o>-1){var a=new NotifyCollectionChangedEventArgs(s,e,o);this._chgEdited.onCollectionChanged(a)}else if((o=this._chgAdded.indexOf(e))>-1){a=new NotifyCollectionChangedEventArgs(s,e,o);this._chgAdded.onCollectionChanged(a)}}}};CollectionView.prototype._extend=function(e,t,n){void 0===n&&(n=_OBJ_DEPTH);for(var r in t)try{var i=t[r];if(n>0&&isObject(i))if("Map"===i.constructor.name)e[r]=i;else{e[r]={};this._extend(e[r],i,n-1)}else e[r]=i}catch(e){}return e};CollectionView.prototype._getChangedFields=function(e,t,n){void 0===n&&(n=_OBJ_DEPTH);assert(null!=t&&null!=e,"Two objects expected.");var r={};for(var i in t)try{this._sameValue(e[i],t[i],n)||(r[i]=!0)}catch(e){}for(var i in e)try{r[i]||this._sameValue(e[i],t[i],n)||(r[i]=!0)}catch(e){}var o=Object.keys(r);return o.length?o:null};CollectionView.prototype._sameValue=function(e,t,n){void 0===n&&(n=_OBJ_DEPTH);return!!(e===t||DateTime.equals(e,t)||Number.isNaN(e)&&Number.isNaN(t))||!(!isObject(e)||!isObject(t))&&(!(n>0)||null==this._getChangedFields(e,t,n-1))};CollectionView.prototype._sameContent=function(e,t){return null==this._getChangedFields(e,t)};CollectionView.prototype._needRefresh=function(e){if(this._pendingRefresh)return!0;if(!e)return!1;if(this._filter)return!0;for(var t=0;t<this._srtDsc.length;t++){var n=this._getBindingRoot(this._srtDsc[t].property);if(e.indexOf(n)>-1)return!0}for(t=0;t<this._grpDesc.length;t++){var r=this._grpDesc[t];if(!(r instanceof PropertyGroupDescription))return!0;n=this._getBindingRoot(r.propertyName);if(e.indexOf(n)>-1)return!0}return!1};CollectionView.prototype._getBindingRoot=function(e){var t=e.indexOf(".");return t>-1?e.substr(0,t):e};Object.defineProperty(CollectionView.prototype,"canChangePage",{get:function(){return this._canChangePage},set:function(e){this._canChangePage=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"isPageChanging",{get:function(){return!1},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"itemCount",{get:function(){return this._pgView.length},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"pageIndex",{get:function(){return this._pgIdx},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"pageSize",{get:function(){return this._pgSz},set:function(e){if(e!=this._pgSz){this._pgSz=asInt(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"totalItemCount",{get:function(){return this._view.length},enumerable:!0,configurable:!0});Object.defineProperty(CollectionView.prototype,"pageCount",{get:function(){return this.pageSize?Math.ceil(this.totalItemCount/this.pageSize):1},enumerable:!0,configurable:!0});CollectionView.prototype.moveToFirstPage=function(){return this.moveToPage(0)};CollectionView.prototype.moveToLastPage=function(){return this.moveToPage(this.pageCount-1)};CollectionView.prototype.moveToPreviousPage=function(){return this.moveToPage(this.pageIndex-1)};CollectionView.prototype.moveToNextPage=function(){return this.moveToPage(this.pageIndex+1)};CollectionView.prototype.moveToPage=function(e){var t=clamp(e,0,this.pageCount-1);if(t!=this._pgIdx){if(!this.canChangePage)return!1;var n=new PageChangingEventArgs(t);if(this.onPageChanging(n)&&this.onCurrentChanging(n)){this.commitEdit();this.commitNew();var r=this.currentItem;this._pgIdx=t;this._pgView=this._getPageView();this._idx=0;if(this.groupDescriptions&&0!=this.groupDescriptions.length)this.refresh();else{this.onCollectionChanged();r!=this.currentItem&&this.onCurrentChanged()}this.onPageChanged()}}return this._pgIdx==e};CollectionView.prototype.onPageChanged=function(e){this.pageChanged.raise(this,e)};CollectionView.prototype.onPageChanging=function(e){this.pageChanging.raise(this,e);return!e.cancel};CollectionView.prototype._getFullGroup=function(e){var t=this._getGroupByPath(this._fullGroups,e.level,e._path);null!=t&&(e=t);return e};CollectionView.prototype._getGroupByPath=function(e,t,n){if(e)for(var r=0;r<e.length;r++){var i=e[r];if(i.level==t&&i._path==n)return i;if(i.level<t&&0==n.indexOf(i._path)&&null!=(i=this._getGroupByPath(i.groups,t,n)))return i}return null};CollectionView.prototype._getPageView=function(){if(this.pageSize<=0||this._pgIdx<0)return this._view;var e=this._pgSz*this._pgIdx,t=Math.min(e+this._pgSz,this._view.length);return this._view.slice(e,t)};CollectionView.prototype._createGroups=function(e){var t=this;if(!this._grpDesc||!this._grpDesc.length)return null;var n=[],r={},i=null;e.forEach((function(e){for(var o=n,s=t._grpDesc.length,a="",l=0;l<s;l++){var u=t._grpDesc[l],c=u.groupNameFromItem(e,l),p=l==s-1;if(!(i=r[a])&&isPrimitive(c)){i={};r[a]=i}var h=t._getGroup(u,o,i,c,l,p);a+="/"+c;h._path=a;p&&h.items.push(e);o=h.groups}}));return n};CollectionView.prototype._getGroupsDigest=function(e){for(var t="",n=0;null!=e&&n<e.length;n++){var r=e[n];t+="{"+r.name+":"+(r.items?r.items.length:"*");if(r.groups.length>0){t+=",";t+=this._getGroupsDigest(r.groups)}t+="}"}return t};CollectionView.prototype._mergeGroupItems=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[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(o=0,s=r._items.length;o<s;o++)t.push(r._items[o])}return t};CollectionView.prototype._getGroup=function(e,t,n,r,i,o){var s;if(n&&isPrimitive(r)){if(s=n[r])return s}else for(var a=0;a<t.length;a++)if(e.namesMatch(t[a].name,r))return t[a];var l=new CollectionViewGroup(e,r,i,o);t.push(l);n&&(n[r]=l);return l};CollectionView._collator="undefined"!=typeof window&&window.Intl&&Intl.Collator?new Intl.Collator:null;return CollectionView}();exports.CollectionView=CollectionView;var CollectionViewGroup=function(){function CollectionViewGroup(e,t,n,r){this._gd=e;this._name=t;this._level=n;this._isBottomLevel=r;this._groups=[];this._items=[]}Object.defineProperty(CollectionViewGroup.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"isBottomLevel",{get:function(){return this._isBottomLevel},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewGroup.prototype,"groupDescription",{get:function(){return this._gd},enumerable:!0,configurable:!0});CollectionViewGroup.prototype.getAggregate=function(e,t,n,r){var i=tryCast(n,CollectionView);return getAggregate(e,(i?i._getFullGroup(this):this).items,t,r)};CollectionViewGroup.prototype._clone=function(){var e=new CollectionViewGroup(this.groupDescription,this.name,this.level,this.isBottomLevel);e._path=this._path;if(this.groups.length)for(var t=0;t<this.groups.length;t++)e.groups.push(this.groups[t]);if(this.items.length)for(t=0;t<this.items.length;t++)e.items.push(this.items[t]);return e};return CollectionViewGroup}();exports.CollectionViewGroup=CollectionViewGroup;var _NullValue=function _NullValue(e){this._id=e};exports._NullValue=_NullValue;exports.controlBaseClass="undefined"!=typeof window&&window["wj-control-is-element"]?HTMLElement:Object;var __isES6Mode=!1;try{var f=function __c(){};f.prototype=Array.prototype;__isES6Mode=f.prototype!==Array.prototype}catch(e){__isES6Mode=!0}var __callSuper=__isES6Mode||exports.controlBaseClass!==Object,ControlBase=function(e){__extends(ControlBase,e);function ControlBase(){var t=this;__callSuper&&(t=e.call(this)||this);return t}return ControlBase}(exports.controlBaseClass);exports.ControlBase=ControlBase;var Control=function(e){__extends(Control,e);function Control(t,n,r){void 0===n&&(n=null);void 0===r&&(r=!1);var i=e.call(this)||this;i.workingAs="PureJs";i.disposed=!1;i._orgAttributes=[];i._listeners=[];i._pristine=!0;i._focus=!1;i._updating=0;i._fullUpdate=!1;i._listenResizeEvents=!0;i.gotFocus=new Event;i.lostFocus=new Event;i.invalidInput=new Event;i.refreshing=new Event;i.refreshed=new Event;i._updateWme();assert(null==Control.getControl(t),"Element is already hosting a control.");var o=getElement(t);assert(null!=o,"Cannot find the host element.");i._orgTabIndex=o.hasAttribute("tabindex")?o.tabIndex:0;for(var s=0;s<o.attributes.length;s++){var a=o.attributes[s];i._orgAttributes.push({name:a.name,value:a.textContent})}i._orgInner=o.innerHTML;i._orgTag=o.tagName;i._orgAtts=o.attributes;"INPUT"!=o.tagName&&"SELECT"!=o.tagName||(o=i._replaceWithDiv(o));i._e=o;o[Control._CTRL_KEY]=i;var l=i.addEventListener.bind(i);if(1==r){i._szCtl=new Size(o.offsetWidth,o.offsetHeight);var u=window.ResizeObserver,c=null;u&&(c=i._szObserver=new u((function(e){return i._resizeObserverCallback(e)})));c?c.observe(o):l(window,"resize",i._handleResize.bind(i))}var p=i._handleFocusBlur.bind(i);l(o,"focus",p,!0);l(o,"blur",p,!0);var h=i._handleDisabled.bind(i);l(o,"mousedown",h,!0);l(o,"mouseup",h,!0);l(o,"click",h,!0);l(o,"dblclick",h,!0);l(o,"wheel",h,getEventOptions(!0,!0));l(o,"keydown",(function(e){i.isDisabled&&e.keyCode!=Key.Tab&&e.preventDefault()}));0==Control._ctlCnt&&_detectTouch(!0);Control._ctlCnt++;return i}Control.prototype.getTemplate=function(){for(var e=Object.getPrototypeOf(this);e;e=Object.getPrototypeOf(e)){var t=e.constructor.controlTemplate;if(t)return t}return null};Control.prototype.applyTemplate=function(e,t,n,r){var i=this,o=this._e;e&&addClass(o,e);var s=null;t&&(s=createElement(t,o));for(var a=o.querySelectorAll("a."+exports.InputFormElementsClsNames.btn),l=0;l<a.length;l++){var u=a[l];setAttribute(u,"role","button",!0);setAttribute(u,"href","",!0);setAttribute(u,"draggable",!1,!0)}var c=o.querySelectorAll("button");for(l=0;l<c.length;l++)setAttribute(c[l],"type","button",!0);var p=o.querySelectorAll("input"),h=1==p.length?p[0]:null;if(h){var f=Control._rxInputAtts;this._copyAttributes(h,o.attributes,f);this._copyAttributes(h,this._orgAtts,f)}if(h&&o.id){for(var d=o;d.parentElement;)d=d.parentElement;var g=d.querySelector('label[for="'+o.id+'"]');if(g instanceof HTMLLabelElement){var _=getUniqueId(o.id+"_input");h.id=_;g.htmlFor=_}}if(h){var m=h.value,v=!0,b=!1,y=document.createEvent("HTMLEvents");y.initEvent("change",!0,!1);this.gotFocus.addHandler((function(){v=!1;b=!0;m=h.value}));this.addEventListener(o,"focusin",(function(e){if(v){b=!0;v=!1;m=h.value}}));this.addEventListener(h,"input",(function(){i._pristine=!1;i._getInputValueTimer=setTimeout((function(){m=h.value}))}));this.addEventListener(h,"change",(function(e){e.isTrusted&&(m=h.value)}));var leave_1=function(){if(!i._containsFocus()){v=!0;if(i._pristine){i._pristine=!1;i._updateState()}if(b&&m!=h.value){m=h.value;h.dispatchEvent(y)}b=!1}};this.addEventListener(o,"blur",(function(){leave_1()}));this.lostFocus.addHandler((function(){leave_1()}))}h?o.tabIndex=-1:o.getAttribute("tabindex")||(o.tabIndex=0);this._updateState();if(n)for(var C in n){var w=n[C];this[C]=s.querySelector('[wj-part="'+w+'"]');null==this[C]&&s.getAttribute("wj-part")==w&&(this[C]=s);if(null==this[C])throw'Missing template part: "'+w+'"';if(w==r){var E="name",A=o.attributes[E];A&&A.value&&this[C].setAttribute(E,A.value);E="accesskey";if((A=o.attributes[E])&&A.value){this[C].setAttribute(E,A.value);o.removeAttribute(E)}}}return s};Control.prototype.dispose=function(){if(this._e){this.disposed=!0;for(var e=this._e.querySelectorAll("."+exports.ControlClsNames.hostElement),t=0;t<e.length;t++){var n=Control.getControl(e[t]);n&&n.dispose()}if(this._toInv){clearTimeout(this._toInv);this._toInv=null}if(this._toFocus){clearTimeout(this._toFocus);this._toFocus=null}if(this._getInputValueTimer){clearTimeout(this._getInputValueTimer);this._getInputValueTimer=null}if(this._updateFocusStateTimer){clearTimeout(this._updateFocusStateTimer);this._updateFocusStateTimer=null}if(this.focusService){this.focusService.dispose();this.focusService=null}var r=this._szObserver;r&&r.disconnect();this.removeEventListener();for(var i in this)if(i.length>2&&0==i.indexOf("on")){(s=this[i[2].toLowerCase()+i.substr(3)])instanceof Event&&s.removeAllHandlers()}var o=this.collectionView;if(o instanceof CollectionView)for(var i in o){var s;(s=o[i])instanceof Event&&s.removeHandler(null,this)}if(this._e.parentNode){for(;this._e.attributes.length>0;)this._e.removeAttribute(this._e.attributes[0].name);for(var a=0,l=this._orgAttributes;a<l.length;a++){var u=l[a];this._e.setAttribute(u.name,u.value)}this._e.innerHTML=this._orgInner}this._e[Control._CTRL_KEY]=null;this._e=this._orgTag=this._szObserver=null;Control._ctlCnt--;0==Control._ctlCnt&&_detectTouch(!1);if(Control._ctlInvalidInput===this){if(Control._toInvalidInput){clearTimeout(Control._toInvalidInput);Control._toInvalidInput=null}if(Control._toClearCtlInvalid){clearTimeout(Control._toClearCtlInvalid);Control._toClearCtlInvalid=null}Control._ctlInvalidInput=null}if(Control._toTouch){clearTimeout(Control._toTouch);Control._toTouch=null}}};Control.getControl=function(e){var t=getElement(e);return t?asType(t[Control._CTRL_KEY],Control,!0):null};Object.defineProperty(Control.prototype,"hostElement",{get:function(){return this._e},enumerable:!0,configurable:!0});Object.defineProperty(Control.prototype,"rightToLeft",{get:function(){null==this._rtlDir&&(this._rtlDir=!!this._e&&"rtl"==getComputedStyle(this._e).direction);return this._rtlDir},enumerable:!0,configurable:!0});Control.prototype.focus=function(){var e=this._e;e&&e.offsetHeight&&(this.isDisabled||!(e.tabIndex>=0)&&moveFocus(e,0)||e.focus())};Control.prototype.containsFocus=function(){return this._containsFocusImpl(getActiveElement())};Control.prototype._containsFocus=function(){this.focusService||(this.focusService=new _FocusService);return this._containsFocusImpl(_getActiveElement(this.focusService.activeElement))};Control.prototype._containsFocusImpl=function(e){return contains(this._e,e,!0)};Control.prototype.invalidate=function(e){var t=this;void 0===e&&(e=!0);this._rtlDir=null;this._fullUpdate=this._fullUpdate||e;if(this._toInv){clearTimeout(this._toInv);this._toInv=null}this.isUpdating||this.disposed||(this._toInv=setTimeout((function(){t.refresh(t._fullUpdate);t._toInv=null}),Control._REFRESH_INTERVAL))};Control.prototype.refresh=function(e){var t=this;void 0===e&&(e=!0);if(!this.isUpdating&&!this.disposed){this.onRefreshing();this.refreshed.hasHandlers&&setTimeout((function(){t.onRefreshed()}))}if(!this.isUpdating&&this._toInv){clearTimeout(this._toInv);this._toInv=null;this._fullUpdate=!1}this._updateState();this._updateWme()};Control.invalidateAll=function(e){e||(e=document.body);var t=e.children;if(t)for(var n=0;n<t.length;n++)Control.invalidateAll(t[n]);var r=Control.getControl(e);r&&r.invalidate()};Control.refreshAll=function(e){e||(e=document.body);if(e.children)for(var t=0;t<e.children.length;t++)Control.refreshAll(e.children[t]);var n=Control.getControl(e);n&&n.refresh()};Control.disposeAll=function(e){var t=Control.getControl(e);if(t)t.dispose();else if(e.children)for(var n=0;n<e.children.length;n++)Control.disposeAll(e.children[n])};Control.prototype.beginUpdate=function(){this._updating++};Control.prototype.endUpdate=function(e){void 0===e&&(e=!0);this._updating--;this._updating<=0&&e&&this.invalidate()};Object.defineProperty(Control.prototype,"isUpdating",{get:function(){return this._updating>0},enumerable:!0,configurable:!0});Control.prototype.deferUpdate=function(e){try{this.beginUpdate();e()}finally{this.endUpdate()}};Object.defineProperty(Control.prototype,"isTouching",{get:function(){return Control._touching},enumerable:!0,configurable:!0});Object.defineProperty(Control.prototype,"tabOrder",{get:function(){return this._orgTabIndex},set:function(e){this._setTabOrder(e)},enumerable:!0,configurable:!0});Control.prototype._setTabOrder=function(e){var t=this._e;this._orgTabIndex=e;var n=t.querySelectorAll("input"),r=1===n.length?n[0]:null;t.tabIndex=this.isDisabled||r?-1:this._orgTabIndex;r&&(r.tabIndex=this._orgTabIndex)};Object.defineProperty(Control.prototype,"isDisabled",{get:function(){return this._e&&null!=this._e.getAttribute("disabled")},set:function(e){this._setIsDisabled(e)},enumerable:!0,configurable:!0});Control.prototype._setIsDisabled=function(e){if((e=!!asBoolean(e,!0))!=this.isDisabled){var t=this._e;if(t){toggleClass(t,exports.ControlStateClsNames.disabled,e);setAttribute(t,"disabled",e?"disabled":null);setAttribute(t,"aria-disabled",e);if(t.id){var n=document.querySelector("[dropdown-id="+t.id+"]");n&&toggleClass(n,exports.ControlStateClsNames.disabled,e)}t.tabIndex=this.isDisabled||1===t.querySelectorAll("input").length?-1:this._orgTabIndex;for(var r=t.querySelectorAll("input,textarea,button,command,fieldset,keygen,optgroup,option,select"),i=Control._DSBL_KEY,o=0;o<r.length;o++){var s=r[o];if(e){s[i]=s.disabled;s.disabled=!0}else{if(!!closest(s,"."+exports.ControlClsNames.hostElement+"."+exports.ControlStateClsNames.disabled)){s[i]=s.disabled;s.disabled=!0}else{var a=s[i];isBoolean(a)||(a=!1);s.disabled=a;delete s[i]}}}}}};Control.prototype.initialize=function(e){copy(this,e)};Control.prototype.addEventListener=function(e,t,n,r,i){if(e){null==r&&(r=!1);isBoolean(r)&&null==i&&(t.indexOf("touch")>-1||t.indexOf("wheel")>-1)&&(i=!1);var o=isBoolean(r)&&isBoolean(i)?getEventOptions(r,i):r;e.addEventListener(t,n,o);this._listeners.push({target:e,type:t,fn:n,capture:r})}};Control.prototype.removeEventListener=function(e,t,n,r){for(var i=0,o=0;o<this._listeners.length;o++){var s=this._listeners[o];if(!(null!=e&&e!=s.target||null!=t&&t!=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};Control.prototype.onGotFocus=function(e){this.gotFocus.raise(this,e)};Control.prototype.onLostFocus=function(e){this.lostFocus.raise(this,e)};Control.prototype.onInvalidInput=function(e){this.invalidInput.raise(this,e);var t=this;if(e.cancel){var n=Control._FOCUS_INTERVAL+50;if(null==Control._ctlInvalidInput||Control._ctlInvalidInput===this){Control._ctlInvalidInput=this;Control._toInvalidInput&&clearTimeout(Control._toInvalidInput);Control._toClearCtlInvalid&&clearTimeout(Control._toClearCtlInvalid);Control._toInvalidInput=setTimeout((function(){Control._toInvalidInput=null;t.containsFocus()||"isDroppedDown"in t&&"_isDropdownOpened"in t&&t._isDropdownOpened&&(t.isDroppedDown=t._isDropdownOpened);t.focus();Control._toClearCtlInvalid=setTimeout((function(){Control._ctlInvalidInput=null;Control._toClearCtlInvalid=null}),n)}),n)}}else Control._ctlInvalidInput=null;this._updateState();return!e.cancel};Control.prototype.onRefreshing=function(e){this.refreshing.raise(this,e)};Control.prototype.onRefreshed=function(e){this.refreshed.raise(this,e)};Control.prototype._getProductInfo=function(){return"B0C3,Control"};Control.prototype._getFocusedElements=function(e){for(var t=e;t;){if(!t.parentNode)return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&void 0!==t.host?t.querySelectorAll("."+exports.ControlStateClsNames.focused):document.body.querySelectorAll("."+exports.ControlStateClsNames.focused);t=t.parentNode}return[]};Control.prototype._updateWme=function(){var e=this._getProductInfo(),t=Control._toWme,n=_updateWme;if(isFunction(n)&&!t[e]){t[e]=!0;n(this,Control._licKey)}};Control.prototype._hasPendingUpdates=function(){return null!=this._toInv};Control.prototype._handleResize=function(){if(this._e.parentElement||this._e.parentNode){var e=new Size(this._e.offsetWidth,this._e.offsetHeight);if(!e.equals(this._szCtl)){this._szCtl=e;this._listenResizeEvents&&(e.width||e.height)&&this.invalidate()}}};Control.prototype._resizeObserverCallback=function(e){e.forEach((function(e){var t=Control.getControl(e.target);t&&t._handleResize()}))};Control.prototype._handleFocusBlur=function(){var e=this;this._toFocus||(this._toFocus=setTimeout((function(){e._toFocus=null;e._updateFocusState()}),Control._FOCUS_INTERVAL))};Control.prototype._updateFocusState=function(){var e=this;this._updateFocusStateTimer=setTimeout((function(){for(var t=EventArgs.empty,n=e._getFocusedElements(e.hostElement),r=0;r<n.length;r++){if((a=Control.getControl(n[r]))&&a._focus&&!a.containsFocus()){removeClass(a._e,exports.ControlStateClsNames.focus);a._focus=!1;a._updateState();a.onLostFocus(t)}}var i=getActiveElement();if(i)for(var o=!0,s=i;s;){var a;if((a=Control.getControl(s))&&!a._focus&&a.containsFocus()){if(o){addClass(s,exports.ControlStateClsNames.focus);o=!1}a._focus=!0;a._updateState();a.onGotFocus(t)}s=s[Control._OWNR_KEY]||s.parentNode}}))};Control.prototype._updateState=function(){var e=this.hostElement;if(e){toggleClass(e,exports.ControlStateClsNames.focused,this._focus);this._rtlDir="rtl"==getComputedStyle(e).direction;toggleClass(e,exports.UtilitesClsNames.rtl,this._rtlDir);var t=e.querySelector("input");if(t instanceof HTMLInputElement){toggleClass(e,exports.ControlStateClsNames.empty,0==t.value.length);toggleClass(e,exports.ControlStateClsNames.readOnly,t.readOnly);var n=t.validationMessage;toggleClass(e,exports.ControlStateClsNames.invalid,!this._pristine&&null!=n&&n.length>0);var r=closest(this.hostElement,exports.ControlStateClsNames.labeledInput),i=r&&r.querySelector(exports.ControlStateClsNames.wjError);if(i){var o=this.hostElement.classList.contains(exports.ControlStateClsNames.invalid);toggleClass(i,exports.ControlStateClsNames.errorVisible,o)}}}};Control.prototype._handleDisabled=function(e){if(this.isDisabled||closest(e.target,"."+exports.ControlStateClsNames.disabled)){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation()}};Control.prototype._replaceWithDiv=function(e){var t=document.createElement("div");e.parentElement.replaceChild(t,e);t.innerHTML=e.innerHTML;this._copyAttributes(t,e.attributes,/id|style|class/i);return t};Control.prototype._copyAttributes=function(e,t,n){if(e)for(var r=0;r<t.length;r++){var i=t[r].name;i.match(n)&&e.setAttribute(i,t[r].value)}};Control.prototype._getKeyCode=function(e){var t=e.keyCode;if(this.rightToLeft)switch(t){case Key.Right:t=Key.Left;break;case Key.Left:t=Key.Right}return t};Control.prototype._getCodeAsPerRTL=function(e){var t=e.code;if(this.rightToLeft)switch(t){case"ArrowRight":return"ArrowLeft";case"ArrowLeft":return"ArrowRight"}return t};Control.sharedState={};Control._toWme={};Control._ctlCnt=0;Control._touching=!1;Control._REFRESH_INTERVAL=10;Control._FOCUS_INTERVAL=5;Control._ANIM_DEF_DURATION=400;Control._ANIM_DEF_STEP=35;Control._CLICK_DELAY=800;Control._CLICK_REPEAT=75;Control._CLIPBOARD_DELAY=100;Control._POPUP_ZINDEX=1500;Control._SEARCH_DELAY=500;Control._HOVER_DELAY=400;Control._LEAVE_DELAY=600;Control._DRAG_SCROLL_EDGE=15;Control._DRAG_SCROLL_STEP=20;Control._CTRL_KEY="$WJ-CTRL";Control._OWNR_KEY="$WJ-OWNR";Control._SCRL_KEY="$WJ-SCRL";Control._TTIP_KEY="$WJ-TTIP";Control._DSBL_KEY="$WJ-DSBL";Control._rxInputAtts=/name|tabindex|placeholder|autofocus|autocomplete|autocorrect|autocapitalize|spellcheck|readonly|minlength|maxlength|pattern|type|aria-.+/i;return Control}(ControlBase);exports.Control=Control;function _detectTouch(e){if("ontouchstart"in window||"onpointerdown"in window){var t=document,n=getEventOptions(!0,!0),r=_handleTouchStart,i=_handleTouchEnd,o=e?t.addEventListener.bind(t):t.removeEventListener.bind(t);if("ontouchstart"in window){o("touchstart",r,n);o("touchend",i,n);o("touchcancel",i,n)}else if("onpointerdown"in window){o("pointerdown",r,n);o("pointerup",i,n);o("pointercancel",i,n)}}}function _handleTouchStart(e){if(null==e.pointerType||"touch"==e.pointerType){if(Control._toTouch){clearTimeout(Control._toTouch);Control._toTouch=null}Control._touching=!0}}function _handleTouchEnd(e){if(null==e.pointerType||"touch"==e.pointerType){Control._toTouch=setTimeout((function(){Control._toTouch=null;Control._touching=!1}),900);if(document.querySelector("ion-app")){var t=e.target;if(closest(t,".wj-dropdown-panel,.wj-dropdown")){t.focus();e.stopPropagation();e.stopImmediatePropagation()}}}}var PrintDocument=function(){function PrintDocument(e){this._title=null;this._copyCss=!0;null!=e&&copy(this,e)}Object.defineProperty(PrintDocument.prototype,"title",{get:function(){return this._title},set:function(e){this._title=asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(PrintDocument.prototype,"copyCss",{get:function(){return this._copyCss},set:function(e){this._copyCss=asBoolean(e)},enumerable:!0,configurable:!0});PrintDocument.prototype.addCSS=function(e){this._css||(this._css=[]);this._css.push(e)};PrintDocument.prototype.append=function(e){var t=this._getDocument();if(isString(e))t.write(e);else if(e instanceof Element){e instanceof HTMLElement&&Control.refreshAll(e);for(var n=e.cloneNode(!0),r=n.querySelectorAll("input"),i=0;i<r.length;i++){var o=r[i];switch(o.type){case"checkbox":setAttribute(o,"checked",!!o.checked||null);setAttribute(o,"indeterminate",!!o.indeterminate||null);break;case"radio":setAttribute(o,"checked",!!o.checked||null);break;default:setAttribute(o,"value",o.value||null)}}t.write(n.outerHTML)}else assert(!1,"content should be an HTML string or an Element.")};PrintDocument.prototype.print=function(e){var t=this;if(this._iframe){this._close();setTimeout((function(){var n=t._iframe.contentWindow,r="onafterprint"in n&&!isFirefox();r&&(n.onafterprint=function(){t._afterPrint(e)});if(!(isIE()&&null==n.document.body)&&document.queryCommandSupported("print"))n.document.execCommand("print",!0,null);else{n.focus();n.print()}r||t._afterPrint(e)}),100)}};PrintDocument.prototype._afterPrint=function(e){document.body.removeChild(this._iframe);this._iframe=null;isFunction(e)&&e()};PrintDocument.prototype._getDocument=function(){if(!this._iframe){var e=this._iframe=document.createElement("iframe");addClass(e,exports.PrintDocumentClsNames.printDocument);setCss(e,{position:"fixed",left:32e3,top:32e3});document.body.appendChild(e)}return this._iframe.contentDocument};PrintDocument.prototype._close=function(){var e=this,t=this._getDocument();t.close();t.title=null!=this.title?this.title:document.title;t.title&&t.title.trim()||(t.title=" ");this._copyCss&&[document.head,document.body].forEach((function(t){for(var n=t.querySelectorAll("LINK"),r=0;r<n.length;r++){var i=n[r];if(i.rel.match(/stylesheet/i)&&(!i.type||i.type.match(/text\/css/i))){var o=httpRequest(i.href,{async:!1});e._addStyle(o.responseText)}}var s=t.querySelectorAll("STYLE");for(r=0;r<s.length;r++)e._addStyle(s[r].textContent)}));if(this._css)for(var n=0;n<this._css.length;n++){var r=t.createElement("style"),i=httpRequest(this._css[n],{async:!1});r.textContent=i.responseText;t.head.appendChild(r)}};PrintDocument.prototype._addStyle=function(e){var t=this._getDocument(),n=t.createElement("style");n.textContent=e;t.head.appendChild(n)};return PrintDocument}();exports.PrintDocument=PrintDocument;var Clipboard=function(){function Clipboard(){}Clipboard.copy=function(e){Clipboard._copyPaste(asString(e),null)};Clipboard.paste=function(e){e=asFunction(e);Clipboard._copyPaste(null,e)};Clipboard._copyPaste=function(e,t){for(var n=getActiveElement(),r=closest(n,"."+exports.ControlClsNames.hostElement);r&&Control.getControl(r);)r=r.parentElement;if(r=r||document.body){var i=!1,o=createElement('<textarea class="'+exports.ClipboardClsNames.clipboard+'">',r,{position:"fixed",opacity:"0"});o.onkeydown=function(e){return e.preventDefault()};o.onchange=function(e){return e.stopImmediatePropagation()};if(isString(e)){o.value=e;o.select();document.execCommand("copy")&&(i=!0)}else{o.select();if(isFunction(t)&&document.execCommand("paste")){t(o.value);i=!0}}setTimeout((function(){n.focus({preventScroll:!0});(isIE()?setTimeout:function(e,t){return e()})((function(){return removeChild(o)}),500);!i&&isFunction(t)&&t(o.value)}),Control._CLIPBOARD_DELAY)}};return Clipboard}();exports.Clipboard=Clipboard;var PopupPosition,TooltipTrigger,_ClickRepeater=function(){function _ClickRepeater(e){this._isDown=!1;this._mousedownBnd=this._mousedown.bind(this);this._mouseupBnd=this._mouseup.bind(this);this._clickBnd=this._click.bind(this);this.element=e;this._connect(!0)}Object.defineProperty(_ClickRepeater.prototype,"element",{get:function(){return this._e},set:function(e){this._connect(!1);this._e=asType(e,HTMLElement,!0);this._connect(!0)},enumerable:!0,configurable:!0});Object.defineProperty(_ClickRepeater.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=asBoolean(e)},enumerable:!0,configurable:!0});_ClickRepeater.prototype._connect=function(e){var t=this;this._e&&_ClickRepeater._startEvents.forEach((function(n){e?t._e.addEventListener(n,t._mousedownBnd,{passive:!0}):t._e.removeEventListener(n,t._mousedownBnd)}))};_ClickRepeater.prototype._clearTimeouts=function(){if(this._toRepeat){clearTimeout(this._toRepeat);this._toRepeat=null}if(this._toDelay){clearTimeout(this._toDelay);this._toDelay=null}};_ClickRepeater.prototype._mousedown=function(e){var t=this;this._isDown&&this._mouseup(null);if(!this._disabled){this._isDown=!0;_ClickRepeater._stopEvents.forEach((function(e){document.addEventListener(e,t._mouseupBnd)}));this._clearTimeouts();this._toDelay=setTimeout((function(){if(t._isDown){t._click();t._toRepeat=setTimeout(t._clickBnd,Control._CLICK_REPEAT)}}),Control._CLICK_DELAY)}};_ClickRepeater.prototype._mouseup=function(e){var t=this;this._isDown&&e&&"keydown"!=e.type&&this._clicked&&e.preventDefault();_ClickRepeater._stopEvents.forEach((function(e){document.removeEventListener(e,t._mouseupBnd)}));this._clearTimeouts();this._isDown=!1;this._clicked=!1};_ClickRepeater.prototype._click=function(){this._clicked=!0;this._clearTimeouts();if(this._e){this._e.click();this._isDown&&(this._toRepeat=setTimeout(this._clickBnd,Control._CLICK_REPEAT))}};_ClickRepeater._startEvents=["mousedown","touchstart"];_ClickRepeater._stopEvents=["mouseup","mouseout","keydown","touchend","touchcancel"];return _ClickRepeater}();exports._ClickRepeater=_ClickRepeater;!function(e){e[e.Above=0]="Above";e[e.AboveRight=1]="AboveRight";e[e.RightTop=2]="RightTop";e[e.Right=3]="Right";e[e.RightBottom=4]="RightBottom";e[e.BelowRight=5]="BelowRight";e[e.Below=6]="Below";e[e.BelowLeft=7]="BelowLeft";e[e.LeftBottom=8]="LeftBottom";e[e.Left=9]="Left";e[e.LeftTop=10]="LeftTop";e[e.AboveLeft=11]="AboveLeft"}(PopupPosition=exports.PopupPosition||(exports.PopupPosition={}));function showPopup(e,t,n,r,i,o){void 0===i&&(i=!0);var s=e.offsetHeight||e.offsetWidth,a=n;(isBoolean(n)||null==n)&&(a=n?PopupPosition.AboveLeft:PopupPosition.BelowLeft);var l=_getPopupParent(t);_addPopupToDOM(e,l);_copyPopupStyles(e,t,i);Control.refreshAll(e);_updatePopupPosition(e,t,a);isFirefox()&&requestAnimationFrame((function(){_updatePopupPosition(e,t,a)}));t instanceof HTMLElement&&(e[Control._OWNR_KEY]=t);if(!s){_hidePopupOnscroll(e,t,o);if(r)return animate((function(t){return e.style.opacity=t<1?t.toString():""}));e.style.opacity=""}return null}exports.showPopup=showPopup;function hidePopup(e,t,n){void 0===t&&(t=!0);void 0===n&&(n=!1);var r=null;n?r=animate((function(n){e.style.opacity=(1-n).toString();if(1==n){_hidePopup(e,t);e.style.opacity=""}})):_hidePopup(e,t);return r}exports.hidePopup=hidePopup;function _updatePopupPosition(e,t,n){var r=_getReferenceRect(e,t),i=_getPopupOffset(e),o=_getPopupPosition(e,r,n,i),s={position:"absolute",zIndex:Control._POPUP_ZINDEX},a=0==i.x;if(a){s.left=o.x;s.top=o.y}else s.transform="translate("+o.x+"px, "+o.y+"px)";var l=e.getBoundingClientRect().width;setCss(e,s);if(a){var u=l-e.getBoundingClientRect().width;u>0&&(e.style.left=o.x-Math.ceil(u)+"px")}}exports._updatePopupPosition=_updatePopupPosition;function _hidePopup(e,t){e.style.display="none";t&&e.parentElement&&setTimeout((function(){if("none"==e.style.display){removeChild(e);isFunction(t)&&t()}}),Control._FOCUS_INTERVAL+50);var n=e[Control._SCRL_KEY];n instanceof Control&&n.dispose();delete e[Control._SCRL_KEY];delete e[Control._OWNR_KEY]}function _isjQueryDialog(e){var t=window.jQuery,n=isFunction(t)?t(e):null;return n&&isFunction(n.dialog)&&hasClass(e,"ui-dialog")}function _getPopupParent(e){var t=document.body;if(e instanceof HTMLElement){if(!contains(document.body,e))return t;for(var n=e;n;n=n.parentElement){if("DIALOG"==n.tagName||"ION-CONTENT"==n.tagName||"fixed"==getComputedStyle(n).position){t=n;break}if(_isjQueryDialog(n)){t=n.querySelector(".ui-dialog-content")||n;break}}}return t}function _addPopupToDOM(e,t){if(!e.offsetHeight||!e.offsetWidth||e.parentElement!=t){setCss(e,{opacity:"0",position:"fixed",left:0,top:0,transform:"",display:""});t.appendChild(e)}}function _getPopupOffset(e){var t=document.body,n=document.documentElement,r=e.parentElement,i=new Point(t.scrollLeft||pageXOffset,t.scrollTop||pageYOffset);if(r!=t){var o=r==t?n:e.offsetParent||r;o==t&&(o=r);if(o){var s=o.getBoundingClientRect();i=new Point(o.scrollLeft-s.left,o.scrollTop-s.top)}}if(r instanceof HTMLElement){var a=getComputedStyle(r);i.x-=parseFloat(a.borderLeftWidth);i.y-=parseFloat(a.borderTopWidth)}return i}function _copyPopupStyles(e,t,n){if(t instanceof HTMLElement&&n){var r=n instanceof HTMLElement?n:t,i=getComputedStyle(r);1==new Color(i.backgroundColor).a&&setCss(e,{color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle})}}function _hidePopupOnscroll(e,t,n){var r=t instanceof MouseEvent?t.target:t;if(r instanceof HTMLElement&&r.parentElement!=document.body){var i=Date.now(),o=r.getBoundingClientRect(),s=new Control(document.createElement("div"));e[Control._SCRL_KEY]=s;s.addEventListener(document,"scroll",(function(a){if(a.target!=e.parentElement&&Date.now()-i>100&&contains(document,r)&&!contains(e,a.target)&&(a.target!=document||null!=t&&"fixed"==e.style.position)){var l=r.getBoundingClientRect(),u=Math.abs(l.left-o.left),c=Math.abs(l.top-o.top);if(u>1||c>1){isFunction(n)&&n();_hidePopup(e,!0);s.dispose()}}}),!0)}}function _getPopupPosition(e,t,n,r){var i=document.documentElement,o=i.clientWidth,s=i.clientHeight,a=PopupPosition;switch(n){case a.AboveLeft:case a.AboveRight:case a.BelowLeft:case a.BelowRight:if(t){var l=t.width;if(l){isIE()&&(l-=e.offsetWidth-e.clientWidth);e.style.minWidth=l+"px"}}}var u=getComputedStyle(e),c=parseFloat(u.marginTop)+parseFloat(u.marginBottom),p=parseFloat(u.marginLeft)+parseFloat(u.marginRight),h=new Size(e.offsetWidth+p,e.offsetHeight+c),f=new Point((o-h.width)/2,Math.round((s-h.height)/2*.7));if(t){"rtl"==u.direction&&(n=_getRtlPosition(n));var d=t.left,g=o-t.right;f.x=t.left;switch(n){case a.Above:case a.Below:f.x=t.left+(t.width-h.width)/2;break;case a.AboveLeft:case a.BelowLeft:f.x=t.left;break;case a.AboveRight:case a.BelowRight:f.x=t.right-h.width;break;case a.Left:case a.LeftTop:case a.LeftBottom:f.x=d>=h.width||d>=g?t.left-h.width:t.right;break;case a.RightTop:case a.RightBottom:case a.Right:f.x=g>=h.width||g>=d?t.right:t.left-h.width}var _=t.top,m=s-t.bottom;switch(n){case a.Above:case a.AboveLeft:case a.AboveRight:f.y=_>h.height||_>m?t.top-h.height:t.bottom;break;case a.Below:case a.BelowLeft:case a.BelowRight:f.y=m>h.height||m>_?t.bottom:t.top-h.height;break;case a.LeftTop:case a.RightTop:f.y=t.top;break;case a.LeftBottom:case a.RightBottom:f.y=t.bottom-h.height;break;case a.Left:case a.Right:f.y=t.bottom-h.height+(h.height-t.height)/2}}f.x=Math.min(f.x,o-h.width);f.y=Math.min(f.y,s-h.height);f.x=Math.max(0,f.x)+r.x;f.y=Math.max(0,f.y)+r.y;return f}function _getRtlPosition(e){var t=PopupPosition;switch(e){case t.AboveLeft:return t.AboveRight;case t.AboveRight:return t.AboveLeft;case t.BelowLeft:return t.BelowRight;case t.BelowRight:return t.BelowLeft;case t.Left:return t.Right;case t.LeftTop:return t.RightTop;case t.LeftBottom:return t.RightBottom;case t.Right:return t.Left;case t.RightTop:return t.LeftTop;case t.RightBottom:return t.LeftBottom}return e}function _getReferenceRect(e,t){return t instanceof MouseEvent?t.clientX<=0&&t.clientY<=0&&t.target instanceof HTMLElement?Rect.fromBoundingRect(t.target.getBoundingClientRect()):new Rect(t.pageX-pageXOffset,t.pageY-pageYOffset,0,0):t instanceof Point?new Rect(t.x,t.y,0,0):t instanceof HTMLElement?Rect.fromBoundingRect(t.getBoundingClientRect()):t&&null!=t.top&&null!=t.left?t:null}!function(e){e[e.Focus=0]="Focus";e[e.Hover=1]="Hover";e[e.Both=2]="Both"}(TooltipTrigger=exports.TooltipTrigger||(exports.TooltipTrigger={}));var Tooltip=function(){function Tooltip(e){this._showAutoTipBnd=this._showAutoTip.bind(this);this._hideAutoTipBnd=this._hideAutoTip.bind(this);this._mousemoveBnd=this._mousemove.bind(this);this._focusBnd=this._focus.bind(this);this._mousemovedocBnd=this._mousemovedoc.bind(this);this._keydownBnd=this._keydown.bind(this);this._keydownHandleBnd=this.keydownHandle.bind(this);this._html=!0;this._cssClass="";this._gap=6;this._isAnimated=!1;this._position=PopupPosition.Above;this._trigger=TooltipTrigger.Hover;this._showAtMouse=!1;this._showDelay=500;this._hideDelay=0;this._tooltipVisibleOnHover=!0;this._tips=[];this._forceRecreate=!1;this.popup=new Event;copy(this,e)}Object.defineProperty(Tooltip.prototype,"position",{get:function(){return this._position},set:function(e){this._position=asEnum(e,PopupPosition)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"trigger",{get:function(){return this._trigger},set:function(e){var t=this;this._trigger=asEnum(e,TooltipTrigger);this._tips.forEach((function(e){t._detach(e.element);t._attach(e.element)}))},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"isAnimated",{get:function(){return this._isAnimated},set:function(e){this._isAnimated=asBoolean(e)},enumerable:!0,configurable:!0});Tooltip.prototype.setTooltip=function(e,t,n){e=getElement(e);t=this._getContent(t);var r=this._indexOf(e);if(r>-1){this._detach(e);this._tips.splice(r,1)}if(t){this._attach(e);this._tips.push({element:e,content:t,position:n})}var i=Tooltip._eTip;i&&i[Control._TTIP_KEY]==e&&(t?this._setContent(t):this._hideAutoTip())};Tooltip.prototype.getTooltip=function(e){e=getElement(e);for(var t=this._tips,n=0;n<t.length;n++)if(t[n].element==e)return t[n].content;return null};Tooltip.prototype.show=function(e,t,n,r){e=getElement(e);t=this._getContent(t);if(e){null==r&&(r=this.position);document.addEventListener("keydown",this._keydownHandleBnd);var i=Tooltip._eTip;this.forceRecreate&&i&&i.remove();if(!i||this.forceRecreate){addClass(i=Tooltip._eTip=document.createElement("div"),exports.TooltipClsNames.hostElement);setAttribute(i,"aria-live","polite");i.style.visibility="none"}if(!i.isConnected){i.id=getUniqueId(e.id+"_toolTip");addAttributeValueToElement(e,"aria-describedby",i.id)}i.setAttribute("class",exports.TooltipClsNames.hostElement);this._tooltipVisibleOnHover&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&i.addEventListener("mouseleave",this._hideAutoTipBnd);addClass(i,this.cssClass);hasClass(e,exports.ControlStateClsNames.invalid)?i.setAttribute("role","alert"):i.setAttribute("role","tooltip");this._setContent(t);i[Control._TTIP_KEY]=e;var o=new TooltipEventArgs(t,e);this.onPopup(o);if(o.content&&!o.cancel){this._setContent(o.content);n||(n=Rect.fromBoundingRect(e.getBoundingClientRect()));var s=this.gap,a=PopupPosition;if(s)switch(r){case a.Above:case a.AboveLeft:case a.AboveRight:case a.Below:case a.BelowLeft:case a.BelowRight:n=n.inflate(0,s);break;default:n=n.inflate(s,0)}showPopup(i,n,r,this.isAnimated);document.addEventListener("mousedown",this._hideAutoTipBnd)}}};Tooltip.prototype.hide=function(){var e=Tooltip._eTip;if(e){removeChild(e);removeClass(e,this.cssClass);e.innerHTML="";this._tooltipVisibleOnHover&&e.removeEventListener("mouseleave",this._hideAutoTipBnd);removeAttributeValueFromElement(e[Control._TTIP_KEY],"aria-describedby",e.id)}document.removeEventListener("mousedown",this._hideAutoTipBnd);document.removeEventListener("keydown",this._keydownHandleBnd);this._tooltipVisibleOnHover&&document.removeEventListener("mousemove",this._mousemovedocBnd)};Tooltip.prototype.dispose=function(){var e=this;this.hide();var t=this._tips;if(t.length){t.forEach((function(t){e._detach(t.element)}));t.splice(0,t.length)}if(Tooltip._eTip){Tooltip._eTip[Control._TTIP_KEY]=null;Tooltip._eTip=null}this._clearTimeouts()};Object.defineProperty(Tooltip.prototype,"isVisible",{get:function(){var e=Tooltip._eTip;return null!=e&&null!=e.parentElement&&e.offsetWidth>0},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"isContentHtml",{get:function(){return this._html},set:function(e){this._html=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"cssClass",{get:function(){return this._cssClass},set:function(e){this._cssClass=asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"gap",{get:function(){return this._gap},set:function(e){this._gap=asNumber(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"showAtMouse",{get:function(){return this._showAtMouse},set:function(e){this._showAtMouse=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"showDelay",{get:function(){return this._showDelay},set:function(e){this._showDelay=asInt(e)},enumerable:!0,configurable:!0});Object.defineProperty(Tooltip.prototype,"hideDelay",{get:function(){return this._hideDelay},set:function(e){this._hideDelay=asInt(e)},enumerable:!0,configurable:!0});Tooltip.prototype.onPopup=function(e){this.popup&&this.popup.raise(this,e);return!e.cancel};Tooltip.prototype.keydownHandle=function(e){"Escape"===e.key&&this.hide()};Tooltip.prototype._indexOf=function(e){for(var t=0;t<this._tips.length;t++)if(this._tips[t].element==e)return t;return-1};Tooltip.prototype._attach=function(e){if(this._tooltipVisibleOnHover)switch(this._trigger){case TooltipTrigger.Focus:e.addEventListener("focus",this._focusBnd);e.addEventListener("keydown",this._keydownBnd);e.addEventListener("blur",this._hideAutoTipBnd);break;case TooltipTrigger.Both:e.addEventListener("mouseenter",this._showAutoTipBnd);e.addEventListener("mouseleave",this._hideAutoTipBnd);e.addEventListener("focus",this._focusBnd);e.addEventListener("keydown",this._keydownBnd);e.addEventListener("blur",this._hideAutoTipBnd);break;default:e.addEventListener("mouseenter",this._showAutoTipBnd);e.addEventListener("mouseleave",this._hideAutoTipBnd)}else{e.addEventListener("mouseenter",this._showAutoTipBnd);e.addEventListener("mouseleave",this._hideAutoTipBnd)}e.addEventListener("click",this._showAutoTipBnd);this.showAtMouse&&e.addEventListener("mousemove",this._mousemoveBnd)};Tooltip.prototype._detach=function(e){e.removeEventListener("focus",this._focusBnd);e.removeEventListener("mouseenter",this._showAutoTipBnd);e.removeEventListener("mouseleave",this._hideAutoTipBnd);e.removeEventListener("click",this._showAutoTipBnd);e.removeEventListener("mousemove",this._mousemoveBnd);e.removeEventListener("keydown",this._keydownBnd);e.removeEventListener("blur",this._hideAutoTipBnd);e.removeEventListener("mousedown",this._hideAutoTipBnd)};Tooltip.prototype._keydown=function(e,t){if("Tab"==e.key){this._clearTimeouts();this.hide()}};Tooltip.prototype._focus=function(e){e&&e.target&&this._showAutoTip(void 0,e.target)};Tooltip.prototype._showAutoTip=function(e,t){var n=this,r=this._hideDelay;if(e&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)){if(e.defaultPrevented)return;if("click"==e.type&&!Control._touching){this._hideAutoTip(e);return}var i=e&&"mouseenter"==e.type?this._showDelay:0;this._clearTimeouts();this._eMouse=e;var o=e.target;this._toShow=setTimeout((function(){var e=n._indexOf(o);if(e>-1){var t=n._tips[e],i=n._eMouse,s=n._showAtMouse?new Rect(i.clientX,i.clientY,0,0):null,a=t&&t.element;if(a&&n._hasOffset(a)){var l=Control.getControl(t.element);if(null==l||0!=l.isVisible){n.show(t.element,t.content,s,t.position);r>0&&(n._toHide=setTimeout((function(){n.hide()}),r))}}}}),i)}if(t&&[TooltipTrigger.Focus,TooltipTrigger.Both].includes(this.trigger)){i=this._showDelay;this._toShow=setTimeout((function(){var e=n._indexOf(t);if(e>-1){var i=n._tips[e],o=i&&i.element;if(o&&n._hasOffset(o)){var s=Control.getControl(i.element);if(null==s||0!=s.isVisible){n.show(i.element,i.content,null,i.position);r>0&&(n._toHide=setTimeout((function(){n.hide()}),r))}}}}),i)}};Tooltip.prototype._mousemove=function(e){this._eMouse=e};Tooltip.prototype._mousemovedoc=function(e){[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&this._checkBoundsAndHide(e,!1)};Tooltip.prototype._hideAutoTip=function(e){if(e){if(Tooltip._eTip)if(this._tooltipVisibleOnHover){"mouseleave"==e.type&&document.addEventListener("mousemove",this._mousemovedocBnd);this._checkBoundsAndHide(e,!0)}else if((this.trigger==TooltipTrigger.Hover||this.trigger==TooltipTrigger.Both)&&e&&"click"!=e.type&&"mousedown"!=e.type){this._clearTimeouts();this.hide()}}};Tooltip.prototype._checkBoundsAndHide=function(e,t){var n=Tooltip._eTip;if(n){var r=n[Control._TTIP_KEY],i=Rect.fromBoundingRect(n.getBoundingClientRect()),o=Rect.fromBoundingRect(r.getBoundingClientRect()),s=this.gap+2,a=PopupPosition,l=0;if(e){var u=this._indexOf(r);u>-1&&(l=this._tips[u]&&this._tips[u].position?this._tips[u].position:this.position);switch(l){case a.Above:case a.AboveLeft:case a.AboveRight:o=o.inflate(0,s,0,0);break;case a.Below:case a.BelowLeft:case a.BelowRight:o=o.inflate(0,0,0,s);break;case a.Left:case a.LeftTop:case a.LeftBottom:o=o.inflate(s,0,0,0);break;case a.Right:case a.RightTop:case a.RightBottom:o=o.inflate(0,0,s,0)}var c=e,p=!0;n.getClientRects().length>0&&null!=c&&(p=!(c.clientX>=i.left&&c.clientX<=i.right&&c.clientY>=i.top&&c.clientY<=i.bottom));var h=!0;null!=c&&(h=!(c.clientX>=o.left&&c.clientX<=o.right&&c.clientY>=o.top&&c.clientY<=o.bottom));if(p&&h||"blur"==e.type){t&&this._clearTimeouts();this.hide()}}}};Tooltip.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHide){clearTimeout(this._toHide);this._toHide=null}if(this._forScreenReader){clearTimeout(this._forScreenReader);this._forScreenReader=null}};Tooltip.prototype._getContent=function(e){if((e=asString(e))&&"#"==e[0]){var t=getElement(e);t&&(e=t.innerHTML)}return e};Tooltip.prototype._setContent=function(e){var t=Tooltip._eTip;t&&(this._html?t.innerHTML=e:t.textContent=e)};Tooltip.prototype._hasOffset=function(e){var t=new Size(e.offsetWidth,e.offsetHeight);if(e instanceof SVGGraphicsElement){var n=e.getBBox();t.width=n.width;t.height=n.height}return t.width>0||t.height>0};Object.defineProperty(Tooltip.prototype,"forceRecreate",{get:function(){return this._forceRecreate},set:function(e){this._forceRecreate=e},enumerable:!0,configurable:!0});return Tooltip}();exports.Tooltip=Tooltip;var TooltipEventArgs=function(e){__extends(TooltipEventArgs,e);function TooltipEventArgs(t,n){var r=e.call(this)||this;r._content=asString(t);r._e=n;return r}Object.defineProperty(TooltipEventArgs.prototype,"tip",{get:function(){return Tooltip._eTip},enumerable:!0,configurable:!0});Object.defineProperty(TooltipEventArgs.prototype,"element",{get:function(){return this._e},enumerable:!0,configurable:!0});Object.defineProperty(TooltipEventArgs.prototype,"content",{get:function(){return this._content},set:function(e){this._content=asString(e)},enumerable:!0,configurable:!0});return TooltipEventArgs}(CancelEventArgs);exports.TooltipEventArgs=TooltipEventArgs;_registerModule("wijmo",selfModule);var theLic="The Wijmo license in this application ",_licStr={evl:"Wijmo Evaluation Version ({version})",prd:theLic+"is not valid for the <b>{control}</b> control.",ver:theLic+"is not valid for the version in use. The license version is <b>{licVer}</b>; the product version is <b>{version}</b>.",dmn:theLic+"is not valid for the current domain. The license domain is <b>{licDomain}</b>; the current domain is <b>{domain}</b>.",exp:theLic+"has expired. The license expiration date is <b>{expDate:d}</b>.",lic:theLic+"is invalid.",mss:theLic+"is not set.",ctc:'If you are a customer, you can <a target="_blank" rel="noopener" href="https://developer.mescius.com/licensing/wijmo?utm_source=Wijmo-In-App&utm_medium=Click-to-Site&utm_campaign=Wijmo-User-Analysis">create a license</a> online. Otherwise, you can <a target="_blank" rel="noopener" href="https://developer.mescius.com/wijmo/request-trial-key?utm_source=Wijmo-In-App&utm_medium=Click-to-Site&utm_campaign=Wijmo-User-Analysis">generate a 30-day license</a> for free. For further assistance, contact MESCIUS: <a href="mailto:us.sales@mescius.com">us.sales@mescius.com</a>.',hdr:"Wijmo License",cls:"CLOSE"},_codes={};function _updateWme(e,t){var n=Control._wme;if(!(n&&contains(document.body,n)&&n.offsetWidth&&n.offsetHeight))if(t){var r=_getControlCode(e);if(!_codes[r]){_codes[r]=!0;_attorn(t,{algorithmCode:"B0",publicKey:"l6/zrbWoSbcLFwEetFh38rH3ErBZE9H+Cqix3R+wTlfA1wD5B+lUcCQn+EJ60I4RGrm0x1sFjkiLWwB0jAn6BWZv0W4WbqAKriOdeoivxDp1Wmjs3qkEDhvbsjPtfvwx2BHil6o+/tDrdMJQSGs18WZm2PoQLQuL+9VhZ4FNRHUQU3Jtioke/OZEGHJOdYVwvCGalzBad6QFOiVbDBQPePpS3++GJzOxN8SN/7lyS5/IdKiy3WJRaVGkB370+HbN6hKraDfUgReLX26yxRaKC/5aWnGAJ2NnWLoGyAGRcwT9dVjo4bcAZNrrA0U9JVKQxaSskhdv2p49XzJkltXx5w=="},(function(n){_checkLicense(e,t,n);delete _codes[r]}),(function(){_checkLicense(e,t,null);delete _codes[r]}))}}else _checkLicense(e,null,null)}exports._updateWme=_updateWme;function _getControlCode(e){return e._getProductInfo().split(",")[0]}function _getControlName(e){return e._getProductInfo().split(",")[1]}function _checkLicense(e,t,n){var r=exports.culture.Licensing||_licStr,i=null;n?_checkExpiration(e,n)?_checkVersion(e,n)?_checkDomain(e,n)?_checkProductCode(e,n)?_checkEval(e,n)&&(i=r.evl):i=r.prd:i=r.dmn:i=r.ver:i=r.exp:i=t?r.lic:r.mss;i&&_addWme(e,i+="<br/><br/>"+r.ctc,n)}function _checkProductCode(e,t){var n=_getControlCode(e);if(n&&n.length>=4)for(var r=0;r<t.Prd.length;r++)if(t.Prd[r].C.indexOf(n)>-1)return!0;return!1}function _checkExpiration(e,t){if(t.Exp){var n=t.Exp,r=new Date(parseInt(n.substr(0,4))||0,parseInt(n.substr(4,2))-1||0,parseInt(n.substr(6,2))||0);if(Math.ceil((r.valueOf()-Date.now())/864e5)<=0)return!1}return!0}function _checkVersion(e,t){var n=t.Anl?t.Anl.ver:null,r=getVersion();if(n&&r){return parseInt(n.replace("v",""))+10>=parseInt(r.split(".")[1])}return!0}function _checkDomain(e,t){if(_isLocalHost()||!t.Dms)return!0;for(var n=location.hostname,r=t.Dms.split(","),i=0;i<r.length;i++)if(_checkHost(n,r[i]))return!0;return!1}function _checkHost(e,t){var n="^"+t.replace(/\./g,"\\.").replace(/\*/g,"(.*)")+"$",r=new RegExp(n,"i").test(e);return r||"*."!=t.substr(0,2)?r:_checkHost(e,t.substr(2))}function _checkEval(e,t){return!!t&&t.Evl}function _isLocalHost(){var e=location,t=atob("Xih8bG9jYWxob3N0fGZpZGRsZS5qc2hlbGwubmV0fHJ1bi5wbG5rci5jb3xzLmNvZGVwZW4uaW98bnVsbC5qc2Jpbi5jb218Lio/LnN0YWNrYmxpdHouaW98MTI3LjAuMC4xfFt3LV0rLmxvY2FsfFt3LV0rfDo6MSkk");return"file:"==e.protocol||new RegExp(t,"i").test(e.hostname)}function _addWme(e,t,n){t=_getMessage(e,t,n);if(!_codes[" "]&&!_isLocalHost()&&!_checkEval(e,n)){_codes[" "]=!0;var r=exports.culture.Licensing||_licStr,i=createElement('<div style="position:fixed;background:rgba(0,0,0,0.3);left:0;top:0;width:100%;height:100%;font-family: sans-serif;z-index:10000;"><div style="position:relative;overflow:auto;background:white;width:450px;padding:36pt;left:50%;top:50%;transform:translate(-50%,-50%)"><div><p style="font-size:150%;font-weight:bold">'+r.hdr+"</p><p>"+t+'</p></div><div style="text-align:right;margin-top:24pt"><button style="border:none;background:rgba(158,158,158,.2);padding:8px 16px">'+r.cls+"</button></div></div></div>",document.body);i.addEventListener("click",(function(e){e.target instanceof HTMLButtonElement&&removeChild(i)}))}if(!Control._wme){var o=createElement('<div><a href="'+_getWmeHref()+'" target="_blank" rel="noopener">'+_getMessage(e)+"</a></div>"),s={position:"fixed",display:"block",visibility:"visible",background:"rgba(240,240,240,.9)",padding:"8px 12px",margin:"6px",fontFamily:"sans-serif",fontSize:"14pt",fontWeight:"bold",zIndex:1e4,opacity:.8,height:"auto",width:"auto",transform:"none"};switch(Math.round(100*Math.random())%3){case 0:s.right=s.bottom=0;break;case 1:s.left=s.bottom=0;break;case 2:s.right=s.top=0}setCss(o,s);document.body.appendChild(o);Control._wme=o;_addClickableTooltip(o,t)}}function _addClickableTooltip(e,t){var n,r=createElement(t);r.className=exports.TooltipClsNames.hostElement;setCss(r,{pointerEvents:"auto",padding:"10px",margin:"6px"});[e,r].forEach((function(e){e.addEventListener("mouseenter",(function(){return trackMouse(!0)}));e.addEventListener("mouseleave",(function(){return trackMouse(!1)}))}));var i=0;function trackMouse(t){i+=t?1:-1;n&&clearTimeout(n);n=setTimeout((function(){n=null;1==i?showPopup(r,e.getBoundingClientRect()):i<1&&hidePopup(r)}),500)}}function _getWmeHref(){switch(exports.culture.Globalize.name){case"ja":return"https://developer.mescius.jp/wijmo/about-license";case"ko":return"https://www.mescius.co.kr/wijmo#price";default:return"https://developer.mescius.com/licensing/wijmo?utm_source=Wijmo-In-App&utm_medium=Click-to-Site&utm_campaign=Wijmo-User-Analysis"}}function _getMessage(e,t,n){if(!t||t.trim().length<15){t=(exports.culture.Licensing||_licStr).evl}(!t||t.trim().length<15)&&(t=atob("V2lqbW8gRXZhbHVhdGlvbiBWZXJzaW9uICh7dmVyc2lvbn0p"));var r=null;if(n&&n.Exp){var i=n.Exp;r=new Date(parseInt(i.substr(0,4))||0,parseInt(i.substr(4,2))-1||0,parseInt(i.substr(6,2))||0)}return t=format(t,{version:getVersion(),domain:location.hostname,control:_getControlName(e),licVer:n&&n.Anl?"5."+n.Anl.ver.replace("v","")+".*":null,licDomain:n?n.Dms:null,expDate:r})}function _attorn(e,t,n,r){var i=parseKeyData(e,t.algorithmCode);if(!i)return r();var o=i.lic,s=i.prefix+"#"+t.algorithmCode;if(tripleHash(s+JSON.stringify(o.D))!=o.H)return r();var a=window.msCrypto||window.crypto,l=a?a.subtle:null;if(!l||!location.protocol.match(/^https/i))return n(o.D);var u={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},c={alg:"RS256",e:"AQAB",kty:"RSA",n:str64ToJwkBase64(t.publicKey)};c=window.msCrypto?str2ArrayBuffer(JSON.stringify(c)):c;try{asPromise(l.importKey("jwk",c,u,!1,["verify"])).then((function(e){var t=arrayBuffer2Str(str64ToArrayBuffer(str64EncodeUnicode(s+JSON.stringify(o.D))));asPromise(l.verify(u,e,str64ToArrayBuffer(o.S),str2ArrayBuffer(t))).then((function(e){return e?n(o.D):r()}))}),(function(){return n(o.D)}))}catch(e){return n(o.D)}}var templateObject_1,uint8Array="undefined"==typeof window?null:window.Uint8Array||window.TypedArray;function parseKeyData(e,t){try{t="#"+t;var n=e.indexOf(t);if(n>-1)return{prefix:e.substring(0,n),lic:JSON.parse(decode(e.substr(n+t.length)))}}catch(e){}return null}function decode(e){if(!e)return"";var t=unshiftString(e);t=reverseString(t);var n=Math.ceil(t.length/2);return str64DecodeUnicode(t=(t=(t=t.substr(n)+t.substr(0,n)).replace("#","=")).replace("&","=="))}function unshiftString(e){for(var t=e.split(""),n=t.length-5;n>=0;n--){swapArrayElements(t,n+1,n+3,unshiftChar);swapArrayElements(t,n,n+2,unshiftChar)}return t.join("")}function swapArrayElements(e,t,n,r){e.length>1&&e.splice(n,1,r(e.splice(t,1,r(e[n]))[0]))}function shiftChar(e,t){var n=e.charCodeAt(0);return n>=65&&n<=90?e.toLowerCase():n>=97&&n<=122?e.toUpperCase():n>=48&&n<=57?String.fromCharCode(48+(n-48+10+t)%10):e}function unshiftChar(e){return shiftChar(e,-1)}function reverseString(e){return e.split("").reverse().join("")}function str64DecodeUnicode(e){for(var t=atob(e),n="",r=0;r<t.length;r++)n+="%"+("00"+t.charCodeAt(r).toString(16)).slice(-2);return decodeURIComponent(n)}function arrayBuffer2Str(e){return String.fromCharCode.apply(null,new uint8Array(e))}function str64ToArrayBuffer(e){for(var t=atob(e),n=t.length,r=new uint8Array(n),i=0;i<n;i++)r[i]=t.charCodeAt(i);return r.buffer}function str64EncodeUnicode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})))}function str64ToJwkBase64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")}function str2ArrayBuffer(e){for(var t=new ArrayBuffer(e.length),n=new uint8Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}function tripleHash(e){for(var t=0,n=5381,r=0,i=e.length-1;i>=0;i--){var o=e.charCodeAt(i);t=o+(t<<6)+(t<<16)-t;n=o+((n<<5)+n);r=o+((r<<5)-r)}var s=t^n^r;s<0&&(s=~s);return s.toString(16).toUpperCase()}function asPromise(e){if("oncomplete"in e){e.then=function(t,n){e.resolve=t;e.reject=n};e.oncomplete=function(t){e.resolve(e.result)};e.onerror=function(t){e.reject()}}return e}