@mescius/wijmo 5.20252.44 → 5.20261.45-nightly.d20260105.t014601

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/es2015-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20252.44
3
+ * Wijmo Library 5.20261.45-nightly.d20260105.t014601
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
- import*as selfModule from"@mescius/wijmo";function _ipTools(){const t={};var e="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"$"),"i"),threeOctet:new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"$"),"i"),twoOctet:new RegExp("^".concat(e,"\\.").concat(e,"$"),"i"),longValue:new RegExp("^".concat(e,"$"),"i")},r=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),n="(?:[0-9a-f]+::?)+",o={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?(".concat(n,")?([0-9a-f]+)?(::)?(").concat("%[0-9a-z]{1,}",")?$"),"i"),deprecatedTransitional:new RegExp("^(?:::)(".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"(").concat("%[0-9a-z]{1,}",")?)$"),"i"),transitional:new RegExp("^((?:".concat(n,")|(?:::)(?:").concat(n,")?)").concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"(").concat("%[0-9a-z]{1,}",")?$"),"i")};function expandIPv6(t,e){if(t.indexOf("::")!==t.lastIndexOf("::"))return null;var i,r,s=0,n=-1,a=(t.match(o.zoneIndex)||[])[0];if(a){a=a.substring(1);t=t.replace(/%.+$/,"")}for(;(n=t.indexOf(":",n+1))>=0;)s++;"::"===t.substr(0,2)&&s--;"::"===t.substr(-2,2)&&s--;if(s>e)return null;r=e-s;i=":";for(;r--;)i+="0:";":"===(t=t.replace("::",i))[0]&&(t=t.slice(1));":"===t[t.length-1]&&(t=t.slice(0,-1));return{parts:e=function(){for(var e=t.split(":"),i=[],r=0;r<e.length;r++)i.push(parseInt(e[r],16));return i}(),zoneId:a}}function matchCIDR(t,e,i,r){if(t.length!==e.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(var s,n=0;r>0;){(s=i-r)<0&&(s=0);if(t[n]>>s!=e[n]>>s)return!1;r-=i;n+=1}return!0}function parseIntAuto(t){if(s.test(t))return parseInt(t,16);if("0"===t[0]&&!isNaN(parseInt(t[1],10))){if(r.test(t))return parseInt(t,8);throw new Error("ipaddr: cannot parse ".concat(t," as octal"))}return parseInt(t,10)}function padPart(t,e){for(;t.length<e;)t="0".concat(t);return t}t.IPv4=function(){function IPv4(t){if(4!==t.length)throw new Error("ipaddr: ipv4 octet count should be 4");var e,i;for(e=0;e<t.length;e++)if(!(0<=(i=t[e])&&i<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=t}IPv4.prototype.SpecialRanges={unspecified:[[new IPv4([0,0,0,0]),8]],broadcast:[[new IPv4([255,255,255,255]),32]],multicast:[[new IPv4([224,0,0,0]),4]],linkLocal:[[new IPv4([169,254,0,0]),16]],loopback:[[new IPv4([127,0,0,0]),8]],carrierGradeNat:[[new IPv4([100,64,0,0]),10]],private:[[new IPv4([10,0,0,0]),8],[new IPv4([172,16,0,0]),12],[new IPv4([192,168,0,0]),16]],reserved:[[new IPv4([192,0,0,0]),24],[new IPv4([192,0,2,0]),24],[new IPv4([192,88,99,0]),24],[new IPv4([198,51,100,0]),24],[new IPv4([203,0,113,0]),24],[new IPv4([240,0,0,0]),4]]};IPv4.prototype.kind=function(){return"ipv4"};IPv4.prototype.match=function(t,e){var i;if(void 0===e){t=(i=t)[0];e=i[1]}if("ipv4"!==t.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return matchCIDR(this.octets,t.octets,8,e)};IPv4.prototype.prefixLengthFromSubnetMask=function(){var t,e,i,r=0,s=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};for(t=3;t>=0;t-=1){if(!((e=this.octets[t])in n))return null;i=n[e];if(s&&0!==i)return null;8!==i&&(s=!0);r+=i}return 32-r};IPv4.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)};IPv4.prototype.toByteArray=function(){return this.octets.slice(0)};IPv4.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:".concat(this.toString()))};IPv4.prototype.toNormalizedString=function(){return this.toString()};IPv4.prototype.toString=function(){return this.octets.join(".")};return IPv4}();t.IPv4.broadcastAddressFromCIDR=function(t){try{for(var e=this.parseCIDR(t),i=e[0].toByteArray(),r=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),s=[],n=0;n<4;){s.push(parseInt(i[n],10)|255^parseInt(r[n],10));n++}return new this(s)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};t.IPv4.isIPv4=function(t){return null!==this.parser(t)};t.IPv4.isValid=function(t){try{new this(this.parser(t));return!0}catch(t){return!1}};t.IPv4.isValidFourPartDecimal=function(e){return!(!t.IPv4.isValid(e)||!e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))};t.IPv4.networkAddressFromCIDR=function(t){var e,i,r,s,n;try{r=(e=this.parseCIDR(t))[0].toByteArray();n=this.subnetMaskFromPrefixLength(e[1]).toByteArray();s=[];i=0;for(;i<4;){s.push(parseInt(r[i],10)&parseInt(n[i],10));i++}return new this(s)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};t.IPv4.parse=function(t){var e=this.parser(t);if(null===e)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(e)};t.IPv4.parseCIDR=function(t){var e;if(e=t.match(/^(.+)\/(\d+)$/)){var i=parseInt(e[2]);if(i>=0&&i<=32){var r=[this.parse(e[1]),i];Object.defineProperty(r,"toString",{value:function value(){return this.join("/")}});return r}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")};t.IPv4.parser=function(t){var e,r,s;if(e=t.match(i.fourOctet))return function(){for(var t=e.slice(1,6),i=[],s=0;s<t.length;s++){r=t[s];i.push(parseIntAuto(r))}return i}();if(e=t.match(i.longValue)){if((s=parseIntAuto(e[1]))>4294967295||s<0)throw new Error("ipaddr: address outside defined range");return function(){var t,e=[];for(t=0;t<=24;t+=8)e.push(s>>t&255);return e}().reverse()}return(e=t.match(i.twoOctet))?function(){var t=e.slice(1,4),i=[];if((s=parseIntAuto(t[1]))>16777215||s<0)throw new Error("ipaddr: address outside defined range");i.push(parseIntAuto(t[0]));i.push(s>>16&255);i.push(s>>8&255);i.push(255&s);return i}():(e=t.match(i.threeOctet))?function(){var t=e.slice(1,5),i=[];if((s=parseIntAuto(t[2]))>65535||s<0)throw new Error("ipaddr: address outside defined range");i.push(parseIntAuto(t[0]));i.push(parseIntAuto(t[1]));i.push(s>>8&255);i.push(255&s);return i}():null};t.IPv4.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(var e=[0,0,0,0],i=0,r=Math.floor(t/8);i<r;){e[i]=255;i++}r<4&&(e[r]=Math.pow(2,t%8)-1<<8-t%8);return new this(e)};t.IPv6=function(){function IPv6(t,e){var i,r;if(16===t.length){this.parts=[];for(i=0;i<=14;i+=2)this.parts.push(t[i]<<8|t[i+1])}else{if(8!==t.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=t}for(i=0;i<this.parts.length;i++)if(!(0<=(r=this.parts[i])&&r<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");e&&(this.zoneId=e)}IPv6.prototype.SpecialRanges={unspecified:[new IPv6([0,0,0,0,0,0,0,0]),128],linkLocal:[new IPv6([65152,0,0,0,0,0,0,0]),10],multicast:[new IPv6([65280,0,0,0,0,0,0,0]),8],loopback:[new IPv6([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new IPv6([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new IPv6([0,0,0,0,0,65535,0,0]),96],rfc6145:[new IPv6([0,0,0,0,65535,0,0,0]),96],rfc6052:[new IPv6([100,65435,0,0,0,0,0,0]),96],"6to4":[new IPv6([8194,0,0,0,0,0,0,0]),16],teredo:[new IPv6([8193,0,0,0,0,0,0,0]),32],reserved:[[new IPv6([8193,3512,0,0,0,0,0,0]),32]]};IPv6.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()};IPv6.prototype.kind=function(){return"ipv6"};IPv6.prototype.match=function(t,e){var i;if(void 0===e){t=(i=t)[0];e=i[1]}if("ipv6"!==t.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return matchCIDR(this.parts,t.parts,16,e)};IPv6.prototype.prefixLengthFromSubnetMask=function(){for(var t,e,i=0,r=!1,s={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},n=7;n>=0;n-=1){if(!((t=this.parts[n])in s))return null;e=s[t];if(r&&0!==e)return null;16!==e&&(r=!0);i+=e}return 128-i};IPv6.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)};IPv6.prototype.toByteArray=function(){for(var t,e=[],i=this.parts,r=0;r<i.length;r++){t=i[r];e.push(t>>8);e.push(255&t)}return e};IPv6.prototype.toFixedLengthString=function(){var t=function(){for(var t=[],e=0;e<this.parts.length;e++)t.push(padPart(this.parts[e].toString(16),4));return t}.call(this).join(":"),e="";this.zoneId&&(e="%".concat(this.zoneId));return t+e};IPv6.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");var e=this.parts.slice(-2),i=e[0],r=e[1];return new t.IPv4([i>>8,255&i,r>>8,255&r])};IPv6.prototype.toNormalizedString=function(){var t=function(){for(var t=[],e=0;e<this.parts.length;e++)t.push(this.parts[e].toString(16));return t}.call(this).join(":"),e="";this.zoneId&&(e="%".concat(this.zoneId));return t+e};IPv6.prototype.toRFC5952String=function(){for(var t,e=/((^|:)(0(:|$)){2,})/g,i=this.toNormalizedString(),r=0,s=-1;t=e.exec(i);)if(t[0].length>s){r=t.index;s=t[0].length}return s<0?i:"".concat(i.substring(0,r),"::").concat(i.substring(r+s))};IPv6.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")};return IPv6}();t.IPv6.broadcastAddressFromCIDR=function(t){try{for(var e=this.parseCIDR(t),i=e[0].toByteArray(),r=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),s=[],n=0;n<16;){s.push(parseInt(i[n],10)|255^parseInt(r[n],10));n++}return new this(s)}catch(t){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(t,")"))}};t.IPv6.isIPv6=function(t){return null!==this.parser(t)};t.IPv6.isValid=function(t){if("string"==typeof t&&-1===t.indexOf(":"))return!1;try{var e=this.parser(t);new this(e.parts,e.zoneId);return!0}catch(t){return!1}};t.IPv6.networkAddressFromCIDR=function(t){var e,i,r,s,n;try{r=(e=this.parseCIDR(t))[0].toByteArray();n=this.subnetMaskFromPrefixLength(e[1]).toByteArray();s=[];i=0;for(;i<16;){s.push(parseInt(r[i],10)&parseInt(n[i],10));i++}return new this(s)}catch(t){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(t,")"))}};t.IPv6.parse=function(t){var e=this.parser(t);if(null===e.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(e.parts,e.zoneId)};t.IPv6.parseCIDR=function(t){var e,i,r;if((i=t.match(/^(.+)\/(\d+)$/))&&(e=parseInt(i[2]))>=0&&e<=128){r=[this.parse(i[1]),e];Object.defineProperty(r,"toString",{value:function value(){return this.join("/")}});return r}throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")};t.IPv6.parser=function(t){var e,i,r,s,n,a;if(r=t.match(o.deprecatedTransitional))return this.parser("::ffff:".concat(r[1]));if(o.native.test(t))return expandIPv6(t,8);if(r=t.match(o.transitional)){a=r[6]||"";if((e=expandIPv6(r[1].slice(0,-1)+a,6)).parts){n=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])];for(i=0;i<n.length;i++)if(!(0<=(s=n[i])&&s<=255))return null;e.parts.push(n[0]<<8|n[1]);e.parts.push(n[2]<<8|n[3]);return{parts:e.parts,zoneId:e.zoneId}}}return null};t.IPv6.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>128)throw new Error("ipaddr: invalid IPv6 prefix length");for(var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=0,r=Math.floor(t/8);i<r;){e[i]=255;i++}r<16&&(e[r]=Math.pow(2,t%8)-1<<8-t%8);return new this(e)};t.fromByteArray=function(e){var i=e.length;if(4===i)return new t.IPv4(e);if(16===i)return new t.IPv6(e);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")};t.isValid=function(e){return t.IPv6.isValid(e)||t.IPv4.isValid(e)};t.parse=function(e){if(t.IPv6.isValid(e))return t.IPv6.parse(e);if(t.IPv4.isValid(e))return t.IPv4.parse(e);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")};t.parseCIDR=function(e){try{return t.IPv6.parseCIDR(e)}catch(i){try{return t.IPv4.parseCIDR(e)}catch(t){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}};t.process=function(t){var e=this.parse(t);return"ipv6"===e.kind()&&e.isIPv4MappedAddress()?e.toIPv4Address():e};t.subnetMatch=function(t,e,i){var r,s,n,o;null==i&&(i="unicast");for(s in e)if(Object.prototype.hasOwnProperty.call(e,s)){!(n=e[s])[0]||n[0]instanceof Array||(n=[n]);for(r=0;r<n.length;r++){o=n[r];if(t.kind()===o[0].kind()&&t.match.apply(t,o))return s}}return i};return t}export const ipaddr=_ipTools();export class Binding{constructor(t){this.path=t}get path(){return this._path}set path(t){this._path=t;this._parts=t?t.split("."):[];for(let t=0;t<this._parts.length;t++){let e=this._parts[t],i=e.indexOf("[");if(i>-1){this._parts[t]=e.substr(0,i);this._parts.splice(++t,0,parseInt(e.substr(i+1)))}}this._key=1==this._parts.length?this._parts[0]:null}getValue(t){if(t){if(this._key)return t[this._key];if(this._path&&this._path in t)return t[this._path];for(let e=0;e<this._parts.length&&t;e++)t=t[this._parts[e]]}return t}setValue(t,e){if(t)try{let i=this._path;if(i in t){t[i]=e;return t[i]==e}for(let e=0;e<this._parts.length-1;e++)if(null==(t=t[this._parts[e]]))return!1;i=this._parts[this._parts.length-1];t[i]=e;return t[i]==e}catch(t){return!1}return!1}}class EventHandler{constructor(t,e){this.handler=t;this.self=e}}export class Event{constructor(t){this._handlers=[];this._handlersChanged=t}addHandler(t,e){t=asFunction(t);this._handlers.push(new EventHandler(t,e));isFunction(this._handlersChanged)&&this._handlersChanged()}getHandler(t=0){const e=this._handlers[t];if(e)return e.handler}removeHandler(t,e){let i=!1;t=asFunction(t);for(let r=0;r<this._handlers.length;r++){let s=this._handlers[r];if(!(s.handler!=t&&null!=t||s.self!=e&&null!=e)){this._handlers.splice(r--,1);i=!0;if(t&&e)break}}i&&isFunction(this._handlersChanged)&&this._handlersChanged()}removeAllHandlers(){let t=this._handlers.length>0;this._handlers.length=0;t&&isFunction(this._handlersChanged)&&this._handlersChanged()}raise(t,e=EventArgs.empty){let i=this._handlers;for(let r=0;r<i.length;r++){let s=i[r];s.handler.call(s.self,t,e);i[r]!==s&&r--}}get hasHandlers(){return this._handlers.length>0}get handlerCount(){return this._handlers.length}}export class EventArgs{}EventArgs.empty=new EventArgs;export class CancelEventArgs extends EventArgs{constructor(){super(...arguments);this.cancel=!1}}export class PropertyChangedEventArgs extends EventArgs{constructor(t,e,i){super();this._name=t;this._oldVal=e;this._newVal=i}get propertyName(){return this._name}get oldValue(){return this._oldVal}get newValue(){return this._newVal}}export class RequestErrorEventArgs extends CancelEventArgs{constructor(t,e){super();this._xhr=t;this._msg=e}get request(){return this._xhr}get message(){return this._msg}set message(t){this._msg=t}}export var NotifyCollectionChangedAction;!function(t){t[t.Add=0]="Add";t[t.Remove=1]="Remove";t[t.Change=2]="Change";t[t.Reset=3]="Reset"}(NotifyCollectionChangedAction||(NotifyCollectionChangedAction={}));export class NotifyCollectionChangedEventArgs extends EventArgs{constructor(t=NotifyCollectionChangedAction.Reset,e=null,i=-1){super();this.action=t;this.item=e;this.index=i}}NotifyCollectionChangedEventArgs.reset=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);export class SortDescription{constructor(t,e){this._bnd=new Binding(t);this._asc=e}get property(){return this._bnd.path}get ascending(){return this._asc}}export class PageChangingEventArgs extends CancelEventArgs{constructor(t){super();this.newPageIndex=t}}export class GroupDescription{groupNameFromItem(t,e){return""}namesMatch(t,e){return t===e}}export class PropertyGroupDescription extends GroupDescription{constructor(t,e){super();this._bnd=new Binding(t);this._converter=e}get propertyName(){return this._bnd.path}groupNameFromItem(t,e){return this._converter?this._converter(t,this.propertyName):this._bnd.getValue(t)}namesMatch(t,e){return t===e}}export const empty={};export const ClipboardClsNames={clipboard:"wj-clipboard"};export const ControlClsNames={content:"wj-content",hostElement:"wj-control",template:"wj-template"};export const 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"};export const 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"};export const 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"};export const PrintDocumentClsNames={printDocument:"wj-printdocument"};export const TooltipClsNames={hostElement:"wj-tooltip"};export const 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"};export const 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"}};const _agent="undefined"!=typeof navigator?navigator.userAgent:"";export function isMobile(){const t=_agent.toLowerCase();return["android","webos","iphone","ipad","ipod","blackberry","windows phone","mobile","mobi","tablet"].some(e=>t.includes(e))}export function isSupportTouch(){return"ontouchstart"in window||navigator.maxTouchPoints>0}const _isiOS=null!=_agent.match(/iPad|iPhone|iPod/i);export function isiOS(){return _isiOS}const _isFF=null!=_agent.match(/Firefox\//);export function isFirefox(){return _isFF}const _isSafari=null!=_agent.match(/^((?!Chrome|Android).)*safari/i);export function isSafari(){return _isSafari}const _isEdge=null!=_agent.match(/Edge\/|Edg\//);export function isEdge(){return _isEdge}const _isIE=null!=_agent.match(/MSIE |Trident\/|Edge\//);export function isIE(){return _isIE}let _isIE9=!1;export function isIE9(){return _isIE9}let _isIE10=!1;export function isIE10(){return _isIE10}let _isChromiumBased=null;export function isChromiumBased(){if(null!=_isChromiumBased)return _isChromiumBased;{_isChromiumBased=!1;const t="undefined"!=typeof navigator?navigator.userAgentData:null;if(t&&t.brands)for(let e of t.brands)if("Chromium"==e.brand){_isChromiumBased=!0;break}return _isChromiumBased}}let _supportsPassive=!1;"undefined"!=typeof document&&document.addEventListener("test",t=>{},{get passive(){_supportsPassive=!0;return!0}});export function getEventOptions(t,e){return _supportsPassive?{capture:t,passive:e}:t}var _supportsFocusOptions=!1;"undefined"!=typeof document&&document.createElement("div").focus({get preventScroll(){_supportsFocusOptions=!0;return!0}});export function supportsFocusOptions(){return _supportsFocusOptions}export function _startDrag(t,e){t.effectAllowed=e;isFirefox()&&t.setData("text","")}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",t=>{if(1==t.which){let e=closest(t.target,"."+ControlClsNames.hostElement);if(e&&!e.style.cursor)for(let e=t.target;e;e=e.parentElement)if(e.attributes&&e.attributes.draggable){e.dragDrop();return!1}}})}}if("undefined"!=typeof window){let t="requestAnimationFrame",e="cancelAnimationFrame";if(!window[t]){let i=0;window[t]=t=>{let e=Date.now(),r=16-(e-i),s=r>0?r:0;i=e+s;return setTimeout(()=>{t(i)},s)};window[e]=clearTimeout}if(!window.atob){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e=new RegExp("[^"+t+"]");window.atob=i=>{let r,s,n,o,a=[],l=0,h=i.length;if(e.test(i)||/=/.test(i)&&(/=[^=]/.test(i)||/={3}/.test(i)))throw new Error("Invalid base64 data");h%4>0&&(h=(i+=Array(4-h%4+1).join("=")).length);for(;l<h;){for(s=[],o=l;l<o+4;)s.push(t.indexOf(i.charAt(l++)));r=(s[0]<<18)+(s[1]<<12)+((63&s[2])<<6)+(63&s[3]);n=[(r&255<<16)>>16,64===s[2]?-1:(65280&r)>>8,64===s[3]?-1:255&r];for(o=0;o<3;++o)(n[o]>=0||0===o)&&a.push(String.fromCharCode(n[o]))}return a.join("")};window.btoa=e=>{let i,r,s=[],n=0,o=e.length;for(;n<o;){r=[e.charCodeAt(n++),e.charCodeAt(n++),e.charCodeAt(n++)];i=(r[0]<<16)+((r[1]||0)<<8)+(r[2]||0);s.push(t.charAt((i&63<<18)>>18),t.charAt((258048&i)>>12),t.charAt(isNaN(r[1])?64:(4032&i)>>6),t.charAt(isNaN(r[2])?64:63&i))}return s.join("")}}}export class _FocusService{constructor(){this._hasDoc="undefined"!=typeof Document;this._ae=this._nativeAe();let t=window,e=this._onBlur.bind(this),i=this._onFocus.bind(this);t.addEventListener("focusout",e,!0);t.addEventListener("focusin",i,!0);if(!isIE()){t.addEventListener("blur",e,!0);t.addEventListener("focus",i,!0)}}get activeElement(){let t=this._ae,e=this._nativeAe();t===_FocusService._noAe?t=this._ae=e:t!=e&&(this._isSpecialRoot(t)||document.body.contains(t)||(t=this._ae=e));return t!==_FocusService._noAe?t:null}_onBlur(t){if(t.isTrusted){let e=t.relatedTarget;this._ae=this._isSpecialRoot(e)?this._nativeAe():e}}_onFocus(t){t.isTrusted&&(this._ae=this._nativeAe())}_isSpecialRoot(t){return null==t||t===document.body||this._hasDoc&&t instanceof Document}_nativeAe(){let t;try{t="unknown"!=typeof document.activeElement?document.activeElement:_FocusService._noAe}catch(e){t=_FocusService._noAe}return t}dispose(){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={};const _getProxyTarget="undefined"!=typeof window&&window.Symbol?Symbol("_getProxyTarget"):"\t_get\tProxy\tTarget\t";export function _getCalculatedArray(t,e,i){let r=new WeakMap;if(!i){let e={};if(t.length){let r=t[0];for(let t in r){let i=typeof r[t];e[t]="string"==i?"":"number"==i?0:null}i=e}}return new Proxy(t,{get(t,s){if(s===_getProxyTarget)return t;if("string"==typeof s||"number"==typeof s){if("indexOf"==s)return(e,i)=>{let r=t.indexOf(e,i);r<0&&e&&(e=e[_getProxyTarget])&&(r=t.indexOf(e,i));return r};let n=parseInt(s);if(!isNaN(n)){let s=t[n];if(s&&!s[_getProxyTarget]){let t=r.get(s);if(!t){t=_createItemProxy(s,e,i);r.set(s,t)}s=t}return s}}return Reflect.get(t,s)}})}function _createItemProxy(t,e,i){if(!t[_getProxyTarget]){if(isIE())for(let i in e)t[i]=null;let r={get:(t,r,s)=>{if(r===_getProxyTarget)return t;if("constructor"===r)return()=>Object.assign({},i||{});let n=e[r];if(n)switch(typeof n){case"function":return n(s);case"string":return _eval(n,s)}return t[r]}};if(!isIE()){r.ownKeys=t=>Object.keys(t).concat(Object.keys(e));r.getOwnPropertyDescriptor=(t,i)=>i in e?{enumerable:!0,configurable:!0,writable:!1}:Reflect.getOwnPropertyDescriptor(t,i)}t=new Proxy(t,r)}return t}export function _getTargetObject(t){return(t?t[_getProxyTarget]:null)||t}function _eval(t,e){let i=[e];return new Function(...["$"],"return "+t)(...i)}var _VERSION="5.20252.44";export class _ENV_TOOLS{}_ENV_TOOLS.isSameInstance=(t,e)=>t==e;_ENV_TOOLS.indexOf=(t,e)=>t.indexOf(e);export const _CLS_STATE_DISABLED=ControlStateClsNames.disabled;export function getVersion(){return _VERSION}export function setLicenseKey(t){Control._licKey=t}export var Key;!function(t){t[t.Back=8]="Back";t[t.Tab=9]="Tab";t[t.Enter=13]="Enter";t[t.Escape=27]="Escape";t[t.Space=32]="Space";t[t.PageUp=33]="PageUp";t[t.PageDown=34]="PageDown";t[t.End=35]="End";t[t.Home=36]="Home";t[t.Left=37]="Left";t[t.Up=38]="Up";t[t.Right=39]="Right";t[t.Down=40]="Down";t[t.Delete=46]="Delete";t[t.X=88]="X";t[t.F1=112]="F1";t[t.F2=113]="F2";t[t.F3=114]="F3";t[t.F4=115]="F4";t[t.F5=116]="F5";t[t.F6=117]="F6";t[t.F7=118]="F7";t[t.F8=119]="F8";t[t.F9=120]="F9";t[t.F10=121]="F10";t[t.F11=122]="F11";t[t.F12=123]="F12";t[t.PlusKey=107]="PlusKey";t[t.EqualPlusKey=187]="EqualPlusKey";t[t.MinusKey=109]="MinusKey";t[t.HyphenMinusKey=189]="HyphenMinusKey";t[t.S=83]="S";t[t.P=80]="P";t[t.F=70]="F"}(Key||(Key={}));export var DataType;!function(t){t[t.Object=0]="Object";t[t.String=1]="String";t[t.Number=2]="Number";t[t.Boolean=3]="Boolean";t[t.Date=4]="Date";t[t.Array=5]="Array"}(DataType||(DataType={}));export function tryCast(t,e){return null==t?null:isString(e)?isFunction(t.implementsInterface)&&t.implementsInterface(e)?t:null:t instanceof e?t:null}export function isPrimitive(t){return isString(t)||isNumber(t)||isBoolean(t)||isDate(t)}export function isString(t){return"string"==typeof t}export function isNullOrWhiteSpace(t){return!t||!/\S/.test(t)}export function isNumber(t){return"number"==typeof t}export function isInt(t){return isNumber(t)&&t==Math.round(t)}export function isBoolean(t){return"boolean"==typeof t}export function isFunction(t){return"function"==typeof t}export function isUndefined(t){return void 0===t}export function isNullOrUndefined(t){return null==t}export function isDate(t){return(t instanceof Date||"[object Date]"===Object.prototype.toString.call(t))&&!isNaN(t.getTime())}export function isArray(t){return t instanceof Array||Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)}export function _isPlainArray(t){return Array.isArray(t)}export function isObject(t){return null!=t&&"object"==typeof t&&!isDate(t)&&!isArray(t)}export function isEmpty(t){for(var e in t)return!1;return!0}export function _areObjectsEqual(t,e){const i=Object.entries(t),r=Object.entries(e);if(i.length!==r.length)return!1;for(const[t,r]of i)if(!e.hasOwnProperty(t)||e[t]!==r)return!1;return!0}export function getUniqueId(t){let e=t;for(let i=0;null!=document.getElementById(e);i++)e=t+i;return e}export function getSafeUniqueId(t,e="wj",i){let r=t;r=r.trim().toLowerCase();r=r.replace(/[^a-z0-9_-]+/g,"-");r=r.replace(/-+/g,"-").replace(/^-|-$/g,"");r?/^[a-z]/.test(r)&&!i||(r=`${e}-${r}`):r=`${e}-${Date.now()}`;for(let t=0;null!=document.getElementById(r);t++)r+=t;return r}export function uidGenerator(){for(var t="",e="0123456789abcdef".split(""),i=0;i<32;i++){var r=Math.floor(16*Math.random());switch(i){case 8:t+="-";break;case 12:r=4;t+="-";break;case 16:r=3&r|8;t+="-";break;case 20:t+="-"}t+=e[r]}return t}export function mouseToPage(t){if(t instanceof Point)return t;t&&t.touches&&t.touches.length>0&&(t=t.touches[0]);if(isNumber(t.clientX)&&isNumber(t.clientY))return new Point(t.clientX+pageXOffset,t.clientY+pageYOffset);throw"Mouse or touch event expected."}export function getType(t){return isNumber(t)?DataType.Number:isBoolean(t)?DataType.Boolean:isDate(t)?DataType.Date:isString(t)?DataType.String:isArray(t)?DataType.Array:DataType.Object}export function getTypes(t,e=1e3){if(!t)return[];const i=t.length;(e<=0||i<e)&&(e=i);const r=[];if(e){const i=Object.keys(t[0]),s={},n=[...i];for(let i=0;i<e;i++){const e=t[i];for(let r=n.length-1;r>=0;r--){const o=n[r],a=e[o];if(isPrimitive(a)){let e=Object.getOwnPropertyDescriptor(t[i],o);s[o]={binding:o,dataType:getType(a),isReadOnly:e&&!e.writable&&!e.set};n.splice(r,1)}}if(!n.length)break}for(let t=0;t<i.length;t++){const e=s[i[t]];e&&r.push(e)}}return r}export function changeType(t,e,i,r){if(null!=t){let s=DataType;if(isString(t))switch(e){case s.Number:let e=Globalize.parseFloat(t,i);return isNaN(e)?t:e;case s.Date:let n=Globalize.parseDate(t,i,isDate(r)?r:null);n||i||!t||(n=new Date(t));return n&&isFinite(n.getTime())?n:t;case s.Boolean:switch(t.toLowerCase()){case"true":return!0;case"false":return!1}return t;case s.Array:try{let e=t.split(",").map(t=>(t=t.trim()).match(/^(\+|\-)?\d+\.?\d*$/)?t:'"'+t+'"');return JSON.parse("["+e.join(",")+"]")}catch(t){}}if(e==DataType.String)return Globalize.format(t,i)}return t}export function toFixed(t,e,i){if(i){let i=t.toString(),r=i.indexOf("e"),s=i.indexOf(".");if(r>-1){if("-"===i[r+1]){let n=parseFloat(i.substr(r+2)),o=i.substr(0,r);s>-1&&(o=o.substr(0,s)+o.substr(s+1));i="0."+(Array(n).join("0")+o).substr(0,e);t=parseFloat(i)}}else if(s>-1){i=i.substr(0,s+1+e);t=parseFloat(i)}}else{let i=Math.pow(10,e);t=Math.round(t*i)/i}return t}export function format(t,e,i){if((t=asString(t)).match(/\{.*"count".*:.*"when".*:.*\}/))try{let i=JSON.parse(t);if(isString(i.count)){let r=e[i.count],s=i.when;if(isNumber(r)&&isObject(s)){let e=s[r]||s.other;isString(e)&&(t=e)}}}catch(t){}return t.replace(/\{(.*?)(:(.*?))?\}/g,(t,r,s,n)=>{let o=t;if(r&&"{"!=r[0]&&e){o=new Binding(r).getValue(e);n&&(o=Globalize.format(o,n));i&&(o=i(e,r,n,o))}return null==o?"":o})}export function glbz(...t){let e=[],i=-1;t[0].forEach((r,s)=>{if(s>0&&s!=i){let n=t[s],o=r.match(/^:([a-z][0-9]*\b)/i)||r.match(/^:'(.+?)'/)||r.match(/^:"(.+?)"/);if(o){n=Globalize.format(n,o[1]);r=r.substr(o[0].length)}else if(":"==r&&s<t.length-1&&(isNumber(n)||isDate(n))){n=Globalize.format(n,t[s+1]);r="";i=s+1}e.push(n)}r&&e.push(r)});return e.join("")}export function evalTemplate(t,e){if(isIE()){let i=/:\${([^}]*)}/g,r=/\${([^}]*)}(:(([A-Za-z]\d*)|"([^"]+)"|'([^']+)'))?/g;return(t=t.replace(i,(t,i)=>":"+_evalExpression(i,e))).replace(r,(t,i,r,s,n,o,a)=>{let l=_evalExpression(i,e);return s?Globalize.format(l,n||o||a):l})}return _evalExpression(t,e)}function _evalExpression(t,e){(e=e||{}).glbz=glbz;const i=parseTpl(t,e);return isIE()?i:glbz`${i}`}function get(t,e,i=`\${${t}}`){return t.split(".").reduce((t,e)=>null!=t&&null!=t[e]?t[e]:i,e)}function parseTpl(t,e,i){return t.replace(/\$\{.+?}/g,t=>get(t.substr(2,t.length-3).trim(),e,i))}export function clamp(t,e,i){if(null!=t){null!=i&&t>i&&(t=i);null!=e&&t<e&&(t=e)}return t}export function copy(t,e,i=!0,r=!1){if(e)for(let s in e)if("_"!=s[0]){assert(s in t,'Unknown property "'+s+'".');let n=e[s];if(!t._copy||!t._copy(s,n)){const e=t[s];t[s]instanceof Event?isFunction(n)&&t[s].addHandler(n):!i||!isObject(n)||"undefined"!=typeof Element&&n instanceof Element||!e||!isObject(e)||Object.getPrototypeOf(e).constructor==Object.prototype.constructor&&isWritable(t,s)||"itemsSource"==s?r&&isObject(n)&&Object.getPrototypeOf(n).isPrototypeOf(Object)&&isObject(e)&&!Object.getPrototypeOf(e).isPrototypeOf(Object)?copy(e,n):t[s]=n:copy(e,n)}}return t}export function _isPlainObject(t){return isObject(t)&&Object.getPrototypeOf(t).isPrototypeOf(Object)}export function isWritable(t,e){const i=Object.getOwnPropertyDescriptor(t,e)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||{};return!!i.writable||isFunction(i.set)}export function deepClone(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t)){return t.map(t=>deepClone(t))}const e={};for(const i in t)t.hasOwnProperty(i)&&(e[i]=deepClone(t[i]));return e}export function assert(t,e,i=!0){if(!t){e="** Assertion failed in Wijmo: "+e;let t=new Error;isString(t.stack)&&i&&(e+=" "+t.stack);throw e}}export function _deprecated(t,e){console.error('** WARNING: "'+t+'" has been deprecated; please use "'+e+'" instead.')}export function _warning(t){console.error('** WARNING: "'+t)}export function asString(t,e=!0){isUndefined(t)&&(t=null);assert(e&&null==t||isString(t),"String expected.");return t}export function asNumber(t,e=!1,i=!1){assert(e&&null==t||isNumber(t),"Number expected.");if(i&&t&&t<0)throw"Positive number expected.";return t}export function asInt(t,e=!1,i=!1){assert(e&&null==t||isInt(t),"Integer expected.");if(i&&t&&t<0)throw"Positive integer expected.";return t}export function asBoolean(t,e=!1){assert(e&&null==t||isBoolean(t),"Boolean expected.");return t}export function asDate(t,e=!1){if(isString(t)){let e=changeType(t,DataType.Date,"r");isDate(e)&&(t=e)}assert(e&&null==t||isDate(t),"Date expected.");return t}export function asFunction(t,e=!0){assert(e&&null==t||isFunction(t),"Function expected.");return t}export function asArray(t,e=!0){assert(e&&null==t||isArray(t),"Array expected.");return t}export function asType(t,e,i=!1){t=tryCast(t,e);assert(i||null!=t,e+" expected.");return t}export function asEnum(t,e,i=!1){if(null==t&&i)return null;let r=isString(t)?e[t]:t;assert(null!=r,'Invalid enum value: "'+t+'"');return isNumber(r)?r:t}export function asCollectionView(t,e=!0){if(null==t&&e)return null;let i=tryCast(t,"ICollectionView");if(null!=i)return i;isArray(t)||assert(!1,"Array or ICollectionView expected.");return new CollectionView(t)}export function hasItems(t){return null!=t&&null!=t.items&&t.items.length>0}export function toHeaderCase(t){return t&&t.length?t[0].toUpperCase()+t.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""}export function escapeHtml(t){t&&isString(t)&&(t=t.replace(/[&<>]/g,t=>_ENTITYMAP[t]));return null!=t?t.toString():""}const _ENTITYMAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_specialCharsRegex=/"(.*?)"|[^\w]|_/g;export function getSpecialCharsRegex(){return _specialCharsRegex}export function escapeRegExp(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}export function toPlainText(t){let e=asString(t);if(isString(e)&&e.indexOf("<")>-1){_plainText||(_plainText=document.createElement("div"));_plainText.innerHTML=e;e=_plainText.textContent}return e}var _plainText;export function hasClass(t,e){if(t&&e){if(t instanceof HTMLElement&&t.classList&&!isIE9())return t.classList.contains(e);if(t.getAttribute){let i=new RegExp("(\\s|^)"+e+"(\\s|$)");return t&&i.test(t.getAttribute("class"))}}return!1}export function addClass(t,e=""){if(t&&e){let i=e.trim();if(t instanceof HTMLElement&&t.classList&&!isIE9()){i.indexOf(" ")<0?t.classList.add(i):i.split(" ").forEach(e=>{e.length>0&&t.classList.add(e)});return}t.setAttribute&&i.split(" ").forEach(e=>{if(e.length>0&&!hasClass(t,e)){let i=t.getAttribute("class");t.setAttribute("class",i?i+" "+e:e)}})}}export function removeClass(t,e){if(t&&e){let i=e.trim();if(t instanceof HTMLElement&&t.classList&&!isIE9()){i.indexOf(" ")<0?t.classList.remove(i):i.split(" ").forEach(e=>{e.length>0&&t.classList.remove(e)});0===t.classList.length&&t.removeAttribute("class");return}t.setAttribute&&i.split(" ").forEach(e=>{if(hasClass(t,e)){let i=new RegExp("((\\s|^)"+e+"(\\s|$))","g"),r=t.getAttribute("class");r=r.replace(i," ").replace(/ +/g," ").trim();r?t.setAttribute("class",r):t.removeAttribute("class")}})}}export function toggleClass(t,e,i){null==i&&(i=!hasClass(t,e));i?addClass(t,e):removeClass(t,e)}export function setAttribute(t,e,i,r){t&&(null!=i?r&&t.getAttribute(e)||("style"===e.toLowerCase()&&(t instanceof HTMLElement||t instanceof SVGElement)?t.style.cssText=i.toString():t.setAttribute(e,i.toString())):t.removeAttribute(e))}export function setInnerHTMLSafe(t,e){e=e.replace(/\bstyle\s*=/gi,"data-wj-style=");t.innerHTML=e;const i=t.querySelectorAll("[data-wj-style]");for(let t=0;t<i.length;t++){const e=i[t],r=e.getAttribute("data-wj-style");r&&(e instanceof HTMLElement||e instanceof SVGElement)&&(e.style.cssText=r);e.removeAttribute("data-wj-style")}}export function setChecked(t,e){let i=null==e;t.checked=isIE()?e||i:e;t.indeterminate=i}export function setAriaLabel(t,e){setAttribute(t,"aria-label",e)}export function setSelectionRange(t,e,i=e,r=!0){assert(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected");if(contains(document.body,t)&&!t.disabled&&t.offsetHeight){try{t.setSelectionRange(e,i,"backward")}catch(t){}if(r)try{t.focus();return!0}catch(t){}}return!1}export function disableAutoComplete(t){let e="autocomplete",i=t.getAttribute(e);i&&"on"!=i||t.setAttribute(e,"off");"autocorrect,autocapitalize,spellcheck".split(",").forEach(e=>{t.setAttribute(e,"spellcheck"==e?"false":"off")})}export function removeChild(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}export function getActiveElement(){let t=document.activeElement;if(t){let e=t.shadowRoot;e&&e.activeElement&&(t=e.activeElement)}return t}export function _getActiveElement(t){let e=t;if(e){let t=e.shadowRoot;t&&t.activeElement&&(e=t.activeElement)}return e}export function moveFocus(t,e){let i=_getFocusableElements(t,e<0),r=0;if(e){let t=i.indexOf(getActiveElement());t>-1&&(r=(t+e+i.length)%i.length)}if(r<i.length){let t=i[r];t.focus();t instanceof HTMLInputElement&&t.select();return!0}return!1}export function _getFocusableElements(t,e=!1){let i=[],r=Array.prototype.slice.call(t.querySelectorAll("input,select,textarea,button,a,div,label,[tabindex]")),s={};r=r.filter(t=>-1!==t.tabIndex);const isRb=t=>t instanceof HTMLInputElement&&"radio"===t.type;r.forEach(t=>{isRb(t)&&t.checked&&(s[t.name||""]=!0)});r=r.filter(t=>!isRb(t)||t.checked||!s[t.name||""]);r.sort((t,e)=>t.tabIndex===e.tabIndex?0:0===t.tabIndex?1:0===e.tabIndex?-1:t.tabIndex-e.tabIndex);for(let t=0;t<r.length;t++){let s=r[t];if(s.offsetHeight>0&&s.tabIndex>-1&&!s.disabled&&"hidden"!==window.getComputedStyle(s).visibility&&!closest(s,"[disabled],."+ControlStateClsNames.disabled)){if(s instanceof HTMLAnchorElement&&!s.hasAttribute("href"))continue;if(isIE()&&!s.hasAttribute("tabindex")){if(s instanceof HTMLDivElement)continue;let t=Control.getControl(closest(s,".wj-flexgrid"));if(t&&0==t.keyActionTab)continue}if("radio"===s.type&&!s.checked&&i.length>0){let t=i[i.length-1],r=getActiveElement();if("radio"===t.type&&t.name===s.name){e&&t!=r&&(i[i.length-1]=s);continue}}(Control.getControl(s)||!_getFocusableElements(s).length||s.classList.contains("wj-detail"))&&i.push(s)}}return i}export function saveFile(t,e,i="text/plain"){let r=t instanceof Blob;r||!i.match(/\bcsv\b/i)&&!e.match(/\.csv$/i)||(t="\ufeff"+t);let s=r?t:new Blob([t],{type:i});const n=navigator;if(isFunction(n.msSaveOrOpenBlob))n.msSaveOrOpenBlob(s,e);else{var o=document.createElement("a"),click=t=>{let e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null);t.dispatchEvent(e)};if("download"in o){let t=window.URL||window.webkitURL,i=t.createObjectURL(s);o.href=i;o.target="_blank";o.download=e;click(o);o=null;window.setTimeout(()=>{t.revokeObjectURL(i)},3e4)}else{let t=new FileReader;t.onloadend=()=>{o.href=t.result;o.download=e;click(o);o=null};t.readAsDataURL(s)}}}export function getElement(t){if(t instanceof Element||t&&t.appendChild&&t.appendChild instanceof Function)return t;if(isString(t))try{return document.querySelector(t)}catch(t){}return t&&t.jquery?t[0]:null}function processStyleProperty(t){let e=(t=t.replace(";base64,","_wj_")).split(";"),i=[];e.forEach(t=>{let e=[];if(t.indexOf("_wj_")>-1){e=(t=t.replace("_wj_",";base64,").replace("data:image","_wjimg_")).split(":");2==e.length&&(e[1]=e[1].replace("_wjimg_","data:image"))}else e=t.split(":");i.push(e)});return i}export function createElement(t,e,i){t=t.replace(/\bstyle\s*=/gi,"_wj-style=");let r=document.createElement("div");r.innerHTML=t;if(t.indexOf("_wj-style")>-1){const t=r.querySelectorAll("[_wj-style]");for(let e=0;e<t.length;e++){let i=t[e],r=i.getAttribute("_wj-style"),s=[];if(r.indexOf(";base64,")>-1)s=processStyleProperty(r);else{r.split(";").forEach(t=>{s.push(t.split(":"))})}s.forEach(t=>{2==t.length&&(i.style[t[0].trim()]=t[1].trim())});i.removeAttribute("_wj-style")}}1==r.children.length&&(r=r.children[0]);i&&setCss(r,i);e&&(e=getElement(e)).appendChild(r);return r}export function setText(t,e){t.textContent=e||""}export function contains(t,e,i){for(let r=e;r&&t;){if(r===t)return!0;r=(i?r[Control._OWNR_KEY]:null)||r.parentNode||r.host}return!1}export function closest(t,e){if(t){if(isFunction(t.closest))return t.closest(e);let i=t.matches||t.webkitMatchesSelector||t.msMatchesSelector||t.mozMatchesSelector;if(i)for(;t&&1===t.nodeType;t=t.parentElement||t.parentNode)if(i.call(t,e))return t}return null}export function closestClass(t,e){return closest(t,"."+e)}export function enable(t,e){let i=!e,r="disabled";toggleClass(t,ControlStateClsNames.disabled,i);setAttribute(t,r,i?r:null);let s=t.querySelectorAll("input,button");for(let t=0;t<s.length;t++)setAttribute(s[t],r,i?r:null)}export function getElementRect(t){let e=t.getBoundingClientRect();return new Rect(e.left+pageXOffset,e.top+pageYOffset,e.width,e.height)}export function setCss(t,e){assert(isObject(e),"css parameter should be an object");if(t instanceof Array)for(let i=0;i<t.length;i++)setCss(t[i],e);else if(t&&t.style){let i=t.style;for(let t in e){let r=e[t];"number"==typeof r&&t.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(r+="px");i[t]!==r&&(i[t]=r)}}}export function animate(t,e,i,r){null==e&&(e=Control._ANIM_DEF_DURATION);null==i&&(i=Control._ANIM_DEF_STEP);t=asFunction(t);e=asNumber(e,!1,!0);i=asNumber(i,!1,!0);let s,n=Date.now(),o=setInterval(()=>{let i=Math.min(1,(Date.now()-n)/e);i=Math.sin(i*Math.PI/2);i*=i;s&&cancelAnimationFrame(s);s=requestAnimationFrame(()=>{s=null;t(i);i>=1&&r&&r()});i>=1&&clearInterval(o)},i);return o}export class Point{constructor(t=0,e=0){this.x=asNumber(t);this.y=asNumber(e)}equals(t,e=0,i=0){return t instanceof Point&&Math.abs(this.x-t.x)<=e&&Math.abs(this.y-t.y)<=i}clone(){return new Point(this.x,this.y)}}export class Size{constructor(t=0,e=0){this.width=asNumber(t);this.height=asNumber(e)}equals(t){return t instanceof Size&&this.width==t.width&&this.height==t.height}clone(){return new Size(this.width,this.height)}}export class Rect{constructor(t,e,i,r){this.left=asNumber(t);this.top=asNumber(e);this.width=asNumber(i);this.height=asNumber(r)}get right(){return this.left+this.width}get bottom(){return this.top+this.height}equals(t){return t instanceof Rect&&this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height}clone(){return new Rect(this.left,this.top,this.width,this.height)}static fromBoundingRect(t){if(null!=t.left)return new Rect(t.left,t.top,t.width,t.height);if(null!=t.x)return new Rect(t.x,t.y,t.width,t.height);assert(!1,"Invalid source rectangle.")}static union(t,e){let i=Math.min(t.left,e.left),r=Math.min(t.top,e.top),s=Math.max(t.right,e.right),n=Math.max(t.bottom,e.bottom);return new Rect(i,r,s-i,n-r)}static intersection(t,e){let i=Math.max(t.left,e.left),r=Math.max(t.top,e.top),s=Math.min(t.right,e.right),n=Math.min(t.bottom,e.bottom);return new Rect(i,r,s-i,n-r)}contains(t){if(t instanceof Point)return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom;if(t instanceof Rect){let e=t;return e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom}assert(!1,"Point or Rect expected.")}inflate(t,e,i,r){return null!=i&&null!=r?new Rect(this.left-t,this.top-e,this.width+t+i,this.height+e+r):new Rect(this.left-t,this.top-e,this.width+2*t,this.height+2*e)}}export class DateTime{static addDays(t,e){(t=new Date(t.getTime())).setDate(t.getDate()+e);return t}static addMonths(t,e){var i=(t=new Date(t.getTime())).getDate();t.setMonth(t.getMonth()+e);t.getDate()!=i&&t.setDate(0);return t}static addYears(t,e){(t=new Date(t.getTime())).setFullYear(t.getFullYear()+e);return t}static addHours(t,e){(t=new Date(t.getTime())).setHours(t.getHours()+e);return t}static addMinutes(t,e){(t=new Date(t.getTime())).setMinutes(t.getMinutes()+e);return t}static addSeconds(t,e){(t=new Date(t.getTime())).setSeconds(t.getSeconds()+e);return t}static weekFirst(t,e=Globalize.getFirstDayOfWeek()){return DateTime.addDays(t,-(t.getDay()-e))}static weekLast(t,e=Globalize.getFirstDayOfWeek()){t=DateTime.weekFirst(t,e);return DateTime.addDays(t,6)}static monthFirst(t){return DateTime.addDays(t,1-t.getDate())}static monthLast(t){t=DateTime.monthFirst(t);t=DateTime.addMonths(t,1);return DateTime.addDays(t,-1)}static yearFirst(t){return new Date(t.getFullYear(),0,1)}static yearLast(t){return new Date(t.getFullYear(),11,31)}static sameDate(t,e){return isDate(t)&&isDate(e)&&t.getFullYear()==e.getFullYear()&&t.getMonth()==e.getMonth()&&t.getDate()==e.getDate()}static sameTime(t,e){return isDate(t)&&isDate(e)&&t.getHours()==e.getHours()&&t.getMinutes()==e.getMinutes()&&t.getSeconds()==e.getSeconds()&&t.getMilliseconds()==e.getMilliseconds()}static equals(t,e){return null==t&&null==e||isDate(t)&&isDate(e)&&t.getTime()==e.getTime()}static fromDateTime(t,e){if(!t&&!e)return null;t||(t=e);e||(e=t);return DateTime.newDate(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static toFiscal(t,e){let i=culture.Globalize.calendar;return isArray(i.fiscalYearOffsets)?DateTime.addMonths(t,-i.fiscalYearOffsets[e?0:1]):t}static fromFiscal(t,e){let i=culture.Globalize.calendar;return isArray(i.fiscalYearOffsets)?DateTime.addMonths(t,+i.fiscalYearOffsets[e?0:1]):t}static newDate(t,e,i,r,s,n,o){if(null==t||null==e||null==i){let r=new Date;null==t&&(t=r.getFullYear());null==e&&(e=r.getMonth());null==i&&(i=r.getDate())}null==r&&(r=0);null==s&&(s=0);null==n&&(n=0);null==o&&(o=0);let a=new Date(t,e,i,r,s,n,o),l=a.getFullYear();t<100&&l>=1900&&a.setFullYear(a.getFullYear()-1900);return a}static clone(t){return DateTime.fromDateTime(t,t)}}export function httpRequest(t,e){let i=e||{},r=i.method?asString(i.method).toUpperCase():"GET",s=null==i.async||asBoolean(i.async),n=i.data;if(null!=n&&"GET"==r){let e=[];for(let t in n){let i=n[t];isDate(i)&&(i=i.toJSON());e.push(t+"="+encodeURIComponent(i))}if(e.length){let i=t.indexOf("?")<0?"?":"&";t+=i+e.join("&")}n=null}let o=new XMLHttpRequest;o.URL_DEBUG=t;let a=!1;if(null!=n&&!isString(n)){a=isObject(n);n=JSON.stringify(n)}o.onload=function(){if(4==o.readyState){o.status<300?i.success&&asFunction(i.success)(o):i.error&&asFunction(i.error)(o);i.complete&&asFunction(i.complete)(o)}};o.onerror=function(){if(!isFunction(i.error))throw"HttpRequest Error: "+o.status+" "+o.statusText;i.error(o)};o.open(r,t,s,i.user,i.password);i.user&&i.password&&o.setRequestHeader("Authorization","Basic "+btoa(i.user+":"+i.password));a&&(()=>{for(let t in i.requestHeaders)if("content-type"===t.toLowerCase())return!1;return!0})()&&o.setRequestHeader("Content-Type","application/json");if(i.requestHeaders)for(let t in i.requestHeaders)o.setRequestHeader(t,i.requestHeaders[t]);isNumber(i.timeout)&&(o.timeout=i.timeout);isFunction(i.beforeSend)&&i.beforeSend(o);o.send(n);return o}let _modules={};export function _registerModule(t,e){_modules[t]=e;if("wijmo"===t){let t="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;t&&(t.wijmo=e)}}export function _getModule(t){return _modules[t]}export function focusFirst(t,e){const i=t.querySelectorAll(e||'button, [href], input, [tabindex]:not([tabindex="-1"])'),r=Array.from(i).filter(t=>t.offsetWidth>0&&t.offsetHeight>0&&!t.hasAttribute("disabled")&&t.tabIndex>=0);if(r.length>0){r[0].focus();return!0}return!1}export const cellCoordinateParserRegex=new RegExp(/(\'?\w+\'?\!)?(\$?[A-Za-z]+)(\$?\d+)/,"g");export function getScrollableParent(t){const e=document.scrollingElement;let i="absolute"==getComputedStyle(t).position?t.offsetParent:t.parentElement;for(;i&&i!=e;){if(i.clientHeight!=i.scrollHeight)return i;i="absolute"==getComputedStyle(i).position?i.offsetParent:i.parentElement;t=i}return e}export function getOffsetFromAncestor(t,e){let i=0,r=0,s=0,n=0;for(;t;){r+=t.offsetLeft;i+=t.offsetTop;t=t.offsetParent}for(;e;){n+=e.offsetLeft;s+=e.offsetTop;e=e.offsetParent}return{top:i-s,left:r-n}}export function _isMacOS(){return-1!==navigator.userAgent.indexOf("Mac")}export function _setAriaLabelBy(t,e,i,r){let s=""===i?null:i;if(s!==t.ariaLabelledBy){t._ariaLabelledby=s;setAttribute(e,"aria-labelledby",s);r&&r()}}export function deepElementFromPoint(t,e){let i=document.elementFromPoint(t,e);for(;i&&i.shadowRoot;){const r=i.shadowRoot.elementFromPoint(t,e);if(!r||r===i)break;i=r}return i}export function roundTo(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}export function addAttributeValueToElement(t,e,i){const r=t.getAttribute(e);if(r){if(!r.split(/\s+/).includes(i)){setAttribute(t,e,r+" "+i)}}else setAttribute(t,e,i)}export function removeAttributeValueFromElement(t,e,i){const r=t.getAttribute(e);if(!r)return;const s=i.toString(),n=r.split(/\s+/).filter(t=>t!==s);n.length>0?t.setAttribute(e,n.join(" ")):t.removeAttribute(e)}export function replaceItems(t,e){const i=new Map(e.map(t=>[""+t.value,t]));return t.map(t=>{const e=""+t.value;return i.has(e)?i.get(e):t})}export function _getTextDecorations(t){const e=[];if(t){t.underline&&e.push("underline");t.strikethrough&&e.push("line-through")}return e.length?e.join(" "):"none"}export class _Map{constructor(t=!0){if(t)this._h={};else{let t=_getGlobal(),e=t&&t.Map;this._m=e&&new Map||new _ArrayMap}}get isPojoHash(){return null!=this._h}get size(){return this._h&&Object.keys(this._h).length||this._m.size}clear(){this._h?this._h={}:this._m.clear()}delete(t){this._h?delete this._h[t]:this._m.delete(t)}get(t){return this._h?this._h[t]:this._m.get(t)}has(t){return this._h?t in this._h:this._m.has(t)}set(t,e){this._h?this._h[t]=e:this._m.set(t,e);return this}}class _ArrayMap{constructor(){this._d=[]}get size(){return this._d.length}clear(){this._d=[]}delete(t){let e=this._kIdx(t);if(e>-1){this._d.splice(e,1);return!0}return!1}get(t){let e=this._kIdx(t);return e>-1?this._d[e].v:void 0}has(t){return this._kIdx(t)>-1}set(t,e){let i=this._kIdx(t);i>-1?this._d[i].v=e:this._d.push({k:t,v:e});return this}_kIdx(t){let e=this._d,i=e.length;if(t==t){for(let r=0;r<i;r++)if(e[r].k===t)return r}else for(let t=0;t<i;t++){let i=e[t].k;if(i!=i)return t}return-1}}function _getGlobal(){let t=null;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self);return t}export class Color{constructor(t){this._r=0;this._g=0;this._b=0;this._a=1;t&&this._parse(t)}get r(){return this._r}set r(t){this._r=clamp(asNumber(t),0,255)}get g(){return this._g}set g(t){this._g=clamp(asNumber(t),0,255)}get b(){return this._b}set b(t){this._b=clamp(asNumber(t),0,255)}get a(){return this._a}set a(t){this._a=clamp(asNumber(t),0,1)}equals(t){return t instanceof Color&&this.r==t.r&&this.g==t.g&&this.b==t.b&&this.a==t.a}toString(){let t=Math.round(100*this.a);return t>99?"#"+((1<<24)+(this.r<<16)+(this.g<<8)+this.b).toString(16).slice(1):"rgba("+this.r+","+this.g+","+this.b+","+t/100+")"}static fromRgba(t,e,i,r=1){let s=new Color(null);s.r=Math.round(clamp(asNumber(t),0,255));s.g=Math.round(clamp(asNumber(e),0,255));s.b=Math.round(clamp(asNumber(i),0,255));s.a=clamp(asNumber(r),0,1);return s}static fromHsb(t,e,i,r=1){let s=Color._hsbToRgb(clamp(asNumber(t),0,1),clamp(asNumber(e),0,1),clamp(asNumber(i),0,1));return Color.fromRgba(s[0],s[1],s[2],r)}static fromHsl(t,e,i,r=1){let s=Color._hslToRgb(clamp(asNumber(t),0,1),clamp(asNumber(e),0,1),clamp(asNumber(i),0,1));return Color.fromRgba(s[0],s[1],s[2],r)}static fromString(t){let e=new Color(null);return e._parse(asString(t))?e:null}getHsb(){return Color._rgbToHsb(this.r,this.g,this.b)}getHsl(){return Color._rgbToHsl(this.r,this.g,this.b)}static interpolate(t,e,i){i=clamp(asNumber(i),0,1);let r=Color._rgbToHsl(t.r,t.g,t.b),s=Color._rgbToHsl(e.r,e.g,e.b),n=1-i,o=t.a*n+e.a*i,a=[r[0]*n+s[0]*i,r[1]*n+s[1]*i,r[2]*n+s[2]*i],l=Color._hslToRgb(a[0],a[1],a[2]);return Color.fromRgba(l[0],l[1],l[2],o)}static toOpaque(t,e){if(1==(t=isString(t)?Color.fromString(t):asType(t,Color)).a)return t;e=null==e?Color.fromRgba(255,255,255,1):isString(e)?Color.fromString(e):asType(e,Color);let i=t.a,r=1-i;return Color.fromRgba(t.r*i+e.r*r,t.g*i+e.g*r,t.b*i+e.b*r)}_parse(t){if("transparent"==(t=t.toLowerCase())){this._r=this._g=this._b=this._a=0;return!0}if(t&&0!=t.indexOf("#")&&0!=t.indexOf("rgb")&&0!=t.indexOf("hsl")){let e=document.createElement("div");e.style.color=t;let i=e.style.color;if(i==t){i=window.getComputedStyle(e).color;if(!i){document.body.appendChild(e);i=window.getComputedStyle(e).color;removeChild(e)}}t=i.toLowerCase()}if(0==t.indexOf("#")){if(this._isValidHexColor(t)){if(4==t.length){this.r=parseInt(t[1]+t[1],16);this.g=parseInt(t[2]+t[2],16);this.b=parseInt(t[3]+t[3],16);this.a=1;return!0}if(7==t.length){this.r=parseInt(t.substr(1,2),16);this.g=parseInt(t.substr(3,2),16);this.b=parseInt(t.substr(5,2),16);this.a=1;return!0}}return!1}if(0==t.indexOf("rgb")){let e=t.indexOf("("),i=t.indexOf(")");if(e>-1&&i>-1){let r=t.substr(e+1,i-(e+1)).split(",");if(r.length>2){this.r=parseInt(r[0]);this.g=parseInt(r[1]);this.b=parseInt(r[2]);this.a=r.length>3?parseFloat(r[3]):1;return!0}}}if(0==t.indexOf("hsl")){let e=t.indexOf("("),i=t.indexOf(")");if(e>-1&&i>-1){let r=t.substr(e+1,i-(e+1)).split(",");if(r.length>2){let t=parseInt(r[0])/360,e=parseInt(r[1]),i=parseInt(r[2]);r[1].indexOf("%")>-1&&(e/=100);r[2].indexOf("%")>-1&&(i/=100);let s=Color._hslToRgb(t,e,i);this.r=s[0];this.g=s[1];this.b=s[2];this.a=r.length>3?parseFloat(r[3]):1;return!0}}}return!1}_isValidHexColor(t){return/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(t)}static _hslToRgb(t,e,i){assert(t>=0&&t<=1&&e>=0&&e<=1&&i>=0&&i<=1,"bad HSL values");let r,s,n;if(0==e)r=s=n=i;else{let o=i<.5?i*(1+e):i+e-i*e,a=2*i-o;r=Color._hue2rgb(a,o,t+1/3);s=Color._hue2rgb(a,o,t);n=Color._hue2rgb(a,o,t-1/3)}return[Math.round(255*r),Math.round(255*s),Math.round(255*n)]}static _hue2rgb(t,e,i){i<0&&(i+=1);i>1&&(i-=1);return i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}static _rgbToHsl(t,e,i){assert(t>=0&&t<=255&&e>=0&&e<=255&&i>=0&&i<=255,"bad RGB values");t/=255,e/=255,i/=255;let r,s,n=Math.max(t,e,i),o=Math.min(t,e,i),a=(n+o)/2;if(n==o)r=s=0;else{let l=n-o;s=a>.5?l/(2-n-o):l/(n+o);switch(n){case t:r=(e-i)/l+(e<i?6:0);break;case e:r=(i-t)/l+2;break;case i:r=(t-e)/l+4}r/=6}return[r,s,a]}static _rgbToHsb(t,e,i){assert(t>=0&&t<=255&&e>=0&&e<=255&&i>=0&&i<=255,"bad RGB values");let r=Color._rgbToHsl(t,e,i);return Color._hslToHsb(r[0],r[1],r[2])}static _hsbToRgb(t,e,i){let r=Color._hsbToHsl(t,e,i);return Color._hslToRgb(r[0],r[1],r[2])}static _hsbToHsl(t,e,i){assert(t>=0&&t<=1&&e>=0&&e<=1&&i>=0&&i<=1,"bad HSB values");let r=clamp(i*(2-e)/2,0,1),s=1-Math.abs(2*r-1),n=clamp(s>0?i*e/s:e,0,1);assert(!isNaN(r)&&!isNaN(n),"bad conversion to HSL");return[t,n,r]}static _hslToHsb(t,e,i){assert(t>=0&&t<=1&&e>=0&&e<=1&&i>=0&&i<=1,"bad HSL values");let r=clamp(1==i?1:(2*i+e*(1-Math.abs(2*i-1)))/2,0,1),s=clamp(r>0?2*(r-i)/r:e,0,1);assert(!isNaN(r)&&!isNaN(s),"bad conversion to HSB");return[t,s,r]}}export var 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]}}};export class Globalize{static format(t,e,i,r,s){if(isString(t))return t;if(isNumber(t)){e=e||(t==Math.round(t)?"n0":"n2");return Globalize.formatNumber(t,e,i,r,s)}if(isDate(t)){e=e||Globalize.DefaultDateFormat;return Globalize.formatDate(t,e)}return null!=t?t.toString():""}static formatNumber(t,e,i,r,s){t=asNumber(t);e=asString(e);let n,o=culture.Globalize.numberFormat,a=Globalize._parseNumericFormat(e),l=a.spec,h=a.prec,u=o["."]||".",c=o[","]||",",d=o["-"]||"-",p=Math;null==h&&(h=null!=s?s:"c"==l?o.currency.decimals:"e"==l?6:"r"==l?15:t==p.round(t)?0:2);a.scale&&(t/=p.pow(10,a.scale));if("d"==l||"x"==l){n=(r?p.floor:p.round)(p.abs(t)).toString("d"==l?10:16);for(;n.length<h;)n="0"+n;t<0&&(n=d+n);return"X"==a.specRaw?n.toUpperCase():n}r&&"p"!=l&&"e"!=l&&(t=toFixed(t,h,!0));switch(l){case"e":n=t.toExponential(h);"E"==a.specRaw&&(n=n.replace("e","E"));break;case"c":n=Globalize._toFixedStr(p.abs(t),h);break;case"p":t=Globalize._shiftDecimal(t,2,14);r&&(t=toFixed(t,h,r));n=Globalize._toFixedStr(p.abs(t),h);break;default:n=Globalize._toFixedStr(t,h);"-"!=n[0]||n.match(/[1-9]/)||(n=n.substr(1))}(i||"g"==l||"r"==l)&&n.indexOf(".")>-1&&(n=n.replace(/(\.\d*?)0+$/g,"$1").replace(/\.$/,""));"."!=u&&(n=n.replace(".",u));"-"!=d&&(n=n.replace("-",d));if(c&&("n"==l||"c"==l||"p"==a.specRaw||"F"==a.specRaw||"G"==a.specRaw)){let t=n.indexOf(u),e=/\B(?=(\d\d\d)+(?!\d))/g;n=t>-1?n.substr(0,t).replace(e,c)+n.substr(t):n.replace(e,c)}if("c"==l){let e=t<0&&n.match(/[1-9]/)?0:1,i=o.currency.pattern[e],r=a.curr||o.currency.symbol;"​"==r&&(r="");n=i.replace("n",n).replace("$",r)}if("p"==l){let e=t<0&&n.match(/[1-9]/)?0:1,i=o.percent.pattern[e],r=o["%"]||"%";n=i.replace("n",n);"%"!=r&&(n=n.replace("%",r));"-"!=d&&0==e&&(n=n.replace("-",d))}return a.prefix||a.suffix?a.prefix+n+a.suffix:n}static formatDate(t,e){t=asDate(t);switch(e){case"r":case"R":return t.toUTCString();case"u":return t.toISOString().replace(/\.\d{3}/,"")}e=Globalize._expandFormat(e);return Globalize._parseDateFormat(e).map(i=>Globalize._formatDatePart(t,e,i)).join("")}static parseInt(t,e){return Math.round(Globalize.parseFloat(t,e))}static parseFloat(t,e){let i=Globalize._parseNumericFormat(e),r=i.prefix;r&&0==t.indexOf(r)&&(t=t.substring(r.length));let s=i.suffix;if(s){let e=t.lastIndexOf(s);e>-1&&e==t.length-s.length&&(t=t.substring(0,t.length-s.length))}let n=culture.Globalize.numberFormat,o=n["."]||".",a=n[","]||",",l=n["-"]||"-",h=n["%"]||"%",u=i.curr||n.currency.symbol||"$",c=t.indexOf(h)>-1,d=t.indexOf("(")>-1&&t.indexOf(")")>-1,p=0;if("x"==i.spec)p=parseInt(t,16);else{[u,h,"(",")"].forEach(e=>{t=t.replace(e,"")});/\s/.test(a)&&(t=t.replace(/\s+/g,""));let e=(t=t.replace(new RegExp("\\"+a,"g"),"").replace(new RegExp("\\"+l,"g"),"-").replace(/(\+|\-)\s+/g,"$1").replace(o,".").trim()).length;if(!d&&e&&"-"==t[e-1]){d=!0;t=t.substring(0,e-1)}p=/^\s*(\+|\-)?\d*(\.\d*)?(\s*E(\+|\-)?\d+)?\s*$/i.test(t)?parseFloat(t):Number.NaN}if(!isNaN(p)){d=d||p<0;p=Math.abs(p);c&&(p=Globalize._shiftDecimal(p,-2));d&&(p=-p);i.scale&&(p*=Math.pow(10,i.scale))}return p}static parseDate(t,e,i){if(!(t=asString(t)))return null;if("u"==e)return new Date(t);let r;if("R"==e||"r"==e){let e=/((\d+)\-(\d+)\-(\d+))?\s?((\d+):(\d+)(:(\d+))?)?/,i=t.match(e);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(t);return isNaN(r.getTime())?null:r}e=Globalize._expandFormat(e||"d");let s=culture.Globalize.calendar,n=Globalize._CJK,o=new RegExp("(\\"+s["/"]+")|(\\"+s[":"]+")|(\\d+)|(["+n+"\\.]{2,})|(["+n+"]+)","gi"),a=t.match(o),l=Globalize._parseDateFormat(e),h=0;if(!(a&&a.length&&l&&l.length))return null;let u,c,d,p,f,g=-1,_=0,m=1,b=0,C=0,v=0,w=0,y=-1,x=null;if(i=asDate(i,!0)){_=i.getMonth();m=i.getDate();b=i.getHours();C=i.getMinutes();v=i.getSeconds();w=i.getMilliseconds()}for(let t=0;t<l.length&&a;t++){let e=t-h,i=e>-1&&e<a.length?a[e]:"",r=l[t].length;switch(l[t]){case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":f=l[t];case"yyyy":case"yyy":case"yy":case"y":if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}g=parseInt(i);p=4==i.length;break;case"MMMM":case"MMM":d=!0;_=-1;let n=i.toLowerCase(),o="MMMM"==l[t]?s.months:s.monthsAbbr;for(let t=0;t<12;t++)if(0==o[t].toLowerCase().indexOf(n)){_=t;break}if(_>-1)break;case"MM":case"M":d=!0;if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}_=parseInt(i)-1;break;case"dddd":case"ddd":u=!0;break;case"dd":case"d":if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}m=parseInt(i);c=!0;break;case"hh":case"h":if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}b=parseInt(i);b=12==b?0:b;break;case"HH":if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}b=parseInt(i);break;case"H":b=parseInt(i);break;case"mm":case"m":if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}C=parseInt(i);break;case"ss":case"s":if(r>1&&i.length>r){a[e]=i.substr(r);i=i.substr(0,r);h++}v=parseInt(i);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(i)/Math.pow(10,r-3);break;case"tt":case"t":i=i.toUpperCase();b<12&&s.pm.indexOf(i)>-1&&(b+=12);break;case"q":case"Q":case"u":case"U":y=parseInt(i);break;case"ggg":case"gg":case"g":case'"г."':x=s.eras.length>1?Globalize._getEra(i,s):s.eras.length>0?s.eras[0]:null;if(s.eras.length>0&&!x)return null;break;case"/":case":":if(i&&i!=s[l[t]])return null;break;case s["/"]:case s[":"]:if(i&&i!=l[t])return null;break;case"K":break;default:Globalize._unquote(l[t]).trim()!=i.trim()&&h++}}if(d&&c){isNaN(b)&&(b=0);isNaN(C)&&(C=0);isNaN(v)&&(v=0)}if(_<0||_>11||isNaN(_)||m<1||m>31||isNaN(m)||b<0||b>=24||isNaN(b)||C<0||C>=60||isNaN(C)||v<0||v>=60||isNaN(v))return null;if(a.length+h>l.length)return null;if(f){if(!d)return null;let t=culture.Globalize.calendar;if(isArray(t.fiscalYearOffsets)){let e="E"==f[0],i=_-t.fiscalYearOffsets[e?0:1];g+=i>11?-1:i<0?1:0}}if(u&&!c)return null;!d&&y>=1&&y<=4&&(_=3*(y-1));if(isNaN(g)||g<0)g=i?i.getFullYear():(new Date).getFullYear();else if(x&&x.start)g=g+x.start.getFullYear()-1;else if(g<100&&!p){let t=isNumber(s.twoDigitYearMax)?s.twoDigitYearMax:2029;t>99&&(g+=g+2e3<=t?2e3:1900)}r=DateTime.newDate(g,_,m,b,C+0,v,w);return r.getMonth()!=_||r.getDate()!=m||isNaN(r.getTime())?null:r}static getFullFormat(t){return Globalize._expandFormat(t)}static getFirstDayOfWeek(){let t=culture.Globalize.calendar.firstDay;return t||0}static getNumberDecimalSeparator(){let t=culture.Globalize.numberFormat["."];return t||"."}static _toFixedStr(t,e){let i=t.toString(),r=i.indexOf("."),s=e-(i.length-r)+1,n=i.indexOf("e")>-1;if(!n&&r>-1&&s>=0)return i+Array(s+1).join("0");if(r>-1&&!n&&"5"==i[i.length-1]){t=+(Math.round(+(Math.abs(t)+"e"+e))+"e"+-e)*(t<0?-1:1)}return t.toFixed(e)}static _unquote(t){return t.length>1&&t[0]==t[t.length-1]&&("'"==t[0]||'"'==t[0])?t.substr(1,t.length-2):t}static _parseNumericFormat(t){let e=Globalize._numFormatInfo[t];if(!e){let i=t&&t.match(/(\"(.*?)\"\s*)?([a-z]+)\s*(\d*)\s*(,*)(\s*\"(.*?)\"\s*)?(.*)/i)||[],r=i[3]?i[3]:"n";if(r.length>1){i=[];r="n"}e={prefix:i[2]||"",spec:r.toLowerCase(),specRaw:r,prec:i[4]?parseInt(i[4]):null,scale:i[5]?3*i[5].length:0,suffix:i[7]||"",curr:i[8]||null};Globalize._numFormatInfo[t]=e}return e}static _parseDateFormat(t){let e=Globalize._dateFormatParts[t];if(!e){e=[];if(t){let i,r;for(i=0;i>-1&&i<t.length;i++){let s=t[i];if("'"==s||'"'==s){r=t.indexOf(s,i+1);if(r>-1){e.push(t.substring(i,r+1));i=r;continue}}if("\\"==s&&i<t.length-1){i++;e.push('"'+t[i]+'"')}else{r=i+1;for(;r<t.length&&t[r]==s;r++);e.push(t.substring(i,r));i=r-1}}}Globalize._dateFormatParts[t]=e}return e}static _formatDatePart(t,e,i){let r,s=culture.Globalize.calendar,n=null,o=0,a=0,l=i.length;switch(i){case"yyyy":case"yyy":case"yy":case"y":case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":r="E"==i[0]?DateTime.toFiscal(t,!0):"e"==i[0]?DateTime.toFiscal(t,!1):t;o=r.getFullYear();if(s.eras.length>1&&e.indexOf("g")>-1){n=Globalize._getEra(t,s);n&&(o=isDate(n.start)?o-n.start.getFullYear()+1:Math.abs(o))}let h=i.length<3?o%100:3==i.length?o%1e3:o;return Globalize._zeroPad(h,i.length);case"MMMMM":return s.monthsAbbr[t.getMonth()][0];case"MMMM":return s.months[t.getMonth()];case"MMM":return s.monthsAbbr[t.getMonth()];case"MM":case"M":return Globalize._zeroPad(t.getMonth()+1,l);case"dddd":return s.days[t.getDay()];case"ddd":return s.daysAbbr[t.getDay()];case"dd":return Globalize._zeroPad(t.getDate(),2);case"d":return t.getDate().toString();case"hh":case"h":return Globalize._zeroPad(Globalize._h12(t),l);case"HH":case"H":return Globalize._zeroPad(t.getHours(),l);case"mm":case"m":return Globalize._zeroPad(t.getMinutes(),l);case"ss":case"s":return Globalize._zeroPad(t.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=t.getMilliseconds()*Math.pow(10,l-3);return"f"==i[0]?Globalize._zeroPad(a,l):a.toFixed(0);case"tt":return t.getHours()<12?s.am[0]:s.pm[0];case"t":return t.getHours()<12?s.am[1]:s.pm[1];case"q":case"Q":return(Math.floor(t.getMonth()/3)+1).toString();case"u":case"U":r=DateTime.toFiscal(t,"U"==i);return(Math.floor(r.getMonth()/3)+1).toString();case"ggg":case"gg":case"g":if(s.eras.length>1){n=Globalize._getEra(t,s);if(n){if(isString(n))return n;switch(i){case"gg":return n.name[0];case"g":return n.symbol;default:return n.name}}}return s.eras[0];case":":case"/":return s[i];case"K":let u=t.toString().match(/(\+|\-)(\d{2})(\d{2})/);return u?u[1]+u[2]+u[3]:"";case"zzz":case"zz":case"z":let c,d=-t.getTimezoneOffset(),p=Math.abs(d),f=Globalize.formatNumber;switch(i){case"zzz":c=f(p/60,"d2",!1,!0)+s[":"]+f(p%60,"d2",!1,!0);break;case"zz":c=f(p/60,"d2",!1,!0);break;case"z":c=f(p/60,"d1",!1,!0)}return(d>=0?"+":"-")+c}return l>1&&i[0]==i[l-1]&&('"'==i[0]||"'"==i[0])?i.substr(1,l-2):i}static _getEra(t,e){if(e.eras){let i=e.eras,r=e.eras.length;if(isDate(t)){if(isString(i[0]))return i[t.getFullYear()>=0?0:1];if(isDate(i[0].start)){for(let e=0;e<r;e++)if(t>=i[e].start)return i[e];return i[r-1]}}else if(isString(t)&&t.length>0){t=t.toLowerCase();for(let e=0;e<r;e++){let r=i[e];if(isString(r)){if(0==r.toLowerCase().indexOf(t))return r}else if(r.name&&0==r.name.toLowerCase().indexOf(t)||r.symbol&&0==r.symbol.toLowerCase().indexOf(t))return r}}}return null}static _expandFormat(t){let e=culture.Globalize.calendar.patterns[t];return e||t}static _zeroPad(t,e){let i=t.toFixed(0),r=e-i.length+1;return r>0?Array(r).join("0")+i:i}static _h12(t){let e=culture.Globalize.calendar,i=t.getHours();if(e.am&&e.am[0]){i%=12;0==i&&(i=12)}return i}static _shiftDecimal(t,e,i){if(0==e||isNaN(t))return t;let r=t.toString();if(r.indexOf("e")>-1){let r=t*Math.pow(10,e);null!=i&&(r=parseFloat(r.toFixed(i)));return r}let s=Array(Math.abs(e)+1).join("0");e<0&&(r=s+r);var n=r.indexOf(".");if(n<0){r+=".";n=r.indexOf(".")}e>0&&(r+=s);n+=e;r=r.replace(".","");r=r.substr(0,n)+"."+r.substr(n);return parseFloat(r)}}Globalize.DefaultDateFormat="d";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={};export const _loadedCultures="undefined"!=typeof window&&window.wijmo&&window.wijmo._loadedCultures||{};export function _updateCulture(t){culture=t;_loadedCultures[t.Globalize.name]=t}export function _addCultureInfo(t,e){let i="undefined"!=typeof window?window.wijmo:null,r=i?i.culture:null,s=r?r[t]:null;culture[t]=s||e}export const changeCultureSync=(t,e)=>{const i=document.getElementsByTagName("script");for(let t=0;t<i.length;t++){let e=i[t];if(e.src.indexOf("wijmo.culture.")>-1){e.parentElement.removeChild(e);break}}const r=_loadedCultures[t]||void 0;if(r){let t=window.wijmo._updateCulture;t?t(r):window.wijmo.culture=r;e&&e();window.wijmo.Control.invalidateAll()}return r};export const changeCulture=t=>new Promise((e,i)=>{const r=changeCultureSync(t);r?e(r):i()});export class _MaskProvider{constructor(t,e="",i="_"){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(e);this.input=t;this.promptChar=asString(i,!1);this._connect(!0);(this._evtInput=document.createEvent("HTMLEvents")).initEvent("input",!0,!1)}get input(){return this._tbx}set input(t){this._connect(!1);this._tbx=t;this._connect(!0)}get mask(){return this._msk}set mask(t){if(t!=this._msk){this._msk=asString(t,!0);this._parseMask();this._valueChanged()}}get promptChar(){return this._promptChar}set promptChar(t){if(t!=this._promptChar){assert(1==(t=asString(t,!1)).length,"promptChar must be a string with length 1.");let e=this._tbx,i=e.value,r="",s=this._mskArr,n=this._promptChar;for(let e=0;e<i.length;e++){let o=s[e],a=i[e];o&&o.literal||a!==n||(a=t);r+=a}e.value=r;this._promptChar=t}}get overwriteMode(){return this._overWrite}set overwriteMode(t){this._overWrite=asBoolean(t)}get maskFull(){return this._full}getMaskRange(){return this._mskArr.length?[this._firstPos,this._lastPos]:[0,this._tbx.value.length-1]}getRawValue(){let t=this._tbx?this._tbx.value:"";if(!this.mask)return t;let e="";for(let i=0;i<this._mskArr.length&&i<t.length;i++)this._mskArr[i].literal||t[i]==this._promptChar||(e+=t[i]);return e}refresh(){this._parseMask();this._valueChanged()}_input(t){if(this._msk&&!this._composing&&t!=this._evtInput){t.preventDefault();t.stopImmediatePropagation();setTimeout(()=>{this._valueChanged();this._tbx&&this._tbx.dispatchEvent(this._evtInput)})}}_keydown(t){if(t.keyCode==Key.Back){let e=this._tbx.selectionStart,i=this._tbx.selectionEnd;if(e<=this._firstPos&&i==e){t.preventDefault();this._backSpace=!1;return}}this._backSpace=t.keyCode==Key.Back}_keypress(t){t.ctrlKey||t.metaKey||t.altKey||this._composing||!this._preventKey(t.charCode)||t.preventDefault()}_cmpstart(t){this._composing=!0}_cmpend(t){if(this._composing){this._composing=!1;setTimeout(()=>{let t=this._tbx;t&&this._valueChanged()&&t.dispatchEvent(this._evtInput)})}}_preventKey(t){if(t&&this._mskArr.length){let e=this._tbx,i=e.selectionStart,r=String.fromCharCode(t);if(i<this._firstPos){i=this._firstPos;setSelectionRange(e,i)}if(i>=this._mskArr.length)return!0;let s=this._mskArr[i];if(s.literal)this._validatePosition(i);else if(s.wildCard!=r&&!this._isCharValid(s.wildCard,r))return!0}return!1}_connect(t){let e=this._tbx;if(e){assert(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected.");if(t){this._autoComplete=e.autocomplete;this._spellCheck=e.spellcheck;e.autocomplete="off";e.spellcheck=!1;e.addEventListener("input",this._inputBnd,!0);e.addEventListener("keydown",this._keydownBnd,!0);e.addEventListener("keypress",this._keypressBnd,!0);e.addEventListener("compositionstart",this._cmpstartBnd,!0);e.addEventListener("compositionend",this._cmpendBnd,!0);e.addEventListener("blur",this._cmpendBnd,!0);this._valueChanged()}else{e.autocomplete=this._autoComplete;e.spellcheck=this._spellCheck;e.removeEventListener("input",this._inputBnd,!0);e.removeEventListener("keydown",this._keydownBnd,!0);e.removeEventListener("keypress",this._keypressBnd,!0);e.removeEventListener("compositionstart",this._cmpstartBnd,!0);e.removeEventListener("compositionend",this._cmpendBnd,!0);e.removeEventListener("blur",this._cmpendBnd,!0)}}}_valueChanged(){if(!this._tbx||!this._msk)return!1;let t=this._tbx,e=t.selectionStart,i=e>0?t.value[e-1]:"",r=t.value;t.value=this._applyMask();""==r&&(e=this._firstPos+1);let s=e>0?t.value[e-1]:"";e>0&&s==this._promptChar&&i!=this.promptChar&&e--;e==r.length&&(e=this._matchEnd);this._validatePosition(e);return r!=t.value}_applyMask(){let t=this._tbx,e=t.value;this._full=!0;this._matchEnd=0;if(!this._msk)return e;if(!e&&!t.required)return e;if(this._overWrite){let i=t.selectionStart;t==document.activeElement&&t.selectionEnd==i&&e.length>this.mask.length&&(e=e.substr(0,i)+e.substr(i+e.length-this.mask.length))}e=this._handleVagueLiterals(e);let i="",r=0,s=this._promptChar;for(let t=0;t<this._mskArr.length;t++){let n=this._mskArr[t],o=n.literal;o&&o==e[r]&&r++;if(n.wildCard){o=s;if(e){let t=r;for(;t<e.length;t++)if(this._isCharValid(n.wildCard,e[t])){o=e[t];switch(n.charCase){case">":o=o.toUpperCase();break;case"<":o=o.toLowerCase()}o!=s&&(this._matchEnd=i.length+1);break}r=t+1}o==s&&(this._full=!1)}i+=o}return i}_handleVagueLiterals(t){if(t.length>this._mskArr.length+1)return t;let e=t.length-this._mskArr.length;if(0!=e&&t.length>1){let i=-1,r=this._backSpace,s=this._tbx,n=s==getActiveElement()?s.selectionStart:s.value.length;for(let t=Math.max(0,n-e);t<this._mskArr.length;t++)if(this._mskArr[t].vague){i=t;break}if(i>-1)if(e<0){if(r)for(;i>0&&this._mskArr[i-1].literal;)i--;let s=Array(1-e).join(this._promptChar),n=i+e;n>-1&&(t=t.substr(0,n)+s+t.substr(n-e))}else{for(;i>0&&this._mskArr[i-1].literal;)i--;t=t.substr(0,i)+t.substr(i+e)}}return t}_isCharValid(t,e){if(e==this._promptChar)return!0;switch(t){case"0":return this._isDigit(e);case"9":return this._isDigit(e)||" "==e;case"#":return this._isDigit(e)||" "==e||"+"==e||"-"==e;case"L":return this._isLetter(e);case"l":return this._isLetter(e)||" "==e;case"A":return this._isDigit(e)||this._isLetter(e);case"a":return this._isDigit(e)||this._isLetter(e)||" "==e;case"9":return e>="0"&&e<="9";case"J":case"G":return!("G"==t&&_MaskProvider._X_DBCS_BIG_HIRA.indexOf(e)>-1)&&(e>="ぁ"&&e<="ゟ");case"K":case"N":return!("N"==t&&_MaskProvider._X_DBCS_BIG_KATA.indexOf(e)>-1)&&(e>="゠"&&e<="ヿ");case"Z":return!(e>="ヲ"&&e<="゚")&&(e<" "||e>"ÿ");case"H":return e>="!"&&e<="ÿ"||e>="ヲ"&&e<="゚";case"K":case"N":return!("N"==t&&_MaskProvider._X_SBCS_BIG_KATA.indexOf(e)>-1)&&(e>="ヲ"&&e<="゚")}return!1}_isDigit(t){return t>="0"&&t<="9"}_isLetter(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}_validatePosition(t){let e=this._mskArr;if(this._backSpace)for(;t>0&&t<e.length&&e[t-1].literal;)t--;if(0==t||!this._backSpace)for(;t<e.length&&e[t].literal;)t++;getActiveElement()==this._tbx&&setSelectionRange(this._tbx,t);this._backSpace=!1}_parseMask(){this._mskArr=[];this._firstPos=-1;this._lastPos=-1;let t,e=this._msk,i="|";for(let r=0;e&&r<e.length;r++)switch(e[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(e[r],i));break;case".":case",":case":":case"/":case"$":switch(e[r]){case".":case",":t=culture.Globalize.numberFormat[e[r]];break;case":":case"/":t=culture.Globalize.calendar[e[r]];break;case"$":t=culture.Globalize.numberFormat.currency.symbol}for(let e=0;e<t.length;e++)this._mskArr.push(new _MaskElement(t[e]));break;case"<":case">":case"|":i=e[r];break;case"\\":r<e.length-1&&r++;this._mskArr.push(new _MaskElement(e[r]));break;default:this._mskArr.push(new _MaskElement(e[r]))}for(let t=0;t<this._mskArr.length;t++){let e=this._mskArr[t];if(e.literal)for(let t=0;t<this._mskArr.length;t++){let i=this._mskArr[t];if(i.wildCard&&this._isCharValid(i.wildCard,e.literal)){e.vague=!0;break}}}}dispose(){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="ァィゥェォャュョッ";export class _MaskElement{constructor(t,e){if(e){this.wildCard=t;this.charCase=e}else this.literal=t}}export var Aggregate;!function(t){t[t.None=0]="None";t[t.Sum=1]="Sum";t[t.Cnt=2]="Cnt";t[t.Avg=3]="Avg";t[t.Max=4]="Max";t[t.Min=5]="Min";t[t.Rng=6]="Rng";t[t.Std=7]="Std";t[t.Var=8]="Var";t[t.StdPop=9]="StdPop";t[t.VarPop=10]="VarPop";t[t.CntAll=11]="CntAll";t[t.First=12]="First";t[t.Last=13]="Last"}(Aggregate||(Aggregate={}));export function getAggregate(t,e,i,r){let s=0,n=0,o=0,a=0,l=null,h=null,u=null,c=i?new Binding(i):null;if((t=asEnum(t,Aggregate))==Aggregate.CntAll)return e.length;for(let i=0;i<e.length;i++){let d=e[i];c&&(d=c.getValue(d));if(null!=d){if(t==Aggregate.First)return d;s++;(null==l||d<l)&&(l=d);(null==h||d>h)&&(h=d);u=d;d&&"string"==typeof d&&d.length>1&&"="===d[0]&&"="!==d[1]&&r&&"function"==typeof r.evaluate&&(d=r.evaluate(d));if(isNumber(d)&&!isNaN(d)){n++;o+=d;a+=d*d}else if(isBoolean(d)){n++;if(1==d){o++;a++}}}}let d=0==n?0:o/n;switch(t){case Aggregate.Avg:return d;case Aggregate.Cnt:return s;case Aggregate.Max:return h;case Aggregate.Min:return l;case Aggregate.Rng:return h-l;case Aggregate.Sum:return o;case Aggregate.VarPop:return n<=1?0:a/n-d*d;case Aggregate.StdPop:return n<=1?0:Math.sqrt(a/n-d*d);case Aggregate.Var:return n<=1?0:(a/n-d*d)*n/(n-1);case Aggregate.Std:return n<=1?0:Math.sqrt((a/n-d*d)*n/(n-1));case Aggregate.Last:return u;case Aggregate.First:return null}throw"Invalid aggregate type."}function extend(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}export class ArrayBase extends Array{constructor(){canChangePrototype?this.length=0:super()}}let canChangePrototype=!0;try{extend(ArrayBase.prototype,Array.prototype);canChangePrototype=ArrayBase.prototype.length===Array.prototype.length}catch(t){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});export class ObservableArray extends ArrayBase{constructor(t){super();this._updating=0;this.collectionChanged=new Event;if(t){t=asArray(t);this._updating++;for(let e=0;e<t.length;e++)this.push(t[e]);this._updating--}}push(...t){t.forEach(t=>{super.push(t);this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t,this.length-1)});return this.length}shift(){let t=super.shift();this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,0);return t}unshift(...t){let e=super.unshift(...t);1==t.length?this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t[0],0):this._raiseCollectionChanged();return e}pop(){let t=super.pop();this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,this.length);return t}splice(t,e,...i){let r,s=NotifyCollectionChangedAction,n=this._raiseCollectionChanged.bind(this);if(e&&i.length){r=super.splice(t,e,...i);1==e&&1==i.length?n(s.Change,i[0],t):n()}else if(i.length){r=super.splice(t,0,...i);1==i.length?n(s.Add,i[0],t):n()}else{r=super.splice(t,e);1==e?n(s.Remove,r[0],t):n()}return r}slice(t,e){return super.slice(t,e)}indexOf(t,e){return super.indexOf(t,e)}sort(t){let e=super.sort(t);this._raiseCollectionChanged();return e}insert(t,e){this.splice(t,0,e)}remove(t){let e=this.indexOf(t);e>-1&&this.removeAt(e);return e>-1}removeAt(t){this.splice(t,1)}setAt(t,e){t>=this.length&&(this.length=t+1);this.splice(t,1,e)}clear(){this.length&&this.splice(0,this.length)}beginUpdate(){this._updating++}endUpdate(t=!1){this._updating--;this._updating<=0&&!t&&this._raiseCollectionChanged()}get isUpdating(){return this._updating>0}deferUpdate(t){try{this.beginUpdate();t()}finally{this.endUpdate()}}implementsInterface(t){return"INotifyCollectionChanged"==t}onCollectionChanged(t=NotifyCollectionChangedEventArgs.reset){this.isUpdating||this.collectionChanged.raise(this,t)}_raiseCollectionChanged(t=NotifyCollectionChangedAction.Reset,e,i){if(!this.isUpdating){let r=new NotifyCollectionChangedEventArgs(t,e,i);this.onCollectionChanged(r)}}}export var SortNulls;!function(t){t[t.Natural=0]="Natural";t[t.First=1]="First";t[t.Last=2]="Last"}(SortNulls||(SortNulls={}));const _OBJ_DEPTH=2;export class CollectionView{constructor(t,e){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(()=>{this._srtDsc.forEach(t=>{assert(t instanceof SortDescription,"sortDescriptions array must contain SortDescription objects.")});this.canSort&&this._commitAndRefresh()});this._grpDesc.collectionChanged.addHandler(()=>{this._grpDesc.forEach(t=>{assert(t instanceof GroupDescription,"groupDescriptions array must contain GroupDescription objects.")});this.canGroup&&this._commitAndRefresh()});this._filters.collectionChanged.addHandler(()=>{this._filters.forEach(t=>{assert(isFunction(t),"filters array must contain IPredicate functions.")});this.canFilter&&this._commitAndRefresh()});this._chgEdited.collectionChanged.addHandler((t,e)=>{if(e&&e.action&&this._orgVals&&0!==this._orgVals.size)switch(e.action){case NotifyCollectionChangedAction.Remove:this._orgVals.delete(e.item);break;case NotifyCollectionChangedAction.Reset:this._orgVals.clear()}});this.sourceCollection=t||new ObservableArray;if(e){this._initializing=!0;this.deferUpdate(()=>{copy(this,e)});this._initializing=!1}null==this._keepCurrentItem&&(this._keepCurrentItem=!0)}_copy(t,e){switch(t){case"sortDescriptions":let t=this.sortDescriptions;t.deferUpdate(()=>{t.clear();asArray(e).forEach(e=>{isString(e)?e=new SortDescription(e,!0):e instanceof SortDescription||!e.property||(e=new SortDescription(e.property,e.ascending));t.push(e)})});return!0;case"groupDescriptions":let i=this.groupDescriptions;i.deferUpdate(()=>{i.clear();e.forEach(t=>{isString(t)&&(t=new PropertyGroupDescription(t));i.push(t)})});return!0;case"currentItem":this.currentItem=e;return!0}return!1}get calculatedFields(){return this._calcFields}set calculatedFields(t){if(t&&!window.Proxy){console.warn("** Calculated fields require Proxy (see https://www.npmjs.com/package/proxy-polyfill).");t=null}if(t!=this._calcFields){this._calcFields=t;let e=this._srcRaw;this._srcRaw=null;this.sourceCollection=e}}get newItemCreator(){return this._itemCreator}set newItemCreator(t){this._itemCreator=asFunction(t)}get sortConverter(){return this._srtCvt}set sortConverter(t){t!=this._srtCvt&&(this._srtCvt=asFunction(t,!0))}get sortComparer(){return this._srtCmp}set sortComparer(t){t!=this._srtCmp&&(this._srtCmp=asFunction(t,!0))}get useStableSort(){return this._stableSort}set useStableSort(t){if(t!=this._stableSort){this._stableSort=asBoolean(t);this.refresh()}}get sortNulls(){return this._srtNulls}set sortNulls(t){if((t=asEnum(t,SortNulls))!=this._srtNulls){this._srtNulls=t;this.refresh()}}get sortNullsFirst(){return this.sortNulls!=SortNulls.Last}set sortNullsFirst(t){_deprecated("sortNullsFirst","sortNulls");this.sortNulls=asBoolean(t)?SortNulls.First:SortNulls.Last}getAggregate(t,e,i){return getAggregate(t,i?this._pgView:this._view,e)}get trackChanges(){return this._trackChanges}set trackChanges(t){this._trackChanges=asBoolean(t)}get refreshOnEdit(){return this._refreshOnEdit}set refreshOnEdit(t){this._refreshOnEdit=asBoolean(t)}get itemsAdded(){return this._chgAdded}get itemsRemoved(){return this._chgRemoved}get itemsEdited(){return this._chgEdited}clearChanges(){this._chgAdded.clear();this._chgRemoved.clear();this._chgEdited.clear();this._orgVals&&this._orgVals.clear()}implementsInterface(t){switch(t){case"ICollectionView":case"IEditableCollectionView":case"IPagedCollectionView":case"INotifyCollectionChanged":return!0}return!1}get getError(){return this._getError}set getError(t){if(this._getError!=t){this._getError=asFunction(t);this._raiseCollectionChanged()}}onCollectionChanged(t=NotifyCollectionChangedEventArgs.reset,e){t.action!=NotifyCollectionChangedAction.Change||this._committing||this._canceling||t.item==this.currentEditItem||t.item==this.currentAddItem||this._trackItemChanged(t.item,e);this._updating||this.collectionChanged.raise(this,t)}_raiseCollectionChanged(t=NotifyCollectionChangedAction.Reset,e,i){let r=new NotifyCollectionChangedEventArgs(t,e,i);this.onCollectionChanged(r)}onSourceCollectionChanging(t){this.sourceCollectionChanging.raise(this,t);return!t.cancel}onSourceCollectionChanged(t){this.sourceCollectionChanged.raise(this,t)}get canFilter(){return this._canFilter}set canFilter(t){this._canFilter=asBoolean(t)}get canGroup(){return this._canGroup}set canGroup(t){this._canGroup=asBoolean(t)}get canSort(){return this._canSort}set canSort(t){this._canSort=asBoolean(t)}get currentItem(){return this._pgView&&this._idx>-1&&this._idx<this._pgView.length?this._pgView[this._idx]:null}set currentItem(t){this.moveCurrentTo(t)}get currentPosition(){return this._idx}set currentPosition(t){this.moveCurrentToPosition(asNumber(t))}get filter(){return this._filter}set filter(t){if(this._filter!=t){this._filter=asFunction(t);this.canFilter&&this.refresh()}}get filters(){return this._filters}get groupDescriptions(){return this._grpDesc}get groups(){return this._groups}get isEmpty(){return!this._pgView||!this._pgView.length}get sortDescriptions(){return this._srtDsc}get sourceCollection(){return this._src}set sourceCollection(t){if(t!=this._srcRaw){if(!this.onSourceCollectionChanging(new CancelEventArgs))return;let e=this.currentPosition;this.commitEdit();null!=this._ncc&&this._ncc.collectionChanged.removeHandler(this._sourceChanged);this._srcRaw=t;this._src=asArray(t,!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&&e>-1&&this.onCurrentChanged()}}_sourceChanged(t,e){this._updating<=0&&this.refresh()}contains(t){return this._pgView.indexOf(t)>-1}moveCurrentTo(t){return this.moveCurrentToPosition(_ENV_TOOLS.indexOf(this._pgView,t))}moveCurrentToFirst(){return this.moveCurrentToPosition(0)}moveCurrentToLast(){return this.moveCurrentToPosition(this._pgView.length-1)}moveCurrentToPrevious(){return this._idx>0&&this.moveCurrentToPosition(this._idx-1)}moveCurrentToNext(){return this.moveCurrentToPosition(this._idx+1)}moveCurrentToPosition(t){if(t>=-1&&t<this._pgView.length&&t!=this._idx){let e=new CancelEventArgs;if(this.onCurrentChanging(e)){let e=this._pgView[t],i=_getTargetObject(e),r=this._edtItem,s=this._newItem;r&&r!=e&&r!=i?this.commitEdit():s&&s!=e&&s!=i&&this.commitNew();this._idx=t;this.onCurrentChanged()}}return this._idx==t}refresh(){if(this._newItem||this._edtItem||this._updating>0)this._pendingRefresh=!0;else{let t=this.currentItem;this._performRefresh();this.onCollectionChanged();t==this.currentItem||this._initializing||this.onCurrentChanged()}}_commitAndRefresh(){if(this.currentEditItem||this.currentAddItem){this._pendingRefresh=!0;this.commitEdit()}else this.refresh()}_performRefresh(){if(this._updating>0){this._pendingRefresh=!0;return}this._pendingRefresh=!1;this._pendingRemove=!1;let t=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)}let e=this._keepCurrentItem&&null!=t?this._pgView.indexOf(t):-1;e<0&&(e=Math.min(this._idx,this._pgView.length-1));this._idx=e;this._digest=this._getGroupsDigest(this.groups)}_performSort(t){if(this._stableSort){let e=t.map((t,e)=>({item:t,index:e})),i=this._compareItems();e.sort((t,e)=>{let r=i(t.item,e.item);return 0==r?t.index-e.index:r});for(let i=0;i<t.length;i++)t[i]=e[i].item}else t.sort(this._compareItems())}_compareItems(){let t=this._srtDsc,e=this._srtCvt,i=this._srtCmp,r=CollectionView._collator,s=!0,n=0;return(o,a)=>{for(let l=0;l<t.length;l++){let h=t[l],u=h._bnd.getValue(o),c=h._bnd.getValue(a);if(e){u=e(h,o,u,s);c=e(h,a,c,!1);s=!1}if(i){n=i(u,c);if(null!=n){if(0!=n)return h.ascending?+n:-n;continue}}u!=u&&(u=null);c!=c&&(c=null);if(u!==c&&(null==u||null==c))switch(this._srtNulls){case SortNulls.First:return null==u?-1:1;case SortNulls.Last:return null==u?1:-1;default:n=null==u?-1:1;return h.ascending?+n:-n}if("string"==typeof u&&"string"==typeof c){if(r){n=r.compare(u,c);if(0!=n)return h.ascending?+n:-n;continue}let t=u.toLowerCase(),e=c.toLowerCase();if(t!=e){u=t;c=e}}n=u<c?-1:u>c?1:0;if(0!=n)return h.ascending?+n:-n}return 0}}_performFilter(t){return this.canFilter&&this._filter||this._filters.length?t.filter(this._filterItem,this):t}_filterItem(t){var e=!this.canFilter||!this._filter||this._filter(t);for(let i=0;i<this._filters.length&&e;i++)e=this._filters[i](t);return e}onCurrentChanged(t){this.currentChanged.raise(this,t)}onCurrentChanging(t){this.currentChanging.raise(this,t);return!t.cancel}get items(){return this._pgView}beginUpdate(){this._updating++}endUpdate(t=!0){this._updating--;t&&(this._pendingRefresh=!0);if(this._updating<=0){this._pendingRefresh&&this.refresh();if(this._pendingRemove){this._pendingRemove=!1;this._raiseCollectionChanged()}}}get isUpdating(){return this._updating>0}deferUpdate(t,e=!0){try{this.beginUpdate();t()}finally{this.endUpdate(e)}}get canAddNew(){return this._canAddNew}set canAddNew(t){if(t!=this._canAddNew){this._canAddNew=asBoolean(t);this._raiseCollectionChanged()}}get canCancelEdit(){return this._canCancelEdit}set canCancelEdit(t){this._canCancelEdit=asBoolean(t)}get canRemove(){return this._canRemove}set canRemove(t){this._canRemove=asBoolean(t)}get currentAddItem(){return this._newItem}get currentEditItem(){return this._edtItem}get isAddingNew(){return null!=this._newItem}get isEditingItem(){return null!=this._edtItem}editItem(t){if(t!=this._edtItem&&this.moveCurrentTo(t)){this.commitEdit();this._edtItem=t;this._edtClone=this._extend({},this._edtItem)}}commitEdit(){let t=this._edtItem,e=this._edtClone;if(null!=t){this._committing=!0;let i=this._getChangedFields(t,e),r=this._pendingRefresh;this._edtItem=null;this._edtClone=null;let s=this._pgView.indexOf(t),n=this._digest;this._needRefresh(i)&&this._refreshOnEdit&&this._performRefresh();this._trackItemChanged(t,e);this._pgView.indexOf(t)!=s||n!=this._digest||r?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,t,s);this.commitNew();this._committing=!1;if(this.sourceCollection instanceof ObservableArray){this._updating++;let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,t);this.sourceCollection.onCollectionChanged(e);this._updating--}}}cancelEdit(){let t=this._edtItem;if(null!=t){this._edtItem=null;if(!this.canCancelEdit)return;let e=this._src.indexOf(t);if(e>=0&&this._edtClone){this._extend(this._src[e],this._edtClone);this._edtClone=null;this._canceling=!0;this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,t,e);this._canceling=!1;if(this._pendingRefresh&&this._refreshOnEdit){this._performRefresh();this._raiseCollectionChanged()}}}}addNew(t,e=!1){this.commitEdit();if(!this.canAddNew)return null;let i=this.sourceCollection;null==t&&(t=this.newItemCreator?this.newItemCreator():i&&i.length?new i[0].constructor:{});if(null!=t){this._updating++;i.push(t);this._updating--;t=i[i.length-1];this._newItem=t;this._pgView!=this._src&&this._pgView.push(t);if(this.groups&&this.groups.length){let e=this.groups[this.groups.length-1];e.items.push(t);for(;e.groups&&e.groups.length;){e=e.groups[e.groups.length-1];e.items.push(t)}}this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t,this._pgView.length-1);this.moveCurrentTo(t);e&&this.commitNew()}return this._newItem}commitNew(){let t=this._newItem;if(null!=t){this._newItem=null;let e=this._pgView.indexOf(t),i=this._digest;this._refreshOnEdit&&this._performRefresh();if(this._trackChanges){let e=this._chgEdited.indexOf(t);e>-1&&this._chgEdited.removeAt(e);this._chgAdded.indexOf(t)<0&&this._chgAdded.push(t)}this._pgView.indexOf(t)!=e||i!=this._digest||this.calculatedFields?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,t,e)}}cancelNew(){let t=this._newItem;null!=t&&this.remove(t)}remove(t){let e=t==this._newItem;e&&(this._newItem=null);t==this._edtItem&&this.cancelEdit();if(!this.canRemove)return;let i=this._src.indexOf(t);if(i>-1){let r=this._view.indexOf(t)<0,s=this.currentItem;this._updating++;this._src.splice(i,1);this._updating--;let n=this._digest;if(this._refreshOnEdit)this._performRefresh();else{this._updating>0&&(this._pendingRemove=!0);let e=this._pgView.indexOf(t);e>=0&&this._pgView.splice(e,1)}if(this._trackChanges){let i=this._chgAdded.indexOf(t);i>-1&&this._chgAdded.removeAt(i);let r=this._chgEdited.indexOf(t);r>-1&&this._chgEdited.removeAt(r);this._chgRemoved.indexOf(t)<0&&!e&&i<0&&this._chgRemoved.push(t)}let o=this.sortDescriptions.length>0,a=this.pageSize>0&&this._pgIdx>-1;o||a||n!=this._getGroupsDigest(this.groups)?this._raiseCollectionChanged():r||this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,i);this.currentItem!==s&&this.onCurrentChanged()}}removeAt(t){t=asInt(t);this.remove(this._pgView[t])}_trackItemChanged(t,e){if(this._trackChanges){let i=this.sourceCollection;if(i&&i.indexOf(t)>-1){let i=this._orgVals,r=i?i.get(t):null;if(e&&!r){i.set(t,e);r=e}let s=this._chgEdited.indexOf(t),n=NotifyCollectionChangedAction.Change;if(r&&this._sameContent(t,r)){s>-1&&this._chgEdited.removeAt(s);return}if(s<0&&this._chgAdded.indexOf(t)<0)this._chgEdited.push(t);else if(s>-1){let e=new NotifyCollectionChangedEventArgs(n,t,s);this._chgEdited.onCollectionChanged(e)}else{s=this._chgAdded.indexOf(t);if(s>-1){let e=new NotifyCollectionChangedEventArgs(n,t,s);this._chgAdded.onCollectionChanged(e)}}}}}_extend(t,e,i=2){for(let r in e)try{let s=e[r];if(i>0&&isObject(s))if("Map"===s.constructor.name)t[r]=s;else{t[r]={};this._extend(t[r],s,i-1)}else t[r]=s}catch(t){}return t}_getChangedFields(t,e,i=2){assert(null!=e&&null!=t,"Two objects expected.");let r={};for(let s in e)try{this._sameValue(t[s],e[s],i)||(r[s]=!0)}catch(t){}for(let s in t)try{r[s]||this._sameValue(t[s],e[s],i)||(r[s]=!0)}catch(t){}let s=Object.keys(r);return s.length?s:null}_sameValue(t,e,i=2){return!!(t===e||DateTime.equals(t,e)||Number.isNaN(t)&&Number.isNaN(e))||!(!isObject(t)||!isObject(e))&&(!(i>0)||null==this._getChangedFields(t,e,i-1))}_sameContent(t,e){return null==this._getChangedFields(t,e)}_needRefresh(t){if(this._pendingRefresh)return!0;if(!t)return!1;if(this._filter)return!0;for(let e=0;e<this._srtDsc.length;e++){let i=this._getBindingRoot(this._srtDsc[e].property);if(t.indexOf(i)>-1)return!0}for(let e=0;e<this._grpDesc.length;e++){let i=this._grpDesc[e];if(!(i instanceof PropertyGroupDescription))return!0;let r=this._getBindingRoot(i.propertyName);if(t.indexOf(r)>-1)return!0}return!1}_getBindingRoot(t){let e=t.indexOf(".");return e>-1?t.substr(0,e):t}get canChangePage(){return this._canChangePage}set canChangePage(t){this._canChangePage=asBoolean(t)}get isPageChanging(){return!1}get itemCount(){return this._pgView.length}get pageIndex(){return this._pgIdx}get pageSize(){return this._pgSz}set pageSize(t){if(t!=this._pgSz){this._pgSz=asInt(t);this.refresh()}}get totalItemCount(){return this._view.length}get pageCount(){return this.pageSize?Math.ceil(this.totalItemCount/this.pageSize):1}moveToFirstPage(){return this.moveToPage(0)}moveToLastPage(){return this.moveToPage(this.pageCount-1)}moveToPreviousPage(){return this.moveToPage(this.pageIndex-1)}moveToNextPage(){return this.moveToPage(this.pageIndex+1)}moveToPage(t){let e=clamp(t,0,this.pageCount-1);if(e!=this._pgIdx){if(!this.canChangePage)return!1;let t=new PageChangingEventArgs(e);if(this.onPageChanging(t)&&this.onCurrentChanging(t)){this.commitEdit();this.commitNew();let t=this.currentItem;this._pgIdx=e;this._pgView=this._getPageView();this._idx=0;if(this.groupDescriptions&&0!=this.groupDescriptions.length)this.refresh();else{this.onCollectionChanged();t!=this.currentItem&&this.onCurrentChanged()}this.onPageChanged()}}return this._pgIdx==t}onPageChanged(t){this.pageChanged.raise(this,t)}onPageChanging(t){this.pageChanging.raise(this,t);return!t.cancel}_getFullGroup(t){let e=this._getGroupByPath(this._fullGroups,t.level,t._path);null!=e&&(t=e);return t}_getGroupByPath(t,e,i){if(t)for(let r=0;r<t.length;r++){let s=t[r];if(s.level==e&&s._path==i)return s;if(s.level<e&&0==i.indexOf(s._path)){s=this._getGroupByPath(s.groups,e,i);if(null!=s)return s}}return null}_getPageView(){if(this.pageSize<=0||this._pgIdx<0)return this._view;let t=this._pgSz*this._pgIdx,e=Math.min(t+this._pgSz,this._view.length);return this._view.slice(t,e)}_createGroups(t){if(!this._grpDesc||!this._grpDesc.length)return null;let e=[],i={},r=null;t.forEach(t=>{let s=e,n=this._grpDesc.length,o="";for(let e=0;e<n;e++){let a=this._grpDesc[e],l=a.groupNameFromItem(t,e),h=e==n-1;r=i[o];if(!r&&isPrimitive(l)){r={};i[o]=r}let u=this._getGroup(a,s,r,l,e,h);o+="/"+l;u._path=o;h&&u.items.push(t);s=u.groups}});return e}_getGroupsDigest(t){let e="";for(let i=0;null!=t&&i<t.length;i++){let r=t[i];e+="{"+r.name+":"+(r.items?r.items.length:"*");if(r.groups.length>0){e+=",";e+=this._getGroupsDigest(r.groups)}e+="}"}return e}_mergeGroupItems(t){let e=[];for(let i=0;i<t.length;i++){let r=t[i];if(!r._isBottomLevel){let t=this._mergeGroupItems(r.groups);for(let e=0,i=t.length;e<i;e++)r._items.push(t[e])}for(let t=0,i=r._items.length;t<i;t++)e.push(r._items[t])}return e}_getGroup(t,e,i,r,s,n){let o;if(i&&isPrimitive(r)){o=i[r];if(o)return o}else for(let i=0;i<e.length;i++)if(t.namesMatch(e[i].name,r))return e[i];let a=new CollectionViewGroup(t,r,s,n);e.push(a);i&&(i[r]=a);return a}}CollectionView._collator="undefined"!=typeof window&&window.Intl&&Intl.Collator?new Intl.Collator:null;export class CollectionViewGroup{constructor(t,e,i,r){this._gd=t;this._name=e;this._level=i;this._isBottomLevel=r;this._groups=[];this._items=[]}get name(){return this._name}get level(){return this._level}get isBottomLevel(){return this._isBottomLevel}get items(){return this._items}get groups(){return this._groups}get groupDescription(){return this._gd}getAggregate(t,e,i,r){let s=tryCast(i,CollectionView);return getAggregate(t,(s?s._getFullGroup(this):this).items,e,r)}_clone(){const t=new CollectionViewGroup(this.groupDescription,this.name,this.level,this.isBottomLevel);t._path=this._path;if(this.groups.length)for(let e=0;e<this.groups.length;e++)t.groups.push(this.groups[e]);if(this.items.length)for(let e=0;e<this.items.length;e++)t.items.push(this.items[e]);return t}}export class _NullValue{constructor(t){this._id=t}}export var controlBaseClass="undefined"!=typeof window&&window["wj-control-is-element"]?HTMLElement:Object;var __isES6Mode=!1;try{let t=class __c{};t.prototype=Array.prototype;__isES6Mode=t.prototype!==Array.prototype}catch(t){__isES6Mode=!0}var __callSuper=__isES6Mode||controlBaseClass!==Object;export class ControlBase extends controlBaseClass{constructor(){__callSuper&&super()}}export class Control extends ControlBase{constructor(t,e=null,i=!1){super();this.workingAs="PureJs";this.disposed=!1;this._orgAttributes=[];this._listeners=[];this._pristine=!0;this._focus=!1;this._updating=0;this._fullUpdate=!1;this._listenResizeEvents=!0;this.gotFocus=new Event;this.lostFocus=new Event;this.invalidInput=new Event;this.refreshing=new Event;this.refreshed=new Event;this._updateWme();assert(null==Control.getControl(t),"Element is already hosting a control.");let r=getElement(t);assert(null!=r,"Cannot find the host element.");this._orgTabIndex=r.hasAttribute("tabindex")?r.tabIndex:0;for(let t=0;t<r.attributes.length;t++){const e=r.attributes[t];this._orgAttributes.push({name:e.name,value:e.textContent})}this._orgInner=r.innerHTML;this._orgTag=r.tagName;this._orgAtts=r.attributes;"INPUT"!=r.tagName&&"SELECT"!=r.tagName||(r=this._replaceWithDiv(r));this._e=r;r[Control._CTRL_KEY]=this;let s=this.addEventListener.bind(this);if(1==i){this._szCtl=new Size(r.offsetWidth,r.offsetHeight);let t=window.ResizeObserver,e=null;t&&(e=this._szObserver=new t(t=>this._resizeObserverCallback(t)));e?e.observe(r):s(window,"resize",this._handleResize.bind(this))}let n=this._handleFocusBlur.bind(this);s(r,"focus",n,!0);s(r,"blur",n,!0);let o=this._handleDisabled.bind(this);s(r,"mousedown",o,!0);s(r,"mouseup",o,!0);s(r,"click",o,!0);s(r,"dblclick",o,!0);s(r,"wheel",o,getEventOptions(!0,!0));s(r,"keydown",t=>{this.isDisabled&&t.keyCode!=Key.Tab&&t.preventDefault()});0==Control._ctlCnt&&_detectTouch(!0);Control._ctlCnt++}getTemplate(){for(let t=Object.getPrototypeOf(this);t;t=Object.getPrototypeOf(t)){let e=t.constructor.controlTemplate;if(e)return e}return null}applyTemplate(t,e,i,r){let s=this._e;t&&addClass(s,t);let n=null;e&&(n=createElement(e,s));let o=s.querySelectorAll("a."+InputFormElementsClsNames.btn);for(var a=0;a<o.length;a++){let t=o[a];setAttribute(t,"role","button",!0);setAttribute(t,"href","",!0);setAttribute(t,"draggable",!1,!0)}let l=s.querySelectorAll("button");for(a=0;a<l.length;a++)setAttribute(l[a],"type","button",!0);let h=s.querySelectorAll("input"),u=1==h.length?h[0]:null;if(u){let t=Control._rxInputAtts;this._copyAttributes(u,s.attributes,t);this._copyAttributes(u,this._orgAtts,t)}if(u&&s.id){let t=s;for(;t.parentElement;)t=t.parentElement;let e=t.querySelector('label[for="'+s.id+'"]');if(e instanceof HTMLLabelElement){let t=getUniqueId(s.id+"_input");u.id=t;e.htmlFor=t}}if(u){let t=u.value,e=!0,i=!1,r=document.createEvent("HTMLEvents");r.initEvent("change",!0,!1);this.gotFocus.addHandler(()=>{e=!1;i=!0;t=u.value});this.addEventListener(s,"focusin",r=>{if(e){i=!0;e=!1;t=u.value}});this.addEventListener(u,"input",()=>{this._pristine=!1;this._getInputValueTimer=setTimeout(()=>{t=u.value})});this.addEventListener(u,"change",e=>{e.isTrusted&&(t=u.value)});const leave=()=>{if(!this._containsFocus()){e=!0;if(this._pristine){this._pristine=!1;this._updateState()}if(i&&t!=u.value){t=u.value;u.dispatchEvent(r)}i=!1}};this.addEventListener(s,"blur",()=>{leave()});this.lostFocus.addHandler(()=>{leave()})}u?s.tabIndex=-1:s.getAttribute("tabindex")||(s.tabIndex=0);this._updateState();if(i)for(let t in i){let e=i[t];this[t]=n.querySelector('[wj-part="'+e+'"]');null==this[t]&&n.getAttribute("wj-part")==e&&(this[t]=n);if(null==this[t])throw'Missing template part: "'+e+'"';if(e==r){let e="name",i=s.attributes[e];i&&i.value&&this[t].setAttribute(e,i.value);e="accesskey";i=s.attributes[e];if(i&&i.value){this[t].setAttribute(e,i.value);s.removeAttribute(e)}}}return n}dispose(){if(!this._e)return;this.disposed=!0;let t=this._e.querySelectorAll("."+ControlClsNames.hostElement);for(let e=0;e<t.length;e++){let i=Control.getControl(t[e]);i&&i.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}let e=this._szObserver;e&&e.disconnect();this.removeEventListener();for(let t in this)if(t.length>2&&0==t.indexOf("on")){let e=this[t[2].toLowerCase()+t.substr(3)];e instanceof Event&&e.removeAllHandlers()}let i=this.collectionView;if(i instanceof CollectionView)for(let t in i){let e=i[t];e instanceof Event&&e.removeHandler(null,this)}if(this._e.parentNode){for(;this._e.attributes.length>0;)this._e.removeAttribute(this._e.attributes[0].name);for(let t of this._orgAttributes)setAttribute(this._e,t.name,t.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}}static getControl(t){let e=getElement(t);return e?asType(e[Control._CTRL_KEY],Control,!0):null}get hostElement(){return this._e}get rightToLeft(){null==this._rtlDir&&(this._rtlDir=!!this._e&&"rtl"==getComputedStyle(this._e).direction);return this._rtlDir}focus(){let t=this._e;t&&t.offsetHeight&&(this.isDisabled||!(t.tabIndex>=0)&&moveFocus(t,0)||t.focus())}containsFocus(){return this._containsFocusImpl(getActiveElement())}_containsFocus(){this.focusService||(this.focusService=new _FocusService);return this._containsFocusImpl(_getActiveElement(this.focusService.activeElement))}_containsFocusImpl(t){return contains(this._e,t,!0)}invalidate(t=!0){this._rtlDir=null;this._fullUpdate=this._fullUpdate||t;if(this._toInv){clearTimeout(this._toInv);this._toInv=null}this.isUpdating||this.disposed||(this._toInv=setTimeout(()=>{this.refresh(this._fullUpdate);this._toInv=null},Control._REFRESH_INTERVAL))}refresh(t=!0){if(!this.isUpdating&&!this.disposed){this.onRefreshing();this.refreshed.hasHandlers&&setTimeout(()=>{this.onRefreshed()})}if(!this.isUpdating&&this._toInv){clearTimeout(this._toInv);this._toInv=null;this._fullUpdate=!1}this._updateState();this._updateWme()}static invalidateAll(t){t||(t=document.body);let e=t.children;if(e)for(let t=0;t<e.length;t++)Control.invalidateAll(e[t]);let i=Control.getControl(t);i&&i.invalidate()}static refreshAll(t){t||(t=document.body);if(t.children)for(let e=0;e<t.children.length;e++)Control.refreshAll(t.children[e]);let e=Control.getControl(t);e&&e.refresh()}static disposeAll(t){let e=Control.getControl(t);if(e)e.dispose();else if(t.children)for(let e=0;e<t.children.length;e++)Control.disposeAll(t.children[e])}beginUpdate(){this._updating++}endUpdate(t=!0){this._updating--;this._updating<=0&&t&&this.invalidate()}get isUpdating(){return this._updating>0}deferUpdate(t){try{this.beginUpdate();t()}finally{this.endUpdate()}}get isTouching(){return Control._touching}get tabOrder(){return this._orgTabIndex}set tabOrder(t){this._setTabOrder(t)}_setTabOrder(t){let e=this._e;this._orgTabIndex=t;let i=e.querySelectorAll("input"),r=1===i.length?i[0]:null;e.tabIndex=this.isDisabled||r?-1:this._orgTabIndex;r&&(r.tabIndex=this._orgTabIndex)}get isDisabled(){return this._e&&null!=this._e.getAttribute("disabled")}set isDisabled(t){this._setIsDisabled(t)}_setIsDisabled(t){if((t=!!asBoolean(t,!0))!=this.isDisabled){let e=this._e;if(e){let i="disabled";toggleClass(e,ControlStateClsNames.disabled,t);setAttribute(e,i,t?i:null);setAttribute(e,"aria-disabled",t);if(e.id){const i=document.querySelector(`[dropdown-id=${e.id}]`);i&&toggleClass(i,ControlStateClsNames.disabled,t)}e.tabIndex=this.isDisabled||1===e.querySelectorAll("input").length?-1:this._orgTabIndex;let r=e.querySelectorAll("input,textarea,button,command,fieldset,keygen,optgroup,option,select"),s=Control._DSBL_KEY;for(let e=0;e<r.length;e++){let i=r[e];if(t){i[s]=i.disabled;i.disabled=!0}else{if(!!closest(i,`.${ControlClsNames.hostElement}.${ControlStateClsNames.disabled}`)){i[s]=i.disabled;i.disabled=!0}else{let t=i[s];isBoolean(t)||(t=!1);i.disabled=t;delete i[s]}}}}}}initialize(t){copy(this,t)}addEventListener(t,e,i,r,s){if(t){null==r&&(r=!1);isBoolean(r)&&null==s&&(e.indexOf("touch")>-1||e.indexOf("wheel")>-1)&&(s=!1);let n=isBoolean(r)&&isBoolean(s)?getEventOptions(r,s):r;t.addEventListener(e,i,n);this._listeners.push({target:t,type:e,fn:i,capture:r})}}removeEventListener(t,e,i,r){let s=0;for(let n=0;n<this._listeners.length;n++){let o=this._listeners[n];if(!(null!=t&&t!=o.target||null!=e&&e!=o.type||null!=i&&i!=o.fn||null!=r&&r!=o.capture)){o.target.removeEventListener(o.type,o.fn,o.capture);this._listeners.splice(n,1);n--;s++}}return s}onGotFocus(t){this.gotFocus.raise(this,t)}onLostFocus(t){this.lostFocus.raise(this,t)}onInvalidInput(t){this.invalidInput.raise(this,t);let e=this;if(t.cancel){let t=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(()=>{Control._toInvalidInput=null;e.containsFocus()||"isDroppedDown"in e&&"_isDropdownOpened"in e&&e._isDropdownOpened&&(e.isDroppedDown=e._isDropdownOpened);e.focus();Control._toClearCtlInvalid=setTimeout(()=>{Control._ctlInvalidInput=null;Control._toClearCtlInvalid=null},t)},t)}}else Control._ctlInvalidInput=null;this._updateState();return!t.cancel}onRefreshing(t){this.refreshing.raise(this,t)}onRefreshed(t){this.refreshed.raise(this,t)}_getProductInfo(){return"B0C3,Control"}_getFocusedElements(t){let e=t;for(;e;){if(!e.parentNode)return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&void 0!==e.host?e.querySelectorAll("."+ControlStateClsNames.focused):document.body.querySelectorAll("."+ControlStateClsNames.focused);e=e.parentNode}return[]}_updateWme(){let t=this._getProductInfo(),e=Control._toWme,i=_updateWme;if(isFunction(i)&&!e[t]){e[t]=!0;i(this,Control._licKey)}}_hasPendingUpdates(){return null!=this._toInv}_handleResize(){if(this._e.parentElement||this._e.parentNode){let t=new Size(this._e.offsetWidth,this._e.offsetHeight);if(!t.equals(this._szCtl)){this._szCtl=t;this._listenResizeEvents&&(t.width||t.height)&&this.invalidate()}}}_resizeObserverCallback(t){t.forEach(t=>{let e=Control.getControl(t.target);e&&e._handleResize()})}_handleFocusBlur(){this._toFocus||(this._toFocus=setTimeout(()=>{this._toFocus=null;this._updateFocusState()},Control._FOCUS_INTERVAL))}_updateFocusState(){this._updateFocusStateTimer=setTimeout(()=>{let t=EventArgs.empty,e=this._getFocusedElements(this.hostElement);for(let i=0;i<e.length;i++){let r=Control.getControl(e[i]);if(r&&r._focus&&!r.containsFocus()){removeClass(r._e,ControlStateClsNames.focus);r._focus=!1;r._updateState();r.onLostFocus(t)}}let i=getActiveElement();if(i){let e=!0;for(let r=i;r;){let i=Control.getControl(r);if(i&&!i._focus&&i.containsFocus()){if(e){addClass(r,ControlStateClsNames.focus);e=!1}i._focus=!0;i._updateState();i.onGotFocus(t)}r=r[Control._OWNR_KEY]||r.parentNode}}})}_updateState(){let t=this.hostElement;if(t){toggleClass(t,ControlStateClsNames.focused,this._focus);this._rtlDir=this._getRtlStates();toggleClass(t,UtilitesClsNames.rtl,this._rtlDir);let e=t.querySelector("input");if(e instanceof HTMLInputElement){toggleClass(t,ControlStateClsNames.empty,0==e.value.length);toggleClass(t,ControlStateClsNames.readOnly,e.readOnly);let i=e.validationMessage;toggleClass(t,ControlStateClsNames.invalid,!this._pristine&&null!=i&&i.length>0);const r=closest(this.hostElement,ControlStateClsNames.labeledInput),s=r&&r.querySelector(ControlStateClsNames.wjError);if(s){const t=this.hostElement.classList.contains(ControlStateClsNames.invalid);toggleClass(s,ControlStateClsNames.errorVisible,t)}}}}_getRtlStates(){let t=this.hostElement;return"rtl"===getComputedStyle(t).direction}_handleDisabled(t){if(this.isDisabled||closest(t.target,"."+ControlStateClsNames.disabled)){t.preventDefault();t.stopPropagation();t.stopImmediatePropagation()}}_replaceWithDiv(t){let e=document.createElement("div");t.parentElement.replaceChild(e,t);e.innerHTML=t.innerHTML;this._copyAttributes(e,t.attributes,/id|style|class/i);return e}_copyAttributes(t,e,i){if(t)for(let r=0;r<e.length;r++){let s=e[r].name;s.match(i)&&t.setAttribute(s,e[r].value)}}_getKeyCode(t){let e=t.keyCode;if(this.rightToLeft)switch(e){case Key.Right:e=Key.Left;break;case Key.Left:e=Key.Right}return e}_getCodeAsPerRTL(t){let e=t.code;if(this.rightToLeft)switch(e){case"ArrowRight":return"ArrowLeft";case"ArrowLeft":return"ArrowRight"}return e}}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;function _detectTouch(t){if("ontouchstart"in window||"onpointerdown"in window){let e=document,i=getEventOptions(!0,!0),r=_handleTouchStart,s=_handleTouchEnd,n=t?e.addEventListener.bind(e):e.removeEventListener.bind(e);if("ontouchstart"in window){n("touchstart",r,i);n("touchend",s,i);n("touchcancel",s,i)}else if("onpointerdown"in window){n("pointerdown",r,i);n("pointerup",s,i);n("pointercancel",s,i)}}}function _handleTouchStart(t){if(null==t.pointerType||"touch"==t.pointerType){if(Control._toTouch){clearTimeout(Control._toTouch);Control._toTouch=null}Control._touching=!0}}function _handleTouchEnd(t){if(null==t.pointerType||"touch"==t.pointerType){Control._toTouch=setTimeout((function(){Control._toTouch=null;Control._touching=!1}),900);if(document.querySelector("ion-app")){let e=t.target;if(closest(e,".wj-dropdown-panel,.wj-dropdown")){e.focus();t.stopPropagation();t.stopImmediatePropagation()}}}}export class PrintDocument{constructor(t){this._title=null;this._copyCss=!0;null!=t&&copy(this,t)}get title(){return this._title}set title(t){this._title=asString(t)}get copyCss(){return this._copyCss}set copyCss(t){this._copyCss=asBoolean(t)}addCSS(t){this._css||(this._css=[]);this._css.push(t)}append(t){let e=this._getDocument();if(isString(t))e.write(t);else if(t instanceof Element){t instanceof HTMLElement&&Control.refreshAll(t);let i=t.cloneNode(!0),r=i.querySelectorAll("input");for(let t=0;t<r.length;t++){let e=r[t];switch(e.type){case"checkbox":setAttribute(e,"checked",!!e.checked||null);setAttribute(e,"indeterminate",!!e.indeterminate||null);break;case"radio":setAttribute(e,"checked",!!e.checked||null);break;default:setAttribute(e,"value",e.value||null)}}e.write(i.outerHTML)}else assert(!1,"content should be an HTML string or an Element.")}print(t){if(this._iframe){this._close();setTimeout(()=>{let e=this._iframe.contentWindow,i="onafterprint"in e&&!isFirefox();i&&(e.onafterprint=()=>{this._afterPrint(t)});if(!(isIE()&&null==e.document.body)&&document.queryCommandSupported("print"))e.document.execCommand("print",!0,null);else{e.focus();e.print()}i||this._afterPrint(t)},100)}}_afterPrint(t){document.body.removeChild(this._iframe);this._iframe=null;isFunction(t)&&t()}_getDocument(){if(!this._iframe){let t=this._iframe=document.createElement("iframe");addClass(t,PrintDocumentClsNames.printDocument);setCss(t,{position:"fixed",left:32e3,top:32e3});document.body.appendChild(t)}return this._iframe.contentDocument}_close(){let 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(t=>{let e=t.querySelectorAll("LINK");for(let t=0;t<e.length;t++){let i=e[t];if(i.rel.match(/stylesheet/i)&&(!i.type||i.type.match(/text\/css/i))){let t=httpRequest(i.href,{async:!1});this._addStyle(t.responseText)}}let i=t.querySelectorAll("STYLE");for(let t=0;t<i.length;t++)this._addStyle(i[t].textContent)});if(this._css)for(let e=0;e<this._css.length;e++){let i=t.createElement("style"),r=httpRequest(this._css[e],{async:!1});i.textContent=r.responseText;t.head.appendChild(i)}}_addStyle(t){let e=this._getDocument(),i=e.createElement("style");i.textContent=t;e.head.appendChild(i)}}export class Clipboard{static copy(t){Clipboard._copyPaste(asString(t),null)}static paste(t){t=asFunction(t);Clipboard._copyPaste(null,t)}static _copyPaste(t,e){let i=getActiveElement(),r=closest(i,"."+ControlClsNames.hostElement);for(;r&&Control.getControl(r);)r=r.parentElement;r=r||document.body;if(r){let s=!1,n=createElement(`<textarea class="${ClipboardClsNames.clipboard}">`,r,{position:"fixed",opacity:"0"});n.onkeydown=t=>t.preventDefault();n.onchange=t=>t.stopImmediatePropagation();if(isString(t)){n.value=t;n.select();document.execCommand("copy")&&(s=!0)}else{n.select();if(isFunction(e)&&document.execCommand("paste")){e(n.value);s=!0}}setTimeout(()=>{i.focus({preventScroll:!0});(isIE()?setTimeout:(t,e)=>t())(()=>removeChild(n),500);!s&&isFunction(e)&&e(n.value)},Control._CLIPBOARD_DELAY)}}}export class _ClickRepeater{constructor(t){this._isDown=!1;this._mousedownBnd=this._mousedown.bind(this);this._mouseupBnd=this._mouseup.bind(this);this._clickBnd=this._click.bind(this);this.element=t;this._connect(!0)}get element(){return this._e}set element(t){this._connect(!1);this._e=asType(t,HTMLElement,!0);this._connect(!0)}get disabled(){return this._disabled}set disabled(t){this._disabled=asBoolean(t)}_connect(t){this._e&&_ClickRepeater._startEvents.forEach(e=>{t?this._e.addEventListener(e,this._mousedownBnd,{passive:!0}):this._e.removeEventListener(e,this._mousedownBnd)})}_clearTimeouts(){if(this._toRepeat){clearTimeout(this._toRepeat);this._toRepeat=null}if(this._toDelay){clearTimeout(this._toDelay);this._toDelay=null}}_mousedown(t){this._isDown&&this._mouseup(null);if(!this._disabled){this._isDown=!0;_ClickRepeater._stopEvents.forEach(t=>{document.addEventListener(t,this._mouseupBnd)});this._clearTimeouts();this._toDelay=setTimeout(()=>{if(this._isDown){this._click();this._toRepeat=setTimeout(this._clickBnd,Control._CLICK_REPEAT)}},Control._CLICK_DELAY)}}_mouseup(t){if(!t||"mouseout"!==t.type||this._e&&this._e.contains(t.target)){this._isDown&&t&&"keydown"!=t.type&&this._clicked&&t.preventDefault();_ClickRepeater._stopEvents.forEach(t=>{document.removeEventListener(t,this._mouseupBnd)});this._clearTimeouts();this._isDown=!1;this._clicked=!1}}_click(){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"];export var PopupPosition;!function(t){t[t.Above=0]="Above";t[t.AboveRight=1]="AboveRight";t[t.RightTop=2]="RightTop";t[t.Right=3]="Right";t[t.RightBottom=4]="RightBottom";t[t.BelowRight=5]="BelowRight";t[t.Below=6]="Below";t[t.BelowLeft=7]="BelowLeft";t[t.LeftBottom=8]="LeftBottom";t[t.Left=9]="Left";t[t.LeftTop=10]="LeftTop";t[t.AboveLeft=11]="AboveLeft"}(PopupPosition||(PopupPosition={}));export function showPopup(t,e,i,r,s=!0,n){let o=t.offsetHeight||t.offsetWidth,a=i;(isBoolean(i)||null==i)&&(a=i?PopupPosition.AboveLeft:PopupPosition.BelowLeft);let l=_getPopupParent(e);_addPopupToDOM(t,l);_copyPopupStyles(t,e,s);Control.refreshAll(t);_updatePopupPosition(t,e,a);isFirefox()&&requestAnimationFrame(()=>{_updatePopupPosition(t,e,a)});e instanceof HTMLElement&&(t[Control._OWNR_KEY]=e);if(!o){_hidePopupOnscroll(t,e,n);if(r)return animate(e=>t.style.opacity=e<1?e.toString():"");t.style.opacity=""}return null}export function hidePopup(t,e=!0,i=!1){let r=null;i?r=animate(i=>{t.style.opacity=(1-i).toString();if(1==i){_hidePopup(t,e);t.style.opacity=""}}):_hidePopup(t,e);return r}export function _updatePopupPosition(t,e,i){let r=_getReferenceRect(t,e),s=_getPopupOffset(t),n=_getPopupPosition(t,r,i,s),o={position:"absolute",zIndex:Control._POPUP_ZINDEX},a=0==s.x;if(a){o.left=n.x;o.top=n.y}else o.transform="translate("+n.x+"px, "+n.y+"px)";let l=t.getBoundingClientRect().width;setCss(t,o);if(a){let e=l-t.getBoundingClientRect().width;e>0&&(t.style.left=n.x-Math.ceil(e)+"px")}}function _hidePopup(t,e){t.style.display="none";e&&t.parentElement&&setTimeout(()=>{if("none"==t.style.display){removeChild(t);isFunction(e)&&e()}},Control._FOCUS_INTERVAL+50);let i=t[Control._SCRL_KEY];i instanceof Control&&i.dispose();delete t[Control._SCRL_KEY];delete t[Control._OWNR_KEY]}function _isjQueryDialog(t){let e=window.jQuery,i=isFunction(e)?e(t):null;return i&&isFunction(i.dialog)&&hasClass(t,"ui-dialog")}function _getPopupParent(t){let e=document.body;if(t instanceof HTMLElement){if(!contains(document.body,t))return e;for(let i=t;i;i=i.parentElement){if("DIALOG"==i.tagName||"ION-CONTENT"==i.tagName||"fixed"==getComputedStyle(i).position){e=i;break}if(_isjQueryDialog(i)){e=i.querySelector(".ui-dialog-content")||i;break}}}return e}function _addPopupToDOM(t,e){if(!t.offsetHeight||!t.offsetWidth||t.parentElement!=e){setCss(t,{opacity:"0",position:"fixed",left:0,top:0,transform:"",display:""});e.appendChild(t)}}function _getPopupOffset(t){let e=document.body,i=document.documentElement,r=t.parentElement,s=new Point(e.scrollLeft||pageXOffset,e.scrollTop||pageYOffset);if(r!=e){let n=r==e?i:t.offsetParent||r;n==e&&(n=r);if(n){let t=n.getBoundingClientRect();s=new Point(n.scrollLeft-t.left,n.scrollTop-t.top)}}if(r instanceof HTMLElement){let t=getComputedStyle(r);s.x-=parseFloat(t.borderLeftWidth);s.y-=parseFloat(t.borderTopWidth)}return s}function _copyPopupStyles(t,e,i){if(e instanceof HTMLElement&&i){let r=i instanceof HTMLElement?i:e,s=getComputedStyle(r);1==new Color(s.backgroundColor).a&&setCss(t,{color:s.color,backgroundColor:s.backgroundColor,fontFamily:s.fontFamily,fontSize:s.fontSize,fontWeight:s.fontWeight,fontStyle:s.fontStyle})}}function _hidePopupOnscroll(t,e,i){let r=e instanceof MouseEvent?e.target:e;if(r instanceof HTMLElement&&r.parentElement!=document.body){let s=Date.now(),n=r.getBoundingClientRect(),o=new Control(document.createElement("div"));t[Control._SCRL_KEY]=o;o.addEventListener(document,"scroll",a=>{if(a.target!=t.parentElement&&Date.now()-s>100&&contains(document,r)&&!contains(t,a.target)&&(a.target!=document||null!=e&&"fixed"==t.style.position)){let e=r.getBoundingClientRect(),s=Math.abs(e.left-n.left),a=Math.abs(e.top-n.top);if(s>1||a>1){isFunction(i)&&i();_hidePopup(t,!0);o.dispose()}}},!0)}}function _getPopupPosition(t,e,i,r){let s=document.documentElement,n=s.clientWidth,o=s.clientHeight,a=PopupPosition;switch(i){case a.AboveLeft:case a.AboveRight:case a.BelowLeft:case a.BelowRight:if(e){let i=e.width;if(i){isIE()&&(i-=t.offsetWidth-t.clientWidth);t.style.minWidth=i+"px"}}}let l=getComputedStyle(t),h=parseFloat(l.marginTop)+parseFloat(l.marginBottom),u=parseFloat(l.marginLeft)+parseFloat(l.marginRight),c=new Size(t.offsetWidth+u,t.offsetHeight+h),d=new Point((n-c.width)/2,Math.round((o-c.height)/2*.7));if(e){"rtl"==l.direction&&(i=_getRtlPosition(i));let t=e.left,r=n-e.right;d.x=e.left;switch(i){case a.Above:case a.Below:d.x=e.left+(e.width-c.width)/2;break;case a.AboveLeft:case a.BelowLeft:d.x=e.left;break;case a.AboveRight:case a.BelowRight:d.x=e.right-c.width;break;case a.Left:case a.LeftTop:case a.LeftBottom:d.x=t>=c.width||t>=r?e.left-c.width:e.right;break;case a.RightTop:case a.RightBottom:case a.Right:d.x=r>=c.width||r>=t?e.right:e.left-c.width}let s=e.top,h=o-e.bottom;switch(i){case a.Above:case a.AboveLeft:case a.AboveRight:d.y=s>c.height||s>h?e.top-c.height:e.bottom;break;case a.Below:case a.BelowLeft:case a.BelowRight:d.y=h>c.height||h>s?e.bottom:e.top-c.height;break;case a.LeftTop:case a.RightTop:d.y=e.top;break;case a.LeftBottom:case a.RightBottom:d.y=e.bottom-c.height;break;case a.Left:case a.Right:d.y=e.bottom-c.height+(c.height-e.height)/2}}d.x=Math.min(d.x,n-c.width);d.y=Math.min(d.y,o-c.height);d.x=Math.max(0,d.x)+r.x;d.y=Math.max(0,d.y)+r.y;return d}function _getRtlPosition(t){let e=PopupPosition;switch(t){case e.AboveLeft:return e.AboveRight;case e.AboveRight:return e.AboveLeft;case e.BelowLeft:return e.BelowRight;case e.BelowRight:return e.BelowLeft;case e.Left:return e.Right;case e.LeftTop:return e.RightTop;case e.LeftBottom:return e.RightBottom;case e.Right:return e.Left;case e.RightTop:return e.LeftTop;case e.RightBottom:return e.LeftBottom}return t}function _getReferenceRect(t,e){return e instanceof MouseEvent?e.clientX<=0&&e.clientY<=0&&e.target instanceof HTMLElement?Rect.fromBoundingRect(e.target.getBoundingClientRect()):new Rect(e.pageX-pageXOffset,e.pageY-pageYOffset,0,0):e instanceof Point?new Rect(e.x,e.y,0,0):e instanceof HTMLElement?Rect.fromBoundingRect(e.getBoundingClientRect()):e&&null!=e.top&&null!=e.left?e:null}export var TooltipTrigger;!function(t){t[t.Focus=0]="Focus";t[t.Hover=1]="Hover";t[t.Both=2]="Both"}(TooltipTrigger||(TooltipTrigger={}));export class Tooltip{constructor(t){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,t)}get position(){return this._position}set position(t){this._position=asEnum(t,PopupPosition)}get trigger(){return this._trigger}set trigger(t){this._trigger=asEnum(t,TooltipTrigger);this._tips.forEach(t=>{this._detach(t.element);this._attach(t.element)})}get isAnimated(){return this._isAnimated}set isAnimated(t){this._isAnimated=asBoolean(t)}setTooltip(t,e,i){t=getElement(t);e=this._getContent(e);let r=this._indexOf(t);if(r>-1){this._detach(t);this._tips.splice(r,1)}if(e){this._attach(t);this._tips.push({element:t,content:e,position:i})}let s=Tooltip._eTip;if(s&&s[Control._TTIP_KEY]==t)if(e){this._setContent(e);s.isConnected&&!this._showAtMouse&&this.show(t,e,null,i)}else this._hideAutoTip()}getTooltip(t){t=getElement(t);let e=this._tips;for(let i=0;i<e.length;i++)if(e[i].element==t)return e[i].content;return null}show(t,e,i,r){t=getElement(t);e=this._getContent(e);if(!t)return;null==r&&(r=this.position);document.addEventListener("keydown",this._keydownHandleBnd);let s=Tooltip._eTip;this.forceRecreate&&s&&s.remove();if(!s||this.forceRecreate){s=Tooltip._eTip=document.createElement("div");addClass(s,TooltipClsNames.hostElement);setAttribute(s,"aria-live","polite");s.style.visibility="none"}if(!s.isConnected){s.id=getUniqueId(t.id+"_toolTip");addAttributeValueToElement(t,"aria-describedby",s.id)}s.setAttribute("class",TooltipClsNames.hostElement);this._tooltipVisibleOnHover&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&s.addEventListener("mouseleave",this._hideAutoTipBnd);addClass(s,this.cssClass);hasClass(t,ControlStateClsNames.invalid)?s.setAttribute("role","alert"):s.setAttribute("role","tooltip");this._setContent(e);s[Control._TTIP_KEY]=t;let n=new TooltipEventArgs(e,t);this.onPopup(n);if(n.content&&!n.cancel){this._setContent(n.content);i||(i=Rect.fromBoundingRect(t.getBoundingClientRect()));let e=this.gap,o=PopupPosition;if(e)switch(r){case o.Above:case o.AboveLeft:case o.AboveRight:case o.Below:case o.BelowLeft:case o.BelowRight:i=i.inflate(0,e);break;default:i=i.inflate(e,0)}showPopup(s,i,r,this.isAnimated);document.addEventListener("mousedown",this._hideAutoTipBnd)}}hide(){let t=Tooltip._eTip;if(t){removeChild(t);removeClass(t,this.cssClass);t.innerHTML="";this._tooltipVisibleOnHover&&t.removeEventListener("mouseleave",this._hideAutoTipBnd);removeAttributeValueFromElement(t[Control._TTIP_KEY],"aria-describedby",t.id)}document.removeEventListener("mousedown",this._hideAutoTipBnd);document.removeEventListener("keydown",this._keydownHandleBnd);this._tooltipVisibleOnHover&&document.removeEventListener("mousemove",this._mousemovedocBnd)}dispose(){this.hide();let t=this._tips;if(t.length){t.forEach(t=>{this._detach(t.element)});t.splice(0,t.length)}if(Tooltip._eTip){Tooltip._eTip[Control._TTIP_KEY]=null;Tooltip._eTip=null}this._clearTimeouts()}get isVisible(){let t=Tooltip._eTip;return null!=t&&null!=t.parentElement&&t.offsetWidth>0}get isContentHtml(){return this._html}set isContentHtml(t){this._html=asBoolean(t)}get cssClass(){return this._cssClass}set cssClass(t){this._cssClass=asString(t)}get gap(){return this._gap}set gap(t){this._gap=asNumber(t)}get showAtMouse(){return this._showAtMouse}set showAtMouse(t){this._showAtMouse=asBoolean(t)}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=asInt(t)}get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=asInt(t)}onPopup(t){this.popup&&this.popup.raise(this,t);return!t.cancel}keydownHandle(t){"Escape"===t.key&&this.hide()}_indexOf(t){for(let e=0;e<this._tips.length;e++)if(this._tips[e].element==t)return e;return-1}_attach(t){if(this._tooltipVisibleOnHover)switch(this._trigger){case TooltipTrigger.Focus:t.addEventListener("focus",this._focusBnd);t.addEventListener("keydown",this._keydownBnd);t.addEventListener("blur",this._hideAutoTipBnd);break;case TooltipTrigger.Both:t.addEventListener("mousemove",this._showAutoTipBnd);t.addEventListener("mouseleave",this._hideAutoTipBnd);t.addEventListener("focus",this._focusBnd);t.addEventListener("keydown",this._keydownBnd);t.addEventListener("blur",this._hideAutoTipBnd);break;default:t.addEventListener("mousemove",this._showAutoTipBnd);t.addEventListener("mouseleave",this._hideAutoTipBnd)}else{t.addEventListener("mousemove",this._showAutoTipBnd);t.addEventListener("mouseleave",this._hideAutoTipBnd)}t.addEventListener("click",this._showAutoTipBnd);this.showAtMouse&&t.addEventListener("mousemove",this._mousemoveBnd)}_detach(t){t.removeEventListener("focus",this._focusBnd);t.removeEventListener("mousemove",this._showAutoTipBnd);t.removeEventListener("mouseleave",this._hideAutoTipBnd);t.removeEventListener("click",this._showAutoTipBnd);t.removeEventListener("mousemove",this._mousemoveBnd);t.removeEventListener("keydown",this._keydownBnd);t.removeEventListener("blur",this._hideAutoTipBnd);t.removeEventListener("mousedown",this._hideAutoTipBnd)}_keydown(t,e){if("Tab"==t.key){this._clearTimeouts();this.hide()}}_focus(t){t&&t.target&&this._showAutoTip(void 0,t.target)}_showAutoTip(t,e){let i=this._hideDelay;if(t&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)){if(t.defaultPrevented)return;if(this._tooltipVisibleOnHover&&"mousemove"==t.type&&this.isVisible&&!1===this._isMouseOutOfTipAndOwner(t))return;if("click"==t.type&&!Control._touching){this._hideAutoTip(t);return}let e=t&&"mouseenter"==t.type?this._showDelay:0;this._clearTimeouts();this._eMouse=t;let r=t.currentTarget;this._toShow=setTimeout(()=>{let t=this._indexOf(r);if(t>-1){let e=this._tips[t],r=this._eMouse,s=this._showAtMouse?new Rect(r.clientX,r.clientY,0,0):null;const n=e&&e.element;if(n&&this._hasOffset(n)){let t=Control.getControl(e.element);if(null==t||0!=t.isVisible){this.show(e.element,e.content,s,e.position);i>0&&(this._toHide=setTimeout(()=>{this.hide()},i))}}}},e)}if(e&&[TooltipTrigger.Focus,TooltipTrigger.Both].includes(this.trigger)){let t=this._showDelay;this._toShow=setTimeout(()=>{let t=this._indexOf(e);if(t>-1){let e=this._tips[t],r=null;const s=e&&e.element;if(s&&this._hasOffset(s)){let t=Control.getControl(e.element);if(null==t||0!=t.isVisible){this.show(e.element,e.content,r,e.position);i>0&&(this._toHide=setTimeout(()=>{this.hide()},i))}}}},t)}}_mousemove(t){let e=Tooltip._eTip;e&&!e.isConnected&&(this._eMouse=t)}_mousemovedoc(t){[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&this._checkBoundsAndHide(t,!1)}_hideAutoTip(t){if(!t)return;if(Tooltip._eTip)if(this._tooltipVisibleOnHover){"mouseleave"==t.type&&document.addEventListener("mousemove",this._mousemovedocBnd);this._checkBoundsAndHide(t,!0)}else if((this.trigger==TooltipTrigger.Hover||this.trigger==TooltipTrigger.Both)&&t&&"click"!=t.type&&"mousedown"!=t.type){this._clearTimeouts();this.hide()}}_checkBoundsAndHide(t,e){if(Tooltip._eTip&&t&&(!0===this._isMouseOutOfTipAndOwner(t)||"blur"==t.type)){e&&this._clearTimeouts();this.hide()}}_clearTimeouts(){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}}_getContent(t){if((t=asString(t))&&"#"==t[0]){let e=getElement(t);e&&(t=e.innerHTML)}return t}_setContent(t){let e=Tooltip._eTip;e&&(this._html?e.innerHTML=t:e.textContent=t)}_hasOffset(t){let e=new Size(t.offsetWidth,t.offsetHeight);if(t instanceof SVGGraphicsElement){let i=t.getBBox();e.width=i.width;e.height=i.height}return e.width>0||e.height>0}get forceRecreate(){return this._forceRecreate}set forceRecreate(t){this._forceRecreate=t}_isMouseOutOfTipAndOwner(t){let e=Tooltip._eTip;if(!e||!t)return;let i=e[Control._TTIP_KEY],r=Rect.fromBoundingRect(e.getBoundingClientRect()),s=Rect.fromBoundingRect(i.getBoundingClientRect()),n=this.gap+2,o=PopupPosition,a=0,l=this._indexOf(i);l>-1&&(a=this._tips[l]&&this._tips[l].position?this._tips[l].position:this.position);switch(a){case o.Above:case o.AboveLeft:case o.AboveRight:s=s.inflate(0,n,0,0);break;case o.Below:case o.BelowLeft:case o.BelowRight:s=s.inflate(0,0,0,n);break;case o.Left:case o.LeftTop:case o.LeftBottom:s=s.inflate(n,0,0,0);break;case o.Right:case o.RightTop:case o.RightBottom:s=s.inflate(0,0,n,0)}let h=t,u=!0;e.getClientRects().length>0&&null!=h&&(u=!(h.clientX>r.left&&h.clientX<r.right&&h.clientY>r.top&&h.clientY<r.bottom));let c=!0;null!=h&&(c=!(h.clientX>s.left&&h.clientX<s.right&&h.clientY>s.top&&h.clientY<s.bottom));return u&&c}}export class TooltipEventArgs extends CancelEventArgs{constructor(t,e){super();this._content=asString(t);this._e=e}get tip(){return Tooltip._eTip}get element(){return this._e}get content(){return this._content}set content(t){this._content=asString(t)}}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={};export function _updateWme(t,e){let i=Control._wme;if(!(i&&contains(document.body,i)&&i.offsetWidth&&i.offsetHeight))if(e){let i=_getControlCode(t);if(!_codes[i]){_codes[i]=!0;_attorn(e,{algorithmCode:"B0",publicKey:"l6/zrbWoSbcLFwEetFh38rH3ErBZE9H+Cqix3R+wTlfA1wD5B+lUcCQn+EJ60I4RGrm0x1sFjkiLWwB0jAn6BWZv0W4WbqAKriOdeoivxDp1Wmjs3qkEDhvbsjPtfvwx2BHil6o+/tDrdMJQSGs18WZm2PoQLQuL+9VhZ4FNRHUQU3Jtioke/OZEGHJOdYVwvCGalzBad6QFOiVbDBQPePpS3++GJzOxN8SN/7lyS5/IdKiy3WJRaVGkB370+HbN6hKraDfUgReLX26yxRaKC/5aWnGAJ2NnWLoGyAGRcwT9dVjo4bcAZNrrA0U9JVKQxaSskhdv2p49XzJkltXx5w=="},r=>{_checkLicense(t,e,r);delete _codes[i]},()=>{_checkLicense(t,e,null);delete _codes[i]})}}else _checkLicense(t,null,null)}function _getControlCode(t){return t._getProductInfo().split(",")[0]}function _getControlName(t){return t._getProductInfo().split(",")[1]}function _checkLicense(t,e,i){let r=culture.Licensing||_licStr,s=null;i?_checkExpiration(t,i)?_checkVersion(t,i)?_checkDomain(t,i)?_checkProductCode(t,i)?_checkEval(t,i)&&(s=r.evl):s=r.prd:s=r.dmn:s=r.ver:s=r.exp:s=e?r.lic:r.mss;if(s){s+="<br/><br/>"+r.ctc;_addWme(t,s,i)}}function _checkProductCode(t,e){let i=_getControlCode(t);if(i&&i.length>=4)for(let t=0;t<e.Prd.length;t++)if(e.Prd[t].C.indexOf(i)>-1)return!0;return!1}function _checkExpiration(t,e){if(e.Exp){let t=e.Exp,i=new Date(parseInt(t.substr(0,4))||0,parseInt(t.substr(4,2))-1||0,parseInt(t.substr(6,2))||0);if(Math.ceil((i.valueOf()-Date.now())/864e5)<=0)return!1}return!0}function _checkVersion(t,e){let i=e.Anl?e.Anl.ver:null,r=getVersion();if(i&&r){return parseInt(i.replace("v",""))+10>=parseInt(r.split(".")[1])}return!0}function _checkDomain(t,e){if(_isLocalHost()||!e.Dms)return!0;let i=location.hostname,r=e.Dms.split(",");for(let t=0;t<r.length;t++)if(_ckHT(i,r[t]))return!0;return!1}export function _ckHT(t,e){var i="^"+e.replace(/\./g,"\\.").replace(/\*/g,"(.*)")+"$";if(new RegExp(i,"i").test(t))return!0;if("*."==e.substr(0,2))return _ckHT(t,e.substr(2));if(isIp(t)&&!isIpv6(t)){let i=ipaddr.parse(t),r=parseCIDR(e);if(r&&matchCIDR(i,r))return!0}return!1}function isIp(t){return isIpv4(t)||isIpv6(t)}function isIpv4(t){return ipaddr.IPv4.isValidFourPartDecimal(t)}function isIpv6(t){return ipaddr.IPv6.isValid(t)}function isIPExactMatch(t,e){return ipaddr.parse(t).toString()===ipaddr.parse(e).toString()}function parseCIDR(t){if(-1===t.indexOf("/"))return!1;let e=t.split("/");if(e[1].indexOf(".")>-1){let i=ipaddr.parse(e[1]).prefixLengthFromSubnetMask();t=[e[0],i].join("/")}try{return ipaddr.parseCIDR(t)}catch(t){return!1}}function matchCIDR(t,e){try{return t.match(e)}catch(t){return!1}}function _checkEval(t,e){return!!e&&e.Evl}function _isLocalHost(){let t=location,e=atob("Xih8bG9jYWxob3N0fGZpZGRsZS5qc2hlbGwubmV0fHJ1bi5wbG5rci5jb3xzLmNvZGVwZW4uaW98bnVsbC5qc2Jpbi5jb218Lio/LnN0YWNrYmxpdHouaW98MTI3LjAuMC4xfFt3LV0rLmxvY2FsfFt3LV0rfDo6MSkk");return"file:"==t.protocol||new RegExp(e,"i").test(t.hostname)}function _addWme(t,e,i){e=_getMessage(t,e,i);if(!_codes[" "]&&!_isLocalHost()&&!_checkEval(t,i)){_codes[" "]=!0;let t=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">'+t.hdr+"</p><p>"+e+'</p></div><div style="text-align:right;margin-top:24pt"><button style="border:none;background:rgba(158,158,158,.2);padding:8px 16px">'+t.cls+"</button></div></div></div>",document.body);i.addEventListener("click",t=>{t.target instanceof HTMLButtonElement&&removeChild(i)})}if(!Control._wme){let i=createElement('<div><a href="'+_getWmeHref()+'" target="_blank" rel="noopener">'+_getMessage(t)+"</a></div>"),r={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:r.right=r.bottom=0;break;case 1:r.left=r.bottom=0;break;case 2:r.right=r.top=0}setCss(i,r);document.body.appendChild(i);Control._wme=i;_addClickableTooltip(i,e)}}function _addClickableTooltip(t,e){let i,r=createElement(e);r.className=TooltipClsNames.hostElement;setCss(r,{pointerEvents:"auto",padding:"10px",margin:"6px"});[t,r].forEach(t=>{t.addEventListener("mouseenter",()=>trackMouse(!0));t.addEventListener("mouseleave",()=>trackMouse(!1))});let s=0;function trackMouse(e){s+=e?1:-1;i&&clearTimeout(i);i=setTimeout(()=>{i=null;1==s?showPopup(r,t.getBoundingClientRect()):s<1&&hidePopup(r)},500)}}function _getWmeHref(){switch(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(t,e,i){if(!e||e.trim().length<15){e=(culture.Licensing||_licStr).evl}(!e||e.trim().length<15)&&(e=atob("V2lqbW8gRXZhbHVhdGlvbiBWZXJzaW9uICh7dmVyc2lvbn0p"));let r=null;if(i&&i.Exp){let t=i.Exp;r=new Date(parseInt(t.substr(0,4))||0,parseInt(t.substr(4,2))-1||0,parseInt(t.substr(6,2))||0)}return e=format(e,{version:getVersion(),domain:location.hostname,control:_getControlName(t),licVer:i&&i.Anl?"5."+i.Anl.ver.replace("v","")+".*":null,licDomain:i?i.Dms:null,expDate:r})}function _attorn(t,e,i,r){let s=parseKeyData(t,e.algorithmCode);if(!s)return r();let n=s.lic,o=s.prefix+"#"+e.algorithmCode;if(tripleHash(o+JSON.stringify(n.D))!=n.H)return r();let a=window.msCrypto||window.crypto,l=a?a.subtle:null;if(!l||!location.protocol.match(/^https/i))return i(n.D);let h={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},u={alg:"RS256",e:"AQAB",kty:"RSA",n:str64ToJwkBase64(e.publicKey)};u=window.msCrypto?str2ArrayBuffer(JSON.stringify(u)):u;try{asPromise(l.importKey("jwk",u,h,!1,["verify"])).then(t=>{let e=arrayBuffer2Str(str64ToArrayBuffer(str64EncodeUnicode(o+JSON.stringify(n.D))));asPromise(l.verify(h,t,str64ToArrayBuffer(n.S),str2ArrayBuffer(e))).then(t=>t?i(n.D):r())},()=>i(n.D))}catch(t){return i(n.D)}}var uint8Array="undefined"==typeof window?null:window.Uint8Array||window.TypedArray;function parseKeyData(t,e){try{e="#"+e;let i=t.indexOf(e);if(i>-1)return{prefix:t.substring(0,i),lic:JSON.parse(decode(t.substr(i+e.length)))}}catch(t){}return null}function decode(t){if(!t)return"";let e=unshiftString(t);e=reverseString(e);let i=Math.ceil(e.length/2);e=e.substr(i)+e.substr(0,i);e=e.replace("#","=");e=e.replace("&","==");return str64DecodeUnicode(e)}function unshiftString(t){let e=t.split("");for(let t=e.length-5;t>=0;t--){swapArrayElements(e,t+1,t+3,unshiftChar);swapArrayElements(e,t,t+2,unshiftChar)}return e.join("")}function swapArrayElements(t,e,i,r){t.length>1&&t.splice(i,1,r(t.splice(e,1,r(t[i]))[0]))}function shiftChar(t,e){let i=t.charCodeAt(0);return i>=65&&i<=90?t.toLowerCase():i>=97&&i<=122?t.toUpperCase():i>=48&&i<=57?String.fromCharCode(48+(i-48+10+e)%10):t}function unshiftChar(t){return shiftChar(t,-1)}function reverseString(t){return t.split("").reverse().join("")}function str64DecodeUnicode(t){let e=atob(t),i="";for(let t=0;t<e.length;t++)i+="%"+("00"+e.charCodeAt(t).toString(16)).slice(-2);return decodeURIComponent(i)}function arrayBuffer2Str(t){return String.fromCharCode.apply(null,new uint8Array(t))}function str64ToArrayBuffer(t){let e=atob(t),i=e.length,r=new uint8Array(i);for(let t=0;t<i;t++)r[t]=e.charCodeAt(t);return r.buffer}function str64EncodeUnicode(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16))))}function str64ToJwkBase64(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")}function str2ArrayBuffer(t){let e=new ArrayBuffer(t.length),i=new uint8Array(e);for(let e=0,r=t.length;e<r;e++)i[e]=t.charCodeAt(e);return e}function tripleHash(t){let e=0,i=5381,r=0;for(let s=t.length-1;s>=0;s--){let n=t.charCodeAt(s);e=n+(e<<6)+(e<<16)-e;i=n+((i<<5)+i);r=n+((r<<5)-r)}let s=e^i^r;s<0&&(s=~s);return s.toString(16).toUpperCase()}function asPromise(t){if("oncomplete"in t){t.then=(e,i)=>{t.resolve=e;t.reject=i};t.oncomplete=e=>{t.resolve(t.result)};t.onerror=e=>{t.reject()}}return t}_registerModule("wijmo",selfModule);
14
+ import*as selfModule from"@mescius/wijmo";export class _Map{constructor(t=!0){if(t)this._h={};else{const t=_getGlobal(),e=t&&t.Map;this._m=e&&new Map||new _ArrayMap}}get isPojoHash(){return null!=this._h}get size(){return this._h&&Object.keys(this._h).length||this._m.size}clear(){this._h?this._h={}:this._m.clear()}delete(t){this._h?delete this._h[t]:this._m.delete(t)}get(t){return this._h?this._h[t]:this._m.get(t)}has(t){return this._h?t in this._h:this._m.has(t)}set(t,e){this._h?this._h[t]=e:this._m.set(t,e);return this}}class _ArrayMap{constructor(){this._d=[]}get size(){return this._d.length}clear(){this._d=[]}delete(t){const e=this._kIdx(t);if(e>-1){this._d.splice(e,1);return!0}return!1}get(t){const e=this._kIdx(t);return e>-1?this._d[e].v:void 0}has(t){return this._kIdx(t)>-1}set(t,e){const s=this._kIdx(t);s>-1?this._d[s].v=e:this._d.push({k:t,v:e});return this}_kIdx(t){const e=this._d,s=e.length;if(t==t){for(let n=0;n<s;n++)if(e[n].k===t)return n}else for(let t=0;t<s;t++){const s=e[t].k;if(s!=s)return t}return-1}}function _getGlobal(){let t=null;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self);return t}function _ipTools(){const t={};var e="(0?\\d+|0x[a-f0-9]+)",s={fourOctet:new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"$"),"i"),threeOctet:new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"$"),"i"),twoOctet:new RegExp("^".concat(e,"\\.").concat(e,"$"),"i"),longValue:new RegExp("^".concat(e,"$"),"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),r="(?:[0-9a-f]+::?)+",o={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?(".concat(r,")?([0-9a-f]+)?(::)?(").concat("%[0-9a-z]{1,}",")?$"),"i"),deprecatedTransitional:new RegExp("^(?:::)(".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"(").concat("%[0-9a-z]{1,}",")?)$"),"i"),transitional:new RegExp("^((?:".concat(r,")|(?:::)(?:").concat(r,")?)").concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"(").concat("%[0-9a-z]{1,}",")?$"),"i")};function expandIPv6(t,e){if(t.indexOf("::")!==t.lastIndexOf("::"))return null;var s,n,i=0,r=-1,a=(t.match(o.zoneIndex)||[])[0];if(a){a=a.substring(1);t=t.replace(/%.+$/,"")}for(;(r=t.indexOf(":",r+1))>=0;)i++;"::"===t.substr(0,2)&&i--;"::"===t.substr(-2,2)&&i--;if(i>e)return null;n=e-i;s=":";for(;n--;)s+="0:";":"===(t=t.replace("::",s))[0]&&(t=t.slice(1));":"===t[t.length-1]&&(t=t.slice(0,-1));return{parts:e=(()=>{var e=t.split(":"),s=[];for(let t=0;t<e.length;t++)s.push(parseInt(e[t],16));return s})(),zoneId:a}}function matchCIDR(t,e,s,n){if(t.length!==e.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(var i,r=0;n>0;){(i=s-n)<0&&(i=0);if(t[r]>>i!=e[r]>>i)return!1;n-=s;r+=1}return!0}function parseIntAuto(t){if(i.test(t))return parseInt(t,16);if("0"===t[0]&&!Number.isNaN(parseInt(t[1],10))){if(n.test(t))return parseInt(t,8);throw new Error("ipaddr: cannot parse ".concat(t," as octal"))}return parseInt(t,10)}function padPart(t,e){for(;t.length<e;)t="0".concat(t);return t}t.IPv4=(()=>{function IPv4(t){if(4!==t.length)throw new Error("ipaddr: ipv4 octet count should be 4");var e,s;for(e=0;e<t.length;e++)if(!(0<=(s=t[e])&&s<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=t}IPv4.prototype.SpecialRanges={unspecified:[[new IPv4([0,0,0,0]),8]],broadcast:[[new IPv4([255,255,255,255]),32]],multicast:[[new IPv4([224,0,0,0]),4]],linkLocal:[[new IPv4([169,254,0,0]),16]],loopback:[[new IPv4([127,0,0,0]),8]],carrierGradeNat:[[new IPv4([100,64,0,0]),10]],private:[[new IPv4([10,0,0,0]),8],[new IPv4([172,16,0,0]),12],[new IPv4([192,168,0,0]),16]],reserved:[[new IPv4([192,0,0,0]),24],[new IPv4([192,0,2,0]),24],[new IPv4([192,88,99,0]),24],[new IPv4([198,51,100,0]),24],[new IPv4([203,0,113,0]),24],[new IPv4([240,0,0,0]),4]]};IPv4.prototype.kind=()=>"ipv4";IPv4.prototype.match=function(t,e){var s;if(void 0===e){t=(s=t)[0];e=s[1]}if("ipv4"!==t.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return matchCIDR(this.octets,t.octets,8,e)};IPv4.prototype.prefixLengthFromSubnetMask=function(){var t,e,s,n=0,i=!1,r={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};for(t=3;t>=0;t-=1){if(!((e=this.octets[t])in r))return null;s=r[e];if(i&&0!==s)return null;8!==s&&(i=!0);n+=s}return 32-n};IPv4.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)};IPv4.prototype.toByteArray=function(){return this.octets.slice(0)};IPv4.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:".concat(this.toString()))};IPv4.prototype.toNormalizedString=function(){return this.toString()};IPv4.prototype.toString=function(){return this.octets.join(".")};return IPv4})();t.IPv4.broadcastAddressFromCIDR=function(t){try{const e=this.parseCIDR(t),s=e[0].toByteArray(),n=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),i=[];let r=0;for(;r<4;){i.push(parseInt(s[r],10)|255^parseInt(n[r],10));r++}return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};t.IPv4.isIPv4=function(t){return null!==this.parser(t)};t.IPv4.isValid=function(t){try{new this(this.parser(t));return!0}catch(t){return!1}};t.IPv4.isValidFourPartDecimal=e=>!(!t.IPv4.isValid(e)||!e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/));t.IPv4.networkAddressFromCIDR=function(t){var e,s,n,i,r;try{n=(e=this.parseCIDR(t))[0].toByteArray();r=this.subnetMaskFromPrefixLength(e[1]).toByteArray();i=[];s=0;for(;s<4;){i.push(parseInt(n[s],10)&parseInt(r[s],10));s++}return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};t.IPv4.parse=function(t){var e=this.parser(t);if(null===e)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(e)};t.IPv4.parseCIDR=function(t){var e;if(e=t.match(/^(.+)\/(\d+)$/)){const t=parseInt(e[2]);if(t>=0&&t<=32){const s=[this.parse(e[1]),t];Object.defineProperty(s,"toString",{value:function value(){return this.join("/")}});return s}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")};t.IPv4.parser=t=>{var e,n,i;if(e=t.match(s.fourOctet))return(()=>{var t=e.slice(1,6),s=[];for(let e=0;e<t.length;e++){n=t[e];s.push(parseIntAuto(n))}return s})();if(e=t.match(s.longValue)){if((i=parseIntAuto(e[1]))>4294967295||i<0)throw new Error("ipaddr: address outside defined range");return(()=>{var t,e=[];for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}return(e=t.match(s.twoOctet))?(()=>{var t=e.slice(1,4),s=[];if((i=parseIntAuto(t[1]))>16777215||i<0)throw new Error("ipaddr: address outside defined range");s.push(parseIntAuto(t[0]));s.push(i>>16&255);s.push(i>>8&255);s.push(255&i);return s})():(e=t.match(s.threeOctet))?(()=>{var t=e.slice(1,5),s=[];if((i=parseIntAuto(t[2]))>65535||i<0)throw new Error("ipaddr: address outside defined range");s.push(parseIntAuto(t[0]));s.push(parseIntAuto(t[1]));s.push(i>>8&255);s.push(255&i);return s})():null};t.IPv4.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(var e=[0,0,0,0],s=0,n=Math.floor(t/8);s<n;){e[s]=255;s++}n<4&&(e[n]=Math.pow(2,t%8)-1<<8-t%8);return new this(e)};t.IPv6=(()=>{function IPv6(t,e){var s,n;if(16===t.length){this.parts=[];for(s=0;s<=14;s+=2)this.parts.push(t[s]<<8|t[s+1])}else{if(8!==t.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=t}for(s=0;s<this.parts.length;s++)if(!(0<=(n=this.parts[s])&&n<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");e&&(this.zoneId=e)}IPv6.prototype.SpecialRanges={unspecified:[new IPv6([0,0,0,0,0,0,0,0]),128],linkLocal:[new IPv6([65152,0,0,0,0,0,0,0]),10],multicast:[new IPv6([65280,0,0,0,0,0,0,0]),8],loopback:[new IPv6([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new IPv6([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new IPv6([0,0,0,0,0,65535,0,0]),96],rfc6145:[new IPv6([0,0,0,0,65535,0,0,0]),96],rfc6052:[new IPv6([100,65435,0,0,0,0,0,0]),96],"6to4":[new IPv6([8194,0,0,0,0,0,0,0]),16],teredo:[new IPv6([8193,0,0,0,0,0,0,0]),32],reserved:[[new IPv6([8193,3512,0,0,0,0,0,0]),32]]};IPv6.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()};IPv6.prototype.kind=()=>"ipv6";IPv6.prototype.match=function(t,e){var s;if(void 0===e){t=(s=t)[0];e=s[1]}if("ipv6"!==t.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return matchCIDR(this.parts,t.parts,16,e)};IPv6.prototype.prefixLengthFromSubnetMask=function(){var t,e,s=0,n=!1,i={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};for(let r=7;r>=0;r-=1){if(!((t=this.parts[r])in i))return null;e=i[t];if(n&&0!==e)return null;16!==e&&(n=!0);s+=e}return 128-s};IPv6.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)};IPv6.prototype.toByteArray=function(){var t,e=[],s=this.parts;for(let n=0;n<s.length;n++){t=s[n];e.push(t>>8);e.push(255&t)}return e};IPv6.prototype.toFixedLengthString=function(){var t=function(){var t=[];for(let e=0;e<this.parts.length;e++)t.push(padPart(this.parts[e].toString(16),4));return t}.call(this).join(":"),e="";this.zoneId&&(e="%".concat(this.zoneId));return t+e};IPv6.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");var e=this.parts.slice(-2),s=e[0],n=e[1];return new t.IPv4([s>>8,255&s,n>>8,255&n])};IPv6.prototype.toNormalizedString=function(){var t=function(){var t=[];for(let e=0;e<this.parts.length;e++)t.push(this.parts[e].toString(16));return t}.call(this).join(":"),e="";this.zoneId&&(e="%".concat(this.zoneId));return t+e};IPv6.prototype.toRFC5952String=function(){for(var t,e=/((^|:)(0(:|$)){2,})/g,s=this.toNormalizedString(),n=0,i=-1;t=e.exec(s);)if(t[0].length>i){n=t.index;i=t[0].length}return i<0?s:"".concat(s.substring(0,n),"::").concat(s.substring(n+i))};IPv6.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")};return IPv6})();t.IPv6.broadcastAddressFromCIDR=function(t){try{const e=this.parseCIDR(t),s=e[0].toByteArray(),n=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),i=[];let r=0;for(;r<16;){i.push(parseInt(s[r],10)|255^parseInt(n[r],10));r++}return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(t,")"))}};t.IPv6.isIPv6=function(t){return null!==this.parser(t)};t.IPv6.isValid=function(t){if("string"==typeof t&&-1===t.indexOf(":"))return!1;try{const e=this.parser(t);new this(e.parts,e.zoneId);return!0}catch(t){return!1}};t.IPv6.networkAddressFromCIDR=function(t){var e,s,n,i,r;try{n=(e=this.parseCIDR(t))[0].toByteArray();r=this.subnetMaskFromPrefixLength(e[1]).toByteArray();i=[];s=0;for(;s<16;){i.push(parseInt(n[s],10)&parseInt(r[s],10));s++}return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(t,")"))}};t.IPv6.parse=function(t){var e=this.parser(t);if(null===e.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(e.parts,e.zoneId)};t.IPv6.parseCIDR=function(t){var e,s,n;if((s=t.match(/^(.+)\/(\d+)$/))&&(e=parseInt(s[2]))>=0&&e<=128){n=[this.parse(s[1]),e];Object.defineProperty(n,"toString",{value:function value(){return this.join("/")}});return n}throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")};t.IPv6.parser=function(t){var e,s,n,i,r,a;if(n=t.match(o.deprecatedTransitional))return this.parser("::ffff:".concat(n[1]));if(o.native.test(t))return expandIPv6(t,8);if(n=t.match(o.transitional)){a=n[6]||"";if((e=expandIPv6(n[1].slice(0,-1)+a,6)).parts){r=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])];for(s=0;s<r.length;s++)if(!(0<=(i=r[s])&&i<=255))return null;e.parts.push(r[0]<<8|r[1]);e.parts.push(r[2]<<8|r[3]);return{parts:e.parts,zoneId:e.zoneId}}}return null};t.IPv6.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>128)throw new Error("ipaddr: invalid IPv6 prefix length");for(var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0,n=Math.floor(t/8);s<n;){e[s]=255;s++}n<16&&(e[n]=Math.pow(2,t%8)-1<<8-t%8);return new this(e)};t.fromByteArray=e=>{var s=e.length;if(4===s)return new t.IPv4(e);if(16===s)return new t.IPv6(e);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")};t.isValid=e=>t.IPv6.isValid(e)||t.IPv4.isValid(e);t.parse=e=>{if(t.IPv6.isValid(e))return t.IPv6.parse(e);if(t.IPv4.isValid(e))return t.IPv4.parse(e);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")};t.parseCIDR=e=>{try{return t.IPv6.parseCIDR(e)}catch(s){try{return t.IPv4.parseCIDR(e)}catch(t){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}};t.process=function(t){var e=this.parse(t);return"ipv6"===e.kind()&&e.isIPv4MappedAddress()?e.toIPv4Address():e};t.subnetMatch=(t,e,s)=>{var n,i,r,o;null==s&&(s="unicast");for(i in e)if(Object.prototype.hasOwnProperty.call(e,i)){(r=e[i])[0]&&!Array.isArray(r[0])&&(r=[r]);for(n=0;n<r.length;n++){o=r[n];if(t.kind()===o[0].kind()&&t.match.apply(t,o))return i}}return s};return t}export const ipaddr=_ipTools();export class Binding{constructor(t){this.path=t}get path(){return this._path}set path(t){this._path=t;this._parts=t?t.split("."):[];for(let t=0;t<this._parts.length;t++){const e=this._parts[t],s=e.indexOf("[");if(s>-1){this._parts[t]=e.substr(0,s);this._parts.splice(++t,0,parseInt(e.substr(s+1)))}}this._key=1==this._parts.length?this._parts[0]:null}getValue(t){if(t){if(this._key)return t[this._key];if(this._path&&this._path in t)return t[this._path];for(let e=0;e<this._parts.length&&t;e++)t=t[this._parts[e]]}return t}setValue(t,e){if(t)try{let s=this._path;if(s in t){t[s]=e;return t[s]==e}for(let e=0;e<this._parts.length-1;e++)if(null==(t=t[this._parts[e]]))return!1;s=this._parts[this._parts.length-1];t[s]=e;return t[s]==e}catch(t){return!1}return!1}}class EventHandler{constructor(t,e){this.handler=t;this.self=e}}export class Event{constructor(t){this._handlers=[];this._handlersChanged=t}addHandler(t,e){t=asFunction(t);this._handlers.push(new EventHandler(t,e));isFunction(this._handlersChanged)&&this._handlersChanged()}getHandler(t=0){const e=this._handlers[t];if(e)return e.handler}removeHandler(t,e){let s=!1;t=asFunction(t);for(let n=0;n<this._handlers.length;n++){const i=this._handlers[n];if(!(i.handler!=t&&null!=t||i.self!=e&&null!=e)){this._handlers.splice(n--,1);s=!0;if(t&&e)break}}s&&isFunction(this._handlersChanged)&&this._handlersChanged()}removeAllHandlers(){const t=this._handlers.length>0;this._handlers.length=0;t&&isFunction(this._handlersChanged)&&this._handlersChanged()}raise(t,e=EventArgs.empty){const s=this._handlers;for(let n=0;n<s.length;n++){const i=s[n];i.handler.call(i.self,t,e);s[n]!==i&&n--}}get hasHandlers(){return this._handlers.length>0}get handlerCount(){return this._handlers.length}}export class EventArgs{}EventArgs.empty=new EventArgs;export class CancelEventArgs extends EventArgs{constructor(){super(...arguments);this.cancel=!1}}export class PropertyChangedEventArgs extends EventArgs{constructor(t,e,s){super();this._name=t;this._oldVal=e;this._newVal=s}get propertyName(){return this._name}get oldValue(){return this._oldVal}get newValue(){return this._newVal}}export class RequestErrorEventArgs extends CancelEventArgs{constructor(t,e){super();this._xhr=t;this._msg=e}get request(){return this._xhr}get message(){return this._msg}set message(t){this._msg=t}}export var NotifyCollectionChangedAction;!function(t){t[t.Add=0]="Add";t[t.Remove=1]="Remove";t[t.Change=2]="Change";t[t.Reset=3]="Reset"}(NotifyCollectionChangedAction||(NotifyCollectionChangedAction={}));export class NotifyCollectionChangedEventArgs extends EventArgs{constructor(t=NotifyCollectionChangedAction.Reset,e=null,s=-1){super();this.action=t;this.item=e;this.index=s}}NotifyCollectionChangedEventArgs.reset=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);export class SortDescription{constructor(t,e){this._bnd=new Binding(t);this._asc=e}get property(){return this._bnd.path}get ascending(){return this._asc}}export class PageChangingEventArgs extends CancelEventArgs{constructor(t){super();this.newPageIndex=t}}export class GroupDescription{groupNameFromItem(t,e){return""}namesMatch(t,e){return t===e}}export class PropertyGroupDescription extends GroupDescription{constructor(t,e){super();this._bnd=new Binding(t);this._converter=e}get propertyName(){return this._bnd.path}groupNameFromItem(t,e){return this._converter?this._converter(t,this.propertyName):this._bnd.getValue(t)}namesMatch(t,e){return t===e}}export const empty={};export const ClipboardClsNames={clipboard:"wj-clipboard"};export const ControlClsNames={content:"wj-content",hostElement:"wj-control",template:"wj-template"};export const 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"};export const 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"};export const 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"};export const PrintDocumentClsNames={printDocument:"wj-printdocument"};export const TooltipClsNames={hostElement:"wj-tooltip"};export const 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"};export const 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"}};const _agent="undefined"!=typeof navigator?navigator.userAgent:"";export function isMobile(){const t=_agent.toLowerCase();return["android","webos","iphone","ipad","ipod","blackberry","windows phone","mobile","mobi","tablet"].some(e=>t.includes(e))}export function isSupportTouch(){return"ontouchstart"in window||navigator.maxTouchPoints>0}const _isiOS=null!=_agent.match(/iPad|iPhone|iPod/i);export function isiOS(){return _isiOS}const _isFF=null!=_agent.match(/Firefox\//);export function isFirefox(){return _isFF}const _isSafari=null!=_agent.match(/^((?!Chrome|Android).)*safari/i);export function isSafari(){return _isSafari}const _isEdge=null!=_agent.match(/Edge\/|Edg\//);export function isEdge(){return _isEdge}const _isIE=null!=_agent.match(/MSIE |Trident\/|Edge\//);export function isIE(){return _isIE}let _isIE9=!1;export function isIE9(){return _isIE9}let _isIE10=!1;export function isIE10(){return _isIE10}let _isChromiumBased=null;export function isChromiumBased(){if(null!=_isChromiumBased)return _isChromiumBased;{_isChromiumBased=!1;const t="undefined"!=typeof navigator?navigator.userAgentData:null;if(t&&t.brands)for(const e of t.brands)if("Chromium"==e.brand){_isChromiumBased=!0;break}return _isChromiumBased}}let _supportsPassive=!1;"undefined"!=typeof document&&document.addEventListener("test",t=>{},{get passive(){_supportsPassive=!0;return!0}});export function getEventOptions(t,e){return _supportsPassive?{capture:t,passive:e}:t}var _supportsFocusOptions=!1;"undefined"!=typeof document&&document.createElement("div").focus({get preventScroll(){_supportsFocusOptions=!0;return!0}});export function supportsFocusOptions(){return _supportsFocusOptions}export function _startDrag(t,e){t.effectAllowed=e;isFirefox()&&t.setData("text","")}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",t=>{if(1==t.which){const e=closest(t.target,"."+ControlClsNames.hostElement);if(e&&!e.style.cursor)for(let e=t.target;e;e=e.parentElement)if(e.attributes&&e.attributes.draggable){e.dragDrop();return!1}}})}}if("undefined"!=typeof window){let t="requestAnimationFrame",e="cancelAnimationFrame";if(!window[t]){let s=0;window[t]=t=>{const e=Date.now(),n=16-(e-s),i=n>0?n:0;s=e+i;return setTimeout(()=>{t(s)},i)};window[e]=clearTimeout}if(!window.atob){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e=new RegExp(`[^${t}]`);window.atob=s=>{let n,i,r,o,a=[],l=0,c=s.length;if(e.test(s)||/=/.test(s)&&(/=[^=]/.test(s)||/={3}/.test(s)))throw new Error("Invalid base64 data");c%4>0&&(c=(s+=Array(4-c%4+1).join("=")).length);for(;l<c;){for(i=[],o=l;l<o+4;)i.push(t.indexOf(s.charAt(l++)));n=(i[0]<<18)+(i[1]<<12)+((63&i[2])<<6)+(63&i[3]);r=[(n&255<<16)>>16,64===i[2]?-1:(65280&n)>>8,64===i[3]?-1:255&n];for(o=0;o<3;++o)(r[o]>=0||0===o)&&a.push(String.fromCharCode(r[o]))}return a.join("")};window.btoa=e=>{let s,n,i=[],r=0,o=e.length;for(;r<o;){n=[e.charCodeAt(r++),e.charCodeAt(r++),e.charCodeAt(r++)];s=(n[0]<<16)+((n[1]||0)<<8)+(n[2]||0);i.push(t.charAt((s&63<<18)>>18),t.charAt((258048&s)>>12),t.charAt(Number.isNaN(n[1])?64:(4032&s)>>6),t.charAt(Number.isNaN(n[2])?64:63&s))}return i.join("")}}}export class _FocusService{constructor(){this._hasDoc="undefined"!=typeof Document;this._ae=this._nativeAe();const t=window,e=this._onBlur.bind(this),s=this._onFocus.bind(this);t.addEventListener("focusout",e,!0);t.addEventListener("focusin",s,!0);if(!isIE()){t.addEventListener("blur",e,!0);t.addEventListener("focus",s,!0)}}get activeElement(){let t=this._ae,e=this._nativeAe();t===_FocusService._noAe?t=this._ae=e:t!=e&&(this._isSpecialRoot(t)||document.body.contains(t)||(t=this._ae=e));return t!==_FocusService._noAe?t:null}_onBlur(t){if(t.isTrusted){const e=t.relatedTarget;this._ae=this._isSpecialRoot(e)?this._nativeAe():e}}_onFocus(t){t.isTrusted&&(this._ae=this._nativeAe())}_isSpecialRoot(t){return null==t||t===document.body||this._hasDoc&&t instanceof Document}_nativeAe(){let t;try{t="unknown"!=typeof document.activeElement?document.activeElement:_FocusService._noAe}catch(e){t=_FocusService._noAe}return t}dispose(){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={};const _getProxyTarget="undefined"!=typeof window&&window.Symbol?Symbol("_getProxyTarget"):"\t_get\tProxy\tTarget\t";export function _getCalculatedArray(t,e,s){const n=new WeakMap;if(!s){const e={};if(t.length){const n=t[0];for(const t in n){const s=typeof n[t];e[t]="string"==s?"":"number"==s?0:null}s=e}}return new Proxy(t,{get(t,i){if(i===_getProxyTarget)return t;if("string"==typeof i||"number"==typeof i){if("indexOf"==i)return(e,s)=>{let n=t.indexOf(e,s);n<0&&e&&(e=e[_getProxyTarget])&&(n=t.indexOf(e,s));return n};const r=parseInt(i);if(!Number.isNaN(r)){let i=t[r];if(i&&!i[_getProxyTarget]){let t=n.get(i);if(!t){t=_createItemProxy(i,e,s);n.set(i,t)}i=t}return i}}return Reflect.get(t,i)}})}function _createItemProxy(t,e,s){if(!t[_getProxyTarget]){if(isIE())for(const s in e)t[s]=null;const n={get:(t,n,i)=>{if(n===_getProxyTarget)return t;if("constructor"===n)return()=>Object.assign({},s||{});const r=e[n];if(r)switch(typeof r){case"function":return r(i);case"string":return _eval(r,i)}return t[n]}};if(!isIE()){n.ownKeys=t=>Object.keys(t).concat(Object.keys(e));n.getOwnPropertyDescriptor=(t,s)=>s in e?{enumerable:!0,configurable:!0,writable:!1}:Reflect.getOwnPropertyDescriptor(t,s)}t=new Proxy(t,n)}return t}export function _getTargetObject(t){return(t?t[_getProxyTarget]:null)||t}function _eval(t,e){const s=[e];return new Function(...["$"],"return "+t)(...s)}var _VERSION="5.20261.45";export class _ENV_TOOLS{}_ENV_TOOLS.isSameInstance=(t,e)=>t==e;_ENV_TOOLS.indexOf=(t,e)=>t.indexOf(e);export const _CLS_STATE_DISABLED=ControlStateClsNames.disabled;export function getVersion(){return _VERSION}export function setLicenseKey(t){Control._licKey=t}export var Key;!function(t){t[t.Back=8]="Back";t[t.Tab=9]="Tab";t[t.Enter=13]="Enter";t[t.Escape=27]="Escape";t[t.Space=32]="Space";t[t.PageUp=33]="PageUp";t[t.PageDown=34]="PageDown";t[t.End=35]="End";t[t.Home=36]="Home";t[t.Left=37]="Left";t[t.Up=38]="Up";t[t.Right=39]="Right";t[t.Down=40]="Down";t[t.Delete=46]="Delete";t[t.X=88]="X";t[t.F1=112]="F1";t[t.F2=113]="F2";t[t.F3=114]="F3";t[t.F4=115]="F4";t[t.F5=116]="F5";t[t.F6=117]="F6";t[t.F7=118]="F7";t[t.F8=119]="F8";t[t.F9=120]="F9";t[t.F10=121]="F10";t[t.F11=122]="F11";t[t.F12=123]="F12";t[t.PlusKey=107]="PlusKey";t[t.EqualPlusKey=187]="EqualPlusKey";t[t.MinusKey=109]="MinusKey";t[t.HyphenMinusKey=189]="HyphenMinusKey";t[t.S=83]="S";t[t.P=80]="P";t[t.F=70]="F"}(Key||(Key={}));export var DataType;!function(t){t[t.Object=0]="Object";t[t.String=1]="String";t[t.Number=2]="Number";t[t.Boolean=3]="Boolean";t[t.Date=4]="Date";t[t.Array=5]="Array"}(DataType||(DataType={}));export function tryCast(t,e){return null==t?null:isString(e)?isFunction(t.implementsInterface)&&t.implementsInterface(e)?t:null:t instanceof e?t:null}export function isPrimitive(t){return isString(t)||isNumber(t)||isBoolean(t)||isDate(t)}export function isString(t){return"string"==typeof t}export function isNullOrWhiteSpace(t){return!t||!/\S/.test(t)}export function isNumber(t){return"number"==typeof t}export function isInt(t){return isNumber(t)&&t==Math.round(t)}export function isBoolean(t){return"boolean"==typeof t}export function isFunction(t){return"function"==typeof t}export function isUndefined(t){return void 0===t}export function isNullOrUndefined(t){return null==t}export function isDate(t){return(t instanceof Date||"[object Date]"===Object.prototype.toString.call(t))&&!Number.isNaN(t.getTime())}export function isArray(t){return t instanceof Array||Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t)}export function _isPlainArray(t){return Array.isArray(t)}export function isObject(t){return null!=t&&"object"==typeof t&&!isDate(t)&&!isArray(t)}export function isEmpty(t){for(var e in t)return!1;return!0}export function _areObjectsEqual(t,e){const s=Object.entries(t),n=Object.entries(e);if(s.length!==n.length)return!1;for(const[t,n]of s)if(!e.hasOwnProperty(t)||e[t]!==n)return!1;return!0}export function getUniqueId(t){let e=t;for(let s=0;null!=document.getElementById(e);s++)e=t+s;return e}export function getSafeUniqueId(t,e="wj",s){let n=t;n=n.trim().toLowerCase();n=n.replace(/[^a-z0-9_-]+/g,"-");n=n.replace(/-+/g,"-").replace(/^-|-$/g,"");n?/^[a-z]/.test(n)&&!s||(n=`${e}-${n}`):n=`${e}-${Date.now()}`;for(let t=0;null!=document.getElementById(n);t++)n+=t;return n}export function uidGenerator(){var t="",e="0123456789abcdef".split("");for(let s=0;s<32;s++){let n=Math.floor(16*Math.random());switch(s){case 8:t+="-";break;case 12:n=4;t+="-";break;case 16:n=3&n|8;t+="-";break;case 20:t+="-"}t+=e[n]}return t}export function mouseToPage(t){if(t instanceof Point)return t;t&&t.touches&&t.touches.length>0&&(t=t.touches[0]);if(isNumber(t.clientX)&&isNumber(t.clientY))return new Point(t.clientX+pageXOffset,t.clientY+pageYOffset);throw"Mouse or touch event expected."}export function getType(t){return isNumber(t)?DataType.Number:isBoolean(t)?DataType.Boolean:isDate(t)?DataType.Date:isString(t)?DataType.String:isArray(t)?DataType.Array:DataType.Object}export function getTypes(t,e=1e3){if(!t)return[];const s=t.length;(e<=0||s<e)&&(e=s);const n=[];if(e){const s=Object.keys(t[0]),i={},r=[...s];for(let s=0;s<e;s++){const e=t[s];for(let n=r.length-1;n>=0;n--){const o=r[n],a=e[o];if(isPrimitive(a)){const e=Object.getOwnPropertyDescriptor(t[s],o);i[o]={binding:o,dataType:getType(a),isReadOnly:e&&!e.writable&&!e.set};r.splice(n,1)}}if(!r.length)break}for(let t=0;t<s.length;t++){const e=i[s[t]];e&&n.push(e)}}return n}export function changeType(t,e,s,n){if(null!=t){const i=DataType;if(isString(t))switch(e){case i.Number:{const e=Globalize.parseFloat(t,s);return Number.isNaN(e)?t:e}case i.Date:{let e=Globalize.parseDate(t,s,isDate(n)?n:null);e||s||!t||(e=new Date(t));return e&&Number.isFinite(e.getTime())?e:t}case i.Boolean:switch(t.toLowerCase()){case"true":return!0;case"false":return!1}return t;case i.Array:try{const e=t.split(",").map(t=>(t=t.trim()).match(/^(\+|-)?\d+\.?\d*$/)?t:`"${t}"`);return JSON.parse(`[${e.join(",")}]`)}catch(t){}}if(e==DataType.String)return Globalize.format(t,s)}return t}export function toFixed(t,e,s){if(s){let s=t.toString(),n=s.indexOf("e"),i=s.indexOf(".");if(n>-1){if("-"===s[n+1]){let r=parseFloat(s.substr(n+2)),o=s.substr(0,n);i>-1&&(o=o.substr(0,i)+o.substr(i+1));s="0."+(Array(r).join("0")+o).substr(0,e);t=parseFloat(s)}}else if(i>-1){s=s.substr(0,i+1+e);t=parseFloat(s)}}else{const s=Math.pow(10,e);t=Math.round(t*s)/s}return t}export function format(t,e,s){if((t=asString(t)).match(/\{.*"count".*:.*"when".*:.*\}/))try{const s=JSON.parse(t);if(isString(s.count)){const n=e[s.count],i=s.when;if(isNumber(n)&&isObject(i)){const e=i[n]||i.other;isString(e)&&(t=e)}}}catch(t){}return t.replace(/\{(.*?)(:(.*?))?\}/g,(t,n,i,r)=>{let o=t;if(n&&"{"!=n[0]&&e){o=new Binding(n).getValue(e);r&&(o=Globalize.format(o,r));s&&(o=s(e,n,r,o))}return null==o?"":o})}export function glbz(...t){let e=[],s=-1;t[0].forEach((n,i)=>{if(i>0&&i!=s){let r=t[i];const o=n.match(/^:([a-z][0-9]*\b)/i)||n.match(/^:'(.+?)'/)||n.match(/^:"(.+?)"/);if(o){r=Globalize.format(r,o[1]);n=n.substr(o[0].length)}else if(":"==n&&i<t.length-1&&(isNumber(r)||isDate(r))){r=Globalize.format(r,t[i+1]);n="";s=i+1}e.push(r)}n&&e.push(n)});return e.join("")}export function evalTemplate(t,e){if(isIE()){const s=/:\${([^}]*)}/g,n=/\${([^}]*)}(:(([A-Za-z]\d*)|"([^"]+)"|'([^']+)'))?/g;return(t=t.replace(s,(t,s)=>":"+_evalExpression(s,e))).replace(n,(t,s,n,i,r,o,a)=>{const l=_evalExpression(s,e);return i?Globalize.format(l,r||o||a):l})}return _evalExpression(t,e)}function _evalExpression(t,e){(e=e||{}).glbz=glbz;const s=parseTpl(t,e);return isIE()?s:glbz`${s}`}function get(t,e,s=`\${${t}}`){return t.split(".").reduce((t,e)=>null!=t&&null!=t[e]?t[e]:s,e)}function parseTpl(t,e,s){return t.replace(/\$\{.+?}/g,t=>get(t.substr(2,t.length-3).trim(),e,s))}export function clamp(t,e,s){if(null!=t){null!=s&&t>s&&(t=s);null!=e&&t<e&&(t=e)}return t}export function copy(t,e,s=!0,n=!1){if(e)for(const i in e)if("_"!=i[0]){assert(i in t,`Unknown property "${i}".`);const r=e[i];if(!t._copy||!t._copy(i,r)){const e=t[i];t[i]instanceof Event?isFunction(r)&&t[i].addHandler(r):!s||!isObject(r)||"undefined"!=typeof Element&&r instanceof Element||!e||!isObject(e)||Object.getPrototypeOf(e).constructor==Object.prototype.constructor&&isWritable(t,i)||"itemsSource"==i?n&&isObject(r)&&Object.getPrototypeOf(r).isPrototypeOf(Object)&&isObject(e)&&!Object.getPrototypeOf(e).isPrototypeOf(Object)?copy(e,r):t[i]=r:copy(e,r)}}return t}export function _isPlainObject(t){return isObject(t)&&Object.getPrototypeOf(t).isPrototypeOf(Object)}export function isWritable(t,e){const s=Object.getOwnPropertyDescriptor(t,e)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||{};return!!s.writable||isFunction(s.set)}export function deepClone(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t)){return t.map(t=>deepClone(t))}const e={};for(const s in t)t.hasOwnProperty(s)&&(e[s]=deepClone(t[s]));return e}export function assert(t,e,s=!0){if(!t){e="** Assertion failed in Wijmo: "+e;const t=new Error;isString(t.stack)&&s&&(e+=" "+t.stack);throw e}}export function _deprecated(t,e){console.error(`** WARNING: "${t}" has been deprecated; please use "${e}" instead.`)}export function _warning(t){console.error('** WARNING: "'+t)}export function asString(t,e=!0){isUndefined(t)&&(t=null);assert(e&&null==t||isString(t),"String expected.");return t}export function asNumber(t,e=!1,s=!1){assert(e&&null==t||isNumber(t),"Number expected.");if(s&&t&&t<0)throw"Positive number expected.";return t}export function asInt(t,e=!1,s=!1){assert(e&&null==t||isInt(t),"Integer expected.");if(s&&t&&t<0)throw"Positive integer expected.";return t}export function asBoolean(t,e=!1){assert(e&&null==t||isBoolean(t),"Boolean expected.");return t}export function asDate(t,e=!1){if(isString(t)){const e=changeType(t,DataType.Date,"r");isDate(e)&&(t=e)}assert(e&&null==t||isDate(t),"Date expected.");return t}export function asFunction(t,e=!0){assert(e&&null==t||isFunction(t),"Function expected.");return t}export function asArray(t,e=!0){assert(e&&null==t||isArray(t),"Array expected.");return t}export function asType(t,e,s=!1){t=tryCast(t,e);assert(s||null!=t,e+" expected.");return t}export function asEnum(t,e,s=!1){if(null==t&&s)return null;const n=isString(t)?e[t]:t;assert(null!=n,`Invalid enum value: "${t}"`);return isNumber(n)?n:t}export function asCollectionView(t,e=!0){if(null==t&&e)return null;const s=tryCast(t,"ICollectionView");if(null!=s)return s;isArray(t)||assert(!1,"Array or ICollectionView expected.");return new CollectionView(t)}export function hasItems(t){return null!=t&&null!=t.items&&t.items.length>0}export function toHeaderCase(t){return t&&t.length?t[0].toUpperCase()+t.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""}export function escapeHtml(t){t&&isString(t)&&(t=t.replace(/[&<>]/g,t=>_ENTITYMAP[t]));return null!=t?t.toString():""}const _ENTITYMAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_specialCharsRegex=/"(.*?)"|[^\w]|_/g;export function getSpecialCharsRegex(){return _specialCharsRegex}export function escapeRegExp(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}export function toPlainText(t){let e=asString(t);if(isString(e)&&e.indexOf("<")>-1){_plainText||(_plainText=document.createElement("div"));_plainText.innerHTML=e;e=_plainText.textContent}return e}var _plainText;export function hasClass(t,e){if(t&&e){if(t instanceof HTMLElement&&t.classList&&!isIE9())return t.classList.contains(e);if(t.getAttribute){const s=new RegExp(`(\\s|^)${e}(\\s|$)`);return t&&s.test(t.getAttribute("class"))}}return!1}export function addClass(t,e=""){if(t&&e){const s=e.trim();if(t instanceof HTMLElement&&t.classList&&!isIE9()){s.indexOf(" ")<0?t.classList.add(s):s.split(" ").forEach(e=>{e.length>0&&t.classList.add(e)});return}t.setAttribute&&s.split(" ").forEach(e=>{if(e.length>0&&!hasClass(t,e)){const s=t.getAttribute("class");t.setAttribute("class",s?`${s} ${e}`:e)}})}}export function removeClass(t,e){if(t&&e){const s=e.trim();if(t instanceof HTMLElement&&t.classList&&!isIE9()){s.indexOf(" ")<0?t.classList.remove(s):s.split(" ").forEach(e=>{e.length>0&&t.classList.remove(e)});0===t.classList.length&&t.removeAttribute("class");return}t.setAttribute&&s.split(" ").forEach(e=>{if(hasClass(t,e)){let s=new RegExp(`((\\s|^)${e}(\\s|$))`,"g"),n=t.getAttribute("class");n=n.replace(s," ").replace(/ +/g," ").trim();n?t.setAttribute("class",n):t.removeAttribute("class")}})}}export function toggleClass(t,e,s){null==s&&(s=!hasClass(t,e));s?addClass(t,e):removeClass(t,e)}export function setAttribute(t,e,s,n){t&&(null!=s?n&&t.getAttribute(e)||("style"===e.toLowerCase()&&(t instanceof HTMLElement||t instanceof SVGElement)?t.style.cssText=s.toString():t.setAttribute(e,s.toString())):t.removeAttribute(e))}export function setInnerHTMLSafe(t,e){e=e.replace(/\bstyle\s*=/gi,"data-wj-style=");t.innerHTML=e;const s=t.querySelectorAll("[data-wj-style]");for(let t=0;t<s.length;t++){const e=s[t],n=e.getAttribute("data-wj-style");n&&(e instanceof HTMLElement||e instanceof SVGElement)&&(e.style.cssText=n);e.removeAttribute("data-wj-style")}}export function setChecked(t,e){const s=null==e;t.checked=isIE()?e||s:e;t.indeterminate=s}export function setAriaLabel(t,e){setAttribute(t,"aria-label",e)}export function setSelectionRange(t,e,s=e,n=!0){assert(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected");if(contains(document.body,t)&&!t.disabled&&t.offsetHeight){try{t.setSelectionRange(e,s,"backward")}catch(t){}if(n)try{t.focus();return!0}catch(t){}}return!1}export function disableAutoComplete(t){const e="autocomplete",s=t.getAttribute(e);s&&"on"!=s||t.setAttribute(e,"off");"autocorrect,autocapitalize,spellcheck".split(",").forEach(e=>{t.setAttribute(e,"spellcheck"==e?"false":"off")})}export function removeChild(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}export function getActiveElement(){let t=document.activeElement;if(t){const e=t.shadowRoot;e&&e.activeElement&&(t=e.activeElement)}return t}export function _getActiveElement(t){let e=t;if(e){const t=e.shadowRoot;t&&t.activeElement&&(e=t.activeElement)}return e}export function moveFocus(t,e){const s=_getFocusableElements(t,e<0);let n=0;if(e){const t=s.indexOf(getActiveElement());t>-1&&(n=(t+e+s.length)%s.length)}if(n<s.length){const t=s[n];t.focus();t instanceof HTMLInputElement&&t.select();return!0}return!1}export function _getFocusableElements(t,e=!1){let s=[],n=Array.prototype.slice.call(t.querySelectorAll("input,select,textarea,button,a,div,label,[tabindex]")),i={};n=n.filter(t=>-1!==t.tabIndex);const isRb=t=>t instanceof HTMLInputElement&&"radio"===t.type;n.forEach(t=>{isRb(t)&&t.checked&&(i[t.name||""]=!0)});n=n.filter(t=>!isRb(t)||t.checked||!i[t.name||""]);n.sort((t,e)=>t.tabIndex===e.tabIndex?0:0===t.tabIndex?1:0===e.tabIndex?-1:t.tabIndex-e.tabIndex);for(let t=0;t<n.length;t++){const i=n[t];if(i.offsetHeight>0&&i.tabIndex>-1&&!i.disabled&&"hidden"!==window.getComputedStyle(i).visibility&&!closest(i,"[disabled],."+ControlStateClsNames.disabled)){if(i instanceof HTMLAnchorElement&&!i.hasAttribute("href"))continue;if(isIE()&&!i.hasAttribute("tabindex")){if(i instanceof HTMLDivElement)continue;const t=Control.getControl(closest(i,".wj-flexgrid"));if(t&&0==t.keyActionTab)continue}if("radio"===i.type&&!i.checked&&s.length>0){const t=s[s.length-1],n=getActiveElement();if("radio"===t.type&&t.name===i.name){e&&t!=n&&(s[s.length-1]=i);continue}}(Control.getControl(i)||!_getFocusableElements(i).length||i.classList.contains("wj-detail"))&&s.push(i)}}return s}export function saveFile(t,e,s="text/plain"){const n=t instanceof Blob;n||!s.match(/\bcsv\b/i)&&!e.match(/\.csv$/i)||(t="\ufeff"+t);const i=n?t:new Blob([t],{type:s}),r=navigator;if(isFunction(r.msSaveOrOpenBlob))r.msSaveOrOpenBlob(i,e);else{let t=document.createElement("a"),click=t=>{const e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null);t.dispatchEvent(e)};if("download"in t){const s=window.URL||window.webkitURL,n=s.createObjectURL(i);t.href=n;t.target="_blank";t.download=e;click(t);t=null;window.setTimeout(()=>{s.revokeObjectURL(n)},3e4)}else{const s=new FileReader;s.onloadend=()=>{t.href=s.result;t.download=e;click(t);t=null};s.readAsDataURL(i)}}}export function getElement(t){if(t instanceof Element||t&&t.appendChild&&t.appendChild instanceof Function)return t;if(isString(t))try{return document.querySelector(t)}catch(t){}return t&&t.jquery?t[0]:null}function processStyleProperty(t){const e=(t=t.replace(";base64,","_wj_")).split(";"),s=[];e.forEach(t=>{let e=[];if(t.indexOf("_wj_")>-1){e=(t=t.replace("_wj_",";base64,").replace("data:image","_wjimg_")).split(":");2==e.length&&(e[1]=e[1].replace("_wjimg_","data:image"))}else e=t.split(":");s.push(e)});return s}export function createElement(t,e,s){t=t.replace(/\bstyle\s*=/gi,"_wj-style=");let n=document.createElement("div");n.innerHTML=t;if(t.indexOf("_wj-style")>-1){const t=n.querySelectorAll("[_wj-style]");for(let e=0;e<t.length;e++){let s=t[e],n=s.getAttribute("_wj-style"),i=[];if(n.indexOf(";base64,")>-1)i=processStyleProperty(n);else{n.split(";").forEach(t=>{i.push(t.split(":"))})}i.forEach(t=>{2==t.length&&(s.style[t[0].trim()]=t[1].trim())});s.removeAttribute("_wj-style")}}1==n.children.length&&(n=n.children[0]);s&&setCss(n,s);e&&(e=getElement(e)).appendChild(n);return n}export function setText(t,e){t.textContent=e||""}export function contains(t,e,s){for(let n=e;n&&t;){if(n===t)return!0;n=(s?n[Control._OWNR_KEY]:null)||n.parentNode||n.host}return!1}export function closest(t,e){if(t){if(isFunction(t.closest))return t.closest(e);const s=t.matches||t.webkitMatchesSelector||t.msMatchesSelector||t.mozMatchesSelector;if(s)for(;t&&1===t.nodeType;t=t.parentElement||t.parentNode)if(s.call(t,e))return t}return null}export function closestClass(t,e){return closest(t,"."+e)}export function enable(t,e){const s=!e,n="disabled";toggleClass(t,ControlStateClsNames.disabled,s);setAttribute(t,n,s?n:null);const i=t.querySelectorAll("input,button");for(let t=0;t<i.length;t++)setAttribute(i[t],n,s?n:null)}export function getElementRect(t){const e=t.getBoundingClientRect();return new Rect(e.left+pageXOffset,e.top+pageYOffset,e.width,e.height)}export function setCss(t,e){assert(isObject(e),"css parameter should be an object");if(t instanceof Array)for(let s=0;s<t.length;s++)setCss(t[s],e);else if(t&&t.style){const s=t.style;for(const t in e){let n=e[t];"number"==typeof n&&t.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(n+="px");s[t]!==n&&(s[t]=n)}}}export function animate(t,e,s,n){null==e&&(e=Control._ANIM_DEF_DURATION);null==s&&(s=Control._ANIM_DEF_STEP);t=asFunction(t);e=asNumber(e,!1,!0);s=asNumber(s,!1,!0);let i,r=Date.now();const o=setInterval(()=>{let s=Math.min(1,(Date.now()-r)/e);s=Math.sin(s*Math.PI/2);s*=s;i&&cancelAnimationFrame(i);i=requestAnimationFrame(()=>{i=null;t(s);s>=1&&n&&n()});s>=1&&clearInterval(o)},s);return o}export class Point{constructor(t=0,e=0){this.x=asNumber(t);this.y=asNumber(e)}equals(t,e=0,s=0){return t instanceof Point&&Math.abs(this.x-t.x)<=e&&Math.abs(this.y-t.y)<=s}clone(){return new Point(this.x,this.y)}}export class Size{constructor(t=0,e=0){this.width=asNumber(t);this.height=asNumber(e)}equals(t){return t instanceof Size&&this.width==t.width&&this.height==t.height}clone(){return new Size(this.width,this.height)}}export class Rect{constructor(t,e,s,n){this.left=asNumber(t);this.top=asNumber(e);this.width=asNumber(s);this.height=asNumber(n)}get right(){return this.left+this.width}get bottom(){return this.top+this.height}equals(t){return t instanceof Rect&&this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height}clone(){return new Rect(this.left,this.top,this.width,this.height)}static fromBoundingRect(t){if(null!=t.left)return new Rect(t.left,t.top,t.width,t.height);if(null!=t.x)return new Rect(t.x,t.y,t.width,t.height);assert(!1,"Invalid source rectangle.")}static union(t,e){const s=Math.min(t.left,e.left),n=Math.min(t.top,e.top),i=Math.max(t.right,e.right),r=Math.max(t.bottom,e.bottom);return new Rect(s,n,i-s,r-n)}static intersection(t,e){const s=Math.max(t.left,e.left),n=Math.max(t.top,e.top),i=Math.min(t.right,e.right),r=Math.min(t.bottom,e.bottom);return new Rect(s,n,i-s,r-n)}contains(t){if(t instanceof Point)return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom;if(t instanceof Rect){const e=t;return e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom}assert(!1,"Point or Rect expected.")}inflate(t,e,s,n){return null!=s&&null!=n?new Rect(this.left-t,this.top-e,this.width+t+s,this.height+e+n):new Rect(this.left-t,this.top-e,this.width+2*t,this.height+2*e)}}export class DateTime{static addDays(t,e){(t=new Date(t.getTime())).setDate(t.getDate()+e);return t}static addMonths(t,e){var s=(t=new Date(t.getTime())).getDate();t.setMonth(t.getMonth()+e);t.getDate()!=s&&t.setDate(0);return t}static addYears(t,e){(t=new Date(t.getTime())).setFullYear(t.getFullYear()+e);return t}static addHours(t,e){(t=new Date(t.getTime())).setHours(t.getHours()+e);return t}static addMinutes(t,e){(t=new Date(t.getTime())).setMinutes(t.getMinutes()+e);return t}static addSeconds(t,e){(t=new Date(t.getTime())).setSeconds(t.getSeconds()+e);return t}static weekFirst(t,e=Globalize.getFirstDayOfWeek()){return DateTime.addDays(t,-(t.getDay()-e))}static weekLast(t,e=Globalize.getFirstDayOfWeek()){t=DateTime.weekFirst(t,e);return DateTime.addDays(t,6)}static monthFirst(t){return DateTime.addDays(t,1-t.getDate())}static monthLast(t){t=DateTime.monthFirst(t);t=DateTime.addMonths(t,1);return DateTime.addDays(t,-1)}static yearFirst(t){return new Date(t.getFullYear(),0,1)}static yearLast(t){return new Date(t.getFullYear(),11,31)}static sameDate(t,e){return isDate(t)&&isDate(e)&&t.getFullYear()==e.getFullYear()&&t.getMonth()==e.getMonth()&&t.getDate()==e.getDate()}static sameTime(t,e){return isDate(t)&&isDate(e)&&t.getHours()==e.getHours()&&t.getMinutes()==e.getMinutes()&&t.getSeconds()==e.getSeconds()&&t.getMilliseconds()==e.getMilliseconds()}static equals(t,e){return null==t&&null==e||isDate(t)&&isDate(e)&&t.getTime()==e.getTime()}static fromDateTime(t,e){if(!t&&!e)return null;t||(t=e);e||(e=t);return DateTime.newDate(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static toFiscal(t,e){const s=culture.Globalize.calendar;return isArray(s.fiscalYearOffsets)?DateTime.addMonths(t,-s.fiscalYearOffsets[e?0:1]):t}static fromFiscal(t,e){const s=culture.Globalize.calendar;return isArray(s.fiscalYearOffsets)?DateTime.addMonths(t,+s.fiscalYearOffsets[e?0:1]):t}static newDate(t,e,s,n,i,r,o){if(null==t||null==e||null==s){const n=new Date;null==t&&(t=n.getFullYear());null==e&&(e=n.getMonth());null==s&&(s=n.getDate())}null==n&&(n=0);null==i&&(i=0);null==r&&(r=0);null==o&&(o=0);const a=new Date(t,e,s,n,i,r,o),l=a.getFullYear();t<100&&l>=1900&&a.setFullYear(a.getFullYear()-1900);return a}static clone(t){return DateTime.fromDateTime(t,t)}}export function httpRequest(t,e){const s=e||{};let n=s.method?asString(s.method).toUpperCase():"GET",i=null==s.async||asBoolean(s.async),r=s.data;if(null!=r&&"GET"==n){const e=[];for(const t in r){let s=r[t];isDate(s)&&(s=s.toJSON());e.push(`${t}=${encodeURIComponent(s)}`)}if(e.length){const s=t.indexOf("?")<0?"?":"&";t+=s+e.join("&")}r=null}const o=new XMLHttpRequest;o.URL_DEBUG=t;let a=!1;if(null!=r&&!isString(r)){a=isObject(r);r=JSON.stringify(r)}o.onload=()=>{if(4==o.readyState){o.status<300?s.success&&asFunction(s.success)(o):s.error&&asFunction(s.error)(o);s.complete&&asFunction(s.complete)(o)}};o.onerror=()=>{if(!isFunction(s.error))throw`HttpRequest Error: ${o.status} ${o.statusText}`;s.error(o)};o.open(n,t,i,s.user,s.password);s.user&&s.password&&o.setRequestHeader("Authorization","Basic "+btoa(`${s.user}:${s.password}`));a&&(()=>{for(const t in s.requestHeaders)if("content-type"===t.toLowerCase())return!1;return!0})()&&o.setRequestHeader("Content-Type","application/json");if(s.requestHeaders)for(const t in s.requestHeaders)o.setRequestHeader(t,s.requestHeaders[t]);isNumber(s.timeout)&&(o.timeout=s.timeout);isFunction(s.beforeSend)&&s.beforeSend(o);o.send(r);return o}const _modules={};export function _registerModule(t,e){_modules[t]=e;if("wijmo"===t){const t="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;t&&(t.wijmo=e)}}export function _getModule(t){return _modules[t]}export function focusFirst(t,e){const s=t.querySelectorAll(e||'button, [href], input, [tabindex]:not([tabindex="-1"])'),n=Array.from(s).filter(t=>t.offsetWidth>0&&t.offsetHeight>0&&!t.hasAttribute("disabled")&&t.tabIndex>=0);if(n.length>0){n[0].focus();return!0}return!1}export const cellCoordinateParserRegex=new RegExp(/('?\w+'?!)?(\$?[A-Za-z]+)(\$?\d+)/,"g");export function getScrollableParent(t){const e=document.scrollingElement;let s="absolute"==getComputedStyle(t).position?t.offsetParent:t.parentElement;for(;s&&s!=e;){if(s.clientHeight!=s.scrollHeight)return s;s="absolute"==getComputedStyle(s).position?s.offsetParent:s.parentElement;t=s}return e}export function getOffsetFromAncestor(t,e){let s=0,n=0,i=0,r=0;for(;t;){n+=t.offsetLeft;s+=t.offsetTop;t=t.offsetParent}for(;e;){r+=e.offsetLeft;i+=e.offsetTop;e=e.offsetParent}return{top:s-i,left:n-r}}export function _isMacOS(){return-1!==navigator.userAgent.indexOf("Mac")}export function _setAriaLabelBy(t,e,s,n){const i=""===s?null:s;if(i!==t.ariaLabelledBy){t._ariaLabelledby=i;setAttribute(e,"aria-labelledby",i);n&&n()}}export function deepElementFromPoint(t,e){let s=document.elementFromPoint(t,e);for(;s&&s.shadowRoot;){const n=s.shadowRoot.elementFromPoint(t,e);if(!n||n===s)break;s=n}return s}export function roundTo(t,e){const s=Math.pow(10,e);return Math.round(t*s)/s}export function addAttributeValueToElement(t,e,s){const n=t.getAttribute(e);if(n){if(!n.split(/\s+/).includes(s)){setAttribute(t,e,`${n} ${s}`)}}else setAttribute(t,e,s)}export function removeAttributeValueFromElement(t,e,s){const n=t.getAttribute(e);if(!n)return;const i=s.toString(),r=n.split(/\s+/).filter(t=>t!==i);r.length>0?t.setAttribute(e,r.join(" ")):t.removeAttribute(e)}export function replaceItems(t,e){const s=new Map(e.map(t=>[""+t.value,t]));return t.map(t=>{const e=""+t.value;return s.has(e)?s.get(e):t})}export function _getTextDecorations(t){const e=[];if(t){t.underline&&e.push("underline");t.strikethrough&&e.push("line-through")}return e.length?e.join(" "):"none"}export class Color{constructor(t){this._r=0;this._g=0;this._b=0;this._a=1;t&&this._parse(t)}get r(){return this._r}set r(t){this._r=clamp(asNumber(t),0,255)}get g(){return this._g}set g(t){this._g=clamp(asNumber(t),0,255)}get b(){return this._b}set b(t){this._b=clamp(asNumber(t),0,255)}get a(){return this._a}set a(t){this._a=clamp(asNumber(t),0,1)}equals(t){return t instanceof Color&&this.r==t.r&&this.g==t.g&&this.b==t.b&&this.a==t.a}toString(){const t=Math.round(100*this.a);return t>99?"#"+((1<<24)+(this.r<<16)+(this.g<<8)+this.b).toString(16).slice(1):`rgba(${this.r},${this.g},${this.b},${t/100})`}static fromRgba(t,e,s,n=1){const i=new Color(null);i.r=Math.round(clamp(asNumber(t),0,255));i.g=Math.round(clamp(asNumber(e),0,255));i.b=Math.round(clamp(asNumber(s),0,255));i.a=clamp(asNumber(n),0,1);return i}static fromHsb(t,e,s,n=1){const i=Color._hsbToRgb(clamp(asNumber(t),0,1),clamp(asNumber(e),0,1),clamp(asNumber(s),0,1));return Color.fromRgba(i[0],i[1],i[2],n)}static fromHsl(t,e,s,n=1){const i=Color._hslToRgb(clamp(asNumber(t),0,1),clamp(asNumber(e),0,1),clamp(asNumber(s),0,1));return Color.fromRgba(i[0],i[1],i[2],n)}static fromString(t){const e=new Color(null);return e._parse(asString(t))?e:null}getHsb(){return Color._rgbToHsb(this.r,this.g,this.b)}getHsl(){return Color._rgbToHsl(this.r,this.g,this.b)}static interpolate(t,e,s){s=clamp(asNumber(s),0,1);const n=Color._rgbToHsl(t.r,t.g,t.b),i=Color._rgbToHsl(e.r,e.g,e.b),r=1-s,o=t.a*r+e.a*s,a=[n[0]*r+i[0]*s,n[1]*r+i[1]*s,n[2]*r+i[2]*s],l=Color._hslToRgb(a[0],a[1],a[2]);return Color.fromRgba(l[0],l[1],l[2],o)}static toOpaque(t,e){if(1==(t=isString(t)?Color.fromString(t):asType(t,Color)).a)return t;e=null==e?Color.fromRgba(255,255,255,1):isString(e)?Color.fromString(e):asType(e,Color);const s=t.a,n=1-s;return Color.fromRgba(t.r*s+e.r*n,t.g*s+e.g*n,t.b*s+e.b*n)}_parse(t){if("transparent"==(t=t.toLowerCase())){this._r=this._g=this._b=this._a=0;return!0}if(t&&0!=t.indexOf("#")&&0!=t.indexOf("rgb")&&0!=t.indexOf("hsl")){const e=document.createElement("div");e.style.color=t;let s=e.style.color;if(s==t){s=window.getComputedStyle(e).color;if(!s){document.body.appendChild(e);s=window.getComputedStyle(e).color;removeChild(e)}}t=s.toLowerCase()}if(0==t.indexOf("#")){if(this._isValidHexColor(t)){if(4==t.length){this.r=parseInt(t[1]+t[1],16);this.g=parseInt(t[2]+t[2],16);this.b=parseInt(t[3]+t[3],16);this.a=1;return!0}if(7==t.length){this.r=parseInt(t.substr(1,2),16);this.g=parseInt(t.substr(3,2),16);this.b=parseInt(t.substr(5,2),16);this.a=1;return!0}}return!1}if(0==t.indexOf("rgb")){const e=t.indexOf("("),s=t.indexOf(")");if(e>-1&&s>-1){const n=t.substr(e+1,s-(e+1)).split(",");if(n.length>2){this.r=parseInt(n[0]);this.g=parseInt(n[1]);this.b=parseInt(n[2]);this.a=n.length>3?parseFloat(n[3]):1;return!0}}}if(0==t.indexOf("hsl")){const e=t.indexOf("("),s=t.indexOf(")");if(e>-1&&s>-1){const n=t.substr(e+1,s-(e+1)).split(",");if(n.length>2){let t=parseInt(n[0])/360,e=parseInt(n[1]),s=parseInt(n[2]);n[1].indexOf("%")>-1&&(e/=100);n[2].indexOf("%")>-1&&(s/=100);const i=Color._hslToRgb(t,e,s);this.r=i[0];this.g=i[1];this.b=i[2];this.a=n.length>3?parseFloat(n[3]):1;return!0}}}return!1}_isValidHexColor(t){return/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(t)}static _hslToRgb(t,e,s){assert(t>=0&&t<=1&&e>=0&&e<=1&&s>=0&&s<=1,"bad HSL values");let n,i,r;if(0==e)n=i=r=s;else{const o=s<.5?s*(1+e):s+e-s*e,a=2*s-o;n=Color._hue2rgb(a,o,t+1/3);i=Color._hue2rgb(a,o,t);r=Color._hue2rgb(a,o,t-1/3)}return[Math.round(255*n),Math.round(255*i),Math.round(255*r)]}static _hue2rgb(t,e,s){s<0&&(s+=1);s>1&&(s-=1);return s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t}static _rgbToHsl(t,e,s){assert(t>=0&&t<=255&&e>=0&&e<=255&&s>=0&&s<=255,"bad RGB values");t/=255;e/=255;s/=255;const n=Math.max(t,e,s),i=Math.min(t,e,s);let r,o;const a=(n+i)/2;if(n==i)r=o=0;else{const l=n-i;o=a>.5?l/(2-n-i):l/(n+i);switch(n){case t:r=(e-s)/l+(e<s?6:0);break;case e:r=(s-t)/l+2;break;case s:r=(t-e)/l+4}r/=6}return[r,o,a]}static _rgbToHsb(t,e,s){assert(t>=0&&t<=255&&e>=0&&e<=255&&s>=0&&s<=255,"bad RGB values");const n=Color._rgbToHsl(t,e,s);return Color._hslToHsb(n[0],n[1],n[2])}static _hsbToRgb(t,e,s){const n=Color._hsbToHsl(t,e,s);return Color._hslToRgb(n[0],n[1],n[2])}static _hsbToHsl(t,e,s){assert(t>=0&&t<=1&&e>=0&&e<=1&&s>=0&&s<=1,"bad HSB values");const n=clamp(s*(2-e)/2,0,1),i=1-Math.abs(2*n-1),r=clamp(i>0?s*e/i:e,0,1);assert(!Number.isNaN(n)&&!Number.isNaN(r),"bad conversion to HSL");return[t,r,n]}static _hslToHsb(t,e,s){assert(t>=0&&t<=1&&e>=0&&e<=1&&s>=0&&s<=1,"bad HSL values");const n=clamp(1==s?1:(2*s+e*(1-Math.abs(2*s-1)))/2,0,1),i=clamp(n>0?2*(n-s)/n:e,0,1);assert(!Number.isNaN(n)&&!Number.isNaN(i),"bad conversion to HSB");return[t,i,n]}}export var 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]}}};export class Globalize{static format(t,e,s,n,i){if(isString(t))return t;if(isNumber(t)){e=e||(t==Math.round(t)?"n0":"n2");return Globalize.formatNumber(t,e,s,n,i)}if(isDate(t)){e=e||Globalize.DefaultDateFormat;return Globalize.formatDate(t,e)}return null!=t?t.toString():""}static formatNumber(t,e,s,n,i){t=asNumber(t);e=asString(e);let r,o=culture.Globalize.numberFormat,a=Globalize._parseNumericFormat(e),l=a.spec,c=a.prec,h=o["."]||".",u=o[","]||",",d=o["-"]||"-",p=Math;null==c&&(c=null!=i?i:"c"==l?o.currency.decimals:"e"==l?6:"r"==l?15:t==p.round(t)?0:2);a.scale&&(t/=p.pow(10,a.scale));if("d"==l||"x"==l){r=(n?p.floor:p.round)(p.abs(t)).toString("d"==l?10:16);for(;r.length<c;)r="0"+r;t<0&&(r=d+r);return"X"==a.specRaw?r.toUpperCase():r}n&&"p"!=l&&"e"!=l&&(t=toFixed(t,c,!0));switch(l){case"e":r=t.toExponential(c);"E"==a.specRaw&&(r=r.replace("e","E"));break;case"c":r=Globalize._toFixedStr(p.abs(t),c);break;case"p":t=Globalize._shiftDecimal(t,2,14);n&&(t=toFixed(t,c,n));r=Globalize._toFixedStr(p.abs(t),c);break;default:r=Globalize._toFixedStr(t,c);"-"!=r[0]||r.match(/[1-9]/)||(r=r.substr(1))}(s||"g"==l||"r"==l)&&r.indexOf(".")>-1&&(r=r.replace(/(\.\d*?)0+$/g,"$1").replace(/\.$/,""));"."!=h&&(r=r.replace(".",h));"-"!=d&&(r=r.replace("-",d));if(u&&("n"==l||"c"==l||"p"==a.specRaw||"F"==a.specRaw||"G"==a.specRaw)){const t=r.indexOf(h),e=/\B(?=(\d\d\d)+(?!\d))/g;r=t>-1?r.substr(0,t).replace(e,u)+r.substr(t):r.replace(e,u)}if("c"==l){let e=t<0&&r.match(/[1-9]/)?0:1,s=o.currency.pattern[e],n=a.curr||o.currency.symbol;"​"==n&&(n="");r=s.replace("n",r).replace("$",n)}if("p"==l){const e=t<0&&r.match(/[1-9]/)?0:1,s=o.percent.pattern[e],n=o["%"]||"%";r=s.replace("n",r);"%"!=n&&(r=r.replace("%",n));"-"!=d&&0==e&&(r=r.replace("-",d))}return a.prefix||a.suffix?a.prefix+r+a.suffix:r}static formatDate(t,e){t=asDate(t);switch(e){case"r":case"R":return t.toUTCString();case"u":return t.toISOString().replace(/\.\d{3}/,"")}e=Globalize._expandFormat(e);return Globalize._parseDateFormat(e).map(s=>Globalize._formatDatePart(t,e,s)).join("")}static parseInt(t,e){return Math.round(Globalize.parseFloat(t,e))}static parseFloat(t,e){const s=Globalize._parseNumericFormat(e),n=s.prefix;n&&0==t.indexOf(n)&&(t=t.substring(n.length));const i=s.suffix;if(i){const e=t.lastIndexOf(i);e>-1&&e==t.length-i.length&&(t=t.substring(0,t.length-i.length))}let r=culture.Globalize.numberFormat,o=r["."]||".",a=r[","]||",",l=r["-"]||"-",c=r["%"]||"%",h=s.curr||r.currency.symbol||"$",u=t.indexOf(c)>-1,d=t.indexOf("(")>-1&&t.indexOf(")")>-1,p=0;if("x"==s.spec)p=parseInt(t,16);else{[h,c,"(",")"].forEach(e=>{t=t.replace(e,"")});/\s/.test(a)&&(t=t.replace(/\s+/g,""));const e=(t=t.replace(new RegExp("\\"+a,"g"),"").replace(new RegExp("\\"+l,"g"),"-").replace(/(\+|-)\s+/g,"$1").replace(o,".").trim()).length;if(!d&&e&&"-"==t[e-1]){d=!0;t=t.substring(0,e-1)}p=/^\s*(\+|-)?\d*(\.\d*)?(\s*E(\+|-)?\d+)?\s*$/i.test(t)?parseFloat(t):Number.NaN}if(!Number.isNaN(p)){d=d||p<0;p=Math.abs(p);u&&(p=Globalize._shiftDecimal(p,-2));d&&(p=-p);s.scale&&(p*=Math.pow(10,s.scale))}return p}static parseDate(t,e,s){if(!(t=asString(t)))return null;if("u"==e)return new Date(t);let n;if("R"==e||"r"==e){const e=/((\d+)-(\d+)-(\d+))?\s?((\d+):(\d+)(:(\d+))?)?/,s=t.match(e);if(s[1]||s[5]){n=s[1]?new Date(parseInt(s[2]),parseInt(s[3])-1,parseInt(s[4])):new Date;if(s[5]){n.setHours(parseInt(s[6]));n.setMinutes(parseInt(s[7]));n.setSeconds(s[8]?parseInt(s[9]):0)}}else n=new Date(t);return Number.isNaN(n.getTime())?null:n}e=Globalize._expandFormat(e||"d");let i=culture.Globalize.calendar,r=Globalize._CJK,o=new RegExp("(\\"+i["/"]+")|(\\"+i[":"]+")|(\\d+)|(["+r+"\\.]{2,})|(["+r+"]+)","gi"),a=t.match(o),l=Globalize._parseDateFormat(e),c=0;if(!(a&&a.length&&l&&l.length))return null;let h,u,d,p,f,g=-1,_=0,m=1,b=0,C=0,v=0,w=0,y=-1,x=null;if(s=asDate(s,!0)){_=s.getMonth();m=s.getDate();b=s.getHours();C=s.getMinutes();v=s.getSeconds();w=s.getMilliseconds()}for(let t=0;t<l.length&&a;t++){let e=t-c,s=e>-1&&e<a.length?a[e]:"",n=l[t].length;switch(l[t]){case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":f=l[t];case"yyyy":case"yyy":case"yy":case"y":if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}g=parseInt(s);p=4==s.length;break;case"MMMM":case"MMM":{d=!0;_=-1;const e=s.toLowerCase(),n="MMMM"==l[t]?i.months:i.monthsAbbr;for(let t=0;t<12;t++)if(0==n[t].toLowerCase().indexOf(e)){_=t;break}if(_>-1)break}case"MM":case"M":d=!0;if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}_=parseInt(s)-1;break;case"dddd":case"ddd":h=!0;break;case"dd":case"d":if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}m=parseInt(s);u=!0;break;case"hh":case"h":if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}b=parseInt(s);b=12==b?0:b;break;case"HH":if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}b=parseInt(s);break;case"H":b=parseInt(s);break;case"mm":case"m":if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}C=parseInt(s);break;case"ss":case"s":if(n>1&&s.length>n){a[e]=s.substr(n);s=s.substr(0,n);c++}v=parseInt(s);break;case"fffffff":case"FFFFFFF":case"ffffff":case"FFFFFF":case"fffff":case"FFFFF":case"ffff":case"FFFF":case"fff":case"FFF":case"ff":case"FF":case"f":case"F":w=parseInt(s)/Math.pow(10,n-3);break;case"tt":case"t":s=s.toUpperCase();b<12&&i.pm.indexOf(s)>-1&&(b+=12);break;case"q":case"Q":case"u":case"U":y=parseInt(s);break;case"ggg":case"gg":case"g":case'"г."':x=i.eras.length>1?Globalize._getEra(s,i):i.eras.length>0?i.eras[0]:null;if(i.eras.length>0&&!x)return null;break;case"/":case":":if(s&&s!=i[l[t]])return null;break;case i["/"]:case i[":"]:if(s&&s!=l[t])return null;break;case"K":break;default:Globalize._unquote(l[t]).trim()!=s.trim()&&c++}}if(d&&u){Number.isNaN(b)&&(b=0);Number.isNaN(C)&&(C=0);Number.isNaN(v)&&(v=0)}if(_<0||_>11||Number.isNaN(_)||m<1||m>31||Number.isNaN(m)||b<0||b>=24||Number.isNaN(b)||C<0||C>=60||Number.isNaN(C)||v<0||v>=60||Number.isNaN(v))return null;if(a.length+c>l.length)return null;if(f){if(!d)return null;const t=culture.Globalize.calendar;if(isArray(t.fiscalYearOffsets)){const e="E"==f[0],s=_-t.fiscalYearOffsets[e?0:1];g+=s>11?-1:s<0?1:0}}if(h&&!u)return null;!d&&y>=1&&y<=4&&(_=3*(y-1));if(Number.isNaN(g)||g<0)g=s?s.getFullYear():(new Date).getFullYear();else if(x&&x.start)g=g+x.start.getFullYear()-1;else if(g<100&&!p){const t=isNumber(i.twoDigitYearMax)?i.twoDigitYearMax:2029;t>99&&(g+=g+2e3<=t?2e3:1900)}n=DateTime.newDate(g,_,m,b,C+0,v,w);return n.getMonth()!=_||n.getDate()!=m||Number.isNaN(n.getTime())?null:n}static getFullFormat(t){return Globalize._expandFormat(t)}static getFirstDayOfWeek(){const t=culture.Globalize.calendar.firstDay;return t||0}static getNumberDecimalSeparator(){const t=culture.Globalize.numberFormat["."];return t||"."}static _toFixedStr(t,e){const s=t.toString(),n=s.indexOf("."),i=e-(s.length-n)+1,r=s.indexOf("e")>-1;if(!r&&n>-1&&i>=0)return s+Array(i+1).join("0");if(n>-1&&!r&&"5"==s[s.length-1]){t=+`${Math.round(+`${Math.abs(t)}e${e}`)}e${-e}`*(t<0?-1:1)}return t.toFixed(e)}static _unquote(t){return t.length>1&&t[0]==t[t.length-1]&&("'"==t[0]||'"'==t[0])?t.substr(1,t.length-2):t}static _parseNumericFormat(t){let e=Globalize._numFormatInfo[t];if(!e){let s=t&&t.match(/("(.*?)"\s*)?([a-z]+)\s*(\d*)\s*(,*)(\s*"(.*?)"\s*)?(.*)/i)||[],n=s[3]?s[3]:"n";if(n.length>1){s=[];n="n"}e={prefix:s[2]||"",spec:n.toLowerCase(),specRaw:n,prec:s[4]?parseInt(s[4]):null,scale:s[5]?3*s[5].length:0,suffix:s[7]||"",curr:s[8]||null};Globalize._numFormatInfo[t]=e}return e}static _parseDateFormat(t){let e=Globalize._dateFormatParts[t];if(!e){e=[];if(t){let s,n;for(s=0;s>-1&&s<t.length;s++){const i=t[s];if("'"==i||'"'==i){n=t.indexOf(i,s+1);if(n>-1){e.push(t.substring(s,n+1));s=n;continue}}if("\\"==i&&s<t.length-1){s++;e.push(`"${t[s]}"`)}else{n=s+1;for(;n<t.length&&t[n]==i;n++);e.push(t.substring(s,n));s=n-1}}}Globalize._dateFormatParts[t]=e}return e}static _formatDatePart(t,e,s){let n,i=culture.Globalize.calendar,r=null,o=0,a=0,l=s.length;switch(s){case"yyyy":case"yyy":case"yy":case"y":case"EEEE":case"EEE":case"EE":case"E":case"eeee":case"eee":case"ee":case"e":{n="E"==s[0]?DateTime.toFiscal(t,!0):"e"==s[0]?DateTime.toFiscal(t,!1):t;o=n.getFullYear();if(i.eras.length>1&&e.indexOf("g")>-1){r=Globalize._getEra(t,i);r&&(o=isDate(r.start)?o-r.start.getFullYear()+1:Math.abs(o))}const a=s.length<3?o%100:3==s.length?o%1e3:o;return Globalize._zeroPad(a,s.length)}case"MMMMM":return i.monthsAbbr[t.getMonth()][0];case"MMMM":return i.months[t.getMonth()];case"MMM":return i.monthsAbbr[t.getMonth()];case"MM":case"M":return Globalize._zeroPad(t.getMonth()+1,l);case"dddd":return i.days[t.getDay()];case"ddd":return i.daysAbbr[t.getDay()];case"dd":return Globalize._zeroPad(t.getDate(),2);case"d":return t.getDate().toString();case"hh":case"h":return Globalize._zeroPad(Globalize._h12(t),l);case"HH":case"H":return Globalize._zeroPad(t.getHours(),l);case"mm":case"m":return Globalize._zeroPad(t.getMinutes(),l);case"ss":case"s":return Globalize._zeroPad(t.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=t.getMilliseconds()*Math.pow(10,l-3);return"f"==s[0]?Globalize._zeroPad(a,l):a.toFixed(0);case"tt":return t.getHours()<12?i.am[0]:i.pm[0];case"t":return t.getHours()<12?i.am[1]:i.pm[1];case"q":case"Q":return(Math.floor(t.getMonth()/3)+1).toString();case"u":case"U":n=DateTime.toFiscal(t,"U"==s);return(Math.floor(n.getMonth()/3)+1).toString();case"ggg":case"gg":case"g":if(i.eras.length>1){r=Globalize._getEra(t,i);if(r){if(isString(r))return r;switch(s){case"gg":return r.name[0];case"g":return r.symbol;default:return r.name}}}return i.eras[0];case":":case"/":return i[s];case"K":{const e=t.toString().match(/(\+|-)(\d{2})(\d{2})/);return e?e[1]+e[2]+e[3]:""}case"zzz":case"zz":case"z":{let e,n=-t.getTimezoneOffset(),r=Math.abs(n),o=Globalize.formatNumber;switch(s){case"zzz":e=o(r/60,"d2",!1,!0)+i[":"]+o(r%60,"d2",!1,!0);break;case"zz":e=o(r/60,"d2",!1,!0);break;case"z":e=o(r/60,"d1",!1,!0)}return(n>=0?"+":"-")+e}}return l>1&&s[0]==s[l-1]&&('"'==s[0]||"'"==s[0])?s.substr(1,l-2):s}static _getEra(t,e){if(e.eras){const s=e.eras,n=e.eras.length;if(isDate(t)){if(isString(s[0]))return s[t.getFullYear()>=0?0:1];if(isDate(s[0].start)){for(let e=0;e<n;e++)if(t>=s[e].start)return s[e];return s[n-1]}}else if(isString(t)&&t.length>0){t=t.toLowerCase();for(let e=0;e<n;e++){const n=s[e];if(isString(n)){if(0==n.toLowerCase().indexOf(t))return n}else if(n.name&&0==n.name.toLowerCase().indexOf(t)||n.symbol&&0==n.symbol.toLowerCase().indexOf(t))return n}}}return null}static _expandFormat(t){const e=culture.Globalize.calendar.patterns[t];return e||t}static _zeroPad(t,e){const s=t.toFixed(0),n=e-s.length+1;return n>0?Array(n).join("0")+s:s}static _h12(t){let e=culture.Globalize.calendar,s=t.getHours();if(e.am&&e.am[0]){s%=12;0==s&&(s=12)}return s}static _shiftDecimal(t,e,s){if(0==e||isNaN(t))return t;let n=t.toString();if(n.indexOf("e")>-1){let n=t*Math.pow(10,e);null!=s&&(n=parseFloat(n.toFixed(s)));return n}const i=Array(Math.abs(e)+1).join("0");e<0&&(n=i+n);var r=n.indexOf(".");if(r<0){n+=".";r=n.indexOf(".")}e>0&&(n+=i);r+=e;n=n.replace(".","");n=`${n.substr(0,r)}.${n.substr(r)}`;return parseFloat(n)}}Globalize.DefaultDateFormat="d";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={};export const _loadedCultures="undefined"!=typeof window&&window.wijmo&&window.wijmo._loadedCultures||{};export function _updateCulture(t){culture=t;_loadedCultures[t.Globalize.name]=t}export function _addCultureInfo(t,e){const s="undefined"!=typeof window?window.wijmo:null,n=s?s.culture:null,i=n?n[t]:null;culture[t]=i||e}export const changeCultureSync=(t,e)=>{const s=document.getElementsByTagName("script");for(let t=0;t<s.length;t++){const e=s[t];if(e.src.indexOf("wijmo.culture.")>-1){e.parentElement.removeChild(e);break}}const n=_loadedCultures[t]||void 0;if(n){const t=window.wijmo._updateCulture;t?t(n):window.wijmo.culture=n;e&&e();window.wijmo.Control.invalidateAll()}return n};export const changeCulture=t=>new Promise((e,s)=>{const n=changeCultureSync(t);n?e(n):s()});export class _MaskProvider{constructor(t,e="",s="_"){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(e);this.input=t;this.promptChar=asString(s,!1);this._connect(!0);this._evtInput=document.createEvent("HTMLEvents");this._evtInput.initEvent("input",!0,!1)}get input(){return this._tbx}set input(t){this._connect(!1);this._tbx=t;this._connect(!0)}get mask(){return this._msk}set mask(t){if(t!=this._msk){this._msk=asString(t,!0);this._parseMask();this._valueChanged()}}get promptChar(){return this._promptChar}set promptChar(t){if(t!=this._promptChar){assert(1==(t=asString(t,!1)).length,"promptChar must be a string with length 1.");const e=this._tbx;let s=e.value,n="",i=this._mskArr,r=this._promptChar;for(let e=0;e<s.length;e++){let o=i[e],a=s[e];o&&o.literal||a!==r||(a=t);n+=a}e.value=n;this._promptChar=t}}get overwriteMode(){return this._overWrite}set overwriteMode(t){this._overWrite=asBoolean(t)}get maskFull(){return this._full}getMaskRange(){return this._mskArr.length?[this._firstPos,this._lastPos]:[0,this._tbx.value.length-1]}getRawValue(){const t=this._tbx?this._tbx.value:"";if(!this.mask)return t;let e="";for(let s=0;s<this._mskArr.length&&s<t.length;s++)this._mskArr[s].literal||t[s]==this._promptChar||(e+=t[s]);return e}refresh(){this._parseMask();this._valueChanged()}_input(t){if(this._msk&&!this._composing&&t!=this._evtInput){t.preventDefault();t.stopImmediatePropagation();setTimeout(()=>{this._valueChanged();this._tbx&&this._tbx.dispatchEvent(this._evtInput)})}}_keydown(t){if(t.keyCode==Key.Back){const e=this._tbx.selectionStart,s=this._tbx.selectionEnd;if(e<=this._firstPos&&s==e){t.preventDefault();this._backSpace=!1;return}}this._backSpace=t.keyCode==Key.Back}_keypress(t){t.ctrlKey||t.metaKey||t.altKey||this._composing||!this._preventKey(t.charCode)||t.preventDefault()}_cmpstart(t){this._composing=!0}_cmpend(t){if(this._composing){this._composing=!1;setTimeout(()=>{const t=this._tbx;t&&this._valueChanged()&&t.dispatchEvent(this._evtInput)})}}_preventKey(t){if(t&&this._mskArr.length){let e=this._tbx,s=e.selectionStart,n=String.fromCharCode(t);if(s<this._firstPos){s=this._firstPos;setSelectionRange(e,s)}if(s>=this._mskArr.length)return!0;const i=this._mskArr[s];if(i.literal)this._validatePosition(s);else if(i.wildCard!=n&&!this._isCharValid(i.wildCard,n))return!0}return!1}_connect(t){const e=this._tbx;if(e){assert(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected.");if(t){this._autoComplete=e.autocomplete;this._spellCheck=e.spellcheck;e.autocomplete="off";e.spellcheck=!1;e.addEventListener("input",this._inputBnd,!0);e.addEventListener("keydown",this._keydownBnd,!0);e.addEventListener("keypress",this._keypressBnd,!0);e.addEventListener("compositionstart",this._cmpstartBnd,!0);e.addEventListener("compositionend",this._cmpendBnd,!0);e.addEventListener("blur",this._cmpendBnd,!0);this._valueChanged()}else{e.autocomplete=this._autoComplete;e.spellcheck=this._spellCheck;e.removeEventListener("input",this._inputBnd,!0);e.removeEventListener("keydown",this._keydownBnd,!0);e.removeEventListener("keypress",this._keypressBnd,!0);e.removeEventListener("compositionstart",this._cmpstartBnd,!0);e.removeEventListener("compositionend",this._cmpendBnd,!0);e.removeEventListener("blur",this._cmpendBnd,!0)}}}_valueChanged(){if(!this._tbx||!this._msk)return!1;let t=this._tbx,e=t.selectionStart,s=e>0?t.value[e-1]:"",n=t.value;t.value=this._applyMask();""==n&&(e=this._firstPos+1);const i=e>0?t.value[e-1]:"";e>0&&i==this._promptChar&&s!=this.promptChar&&e--;e==n.length&&(e=this._matchEnd);this._validatePosition(e);return n!=t.value}_applyMask(){let t=this._tbx,e=t.value;this._full=!0;this._matchEnd=0;if(!this._msk)return e;if(!e&&!t.required)return e;if(this._overWrite){const s=t.selectionStart;t==document.activeElement&&t.selectionEnd==s&&e.length>this.mask.length&&(e=e.substr(0,s)+e.substr(s+e.length-this.mask.length))}e=this._handleVagueLiterals(e);let s="",n=0,i=this._promptChar;for(let t=0;t<this._mskArr.length;t++){let r=this._mskArr[t],o=r.literal;o&&o==e[n]&&n++;if(r.wildCard){o=i;if(e){let t=n;for(;t<e.length;t++)if(this._isCharValid(r.wildCard,e[t])){o=e[t];switch(r.charCase){case">":o=o.toUpperCase();break;case"<":o=o.toLowerCase()}o!=i&&(this._matchEnd=s.length+1);break}n=t+1}o==i&&(this._full=!1)}s+=o}return s}_handleVagueLiterals(t){if(t.length>this._mskArr.length+1)return t;const e=t.length-this._mskArr.length;if(0!=e&&t.length>1){let s=-1,n=this._backSpace,i=this._tbx,r=i==getActiveElement()?i.selectionStart:i.value.length;for(let t=Math.max(0,r-e);t<this._mskArr.length;t++)if(this._mskArr[t].vague){s=t;break}if(s>-1)if(e<0){if(n)for(;s>0&&this._mskArr[s-1].literal;)s--;const i=Array(1-e).join(this._promptChar),r=s+e;r>-1&&(t=t.substr(0,r)+i+t.substr(r-e))}else{for(;s>0&&this._mskArr[s-1].literal;)s--;t=t.substr(0,s)+t.substr(s+e)}}return t}_isCharValid(t,e){if(e==this._promptChar)return!0;switch(t){case"0":return this._isDigit(e);case"9":return this._isDigit(e)||" "==e;case"#":return this._isDigit(e)||" "==e||"+"==e||"-"==e;case"L":return this._isLetter(e);case"l":return this._isLetter(e)||" "==e;case"A":return this._isDigit(e)||this._isLetter(e);case"a":return this._isDigit(e)||this._isLetter(e)||" "==e;case"9":return e>="0"&&e<="9";case"J":case"G":return!("G"==t&&_MaskProvider._X_DBCS_BIG_HIRA.indexOf(e)>-1)&&(e>="ぁ"&&e<="ゟ");case"K":case"N":return!("N"==t&&_MaskProvider._X_DBCS_BIG_KATA.indexOf(e)>-1)&&(e>="゠"&&e<="ヿ");case"Z":return!(e>="ヲ"&&e<="゚")&&(e<" "||e>"ÿ");case"H":return e>="!"&&e<="ÿ"||e>="ヲ"&&e<="゚";case"K":case"N":return!("N"==t&&_MaskProvider._X_SBCS_BIG_KATA.indexOf(e)>-1)&&(e>="ヲ"&&e<="゚")}return!1}_isDigit(t){return t>="0"&&t<="9"}_isLetter(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}_validatePosition(t){const e=this._mskArr;if(this._backSpace)for(;t>0&&t<e.length&&e[t-1].literal;)t--;if(0==t||!this._backSpace)for(;t<e.length&&e[t].literal;)t++;getActiveElement()==this._tbx&&setSelectionRange(this._tbx,t);this._backSpace=!1}_parseMask(){this._mskArr=[];this._firstPos=-1;this._lastPos=-1;let t,e=this._msk,s="|";for(let n=0;e&&n<e.length;n++)switch(e[n]){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(e[n],s));break;case".":case",":case":":case"/":case"$":switch(e[n]){case".":case",":t=culture.Globalize.numberFormat[e[n]];break;case":":case"/":t=culture.Globalize.calendar[e[n]];break;case"$":t=culture.Globalize.numberFormat.currency.symbol}for(let e=0;e<t.length;e++)this._mskArr.push(new _MaskElement(t[e]));break;case"<":case">":case"|":s=e[n];break;case"\\":n<e.length-1&&n++;this._mskArr.push(new _MaskElement(e[n]));break;default:this._mskArr.push(new _MaskElement(e[n]))}for(let t=0;t<this._mskArr.length;t++){const e=this._mskArr[t];if(e.literal)for(let t=0;t<this._mskArr.length;t++){const s=this._mskArr[t];if(s.wildCard&&this._isCharValid(s.wildCard,e.literal)){e.vague=!0;break}}}}dispose(){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="ァィゥェォャュョッ";export class _MaskElement{constructor(t,e){if(e){this.wildCard=t;this.charCase=e}else this.literal=t}}export var Aggregate;!function(t){t[t.None=0]="None";t[t.Sum=1]="Sum";t[t.Cnt=2]="Cnt";t[t.Avg=3]="Avg";t[t.Max=4]="Max";t[t.Min=5]="Min";t[t.Rng=6]="Rng";t[t.Std=7]="Std";t[t.Var=8]="Var";t[t.StdPop=9]="StdPop";t[t.VarPop=10]="VarPop";t[t.CntAll=11]="CntAll";t[t.First=12]="First";t[t.Last=13]="Last"}(Aggregate||(Aggregate={}));export function getAggregate(t,e,s,n){let i=0,r=0,o=0,a=0,l=null,c=null,h=null,u=s?new Binding(s):null;if((t=asEnum(t,Aggregate))==Aggregate.CntAll)return e.length;for(let s=0;s<e.length;s++){let d=e[s];u&&(d=u.getValue(d));if(null!=d){if(t==Aggregate.First)return d;i++;(null==l||d<l)&&(l=d);(null==c||d>c)&&(c=d);h=d;d&&"string"==typeof d&&d.length>1&&"="===d[0]&&"="!==d[1]&&n&&"function"==typeof n.evaluate&&(d=n.evaluate(d));if(isNumber(d)&&!Number.isNaN(d)){r++;o+=d;a+=d*d}else if(isBoolean(d)){r++;if(1==d){o++;a++}}}}const d=0==r?0:o/r;switch(t){case Aggregate.Avg:return d;case Aggregate.Cnt:return i;case Aggregate.Max:return c;case Aggregate.Min:return l;case Aggregate.Rng:return c-l;case Aggregate.Sum:return o;case Aggregate.VarPop:return r<=1?0:a/r-d*d;case Aggregate.StdPop:return r<=1?0:Math.sqrt(a/r-d*d);case Aggregate.Var:return r<=1?0:(a/r-d*d)*r/(r-1);case Aggregate.Std:return r<=1?0:Math.sqrt((a/r-d*d)*r/(r-1));case Aggregate.Last:return h;case Aggregate.First:return null}throw"Invalid aggregate type."}function extend(t,e){for(const s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t}export class ArrayBase extends Array{constructor(){canChangePrototype?this.length=0:super()}}let canChangePrototype=!0;try{extend(ArrayBase.prototype,Array.prototype);canChangePrototype=ArrayBase.prototype.length===Array.prototype.length}catch(t){canChangePrototype=!1}var symb="undefined"!=typeof window?window.Symbol:null;!canChangePrototype&&symb&&symb.species&&Object.defineProperty(ArrayBase,symb.species,{get:()=>Array,enumerable:!1,configurable:!1});export class ObservableArray extends ArrayBase{constructor(t){super();this._updating=0;this.collectionChanged=new Event;if(t){t=asArray(t);this._updating++;for(let e=0;e<t.length;e++)this.push(t[e]);this._updating--}}push(...t){t.forEach(t=>{super.push(t);this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t,this.length-1)});return this.length}shift(){const t=super.shift();this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,0);return t}unshift(...t){const e=super.unshift(...t);1==t.length?this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t[0],0):this._raiseCollectionChanged();return e}pop(){const t=super.pop();this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,this.length);return t}splice(t,e,...s){let n,i=NotifyCollectionChangedAction,r=this._raiseCollectionChanged.bind(this);if(e&&s.length){n=super.splice(t,e,...s);1==e&&1==s.length?r(i.Change,s[0],t):r()}else if(s.length){n=super.splice(t,0,...s);1==s.length?r(i.Add,s[0],t):r()}else{n=super.splice(t,e);1==e?r(i.Remove,n[0],t):r()}return n}slice(t,e){return super.slice(t,e)}indexOf(t,e){return super.indexOf(t,e)}sort(t){const e=super.sort(t);this._raiseCollectionChanged();return e}insert(t,e){this.splice(t,0,e)}remove(t){const e=this.indexOf(t);e>-1&&this.removeAt(e);return e>-1}removeAt(t){this.splice(t,1)}setAt(t,e){t>=this.length&&(this.length=t+1);this.splice(t,1,e)}clear(){this.length&&this.splice(0,this.length)}beginUpdate(){this._updating++}endUpdate(t=!1){this._updating--;this._updating<=0&&!t&&this._raiseCollectionChanged()}get isUpdating(){return this._updating>0}deferUpdate(t){try{this.beginUpdate();t()}finally{this.endUpdate()}}implementsInterface(t){return"INotifyCollectionChanged"==t}onCollectionChanged(t=NotifyCollectionChangedEventArgs.reset){this.isUpdating||this.collectionChanged.raise(this,t)}_raiseCollectionChanged(t=NotifyCollectionChangedAction.Reset,e,s){if(!this.isUpdating){const n=new NotifyCollectionChangedEventArgs(t,e,s);this.onCollectionChanged(n)}}}export var SortNulls;!function(t){t[t.Natural=0]="Natural";t[t.First=1]="First";t[t.Last=2]="Last"}(SortNulls||(SortNulls={}));const _OBJ_DEPTH=2;export class CollectionView{constructor(t,e){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(()=>{this._srtDsc.forEach(t=>{assert(t instanceof SortDescription,"sortDescriptions array must contain SortDescription objects.")});this.canSort&&this._commitAndRefresh()});this._grpDesc.collectionChanged.addHandler(()=>{this._grpDesc.forEach(t=>{assert(t instanceof GroupDescription,"groupDescriptions array must contain GroupDescription objects.")});this.canGroup&&this._commitAndRefresh()});this._filters.collectionChanged.addHandler(()=>{this._filters.forEach(t=>{assert(isFunction(t),"filters array must contain IPredicate functions.")});this.canFilter&&this._commitAndRefresh()});this._chgEdited.collectionChanged.addHandler((t,e)=>{if(e&&e.action&&this._orgVals&&0!==this._orgVals.size)switch(e.action){case NotifyCollectionChangedAction.Remove:this._orgVals.delete(e.item);break;case NotifyCollectionChangedAction.Reset:this._orgVals.clear()}});this.sourceCollection=t||new ObservableArray;if(e){this._initializing=!0;this.deferUpdate(()=>{copy(this,e)});this._initializing=!1}null==this._keepCurrentItem&&(this._keepCurrentItem=!0)}_copy(t,e){switch(t){case"sortDescriptions":{const t=this.sortDescriptions;t.deferUpdate(()=>{t.clear();asArray(e).forEach(e=>{isString(e)?e=new SortDescription(e,!0):e instanceof SortDescription||!e.property||(e=new SortDescription(e.property,e.ascending));t.push(e)})});return!0}case"groupDescriptions":{const t=this.groupDescriptions;t.deferUpdate(()=>{t.clear();e.forEach(e=>{isString(e)&&(e=new PropertyGroupDescription(e));t.push(e)})});return!0}case"currentItem":this.currentItem=e;return!0}return!1}get calculatedFields(){return this._calcFields}set calculatedFields(t){if(t&&!window.Proxy){console.warn("** Calculated fields require Proxy (see https://www.npmjs.com/package/proxy-polyfill).");t=null}if(t!=this._calcFields){this._calcFields=t;const e=this._srcRaw;this._srcRaw=null;this.sourceCollection=e}}get newItemCreator(){return this._itemCreator}set newItemCreator(t){this._itemCreator=asFunction(t)}get sortConverter(){return this._srtCvt}set sortConverter(t){t!=this._srtCvt&&(this._srtCvt=asFunction(t,!0))}get sortComparer(){return this._srtCmp}set sortComparer(t){t!=this._srtCmp&&(this._srtCmp=asFunction(t,!0))}get useStableSort(){return this._stableSort}set useStableSort(t){if(t!=this._stableSort){this._stableSort=asBoolean(t);this.refresh()}}get sortNulls(){return this._srtNulls}set sortNulls(t){if((t=asEnum(t,SortNulls))!=this._srtNulls){this._srtNulls=t;this.refresh()}}get sortNullsFirst(){return this.sortNulls!=SortNulls.Last}set sortNullsFirst(t){_deprecated("sortNullsFirst","sortNulls");this.sortNulls=asBoolean(t)?SortNulls.First:SortNulls.Last}getAggregate(t,e,s){return getAggregate(t,s?this._pgView:this._view,e)}get trackChanges(){return this._trackChanges}set trackChanges(t){this._trackChanges=asBoolean(t)}get refreshOnEdit(){return this._refreshOnEdit}set refreshOnEdit(t){this._refreshOnEdit=asBoolean(t)}get itemsAdded(){return this._chgAdded}get itemsRemoved(){return this._chgRemoved}get itemsEdited(){return this._chgEdited}clearChanges(){this._chgAdded.clear();this._chgRemoved.clear();this._chgEdited.clear();this._orgVals&&this._orgVals.clear()}implementsInterface(t){switch(t){case"ICollectionView":case"IEditableCollectionView":case"IPagedCollectionView":case"INotifyCollectionChanged":return!0}return!1}get getError(){return this._getError}set getError(t){if(this._getError!=t){this._getError=asFunction(t);this._raiseCollectionChanged()}}onCollectionChanged(t=NotifyCollectionChangedEventArgs.reset,e){t.action!=NotifyCollectionChangedAction.Change||this._committing||this._canceling||t.item==this.currentEditItem||t.item==this.currentAddItem||this._trackItemChanged(t.item,e);this._updating||this.collectionChanged.raise(this,t)}_raiseCollectionChanged(t=NotifyCollectionChangedAction.Reset,e,s){const n=new NotifyCollectionChangedEventArgs(t,e,s);this.onCollectionChanged(n)}onSourceCollectionChanging(t){this.sourceCollectionChanging.raise(this,t);return!t.cancel}onSourceCollectionChanged(t){this.sourceCollectionChanged.raise(this,t)}get canFilter(){return this._canFilter}set canFilter(t){this._canFilter=asBoolean(t)}get canGroup(){return this._canGroup}set canGroup(t){this._canGroup=asBoolean(t)}get canSort(){return this._canSort}set canSort(t){this._canSort=asBoolean(t)}get currentItem(){return this._pgView&&this._idx>-1&&this._idx<this._pgView.length?this._pgView[this._idx]:null}set currentItem(t){this.moveCurrentTo(t)}get currentPosition(){return this._idx}set currentPosition(t){this.moveCurrentToPosition(asNumber(t))}get filter(){return this._filter}set filter(t){if(this._filter!=t){this._filter=asFunction(t);this.canFilter&&this.refresh()}}get filters(){return this._filters}get groupDescriptions(){return this._grpDesc}get groups(){return this._groups}get isEmpty(){return!this._pgView||!this._pgView.length}get sortDescriptions(){return this._srtDsc}get sourceCollection(){return this._src}set sourceCollection(t){if(t!=this._srcRaw){if(!this.onSourceCollectionChanging(new CancelEventArgs))return;const e=this.currentPosition;this.commitEdit();null!=this._ncc&&this._ncc.collectionChanged.removeHandler(this._sourceChanged);this._srcRaw=t;this._src=asArray(t,!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&&e>-1&&this.onCurrentChanged()}}_sourceChanged(t,e){this._updating<=0&&this.refresh()}contains(t){return this._pgView.indexOf(t)>-1}moveCurrentTo(t){return this.moveCurrentToPosition(_ENV_TOOLS.indexOf(this._pgView,t))}moveCurrentToFirst(){return this.moveCurrentToPosition(0)}moveCurrentToLast(){return this.moveCurrentToPosition(this._pgView.length-1)}moveCurrentToPrevious(){return this._idx>0&&this.moveCurrentToPosition(this._idx-1)}moveCurrentToNext(){return this.moveCurrentToPosition(this._idx+1)}moveCurrentToPosition(t){if(t>=-1&&t<this._pgView.length&&t!=this._idx){const e=new CancelEventArgs;if(this.onCurrentChanging(e)){const e=this._pgView[t],s=_getTargetObject(e),n=this._edtItem,i=this._newItem;n&&n!=e&&n!=s?this.commitEdit():i&&i!=e&&i!=s&&this.commitNew();this._idx=t;this.onCurrentChanged()}}return this._idx==t}refresh(){if(this._newItem||this._edtItem||this._updating>0)this._pendingRefresh=!0;else{const t=this.currentItem;this._performRefresh();this.onCollectionChanged();t==this.currentItem||this._initializing||this.onCurrentChanged()}}_commitAndRefresh(){if(this.currentEditItem||this.currentAddItem){this._pendingRefresh=!0;this.commitEdit()}else this.refresh()}_performRefresh(){if(this._updating>0){this._pendingRefresh=!0;return}this._pendingRefresh=!1;this._pendingRemove=!1;const t=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)}let e=this._keepCurrentItem&&null!=t?this._pgView.indexOf(t):-1;e<0&&(e=Math.min(this._idx,this._pgView.length-1));this._idx=e;this._digest=this._getGroupsDigest(this.groups)}_performSort(t){if(this._stableSort){const e=t.map((t,e)=>({item:t,index:e})),s=this._compareItems();e.sort((t,e)=>{const n=s(t.item,e.item);return 0==n?t.index-e.index:n});for(let s=0;s<t.length;s++)t[s]=e[s].item}else t.sort(this._compareItems())}_compareItems(){let t=this._srtDsc,e=this._srtCvt,s=this._srtCmp,n=CollectionView._collator,i=!0,r=0;return(o,a)=>{for(let l=0;l<t.length;l++){let c=t[l],h=c._bnd.getValue(o),u=c._bnd.getValue(a);if(e){h=e(c,o,h,i);u=e(c,a,u,!1);i=!1}if(s){r=s(h,u);if(null!=r){if(0!=r)return c.ascending?+r:-r;continue}}Number.isNaN(h)&&(h=null);Number.isNaN(u)&&(u=null);if(h!==u&&(null==h||null==u))switch(this._srtNulls){case SortNulls.First:return null==h?-1:1;case SortNulls.Last:return null==h?1:-1;default:r=null==h?-1:1;return c.ascending?+r:-r}if("string"==typeof h&&"string"==typeof u){if(n){r=n.compare(h,u);if(0!=r)return c.ascending?+r:-r;continue}const t=h.toLowerCase(),e=u.toLowerCase();if(t!=e){h=t;u=e}}r=h<u?-1:h>u?1:0;if(0!=r)return c.ascending?+r:-r}return 0}}_performFilter(t){return this.canFilter&&this._filter||this._filters.length?t.filter(this._filterItem,this):t}_filterItem(t){var e=!this.canFilter||!this._filter||this._filter(t);for(let s=0;s<this._filters.length&&e;s++)e=this._filters[s](t);return e}onCurrentChanged(t){this.currentChanged.raise(this,t)}onCurrentChanging(t){this.currentChanging.raise(this,t);return!t.cancel}get items(){return this._pgView}beginUpdate(){this._updating++}endUpdate(t=!0){this._updating--;t&&(this._pendingRefresh=!0);if(this._updating<=0){this._pendingRefresh&&this.refresh();if(this._pendingRemove){this._pendingRemove=!1;this._raiseCollectionChanged()}}}get isUpdating(){return this._updating>0}deferUpdate(t,e=!0){try{this.beginUpdate();t()}finally{this.endUpdate(e)}}get canAddNew(){return this._canAddNew}set canAddNew(t){if(t!=this._canAddNew){this._canAddNew=asBoolean(t);this._raiseCollectionChanged()}}get canCancelEdit(){return this._canCancelEdit}set canCancelEdit(t){this._canCancelEdit=asBoolean(t)}get canRemove(){return this._canRemove}set canRemove(t){this._canRemove=asBoolean(t)}get currentAddItem(){return this._newItem}get currentEditItem(){return this._edtItem}get isAddingNew(){return null!=this._newItem}get isEditingItem(){return null!=this._edtItem}editItem(t){if(t!=this._edtItem&&this.moveCurrentTo(t)){this.commitEdit();this._edtItem=t;this._edtClone=this._extend({},this._edtItem)}}commitEdit(){const t=this._edtItem,e=this._edtClone;if(null!=t){this._committing=!0;const s=this._getChangedFields(t,e),n=this._pendingRefresh;this._edtItem=null;this._edtClone=null;const i=this._pgView.indexOf(t),r=this._digest;this._needRefresh(s)&&this._refreshOnEdit&&this._performRefresh();this._trackItemChanged(t,e);this._pgView.indexOf(t)!=i||r!=this._digest||n?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,t,i);this.commitNew();this._committing=!1;if(this.sourceCollection instanceof ObservableArray){this._updating++;const e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,t);this.sourceCollection.onCollectionChanged(e);this._updating--}}}cancelEdit(){const t=this._edtItem;if(null!=t){this._edtItem=null;if(!this.canCancelEdit)return;const e=this._src.indexOf(t);if(e>=0&&this._edtClone){this._extend(this._src[e],this._edtClone);this._edtClone=null;this._canceling=!0;this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,t,e);this._canceling=!1;if(this._pendingRefresh&&this._refreshOnEdit){this._performRefresh();this._raiseCollectionChanged()}}}}addNew(t,e=!1){this.commitEdit();if(!this.canAddNew)return null;const s=this.sourceCollection;null==t&&(t=this.newItemCreator?this.newItemCreator():s&&s.length?new s[0].constructor:{});if(null!=t){this._updating++;s.push(t);this._updating--;t=s[s.length-1];this._newItem=t;this._pgView!=this._src&&this._pgView.push(t);if(this.groups&&this.groups.length){let e=this.groups[this.groups.length-1];e.items.push(t);for(;e.groups&&e.groups.length;){e=e.groups[e.groups.length-1];e.items.push(t)}}this._raiseCollectionChanged(NotifyCollectionChangedAction.Add,t,this._pgView.length-1);this.moveCurrentTo(t);e&&this.commitNew()}return this._newItem}commitNew(){const t=this._newItem;if(null!=t){this._newItem=null;const e=this._pgView.indexOf(t),s=this._digest;this._refreshOnEdit&&this._performRefresh();if(this._trackChanges){const e=this._chgEdited.indexOf(t);e>-1&&this._chgEdited.removeAt(e);this._chgAdded.indexOf(t)<0&&this._chgAdded.push(t)}this._pgView.indexOf(t)!=e||s!=this._digest||this.calculatedFields?this._raiseCollectionChanged():this._raiseCollectionChanged(NotifyCollectionChangedAction.Change,t,e)}}cancelNew(){const t=this._newItem;null!=t&&this.remove(t)}remove(t){const e=t==this._newItem;e&&(this._newItem=null);t==this._edtItem&&this.cancelEdit();if(!this.canRemove)return;const s=this._src.indexOf(t);if(s>-1){const n=this._view.indexOf(t)<0,i=this.currentItem;this._updating++;this._src.splice(s,1);this._updating--;const r=this._digest;if(this._refreshOnEdit)this._performRefresh();else{this._updating>0&&(this._pendingRemove=!0);const e=this._pgView.indexOf(t);e>=0&&this._pgView.splice(e,1)}if(this._trackChanges){const s=this._chgAdded.indexOf(t);s>-1&&this._chgAdded.removeAt(s);const n=this._chgEdited.indexOf(t);n>-1&&this._chgEdited.removeAt(n);this._chgRemoved.indexOf(t)<0&&!e&&s<0&&this._chgRemoved.push(t)}const o=this.sortDescriptions.length>0,a=this.pageSize>0&&this._pgIdx>-1;o||a||r!=this._getGroupsDigest(this.groups)?this._raiseCollectionChanged():n||this._raiseCollectionChanged(NotifyCollectionChangedAction.Remove,t,s);this.currentItem!==i&&this.onCurrentChanged()}}removeAt(t){t=asInt(t);this.remove(this._pgView[t])}_trackItemChanged(t,e){if(this._trackChanges){const s=this.sourceCollection;if(s&&s.indexOf(t)>-1){let s=this._orgVals,n=s?s.get(t):null;if(e&&!n){s.set(t,e);n=e}let i=this._chgEdited.indexOf(t),r=NotifyCollectionChangedAction.Change;if(n&&this._sameContent(t,n)){i>-1&&this._chgEdited.removeAt(i);return}if(i<0&&this._chgAdded.indexOf(t)<0)this._chgEdited.push(t);else if(i>-1){const e=new NotifyCollectionChangedEventArgs(r,t,i);this._chgEdited.onCollectionChanged(e)}else{i=this._chgAdded.indexOf(t);if(i>-1){const e=new NotifyCollectionChangedEventArgs(r,t,i);this._chgAdded.onCollectionChanged(e)}}}}}_extend(t,e,s=2){for(const n in e)try{const i=e[n];if(s>0&&isObject(i))if("Map"===i.constructor.name)t[n]=i;else{t[n]={};this._extend(t[n],i,s-1)}else t[n]=i}catch(t){}return t}_getChangedFields(t,e,s=2){assert(null!=e&&null!=t,"Two objects expected.");const n={};for(const i in e)try{this._sameValue(t[i],e[i],s)||(n[i]=!0)}catch(t){}for(const i in t)try{n[i]||this._sameValue(t[i],e[i],s)||(n[i]=!0)}catch(t){}const i=Object.keys(n);return i.length?i:null}_sameValue(t,e,s=2){return!!(t===e||DateTime.equals(t,e)||Number.isNaN(t)&&Number.isNaN(e))||!(!isObject(t)||!isObject(e))&&(!(s>0)||null==this._getChangedFields(t,e,s-1))}_sameContent(t,e){return null==this._getChangedFields(t,e)}_needRefresh(t){if(this._pendingRefresh)return!0;if(!t)return!1;if(this._filter)return!0;for(let e=0;e<this._srtDsc.length;e++){const s=this._getBindingRoot(this._srtDsc[e].property);if(t.indexOf(s)>-1)return!0}for(let e=0;e<this._grpDesc.length;e++){const s=this._grpDesc[e];if(!(s instanceof PropertyGroupDescription))return!0;const n=this._getBindingRoot(s.propertyName);if(t.indexOf(n)>-1)return!0}return!1}_getBindingRoot(t){const e=t.indexOf(".");return e>-1?t.substr(0,e):t}get canChangePage(){return this._canChangePage}set canChangePage(t){this._canChangePage=asBoolean(t)}get isPageChanging(){return!1}get itemCount(){return this._pgView.length}get pageIndex(){return this._pgIdx}get pageSize(){return this._pgSz}set pageSize(t){if(t!=this._pgSz){this._pgSz=asInt(t);this.refresh()}}get totalItemCount(){return this._view.length}get pageCount(){return this.pageSize?Math.ceil(this.totalItemCount/this.pageSize):1}moveToFirstPage(){return this.moveToPage(0)}moveToLastPage(){return this.moveToPage(this.pageCount-1)}moveToPreviousPage(){return this.moveToPage(this.pageIndex-1)}moveToNextPage(){return this.moveToPage(this.pageIndex+1)}moveToPage(t){const e=clamp(t,0,this.pageCount-1);if(e!=this._pgIdx){if(!this.canChangePage)return!1;const t=new PageChangingEventArgs(e);if(this.onPageChanging(t)&&this.onCurrentChanging(t)){this.commitEdit();this.commitNew();const t=this.currentItem;this._pgIdx=e;this._pgView=this._getPageView();this._idx=0;if(this.groupDescriptions&&0!=this.groupDescriptions.length)this.refresh();else{this.onCollectionChanged();t!=this.currentItem&&this.onCurrentChanged()}this.onPageChanged()}}return this._pgIdx==t}onPageChanged(t){this.pageChanged.raise(this,t)}onPageChanging(t){this.pageChanging.raise(this,t);return!t.cancel}_getFullGroup(t){const e=this._getGroupByPath(this._fullGroups,t.level,t._path);null!=e&&(t=e);return t}_getGroupByPath(t,e,s){if(t)for(let n=0;n<t.length;n++){let i=t[n];if(i.level==e&&i._path==s)return i;if(i.level<e&&0==s.indexOf(i._path)){i=this._getGroupByPath(i.groups,e,s);if(null!=i)return i}}return null}_getPageView(){if(this.pageSize<=0||this._pgIdx<0)return this._view;const t=this._pgSz*this._pgIdx,e=Math.min(t+this._pgSz,this._view.length);return this._view.slice(t,e)}_createGroups(t){if(!this._grpDesc||!this._grpDesc.length)return null;let e=[],s={},n=null;t.forEach(t=>{let i=e,r=this._grpDesc.length,o="";for(let e=0;e<r;e++){const a=this._grpDesc[e],l=a.groupNameFromItem(t,e),c=e==r-1;n=s[o];if(!n&&isPrimitive(l)){n={};s[o]=n}const h=this._getGroup(a,i,n,l,e,c);o+="/"+l;h._path=o;c&&h.items.push(t);i=h.groups}});return e}_getGroupsDigest(t){let e="";for(let s=0;null!=t&&s<t.length;s++){const n=t[s];e+=`{${n.name}:${n.items?n.items.length:"*"}`;if(n.groups.length>0){e+=",";e+=this._getGroupsDigest(n.groups)}e+="}"}return e}_mergeGroupItems(t){const e=[];for(let s=0;s<t.length;s++){const n=t[s];if(!n._isBottomLevel){const t=this._mergeGroupItems(n.groups);for(let e=0,s=t.length;e<s;e++)n._items.push(t[e])}for(let t=0,s=n._items.length;t<s;t++)e.push(n._items[t])}return e}_getGroup(t,e,s,n,i,r){let o;if(s&&isPrimitive(n)){o=s[n];if(o)return o}else for(let s=0;s<e.length;s++)if(t.namesMatch(e[s].name,n))return e[s];const a=new CollectionViewGroup(t,n,i,r);e.push(a);s&&(s[n]=a);return a}}CollectionView._collator="undefined"!=typeof window&&window.Intl&&Intl.Collator?new Intl.Collator:null;export class CollectionViewGroup{constructor(t,e,s,n){this._gd=t;this._name=e;this._level=s;this._isBottomLevel=n;this._groups=[];this._items=[]}get name(){return this._name}get level(){return this._level}get isBottomLevel(){return this._isBottomLevel}get items(){return this._items}get groups(){return this._groups}get groupDescription(){return this._gd}getAggregate(t,e,s,n){const i=tryCast(s,CollectionView);return getAggregate(t,(i?i._getFullGroup(this):this).items,e,n)}_clone(){const t=new CollectionViewGroup(this.groupDescription,this.name,this.level,this.isBottomLevel);t._path=this._path;if(this.groups.length)for(let e=0;e<this.groups.length;e++)t.groups.push(this.groups[e]);if(this.items.length)for(let e=0;e<this.items.length;e++)t.items.push(this.items[e]);return t}}export class _NullValue{constructor(t){this._id=t}}export var controlBaseClass="undefined"!=typeof window&&window["wj-control-is-element"]?HTMLElement:Object;var __isES6Mode=!1;try{const t=class __c{};t.prototype=Array.prototype;__isES6Mode=t.prototype!==Array.prototype}catch(t){__isES6Mode=!0}var __callSuper=__isES6Mode||controlBaseClass!==Object;export class ControlBase extends controlBaseClass{constructor(){__callSuper&&super()}}export class Control extends ControlBase{constructor(t,e=null,s=!1){super();this.workingAs="PureJs";this.disposed=!1;this._orgAttributes=[];this._listeners=[];this._pristine=!0;this._focus=!1;this._updating=0;this._fullUpdate=!1;this._listenResizeEvents=!0;this.gotFocus=new Event;this.lostFocus=new Event;this.invalidInput=new Event;this.refreshing=new Event;this.refreshed=new Event;this._updateWme();assert(null==Control.getControl(t),"Element is already hosting a control.");let n=getElement(t);assert(null!=n,"Cannot find the host element.");this._orgTabIndex=n.hasAttribute("tabindex")?n.tabIndex:0;for(let t=0;t<n.attributes.length;t++){const e=n.attributes[t];this._orgAttributes.push({name:e.name,value:e.textContent})}this._orgInner=n.innerHTML;this._orgTag=n.tagName;this._orgAtts=n.attributes;"INPUT"!=n.tagName&&"SELECT"!=n.tagName||(n=this._replaceWithDiv(n));this._e=n;n[Control._CTRL_KEY]=this;const i=this.addEventListener.bind(this);if(1==s){this._szCtl=new Size(n.offsetWidth,n.offsetHeight);let t=window.ResizeObserver,e=null;t&&(e=this._szObserver=new t(t=>this._resizeObserverCallback(t)));e?e.observe(n):i(window,"resize",this._handleResize.bind(this))}const r=this._handleFocusBlur.bind(this);i(n,"focus",r,!0);i(n,"blur",r,!0);const o=this._handleDisabled.bind(this);i(n,"mousedown",o,!0);i(n,"mouseup",o,!0);i(n,"click",o,!0);i(n,"dblclick",o,!0);i(n,"wheel",o,getEventOptions(!0,!0));i(n,"keydown",t=>{this.isDisabled&&t.keyCode!=Key.Tab&&t.preventDefault()});0==Control._ctlCnt&&_detectTouch(!0);Control._ctlCnt++}getTemplate(){for(let t=Object.getPrototypeOf(this);t;t=Object.getPrototypeOf(t)){const e=t.constructor.controlTemplate;if(e)return e}return null}applyTemplate(t,e,s,n){const i=this._e;t&&addClass(i,t);let r=null;e&&(r=createElement(e,i));const o=i.querySelectorAll("a."+InputFormElementsClsNames.btn);for(let t=0;t<o.length;t++){const e=o[t];setAttribute(e,"role","button",!0);setAttribute(e,"href","",!0);setAttribute(e,"draggable",!1,!0)}const a=i.querySelectorAll("button");for(let t=0;t<a.length;t++)setAttribute(a[t],"type","button",!0);const l=i.querySelectorAll("input"),c=1==l.length?l[0]:null;if(c){const t=Control._rxInputAtts;this._copyAttributes(c,i.attributes,t);this._copyAttributes(c,this._orgAtts,t)}if(c&&i.id){let t=i;for(;t.parentElement;)t=t.parentElement;const e=t.querySelector(`label[for="${i.id}"]`);if(e instanceof HTMLLabelElement){const t=getUniqueId(i.id+"_input");c.id=t;e.htmlFor=t}}if(c){let t=c.value,e=!0,s=!1,n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1);this.gotFocus.addHandler(()=>{e=!1;s=!0;t=c.value});this.addEventListener(i,"focusin",n=>{if(e){s=!0;e=!1;t=c.value}});this.addEventListener(c,"input",()=>{this._pristine=!1;this._getInputValueTimer=setTimeout(()=>{t=c.value})});this.addEventListener(c,"change",e=>{e.isTrusted&&(t=c.value)});const leave=()=>{if(!this._containsFocus()){e=!0;if(this._pristine){this._pristine=!1;this._updateState()}if(s&&t!=c.value){t=c.value;c.dispatchEvent(n)}s=!1}};this.addEventListener(i,"blur",()=>{leave()});this.lostFocus.addHandler(()=>{leave()})}c?i.tabIndex=-1:i.getAttribute("tabindex")||(i.tabIndex=0);this._updateState();if(s)for(const t in s){const e=s[t];this[t]=r.querySelector(`[wj-part="${e}"]`);null==this[t]&&r.getAttribute("wj-part")==e&&(this[t]=r);if(null==this[t])throw`Missing template part: "${e}"`;if(e==n){let e="name",s=i.attributes[e];s&&s.value&&this[t].setAttribute(e,s.value);e="accesskey";s=i.attributes[e];if(s&&s.value){this[t].setAttribute(e,s.value);i.removeAttribute(e)}}}return r}dispose(){if(!this._e)return;this.disposed=!0;const t=this._e.querySelectorAll("."+ControlClsNames.hostElement);for(let e=0;e<t.length;e++){const s=Control.getControl(t[e]);s&&s.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}const e=this._szObserver;e&&e.disconnect();this.removeEventListener();for(const t in this)if(t.length>2&&0==t.indexOf("on")){const e=this[t[2].toLowerCase()+t.substr(3)];e instanceof Event&&e.removeAllHandlers()}const s=this.collectionView;if(s instanceof CollectionView)for(const t in s){const e=s[t];e instanceof Event&&e.removeHandler(null,this)}if(this._e.parentNode){for(;this._e.attributes.length>0;)this._e.removeAttribute(this._e.attributes[0].name);for(const t of this._orgAttributes)setAttribute(this._e,t.name,t.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}}static getControl(t){const e=getElement(t);return e?asType(e[Control._CTRL_KEY],Control,!0):null}get hostElement(){return this._e}get rightToLeft(){null==this._rtlDir&&(this._rtlDir=!!this._e&&"rtl"==getComputedStyle(this._e).direction);return this._rtlDir}focus(){const t=this._e;t&&t.offsetHeight&&(this.isDisabled||!(t.tabIndex>=0)&&moveFocus(t,0)||t.focus())}containsFocus(){return this._containsFocusImpl(getActiveElement())}_containsFocus(){this.focusService||(this.focusService=new _FocusService);return this._containsFocusImpl(_getActiveElement(this.focusService.activeElement))}_containsFocusImpl(t){return contains(this._e,t,!0)}invalidate(t=!0){this._rtlDir=null;this._fullUpdate=this._fullUpdate||t;if(this._toInv){clearTimeout(this._toInv);this._toInv=null}this.isUpdating||this.disposed||(this._toInv=setTimeout(()=>{this.refresh(this._fullUpdate);this._toInv=null},Control._REFRESH_INTERVAL))}refresh(t=!0){if(!this.isUpdating&&!this.disposed){this.onRefreshing();this.refreshed.hasHandlers&&setTimeout(()=>{this.onRefreshed()})}if(!this.isUpdating&&this._toInv){clearTimeout(this._toInv);this._toInv=null;this._fullUpdate=!1}this._updateState();this._updateWme()}static invalidateAll(t){t||(t=document.body);const e=t.children;if(e)for(let t=0;t<e.length;t++)Control.invalidateAll(e[t]);const s=Control.getControl(t);s&&s.invalidate()}static refreshAll(t){t||(t=document.body);if(t.children)for(let e=0;e<t.children.length;e++)Control.refreshAll(t.children[e]);const e=Control.getControl(t);e&&e.refresh()}static disposeAll(t){const e=Control.getControl(t);if(e)e.dispose();else if(t.children)for(let e=0;e<t.children.length;e++)Control.disposeAll(t.children[e])}beginUpdate(){this._updating++}endUpdate(t=!0){this._updating--;this._updating<=0&&t&&this.invalidate()}get isUpdating(){return this._updating>0}deferUpdate(t){try{this.beginUpdate();t()}finally{this.endUpdate()}}get isTouching(){return Control._touching}get tabOrder(){return this._orgTabIndex}set tabOrder(t){this._setTabOrder(t)}_setTabOrder(t){const e=this._e;this._orgTabIndex=t;const s=e.querySelectorAll("input"),n=1===s.length?s[0]:null;e.tabIndex=this.isDisabled||n?-1:this._orgTabIndex;n&&(n.tabIndex=this._orgTabIndex)}get isDisabled(){return this._e&&null!=this._e.getAttribute("disabled")}set isDisabled(t){this._setIsDisabled(t)}_setIsDisabled(t){if((t=!!asBoolean(t,!0))!=this.isDisabled){const e=this._e;if(e){const s="disabled";toggleClass(e,ControlStateClsNames.disabled,t);setAttribute(e,s,t?s:null);setAttribute(e,"aria-disabled",t);if(e.id){const s=document.querySelector(`[dropdown-id=${e.id}]`);s&&toggleClass(s,ControlStateClsNames.disabled,t)}e.tabIndex=this.isDisabled||1===e.querySelectorAll("input").length?-1:this._orgTabIndex;const n=e.querySelectorAll("input,textarea,button,command,fieldset,keygen,optgroup,option,select"),i=Control._DSBL_KEY;for(let e=0;e<n.length;e++){const s=n[e];if(t){s[i]=s.disabled;s.disabled=!0}else{if(closest(s,`.${ControlClsNames.hostElement}.${ControlStateClsNames.disabled}`)){s[i]=s.disabled;s.disabled=!0}else{let t=s[i];isBoolean(t)||(t=!1);s.disabled=t;delete s[i]}}}}}}initialize(t){copy(this,t)}addEventListener(t,e,s,n,i){if(t){null==n&&(n=!1);isBoolean(n)&&null==i&&(e.indexOf("touch")>-1||e.indexOf("wheel")>-1)&&(i=!1);const r=isBoolean(n)&&isBoolean(i)?getEventOptions(n,i):n;t.addEventListener(e,s,r);this._listeners.push({target:t,type:e,fn:s,capture:n})}}removeEventListener(t,e,s,n){let i=0;for(let r=0;r<this._listeners.length;r++){const o=this._listeners[r];if(!(null!=t&&t!=o.target||null!=e&&e!=o.type||null!=s&&s!=o.fn||null!=n&&n!=o.capture)){o.target.removeEventListener(o.type,o.fn,o.capture);this._listeners.splice(r,1);r--;i++}}return i}onGotFocus(t){this.gotFocus.raise(this,t)}onLostFocus(t){this.lostFocus.raise(this,t)}onInvalidInput(t){this.invalidInput.raise(this,t);if(t.cancel){const t=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(()=>{Control._toInvalidInput=null;this.containsFocus()||"isDroppedDown"in this&&"_isDropdownOpened"in this&&this._isDropdownOpened&&(this.isDroppedDown=this._isDropdownOpened);this.focus();Control._toClearCtlInvalid=setTimeout(()=>{Control._ctlInvalidInput=null;Control._toClearCtlInvalid=null},t)},t)}}else Control._ctlInvalidInput=null;this._updateState();return!t.cancel}onRefreshing(t){this.refreshing.raise(this,t)}onRefreshed(t){this.refreshed.raise(this,t)}_getProductInfo(){return"B0C3,Control"}_getFocusedElements(t){let e=t;for(;e;){if(!e.parentNode)return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&void 0!==e.host?e.querySelectorAll("."+ControlStateClsNames.focused):document.body.querySelectorAll("."+ControlStateClsNames.focused);e=e.parentNode}return[]}_updateWme(){const t=this._getProductInfo(),e=Control._toWme,s=_updateWme;if(isFunction(s)&&!e[t]){e[t]=!0;s(this,Control._licKey)}}_hasPendingUpdates(){return null!=this._toInv}_handleResize(){if(this._e.parentElement||this._e.parentNode){const t=new Size(this._e.offsetWidth,this._e.offsetHeight);if(!t.equals(this._szCtl)){this._szCtl=t;this._listenResizeEvents&&(t.width||t.height)&&this.invalidate()}}}_resizeObserverCallback(t){t.forEach(t=>{const e=Control.getControl(t.target);e&&e._handleResize()})}_handleFocusBlur(){this._toFocus||(this._toFocus=setTimeout(()=>{this._toFocus=null;this._updateFocusState()},Control._FOCUS_INTERVAL))}_updateFocusState(){this._updateFocusStateTimer=setTimeout(()=>{const t=EventArgs.empty,e=this._getFocusedElements(this.hostElement);for(let s=0;s<e.length;s++){const n=Control.getControl(e[s]);if(n&&n._focus&&!n.containsFocus()){removeClass(n._e,ControlStateClsNames.focus);n._focus=!1;n._updateState();n.onLostFocus(t)}}const s=getActiveElement();if(s){let e=!0;for(let n=s;n;){const s=Control.getControl(n);if(s&&!s._focus&&s.containsFocus()){if(e){addClass(n,ControlStateClsNames.focus);e=!1}s._focus=!0;s._updateState();s.onGotFocus(t)}n=n[Control._OWNR_KEY]||n.parentNode}}})}_updateState(){const t=this.hostElement;if(t){toggleClass(t,ControlStateClsNames.focused,this._focus);this._rtlDir=this._getRtlStates();toggleClass(t,UtilitesClsNames.rtl,this._rtlDir);const e=t.querySelector("input");if(e instanceof HTMLInputElement){toggleClass(t,ControlStateClsNames.empty,0==e.value.length);toggleClass(t,ControlStateClsNames.readOnly,e.readOnly);const s=e.validationMessage;toggleClass(t,ControlStateClsNames.invalid,!this._pristine&&null!=s&&s.length>0);const n=closest(this.hostElement,ControlStateClsNames.labeledInput),i=n&&n.querySelector(ControlStateClsNames.wjError);if(i){const t=this.hostElement.classList.contains(ControlStateClsNames.invalid);toggleClass(i,ControlStateClsNames.errorVisible,t)}}}}_getRtlStates(){const t=this.hostElement;return"rtl"===getComputedStyle(t).direction}_handleDisabled(t){if(this.isDisabled||closest(t.target,"."+ControlStateClsNames.disabled)){t.preventDefault();t.stopPropagation();t.stopImmediatePropagation()}}_replaceWithDiv(t){const e=document.createElement("div");t.parentElement.replaceChild(e,t);e.innerHTML=t.innerHTML;this._copyAttributes(e,t.attributes,/id|style|class/i);return e}_copyAttributes(t,e,s){if(t)for(let n=0;n<e.length;n++){const i=e[n].name;i.match(s)&&t.setAttribute(i,e[n].value)}}_getKeyCode(t){let e=t.keyCode;if(this.rightToLeft)switch(e){case Key.Right:e=Key.Left;break;case Key.Left:e=Key.Right}return e}_getCodeAsPerRTL(t){const e=t.code;if(this.rightToLeft)switch(e){case"ArrowRight":return"ArrowLeft";case"ArrowLeft":return"ArrowRight"}return e}}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;function _detectTouch(t){if("ontouchstart"in window||"onpointerdown"in window){const e=document,s=getEventOptions(!0,!0),n=_handleTouchStart,i=_handleTouchEnd,r=t?e.addEventListener.bind(e):e.removeEventListener.bind(e);if("ontouchstart"in window){r("touchstart",n,s);r("touchend",i,s);r("touchcancel",i,s)}else if("onpointerdown"in window){r("pointerdown",n,s);r("pointerup",i,s);r("pointercancel",i,s)}}}function _handleTouchStart(t){if(null==t.pointerType||"touch"==t.pointerType){if(Control._toTouch){clearTimeout(Control._toTouch);Control._toTouch=null}Control._touching=!0}}function _handleTouchEnd(t){if(null==t.pointerType||"touch"==t.pointerType){Control._toTouch=setTimeout(()=>{Control._toTouch=null;Control._touching=!1},900);if(document.querySelector("ion-app")){const e=t.target;if(closest(e,".wj-dropdown-panel,.wj-dropdown")){e.focus();t.stopPropagation();t.stopImmediatePropagation()}}}}export class PrintDocument{constructor(t){this._title=null;this._copyCss=!0;null!=t&&copy(this,t)}get title(){return this._title}set title(t){this._title=asString(t)}get copyCss(){return this._copyCss}set copyCss(t){this._copyCss=asBoolean(t)}addCSS(t){this._css||(this._css=[]);this._css.push(t)}append(t){const e=this._getDocument();if(isString(t))e.write(t);else if(t instanceof Element){t instanceof HTMLElement&&Control.refreshAll(t);const s=t.cloneNode(!0),n=s.querySelectorAll("input");for(let t=0;t<n.length;t++){const e=n[t];switch(e.type){case"checkbox":setAttribute(e,"checked",!!e.checked||null);setAttribute(e,"indeterminate",!!e.indeterminate||null);break;case"radio":setAttribute(e,"checked",!!e.checked||null);break;default:setAttribute(e,"value",e.value||null)}}e.write(s.outerHTML)}else assert(!1,"content should be an HTML string or an Element.")}print(t){if(this._iframe){this._close();setTimeout(()=>{const e=this._iframe.contentWindow,s="onafterprint"in e&&!isFirefox();s&&(e.onafterprint=()=>{this._afterPrint(t)});if(!(isIE()&&null==e.document.body)&&document.queryCommandSupported("print"))e.document.execCommand("print",!0,null);else{e.focus();e.print()}s||this._afterPrint(t)},100)}}_afterPrint(t){document.body.removeChild(this._iframe);this._iframe=null;isFunction(t)&&t()}_getDocument(){if(!this._iframe){this._iframe=document.createElement("iframe");const t=this._iframe;addClass(t,PrintDocumentClsNames.printDocument);setCss(t,{position:"fixed",left:32e3,top:32e3});document.body.appendChild(t)}return this._iframe.contentDocument}_close(){const 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(t=>{const e=t.querySelectorAll("LINK");for(let t=0;t<e.length;t++){const s=e[t];if(s.rel.match(/stylesheet/i)&&(!s.type||s.type.match(/text\/css/i))){const t=httpRequest(s.href,{async:!1});this._addStyle(t.responseText)}}const s=t.querySelectorAll("STYLE");for(let t=0;t<s.length;t++)this._addStyle(s[t].textContent)});if(this._css)for(let e=0;e<this._css.length;e++){const s=t.createElement("style"),n=httpRequest(this._css[e],{async:!1});s.textContent=n.responseText;t.head.appendChild(s)}}_addStyle(t){const e=this._getDocument(),s=e.createElement("style");s.textContent=t;e.head.appendChild(s)}}export class Clipboard{static copy(t){Clipboard._copyPaste(asString(t),null)}static paste(t){t=asFunction(t);Clipboard._copyPaste(null,t)}static _copyPaste(t,e){const s=getActiveElement();let n=closest(s,"."+ControlClsNames.hostElement);for(;n&&Control.getControl(n);)n=n.parentElement;n=n||document.body;if(n){let i=!1,r=createElement(`<textarea class="${ClipboardClsNames.clipboard}">`,n,{position:"fixed",opacity:"0"});r.onkeydown=t=>t.preventDefault();r.onchange=t=>t.stopImmediatePropagation();if(isString(t)){r.value=t;r.select();document.execCommand("copy")&&(i=!0)}else{r.select();if(isFunction(e)&&document.execCommand("paste")){e(r.value);i=!0}}setTimeout(()=>{s.focus({preventScroll:!0});(isIE()?setTimeout:(t,e)=>t())(()=>removeChild(r),500);!i&&isFunction(e)&&e(r.value)},Control._CLIPBOARD_DELAY)}}}export class _ClickRepeater{constructor(t){this._isDown=!1;this._mousedownBnd=this._mousedown.bind(this);this._mouseupBnd=this._mouseup.bind(this);this._clickBnd=this._click.bind(this);this.element=t;this._connect(!0)}get element(){return this._e}set element(t){this._connect(!1);this._e=asType(t,HTMLElement,!0);this._connect(!0)}get disabled(){return this._disabled}set disabled(t){this._disabled=asBoolean(t)}_connect(t){this._e&&_ClickRepeater._startEvents.forEach(e=>{t?this._e.addEventListener(e,this._mousedownBnd,{passive:!0}):this._e.removeEventListener(e,this._mousedownBnd)})}_clearTimeouts(){if(this._toRepeat){clearTimeout(this._toRepeat);this._toRepeat=null}if(this._toDelay){clearTimeout(this._toDelay);this._toDelay=null}}_mousedown(t){this._isDown&&this._mouseup(null);if(!this._disabled){this._isDown=!0;_ClickRepeater._stopEvents.forEach(t=>{document.addEventListener(t,this._mouseupBnd)});this._clearTimeouts();this._toDelay=setTimeout(()=>{if(this._isDown){this._click();this._toRepeat=setTimeout(this._clickBnd,Control._CLICK_REPEAT)}},Control._CLICK_DELAY)}}_mouseup(t){if(!t||"mouseout"!==t.type||this._e&&this._e.contains(t.target)){this._isDown&&t&&"keydown"!=t.type&&this._clicked&&t.preventDefault();_ClickRepeater._stopEvents.forEach(t=>{document.removeEventListener(t,this._mouseupBnd)});this._clearTimeouts();this._isDown=!1;this._clicked=!1}}_click(){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"];export var PopupPosition;!function(t){t[t.Above=0]="Above";t[t.AboveRight=1]="AboveRight";t[t.RightTop=2]="RightTop";t[t.Right=3]="Right";t[t.RightBottom=4]="RightBottom";t[t.BelowRight=5]="BelowRight";t[t.Below=6]="Below";t[t.BelowLeft=7]="BelowLeft";t[t.LeftBottom=8]="LeftBottom";t[t.Left=9]="Left";t[t.LeftTop=10]="LeftTop";t[t.AboveLeft=11]="AboveLeft"}(PopupPosition||(PopupPosition={}));export function showPopup(t,e,s,n,i=!0,r){const o=t.offsetHeight||t.offsetWidth;let a=s;(isBoolean(s)||null==s)&&(a=s?PopupPosition.AboveLeft:PopupPosition.BelowLeft);const l=_getPopupParent(e);_addPopupToDOM(t,l);_copyPopupStyles(t,e,i);Control.refreshAll(t);_updatePopupPosition(t,e,a);isFirefox()&&requestAnimationFrame(()=>{_updatePopupPosition(t,e,a)});e instanceof HTMLElement&&(t[Control._OWNR_KEY]=e);if(!o){_hidePopupOnscroll(t,e,r);if(n)return animate(e=>{t.style.opacity=e<1?e.toString():""});t.style.opacity=""}return null}export function hidePopup(t,e=!0,s=!1){let n=null;s?n=animate(s=>{t.style.opacity=(1-s).toString();if(1==s){_hidePopup(t,e);t.style.opacity=""}}):_hidePopup(t,e);return n}export function _updatePopupPosition(t,e,s){const n=_getReferenceRect(t,e),i=_getPopupOffset(t),r=_getPopupPosition(t,n,s,i),o={position:"absolute",zIndex:Control._POPUP_ZINDEX},a=0==i.x;if(a){o.left=r.x;o.top=r.y}else o.transform=`translate(${r.x}px, ${r.y}px)`;const l=t.getBoundingClientRect().width;setCss(t,o);if(a){const e=l-t.getBoundingClientRect().width;e>0&&(t.style.left=r.x-Math.ceil(e)+"px")}}function _hidePopup(t,e){t.style.display="none";e&&t.parentElement&&setTimeout(()=>{if("none"==t.style.display){removeChild(t);isFunction(e)&&e()}},Control._FOCUS_INTERVAL+50);const s=t[Control._SCRL_KEY];s instanceof Control&&s.dispose();delete t[Control._SCRL_KEY];delete t[Control._OWNR_KEY]}function _isjQueryDialog(t){const e=window.jQuery,s=isFunction(e)?e(t):null;return s&&isFunction(s.dialog)&&hasClass(t,"ui-dialog")}function _getPopupParent(t){let e=document.body;if(t instanceof HTMLElement){if(!contains(document.body,t))return e;for(let s=t;s;s=s.parentElement){if("DIALOG"==s.tagName||"ION-CONTENT"==s.tagName||"fixed"==getComputedStyle(s).position){e=s;break}if(_isjQueryDialog(s)){e=s.querySelector(".ui-dialog-content")||s;break}}}return e}function _addPopupToDOM(t,e){if(!t.offsetHeight||!t.offsetWidth||t.parentElement!=e){setCss(t,{opacity:"0",position:"fixed",left:0,top:0,transform:"",display:""});e.appendChild(t)}}function _getPopupOffset(t){let e=document.body,s=document.documentElement,n=t.parentElement,i=new Point(e.scrollLeft||pageXOffset,e.scrollTop||pageYOffset);if(n!=e){let r=n==e?s:t.offsetParent||n;r==e&&(r=n);if(r){const t=r.getBoundingClientRect();i=new Point(r.scrollLeft-t.left,r.scrollTop-t.top)}}if(n instanceof HTMLElement){const t=getComputedStyle(n);i.x-=parseFloat(t.borderLeftWidth);i.y-=parseFloat(t.borderTopWidth)}return i}function _copyPopupStyles(t,e,s){if(e instanceof HTMLElement&&s){const n=s instanceof HTMLElement?s:e,i=getComputedStyle(n);1==new Color(i.backgroundColor).a&&setCss(t,{color:i.color,backgroundColor:i.backgroundColor,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle})}}function _hidePopupOnscroll(t,e,s){const n=e instanceof MouseEvent?e.target:e;if(n instanceof HTMLElement&&n.parentElement!=document.body){const i=Date.now(),r=n.getBoundingClientRect(),o=new Control(document.createElement("div"));t[Control._SCRL_KEY]=o;o.addEventListener(document,"scroll",a=>{if(a.target!=t.parentElement&&Date.now()-i>100&&contains(document,n)&&!contains(t,a.target)&&(a.target!=document||null!=e&&"fixed"==t.style.position)){const e=n.getBoundingClientRect(),i=Math.abs(e.left-r.left),a=Math.abs(e.top-r.top);if(i>1||a>1){isFunction(s)&&s();_hidePopup(t,!0);o.dispose()}}},!0)}}function _getPopupPosition(t,e,s,n){const i=document.documentElement,r=i.clientWidth,o=i.clientHeight,a=PopupPosition;switch(s){case a.AboveLeft:case a.AboveRight:case a.BelowLeft:case a.BelowRight:if(e){let s=e.width;if(s){isIE()&&(s-=t.offsetWidth-t.clientWidth);t.style.minWidth=s+"px"}}}const l=getComputedStyle(t),c=parseFloat(l.marginTop)+parseFloat(l.marginBottom),h=parseFloat(l.marginLeft)+parseFloat(l.marginRight),u=new Size(t.offsetWidth+h,t.offsetHeight+c),d=new Point((r-u.width)/2,Math.round((o-u.height)/2*.7));if(e){"rtl"==l.direction&&(s=_getRtlPosition(s));const t=e.left,n=r-e.right;d.x=e.left;switch(s){case a.Above:case a.Below:d.x=e.left+(e.width-u.width)/2;break;case a.AboveLeft:case a.BelowLeft:d.x=e.left;break;case a.AboveRight:case a.BelowRight:d.x=e.right-u.width;break;case a.Left:case a.LeftTop:case a.LeftBottom:d.x=t>=u.width||t>=n?e.left-u.width:e.right;break;case a.RightTop:case a.RightBottom:case a.Right:d.x=n>=u.width||n>=t?e.right:e.left-u.width}const i=e.top,c=o-e.bottom;switch(s){case a.Above:case a.AboveLeft:case a.AboveRight:d.y=i>u.height||i>c?e.top-u.height:e.bottom;break;case a.Below:case a.BelowLeft:case a.BelowRight:d.y=c>u.height||c>i?e.bottom:e.top-u.height;break;case a.LeftTop:case a.RightTop:d.y=e.top;break;case a.LeftBottom:case a.RightBottom:d.y=e.bottom-u.height;break;case a.Left:case a.Right:d.y=e.bottom-u.height+(u.height-e.height)/2}}d.x=Math.min(d.x,r-u.width);d.y=Math.min(d.y,o-u.height);d.x=Math.max(0,d.x)+n.x;d.y=Math.max(0,d.y)+n.y;return d}function _getRtlPosition(t){const e=PopupPosition;switch(t){case e.AboveLeft:return e.AboveRight;case e.AboveRight:return e.AboveLeft;case e.BelowLeft:return e.BelowRight;case e.BelowRight:return e.BelowLeft;case e.Left:return e.Right;case e.LeftTop:return e.RightTop;case e.LeftBottom:return e.RightBottom;case e.Right:return e.Left;case e.RightTop:return e.LeftTop;case e.RightBottom:return e.LeftBottom}return t}function _getReferenceRect(t,e){return e instanceof MouseEvent?e.clientX<=0&&e.clientY<=0&&e.target instanceof HTMLElement?Rect.fromBoundingRect(e.target.getBoundingClientRect()):new Rect(e.pageX-pageXOffset,e.pageY-pageYOffset,0,0):e instanceof Point?new Rect(e.x,e.y,0,0):e instanceof HTMLElement?Rect.fromBoundingRect(e.getBoundingClientRect()):e&&null!=e.top&&null!=e.left?e:null}export var TooltipTrigger;!function(t){t[t.Focus=0]="Focus";t[t.Hover=1]="Hover";t[t.Both=2]="Both"}(TooltipTrigger||(TooltipTrigger={}));export class Tooltip{constructor(t){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,t)}get position(){return this._position}set position(t){this._position=asEnum(t,PopupPosition)}get trigger(){return this._trigger}set trigger(t){this._trigger=asEnum(t,TooltipTrigger);this._tips.forEach(t=>{this._detach(t.element);this._attach(t.element)})}get isAnimated(){return this._isAnimated}set isAnimated(t){this._isAnimated=asBoolean(t)}setTooltip(t,e,s){t=getElement(t);e=this._getContent(e);const n=this._indexOf(t);if(n>-1){this._detach(t);this._tips.splice(n,1)}if(e){this._attach(t);this._tips.push({element:t,content:e,position:s})}const i=Tooltip._eTip;if(i&&i[Control._TTIP_KEY]==t)if(e){this._setContent(e);i.isConnected&&!this._showAtMouse&&this.show(t,e,null,s)}else this._hideAutoTip()}getTooltip(t){t=getElement(t);const e=this._tips;for(let s=0;s<e.length;s++)if(e[s].element==t)return e[s].content;return null}show(t,e,s,n){t=getElement(t);e=this._getContent(e);if(!t)return;null==n&&(n=this.position);document.addEventListener("keydown",this._keydownHandleBnd);let i=Tooltip._eTip;this.forceRecreate&&i&&i.remove();if(!i||this.forceRecreate){i=Tooltip._eTip=document.createElement("div");addClass(i,TooltipClsNames.hostElement);setAttribute(i,"aria-live","polite");i.style.visibility="none"}if(!i.isConnected){i.id=getUniqueId(t.id+"_toolTip");addAttributeValueToElement(t,"aria-describedby",i.id)}i.setAttribute("class",TooltipClsNames.hostElement);this._tooltipVisibleOnHover&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&i.addEventListener("mouseleave",this._hideAutoTipBnd);addClass(i,this.cssClass);hasClass(t,ControlStateClsNames.invalid)?i.setAttribute("role","alert"):i.setAttribute("role","tooltip");this._setContent(e);i[Control._TTIP_KEY]=t;const r=new TooltipEventArgs(e,t);this.onPopup(r);if(r.content&&!r.cancel){this._setContent(r.content);s||(s=Rect.fromBoundingRect(t.getBoundingClientRect()));const e=this.gap,o=PopupPosition;if(e)switch(n){case o.Above:case o.AboveLeft:case o.AboveRight:case o.Below:case o.BelowLeft:case o.BelowRight:s=s.inflate(0,e);break;default:s=s.inflate(e,0)}showPopup(i,s,n,this.isAnimated);document.addEventListener("mousedown",this._hideAutoTipBnd)}}hide(){const t=Tooltip._eTip;if(t){removeChild(t);removeClass(t,this.cssClass);t.innerHTML="";this._tooltipVisibleOnHover&&t.removeEventListener("mouseleave",this._hideAutoTipBnd);removeAttributeValueFromElement(t[Control._TTIP_KEY],"aria-describedby",t.id)}document.removeEventListener("mousedown",this._hideAutoTipBnd);document.removeEventListener("keydown",this._keydownHandleBnd);this._tooltipVisibleOnHover&&document.removeEventListener("mousemove",this._mousemovedocBnd)}dispose(){this.hide();const t=this._tips;if(t.length){t.forEach(t=>{this._detach(t.element)});t.splice(0,t.length)}if(Tooltip._eTip){Tooltip._eTip[Control._TTIP_KEY]=null;Tooltip._eTip=null}this._clearTimeouts()}get isVisible(){const t=Tooltip._eTip;return null!=t&&null!=t.parentElement&&t.offsetWidth>0}get isContentHtml(){return this._html}set isContentHtml(t){this._html=asBoolean(t)}get cssClass(){return this._cssClass}set cssClass(t){this._cssClass=asString(t)}get gap(){return this._gap}set gap(t){this._gap=asNumber(t)}get showAtMouse(){return this._showAtMouse}set showAtMouse(t){this._showAtMouse=asBoolean(t)}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=asInt(t)}get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=asInt(t)}onPopup(t){this.popup&&this.popup.raise(this,t);return!t.cancel}keydownHandle(t){"Escape"===t.key&&this.hide()}_indexOf(t){for(let e=0;e<this._tips.length;e++)if(this._tips[e].element==t)return e;return-1}_attach(t){if(this._tooltipVisibleOnHover)switch(this._trigger){case TooltipTrigger.Focus:t.addEventListener("focus",this._focusBnd);t.addEventListener("keydown",this._keydownBnd);t.addEventListener("blur",this._hideAutoTipBnd);break;case TooltipTrigger.Both:t.addEventListener("mousemove",this._showAutoTipBnd);t.addEventListener("mouseleave",this._hideAutoTipBnd);t.addEventListener("focus",this._focusBnd);t.addEventListener("keydown",this._keydownBnd);t.addEventListener("blur",this._hideAutoTipBnd);break;default:t.addEventListener("mousemove",this._showAutoTipBnd);t.addEventListener("mouseleave",this._hideAutoTipBnd)}else{t.addEventListener("mousemove",this._showAutoTipBnd);t.addEventListener("mouseleave",this._hideAutoTipBnd)}t.addEventListener("click",this._showAutoTipBnd);this.showAtMouse&&t.addEventListener("mousemove",this._mousemoveBnd)}_detach(t){t.removeEventListener("focus",this._focusBnd);t.removeEventListener("mousemove",this._showAutoTipBnd);t.removeEventListener("mouseleave",this._hideAutoTipBnd);t.removeEventListener("click",this._showAutoTipBnd);t.removeEventListener("mousemove",this._mousemoveBnd);t.removeEventListener("keydown",this._keydownBnd);t.removeEventListener("blur",this._hideAutoTipBnd);t.removeEventListener("mousedown",this._hideAutoTipBnd)}_keydown(t,e){if("Tab"==t.key){this._clearTimeouts();this.hide()}}_focus(t){t&&t.target&&this._showAutoTip(void 0,t.target)}_showAutoTip(t,e){const s=this._hideDelay;if(t&&[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)){if(t.defaultPrevented)return;if(this._tooltipVisibleOnHover&&"mousemove"==t.type&&this.isVisible&&!1===this._isMouseOutOfTipAndOwner(t))return;if("click"==t.type&&!Control._touching){this._hideAutoTip(t);return}const e=t&&"mouseenter"==t.type?this._showDelay:0;this._clearTimeouts();this._eMouse=t;const n=t.currentTarget;this._toShow=setTimeout(()=>{const t=this._indexOf(n);if(t>-1){const e=this._tips[t],n=this._eMouse,i=this._showAtMouse?new Rect(n.clientX,n.clientY,0,0):null,r=e&&e.element;if(r&&this._hasOffset(r)){const t=Control.getControl(e.element);if(null==t||0!=t.isVisible){this.show(e.element,e.content,i,e.position);s>0&&(this._toHide=setTimeout(()=>{this.hide()},s))}}}},e)}if(e&&[TooltipTrigger.Focus,TooltipTrigger.Both].includes(this.trigger)){const t=this._showDelay;this._toShow=setTimeout(()=>{const t=this._indexOf(e);if(t>-1){const e=this._tips[t],n=null,i=e&&e.element;if(i&&this._hasOffset(i)){const t=Control.getControl(e.element);if(null==t||0!=t.isVisible){this.show(e.element,e.content,n,e.position);s>0&&(this._toHide=setTimeout(()=>{this.hide()},s))}}}},t)}}_mousemove(t){const e=Tooltip._eTip;e&&!e.isConnected&&(this._eMouse=t)}_mousemovedoc(t){[TooltipTrigger.Hover,TooltipTrigger.Both].includes(this.trigger)&&this._checkBoundsAndHide(t,!1)}_hideAutoTip(t){if(!t)return;if(Tooltip._eTip)if(this._tooltipVisibleOnHover){"mouseleave"==t.type&&document.addEventListener("mousemove",this._mousemovedocBnd);this._checkBoundsAndHide(t,!0)}else if((this.trigger==TooltipTrigger.Hover||this.trigger==TooltipTrigger.Both)&&t&&"click"!=t.type&&"mousedown"!=t.type){this._clearTimeouts();this.hide()}}_checkBoundsAndHide(t,e){if(!Tooltip._eTip)return;if(!t)return;if(!0===this._isMouseOutOfTipAndOwner(t)||"blur"==t.type){e&&this._clearTimeouts();this.hide()}}_clearTimeouts(){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}}_getContent(t){if((t=asString(t))&&"#"==t[0]){const e=getElement(t);e&&(t=e.innerHTML)}return t}_setContent(t){const e=Tooltip._eTip;e&&(this._html?e.innerHTML=t:e.textContent=t)}_hasOffset(t){const e=new Size(t.offsetWidth,t.offsetHeight);if(t instanceof SVGGraphicsElement){const s=t.getBBox();e.width=s.width;e.height=s.height}return e.width>0||e.height>0}get forceRecreate(){return this._forceRecreate}set forceRecreate(t){this._forceRecreate=t}_isMouseOutOfTipAndOwner(t){const e=Tooltip._eTip;if(!e||!t)return;const s=e[Control._TTIP_KEY];let n=Rect.fromBoundingRect(e.getBoundingClientRect()),i=Rect.fromBoundingRect(s.getBoundingClientRect()),r=this.gap+2,o=PopupPosition,a=0;const l=this._indexOf(s);l>-1&&(a=this._tips[l]&&this._tips[l].position?this._tips[l].position:this.position);switch(a){case o.Above:case o.AboveLeft:case o.AboveRight:i=i.inflate(0,r,0,0);break;case o.Below:case o.BelowLeft:case o.BelowRight:i=i.inflate(0,0,0,r);break;case o.Left:case o.LeftTop:case o.LeftBottom:i=i.inflate(r,0,0,0);break;case o.Right:case o.RightTop:case o.RightBottom:i=i.inflate(0,0,r,0)}const c=t;let h=!0;e.getClientRects().length>0&&null!=c&&(h=!(c.clientX>n.left&&c.clientX<n.right&&c.clientY>n.top&&c.clientY<n.bottom));let u=!0;null!=c&&(u=!(c.clientX>i.left&&c.clientX<i.right&&c.clientY>i.top&&c.clientY<i.bottom));return h&&u}}export class TooltipEventArgs extends CancelEventArgs{constructor(t,e){super();this._content=asString(t);this._e=e}get tip(){return Tooltip._eTip}get element(){return this._e}get content(){return this._content}set content(t){this._content=asString(t)}}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={};export function _updateWme(t,e){const s=Control._wme;if(!(s&&contains(document.body,s)&&s.offsetWidth&&s.offsetHeight))if(e){const s=_getControlCode(t);if(!_codes[s]){_codes[s]=!0;_attorn(e,{algorithmCode:"B0",publicKey:"l6/zrbWoSbcLFwEetFh38rH3ErBZE9H+Cqix3R+wTlfA1wD5B+lUcCQn+EJ60I4RGrm0x1sFjkiLWwB0jAn6BWZv0W4WbqAKriOdeoivxDp1Wmjs3qkEDhvbsjPtfvwx2BHil6o+/tDrdMJQSGs18WZm2PoQLQuL+9VhZ4FNRHUQU3Jtioke/OZEGHJOdYVwvCGalzBad6QFOiVbDBQPePpS3++GJzOxN8SN/7lyS5/IdKiy3WJRaVGkB370+HbN6hKraDfUgReLX26yxRaKC/5aWnGAJ2NnWLoGyAGRcwT9dVjo4bcAZNrrA0U9JVKQxaSskhdv2p49XzJkltXx5w=="},n=>{_checkLicense(t,e,n);delete _codes[s]},()=>{_checkLicense(t,e,null);delete _codes[s]})}}else _checkLicense(t,null,null)}function _getControlCode(t){return t._getProductInfo().split(",")[0]}function _getControlName(t){return t._getProductInfo().split(",")[1]}function _checkLicense(t,e,s){let n=culture.Licensing||_licStr,i=null;s?_checkExpiration(t,s)?_checkVersion(t,s)?_checkDomain(t,s)?_checkProductCode(t,s)?_checkEval(t,s)&&(i=n.evl):i=n.prd:i=n.dmn:i=n.ver:i=n.exp:i=e?n.lic:n.mss;if(i){i+="<br/><br/>"+n.ctc;_addWme(t,i,s)}}function _checkProductCode(t,e){const s=_getControlCode(t);if(s&&s.length>=4)for(let t=0;t<e.Prd.length;t++)if(e.Prd[t].C.indexOf(s)>-1)return!0;return!1}function _checkExpiration(t,e){if(e.Exp){const t=e.Exp,s=new Date(parseInt(t.substr(0,4))||0,parseInt(t.substr(4,2))-1||0,parseInt(t.substr(6,2))||0);if(Math.ceil((s.valueOf()-Date.now())/864e5)<=0)return!1}return!0}function _checkVersion(t,e){const s=e.Anl?e.Anl.ver:null,n=getVersion();if(s&&n){return parseInt(s.replace("v",""))+10>=parseInt(n.split(".")[1])}return!0}function _checkDomain(t,e){if(_isLocalHost()||!e.Dms)return!0;const s=location.hostname,n=e.Dms.split(",");for(let t=0;t<n.length;t++)if(_ckHT(s,n[t]))return!0;return!1}export function _ckHT(t,e){var s=`^${e.replace(/\./g,"\\.").replace(/\*/g,"(.*)")}$`;if(new RegExp(s,"i").test(t))return!0;if("*."==e.substr(0,2))return _ckHT(t,e.substr(2));if(isIp(t)&&!isIpv6(t)){const s=ipaddr.parse(t),n=parseCIDR(e);if(n&&matchCIDR(s,n))return!0}return!1}function isIp(t){return isIpv4(t)||isIpv6(t)}function isIpv4(t){return ipaddr.IPv4.isValidFourPartDecimal(t)}function isIpv6(t){return ipaddr.IPv6.isValid(t)}function _isIPExactMatch(t,e){return ipaddr.parse(t).toString()===ipaddr.parse(e).toString()}function parseCIDR(t){if(-1===t.indexOf("/"))return!1;const e=t.split("/");if(e[1].indexOf(".")>-1){const s=ipaddr.parse(e[1]).prefixLengthFromSubnetMask();t=[e[0],s].join("/")}try{return ipaddr.parseCIDR(t)}catch(t){return!1}}function matchCIDR(t,e){try{return t.match(e)}catch(t){return!1}}function _checkEval(t,e){return!!e&&e.Evl}function _isLocalHost(){const t=location,e=atob("Xih8bG9jYWxob3N0fGZpZGRsZS5qc2hlbGwubmV0fHJ1bi5wbG5rci5jb3xzLmNvZGVwZW4uaW98bnVsbC5qc2Jpbi5jb218Lio/LnN0YWNrYmxpdHouaW98MTI3LjAuMC4xfFt3LV0rLmxvY2FsfFt3LV0rfDo6MSkk");return"file:"==t.protocol||new RegExp(e,"i").test(t.hostname)}function _addWme(t,e,s){e=_getMessage(t,e,s);if(!_codes[" "]&&!_isLocalHost()&&!_checkEval(t,s)){_codes[" "]=!0;const t=culture.Licensing||_licStr,s=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">'+t.hdr+"</p><p>"+e+'</p></div><div style="text-align:right;margin-top:24pt"><button style="border:none;background:rgba(158,158,158,.2);padding:8px 16px">'+t.cls+"</button></div></div></div>",document.body);s.addEventListener("click",t=>{t.target instanceof HTMLButtonElement&&removeChild(s)})}if(!Control._wme){const s=createElement(`<div><a href="${_getWmeHref()}" target="_blank" rel="noopener">${_getMessage(t)}</a></div>`),n={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:n.right=n.bottom=0;break;case 1:n.left=n.bottom=0;break;case 2:n.right=n.top=0}setCss(s,n);document.body.appendChild(s);Control._wme=s;_addClickableTooltip(s,e)}}function _addClickableTooltip(t,e){const s=createElement(e);s.className=TooltipClsNames.hostElement;setCss(s,{pointerEvents:"auto",padding:"10px",margin:"6px"});[t,s].forEach(t=>{t.addEventListener("mouseenter",()=>trackMouse(!0));t.addEventListener("mouseleave",()=>trackMouse(!1))});let n,i=0;function trackMouse(e){i+=e?1:-1;n&&clearTimeout(n);n=setTimeout(()=>{n=null;1==i?showPopup(s,t.getBoundingClientRect()):i<1&&hidePopup(s)},500)}}function _getWmeHref(){switch(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(t,e,s){if(!e||e.trim().length<15){e=(culture.Licensing||_licStr).evl}(!e||e.trim().length<15)&&(e=atob("V2lqbW8gRXZhbHVhdGlvbiBWZXJzaW9uICh7dmVyc2lvbn0p"));let n=null;if(s&&s.Exp){const t=s.Exp;n=new Date(parseInt(t.substr(0,4))||0,parseInt(t.substr(4,2))-1||0,parseInt(t.substr(6,2))||0)}return e=format(e,{version:getVersion(),domain:location.hostname,control:_getControlName(t),licVer:s&&s.Anl?`5.${s.Anl.ver.replace("v","")}.*`:null,licDomain:s?s.Dms:null,expDate:n})}function _attorn(t,e,s,n){const i=parseKeyData(t,e.algorithmCode);if(!i)return n();const r=i.lic,o=`${i.prefix}#${e.algorithmCode}`;if(tripleHash(o+JSON.stringify(r.D))!=r.H)return n();const a=window.msCrypto||window.crypto,l=a?a.subtle:null;if(!l||!location.protocol.match(/^https/i))return s(r.D);const c={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};let h={alg:"RS256",e:"AQAB",kty:"RSA",n:str64ToJwkBase64(e.publicKey)};h=window.msCrypto?str2ArrayBuffer(JSON.stringify(h)):h;try{asPromise(l.importKey("jwk",h,c,!1,["verify"])).then(t=>{const e=arrayBuffer2Str(str64ToArrayBuffer(str64EncodeUnicode(o+JSON.stringify(r.D))));asPromise(l.verify(c,t,str64ToArrayBuffer(r.S),str2ArrayBuffer(e))).then(t=>t?s(r.D):n())},()=>s(r.D))}catch(t){return s(r.D)}}var uint8Array="undefined"==typeof window?null:window.Uint8Array||window.TypedArray;function parseKeyData(t,e){try{e="#"+e;const s=t.indexOf(e);if(s>-1)return{prefix:t.substring(0,s),lic:JSON.parse(decode(t.substr(s+e.length)))}}catch(t){}return null}function decode(t){if(!t)return"";let e=unshiftString(t);e=reverseString(e);const s=Math.ceil(e.length/2);e=e.substr(s)+e.substr(0,s);e=e.replace("#","=");e=e.replace("&","==");return str64DecodeUnicode(e)}function unshiftString(t){const e=t.split("");for(let t=e.length-5;t>=0;t--){swapArrayElements(e,t+1,t+3,unshiftChar);swapArrayElements(e,t,t+2,unshiftChar)}return e.join("")}function swapArrayElements(t,e,s,n){t.length>1&&t.splice(s,1,n(t.splice(e,1,n(t[s]))[0]))}function shiftChar(t,e){const s=t.charCodeAt(0);return s>=65&&s<=90?t.toLowerCase():s>=97&&s<=122?t.toUpperCase():s>=48&&s<=57?String.fromCharCode(48+(s-48+10+e)%10):t}function unshiftChar(t){return shiftChar(t,-1)}function reverseString(t){return t.split("").reverse().join("")}function str64DecodeUnicode(t){let e=atob(t),s="";for(let t=0;t<e.length;t++)s+="%"+("00"+e.charCodeAt(t).toString(16)).slice(-2);return decodeURIComponent(s)}function arrayBuffer2Str(t){return String.fromCharCode.apply(null,new uint8Array(t))}function str64ToArrayBuffer(t){const e=atob(t),s=e.length,n=new uint8Array(s);for(let t=0;t<s;t++)n[t]=e.charCodeAt(t);return n.buffer}function str64EncodeUnicode(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16))))}function str64ToJwkBase64(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function str2ArrayBuffer(t){const e=new ArrayBuffer(t.length),s=new uint8Array(e);for(let e=0,n=t.length;e<n;e++)s[e]=t.charCodeAt(e);return e}function tripleHash(t){let e=0,s=5381,n=0;for(let i=t.length-1;i>=0;i--){const r=t.charCodeAt(i);e=r+(e<<6)+(e<<16)-e;s=r+((s<<5)+s);n=r+((n<<5)-n)}let i=e^s^n;i<0&&(i=~i);return i.toString(16).toUpperCase()}function asPromise(t){if("oncomplete"in t){t.then=(e,s)=>{t.resolve=e;t.reject=s};t.oncomplete=e=>{t.resolve(t.result)};t.onerror=e=>{t.reject()}}return t}_registerModule("wijmo",selfModule);