UNPKG

@mescius/wijmo

Version:

UI library for pure JS, Angular, React, Vue and more...

14 lines (13 loc) 145 kB
/*! * * Wijmo Library 5.20252.44 * https://developer.mescius.com/wijmo * * Copyright(c) MESCIUS inc. All rights reserved. * * Licensed under the End-User License Agreement For MESCIUS Wijmo Software. * us.sales@mescius.com * https://developer.mescius.com/wijmo/licensing * */ 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;