@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
2 lines • 535 kB
JavaScript
/*! For license information please see orgchart.min.js.LICENSE.txt */
function mxOrgChartLayout(t,e,n,r){switch(mxGraphLayout.call(this,t),this.correctY=!1,parseInt(e)){case 0:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_LINEAR,this.correctY=!0;break;case 1:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_HANGER2,this.correctY=!0;break;case 3:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_FISHBONE1;break;case 4:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_FISHBONE2;break;case 5:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_1COLUMN_L;break;case 6:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_1COLUMN_R;break;case 7:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_SMART;break;default:this.branchOptimizer=mxOrgChartLayout.prototype.BRANCH_OPT_HANGER4,this.correctY=!0}this.parentChildSpacing=0<n?n:20,this.siblingSpacing=0<r?r:20}!function(t){"use strict";var e,n,r,i,o,s,a,u,l,c,g={global:t,emptyFn:function(){},identity:function(t){return t},geti:function(t,e,n){return Bridge.hasValue(t[e])?e:n},literal:function(t,e){return e.$getType=function(){return t},e},isPlainObject:function(t){if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1},toPlain:function(t){var e,n,r,i,o;if(!t||Bridge.isPlainObject(t)||"object"!=typeof t)return t;if("function"==typeof t.toJSON)return t.toJSON();if(Bridge.isArray(t)){for(e=[],n=0;n<t.length;n++)e.push(Bridge.toPlain(t[n]));return e}for(o in r={},t)i=t[o],Bridge.isFunction(i)||(r[o]=i);return r},ref:function(t,e){Bridge.isArray(e)&&(e=System.Array.toIndex(t,e));var n={};return Object.defineProperty(n,"v",{get:function(){return t[e]},set:function(n){t[e]=n}}),n},property:function(t,e,n,r){t[e]=n;var i="$"===e.charAt(0)?e.slice(1):e,o="get"+i,s="set"+i,a=e.lastIndexOf("$");a>0&&e.length-a-1>0&&!isNaN(parseInt(e.substr(a+1)))&&(a=e.substring(0,a-1).lastIndexOf("$")),a>0&&a!==e.length-1&&(o=e.substring(0,a)+"get"+e.substr(a+1),s=e.substring(0,a)+"set"+e.substr(a+1)),t[o]=function(t,e,n){return n?function(){return e[t]}:function(){return this[t]}}(e,t,r),t[s]=function(t,e,n){return n?function(n){e[t]=n}:function(e){this[t]=e}}(e,t,r)},event:function(t,e,n,r){t[e]=n;var i="$"===e.charAt(0)?e.slice(1):e,o="add"+i,s="remove"+i,a=e.lastIndexOf("$");a>0&&e.length-a-1>0&&!isNaN(parseInt(e.substr(a+1)))&&(a=e.substring(0,a-1).lastIndexOf("$")),a>0&&a!==e.length-1&&(o=e.substring(0,a)+"add"+e.substr(a+1),s=e.substring(0,a)+"remove"+e.substr(a+1)),t[o]=function(t,e,n){return n?function(n){e[t]=Bridge.fn.combine(e[t],n)}:function(e){this[t]=Bridge.fn.combine(this[t],e)}}(e,t,r),t[s]=function(t,e,n){return n?function(n){e[t]=Bridge.fn.remove(e[t],n)}:function(e){this[t]=Bridge.fn.remove(this[t],e)}}(e,t,r)},createInstance:function(t,e){return t===System.Decimal?System.Decimal.Zero:t===System.Int64?System.Int64.Zero:t===System.UInt64?System.UInt64.Zero:t===System.Double||t===System.Single||t===System.Byte||t===System.SByte||t===System.Int16||t===System.UInt16||t===System.Int32||t===System.UInt32||t===Bridge.Int?0:"function"==typeof t.getDefaultValue?t.getDefaultValue():t!==Boolean&&(t===Date?new Date(0):t===Number?0:t===String?"":t&&t.$literal?t.ctor():e&&e.length>0?Bridge.Reflection.applyConstructor(t,e):new t)},clone:function(t){return Bridge.isArray(t)?System.Array.clone(t):Bridge.isString(t)?t:Bridge.isFunction(t.System$ICloneable$clone)?t.System$ICloneable$clone():Bridge.is(t,System.ICloneable)?t.clone():null},copy:function(t,e,n,r){"string"==typeof n&&(n=n.split(/[,;\s]+/));for(var i,o=0,s=n?n.length:0;o<s;o++)i=n[o],(!0!==r||null==t[i])&&(t[i]=Bridge.is(e[i],System.ICloneable)?Bridge.clone(e[i]):e[i]);return t},get:function(t){return t&&null!==t.$staticInit&&t.$staticInit(),t},ns:function(t,e){var n=t.split("."),r=0;for(e||(e=Bridge.global),r=0;r<n.length;r++)void 0===e[n[r]]&&(e[n[r]]={}),e=e[n[r]];return e},ready:function(t,e){var n=function(){e?t.apply(e):t()};void 0!==Bridge.global.jQuery?Bridge.global.jQuery(n):void 0===Bridge.global.document||"complete"===Bridge.global.document.readyState||"loaded"===Bridge.global.document.readyState?n():Bridge.on("DOMContentLoaded",Bridge.global.document,n)},on:function(t,e,n,r){e.addEventListener?e.addEventListener(t,(function(t){var e=n.apply(r||this,arguments);return!1===e&&(t.stopPropagation(),t.preventDefault()),e}),!1):e.attachEvent("on"+t,(function(){var t=n.call(r||e,Bridge.global.event);return!1===t&&(Bridge.global.event.returnValue=!1,Bridge.global.event.cancelBubble=!0),t}))},addHash:function(t,e,n){if(isNaN(e)&&(e=17),isNaN(n)&&(n=23),Bridge.isArray(t)){for(var r=0;r<t.length;r++)e=e+((e*n|0)+(null==t[r]?0:Bridge.getHashCode(t[r])))|0;return e}return e+((e*n|0)+(null==t?0:Bridge.getHashCode(t)))|0},getHashCode:function(t,e,n){var r,i,o,s,a;if(Bridge.isEmpty(t,!0)){if(e)return 0;throw new System.InvalidOperationException("HashCode cannot be calculated for empty value")}if(!1!==n&&t.hasOwnProperty("item1")&&Bridge.isPlainObject(t)&&(n=!0),t.getHashCode&&Bridge.isFunction(t.getHashCode)&&!t.__insideHashCode&&0===t.getHashCode.length)return t.__insideHashCode=!0,r=t.getHashCode(),delete t.__insideHashCode,r;if(Bridge.isBoolean(t))return t?1:0;if(Bridge.isDate(t))return 4294967295&t.valueOf();if(t===Number.POSITIVE_INFINITY)return 2146435072;if(t===Number.NEGATIVE_INFINITY)return 4293918720;if(Bridge.isNumber(t)){if(Math.floor(t)===t)return t;t=t.toExponential()}if(Bridge.isString(t)){for(i=0,o=0;o<t.length;o++)i=(i<<5)-i+t.charCodeAt(o)&4294967295;return i}if(t.$$hashCode)return t.$$hashCode;if(n&&"object"==typeof t){for(a in s=0,t)t.hasOwnProperty(a)&&(s=29*s+(Bridge.isEmpty(t[a],!0)?0:Bridge.getHashCode(t[a])));if(0!==s)return t.$$hashCode=s,s}return t.$$hashCode=4294967296*Math.random()|0,t.$$hashCode},getDefaultValue:function(t){return t.getDefaultValue&&0===t.getDefaultValue.length?t.getDefaultValue():t!==Boolean&&(t===Date?new Date(-864e13):t===Number?0:null)},getTypeAlias:function(t){return(t.$$name||Bridge.getTypeName(t)).replace(/[\.\(\)\,]/g,"$")},getTypeName:function(t){return Bridge.Reflection.getTypeFullName(t)},hasValue:function(t){return null!=t},hasValue$1:function(){if(0===arguments.length)return!1;for(var t=0;t<arguments.length;t++)if(null==arguments[t])return!1;return!0},is:function(t,e,n,r){var i,o,s,a;if(null==t)return!!r;if(i=t.constructor,e.constructor===Function&&t instanceof e||i===e)return!0;if(o=i.$kind||i.$$inherits,s=e.$kind,o||s){if(e.$isInterface){if(o)return i.$isArrayEnumerator?System.Array.is(t,e):e.isAssignableFrom?e.isAssignableFrom(i):Bridge.Reflection.getInterfaces(i).indexOf(e)>=0;if(Bridge.isArray(t,i))return System.Array.is(t,e);if(i===String)return System.String.is(t,e)}return!0!==n&&e.$is?e.$is(t):!(!e.$literal||!Bridge.isPlainObject(t))&&(!t.$getType||Bridge.Reflection.isAssignableFrom(e,t.$getType()))}if("boolean"==(a=typeof e))return e;if("string"===a&&(e=Bridge.unroll(e)),"function"===a&&Bridge.getType(t).prototype instanceof e)return!0;if(!0!==n){if("function"==typeof e.$is)return e.$is(t);if("function"==typeof e.isAssignableFrom)return e.isAssignableFrom(Bridge.getType(t))}return Bridge.isArray(t)?System.Array.is(t,e):"object"===a&&(i===e||t instanceof e)},as:function(t,e,n){return Bridge.is(t,e,!1,n)?t:null},cast:function(t,e,n){if(null==t)return t;var r=Bridge.is(t,e,!1,n)?t:null;if(null===r)throw new System.InvalidCastException("Unable to cast type "+(t?Bridge.getTypeName(t):"'null'")+" to type "+Bridge.getTypeName(e));return r},apply:function(t,e){for(var n,r=Bridge.getPropertyNames(e,!0),i=0;i<r.length;i++)"function"==typeof t[n=r[i]]&&"function"!=typeof e[n]?t[n](e[n]):t[n]=e[n];return t},merge:function(t,e,n,r){var i,o,s,a,u,l,c;if(t instanceof System.Decimal&&Bridge.isNumber(e))return new System.Decimal(e);if(t instanceof System.Int64&&Bridge.isNumber(e))return new System.Int64(e);if(t instanceof System.UInt64&&Bridge.isNumber(e))return new System.UInt64(e);if(t instanceof Boolean||Bridge.isBoolean(t)||t instanceof Number||Bridge.isNumber(t)||t instanceof String||Bridge.isString(t)||t instanceof Function||Bridge.isFunction(t)||t instanceof Date||Bridge.isDate(t)||Bridge.isNumber(t)||t instanceof System.Double||t instanceof System.Single||t instanceof System.Byte||t instanceof System.SByte||t instanceof System.Int16||t instanceof System.UInt16||t instanceof System.Int32||t instanceof System.UInt32||t instanceof Bridge.Int||t instanceof System.Decimal)return e;if(Bridge.isArray(e)&&Bridge.isFunction(t.add||t.push))for(u=Bridge.isArray(t)?t.push:t.add,o=0;o<e.length;o++)l=e[o],Bridge.isArray(l)||(l=[void 0===r?l:Bridge.merge(r(),l)]),u.apply(t,l);else for(i in e)s=e[i],"function"==typeof t[i]?i.match(/^\s*get[A-Z]/)?Bridge.merge(t[i](),s):t[i](s):"function"==typeof t[c="set"+i.charAt(0).toUpperCase()+i.slice(1)]&&"function"!=typeof s?t[c](s):s&&s.constructor===Object&&t[i]?(a=t[i],Bridge.merge(a,s)):t[i]=s;return n&&n.call(t,t),t},getEnumerator:function(t,e,n){if("string"==typeof t&&(t=System.String.toCharArray(t)),2===arguments.length&&Bridge.isFunction(e)&&(n=e,e=null),e&&t&&t[e])return t[e].call(t);if(!n&&t&&t.getEnumerator)return t.getEnumerator();var r;if(n&&Bridge.isFunction(t[r="System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(n)+"$getEnumerator"])||Bridge.isFunction(t[r="System$Collections$IEnumerable$getEnumerator"]))return t[r]();if(n&&t&&t.getEnumerator)return t.getEnumerator();if("[object Array]"===Object.prototype.toString.call(t)||t&&Bridge.isDefined(t.length))return new Bridge.ArrayEnumerator(t,n);throw new System.InvalidOperationException("Cannot create enumerator")},getPropertyNames:function(t,e){var n=[];for(var r in t)(e||"function"!=typeof t[r])&&n.push(r);return n},isDefined:function(t,e){return void 0!==t&&(!e||null!==t)},isEmpty:function(t,e){return null==t||!e&&""===t||!(e||!Bridge.isArray(t))&&0===t.length},toArray:function(t){var e,n,r,i=[];if(Bridge.isArray(t))for(e=0,r=t.length;e<r;++e)i.push(t[e]);else for(e=Bridge.getEnumerator(t);e.moveNext();)n=e.getCurrent(),i.push(n);return i},toList:function(t,e){return new(System.Collections.Generic.List$1(e||Object))(t)},arrayTypes:[t.Array,t.Uint8Array,t.Int8Array,t.Int16Array,t.Uint16Array,t.Int32Array,t.Uint32Array,t.Float32Array,t.Float64Array,t.Uint8ClampedArray],isArray:function(t,e){var n=e||(null!=t?t.constructor:null);return!!n&&Bridge.arrayTypes.indexOf(n)>=0},isFunction:function(t){return"function"==typeof t},isDate:function(t){return"[object Date]"===Object.prototype.toString.call(t)},isNull:function(t){return null==t},isBoolean:function(t){return"boolean"==typeof t},isNumber:function(t){return"number"==typeof t&&isFinite(t)},isString:function(t){return"string"==typeof t},unroll:function(t){for(var e=t.split("."),n=Bridge.global[e[0]],r=1;r<e.length;r++){if(!n)return null;n=n[e[r]]}return n},referenceEquals:function(t,e){return Bridge.hasValue(t)?t===e:!Bridge.hasValue(e)},staticEquals:function(t,e){return Bridge.hasValue(t)?!!Bridge.hasValue(e)&&Bridge.equals(t,e):!Bridge.hasValue(e)},equals:function(t,e){if(null==t&&null==e)return!0;if(t&&Bridge.isFunction(t.equals)&&1===t.equals.length)return t.equals(e);if(e&&Bridge.isFunction(e.equals)&&1===e.equals.length)return e.equals(t);if(Bridge.isDate(t)&&Bridge.isDate(e))return t.valueOf()===e.valueOf();if(Bridge.isNull(t)&&Bridge.isNull(e))return!0;if(Bridge.isNull(t)!==Bridge.isNull(e))return!1;var n=t===e;return n||"object"!=typeof t||"object"!=typeof e||null===t||null===e||"struct"!==t.$kind||"struct"!==e.$kind||t.$$name!==e.$$name?!n&&t&&e&&t.hasOwnProperty("item1")&&Bridge.isPlainObject(t)&&e.hasOwnProperty("item1")&&Bridge.isPlainObject(e)?Bridge.objectEquals(t,e):n:Bridge.getHashCode(t)===Bridge.getHashCode(e)&&Bridge.objectEquals(t,e)},objectEquals:function(t,e){Bridge.$$leftChain=[],Bridge.$$rightChain=[];var n=Bridge.deepEquals(t,e);return delete Bridge.$$leftChain,delete Bridge.$$rightChain,n},deepEquals:function(t,e){if("object"==typeof t&&"object"==typeof e){if(t===e)return!0;if(Bridge.$$leftChain.indexOf(t)>-1||Bridge.$$rightChain.indexOf(e)>-1)return!1;for(var n in e)if(e.hasOwnProperty(n)!==t.hasOwnProperty(n)||typeof e[n]!=typeof t[n])return!1;for(n in t){if(e.hasOwnProperty(n)!==t.hasOwnProperty(n)||typeof t[n]!=typeof e[n])return!1;if(t[n]!==e[n])if("object"==typeof t[n]){if(Bridge.$$leftChain.push(t),Bridge.$$rightChain.push(e),!Bridge.deepEquals(t[n],e[n]))return!1;Bridge.$$leftChain.pop(),Bridge.$$rightChain.pop()}else if(!Bridge.equals(t[n],e[n]))return!1}return!0}return Bridge.equals(t,e)},compare:function(t,e,n,r){if(!Bridge.isDefined(t,!0)){if(n)return 0;throw new System.NullReferenceException}if(Bridge.isNumber(t)||Bridge.isString(t)||Bridge.isBoolean(t))return Bridge.isString(t)&&!Bridge.hasValue(e)?1:t<e?-1:t>e?1:0;if(Bridge.isDate(t))return Bridge.compare(t.valueOf(),e.valueOf());var i;if(r&&Bridge.isFunction(t[i="System$IComparable$1$"+Bridge.getTypeAlias(r)+"$compareTo"])||Bridge.isFunction(t[i="System$IComparable$compareTo"]))return t[i](e);if(Bridge.isFunction(t.compareTo))return t.compareTo(e);if(r&&Bridge.isFunction(e[i="System$IComparable$1$"+Bridge.getTypeAlias(r)+"$compareTo"])||Bridge.isFunction(e[i="System$IComparable$compareTo"]))return-e[i](t);if(Bridge.isFunction(e.compareTo))return-e.compareTo(t);if(n)return 0;throw new System.Exception("Cannot compare items")},equalsT:function(t,e,n){if(!Bridge.isDefined(t,!0))throw new System.NullReferenceException;return Bridge.isNumber(t)||Bridge.isString(t)||Bridge.isBoolean(t)?t===e:Bridge.isDate(t)?t.valueOf()===e.valueOf():n&&null!=t&&Bridge.isFunction(t[r="System$IEquatable$1$"+Bridge.getTypeAlias(n)+"$equalsT"])?t[r](e):n&&null!=e&&Bridge.isFunction(e[r="System$IEquatable$1$"+Bridge.getTypeAlias(n)+"$equalsT"])?e[r](t):t.equalsT?t.equalsT(e):e.equalsT(t);var r},format:function(t,e,n){return Bridge.isNumber(t)?Bridge.Int.format(t,e,n):Bridge.isDate(t)?Bridge.Date.format(t,e,n):Bridge.isFunction(t.System$IFormattable$format)?t.System$IFormattable$format(e,n):t.format(e,n)},getType:function(t){if(null==t)throw new System.NullReferenceException("instance is null");if("number"==typeof t)return!isNaN(t)&&isFinite(t)&&Math.floor(t,0)===t?System.Int32:System.Double;if(t.$getType)return t.$getType();try{return t.constructor}catch(t){return Object}},isLower:function(t){var e=String.fromCharCode(t);return e===e.toLowerCase()&&e!==e.toUpperCase()},isUpper:function(t){var e=String.fromCharCode(t);return e!==e.toLowerCase()&&e===e.toUpperCase()},coalesce:function(t,e){return Bridge.hasValue(t)?t:e},fn:{equals:function(t){return this===t||null!=t&&this.constructor===t.constructor&&this.equals===t.equals&&this.$method===t.$method&&this.$scope===t.$scope},call:function(t,e){var n=Array.prototype.slice.call(arguments,2);return(t=t||Bridge.global)[e].apply(t,n)},makeFn:function(t,e){return function(){return t.apply(this,arguments)}},bind:function(t,e,n,r){var i,o;if(e&&e.$method===e&&e.$scope===t)return e;if(t&&t.$$bind)for(i=0;i<t.$$bind.length;i++)if(t.$$bind[i].$method===e)return t.$$bind[i];return o=2===arguments.length?Bridge.fn.makeFn((function(){Bridge.caller.unshift(this);var n=e.apply(t,arguments);return Bridge.caller.shift(this),n}),e.length):Bridge.fn.makeFn((function(){var i,o=n||arguments;return!0===r?o=(o=Array.prototype.slice.call(arguments,0)).concat(n):"number"==typeof r&&(o=Array.prototype.slice.call(arguments,0),0===r?o.unshift.apply(o,n):r<o.length?o.splice.apply(o,[r,0].concat(n)):o.push.apply(o,n)),Bridge.caller.unshift(this),i=e.apply(t,o),Bridge.caller.shift(this),i}),e.length),t&&(t.$$bind=t.$$bind||[],t.$$bind.push(o)),o.$method=e,o.$scope=t,o.equals=Bridge.fn.equals,o},bindScope:function(t,e){var n=Bridge.fn.makeFn((function(){var n,r=Array.prototype.slice.call(arguments,0);return r.unshift.apply(r,[t]),Bridge.caller.unshift(this),n=e.apply(t,r),Bridge.caller.shift(this),n}),e.length);return n.$method=e,n.$scope=t,n.equals=Bridge.fn.equals,n},$build:function(t){var e=function(){for(var t=e.$invocationList,n=null,r=0;r<t.length;r++)n=t[r].apply(null,arguments);return n};return e.$invocationList=t?Array.prototype.slice.call(t,0):[],0===e.$invocationList.length?null:e},combine:function(t,e){if(!t||!e)return t||e;var n=t.$invocationList?t.$invocationList:[t],r=e.$invocationList?e.$invocationList:[e];return Bridge.fn.$build(n.concat(r))},getInvocationList:function(){},remove:function(t,e){if(!t||!e)return t||null;for(var n,r,i=t.$invocationList?t.$invocationList:[t],o=e.$invocationList?e.$invocationList:[e],s=[],a=i.length-1;a>=0;a--){for(n=!1,r=0;r<o.length;r++)if(i[a]===o[r]||i[a].$method&&i[a].$method===o[r].$method&&i[a].$scope&&i[a].$scope===o[r].$scope){n=!0;break}n||s.push(i[a])}return s.reverse(),Bridge.fn.$build(s)}},sleep:function(t,e){if(Bridge.hasValue(e)&&(t=e.getTotalMilliseconds()),isNaN(t)||t<-1||t>2147483647)throw new System.ArgumentOutOfRangeException("timeout","Number must be either non-negative and less than or equal to Int32.MaxValue or -1");-1==t&&(t=2147483647);for(var n=(new Date).getTime();(new Date).getTime()-n<t&&!((new Date).getTime()-n>2147483647););},getMetadata:function(t){return t.$getMetadata?t.$getMetadata():t.$metadata}};t.Bridge=g,t.Bridge.caller=[],t.System={},t.System.Diagnostics={},t.System.Diagnostics.Contracts={},t.System.Threading={},e={is:function(t,e){return!!Bridge.isString(t)&&(t.constructor===e||t instanceof e||e===System.ICloneable||e===System.Collections.IEnumerable||e===System.Collections.Generic.IEnumerable$1(System.Char)||e===System.IComparable$1(String)||e===System.IEquatable$1(String))},lastIndexOf:function(t,e,n,r){var i=t.lastIndexOf(e,n);return i<n-r+1?-1:i},lastIndexOfAny:function(t,e,n,r){var i,o,s=t.length;if(!s)return-1;for(e=String.fromCharCode.apply(null,e),(i=(n=n||s-1)-(r=r||s)+1)<0&&(i=0),o=n;o>=i;o--)if(e.indexOf(t.charAt(o))>=0)return o;return-1},isNullOrWhiteSpace:function(t){return!t||System.Char.isWhiteSpace(t)},isNullOrEmpty:function(t){return!t},fromCharCount:function(t,e){if(e>=0)return String(Array(e+1).join(String.fromCharCode(t)));throw new System.ArgumentOutOfRangeException("count","cannot be less than zero")},format:function(t){return System.String._format(System.Globalization.CultureInfo.getCurrentCulture(),t,Array.prototype.slice.call(arguments,1))},formatProvider:function(t,e){return System.String._format(t,e,Array.prototype.slice.call(arguments,2))},_format:function(t,e,n){var r=this,i=n,o=this.decodeBraceSequence;return e.replace(/(\{+)((\d+|[a-zA-Z_$]\w+(?:\.[a-zA-Z_$]\w+|\[\d+\])*)(?:\,(-?\d*))?(?:\:([^\}]*))?)(\}+)|(\{+)|(\}+)/g,(function(e,n,s,a,u,l,c,g,h){return g?o(g):h?o(h):n.length%2==0||c.length%2==0?o(n)+s+o(c):o(n,!0)+r.handleElement(t,a,u,l,i)+o(c,!0)}))},handleElement:function(t,e,n,r,i){var o;if((e=parseInt(e,10))>i.length-1)throw new System.FormatException("Input string was not in a correct format.");return null==(o=i[e])&&(o=""),o=r&&Bridge.is(o,System.IFormattable)?Bridge.format(o,r,t):""+o,n&&(n=parseInt(n,10),Bridge.isNumber(n)||(n=null)),System.String.alignString(o.toString(),n)},decodeBraceSequence:function(t,e){return t.substr(0,(t.length+(e?0:1))/2)},alignString:function(t,e,n,r,i){if(!t||!e)return t;if(n||(n=" "),Bridge.isNumber(n)&&(n=String.fromCharCode(n)),r||(r=e<0?1:2),e=Math.abs(e),i&&t.length>e&&(t=t.substring(0,e)),e+1>=t.length)switch(r){case 2:t=Array(e+1-t.length).join(n)+t;break;case 3:var o=e-t.length,s=Math.ceil(o/2);t=Array(o-s+1).join(n)+t+Array(s+1).join(n);break;default:t+=Array(e+1-t.length).join(n)}return t},startsWith:function(t,e){return!e.length||!(e.length>t.length)&&(e=System.String.escape(e),null!==t.match("^"+e))},endsWith:function(t,e){return!e.length||!(e.length>t.length)&&(e=System.String.escape(e),null!==t.match(e+"$"))},contains:function(t,e){if(null==e)throw new System.ArgumentNullException;return null!=t&&t.indexOf(e)>-1},indexOfAny:function(t,e){var n,r,i,o,s,a;if(null==e)throw new System.ArgumentNullException;if(null==t||""===t)return-1;if((n=arguments.length>2?arguments[2]:0)<0)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero");if((r=arguments.length>3?arguments[3]:t.length-n)<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(r>t.length-n)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string");for(i=t.substr(n,r),o=0;o<e.length;o++)if(s=String.fromCharCode(e[o]),(a=i.indexOf(s))>-1)return a+n;return-1},indexOf:function(t,e){var n,r,i,o;if(null==e)throw new System.ArgumentNullException;if(null==t||""===t)return-1;if((n=arguments.length>2?arguments[2]:0)<0||n>t.length)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(""===e)return arguments.length>2?n:0;if((r=arguments.length>3?arguments[3]:t.length-n)<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(r>t.length-n)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string");return i=t.substr(n,r),(o=5===arguments.length&&arguments[4]%2!=0?i.toLocaleUpperCase().indexOf(e.toLocaleUpperCase()):i.indexOf(e))>-1?5===arguments.length?0===System.String.compare(e,i.substr(o,e.length),arguments[4])?o+n:-1:o+n:-1},equals:function(){return 0===System.String.compare.apply(this,arguments)},compare:function(t,e){if(null==t)return null==e?0:-1;if(null==e)return 1;if(arguments.length>=3)if(Bridge.isBoolean(arguments[2])){if(arguments[2]&&(t=t.toLocaleUpperCase(),e=e.toLocaleUpperCase()),4===arguments.length)return t.localeCompare(e,arguments[3].name)}else switch(arguments[2]){case 1:return t.localeCompare(e,System.Globalization.CultureInfo.getCurrentCulture().name,{sensitivity:"accent"});case 2:return t.localeCompare(e,System.Globalization.CultureInfo.invariantCulture.name);case 3:return t.localeCompare(e,System.Globalization.CultureInfo.invariantCulture.name,{sensitivity:"accent"});case 4:return t===e?0:t>e?1:-1;case 5:return t.toUpperCase()===e.toUpperCase()?0:t.toUpperCase()>e.toUpperCase()?1:-1}return t.localeCompare(e)},toCharArray:function(t,e,n){var r,i;if(e<0||e>t.length||e>t.length-n)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(n<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");for(Bridge.hasValue(e)||(e=0),Bridge.hasValue(n)||(n=t.length),r=[],i=e;i<e+n;i++)r.push(t.charCodeAt(i));return r},escape:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},replaceAll:function(t,e,n){var r=new RegExp(System.String.escape(e),"g");return t.replace(r,n)},insert:function(t,e,n){return t>0?e.substring(0,t)+n+e.substring(t,e.length):n+e},remove:function(t,e,n){if(null==t)throw new System.NullReferenceException;if(e<0)throw new System.ArgumentOutOfRangeException("startIndex","StartIndex cannot be less than zero");if(null!=n){if(n<0)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than zero");if(n>t.length-e)throw new System.ArgumentOutOfRangeException("count","Index and count must refer to a location within the string")}else if(e>=t.length)throw new System.ArgumentOutOfRangeException("startIndex","startIndex must be less than length of string");return null==n||e+n>t.length?t.substr(0,e):t.substr(0,e)+t.substr(e+n)},split:function(t,e,n,r){for(var i,o=Bridge.hasValue(e)&&0!==e.length?new RegExp(e.map(System.String.escape).join("|"),"g"):new RegExp("\\s","g"),s=[],a=0;;a=o.lastIndex){if(!(i=o.exec(t)))return(1!==r||a!==t.length)&&s.push(t.substr(a)),s;if(1!==r||i.index>a){if(s.length===n-1)return s.push(t.substr(a)),s;s.push(t.substring(a,i.index))}}},trimEnd:function(t,e){return t.replace(e?new RegExp("["+System.String.escape(String.fromCharCode.apply(null,e))+"]+$"):/\s*$/,"")},trimStart:function(t,e){return t.replace(e?new RegExp("^["+System.String.escape(String.fromCharCode.apply(null,e))+"]+"):/^\s*/,"")},trim:function(t,e){return System.String.trimStart(System.String.trimEnd(t,e),e)},concat:function(){for(var t,e="",n=0;n<arguments.length;n++)e+=null==(t=arguments[n])?"":t;return e}},System.String=e,n={nameEquals:function(t,e,n){return n?t.toLowerCase()===e.toLowerCase():t.charAt(0).toLowerCase()+t.slice(1)===e.charAt(0).toLowerCase()+e.slice(1)},checkEnumType:function(t){if(!t)throw new System.ArgumentNullException("enumType");if(t.prototype&&"enum"!==t.$kind)throw new System.ArgumentException("","enumType")},toName:function(t){return t},parse:function(t,e,r,i){var o,s,a,u,l,c;if(System.Enum.checkEnumType(t),o={},System.Int32.tryParse(e,o))return o.v;if(s=t,t.prototype&&t.prototype.$flags){var g=e.split(","),h=0,m=!0;for(a=g.length-1;a>=0;a--){for(c in u=g[a].trim(),l=!1,s)if(n.nameEquals(c,u,r)){h|=s[c],l=!0;break}if(!l){m=!1;break}}if(m)return h}else for(c in s)if(n.nameEquals(c,e,r))return s[c];if(!0!==i)throw new System.ArgumentException("Invalid Enumeration Value");return null},toString:function(t,e,r){var i,o,s,a;if(t===Number)return e.toString();if(System.Enum.checkEnumType(t),i=t,o=System.Int64.is64Bit(e),(t.prototype&&t.prototype.$flags||!0===r)&&0!==e){for(a in s=[],i)(o&&System.Int64.is64Bit(i[a])?!i[a].and(e).isZero():i[a]&e)&&s.push(n.toName(a));return s.length?s.join(", "):e.toString()}for(a in i)if(o&&System.Int64.is64Bit(i[a])?i[a].eq(e):i[a]===e)return n.toName(a);return e.toString()},getValues:function(t){var e,n,r;for(r in System.Enum.checkEnumType(t),e=[],n=t)n.hasOwnProperty(r)&&r.indexOf("$")<0&&"function"!=typeof n[r]&&e.push(n[r]);return e},format:function(t,e,n){var r;if(System.Enum.checkEnumType(t),!Bridge.hasValue(e)&&(r="value")||!Bridge.hasValue(n)&&(r="format"))throw new System.ArgumentNullException(r);switch(n){case"G":case"g":return System.Enum.toString(t,e);case"x":case"X":return e.toString(16);case"d":case"D":return e.toString();case"f":case"F":return System.Enum.toString(t,e,!0);default:throw new System.FormatException}},getNames:function(t){var e,r,i;for(i in System.Enum.checkEnumType(t),e=[],r=t)r.hasOwnProperty(i)&&i.indexOf("$")<0&&"function"!=typeof r[i]&&e.push(n.toName(i));return e},getName:function(t,e){var n,r;for(r in System.Enum.checkEnumType(t),n=t)if(n[r]===e)return r.charAt(0).toUpperCase()+r.slice(1);return null},hasFlag:function(t,e){return!!(t&e)},isDefined:function(t,e){var r,i,o;for(o in System.Enum.checkEnumType(t),r=t,i=Bridge.isString(e),r)if(i?n.nameEquals(o,e,!1):r[o]===e)return!0;return!1},tryParse:function(t,e,r,i){return r.v=0,r.v=n.parse(t,e,i,!0),null!=r.v}},System.Enum=n;var h=function(t){return t.test(navigator.userAgent.toLowerCase())},m=Bridge.global.document&&"CSS1Compat"===Bridge.global.document.compatMode,f=function(t,e){var n;return t&&(n=e.exec(navigator.userAgent.toLowerCase()))?parseFloat(n[1]):0},d=Bridge.global.document?Bridge.global.document.documentMode:null,y=h(/opera/),p=y&&h(/version\/10\.5/),S=h(/\bchrome\b/),C=h(/webkit/),x=!S&&h(/safari/),v=x&&h(/applewebkit\/4/),w=x&&h(/version\/3/),b=x&&h(/version\/4/),B=x&&h(/version\/5\.0/),I=x&&h(/version\/5/),$=!y&&(h(/msie/)||h(/trident/)),_=$&&(h(/msie 7/)&&8!==d&&9!==d&&10!==d||7===d),E=$&&(h(/msie 8/)&&7!==d&&9!==d&&10!==d||8===d),O=$&&(h(/msie 9/)&&7!==d&&8!==d&&10!==d||9===d),A=$&&(h(/msie 10/)&&7!==d&&8!==d&&9!==d||10===d),T=$&&(h(/trident\/7\.0/)&&7!==d&&8!==d&&9!==d&&10!==d||11===d),L=$&&h(/msie 6/),R=!C&&!$&&h(/gecko/),N=R&&h(/rv:1\.9/),k=R&&h(/rv:2\.0/),D=R&&h(/rv:5\./),P=R&&h(/rv:10\./),M=N&&h(/rv:1\.9\.0/),G=N&&h(/rv:1\.9\.1/),V=N&&h(/rv:1\.9\.2/),F=h(/windows|win32/),z=h(/macintosh|mac os x/),q=h(/linux/),H=f(!0,/\bchrome\/(\d+\.\d+)/),U=f(!0,/\bfirefox\/(\d+\.\d+)/),j=f($,/msie (\d+\.\d+)/),W=f(y,/version\/(\d+\.\d+)/),Z=f(x,/version\/(\d+\.\d+)/),X=f(C,/webkit\/(\d+\.\d+)/),K=!!Bridge.global.location&&/^https/i.test(Bridge.global.location.protocol),Y=/iPhone/i.test(navigator.platform),J=/iPod/i.test(navigator.platform),Q=/iPad/i.test(navigator.userAgent),tt=/Blackberry/i.test(navigator.userAgent),et=/Android/i.test(navigator.userAgent),nt=z||F||q&&!et,rt={isStrict:m,isIEQuirks:$&&!m&&(L||_||E||O),isOpera:y,isOpera10_5:p,isWebKit:C,isChrome:S,isSafari:x,isSafari3:w,isSafari4:b,isSafari5:I,isSafari5_0:B,isSafari2:v,isIE:$,isIE6:L,isIE7:_,isIE7m:L||_,isIE7p:$&&!L,isIE8:E,isIE8m:L||_||E,isIE8p:$&&!(L||_),isIE9:O,isIE9m:L||_||E||O,isIE9p:$&&!(L||_||E),isIE10:A,isIE10m:L||_||E||O||A,isIE10p:$&&!(L||_||E||O),isIE11:T,isIE11m:L||_||E||O||A||T,isIE11p:$&&!(L||_||E||O||A),isGecko:R,isGecko3:N,isGecko4:k,isGecko5:D,isGecko10:P,isFF3_0:M,isFF3_5:G,isFF3_6:V,isFF4:4<=U&&U<5,isFF5:5<=U&&U<6,isFF10:10<=U&&U<11,isLinux:q,isWindows:F,isMac:z,chromeVersion:H,firefoxVersion:U,ieVersion:j,operaVersion:W,safariVersion:Z,webKitVersion:X,isSecure:K,isiPhone:Y,isiPod:J,isiPad:Q,isBlackberry:tt,isAndroid:et,isDesktop:nt,isTablet:Q,isPhone:!nt&&!Q,iOS:Y||Q||J,standalone:!!Bridge.global.navigator&&!!Bridge.global.navigator.standalone};Bridge.Browser=rt,r={_initialize:function(){this.$initialized||(this.$initialized=Bridge.emptyFn,this.$staticInit&&this.$staticInit(),this.$initMembers&&this.$initMembers())},initConfig:function(t,e,n,r,i,o){var s,a,u,l;if(n.fields)for(a in n.fields)i[a]=n.fields[a];if(n.properties)for(a in n.properties)Bridge.property(i,a,n.properties[a],r);if(n.events)for(a in n.events)Bridge.event(i,a,n.events[a],r);if(n.alias)for(u=0;u<n.alias.length;u++)void 0===(l=i[n.alias[u]])&&o&&(l=o[n.alias[u]]),i[n.alias[u+1]]=l,u++;n.init&&(s=n.init),(s||t&&!r&&e.$initMembers)&&(i.$initMembers=function(){t&&!r&&e.$initMembers&&e.$initMembers.call(this),s&&s.call(this)})},definei:function(t,e,n){!0!==n&&n||!e?n?n.$kind="interface":e={$kind:"interface"}:e.$kind="interface";var r=Bridge.define(t,e,n);return r.$kind="interface",r.$isInterface=!0,r},define:function(t,e,n,r){var i,o,s,a,u,l,c,g,h,m,f,d,y,p=!1;if(!0===n?(p=!0,n=e,e=Bridge.global):n||(n=e,e=Bridge.global),Bridge.isFunction(n))return i=function(){var e,r,o,s;return(r=Bridge.Class.getCachedType(i,arguments))?r.type:(e=Array.prototype.slice.call(arguments),o=n.apply(null,e),s=Bridge.define(Bridge.Class.genericName(t,e),o,!0,{fn:i,args:e}),Bridge.Class.staticInitAllow||Bridge.Class.$queue.push(s),Bridge.get(s))},i.$cache=[],Bridge.Class.generic(t,e,i,n.length);p||(Bridge.Class.staticInitAllow=!1);var S,C,x,v,w,b,B,I=(n=n||{}).$inherits||n.inherits,$=n.$statics||n.statics,_=n.$entryPoint,E=n.$scope||e||Bridge.global;if(n.$kind=n.$kind||"class",n.$inherits?delete n.$inherits:delete n.inherits,_&&delete n.$entryPoint,Bridge.isFunction($)?$=null:n.$statics?delete n.$statics:delete n.statics,(s=n.hasOwnProperty("ctor")&&n.ctor)?o=s:(o=n.$literal?function(t){return(t=t||{}).$getType=function(){return o},t}:function(){this.$initialize(),o.$base&&(o.$$inherits&&o.$$inherits.length>0&&o.$$inherits[0].$staticInit&&o.$$inherits[0].$staticInit(),o.$base.ctor.call(this))},n.ctor=o),n.$literal&&($&&$.getDefaultValue||(o.getDefaultValue=function(){return{$getType:function(){return o}}}),o.$literal=!0,delete n.$literal),p||(E=Bridge.Class.set(E,t,o)),r&&r.fn.$cache.push({type:o,args:r.args}),o.$$name=t,o.$kind=n.$kind,r&&p){for(o.$genericTypeDefinition=r.fn,o.$typeArguments=r.args,o.$assembly=r.fn.$assembly||Bridge.$currentAssembly,a=Bridge.Reflection.getTypeFullName(r.fn),x=0;x<r.args.length;x++)a+=(0===x?"[":",")+"["+Bridge.Reflection.getTypeQName(r.args[x])+"]";a+="]",o.$$fullname=a}else o.$$fullname=o.$$name;if(I&&Bridge.isFunction(I)&&(I=I()),u=[],l=[],I)for(c=0;c<I.length;c++){if((h=((g=I[c]).$interfaces||[]).concat(g.$baseInterfaces||[])).length>0)for(m=0;m<h.length;m++)l.indexOf(h[m])<0&&l.push(h[m]);"interface"===g.$kind&&u.push(g)}for(B in o.$baseInterfaces=l,o.$interfaces=u,o.$allInterfaces=u.concat(l),(!I||"interface"===I[0].$kind)&&(I=null),S=I?I[0].prototype:this.prototype,o.$base=S,C=I?I[0].$$initCtor?new I[0].$$initCtor:new I[0]:{},o.$$initCtor=function(){},o.$$initCtor.prototype=C,o.$$initCtor.prototype.constructor=o,o.$$initCtor.prototype.$$fullname=r&&p?o.$$fullname:o.$$name,$&&(f=$.$config||$.config)&&!Bridge.isFunction(f)&&(Bridge.Class.initConfig(I,S,f,!0,o),$.$config?delete $.$config:delete $.config),(d=n.$config||n.config)&&!Bridge.isFunction(d)?(Bridge.Class.initConfig(I,S,d,!1,n,C),n.$config?delete n.$config:delete n.config):I&&S.$initMembers&&(n.$initMembers=function(){S.$initMembers.call(this)}),n.$initialize=Bridge.Class._initialize,y=[],n)y.push(B);for(x=0;x<y.length;x++)B=y[x],v=n[B],w="ctor"===B,b=B,Bridge.isFunction(v)&&(w||null!==B.match("^\\$ctor"))&&(w=!0),w?(o[b]=n[B],o[b].prototype=C,o[b].prototype.constructor=o,C[b]=n[B]):C[b]=n[B];if(C.$$name=t,$)for(B in $)"ctor"===B?o.$ctor=$[B]:o[B]=$[B];for(I||(I=[Object].concat(u)),o.$$inherits=I,x=0;x<I.length;x++)(E=I[x]).$$inheritors||(E.$$inheritors=[]),E.$$inheritors.push(o);return i=function(){Bridge.Class.staticInitAllow&&(o.$staticInit=null,o.$initMembers&&o.$initMembers(),o.$ctor&&o.$ctor())},(_||Bridge.isFunction(C.$main))&&Bridge.Class.$queueEntry.push(o),o.$staticInit=i,p||Bridge.Class.registerType(t,o),Bridge.Reflection&&(o.$getMetadata=Bridge.Reflection.getMetadata),"enum"===o.$kind&&(o.$is=function(t){var e=o.prototype.$utype;return e===System.String?"string"==typeof t:e&&e.$is?e.$is(t):"number"==typeof t},o.getDefaultValue=function(){return o.prototype.$utype===System.String?null:0}),"interface"===o.$kind&&(o.prototype.$variance&&(o.isAssignableFrom=Bridge.Class.varianceAssignable),o.$isInterface=!0),o},varianceAssignable:function(t){var e,n,r=function(t,e){var n;if(e.$genericTypeDefinition===t.$genericTypeDefinition&&e.$typeArguments.length===t.$typeArguments.length){for(n=0;n<t.$typeArguments.length;n++){var r=t.prototype.$variance[n],i=t.$typeArguments[n],o=e.$typeArguments[n];switch(r){case 1:if(!Bridge.Reflection.isAssignableFrom(i,o))return!1;break;case 2:if(!Bridge.Reflection.isAssignableFrom(o,i))return!1;break;default:if(o!==i)return!1}}return!0}return!1};if("interface"===t.$kind&&r(this,t))return!0;for(e=Bridge.Reflection.getInterfaces(t),n=0;n<e.length;n++)if(e[n]===this||r(this,e[n]))return!0;return!1},registerType:function(t,e){Bridge.$currentAssembly&&(Bridge.$currentAssembly.$types[t]=e,e.$assembly=Bridge.$currentAssembly)},addExtend:function(t,e){var n,r,i,o;for(Array.prototype.push.apply(t.$$inherits,e),t.$interfaces=t.$interfaces||[],t.$baseInterfaces=t.$baseInterfaces||[],n=0;n<e.length;n++){if((r=e[n]).$$inheritors||(r.$$inheritors=[]),r.$$inheritors.push(t),(i=(r.$interfaces||[]).concat(r.$baseInterfaces||[])).length>0)for(o=0;o<i.length;o++)t.$baseInterfaces.indexOf(i[o])<0&&t.$baseInterfaces.push(i[o]);"interface"===r.$kind&&t.$interfaces.push(r)}t.$allInterfaces=t.$interfaces.concat(t.$baseInterfaces)},set:function(t,e,n,r){for(var i,o,s,a,u=e.split("."),l=0;l<u.length-1;l++)void 0===t[u[l]]&&(t[u[l]]={}),t=t[u[l]];if(s=t[i=u[u.length-1]]){if(s.$$name===e)throw"Class '"+e+"' is already defined";for(o in s)"function"==typeof(a=s[o])&&a.$$name&&function(t,e,n){Object.defineProperty(t,e,{get:function(){return Bridge.Class.staticInitAllow&&(n.$staticInit&&n.$staticInit(),Bridge.Class.defineProperty(t,e,n)),n},set:function(t){n=t},enumerable:!0,configurable:!0})}(n,o,a)}return!0!==r?function(t,e,n){Object.defineProperty(t,e,{get:function(){return Bridge.Class.staticInitAllow&&(n.$staticInit&&n.$staticInit(),Bridge.Class.defineProperty(t,e,n)),n},set:function(t){n=t},enumerable:!0,configurable:!0})}(t,i,n):t[i]=n,t},defineProperty:function(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0})},genericName:function(t,e){for(var n,r=t,i=0;i<e.length;i++)r+="$"+((n=e[i]).$$name||Bridge.getTypeName(n));return r},getCachedType:function(t,e){for(var n,r,i,o=t.$cache,s=o.length,a=0;a<s;a++)if((n=o[a]).args.length===e.length){for(r=!0,i=0;i<n.args.length;i++)if(n.args[i]!==e[i]){r=!1;break}if(r)return n}return null},generic:function(t,e,n,r){return n.$$name=t,n.$kind="class",Bridge.Class.set(e,t,n,!0),Bridge.Class.registerType(t,n),n.$typeArgumentCount=r,n.$isGenericTypeDefinition=!0,n.$getMetadata=Bridge.Reflection.getMetadata,n},init:function(t){var e,n,r;for(Bridge.Class.staticInitAllow=!0,e=Bridge.Class.$queue.concat(Bridge.Class.$queueEntry),n=0;n<e.length;n++)(r=e[n]).$staticInit&&r.$staticInit(),r.prototype.$main&&Bridge.ready(r.prototype.$main);Bridge.Class.$queue.length=0,Bridge.Class.$queueEntry.length=0,t&&t()}},Bridge.Class=r,Bridge.Class.$queue=[],Bridge.Class.$queueEntry=[],Bridge.define=Bridge.Class.define,Bridge.definei=Bridge.Class.definei,Bridge.init=Bridge.Class.init,Bridge.assembly=function(t,e,n){n||(n=e,e={}),t=t||"Bridge.$Unknown";var r=System.Reflection.Assembly.assemblies[t];r?Bridge.apply(r.res,e||{}):r=new System.Reflection.Assembly(t,e),Bridge.$currentAssembly=r,n&&n.call(Bridge.global,r,Bridge.global),Bridge.init()},Bridge.define("System.Reflection.Assembly",{statics:{assemblies:{}},ctor:function(t,e){this.$initialize(),this.name=t,this.res=e||{},this.$types={},this.$={},System.Reflection.Assembly.assemblies[t]=this},toString:function(){return this.name},getManifestResourceNames:function(){return Object.keys(this.res)},getManifestResourceDataAsBase64:function(t,e){return 1===arguments.length&&(e=t,t=null),t&&(e=Bridge.Reflection.getTypeNamespace(t)+"."+e),this.res[e]||null},getManifestResourceData:function(t,e){1===arguments.length&&(e=t,t=null),t&&(e=Bridge.Reflection.getTypeNamespace(t)+"."+e);var n=this.res[e];return n?System.Convert.fromBase64String(n):null},getCustomAttributes:function(t){return t&&!Bridge.isBoolean(t)?this.attr.filter((function(e){return Bridge.is(e,t)})):this.attr}}),Bridge.$currentAssembly=new System.Reflection.Assembly("mscorlib"),Bridge.SystemAssembly=Bridge.$currentAssembly,Bridge.SystemAssembly.$types["System.Reflection.Assembly"]=System.Reflection.Assembly,System.Reflection.Assembly.$assembly=Bridge.SystemAssembly,i=Bridge.$currentAssembly,Bridge.SystemAssembly.version="15.6.0",Bridge.SystemAssembly.compiler="15.6.0",Bridge.define("Bridge.Utils.SystemAssemblyVersion"),Bridge.Reflection={setMetadata:function(t,e){t.$getMetadata=Bridge.Reflection.getMetadata,t.$metadata=e},initMetaData:function(t,e){var n,r;if(e.m)for(n=0;n<e.m.length;n++)(r=e.m[n]).td=t,r.ad&&(r.ad.td=t),r.r&&(r.r.td=t),r.g&&(r.g.td=t),r.s&&(r.s.td=t);t.$metadata=e,t.$initMetaData=!0},getMetadata:function(){var t,e,n,r;if(!this.$metadata&&this.$genericTypeDefinition&&(this.$metadata=this.$genericTypeDefinition.$factoryMetadata||this.$genericTypeDefinition.$metadata),"function"==typeof(t=this.$metadata))if(this.$isGenericTypeDefinition){for(n=this.$typeArgumentCount,r=new Array(n),e=0;e<n;e++)r[e]=Object;this.$factoryMetadata=this.$metadata,t=this.$metadata.apply(null,r)}else t=this.$typeArguments?this.$metadata.apply(null,this.$typeArguments):this.$metadata();return!this.$initMetaData&&t&&Bridge.Reflection.initMetaData(this,t),t},load:function(t){return System.Reflection.Assembly.assemblies[t]||require(t)},getGenericTypeDefinition:function(t){if(t.$isGenericTypeDefinition)return t;if(!t.$genericTypeDefinition)throw new System.InvalidOperationException("This operation is only valid on generic types.");return t.$genericTypeDefinition},getGenericParameterCount:function(t){return t.$typeArgumentCount||0},getGenericArguments:function(t){return t.$typeArguments||null},isGenericTypeDefinition:function(t){return t.$isGenericTypeDefinition||!1},getBaseType:function(t){var e,n;if(t===Object||"interface"===t.$kind||null==t.prototype)return null;if(Object.getPrototypeOf)return Object.getPrototypeOf(t.prototype).constructor;if(e=t.prototype,Object.prototype.hasOwnProperty.call(e,"constructor"))try{return n=e.constructor,delete e.constructor,e.constructor}finally{e.constructor=n}return e.constructor},getTypeFullName:function(t){var e,n;return t.$$fullname?t.$$fullname:t.$$name?t.$$name:(e=t.constructor===Function?t.toString():t.constructor.toString(),(n=/function (.{1,})\(/.exec(e))&&n.length>1?n[1]:"Object")},_makeQName:function(t,e){return t+(e?", "+e.name:"")},getTypeQName:function(t){return Bridge.Reflection._makeQName(Bridge.Reflection.getTypeFullName(t),t.$assembly)},getTypeName:function(t){var e=Bridge.Reflection.getTypeFullName(t),n=e.indexOf("["),r=e.lastIndexOf(".",n>=0?n:e.length);return r>0?e.substr(r+1):e},getTypeNamespace:function(t){var e,n=Bridge.Reflection.getTypeFullName(t),r=n.indexOf("["),i=n.lastIndexOf(".",r>=0?r:n.length),o=i>0?n.substr(0,i):"";return t.$assembly&&(e=Bridge.Reflection._getAssemblyType(t.$assembly,o))&&(o=Bridge.Reflection.getTypeNamespace(e)),o},getTypeAssembly:function(t){return System.Array.contains([Date,Number,Boolean,String,Function,Array],t)?Bridge.SystemAssembly:t.$assembly||Bridge.SystemAssembly},_getAssemblyType:function(t,e){var n,r,i,o,s=!1;if(t||(t=Bridge.SystemAssembly,s=!0),t.$types){if(n=t.$types[e]||null)return n;if("mscorlib"!==t.name)return null;t=Bridge.global}for(r=e.split("."),i=t,o=0;o<r.length;o++)if(!(i=i[r[o]]))return null;return"function"!=typeof i||!s&&i.$assembly&&t.name!==i.$assembly.name?null:i},getAssemblyTypes:function(t){var e,n,r=[];if(t.$types)for(e in t.$types)t.$types.hasOwnProperty(e)&&r.push(t.$types[e]);else n=function(t,e){for(var i in t)t.hasOwnProperty(i)&&n(t[i],i);"function"==typeof t&&Bridge.isUpper(e.charCodeAt(0))&&r.push(t)},n(t,"");return r},createAssemblyInstance:function(t,e){var n=Bridge.Reflection.getType(e,t);return n?Bridge.createInstance(n):null},getInterfaces:function(t){return t.$allInterfaces?t.$allInterfaces:t===Date?[System.IComparable$1(Date),System.IEquatable$1(Date),System.IComparable,System.IFormattable]:t===Number?[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int),System.IComparable,System.IFormattable]:t===Boolean?[System.IComparable$1(Boolean),System.IEquatable$1(Boolean),System.IComparable]:t===String?[System.IComparable$1(String),System.IEquatable$1(String),System.IComparable,System.ICloneable,System.Collections.IEnumerable,System.Collections.Generic.IEnumerable$1(System.Char)]:t===Array||System.Array._typedArrays[Bridge.getTypeName(t)]?[System.Collections.IEnumerable,System.Collections.ICollection,System.ICloneable,System.Collections.Generic.IEnumerable$1(Object),System.Collections.Generic.ICollection$1(Object),System.Collections.Generic.IList$1(Object)]:[]},isInstanceOfType:function(t,e){return Bridge.is(t,e)},isAssignableFrom:function(t,e){if(null==t)throw new System.NullReferenceException;if(null==e)return!1;if(t===e||t===Object)return!0;if(Bridge.isFunction(t.isAssignableFrom))return t.isAssignableFrom(e);if(e===Array)return System.Array.is([],t);if(Bridge.Reflection.isInterface(t)&&System.Array.contains(Bridge.Reflection.getInterfaces(e),t))return!0;var n,r=e.$$inherits;if(r)for(n=0;n<r.length;n++)if(Bridge.Reflection.isAssignableFrom(t,r[n]))return!0;return!1},isClass:function(t){return"class"===t.$kind||t===Array||t===Function||t===RegExp||t===String||t===Error||t===Object},isEnum:function(t){return"enum"===t.$kind},isFlags:function(t){return!(!t.prototype||!t.prototype.$flags)},isInterface:function(t){return"interface"===t.$kind},_getType:function(t,e,n){var r,i,o=!n,s=(n=n||/[[,\]]/g).lastIndex,a=n.exec(t),u=[];if(a)switch(r=t.substring(s,a.index),a[0]){case"[":if("["!==t[a.index+1])return null;for(;;){if(n.exec(t),!(i=Bridge.Reflection._getType(t,Bridge.SystemAssembly,n)))return null;if(u.push(i),"]"===(a=n.exec(t))[0])break;if(","!==a[0])return null}if((a=n.exec(t))&&","===a[0]&&(n.exec(t),!(e=System.Reflection.Assembly.assemblies[(n.lastIndex>0?t.substring(a.index+1,n.lastIndex-1):t.substring(a.index+1)).trim()])))return null;break;case",":if(n.exec(t),!(e=System.Reflection.Assembly.assemblies[(n.lastIndex>0?t.substring(a.index+1,n.lastIndex-1):t.substring(a.index+1)).trim()]))return null}else r=t.substring(s);return o&&n.lastIndex?null:(i=Bridge.Reflection._getAssemblyType(e,r.trim()),(i=u.length?i.apply(null,u):i)&&i.$staticInit&&i.$staticInit(),i)},getType:function(t,e){return t?Bridge.Reflection._getType(t,e):null},canAcceptNull:function(t){return"struct"!==t.$kind&&t!==System.Decimal&&t!==System.Int64&&t!==System.UInt64&&t!==System.Double&&t!==System.Single&&t!==System.Byte&&t!==System.SByte&&t!==System.Int16&&t!==System.UInt16&&t!==System.Int32&&t!==System.UInt32&&t!==Bridge.Int&&t!==Boolean&&t!==Date&&t!==Number},applyConstructor:function(t,e){var n,r,i,o,s,a,u,l,c,g;if(!e||0===e.length)return new t;if(t.$$initCtor&&"anonymous"!==t.$kind){if(n=0,Bridge.getMetadata(t)){for(r=Bridge.Reflection.getMembers(t,1,28),o=0;o<r.length;o++)if((s=r[o]).p&&s.p.length===e.length){for(i=!0,a=0;a<s.p.length;a++)if(u=s.p[a],!Bridge.is(e[a],u)||null==e[a]&&!Bridge.Reflection.canAcceptNull(u)){i=!1;break}i&&(t=t[s.sn],n++)}}else if(Bridge.isFunction(t.ctor)&&t.ctor.length===e.length)t=t.ctor;else for(l="$ctor",c=1;Bridge.isFunction(t[l+c]);)t[l+c].length===e.length&&(t=t[l+c],n++),c++;if(n>1)throw new System.Exception("The ambiguous constructor call")}return(g=function(){t.apply(this,e)}).prototype=t.prototype,new g},getAttributes:function(t,e,n){var r,i,o,s,a,u,l,c=[];if(n&&(u=Bridge.Reflection.getBaseType(t)))for(o=Bridge.Reflection.getAttributes(u,e,!0),r=0;r<o.length;r++)i=Bridge.getType(o[r]),(s=Bridge.getMetadata(i))&&s.ni||c.push(o[r]);if((a=Bridge.getMetadata(t))&&a.at)for(r=0;r<a.at.length;r++)if(o=a.at[r],null==e||Bridge.Reflection.isInstanceOfType(o,e)){if(i=Bridge.getType(o),!(s=Bridge.getMetadata(i))||!s.am)for(l=c.length-1;l>=0;l--)Bridge.Reflection.isInstanceOfType(c[l],i)&&c.splice(l,1);c.push(o)}return c},getMembers:function(t,e,n,r,i){var o,s,a,u,l,c,g,h,m,f=[];if((72==(72&n)||4==(6&n))&&(o=Bridge.Reflection.getBaseType(t))&&(f=Bridge.Reflection.getMembers(o,-2&e,n&(64&n?255:247)&(2&n?251:255),r,i)),s=function(t){if(e&t.t&&(4&n&&!t.is||8&n&&t.is)&&(!r||t.n===r)){if(i){if((t.p||[]).length!==i.length)return;for(var o=0;o<i.length;o++)if(i[o]!==t.p[o])return}f.push(t)}},(a=Bridge.getMetadata(t))&&a.m)for(u=["g","s","ad","r"],m=0;m<a.m.length;m++)for(s(l=a.m[m]),c=0;c<4;c++)l[g=u[c]]&&s(l[g]);if(256&n){for(;t;){for(h=[],m=0;m<f.length;m++)f[m].td===t&&h.push(f[m]);if(h.length>1)throw new System.Reflection.AmbiguousMatchException("Ambiguous match");if(1===h.length)return h[0];t=Bridge.Reflection.getBaseType(t)}return null}return f},midel:function(t,e,n){var r,i,o,s;if(t.is&&e)throw new System.ArgumentException("Cannot specify target for static method");if(!t.is&&!e)throw new System.ArgumentException("Must specify target for instance method");if(t.fg)r=function(){return(t.is?t.td:this)[t.fg]};else if(t.fs)r=function(e){(t.is?t.td:this)[t.fs]=e};else{if(r=t.def||(t.is||t.sm?t.td[t.sn]:e[t.sn]),t.tpc){if(!n||n.length!==t.tpc)throw new System.ArgumentException("Wrong number of type arguments");i=r,r=function(){return i.apply(this,n.concat(Array.prototype.slice.call(arguments)))}}else if(n&&n.length)throw new System.ArgumentException("Cannot specify type arguments for non-generic method");t.exp&&(o=r,r=function(){return o.apply(this,Array.prototype.slice.call(arguments,0,arguments.length-1).concat(arguments[arguments.length-1]))}),t.sm&&(s=r,r=function(){return s.apply(null,[this].concat(Array.prototype.slice.call(arguments)))})}return Bridge.fn.bind(e,r)},invokeCI:function(t,e){return t.exp&&(e=e.slice(0,e.length-1).concat(e[e.length-1])),t.def?t.def.apply(null,e):t.sm?t.td[t.sn].apply(null,e):Bridge.Reflection.applyConstructor(t.sn?t.td[t.sn]:t.td,e)},fieldAccess:function(t,e){if(t.is&&e)throw new System.ArgumentException("Cannot specify target for static field");if(!t.is&&!e)throw new System.ArgumentException("Must specify target for instance field");if(e=t.is?t.td:e,3!==arguments.length)return e[t.sn];e[t.sn]=arguments[2]}},Bridge.setMetadata=Bridge.Reflection.setMetadata,System.Reflection.ConstructorInfo={$is:function(t){return null!=t&&1===t.t}},System.Reflection.EventInfo={$is:function(t){return null!=t&&2===t.t}},System.Reflection.FieldInfo={$is:function(t){return null!=t&&4===t.t}},System.Reflection.MethodBase={$is:function(t){return null!=t&&(1===t.t||8===t.t)}},System.Reflection.MethodInfo={$is:function(t){return null!=t&&8===t.t}},System.Reflection.PropertyInfo={$is:function(t){return null!=t&&16===t.t}},System.AppDomain={getAssemblies:function(){return Object.keys(System.Reflection.Assembly.assemblies).map((function(t){return System.Reflection.Assembly.assemblies[t]}))}},Bridge.define("System.IFormattable",{$kind:"interface",statics:{$is:function(t){return!(!Bridge.isNumber(t)&&!Bridge.isDate(t))||Bridge.is(t,System.IFormattable,!0)}}}),Bridge.define("System.IComparable",{$kind:"interface",statics:{$is:function(t){return!!(Bridge.isNumber(t)||Bridge.isDate(t)||Bridge.isBoolean(t)||Bridge.isString(t))||Bridge.is(t,System.IComparable,!0)}}}),Bridge.define("System.IFormatProvider",{$kind:"interface"}),Bridge.define("System.ICloneable",{$kind:"interface"}),Bridge.define("System.IComparable$1",(function(t){return{$kind:"interface",statics:{$is:function(e){return!!(Bridge.isNumber(e)&&t.$number&&t.$is(e)||Bridge.isDate(e)&&t===Date||Bridge.isBoolean(e)&&t===Boolean||Bridge.isString(e)&&t===String)||Bridge.is(e,System.IComparable$1(t),!0)}}}})),Bridge.define("System.IEquatable$1",(function(t){return{$kind:"interface",statics:{$is:function(e){return!!(Bridge.isNumber(e)&&t.$number&&t.$is(e)||Bridge.isDate(e)&&t===Date||Bridge.isBoolean(e)&&t===Boolean||Bridge.isString(e)&&t===String)||Bridge.is(e,System.IEquatable$1(t),!0)}}}})),Bridge.define("Bridge.IPromise",{$kind:"interface"}),Bridge.define("System.IDisposable",{$kind:"interface"}),o={hasValue:Bridge.hasValue,getValue:function(t){if(!Bridge.hasValue(t))throw new System.InvalidOperationException("Nullable instance doesn't have a value.");return t},getValueOrDefault:function(t,e){return Bridge.hasValue(t)?t:e},add:function(t,e){return Bridge.hasValue$1(t,e)?t+e:null},band:function(t,e){return Bridge.hasValue$1(t,e)?t&e:null},bor:function(t,e){return Bridge.hasValue$1(t,e)?t|e:null},and:function(t,e){return!0===t&&!0===e||!1!==t&&!1!==e&&null},or:function(t,e){return!0===t||!0===e||(!1!==t||!1!==e)&&null},div:function(t,e){return Bridge.hasValue$1(t,e)?t/e:null},eq:function(t,e){return Bridge.hasValue(t)?t===e:!Bridge.hasValue(e)},equals:function(t,e,n){return Bridge.hasValue(t)?n?n(t,e):Bridge.equals(t,e):!Bridge.hasValue(e)},toString:function(t,e){return Bridge.hasValue(t)?e?e(t):t.toString():""},getHashCode:function(t,e){return Bridge.hasValue(t)?e?e(t):Bridge.getHashCode(t):0},xor:function(t,e){return Bridge.hasValue$1(t,e)?t^e:null},gt:function(t,e){return Bridge.hasValue$1(t,e)&&t>e},gte:function(t,e){return Bridge.hasValue$1(t,e)&&t>=e},neq:function(t,e){return Bridge.hasValue(t)?t!==e:Bridge.hasValue(e)},lt:function(t,e){return Bridge.hasValue$1(t,e)&&t<e},lte:function(t,e){return Bridge.hasValue$1(t,e)&&t<=e},mod:function(t,e){return Bridge.hasValue$1(t,e)?t%e:null},mul:function(t,e){return Bridge.hasValue$1(t,e)?t*e:null},sl:function(t,e){return Bridge.hasValue$1(t,e)?t<<e:null},sr:function(t,e){return Bridge.hasValue$1(t,e)?t>>e:null},srr:function(t,e){return Bridge.hasValue$1(t,e)?t>>>e:null},sub:function(t,e){return Bridge.hasValue$1(t,e)?t-e:null},bnot:function(t){return Bridge.hasValue(t)?~t:null},neg:function(t){return Bridge.hasValue(t)?-t:null},not:function(t){return Bridge.hasValue(t)?!t:null},pos:function(t){return Bridge.hasValue(t)?+t:null},lift:function(){for(var t=1;t<arguments.length;t++)if(!Bridge.hasValue(arguments[t]))return null;return null==arguments[0]?null:null==arguments[0].apply?arguments[0]:arguments[0].apply(null,Array.prototype.slice.call(arguments,1))},lift1:function(t,e){return Bridge.hasValue(e)?"function"==typeof t?t.apply(null,Array.prototype.slice.call(arguments,1)):e[t].apply(e,Array.prototype.slice.call(arguments,2)):null},lift2:function(t,e,n){return Bridge.hasValue$1(e,n)?"function"==typeof t?t.apply(null,Array.prototype.slice.call(arguments,1)):e[t].apply(e,Array.prototype.slice.call(arguments,2)):null},liftcmp:function(t,e,n){return!!Bridge.hasValue$1(e,n)&&("function"==typeof t?t.apply(null,Array.prototype.slice.call(arguments,1)):e[t].apply(e,Array.prototype.slice.call(arguments,2)))},lifteq:function(t,e,n){var r=Bridge.hasValue(e),i=Bridge.hasValue(n);return!r&&!i||r&&i&&("function"==typeof t?t.apply(null,Array.prototype.slice.call(arguments,1)):e[t].apply(e,Array.prototype.slice.call(arguments,2)))},liftne:function(t,e,n){var r=Bridge.hasValue(e),i=Bridge.hasValue(n);return r!==i||r&&("function"==typeof t?t.apply(null,Array.prototype.slice.call(arguments,1)):e[t].apply(e,Array.prototype.slice.call(arguments,2)))}},System.Nullable=o,Bridge.define("System.Nullable$1",(function(t){return{$kind:"struct",statics:{getDefaultValue:function(){return null},$is:function(e){return Bridge.is(e,t)}}}})),Bridge.define("System.Char",{inherits:[System.IComparable,System.IFormattable],$kind:"struct",statics:{min:0,max:65535,$is:function(t){return"number"==typeof t&&Math.round(t,0)==t&&t>=System.Char.min&&t<=System.Char.max},getDefaultValue:function(){return 0},parse:function(t){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("s");if(1!==t.length)throw new System.FormatException;return t.charCodeAt(0)},tryParse:function(t,e){var n=t&&1===t.length;return e.v=n?t.charCodeAt(0):0,n},format:function(t,e,n){return Bridge.Int.format(t,e,n)},charCodeAt:function(t,e){if(null==t)throw new System.ArgumentNullException;if(1!=t.length)throw new System.FormatException("String must be exactly one character long");return t.charCodeAt(e)},isWhiteSpace:function(t){return!/[^\s\x09-\x0D\x85\xA0]/.test(t)},isDigit:function(t){return t<256?t>=48&&t<=57:new RegExp("[0-90-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9]").test(String.fromCharCode(t))},isLetter:function(t){return t<256?t>=65&&t<=90||t>=97&&t<=122:new RegExp("[A-Za-za-zµß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʯͱͳͷͻ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᴫᵫ-ᵷᵹ-ᶚḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆῇῐ-ΐῖῗῠ-ῧῲ-ῴῶῷℊℎℏℓℯℴℹℼℽⅆ-ⅉⅎↄⰰ-ⱞⱡⱥⱦⱨⱪⱬⱱⱳⱴⱶ-ⱻⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝱ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟺff-stﬓ-ﬗa-zA-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉ-ƋƎ-ƑƓƔƖ-ƘƜƝƟƠƢƤƦƧƩƬƮƯƱ-ƳƵƷƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-ZDžLjNjDzᾈ-ᾏᾘ-ᾟᾨ-ᾯᾼῌῼʰ-ˁˆ-ˑˠ-ˤˬˮʹͺՙـۥۦߴߵߺࠚࠤࠨॱๆໆჼៗᡃᪧᱸ-ᱽᴬ-ᵪᵸᶛ-ᶿⁱⁿₐ-ₜⱼⱽⵯⸯ々〱-〵〻ゝゞー-ヾꀕꓸ-ꓽꘌꙿꜗ-ꜟꝰꞈꟸꟹꧏꩰꫝꫳꫴー゙゚ªºƻǀ-ǃʔא-תװ-ײؠ-ؿف-يٮٯٱ-ۓەۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪࠀ-ࠕࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॲ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๅກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎა-ჺჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៜᠠ-ᡂᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱷᳩ-ᳬᳮ-ᳱᳵᳶℵ-ℸⴰ-ⵧⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ〆〼ぁ-ゖゟァ-ヺヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꀔꀖ-ꒌꓐ-ꓷꔀ-ꘋꘐ-ꘟꘪꘫꙮꚠ-ꛥꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩯꩱ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛꫜꫠ-ꫪꫲꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎יִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼヲ-ッア-ンᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]").test(String.fromCharCode(t))},isHighSurrogate:function(t){return new RegExp("[\ud800-\udbff]").test(String.fromCharCode(t))},isLowSurrogate:function(t){return new RegExp("[\udc00-\udfff]").test(String.fromCharCode(t))},isSurrogate:function(t){return new RegExp("[\ud800-\udfff]").test(String.fromCharCode(t))},isNull:function(t){return new RegExp("\0").test(String.fromCharCode(t))},isSymbol:function(t){return t<256?-1!=[36,43,60,61,62,94,96,124,126,162,163,164,165,166,167,168,169,172,174,175,176,177,180,182,184,215,247].indexOf(t):new RegExp("[₠-⃐-℀-⅏⅐-←-⇿∀-⋿⌀-⏿■-◿☀-⛿✀-➿⟀-⟯⟰-⟿⠀-⣿⤀-⥿⦀-⧿⨀-⫿⬀-⯿]").test(String.fromCharCode(t))},isSeparator:function(t){return t<256?32==t||160==t:new RegExp("[\u2028\u2029 - ]").test(String.fromCharCode(t))},isPunctuation:function(t){return t<256?-1!=[33,34,35,37,38,39,40,41,42,44,45,46,47,58,59,63,64,91,92,93,95,123,125,161,171,173,183,187,191].indexOf(t):new RegExp("[!-#%-*,-/:;?@[-]_{}¡§«¶·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔༺-༽྅࿐-࿔࿙࿚၊-၏჻፠-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰-⸻、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・-֊־᐀᠆‐-―⸗⸚⸺⸻〜〰゠︱︲﹘﹣-([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝﴾︗︵︷︹︻︽︿﹁﹃﹇﹙﹛﹝([{⦅「)]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶︸︺︼︾﹀﹂﹄﹈﹚﹜﹞)]}⦆」«‘‛“‟‹⸂⸄⸉⸌⸜⸠»’”›⸃⸅⸊⸍⸝⸡_‿⁀⁔︳︴﹍-﹏_!-#%-'*,./:;?@\\¡§¶·¿;·՚-՟։׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔྅࿐-࿔࿙࿚၊-၏჻፠-፨᙭᙮᛫-᛭᜵᜶។-៖៘-៚᠀-᠅᠇-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‖‗†-‧‰-‸※-‾⁁-⁃⁇-⁑⁓⁕-⁞⳹-⳼⳾⳿⵰⸀⸁⸆-⸈⸋⸎-⸖⸘⸙⸛⸞⸟⸪-⸮⸰-⸹、-〃〽・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫︐-︖︙︰﹅﹆﹉-﹌﹐-﹒﹔-﹗﹟-﹡﹨﹪﹫!-#%-'*,./:;?@\。、・]").test(String.fromCharCode(t))},isNumber:function(t){return t<256?-1!=[48,49,50,51,52,53,54,55,56,57,178,179,185,188,189,190].indexOf(t):new RegExp("[0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-90-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9ᛮ-ᛰⅠ-ↂↅ-ↈ〇〡-〩〸-〺ꛦ-ꛯ²³¹¼-¾৴-৹୲-୷௰-௲౸-౾൰-൵༪-༳፩-፼៰-៹᧚⁰⁴-⁹₀-₉⅐-⅟↉①-⒛⓪-⓿❶-➓⳽㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꠰-꠵]").test(String.fromCharCode(t))},isControl:function(t){return t<256?t>=0&&t<=31||t>=127&&t<=159:new RegExp("[\0--]").test(String.fromCharCode(t))}}}),Bridge.Class.addExtend(System.Char,[System.IComparable$1(System.Char),System.IEquatable$1(System.Char)]),Bridge.define("System.FormattableString",{inherits:[System.IFormattable],statics:{invariant:function(t){return t.toString$1(System.Globalization.CultureInfo.invariantCulture)}},toString:function(){return this.toString$1(System.Globalization.CultureInfo.getCurrentCulture())},System$IFormattable$format:function(t,e){return this.toString$1(e)}}),Bridge.define("System.FormattableStringImpl",{inherits:[System.FormattableString],args:null,format:null,ctor:function(t,e){void 0===e&&(e=[]),this.$initialize(),System.FormattableString.ctor.call(this),this.format=t,this.args=e},getArgumentCount:function(){return this.args.length},getFormat:function(){return this.format},getArgument:function(t){return this.args[t]},getArguments:function(){return this.args},toString$1:function(t){return System.String.formatProvider.apply(System.String,[t,this.format].concat(this.args))}}),Bridge.define("System.Runtime.CompilerServices.FormattableStringFactory",{statics:{create:function(t,e){return void 0===e&&(e=[]),new System.FormattableStringImpl(t,e)}}}),Bridge.define("System.Exception",{ctor:function(t,e){this.$initialize(),this.message=t||"Exception of type '"+Bridge.getTypeName(this)+"' was thrown.",this.innerException=e||null,this.errorStack=new Error,this.data=new(System.Collections.Generic.Dictionary$2(Object,Object))},getMessage:function(){return this.message},getInnerException:function(){return this.innerException},getStackTrace:function(){return this.errorStack.stack},getData:function(){return this.data},toString:function(){return this.getMessage()},statics:{create:function(t){return Bridge.is(t,System.Exception)?t:t instanceof TypeError?new System.NullReferenceException(t.message,new Bridge.ErrorException(t)):t instanceof RangeError?new System.ArgumentOutOfRangeException(null,t.message,new Bridge.ErrorException(t)):t instanceof Error?new Bridge.ErrorException(t):new System.Exception(t?t.toString():null)}}}),Bridge.define("System.SystemException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"System error.",e)}}),Bridge.define("System.OutOfMemoryException",{inherits:[System.SystemException],ctor:function(t,e){this.$initialize(),t||(t="Insufficient memory to continue the execution of the program."),System.SystemException.ctor.call(this,t,e)}}),Bridge.define("System.IndexOutOfRangeException",{inherits:[System.SystemException],ctor:function(t,e){this.$initialize(),t||(t="Index was outside the bounds of the array."),System.SystemException.ctor.call(this,t,e)}}),Bridge.define("System.TimeoutException",{inherits:[System.SystemException],ctor:function(t,e){this.$initialize(),t||(t="The operation has timed out."),System.SystemException.ctor.call(this,t,e)}}),Bridge.define("System.RegexMatchTimeoutException",{inherits:[System.TimeoutException],_regexInput:"",_regexPattern:"",_matchTimeout:null,config:{init:function(){this._matchTimeout=System.TimeSpan.fromTicks(-1)}},ctor:function(){this.$initialize(),System.TimeoutException.ctor.call(this)},$ctor1:function(t){this.$initialize(),System.TimeoutException.ctor.call(this,t)},$ctor2:function(t,e){this.$initialize(),System.TimeoutException.ctor.call(this,t,e)},$ctor3:function(t,e,n){this.$initialize(),this._regexInput=t,this._regexPattern=e,this._matchTimeout=n,this.$ctor1("The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors.")},getPattern:function(){return this._regexPattern},getInput:function(){return this._regexInput},getMatchTimeout:function(){return this._matchTimeout}}),Bridge.define("Bridge.ErrorException",{inherits:[System.Exception],ctor:function(t){this.$initialize(),System.Exception.ctor.call(this,t.message),this.errorStack=t,this.error=t},getError:function(){return this.error}}),Bridge.define("System.ArgumentException",{inherits:[System.Exception],ctor:function(t,e,n){this.$initialize(),System.Exception.ctor.call(this,t||"Value does not fall within the expected range.",n),this.paramName=e||null},getParamName:function(){return this.paramName}}),Bridge.define("System.ArgumentNullException",{inherits:[System.ArgumentException],ctor:function(t,e,n){this.$initialize(),e||(e="Value cannot be null.",t&&(e+="\nParameter name: "+t)),System.ArgumentException.ctor.call(this,e,t,n)}}),Bridge.define("System.ArgumentOutOfRangeException",{inherits:[System.ArgumentException],ctor:function(t,e,n,r){this.$initialize(),e||(e="Value is out of range.",t&&(e+="\nParameter name: "+t)),System.ArgumentException.ctor.call(this,e,t,n),this.actualValue=r||null},getActualValue:function(){return this.actualValue}}),Bridge.define("System.Globalization.CultureNotFoundException",{inherits:[System.ArgumentException],ctor:function(t,e,n,r,i){this.$initialize(),n||(n="Culture is not supported.",t&&(n+="\nParameter name: "+t),e&&(n+="\n"+e+" is an invalid culture identifier.")),System.ArgumentException.ctor.call(this,n,t,r),this.invalidCultureName=e||null,this.invalidCultureId=i||null},getInvalidCultureName:function(){return this.invalidCultureName},getInvalidCultureId:function(){return this.invalidCultureId}}),Bridge.define("System.Collections.Generic.KeyNotFoundException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Key not found.",e)}}),Bridge.define("System.ArithmeticException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Overflow or underflow in the arithmetic operation.",e)}}),Bridge.define("System.DivideByZeroException",{inherits:[System.ArithmeticException],ctor:function(t,e){this.$initialize(),System.ArithmeticException.ctor.call(this,t||"Division by 0.",e)}}),Bridge.define("System.OverflowException",{inherits:[System.ArithmeticException],ctor:function(t,e){this.$initialize(),System.ArithmeticException.ctor.call(this,t||"Arithmetic operation resulted in an overflow.",e)}}),Bridge.define("System.FormatException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Invalid format.",e)}}),Bridge.define("System.InvalidCastException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"The cast is not valid.",e)}}),Bridge.define("System.InvalidOperationException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Operation is not valid due to the current state of the object.",e)}}),Bridge.define("System.NotImplementedException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"The method or operation is not implemented.",e)}}),Bridge.define("System.NotSupportedException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Specified method is not supported.",e)}}),Bridge.define("System.NullReferenceException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Object is null.",e)}}),Bridge.define("System.RankException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Attempted to operate on an array with the incorrect number of dimensions.",e)}}),Bridge.define("Bridge.PromiseException",{inherits:[System.Exception],ctor:function(t,e,n){this.$initialize(),this.arguments=System.Array.clone(t),null==e&&(e="Promise exception: [",e+=this.arguments.map((function(t){return null==t?"null":t.toString()})).join(", "),e+="]"),System.Exception.ctor.call(this,e,n)},getArguments:function(){return this.arguments}}),Bridge.define("System.OperationCanceledException",{inherits:[System.Exception],ctor:function(t,e,n){this.$initialize(),System.Exception.ctor.call(this,t||"Operation was canceled.",n),this.cancellationToken=e||System.Threading.CancellationToken.none}}),Bridge.define("System.Threading.Tasks.TaskCanceledException",{inherits:[System.OperationCanceledException],ctor:function(t,e,n){this.$initialize(),System.OperationCanceledException.ctor.call(this,t||"A task was canceled.",null,n),this.task=e||null}}),Bridge.define("System.AggregateException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),this.innerExceptions=new(System.Collections.ObjectModel.ReadOnlyCollection$1(System.Exception))(Bridge.hasValue(e)?Bridge.toArray(e):[]),System.Exception.ctor.call(this,t||"One or more errors occurred.",this.innerExceptions.items.length?this.innerExceptions.items[0]:null)},handle:function(t){var e,n,r;if(!Bridge.hasValue(t))throw new System.ArgumentNullException("predicate");for(e=this.innerExceptions.getCount(),n=[],r=0;r<e;r++)t(this.innerExceptions.get(r))||n.push(this.innerExceptions.get(r));if(n.length>0)throw new System.AggregateException(this.getMessage(),n)},flatten:function(){var t,e,n,r,i,o=new(System.Collections.Generic.List$1(System.Exception)),s=new(System.Collections.Generic.List$1(System.AggregateException));for(s.add(this),t=0;s.getCount()>t;)for(e=s.getItem(t++).innerExceptions,n=0;n<e.getCount();n++)r=e.get(n),Bridge.hasValue(r)&&(i=Bridge.as(r,System.AggregateException),Bridge.hasValue(i)?s.add(i):o.add(r));return new System.AggregateException(this.getMessage(),o)}}),Bridge.define("System.Reflection.AmbiguousMatchException",{inherits:[System.Exception],ctor:function(t,e){this.$initialize(),System.Exception.ctor.call(this,t||"Ambiguous match.",e)}}),Bridge.define("System.Globalization.DateTimeFormatInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:{getFormat:"System$IFormatProvider$getFormat"}},statics:{$allStandardFormats:{d:"shortDatePattern",D:"longDatePattern",f:"longDatePattern shortTimePattern",F:"longDatePattern longTimePattern",g:"shortDatePattern shortTimePattern",G:"shortDatePattern longTimePattern",m:"monthDayPattern",M:"monthDayPattern",o:"roundtripFormat",O:"roundtripFormat",r:"rfc1123",R:"rfc1123",s:"sortableDateTimePattern",S:"sortableDateTimePattern1",t:"shortTimePattern",T:"longTimePattern",u:"universalSortableDateTimePattern",U:"longDatePattern longTimePattern",y:"yearMonthPattern",Y:"yearMonthPattern"},ctor:function(){this.invariantInfo=Bridge.merge(new System.Globalization.DateTimeFormatInfo,{abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbreviatedMonthGenitiveNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],amDesignator:"AM",dateSeparator:"/",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],firstDayOfWeek:0,fullDateTimePattern:"dddd, dd MMMM yyyy HH:mm:ss",longDatePattern:"dddd, dd MMMM yyyy",longTimePattern:"HH:mm:ss",monthDayPattern:"MMMM dd",monthGenitiveNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],pmDesignator:"PM",rfc1123:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",shortDatePattern:"MM/dd/yyyy",shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],shortTimePattern:"HH:mm",sortableDateTimePattern:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",sortableDateTimePattern1:"yyyy'-'MM'-'dd",timeSeparator:":",universalSortableDateTimePattern:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",yearMonthPattern:"yyyy MMMM",roundtripFormat:"yyyy'-'MM'-'dd'T'HH':'mm':'ss.uzzz"})}},getFormat:function(t){return t===System.Globalization.DateTimeFormatInfo?this:null},getAbbreviatedDayName:function(t){if(t<0||t>6)throw new System.ArgumentOutOfRangeException("dayofweek");return this.abbreviatedDayNames[t]},getAbbreviatedMonthName:function(t){if(t<1||t>13)throw new System.ArgumentOutOfRangeException("month");return this.abbreviatedMonthNames[t-1]},getAllDateTimePatterns:function(t,e){var n,r,i,o,s=System.Globalization.DateTimeFormatInfo.$allStandardFormats,a=[];if(t){if(!s[t]){if(e)return null;throw new System.ArgumentException(null,"format")}(n={})[t]=s[t]}else n=s;for(s in n){for(r=n[s].split(" "),i="",o=0;o<r.length;o++)i=(0===o?"":i+" ")+this[r[o]];a.push(i)}return a},getDayName:function(t){if(t<0||t>6)throw new System.ArgumentOutOfRangeException("dayofweek");return this.dayNames[t]},getMonthName:function(t){if(t<1||t>13)throw new System.ArgumentOutOfRangeException("month");return this.monthNames[t-1]},getShortestDayName:function(t){if(t<0||t>6)throw new System.ArgumentOutOfRangeException("dayOfWeek");return this.shortestDayNames[t]},clone:function(){return Bridge.copy(new System.Globalization.DateTimeFormatInfo,this,["abbreviatedDayNames","abbreviatedMonthGenitiveNames","abbreviatedMonthNames","amDesignator","dateSeparator","dayNames","firstDayOfWeek","fullDateTimePattern","longDatePattern","longTimePattern","monthDayPattern","monthGenitiveNames","monthNames","pmDesignator","rfc1123","shortDatePattern","shortestDayNames","shortTimePattern","sortableDateTimePattern","timeSeparator","universalSortableDateTimePattern","yearMonthPattern","roundtripFormat"])}}),Bridge.define("System.Globalization.NumberFormatInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:{getFormat:"System$IFormatProvider$getFormat"}},statics:{ctor:function(){this.numberNegativePatterns=["(n)","-n","- n","n-","n -"],this.currencyNegativePatterns=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],this.currencyPositivePatterns=["$n","n$","$ n","n $"],this.percentNegativePatterns=["-n %","-n%","-%n","%-n","%n-","n-%","n%-","-% n","n %-","% n-","% -n","n- %"],this.percentPositivePatterns=["n %","n%","%n","% n"],this.invariantInfo=Bridge.merge(new System.Globalization.NumberFormatInfo,{nanSymbol:"NaN",negativeSign:"-",positiveSign:"+",negativeInfinitySymbol:"-Infinity",positiveInfinitySymbol:"Infinity",percentSymbol:"%",percentGroupSizes:[3],percentDecimalDigits:2,percentDecimalSeparator:".",percentGroupSeparator:",",percentPositivePattern:0,percentNegativePattern:0,currencySymbol:"¤",currencyGroupSizes:[3],currencyDecimalDigits:2,currencyDecimalSeparator:".",currencyGroupSeparator:",",currencyNegativePattern:0,currencyPositivePattern:0,numberGroupSizes:[3],numberDecimalDigits:2,numberDecimalSeparator:".",numberGroupSeparator:",",numberNegativePattern:1})}},getFormat:function(t){return t===System.Globalization.NumberFormatInfo?this:null},clone:function(){return Bridge.copy(new System.Globalization.NumberFormatInfo,this,["nanSymbol","negativeSign","positiveSign","negativeInfinitySymbol","positiveInfinitySymbol","percentSymbol","percentGroupSizes","percentDecimalDigits","percentDecimalSeparator","percentGroupSeparator","percentPositivePattern","percentNegativePattern","currencySymbol","currencyGroupSizes","currencyDecimalDigits","currencyDecimalSeparator","currencyGroupSeparator","currencyNegativePattern","currencyPositivePattern","numberGroupSizes","numberDecimalDigits","numberDecimalSeparator","numberGroupSeparator","numberNegativePattern"])}}),Bridge.define("System.Globalization.CultureInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:{getFormat:"System$IFormatProvider$getFormat"}},$entryPoint:!0,statics:{ctor:function(){this.cultures=this.cultures||{},this.invariantCulture=Bridge.merge(new System.Globalization.CultureInfo("iv",!0),{englishName:"Invariant Language (Invariant Country)",nativeName:"Invariant Language (Invariant Country)",numberFormat:System.Globalization.NumberFormatInfo.invariantInfo,dateTimeFormat:System.Globalization.DateTimeFormatInfo.invariantInfo}),this.setCurrentCulture(System.Globalization.CultureInfo.invariantCulture)},getCurrentCulture:function(){return this.currentCulture},setCurrentCulture:function(t){this.currentCulture=t,System.Globalization.DateTimeFormatInfo.currentInfo=t.dateTimeFormat,System.Globalization.NumberFormatInfo.currentInfo=t.numberFormat},getCultureInfo:function(t){if(!t)throw new System.ArgumentNullException("name");return this.cultures[t]},getCultures:function(){for(var t=Bridge.getPropertyNames(this.cultures),e=[],n=0;n<t.length;n++)e.push(this.cultures[t[n]]);return e}},ctor:function(t,e){if(this.$initialize(),this.name=t,System.Globalization.CultureInfo.cultures||(System.Globalization.CultureInfo.cultures={}),System.Globalization.CultureInfo.cultures[t])Bridge.copy(this,System.Globalization.CultureInfo.cultures[t],["englishName","nativeName","numberFormat","dateTimeFormat"]);else{if(!e)throw new System.Globalization.CultureNotFoundException("name",t);System.Globalization.CultureInfo.cultures[t]=this}},getFormat:function(t){switch(t){case System.Globalization.NumberFormatInfo:return this.numberFormat;case System.Globalization.DateTimeFormatInfo:return this.dateTimeFormat;default:return null}},clone:function(){return new System.Globalization.CultureInfo(this.name)}}),Bridge.Math={divRem:function(t,e,n){var r=t%e;return n.v=r,(t-r)/e},round:function(t,e,n){var r,i,o=Math.pow(10,e||0);return(t*=o)%1==.5*(r=t>0|-(t<0))?((i=Math.floor(t))+(4===n?r>0:i%2*r))/o:Math.round(t)/o},log10:Math.log10||function(t){return Math.log(t)/Math.LN10},logWithBase:function(t,e){return isNaN(t)?t:isNaN(e)?e:1===e?NaN:1===t||0!==e&&e!==Number.POSITIVE_INFINITY?Bridge.Math.log10(t)/Bridge.Math.log10(e):NaN},log:function(t){return 0===t?Number.NEGATIVE_INFINITY:t<0||isNaN(t)?NaN:t===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:t===Number.NEGATIVE_INFINITY?NaN:Math.log(t)},sinh:Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2},cosh:Math.cosh||function(t){return(Math.exp(t)+Math.exp(-t))/2},tanh:Math.tanh||function(t){if(t===1/0)return 1;if(t===-1/0)return-1;var e=Math.exp(2*t);return(e-1)/(e+1)}},s={trueString:"True",falseString:"False",is:function(t,e){return e===System.IComparable||e===System.IEquatable$1(Boolean)||e===System.IComparable$1(Boolean)},$is:function(t){return"boolean"==typeof t},getDefaultValue:function(){return!1},toString:function(t){return t?System.Boolean.trueString:System.Boolean.falseString},parse:function(t){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("value");var e={v:!1};if(!System.Boolean.tryParse(t,e))throw new System.FormatException("Bad format for Boolean value");return e.v},tryParse:function(t,e){if(e.v=!1,!Bridge.hasValue(t))return!1;if(System.String.equals(System.Boolean.trueString,t,5))return e.v=!0,!0;if(System.String.equals(System.Boolean.falseString,t,5))return e.v=!1,!0;for(var n=0,r=t.length-1;n<t.length&&(System.Char.isWhiteSpace(t[n])||System.Char.isNull(t.charCodeAt(n)));)n++;for(;r>=n&&(System.Char.isWhiteSpace(t[r])||System.Char.isNull(t.charCodeAt(r)));)r--;return t=t.substr(n,r-n+1),System.String.equals(System.Boolean.trueString,t,5)?(e.v=!0,!0):!!System.String.equals(System.Boolean.falseString,t,5)&&(e.v=!1,!0)}},System.Boolean=s,function(){var t=function(t,e,n,r){var i=Bridge.define(t,{inherits:[System.IComparable,System.IFormattable],statics:{$number:!0,min:e,max:n,precision:r,$is:function(t){return"number"==typeof t&&Math.floor(t,0)===t&&t>=e&&t<=n},getDefaultValue:function(){return 0},parse:function(t,r){return Bridge.Int.parseInt(t,e,n,r)},tryParse:function(t,r,i){return Bridge.Int.tryParseInt(t,r,e,n,i)},format:function(t,e,n){return Bridge.Int.format(t,e,n,i)}}});i.$kind="",Bridge.Class.addExtend(i,[System.IComparable$1(i),System.IEquatable$1(i)])};t("System.Byte",0,255,3),t("System.SByte",-128,127,3),t("System.Int16",-32768,32767,5),t("System.UInt16",0,65535,5),t("System.Int32",-2147483648,2147483647,10),t("System.UInt32",0,4294967295,10)}(),Bridge.define("Bridge.Int",{inherits:[System.IComparable,System.IFormattable],statics:{$number:!0,$is:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t,0)===t},getDefaultValue:function(){return 0},format:function(t,e,n,r){var i,o,s,a,u,l,c,g,h,m=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),f=m.numberDecimalSeparator,d=(m.numberGroupSeparator,t instanceof System.Decimal),y=t instanceof System.Int64||t instanceof System.UInt64,p=d||y?!t.isZero()&&t.isNegative():t<0;if(!y&&(d?!t.isFinite():!isFinite(t)))return Number.NEGATIVE_INFINITY===t||d&&p?m.negativeInfinitySymbol:isNaN(t)?m.nanSymbol:m.positiveInfinitySymbol;if(e||(e="G"),i=e.match(/^([a-zA-Z])(\d*)$/))switch(a=i[1].toUpperCase(),o=(o=parseInt(i[2],10))>15?15:o,a){case"D":return this.defaultFormat(t,isNaN(o)?1:o,0,0,m,!0);case"F":case"N":return isNaN(o)&&(o=m.numberDecimalDigits),this.defaultFormat(t,1,o,o,m,"F"===a);case"G":case"E":for(var S,C,x=0,v=d||y?y&&t.eq(System.Int64.MinValue)?System.Int64(t.value.toUnsigned()):t.abs():Math.abs(t),w=i[1],b=3;d||y?v.gte(10):v>=10;)d||y?v=v.div(10):v/=10,x++;for(;d||y?v.ne(0)&&v.lt(1):0!==v&&v<1;)d||y?v=v.mul(10):v*=10,x--;if("G"===a){if((u=isNaN(o))&&(o=d?29:y?t instanceof System.Int64?19:20:r&&r.precision?r.precision:15),x>-5&&x<o||d&&u)return S=0,C=o-(x>0?x+1:1),this.defaultFormat(t,1,S,C,m,!0);w="G"===w?"E":"e",b=2,S=0,C=(o||15)-1}else S=C=isNaN(o)?6:o;return x>=0?w+=m.positiveSign:(w+=m.negativeSign,x=-x),p&&(d||y?v=v.mul(-1):v*=-1),this.defaultFormat(v,1,S,C,m)+w+this.defaultFormat(x,b,0,0,m,!0);case"P":return isNaN(o)&&(o=m.percentDecimalDigits),this.defaultFormat(100*t,1,o,o,m,!1,"percent");case"X":for(l=d?t.round().value.toHex().substr(2):y?t.toString(16):Math.round(t).toString(16),"X"===i[1]&&(l=l.toUpperCase()),o-=l.length;o-- >0;)l="0"+l;return l;case"C":return isNaN(o)&&(o=m.currencyDecimalDigits),this.defaultFormat(t,1,o,o,m,!1,"currency");case"R":return c=d||y?t.toString():""+t,"."!==f&&(c=c.replace(".",f)),c.replace("e","E")}if(-1!==e.indexOf(",.")||System.String.endsWith(e,",")){for(g=0,-1===(h=e.indexOf(",."))&&(h=e.length-1);h>-1&&","===e.charAt(h);)g++,h--;d||y?t=t.div(Math.pow(1e3,g)):t/=Math.pow(1e3,g)}return-1!==e.indexOf("%")&&(d||y?t=t.mul(100):t*=100),-1!==e.indexOf("‰")&&(d||y?t=t.mul(1e3):t*=1e3),s=e.split(";"),(d||y?t.lt(0):t<0)&&s.length>1?(d||y?t=t.mul(-1):t*=-1,e=s[1]):e=s[(d||y?t.ne(0):!t)&&s.length>2?2:0],this.customFormat(t,e,m,!e.match(/^[^\.]*[0#],[0#]/))},defaultFormat:function(t,e,n,r,i,o,s){s=s||"number";var a,u,l,c,g,h,m,f,d,y,p,S,C=(i||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),x=C[s+"GroupSizes"],v="",w=t instanceof System.Decimal,b=t instanceof System.Int64||t instanceof System.UInt64,B=w||b?!t.isZero()&&t.isNegative():t<0;if(Math.pow(10,r),S=(a=w?t.abs().toDecimalPlaces(r).toFixed():b?t.eq(System.Int64.MinValue)?t.value.toUnsigned().toString():t.abs().toString():""+ +Math.abs(t).toFixed(r)).split("").every((function(t){return"0"===t||"."===t})),(u=a.indexOf("."))>0&&(g=C[s+"DecimalSeparator"]+a.substr(u+1),a=a.substr(0,u)),a.length<e&&(a=Array(e-a.length+1).join("0")+a),g?(g.length-1<n&&(g+=Array(n-g.length+2).join("0")),0===r?g=null:g.length-1>r&&(g=g.substr(0,r+1))):n>0&&(g=C[s+"DecimalSeparator"]+Array(n+1).join("0")),c=x[l=0],a.length<c)v=a,g&&(v+=g);else{for(h=a.length,m=!1,p=o?"":C[s+"GroupSeparator"];!m&&((f=h-(d=c))<0&&(c+=f,d+=f,f=0,m=!0),d);)y=a.substr(f,d),v=v.length?y+p+v:y,h-=d,l<x.length-1&&(c=x[++l]);g&&(v+=g)}return B&&!S?System.Globalization.NumberFormatInfo[s+"NegativePatterns"][C[s+"NegativePattern"]].replace("-",C.negativeSign).replace("%",C.percentSymbol).replace("$",C.currencySymbol).replace("n",v):System.Globalization.NumberFormatInfo[s+"PositivePatterns"]?System.Globalization.NumberFormatInfo[s+"PositivePatterns"][C[s+"PositivePattern"]].replace("%",C.percentSymbol).replace("$",C.currencySymbol).replace("n",v):v},customFormat:function(t,e,n,r){var i,o,s,a,u,l,c,g,h,m,f=0,d=-1,y=0,p=-1,S=0,C=1,x=!1,v="",w=!1,b=!1,B=!1,I=t instanceof System.Decimal,$=t instanceof System.Int64||t instanceof System.UInt64,_=I||$?!t.isZero()&&t.isNegative():t<0;for(h="number",-1!==e.indexOf("%")?h="percent":-1!==e.indexOf("$")&&(h="currency"),s=0;s<e.length;s++)if("'"===(o=e.charAt(s))||'"'===o){if((s=e.indexOf(o,s+1))<0)break}else"\\"===o?s++:(("0"===o||"#"===o)&&(y+=S,"0"===o&&(S?p=y:d<0&&(d=f)),f+=!S),S=S||"."===o);for(d=d<0?1:f-d,_&&(x=!0),l=Math.pow(10,y),g=(t=I?System.Decimal.round(t.abs().mul(l),4).div(l).toString():$?(t.eq(System.Int64.MinValue)?System.Int64(t.value.toUnsigned()):t.abs()).mul(l).div(l).toString():""+Math.round(Math.abs(t)*l)/l).split("").every((function(t){return"0"===t||"."===t})),s=(i=(c=t.indexOf("."))<0?t.length:c)-f,m={groupIndex:Math.max(i,d),sep:r?"":n[h+"GroupSeparator"]},1===i&&"0"===t.charAt(0)&&(w=!0),a=0;a<e.length;a++)if("'"===(o=e.charAt(a))||'"'===o){if(u=e.indexOf(o,a+1),v+=e.substring(a+1,u<0?e.length:u),u<0)break;a=u}else"\\"===o?(v+=e.charAt(a+1),a++):"#"===o||"0"===o?(B=!0,!b&&w&&"#"===o||(m.buffer=v,s<i?(s>=0?(C&&this.addGroup(t.substr(0,s),m),this.addGroup(t.charAt(s),m)):s>=i-d&&this.addGroup("0",m),C=0):(p-- >0||s<t.length)&&this.addGroup(s>=t.length?"0":t.charAt(s),m),v=m.buffer),s++):"."===o?(B||w||(v+=t.substr(0,i),B=!0),(t.length>++s||p>0)&&(b=!0,v+=n[h+"DecimalSeparator"])):","!==o&&(v+=o);return x&&!g&&(v="-"+v),v},addGroup:function(t,e){for(var n=e.buffer,r=e.sep,i=e.groupIndex,o=0,s=t.length;o<s;o++)n+=t.charAt(o),r&&i>1&&i--%3==1&&(n+=r);e.buffer=n,e.groupIndex=i},parseFloat:function(t,e){var n={};return Bridge.Int.tryParseFloat(t,e,n,!1),n.v},tryParseFloat:function(t,e,n,r){var i,o,s,a;if(n.v=0,null==r&&(r=!0),null==t){if(r)return!1;throw new System.ArgumentNullException("s")}t=t.trim();var u=(e||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),l=u.numberDecimalSeparator,c=u.numberGroupSeparator,g="Input string was not in a correct format.",h=t.indexOf(l),m=c?t.indexOf(c):-1;if(h>-1&&(h<m||m>-1&&h<t.indexOf(c,h)||t.indexOf(l,h+1)>-1)){if(r)return!1;throw new System.FormatException(g)}if("."!==l&&"."!==c&&t.indexOf(".")>-1){if(r)return!1;throw new System.FormatException(g)}if(m>-1){for(i="",s=0;s<t.length;s++)t[s]!==c&&(i+=t[s]);t=i}if(t===u.negativeInfinitySymbol)return n.v=Number.NEGATIVE_INFINITY,!0;if(t===u.positiveInfinitySymbol)return n.v=Number.POSITIVE_INFINITY,!0;if(t===u.nanSymbol)return n.v=Number.NaN,!0;for(o=0,s=0;s<t.length;s++)if(System.Char.isLetter(t[s].charCodeAt(0))){if("e"!==t[s].toLowerCase()){if(r)return!1;throw new System.FormatException(g)}if(++o>1){if(r)return!1;throw new System.FormatException(g)}}if(a=parseFloat(t.replace(l,".")),isNaN(a)){if(r)return!1;throw new System.FormatException(g)}return n.v=a,!0},parseInt:function(t,e,n,r){if(r=r||10,null==t)throw new System.ArgumentNullException("str");if(r<=10&&!/^[+-]?[0-9]+$/.test(t)||16==r&&!/^[+-]?[0-9A-F]+$/gi.test(t))throw new System.FormatException("Input string was not in a correct format.");var i=parseInt(t,r);if(isNaN(i))throw new System.FormatException("Input string was not in a correct format.");if(i<e||i>n)throw new System.OverflowException;return i},tryParseInt:function(t,e,n,r,i){return e.v=0,!((i=i||10)<=10&&!/^[+-]?[0-9]+$/.test(t)||16==i&&!/^[+-]?[0-9A-F]+$/gi.test(t)||(e.v=parseInt(t,i),e.v<n||e.v>r))},isInfinite:function(t){return t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY},trunc:function(t){return Bridge.isNumber(t)?t>0?Math.floor(t):Math.ceil(t):Bridge.Int.isInfinite(t)?t:null},div:function(t,e){if(!Bridge.isNumber(t)||!Bridge.isNumber(e))return null;if(0===e)throw new System.DivideByZeroException;return this.trunc(t/e)},mod:function(t,e){if(!Bridge.isNumber(t)||!Bridge.isNumber(e))return null;if(0===e)throw new System.DivideByZeroException;return t%e},check:function(t,e){if(System.Int64.is64Bit(t))return System.Int64.check(t,e);if(t instanceof System.Decimal)return System.Decimal.toInt(t,e);if(Bridge.isNumber(t)&&!e.$is(t))throw new System.OverflowException;return Bridge.Int.isInfinite(t)?e===System.Int64||e===System.UInt64?e.MinValue:e.min:t},sxb:function(t){return Bridge.isNumber(t)?t|(128&t?4294967040:0):Bridge.Int.isInfinite(t)?System.SByte.min:null},sxs:function(t){return Bridge.isNumber(t)?t|(32768&t?4294901760:0):Bridge.Int.isInfinite(t)?System.Int16.min:null},clip8:function(t){return Bridge.isNumber(t)?Bridge.Int.sxb(255&t):Bridge.Int.isInfinite(t)?System.SByte.min:null},clipu8:function(t){return Bridge.isNumber(t)?255&t:Bridge.Int.isInfinite(t)?System.Byte.min:null},clip16:function(t){return Bridge.isNumber(t)?Bridge.Int.sxs(65535&t):Bridge.Int.isInfinite(t)?System.Int16.min:null},clipu16:function(t){return Bridge.isNumber(t)?65535&t:Bridge.Int.isInfinite(t)?System.UInt16.min:null},clip32:function(t){return Bridge.isNumber(t)?0|t:Bridge.Int.isInfinite(t)?System.Int32.min:null},clipu32:function(t){return Bridge.isNumber(t)?t>>>0:Bridge.Int.isInfinite(t)?System.UInt32.min:null},clip64:function(t){return Bridge.isNumber(t)?System.Int64(Bridge.Int.trunc(t)):Bridge.Int.isInfinite(t)?System.Int64.MinValue:null},clipu64:function(t){return Bridge.isNumber(t)?System.UInt64(Bridge.Int.trunc(t)):Bridge.Int.isInfinite(t)?System.UInt64.MinValue:null},sign:function(t){return Bridge.isNumber(t)?0===t?0:t<0?-1:1:null}}}),Bridge.Int.$kind="",Bridge.Class.addExtend(Bridge.Int,[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int)]),Bridge.define("System.Double",{inherits:[System.IComparable,System.IFormattable],statics:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE,precision:15,$number:!0,$is:function(t){return"number"==typeof t},getDefaultValue:function(){return 0},parse:function(t,e){return Bridge.Int.parseFloat(t,e)},tryParse:function(t,e,n){return Bridge.Int.tryParseFloat(t,e,n)},format:function(t,e,n){return Bridge.Int.format(t,e,n,System.Double)}}}),System.Double.$kind="",Bridge.Class.addExtend(System.Double,[System.IComparable$1(System.Double),System.IEquatable$1(System.Double)]),Bridge.define("System.Single",{inherits:[System.IComparable,System.IFormattable],statics:{min:-34028234663852886e22,max:34028234663852886e22,precision:7,$number:!0,$is:System.Double.$is,getDefaultValue:System.Double.getDefaultValue,parse:System.Double.parse,tryParse:System.Double.tryParse,format:function(t,e,n){return Bridge.Int.format(t,e,n,System.Single)}}}),System.Single.$kind="",Bridge.Class.addExtend(System.Single,[System.IComparable$1(System.Single),System.IEquatable$1(System.Single)]),function(t){function e(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function n(t){return!0===(t&&t.__isLong__)}function r(t,e){var n,r;if(e){if((r=0<=(t>>>=0)&&256>t)&&(n=l[t]))return n;n=o(t,0>(0|t)?-1:0,!0),r&&(l[t]=n)}else{if((r=-128<=(t|=0)&&128>t)&&(n=u[t]))return n;n=o(t,0>t?-1:0,!1),r&&(u[t]=n)}return n}function i(t,e){if(isNaN(t)||!isFinite(t))return e?g:v;if(e){if(0>t)return g;if(t>=S)return y}else{if(t<=-C)return p;if(t+1>=C)return d}return 0>t?i(-t,e).neg():o(t%4294967296|0,t/4294967296|0,e)}function o(t,n,r){return new e(t,n,r)}function s(t,e,n){var r,o,a,u,l;if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return v;if("number"==typeof e?(n=e,e=!1):e=!!e,2>(n=n||10)||36<n)throw RangeError("radix");if(0<(r=t.indexOf("-")))throw Error("interior hyphen");if(0===r)return s(t.substring(1),e,n).neg();for(r=i(c(n,8)),o=v,a=0;a<t.length;a+=8)u=Math.min(8,t.length-a),l=parseInt(t.substring(a,a+u),n),8>u?(u=i(c(n,u)),o=o.mul(u).add(i(l))):o=(o=o.mul(r)).add(i(l));return o.unsigned=e,o}function a(t){return t instanceof e?t:"number"==typeof t?i(t):"string"==typeof t?s(t):o(t.low,t.high,t.unsigned)}var u,l,c,g,h,m,f,d,y,p;t.Bridge.$Long=e,e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=n,u={},l={},e.fromInt=r,e.fromNumber=i,e.fromBits=o,c=Math.pow,e.fromString=s,e.fromValue=a;var S=0x10000000000000000,C=S/2,x=r(16777216),v=r(0);e.ZERO=v,g=r(0,!0),e.UZERO=g,h=r(1),e.ONE=h,m=r(1,!0),e.UONE=m,f=r(-1),e.NEG_ONE=f,d=o(-1,2147483647,!1),e.MAX_VALUE=d,y=o(-1,-1,!0),e.MAX_UNSIGNED_VALUE=y,p=o(0,-2147483648,!1),e.MIN_VALUE=p,(t=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},t.toNumber=function(){return this.unsigned?4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)},t.toString=function(t){if(2>(t=t||10)||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(p)){var e=i(t);return e=(n=this.div(e)).mul(e).sub(this),n.toString(t)+e.toInt().toString(t)}return(void 0===t||10===t?"-":"")+this.neg().toString(t)}for(var n=i(c(t,6),this.unsigned),r=(e=this,"");;){var o=e.div(n),s=(e.sub(o.mul(n)).toInt()>>>0).toString(t);if((e=o).isZero())return s+r;for(;6>s.length;)s="0"+s;r=""+s+r}},t.getHighBits=function(){return this.high},t.getHighBitsUnsigned=function(){return this.high>>>0},t.getLowBits=function(){return this.low},t.getLowBitsUnsigned=function(){return this.low>>>0},t.getNumBitsAbs=function(){if(this.isNegative())return this.eq(p)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;0<e&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},t.isZero=function(){return 0===this.high&&0===this.low},t.isNegative=function(){return!this.unsigned&&0>this.high},t.isPositive=function(){return this.unsigned||0<=this.high},t.isOdd=function(){return 1==(1&this.low)},t.isEven=function(){return 0==(1&this.low)},t.equals=function(t){return n(t)||(t=a(t)),(this.unsigned===t.unsigned||1!=this.high>>>31||1!=t.high>>>31)&&this.high===t.high&&this.low===t.low},t.eq=t.equals,t.notEquals=function(t){return!this.eq(t)},t.neq=t.notEquals,t.lessThan=function(t){return 0>this.comp(t)},t.lt=t.lessThan,t.lessThanOrEqual=function(t){return 0>=this.comp(t)},t.lte=t.lessThanOrEqual,t.greaterThan=function(t){return 0<this.comp(t)},t.gt=t.greaterThan,t.greaterThanOrEqual=function(t){return 0<=this.comp(t)},t.gte=t.greaterThanOrEqual,t.compare=function(t){if(n(t)||(t=a(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},t.comp=t.compare,t.negate=function(){return!this.unsigned&&this.eq(p)?p:this.not().add(h)},t.neg=t.negate,t.add=function(t){n(t)||(t=a(t));var e,r=this.high>>>16,i=65535&this.high,s=this.low>>>16,u=t.high>>>16,l=65535&t.high,c=t.low>>>16;return t=0+((e=(65535&this.low)+(65535&t.low)+0)>>>16),s=0+((t+=s+c)>>>16),o((65535&t)<<16|65535&e,(i=(i=0+((s+=i+l)>>>16))+(r+u)&65535)<<16|65535&s,this.unsigned)},t.subtract=function(t){return n(t)||(t=a(t)),this.add(t.neg())},t.sub=t.subtract,t.multiply=function(t){var e,r,s,u;if(this.isZero()||(n(t)||(t=a(t)),t.isZero()))return v;if(this.eq(p))return t.isOdd()?p:v;if(t.eq(p))return this.isOdd()?p:v;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(x)&&t.lt(x))return i(this.toNumber()*t.toNumber(),this.unsigned);var l=this.high>>>16,c=65535&this.high,g=this.low>>>16,h=65535&this.low,m=t.high>>>16,f=65535&t.high,d=t.low>>>16;return s=0+((u=0+h*(t=65535&t.low))>>>16),r=0+((s+=g*t)>>>16),r+=(s=(65535&s)+h*d)>>>16,e=0+((r+=c*t)>>>16),e+=(r=(65535&r)+g*d)>>>16,r&=65535,o((s&=65535)<<16|65535&u,(e=(e+=(r+=h*f)>>>16)+(l*t+c*d+g*f+h*m)&65535)<<16|(r&=65535),this.unsigned)},t.mul=t.multiply,t.divide=function(t){var e,r,o;if(n(t)||(t=a(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;if(this.unsigned)t.unsigned||(t=t.toUnsigned());else{if(this.eq(p))return t.eq(h)||t.eq(f)?p:t.eq(p)?h:(e=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?h:f:(r=this.sub(t.mul(e)),e.add(r.div(t)));if(t.eq(p))return this.unsigned?g:v;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg()}if(this.unsigned){if(t.gt(this))return g;if(t.gt(this.shru(1)))return m;o=g}else o=v;for(r=this;r.gte(t);){e=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var s=48>=(s=Math.ceil(Math.log(e)/Math.LN2))?1:c(2,s-48),u=i(e),l=u.mul(t);l.isNegative()||l.gt(r);)l=(u=i(e-=s,this.unsigned)).mul(t);u.isZero()&&(u=h),o=o.add(u),r=r.sub(l)}return o},t.div=t.divide,t.modulo=function(t){return n(t)||(t=a(t)),this.sub(this.div(t).mul(t))},t.mod=t.modulo,t.not=function(){return o(~this.low,~this.high,this.unsigned)},t.and=function(t){return n(t)||(t=a(t)),o(this.low&t.low,this.high&t.high,this.unsigned)},t.or=function(t){return n(t)||(t=a(t)),o(this.low|t.low,this.high|t.high,this.unsigned)},t.xor=function(t){return n(t)||(t=a(t)),o(this.low^t.low,this.high^t.high,this.unsigned)},t.shiftLeft=function(t){return n(t)&&(t=t.toInt()),0==(t&=63)?this:32>t?o(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):o(0,this.low<<t-32,this.unsigned)},t.shl=t.shiftLeft,t.shiftRight=function(t){return n(t)&&(t=t.toInt()),0==(t&=63)?this:32>t?o(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):o(this.high>>t-32,0<=this.high?0:-1,this.unsigned)},t.shr=t.shiftRight,t.shiftRightUnsigned=function(t){if(n(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return 32>t?o(this.low>>>t|e<<32-t,e>>>t,this.unsigned):o(32===t?e:e>>>t-32,0,this.unsigned)},t.shru=t.shiftRightUnsigned,t.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},t.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)}}(Bridge.global),System.Int64=function(t){if(this.constructor!==System.Int64)return new System.Int64(t);Bridge.hasValue(t)||(t=0),this.T=System.Int64,this.unsigned=!1,this.value=System.Int64.getValue(t)},System.Int64.$$name="System.Int64",System.Int64.prototype.$$name="System.Int64",System.Int64.$kind="struct",System.Int64.prototype.$kind="struct",System.Int64.$$inherits=[],Bridge.Class.addExtend(System.Int64,[System.IComparable,System.IFormattable,System.IComparable$1(System.Int64),System.IEquatable$1(System.Int64)]),System.Int64.$is=function(t){return t instanceof System.Int64},System.Int64.is64Bit=function(t){return t instanceof System.Int64||t instanceof System.UInt64},System.Int64.getDefaultValue=function(){return System.Int64.Zero},System.Int64.getValue=function(t){return Bridge.hasValue(t)?t instanceof Bridge.$Long?t:t instanceof System.Int64?t.value:t instanceof System.UInt64?t.value.toSigned():Bridge.isArray(t)?new Bridge.$Long(t[0],t[1]):Bridge.isString(t)?Bridge.$Long.fromString(t):Bridge.isNumber(t)?Bridge.$Long.fromNumber(t):t instanceof System.Decimal?Bridge.$Long.fromString(t.toString()):Bridge.$Long.fromValue(t):null},System.Int64.create=function(t){return Bridge.hasValue(t)?t instanceof System.Int64?t:new System.Int64(t):null},System.Int64.lift=function(t){return Bridge.hasValue(t)?System.Int64.create(t):null},System.Int64.toNumber=function(t){return t?t.toNumber():null},System.Int64.prototype.toNumberDivided=function(t){var e=this.div(t),n=this.mod(t).toNumber()/t;return e.toNumber()+n},System.Int64.prototype.toJSON=function(){return this.toNumber()},System.Int64.prototype.toString=function(t,e){return t||e?Bridge.isNumber(t)&&!e?this.value.toString(t):Bridge.Int.format(this,t,e):this.value.toString()},System.Int64.prototype.format=function(t,e){return Bridge.Int.format(this,t,e)},System.Int64.prototype.isNegative=function(){return this.value.isNegative()},System.Int64.prototype.abs=function(){if(this.T===System.Int64&&this.eq(System.Int64.MinValue))throw new System.OverflowException;return new this.T(this.value.isNegative()?this.value.neg():this.value)},System.Int64.prototype.compareTo=function(t){return this.value.compare(this.T.getValue(t))},System.Int64.prototype.add=function(t,e){var n=this.T.getValue(t),r=new this.T(this.value.add(n));if(e){var i=this.value.isNegative(),o=n.isNegative(),s=r.value.isNegative();if(i&&o&&!s||!i&&!o&&s||this.T===System.UInt64&&r.lt(System.UInt64.max(this,n)))throw new System.OverflowException}return r},System.Int64.prototype.sub=function(t,e){var n=this.T.getValue(t),r=new this.T(this.value.sub(n));if(e){var i=this.value.isNegative(),o=n.isNegative(),s=r.value.isNegative();if(i&&!o&&!s||!i&&o&&s||this.T===System.UInt64&&this.value.lt(n))throw new System.OverflowException}return r},System.Int64.prototype.isZero=function(){return this.value.isZero()},System.Int64.prototype.mul=function(t,e){var n,r=this.T.getValue(t),i=new this.T(this.value.mul(r));if(e){var o=this.sign(),s=r.isZero()?0:r.isNegative()?-1:1,a=i.sign();if(this.T===System.Int64){if(this.eq(System.Int64.MinValue)||this.eq(System.Int64.MaxValue)){if(r.neq(1)&&r.neq(0))throw new System.OverflowException;return i}if(r.eq(Bridge.$Long.MIN_VALUE)||r.eq(Bridge.$Long.MAX_VALUE)){if(this.neq(1)&&this.neq(0))throw new System.OverflowException;return i}if(-1===o&&-1===s&&1!==a||1===o&&1===s&&1!==a||-1===o&&1===s&&-1!==a||1===o&&-1===s&&-1!==a)throw new System.OverflowException;if((n=i.abs()).lt(this.abs())||n.lt(System.Int64(r).abs()))throw new System.OverflowException}else{if(this.eq(System.UInt64.MaxValue)){if(r.neq(1)&&r.neq(0))throw new System.OverflowException;return i}if(r.eq(Bridge.$Long.MAX_UNSIGNED_VALUE)){if(this.neq(1)&&this.neq(0))throw new System.OverflowException;return i}if((n=i.abs()).lt(this.abs())||n.lt(System.Int64(r).abs()))throw new System.OverflowException}}return i},System.Int64.prototype.div=function(t){return new this.T(this.value.div(this.T.getValue(t)))},System.Int64.prototype.mod=function(t){return new this.T(this.value.mod(this.T.getValue(t)))},System.Int64.prototype.neg=function(t){if(t&&this.T===System.Int64&&this.eq(System.Int64.MinValue))throw new System.OverflowException;return new this.T(this.value.neg())},System.Int64.prototype.inc=function(t){return this.add(1,t)},System.Int64.prototype.dec=function(t){return this.sub(1,t)},System.Int64.prototype.sign=function(){return this.value.isZero()?0:this.value.isNegative()?-1:1},System.Int64.prototype.clone=function(){return new this.T(this)},System.Int64.prototype.ne=function(t){return this.value.neq(this.T.getValue(t))},System.Int64.prototype.neq=function(t){return this.value.neq(this.T.getValue(t))},System.Int64.prototype.eq=function(t){return this.value.eq(this.T.getValue(t))},System.Int64.prototype.lt=function(t){return this.value.lt(this.T.getValue(t))},System.Int64.prototype.lte=function(t){return this.value.lte(this.T.getValue(t))},System.Int64.prototype.gt=function(t){return this.value.gt(this.T.getValue(t))},System.Int64.prototype.gte=function(t){return this.value.gte(this.T.getValue(t))},System.Int64.prototype.equals=function(t){return this.value.eq(this.T.getValue(t))},System.Int64.prototype.equalsT=function(t){return this.equals(t)},System.Int64.prototype.getHashCode=function(){return 397*(397*this.sign()+this.value.high|0)+this.value.low|0},System.Int64.prototype.toNumber=function(){return this.value.toNumber()},System.Int64.parse=function(t){if(null==t)throw new System.ArgumentNullException("str");if(!/^[+-]?[0-9]+$/.test(t))throw new System.FormatException("Input string was not in a correct format.");var e=new System.Int64(t);if(t!==e.toString())throw new System.OverflowException;return e},System.Int64.tryParse=function(t,e){try{return null!=t&&/^[+-]?[0-9]+$/.test(t)?(e.v=new System.Int64(t),t===e.v.toString()||(e.v=System.Int64(Bridge.$Long.ZERO),!1)):(e.v=System.Int64(Bridge.$Long.ZERO),!1)}catch(t){return e.v=System.Int64(Bridge.$Long.ZERO),!1}},System.Int64.divRem=function(t,e,n){t=System.Int64(t),e=System.Int64(e);var r=t.mod(e);return n.v=r,t.sub(r).div(e)},System.Int64.min=function(){for(var t,e=[],n=0,r=arguments.length;n<r;n++)e.push(System.Int64.getValue(arguments[n]));for(n=0,t=e[0];++n<e.length;)e[n].lt(t)&&(t=e[n]);return new System.Int64(t)},System.Int64.max=function(){for(var t,e=[],n=0,r=arguments.length;n<r;n++)e.push(System.Int64.getValue(arguments[n]));for(n=0,t=e[0];++n<e.length;)e[n].gt(t)&&(t=e[n]);return new System.Int64(t)},System.Int64.prototype.and=function(t){return new this.T(this.value.and(this.T.getValue(t)))},System.Int64.prototype.not=function(){return new this.T(this.value.not())},System.Int64.prototype.or=function(t){return new this.T(this.value.or(this.T.getValue(t)))},System.Int64.prototype.shl=function(t){return new this.T(this.value.shl(t))},System.Int64.prototype.shr=function(t){return new this.T(this.value.shr(t))},System.Int64.prototype.shru=function(t){return new this.T(this.value.shru(t))},System.Int64.prototype.xor=function(t){return new this.T(this.value.xor(this.T.getValue(t)))},System.Int64.check=function(t,e){if(Bridge.Int.isInfinite(t))return e===System.Int64||e===System.UInt64?e.MinValue:e.min;if(!t)return null;var n,r;if(e===System.Int64){if(t instanceof System.Int64)return t;if((n=t.value.toString())!==(r=new System.Int64(n)).value.toString())throw new System.OverflowException;return r}if(e===System.UInt64){if(t instanceof System.UInt64)return t;if(t.value.isNegative())throw new System.OverflowException;if((n=t.value.toString())!==(r=new System.UInt64(n)).value.toString())throw new System.OverflowException;return r}return Bridge.Int.check(t.toNumber(),e)},System.Int64.clip8=function(t){return t?Bridge.Int.sxb(255&t.value.low):Bridge.Int.isInfinite(t)?System.SByte.min:null},System.Int64.clipu8=function(t){return t?255&t.value.low:Bridge.Int.isInfinite(t)?System.Byte.min:null},System.Int64.clip16=function(t){return t?Bridge.Int.sxs(65535&t.value.low):Bridge.Int.isInfinite(t)?System.Int16.min:null},System.Int64.clipu16=function(t){return t?65535&t.value.low:Bridge.Int.isInfinite(t)?System.UInt16.min:null},System.Int64.clip32=function(t){return t?0|t.value.low:Bridge.Int.isInfinite(t)?System.Int32.min:null},System.Int64.clipu32=function(t){return t?t.value.low>>>0:Bridge.Int.isInfinite(t)?System.UInt32.min:null},System.Int64.clip64=function(t){return t?new System.Int64(t.value.toSigned()):Bridge.Int.isInfinite(t)?System.Int64.MinValue:null},System.Int64.clipu64=function(t){return t?new System.UInt64(t.value.toUnsigned()):Bridge.Int.isInfinite(t)?System.UInt64.MinValue:null},System.Int64.Zero=System.Int64(Bridge.$Long.ZERO),System.Int64.MinValue=System.Int64(Bridge.$Long.MIN_VALUE),System.Int64.MaxValue=System.Int64(Bridge.$Long.MAX_VALUE),System.Int64.precision=19,System.UInt64=function(t){if(this.constructor!==System.UInt64)return new System.UInt64(t);Bridge.hasValue(t)||(t=0),this.T=System.UInt64,this.unsigned=!0,this.value=System.UInt64.getValue(t,!0)},System.UInt64.$$name="System.UInt64",System.UInt64.prototype.$$name="System.UInt64",System.UInt64.$kind="struct",System.UInt64.prototype.$kind="struct",System.UInt64.$$inherits=[],Bridge.Class.addExtend(System.UInt64,[System.IComparable,System.IFormattable,System.IComparable$1(System.UInt64),System.IEquatable$1(System.UInt64)]),System.UInt64.$is=function(t){return t instanceof System.UInt64},System.UInt64.getDefaultValue=function(){return System.UInt64.Zero},System.UInt64.getValue=function(t){return Bridge.hasValue(t)?t instanceof Bridge.$Long?t:t instanceof System.UInt64?t.value:t instanceof System.Int64?t.value.toUnsigned():Bridge.isArray(t)?new Bridge.$Long(t[0],t[1],!0):Bridge.isString(t)?Bridge.$Long.fromString(t,!0):Bridge.isNumber(t)?Bridge.$Long.fromNumber(t,!0):t instanceof System.Decimal?Bridge.$Long.fromString(t.toString(),!0):Bridge.$Long.fromValue(t):null},System.UInt64.create=function(t){return Bridge.hasValue(t)?t instanceof System.UInt64?t:new System.UInt64(t):null},System.UInt64.lift=function(t){return Bridge.hasValue(t)?System.UInt64.create(t):null},System.UInt64.prototype.toJSON=System.Int64.prototype.toJSON,System.UInt64.prototype.toString=System.Int64.prototype.toString,System.UInt64.prototype.format=System.Int64.prototype.format,System.UInt64.prototype.isNegative=System.Int64.prototype.isNegative,System.UInt64.prototype.abs=System.Int64.prototype.abs,System.UInt64.prototype.compareTo=System.Int64.prototype.compareTo,System.UInt64.prototype.add=System.Int64.prototype.add,System.UInt64.prototype.sub=System.Int64.prototype.sub,System.UInt64.prototype.isZero=System.Int64.prototype.isZero,System.UInt64.prototype.mul=System.Int64.prototype.mul,System.UInt64.prototype.div=System.Int64.prototype.div,System.UInt64.prototype.toNumberDivided=System.Int64.prototype.toNumberDivided,System.UInt64.prototype.mod=System.Int64.prototype.mod,System.UInt64.prototype.neg=System.Int64.prototype.neg,System.UInt64.prototype.inc=System.Int64.prototype.inc,System.UInt64.prototype.dec=System.Int64.prototype.dec,System.UInt64.prototype.sign=System.Int64.prototype.sign,System.UInt64.prototype.clone=System.Int64.prototype.clone,System.UInt64.prototype.ne=System.Int64.prototype.ne,System.UInt64.prototype.neq=System.Int64.prototype.neq,System.UInt64.prototype.eq=System.Int64.prototype.eq,System.UInt64.prototype.lt=System.Int64.prototype.lt,System.UInt64.prototype.lte=System.Int64.prototype.lte,System.UInt64.prototype.gt=System.Int64.prototype.gt,System.UInt64.prototype.gte=System.Int64.prototype.gte,System.UInt64.prototype.equals=System.Int64.prototype.equals,System.UInt64.prototype.equalsT=System.Int64.prototype.equalsT,System.UInt64.prototype.getHashCode=System.Int64.prototype.getHashCode,System.UInt64.prototype.toNumber=System.Int64.prototype.toNumber,System.UInt64.parse=function(t){if(null==t)throw new System.ArgumentNullException("str");if(!/^[+-]?[0-9]+$/.test(t))throw new System.FormatException("Input string was not in a correct format.");var e=new System.UInt64(t);if(e.value.isNegative())throw new System.OverflowException;if(t!==e.toString())throw new System.OverflowException;return e},System.UInt64.tryParse=function(t,e){try{return null!=t&&/^[+-]?[0-9]+$/.test(t)?(e.v=new System.UInt64(t),e.v.isNegative()?(e.v=System.UInt64(Bridge.$Long.UZERO),!1):t===e.v.toString()||(e.v=System.UInt64(Bridge.$Long.UZERO),!1)):(e.v=System.UInt64(Bridge.$Long.UZERO),!1)}catch(t){return e.v=System.UInt64(Bridge.$Long.UZERO),!1}},System.UInt64.min=function(){for(var t,e=[],n=0,r=arguments.length;n<r;n++)e.push(System.UInt64.getValue(arguments[n]));for(n=0,t=e[0];++n<e.length;)e[n].lt(t)&&(t=e[n]);return new System.UInt64(t)},System.UInt64.max=function(){for(var t,e=[],n=0,r=arguments.length;n<r;n++)e.push(System.UInt64.getValue(arguments[n]));for(n=0,t=e[0];++n<e.length;)e[n].gt(t)&&(t=e[n]);return new System.UInt64(t)},System.UInt64.divRem=function(t,e,n){t=System.UInt64(t),e=System.UInt64(e);var r=t.mod(e);return n.v=r,t.sub(r).div(e)},System.UInt64.prototype.and=System.Int64.prototype.and,System.UInt64.prototype.not=System.Int64.prototype.not,System.UInt64.prototype.or=System.Int64.prototype.or,System.UInt64.prototype.shl=System.Int64.prototype.shl,System.UInt64.prototype.shr=System.Int64.prototype.shr,System.UInt64.prototype.shru=System.Int64.prototype.shru,System.UInt64.prototype.xor=System.Int64.prototype.xor,System.UInt64.Zero=System.UInt64(Bridge.$Long.UZERO),System.UInt64.MinValue=System.UInt64.Zero,System.UInt64.MaxValue=System.UInt64(Bridge.$Long.MAX_UNSIGNED_VALUE),System.UInt64.precision=20,function(t){function e(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;i>e;e++)r=t[e]+"",(n=At-r.length)&&(o+=g(n)),o+=r;s=t[e],(n=At-(r=s+"").length)&&(o+=g(n))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function n(t,e,n){if(t!==~~t||e>t||t>n)throw Error(vt+t)}function r(t,e,n,r){for(var i,o,s,a=t[0];a>=10;a/=10)--e;return--e<0?(e+=At,i=0):(i=Math.ceil((e+1)/At),e%=At),a=Bt(10,At-e),s=t[i]%a|0,null==r?3>e?(0==e?s=s/100|0:1==e&&(s=s/10|0),o=4>n&&99999==s||n>3&&49999==s||5e4==s||0==s):o=(4>n&&s+1==a||n>3&&s+1==a/2)&&(t[i+1]/a/100|0)==Bt(10,e-2)-1||(s==a/2||0==s)&&0==(t[i+1]/a/100|0):4>e?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),o=(r||4>n)&&9999==s||!r&&n>3&&4999==s):o=((r||4>n)&&s+1==a||!r&&n>3&&s+1==a/2)&&(t[i+1]/a/1e3|0)==Bt(10,e-3)-1,o}function i(t,e,n){for(var r,i,o=[0],s=0,a=t.length;a>s;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=ft.indexOf(t.charAt(s++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function o(t,e,n,r){var i,o,s,a,u,l,c,g,h,m=t.constructor;t:if(null!=e){if(!(g=t.d))return t;for(i=1,a=g[0];a>=10;a/=10)i++;if(0>(o=e-i))o+=At,s=e,u=(c=g[h=0])/Bt(10,i-s-1)%10|0;else if((h=Math.ceil((o+1)/At))>=(a=g.length)){if(!r)break t;for(;a++<=h;)g.push(0);c=u=0,i=1,s=(o%=At)-At+1}else{for(c=a=g[h],i=1;a>=10;a/=10)i++;u=0>(s=(o%=At)-At+i)?0:c/Bt(10,i-s-1)%10|0}if(r=r||0>e||void 0!==g[h+1]||(0>s?c:c%Bt(10,i-s-1)),l=4>n?(u||r)&&(0==n||n==(t.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?s>0?c/Bt(10,i-s):0:g[h-1])%10&1||n==(t.s<0?8:7)),1>e||!g[0])return g.length=0,l?(e-=t.e+1,g[0]=Bt(10,(At-e%At)%At),t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=h,a=1,h--):(g.length=h+1,a=Bt(10,At-o),g[h]=s>0?(c/Bt(10,i-s)%Bt(10,s)|0)*a:0),l)for(;;){if(0==h){for(o=1,s=g[0];s>=10;s/=10)o++;for(s=g[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,g[0]==Ot&&(g[0]=1));break}if(g[h]+=a,g[h]!=Ot)break;g[h--]=0,a=1}for(o=g.length;0===g[--o];)g.pop()}return Ct&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function s(t,n,r){if(!t.isFinite())return p(t);var i,o=t.e,s=e(t.d),a=s.length;return n?(r&&(i=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+g(i):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):0>o?(s="0."+g(-o-1)+s,r&&(i=r-a)>0&&(s+=g(i))):o>=a?(s+=g(o+1-a),r&&(i=r-o-1)>0&&(s=s+"."+g(i))):((i=o+1)<a&&(s=s.slice(0,i)+"."+s.slice(i)),r&&(i=r-a)>0&&(o+1===a&&(s+="."),s+=g(i))),s}function a(t,e){for(var n=1,r=t[0];r>=10;r/=10)n++;return n+e*At-1}function u(t,e,n){if(e>Tt)throw Ct=!0,n&&(t.precision=n),Error(wt);return o(new t(dt),e,1,!0)}function l(t,e,n){if(e>Lt)throw Error(wt);return o(new t(yt),e,n,!0)}function c(t){var e=t.length-1,n=e*At+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function g(t){for(var e="";t--;)e+="0";return e}function h(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/At+4);for(Ct=!1;;){if(n%2&&b((o=o.times(e)).d,s)&&(i=!0),0===(n=bt(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}b((e=e.times(e)).d,s)}return Ct=!0,o}function m(t){return 1&t.d[t.d.length-1]}function f(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;){if(!(r=new t(e[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function d(t,n){var i,s,a,u,l,c,g,h=0,m=0,f=0,d=t.constructor,y=d.rounding,p=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(Ct=!1,g=p):g=n,c=new d(.03125);t.e>-2;)t=t.times(c),f+=5;for(g+=s=Math.log(Bt(2,f))/Math.LN10*2+5|0,i=u=l=new d(1),d.precision=g;;){if(u=o(u.times(t),g,1),i=i.times(++m),e((c=l.plus(gt(u,i,g,1))).d).slice(0,g)===e(l.d).slice(0,g)){for(a=f;a--;)l=o(l.times(l),g,1);if(null!=n)return d.precision=p,l;if(!(3>h&&r(l.d,g-s,y,h)))return o(l,d.precision=p,y,Ct=!0);d.precision=g+=10,i=u=c=new d(1),m=0,h++}l=c}}function y(t,n){var i,s,a,l,c,g,h,m,f,d,p,S=1,C=t,x=C.d,v=C.constructor,w=v.rounding,b=v.precision;if(C.s<0||!x||!x[0]||!C.e&&1==x[0]&&1==x.length)return new v(x&&!x[0]?-1/0:1!=C.s?NaN:x?0:C);if(null==n?(Ct=!1,f=b):f=n,v.precision=f+=10,s=(i=e(x)).charAt(0),!(Math.abs(l=C.e)<15e14))return m=u(v,f+2,b).times(l+""),C=y(new v(s+"."+i.slice(1)),f-10).plus(m),v.precision=b,null==n?o(C,b,w,Ct=!0):C;for(;7>s&&1!=s||1==s&&i.charAt(1)>3;)s=(i=e((C=C.times(t)).d)).charAt(0),S++;for(l=C.e,s>1?(C=new v("0."+i),l++):C=new v(s+"."+i.slice(1)),d=C,h=c=C=gt(C.minus(1),C.plus(1),f,1),p=o(C.times(C),f,1),a=3;;){if(c=o(c.times(p),f,1),e((m=h.plus(gt(c,new v(a),f,1))).d).slice(0,f)===e(h.d).slice(0,f)){if(h=h.times(2),0!==l&&(h=h.plus(u(v,f+2,b).times(l+""))),h=gt(h,new v(S),f,1),null!=n)return v.precision=b,h;if(!r(h.d,f-10,w,g))return o(h,v.precision=b,w,Ct=!0);v.precision=f+=10,m=c=C=gt(d.minus(1),d.plus(1),f,1),p=o(C.times(C),f,1),a=g=1}h=m,a+=2}}function p(t){return String(t.s*t.s/0)}function S(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(0>n&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):0>n&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%At,0>n&&(r+=At),i>r){for(r&&t.d.push(+e.slice(0,r)),i-=At;i>r;)t.d.push(+e.slice(r,r+=At));e=e.slice(r),r=At-e.length}else r-=i;for(;r--;)e+="0";t.d.push(+e),Ct&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function C(t,e){var n,r,o,s,u,l,c,g,m;if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if($t.test(e))n=16,e=e.toLowerCase();else if(It.test(e))n=2;else{if(!_t.test(e))throw Error(vt+e);n=8}for((s=e.search(/p/i))>0?(c=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),u=(s=e.indexOf("."))>=0,r=t.constructor,u&&(s=(l=(e=e.replace(".","")).length)-s,o=h(r,new r(n),s,2*s)),s=m=(g=i(e,n,Ot)).length-1;0===g[s];--s)g.pop();return 0>s?new r(0*t.s):(t.e=a(g,m),t.d=g,Ct=!1,u&&(t=gt(t,o,4*l)),c&&(t=t.times(Math.abs(c)<54?Math.pow(2,c):pt.pow(2,c))),Ct=!0,t)}function x(t,e,n,r,i){var o,s,a,u,l=t.precision,c=Math.ceil(l/At);for(Ct=!1,u=n.times(n),a=new t(r);;){if(s=gt(a.times(u),new t(e++*e++),l,1),a=i?r.plus(s):r.minus(s),r=gt(s.times(u),new t(e++*e++),l,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return Ct=!0,s.d.length=c+1,s}function v(t,e){var n,r=e.s<0,i=l(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return ct=r?4:1,e;if((n=e.divToInt(i)).isZero())ct=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return ct=m(n)?r?2:3:r?4:1,e;ct=m(n)?r?1:4:r?3:2}return e.minus(i).abs()}function w(t,e,r,o){var a,u,l,c,g,h,m,f,d,y=t.constructor,S=void 0!==r;if(S?(n(r,1,mt),void 0===o?o=y.rounding:n(o,0,8)):(r=y.precision,o=y.rounding),t.isFinite()){for(S?(a=2,16==e?r=4*r-3:8==e&&(r=3*r-2)):a=e,(l=(m=s(t)).indexOf("."))>=0&&(m=m.replace(".",""),(d=new y(1)).e=m.length-l,d.d=i(s(d),10,a),d.e=d.d.length),u=g=(f=i(m,10,a)).length;0==f[--g];)f.pop();if(f[0]){if(0>l?u--:((t=new y(t)).d=f,t.e=u,f=(t=gt(t,d,r,o,0,a)).d,u=t.e,h=ut),l=f[r],c=a/2,h=h||void 0!==f[r+1],h=4>o?(void 0!==l||h)&&(0===o||o===(t.s<0?3:2)):l>c||l===c&&(4===o||h||6===o&&1&f[r-1]||o===(t.s<0?8:7)),f.length=r,h)for(;++f[--r]>a-1;)f[r]=0,r||(++u,f.unshift(1));for(g=f.length;!f[g-1];--g);for(l=0,m="";g>l;l++)m+=ft.charAt(f[l]);if(S){if(g>1)if(16==e||8==e){for(l=16==e?4:3,--g;g%l;g++)m+="0";for(g=(f=i(m,a,e)).length;!f[g-1];--g);for(l=1,m="1.";g>l;l++)m+=ft.charAt(f[l])}else m=m.charAt(0)+"."+m.slice(1);m=m+(0>u?"p":"p+")+u}else if(0>u){for(;++u;)m="0"+m;m="0."+m}else if(++u>g)for(u-=g;u--;)m+="0";else g>u&&(m=m.slice(0,u)+"."+m.slice(u))}else m=S?"0p+0":"0";m=(16==e?"0x":2==e?"0b":8==e?"0o":"")+m}else m=p(t);return t.s<0?"-"+m:m}function b(t,e){if(t.length>e)return t.length=e,!0}function B(t){return new this(t).abs()}function I(t){return new this(t).acos()}function $(t){return new this(t).acosh()}function _(t,e){return new this(t).plus(e)}function E(t){return new this(t).asin()}function O(t){return new this(t).asinh()}function A(t){return new this(t).atan()}function T(t){return new this(t).atanh()}function L(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?l(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=l(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(gt(t,e,o,1)),e=l(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(gt(t,e,o,1)):(n=l(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function R(t){return new this(t).cbrt()}function N(t){return o(t=new this(t),t.e+1,2)}function k(t){if(!t||"object"!=typeof t)throw Error(xt+"Object expected");for(var e,n,r=["precision",1,mt,"rounding",0,8,"toExpNeg",-ht,0,"toExpPos",0,ht,"maxE",0,ht,"minE",-ht,0,"modulo",0,9],i=0;i<r.length;i+=3)if(void 0!==(n=t[e=r[i]])){if(!(bt(n)===n&&n>=r[i+1]&&n<=r[i+2]))throw Error(vt+e+": "+n);this[e]=n}if(t.hasOwnProperty(e="crypto"))if(void 0===(n=t[e]))this[e]=n;else{if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(vt+e+": "+n);this[e]=!(!n||!St||!St.getRandomValues&&!St.randomBytes)}return this}function D(t){return new this(t).cos()}function P(t){return new this(t).cosh()}function M(t,e){return new this(t).div(e)}function G(t){return new this(t).exp()}function V(t){return o(t=new this(t),t.e+1,3)}function F(t){var e,n,r,o;if("string"!=typeof t||!t)throw Error(vt+t);if(r=t.length,o=ft.indexOf(t.charAt(0)),1===r)return new this(o>81?[-1/0,1/0,NaN][o-82]:o>40?-(o-41):o);if(64&o)e=(n=16&o)?(7&o)-3:(15&o)-7,r=1;else{if(2===r)return new this((o=88*o+ft.indexOf(t.charAt(1)))>=2816?-(o-2816)-41:o+41);if(n=32&o,!(31&o))return t=i(t.slice(1),88,10).join(""),new this(n?"-"+t:t);r=1+(e=15&o),e=1===e?ft.indexOf(t.charAt(1)):2===e?88*ft.indexOf(t.charAt(1))+ft.indexOf(t.charAt(2)):+i(t.slice(1,r),88,10).join(""),16&o&&(e=-e)}return t=(t=i(t.slice(r),88,10).join(""))+"e"+(e=e-t.length+1),new this(n?"-"+t:t)}function z(){var t,e,n=new this(0);for(Ct=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return Ct=!0,new this(1/0);n=e}return Ct=!0,n.sqrt()}function q(t){return new this(t).ln()}function H(t,e){return new this(t).log(e)}function U(t){return new this(t).log(2)}function j(t){return new this(t).log(10)}function W(){return f(this,arguments,"lt")}function Z(){return f(this,arguments,"gt")}function X(t,e){return new this(t).mod(e)}function K(t,e){return new this(t).mul(e)}function Y(t,e){return new this(t).pow(e)}function J(t){var e,r,i,o,s=0,a=new this(1),u=[];if(void 0===t?t=this.precision:n(t,1,mt),i=Math.ceil(t/At),!1===this.crypto)for(;i>s;)u[s++]=1e7*Math.random()|0;else if(St&&St.getRandomValues)for(e=St.getRandomValues(new Uint32Array(i));i>s;)(o=e[s])>=429e7?e[s]=St.getRandomValues(new Uint32Array(1))[0]:u[s++]=o%1e7;else if(St&&St.randomBytes){for(e=St.randomBytes(i*=4);i>s;)(o=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((127&e[s+3])<<24))>=214e7?St.randomBytes(4).copy(e,s):(u.push(o%1e7),s+=4);s=i/4}else{if(this.crypto)throw Error(xt+"crypto unavailable");for(;i>s;)u[s++]=1e7*Math.random()|0}for(i=u[--s],t%=At,i&&t&&(o=Bt(10,At-t),u[s]=(i/o|0)*o);0===u[s];s--)u.pop();if(0>s)r=0,u=[0];else{for(r=-1;0===u[0];r-=At)u.shift();for(i=1,o=u[0];o>=10;o/=10)i++;At>i&&(r-=At-i)}return a.e=r,a.d=u,a}function Q(t){return o(t=new this(t),t.e+1,this.rounding)}function tt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function et(t){return new this(t).sin()}function nt(t){return new this(t).sinh()}function rt(t){return new this(t).sqrt()}function it(t,e){return new this(t).sub(e)}function ot(t){return new this(t).tan()}function st(t){return new this(t).tanh()}function at(t){return o(t=new this(t),t.e+1,1)}var ut,lt,ct,gt,ht=9e15,mt=1e9,ft="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%()*+,-./:;=?@[]^_`{|}~",dt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",yt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",pt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:void 0},St="undefined"!=typeof crypto?crypto:null,Ct=!0,xt="[DecimalError] ",vt=xt+"Invalid argument: ",wt=xt+"Precision limit exceeded",bt=Math.floor,Bt=Math.pow,It=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$t=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,_t=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Et=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ot=1e7,At=7,Tt=dt.length-1,Lt=yt.length-1,Rt={};if(Rt.absoluteValue=Rt.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),o(t)},Rt.ceil=function(){return o(new this.constructor(this),this.e+1,2)},Rt.comparedTo=Rt.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,u=o.s,l=t.s;if(!s||!a)return u&&l?u!==l?u:s===a?0:!s^0>u?1:-1:NaN;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==t.e)return o.e>t.e^0>u?1:-1;for(r=s.length,e=0,n=(i=a.length)>r?r:i;n>e;++e)if(s[e]!==a[e])return s[e]>a[e]^0>u?1:-1;return r===i?0:r>i^0>u?1:-1},Rt.cosine=Rt.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+At,r.rounding=1,n=function(t,e){var n,r,i,o,s=e.d.length;for(32>s?(n=Math.ceil(s/3),r=Math.pow(4,-n).toString()):(n=16,r="2.3283064365386962890625e-10"),t.precision+=n,e=x(t,1,e.times(r),new t(1)),i=n;i--;)o=e.times(e),e=o.times(o).minus(o).times(8).plus(1);return t.precision-=n,e}(r,v(r,n)),r.precision=t,r.rounding=e,o(2==ct||3==ct?n.neg():n,t,e,!0)):new r(1):new r(NaN)},Rt.cubeRoot=Rt.cbrt=function(){var t,n,r,i,s,a,u,l,c,g,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(Ct=!1,(a=h.s*Math.pow(h.s*h,1/3))&&Math.abs(a)!=1/0?i=new m(a.toString()):(r=e(h.d),(a=((t=h.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=Math.pow(r,1/3),t=bt((t+1)/3)-(t%3==(0>t?-1:2)),(i=new m(r=a==1/0?"5e"+t:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+t)).s=h.s),u=(t=m.precision)+3;;)if(g=(c=(l=i).times(l).times(l)).plus(h),i=gt(g.plus(h).times(l),g.plus(c),u+2,1),e(l.d).slice(0,u)===(r=e(i.d)).slice(0,u)){if("9999"!=(r=r.slice(u-3,u+1))&&(s||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(o(i,t+1,1),n=!i.times(i).times(i).eq(h));break}if(!s&&(o(l,t+1,0),l.times(l).times(l).eq(h))){i=l;break}u+=4,s=1}return Ct=!0,o(i,t,m.rounding,n)},Rt.decimalPlaces=Rt.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=((t=e.length-1)-bt(this.e/At))*At,t=e[t])for(;t%10==0;t/=10)n--;0>n&&(n=0)}return n},Rt.dividedBy=Rt.div=function(t){return gt(this,new this.constructor(t))},Rt.dividedToIntegerBy=Rt.divToInt=function(t){var e=this.constructor;return o(gt(this,new e(t),0,1,1),e.precision,e.rounding)},Rt.equals=Rt.eq=function(t){return 0===this.cmp(t)},Rt.floor=function(){return o(new this.constructor(this),this.e+1,3)},Rt.greaterThan=Rt.gt=function(t){return this.cmp(t)>0},Rt.greaterThanOrEqualTo=Rt.gte=function(t){var e=this.cmp(t);return 1==e||0===e},Rt.hyperbolicCosine=Rt.cosh=function(){var t,e,n,r,i,s,a,u,l=this,c=l.constructor,g=new c(1);if(!l.isFinite())return new c(l.s?1/0:NaN);if(l.isZero())return g;for(n=c.precision,r=c.rounding,c.precision=n+Math.max(l.e,l.sd())+4,c.rounding=1,32>(i=l.d.length)?(t=Math.ceil(i/3),e=Math.pow(4,-t).toString()):(t=16,e="2.3283064365386962890625e-10"),l=x(c,1,l.times(e),new c(1),!0),a=t,u=new c(8);a--;)s=l.times(l),l=g.minus(s.times(u.minus(s.times(u))));return o(l,c.precision=n,c.rounding=r,!0)},Rt.hyperbolicSine=Rt.sinh=function(){var t,e,n,r,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,n=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,3>(r=i.d.length))i=x(s,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=x(s,2,i=i.times(Math.pow(5,-t)),i,!0);for(var a,u=new s(5),l=new s(16),c=new s(20);t--;)a=i.times(i),i=i.times(u.plus(a.times(l.times(a).plus(c))))}return s.precision=e,s.rounding=n,o(i,e,n,!0)},Rt.hyperbolicTangent=Rt.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,gt(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},Rt.inverseCosine=Rt.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?l(n,i,o):new n(0):new n(NaN):e.isZero()?l(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=l(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},Rt.inverseHyperbolicCosine=Rt.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Ct=!1,n=n.times(n).minus(1).sqrt().plus(n),Ct=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},Rt.inverseHyperbolicSine=Rt.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Ct=!1,n=n.times(n).plus(1).sqrt().plus(n),Ct=!0,r.precision=t,r.rounding=e,n.ln())},Rt.inverseHyperbolicTangent=Rt.atanh=function(){var t,e,n,r,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=s.precision,e=s.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?o(new s(i),t,e,!0):(s.precision=n=r-i.e,i=gt(i.plus(1),new s(1).minus(i),n+t,1),s.precision=t+4,s.rounding=1,i=i.ln(),s.precision=t,s.rounding=e,i.times(.5))):new s(NaN)},Rt.inverseSine=Rt.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=l(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},Rt.inverseTangent=Rt.atan=function(){var t,e,n,r,i,s,a,u,c,g=this,h=g.constructor,m=h.precision,f=h.rounding;if(g.isFinite()){if(g.isZero())return new h(g);if(g.abs().eq(1)&&Lt>=m+4)return(a=l(h,m+4,f).times(.25)).s=g.s,a}else{if(!g.s)return new h(NaN);if(Lt>=m+4)return(a=l(h,m+4,f).times(.5)).s=g.s,a}for(h.precision=u=m+10,h.rounding=1,t=n=Math.min(28,u/At+2|0);t;--t)g=g.div(g.times(g).plus(1).sqrt().plus(1));for(Ct=!1,e=Math.ceil(u/At),r=1,c=g.times(g),a=new h(g),i=g;-1!==t;)if(i=i.times(c),s=a.minus(i.div(r+=2)),i=i.times(c),void 0!==(a=s.plus(i.div(r+=2))).d[e])for(t=e;a.d[t]===s.d[t]&&t--;);return n&&(a=a.times(2<<n-1)),Ct=!0,o(a,h.precision=m,h.rounding=f,!0)},Rt.isFinite=function(){return!!this.d},Rt.isInteger=Rt.isInt=function(){return!!this.d&&bt(this.e/At)>this.d.length-2},Rt.isNaN=function(){return!this.s},Rt.isNegative=Rt.isNeg=function(){return this.s<0},Rt.isPositive=Rt.isPos=function(){return this.s>0},Rt.isZero=function(){return!!this.d&&0===this.d[0]},Rt.lessThan=Rt.lt=function(t){return this.cmp(t)<0},Rt.lessThanOrEqualTo=Rt.lte=function(t){return this.cmp(t)<1},Rt.logarithm=Rt.log=function(t){var n,i,s,a,l,c,g,h,m=this,f=m.constructor,d=f.precision,p=f.rounding;if(null==t)t=new f(10),n=!0;else{if(i=(t=new f(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new f(NaN);n=t.eq(10)}if(i=m.d,m.s<0||!i||!i[0]||m.eq(1))return new f(i&&!i[0]?-1/0:1!=m.s?NaN:i?0:1/0);if(n)if(i.length>1)l=!0;else{for(a=i[0];a%10==0;)a/=10;l=1!==a}if(Ct=!1,c=y(m,g=d+5),s=n?u(f,g+10):y(t,g),r((h=gt(c,s,g,1)).d,a=d,p))do{if(c=y(m,g+=10),s=n?u(f,g+10):y(t,g),h=gt(c,s,g,1),!l){+e(h.d).slice(a+1,a+15)+1==1e14&&(h=o(h,d+1,0));break}}while(r(h.d,a+=10,p));return Ct=!0,o(h,d,p)},Rt.minus=Rt.sub=function(t){var e,n,r,i,s,u,l,c,g,h,m,f,d=this,y=d.constructor;if(t=new y(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new y(t.d||d.s!==t.s?d:NaN):t=new y(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(g=d.d,f=t.d,l=y.precision,c=y.rounding,!g[0]||!f[0]){if(f[0])t.s=-t.s;else{if(!g[0])return new y(3===c?-0:0);t=new y(d)}return Ct?o(t,l,c):t}if(n=bt(t.e/At),h=bt(d.e/At),g=g.slice(),s=h-n){for((m=0>s)?(e=g,s=-s,u=f.length):(e=f,n=h,u=g.length),s>(r=Math.max(Math.ceil(l/At),u)+2)&&(s=r,e.length=1),e.reverse(),r=s;r--;)e.push(0);e.reverse()}else{for(r=g.length,(m=(u=f.length)>r)&&(u=r),r=0;u>r;r++)if(g[r]!=f[r]){m=g[r]<f[r];break}s=0}for(m&&(e=g,g=f,f=e,t.s=-t.s),u=g.length,r=f.length-u;r>0;--r)g[u++]=0;for(r=f.length;r>s;){if(g[--r]<f[r]){for(i=r;i&&0===g[--i];)g[i]=Ot-1;--g[i],g[r]+=Ot}g[r]-=f[r]}for(;0===g[--u];)g.pop();for(;0===g[0];g.shift())--n;return g[0]?(t.d=g,t.e=a(g,n),Ct?o(t,l,c):t):new y(3===c?-0:0)},Rt.modulo=Rt.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?o(new r(n),r.precision,r.rounding):(Ct=!1,9==r.modulo?(e=gt(n,t.abs(),0,3,1)).s*=t.s:e=gt(n,t,0,r.modulo,1),e=e.times(t),Ct=!0,n.minus(e))},Rt.naturalExponential=Rt.exp=function(){return d(this)},Rt.naturalLogarithm=Rt.ln=function(){return y(this)},Rt.negated=Rt.neg=function(){var t=new this.constructor(this);return t.s=-t.s,o(t)},Rt.plus=Rt.add=function(t){var e,n,r,i,s,u,l,c,g,h,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d||(t=new f(t.d||m.s===t.s?m:NaN)):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.minus(t);if(g=m.d,h=t.d,l=f.precision,c=f.rounding,!g[0]||!h[0])return h[0]||(t=new f(m)),Ct?o(t,l,c):t;if(s=bt(m.e/At),r=bt(t.e/At),g=g.slice(),i=s-r){for(0>i?(n=g,i=-i,u=h.length):(n=h,r=s,u=g.length),i>(u=(s=Math.ceil(l/At))>u?s+1:u+1)&&(i=u,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(0>(u=g.length)-(i=h.length)&&(i=u,n=h,h=g,g=n),e=0;i;)e=(g[--i]=g[i]+h[i]+e)/Ot|0,g[i]%=Ot;for(e&&(g.unshift(e),++r),u=g.length;0==g[--u];)g.pop();return t.d=g,t.e=a(g,r),Ct?o(t,l,c):t},Rt.precision=Rt.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(vt+t);return n.d?(e=c(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},Rt.round=function(){var t=this,e=t.constructor;return o(new e(t),t.e+1,e.rounding)},Rt.sine=Rt.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+At,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(3>r)return x(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=x(t,2,e=e.times(Math.pow(5,-n)),e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}(r,v(r,n)),r.precision=t,r.rounding=e,o(ct>2?n.neg():n,t,e,!0)):new r(NaN)},Rt.squareRoot=Rt.sqrt=function(){var t,n,r,i,s,a,u=this,l=u.d,c=u.e,g=u.s,h=u.constructor;if(1!==g||!l||!l[0])return new h(!g||0>g&&(!l||l[0])?NaN:l?u:1/0);for(Ct=!1,0==(g=Math.sqrt(+u))||g==1/0?(((n=e(l)).length+c)%2==0&&(n+="0"),g=Math.sqrt(n),c=bt((c+1)/2)-(0>c||c%2),i=new h(n=g==1/0?"1e"+c:(n=g.toExponential()).slice(0,n.indexOf("e")+1)+c)):i=new h(g.toString()),r=(c=h.precision)+3;;)if(i=(a=i).plus(gt(u,a,r+2,1)).times(.5),e(a.d).slice(0,r)===(n=e(i.d)).slice(0,r)){if("9999"!=(n=n.slice(r-3,r+1))&&(s||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(o(i,c+1,1),t=!i.times(i).eq(u));break}if(!s&&(o(a,c+1,0),a.times(a).eq(u))){i=a;break}r+=4,s=1}return Ct=!0,o(i,c,h.rounding,t)},Rt.tangent=Rt.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=gt(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,o(2==ct||4==ct?n.neg():n,t,e,!0)):new r(NaN)},Rt.times=Rt.mul=function(t){var e,n,r,i,s,u,l,c,g,h=this,m=h.constructor,f=h.d,d=(t=new m(t)).d;if(t.s*=h.s,!(f&&f[0]&&d&&d[0]))return new m(!t.s||f&&!f[0]&&!d||d&&!d[0]&&!f?NaN:f&&d?0*t.s:t.s/0);for(n=bt(h.e/At)+bt(t.e/At),c=f.length,(g=d.length)>c&&(s=f,f=d,d=s,u=c,c=g,g=u),s=[],r=u=c+g;r--;)s.push(0);for(r=g;--r>=0;){for(e=0,i=c+r;i>r;)l=s[i]+d[r]*f[i-r-1]+e,s[i--]=l%Ot|0,e=l/Ot|0;s[i]=(s[i]+e)%Ot|0}for(;!s[--u];)s.pop();for(e?++n:s.shift(),r=s.length;!s[--r];)s.pop();return t.d=s,t.e=a(s,n),Ct?o(t,m.precision,m.rounding):t},Rt.toBinary=function(t,e){return w(this,2,t,e)},Rt.toDecimalPlaces=Rt.toDP=function(t,e){var r=this,i=r.constructor;return r=new i(r),void 0===t?r:(n(t,0,mt),void 0===e?e=i.rounding:n(e,0,8),o(r,t+r.e+1,e))},Rt.toExponential=function(t,e){var r,i=this,a=i.constructor;return void 0===t?r=s(i,!0):(n(t,0,mt),void 0===e?e=a.rounding:n(e,0,8),r=s(i=o(new a(i),t+1,e),!0,t+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Rt.toFixed=function(t,e){var r,i,a=this,u=a.constructor;return void 0===t?r=s(a):(n(t,0,mt),void 0===e?e=u.rounding:n(e,0,8),r=s(i=o(new u(a),t+a.e+1,e),!1,t+i.e+1)),a.isNeg()&&!a.isZero()?"-"+r:r},Rt.toFraction=function(t){var n,r,i,o,s,a,u,l,g,h,m,f,d=this,y=d.d,p=d.constructor;if(!y)return new p(d);if(g=r=new p(1),i=l=new p(0),a=(s=(n=new p(i)).e=c(y)-d.e-1)%At,n.d[0]=Bt(10,0>a?At+a:a),null==t)t=s>0?n:g;else{if(!(u=new p(t)).isInt()||u.lt(g))throw Error(vt+u);t=u.gt(n)?s>0?n:g:u}for(Ct=!1,u=new p(e(y)),h=p.precision,p.precision=s=y.length*At*2;m=gt(u,n,0,1,1),1!=(o=r.plus(m.times(i))).cmp(t);)r=i,i=o,o=g,g=l.plus(m.times(o)),l=o,o=n,n=u.minus(m.times(o)),u=o;return o=gt(t.minus(r),i,0,1,1),l=l.plus(o.times(g)),r=r.plus(o.times(i)),l.s=g.s=d.s,f=gt(g,i,s,1).minus(d).abs().cmp(gt(l,r,s,1).minus(d).abs())<1?[g,i]:[l,r],p.precision=h,Ct=!0,f},Rt.toHexadecimal=Rt.toHex=function(t,e){return w(this,16,t,e)},Rt.toJSON=function(){var t,n,r,o,s,a,u,l,c=this,g=c.s<0;if(!c.d)return ft.charAt(c.s?g?82:83:84);if(n=c.e,1===c.d.length&&4>n&&n>=0&&2857>(a=c.d[0]))return 41>a?ft.charAt(g?a+41:a):(a-=41,g&&(a+=2816),o=a/88|0,ft.charAt(o)+ft.charAt(a-88*o));if(l=e(c.d),u="",!g&&8>=n&&n>=-7)o=64+n+7;else if(g&&4>=n&&n>=-3)o=80+n+3;else if(l.length===n+1)o=32*g;else if(o=32*g+16*(0>n),88>(n=Math.abs(n)))o+=1,u=ft.charAt(n);else if(7744>n)o+=2,a=n/88|0,u=ft.charAt(a)+ft.charAt(n-88*a);else for(o+=s=(t=i(String(n),10,88)).length,r=0;s>r;r++)u+=ft.charAt(t[r]);for(u=ft.charAt(o)+u,s=(t=i(l,10,88)).length,r=0;s>r;r++)u+=ft.charAt(t[r]);return u},Rt.toNearest=function(t,e){var r=this,i=r.constructor;if(r=new i(r),null==t){if(!r.d)return r;t=new i(1),e=i.rounding}else{if(t=new i(t),void 0!==e&&n(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(Ct=!1,4>e&&(e=[4,5,7,8][e]),r=gt(r,t,0,e,1).times(t),Ct=!0,o(r)):(t.s=r.s,r=t),r},Rt.toNumber=function(){return+this},Rt.toOctal=function(t,e){return w(this,8,t,e)},Rt.toPower=Rt.pow=function(t){var n,i,s,a,u,l,c,g=this,m=g.constructor,f=+(t=new m(t));if(!(g.d&&t.d&&g.d[0]&&t.d[0]))return new m(Bt(+g,f));if((g=new m(g)).eq(1))return g;if(s=m.precision,u=m.rounding,t.eq(1))return o(g,s,u);if(c=(n=bt(t.e/At))>=(i=t.d.length-1),l=g.s,c){if((i=0>f?-f:f)<=9007199254740991)return a=h(m,g,i,s),t.s<0?new m(1).div(a):o(a,s,u)}else if(0>l)return new m(NaN);return l=0>l&&1&t.d[Math.max(n,i)]?-1:1,(n=0!=(i=Bt(+g,f))&&isFinite(i)?new m(i+"").e:bt(f*(Math.log("0."+e(g.d))/Math.LN10+g.e+1)))>m.maxE+1||n<m.minE-1?new m(n>0?l/0:0):(Ct=!1,m.rounding=g.s=1,i=Math.min(12,(n+"").length),r((a=o(a=d(t.times(y(g,s+i)),s),s+5,1)).d,s,u)&&(n=s+10,+e((a=o(d(t.times(y(g,n+i)),n),n+5,1)).d).slice(s+1,s+15)+1==1e14&&(a=o(a,s+1,0))),a.s=l,Ct=!0,m.rounding=u,o(a,s,u))},Rt.toPrecision=function(t,e){var r,i=this,a=i.constructor;return void 0===t?r=s(i,i.e<=a.toExpNeg||i.e>=a.toExpPos):(n(t,1,mt),void 0===e?e=a.rounding:n(e,0,8),r=s(i=o(new a(i),t,e),t<=i.e||i.e<=a.toExpNeg,t)),i.isNeg()&&!i.isZero()?"-"+r:r},Rt.toSignificantDigits=Rt.toSD=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(n(t,1,mt),void 0===e?e=r.rounding:n(e,0,8)),o(new r(this),t,e)},Rt.toString=function(){var t=this,e=t.constructor,n=s(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},Rt.truncated=Rt.trunc=function(){return o(new this.constructor(this),this.e+1,1)},Rt.valueOf=function(){var t=this,e=t.constructor,n=s(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n},gt=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;n>i;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,s,a,u,l){var c,g,h,m,f,d,y,p,S,C,x,v,w,b,B,I,$,_,E,O,A=r.constructor,T=r.s==i.s?1:-1,L=r.d,R=i.d;if(!(L&&L[0]&&R&&R[0]))return new A(r.s&&i.s&&(L?!R||L[0]!=R[0]:R)?L&&0==L[0]||!R?0*T:T/0:NaN);for(l?(f=1,g=r.e-i.e):(l=Ot,f=At,g=bt(r.e/f)-bt(i.e/f)),E=R.length,$=L.length,C=(S=new A(T)).d=[],h=0;R[h]==(L[h]||0);h++);if(R[h]>(L[h]||0)&&g--,null==s?(b=s=A.precision,a=A.rounding):b=u?s+(r.e-i.e)+1:s,0>b)C.push(1),d=!0;else{if(b=b/f+2|0,h=0,1==E){for(m=0,R=R[0],b++;($>h||m)&&b--;h++)B=m*l+(L[h]||0),C[h]=B/R|0,m=B%R|0;d=m||$>h}else{for((m=l/(R[0]+1)|0)>1&&(R=t(R,m,l),L=t(L,m,l),E=R.length,$=L.length),I=E,v=(x=L.slice(0,E)).length;E>v;)x[v++]=0;(O=R.slice()).unshift(0),_=R[0],R[1]>=l/2&&++_;do{m=0,0>(c=e(R,x,E,v))?(w=x[0],E!=v&&(w=w*l+(x[1]||0)),(m=w/_|0)>1?(m>=l&&(m=l-1),1==(c=e(y=t(R,m,l),x,p=y.length,v=x.length))&&(m--,n(y,p>E?O:R,p,l))):(0==m&&(c=m=1),y=R.slice()),v>(p=y.length)&&y.unshift(0),n(x,y,v,l),-1==c&&1>(c=e(R,x,E,v=x.length))&&(m++,n(x,v>E?O:R,v,l)),v=x.length):0===c&&(m++,x=[0]),C[h++]=m,c&&x[0]?x[v++]=L[I]||0:(x=[L[I]],v=1)}while((I++<$||void 0!==x[0])&&b--);d=void 0!==x[0]}C[0]||C.shift()}if(1==f)S.e=g,ut=d;else{for(h=1,m=C[0];m>=10;m/=10)h++;S.e=h+g*f-1,o(S,u?s+S.e+1:s,a,d)}return S}}(),pt=function t(e){function n(t){var e,r,i,o=this;if(!(o instanceof n))return new n(t);if(o.constructor=n,t instanceof n)return o.s=t.s,o.e=t.e,void(o.d=(t=t.d)?t.slice():t);if("number"==(i=typeof t)){if(0===t)return o.s=0>1/t?-1:1,o.e=0,void(o.d=[0]);if(0>t?(t=-t,o.s=-1):o.s=1,t===~~t&&1e7>t){for(e=0,r=t;r>=10;r/=10)e++;return o.e=e,void(o.d=[t])}return 0*t!=0?(t||(o.s=NaN),o.e=NaN,void(o.d=null)):S(o,t.toString())}if("string"!==i)throw Error(vt+t);return 45===t.charCodeAt(0)?(t=t.slice(1),o.s=-1):o.s=1,Et.test(t)?S(o,t):C(o,t)}var r,i,o;if(n.prototype=Rt,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=k,n.clone=t,n.abs=B,n.acos=I,n.acosh=$,n.add=_,n.asin=E,n.asinh=O,n.atan=A,n.atanh=T,n.atan2=L,n.cbrt=R,n.ceil=N,n.cos=D,n.cosh=P,n.div=M,n.exp=G,n.floor=V,n.fromJSON=F,n.hypot=z,n.ln=q,n.log=H,n.log10=j,n.log2=U,n.max=W,n.min=Z,n.mod=X,n.mul=K,n.pow=Y,n.random=J,n.round=Q,n.sign=tt,n.sin=et,n.sinh=nt,n.sqrt=rt,n.sub=it,n.tan=ot,n.tanh=st,n.trunc=at,void 0===e&&(e={}),e)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<o.length;)e.hasOwnProperty(i=o[r++])||(e[i]=this[i]);return n.config(e),n}(pt),dt=new pt(dt),yt=new pt(yt),Bridge.$Decimal=pt,"function"==typeof define&&define.amd)define((function(){return pt}));else if("undefined"!=typeof module&&module.exports){if(module.exports=pt,!St)try{St=require("crypto")}catch(t){}}else t||(t="undefined"!=typeof self&&self&&self.self==self?self:Function("return this")()),lt=t.Decimal,pt.noConflict=function(){return t.Decimal=lt,pt},t.Decimal=pt}(Bridge.global),System.Decimal=function(t,e,n){var r;if(this.constructor!==System.Decimal)return new System.Decimal(t,e,n);if(null==t&&(t=0),"string"==typeof t){if((r=(e=e||System.Globalization.CultureInfo.getCurrentCulture())&&e.getFormat(System.Globalization.NumberFormatInfo))&&"."!==r.numberDecimalSeparator&&(t=t.replace(r.numberDecimalSeparator,".")),!/^\s*[+-]?(\d+|\d+.|\d*\.\d+)((e|E)[+-]?\d+)?\s*$/.test(t))throw new System.FormatException;t=t.replace(/\s/g,"")}if(n&&n.precision&&"number"==typeof t){var i=(Bridge.Int.trunc(t)+"").length,o=n.precision-i;o<0&&(o=0),t=t.toFixed(o)}this.value=System.Decimal.getValue(t)},System.Decimal.$$name="System.Decimal",System.Decimal.prototype.$$name="System.Decimal",System.Decimal.$kind="struct",System.Decimal.prototype.$kind="struct",System.Decimal.$$inherits=[],Bridge.Class.addExtend(System.Decimal,[System.IComparable,System.IFormattable,System.IComparable$1(System.Decimal),System.IEquatable$1(System.Decimal)]),System.Decimal.$is=function(t){return t instanceof System.Decimal},System.Decimal.getDefaultValue=function(){return new System.Decimal(0)},System.Decimal.getValue=function(t){return Bridge.hasValue(t)?t instanceof System.Decimal?t.value:t instanceof System.Int64||t instanceof System.UInt64?new Bridge.$Decimal(t.toString()):new Bridge.$Decimal(t):this.getDefaultValue()},System.Decimal.create=function(t){return Bridge.hasValue(t)?t instanceof System.Decimal?t:new System.Decimal(t):null},System.Decimal.lift=function(t){return null==t?null:System.Decimal.create(t)},System.Decimal.prototype.toString=function(t,e){return t||e?Bridge.Int.format(this,t,e):this.value.toString()},System.Decimal.prototype.toFloat=function(){return this.value.toNumber()},System.Decimal.prototype.toJSON=function(){return this.value.toNumber()},System.Decimal.prototype.format=function(t,e){return Bridge.Int.format(this.toFloat(),t,e)},System.Decimal.prototype.decimalPlaces=function(){return this.value.decimalPlaces()},System.Decimal.prototype.dividedToIntegerBy=function(t){return new System.Decimal(this.value.dividedToIntegerBy(System.Decimal.getValue(t)))},System.Decimal.prototype.exponential=function(){return new System.Decimal(this.value.exponential())},System.Decimal.prototype.abs=function(){return new System.Decimal(this.value.abs())},System.Decimal.prototype.floor=function(){return new System.Decimal(this.value.floor())},System.Decimal.prototype.ceil=function(){return new System.Decimal(this.value.ceil())},System.Decimal.prototype.trunc=function(){return new System.Decimal(this.value.trunc())},System.Decimal.round=function(t,e){var n,r;return t=System.Decimal.create(t),n=Bridge.$Decimal.rounding,Bridge.$Decimal.rounding=e,r=new System.Decimal(t.value.round()),Bridge.$Decimal.rounding=n,r},System.Decimal.toDecimalPlaces=function(t,e,n){return t=System.Decimal.create(t),new System.Decimal(t.value.toDecimalPlaces(e,n))},System.Decimal.prototype.compareTo=function(t){return this.value.comparedTo(System.Decimal.getValue(t))},System.Decimal.prototype.add=function(t){return new System.Decimal(this.value.plus(System.Decimal.getValue(t)))},System.Decimal.prototype.sub=function(t){return new System.Decimal(this.value.minus(System.Decimal.getValue(t)))},System.Decimal.prototype.isZero=function(){return this.value.isZero},System.Decimal.prototype.mul=function(t){return new System.Decimal(this.value.times(System.Decimal.getValue(t)))},System.Decimal.prototype.div=function(t){return new System.Decimal(this.value.dividedBy(System.Decimal.getValue(t)))},System.Decimal.prototype.mod=function(t){return new System.Decimal(this.value.modulo(System.Decimal.getValue(t)))},System.Decimal.prototype.neg=function(){return new System.Decimal(this.value.negated())},System.Decimal.prototype.inc=function(){return new System.Decimal(this.value.plus(System.Decimal.getValue(1)))},System.Decimal.prototype.dec=function(){return new System.Decimal(this.value.minus(System.Decimal.getValue(1)))},System.Decimal.prototype.sign=function(){return this.value.isZero()?0:this.value.isNegative()?-1:1},System.Decimal.prototype.clone=function(){return new System.Decimal(this)},System.Decimal.prototype.ne=function(t){return!!this.compareTo(t)},System.Decimal.prototype.lt=function(t){return this.compareTo(t)<0},System.Decimal.prototype.lte=function(t){return this.compareTo(t)<=0},System.Decimal.prototype.gt=function(t){return this.compareTo(t)>0},System.Decimal.prototype.gte=function(t){return this.compareTo(t)>=0},System.Decimal.prototype.equals=function(t){return!this.compareTo(t)},System.Decimal.prototype.equalsT=function(t){return!this.compareTo(t)},System.Decimal.prototype.getHashCode=function(){for(var t=397*this.sign()+this.value.e|0,e=0;e<this.value.d.length;e++)t=397*t+this.value.d[e]|0;return t},System.Decimal.toInt=function(t,e){var n,r,i;if(!t)return null;if(e){if(e===System.Int64){if((n=t.value.trunc().toString())!==(r=new System.Int64(n)).value.toString())throw new System.OverflowException;return r}if(e===System.UInt64){if(t.value.isNegative())throw new System.OverflowException;if((n=t.value.trunc().toString())!==(r=new System.UInt64(n)).value.toString())throw new System.OverflowException;return r}return Bridge.Int.check(Bridge.Int.trunc(t.value.toNumber()),e)}if(i=Bridge.Int.trunc(System.Decimal.getValue(t).toNumber()),!Bridge.Int.$is(i))throw new System.OverflowException;return i},System.Decimal.tryParse=function(t,e,n){try{return n.v=new System.Decimal(t,e),!0}catch(t){return n.v=new System.Decimal(0),!1}},System.Decimal.toFloat=function(t){return t?System.Decimal.getValue(t).toNumber():null},System.Decimal.setConfig=function(t){Bridge.$Decimal.config(t)},System.Decimal.min=function(){for(var t=[],e=0,n=arguments.length;e<n;e++)t.push(System.Decimal.getValue(arguments[e]));return new System.Decimal(Bridge.$Decimal.min.apply(Bridge.$Decimal,t))},System.Decimal.max=function(){for(var t=[],e=0,n=arguments.length;e<n;e++)t.push(System.Decimal.getValue(arguments[e]));return new System.Decimal(Bridge.$Decimal.max.apply(Bridge.$Decimal,t))},System.Decimal.random=function(t){return new System.Decimal(Bridge.$Decimal.random(t))},System.Decimal.exp=function(t){return new System.Decimal(System.Decimal.getValue(t).exp())},System.Decimal.exp=function(t){return new System.Decimal(System.Decimal.getValue(t).exp())},System.Decimal.ln=function(t){return new System.Decimal(System.Decimal.getValue(t).ln())},System.Decimal.log=function(t,e){return new System.Decimal(System.Decimal.getValue(t).log(e))},System.Decimal.pow=function(t,e){return new System.Decimal(System.Decimal.getValue(t).pow(e))},System.Decimal.sqrt=function(t){return new System.Decimal(System.Decimal.getValue(t).sqrt())},System.Decimal.prototype.isFinite=function(){return this.value.isFinite()},System.Decimal.prototype.isInteger=function(){return this.value.isInteger()},System.Decimal.prototype.isNaN=function(){return this.value.isNaN()},System.Decimal.prototype.isNegative=function(){return this.value.isNegative()},System.Decimal.prototype.isZero=function(){return this.value.isZero()},System.Decimal.prototype.log=function(t){return new System.Decimal(this.value.log(t))},System.Decimal.prototype.ln=function(){return new System.Decimal(this.value.ln())},System.Decimal.prototype.precision=function(){return this.value.precision()},System.Decimal.prototype.round=function(){var t,e=Bridge.$Decimal.rounding;return Bridge.$Decimal.rounding=6,t=new System.Decimal(this.value.round()),Bridge.$Decimal.rounding=e,t},System.Decimal.prototype.sqrt=function(){return new System.Decimal(this.value.sqrt())},System.Decimal.prototype.toDecimalPlaces=function(t,e){return new System.Decimal(this.value.toDecimalPlaces(t,e))},System.Decimal.prototype.toExponential=function(t,e){return this.value.toExponential(t,e)},System.Decimal.prototype.toFixed=function(t,e){return this.value.toFixed(t,e)},System.Decimal.prototype.pow=function(t){return new System.Decimal(this.value.pow(t))},System.Decimal.prototype.toPrecision=function(t,e){return this.value.toPrecision(t,e)},System.Decimal.prototype.toSignificantDigits=function(t,e){return new System.Decimal(this.value.toSignificantDigits(t,e))},System.Decimal.prototype.valueOf=function(){return this.value.valueOf()},System.Decimal.prototype.toFormat=function(t,e,n){var r,i,o,s=Bridge.$Decimal.format;return n&&!n.getFormat?(i=Bridge.merge({},s||{}),Bridge.$Decimal.format=Bridge.merge(i,n),r=this.value.toFormat(t,e)):((o=(n=n||System.Globalization.CultureInfo.getCurrentCulture())&&n.getFormat(System.Globalization.NumberFormatInfo))&&(Bridge.$Decimal.format.decimalSeparator=o.numberDecimalSeparator,Bridge.$Decimal.format.groupSeparator=o.numberGroupSeparator,Bridge.$Decimal.format.groupSize=o.numberGroupSizes[0]),r=this.value.toFormat(t,e)),Bridge.$Decimal.format=s,r},Bridge.$Decimal.config({precision:29}),System.Decimal.Zero=System.Decimal(0),System.Decimal.One=System.Decimal(1),System.Decimal.MinusOne=System.Decimal(-1),System.Decimal.MinValue=System.Decimal("-79228162514264337593543950335"),System.Decimal.MaxValue=System.Decimal("79228162514264337593543950335"),System.Decimal.precision=29,Bridge.define("System.DayOfWeek",{$kind:"enum",$statics:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6}}),a={getDefaultValue:function(){return new Date(-864e13)},utcNow:function(){var t=new Date;return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())},today:function(){var t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate())},timeOfDay:function(t){return new System.TimeSpan(1e4*(t-new Date(t.getFullYear(),t.getMonth(),t.getDate())))},isUseGenitiveForm:function(t,e,n,r){for(var i=0,o=e-1;o>=0&&t[o]!==r;o--);if(o>=0){for(;--o>=0&&t[o]===r;)i++;if(i<=1)return!0}for(o=e+n;o<t.length&&t[o]!==r;o++);if(o<t.length){for(i=0;++o<t.length&&t[o]===r;)i++;if(i<=1)return!0}return!1},format:function(t,e,n){var r,i=this,o=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),s=t.getFullYear(),a=t.getMonth(),u=t.getDate(),l=t.getDay(),c=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),m=t.getMilliseconds(),f=t.getTimezoneOffset();return 1===(e=e||"G").length?(r=o.getAllDateTimePatterns(e,!0),e=r?r[0]:e):2===e.length&&"%"===e.charAt(0)&&(e=e.charAt(1)),e.replace(/(\\.|'[^']*'|"[^"]*"|d{1,4}|M{1,4}|yyyy|yy|y|HH?|hh?|mm?|ss?|tt?|f{1,3}|z{1,3}|\:|\/)/g,(function(t,n,r){var d=t;switch(t){case"dddd":d=o.dayNames[l];break;case"ddd":d=o.abbreviatedDayNames[l];break;case"dd":d=u<10?"0"+u:u;break;case"d":d=u;break;case"MMMM":d=i.isUseGenitiveForm(e,r,4,"d")?o.monthGenitiveNames[a]:o.monthNames[a];break;case"MMM":d=i.isUseGenitiveForm(e,r,3,"d")?o.abbreviatedMonthGenitiveNames[a]:o.abbreviatedMonthNames[a];break;case"MM":d=a+1<10?"0"+(a+1):a+1;break;case"M":d=a+1;break;case"yyyy":d=s;break;case"yy":1===(d=(s%100).toString()).length&&(d="0"+d);break;case"y":d=s%100;break;case"h":case"hh":(d=c%12)?"hh"===t&&1===d.length&&(d="0"+d):d="12";break;case"HH":1===(d=c.toString()).length&&(d="0"+d);break;case"H":d=c;break;case"mm":1===(d=g.toString()).length&&(d="0"+d);break;case"m":d=g;break;case"ss":1===(d=h.toString()).length&&(d="0"+d);break;case"s":d=h;break;case"t":case"tt":d=c<12?o.amDesignator:o.pmDesignator,"t"===t&&(d=d.charAt(0));break;case"f":case"ff":case"fff":(d=m.toString()).length<3&&(d=Array(3-d.length).join("0")+d),"ff"===t?d=d.substr(0,2):"f"===t&&(d=d.charAt(0));break;case"z":d=((d=f/60)>=0?"-":"+")+Math.floor(Math.abs(d));break;case"zz":case"zzz":d=((d=f/60)>=0?"-":"+")+System.String.alignString(Math.floor(Math.abs(d)).toString(),2,"0",2),"zzz"===t&&(d+=o.timeSeparator+System.String.alignString(Math.floor(Math.abs(f%60)).toString(),2,"0",2));break;case":":d=o.timeSeparator;break;case"/":d=o.dateSeparator;break;default:d=t.substr(1,t.length-1-("\\"!==t.charAt(0)))}return d}))},parse:function(t,e,n,r){var i=this.parseExact(t,null,e,n,!0);if(null!==i)return i;if(i=Date.parse(t),!isNaN(i))return new Date(i);if(!r)throw new System.FormatException("String does not contain a valid string representation of a date and time.")},parseExact:function(t,e,n,r,i){var o,s;if(e||(e=["G","g","F","f","D","d","R","r","s","S","U","u","O","o","Y","y","M","m","T","t"]),Bridge.isArray(e)){for(o=0;o<e.length;o++)if(null!=(s=Bridge.Date.parseExact(t,e[o],n,r,!0)))return s;if(i)return null;throw new System.FormatException("String does not contain a valid string representation of a date and time.")}var a,u,l,c,g,h,m,f,d,y=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),p=y.amDesignator,S=y.pmDesignator,C=0,x=0,v=0,w=0,b=1,B=1,I=0,$=0,_=0,E=0,O="",A=0,T=0,L=!1,R=!1;if(null==t)throw new System.ArgumentNullException("str");for(1===(e=e||"G").length?e=(d=y.getAllDateTimePatterns(e,!0))?d[0]:e:2===e.length&&"%"===e.charAt(0)&&(e=e.charAt(1));x<e.length;){if(a=e.charAt(x),u="","\\"===R)u+=a,x++;else for(;e.charAt(x)===a&&x<e.length;)u+=a,x++;if(f=!0,!R)if("yyyy"===u||"yy"===u||"y"===u){if("yyyy"===u?w=this.subparseInt(t,C,4,4):"yy"===u?w=this.subparseInt(t,C,2,2):"y"===u&&(w=this.subparseInt(t,C,2,4)),null==w){L=!0;break}C+=w.length,2===w.length&&(w=((w=~~w)>30?1900:2e3)+w)}else if("MMM"===u||"MMMM"===u){for(b=0,h="MMM"===u?this.isUseGenitiveForm(e,x,3,"d")?y.abbreviatedMonthGenitiveNames:y.abbreviatedMonthNames:this.isUseGenitiveForm(e,x,4,"d")?y.monthGenitiveNames:y.monthNames,v=0;v<h.length;v++)if(m=h[v],t.substring(C,C+m.length).toLowerCase()===m.toLowerCase()){b=v%12+1,C+=m.length;break}if(b<1||b>12){L=!0;break}}else if("MM"===u||"M"===u){if(null==(b=this.subparseInt(t,C,u.length,2))||b<1||b>12){L=!0;break}C+=b.length}else if("dddd"===u||"ddd"===u){for(h="ddd"===u?y.abbreviatedDayNames:y.dayNames,v=0;v<h.length;v++)if(m=h[v],t.substring(C,C+m.length).toLowerCase()===m.toLowerCase()){C+=m.length;break}}else if("dd"===u||"d"===u){if(null==(B=this.subparseInt(t,C,u.length,2))||B<1||B>31){L=!0;break}C+=B.length}else if("hh"===u||"h"===u){if(null==(I=this.subparseInt(t,C,u.length,2))||I<1||I>12){L=!0;break}C+=I.length}else if("HH"===u||"H"===u){if(null==(I=this.subparseInt(t,C,u.length,2))||I<0||I>23){L=!0;break}C+=I.length}else if("mm"===u||"m"===u){if(null==($=this.subparseInt(t,C,u.length,2))||$<0||$>59)return null;C+=$.length}else if("ss"===u||"s"===u){if(null==(_=this.subparseInt(t,C,u.length,2))||_<0||_>59){L=!0;break}C+=_.length}else if("u"===u){if(null==(E=this.subparseInt(t,C,1,7))){L=!0;break}C+=E.length,E.length>3&&(E=E.substring(0,3))}else if("fffffff"===u||"ffffff"===u||"fffff"===u||"ffff"===u||"fff"===u||"ff"===u||"f"===u){if(null==(E=this.subparseInt(t,C,u.length,7))){L=!0;break}C+=E.length,E.length>3&&(E=E.substring(0,3))}else if("t"===u){if(t.substring(C,C+1).toLowerCase()===p.charAt(0).toLowerCase())O=p;else{if(t.substring(C,C+1).toLowerCase()!==S.charAt(0).toLowerCase()){L=!0;break}O=S}C+=1}else if("tt"===u){if(t.substring(C,C+2).toLowerCase()===p.toLowerCase())O=p;else{if(t.substring(C,C+2).toLowerCase()!==S.toLowerCase()){L=!0;break}O=S}C+=2}else if("z"===u||"zz"===u){if("-"===(c=t.charAt(C)))g=!0;else{if("+"!==c){L=!0;break}g=!1}if(C++,null==(A=this.subparseInt(t,C,1,2))||A>14){L=!0;break}C+=A.length,g&&(A=-A)}else if("zzz"===u){if(m=t.substring(C,C+6),C+=6,6!==m.length){L=!0;break}if("-"===(c=m.charAt(0)))g=!0;else{if("+"!==c){L=!0;break}g=!1}if(l=1,null==(A=this.subparseInt(m,l,1,2))||A>14){L=!0;break}if(l+=A.length,g&&(A=-A),m.charAt(l)!==y.timeSeparator){L=!0;break}if(l++,null==(T=this.subparseInt(m,l,1,2))||A>59){L=!0;break}}else f=!1;if(R||!f){if(m=t.substring(C,C+u.length),!R&&(":"===u&&m!==y.timeSeparator||"/"===u&&m!==y.dateSeparator)||m!==u&&"'"!==u&&'"'!==u&&"\\"!==u){L=!0;break}if("\\"===R&&(R=!1),"'"!==u&&'"'!==u&&"\\"!==u)C+=u.length;else if(!1===R)R=u;else{if(R!==u){L=!0;break}R=!1}}}if(R&&(L=!0),L||(C!==t.length?L=!0:2===b?w%4==0&&w%100!=0||w%400==0?B>29&&(L=!0):B>28&&(L=!0):(4===b||6===b||9===b||11===b)&&B>30&&(L=!0)),L){if(i)return null;throw new System.FormatException("String does not contain a valid string representation of a date and time.")}return I<12&&O===S?I=+I+12:I>11&&O===p&&(I-=12),0!==A||0!==T||r?new Date(Date.UTC(w,b-1,B,I-A,$-T,_,E)):new Date(w,b-1,B,I,$,_,E)},subparseInt:function(t,e,n,r){for(var i,o=r;o>=n;o--){if((i=t.substring(e,e+o)).length<n)return null;if(/^\d+$/.test(i))return i}return null},tryParse:function(t,e,n,r){return n.v=this.parse(t,e,r,!0),null!=n.v||(n.v=new Date(-864e13),!1)},tryParseExact:function(t,e,n,r,i){return r.v=this.parseExact(t,e,n,i,!0),null!=r.v||(r.v=new Date(-864e13),!1)},isDaylightSavingTime:function(t){var e=Bridge.Date.today();return e.setMonth(0),e.setDate(1),e.getTimezoneOffset()!==t.getTimezoneOffset()},toUTC:function(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())},toLocal:function(t){return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},dateAddSubTimespan:function(t,e,n){var r=new Date(t.getTime());return r.setDate(r.getDate()+n*e.getDays()),r.setHours(r.getHours()+n*e.getHours()),r.setMinutes(r.getMinutes()+n*e.getMinutes()),r.setSeconds(r.getSeconds()+n*e.getSeconds()),r.setMilliseconds(r.getMilliseconds()+n*e.getMilliseconds()),r},subdt:function(t,e){return Bridge.hasValue$1(t,e)?this.dateAddSubTimespan(t,e,-1):null},adddt:function(t,e){return Bridge.hasValue$1(t,e)?this.dateAddSubTimespan(t,e,1):null},subdd:function(t,e){return Bridge.hasValue$1(t,e)?new System.TimeSpan(1e4*(t-e)):null},gt:function(t,e){return!!Bridge.hasValue$1(t,e)&&t>e},gte:function(t,e){return!!Bridge.hasValue$1(t,e)&&t>=e},lt:function(t,e){return!!Bridge.hasValue$1(t,e)&&t<e},lte:function(t,e){return!!Bridge.hasValue$1(t,e)&&t<=e}},Bridge.Date=a,Bridge.define("System.TimeSpan",{inherits:[System.IComparable],config:{alias:["compareTo","System$IComparable$compareTo"]},$kind:"struct",statics:{fromDays:function(t){return new System.TimeSpan(864e9*t)},fromHours:function(t){return new System.TimeSpan(36e9*t)},fromMilliseconds:function(t){return new System.TimeSpan(1e4*t)},fromMinutes:function(t){return new System.TimeSpan(6e8*t)},fromSeconds:function(t){return new System.TimeSpan(1e7*t)},fromTicks:function(t){return new System.TimeSpan(t)},ctor:function(){this.zero=new System.TimeSpan(System.Int64.Zero),this.maxValue=new System.TimeSpan(System.Int64.MaxValue),this.minValue=new System.TimeSpan(System.Int64.MinValue)},getDefaultValue:function(){return new System.TimeSpan(System.Int64.Zero)},neg:function(t){return Bridge.hasValue(t)?new System.TimeSpan(t.ticks.neg()):null},sub:function(t,e){return Bridge.hasValue$1(t,e)?new System.TimeSpan(t.ticks.sub(e.ticks)):null},eq:function(t,e){return Bridge.hasValue$1(t,e)?t.ticks.eq(e.ticks):null},neq:function(t,e){return Bridge.hasValue$1(t,e)?t.ticks.ne(e.ticks):null},plus:function(t){return Bridge.hasValue(t)?new System.TimeSpan(t.ticks):null},add:function(t,e){return Bridge.hasValue$1(t,e)?new System.TimeSpan(t.ticks.add(e.ticks)):null},gt:function(t,e){return!!Bridge.hasValue$1(t,e)&&t.ticks.gt(e.ticks)},gte:function(t,e){return!!Bridge.hasValue$1(t,e)&&t.ticks.gte(e.ticks)},lt:function(t,e){return!!Bridge.hasValue$1(t,e)&&t.ticks.lt(e.ticks)},lte:function(t,e){return!!Bridge.hasValue$1(t,e)&&t.ticks.lte(e.ticks)}},ctor:function(){this.$initialize(),this.ticks=System.Int64.Zero,1===arguments.length?this.ticks=arguments[0]instanceof System.Int64?arguments[0]:new System.Int64(arguments[0]):3===arguments.length?this.ticks=new System.Int64(arguments[0]).mul(60).add(arguments[1]).mul(60).add(arguments[2]).mul(1e7):4===arguments.length?this.ticks=new System.Int64(arguments[0]).mul(24).add(arguments[1]).mul(60).add(arguments[2]).mul(60).add(arguments[3]).mul(1e7):5===arguments.length&&(this.ticks=new System.Int64(arguments[0]).mul(24).add(arguments[1]).mul(60).add(arguments[2]).mul(60).add(arguments[3]).mul(1e3).add(arguments[4]).mul(1e4))},getTicks:function(){return this.ticks},getDays:function(){return this.ticks.div(864e9).toNumber()},getHours:function(){return this.ticks.div(36e9).mod(24).toNumber()},getMilliseconds:function(){return this.ticks.div(1e4).mod(1e3).toNumber()},getMinutes:function(){return this.ticks.div(6e8).mod(60).toNumber()},getSeconds:function(){return this.ticks.div(1e7).mod(60).toNumber()},getTotalDays:function(){return this.ticks.toNumberDivided(864e9)},getTotalHours:function(){return this.ticks.toNumberDivided(36e9)},getTotalMilliseconds:function(){return this.ticks.toNumberDivided(1e4)},getTotalMinutes:function(){return this.ticks.toNumberDivided(6e8)},getTotalSeconds:function(){return this.ticks.toNumberDivided(1e7)},get12HourHour:function(){return this.getHours()>12?this.getHours()-12:0===this.getHours()?12:this.getHours()},add:function(t){return new System.TimeSpan(this.ticks.add(t.ticks))},subtract:function(t){return new System.TimeSpan(this.ticks.sub(t.ticks))},duration:function(){return new System.TimeSpan(this.ticks.abs())},negate:function(){return new System.TimeSpan(this.ticks.neg())},compareTo:function(t){return this.ticks.compareTo(t.ticks)},equals:function(t){return t.ticks.eq(this.ticks)},equalsT:function(t){return t.ticks.eq(this.ticks)},format:function(t,e){return this.toString(t,e)},getHashCode:function(){return this.ticks.getHashCode()},toString:function(t,e){var n=this.ticks,r="",i=this,o=(e||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),s=function(t,e,n,r){return System.String.alignString((0|t).toString(),e||2,"0",n||2,r||!1)};return t?t.replace(/(\\.|'[^']*'|"[^"]*"|dd?|HH?|hh?|mm?|ss?|tt?|f{1,7}|\:|\/)/g,(function(t){switch(t){case"d":return i.getDays();case"dd":return s(i.getDays());case"H":return i.getHours();case"HH":return s(i.getHours());case"h":return i.get12HourHour();case"hh":return s(i.get12HourHour());case"m":return i.getMinutes();case"mm":return s(i.getMinutes());case"s":return i.getSeconds();case"ss":return s(i.getSeconds());case"t":return(i.getHours()<12?o.amDesignator:o.pmDesignator).substring(0,1);case"tt":return i.getHours()<12?o.amDesignator:o.pmDesignator;case"f":case"ff":case"fff":case"ffff":case"fffff":case"ffffff":case"fffffff":return s(i.getMilliseconds(),t.length,1,!0);default:return t.substr(1,t.length-1-("\\"!==t.charAt(0)))}})):(n.abs().gte(864e9)&&(r+=s(n.toNumberDivided(864e9))+".",n=n.mod(864e9)),r+=s(n.toNumberDivided(36e9))+":",n=n.mod(36e9),r+=s(0|n.toNumberDivided(6e8))+":",n=n.mod(6e8),r+=s(n.toNumberDivided(1e7)),(n=n.mod(1e7)).gt(0)&&(r+="."+s(n.toNumber(),7)),r)}}),Bridge.Class.addExtend(System.TimeSpan,[System.IComparable$1(System.TimeSpan),System.IEquatable$1(System.TimeSpan)]),Bridge.define("System.Text.StringBuilder",{ctor:function(){this.$initialize(),this.buffer=[],this.capacity=16,1===arguments.length?this.append(arguments[0]):2===arguments.length?(this.append(arguments[0]),this.setCapacity(arguments[1])):3===arguments.length&&this.append(arguments[0],arguments[1],arguments[2])},getLength:function(){if(this.buffer.length<2)return this.buffer[0]?this.buffer[0].length:0;var t=this.buffer.join("");return this.buffer=[],this.buffer[0]=t,t.length},getCapacity:function(){var t=this.getLength();return this.capacity>t?this.capacity:t},setCapacity:function(t){t>this.getLength()&&(this.capacity=t)},toString:function(){var t,e,n=this.buffer.join("");return this.buffer=[],this.buffer[0]=n,2===arguments.length?(t=arguments[0],e=arguments[1],this.checkLimits(n,t,e),n.substr(t,e)):n},append:function(t){var e,n;if(null==t)return this;if(2===arguments.length){if(0===(n=arguments[1]))return this;if(n<0)throw new System.ArgumentOutOfRangeException("count","cannot be less than zero");t=Array(n+1).join(t).toString()}else if(3===arguments.length){if(e=arguments[1],0===(n=arguments[2]))return this;this.checkLimits(t,e,n),t=t.substr(e,n)}return this.buffer[this.buffer.length]=t,this},appendFormat:function(){return this.append(System.String.format.apply(System.String,arguments))},clear:function(){return this.buffer=[],this},appendLine:function(){return 1===arguments.length&&this.append(arguments[0]),this.append("\r\n")},equals:function(t){return null!=t&&(t===this||this.toString()===t.toString())},remove:function(t,e){var n=this.buffer.join("");return this.checkLimits(n,t,e),n.length===e&&0===t?this.clear():(e>0&&(this.buffer=[],this.buffer[0]=n.substring(0,t),this.buffer[1]=n.substring(t+e,n.length)),this)},insert:function(t,e){var n,r;if(null==e)return this;if(3===arguments.length){if(0===(n=arguments[2]))return this;if(n<0)throw new System.ArgumentOutOfRangeException("count","cannot be less than zero");e=Array(n+1).join(e).toString()}return r=this.buffer.join(""),this.buffer=[],t<1?(this.buffer[0]=e,this.buffer[1]=r):t>=r.length?(this.buffer[0]=r,this.buffer[1]=e):(this.buffer[0]=r.substring(0,t),this.buffer[1]=e,this.buffer[2]=r.substring(t,r.length)),this},replace:function(t,e){var n=new RegExp(t,"g"),r=this.buffer.join("");if(this.buffer=[],4===arguments.length){var i=arguments[2],o=arguments[3],s=r.substr(i,o);this.checkLimits(r,i,o),this.buffer[0]=r.substring(0,i),this.buffer[1]=s.replace(n,e),this.buffer[2]=r.substring(i+o,r.length)}else this.buffer[0]=r.replace(n,e);return this},checkLimits:function(t,e,n){if(n<0)throw new System.ArgumentOutOfRangeException("length","must be non-negative");if(e<0)throw new System.ArgumentOutOfRangeException("startIndex","startIndex cannot be less than zero");if(n>t.length-e)throw new System.ArgumentOutOfRangeException("Index and length must refer to a location within the string")}}),function(){var t=RegExp("[-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]","g");Bridge.regexpEscape=function(e){return e.replace(t,"\\$&")}}(),System.Diagnostics.Debug={writeln:function(t){Bridge.Console.debug(t)},_fail:function(t){System.Diagnostics.Debug.writeln(t)},assert:function(t,e){t||(e="Assert failed: "+e,confirm(e+"\r\n\r\nBreak into debugger?")&&System.Diagnostics.Debug._fail(e))},fail:function(t){System.Diagnostics.Debug._fail(t)}},Bridge.define("System.Diagnostics.Stopwatch",{ctor:function(){this.$initialize(),this._stopTime=System.Int64.Zero,this._startTime=System.Int64.Zero,this.isRunning=!1},reset:function(){this._stopTime=this._startTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!1},ticks:function(){return(this.isRunning?System.Diagnostics.Stopwatch.getTimestamp():this._stopTime).sub(this._startTime)},milliseconds:function(){return this.ticks().mul(1e3).div(System.Diagnostics.Stopwatch.frequency)},timeSpan:function(){return new System.TimeSpan(this.milliseconds().mul(1e4))},start:function(){this.isRunning||(this._startTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!0)},stop:function(){this.isRunning&&(this._stopTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!1)},restart:function(){this.isRunning=!1,this.start()},statics:{startNew:function(){var t=new System.Diagnostics.Stopwatch;return t.start(),t}}}),"undefined"!=typeof window&&window.performance&&window.performance.now?(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e6),System.Diagnostics.Stopwatch.isHighResolution=!0,System.Diagnostics.Stopwatch.getTimestamp=function(){return new System.Int64(Math.round(1e3*window.performance.now()))}):"undefined"!=typeof process&&process.hrtime?(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e9),System.Diagnostics.Stopwatch.isHighResolution=!0,System.Diagnostics.Stopwatch.getTimestamp=function(){var t=process.hrtime();return new System.Int64(t[0]).mul(1e9).add(t[1])}):(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e3),System.Diagnostics.Stopwatch.isHighResolution=!1,System.Diagnostics.Stopwatch.getTimestamp=function(){return new System.Int64((new Date).valueOf())}),System.Diagnostics.Contracts.Contract={reportFailure:function(t,e,n,r,i){var o,s,a=n.toString();throw o=(a=(a=a.substring(a.indexOf("return")+7)).substr(0,a.lastIndexOf(";")))?"Contract '"+a+"' failed":"Contract failed",s=e?o+": "+e:o,i?new i(a,e):new System.Diagnostics.Contracts.ContractException(t,s,e,a,r)},assert:function(t,e,n){e()||System.Diagnostics.Contracts.Contract.reportFailure(t,n,e,null)},requires:function(t,e,n){e()||System.Diagnostics.Contracts.Contract.reportFailure(0,n,e,null,t)},forAll:function(t,e,n){if(!n)throw new System.ArgumentNullException("predicate");for(;t<e;t++)if(!n(t))return!1;return!0},forAll$1:function(t,e){if(!t)throw new System.ArgumentNullException("collection");if(!e)throw new System.ArgumentNullException("predicate");var n=Bridge.getEnumerator(t);try{for(;n.moveNext();)if(!e(n.getCurrent()))return!1;return!0}finally{n.dispose()}},exists:function(t,e,n){if(!n)throw new System.ArgumentNullException("predicate");for(;t<e;t++)if(n(t))return!0;return!1},exists$1:function(t,e){if(!t)throw new System.ArgumentNullException("collection");if(!e)throw new System.ArgumentNullException("predicate");var n=Bridge.getEnumerator(t);try{for(;n.moveNext();)if(e(n.getCurrent()))return!0;return!1}finally{n.dispose()}}},Bridge.define("System.Diagnostics.Contracts.ContractFailureKind",{$kind:"enum",$statics:{precondition:0,postcondition:1,postconditionOnException:2,invarian:3,assert:4,assume:5}}),Bridge.define("System.Diagnostics.Contracts.ContractException",{inherits:[System.Exception],ctor:function(t,e,n,r,i){this.$initialize(),System.Exception.ctor.call(this,e,i),this._kind=t,this._failureMessage=e||null,this._userMessage=n||null,this._condition=r||null},getKind:function(){return this._kind},getFailure:function(){return this._failureMessage},getUserMessage:function(){return this._userMessage},getCondition:function(){return this._condition}}),u={toIndex:function(t,e){if(e.length!==(t.$s?t.$s.length:1))throw new System.ArgumentException("Invalid number of indices");if(e[0]<0||e[0]>=(t.$s?t.$s[0]:t.length))throw new System.ArgumentException("Index 0 out of range");var n,r=e[0];if(t.$s)for(n=1;n<t.$s.length;n++){if(e[n]<0||e[n]>=t.$s[n])throw new System.ArgumentException("Index "+n+" out of range");r=r*t.$s[n]+e[n]}return r},$get:function(t){var e=this[System.Array.toIndex(this,t)];return void 0!==e?e:this.$v},get:function(t){var e,n,r;if(arguments.length<2)throw new System.ArgumentNullException("indices");for(e=Array.prototype.slice.call(arguments,1),n=0;n<e.length;n++)if(!Bridge.hasValue(e[n]))throw new System.ArgumentNullException("indices");return void 0!==(r=t[System.Array.toIndex(t,e)])?r:t.$v},$set:function(t,e){this[System.Array.toIndex(this,Array.prototype.slice.call(t,0))]=e},set:function(t,e){var n=Array.prototype.slice.call(arguments,2);t[System.Array.toIndex(t,n)]=e},getLength:function(t,e){if(e<0||e>=(t.$s?t.$s.length:1))throw new System.IndexOutOfRangeException;return t.$s?t.$s[e]:t.length},getRank:function(t){return t.$s?t.$s.length:1},getLower:function(t,e){return System.Array.getLength(t,e),0},create:function(t,e){var n,r,i,o,s,a,u=[],l=arguments.length>2?1:0;for(u.$v=t,u.$s=[],u.get=System.Array.$get,u.set=System.Array.$set,n=2;n<arguments.length;n++)l*=arguments[n],u.$s[n-2]=arguments[n];if(u.length=l,e)for(n=0;n<u.length;n++){for(s=[],a=n,r=u.$s.length-1;r>=0;r--)o=a%u.$s[r],s.unshift(o),a=Bridge.Int.div(a-o,u.$s[r]);for(i=e,o=0;o<s.length;o++)i=i[s[o]];u[n]=i}return u},init:function(t,e,n){for(var r=new Array(t),i=!0!==n&&Bridge.isFunction(e),o=0;o<t;o++)r[o]=i?e():e;return r},toEnumerable:function(t){return new Bridge.ArrayEnumerable(t)},toEnumerator:function(t,e){return new Bridge.ArrayEnumerator(t,e)},_typedArrays:{Float32Array:!0,Float64Array:!0,Int8Array:!0,Int16Array:!0,Int32Array:!0,Uint8Array:!0,Uint8ClampedArray:!0,Uint16Array:!0,Uint32Array:!0},is:function(t,e){return t instanceof Bridge.ArrayEnumerator?!!(t.constructor===e||t instanceof e||e===Bridge.ArrayEnumerator||e.$$name&&System.String.startsWith(e.$$name,"System.Collections.IEnumerator")||e.$$name&&System.String.startsWith(e.$$name,"System.Collections.Generic.IEnumerator")):!!Bridge.isArray(t)&&(t.constructor===e||t instanceof e||!!(e===System.Collections.IEnumerable||e===System.Collections.ICollection||e===System.ICloneable||e.$$name&&System.String.startsWith(e.$$name,"System.Collections.Generic.IEnumerable$1")||e.$$name&&System.String.startsWith(e.$$name,"System.Collections.Generic.ICollection$1")||e.$$name&&System.String.startsWith(e.$$name,"System.Collections.Generic.IList$1"))||!!System.Array._typedArrays[String.prototype.slice.call(Object.prototype.toString.call(t),8,-1)])},clone:function(t){return 1===t.length?[t[0]]:t.slice(0)},getCount:function(t,e){var n;return Bridge.isArray(t)?t.length:Bridge.isFunction(t[n="System$Collections$ICollection$getCount"])||e&&Bridge.isFunction(t[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$getCount"])?t[n]():Bridge.isFunction(t.getCount)?t.getCount():0},getIsReadOnly:function(t,e){var n;return Bridge.isArray(t)?!!e:Bridge.isFunction(t[n="System$Collections$ICollection$getIsReadOnly"])||e&&Bridge.isFunction(t[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$getIsReadOnly"])?t[n]():Bridge.isFunction(t.getIsReadOnly)?t.getIsReadOnly():0},add:function(t,e,n){var r;Bridge.isArray(t)?t.push(e):n&&Bridge.isFunction(t[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$add"])?t[r](e):Bridge.isFunction(t.add)&&t.add(e)},clear:function(t,e){var n;Bridge.isArray(t)?System.Array.fill(t,e?e.getDefaultValue||Bridge.getDefaultValue(e):null,0,t.length):e&&Bridge.isFunction(t[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$clear"])?t[n]():Bridge.isFunction(t.clear)&&t.clear()},fill:function(t,e,n,r){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("dst");if(n<0||r<0||n+r>t.length)throw new System.IndexOutOfRangeException;for(var i=Bridge.isFunction(e);--r>=0;)t[n+r]=i?e():e},copy:function(t,e,n,r,i){if(!n)throw new System.ArgumentNullException("dest","Value cannot be null");if(!t)throw new System.ArgumentNullException("src","Value cannot be null");if(e<0||r<0||i<0)throw new System.ArgumentOutOfRangeException("Number was less than the array's lower bound in the first dimension");if(i>t.length-e||i>n.length-r)throw new System.ArgumentException("Destination array was not long enough. Check destIndex and length, and the array's lower bounds");if(e<r&&t===n)for(;--i>=0;)n[r+i]=t[e+i];else for(var o=0;o<i;o++)n[r+o]=t[e+o]},copyTo:function(t,e,n,r){var i;if(Bridge.isArray(t))System.Array.copy(t,0,e,n,t?t.length:0);else if(Bridge.isFunction(t.copyTo))t.copyTo(e,n);else{if(!r||!Bridge.isFunction(t[i="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(r)+"$copyTo"]))throw new System.NotImplementedException("copyTo");t[i](e,n)}},indexOf:function(t,e,n,r,i){var o,s,a,u;if(Bridge.isArray(t)){for(u=(n=n||0)+(r=r||t.length),s=n;s<u;s++)if((a=t[s])===e||System.Collections.Generic.EqualityComparer$1.$default.equals2(a,e))return s}else{if(i&&Bridge.isFunction(t[o="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(i)+"$indexOf"]))return t[o](e);if(Bridge.isFunction(t.indexOf))return t.indexOf(e)}return-1},contains:function(t,e,n){var r;return Bridge.isArray(t)?System.Array.indexOf(t,e)>-1:n&&Bridge.isFunction(t[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$contains"])?t[r](e):!!Bridge.isFunction(t.contains)&&t.contains(e)},remove:function(t,e,n){var r,i;if(Bridge.isArray(t)){if((i=System.Array.indexOf(t,e))>-1)return t.splice(i,1),!0}else{if(n&&Bridge.isFunction(t[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$remove"]))return t[r](e);if(Bridge.isFunction(t.remove))return t.remove(e)}return!1},insert:function(t,e,n,r){var i;Bridge.isArray(t)?t.splice(e,0,n):r&&Bridge.isFunction(t[i="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(r)+"$insert"])?t[i](e,n):Bridge.isFunction(t.insert)&&t.insert(e,n)},removeAt:function(t,e,n){var r;Bridge.isArray(t)?t.splice(e,1):n&&Bridge.isFunction(t[r="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(n)+"$removeAt"])?t[r](e):Bridge.isFunction(t.removeAt)&&t.removeAt(e)},getItem:function(t,e,n){var r;return Bridge.isArray(t)?t[e]:Bridge.isFunction(t.get)?t.get(e):Bridge.isFunction(t.getItem)?t.getItem(e):n&&Bridge.isFunction(t[r="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(n)+"$getItem"])?t[r](e):Bridge.isFunction(t.get_Item)?t.get_Item(e):void 0},setItem:function(t,e,n,r){var i;if(Bridge.isArray(t))t[e]=n;else if(Bridge.isFunction(t.set))t.set(e,n);else if(Bridge.isFunction(t.setItem))t.setItem(e,n);else{if(r&&Bridge.isFunction(t[i="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(r)+"$setItem"]))return t[i](e,n);Bridge.isFunction(t.set_Item)&&t.set_Item(e,n)}},resize:function(t,e,n){var r;if(e<0)throw new System.ArgumentOutOfRangeException("newSize",null,null,e);var i=0,o=Bridge.isFunction(n),s=t.v;for(s?(i=s.length,s.length=e):s=new Array(e),r=i;r<e;r++)s[r]=o?n():n;t.v=s},reverse:function(t,e,n){var r,i,o;if(!u)throw new System.ArgumentNullException("arr");if(e||0===e||(e=0,n=t.length),e<0||n<0)throw new System.ArgumentOutOfRangeException(e<0?"index":"length","Non-negative number required.");if(u.length-e<n)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(1!==System.Array.getRank(t))throw new System.Exception("Only single dimension arrays are supported here.");for(r=e,i=e+n-1;r<i;)o=t[r],t[r]=t[i],t[i]=o,r++,i--},binarySearch:function(t,e,n,r,i){var o,s,a,u;if(!t)throw new System.ArgumentNullException("array");if(e<0||n<0)throw new System.ArgumentOutOfRangeException(e<0?"index":"length","Non-negative number required.");if(t.length-(e-0)<n)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(1!==System.Array.getRank(t))throw new System.RankException("Only single dimensional arrays are supported for the requested action.");for(i||(i=System.Collections.Generic.Comparer$1.$default),o=e,s=e+n-1;o<=s;){a=o+(s-o>>1);try{u=i.compare(t[a],r)}catch(t){throw new System.InvalidOperationException("Failed to compare two elements in the array.",t)}if(0===u)return a;u<0?o=a+1:s=a-1}return~o},sort:function(t,e,n,r){var i,o;if(!t)throw new System.ArgumentNullException("array");if(2===arguments.length&&"object"==typeof e&&(r=e,e=null),Bridge.isNumber(e)||(e=0),Bridge.isNumber(n)||(n=t.length),r||(r=System.Collections.Generic.Comparer$1.$default),0===e&&n===t.length)t.sort(Bridge.fn.bind(r,r.compare));else for((i=t.slice(e,e+n)).sort(Bridge.fn.bind(r,r.compare)),o=e;o<e+n;o++)t[o]=i[o-e]},min:function(t,e){for(var n=t[0],r=t.length,i=0;i<r;i++)!(t[i]<n||n<e)||t[i]<e||(n=t[i]);return n},max:function(t,e){for(var n=t[0],r=t.length,i=0;i<r;i++)!(t[i]>n||n>e)||t[i]>e||(n=t[i]);return n},addRange:function(t,e){if(Bridge.isArray(e))t.push.apply(t,e);else{var n=Bridge.getEnumerator(e);try{for(;n.moveNext();)t.push(n.getCurrent())}finally{Bridge.is(n,System.IDisposable)&&n.dispose()}}},convertAll:function(t,e){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(e))throw new System.ArgumentNullException("converter");return t.map(e)},find:function(t,e,n){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(n))throw new System.ArgumentNullException("match");for(var r=0;r<e.length;r++)if(n(e[r]))return e[r];return Bridge.getDefaultValue(t)},findAll:function(t,e){var n,r;if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(e))throw new System.ArgumentNullException("match");for(n=[],r=0;r<t.length;r++)e(t[r])&&n.push(t[r]);return n},findIndex:function(t,e,n,r){var i,o;if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(2===arguments.length?(r=e,e=0,n=t.length):3===arguments.length&&(r=n,n=t.length-e),e<0||e>t.length)throw new System.ArgumentOutOfRangeException("startIndex");if(n<0||e>t.length-n)throw new System.ArgumentOutOfRangeException("count");if(!Bridge.hasValue(r))throw new System.ArgumentNullException("match");for(i=e+n,o=e;o<i;o++)if(r(t[o]))return o;return-1},findLast:function(t,e,n){if(!Bridge.hasValue(e))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(n))throw new System.ArgumentNullException("match");for(var r=e.length-1;r>=0;r--)if(n(e[r]))return e[r];return Bridge.getDefaultValue(t)},findLastIndex:function(t,e,n,r){var i,o;if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(2===arguments.length?(r=e,e=t.length-1,n=t.length):3===arguments.length&&(r=n,n=e+1),!Bridge.hasValue(r))throw new System.ArgumentNullException("match");if(0===t.length){if(-1!==e)throw new System.ArgumentOutOfRangeException("startIndex")}else if(e<0||e>=t.length)throw new System.ArgumentOutOfRangeException("startIndex");if(n<0||e-n+1<0)throw new System.ArgumentOutOfRangeException("count");for(i=e-n,o=e;o>i;o--)if(r(t[o]))return o;return-1},forEach:function(t,e){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(e))throw new System.ArgumentNullException("action");for(var n=0;n<t.length;n++)e(t[n],n,t)},indexOfT:function(t,e,n,r){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(2===arguments.length?(n=0,r=t.length):3===arguments.length&&(r=t.length-n),n<0||n>=t.length&&t.length>0)throw new System.ArgumentOutOfRangeException("startIndex","out of range");if(r<0||r>t.length-n)throw new System.ArgumentOutOfRangeException("count","out of range");return System.Array.indexOf(t,e,n,r)},lastIndexOfT:function(t,e,n,r){var i,o,s;if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(2===arguments.length?(n=t.length-1,r=t.length):3===arguments.length&&(r=0===t.length?0:n+1),n<0||n>=t.length&&t.length>0)throw new System.ArgumentOutOfRangeException("startIndex","out of range");if(r<0||n-r+1<0)throw new System.ArgumentOutOfRangeException("count","out of range");for(i=n-r+1,o=n;o>=i;o--)if((s=t[o])===e||System.Collections.Generic.EqualityComparer$1.$default.equals2(s,e))return o;return-1},trueForAll:function(t,e){if(!Bridge.hasValue(t))throw new System.ArgumentNullException("array");if(!Bridge.hasValue(e))throw new System.ArgumentNullException("match");for(var n=0;n<t.length;n++)if(!e(t[n]))return!1;return!0}},System.Array=u,Bridge.define("System.ArraySegment",{ctor:function(t,e,n){this.$initialize(),this.array=t,this.offset=e||0,this.count=n||t.length},getArray:function(){return this.array},getCount:function(){return this.count},getOffset:function(){return this.offset}}),Bridge.define("System.Collections.IEnumerable",{$kind:"interface"}),Bridge.define("System.Collections.IEnumerator",{$kind:"interface"}),Bridge.define("System.Collections.IEqualityComparer",{$kind:"interface"}),Bridge.define("System.Collections.ICollection",{inherits:[System.Collections.IEnumerable],$kind:"interface"}),Bridge.define("System.Collections.Generic.IEnumerator$1",(function(){return{inherits:[System.Collections.IEnumerator],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IEnumerable$1",(function(){return{inherits:[System.Collections.IEnumerable],$kind:"interface"}})),Bridge.define("System.Collections.Generic.ICollection$1",(function(t){return{inherits:[System.Collections.Generic.IEnumerable$1(t)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IEqualityComparer$1",(function(){return{$kind:"interface"}})),Bridge.define("System.Collections.Generic.IDictionary$2",(function(t,e){return{inherits:[System.Collections.Generic.IEnumerable$1(System.Collections.Generic.KeyValuePair$2(t,e))],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IList$1",(function(t){return{inherits:[System.Collections.Generic.ICollection$1(t)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IComparer$1",(function(){return{$kind:"interface"}})),Bridge.define("System.Collections.Generic.ISet$1",(function(t){return{inherits:[System.Collections.Generic.ICollection$1(t)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IReadOnlyCollection$1",(function(t){return{inherits:[System.Collections.Generic.IEnumerable$1(t)],$kind:"interface"}})),Bridge.define("System.Collections.Generic.IReadOnlyList$1",(function(t){return{inherits:[System.Collections.Generic.IReadOnlyCollection$1(t)],$kind:"interface"}})),Bridge.define("Bridge.CustomEnumerator",{inherits:[System.Collections.IEnumerator],config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},ctor:function(t,e,n,r,i){this.$initialize(),this.$moveNext=t,this.$getCurrent=e,this.$dispose=r,this.$reset=n,this.scope=i},moveNext:function(){try{return this.$moveNext.call(this.scope)}catch(t){throw this.dispose.call(this.scope),t}},getCurrent:function(){return this.$getCurrent.call(this.scope)},getCurrent$1:function(){return this.$getCurrent.call(this.scope)},reset:function(){this.$reset&&this.$reset.call(this.scope)},dispose:function(){this.$dispose&&this.$dispose.call(this.scope)}}),Bridge.define("Bridge.ArrayEnumerator",{inherits:[System.Collections.IEnumerator,System.IDisposable],statics:{$isArrayEnumerator:!0},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","dispose","System$IDisposable$dispose"]},ctor:function(t,e){this.$initialize(),this.array=t,this.reset(),e&&(this["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(e)+"$getCurrent$1"]=this.getCurrent)},moveNext:function(){return this.index++,this.index<this.array.length},getCurrent:function(){return this.array[this.index]},getCurrent$1:function(){return this.array[this.index]},reset:function(){this.index=-1},dispose:Bridge.emptyFn}),Bridge.define("Bridge.ArrayEnumerable",{inherits:[System.Collections.IEnumerable],config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator"]},ctor:function(t){this.$initialize(),this.array=t},getEnumerator:function(){return new Bridge.ArrayEnumerator(this.array)}}),Bridge.define("System.Collections.Generic.EqualityComparer$1",(function(t){return{inherits:[System.Collections.Generic.IEqualityComparer$1(t)],statics:{config:{init:function(){this.def=new(System.Collections.Generic.EqualityComparer$1(t))}}},config:{alias:["equals2","System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2","getHashCode2","System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$getHashCode2"]},equals2:function(t,e){return Bridge.isDefined(t,!0)?!!Bridge.isDefined(e,!0)&&(t&&t.$$name?Bridge.isFunction(t.equalsT)?Bridge.equalsT(t,e):Bridge.isFunction(t.equals)?Bridge.equals(t,e):t===e:Bridge.equals(t,e)):!Bridge.isDefined(e,!0)},getHashCode2:function(t){return Bridge.isDefined(t,!0)?Bridge.getHashCode(t):0}}})),System.Collections.Generic.EqualityComparer$1.$default=new(System.Collections.Generic.EqualityComparer$1(Object)),Bridge.define("System.Collections.Generic.Comparer$1",(function(t){return{inherits:[System.Collections.Generic.IComparer$1(t)],config:{alias:["compare","System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(t)+"$compare"]},ctor:function(t){this.$initialize(),this.fn=t,this.compare=t}}})),System.Collections.Generic.Comparer$1.$default=new(System.Collections.Generic.Comparer$1(Object))((function(t,e){return Bridge.hasValue(t)?Bridge.hasValue(e)?Bridge.compare(t,e):1:Bridge.hasValue(e)?-1:0})),Bridge.define("System.Collections.Generic.KeyValuePair$2",(function(t,e){return{$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.KeyValuePair$2(t,e))(Bridge.getDefaultValue(t),Bridge.getDefaultValue(e))}},ctor:function(n,r){void 0===n&&(n=Bridge.getDefaultValue(t)),void 0===r&&(r=Bridge.getDefaultValue(e)),this.$initialize(),this.key=n,this.value=r},toString:function(){var t="[";return null!=this.key&&(t+=this.key.toString()),t+=", ",null!=this.value&&(t+=this.value.toString()),t+"]"}}})),Bridge.define("System.Collections.Generic.Dictionary$2",(function(t,e){return{inherits:[System.Collections.Generic.IDictionary$2(t,e)],config:{alias:["getCount","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$getCount","getKeys","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$getKeys","getValues","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$getValues","get","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$getItem","set","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$setItem","add","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$add","containsKey","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$containsKey","getEnumerator","System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$getEnumerator","remove","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$remove","tryGetValue","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(e)+"$tryGetValue"]},ctor:function(n,r){var i,o,s,a,u;if(this.$initialize(),this.comparer=r||System.Collections.Generic.EqualityComparer$1(t).def,this.clear(),Bridge.is(n,System.Collections.Generic.Dictionary$2(t,e)))for(i=Bridge.getEnumerator(n);i.moveNext();)o=i.getCurrent(),this.add(o.key,o.value);else if("[object Object]"===Object.prototype.toString.call(n))for(s=Object.keys(n),u=0;u<s.length;u++)a=s[u],this.add(a,n[a])},getKeys:function(){return new(System.Collections.Generic.DictionaryCollection$1(t))(this,!0)},getValues:function(){return new(System.Collections.Generic.DictionaryCollection$1(e))(this,!1)},clear:function(){this.entries={},this.count=0},findEntry:function(t){var e,n,r=this.comparer.getHashCode2(t);if(Bridge.isDefined(this.entries[r]))for(e=this.entries[r],n=0;n<e.length;n++)if(this.comparer.equals2(e[n].key,t))return e[n]},containsKey:function(t){return!!this.findEntry(t)},containsValue:function(t){var e,n,r;for(e in this.entries)if(this.entries.hasOwnProperty(e))for(r=this.entries[e],n=0;n<r.length;n++)if(this.comparer.equals2(r[n].value,t))return!0;return!1},get:function(t){var e=this.findEntry(t);if(!e)throw new System.Collections.Generic.KeyNotFoundException("Key "+t+" does not exist.");return e.value},getItem:function(t){return this.get(t)},set:function(n,r,i){var o,s=this.findEntry(n);if(s){if(i)throw new System.ArgumentException("Key "+n+" already exists.");s.value=r}else o=this.comparer.getHashCode2(n),s=new(System.Collections.Generic.KeyValuePair$2(t,e))(n,r),this.entries[o]?this.entries[o].push(s):this.entries[o]=[s],this.count++},setItem:function(t,e,n){this.set(t,e,n)},add:function(t,e){this.set(t,e,!0)},remove:function(t){var e,n,r=this.comparer.getHashCode2(t);if(!this.entries[r])return!1;for(e=this.entries[r],n=0;n<e.length;n++)if(this.comparer.equals2(e[n].key,t))return e.splice(n,1),0==e.length&&delete this.entries[r],this.count--,!0;return!1},getCount:function(){return this.count},getComparer:function(){return this.comparer},tryGetValue:function(t,n){var r=this.findEntry(t);return n.v=r?r.value:Bridge.getDefaultValue(e),!!r},getCustomEnumerator:function(t){var e,n=Bridge.getPropertyNames(this.entries),r=-1;return new Bridge.CustomEnumerator((function(){return(r<0||e>=this.entries[n[r]].length-1)&&(e=-1,r++),!(r>=n.length||(e++,0))}),(function(){return t(this.entries[n[r]][e])}),(function(){r=-1}),null,this)},getEnumerator:function(){return this.getCustomEnumerator((function(t){return t}))}}})),Bridge.define("System.Collections.Generic.DictionaryCollection$1",(function(t){return{inherits:[System.Collections.Generic.ICollection$1(t)],config:{alias:["getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$getEnumerator","getCount","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getCount","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$contains","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$remove"]},ctor:function(t,e){this.$initialize(),this.dictionary=t,this.keys=e},getCount:function(){return this.dictionary.getCount()},getEnumerator:function(){return this.dictionary.getCustomEnumerator(this.keys?function(t){return t.key}:function(t){return t.value})},contains:function(t){return this.keys?this.dictionary.containsKey(t):this.dictionary.containsValue(t)},add:function(){throw new System.NotSupportedException},clear:function(){throw new System.NotSupportedException},remove:function(){throw new System.NotSupportedException}}})),Bridge.define("System.Collections.Generic.List$1",(function(t){return{inherits:[System.Collections.Generic.ICollection$1(t),System.Collections.ICollection,System.Collections.Generic.IList$1(t)],config:{alias:["getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$getItem","setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$setItem","getCount","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getCount","getIsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getIsReadOnly","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$copyTo","getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$getEnumerator","indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$indexOf","insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$insert","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$remove","removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$removeAt"]},ctor:function(t){this.$initialize(),this.items="[object Array]"===Object.prototype.toString.call(t)?System.Array.clone(t):Bridge.is(t,System.Collections.IEnumerable)?Bridge.toArray(t):[],this.clear.$clearCallbacks=[]},checkIndex:function(t){if(t<0||t>this.items.length-1)throw new System.ArgumentOutOfRangeException("Index out of range")},getCount:function(){return this.items.length},getIsReadOnly:function(){return!!this.readOnly},get:function(t){return this.checkIndex(t),this.items[t]},getItem:function(t){return this.get(t)},set:function(t,e){this.checkReadOnly(),this.checkIndex(t),this.items[t]=e},setItem:function(t,e){this.set(t,e)},add:function(t){this.checkReadOnly(),this.items.push(t)},addRange:function(t){this.checkReadOnly();for(var e=Bridge.toArray(t),n=0,r=e.length;n<r;++n)this.items.push(e[n])},clear:function(){this.checkReadOnly(),this.items=[];for(var t=0;t<this.clear.$clearCallbacks.length;t++)this.clear.$clearCallbacks[t](this)},onClear:function(t){this.clear.$clearCallbacks.push(t)},indexOf:function(t,e){var n,r;for(Bridge.isDefined(e)||(e=0),0!==e&&this.checkIndex(e),n=e;n<this.items.length;n++)if(r=this.items[n],System.Collections.Generic.EqualityComparer$1.$default.equals2(r,t))return n;return-1},insertRange:function(t,e){var n,r;for(this.checkReadOnly(),t!==this.items.length&&this.checkIndex(t),n=Bridge.toArray(e),r=0;r<n.length;r++)this.insert(t++,n[r])},contains:function(t){return this.indexOf(t)>-1},copyTo:function(t,e){System.Array.copy(this.items,0,t,e,this.items.length)},getEnumerator:function(){return new Bridge.ArrayEnumerator(this.items,t)},getRange:function(e,n){Bridge.isDefined(e)||(e=0),Bridge.isDefined(n)||(n=this.items.length),0!==e&&this.checkIndex(e),this.checkIndex(e+n-1);for(var r=[],i=e+n,o=e;o<i;o++)r.push(this.items[o]);return new(System.Collections.Generic.List$1(t))(r)},insert:function(t,e){if(this.checkReadOnly(),t!==this.items.length&&this.checkIndex(t),Bridge.isArray(e))for(var n=0;n<e.length;n++)this.insert(t++,e[n]);else this.items.splice(t,0,e)},join:function(t){return this.items.join(t)},lastIndexOf:function(t,e){Bridge.isDefined(e)||(e=this.items.length-1),0!==e&&this.checkIndex(e);for(var n=e;n>=0;n--)if(t===this.items[n])return n;return-1},remove:function(t){this.checkReadOnly();var e=this.indexOf(t);return!(e<0||(this.checkIndex(e),this.items.splice(e,1),0))},removeAt:function(t){this.checkReadOnly(),this.checkIndex(t),this.items.splice(t,1)},removeRange:function(t,e){this.checkReadOnly(),this.checkIndex(t),this.items.splice(t,e)},reverse:function(){this.checkReadOnly(),this.items.reverse()},slice:function(t,e){this.checkReadOnly();var n=this.$$name.substr(this.$$name.lastIndexOf("$")+1);return new(System.Collections.Generic.List$1(Bridge.unroll(n)))(this.items.slice(t,e))},sort:function(t){this.checkReadOnly(),this.items.sort(t||System.Collections.Generic.Comparer$1.$default.compare)},splice:function(t,e,n){this.checkReadOnly(),this.items.splice(t,e,n)},unshift:function(){this.checkReadOnly(),this.items.unshift()},toArray:function(){return Bridge.toArray(this)},checkReadOnly:function(){if(this.readOnly)throw new System.NotSupportedException},binarySearch:function(t,e,n,r){return 1===arguments.length&&(n=t,t=null),2===arguments.length&&(n=t,r=e,t=null,e=null),Bridge.isNumber(t)||(t=0),Bridge.isNumber(e)||(e=this.items.length),r||(r=System.Collections.Generic.Comparer$1.$default),System.Array.binarySearch(this.items,t,e,n,r)},convertAll:function(t,e){var n,r;if(!Bridge.hasValue(e))throw new System.ArgumentNullException("converter is null.");for(n=new(System.Collections.Generic.List$1(t))(this.items.length),r=0;r<this.items.length;r++)n.items[r]=e(this.items[r]);return n}}})),Bridge.define("System.Collections.ObjectModel.ReadOnlyCollection$1",(function(t){return{inherits:[System.Collections.Generic.List$1(t),System.Collections.Generic.IReadOnlyList$1(t)],ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException("list");if(System.Collections.Generic.List$1(t).ctor.call(this,[]),this.readOnly=!0,"[object Array]"===Object.prototype.toString.call(e))this.items=e;else if(Bridge.is(e,System.Collections.Generic.List$1(t))){var n=this;this.items=e.items,e.onClear((function(t){n.items=t.items}))}else Bridge.is(e,System.Collections.IEnumerable)&&(this.items=Bridge.toArray(e))}}})),Bridge.define("System.Threading.Tasks.Task",{inherits:[System.IDisposable],config:{alias:["dispose","System$IDisposable$dispose"]},ctor:function(t,e){this.$initialize(),this.action=t,this.state=e,this.exception=null,this.status=System.Threading.Tasks.TaskStatus.created,this.callbacks=[],this.result=null},statics:{delay:function(t,e){var n=new System.Threading.Tasks.TaskCompletionSource;return setTimeout((function(){n.setResult(e)}),t),n.task},fromResult:function(t){var e=new System.Threading.Tasks.Task;return e.status=System.Threading.Tasks.TaskStatus.ranToCompletion,e.result=t,e},run:function(t){var e=new System.Threading.Tasks.TaskCompletionSource;return setTimeout((function(){try{e.setResult(t())}catch(t){e.setException(System.Exception.create(t))}}),0),e.task},whenAll:function(t){var e,n,r,i=new System.Threading.Tasks.TaskCompletionSource,o=!1,s=[];if(Bridge.is(t,System.Collections.IEnumerable)?t=Bridge.toArray(t):Bridge.isArray(t)||(t=Array.prototype.slice.call(arguments,0)),0===t.length)return i.setResult([]),i.task;for(n=t.length,e=new Array(t.length),r=0;r<t.length;r++)!function(r){t[r].continueWith((function(t){switch(t.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:e[r]=t.getResult();break;case System.Threading.Tasks.TaskStatus.canceled:o=!0;break;case System.Threading.Tasks.TaskStatus.faulted:System.Array.addRange(s,t.exception.innerExceptions);break;default:throw new System.InvalidOperationException("Invalid task status: "+t.status)}0==--n&&(s.length>0?i.setException(s):o?i.setCanceled():i.setResult(e))}))}(r);return i.task},whenAny:function(t){if(Bridge.is(t,System.Collections.IEnumerable)?t=Bridge.toArray(t):Bridge.isArray(t)||(t=Array.prototype.slice.call(arguments,0)),!t.length)throw new System.ArgumentException("At least one task is required");for(var e=new System.Threading.Tasks.TaskCompletionSource,n=0;n<t.length;n++)t[n].continueWith((function(t){switch(t.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:e.trySetResult(t);break;case System.Threading.Tasks.TaskStatus.canceled:e.trySetCanceled();break;case System.Threading.Tasks.TaskStatus.faulted:e.trySetException(t.exception.innerExceptions);break;default:throw new System.InvalidOperationException("Invalid task status: "+t.status)}}));return e.task},fromCallback:function(t,e){var n,r=new System.Threading.Tasks.TaskCompletionSource,i=Array.prototype.slice.call(arguments,2);return n=function(t){r.setResult(t)},i.push(n),t[e].apply(t,i),r.task},fromCallbackResult:function(t,e,n){var r,i=new System.Threading.Tasks.TaskCompletionSource,o=Array.prototype.slice.call(arguments,3);return r=function(t){i.setResult(t)},n(o,r),t[e].apply(t,o),i.task},fromCallbackOptions:function(t,e,n){var r,i=new System.Threading.Tasks.TaskCompletionSource,o=Array.prototype.slice.call(arguments,3);return r=function(t){i.setResult(t)},o[0]=o[0]||{},o[0][n]=r,t[e].apply(t,o),i.task},fromPromise:function(t,e,n,r){var i=new System.Threading.Tasks.TaskCompletionSource;return t.then||(t=t.promise()),"number"==typeof e?e=function(t){return function(){return arguments[t>=0?t:arguments.length+t]}}(e):"function"!=typeof e&&(e=function(){return Array.prototype.slice.call(arguments,0)}),t.then((function(){i.setResult(e?e.apply(null,arguments):Array.prototype.slice.call(arguments,0))}),(function(){i.setException(n?n.apply(null,arguments):new Bridge.PromiseException(Array.prototype.slice.call(arguments,0)))}),r),i.task}},continueWith:function(t,e){var n=new System.Threading.Tasks.TaskCompletionSource,r=this,i=e?function(){n.setResult(t(r))}:function(){try{n.setResult(t(r))}catch(t){n.setException(System.Exception.create(t))}};return this.isCompleted()?setTimeout(i,0):this.callbacks.push(i),n.task},start:function(){if(this.status!==System.Threading.Tasks.TaskStatus.created)throw new System.InvalidOperationException("Task was already started.");var t=this;this.status=System.Threading.Tasks.TaskStatus.running,setTimeout((function(){try{var e=t.action(t.state);delete t.action,delete t.state,t.complete(e)}catch(e){t.fail(new System.AggregateException(null,[System.Exception.create(e)]))}}),0)},runCallbacks:function(){var t=this;setTimeout((function(){for(var e=0;e<t.callbacks.length;e++)t.callbacks[e](t);delete t.callbacks}),0)},complete:function(t){return!this.isCompleted()&&(this.result=t,this.status=System.Threading.Tasks.TaskStatus.ranToCompletion,this.runCallbacks(),!0)},fail:function(t){return!this.isCompleted()&&(this.exception=t,this.status=System.Threading.Tasks.TaskStatus.faulted,this.runCallbacks(),!0)},cancel:function(){return!this.isCompleted()&&(this.status=System.Threading.Tasks.TaskStatus.canceled,this.runCallbacks(),!0)},isCanceled:function(){return this.status===System.Threading.Tasks.TaskStatus.canceled},isCompleted:function(){return this.status===System.Threading.Tasks.TaskStatus.ranToCompletion||this.status===System.Threading.Tasks.TaskStatus.canceled||this.status===System.Threading.Tasks.TaskStatus.faulted},isFaulted:function(){return this.status===System.Threading.Tasks.TaskStatus.faulted},_getResult:function(t){switch(this.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:return this.result;case System.Threading.Tasks.TaskStatus.canceled:var e=new System.Threading.Tasks.TaskCanceledException(null,this);throw t?e:new System.AggregateException(null,[e]);case System.Threading.Tasks.TaskStatus.faulted:throw t?this.exception.innerExceptions.getCount()>0?this.exception.innerExceptions.get(0):null:this.exception;default:throw new System.InvalidOperationException("Task is not yet completed.")}},getResult:function(){return this._getResult(!1)},dispose:function(){},getAwaiter:function(){return this},getAwaitedResult:function(){return this._getResult(!0)}}),Bridge.define("System.Threading.Tasks.TaskStatus",{$kind:"enum",$statics:{created:0,waitingForActivation:1,waitingToRun:2,running:3,waitingForChildrenToComplete:4,ranToCompletion:5,canceled:6,faulted:7}}),Bridge.define("System.Threading.Tasks.TaskCompletionSource",{ctor:function(){this.$initialize(),this.task=new System.Threading.Tasks.Task,this.task.status=System.Threading.Tasks.TaskStatus.running},setCanceled:function(){if(!this.task.cancel())throw new System.InvalidOperationException("Task was already completed.")},setResult:function(t){if(!this.task.complete(t))throw new System.InvalidOperationException("Task was already completed.")},setException:function(t){if(!this.trySetException(t))throw new System.InvalidOperationException("Task was already completed.")},trySetCanceled:function(){return this.task.cancel()},trySetResult:function(t){return this.task.complete(t)},trySetException:function(t){return Bridge.is(t,System.Exception)&&(t=[t]),this.task.fail(new System.AggregateException(null,t))}}),Bridge.define("System.Threading.CancellationTokenSource",{inherits:[System.IDisposable],config:{alias:["dispose","System$IDisposable$dispose"]},ctor:function(t){this.$initialize(),this.timeout="number"==typeof t&&t>=0?setTimeout(Bridge.fn.bind(this,this.cancel),t,-1):null,this.isCancellationRequested=!1,this.token=new System.Threading.CancellationToken(this),this.handlers=[]},cancel:function(t){var e,n,r;if(!this.isCancellationRequested){for(this.isCancellationRequested=!0,e=[],n=this.handlers,this.clean(),r=0;r<n.length;r++)try{n[r].f(n[r].s)}catch(n){if(t&&-1!==t)throw n;e.push(n)}if(e.length>0&&-1!==t)throw new System.AggregateException(null,e)}},cancelAfter:function(t){this.isCancellationRequested||(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(Bridge.fn.bind(this,this.cancel),t,-1))},register:function(t,e){if(this.isCancellationRequested)return t(e),new System.Threading.CancellationTokenRegistration;var n={f:t,s:e};return this.handlers.push(n),new System.Threading.CancellationTokenRegistration(this,n)},deregister:function(t){var e=this.handlers.indexOf(t);e>=0&&this.handlers.splice(e,1)},dispose:function(){this.clean()},clean:function(){if(this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.handlers=[],this.links){for(var t=0;t<this.links.length;t++)this.links[t].dispose();this.links=null}},statics:{createLinked:function(){var t,e,n=new System.Threading.CancellationTokenSource;for(n.links=[],t=Bridge.fn.bind(n,n.cancel),e=0;e<arguments.length;e++)n.links.push(arguments[e].register(t));return n}}}),Bridge.define("System.Threading.CancellationToken",{$kind:"struct",ctor:function(t){this.$initialize(),Bridge.is(t,System.Threading.CancellationTokenSource)||(t=t?System.Threading.CancellationToken.sourceTrue:System.Threading.CancellationToken.sourceFalse),this.source=t},getCanBeCanceled:function(){return!this.source.uncancellable},getIsCancellationRequested:function(){return this.source.isCancellationRequested},throwIfCancellationRequested:function(){if(this.source.isCancellationRequested)throw new System.OperationCanceledException(this)},register:function(t,e){return this.source.register(t,e)},getHashCode:function(){return Bridge.getHashCode(this.source)},equals:function(t){return t.source===this.source},equalsT:function(t){return t.source===this.source},statics:{sourceTrue:{isCancellationRequested:!0,register:function(t,e){return t(e),new System.Threading.CancellationTokenRegistration}},sourceFalse:{uncancellable:!0,isCancellationRequested:!1,register:function(){return new System.Threading.CancellationTokenRegistration}},getDefaultValue:function(){return new System.Threading.CancellationToken}}}),System.Threading.CancellationToken.none=new System.Threading.CancellationToken,Bridge.define("System.Threading.CancellationTokenRegistration",{inherits:function(){return[System.IDisposable,System.IEquatable$1(System.Threading.CancellationTokenRegistration)]},$kind:"struct",config:{alias:["dispose","System$IDisposable$dispose"]},ctor:function(t,e){this.$initialize(),this.cts=t,this.o=e},dispose:function(){this.cts&&(this.cts.deregister(this.o),this.cts=this.o=null)},equalsT:function(t){return this===t},equals:function(t){return this===t},statics:{getDefaultValue:function(){return new System.Threading.CancellationTokenRegistration}}}),l={isNull:function(t){return!Bridge.isDefined(t,!0)},isEmpty:function(t){return!(null!=t&&0!==t.length&&!Bridge.is(t,System.Collections.ICollection))&&0===t.getCount()},isNotEmptyOrWhitespace:function(t){return Bridge.isDefined(t,!0)&&!/^$|\s+/.test(t)},isNotNull:function(t){return Bridge.isDefined(t,!0)},isNotEmpty:function(t){return!Bridge.Validation.isEmpty(t)},email:function(t){return/^(")?(?:[^\."])(?:(?:[\.])?(?:[\w\-!#$%&'*+/=?^_`{|}~]))*\1@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/.test(t)},url:function(t){return/(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:\.\d{1,3}){3})(?!(?:\.\d{1,3}){2})(?!\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/.test(t)},alpha:function(t){return/^[a-zA-Z_]+$/.test(t)},alphaNum:function(t){return/^[a-zA-Z_]+$/.test(t)},creditCard:function(t,e){var n,r,i,o,s=!1;if("Visa"===e)n=/^4\d{3}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("MasterCard"===e)n=/^5[1-5]\d{2}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("Discover"===e)n=/^6011[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("AmericanExpress"===e)n=/^3[4,7]\d{13}$/;else if("DinersClub"===e)n=/^(3[0,6,8]\d{12})|(5[45]\d{14})$/;else{if(!t||t.length<13||t.length>19)return!1;n=/[^0-9 \-]+/,s=!0}if(!n.test(t))return!1;for(r=0,i=2-(t=t.split(s?"-":/[- ]/).join("")).length%2;i<=t.length;i+=2)r+=parseInt(t.charAt(i-1));for(i=t.length%2+1;i<t.length;i+=2)r+=(o=2*parseInt(t.charAt(i-1)))<10?o:o-9;return r%10==0}},Bridge.Validation=l,Bridge.define("System.Version",{inherits:function(){return[System.ICloneable,System.IComparable$1(System.Version),System.IEquatable$1(System.Version)]},statics:{separatorsArray:".",ZERO_CHAR_VALUE:48,appendPositiveNumber:function(t,e){var n,r=e.getLength();do{n=t%10,t=0|Bridge.Int.div(t,10),e.insert(r,String.fromCharCode(65535&(System.Version.ZERO_CHAR_VALUE+n|0)))}while(t>0)},parse:function(t){if(null==t)throw new System.ArgumentNullException("input");var e={v:new System.Version.VersionResult};if(e.v.init("input",!0),!System.Version.tryParseVersion(t,e))throw e.v.getVersionParseException();return e.v.m_parsedVersion},tryParse:function(t,e){var n,r={v:new System.Version.VersionResult};return r.v.init("input",!1),n=System.Version.tryParseVersion(t,r),e.v=r.v.m_parsedVersion,n},tryParseVersion:function(t,e){var n,r,i={},o={},s={},a={};if(null==t)return e.v.setFailure(System.Version.ParseFailureKind.ArgumentNullException),!1;if((r=(n=t.split(System.Version.separatorsArray)).length)<2||r>4)return e.v.setFailure(System.Version.ParseFailureKind.ArgumentException),!1;if(!System.Version.tryParseComponent(n[0],"version",e,i)||!System.Version.tryParseComponent(n[1],"version",e,o))return!1;if((r=r-2|0)>0){if(!System.Version.tryParseComponent(n[2],"build",e,s))return!1;if((r=r-1|0)>0){if(!System.Version.tryParseComponent(n[3],"revision",e,a))return!1;e.v.m_parsedVersion=new System.Version.$ctor3(i.v,o.v,s.v,a.v)}else e.v.m_parsedVersion=new System.Version.$ctor2(i.v,o.v,s.v)}else e.v.m_parsedVersion=new System.Version.$ctor1(i.v,o.v);return!0},tryParseComponent:function(t,e,n,r){return System.Int32.tryParse(t,r)?!(r.v<0&&(n.v.setFailure$1(System.Version.ParseFailureKind.ArgumentOutOfRangeException,e),1)):(n.v.setFailure$1(System.Version.ParseFailureKind.FormatException,t),!1)},op_Equality:function(t,e){return Bridge.referenceEquals(t,null)?Bridge.referenceEquals(e,null):t.equalsT(e)},op_Inequality:function(t,e){return!System.Version.op_Equality(t,e)},op_LessThan:function(t,e){if(null==t)throw new System.ArgumentNullException("v1");return t.compareTo(e)<0},op_LessThanOrEqual:function(t,e){if(null==t)throw new System.ArgumentNullException("v1");return t.compareTo(e)<=0},op_GreaterThan:function(t,e){return System.Version.op_LessThan(e,t)},op_GreaterThanOrEqual:function(t,e){return System.Version.op_LessThanOrEqual(e,t)}},_Major:0,_Minor:0,_Build:-1,_Revision:-1,config:{alias:["clone","System$ICloneable$clone","compareTo","System$IComparable$1$System$Version$compareTo","equalsT","System$IEquatable$1$System$Version$equalsT"]},$ctor3:function(t,e,n,r){if(this.$initialize(),t<0)throw new System.ArgumentOutOfRangeException("major","Cannot be < 0");if(e<0)throw new System.ArgumentOutOfRangeException("minor","Cannot be < 0");if(n<0)throw new System.ArgumentOutOfRangeException("build","Cannot be < 0");if(r<0)throw new System.ArgumentOutOfRangeException("revision","Cannot be < 0");this._Major=t,this._Minor=e,this._Build=n,this._Revision=r},$ctor2:function(t,e,n){if(this.$initialize(),t<0)throw new System.ArgumentOutOfRangeException("major","Cannot be < 0");if(e<0)throw new System.ArgumentOutOfRangeException("minor","Cannot be < 0");if(n<0)throw new System.ArgumentOutOfRangeException("build","Cannot be < 0");this._Major=t,this._Minor=e,this._Build=n},$ctor1:function(t,e){if(this.$initialize(),t<0)throw new System.ArgumentOutOfRangeException("major","Cannot be < 0");if(e<0)throw new System.ArgumentOutOfRangeException("minor","Cannot be < 0");this._Major=t,this._Minor=e},$ctor4:function(t){this.$initialize();var e=System.Version.parse(t);this._Major=e.getMajor(),this._Minor=e.getMinor(),this._Build=e.getBuild(),this._Revision=e.getRevision()},ctor:function(){this.$initialize(),this._Major=0,this._Minor=0},getMajor:function(){return this._Major},getMinor:function(){return this._Minor},getBuild:function(){return this._Build},getRevision:function(){return this._Revision},getMajorRevision:function(){return Bridge.Int.sxs(this._Revision>>16&65535)},getMinorRevision:function(){return Bridge.Int.sxs(65535&this._Revision)},clone:function(){var t=new System.Version.ctor;return t._Major=this._Major,t._Minor=this._Minor,t._Build=this._Build,t._Revision=this._Revision,t},compareTo$1:function(t){if(null==t)return 1;var e=Bridge.as(t,System.Version);if(System.Version.op_Equality(e,null))throw new System.ArgumentException("version should be of System.Version type");return this._Major!==e._Major?this._Major>e._Major?1:-1:this._Minor!==e._Minor?this._Minor>e._Minor?1:-1:this._Build!==e._Build?this._Build>e._Build?1:-1:this._Revision!==e._Revision?this._Revision>e._Revision?1:-1:0},compareTo:function(t){return System.Version.op_Equality(t,null)?1:this._Major!==t._Major?this._Major>t._Major?1:-1:this._Minor!==t._Minor?this._Minor>t._Minor?1:-1:this._Build!==t._Build?this._Build>t._Build?1:-1:this._Revision!==t._Revision?this._Revision>t._Revision?1:-1:0},equals:function(t){return this.equalsT(Bridge.as(t,System.Version))},equalsT:function(t){return!System.Version.op_Equality(t,null)&&this._Major===t._Major&&this._Minor===t._Minor&&this._Build===t._Build&&this._Revision===t._Revision},getHashCode:function(){var t=0;return t|=(15&this._Major)<<28,t|=(255&this._Minor)<<20,(t|=(255&this._Build)<<12)|4095&this._Revision},toString:function(){return-1===this._Build?this.toString$1(2):-1===this._Revision?this.toString$1(3):this.toString$1(4)},toString$1:function(t){var e;switch(t){case 0:return"";case 1:return this._Major.toString();case 2:return e=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,e),e.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,e),e.toString();default:if(-1===this._Build)throw new System.ArgumentException("Build should be > 0 if fieldCount > 2","fieldCount");if(3===t)return e=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,e),e.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,e),e.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Build,e),e.toString();if(-1===this._Revision)throw new System.ArgumentException("Revision should be > 0 if fieldCount > 3","fieldCount");if(4===t)return e=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,e),e.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,e),e.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Build,e),e.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Revision,e),e.toString();throw new System.ArgumentException("Should be < 5","fieldCount")}}}),Bridge.define("System.Version.ParseFailureKind",{$kind:"enum",statics:{ArgumentNullException:0,ArgumentException:1,ArgumentOutOfRangeException:2,FormatException:3}}),Bridge.define("System.Version.VersionResult",{$kind:"struct",statics:{getDefaultValue:function(){return new System.Version.VersionResult}},m_parsedVersion:null,m_failure:0,m_exceptionArgument:null,m_argumentName:null,m_canThrow:!1,ctor:function(){this.$initialize()},init:function(t,e){this.m_canThrow=e,this.m_argumentName=t},setFailure:function(t){this.setFailure$1(t,"")},setFailure$1:function(t,e){if(this.m_failure=t,this.m_exceptionArgument=e,this.m_canThrow)throw this.getVersionParseException()},getVersionParseException:function(){switch(this.m_failure){case System.Version.ParseFailureKind.ArgumentNullException:return new System.ArgumentNullException(this.m_argumentName);case System.Version.ParseFailureKind.ArgumentException:return new System.ArgumentException("VersionString");case System.Version.ParseFailureKind.ArgumentOutOfRangeException:return new System.ArgumentOutOfRangeException(this.m_exceptionArgument,"Cannot be < 0");case System.Version.ParseFailureKind.FormatException:try{System.Int32.parse(this.m_exceptionArgument)}catch(t){if(t=System.Exception.create(t),Bridge.is(t,System.FormatException)||Bridge.is(t,System.OverflowException))return t;throw t}return new System.FormatException("InvalidString");default:return new System.ArgumentException("VersionString")}},getHashCode:function(){return Bridge.addHash([5139482776,this.m_parsedVersion,this.m_failure,this.m_exceptionArgument,this.m_argumentName,this.m_canThrow])},equals:function(t){return!!Bridge.is(t,System.Version.VersionResult)&&Bridge.equals(this.m_parsedVersion,t.m_parsedVersion)&&Bridge.equals(this.m_failure,t.m_failure)&&Bridge.equals(this.m_exceptionArgument,t.m_exceptionArgument)&&Bridge.equals(this.m_argumentName,t.m_argumentName)&&Bridge.equals(this.m_canThrow,t.m_canThrow)},$clone:function(t){var e=t||new System.Version.VersionResult;return e.m_parsedVersion=this.m_parsedVersion,e.m_failure=this.m_failure,e.m_exceptionArgument=this.m_exceptionArgument,e.m_argumentName=this.m_argumentName,e.m_canThrow=this.m_canThrow,e}}),Bridge.define("System.Attribute",{statics:{getCustomAttributes:function(t,e){if(null==t)throw new System.ArgumentNullException("element");if(null==e)throw new System.ArgumentNullException("attributeType");var n=t.at||[];return e?n.filter((function(t){return Bridge.is(t,e)})):n},getCustomAttributes$1:function(t,e,n){if(null==t)throw new System.ArgumentNullException("element");if(null==e)throw new System.ArgumentNullException("attributeType");return t.getCustomAttributes(e||n)}}}),Bridge.define("System.ComponentModel.INotifyPropertyChanged",{$kind:"interface"}),Bridge.define("System.ComponentModel.PropertyChangedEventArgs",{ctor:function(t,e,n){this.$initialize(),this.propertyName=t,this.newValue=e,this.oldValue=n}}),(c={}).convert={typeCodes:{Empty:0,Object:1,DBNull:2,Boolean:3,Char:4,SByte:5,Byte:6,Int16:7,UInt16:8,Int32:9,UInt32:10,Int64:11,UInt64:12,Single:13,Double:14,Decimal:15,DateTime:16,String:18},toBoolean:function(t,e){var n,r;switch(typeof t){case"boolean":return t;case"number":return 0!==t;case"string":if("true"===(n=t.toLowerCase().trim()))return!0;if("false"===n)return!1;throw new System.FormatException("String was not recognized as a valid Boolean.");case"object":if(null==t)return!1;if(t instanceof System.Decimal)return!t.isZero();if(System.Int64.is64Bit(t))return t.ne(0)}return r=c.internal.suggestTypeCode(t),c.internal.throwInvalidCastEx(r,c.convert.typeCodes.Boolean),c.convert.convertToType(c.convert.typeCodes.Boolean,t,e||null)},toChar:function(t,e,n){var r,i=c.convert.typeCodes;if(t instanceof System.Decimal&&(t=t.toFloat()),(t instanceof System.Int64||t instanceof System.UInt64)&&(t=t.toNumber()),r=typeof t,(n=n||c.internal.suggestTypeCode(t))===i.String&&null==t&&(r="string"),n!==i.Object)switch(r){case"boolean":c.internal.throwInvalidCastEx(i.Boolean,i.Char);case"number":return(c.internal.isFloatingType(n)||t%1!=0)&&c.internal.throwInvalidCastEx(n,i.Char),c.internal.validateNumberRange(t,i.Char,!0),t;case"string":if(null==t)throw new System.ArgumentNullException("value");if(1!==t.length)throw new System.FormatException("String must be exactly one character long.");return t.charCodeAt(0)}if(n===i.Object||"object"===r){if(null==t)return 0;Bridge.isDate(t)&&c.internal.throwInvalidCastEx(i.DateTime,i.Char)}return c.internal.throwInvalidCastEx(n,c.convert.typeCodes.Char),c.convert.convertToType(i.Char,t,e||null)},toSByte:function(t,e,n){return c.internal.toNumber(t,e||null,c.convert.typeCodes.SByte,n||null)},toByte:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.Byte)},toInt16:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.Int16)},toUInt16:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.UInt16)},toInt32:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.Int32)},toUInt32:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.UInt32)},toInt64:function(t,e){var n=c.internal.toNumber(t,e||null,c.convert.typeCodes.Int64);return new System.Int64(n)},toUInt64:function(t,e){var n=c.internal.toNumber(t,e||null,c.convert.typeCodes.UInt64);return new System.UInt64(n)},toSingle:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.Single)},toDouble:function(t,e){return c.internal.toNumber(t,e||null,c.convert.typeCodes.Double)},toDecimal:function(t,e){return t instanceof System.Decimal?t:new System.Decimal(c.internal.toNumber(t,e||null,c.convert.typeCodes.Decimal))},toDateTime:function(t,e){var n,r,i=c.convert.typeCodes;switch(typeof t){case"boolean":c.internal.throwInvalidCastEx(i.Boolean,i.DateTime);case"number":n=c.internal.suggestTypeCode(t),c.internal.throwInvalidCastEx(n,i.DateTime);case"string":return Bridge.Date.parse(t,e||null);case"object":if(null==t)return c.internal.getMinValue(i.DateTime);if(Bridge.isDate(t))return t;t instanceof System.Decimal&&c.internal.throwInvalidCastEx(i.Decimal,i.DateTime),t instanceof System.Int64&&c.internal.throwInvalidCastEx(i.Int64,i.DateTime),t instanceof System.UInt64&&c.internal.throwInvalidCastEx(i.UInt64,i.DateTime)}return r=c.internal.suggestTypeCode(t),c.internal.throwInvalidCastEx(r,c.convert.typeCodes.DateTime),c.convert.convertToType(i.DateTime,t,e||null)},toString:function(t,e,n){var r=c.convert.typeCodes;switch(typeof t){case"boolean":return t?"True":"False";case"number":return(n||null)===r.Char?String.fromCharCode(t):isNaN(t)?"NaN":(t%1!=0&&(t=parseFloat(t.toPrecision(15))),t.toString());case"string":return t;case"object":return null==t?"":Bridge.isDate(t)?Bridge.Date.format(t,null,e||null):t instanceof System.Decimal?t.isInteger()?t.toFixed(0,4):t.toPrecision(t.precision()):System.Int64.is64Bit(t)?t.toString():t.format?t.format(null,e||null):Bridge.getTypeName(t)}return c.convert.convertToType(c.convert.typeCodes.String,t,e||null)},toNumberInBase:function(t,e,n){var r,i,o,s,a,u,l,g,h,m;if(2!==e&&8!==e&&10!==e&&16!==e)throw new System.ArgumentException("Invalid Base.");if(r=c.convert.typeCodes,null==t)return n===r.Int64?System.Int64.Zero:n===r.UInt64?System.UInt64.Zero:0;if(0===t.length)throw new System.ArgumentOutOfRangeException("Index was out of range. Must be non-negative and less than the size of the collection.");t=t.toLowerCase();var f=c.internal.getMinValue(n),d=c.internal.getMaxValue(n),y=!1,p=0;if("-"===t[p]){if(10!==e)throw new System.ArgumentException("String cannot contain a minus sign if the base is not 10.");if(f>=0)throw new System.OverflowException("The string was being parsed as an unsigned number and could not have a negative sign.");y=!0,++p}else"+"===t[p]&&++p;if(16===e&&t.length>=2&&"0"===t[p]&&"x"===t[p+1]&&(p+=2),2===e)i=c.internal.charsToCodes("01");else if(8===e)i=c.internal.charsToCodes("01234567");else if(10===e)i=c.internal.charsToCodes("0123456789");else{if(16!==e)throw new System.ArgumentException("Invalid Base.");i=c.internal.charsToCodes("0123456789abcdef")}for(o={},s=0;s<i.length;s++)o[i[s]]=s;if(a=i[0],u=i[i.length-1],n===r.Int64||n===r.UInt64){for(m=p;m<t.length;m++)if(!((h=t[m].charCodeAt(0))>=a&&h<=u))throw m===p?new System.FormatException("Could not find any recognizable digits."):new System.FormatException("Additional non-parsable characters are at the end of the string.");if((l=n===r.Int64?new System.Int64(Bridge.$Long.fromString(t,!1,e)):new System.UInt64(Bridge.$Long.fromString(t,!0,e))).toString(e)!==t)throw new System.OverflowException("Value was either too large or too small.");return l}for(l=0,g=d-f+1,m=p;m<t.length;m++){if(!((h=t[m].charCodeAt(0))>=a&&h<=u))throw m===p?new System.FormatException("Could not find any recognizable digits."):new System.FormatException("Additional non-parsable characters are at the end of the string.");if(l*=e,(l+=o[h])>c.internal.typeRanges.Int64_MaxValue)throw new System.OverflowException("Value was either too large or too small.")}if(y&&(l*=-1),l>d&&10!==e&&f<0&&(l-=g),l<f||l>d)throw new System.OverflowException("Value was either too large or too small.");return l},toStringInBase:function(t,e,n){var r,i,o,s,a,u,l,g;if(c.convert.typeCodes,2!==e&&8!==e&&10!==e&&16!==e)throw new System.ArgumentException("Invalid Base.");var h=c.internal.getMinValue(n),m=c.internal.getMaxValue(n),f=System.Int64.is64Bit(t);if(f){if(t.lt(h)||t.gt(m))throw new System.OverflowException("Value was either too large or too small for an unsigned byte.")}else if(t<h||t>m)throw new System.OverflowException("Value was either too large or too small for an unsigned byte.");if(r=!1,f)return 10===e?t.toString():t.value.toUnsigned().toString(e);if(t<0&&(10===e?(r=!0,t*=-1):t=m+1-h+t),2===e)i="01";else if(8===e)i="01234567";else if(10===e)i="0123456789";else{if(16!==e)throw new System.ArgumentException("Invalid Base.");i="0123456789abcdef"}for(o={},s=i.split(""),u=0;u<s.length;u++)a=s[u],o[u]=a;if(l="",0===t||f&&t.eq(0))l="0";else if(f)for(;t.gt(0);)g=t.mod(e),t=t.sub(g).div(e),l+=o[g.toNumber()];else for(;t>0;)t=(t-(g=t%e))/e,l+=o[g];return r&&(l+="-"),l.split("").reverse().join("")},toBase64String:function(t,e,n,r){var i;if(null==t)throw new System.ArgumentNullException("inArray");if(e=e||0,r=r||0,(n=null!=n?n:t.length)<0)throw new System.ArgumentOutOfRangeException("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(e<0)throw new System.ArgumentOutOfRangeException("offset","Value must be positive.");if(r<0||r>1)throw new System.ArgumentException("Illegal enum value.");if(e>(i=t.length)-n)throw new System.ArgumentOutOfRangeException("offset","Offset and length must refer to a position in the string.");if(0===i)return"";var o=1===r,s=c.internal.toBase64_CalculateAndValidateOutputLength(n,o),a=[];return a.length=s,c.internal.convertToBase64Array(a,t,e,n,o),a.join("")},toBase64CharArray:function(t,e,n,r,i,o){var s,a,u;if(null==t)throw new System.ArgumentNullException("inArray");if(null==r)throw new System.ArgumentNullException("outArray");if(n<0)throw new System.ArgumentOutOfRangeException("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(e<0)throw new System.ArgumentOutOfRangeException("offsetIn","Value must be positive.");if(i<0)throw new System.ArgumentOutOfRangeException("offsetOut","Value must be positive.");if((o=o||0)<0||o>1)throw new System.ArgumentException("Illegal enum value.");if(e>(s=t.length)-n)throw new System.ArgumentOutOfRangeException("offsetIn","Offset and length must refer to a position in the string.");if(0===s)return 0;var l=1===o;if(i>r.length-c.internal.toBase64_CalculateAndValidateOutputLength(n,l))throw new System.ArgumentOutOfRangeException("offsetOut","Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.");return a=[],u=c.internal.convertToBase64Array(a,t,e,n,l),c.internal.charsToCodes(a,r,i),u},fromBase64String:function(t){if(null==t)throw new System.ArgumentNullException("s");var e=t.split("");return c.internal.fromBase64CharPtr(e,0,e.length)},fromBase64CharArray:function(t,e,n){if(null==t)throw new System.ArgumentNullException("inArray");if(n<0)throw new System.ArgumentOutOfRangeException("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(e<0)throw new System.ArgumentOutOfRangeException("offset","Value must be positive.");if(e>t.length-n)throw new System.ArgumentOutOfRangeException("offset","Offset and length must refer to a position in the string.");var r=c.internal.codesToChars(t);return c.internal.fromBase64CharPtr(r,e,n)},convertToType:function(){throw new System.NotSupportedException("IConvertible interface is not supported.")}},c.internal={base64Table:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],typeRanges:{Char_MinValue:0,Char_MaxValue:65535,Byte_MinValue:0,Byte_MaxValue:255,SByte_MinValue:-128,SByte_MaxValue:127,Int16_MinValue:-32768,Int16_MaxValue:32767,UInt16_MinValue:0,UInt16_MaxValue:65535,Int32_MinValue:-2147483648,Int32_MaxValue:2147483647,UInt32_MinValue:0,UInt32_MaxValue:4294967295,Int64_MinValue:System.Int64.MinValue,Int64_MaxValue:System.Int64.MaxValue,UInt64_MinValue:System.UInt64.MinValue,UInt64_MaxValue:System.UInt64.MaxValue,Single_MinValue:-340282347e30,Single_MaxValue:340282347e30,Double_MinValue:-17976931348623157e292,Double_MaxValue:17976931348623157e292,Decimal_MinValue:System.Decimal.MinValue,Decimal_MaxValue:System.Decimal.MaxValue},base64LineBreakPosition:76,getTypeCodeName:function(t){var e,n,r,i=c.convert.typeCodes;if(null==c.internal.typeCodeNames){for(n in e={},i)i.hasOwnProperty(n)&&(e[i[n]]=n);c.internal.typeCodeNames=e}if(null==(r=c.internal.typeCodeNames[t]))throw System.ArgumentOutOfRangeException("typeCode","The specified typeCode is undefined.");return r},suggestTypeCode:function(t){var e=c.convert.typeCodes;switch(typeof t){case"boolean":return e.Boolean;case"number":return t%1!=0?e.Double:e.Int32;case"string":return e.String;case"object":if(Bridge.isDate(t))return e.DateTime;if(null!=t)return e.Object}return null},getMinValue:function(t){var e,n=c.convert.typeCodes;switch(t){case n.Char:return c.internal.typeRanges.Char_MinValue;case n.SByte:return c.internal.typeRanges.SByte_MinValue;case n.Byte:return c.internal.typeRanges.Byte_MinValue;case n.Int16:return c.internal.typeRanges.Int16_MinValue;case n.UInt16:return c.internal.typeRanges.UInt16_MinValue;case n.Int32:return c.internal.typeRanges.Int32_MinValue;case n.UInt32:return c.internal.typeRanges.UInt32_MinValue;case n.Int64:return c.internal.typeRanges.Int64_MinValue;case n.UInt64:return c.internal.typeRanges.UInt64_MinValue;case n.Single:return c.internal.typeRanges.Single_MinValue;case n.Double:return c.internal.typeRanges.Double_MinValue;case n.Decimal:return c.internal.typeRanges.Decimal_MinValue;case n.DateTime:return(e=new Date(0)).setFullYear(1),e;default:return null}},getMaxValue:function(t){var e=c.convert.typeCodes;switch(t){case e.Char:return c.internal.typeRanges.Char_MaxValue;case e.SByte:return c.internal.typeRanges.SByte_MaxValue;case e.Byte:return c.internal.typeRanges.Byte_MaxValue;case e.Int16:return c.internal.typeRanges.Int16_MaxValue;case e.UInt16:return c.internal.typeRanges.UInt16_MaxValue;case e.Int32:return c.internal.typeRanges.Int32_MaxValue;case e.UInt32:return c.internal.typeRanges.UInt32_MaxValue;case e.Int64:return c.internal.typeRanges.Int64_MaxValue;case e.UInt64:return c.internal.typeRanges.UInt64_MaxValue;case e.Single:return c.internal.typeRanges.Single_MaxValue;case e.Double:return c.internal.typeRanges.Double_MaxValue;case e.Decimal:return c.internal.typeRanges.Decimal_MaxValue;default:throw new System.ArgumentOutOfRangeException("typeCode","The specified typeCode is undefined.")}},isFloatingType:function(t){var e=c.convert.typeCodes;return t===e.Single||t===e.Double||t===e.Decimal},toNumber:function(t,e,n,r){var i,o,s=c.convert.typeCodes,a=typeof t,u=c.internal.isFloatingType(n);switch(r===s.String&&(a="string"),(System.Int64.is64Bit(t)||t instanceof System.Decimal)&&(a="number"),a){case"boolean":return t?1:0;case"number":return n===s.Decimal?(c.internal.validateNumberRange(t,n,!0),new System.Decimal(t,e)):n===s.Int64?(c.internal.validateNumberRange(t,n,!0),new System.Int64(t)):n===s.UInt64?(c.internal.validateNumberRange(t,n,!0),new System.UInt64(t)):(System.Int64.is64Bit(t)?t=t.toNumber():t instanceof System.Decimal&&(t=t.toFloat()),u||t%1==0||(t=c.internal.roundToInt(t,n)),u&&(i=c.internal.getMinValue(n),t>c.internal.getMaxValue(n)?t=1/0:t<i&&(t=-1/0)),c.internal.validateNumberRange(t,n,!1),t);case"string":if(null==t){if(null!=e)throw new System.ArgumentNullException("String","Value cannot be null.");return 0}if(u)if(n===s.Decimal){if(!/^[+-]?(\d+|\d+.|\d*\.\d+)$/.test(t)&&!/^[+-]?[0-9]+$/.test(t))throw new System.FormatException("Input string was not in a correct format.");t=System.Decimal(t,e)}else{if(!/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/.test(t))throw new System.FormatException("Input string was not in a correct format.");t=parseFloat(t)}else{if(!/^[+-]?[0-9]+$/.test(t))throw new System.FormatException("Input string was not in a correct format.");o=t,n===s.Int64?o!==(t=new System.Int64(t)).toString()&&this.throwOverflow(c.internal.getTypeCodeName(n)):n===s.UInt64?o!==(t=new System.UInt64(t)).toString()&&this.throwOverflow(c.internal.getTypeCodeName(n)):t=parseInt(t,10)}if(isNaN(t))throw new System.FormatException("Input string was not in a correct format.");return c.internal.validateNumberRange(t,n,!0),t;case"object":if(null==t)return 0;Bridge.isDate(t)&&c.internal.throwInvalidCastEx(c.convert.typeCodes.DateTime,n)}return r=r||c.internal.suggestTypeCode(t),c.internal.throwInvalidCastEx(r,n),c.convert.convertToType(n,t,e)},validateNumberRange:function(t,e,n){var r=c.convert.typeCodes,i=c.internal.getMinValue(e),o=c.internal.getMaxValue(e),s=c.internal.getTypeCodeName(e);(e!==r.Single&&e!==r.Double||n||t!==1/0&&t!==-1/0)&&(e===r.Decimal||e===r.Int64||e===r.UInt64?e===r.Decimal?(System.Int64.is64Bit(t)||(i.gt(t)||o.lt(t))&&this.throwOverflow(s),t=new System.Decimal(t)):e===r.Int64?(t instanceof System.UInt64?t.gt(System.Int64.MaxValue)&&this.throwOverflow(s):t instanceof System.Decimal?(t.gt(new System.Decimal(o))||t.lt(new System.Decimal(i)))&&this.throwOverflow(s):t instanceof System.Int64||(i.toNumber()>t||o.toNumber()<t)&&this.throwOverflow(s),t=new System.Int64(t)):e===r.UInt64&&(t instanceof System.Int64?t.isNegative()&&this.throwOverflow(s):t instanceof System.Decimal?(t.gt(new System.Decimal(o))||t.lt(new System.Decimal(i)))&&this.throwOverflow(s):t instanceof System.UInt64||(i.toNumber()>t||o.toNumber()<t)&&this.throwOverflow(s),t=new System.UInt64(t)):(t<i||t>o)&&this.throwOverflow(s))},throwOverflow:function(t){throw new System.OverflowException("Value was either too large or too small for '"+t+"'.")},roundToInt:function(t,e){var n,r;if(t%1==0)return t;var i=t-(n=t>=0?Math.floor(t):-1*Math.floor(-t)),o=c.internal.getMinValue(e),s=c.internal.getMaxValue(e);if(t>=0){if(t<s+.5)return(i>.5||.5===i&&0!=(1&n))&&++n,n}else if(t>=o-.5)return(i<-.5||-.5===i&&0!=(1&n))&&--n,n;throw r=c.internal.getTypeCodeName(e),new System.OverflowException("Value was either too large or too small for an '"+r+"'.")},toBase64_CalculateAndValidateOutputLength:function(t,e){var n,r=c.internal.base64LineBreakPosition,i=4*~~(t/3);if(0===(i+=t%3!=0?4:0))return 0;if(e&&(n=~~(i/r),i%r==0&&--n,i+=2*n),i>2147483647)throw new System.OutOfMemoryException;return i},convertToBase64Array:function(t,e,n,r,i){for(var o=c.internal.base64Table,s=c.internal.base64LineBreakPosition,a=r%3,u=n+(r-a),l=0,g=0,h=n;h<u;h+=3)i&&(l===s&&(t[g++]="\r",t[g++]="\n",l=0),l+=4),t[g]=o[(252&e[h])>>2],t[g+1]=o[(3&e[h])<<4|(240&e[h+1])>>4],t[g+2]=o[(15&e[h+1])<<2|(192&e[h+2])>>6],t[g+3]=o[63&e[h+2]],g+=4;switch(h=u,i&&0!==a&&l===c.internal.base64LineBreakPosition&&(t[g++]="\r",t[g++]="\n"),a){case 2:t[g]=o[(252&e[h])>>2],t[g+1]=o[(3&e[h])<<4|(240&e[h+1])>>4],t[g+2]=o[(15&e[h+1])<<2],t[g+3]=o[64],g+=4;break;case 1:t[g]=o[(252&e[h])>>2],t[g+1]=o[(3&e[h])<<4],t[g+2]=o[64],t[g+3]=o[64],g+=4}return g},fromBase64CharPtr:function(t,e,n){var r,i,o;if(n<0)throw new System.ArgumentOutOfRangeException("inputLength","Index was out of range. Must be non-negative and less than the size of the collection.");if(e<0)throw new System.ArgumentOutOfRangeException("offset","Value must be positive.");for(;n>0&&(" "===(r=t[e+n-1])||"\n"===r||"\r"===r||"\t"===r);)n--;if(0>(i=c.internal.fromBase64_ComputeResultLength(t,e,n)))throw new System.InvalidOperationException("Contract voilation: 0 <= resultLength.");return(o=[]).length=i,c.internal.fromBase64_Decode(t,e,n,o,0,i),o},fromBase64_Decode:function(t,e,n,r,i,o){for(var s,a,u=i,l="A".charCodeAt(0),c="a".charCodeAt(0),g="0".charCodeAt(0),h="=".charCodeAt(0),m="+".charCodeAt(0),f="/".charCodeAt(0),d=" ".charCodeAt(0),y="\t".charCodeAt(0),p="\n".charCodeAt(0),S="\r".charCodeAt(0),C="Z".charCodeAt(0)-"A".charCodeAt(0),x="9".charCodeAt(0)-"0".charCodeAt(0),v=e+n,w=i+o,b=255,B=!1,I=!1;;){if(e>=v){B=!0;break}if(s=t[e].charCodeAt(0),e++,s-l>>>0<=C)s-=l;else if(s-c>>>0<=C)s-=c-26;else if(s-g>>>0<=x)s-=g-52;else switch(s){case m:s=62;break;case f:s=63;break;case S:case p:case d:case y:continue;case h:I=!0;break;default:throw new System.FormatException("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.")}if(I)break;if(0!=(2147483648&(b=b<<6|s))){if(w-i<3)return-1;r[i]=255&b>>16,r[i+1]=255&b>>8,r[i+2]=255&b,i+=3,b=255}}if(!B&&!I)throw new System.InvalidOperationException("Contract violation: should never get here.");if(I){if(s!==h)throw new System.InvalidOperationException("Contract violation: currCode == intEq.");if(e===v){if(0==(2147483648&(b<<=6)))throw new System.FormatException("Invalid length for a Base-64 char array or string.");if(w-i<2)return-1;r[i]=255&b>>16,r[i+1]=255&b>>8,i+=2,b=255}else{for(;e<v-1&&(" "===(a=t[e])||"\n"===a||"\r"===a||"\t"===a);)e++;if(e!==v-1||"="!==t[e])throw new System.FormatException("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.");if(0==(2147483648&(b<<=12)))throw new System.FormatException("Invalid length for a Base-64 char array or string.");if(w-i<1)return-1;r[i]=255&b>>16,i++,b=255}}if(255!==b)throw new System.FormatException("Invalid length for a Base-64 char array or string.");return i-u},fromBase64_ComputeResultLength:function(t,e,n){var r;if(n<0)throw new System.ArgumentOutOfRangeException("inputLength","Index was out of range. Must be non-negative and less than the size of the collection.");for(var i=e+n,o=n,s=0;e<i;)r=t[e],e++,r<=" "?o--:"="===r&&(o--,s++);if(0>o)throw new System.InvalidOperationException("Contract violation: 0 <= usefulInputLength.");if(0>s)throw new System.InvalidOperationException("Contract violation: 0 <= padding.");if(0!==s)if(1===s)s=2;else{if(2!==s)throw new System.FormatException("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.");s=1}return 3*~~(o/4)+s},charsToCodes:function(t,e,n){if(null==t)return null;n=n||0,null==e&&((e=[]).length=t.length);for(var r=0;r<t.length;r++)e[r+n]=t[r].charCodeAt(0);return e},codesToChars:function(t,e){var n,r;if(null==t)return null;for(e=e||[],n=0;n<t.length;n++)r=t[n],e[n]=String.fromCharCode(r);return e},throwInvalidCastEx:function(t,e){var n=c.internal.getTypeCodeName(t),r=c.internal.getTypeCodeName(e);throw new System.InvalidCastException("Invalid cast from '"+n+"' to '"+r+"'.")}},System.Convert=c.convert,Bridge.define("System.Net.WebSockets.ClientWebSocket",{inherits:[System.IDisposable],ctor:function(){this.$initialize(),this.messageBuffer=[],this.state="none",this.options=new System.Net.WebSockets.ClientWebSocketOptions,this.disposed=!1,this.closeStatus=null,this.closeStatusDescription=null},getCloseStatus:function(){return this.closeStatus},getState:function(){return this.state},getCloseStatusDescription:function(){return this.closeStatusDescription},getSubProtocol:function(){return this.socket?this.socket.protocol:null},connectAsync:function(t){if("none"!==this.state)throw new System.InvalidOperationException("Socket is not in initial state");this.options.setToReadOnly(),this.state="connecting";var e=new System.Threading.Tasks.TaskCompletionSource,n=this;try{this.socket=new WebSocket(t.getAbsoluteUri(),this.options.requestedSubProtocols),this.socket.binaryType="arraybuffer",this.socket.onopen=function(){n.state="open",e.setResult(null)},this.socket.onmessage=function(t){var e,r,i=t.data,o={bytes:[]};if("string"==typeof i){for(e=0;e<i.length;++e)o.bytes.push(i.charCodeAt(e));return o.messageType="text",void n.messageBuffer.push(o)}if(i instanceof ArrayBuffer){for(r=new Uint8Array(i),e=0;e<r.length;e++)o.bytes.push(r[e]);return o.messageType="binary",void n.messageBuffer.push(o)}throw new System.ArgumentException("Invalid message type.")},this.socket.onclose=function(t){n.state="closed",n.closeStatus=t.code,n.closeStatusDescription=t.reason}}catch(t){e.setException(System.Exception.create(t))}return e.task},sendAsync:function(t,e){var n,r,i,o,s;this.throwIfNotConnected(),n=new System.Threading.Tasks.TaskCompletionSource;try{switch(r=t.getArray(),e){case"binary":for(i=new ArrayBuffer(r.length),o=new Int8Array(i),s=0;s<r.length;s++)o[s]=r[s];break;case"text":i=String.fromCharCode.apply(null,r)}"close"===e?this.socket.close():this.socket.send(i),n.setResult(null)}catch(t){n.setException(System.Exception.create(t))}return n.task},receiveAsync:function(t,e){this.throwIfNotConnected();var n=new System.Threading.Tasks.TaskCompletionSource,r=this,i=Bridge.fn.bind(this,(function(){var o,s,a,u,l;try{if(e.getIsCancellationRequested())return void n.setException(new System.Threading.Tasks.TaskCanceledException("Receive has been cancelled.",n.task));if(0===r.messageBuffer.length)return void System.Threading.Tasks.Task.delay(0).continueWith(i);for(o=r.messageBuffer[0],s=t.getArray(),o.bytes.length<=s.length?(r.messageBuffer.shift(),a=o.bytes,u=!0):(a=o.bytes.slice(0,s.length),o.bytes=o.bytes.slice(s.length,o.bytes.length),u=!1),l=0;l<a.length;l++)s[l]=a[l];n.setResult(new System.Net.WebSockets.WebSocketReceiveResult(a.length,o.messageType,u))}catch(t){n.setException(System.Exception.create(t))}}),arguments);return i(),n.task},closeAsync:function(t,e,n){if(this.throwIfNotConnected(),"open"!==this.state)throw new System.InvalidOperationException("Socket is not in connected state");var r=new System.Threading.Tasks.TaskCompletionSource,i=this,o=function(){"closed"!==i.state?n.getIsCancellationRequested()?r.setException(new System.Threading.Tasks.TaskCanceledException("Closing has been cancelled.",r.task)):System.Threading.Tasks.Task.delay(0).continueWith(o):r.setResult(null)};try{this.state="closesent",this.socket.close(t,e)}catch(t){r.setException(System.Exception.create(t))}return o(),r.task},closeOutputAsync:function(t,e){if(this.throwIfNotConnected(),"open"!==this.state)throw new System.InvalidOperationException("Socket is not in connected state");var n=new System.Threading.Tasks.TaskCompletionSource;try{this.state="closesent",this.socket.close(t,e),n.setResult(null)}catch(t){n.setException(System.Exception.create(t))}return n.task},abort:function(){this.dispose()},dispose:function(){this.disposed||(this.disposed=!0,this.messageBuffer=[],"open"===state&&(this.state="closesent",this.socket.close()))},throwIfNotConnected:function(){if(this.disposed)throw new System.InvalidOperationException("Socket is disposed.");if(1!==this.socket.readyState)throw new System.InvalidOperationException("Socket is not connected.")}}),Bridge.define("System.Net.WebSockets.ClientWebSocketOptions",{ctor:function(){this.$initialize(),this.isReadOnly=!1,this.requestedSubProtocols=[]},setToReadOnly:function(){if(this.isReadOnly)throw new System.InvalidOperationException("Options are already readonly.");this.isReadOnly=!0},addSubProtocol:function(t){if(this.isReadOnly)throw new System.InvalidOperationException("Socket already started.");if(this.requestedSubProtocols.indexOf(t)>-1)throw new System.ArgumentException("Socket cannot have duplicate sub-protocols.","subProtocol");this.requestedSubProtocols.push(t)}}),Bridge.define("System.Net.WebSockets.WebSocketReceiveResult",{ctor:function(t,e,n,r,i){this.$initialize(),this.count=t,this.messageType=e,this.endOfMessage=n,this.closeStatus=r,this.closeStatusDescription=i},getCount:function(){return this.count},getMessageType:function(){return this.messageType},getEndOfMessage:function(){return this.endOfMessage},getCloseStatus:function(){return this.closeStatus},getCloseStatusDescription:function(){return this.closeStatusDescription}}),Bridge.define("System.Uri",{ctor:function(t){this.$initialize(),this.absoluteUri=t},getAbsoluteUri:function(){return this.absoluteUri}}),function(t,e){var n,r,i,o,s,a,u,l,c,g,h,m={Identity:function(t){return t},True:function(){return!0},Blank:function(){}},f="number",d="string",y=typeof e,p="function",S={"":m.Identity},C={createLambda:function(t){var e,n,r,i,o,s,a,u,l,c,g;if(null==t)return m.Identity;if(typeof t===d){if(null!=(e=S[t]))return e;if(-1===t.indexOf("=>")){for(n=new RegExp("[$]+","g"),r=0;null!=(i=n.exec(t));)(o=i[0].length)>r&&(r=o);for(s=[],a=1;a<=r;a++){for(u="",l=0;l<a;l++)u+="$";s.push(u)}return c=Array.prototype.join.call(s,","),e=new Function(c,"return "+t),S[t]=e,e}return g=t.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/),e=new Function(g[1],"return "+g[2]),S[t]=e,e}return t},isIEnumerable:function(t){if(typeof Enumerator!==y)try{return new Enumerator(t),!0}catch(t){}return!1},defineProperty:null!=Object.defineProperties?function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(t,e,n){t[e]=n},compare:function(t,e){return t===e?0:t>e?1:-1},dispose:function(t){null!=t&&t.dispose()}},x=function(t,e,r){var i=new n,o=0;this.getCurrent=i.getCurrent,this.reset=function(){throw new Error("Reset is not supported")},this.moveNext=function(){try{switch(o){case 0:o=1,t();case 1:return!!e.apply(i)||(this.dispose(),!1);case 2:return!1}}catch(t){throw this.dispose(),t}},this.dispose=function(){if(1==o)try{r()}finally{o=2}},this.getCurrent$1=this.getCurrent,this.System$Collections$IEnumerator$getCurrent=this.getCurrent,this.System$Collections$IEnumerator$moveNext=this.moveNext,this.System$Collections$IEnumerator$reset=this.reset};x.$$inherits=[],Bridge.Class.addExtend(x,[System.IDisposable,System.Collections.IEnumerator]),n=function(){var t=null;this.getCurrent=function(){return t},this.yieldReturn=function(e){return t=e,!0},this.yieldBreak=function(){return!1}},r=function(t){this.getEnumerator=t},r.$$inherits=[],Bridge.Class.addExtend(r,[System.Collections.IEnumerable]),(r.Utils={}).createLambda=function(t){return C.createLambda(t)},r.Utils.createEnumerable=function(t){return new r(t)},r.Utils.createEnumerator=function(t,e,n){return new x(t,e,n)},r.Utils.extendTo=function(t){var e,n,i,o=t.prototype;for(n in t===Array?(e=u.prototype,C.defineProperty(o,"getSource",(function(){return this}))):(e=r.prototype,C.defineProperty(o,"getEnumerator",(function(){return r.from(this).getEnumerator()}))),e)i=e[n],o[n]!=i&&(null==o[n]||o[n+="ByLinq"]!=i)&&i instanceof Function&&C.defineProperty(o,n,i)},r.choice=function(){var t=arguments;return new r((function(){return new x((function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t}),(function(){return this.yieldReturn(t[Math.floor(Math.random()*t.length)])}),m.Blank)}))},r.cycle=function(){var t=arguments;return new r((function(){var e=0;return new x((function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t}),(function(){return e>=t.length&&(e=0),this.yieldReturn(t[e++])}),m.Blank)}))},i=new r((function(){return new x(m.Blank,(function(){return!1}),m.Blank)})),r.empty=function(){return i},r.from=function(t){if(null==t)return r.empty();if(t instanceof r)return t;if(typeof t==f||"boolean"==typeof t)return r.repeat(t,1);if(typeof t==d)return new r((function(){var e=0;return new x(m.Blank,(function(){return e<t.length&&this.yieldReturn(t.charCodeAt(e++))}),m.Blank)}));var e=Bridge.as(t,System.Collections.IEnumerable);if(e)return new r((function(){var t;return new x((function(){t=Bridge.getEnumerator(e)}),(function(){return!!t.moveNext()&&this.yieldReturn(t.getCurrent())}),(function(){var e=Bridge.as(t,System.IDisposable);e&&e.dispose()}))}));if(typeof t!=p){if(typeof t.length==f)return new u(t);if(!(t instanceof Object)&&C.isIEnumerable(t))return new r((function(){var e,n=!0;return new x((function(){e=new Enumerator(t)}),(function(){return n?n=!1:e.moveNext(),!e.atEnd()&&this.yieldReturn(e.item())}),m.Blank)}));if("object"==typeof Windows&&typeof t.first===p)return new r((function(){var e,n=!0;return new x((function(){e=t.first()}),(function(){return n?n=!1:e.moveNext(),e.hasCurrent?this.yieldReturn(e.current):this.yieldBreak()}),m.Blank)}))}return new r((function(){var e=[],n=0;return new x((function(){var n,r;for(n in t)(r=t[n])instanceof Function||!Object.prototype.hasOwnProperty.call(t,n)||e.push({key:n,value:r})}),(function(){return n<e.length&&this.yieldReturn(e[n++])}),m.Blank)}))},r.make=function(t){return r.repeat(t,1)},r.matches=function(t,e,n){return null==n&&(n=""),e instanceof RegExp&&(n+=e.ignoreCase?"i":"",n+=e.multiline?"m":"",e=e.source),-1===n.indexOf("g")&&(n+="g"),new r((function(){var r;return new x((function(){r=new RegExp(e,n)}),(function(){var e=r.exec(t);return!!e&&this.yieldReturn(e)}),m.Blank)}))},r.range=function(t,e,n){return null==n&&(n=1),new r((function(){var r,i=0;return new x((function(){r=t-n}),(function(){return i++<e?this.yieldReturn(r+=n):this.yieldBreak()}),m.Blank)}))},r.rangeDown=function(t,e,n){return null==n&&(n=1),new r((function(){var r,i=0;return new x((function(){r=t+n}),(function(){return i++<e?this.yieldReturn(r-=n):this.yieldBreak()}),m.Blank)}))},r.rangeTo=function(t,e,n){return null==n&&(n=1),new r(t<e?function(){var r;return new x((function(){r=t-n}),(function(){var t=r+=n;return t<=e?this.yieldReturn(t):this.yieldBreak()}),m.Blank)}:function(){var r;return new x((function(){r=t+n}),(function(){var t=r-=n;return t>=e?this.yieldReturn(t):this.yieldBreak()}),m.Blank)})},r.repeat=function(t,e){return null!=e?r.repeat(t).take(e):new r((function(){return new x(m.Blank,(function(){return this.yieldReturn(t)}),m.Blank)}))},r.repeatWithFinalize=function(t,e){return t=C.createLambda(t),e=C.createLambda(e),new r((function(){var n;return new x((function(){n=t()}),(function(){return this.yieldReturn(n)}),(function(){null!=n&&(e(n),n=null)}))}))},r.generate=function(t,e){return null!=e?r.generate(t).take(e):(t=C.createLambda(t),new r((function(){return new x(m.Blank,(function(){return this.yieldReturn(t())}),m.Blank)})))},r.toInfinity=function(t,e){return null==t&&(t=0),null==e&&(e=1),new r((function(){var n;return new x((function(){n=t-e}),(function(){return this.yieldReturn(n+=e)}),m.Blank)}))},r.toNegativeInfinity=function(t,e){return null==t&&(t=0),null==e&&(e=1),new r((function(){var n;return new x((function(){n=t+e}),(function(){return this.yieldReturn(n-=e)}),m.Blank)}))},r.unfold=function(t,e){return e=C.createLambda(e),new r((function(){var n,r=!0;return new x(m.Blank,(function(){return r?(r=!1,n=t,this.yieldReturn(n)):(n=e(n),this.yieldReturn(n))}),m.Blank)}))},r.defer=function(t){return new r((function(){var e;return new x((function(){e=r.from(t()).getEnumerator()}),(function(){return e.moveNext()?this.yieldReturn(e.getCurrent()):this.yieldBreak()}),(function(){C.dispose(e)}))}))},r.prototype.traverseBreadthFirst=function(t,e){var n=this;return t=C.createLambda(t),e=C.createLambda(e),new r((function(){var i,o=0,s=[];return new x((function(){i=n.getEnumerator()}),(function(){for(;;){if(i.moveNext())return s.push(i.getCurrent()),this.yieldReturn(e(i.getCurrent(),o));var n=r.from(s).selectMany((function(e){return t(e)}));if(!n.any())return!1;o++,s=[],C.dispose(i),i=n.getEnumerator()}}),(function(){C.dispose(i)}))}))},r.prototype.traverseDepthFirst=function(t,e){var n=this;return t=C.createLambda(t),e=C.createLambda(e),new r((function(){var i,o=[];return new x((function(){i=n.getEnumerator()}),(function(){for(;;){if(i.moveNext()){var n=e(i.getCurrent(),o.length);return o.push(i),i=r.from(t(i.getCurrent())).getEnumerator(),this.yieldReturn(n)}if(o.length<=0)return!1;C.dispose(i),i=o.pop()}}),(function(){try{C.dispose(i)}finally{r.from(o).forEach((function(t){t.dispose()}))}}))}))},r.prototype.flatten=function(){var t=this;return new r((function(){var e,n=null;return new x((function(){e=t.getEnumerator()}),(function(){for(;;){if(null!=n){if(n.moveNext())return this.yieldReturn(n.getCurrent());n=null}if(e.moveNext()){if(e.getCurrent()instanceof Array){C.dispose(n),n=r.from(e.getCurrent()).selectMany(m.Identity).flatten().getEnumerator();continue}return this.yieldReturn(e.getCurrent())}return!1}}),(function(){try{C.dispose(e)}finally{C.dispose(n)}}))}))},r.prototype.pairwise=function(t){var e=this;return t=C.createLambda(t),new r((function(){var n;return new x((function(){(n=e.getEnumerator()).moveNext()}),(function(){var e=n.getCurrent();return!!n.moveNext()&&this.yieldReturn(t(e,n.getCurrent()))}),(function(){C.dispose(n)}))}))},r.prototype.scan=function(t,e){var n,i;return null==e?(e=C.createLambda(t),n=!1):(e=C.createLambda(e),n=!0),i=this,new r((function(){var r,o,s=!0;return new x((function(){r=i.getEnumerator()}),(function(){if(s){if(s=!1,n)return this.yieldReturn(o=t);if(r.moveNext())return this.yieldReturn(o=r.getCurrent())}return!!r.moveNext()&&this.yieldReturn(o=e(o,r.getCurrent()))}),(function(){C.dispose(r)}))}))},r.prototype.select=function(t){if((t=C.createLambda(t)).length<=1)return new c(this,null,t);var e=this;return new r((function(){var n,r=0;return new x((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(t(n.getCurrent(),r++))}),(function(){C.dispose(n)}))}))},r.prototype.selectMany=function(t,n){var i=this;return t=C.createLambda(t),null==n&&(n=function(t,e){return e}),n=C.createLambda(n),new r((function(){var o,s=e,a=0;return new x((function(){o=i.getEnumerator()}),(function(){if(s===e&&!o.moveNext())return!1;do{if(null==s){var i=t(o.getCurrent(),a++);s=r.from(i).getEnumerator()}if(s.moveNext())return this.yieldReturn(n(o.getCurrent(),s.getCurrent()));C.dispose(s),s=null}while(o.moveNext());return!1}),(function(){try{C.dispose(o)}finally{C.dispose(s)}}))}))},r.prototype.where=function(t){if((t=C.createLambda(t)).length<=1)return new l(this,t);var e=this;return new r((function(){var n,r=0;return new x((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();)if(t(n.getCurrent(),r++))return this.yieldReturn(n.getCurrent());return!1}),(function(){C.dispose(n)}))}))},r.prototype.choose=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n,r=0;return new x((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){var e=t(n.getCurrent(),r++);if(null!=e)return this.yieldReturn(e)}return this.yieldBreak()}),(function(){C.dispose(n)}))}))},r.prototype.ofType=function(t){var e=this;return new r((function(){var n;return new x((function(){n=Bridge.getEnumerator(e)}),(function(){for(;n.moveNext();){var e=Bridge.as(n.getCurrent(),t);if(Bridge.hasValue(e))return this.yieldReturn(e)}return!1}),(function(){C.dispose(n)}))}))},r.prototype.zip=function(){var t,e=arguments,n=C.createLambda(arguments[arguments.length-1]),i=this;return 2==arguments.length?(t=arguments[0],new r((function(){var e,o,s=0;return new x((function(){e=i.getEnumerator(),o=r.from(t).getEnumerator()}),(function(){return!(!e.moveNext()||!o.moveNext())&&this.yieldReturn(n(e.getCurrent(),o.getCurrent(),s++))}),(function(){try{C.dispose(e)}finally{C.dispose(o)}}))}))):new r((function(){var t,o=0;return new x((function(){var n=r.make(i).concat(r.from(e).takeExceptLast().select(r.from)).select((function(t){return t.getEnumerator()})).toArray();t=r.from(n)}),(function(){if(t.all((function(t){return t.moveNext()}))){var e=t.select((function(t){return t.getCurrent()})).toArray();return e.push(o++),this.yieldReturn(n.apply(null,e))}return this.yieldBreak()}),(function(){r.from(t).forEach(C.dispose)}))}))},r.prototype.merge=function(){var t=arguments,e=this;return new r((function(){var n,i=-1;return new x((function(){n=r.make(e).concat(r.from(t).select(r.from)).select((function(t){return t.getEnumerator()})).toArray()}),(function(){for(;n.length>0;){i=i>=n.length-1?0:i+1;var t=n[i];if(t.moveNext())return this.yieldReturn(t.getCurrent());t.dispose(),n.splice(i--,1)}return this.yieldBreak()}),(function(){r.from(n).forEach(C.dispose)}))}))},r.prototype.join=function(t,n,i,o,s){n=C.createLambda(n),i=C.createLambda(i),o=C.createLambda(o);var a=this;return new r((function(){var u,l,c=null,g=0;return new x((function(){u=a.getEnumerator(),l=r.from(t).toLookup(i,m.Identity,s)}),(function(){for(var t,r;;){if(null!=c){if((t=c[g++])!==e)return this.yieldReturn(o(u.getCurrent(),t));t=null,g=0}if(!u.moveNext())return!1;r=n(u.getCurrent()),c=l.get(r).toArray()}}),(function(){C.dispose(u)}))}))},r.prototype.groupJoin=function(t,e,n,i,o){e=C.createLambda(e),n=C.createLambda(n),i=C.createLambda(i);var s=this;return new r((function(){var a=s.getEnumerator(),u=null;return new x((function(){a=s.getEnumerator(),u=r.from(t).toLookup(n,m.Identity,o)}),(function(){if(a.moveNext()){var t=u.get(e(a.getCurrent()));return this.yieldReturn(i(a.getCurrent(),t))}return!1}),(function(){C.dispose(a)}))}))},r.prototype.all=function(t){t=C.createLambda(t);var e=!0;return this.forEach((function(n){if(!t(n))return e=!1,!1})),e},r.prototype.any=function(t){t=C.createLambda(t);var e=this.getEnumerator();try{if(0==arguments.length)return e.moveNext();for(;e.moveNext();)if(t(e.getCurrent()))return!0;return!1}finally{C.dispose(e)}},r.prototype.isEmpty=function(){return!this.any()},r.prototype.concat=function(){var t,e,n=this;return 1==arguments.length?(t=arguments[0],new r((function(){var e,i;return new x((function(){e=n.getEnumerator()}),(function(){if(null==i){if(e.moveNext())return this.yieldReturn(e.getCurrent());i=r.from(t).getEnumerator()}return!!i.moveNext()&&this.yieldReturn(i.getCurrent())}),(function(){try{C.dispose(e)}finally{C.dispose(i)}}))}))):(e=arguments,new r((function(){var t;return new x((function(){t=r.make(n).concat(r.from(e).select(r.from)).select((function(t){return t.getEnumerator()})).toArray()}),(function(){for(;t.length>0;){var e=t[0];if(e.moveNext())return this.yieldReturn(e.getCurrent());e.dispose(),t.splice(0,1)}return this.yieldBreak()}),(function(){r.from(t).forEach(C.dispose)}))})))},r.prototype.insert=function(t,e){var n=this;return new r((function(){var i,o,s=0,a=!1;return new x((function(){i=n.getEnumerator(),o=r.from(e).getEnumerator()}),(function(){return s==t&&o.moveNext()?(a=!0,this.yieldReturn(o.getCurrent())):i.moveNext()?(s++,this.yieldReturn(i.getCurrent())):!(a||!o.moveNext())&&this.yieldReturn(o.getCurrent())}),(function(){try{C.dispose(i)}finally{C.dispose(o)}}))}))},r.prototype.alternate=function(t){var e=this;return new r((function(){var n,i,o,s;return new x((function(){o=t instanceof Array||null!=t.getEnumerator?r.from(r.from(t).toArray()):r.make(t),(i=e.getEnumerator()).moveNext()&&(n=i.getCurrent())}),(function(){for(;;){if(null!=s){if(s.moveNext())return this.yieldReturn(s.getCurrent());s=null}if(null!=n||!i.moveNext()){if(null!=n){var t=n;return n=null,this.yieldReturn(t)}return this.yieldBreak()}n=i.getCurrent(),s=o.getEnumerator()}}),(function(){try{C.dispose(i)}finally{C.dispose(s)}}))}))},r.prototype.contains=function(t,e){e=e||System.Collections.Generic.EqualityComparer$1.$default;var n=this.getEnumerator();try{for(;n.moveNext();)if(e.equals2(n.getCurrent(),t))return!0;return!1}finally{C.dispose(n)}},r.prototype.defaultIfEmpty=function(t){var n=this;return t===e&&(t=null),new r((function(){var e,r=!0;return new x((function(){e=n.getEnumerator()}),(function(){return e.moveNext()?(r=!1,this.yieldReturn(e.getCurrent())):!!r&&(r=!1,this.yieldReturn(t))}),(function(){C.dispose(e)}))}))},r.prototype.distinct=function(t){return this.except(r.empty(),t)},r.prototype.distinctUntilChanged=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n,r,i;return new x((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){var e=t(n.getCurrent());if(i)return i=!1,r=e,this.yieldReturn(n.getCurrent());if(r!==e)return r=e,this.yieldReturn(n.getCurrent())}return this.yieldBreak()}),(function(){C.dispose(n)}))}))},r.prototype.except=function(t,e){var n=this;return new r((function(){var i,o;return new x((function(){i=n.getEnumerator(),o=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,e),r.from(t).forEach((function(t){o.containsKey(t)||o.add(t)}))}),(function(){for(;i.moveNext();){var t=i.getCurrent();if(!o.containsKey(t))return o.add(t),this.yieldReturn(t)}return!1}),(function(){C.dispose(i)}))}))},r.prototype.intersect=function(t,e){var n=this;return new r((function(){var i,o,s;return new x((function(){i=n.getEnumerator(),o=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,e),r.from(t).forEach((function(t){o.containsKey(t)||o.add(t)})),s=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,e)}),(function(){for(;i.moveNext();){var t=i.getCurrent();if(!s.containsKey(t)&&o.containsKey(t))return s.add(t),this.yieldReturn(t)}return!1}),(function(){C.dispose(i)}))}))},r.prototype.sequenceEqual=function(t,e){var n,i;e=e||System.Collections.Generic.EqualityComparer$1.$default,n=this.getEnumerator();try{i=r.from(t).getEnumerator();try{for(;n.moveNext();)if(!i.moveNext()||!e.equals2(n.getCurrent(),i.getCurrent()))return!1;return!i.moveNext()}finally{C.dispose(i)}}finally{C.dispose(n)}},r.prototype.union=function(t,n){var i=this;return new r((function(){var o,s,a;return new x((function(){o=i.getEnumerator(),a=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,n)}),(function(){var n;if(s===e){for(;o.moveNext();)if(n=o.getCurrent(),!a.containsKey(n))return a.add(n),this.yieldReturn(n);s=r.from(t).getEnumerator()}for(;s.moveNext();)if(n=s.getCurrent(),!a.containsKey(n))return a.add(n),this.yieldReturn(n);return!1}),(function(){try{C.dispose(o)}finally{C.dispose(s)}}))}))},r.prototype.orderBy=function(t,e){return new o(this,t,e,!1)},r.prototype.orderByDescending=function(t,e){return new o(this,t,e,!0)},r.prototype.reverse=function(){var t=this;return new r((function(){var e,n;return new x((function(){e=t.toArray(),n=e.length}),(function(){return n>0&&this.yieldReturn(e[--n])}),m.Blank)}))},r.prototype.shuffle=function(){var t=this;return new r((function(){var e;return new x((function(){e=t.toArray()}),(function(){if(e.length>0){var t=Math.floor(Math.random()*e.length);return this.yieldReturn(e.splice(t,1)[0])}return!1}),m.Blank)}))},r.prototype.weightedSample=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n,r=0;return new x((function(){n=e.choose((function(e){var n=t(e);return n<=0?null:{value:e,bound:r+=n}})).toArray()}),(function(){var t;if(n.length>0){for(var e=Math.floor(Math.random()*r)+1,i=-1,o=n.length;o-i>1;)t=Math.floor((i+o)/2),n[t].bound>=e?o=t:i=t;return this.yieldReturn(n[o].value)}return this.yieldBreak()}),m.Blank)}))},r.prototype.groupBy=function(t,e,n,i){var o=this;return t=C.createLambda(t),e=C.createLambda(e),null!=n&&(n=C.createLambda(n)),new r((function(){var r;return new x((function(){r=o.toLookup(t,e,i).toEnumerable().getEnumerator()}),(function(){for(;r.moveNext();)return null==n?this.yieldReturn(r.getCurrent()):this.yieldReturn(n(r.getCurrent().key(),r.getCurrent()));return!1}),(function(){C.dispose(r)}))}))},r.prototype.partitionBy=function(t,e,n,i){var o,s=this;return t=C.createLambda(t),e=C.createLambda(e),i=i||System.Collections.Generic.EqualityComparer$1.$default,null==n?(o=!1,n=function(t,e){return new h(t,e)}):(o=!0,n=C.createLambda(n)),new r((function(){var a,u,l=[];return new x((function(){(a=s.getEnumerator()).moveNext()&&(u=t(a.getCurrent()),l.push(e(a.getCurrent())))}),(function(){for(var s,c;1==(s=a.moveNext())&&i.equals2(u,t(a.getCurrent()));)l.push(e(a.getCurrent()));return l.length>0&&(c=n(u,o?r.from(l):l),s?(u=t(a.getCurrent()),l=[e(a.getCurrent())]):l=[],this.yieldReturn(c))}),(function(){C.dispose(a)}))}))},r.prototype.buffer=function(t){var e=this;return new r((function(){var n;return new x((function(){n=e.getEnumerator()}),(function(){for(var e=[],r=0;n.moveNext();)if(e.push(n.getCurrent()),++r>=t)return this.yieldReturn(e);return e.length>0&&this.yieldReturn(e)}),(function(){C.dispose(n)}))}))},r.prototype.aggregate=function(t,e,n){return(n=C.createLambda(n))(this.scan(t,e,n).last())},r.prototype.average=function(t,e){!t||e||Bridge.isFunction(t)||(e=t,t=null),t=C.createLambda(t);var n=e||0,r=0;if(this.forEach((function(e){(e=t(e))instanceof System.Decimal||System.Int64.is64Bit(e)?n=e.add(n):n instanceof System.Decimal||System.Int64.is64Bit(n)?n=n.add(e):n+=e,++r})),0===r)throw new System.InvalidOperationException("Sequence contains no elements");return n instanceof System.Decimal||System.Int64.is64Bit(n)?n.div(r):n/r},r.prototype.nullableAverage=function(t,e){return this.any(Bridge.isNull)?null:this.average(t,e)},r.prototype.count=function(t){t=null==t?m.True:C.createLambda(t);var e=0;return this.forEach((function(n,r){t(n,r)&&++e})),e},r.prototype.max=function(t){return null==t&&(t=m.Identity),this.select(t).aggregate((function(t,e){return 1===Bridge.compare(t,e,!0)?t:e}))},r.prototype.nullableMax=function(t){return this.any(Bridge.isNull)?null:this.max(t)},r.prototype.min=function(t){return null==t&&(t=m.Identity),this.select(t).aggregate((function(t,e){return-1===Bridge.compare(t,e,!0)?t:e}))},r.prototype.nullableMin=function(t){return this.any(Bridge.isNull)?null:this.min(t)},r.prototype.maxBy=function(t){return t=C.createLambda(t),this.aggregate((function(e,n){return 1===Bridge.compare(t(e),t(n),!0)?e:n}))},r.prototype.minBy=function(t){return t=C.createLambda(t),this.aggregate((function(e,n){return-1===Bridge.compare(t(e),t(n),!0)?e:n}))},r.prototype.sum=function(t,e){!t||e||Bridge.isFunction(t)||(e=t,t=null),null==t&&(t=m.Identity);var n=this.select(t).aggregate(0,(function(t,e){return t instanceof System.Decimal||System.Int64.is64Bit(t)?t.add(e):e instanceof System.Decimal||System.Int64.is64Bit(e)?e.add(t):t+e}));return 0===n&&e?e:n},r.prototype.nullableSum=function(t,e){return this.any(Bridge.isNull)?null:this.sum(t,e)},r.prototype.elementAt=function(t){var e,n=!1;if(this.forEach((function(r,i){if(i==t)return e=r,n=!0,!1})),!n)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return e},r.prototype.elementAtOrDefault=function(t,n){n===e&&(n=null);var r,i=!1;return this.forEach((function(e,n){if(n==t)return r=e,i=!0,!1})),i?r:n},r.prototype.first=function(t){if(null!=t)return this.where(t).first();var e,n=!1;if(this.forEach((function(t){return e=t,n=!0,!1})),!n)throw new Error("first:No element satisfies the condition.");return e},r.prototype.firstOrDefault=function(t,n){if(n===e&&(n=null),null!=t)return this.where(t).firstOrDefault(null,n);var r,i=!1;return this.forEach((function(t){return r=t,i=!0,!1})),i?r:n},r.prototype.last=function(t){if(null!=t)return this.where(t).last();var e,n=!1;if(this.forEach((function(t){n=!0,e=t})),!n)throw new Error("last:No element satisfies the condition.");return e},r.prototype.lastOrDefault=function(t,n){if(n===e&&(n=null),null!=t)return this.where(t).lastOrDefault(null,n);var r,i=!1;return this.forEach((function(t){i=!0,r=t})),i?r:n},r.prototype.single=function(t){if(null!=t)return this.where(t).single();var e,n=!1;if(this.forEach((function(t){if(n)throw new Error("single:sequence contains more than one element.");n=!0,e=t})),!n)throw new Error("single:No element satisfies the condition.");return e},r.prototype.singleOrDefault=function(t,n){if(n===e&&(n=null),null!=t)return this.where(t).singleOrDefault(null,n);var r,i=!1;return this.forEach((function(t){if(i)throw new Error("single:sequence contains more than one element.");i=!0,r=t})),i?r:n},r.prototype.skip=function(t){var e=this;return new r((function(){var n,r=0;return new x((function(){for(n=e.getEnumerator();r++<t&&n.moveNext(););}),(function(){return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){C.dispose(n)}))}))},r.prototype.skipWhile=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n,r=0,i=!1;return new x((function(){n=e.getEnumerator()}),(function(){for(;!i;){if(!n.moveNext())return!1;if(!t(n.getCurrent(),r++))return i=!0,this.yieldReturn(n.getCurrent())}return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){C.dispose(n)}))}))},r.prototype.take=function(t){var e=this;return new r((function(){var n,r=0;return new x((function(){n=e.getEnumerator()}),(function(){return!!(r++<t&&n.moveNext())&&this.yieldReturn(n.getCurrent())}),(function(){C.dispose(n)}))}))},r.prototype.takeWhile=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n,r=0;return new x((function(){n=e.getEnumerator()}),(function(){return!(!n.moveNext()||!t(n.getCurrent(),r++))&&this.yieldReturn(n.getCurrent())}),(function(){C.dispose(n)}))}))},r.prototype.takeExceptLast=function(t){null==t&&(t=1);var e=this;return new r((function(){if(t<=0)return e.getEnumerator();var n,r=[];return new x((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){if(r.length==t)return r.push(n.getCurrent()),this.yieldReturn(r.shift());r.push(n.getCurrent())}return!1}),(function(){C.dispose(n)}))}))},r.prototype.takeFromLast=function(t){if(t<=0||null==t)return r.empty();var e=this;return new r((function(){var n,i,o=[];return new x((function(){n=e.getEnumerator()}),(function(){if(null==i){for(;n.moveNext();)o.length==t&&o.shift(),o.push(n.getCurrent());i=r.from(o).getEnumerator()}return!!i.moveNext()&&this.yieldReturn(i.getCurrent())}),(function(){C.dispose(i)}))}))},r.prototype.indexOf=function(t,e){var n=null;return typeof t===p?this.forEach((function(e,r){if(t(e,r))return n=r,!1})):(e=e||System.Collections.Generic.EqualityComparer$1.$default,this.forEach((function(r,i){if(e.equals2(r,t))return n=i,!1}))),null!==n?n:-1},r.prototype.lastIndexOf=function(t,e){var n=-1;return typeof t===p?this.forEach((function(e,r){t(e,r)&&(n=r)})):(e=e||System.Collections.Generic.EqualityComparer$1.$default,this.forEach((function(r,i){e.equals2(r,t)&&(n=i)}))),n},r.prototype.asEnumerable=function(){return r.from(this)},r.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},r.prototype.toList=function(t){var e=[];return this.forEach((function(t){e.push(t)})),new(System.Collections.Generic.List$1(t||Object))(e)},r.prototype.toLookup=function(t,e,n){t=C.createLambda(t),e=C.createLambda(e);var r=new(System.Collections.Generic.Dictionary$2(Object,Object))(null,n),i=[];return this.forEach((function(n){var o=t(n),s=e(n),a={v:null};r.tryGetValue(o,a)?a.v.push(s):(i.push(o),r.add(o,[s]))})),new g(r,i)},r.prototype.toObject=function(t,e){t=C.createLambda(t),e=C.createLambda(e);var n={};return this.forEach((function(r){n[t(r)]=e(r)})),n},r.prototype.toDictionary=function(t,e,n,r,i){t=C.createLambda(t),e=C.createLambda(e);var o=new(System.Collections.Generic.Dictionary$2(n,r))(null,i);return this.forEach((function(n){o.add(t(n),e(n))})),o},r.prototype.toJSONString=function(t,e){if(typeof JSON===y||null==JSON.stringify)throw new Error("toJSONString can't find JSON.stringify. This works native JSON support Browser or include json2.js");return JSON.stringify(this.toArray(),t,e)},r.prototype.toJoinedString=function(t,e){return null==t&&(t=""),null==e&&(e=m.Identity),this.select(e).toArray().join(t)},r.prototype.doAction=function(t){var e=this;return t=C.createLambda(t),new r((function(){var n,r=0;return new x((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&(t(n.getCurrent(),r++),this.yieldReturn(n.getCurrent()))}),(function(){C.dispose(n)}))}))},r.prototype.forEach=function(t){t=C.createLambda(t);var e=0,n=this.getEnumerator();try{for(;n.moveNext()&&!1!==t(n.getCurrent(),e++););}finally{C.dispose(n)}},r.prototype.write=function(t,e){null==t&&(t=""),e=C.createLambda(e);var n=!0;this.forEach((function(r){n?n=!1:document.write(t),document.write(e(r))}))},r.prototype.writeLine=function(t){t=C.createLambda(t),this.forEach((function(e){document.writeln(t(e)+"<br />")}))},r.prototype.force=function(){var t=this.getEnumerator();try{for(;t.moveNext(););}finally{C.dispose(t)}},r.prototype.letBind=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n;return new x((function(){n=r.from(t(e)).getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){C.dispose(n)}))}))},r.prototype.share=function(){var t,e=this,n=!1;return new a((function(){return new x((function(){null==t&&(t=e.getEnumerator())}),(function(){if(n)throw new Error("enumerator is disposed");return!!t.moveNext()&&this.yieldReturn(t.getCurrent())}),m.Blank)}),(function(){n=!0,C.dispose(t)}))},r.prototype.memoize=function(){var t,e,n=this,r=!1;return new a((function(){var i=-1;return new x((function(){null==e&&(e=n.getEnumerator(),t=[])}),(function(){if(r)throw new Error("enumerator is disposed");return i++,t.length<=i?!!e.moveNext()&&this.yieldReturn(t[i]=e.getCurrent()):this.yieldReturn(t[i])}),m.Blank)}),(function(){r=!0,C.dispose(e),t=null}))},r.prototype.catchError=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n;return new x((function(){n=e.getEnumerator()}),(function(){try{return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}catch(e){return t(e),!1}}),(function(){C.dispose(n)}))}))},r.prototype.finallyAction=function(t){t=C.createLambda(t);var e=this;return new r((function(){var n;return new x((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.getCurrent())}),(function(){try{C.dispose(n)}finally{t()}}))}))},r.prototype.log=function(t){return t=C.createLambda(t),this.doAction((function(e){typeof console!==y&&console.log(t(e))}))},r.prototype.trace=function(t,e){return null==t&&(t="Trace"),e=C.createLambda(e),this.doAction((function(n){typeof console!==y&&console.log(t,e(n))}))},o=function(t,e,n,r,i){this.source=t,this.keySelector=C.createLambda(e),this.comparer=n||System.Collections.Generic.Comparer$1.$default,this.descending=r,this.parent=i},o.prototype=new r,o.prototype.createOrderedEnumerable=function(t,e,n){return new o(this.source,t,e,n,this)},o.prototype.thenBy=function(t,e){return this.createOrderedEnumerable(t,e,!1)},o.prototype.thenByDescending=function(t,e){return this.createOrderedEnumerable(t,e,!0)},o.prototype.getEnumerator=function(){var t,e,n=this,r=0;return new x((function(){t=[],e=[],n.source.forEach((function(n,r){t.push(n),e.push(r)}));var r=s.create(n,null);r.GenerateKeys(t),e.sort((function(t,e){return r.compare(t,e)}))}),(function(){return r<e.length&&this.yieldReturn(t[e[r++]])}),m.Blank)},s=function(t,e,n,r){this.keySelector=t,this.comparer=e,this.descending=n,this.child=r,this.keys=null},s.create=function(t,e){var n=new s(t.keySelector,t.comparer,t.descending,e);return null!=t.parent?s.create(t.parent,n):n},s.prototype.GenerateKeys=function(t){for(var e=t.length,n=this.keySelector,r=new Array(e),i=0;i<e;i++)r[i]=n(t[i]);this.keys=r,null!=this.child&&this.child.GenerateKeys(t)},s.prototype.compare=function(t,e){var n=this.comparer.compare(this.keys[t],this.keys[e]);return 0==n?null!=this.child?this.child.compare(t,e):C.compare(t,e):this.descending?-n:n},a=function(t,e){this.dispose=e,r.call(this,t)},a.prototype=new r,u=function(t){this.getSource=function(){return t}},u.prototype=new r,u.prototype.any=function(t){return null==t?this.getSource().length>0:r.prototype.any.apply(this,arguments)},u.prototype.count=function(t){return null==t?this.getSource().length:r.prototype.count.apply(this,arguments)},u.prototype.elementAt=function(t){var e=this.getSource();return 0<=t&&t<e.length?e[t]:r.prototype.elementAt.apply(this,arguments)},u.prototype.elementAtOrDefault=function(t,n){n===e&&(n=null);var r=this.getSource();return 0<=t&&t<r.length?r[t]:n},u.prototype.first=function(t){var e=this.getSource();return null==t&&e.length>0?e[0]:r.prototype.first.apply(this,arguments)},u.prototype.firstOrDefault=function(t,n){if(n===e&&(n=null),null!=t)return r.prototype.firstOrDefault.apply(this,arguments);var i=this.getSource();return i.length>0?i[0]:n},u.prototype.last=function(t){var e=this.getSource();return null==t&&e.length>0?e[e.length-1]:r.prototype.last.apply(this,arguments)},u.prototype.lastOrDefault=function(t,n){if(n===e&&(n=null),null!=t)return r.prototype.lastOrDefault.apply(this,arguments);var i=this.getSource();return i.length>0?i[i.length-1]:n},u.prototype.skip=function(t){var e=this.getSource();return new r((function(){var n;return new x((function(){n=t<0?0:t}),(function(){return n<e.length&&this.yieldReturn(e[n++])}),m.Blank)}))},u.prototype.takeExceptLast=function(t){return null==t&&(t=1),this.take(this.getSource().length-t)},u.prototype.takeFromLast=function(t){return this.skip(this.getSource().length-t)},u.prototype.reverse=function(){var t=this.getSource();return new r((function(){var e;return new x((function(){e=t.length}),(function(){return e>0&&this.yieldReturn(t[--e])}),m.Blank)}))},u.prototype.sequenceEqual=function(t,e){return(!(t instanceof u||t instanceof Array)||null!=e||r.from(t).count()==this.count())&&r.prototype.sequenceEqual.apply(this,arguments)},u.prototype.toJoinedString=function(t,e){var n=this.getSource();return null==e&&n instanceof Array?(null==t&&(t=""),n.join(t)):r.prototype.toJoinedString.apply(this,arguments)},u.prototype.getEnumerator=function(){return new Bridge.ArrayEnumerator(this.getSource())},l=function(t,e){this.prevSource=t,this.prevPredicate=e},l.prototype=new r,l.prototype.where=function(t){if((t=C.createLambda(t)).length<=1){var e=this.prevPredicate;return new l(this.prevSource,(function(n){return e(n)&&t(n)}))}return r.prototype.where.call(this,t)},l.prototype.select=function(t){return(t=C.createLambda(t)).length<=1?new c(this.prevSource,this.prevPredicate,t):r.prototype.select.call(this,t)},l.prototype.getEnumerator=function(){var t,e=this.prevPredicate,n=this.prevSource;return new x((function(){t=n.getEnumerator()}),(function(){for(;t.moveNext();)if(e(t.getCurrent()))return this.yieldReturn(t.getCurrent());return!1}),(function(){C.dispose(t)}))},c=function(t,e,n){this.prevSource=t,this.prevPredicate=e,this.prevSelector=n},c.prototype=new r,c.prototype.where=function(t){return(t=C.createLambda(t)).length<=1?new l(this,t):r.prototype.where.call(this,t)},c.prototype.select=function(t){if((t=C.createLambda(t)).length<=1){var e=this.prevSelector;return new c(this.prevSource,this.prevPredicate,(function(n){return t(e(n))}))}return r.prototype.select.call(this,t)},c.prototype.getEnumerator=function(){var t,e=this.prevPredicate,n=this.prevSelector,r=this.prevSource;return new x((function(){t=r.getEnumerator()}),(function(){for(;t.moveNext();)if(null==e||e(t.getCurrent()))return this.yieldReturn(n(t.getCurrent()));return!1}),(function(){C.dispose(t)}))},g=function(t,e){this.count=function(){return t.getCount()},this.get=function(e){var n={v:null},i=t.tryGetValue(e,n);return r.from(i?n.v:[])},this.contains=function(e){return t.containsKey(e)},this.toEnumerable=function(){return r.from(e).select((function(e){return new h(e,t.get(e))}))},this.getEnumerator=function(){return this.toEnumerable().getEnumerator()}},g.$$inherits=[],Bridge.Class.addExtend(g,[System.Collections.IEnumerable]),h=function(t,e){this.key=function(){return t},u.call(this,e)},h.prototype=new u,h.$$inherits=[],Bridge.Class.addExtend(h,[System.Collections.IEnumerable]),Bridge.Linq={},Bridge.Linq.Enumerable=r,System.Linq={},System.Linq.Enumerable=r}(Bridge.global),Bridge.define("System.Guid",{inherits:function(){return[System.IEquatable$1(System.Guid),System.IComparable$1(System.Guid),System.IFormattable]},$kind:"struct",statics:{error1:"Byte array for GUID must be exactly {0} bytes long",valid:null,split:null,nonFormat:null,replace:null,rnd:null,config:{init:function(){this.valid=new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","i"),this.split=new RegExp("^(.{8})(.{4})(.{4})(.{4})(.{12})$"),this.nonFormat=new RegExp("^[{(]?([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})[)}]?$","i"),this.replace=new RegExp("-","g"),this.rnd=new System.Random.ctor,this.empty=new System.Guid.ctor}},parse:function(t){return System.Guid.parseExact(t,null)},parseExact:function(t,e){var n=new System.Guid.ctor;return n.parseInternal(t,e,!0),n},tryParse:function(t,e){return System.Guid.tryParseExact(t,null,e)},tryParseExact:function(t,e,n){return n.v=new System.Guid.ctor,n.v.parseInternal(t,e,!1)},newGuid:function(){var t=System.Array.init(16,0);return System.Guid.rnd.nextBytes(t),t[7]=255&(15&t[7]|64),t[8]=255&(191&t[8]|128),new System.Guid.$ctor1(t)},makeBinary:function(t){return System.Int32.format(255&t,"x2")},op_Equality:function(t,e){return Bridge.referenceEquals(t,null)?Bridge.referenceEquals(e,null):t.equalsT(e)},op_Inequality:function(t,e){return!System.Guid.op_Equality(t,e)},getDefaultValue:function(){return new System.Guid}},_a:0,_b:0,_c:0,_d:0,_e:0,_f:0,_g:0,_h:0,_i:0,_j:0,_k:0,config:{alias:["equalsT","System$IEquatable$1$System$Guid$equalsT","compareTo","System$IComparable$1$System$Guid$compareTo","format","System$IFormattable$format"]},$ctor4:function(t){this.$initialize(),(new System.Guid.ctor).$clone(this),this.parseInternal(t,null,!0)},$ctor1:function(t){if(this.$initialize(),null==t)throw new System.ArgumentNullException("b");if(16!==t.length)throw new System.ArgumentException(System.String.format(System.Guid.error1,16));this._a=t[3]<<24|t[2]<<16|t[1]<<8|t[0],this._b=Bridge.Int.sxs(65535&(t[5]<<8|t[4])),this._c=Bridge.Int.sxs(65535&(t[7]<<8|t[6])),this._d=t[8],this._e=t[9],this._f=t[10],this._g=t[11],this._h=t[12],this._i=t[13],this._j=t[14],this._k=t[15]},$ctor5:function(t,e,n,r,i,o,s,a,u,l,c){this.$initialize(),this._a=0|t,this._b=Bridge.Int.sxs(65535&e),this._c=Bridge.Int.sxs(65535&n),this._d=r,this._e=i,this._f=o,this._g=s,this._h=a,this._i=u,this._j=l,this._k=c},$ctor3:function(t,e,n,r){if(this.$initialize(),null==r)throw new System.ArgumentNullException("d");if(8!==r.length)throw new System.ArgumentException(System.String.format(System.Guid.error1,8));this._a=t,this._b=e,this._c=n,this._d=r[0],this._e=r[1],this._f=r[2],this._g=r[3],this._h=r[4],this._i=r[5],this._j=r[6],this._k=r[7]},$ctor2:function(t,e,n,r,i,o,s,a,u,l,c){this.$initialize(),this._a=t,this._b=e,this._c=n,this._d=r,this._e=i,this._f=o,this._g=s,this._h=a,this._i=u,this._j=l,this._k=c},ctor:function(){this.$initialize()},equalsT:function(t){return this._a===t._a&&this._b===t._b&&this._c===t._c&&this._d===t._d&&this._e===t._e&&this._f===t._f&&this._g===t._g&&this._h===t._h&&this._i===t._i&&this._j===t._j&&this._k===t._k},compareTo:function(t){return System.String.compare(this.toString(),t.toString())},toString:function(){return this.format$1(null)},toString$1:function(t){return this.format$1(t)},format:function(t){return this.format$1(t)},toByteArray:function(){var t=System.Array.init(16,0);return t[0]=255&this._a,t[1]=this._a>>8&255,t[2]=this._a>>16&255,t[3]=this._a>>24&255,t[4]=255&this._b,t[5]=this._b>>8&255,t[6]=255&this._c,t[7]=this._c>>8&255,t[8]=this._d,t[9]=this._e,t[10]=this._f,t[11]=this._g,t[12]=this._h,t[13]=this._i,t[14]=this._j,t[15]=this._k,t},parseInternal:function(t,e,n){var r,i,o,s,a=null;if(System.String.isNullOrEmpty(t))throw new System.ArgumentNullException("input");if(System.String.isNullOrEmpty(e)?null!=(r=System.Guid.nonFormat.exec(t))&&(a=r.slice(1).join("-").toLowerCase()):(e=e.toUpperCase(),i=!1,Bridge.referenceEquals(e,"N")?null!=(o=System.Guid.split.exec(t))&&(i=!0,t=o.slice(1).join("-")):Bridge.referenceEquals(e,"B")||Bridge.referenceEquals(e,"P")?(s=Bridge.referenceEquals(e,"B")?[123,125]:[40,41],t.charCodeAt(0)===s[0]&&t.charCodeAt(t.length-1|0)===s[1]&&(i=!0,t=t.substr(1,t.length-2|0))):i=!0,i&&null!=t.match(System.Guid.valid)&&(a=t.toLowerCase())),null!=a)return this.fromString(a),!0;if(n)throw new System.FormatException("input is not in a recognized format");return!1},format$1:function(t){var e=System.String.concat(System.UInt32.format(this._a>>>0,"x8"),System.UInt16.format(65535&this._b,"x4"),System.UInt16.format(65535&this._c,"x4"));switch(e=System.String.concat(e,[this._d,this._e,this._f,this._g,this._h,this._i,this._j,this._k].map(System.Guid.makeBinary).join("")),e=System.Guid.split.exec(e).slice(1).join("-"),t){case"n":case"N":return e.replace(System.Guid.replace,"");case"b":case"B":return System.String.concat(String.fromCharCode(123),e,String.fromCharCode(125));case"p":case"P":return System.String.concat(String.fromCharCode(40),e,String.fromCharCode(41));default:return e}},fromString:function(t){var e,n;if(!System.String.isNullOrEmpty(t)){for(t=t.replace(System.Guid.replace,""),e=System.Array.init(8,0),this._a=0|System.UInt32.parse(t.substr(0,8),16),this._b=Bridge.Int.sxs(65535&System.UInt16.parse(t.substr(8,4),16)),this._c=Bridge.Int.sxs(65535&System.UInt16.parse(t.substr(12,4),16)),n=8;n<16;n=n+1|0)e[n-8|0]=System.Byte.parse(t.substr(2*n|0,2),16);this._d=e[0],this._e=e[1],this._f=e[2],this._g=e[3],this._h=e[4],this._i=e[5],this._j=e[6],this._k=e[7]}},getHashCode:function(){return Bridge.addHash([1684632903,this._a,this._b,this._c,this._d,this._e,this._f,this._g,this._h,this._i,this._j,this._k])},$clone:function(){return this}}),Bridge.define("System.Text.RegularExpressions.Regex",{statics:{_cacheSize:15,_defaultMatchTimeout:System.TimeSpan.fromMilliseconds(-1),getCacheSize:function(){return System.Text.RegularExpressions.Regex._cacheSize},setCacheSize:function(t){if(t<0)throw new System.ArgumentOutOfRangeException("value");System.Text.RegularExpressions.Regex._cacheSize=t},escape:function(t){if(null==t)throw new System.ArgumentNullException("str");return System.Text.RegularExpressions.RegexParser.escape(t)},unescape:function(t){if(null==t)throw new System.ArgumentNullException("str");return System.Text.RegularExpressions.RegexParser.unescape(t)},isMatch:function(t,e){var n=System.Text.RegularExpressions;return n.Regex.isMatch$2(t,e,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},isMatch$1:function(t,e,n){var r=System.Text.RegularExpressions;return r.Regex.isMatch$2(t,e,n,r.Regex._defaultMatchTimeout)},isMatch$2:function(t,e,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(e,n,r,!0).isMatch(t)},match:function(t,e){var n=System.Text.RegularExpressions;return n.Regex.match$2(t,e,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},match$1:function(t,e,n){var r=System.Text.RegularExpressions;return r.Regex.match$2(t,e,n,r.Regex._defaultMatchTimeout)},match$2:function(t,e,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(e,n,r,!0).match(t)},matches:function(t,e){var n=System.Text.RegularExpressions;return n.Regex.matches$2(t,e,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},matches$1:function(t,e,n){var r=System.Text.RegularExpressions;return r.Regex.matches$2(t,e,n,r.Regex._defaultMatchTimeout)},matches$2:function(t,e,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(e,n,r,!0).matches(t)},replace:function(t,e,n){var r=System.Text.RegularExpressions;return r.Regex.replace$2(t,e,n,r.RegexOptions.None,r.Regex._defaultMatchTimeout)},replace$1:function(t,e,n,r){var i=System.Text.RegularExpressions;return i.Regex.replace$2(t,e,n,r,i.Regex._defaultMatchTimeout)},replace$2:function(t,e,n,r,i){return new System.Text.RegularExpressions.Regex.$ctor3(e,r,i,!0).replace(t,n)},replace$3:function(t,e,n){var r=System.Text.RegularExpressions;return r.Regex.replace$5(t,e,n,r.RegexOptions.None,r.Regex._defaultMatchTimeout)},replace$4:function(t,e,n,r){var i=System.Text.RegularExpressions;return i.Regex.replace$5(t,e,n,r,i.Regex._defaultMatchTimeout)},replace$5:function(t,e,n,r,i){return new System.Text.RegularExpressions.Regex.$ctor3(e,r,i,!0).replace$3(t,n)},split:function(t,e){var n=System.Text.RegularExpressions;return n.Regex.split$2(t,e,n.RegexOptions.None,n.Regex._defaultMatchTimeout)},split$1:function(t,e,n){var r=System.Text.RegularExpressions;return r.Regex.split$2(t,e,n,r.Regex._defaultMatchTimeout)},split$2:function(t,e,n,r){return new System.Text.RegularExpressions.Regex.$ctor3(e,n,r,!0).split(t)}},_pattern:"",_matchTimeout:System.TimeSpan.fromMilliseconds(-1),_runner:null,_caps:null,_capsize:0,_capnames:null,_capslist:null,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(t){this.$ctor1(t,System.Text.RegularExpressions.RegexOptions.None)},$ctor1:function(t,e){this.$ctor2(t,e,System.TimeSpan.fromMilliseconds(-1))},$ctor2:function(t,e,n){this.$ctor3(t,e,n,!1)},$ctor3:function(t,e,n){var r,i,o;if(this.$initialize(),r=System.Text.RegularExpressions,null==t)throw new System.ArgumentNullException("pattern");if(e<r.RegexOptions.None||e>>10!=0)throw new System.ArgumentOutOfRangeException("options");if(0!=(e&r.RegexOptions.ECMAScript)&&0!=(e&~(r.RegexOptions.ECMAScript|r.RegexOptions.IgnoreCase|r.RegexOptions.Multiline|r.RegexOptions.CultureInvariant)))throw new System.ArgumentOutOfRangeException("options");if((e|(i=System.Text.RegularExpressions.RegexOptions.IgnoreCase|System.Text.RegularExpressions.RegexOptions.Multiline|System.Text.RegularExpressions.RegexOptions.Singleline|System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace|System.Text.RegularExpressions.RegexOptions.ExplicitCapture))!==i)throw new System.NotSupportedException("Specified Regex options are not supported.");this._validateMatchTimeout(n),this._pattern=t,this._options=e,this._matchTimeout=n,this._runner=new r.RegexRunner(this),o=this._runner.parsePattern(),this._capnames=o.sparseSettings.sparseSlotNameMap,this._capslist=o.sparseSettings.sparseSlotNameMap.keys,this._capsize=this._capslist.length},getMatchTimeout:function(){return this._matchTimeout},getOptions:function(){return this._options},getRightToLeft:function(){return 0!=(this._options&System.Text.RegularExpressions.RegexOptions.RightToLeft)},isMatch:function(t){if(null==t)throw new System.ArgumentNullException("input");var e=this.getRightToLeft()?t.length:0;return this.isMatch$1(t,e)},isMatch$1:function(t,e){if(null==t)throw new System.ArgumentNullException("input");return null==this._runner.run(!0,-1,t,0,t.length,e)},match:function(t){if(null==t)throw new System.ArgumentNullException("input");var e=this.getRightToLeft()?t.length:0;return this.match$1(t,e)},match$1:function(t,e){if(null==t)throw new System.ArgumentNullException("input");return this._runner.run(!1,-1,t,0,t.length,e)},match$2:function(t,e,n){if(null==t)throw new System.ArgumentNullException("input");var r=this.getRightToLeft()?e+n:e;return this._runner.run(!1,-1,t,e,n,r)},matches:function(t){if(null==t)throw new System.ArgumentNullException("input");var e=this.getRightToLeft()?t.length:0;return this.matches$1(t,e)},matches$1:function(t,e){if(null==t)throw new System.ArgumentNullException("input");return new System.Text.RegularExpressions.MatchCollection(this,t,0,t.length,e)},getGroupNames:function(){if(null==this._capslist){for(var t=System.Globalization.CultureInfo.invariantCulture,e=[],n=this._capsize,r=0;r<n;r++)e[r]=System.Convert.toString(r,t,System.Convert.typeCodes.Int32);return e}return this._capslist.slice()},getGroupNumbers:function(){var t,e,n,r,i=this._caps;if(null==i)for(t=[],n=this._capsize,r=0;r<n;r++)t.push(r);else for(e in t=[],i)i.hasOwnProperty(e)&&(t[i[e]]=e);return t},groupNameFromNumber:function(t){var e,n;return null==this._capslist?t>=0&&t<this._capsize?(e=System.Globalization.CultureInfo.invariantCulture,System.Convert.toString(t,e,System.Convert.typeCodes.Int32)):"":null!=this._caps?null==(n=this._caps[t])?"":parseInt(n):t>=0&&t<this._capslist.length?this._capslist[t]:""},groupNumberFromName:function(t){var e,n,r,i;if(null==t)throw new System.ArgumentNullException("name");if(null!=this._capnames)return null==(e=this._capnames[t])?-1:parseInt(e);for(n=0,i=0;i<t.Length;i++){if((r=t[i])>"9"||r<"0")return-1;n*=10,n+=r-"0"}return n>=0&&n<this._capsize?n:-1},replace:function(t,e){if(null==t)throw new System.ArgumentNullException("input");var n=this.getRightToLeft()?t.length:0;return this.replace$2(t,e,-1,n)},replace$1:function(t,e,n){if(null==t)throw new System.ArgumentNullException("input");var r=this.getRightToLeft()?t.length:0;return this.replace$2(t,e,n,r)},replace$2:function(t,e,n,r){if(null==t)throw new System.ArgumentNullException("input");if(null==e)throw new System.ArgumentNullException("replacement");return System.Text.RegularExpressions.RegexParser.parseReplacement(e,this._caps,this._capsize,this._capnames,this._options).replace(this,t,n,r)},replace$3:function(t,e){if(null==t)throw new System.ArgumentNullException("input");var n=this.getRightToLeft()?t.length:0;return this.replace$5(t,e,-1,n)},replace$4:function(t,e,n){if(null==t)throw new System.ArgumentNullException("input");var r=this.getRightToLeft()?t.length:0;return this.replace$5(t,e,n,r)},replace$5:function(t,e,n,r){if(null==t)throw new System.ArgumentNullException("input");return System.Text.RegularExpressions.RegexReplacement.replace(e,this,t,n,r)},split:function(t){if(null==t)throw new System.ArgumentNullException("input");var e=this.getRightToLeft()?t.length:0;return this.split$2(t,0,e)},split$1:function(t,e){if(null==t)throw new System.ArgumentNullException("input");var n=this.getRightToLeft()?t.length:0;return this.split$2(t,e,n)},split$2:function(t,e,n){if(null==t)throw new System.ArgumentNullException("input");return System.Text.RegularExpressions.RegexReplacement.split(this,t,e,n)},_validateMatchTimeout:function(t){var e=t.getTotalMilliseconds();if(!(-1===e||e>0&&e<=2147483646))throw new System.ArgumentOutOfRangeException("matchTimeout")}}),Bridge.define("System.Text.RegularExpressions.Capture",{_text:"",_index:0,_length:0,ctor:function(t,e,n){this.$initialize(),this._text=t,this._index=e,this._length=n},getIndex:function(){return this._index},getLength:function(){return this._length},getValue:function(){return this._text.substr(this._index,this._length)},toString:function(){return this.getValue()},_getOriginalString:function(){return this._text},_getLeftSubstring:function(){return this._text.slice(0,_index)},_getRightSubstring:function(){return this._text.slice(this._index+this._length,this._text.length)}}),Bridge.define("System.Text.RegularExpressions.CaptureCollection",{inherits:function(){return[System.Collections.ICollection]},config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator","getCount","System$Collections$ICollection$getCount"]},_group:null,_capcount:0,_captures:null,ctor:function(t){this.$initialize(),this._group=t,this._capcount=t._capcount},getSyncRoot:function(){return this._group},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},getCount:function(){return this._capcount},get:function(t){if(t===this._capcount-1&&t>=0)return this._group;if(t>=this._capcount||t<0)throw new System.ArgumentOutOfRangeException("i");return this._ensureCapturesInited(),this._captures[t]},copyTo:function(t,e){if(null==t)throw new System.ArgumentNullException("array");if(t.length<e+this._capcount)throw new System.IndexOutOfRangeException;for(var n,r=e,i=0;i<this._capcount;r++,i++)n=this.get(i),System.Array.set(t,n,[r])},getEnumerator:function(){return new System.Text.RegularExpressions.CaptureEnumerator(this)},_ensureCapturesInited:function(){var t,e,n,r;if(null==this._captures){for((t=[]).length=this._capcount,e=0;e<this._capcount-1;e++)n=this._group._caps[2*e],r=this._group._caps[2*e+1],t[e]=new System.Text.RegularExpressions.Capture(this._group._text,n,r);this._capcount>0&&(t[this._capcount-1]=this._group),this._captures=t}}}),Bridge.define("System.Text.RegularExpressions.CaptureEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},_captureColl:null,_curindex:0,ctor:function(t){this.$initialize(),this._curindex=-1,this._captureColl=t},moveNext:function(){var t=this._captureColl.getCount();return!(this._curindex>=t)&&(this._curindex++,this._curindex<t)},getCurrent:function(){return this.getCapture()},getCapture:function(){if(this._curindex<0||this._curindex>=this._captureColl.getCount())throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this._captureColl.get(this._curindex)},reset:function(){this._curindex=-1}}),Bridge.define("System.Text.RegularExpressions.Group",{inherits:function(){return[System.Text.RegularExpressions.Capture]},statics:{config:{init:function(){var t=new System.Text.RegularExpressions.Group("",[],0);this.getEmpty=function(){return t}}},synchronized:function(t){if(null==t)throw new System.ArgumentNullException("group");var e=t.getCaptures();return e.getCount()>0&&e.get(0),t}},_caps:null,_capcount:0,_capColl:null,ctor:function(t,e,n){this.$initialize();var r=System.Text.RegularExpressions,i=0===n?0:e[2*(n-1)],o=0===n?0:e[2*n-1];r.Capture.ctor.call(this,t,i,o),this._caps=e,this._capcount=n},getSuccess:function(){return 0!==this._capcount},getCaptures:function(){return null==this._capColl&&(this._capColl=new System.Text.RegularExpressions.CaptureCollection(this)),this._capColl}}),Bridge.define("System.Text.RegularExpressions.GroupCollection",{inherits:function(){return[System.Collections.ICollection]},config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator","getCount","System$Collections$ICollection$getCount"]},_match:null,_captureMap:null,_groups:null,ctor:function(t,e){this.$initialize(),this._match=t,this._captureMap=e},getSyncRoot:function(){return this._match},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},getCount:function(){return this._match._matchcount.length},get:function(t){return this._getGroup(t)},getByName:function(t){if(null==this._match._regex)return System.Text.RegularExpressions.Group.getEmpty();var e=this._match._regex.groupNumberFromName(t);return this._getGroup(e)},copyTo:function(t,e){var n,r,i,o;if(null==t)throw new System.ArgumentNullException("array");if(n=this.getCount(),t.length<e+n)throw new System.IndexOutOfRangeException;for(i=e,o=0;o<n;i++,o++)r=this._getGroup(o),System.Array.set(t,r,[i])},getEnumerator:function(){return new System.Text.RegularExpressions.GroupEnumerator(this)},_getGroup:function(t){var e;return null!=this._captureMap?null==(e=this._captureMap[t])?System.Text.RegularExpressions.Group.getEmpty():this._getGroupImpl(e):t>=this._match._matchcount.length||t<0?System.Text.RegularExpressions.Group.getEmpty():this._getGroupImpl(t)},_getGroupImpl:function(t){return 0===t?this._match:(this._ensureGroupsInited(),this._groups[t])},_ensureGroupsInited:function(){var t,e,n,r,i;if(null==this._groups){for((t=[]).length=this._match._matchcount.length,t.length>0&&(t[0]=this._match),i=0;i<t.length-1;i++)e=this._match._text,n=this._match._matches[i+1],r=this._match._matchcount[i+1],t[i+1]=new System.Text.RegularExpressions.Group(e,n,r);this._groups=t}}}),Bridge.define("System.Text.RegularExpressions.GroupEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},_groupColl:null,_curindex:0,ctor:function(t){this.$initialize(),this._curindex=-1,this._groupColl=t},moveNext:function(){var t=this._groupColl.getCount();return!(this._curindex>=t)&&(this._curindex++,this._curindex<t)},getCurrent:function(){return this.getCapture()},getCapture:function(){if(this._curindex<0||this._curindex>=this._groupColl.getCount())throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this._groupColl.get(this._curindex)},reset:function(){this._curindex=-1}}),Bridge.define("System.Text.RegularExpressions.Match",{inherits:function(){return[System.Text.RegularExpressions.Group]},statics:{config:{init:function(){var t=new System.Text.RegularExpressions.Match(null,1,"",0,0,0);this.getEmpty=function(){return t}}},synchronized:function(t){if(null==t)throw new System.ArgumentNullException("match");for(var e,n=t.getGroups(),r=n.getCount(),i=0;i<r;i++)e=n.get(i),System.Text.RegularExpressions.Group.synchronized(e);return t}},_regex:null,_matchcount:null,_matches:null,_textbeg:0,_textend:0,_textstart:0,_groupColl:null,_textpos:0,ctor:function(t,e,n,r,i,o){var s,a;for(this.$initialize(),s=[0,0],System.Text.RegularExpressions.Group.ctor.call(this,n,s,0),this._regex=t,this._matchcount=[],this._matchcount.length=e,a=0;a<e;a++)this._matchcount[a]=0;this._matches=[],this._matches.length=e,this._matches[0]=s,this._textbeg=r,this._textend=r+i,this._textstart=o},getGroups:function(){return null==this._groupColl&&(this._groupColl=new System.Text.RegularExpressions.GroupCollection(this,null)),this._groupColl},nextMatch:function(){return null==this._regex?this:this._regex._runner.run(!1,this._length,this._text,this._textbeg,this._textend-this._textbeg,this._textpos)},result:function(t){if(null==t)throw new System.ArgumentNullException("replacement");if(null==this._regex)throw new System.NotSupportedException("Result cannot be called on a failed Match.");return System.Text.RegularExpressions.RegexParser.parseReplacement(t,this._regex._caps,this._regex._capsize,this._regex._capnames,this._regex._options).replacement(this)},_isMatched:function(t){return t<this._matchcount.length&&this._matchcount[t]>0&&-2!==this._matches[t][2*this._matchcount[t]-1]},_addMatch:function(t,e,n){var r,i,o,s;if(null==this._matches[t]&&(this._matches[t]=new Array(2)),2*(r=this._matchcount[t])+2>this._matches[t].length){for(i=this._matches[t],o=new Array(8*r),s=0;s<2*r;s++)o[s]=i[s];this._matches[t]=o}this._matches[t][2*r]=e,this._matches[t][2*r+1]=n,this._matchcount[t]=r+1},_tidy:function(t){var e=this._matches[0];this._index=e[0],this._length=e[1],this._textpos=t,this._capcount=this._matchcount[0]},_groupToStringImpl:function(t){var e=this._matchcount[t];if(0===e)return"";var n=this._matches[t],r=n[2*(e-1)],i=n[2*e-1];return this._text.slice(r,r+i)},_lastGroupToStringImpl:function(){return this._groupToStringImpl(this._matchcount.length-1)}}),Bridge.define("System.Text.RegularExpressions.MatchSparse",{inherits:function(){return[System.Text.RegularExpressions.Match]},_caps:null,ctor:function(t,e,n,r,i,o,s){this.$initialize(),System.Text.RegularExpressions.Match.ctor.call(this,t,n,r,i,o,s),this._caps=e},getGroups:function(){return null==this._groupColl&&(this._groupColl=new System.Text.RegularExpressions.GroupCollection(this,this._caps)),this._groupColl}}),Bridge.define("System.Text.RegularExpressions.MatchCollection",{inherits:function(){return[System.Collections.ICollection]},config:{alias:["getEnumerator","System$Collections$IEnumerable$getEnumerator","getCount","System$Collections$ICollection$getCount"]},_regex:null,_input:null,_beginning:0,_length:0,_startat:0,_prevlen:0,_matches:null,_done:!1,ctor:function(t,e,n,r,i){if(this.$initialize(),i<0||i>e.Length)throw new System.ArgumentOutOfRangeException("startat");this._regex=t,this._input=e,this._beginning=n,this._length=r,this._startat=i,this._prevlen=-1,this._matches=[]},getCount:function(){return this._done||this._getMatch(2147483647),this._matches.length},getSyncRoot:function(){return this},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},get:function(t){var e=this._getMatch(t);if(null==e)throw new System.ArgumentOutOfRangeException("i");return e},copyTo:function(t,e){var n,r,i,o;if(null==t)throw new System.ArgumentNullException("array");if(n=this.getCount(),t.length<e+n)throw new System.IndexOutOfRangeException;for(i=e,o=0;o<n;i++,o++)r=this._getMatch(o),System.Array.set(t,r,[i])},getEnumerator:function(){return new System.Text.RegularExpressions.MatchEnumerator(this)},_getMatch:function(t){if(t<0)return null;if(this._matches.length>t)return this._matches[t];if(this._done)return null;var e;do{if(!(e=this._regex._runner.run(!1,this._prevLen,this._input,this._beginning,this._length,this._startat)).getSuccess())return this._done=!0,null;this._matches.push(e),this._prevLen=e._length,this._startat=e._textpos}while(this._matches.length<=t);return e}}),Bridge.define("System.Text.RegularExpressions.MatchEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},_matchcoll:null,_match:null,_curindex:0,_done:!1,ctor:function(t){this.$initialize(),this._matchcoll=t},moveNext:function(){return!this._done&&(this._match=this._matchcoll._getMatch(this._curindex),this._curindex++,null!=this._match||(this._done=!0,!1))},getCurrent:function(){if(null==this._match)throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this._match},reset:function(){this._curindex=0,this._done=!1,this._match=null}}),Bridge.define("System.Text.RegularExpressions.RegexOptions",{statics:{None:0,IgnoreCase:1,Multiline:2,ExplicitCapture:4,Compiled:8,Singleline:16,IgnorePatternWhitespace:32,RightToLeft:64,ECMAScript:256,CultureInvariant:512},$kind:"enum",$flags:!0}),Bridge.define("System.Text.RegularExpressions.RegexRunner",{statics:{},_runregex:null,_netEngine:null,_runtext:"",_runtextpos:0,_runtextbeg:0,_runtextend:0,_runtextstart:0,_quick:!1,_prevlen:0,ctor:function(t){if(this.$initialize(),null==t)throw new System.ArgumentNullException("regex");this._runregex=t;var e=t.getOptions(),n=System.Text.RegularExpressions.RegexOptions,r=(e&n.IgnoreCase)===n.IgnoreCase,i=(e&n.Multiline)===n.Multiline,o=(e&n.Singleline)===n.Singleline,s=(e&n.IgnorePatternWhitespace)===n.IgnorePatternWhitespace,a=(e&n.ExplicitCapture)===n.ExplicitCapture,u=t._matchTimeout.getTotalMilliseconds();this._netEngine=new System.Text.RegularExpressions.RegexEngine(t._pattern,r,i,o,s,a,u)},run:function(t,e,n,r,i,o){var s,a,u;if(o<0||o>n.Length)throw new System.ArgumentOutOfRangeException("start","Start index cannot be less than 0 or greater than input length.");if(i<0||i>n.Length)throw new ArgumentOutOfRangeException("length","Length cannot be less than 0 or exceed input length.");if(this._runtext=n,this._runtextbeg=r,this._runtextend=r+i,this._runtextstart=o,this._quick=t,this._prevlen=e,this._runregex.getRightToLeft()?(s=this._runtextbeg,a=-1):(s=this._runtextend,a=1),0===this._prevlen){if(this._runtextstart===s)return System.Text.RegularExpressions.Match.getEmpty();this._runtextstart+=a}return u=this._netEngine.match(this._runtext,this._runtextstart),this._convertNetEngineResults(u)},parsePattern:function(){return this._netEngine.parsePattern()},_convertNetEngineResults:function(t){var e,n,r,i,o,s,a,u;if(t.success&&this._quick)return null;if(!t.success)return System.Text.RegularExpressions.Match.getEmpty();for(n=(e=this.parsePattern()).sparseSettings.isSparse?new System.Text.RegularExpressions.MatchSparse(this._runregex,e.sparseSettings.sparseSlotMap,t.groups.length,this._runtext,0,this._runtext.length,this._runtextstart):new System.Text.RegularExpressions.Match(this._runregex,t.groups.length,this._runtext,0,this._runtext.length,this._runtextstart),s=0;s<t.groups.length;s++)for(o=0,null!=(r=t.groups[s]).descriptor&&(o=this._runregex.groupNumberFromName(r.descriptor.name)),a=0;a<r.captures.length;a++)i=r.captures[a],n._addMatch(o,i.capIndex,i.capLength);return u=t.capIndex+t.capLength,n._tidy(u),n}}),Bridge.define("System.Text.RegularExpressions.RegexParser",{statics:{_Q:5,_S:4,_Z:3,_X:2,_E:1,_category:[0,0,0,0,0,0,0,0,0,2,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,4,0,0,0,4,4,5,5,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,4,0,0,0],escape:function(t){for(var e,n,r,i=0;i<t.length;i++)if(System.Text.RegularExpressions.RegexParser._isMetachar(t[i])){e="",n=t[i],e+=t.slice(0,i);do{switch(e+="\\",n){case"\n":n="n";break;case"\r":n="r";break;case"\t":n="t";break;case"\f":n="f"}for(e+=n,r=++i;i<t.length&&(n=t[i],!System.Text.RegularExpressions.RegexParser._isMetachar(n));)i++;e+=t.slice(r,i)}while(i<t.length);return e}return t},unescape:function(t){for(var e,n,r,i=System.Globalization.CultureInfo.invariantCulture,o=0;o<t.length;o++)if("\\"===t[o]){e="",(r=new System.Text.RegularExpressions.RegexParser(i))._setPattern(t),e+=t.slice(0,o);do{for(o++,r._textto(o),o<t.length&&(e+=r._scanCharEscape()),n=o=r._textpos();o<t.length&&"\\"!==t[o];)o++;e+=t.slice(n,o)}while(o<t.length);return e}return t},parseReplacement:function(t,e,n,r,i){var o,s=System.Globalization.CultureInfo.getCurrentCulture(),a=new System.Text.RegularExpressions.RegexParser(s);return a._options=i,a._noteCaptures(e,n,r),a._setPattern(t),o=a._scanReplacement(),new System.Text.RegularExpressions.RegexReplacement(t,o,e)},_isMetachar:function(t){var e=t.charCodeAt(0);return e<="|".charCodeAt(0)&&System.Text.RegularExpressions.RegexParser._category[e]>=System.Text.RegularExpressions.RegexParser._E}},_caps:null,_capsize:0,_capnames:null,_pattern:"",_currentPos:0,_concatenation:null,_culture:null,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(t){this.$initialize(),this._culture=t,this._caps={}},_noteCaptures:function(t,e,n){this._caps=t,this._capsize=e,this._capnames=n},_setPattern:function(t){null==t&&(t=""),this._pattern=t||"",this._currentPos=0},_scanReplacement:function(){this._concatenation=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Concatenate,this._options);for(var t,e,n;0!==(t=this._charsRight());){for(e=this._textpos();t>0&&"$"!==this._rightChar();)this._moveRight(),t--;this._addConcatenate(e,this._textpos()-e),t>0&&"$"===this._moveRightGetChar()&&(n=this._scanDollar(),this._concatenation.addChild(n))}return this._concatenation},_addConcatenate:function(t,e){var n,r,i;0!==e&&(e>1?(r=this._pattern.slice(t,t+e),n=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Multi,this._options,r)):(i=this._pattern[t],n=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,i)),this._concatenation.addChild(n))},_useOptionE:function(){return 0!=(this._options&System.Text.RegularExpressions.RegexOptions.ECMAScript)},_makeException:function(t){return new System.ArgumentException("Incorrect pattern. "+t)},_scanDollar:function(){var t,e,n,r,i,o=214748364;if(0===this._charsRight())return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$");var s,a=this._rightChar(),u=this._textpos(),l=u;if("{"===a&&this._charsRight()>1?(s=!0,this._moveRight(),a=this._rightChar()):s=!1,a>="0"&&a<="9"){if(!s&&this._useOptionE()){for(t=-1,n=a-"0",this._moveRight(),this._isCaptureSlot(n)&&(t=n,l=this._textpos());this._charsRight()>0&&(a=this._rightChar())>="0"&&a<="9";){if(e=a-"0",n>o||n===o&&e>7)throw this._makeException("Capture group is out of range.");n=10*n+e,this._moveRight(),this._isCaptureSlot(n)&&(t=n,l=this._textpos())}if(this._textto(l),t>=0)return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,t)}else if(t=this._scanDecimal(),(!s||this._charsRight()>0&&"}"===this._moveRightGetChar())&&this._isCaptureSlot(t))return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,t)}else if(s&&this._isWordChar(a)){if(r=this._scanCapname(),this._charsRight()>0&&"}"===this._moveRightGetChar()&&this._isCaptureName(r))return i=this._captureSlotFromName(r),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,i)}else if(!s){switch(t=1,a){case"$":return this._moveRight(),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$");case"&":t=0;break;case"`":t=System.Text.RegularExpressions.RegexReplacement.LeftPortion;break;case"'":t=System.Text.RegularExpressions.RegexReplacement.RightPortion;break;case"+":t=System.Text.RegularExpressions.RegexReplacement.LastGroup;break;case"_":t=System.Text.RegularExpressions.RegexReplacement.WholeString}if(1!==t)return this._moveRight(),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,t)}return this._textto(u),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$")},_scanDecimal:function(){for(var t,e,n=214748364,r=0;this._charsRight()>0&&!((t=this._rightChar())<"0"||t>"9");){if(e=t-"0",this._moveRight(),r>n||r===n&&e>7)throw this._makeException("Capture group is out of range.");r*=10,r+=e}return r},_scanOctal:function(){var t,e,n;for((n=3)>this._charsRight()&&(n=this._charsRight()),e=0;n>0&&(t=this._rightChar()-"0")<=7&&(this._moveRight(),e*=8,e+=t,!(this._useOptionE()&&e>=32));n-=1);return e&=255,String.fromCharCode(e)},_scanHex:function(t){var e,n;if(e=0,this._charsRight()>=t)for(;t>0&&(n=this._hexDigit(this._moveRightGetChar()))>=0;t-=1)e*=16,e+=n;if(t>0)throw this._makeException("Insufficient hexadecimal digits.");return e},_hexDigit:function(t){var e,n=t.charCodeAt(0);return(e=n-"0".charCodeAt(0))<=9?e:(e=n-"a".charCodeAt(0))<=5||(e=n-"A".charCodeAt(0))<=5?e+10:-1},_scanControl:function(){if(this._charsRight()<=0)throw this._makeException("Missing control character.");var t=this._moveRightGetChar().charCodeAt(0);if(t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)&&(t-="a".charCodeAt(0)-"A".charCodeAt(0)),(t-="@".charCodeAt(0))<" ".charCodeAt(0))return String.fromCharCode(t);throw this._makeException("Unrecognized control character.")},_scanCapname:function(){for(var t=this._textpos();this._charsRight()>0;)if(!this._isWordChar(this._moveRightGetChar())){this._moveLeft();break}return _pattern.slice(t,this._textpos())},_scanCharEscape:function(){var t=this._moveRightGetChar();if(t>="0"&&t<="7")return this._moveLeft(),this._scanOctal();switch(t){case"x":return this._scanHex(2);case"u":return this._scanHex(4);case"a":return"";case"b":return"\b";case"e":return"";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"c":return this._scanControl();default:if("8"===t||"9"===t||"_"===t||!this._useOptionE()&&this._isWordChar(t))throw this._makeException("Unrecognized escape sequence \\"+t+".");return t}},_captureSlotFromName:function(t){return this._capnames[t]},_isCaptureSlot:function(t){return null!=this._caps?null!=this._caps[t]:t>=0&&t<this._capsize},_isCaptureName:function(t){return null!=this._capnames&&null!=_capnames[t]},_isWordChar:function(t){return System.Char.isLetter(t.charCodeAt(0))},_charsRight:function(){return this._pattern.length-this._currentPos},_rightChar:function(){return this._pattern[this._currentPos]},_moveRightGetChar:function(){return this._pattern[this._currentPos++]},_moveRight:function(){this._currentPos++},_textpos:function(){return this._currentPos},_textto:function(t){this._currentPos=t},_moveLeft:function(){this._currentPos--}}),Bridge.define("System.Text.RegularExpressions.RegexNode",{statics:{One:9,Multi:12,Ref:13,Empty:23,Concatenate:25},_type:0,_str:null,_children:null,_next:null,_m:0,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(t,e,n){this.$initialize(),this._type=t,this._options=e,t===System.Text.RegularExpressions.RegexNode.Ref?this._m=n:this._str=n||null},addChild:function(t){null==this._children&&(this._children=[]);var e=t._reduce();this._children.push(e),e._next=this},childCount:function(){return null==this._children?0:this._children.length},child:function(t){return this._children[t]},_reduce:function(){return this._type===System.Text.RegularExpressions.RegexNode.Concatenate?this._reduceConcatenation():this},_reduceConcatenation:function(){var t,e,n,r,i,o,s=!1,a=0;if(null==this._children)return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Empty,this._options);for(r=0,i=0;r<this._children.length;r++,i++)if(e=this._children[r],i<r&&(this._children[i]=e),e._type===System.Text.RegularExpressions.RegexNode.Concatenate&&e._isRightToLeft()){for(o=0;o<e._children.length;o++)e._children[o]._next=this;this._children.splice.apply(this._children,[r+1,0].concat(e._children)),i--}else if(e._type===System.Text.RegularExpressions.RegexNode.Multi||e._type===System.Text.RegularExpressions.RegexNode.One){if(t=e._options&(System.Text.RegularExpressions.RegexOptions.RightToLeft|System.Text.RegularExpressions.RegexOptions.IgnoreCase),!s||a!==t){s=!0,a=t;continue}(n=this._children[--i])._type===System.Text.RegularExpressions.RegexNode.One&&(n._type=System.Text.RegularExpressions.RegexNode.Multi,n._str=n._str),0==(t&System.Text.RegularExpressions.RegexOptions.RightToLeft)?n._str+=e._str:n._str=e._str+n._str}else e._type===System.Text.RegularExpressions.RegexNode.Empty?i--:s=!1;return i<r&&this._children.splice(i,r-i),this._stripEnation(System.Text.RegularExpressions.RegexNode.Empty)},_stripEnation:function(t){switch(this.childCount()){case 0:return new c.RegexNode(t,this._options);case 1:return this.child(0);default:return this}},_isRightToLeft:function(){return(this._options&System.Text.RegularExpressions.RegexOptions.RightToLeft)>0}}),Bridge.define("System.Text.RegularExpressions.RegexReplacement",{statics:{replace:function(t,e,n,r,i){var o,s,a,u,l,c,g;if(null==t)throw new System.ArgumentNullException("evaluator");if(r<-1)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than -1.");if(i<0||i>n.length)throw new System.ArgumentOutOfRangeException("startat","Start index cannot be less than 0 or greater than input length.");if(0===r)return n;if((o=e.match$1(n,i)).getSuccess()){if(s="",e.getRightToLeft()){c=[],a=n.length;do{if((u=o.getIndex())+(l=o.getLength())!==a&&c.push(n.slice(u+l,a)),a=u,c.push(t(o)),0==--r)break;o=o.nextMatch()}while(o.getSuccess());for(s=new StringBuilder,a>0&&(s+=s.slice(0,a)),g=c.length-1;g>=0;g--)s+=c[g]}else{a=0;do{if(u=o.getIndex(),l=o.getLength(),u!==a&&(s+=n.slice(a,u)),a=u+l,s+=t(o),0==--r)break;o=o.nextMatch()}while(o.getSuccess());a<n.length&&(s+=n.slice(a,n.length))}return s}return n},split:function(t,e,n,r){var i,o,s,a,u,l,c,g;if(n<0)throw new System.ArgumentOutOfRangeException("count","Count can't be less than 0.");if(r<0||r>e.length)throw new System.ArgumentOutOfRangeException("startat","Start index cannot be less than 0 or greater than input length.");if(i=[],1===n)return i.push(e),i;if(--n,(o=t.match$1(e,r)).getSuccess())if(t.getRightToLeft()){for(a=e.length;;){for(u=o.getIndex(),l=o.getLength(),g=(c=o.getGroups()).getCount(),i.push(e.slice(u+l,a)),a=u,s=1;s<g;s++)o._isMatched(s)&&i.push(c.get(s).toString());if(0==--n)break;if(!(o=o.nextMatch()).getSuccess())break}i.push(e.slice(0,a)),i.reverse()}else{for(a=0;;){for(u=o.getIndex(),l=o.getLength(),g=(c=o.getGroups()).getCount(),i.push(e.slice(a,u)),a=u+l,s=1;s<g;s++)o._isMatched(s)&&i.push(c.get(s).toString());if(0==--n)break;if(!(o=o.nextMatch()).getSuccess())break}i.push(e.slice(a,e.length))}else i.push(e);return i},Specials:4,LeftPortion:-1,RightPortion:-2,LastGroup:-3,WholeString:-4},_rep:"",_strings:[],_rules:[],ctor:function(t,e,n){if(this.$initialize(),this._rep=t,e._type!==System.Text.RegularExpressions.RegexNode.Concatenate)throw new System.ArgumentException("Replacement error.");for(var r,i,o="",s=[],a=[],u=0;u<e.childCount();u++)switch((i=e.child(u))._type){case System.Text.RegularExpressions.RegexNode.Multi:case System.Text.RegularExpressions.RegexNode.One:o+=i._str;break;case System.Text.RegularExpressions.RegexNode.Ref:o.length>0&&(a.push(s.length),s.push(o),o=""),r=i._m,null!=n&&r>=0&&(r=n[r]),a.push(-System.Text.RegularExpressions.RegexReplacement.Specials-1-r);break;default:throw new System.ArgumentException("Replacement error.")}o.length>0&&(a.push(s.length),s.push(o)),this._strings=s,this._rules=a},getPattern:function(){return _rep},replacement:function(t){return this._replacementImpl("",t)},replace:function(t,e,n,r){var i,o,s,a,u,l,c;if(n<-1)throw new System.ArgumentOutOfRangeException("count","Count cannot be less than -1.");if(r<0||r>e.length)throw new System.ArgumentOutOfRangeException("startat","Start index cannot be less than 0 or greater than input length.");if(0===n)return e;if((i=t.match$1(e,r)).getSuccess()){if(o="",t.getRightToLeft()){l=[],s=e.length;do{if((a=i.getIndex())+(u=i.getLength())!==s&&l.push(e.slice(a+u,s)),s=a,this._replacementImplRTL(l,i),0==--n)break;i=i.nextMatch()}while(i.getSuccess());for(s>0&&(o+=o.slice(0,s)),c=l.length-1;c>=0;c--)o+=l[c]}else{s=0;do{if(a=i.getIndex(),u=i.getLength(),a!==s&&(o+=e.slice(s,a)),s=a+u,o=this._replacementImpl(o,i),0==--n)break;i=i.nextMatch()}while(i.getSuccess());s<e.length&&(o+=e.slice(s,e.length))}return o}return e},_replacementImpl:function(t,e){for(var n,r=System.Text.RegularExpressions.RegexReplacement.Specials,i=0;i<this._rules.length;i++)if((n=this._rules[i])>=0)t+=this._strings[n];else if(n<-r)t+=e._groupToStringImpl(-r-1-n);else switch(-r-1-n){case System.Text.RegularExpressions.RegexReplacement.LeftPortion:t+=e._getLeftSubstring();break;case System.Text.RegularExpressions.RegexReplacement.RightPortion:t+=e._getRightSubstring();break;case System.Text.RegularExpressions.RegexReplacement.LastGroup:t+=e._lastGroupToStringImpl();break;case System.Text.RegularExpressions.RegexReplacement.WholeString:t+=e._getOriginalString()}return t},_replacementImplRTL:function(t,e){for(var n,r=System.Text.RegularExpressions.RegexReplacement.Specials,i=_rules.length-1;i>=0;i--)if((n=this._rules[i])>=0)t.push(this._strings[n]);else if(n<-r)t.push(e._groupToStringImpl(-r-1-n));else switch(-r-1-n){case System.Text.RegularExpressions.RegexReplacement.LeftPortion:t.push(e._getLeftSubstring());break;case System.Text.RegularExpressions.RegexReplacement.RightPortion:t.push(e._getRightSubstring());break;case System.Text.RegularExpressions.RegexReplacement.LastGroup:t.push(e._lastGroupToStringImpl());break;case System.Text.RegularExpressions.RegexReplacement.WholeString:t.push(e._getOriginalString())}}}),Bridge.define("System.Text.RegularExpressions.RegexEngine",{_pattern:"",_patternInfo:null,_text:"",_textStart:0,_timeoutMs:-1,_timeoutTime:-1,_settings:null,_branchType:{base:0,offset:1,lazy:2,greedy:3,or:4},_branchResultKind:{ok:1,endPass:2,nextPass:3,nextBranch:4},ctor:function(t,e,n,r,i,o,s){if(this.$initialize(),null==t)throw new System.ArgumentNullException("pattern");this._pattern=t,this._timeoutMs=s,this._settings={ignoreCase:e,multiline:n,singleline:r,ignoreWhitespace:i,explicitCapture:o}},match:function(t,e){var n;if(null==t)throw new System.ArgumentNullException("text");if(null!=e&&(e<0||e>t.length))throw new System.ArgumentOutOfRangeException("textStart","Start index cannot be less than 0 or greater than input length.");return this._text=t,this._textStart=e,this._timeoutTime=this._timeoutMs>0?(new Date).getTime()+System.Convert.toInt32(this._timeoutMs+.5):-1,(n=this.parsePattern()).shouldFail?this._getEmptyMatch():(this._checkTimeout(),this._scanAndTransformResult(e,n.tokens,!1,null))},parsePattern:function(){if(null==this._patternInfo){var t=System.Text.RegularExpressions.RegexEngineParser.parsePattern(this._pattern,this._cloneSettings(this._settings));this._patternInfo=t}return this._patternInfo},_scanAndTransformResult:function(t,e,n,r){var i=this._scan(t,this._text.length,e,n,r);return this._collectScanResults(i,t)},_scan:function(t,e,n,r,i){var o,s,a=this._branchResultKind,u=[];if(u.grCaptureCache={},o=null,0===n.length)return(s=new System.Text.RegularExpressions.RegexEngineState).capIndex=t,s.txtIndex=t,s.capLength=0,s;var l=r?this._branchType.base:this._branchType.offset,c=this._patternInfo.isContiguous?t:e,g=new System.Text.RegularExpressions.RegexEngineBranch(l,t,t,c);for(g.pushPass(0,n,this._cloneSettings(this._settings)),g.started=!0,g.state.txtIndex=t,u.push(g);u.length;){if(o=u[u.length-1],this._scanBranch(e,u,o)===a.ok&&(null==i||o.state.capLength===i))return o.state;this._advanceToNextBranch(u,o),this._checkTimeout()}return null},_scanBranch:function(t,e,n){var r,i,o=this._branchResultKind;if(n.mustFail)return n.mustFail=!1,o.nextBranch;for(;n.hasPass();){if(null==(r=n.peekPass()).tokens||0===r.tokens.length)i=o.endPass;else{if(this._addAlternationBranches(e,n,r)===o.nextBranch)return o.nextBranch;i=this._scanPass(t,e,n,r)}switch(i){case o.nextBranch:return i;case o.nextPass:continue;case o.endPass:case o.ok:n.popPass();break;default:throw new System.InvalidOperationException("Unexpected branch result.")}}return o.ok},_scanPass:function(t,e,n,r){for(var i,o,s,a=this._branchResultKind,u=r.tokens.length;r.index<u;)if(i=r.tokens[r.index],null==(o=r.probe)){if(this._addBranchBeforeProbing(e,n,r,i))return a.nextBranch;switch(s=this._scanToken(t,e,n,r,i)){case a.nextBranch:case a.nextPass:case a.endPass:return s;case a.ok:r.index++;break;default:throw new System.InvalidOperationException("Unexpected branch-pass result.")}}else{if(o.value<o.min||o.forced){if((s=this._scanToken(t,e,n,r,i))!==a.ok)return s;o.value+=1,o.forced=!1;continue}if(this._addBranchAfterProbing(e,n,r,o),o.forced)continue;r.probe=null,r.index++}return a.ok},_addAlternationBranches:function(t,e,n){var r,i,o,s,a=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,u=this._branchType,l=n.tokens.length,c=this._branchResultKind;if(!n.alternationHandled&&!n.tokens.noAlternation){for(r=[-1],s=0;s<l;s++)n.tokens[s].type===a.alternation&&r.push(s);if(r.length>1){for(s=0;s<r.length;s++)(i=new System.Text.RegularExpressions.RegexEngineBranch(u.or,s,0,r.length,e.state)).isNotFailing=!0,(o=i.peekPass()).alternationHandled=!0,o.index=r[s]+1,t.splice(t.length-s,0,i);return t[t.length-r.length].isNotFailing=!1,e.mustFail=!0,n.alternationHandled=!0,c.nextBranch}n.tokens.noAlternation=!0}return c.ok},_addBranchBeforeProbing:function(t,e,n,r){var i,o,s=this._tryGetTokenProbe(r);return null!=s&&(n.probe=s,i=s.isLazy?this._branchType.lazy:this._branchType.greedy,o=new System.Text.RegularExpressions.RegexEngineBranch(i,s.value,s.min,s.max,e.state),t.push(o),!0)},_addBranchAfterProbing:function(t,e,n,r){var i,o,s;r.isLazy?r.value+1<=r.max&&(o=(i=e.clone()).peekPass().probe,i.value+=1,o.forced=!0,t.splice(t.length-1,0,i),e.isNotFailing=!0):r.value+1<=r.max&&((s=e.clone()).started=!0,s.peekPass().probe=null,s.peekPass().index++,t.splice(t.length-1,0,s),r.forced=!0,e.value+=1,e.isNotFailing=!0)},_tryGetTokenProbe:function(t){var e,n,r,i=t.qtoken;if(null==i)return null;if(e=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,i.type===e.quantifier)switch(i.value){case"*":case"*?":n=0,r=2147483647;break;case"+":case"+?":n=1,r=2147483647;break;case"?":case"??":n=0,r=1;break;default:throw new System.InvalidOperationException("Unexpected quantifier value.")}else if(i.type===e.quantifierN)n=i.data.n,r=i.data.n;else{if(i.type!==e.quantifierNM)return null;n=i.data.n,r=null!=i.data.m?i.data.m:2147483647}return new System.Text.RegularExpressions.RegexEngineProbe(n,r,0,i.data.isLazy)},_advanceToNextBranch:function(t,e){if(0!==t.length){var n=t[t.length-1];if(!n.started)return void(n.started=!0);if(e!==n)throw new System.InvalidOperationException("Current branch is supposed to be the last one.");if(1===t.length&&e.type===this._branchType.offset)e.value++,e.state.txtIndex=e.value,e.mustFail=!1,e.state.capIndex=null,e.state.capLength=0,e.state.groups.length=0,e.state.passes.length=1,e.state.passes[0].clearState(this._cloneSettings(this._settings)),e.value>e.max&&t.pop();else if(t.pop(),!e.isNotFailing)return n=t[t.length-1],void this._advanceToNextBranch(t,n)}},_collectScanResults:function(t,e){var n,r,i,o,s,a,u=this._patternInfo.groups,l=this._text,c={},g={},h=this._getEmptyMatch();if(null!=t){for(n=t.groups,this._fillMatch(h,t.capIndex,t.capLength,e),a=0;a<n.length;a++)(i=u[(r=n[a]).rawIndex-1]).constructs.skipCapture||(o={capIndex:r.capIndex,capLength:r.capLength,value:l.slice(r.capIndex,r.capIndex+r.capLength)},null==(s=g[i.name])?(s={capIndex:0,capLength:0,value:"",success:!1,captures:[o]},g[i.name]=s):s.captures.push(o));for(a=0;a<u.length;a++)(i=u[a]).constructs.skipCapture||!0!==c[i.name]&&(null==(s=g[i.name])?s={capIndex:0,capLength:0,value:"",success:!1,captures:[]}:s.captures.length>0&&(o=s.captures[s.captures.length-1],s.capIndex=o.capIndex,s.capLength=o.capLength,s.value=o.value,s.success=!0),c[i.name]=!0,s.descriptor=i,h.groups.push(s))}return h},_scanToken:function(t,e,n,r,i){var o=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,s=this._branchResultKind;switch(i.type){case o.group:case o.groupImnsx:case o.alternationGroup:return this._scanGroupToken(t,e,n,r,i);case o.groupImnsxMisc:return this._scanGroupImnsxToken(i.group.constructs,r.settings);case o.charGroup:return this._scanCharGroupToken(e,n,r,i,!1);case o.charNegativeGroup:return this._scanCharNegativeGroupToken(e,n,r,i,!1);case o.escChar:case o.escCharOctal:case o.escCharHex:case o.escCharUnicode:case o.escCharCtrl:return this._scanLiteral(t,e,n,r,i.data.ch);case o.escCharOther:case o.escCharClass:return this._scanEscapeToken(e,n,r,i);case o.escCharClassCategory:throw new System.NotSupportedException("Unicode Category constructions are not supported.");case o.escCharClassBlock:throw new System.NotSupportedException("Unicode Named block constructions are not supported.");case o.escCharClassDot:return this._scanDotToken(t,e,n,r);case o.escBackrefNumber:return this._scanBackrefNumberToken(t,e,n,r,i);case o.escBackrefName:return this._scanBackrefNameToken(t,e,n,r,i);case o.anchor:case o.escAnchor:return this._scanAnchorToken(t,e,n,r,i);case o.groupConstruct:case o.groupConstructName:case o.groupConstructImnsx:case o.groupConstructImnsxMisc:return s.ok;case o.alternationGroupCondition:case o.alternationGroupRefNameCondition:case o.alternationGroupRefNumberCondition:return this._scanAlternationConditionToken(t,e,n,r,i);case o.alternation:return s.endPass;case o.commentInline:case o.commentXMode:return s.ok;default:return this._scanLiteral(t,e,n,r,i.value)}},_scanGroupToken:function(t,e,n,r,i){var o,s,a=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,u=this._branchResultKind,l=n.state.txtIndex;if(r.onHold){if(i.type===a.group){var c=i.group.rawIndex,g=r.onHoldTextIndex,h=l-g,m=e.grCaptureCache[c];if(null==m&&(m={},e.grCaptureCache[c]=m),null!=m[o=g.toString()+"_"+h.toString()])return u.nextBranch;m[o]=!0,i.group.constructs.emptyCapture||(i.group.isBalancing?n.state.logCaptureGroupBalancing(i.group,g):n.state.logCaptureGroup(i.group,g,h))}return r.onHold=!1,r.onHoldTextIndex=-1,u.ok}if(i.type===a.group||i.type===a.groupImnsx){if(s=i.group.constructs,this._scanGroupImnsxToken(s,r.settings),s.isPositiveLookahead||s.isNegativeLookahead||s.isPositiveLookbehind||s.isNegativeLookbehind)return this._scanLook(n,l,t,i);if(s.isNonbacktracking)return this._scanNonBacktracking(n,l,t,i)}return r.onHoldTextIndex=l,r.onHold=!0,n.pushPass(0,i.children,this._cloneSettings(r.settings)),u.nextPass},_scanGroupImnsxToken:function(t,e){var n=this._branchResultKind;return null!=t.isIgnoreCase&&(e.ignoreCase=t.isIgnoreCase),null!=t.isMultiline&&(e.multiline=t.isMultiline),null!=t.isSingleLine&&(e.singleline=t.isSingleLine),null!=t.isIgnoreWhitespace&&(e.ignoreWhitespace=t.isIgnoreWhitespace),null!=t.isExplicitCapture&&(e.explicitCapture=t.isExplicitCapture),n.ok},_scanAlternationConditionToken:function(t,e,n,r,i){var o,s=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,a=this._branchResultKind,u=i.children,l=n.state.txtIndex,c=a.nextBranch;return i.type===s.alternationGroupRefNameCondition||i.type===s.alternationGroupRefNumberCondition?c=null!=n.state.resolveBackref(i.data.packedSlotId)?a.ok:a.nextBranch:(o=this._scan(l,t,u,!0,null),this._combineScanResults(n,o)&&(c=a.ok)),c===a.nextBranch&&r.tokens.noAlternation&&(c=a.endPass),c},_scanLook:function(t,e,n,r){var i=r.group.constructs,o=this._branchResultKind,s=r.children,a=i.isPositiveLookahead||i.isNegativeLookahead,u=i.isPositiveLookbehind||i.isNegativeLookbehind;return a||u?(s=s.slice(1,s.length),(i.isPositiveLookahead||i.isPositiveLookbehind)===(a?this._scanLookAhead(t,e,n,s):this._scanLookBehind(t,e,n,s))?o.ok:o.nextBranch):null},_scanLookAhead:function(t,e,n,r){var i=this._scan(e,n,r,!0,null);return this._combineScanResults(t,i)},_scanLookBehind:function(t,e,n,r){for(var i,o,s=e;s>=0;){if(i=e-s,o=this._scan(s,n,r,!0,i),this._combineScanResults(t,o))return!0;--s}return!1},_scanNonBacktracking:function(t,e,n,r){var i,o=this._branchResultKind,s=r.children;return s=s.slice(1,s.length),(i=this._scan(e,n,s,!0,null))?(t.state.logCapture(i.capLength),o.ok):o.nextBranch},_scanLiteral:function(t,e,n,r,i){var o,s=this._branchResultKind,a=n.state.txtIndex;if(a+i.length>t)return s.nextBranch;if(r.settings.ignoreCase){for(o=0;o<i.length;o++)if(this._text[a+o].toLowerCase()!==i[o].toLowerCase())return s.nextBranch}else for(o=0;o<i.length;o++)if(this._text[a+o]!==i[o])return s.nextBranch;return n.state.logCapture(i.length),s.ok},_scanWithJsRegex:function(t,e,n,r,i){var o,s,a=this._branchResultKind,u=e.state.txtIndex,l=this._text[u];return null==l&&(l=""),o=n.settings.ignoreCase?"i":"",null==(s=r.rgx)&&(null==i&&(i=r.value),s=new RegExp(i,o),r.rgx=s),s.test(l)?(e.state.logCapture(l.length),a.ok):a.nextBranch},_scanWithJsRegex2:function(t,e){var n=this._branchResultKind,r=this._text[t];return null==r&&(r=""),new RegExp(e,"").test(r)?n.ok:n.nextBranch},_scanCharGroupToken:function(t,e,n,r,i){var o,s,a,u,l,c,g,h=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,m=this._branchResultKind,f=e.state.txtIndex,d=this._text[f];if(null==d)return m.nextBranch;if(a=d.charCodeAt(0),u=r.data.ranges,null!=r.data.substractToken){if(r.data.substractToken.type===h.charGroup)g=this._scanCharGroupToken(t,e,n,r.data.substractToken,!0);else{if(r.data.substractToken.type!==h.charNegativeGroup)throw new System.InvalidOperationException("Unexpected substuct group token.");g=this._scanCharNegativeGroupToken(t,e,n,r.data.substractToken,!0)}if(g===m.ok)return r.type===h.charGroup?m.nextBranch:m.ok}if(null!=u.charClassToken&&this._scanWithJsRegex(t,e,n,u.charClassToken)===m.ok)return m.ok;for(s=0;s<2;s++){for(o=0;o<u.length&&!((l=u[o]).n>a);o++)if(a<=l.m)return i||e.state.logCapture(1),m.ok;null==c&&n.settings.ignoreCase&&(c=d.toUpperCase(),a=(d=d===c?d.toLowerCase():c).charCodeAt(0))}return m.nextBranch},_scanCharNegativeGroupToken:function(t,e,n,r,i){var o=this._branchResultKind,s=e.state.txtIndex;return null==this._text[s]||this._scanCharGroupToken(t,e,n,r,!0)===o.ok?o.nextBranch:(i||e.state.logCapture(1),o.ok)},_scanEscapeToken:function(t,e,n,r){return this._scanWithJsRegex(t,e,n,r)},_scanDotToken:function(t,e,n,r){var i=this._branchResultKind,o=n.state.txtIndex;if(r.settings.singleline){if(o<t)return n.state.logCapture(1),i.ok}else if(o<t&&"\n"!==this._text[o])return n.state.logCapture(1),i.ok;return i.nextBranch},_scanBackrefNumberToken:function(t,e,n,r,i){var o,s=this._branchResultKind,a=n.state.resolveBackref(i.data.slotId);return null==a?s.nextBranch:(o=this._text.slice(a.capIndex,a.capIndex+a.capLength),this._scanLiteral(t,e,n,r,o))},_scanBackrefNameToken:function(t,e,n,r,i){var o,s=this._branchResultKind,a=n.state.resolveBackref(i.data.slotId);return null==a?s.nextBranch:(o=this._text.slice(a.capIndex,a.capIndex+a.capLength),this._scanLiteral(t,e,n,r,o))},_scanAnchorToken:function(t,e,n,r,i){var o=this._branchResultKind,s=n.state.txtIndex;if("\\b"===i.value||"\\B"===i.value){if((s>0&&this._scanWithJsRegex2(s-1,"\\w")===o.ok)==(this._scanWithJsRegex2(s,"\\w")===o.ok)==("\\B"===i.value))return o.ok}else if("^"===i.value){if(0===s||r.settings.multiline&&"\n"===this._text[s-1])return o.ok}else if("$"===i.value){if(s===t||r.settings.multiline&&"\n"===this._text[s])return o.ok}else if("\\A"===i.value){if(0===s)return o.ok}else if("\\z"===i.value){if(s===t)return o.ok}else if("\\Z"===i.value){if(s===t||s===t-1&&"\n"===this._text[s])return o.ok}else if("\\G"===i.value)return o.ok;return o.nextBranch},_cloneSettings:function(t){return{ignoreCase:t.ignoreCase,multiline:t.multiline,singleline:t.singleline,ignoreWhitespace:t.ignoreWhitespace,explicitCapture:t.explicitCapture}},_combineScanResults:function(t,e){if(null!=e){for(var n=t.state.groups,r=e.groups,i=r.length,o=0;o<i;++o)n.push(r[o]);return!0}return!1},_getEmptyMatch:function(){return{capIndex:0,capLength:0,success:!1,value:"",groups:[],captures:[]}},_fillMatch:function(t,e,n,r){null==e&&(e=r),t.capIndex=e,t.capLength=n,t.success=!0,t.value=this._text.slice(e,e+n),t.groups.push({capIndex:e,capLength:n,value:t.value,success:!0,captures:[{capIndex:e,capLength:n,value:t.value}]}),t.captures.push(t.groups[0].captures[0])},_checkTimeout:function(){if(!(this._timeoutTime<0)&&(new Date).getTime()>=this._timeoutTime)throw new System.RegexMatchTimeoutException(this._text,this._pattern,System.TimeSpan.fromMilliseconds(this._timeoutMs))}}),Bridge.define("System.Text.RegularExpressions.RegexEngineBranch",{type:0,value:0,min:0,max:0,isStarted:!1,isNotFailing:!1,state:null,ctor:function(t,e,n,r,i){this.$initialize(),this.type=t,this.value=e,this.min=n,this.max=r,this.state=null!=i?i.clone():new System.Text.RegularExpressions.RegexEngineState},pushPass:function(t,e,n){var r=new System.Text.RegularExpressions.RegexEnginePass(t,e,n);this.state.passes.push(r)},peekPass:function(){return this.state.passes[this.state.passes.length-1]},popPass:function(){return this.state.passes.pop()},hasPass:function(){return this.state.passes.length>0},clone:function(){var t=new System.Text.RegularExpressions.RegexEngineBranch(this.type,this.value,this.min,this.max,this.state);return t.isNotFailing=this.isNotFailing,t}}),Bridge.define("System.Text.RegularExpressions.RegexEngineState",{txtIndex:0,capIndex:null,capLength:0,passes:null,groups:null,ctor:function(){this.$initialize(),this.passes=[],this.groups=[]},logCapture:function(t){null==this.capIndex&&(this.capIndex=this.txtIndex),this.txtIndex+=t,this.capLength+=t},logCaptureGroup:function(t,e,n){this.groups.push({rawIndex:t.rawIndex,slotId:t.packedSlotId,capIndex:e,capLength:n})},logCaptureGroupBalancing:function(t,e){for(var n,r,i,o,s=t.balancingSlotId,a=this.groups,u=a.length-1;u>=0;){if(a[u].slotId===s){n=a[u],r=u;break}--u}return null!=n&&null!=r&&(a.splice(r,1),null!=t.constructs.name1&&(o=e-(i=n.capIndex+n.capLength),this.logCaptureGroup(t,i,o)),!0)},resolveBackref:function(t){for(var e=this.groups,n=e.length-1;n>=0;){if(e[n].slotId===t)return e[n];--n}return null},clone:function(){var t,e,n=new System.Text.RegularExpressions.RegexEngineState;n.txtIndex=this.txtIndex,n.capIndex=this.capIndex,n.capLength=this.capLength;for(var r,i=n.passes,o=this.passes,s=o.length,a=0;a<s;a++)r=o[a].clone(),i.push(r);for(t=n.groups,s=(e=this.groups).length,a=0;a<s;a++)r=e[a],t.push(r);return n}}),Bridge.define("System.Text.RegularExpressions.RegexEnginePass",{index:0,tokens:null,probe:null,onHold:!1,onHoldTextIndex:-1,alternationHandled:!1,settings:null,ctor:function(t,e,n){this.$initialize(),this.index=t,this.tokens=e,this.settings=n},clearState:function(t){this.index=0,this.probe=null,this.onHold=!1,this.onHoldTextIndex=-1,this.alternationHandled=!1,this.settings=t},clone:function(){var t=new System.Text.RegularExpressions.RegexEnginePass(this.index,this.tokens,this.settings);return t.onHold=this.onHold,t.onHoldTextIndex=this.onHoldTextIndex,t.alternationHandled=this.alternationHandled,t.probe=null!=this.probe?this.probe.clone():null,t}}),Bridge.define("System.Text.RegularExpressions.RegexEngineProbe",{min:0,max:0,value:0,isLazy:!1,forced:!1,ctor:function(t,e,n,r){this.$initialize(),this.min=t,this.max=e,this.value=n,this.isLazy=r,this.forced=!1},clone:function(){var t=new System.Text.RegularExpressions.RegexEngineProbe(this.min,this.max,this.value,this.isLazy);return t.forced=this.forced,t}}),Bridge.define("System.Text.RegularExpressions.RegexEngineParser",{statics:{_hexSymbols:"0123456789abcdefABCDEF",_octSymbols:"01234567",_decSymbols:"0123456789",_escapedChars:"abtrvfnexcu",_escapedCharClasses:"pPwWsSdD",_escapedAnchors:"AZzGbB",_escapedSpecialSymbols:" .,$^{}[]()|*+-=?\\|/\"':;~!@#%&",_whiteSpaceChars:" \r\n\t\v\f \ufeff",_unicodeCategories:["Lu","Ll","Lt","Lm","Lo","L","Mn","Mc","Me","M","Nd","Nl","No","N","Pc","Pd","Ps","Pe","Pi","Pf","Po","P","Sm","Sc","Sk","So","S","Zs","Zl","Zp","Z","Cc","Cf","Cs","Co","Cn","C"],_namedCharBlocks:["IsBasicLatin","IsLatin-1Supplement","IsLatinExtended-A","IsLatinExtended-B","IsIPAExtensions","IsSpacingModifierLetters","IsCombiningDiacriticalMarks","IsGreek","IsGreekandCoptic","IsCyrillic","IsCyrillicSupplement","IsArmenian","IsHebrew","IsArabic","IsSyriac","IsThaana","IsDevanagari","IsBengali","IsGurmukhi","IsGujarati","IsOriya","IsTamil","IsTelugu","IsKannada","IsMalayalam","IsSinhala","IsThai","IsLao","IsTibetan","IsMyanmar","IsGeorgian","IsHangulJamo","IsEthiopic","IsCherokee","IsUnifiedCanadianAboriginalSyllabics","IsOgham","IsRunic","IsTagalog","IsHanunoo","IsBuhid","IsTagbanwa","IsKhmer","IsMongolian","IsLimbu","IsTaiLe","IsKhmerSymbols","IsPhoneticExtensions","IsLatinExtendedAdditional","IsGreekExtended","IsGeneralPunctuation","IsSuperscriptsandSubscripts","IsCurrencySymbols","IsCombiningDiacriticalMarksforSymbols","IsCombiningMarksforSymbols","IsLetterlikeSymbols","IsNumberForms","IsArrows","IsMathematicalOperators","IsMiscellaneousTechnical","IsControlPictures","IsOpticalCharacterRecognition","IsEnclosedAlphanumerics","IsBoxDrawing","IsBlockElements","IsGeometricShapes","IsMiscellaneousSymbols","IsDingbats","IsMiscellaneousMathematicalSymbols-A","IsSupplementalArrows-A","IsBraillePatterns","IsSupplementalArrows-B","IsMiscellaneousMathematicalSymbols-B","IsSupplementalMathematicalOperators","IsMiscellaneousSymbolsandArrows","IsCJKRadicalsSupplement","IsKangxiRadicals","IsIdeographicDescriptionCharacters","IsCJKSymbolsandPunctuation","IsHiragana","IsKatakana","IsBopomofo","IsHangulCompatibilityJamo","IsKanbun","IsBopomofoExtended","IsKatakanaPhoneticExtensions","IsEnclosedCJKLettersandMonths","IsCJKCompatibility","IsCJKUnifiedIdeographsExtensionA","IsYijingHexagramSymbols","IsCJKUnifiedIdeographs","IsYiSyllables","IsYiRadicals","IsHangulSyllables","IsHighSurrogates","IsHighPrivateUseSurrogates","IsLowSurrogates","IsPrivateUse or IsPrivateUseArea","IsCJKCompatibilityIdeographs","IsAlphabeticPresentationForms","IsArabicPresentationForms-A","IsVariationSelectors","IsCombiningHalfMarks","IsCJKCompatibilityForms","IsSmallFormVariants","IsArabicPresentationForms-B","IsHalfwidthandFullwidthForms","IsSpecials"],_controlChars:["@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_"],tokenTypes:{literal:0,escChar:110,escCharOctal:111,escCharHex:112,escCharCtrl:113,escCharUnicode:114,escCharOther:115,escCharClass:120,escCharClassCategory:121,escCharClassBlock:122,escCharClassDot:123,escAnchor:130,escBackrefNumber:140,escBackrefName:141,charGroup:200,charNegativeGroup:201,charInterval:202,anchor:300,group:400,groupImnsx:401,groupImnsxMisc:402,groupConstruct:403,groupConstructName:404,groupConstructImnsx:405,groupConstructImnsxMisc:406,quantifier:500,quantifierN:501,quantifierNM:502,alternation:600,alternationGroup:601,alternationGroupCondition:602,alternationGroupRefNumberCondition:603,alternationGroupRefNameCondition:604,commentInline:700,commentXMode:701},parsePattern:function(t,e){var n,r=System.Text.RegularExpressions.RegexEngineParser,i=r._parsePatternImpl(t,e,0,t.length),o=[];return r._fillGroupDescriptors(i,o),n=r._getGroupSparseInfo(o),r._fillBalancingGroupInfo(o,n),r._preTransformBackrefTokens(t,i,n),r._transformRawTokens(e,i,n,[],[],0),r._updateGroupDescriptors(i),{groups:o,sparseSettings:n,isContiguous:e.isContiguous||!1,shouldFail:e.shouldFail||!1,tokens:i}},_transformRawTokens:function(t,e,n,r,i,o){for(var s,a,u,l,c,g,h,m,f=System.Text.RegularExpressions.RegexEngineParser,d=f.tokenTypes,y=0;y<e.length;y++){if(a=e[y],y<e.length-1)switch((m=e[y+1]).type){case d.quantifier:case d.quantifierN:case d.quantifierNM:a.qtoken=m,e.splice(y+1,1),--y}if(a.type===d.escBackrefNumber){if(c=a.data.number,null==(l=n.getPackedSlotIdBySlotNumber(c)))throw new System.ArgumentException("Reference to undefined group number "+c.toString()+".");if(r.indexOf(l)<0){t.shouldFail=!0;continue}a.data.slotId=l}else if(a.type===d.escBackrefName){if(u=a.data.name,null==(l=n.getPackedSlotIdBySlotName(u))){if(f._matchChars(u,0,u.length,f._decSymbols).matchLength===u.length){u="\\"+u,f._updatePatternToken(a,d.escBackrefNumber,a.index,u.length,u),--y;continue}throw new System.ArgumentException("Reference to undefined group name '"+u+"'.")}if(r.indexOf(l)<0){t.shouldFail=!0;continue}a.data.slotId=l}else if(a.type===d.anchor||a.type===d.escAnchor){if("\\G"===a.value){0===o&&0===y?t.isContiguous=!0:t.shouldFail=!0,e.splice(y,1),--y;continue}}else{if(a.type===d.commentInline||a.type===d.commentXMode){e.splice(y,1),--y;continue}if(a.type===d.literal){if(y>0&&!a.qtoken&&(s=e[y-1]).type===d.literal&&!s.qtoken){s.value+=a.value,s.length+=a.length,e.splice(y,1),--y;continue}}else if(a.type===d.alternationGroupCondition&&null!=a.data)if(null!=a.data.number){if(null==(l=n.getPackedSlotIdBySlotNumber(a.data.number)))throw new System.ArgumentException("Reference to undefined group number "+u+".");a.data.packedSlotId=l,f._updatePatternToken(a,d.alternationGroupRefNumberCondition,a.index,a.length,a.value)}else null!=(l=n.getPackedSlotIdBySlotName(a.data.name))?(a.data.packedSlotId=l,f._updatePatternToken(a,d.alternationGroupRefNameCondition,a.index,a.length,a.value)):delete a.data}a.children&&a.children.length&&(g=(g=a.type===d.group?[a.group.rawIndex]:[]).concat(i),h=a.localSettings||t,f._transformRawTokens(h,a.children,n,r,g,o+1),t.shouldFail=t.shouldFail||h.shouldFail,t.isContiguous=t.isContiguous||h.isContiguous),a.type===d.group&&r.push(a.group.packedSlotId)}},_fillGroupDescriptors:function(t,e){var n,r,i;for(System.Text.RegularExpressions.RegexEngineParser._fillGroupStructure(e,t,null),i=1,r=0;r<e.length;r++)null!=(n=e[r]).constructs.name1?(n.name=n.constructs.name1,n.hasName=!0):(n.hasName=!1,n.name=i.toString(),++i)},_fillGroupStructure:function(t,e,n){for(var r,i,o,s,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes,c=0;c<e.length;c++)a=(i=e[c]).children&&i.children.length,(i.type===l.group||i.type===l.groupImnsx||i.type===l.groupImnsxMisc)&&(r={rawIndex:t.length+1,number:-1,parentGroup:null,innerGroups:[],name:null,hasName:!1,constructs:null,quantifier:null,exprIndex:-1,exprLength:0,expr:null,exprFull:null},i.group=r,i.type===l.group&&(t.push(r),null!=n&&(i.group.parentGroup=n,n.innerGroups.push(r))),s=a?i.children[0]:null,r.constructs=u._fillGroupConstructs(s),o=r.constructs,i.isNonCapturingExplicit&&(delete i.isNonCapturingExplicit,o.isNonCapturingExplicit=!0),i.isEmptyCapturing&&(delete i.isEmptyCapturing,o.emptyCapture=!0),o.skipCapture=o.isNonCapturing||o.isNonCapturingExplicit||o.isNonbacktracking||o.isPositiveLookahead||o.isNegativeLookahead||o.isPositiveLookbehind||o.isNegativeLookbehind||null==o.name1&&null!=o.name2),a&&u._fillGroupStructure(t,i.children,i.group)},_getGroupSparseInfo:function(t){var e,n,r,i,o,s,a,u,l,c,g=System.Text.RegularExpressions.RegexEngineParser,h={},m=[],f={},d={0:0,lastSlot:0};for((u={0:0}).keys=["0"],s=0;s<t.length;s++)(o=t[s]).constructs.skipCapture||(o.constructs.isNumberName1?(r=parseInt(o.constructs.name1),m.push(r),h[r]?h[r].push(o):h[r]=[o]):f[i=o.constructs.name1]?f[i].push(o):f[i]=[o]);for(l=function(t,e){return t-e},m.sort(l),c=!1,a=0;a<2;a++){for(s=0;s<t.length;s++)(o=t[s]).constructs.skipCapture||!0===o.constructs.emptyCapture===c&&(r=u.keys.length,o.hasName||(n=[o],null!=(e=h[r])&&(n=n.concat(e),h[r]=null),g._addSparseSlotForSameNamedGroups(n,r,d,u)));c=!0}for(s=0;s<t.length;s++)if(!(o=t[s]).constructs.skipCapture&&o.hasName&&!o.constructs.isNumberName1){for(e=h[r=u.keys.length];null!=e;)g._addSparseSlotForSameNamedGroups(e,r,d,u),h[r]=null,e=h[r=u.keys.length];if(!o.constructs.isNumberName1)for(e=h[r=u.keys.length];null!=e;)g._addSparseSlotForSameNamedGroups(e,r,d,u),h[r]=null,e=h[r=u.keys.length];null!=(e=f[i=o.constructs.name1])&&(g._addSparseSlotForSameNamedGroups(e,r,d,u),f[i]=null)}for(s=0;s<m.length;s++)null!=(e=h[r=m[s]])&&(g._addSparseSlotForSameNamedGroups(e,r,d,u),h[r]=null);return{isSparse:d.isSparse||!1,sparseSlotMap:d,sparseSlotNameMap:u,getPackedSlotIdBySlotNumber:function(t){return this.sparseSlotMap[t]},getPackedSlotIdBySlotName:function(t){return this.sparseSlotNameMap[t]}}},_addSparseSlot:function(t,e,n,r){var i=r.keys.length;t.packedSlotId=i,n[e]=i,r[t.name]=i,r.keys.push(t.name),!n.isSparse&&e-n.lastSlot>1&&(n.isSparse=!0),n.lastSlot=e},_addSparseSlotForSameNamedGroups:function(t,e,n,r){var i,o,s;if(System.Text.RegularExpressions.RegexEngineParser._addSparseSlot(t[0],e,n,r),o=t[0].sparseSlotId,s=t[0].packedSlotId,t.length>1)for(i=1;i<t.length;i++)t[i].sparseSlotId=o,t[i].packedSlotId=s},_fillGroupConstructs:function(t){var e,n,r,i=System.Text.RegularExpressions.RegexEngineParser,o=i.tokenTypes,s={name1:null,name2:null,isNumberName1:!1,isNumberName2:!1,isNonCapturing:!1,isNonCapturingExplicit:!1,isIgnoreCase:null,isMultiline:null,isExplicitCapture:null,isSingleLine:null,isIgnoreWhitespace:null,isPositiveLookahead:!1,isNegativeLookahead:!1,isPositiveLookbehind:!1,isNegativeLookbehind:!1,isNonbacktracking:!1};if(null==t)return s;if(t.type===o.groupConstruct)switch(t.value){case"?:":s.isNonCapturing=!0;break;case"?=":s.isPositiveLookahead=!0;break;case"?!":s.isNegativeLookahead=!0;break;case"?>":s.isNonbacktracking=!0;break;case"?<=":s.isPositiveLookbehind=!0;break;case"?<!":s.isNegativeLookbehind=!0;break;default:throw new System.ArgumentException("Unrecognized grouping construct.")}else if(t.type===o.groupConstructName){if(0===(e=t.value.slice(2,t.length-1).split("-")).length||e.length>2)throw new System.ArgumentException("Invalid group name.");e[0].length&&(s.name1=e[0],n=i._validateGroupName(e[0]),s.isNumberName1=n.isNumberName),2===e.length&&(s.name2=e[1],r=i._validateGroupName(e[1]),s.isNumberName2=r.isNumberName)}else if(t.type===o.groupConstructImnsx||t.type===o.groupConstructImnsxMisc)for(var a,u=t.type===o.groupConstructImnsx?1:0,l=t.length-1-u,c=!0,g=1;g<=l;g++)"-"===(a=t.value[g])?c=!1:"i"===a?s.isIgnoreCase=c:"m"===a?s.isMultiline=c:"n"===a?s.isExplicitCapture=c:"s"===a?s.isSingleLine=c:"x"===a&&(s.isIgnoreWhitespace=c);return s},_validateGroupName:function(t){var e,n;if(!t||!t.length)throw new System.ArgumentException("Invalid group name: Group names must begin with a word character.");if((e=t[0]>="0"&&t[0]<="9")&&(n=System.Text.RegularExpressions.RegexEngineParser)._matchChars(t,0,t.length,n._decSymbols).matchLength!==t.length)throw new System.ArgumentException("Invalid group name: Group names must begin with a word character.");return{isNumberName:e}},_fillBalancingGroupInfo:function(t,e){for(var n,r=0;r<t.length;r++)if(null!=(n=t[r]).constructs.name2&&(n.isBalancing=!0,n.balancingSlotId=e.getPackedSlotIdBySlotName(n.constructs.name2),null==n.balancingSlotId))throw new System.ArgumentException("Reference to undefined group name '"+n.constructs.name2+"'.")},_preTransformBackrefTokens:function(t,e,n){for(var r,i,o,s,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes,c=0;c<e.length;c++){if((a=e[c]).type===l.escBackrefNumber){if((r=a.data.number)>=1&&null!=n.getPackedSlotIdBySlotNumber(r))continue;if(r<=9)throw new System.ArgumentException("Reference to undefined group number "+r.toString()+".");if(null==(i=u._parseOctalCharToken(a.value,0,a.length)))throw new System.ArgumentException("Unrecognized escape sequence "+a.value.slice(0,2)+".");o=a.length-i.length,u._modifyPatternToken(a,t,l.escCharOctal,null,i.length),a.data=i.data,o>0&&(s=u._createPatternToken(t,l.literal,a.index+a.length,o),e.splice(c+1,0,s))}a.children&&a.children.length&&u._preTransformBackrefTokens(t,a.children,n)}},_updateGroupDescriptors:function(t,e){for(var n,r,i,o,s,a=System.Text.RegularExpressions.RegexEngineParser,u=a.tokenTypes,l=e||0,c=0;c<t.length;c++)(r=t[c]).index=l,r.children&&(s=r.childrenPostfix.length,a._updateGroupDescriptors(r.children,l+s),o=a._constructPattern(r.children),r.value=r.childrenPrefix+o+r.childrenPostfix,r.length=r.value.length),r.type===u.group&&r.group&&((n=r.group).exprIndex=r.index,n.exprLength=r.length,c+1<t.length&&((i=t[c+1]).type===u.quantifier||i.type===u.quantifierN||i.type===u.quantifierNM)&&(n.quantifier=i.value),n.expr=r.value,n.exprFull=n.expr+(null!=n.quantifier?n.quantifier:"")),l+=r.length},_constructPattern:function(t){for(var e="",n=0;n<t.length;n++)e+=t[n].value;return e},_parsePatternImpl:function(t,e,n,r){if(null==t)throw new System.ArgumentNullException("pattern");if(n<0||n>t.length)throw new System.ArgumentOutOfRangeException("startIndex");if(r<n||r>t.length)throw new System.ArgumentOutOfRangeException("endIndex");for(var i,o,s=System.Text.RegularExpressions.RegexEngineParser,a=s.tokenTypes,u=[],l=n;l<r;)o=t[l],e.ignoreWhitespace&&s._whiteSpaceChars.indexOf(o)>=0?++l:(null==(i="."===o?s._parseDotToken(t,l,r):"\\"===o?s._parseEscapeToken(t,l,r):"["===o?s._parseCharRangeToken(t,l,r):"^"===o||"$"===o?s._parseAnchorToken(t,l):"("===o?s._parseGroupToken(t,e,l,r):"|"===o?s._parseAlternationToken(t,l):"#"===o&&e.ignoreWhitespace?s._parseXModeCommentToken(t,l,r):s._parseQuantifierToken(t,l,r))&&(i=s._createPatternToken(t,a.literal,l,1)),null!=i&&(u.push(i),l+=i.length));return u},_parseEscapeToken:function(t,e,n){var r,i,o,s,a,u,l,c,g,h=System.Text.RegularExpressions.RegexEngineParser,m=h.tokenTypes,f=t[e];if("\\"!==f)return null;if(e+1>=n)throw new System.ArgumentException("Illegal \\ at end of pattern.");if((f=t[e+1])>="1"&&f<="9")return r=h._matchChars(t,e+1,n,h._decSymbols,3),(i=h._createPatternToken(t,m.escBackrefNumber,e,1+r.matchLength)).data={number:parseInt(r.match,10)},i;if(h._escapedAnchors.indexOf(f)>=0)return h._createPatternToken(t,m.escAnchor,e,2);if(null!=(o=h._parseEscapedChar(t,e,n)))return o;if("k"===f){if(e+2<n&&("'"===(s=t[e+2])||"<"===s)&&(a="<"===s?">":"'",1===(u=h._matchUntil(t,e+3,n,a)).unmatchLength&&u.matchLength>0))return(l=h._createPatternToken(t,m.escBackrefName,e,3+u.matchLength+1)).data={name:u.match},l;throw new System.ArgumentException("Malformed \\k<...> named back reference.")}if((c=f.charCodeAt(0))>=0&&c<48||c>57&&c<65||c>90&&c<95||96===c||c>122&&c<128)return(g=h._createPatternToken(t,m.escChar,e,2)).data={n:c,ch:f},g;throw new System.ArgumentException("Unrecognized escape sequence \\"+f+".")},_parseOctalCharToken:function(t,e,n){var r=System.Text.RegularExpressions.RegexEngineParser,i=r.tokenTypes,o=t[e];if("\\"===o&&e+1<n&&(o=t[e+1])>="0"&&o<="7"){var s=r._matchChars(t,e+1,n,r._octSymbols,3),a=parseInt(s.match,8),u=r._createPatternToken(t,i.escCharOctal,e,1+s.matchLength);return u.data={n:a,ch:String.fromCharCode(a)},u}return null},_parseEscapedChar:function(t,e,n){var r,i,o,s,a,u,l,c,g,h,m=System.Text.RegularExpressions.RegexEngineParser,f=m.tokenTypes,d=t[e];if("\\"!==d||e+1>=n)return null;if(d=t[e+1],m._escapedChars.indexOf(d)>=0){if("x"===d){if(2!==(i=m._matchChars(t,e+2,n,m._hexSymbols,2)).matchLength)throw new System.ArgumentException("Insufficient hexadecimal digits.");return o=parseInt(i.match,16),(r=m._createPatternToken(t,f.escCharHex,e,4)).data={n:o,ch:String.fromCharCode(o)},r}if("c"===d){if(e+2>=n)throw new System.ArgumentException("Missing control character.");if(s=(s=t[e+2]).toUpperCase(),(a=this._controlChars.indexOf(s))>=0)return(r=m._createPatternToken(t,f.escCharCtrl,e,3)).data={n:a,ch:String.fromCharCode(a)},r;throw new System.ArgumentException("Unrecognized control character.")}if("u"===d){if(4!==(u=m._matchChars(t,e+2,n,m._hexSymbols,4)).matchLength)throw new System.ArgumentException("Insufficient hexadecimal digits.");return l=parseInt(u.match,16),(r=m._createPatternToken(t,f.escCharUnicode,e,6)).data={n:l,ch:String.fromCharCode(l)},r}switch(r=m._createPatternToken(t,f.escChar,e,2),d){case"a":c=7;break;case"b":c=8;break;case"t":c=9;break;case"r":c=13;break;case"v":c=11;break;case"f":c=12;break;case"n":c=10;break;case"e":c=27;break;default:throw new System.ArgumentException("Unexpected escaped char: '"+d+"'.")}return r.data={n:c,ch:String.fromCharCode(c)},r}if(d>="0"&&d<="7")return m._parseOctalCharToken(t,e,n);if(m._escapedCharClasses.indexOf(d)>=0){if("p"===d||"P"===d){if((g=m._matchUntil(t,e+2,n,"}")).matchLength<2||"{"!==g.match[0]||1!==g.unmatchLength)throw new System.ArgumentException("Incomplete p{X} character escape.");if(h=g.match.slice(1),m._unicodeCategories.indexOf(h)>=0)return m._createPatternToken(t,f.escCharClassCategory,e,2+g.matchLength+1);if(m._namedCharBlocks.indexOf(h)>=0)return m._createPatternToken(t,f.escCharClassBlock,e,2+g.matchLength+1);throw new System.ArgumentException("Unknown property '"+h+"'.")}return m._createPatternToken(t,f.escCharClass,e,2)}return m._escapedSpecialSymbols.indexOf(d)>=0?((r=m._createPatternToken(t,f.escCharOther,e,2)).data={n:d.charCodeAt(0),ch:d},r):null},_parseCharRangeToken:function(t,e,n){var r,i,o,s,a,u,l,c,g,h=System.Text.RegularExpressions.RegexEngineParser,m=h.tokenTypes,f=[],d=!1,y=!1,p=!1,S=t[e];if("["!==S)return null;for(a=-1,(s=e+1)<n&&"^"===t[s]&&(d=!0,s++),l=s;s<n;){if(y=p,"-"===(S=t[s])&&s+1<n&&"["===t[s+1])(i=h._parseCharRangeToken(t,s+1,n)).childrenPrefix="-"+i.childrenPrefix,i.length++,o=i,u=i.length,p=!0;else if("\\"===S){if(null==(o=h._parseEscapedChar(t,s,n)))throw new System.ArgumentException("Unrecognized escape sequence \\"+S+".");u=o.length}else{if("]"===S&&s>l){a=s;break}o=h._createPatternToken(t,m.literal,s,1),u=1}if(y)throw new System.ArgumentException("A subtraction must be the last element in a character class.");f.length>1&&null!=(r=h._parseCharIntervalToken(t,f[f.length-2],f[f.length-1],o))&&(f.pop(),f.pop(),o=r),null!=o&&(f.push(o),s+=u)}if(a<0||f.length<1)throw new System.ArgumentException("Unterminated [] set.");return c=d?h._createPatternToken(t,m.charNegativeGroup,e,1+a-e,f,"[^","]"):h._createPatternToken(t,m.charGroup,e,1+a-e,f,"[","]"),g=h._tidyCharRange(f),c.data={ranges:g},null!=i&&(c.data.substractToken=i),c},_parseCharIntervalToken:function(t,e,n,r){var i,o,s,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes;if(n.type!==l.literal||"-"!==n.value||e.type!==l.literal&&e.type!==l.escChar&&e.type!==l.escCharOctal&&e.type!==l.escCharHex&&e.type!==l.escCharCtrl&&e.type!==l.escCharUnicode&&e.type!==l.escCharOther||r.type!==l.literal&&r.type!==l.escChar&&r.type!==l.escCharOctal&&r.type!==l.escCharHex&&r.type!==l.escCharCtrl&&r.type!==l.escCharUnicode&&r.type!==l.escCharOther)return null;if(e.type===l.literal?(i=e.value.charCodeAt(0),o=e.value):(i=e.data.n,o=e.data.ch),r.type===l.literal?(s=r.value.charCodeAt(0),a=r.value):(s=r.data.n,a=r.data.ch),i>s)throw new System.NotSupportedException("[x-y] range in reverse order.");var c=e.index,g=e.length+n.length+r.length,h=u._createPatternToken(t,l.charInterval,c,g,[e,n,r],"","");return h.data={startN:i,startCh:o,endN:s,endCh:a},h},_tidyCharRange:function(t){for(var e,n,r,i,o,s,a,u,l=System.Text.RegularExpressions.RegexEngineParser,c=l.tokenTypes,g=[],h=[],m=0;m<t.length;m++){if((i=t[m]).type===c.literal)r=n=i.value.charCodeAt(0);else if(i.type===c.charInterval)n=i.data.startN,r=i.data.endN;else{if(i.type!==c.literal&&i.type!==c.escChar&&i.type!==c.escCharOctal&&i.type!==c.escCharHex&&i.type!==c.escCharCtrl&&i.type!==c.escCharUnicode&&i.type!==c.escCharOther){if(i.type===c.charGroup||i.type===c.charNegativeGroup)continue;h.push(i);continue}r=n=i.data.n}if(0!==g.length){for(e=0;e<g.length&&!(g[e].n>n);e++);g.splice(e,0,{n,m:r})}else g.push({n,m:r})}for(m=0;m<g.length;m++){for(o=g[m],a=0,e=m+1;e<g.length&&!((s=g[e]).n>1+o.m);e++)a++,s.m>o.m&&(o.m=s.m);a>0&&g.splice(m+1,a)}return h.length>0&&(u="["+l._constructPattern(h)+"]",g.charClassToken=l._createPatternToken(u,c.charGroup,0,u.length,t,"[","]")),g},_parseDotToken:function(t,e){var n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes;return"."!==t[e]?null:n._createPatternToken(t,r.escCharClassDot,e,1)},_parseAnchorToken:function(t,e){var n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes,i=t[e];return"^"!==i&&"$"!==i?null:n._createPatternToken(t,r.anchor,e,1)},_updateSettingsFromConstructs:function(t,e){null!=e.isIgnoreWhitespace&&(t.ignoreWhitespace=e.isIgnoreWhitespace),null!=e.isExplicitCapture&&(t.explicitCapture=e.isExplicitCapture)},_parseGroupToken:function(t,e,n,r){var i,o,s,a,u,l,c,g,h=System.Text.RegularExpressions.RegexEngineParser,m=h.tokenTypes,f={ignoreWhitespace:e.ignoreWhitespace,explicitCapture:e.explicitCapture},d=t[n];if("("!==d)return null;var y=1,p=!1,S=n+1,C=-1,x=!1,v=!1,w=!1,b=!1,B=!1,I=null,$=h._parseGroupConstructToken(t,f,n+1,r);for(null!=$&&(I=this._fillGroupConstructs($),S+=$.length,$.type===m.commentInline?x=!0:$.type===m.alternationGroupCondition?v=!0:$.type===m.groupConstructImnsx?(this._updateSettingsFromConstructs(f,I),b=!0):$.type===m.groupConstructImnsxMisc&&(this._updateSettingsFromConstructs(e,I),w=!0)),f.explicitCapture&&(null==I||null==I.name1)&&(B=!0),i=S;i<r;){if("\\"===(d=t[i]))i++;else if("["===d)p=!0;else if("]"===d&&p)p=!1;else if(!p)if("("!==d||x){if(")"===d&&0==--y){C=i;break}}else++y;++i}if(o=null,x){if(C<0)throw new System.ArgumentException("Unterminated (?#...) comment.");o=h._createPatternToken(t,m.commentInline,n,1+C-n)}else{if(C<0)throw new System.ArgumentException("Not enough )'s.");if(s=h._parsePatternImpl(t,f,S,C),null!=$&&s.splice(0,0,$),v){for(a=s.length,l=0,u=0;u<a;u++)if(s[u].type===m.alternation&&++l>1)throw new System.ArgumentException("Too many | in (?()|).");if(0===l)throw new System.NotSupportedException("Alternation group without | is not supported.");o=h._createPatternToken(t,m.alternationGroup,n,1+C-n,s,"(",")")}else c=m.group,w?c=m.groupImnsxMisc:b&&(c=m.groupImnsx),(g=h._createPatternToken(t,c,n,1+C-n,s,"(",")")).localSettings=f,o=g}return B&&(o.isNonCapturingExplicit=!0),o},_parseGroupConstructToken:function(t,e,n,r){var i,o,s,a,u,l,c,g=System.Text.RegularExpressions.RegexEngineParser,h=g.tokenTypes,m=t[n];if("?"!==m||n+1>=r)return null;if(":"===(m=t[n+1])||"="===m||"!"===m||">"===m)return g._createPatternToken(t,h.groupConstruct,n,2);if("#"===m)return g._createPatternToken(t,h.commentInline,n,2);if("("===m)return g._parseAlternationGroupConditionToken(t,e,n,r);if("<"===m&&n+2<r&&("="===(i=t[n+2])||"!"===i))return g._createPatternToken(t,h.groupConstruct,n,3);if("<"===m||"'"===m){if(o="<"===m?">":m,1!==(s=g._matchUntil(t,n+2,r,o)).unmatchLength||0===s.matchLength)throw new System.ArgumentException("Unrecognized grouping construct.");if(a=s.match.slice(0,1),"`~@#$%^&*()+{}[]|\\/|'\";:,.?".indexOf(a)>=0)throw new System.ArgumentException("Invalid group name: Group names must begin with a word character.");return g._createPatternToken(t,h.groupConstructName,n,2+s.matchLength+1)}if((u=g._matchChars(t,n+1,r,"imnsx-")).matchLength>0&&(":"===u.unmatchCh||")"===u.unmatchCh))return l=":"===u.unmatchCh?h.groupConstructImnsx:h.groupConstructImnsxMisc,c=":"===u.unmatchCh?1:0,g._createPatternToken(t,l,n,1+u.matchLength+c);throw new System.ArgumentException("Unrecognized grouping construct.")},_parseQuantifierToken:function(t,e,n){var r,i,o,s=System.Text.RegularExpressions.RegexEngineParser,a=s.tokenTypes,u=null,l=t[e];if("*"===l||"+"===l||"?"===l)(u=s._createPatternToken(t,a.quantifier,e,1)).data={val:l};else if("{"===l&&0!==(r=s._matchChars(t,e+1,n,s._decSymbols)).matchLength)if("}"===r.unmatchCh)(u=s._createPatternToken(t,a.quantifierN,e,1+r.matchLength+1)).data={n:parseInt(r.match,10)};else if(","===r.unmatchCh&&"}"===(i=s._matchChars(t,r.unmatchIndex+1,n,s._decSymbols)).unmatchCh&&((u=s._createPatternToken(t,a.quantifierNM,e,1+r.matchLength+1+i.matchLength+1)).data={n:parseInt(r.match,10),m:null},0!==i.matchLength&&(u.data.m=parseInt(i.match,10),u.data.n>u.data.m)))throw new System.ArgumentException("Illegal {x,y} with x > y.");return null!=u&&(o=e+u.length)<n&&"?"===t[o]&&(this._modifyPatternToken(u,t,u.type,u.index,u.length+1),u.data.isLazy=!0),u},_parseAlternationToken:function(t,e){var n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes;return"|"!==t[e]?null:n._createPatternToken(t,r.alternation,e,1)},_parseAlternationGroupConditionToken:function(t,e,n,r){var i,o,s,a,u,l,c=System.Text.RegularExpressions.RegexEngineParser,g=c.tokenTypes,h=null;if("?"!==t[n]||n+1>=r||"("!==t[n+1]||null==(s=c._parseGroupToken(t,e,n+1,r)))return null;if(s.type===g.commentInline)throw new System.ArgumentException("Alternation conditions cannot be comments.");if((a=s.children)&&a.length){if((i=a[0]).type===g.groupConstructName)throw new System.ArgumentException("Alternation conditions do not capture and cannot be named.");if((i.type===g.groupConstruct||i.type===g.groupConstructImnsx)&&null!=(o=c._findFirstGroupWithoutConstructs(a))&&(o.isEmptyCapturing=!0),i.type===g.literal)if((u=s.value.slice(1,s.value.length-1))[0]>="0"&&u[0]<="9"){if(c._matchChars(u,0,u.length,c._decSymbols).matchLength!==u.length)throw new System.ArgumentException("Malformed Alternation group number: "+u+".");h={number:parseInt(u,10)}}else h={name:u}}return a.length&&(a[0].type===g.groupConstruct||a[0].type===g.groupConstructImnsx)||(i=c._createPatternToken("?:",g.groupConstruct,0,2),a.splice(0,0,i)),l=c._createPatternToken(t,g.alternationGroupCondition,s.index-1,1+s.length,[s],"?",""),null!=h&&(l.data=h),l},_findFirstGroupWithoutConstructs:function(t){for(var e,n=System.Text.RegularExpressions.RegexEngineParser,r=n.tokenTypes,i=null,o=0;o<t.length;++o)if((e=t[o]).type===r.group&&e.children&&e.children.length){if(e.children[0].type!==r.groupConstruct&&e.children[0].type!==r.groupConstructImnsx){i=e;break}if(e.children&&e.children.length&&null!=(i=n._findFirstGroupWithoutConstructs(e.children)))break}return i},_parseXModeCommentToken:function(t,e,n){var r,i=System.Text.RegularExpressions.RegexEngineParser,o=i.tokenTypes,s=t[e];if("#"!==s)return null;for(r=e+1;r<n&&(s=t[r],++r,"\n"!==s););return i._createPatternToken(t,o.commentXMode,e,r-e)},_createLiteralToken:function(t){var e=System.Text.RegularExpressions.RegexEngineParser;return e._createPatternToken(t,e.tokenTypes.literal,0,t.length)},_createPositiveLookaheadToken:function(t,e){var n="(?="+t+")";return System.Text.RegularExpressions.RegexEngineParser._parseGroupToken(n,e,0,n.length)},_createPatternToken:function(t,e,n,r,i,o,s){var a={type:e,index:n,length:r,value:t.slice(n,n+r)};return null!=i&&i.length>0&&(a.children=i,a.childrenPrefix=o,a.childrenPostfix=s),a},_modifyPatternToken:function(t,e,n,r,i){null!=n&&(t.type=n),(null!=r||null!=i)&&(null!=r&&(t.index=r),null!=i&&(t.length=i),t.value=e.slice(t.index,t.index+t.length))},_updatePatternToken:function(t,e,n,r,i){t.type=e,t.index=n,t.length=r,t.value=i},_matchChars:function(t,e,n,r,i){var o,s={match:"",matchIndex:-1,matchLength:0,unmatchCh:"",unmatchIndex:-1,unmatchLength:0},a=e;for(null!=i&&i>=0&&(n=e+i);a<n;){if(o=t[a],r.indexOf(o)<0){s.unmatchCh=o,s.unmatchIndex=a,s.unmatchLength=1;break}a++}return a>e&&(s.match=t.slice(e,a),s.matchIndex=e,s.matchLength=a-e),s},_matchUntil:function(t,e,n,r,i){var o,s={match:"",matchIndex:-1,matchLength:0,unmatchCh:"",unmatchIndex:-1,unmatchLength:0},a=e;for(null!=i&&i>=0&&(n=e+i);a<n;){if(o=t[a],r.indexOf(o)>=0){s.unmatchCh=o,s.unmatchIndex=a,s.unmatchLength=1;break}a++}return a>e&&(s.match=t.slice(e,a),s.matchIndex=e,s.matchLength=a-e),s}}}),Bridge.define("System.Random",{statics:{MBIG:2147483647,MSEED:161803398,MZ:0},inext:0,inextp:0,seedArray:null,config:{init:function(){this.seedArray=System.Array.init(56,0)}},ctor:function(){System.Random.$ctor1.call(this,System.Int64.clip32(System.Int64((new Date).getTime()).mul(1e4)))},$ctor1:function(t){var e,n,r,i,o,s,a;for(this.$initialize(),i=-2147483648===t?2147483647:Math.abs(t),n=System.Random.MSEED-i|0,this.seedArray[55]=n,r=1,o=1;o<55;o=o+1|0)e=(21*o|0)%55,this.seedArray[e]=r,(r=n-r|0)<0&&(r=r+System.Random.MBIG|0),n=this.seedArray[e];for(s=1;s<5;s=s+1|0)for(a=1;a<56;a=a+1|0)this.seedArray[a]=this.seedArray[a]-this.seedArray[1+(a+30|0)%55|0]|0,this.seedArray[a]<0&&(this.seedArray[a]=this.seedArray[a]+System.Random.MBIG|0);this.inext=0,this.inextp=21,t=1},sample:function(){return 4.656612875245797e-10*this.internalSample()},internalSample:function(){var t,e=this.inext,n=this.inextp;return(e=e+1|0)>=56&&(e=1),(n=n+1|0)>=56&&(n=1),(t=this.seedArray[e]-this.seedArray[n]|0)===System.Random.MBIG&&(t=t-1|0),t<0&&(t=t+System.Random.MBIG|0),this.seedArray[e]=t,this.inext=e,this.inextp=n,t},next:function(){return this.internalSample()},next$2:function(t,e){if(t>e)throw new System.ArgumentOutOfRangeException("minValue","'minValue' cannot be greater than maxValue.");var n=System.Int64(e).sub(System.Int64(t));return n.lte(System.Int64(2147483647))?Bridge.Int.clip32(this.sample()*System.Int64.toNumber(n))+t|0:System.Int64.clip32(Bridge.Int.clip64(this.getSampleForLargeRange()*System.Int64.toNumber(n)).add(System.Int64(t)))},next$1:function(t){if(t<0)throw new System.ArgumentOutOfRangeException("maxValue","'maxValue' must be greater than zero.");return Bridge.Int.clip32(this.sample()*t)},getSampleForLargeRange:function(){var t,e=this.internalSample();return this.internalSample()%2==0&&(e=0|-e),t=e,(t+=2147483646)/4294967293},nextDouble:function(){return this.sample()},nextBytes:function(t){if(null==t)throw new System.ArgumentNullException("buffer");for(var e=0;e<t.length;e=e+1|0)t[e]=this.internalSample()%256&255}}),Bridge.define("System.Threading.Timer",{inherits:[System.IDisposable],statics:{MAX_SUPPORTED_TIMEOUT:4294967294,EXC_LESS:"Number must be either non-negative and less than or equal to Int32.MaxValue or -1.",EXC_MORE:"Time-out interval must be less than 2^32-2.",EXC_DISPOSED:"The timer has been already disposed."},dueTime:System.Int64(0),period:System.Int64(0),timerCallback:null,state:null,id:null,disposed:!1,config:{alias:["dispose","System$IDisposable$dispose"]},$ctor1:function(t,e,n,r){this.$initialize(),this.timerSetup(t,e,System.Int64(n),System.Int64(r))},$ctor3:function(t,e,n,r){this.$initialize();var i=Bridge.Int.clip64(n.getTotalMilliseconds()),o=Bridge.Int.clip64(r.getTotalMilliseconds());this.timerSetup(t,e,i,o)},$ctor4:function(t,e,n,r){this.$initialize(),this.timerSetup(t,e,System.Int64(n),System.Int64(r))},$ctor2:function(t,e,n,r){this.$initialize(),this.timerSetup(t,e,n,r)},ctor:function(t){this.$initialize(),this.timerSetup(t,this,System.Int64(-1),System.Int64(-1))},timerSetup:function(t,e,n,r){if(this.disposed)throw new System.InvalidOperationException(System.Threading.Timer.EXC_DISPOSED);if(Bridge.staticEquals(t,null))throw new System.ArgumentNullException("TimerCallback");if(n.lt(System.Int64(-1)))throw new System.ArgumentOutOfRangeException("dueTime",System.Threading.Timer.EXC_LESS);if(r.lt(System.Int64(-1)))throw new System.ArgumentOutOfRangeException("period",System.Threading.Timer.EXC_LESS);if(n.gt(System.Int64(System.Threading.Timer.MAX_SUPPORTED_TIMEOUT)))throw new System.ArgumentOutOfRangeException("dueTime",System.Threading.Timer.EXC_MORE);if(r.gt(System.Int64(System.Threading.Timer.MAX_SUPPORTED_TIMEOUT)))throw new System.ArgumentOutOfRangeException("period",System.Threading.Timer.EXC_MORE);return this.dueTime=n,this.period=r,this.state=e,this.timerCallback=t,this.runTimer(this.dueTime)},handleCallback:function(){if(!this.disposed&&!Bridge.staticEquals(this.timerCallback,null)){var t=this.id;this.timerCallback(this.state),System.Nullable.eq(this.id,t)&&this.runTimer(this.period,!1)}},runTimer:function(t,e){if(void 0===e&&(e=!0),e&&this.disposed)throw new System.InvalidOperationException(System.Threading.Timer.EXC_DISPOSED);if(t.ne(System.Int64(-1))&&!this.disposed){var n=t.toNumber();return this.id=Bridge.global.setTimeout(Bridge.fn.bind(this,this.handleCallback),n),!0}return!1},change:function(t,e){return this.changeTimer(System.Int64(t),System.Int64(e))},change$2:function(t,e){return this.changeTimer(Bridge.Int.clip64(t.getTotalMilliseconds()),Bridge.Int.clip64(e.getTotalMilliseconds()))},change$3:function(t,e){return this.changeTimer(System.Int64(t),System.Int64(e))},change$1:function(t,e){return this.changeTimer(t,e)},changeTimer:function(t,e){return this.clearTimeout(),this.timerSetup(this.timerCallback,this.state,t,e)},clearTimeout:function(){System.Nullable.hasValue(this.id)&&(Bridge.global.clearTimeout(System.Nullable.getValue(this.id)),this.id=null)},dispose:function(){this.clearTimeout(),this.disposed=!0}}),Bridge.define("Bridge.Console",{statics:{BODY_WRAPPER_ID:"bridge-body-wrapper",CONSOLE_MESSAGES_ID:"bridge-console-messages",position:"horizontal",instance:null,getInstance:function(){return null==Bridge.Console.instance&&(Bridge.Console.instance=new Bridge.Console),Bridge.Console.instance},logBase:function(t,e){var n,r,i;void 0===e&&(e=0),n=Bridge.Console.getInstance(),r=null!=t?t.toString():"null",null==n.bufferedOutput?(Bridge.Console.show(),i=n.buildConsoleMessage(r,e),n.consoleMessages.appendChild(i),n.currentMessageElement=i,n.consoleDefined?1===e&&n.consoleDebugDefined?Bridge.global.console.debug(r):Bridge.global.console.log(r):n.operaPostErrorDefined&&Bridge.global.opera.postError(r)):n.bufferedOutput=System.String.concat(n.bufferedOutput,r)},error:function(t){Bridge.Console.logBase(t,2)},debug:function(t){Bridge.Console.logBase(t,1)},log:function(t){Bridge.Console.logBase(t)},hide:function(){if(null!=Bridge.Console.instance){var t=Bridge.Console.getInstance();t.hidden||t.close()}},show:function(){var t=Bridge.Console.getInstance();t.hidden&&t.init(!0)},toggle:function(){Bridge.Console.getInstance().hidden?Bridge.Console.show():Bridge.Console.hide()}},svgNS:"http://www.w3.org/2000/svg",consoleHeight:"300px",consoleHeaderHeight:"35px",tooltip:null,consoleWrapper:null,consoleMessages:null,bridgeIcon:null,bridgeIconPath:null,bridgeConsoleLabel:null,closeBtn:null,closeIcon:null,closeIconPath:null,consoleHeader:null,consoleBody:null,hidden:!0,consoleDefined:!1,consoleDebugDefined:!1,operaPostErrorDefined:!1,currentMessageElement:null,bufferedOutput:null,ctor:function(){this.$initialize(),this.init()},init:function(t){var e,n,r,o,s,a;void 0===t&&(t=!1),this.hidden=!1;var u=Bridge.fn.bind(this,i.$.Bridge.Console.f1)(new(System.Collections.Generic.Dictionary$2(String,String))),l=i.$.Bridge.Console.f2(new(System.Collections.Generic.Dictionary$2(String,String))),c=i.$.Bridge.Console.f3(new(System.Collections.Generic.Dictionary$2(String,String)));this.bridgeIcon=this.bridgeIcon||document.createElementNS(this.svgNS,"svg"),e=Bridge.fn.bind(this,i.$.Bridge.Console.f4)(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(this.bridgeIcon,e),this.bridgeIconPath=this.bridgeIconPath||document.createElementNS(this.svgNS,"path"),(n=new(System.Collections.Generic.Dictionary$2(String,String))).set("d","M19 14.4h2.2V9.6L19 7.1v7.3zm4.3-2.5v2.5h2.2l-2.2-2.5zm-8.5 2.5H17V4.8l-2.2-2.5v12.1zM0 14.4h3l7.5-8.5v8.5h2.2V0L0 14.4z"),n.set("fill","#555"),this.setAttributes(this.bridgeIconPath,n),this.bridgeConsoleLabel=this.bridgeConsoleLabel||document.createElement("span"),this.bridgeConsoleLabel.innerHTML="Bridge Console",this.closeBtn=this.closeBtn||document.createElement("span"),this.closeBtn.setAttribute("style","position: relative;display: inline-block;float: right;cursor: pointer"),this.closeIcon=this.closeIcon||document.createElementNS(this.svgNS,"svg"),r=Bridge.fn.bind(this,i.$.Bridge.Console.f5)(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(this.closeIcon,r),this.closeIconPath=this.closeIconPath||document.createElementNS(this.svgNS,"path"),o=i.$.Bridge.Console.f6(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(this.closeIconPath,o),this.tooltip=this.tooltip||document.createElement("div"),this.tooltip.innerHTML="Refresh page to open Bridge Console",this.tooltip.setAttribute("style","position: absolute;right: 30px;top: -6px;white-space: nowrap;padding: 7px;border-radius: 3px;background-color: rgba(0, 0, 0, 0.75);color: #eee;text-align: center;visibility: hidden;opacity: 0;-webkit-transition: all 0.25s ease-in-out;transition: all 0.25s ease-in-out;z-index: 1;"),Bridge.Console.position="horizontal",Bridge.referenceEquals(Bridge.Console.position,"horizontal")?(this.wrapBodyContent(),u.set("right","0"),l.set("border-top","1px solid #a3a3a3"),c.set("height",this.consoleHeight)):Bridge.referenceEquals(Bridge.Console.position,"vertical")&&(s="400px",document.body.style.marginLeft=s,u.set("top","0"),u.set("width",s),u.set("border-right","1px solid #a3a3a3"),c.set("height","100%")),this.consoleWrapper=this.consoleWrapper||document.createElement("div"),this.consoleWrapper.setAttribute("style",this.obj2Css(u)),this.consoleHeader=this.consoleHeader||document.createElement("div"),this.consoleHeader.setAttribute("style",this.obj2Css(l)),this.consoleBody=this.consoleBody||document.createElement("div"),this.consoleBody.setAttribute("style",this.obj2Css(c)),this.consoleMessages=this.consoleMessages||document.createElement("ul"),(a=this.consoleMessages).id=Bridge.Console.CONSOLE_MESSAGES_ID,a.setAttribute("style","margin: 0;padding: 0;list-style: none;"),t||(this.bridgeIcon.appendChild(this.bridgeIconPath),this.closeIcon.appendChild(this.closeIconPath),this.closeBtn.appendChild(this.closeIcon),this.closeBtn.appendChild(this.tooltip),this.consoleHeader.appendChild(this.bridgeIcon),this.consoleHeader.appendChild(this.bridgeConsoleLabel),this.consoleHeader.appendChild(this.closeBtn),this.consoleBody.appendChild(a),this.consoleWrapper.appendChild(this.consoleHeader),this.consoleWrapper.appendChild(this.consoleBody),document.body.appendChild(this.consoleWrapper),this.closeBtn.addEventListener("click",Bridge.fn.bind(this,this.close)),this.closeBtn.addEventListener("mouseover",Bridge.fn.bind(this,this.showTooltip)),this.closeBtn.addEventListener("mouseout",Bridge.fn.bind(this,this.hideTooltip)),this.consoleDefined=Bridge.isDefined(Bridge.global)&&Bridge.isDefined(Bridge.global.console),this.consoleDebugDefined=this.consoleDefined&&Bridge.isDefined(Bridge.global.console.debug),this.operaPostErrorDefined=Bridge.isDefined(Bridge.global.opera)&&Bridge.isDefined(Bridge.global.opera.postError))},showTooltip:function(){var t=Bridge.Console.getInstance();t.tooltip.style.right="20px",t.tooltip.style.visibility="visible",t.tooltip.style.opacity="1"},hideTooltip:function(){var t=Bridge.Console.getInstance();t.tooltip.style.right="30px",t.tooltip.style.opacity="0"},close:function(){this.hidden=!0,this.consoleWrapper.style.display="none",Bridge.referenceEquals(Bridge.Console.position,"horizontal")?this.unwrapBodyContent():Bridge.referenceEquals(Bridge.Console.position,"vertical")&&document.body.removeAttribute("style")},wrapBodyContent:function(){if(null!=document.body){var t=document.defaultView.getComputedStyle(document.body,null),e=t.paddingTop,n=t.paddingRight,r=t.paddingBottom,i=t.paddingLeft,o=t.marginTop,s=t.marginRight,a=t.marginBottom,u=t.marginLeft,l=document.createElement("div");for(l.id=Bridge.Console.BODY_WRAPPER_ID,l.setAttribute("style",System.String.concat("height: calc(100vh - ",this.consoleHeight," - ",this.consoleHeaderHeight,");","margin-top: calc(-1 * ","(",System.String.concat(o," + ",e),"));","margin-right: calc(-1 * ","(",System.String.concat(s," + ",n),"));","margin-left: calc(-1 * ","(",System.String.concat(u," + ",i),"));","padding-top: calc(",System.String.concat(o," + ",e),");","padding-right: calc(",System.String.concat(s," + ",n),");","padding-bottom: calc(",System.String.concat(a," + ",r),");","padding-left: calc(",System.String.concat(u," + ",i),");","overflow-x: auto;","box-sizing: border-box !important;"));null!=document.body.firstChild;)l.appendChild(document.body.firstChild);document.body.appendChild(l)}},unwrapBodyContent:function(){var t=document.getElementById(Bridge.Console.BODY_WRAPPER_ID);if(null!=t){for(;null!=t.firstChild;)document.body.insertBefore(t.firstChild,t);document.body.removeChild(t)}},buildConsoleMessage:function(t,e){var n,r,o,s,a,u,l=document.createElement("li");return l.setAttribute("style","padding: 5px 10px;border-bottom: 1px solid #f0f0f0;"),n=document.createElementNS(this.svgNS,"svg"),r=Bridge.fn.bind(this,i.$.Bridge.Console.f7)(new(System.Collections.Generic.Dictionary$2(String,String))),this.setAttributes(n,r),o="#555",2===e?o="#d65050":1===e&&(o="#1800FF"),s=document.createElementNS(this.svgNS,"path"),(a=new(System.Collections.Generic.Dictionary$2(String,String))).set("d","M3.8 3.5L.7 6.6s-.1.1-.2.1-.1 0-.2-.1l-.2-.3C0 6.2 0 6.2 0 6.1c0 0 0-.1.1-.1l2.6-2.6L.1.7C0 .7 0 .6 0 .6 0 .5 0 .5.1.4L.4.1c0-.1.1-.1.2-.1s.1 0 .2.1l3.1 3.1s.1.1.1.2-.1.1-.2.1z"),a.set("fill",o),this.setAttributes(s,a),n.appendChild(s),(u=document.createElement("span")).innerHTML=t,u.setAttribute("style",System.String.concat("color: ",o,"; white-space: pre;")),l.appendChild(n),l.appendChild(u),l},setAttributes:function(t,e){for(var n,r=Bridge.getEnumerator(e);r.moveNext();)n=r.getCurrent(),t.setAttribute(n.key,n.value)},obj2Css:function(t){for(var e,n="",r=Bridge.getEnumerator(t);r.moveNext();)e=r.getCurrent(),n=System.String.concat(n,System.String.concat(e.key.toLowerCase(),":",e.value,";"));return n}}),Bridge.ns("Bridge.Console",i.$),Bridge.apply(i.$.Bridge.Console,{f1:function(t){return t.add("position","fixed"),t.add("left","0"),t.add("bottom","0"),t.add("padding-top",this.consoleHeaderHeight),t.add("background-color","#fff"),t.add("font","normal normal normal 13px/1 sans-serif"),t.add("color","#555"),t},f2:function(t){return t.add("position","absolute"),t.add("top","0"),t.add("left","0"),t.add("right","0"),t.add("height","35px"),t.add("padding","9px 15px 7px 10px"),t.add("border-bottom","1px solid #ccc"),t.add("background-color","#f3f3f3"),t.add("box-sizing","border-box"),t},f3:function(t){return t.add("overflow-x","auto"),t.add("font-family","Menlo, Monaco, Consolas, 'Courier New', monospace"),t},f4:function(t){return t.add("xmlns",this.svgNS),t.add("width","25.5"),t.add("height","14.4"),t.add("viewBox","0 0 25.5 14.4"),t.add("style","margin: 0 3px 3px 0;vertical-align:middle;"),t},f5:function(t){return t.add("xmlns",this.svgNS),t.add("width","11.4"),t.add("height","11.4"),t.add("viewBox","0 0 11.4 11.4"),t.add("style","vertical-align: middle;"),t},f6:function(t){return t.add("d","M11.4 1.4L10 0 5.7 4.3 1.4 0 0 1.4l4.3 4.3L0 10l1.4 1.4 4.3-4.3 4.3 4.3 1.4-1.4-4.3-4.3"),t.add("fill","#555"),t},f7:function(t){return t.add("xmlns",this.svgNS),t.add("width","3.9"),t.add("height","6.7"),t.add("viewBox","0 0 3.9 6.7"),t.add("style","margin-right: 7px; vertical-align: middle;"),t}}),"function"==typeof define&&define.amd?define("bridge",[],(function(){return Bridge})):"undefined"!=typeof module&&module.exports&&(module.exports=Bridge)}(this),Bridge.assembly("Bridge.Collections",(function(){"use strict";Bridge.define("System.Collections.BitArray",{inherits:[System.Collections.ICollection,System.ICloneable],statics:{BitsPerInt32:32,BytesPerInt32:4,BitsPerByte:8,_ShrinkThreshold:256,getArrayLength:function(t,e){return t>0?1+(0|Bridge.Int.div(t-1|0,e))|0:0}},m_array:null,m_length:0,_version:0,config:{alias:["getCount","System$Collections$ICollection$getCount","clone","System$ICloneable$clone","getIsReadOnly","System$Collections$ICollection$getIsReadOnly","getEnumerator","System$Collections$IEnumerable$getEnumerator"]},$ctor3:function(t){System.Collections.BitArray.$ctor4.call(this,t,!1)},$ctor4:function(t,e){var n,r;if(this.$initialize(),t<0)throw new System.ArgumentOutOfRangeException("length","Index is less than zero.");for(this.m_array=System.Array.init(System.Collections.BitArray.getArrayLength(t,System.Collections.BitArray.BitsPerInt32),0),this.m_length=t,n=e?-1:0,r=0;r<this.m_array.length;r=r+1|0)this.m_array[r]=n;this._version=0},$ctor1:function(t){var e,n,r;if(this.$initialize(),null==t)throw new System.ArgumentNullException("bytes");if(t.length>268435455)throw new System.ArgumentException(System.String.format("The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.",System.Collections.BitArray.BitsPerByte),"bytes");for(this.m_array=System.Array.init(System.Collections.BitArray.getArrayLength(t.length,System.Collections.BitArray.BytesPerInt32),0),this.m_length=t.length*System.Collections.BitArray.BitsPerByte|0,e=0,n=0;(t.length-n|0)>=4;)this.m_array[Bridge.identity(e,e=e+1|0)]=255&t[n]|(255&t[n+1|0])<<8|(255&t[n+2|0])<<16|(255&t[n+3|0])<<24,n=n+4|0;3==(r=t.length-n|0)&&(this.m_array[e]=(255&t[n+2|0])<<16,r=2),2===r&&(this.m_array[e]=this.m_array[e]|(255&t[n+1|0])<<8,r=1),1===r&&(this.m_array[e]=this.m_array[e]|255&t[n]),this._version=0},ctor:function(t){if(this.$initialize(),null==t)throw new System.ArgumentNullException("values");this.m_array=System.Array.init(System.Collections.BitArray.getArrayLength(t.length,System.Collections.BitArray.BitsPerInt32),0),this.m_length=t.length;for(var e=0;e<t.length;e=e+1|0)t[e]&&(this.m_array[0|Bridge.Int.div(e,32)]=this.m_array[0|Bridge.Int.div(e,32)]|1<<e%32);this._version=0},$ctor5:function(t){if(this.$initialize(),null==t)throw new System.ArgumentNullException("values");if(t.length>67108863)throw new System.ArgumentException(System.String.format("The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.",System.Collections.BitArray.BitsPerInt32),"values");this.m_array=System.Array.init(t.length,0),this.m_length=t.length*System.Collections.BitArray.BitsPerInt32|0,System.Array.copy(t,0,this.m_array,0,t.length),this._version=0},$ctor2:function(t){if(this.$initialize(),null==t)throw new System.ArgumentNullException("bits");var e=System.Collections.BitArray.getArrayLength(t.m_length,System.Collections.BitArray.BitsPerInt32);this.m_array=System.Array.init(e,0),this.m_length=t.m_length,System.Array.copy(t.m_array,0,this.m_array,0,e),this._version=t._version},getItem:function(t){return this.get(t)},setItem:function(t,e){this.set(t,e)},getLength:function(){return this.m_length},setLength:function(t){var e,n,r,i;if(t<0)throw new System.ArgumentOutOfRangeException("value","Non-negative number required.");((e=System.Collections.BitArray.getArrayLength(t,System.Collections.BitArray.BitsPerInt32))>this.m_array.length||(e+System.Collections.BitArray._ShrinkThreshold|0)<this.m_array.length)&&(n=System.Array.init(e,0),System.Array.copy(this.m_array,0,n,0,e>this.m_array.length?this.m_array.length:e),this.m_array=n),t>this.m_length&&(r=System.Collections.BitArray.getArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32)-1|0,(i=this.m_length%32)>0&&(this.m_array[r]=this.m_array[r]&((1<<i)-1|0)),System.Array.fill(this.m_array,0,r+1|0,(e-r|0)-1|0)),this.m_length=t,this._version=this._version+1|0},getCount:function(){return this.m_length},getIsReadOnly:function(){return!1},getIsSynchronized:function(){return!1},get:function(t){if(t<0||t>=this.getLength())throw new System.ArgumentOutOfRangeException("index","Index was out of range. Must be non-negative and less than the size of the collection.");return 0!=(this.m_array[0|Bridge.Int.div(t,32)]&1<<t%32)},set:function(t,e){if(t<0||t>=this.getLength())throw new System.ArgumentOutOfRangeException("index","Index was out of range. Must be non-negative and less than the size of the collection.");this.m_array[0|Bridge.Int.div(t,32)]=e?this.m_array[0|Bridge.Int.div(t,32)]|1<<t%32:this.m_array[0|Bridge.Int.div(t,32)]&~(1<<t%32),this._version=this._version+1|0},setAll:function(t){for(var e=t?-1:0,n=System.Collections.BitArray.getArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),r=0;r<n;r=r+1|0)this.m_array[r]=e;this._version=this._version+1|0},and:function(t){var e,n;if(null==t)throw new System.ArgumentNullException("value");if(this.getLength()!==t.getLength())throw new System.ArgumentException("Array lengths must be the same.");for(e=System.Collections.BitArray.getArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),n=0;n<e;n=n+1|0)this.m_array[n]=this.m_array[n]&t.m_array[n];return this._version=this._version+1|0,this},or:function(t){var e,n;if(null==t)throw new System.ArgumentNullException("value");if(this.getLength()!==t.getLength())throw new System.ArgumentException("Array lengths must be the same.");for(e=System.Collections.BitArray.getArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),n=0;n<e;n=n+1|0)this.m_array[n]=this.m_array[n]|t.m_array[n];return this._version=this._version+1|0,this},xor:function(t){var e,n;if(null==t)throw new System.ArgumentNullException("value");if(this.getLength()!==t.getLength())throw new System.ArgumentException("Array lengths must be the same.");for(e=System.Collections.BitArray.getArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),n=0;n<e;n=n+1|0)this.m_array[n]=this.m_array[n]^t.m_array[n];return this._version=this._version+1|0,this},not:function(){for(var t=System.Collections.BitArray.getArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),e=0;e<t;e=e+1|0)this.m_array[e]=~this.m_array[e];return this._version=this._version+1|0,this},clone:function(){var t=new System.Collections.BitArray.$ctor5(this.m_array);return t._version=this._version,t.m_length=this.m_length,t},getEnumerator:function(){return new System.Collections.BitArray.BitArrayEnumeratorSimple(this)}}),Bridge.define("System.Collections.BitArray.BitArrayEnumeratorSimple",{inherits:[System.Collections.IEnumerator],bitarray:null,index:0,version:0,currentElement:!1,config:{alias:["moveNext","System$Collections$IEnumerator$moveNext","getCurrent","System$Collections$IEnumerator$getCurrent","reset","System$Collections$IEnumerator$reset"]},ctor:function(t){this.$initialize(),this.bitarray=t,this.index=-1,this.version=t._version},getCurrent:function(){if(-1===this.index)throw new System.InvalidOperationException("Enumeration has not started. Call MoveNext.");if(this.index>=this.bitarray.getCount())throw new System.InvalidOperationException("Enumeration already finished.");return this.currentElement},moveNext:function(){if(this.version!==this.bitarray._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");return this.index<(this.bitarray.getCount()-1|0)?(this.index=this.index+1|0,this.currentElement=this.bitarray.get(this.index),!0):(this.index=this.bitarray.getCount(),!1)},reset:function(){if(this.version!==this.bitarray._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");this.index=-1}}),Bridge.define("System.Collections.Generic.BitHelper",{statics:{MarkedBitFlag:1,IntSize:32,toIntArrayLength:function(t){return t>0?1+(0|Bridge.Int.div(t-1|0,System.Collections.Generic.BitHelper.IntSize))|0:0}},_length:0,_array:null,ctor:function(t,e){this.$initialize(),this._array=t,this._length=e},markBit:function(t){var e,n=0|Bridge.Int.div(t,System.Collections.Generic.BitHelper.IntSize);n<this._length&&n>=0&&(e=System.Collections.Generic.BitHelper.MarkedBitFlag<<t%System.Collections.Generic.BitHelper.IntSize,this._array[n]=this._array[n]|e)},isMarked:function(t){var e,n=0|Bridge.Int.div(t,System.Collections.Generic.BitHelper.IntSize);return n<this._length&&n>=0&&(e=System.Collections.Generic.BitHelper.MarkedBitFlag<<t%System.Collections.Generic.BitHelper.IntSize,0!=(this._array[n]&e))}}),Bridge.define("Bridge.Collections.EnumerableHelpers",{statics:{toArray:function(t,e){var n={},r={v:Bridge.Collections.EnumerableHelpers.toArray$1(t,e,n)};return System.Array.resize(r,n.v,Bridge.getDefaultValue(t)),r.v},toArray$1:function(t,e,n){var r,i,o,s,a=Bridge.getEnumerator(e,null,t);try{if(a.System$Collections$IEnumerator$moveNext()){for((r={v:System.Array.init(4,(function(){return Bridge.getDefaultValue(t)}))}).v[0]=a[Bridge.geti(a,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1","getCurrent$1")](),i=1;a.System$Collections$IEnumerator$moveNext();)i===r.v.length&&((s=i<<1)>>>0>(o=2146435071)&&(s=o<=i?i+1|0:o),System.Array.resize(r,s,Bridge.getDefaultValue(t))),r.v[Bridge.identity(i,i=i+1|0)]=a[Bridge.geti(a,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1","getCurrent$1")]();return n.v=i,r.v}}finally{Bridge.hasValue(a)&&a.dispose()}return n.v=0,System.Array.init(0,(function(){return Bridge.getDefaultValue(t)}))}}}),Bridge.define("System.Collections.Generic.HashSet$1",(function(t){return{inherits:[System.Collections.Generic.ICollection$1(t),System.Collections.Generic.ISet$1(t)],statics:{Lower31BitMask:2147483647,ShrinkThreshold:3,hashSetEquals:function(e,n,r){var i,o,s,a,u,l,c;if(null==e)return null==n;if(null==n)return!1;if(System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(e,n)){if(e.getCount()!==n.getCount())return!1;for(i=Bridge.getEnumerator(n);i.moveNext();)if(a=i.getCurrent(),!e.contains(a))return!1;return!0}for(o=Bridge.getEnumerator(n);o.moveNext();){for(u=o.getCurrent(),l=!1,s=Bridge.getEnumerator(e);s.moveNext();)if(c=s.getCurrent(),r["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2"](u,c)){l=!0;break}if(!l)return!1}return!0},areEqualityComparersEqual:function(t,e){return Bridge.equals(t.getComparer(),e.getComparer())}},_buckets:null,_slots:null,_count:0,_lastIndex:0,_freeList:0,_comparer:null,_version:0,config:{alias:["System$Collections$Generic$ICollection$1$T$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$copyTo","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$remove","getCount","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getCount","getIsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getIsReadOnly","System$Collections$Generic$IEnumerable$1$T$getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$getEnumerator","add","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$add","unionWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$unionWith","intersectWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$intersectWith","exceptWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$exceptWith","symmetricExceptWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$symmetricExceptWith","isSubsetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$isSubsetOf","isProperSubsetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$isProperSubsetOf","isSupersetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$isSupersetOf","isProperSupersetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$isProperSupersetOf","overlaps","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$overlaps","setEquals","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(t)+"$setEquals"]},ctor:function(){System.Collections.Generic.HashSet$1(t).$ctor3.call(this,System.Collections.Generic.EqualityComparer$1(t).def)},$ctor3:function(e){this.$initialize(),null==e&&(e=System.Collections.Generic.EqualityComparer$1(t).def),this._comparer=e,this._lastIndex=0,this._count=0,this._freeList=-1,this._version=0},$ctor1:function(e){System.Collections.Generic.HashSet$1(t).$ctor2.call(this,e,System.Collections.Generic.EqualityComparer$1(t).def)},$ctor2:function(e,n){if(System.Collections.Generic.HashSet$1(t).$ctor3.call(this,n),null==e)throw new System.ArgumentNullException("collection");var r=0,i=Bridge.as(e,System.Collections.Generic.ICollection$1(t));null!=i&&(r=System.Array.getCount(i,t)),this.initialize(r),this.unionWith(e),(0===this._count&&this._slots.length>System.Collections.HashHelpers.getMinPrime()||this._count>0&&(0|Bridge.Int.div(this._slots.length,this._count))>System.Collections.Generic.HashSet$1(t).ShrinkThreshold)&&this.trimExcess()},getCount:function(){return this._count},getIsReadOnly:function(){return!1},getComparer:function(){return this._comparer},System$Collections$Generic$ICollection$1$T$add:function(t){this.addIfNotPresent(t)},add:function(t){return this.addIfNotPresent(t)},clear:function(){var e,n;if(this._lastIndex>0){for(e=0;e<this._lastIndex;e=e+1|0)this._slots[e]=new(System.Collections.Generic.HashSet$1.Slot(t));for(n=0;n<this._buckets.length;n=n+1|0)this._buckets[n]=0;this._lastIndex=0,this._count=0,this._freeList=-1}this._version=this._version+1|0},arrayClear:function(){},contains:function(e){var n,r;if(null!=this._buckets)for(n=this.internalGetHashCode(e),r=this._buckets[n%this._buckets.length]-1|0;r>=0;r=this._slots[r].next)if(this._slots[r].hashCode===n&&this._comparer["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2"](this._slots[r].value,e))return!0;return!1},copyTo:function(t,e){this.copyTo$2(t,e,this._count)},copyTo$1:function(t){this.copyTo$2(t,0,this._count)},copyTo$2:function(t,e,n){var r,i;if(null==t)throw new System.ArgumentNullException("array");if(e<0)throw new System.ArgumentOutOfRangeException("arrayIndex");if(n<0)throw new System.ArgumentOutOfRangeException("count");if(e>t.length||n>(t.length-e|0))throw new System.ArgumentException("Destination array is not long enough to copy all the items in the collection. Check array index and length.");for(r=0,i=0;i<this._lastIndex&&r<n;i=i+1|0)this._slots[i].hashCode>=0&&(t[e+r|0]=this._slots[i].value,r=r+1|0)},remove:function(e){var n;if(null!=this._buckets){var r=this.internalGetHashCode(e),i=r%this._buckets.length,o=-1;for(n=this._buckets[i]-1|0;n>=0;o=n,n=this._slots[n].next)if(this._slots[n].hashCode===r&&this._comparer["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2"](this._slots[n].value,e))return o<0?this._buckets[i]=this._slots[n].next+1|0:this._slots[o].next=this._slots[n].next,this._slots[n].hashCode=-1,this._slots[n].value=Bridge.getDefaultValue(t),this._slots[n].next=this._freeList,this._count=this._count-1|0,this._version=this._version+1|0,0===this._count?(this._lastIndex=0,this._freeList=-1):this._freeList=n,!0}return!1},getEnumerator:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(t).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$T$getEnumerator:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(t).$ctor1)(this)},System$Collections$IEnumerable$getEnumerator:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(t).$ctor1)(this)},unionWith:function(e){var n,r;if(null==e)throw new System.ArgumentNullException("other");for(n=Bridge.getEnumerator(e,null,t);n.moveNext();)r=n.getCurrent(),this.addIfNotPresent(r)},intersectWith:function(e){var n,r;if(null==e)throw new System.ArgumentNullException("other");if(0!==this._count){if(null!=(n=Bridge.as(e,System.Collections.Generic.ICollection$1(t)))){if(0===System.Array.getCount(n,t))return void this.clear();if(null!=(r=Bridge.as(e,System.Collections.Generic.HashSet$1(t)))&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,r))return void this.intersectWithHashSetWithSameEC(r)}this.intersectWithEnumerable(e)}},exceptWith:function(e){var n,r;if(null==e)throw new System.ArgumentNullException("other");if(0!==this._count){if(Bridge.referenceEquals(e,this))return void this.clear();for(n=Bridge.getEnumerator(e,null,t);n.moveNext();)r=n.getCurrent(),this.remove(r)}},symmetricExceptWith:function(e){if(null==e)throw new System.ArgumentNullException("other");if(0!==this._count)if(Bridge.referenceEquals(e,this))this.clear();else{var n=Bridge.as(e,System.Collections.Generic.HashSet$1(t));null!=n&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,n)?this.symmetricExceptWithUniqueHashSet(n):this.symmetricExceptWithEnumerable(e)}else this.unionWith(e)},isSubsetOf:function(e){var n,r;if(null==e)throw new System.ArgumentNullException("other");return 0===this._count||(null!=(n=Bridge.as(e,System.Collections.Generic.HashSet$1(t)))&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,n)?!(this._count>n.getCount())&&this.isSubsetOfHashSetWithSameEC(n):(r=this.checkUniqueAndUnfoundElements(e,!1).$clone()).uniqueCount===this._count&&r.unfoundCount>=0)},isProperSubsetOf:function(e){var n,r,i;if(null==e)throw new System.ArgumentNullException("other");if(null!=(n=Bridge.as(e,System.Collections.Generic.ICollection$1(t)))){if(0===this._count)return System.Array.getCount(n,t)>0;if(null!=(r=Bridge.as(e,System.Collections.Generic.HashSet$1(t)))&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,r))return!(this._count>=r.getCount())&&this.isSubsetOfHashSetWithSameEC(r)}return(i=this.checkUniqueAndUnfoundElements(e,!1).$clone()).uniqueCount===this._count&&i.unfoundCount>0},isSupersetOf:function(e){var n,r;if(null==e)throw new System.ArgumentNullException("other");if(null!=(n=Bridge.as(e,System.Collections.Generic.ICollection$1(t)))){if(0===System.Array.getCount(n,t))return!0;if(null!=(r=Bridge.as(e,System.Collections.Generic.HashSet$1(t)))&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,r)&&r.getCount()>this._count)return!1}return this.containsAllElements(e)},isProperSupersetOf:function(e){var n,r,i;if(null==e)throw new System.ArgumentNullException("other");if(0===this._count)return!1;if(null!=(n=Bridge.as(e,System.Collections.Generic.ICollection$1(t)))){if(0===System.Array.getCount(n,t))return!0;if(null!=(r=Bridge.as(e,System.Collections.Generic.HashSet$1(t)))&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,r))return!(r.getCount()>=this._count)&&this.containsAllElements(r)}return(i=this.checkUniqueAndUnfoundElements(e,!0).$clone()).uniqueCount<this._count&&0===i.unfoundCount},overlaps:function(e){var n,r;if(null==e)throw new System.ArgumentNullException("other");if(0===this._count)return!1;for(n=Bridge.getEnumerator(e,null,t);n.moveNext();)if(r=n.getCurrent(),this.contains(r))return!0;return!1},setEquals:function(e){var n,r,i;if(null==e)throw new System.ArgumentNullException("other");return null!=(n=Bridge.as(e,System.Collections.Generic.HashSet$1(t)))&&System.Collections.Generic.HashSet$1(t).areEqualityComparersEqual(this,n)?this._count===n.getCount()&&this.containsAllElements(n):!(null!=(r=Bridge.as(e,System.Collections.Generic.ICollection$1(t)))&&0===this._count&&System.Array.getCount(r,t)>0)&&(i=this.checkUniqueAndUnfoundElements(e,!0).$clone()).uniqueCount===this._count&&0===i.unfoundCount},removeWhere:function(t){var e,n,r;if(Bridge.staticEquals(t,null))throw new System.ArgumentNullException("match");for(e=0,n=0;n<this._lastIndex;n=n+1|0)this._slots[n].hashCode>=0&&t(r=this._slots[n].value)&&this.remove(r)&&(e=e+1|0);return e},trimExcess:function(){var e,n;if(0===this._count)this._buckets=null,this._slots=null,this._version=this._version+1|0;else{var r=System.Collections.HashHelpers.getPrime(this._count),i=System.Array.init(r,(function(){return new(System.Collections.Generic.HashSet$1.Slot(t))})),o=System.Array.init(r,0),s=0;for(e=0;e<this._lastIndex;e=e+1|0)this._slots[e].hashCode>=0&&(i[s]=this._slots[e].$clone(),n=i[s].hashCode%r,i[s].next=o[n]-1|0,o[n]=s+1|0,s=s+1|0);this._lastIndex=s,this._slots=i,this._buckets=o,this._freeList=-1}},initialize:function(e){var n=System.Collections.HashHelpers.getPrime(e);this._buckets=System.Array.init(n,0),this._slots=System.Array.init(n,(function(){return new(System.Collections.Generic.HashSet$1.Slot(t))}))},increaseCapacity:function(){var t=System.Collections.HashHelpers.expandPrime(this._count);if(t<=this._count)throw new System.ArgumentException("HashSet capacity is too big.");this.setCapacity(t,!1)},setCapacity:function(e,n){var r,i,o,s,a,u=System.Array.init(e,(function(){return new(System.Collections.Generic.HashSet$1.Slot(t))}));if(null!=this._slots)for(r=0;r<this._lastIndex;r=r+1|0)u[r]=this._slots[r].$clone();if(n)for(i=0;i<this._lastIndex;i=i+1|0)-1!==u[i].hashCode&&(u[i].hashCode=this.internalGetHashCode(u[i].value));for(o=System.Array.init(e,0),s=0;s<this._lastIndex;s=s+1|0)a=u[s].hashCode%e,u[s].next=o[a]-1|0,o[a]=s+1|0;this._slots=u,this._buckets=o},addIfNotPresent:function(e){var n,r,i,o;for(null==this._buckets&&this.initialize(0),r=(n=this.internalGetHashCode(e))%this._buckets.length,i=this._buckets[r]-1|0;i>=0;i=this._slots[i].next)if(this._slots[i].hashCode===n&&this._comparer["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2"](this._slots[i].value,e))return!1;return this._freeList>=0?(o=this._freeList,this._freeList=this._slots[o].next):(this._lastIndex===this._slots.length&&(this.increaseCapacity(),r=n%this._buckets.length),o=this._lastIndex,this._lastIndex=this._lastIndex+1|0),this._slots[o].hashCode=n,this._slots[o].value=e,this._slots[o].next=this._buckets[r]-1|0,this._buckets[r]=o+1|0,this._count=this._count+1|0,this._version=this._version+1|0,!0},containsAllElements:function(e){for(var n,r=Bridge.getEnumerator(e,null,t);r.moveNext();)if(n=r.getCurrent(),!this.contains(n))return!1;return!0},isSubsetOfHashSetWithSameEC:function(t){for(var e,n=Bridge.getEnumerator(this);n.moveNext();)if(e=n.getCurrent(),!t.contains(e))return!1;return!0},intersectWithHashSetWithSameEC:function(t){for(var e,n=0;n<this._lastIndex;n=n+1|0)this._slots[n].hashCode>=0&&(e=this._slots[n].value,t.contains(e)||this.remove(e))},intersectWithEnumerable:function(e){for(var n,r,i,o=this._lastIndex,s=System.Collections.Generic.BitHelper.toIntArrayLength(o),a=System.Array.init(s,0),u=new System.Collections.Generic.BitHelper(a,s),l=Bridge.getEnumerator(e,null,t);l.moveNext();)n=l.getCurrent(),(r=this.internalIndexOf(n))>=0&&u.markBit(r);for(i=0;i<o;i=i+1|0)this._slots[i].hashCode>=0&&!u.isMarked(i)&&this.remove(this._slots[i].value)},internalIndexOf:function(e){for(var n=this.internalGetHashCode(e),r=this._buckets[n%this._buckets.length]-1|0;r>=0;r=this._slots[r].next)if(this._slots[r].hashCode===n&&this._comparer["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2"](this._slots[r].value,e))return r;return-1},symmetricExceptWithUniqueHashSet:function(t){for(var e,n=Bridge.getEnumerator(t);n.moveNext();)e=n.getCurrent(),this.remove(e)||this.addIfNotPresent(e)},symmetricExceptWithEnumerable:function(e){var n,r,i,o,s,a=this._lastIndex,u=System.Collections.Generic.BitHelper.toIntArrayLength(a),l=System.Array.init(u,0);for(r=new System.Collections.Generic.BitHelper(l,u),o=System.Array.init(u,0),i=new System.Collections.Generic.BitHelper(o,u),n=Bridge.getEnumerator(e,null,t);n.moveNext();){var c=n.getCurrent(),g={v:0};this.addOrGetLocation(c,g)?i.markBit(g.v):g.v<a&&!i.isMarked(g.v)&&r.markBit(g.v)}for(s=0;s<a;s=s+1|0)r.isMarked(s)&&this.remove(this._slots[s].value)},addOrGetLocation:function(e,n){for(var r,i=this.internalGetHashCode(e),o=i%this._buckets.length,s=this._buckets[o]-1|0;s>=0;s=this._slots[s].next)if(this._slots[s].hashCode===i&&this._comparer["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$equals2"](this._slots[s].value,e))return n.v=s,!1;return this._freeList>=0?(r=this._freeList,this._freeList=this._slots[r].next):(this._lastIndex===this._slots.length&&(this.increaseCapacity(),o=i%this._buckets.length),r=this._lastIndex,this._lastIndex=this._lastIndex+1|0),this._slots[r].hashCode=i,this._slots[r].value=e,this._slots[r].next=this._buckets[o]-1|0,this._buckets[o]=r+1|0,this._count=this._count+1|0,this._version=this._version+1|0,n.v=r,!0},checkUniqueAndUnfoundElements:function(e,n){var r,i,o,s,a,u,l,c=new(System.Collections.Generic.HashSet$1.ElementCount(t));if(0===this._count){for(o=0,r=Bridge.getEnumerator(e,null,t);r.moveNext();){r.getCurrent(),o=o+1|0;break}return c.uniqueCount=0,c.unfoundCount=o,c.$clone()}var g,h=this._lastIndex,m=System.Collections.Generic.BitHelper.toIntArrayLength(h),f=System.Array.init(m,0);for(g=new System.Collections.Generic.BitHelper(f,m),s=0,a=0,i=Bridge.getEnumerator(e,null,t);i.moveNext();)if(u=i.getCurrent(),(l=this.internalIndexOf(u))>=0)g.isMarked(l)||(g.markBit(l),a=a+1|0);else if(s=s+1|0,n)break;return c.uniqueCount=a,c.unfoundCount=s,c.$clone()},toArray:function(){var e=System.Array.init(this.getCount(),(function(){return Bridge.getDefaultValue(t)}));return this.copyTo$1(e),e},internalGetHashCode:function(e){return null==e?0:this._comparer["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(t)+"$getHashCode2"](e)&System.Collections.Generic.HashSet$1(t).Lower31BitMask}}})),Bridge.define("System.Collections.Generic.HashSet$1.ElementCount",(function(t){return{$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.HashSet$1.ElementCount(t))}},uniqueCount:0,unfoundCount:0,ctor:function(){this.$initialize()},getHashCode:function(){return Bridge.addHash([4920463385,this.uniqueCount,this.unfoundCount])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.HashSet$1.ElementCount(t))&&Bridge.equals(this.uniqueCount,e.uniqueCount)&&Bridge.equals(this.unfoundCount,e.unfoundCount)},$clone:function(e){var n=e||new(System.Collections.Generic.HashSet$1.ElementCount(t));return n.uniqueCount=this.uniqueCount,n.unfoundCount=this.unfoundCount,n}}})),Bridge.define("System.Collections.Generic.HashSet$1.Enumerator",(function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t)],$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(t))}},_set:null,_index:0,_version:0,_current:Bridge.getDefaultValue(t),config:{alias:["dispose","System$IDisposable$dispose","moveNext","System$Collections$IEnumerator$moveNext","getCurrent","System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1"]},$ctor1:function(e){this.$initialize(),this._set=e,this._index=0,this._version=e._version,this._current=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()},getCurrent:function(){return this._current},System$Collections$IEnumerator$getCurrent:function(){if(0===this._index||this._index===(this._set._lastIndex+1|0))throw new System.InvalidOperationException("Enumeration has either not started or has already finished.");return this.getCurrent()},dispose:function(){},moveNext:function(){if(this._version!==this._set._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");for(;this._index<this._set._lastIndex;){if(this._set._slots[this._index].hashCode>=0)return this._current=this._set._slots[this._index].value,this._index=this._index+1|0,!0;this._index=this._index+1|0}return this._index=this._set._lastIndex+1|0,this._current=Bridge.getDefaultValue(t),!1},System$Collections$IEnumerator$reset:function(){if(this._version!==this._set._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");this._index=0,this._current=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this._set,this._index,this._version,this._current])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.HashSet$1.Enumerator(t))&&Bridge.equals(this._set,e._set)&&Bridge.equals(this._index,e._index)&&Bridge.equals(this._version,e._version)&&Bridge.equals(this._current,e._current)},$clone:function(e){var n=e||new(System.Collections.Generic.HashSet$1.Enumerator(t));return n._set=this._set,n._index=this._index,n._version=this._version,n._current=this._current,n}}})),Bridge.define("System.Collections.Generic.HashSet$1.Slot",(function(t){return{$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.HashSet$1.Slot(t))}},hashCode:0,value:Bridge.getDefaultValue(t),next:0,ctor:function(){this.$initialize()},getHashCode:function(){return Bridge.addHash([1953459283,this.hashCode,this.value,this.next])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.HashSet$1.Slot(t))&&Bridge.equals(this.hashCode,e.hashCode)&&Bridge.equals(this.value,e.value)&&Bridge.equals(this.next,e.next)},$clone:function(e){var n=e||new(System.Collections.Generic.HashSet$1.Slot(t));return n.hashCode=this.hashCode,n.value=this.value,n.next=this.next,n}}})),Bridge.define("System.Collections.Generic.Queue$1",(function(t){return{inherits:[System.Collections.Generic.IEnumerable$1(t),System.Collections.ICollection],statics:{MinimumGrow:4,GrowFactor:200,DefaultCapacity:4},_array:null,_head:0,_tail:0,_size:0,_version:0,config:{alias:["getCount","System$Collections$ICollection$getCount","getIsReadOnly","System$Collections$ICollection$getIsReadOnly","System$Collections$Generic$IEnumerable$1$T$getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$getEnumerator"]},ctor:function(){this.$initialize(),this._array=System.Array.init(0,(function(){return Bridge.getDefaultValue(t)}))},$ctor2:function(e){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException("capacity","Non-negative number required.");this._array=System.Array.init(e,(function(){return Bridge.getDefaultValue(t)}))},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException("collection");this._array=System.Array.init(System.Collections.Generic.Queue$1(t).DefaultCapacity,(function(){return Bridge.getDefaultValue(t)}));var n=Bridge.getEnumerator(e,null,t);try{for(;n.System$Collections$IEnumerator$moveNext();)this.enqueue(n[Bridge.geti(n,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1","getCurrent$1")]())}finally{Bridge.hasValue(n)&&n.dispose()}},getCount:function(){return this._size},getIsReadOnly:function(){return!1},clear:function(){this._head<this._tail?System.Array.fill(this._array,Bridge.getDefaultValue(t),this._head,this._size):(System.Array.fill(this._array,Bridge.getDefaultValue(t),this._head,this._array.length-this._head|0),System.Array.fill(this._array,Bridge.getDefaultValue(t),0,this._tail)),this._head=0,this._tail=0,this._size=0,this._version=this._version+1|0},copyTo:function(t,e){var n,r,i;if(null==t)throw new System.ArgumentNullException("array");if(e<0||e>t.length)throw new System.ArgumentOutOfRangeException("arrayIndex","Index was out of range. Must be non-negative and less than the size of the collection.");if(((n=t.length)-e|0)<this._size)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");0!==(r=(n-e|0)<this._size?n-e|0:this._size)&&(i=(this._array.length-this._head|0)<r?this._array.length-this._head|0:r,System.Array.copy(this._array,this._head,t,e,i),(r=r-i|0)>0&&System.Array.copy(this._array,0,t,(e+this._array.length|0)-this._head|0,r))},enqueue:function(e){if(this._size===this._array.length){var n=0|Bridge.Int.div(this._array.length*System.Collections.Generic.Queue$1(t).GrowFactor|0,100);n<(this._array.length+System.Collections.Generic.Queue$1(t).MinimumGrow|0)&&(n=this._array.length+System.Collections.Generic.Queue$1(t).MinimumGrow|0),this.setCapacity(n)}this._array[this._tail]=e,this._tail=this.moveNext(this._tail),this._size=this._size+1|0,this._version=this._version+1|0},getEnumerator:function(){return new(System.Collections.Generic.Queue$1.Enumerator(t).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$T$getEnumerator:function(){return new(System.Collections.Generic.Queue$1.Enumerator(t).$ctor1)(this)},System$Collections$IEnumerable$getEnumerator:function(){return new(System.Collections.Generic.Queue$1.Enumerator(t).$ctor1)(this)},dequeue:function(){if(0===this._size)throw new System.InvalidOperationException("Queue empty.");var e=this._array[this._head];return this._array[this._head]=Bridge.getDefaultValue(t),this._head=this.moveNext(this._head),this._size=this._size-1|0,this._version=this._version+1|0,e},peek:function(){if(0===this._size)throw new System.InvalidOperationException("Queue empty.");return this._array[this._head]},contains:function(e){for(var n=this._head,r=this._size,i=System.Collections.Generic.EqualityComparer$1(t).def;Bridge.identity(r,r=r-1|0)>0;){if(null==e){if(null==this._array[n])return!0}else if(null!=this._array[n]&&i.equals2(this._array[n],e))return!0;n=this.moveNext(n)}return!1},getElement:function(t){return this._array[(this._head+t|0)%this._array.length]},toArray:function(){var e=System.Array.init(this._size,(function(){return Bridge.getDefaultValue(t)}));return 0===this._size||(this._head<this._tail?System.Array.copy(this._array,this._head,e,0,this._size):(System.Array.copy(this._array,this._head,e,0,this._array.length-this._head|0),System.Array.copy(this._array,0,e,this._array.length-this._head|0,this._tail))),e},setCapacity:function(e){var n=System.Array.init(e,(function(){return Bridge.getDefaultValue(t)}));this._size>0&&(this._head<this._tail?System.Array.copy(this._array,this._head,n,0,this._size):(System.Array.copy(this._array,this._head,n,0,this._array.length-this._head|0),System.Array.copy(this._array,0,n,this._array.length-this._head|0,this._tail))),this._array=n,this._head=0,this._tail=this._size===e?0:this._size,this._version=this._version+1|0},moveNext:function(t){var e=t+1|0;return e===this._array.length?0:e},trimExcess:function(){var t=Bridge.Int.clip32(.9*this._array.length);this._size<t&&this.setCapacity(this._size)}}})),Bridge.define("System.Collections.Generic.Queue$1.Enumerator",(function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.Queue$1.Enumerator(t))}},_q:null,_index:0,_version:0,_currentElement:Bridge.getDefaultValue(t),config:{alias:["dispose","System$IDisposable$dispose","moveNext","System$Collections$IEnumerator$moveNext","getCurrent","System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1"]},$ctor1:function(e){this.$initialize(),this._q=e,this._version=this._q._version,this._index=-1,this._currentElement=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()},getCurrent:function(){if(this._index<0)throw-1===this._index?new System.InvalidOperationException("Enumeration has not started. Call MoveNext."):new System.InvalidOperationException("Enumeration already finished.");return this._currentElement},System$Collections$IEnumerator$getCurrent:function(){return this.getCurrent()},dispose:function(){this._index=-2,this._currentElement=Bridge.getDefaultValue(t)},moveNext:function(){if(this._version!==this._q._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");return-2!==this._index&&(this._index=this._index+1|0,this._index===this._q._size?(this._index=-2,this._currentElement=Bridge.getDefaultValue(t),!1):(this._currentElement=this._q.getElement(this._index),!0))},System$Collections$IEnumerator$reset:function(){if(this._version!==this._q._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");this._index=-1,this._currentElement=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this._q,this._index,this._version,this._currentElement])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Queue$1.Enumerator(t))&&Bridge.equals(this._q,e._q)&&Bridge.equals(this._index,e._index)&&Bridge.equals(this._version,e._version)&&Bridge.equals(this._currentElement,e._currentElement)},$clone:function(e){var n=e||new(System.Collections.Generic.Queue$1.Enumerator(t));return n._q=this._q,n._index=this._index,n._version=this._version,n._currentElement=this._currentElement,n}}})),Bridge.define("System.Collections.Generic.Stack$1",(function(t){return{inherits:[System.Collections.Generic.IEnumerable$1(t),System.Collections.ICollection],statics:{DefaultCapacity:4},_array:null,_size:0,_version:0,config:{alias:["getCount","System$Collections$ICollection$getCount","getIsReadOnly","System$Collections$ICollection$getIsReadOnly","System$Collections$Generic$IEnumerable$1$T$getEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$getEnumerator"]},ctor:function(){this.$initialize(),this._array=System.Array.init(0,(function(){return Bridge.getDefaultValue(t)}))},$ctor2:function(e){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException("capacity","Non-negative number required.");this._array=System.Array.init(e,(function(){return Bridge.getDefaultValue(t)}))},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException("collection");var n={};this._array=Bridge.Collections.EnumerableHelpers.toArray$1(t,e,n),this._size=n.v},getCount:function(){return this._size},getIsReadOnly:function(){return!1},clear:function(){System.Array.fill(this._array,Bridge.getDefaultValue(t),0,this._size),this._size=0,this._version=this._version+1|0},contains:function(e){for(var n=this._size,r=System.Collections.Generic.EqualityComparer$1(t).def;Bridge.identity(n,n=n-1|0)>0;)if(null==e){if(null==this._array[n])return!0}else if(null!=this._array[n]&&r.equals2(this._array[n],e))return!0;return!1},copyTo:function(t,e){var n,r,i;if(null==t)throw new System.ArgumentNullException("array");if(e<0||e>t.length)throw new System.ArgumentOutOfRangeException("arrayIndex","Non-negative number required.");if((t.length-e|0)<this._size)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(Bridge.referenceEquals(t,this._array))System.Array.copy(this._array,0,t,e,this._size),System.Array.reverse(t,e,this._size);else for(n=0,r=e+this._size|0,i=0;i<this._size;i=i+1|0)t[r=r-1|0]=this._array[Bridge.identity(n,n=n+1|0)]},copyTo$1:function(t,e){if(null==t)throw new System.ArgumentNullException("array");if(1!==System.Array.getRank(t))throw new System.ArgumentException("Only single dimensional arrays are supported for the requested action.");if(0!==System.Array.getLower(t,0))throw new System.ArgumentException("The lower bound of target array must be zero.");if(e<0||e>t.length)throw new System.ArgumentOutOfRangeException("arrayIndex","Non-negative number required.");if((t.length-e|0)<this._size)throw new System.ArgumentException("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");try{System.Array.copy(this._array,0,t,e,this._size),System.Array.reverse(t,e,this._size)}catch(t){throw t=System.Exception.create(t),new System.ArgumentException("Target array type is not compatible with the type of items in the collection.")}},getEnumerator:function(){return new(System.Collections.Generic.Stack$1.Enumerator(t).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$T$getEnumerator:function(){return new(System.Collections.Generic.Stack$1.Enumerator(t).$ctor1)(this)},System$Collections$IEnumerable$getEnumerator:function(){return new(System.Collections.Generic.Stack$1.Enumerator(t).$ctor1)(this)},trimExcess:function(){var e,n=Bridge.Int.clip32(.9*this._array.length);this._size<n&&(e={v:this._array},System.Array.resize(e,this._size,Bridge.getDefaultValue(t)),this._array=e.v,this._version=this._version+1|0)},peek:function(){if(0===this._size)throw new System.InvalidOperationException("Stack empty.");return this._array[this._size-1|0]},pop:function(){if(0===this._size)throw new System.InvalidOperationException("Stack empty.");this._version=this._version+1|0;var e=this._array[this._size=this._size-1|0];return this._array[this._size]=Bridge.getDefaultValue(t),e},push:function(e){if(this._size===this._array.length){var n={v:this._array};System.Array.resize(n,0===this._array.length?System.Collections.Generic.Stack$1(t).DefaultCapacity:2*this._array.length|0,Bridge.getDefaultValue(t)),this._array=n.v}this._array[Bridge.identity(this._size,this._size=this._size+1|0)]=e,this._version=this._version+1|0},toArray:function(){for(var e=System.Array.init(this._size,(function(){return Bridge.getDefaultValue(t)})),n=0;n<this._size;)e[n]=this._array[(this._size-n|0)-1|0],n=n+1|0;return e}}})),Bridge.define("System.Collections.Generic.Stack$1.Enumerator",(function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"struct",statics:{getDefaultValue:function(){return new(System.Collections.Generic.Stack$1.Enumerator(t))}},_stack:null,_index:0,_version:0,_currentElement:Bridge.getDefaultValue(t),config:{alias:["dispose","System$IDisposable$dispose","moveNext","System$Collections$IEnumerator$moveNext","getCurrent","System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1"]},$ctor1:function(e){this.$initialize(),this._stack=e,this._version=this._stack._version,this._index=-2,this._currentElement=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()},getCurrent:function(){if(-2===this._index)throw new System.InvalidOperationException("Enumeration has not started. Call MoveNext.");if(-1===this._index)throw new System.InvalidOperationException("Enumeration already finished.");return this._currentElement},System$Collections$IEnumerator$getCurrent:function(){if(-2===this._index)throw new System.InvalidOperationException("Enumeration has not started. Call MoveNext.");if(-1===this._index)throw new System.InvalidOperationException("Enumeration already finished.");return this._currentElement},dispose:function(){this._index=-1},moveNext:function(){var e;if(this._version!==this._stack._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");return-2===this._index?(this._index=this._stack._size-1|0,(e=this._index>=0)&&(this._currentElement=this._stack._array[this._index]),e):-1!==this._index&&(e=(this._index=this._index-1|0)>=0,this._currentElement=e?this._stack._array[this._index]:Bridge.getDefaultValue(t),e)},System$Collections$IEnumerator$reset:function(){if(this._version!==this._stack._version)throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");this._index=-2,this._currentElement=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this._stack,this._index,this._version,this._currentElement])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Stack$1.Enumerator(t))&&Bridge.equals(this._stack,e._stack)&&Bridge.equals(this._index,e._index)&&Bridge.equals(this._version,e._version)&&Bridge.equals(this._currentElement,e._currentElement)},$clone:function(e){var n=e||new(System.Collections.Generic.Stack$1.Enumerator(t));return n._stack=this._stack,n._index=this._index,n._version=this._version,n._currentElement=this._currentElement,n}}})),Bridge.define("System.Collections.HashHelpers",{statics:{HashPrime:101,primes:null,MaxPrimeArrayLength:2146435069,config:{init:function(){this.primes=[3,7,11,17,23,29,37,47,59,71,89,107,131,163,197,239,293,353,431,521,631,761,919,1103,1327,1597,1931,2333,2801,3371,4049,4861,5839,7013,8419,10103,12143,14591,17519,21023,25229,30293,36353,43627,52361,62851,75431,90523,108631,130363,156437,187751,225307,270371,324449,389357,467237,560689,672827,807403,968897,1162687,1395263,1674319,2009191,2411033,2893249,3471899,4166287,4999559,5999471,7199369]}},isPrime:function(t){var e,n;if(0!=(1&t)){for(e=Bridge.Int.clip32(Math.sqrt(t)),n=3;n<=e;n=n+2|0)if(t%n==0)return!1;return!0}return 2===t},getPrime:function(t){var e,n,r;if(t<0)throw new System.ArgumentException("Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table.");for(e=0;e<System.Collections.HashHelpers.primes.length;e=e+1|0)if((n=System.Collections.HashHelpers.primes[e])>=t)return n;for(r=1|t;r<2147483647;r=r+2|0)if(System.Collections.HashHelpers.isPrime(r)&&(r-1|0)%System.Collections.HashHelpers.HashPrime!=0)return r;return t},getMinPrime:function(){return System.Collections.HashHelpers.primes[0]},expandPrime:function(t){var e=2*t|0;return e>>>0>System.Collections.HashHelpers.MaxPrimeArrayLength&&System.Collections.HashHelpers.MaxPrimeArrayLength>t?System.Collections.HashHelpers.MaxPrimeArrayLength:System.Collections.HashHelpers.getPrime(e)}}})})),Bridge.assembly("OrgChart.Layout",(function(t){"use strict";Bridge.define("OrgChart.Annotations.CanBeNullAttribute",{inherits:[System.Attribute]}),Bridge.define("OrgChart.Annotations.ContractAnnotationAttribute",{inherits:[System.Attribute],config:{properties:{Contract:null,ForceFullStates:!1}},ctor:function(t){OrgChart.Annotations.ContractAnnotationAttribute.$ctor1.call(this,t,!1)},$ctor1:function(t,e){this.$initialize(),System.Attribute.ctor.call(this),this.setContract(t),this.setForceFullStates(e)}}),Bridge.define("OrgChart.Annotations.NotNullAttribute",{inherits:[System.Attribute]}),Bridge.define("OrgChart.Annotations.PureAttribute",{inherits:[System.Attribute]}),Bridge.define("OrgChart.Layout.Boundary",{Left:null,Right:null,m_spacerMerger:null,config:{properties:{BoundingRect:null},init:function(){this.BoundingRect=new OrgChart.Layout.Rect}},ctor:function(){OrgChart.Layout.Boundary.$ctor1.call(this,!0)},$ctor1:function(t){this.$initialize(),this.Left=new(System.Collections.Generic.List$1(OrgChart.Layout.Boundary.Step)),this.Right=new(System.Collections.Generic.List$1(OrgChart.Layout.Boundary.Step)),t&&(this.m_spacerMerger=new OrgChart.Layout.Boundary.$ctor1(!1))},PrepareForHorizontalLayout:function(t){if(this.Prepare(t),!t.getElement().DisableCollisionDetection){var e=t.getState();this.Left.add(new OrgChart.Layout.Boundary.Step.$ctor1(t,e.getLeft(),e.getTop(),e.getBottom())),this.Right.add(new OrgChart.Layout.Boundary.Step.$ctor1(t,e.getRight(),e.getTop(),e.getBottom()))}},Prepare:function(t){this.Left.clear(),this.Right.clear(),this.setBoundingRect(new OrgChart.Layout.Rect.$ctor1(t.getState().TopLeft,t.getState().Size))},VerticalMergeFrom:function(t){this.setBoundingRect(OrgChart.Layout.Rect.op_Addition(this.getBoundingRect(),t.getBoundingRect()))},MergeFrom:function(t){var e,n,r,i;if(t.getBoundingRect().getTop()>=t.getBoundingRect().getBottom())throw new System.ArgumentException("Cannot merge boundary of height "+System.Double.format(t.getBoundingRect().getBottom()-t.getBoundingRect().getTop(),"G"));for(e=114;0!==e;){for(var o=114===e?this.Right:this.Left,s=114===e?t.Right:t.Left,a=0,u=0;u<s.getCount()&&a<o.getCount();)n=o.getItem(a),r=s.getItem(u),n.Bottom<=r.Top?a=a+1|0:r.Bottom<=n.Top?(o.insert(a,r),u=u+1|0,this.ValidateState()):(i=114===e?n.X<=r.X:n.X>=r.X,OrgChart.Layout.LayoutAlgorithm.IsEqual(n.Top,r.Top)?OrgChart.Layout.LayoutAlgorithm.IsEqual(n.Bottom,r.Bottom)?(i&&o.setItem(a,r),a=a+1|0,u=u+1|0,this.ValidateState()):n.Bottom<r.Bottom?(i&&o.setItem(a,n.ChangeOwner(r.Node,r.X)),s.setItem(u,r.ChangeTop(n.Bottom)),a=a+1|0,this.ValidateState()):(i&&(o.setItem(a,n.ChangeTop(r.Bottom)),o.insert(a,r),a=a+1|0),u=u+1|0,this.ValidateState()):OrgChart.Layout.LayoutAlgorithm.IsEqual(n.Bottom,r.Bottom)?n.Top<r.Top?(i&&(o.setItem(a,n.ChangeBottom(r.Top)),o.insert(a+1|0,r),a=a+1|0),a=a+1|0,u=u+1|0,this.ValidateState()):(i?o.setItem(a,r):(o.insert(a,r.ChangeBottom(n.Top)),a=a+1|0),a=a+1|0,u=u+1|0,this.ValidateState()):n.Top<r.Top&&n.Bottom<r.Bottom?(i&&(o.setItem(a,n.ChangeBottom(r.Top)),o.insert(a+1|0,new OrgChart.Layout.Boundary.Step.$ctor1(r.Node,r.X,r.Top,n.Bottom)),a=a+1|0),s.setItem(u,r.ChangeTop(n.Bottom)),a=a+1|0,this.ValidateState()):n.Top<r.Top&&n.Bottom>r.Bottom?(i&&(o.setItem(a,n.ChangeBottom(r.Top)),o.insert(a+1|0,r),o.insert(a+2|0,n.ChangeTop(r.Bottom)),a=a+2|0),u=u+1|0,this.ValidateState()):n.Bottom>r.Bottom?(i?(o.setItem(a,n.ChangeTop(r.Bottom)),o.insert(a,r)):o.insert(a,r.ChangeBottom(n.Top)),a=a+1|0,u=u+1|0,this.ValidateState()):(i?o.setItem(a,r.ChangeBottom(n.Bottom)):(o.insert(a,r.ChangeBottom(n.Top)),a=a+1|0),s.setItem(u,r.ChangeTop(n.Bottom)),a=a+1|0,this.ValidateState()));if(a===o.getCount())for(;u<s.getCount();)o.add(s.getItem(u)),u=u+1|0,this.ValidateState();e=114===e?108:0}this.setBoundingRect(OrgChart.Layout.Rect.op_Addition(this.getBoundingRect(),t.getBoundingRect()))},MergeFrom$1:function(t){t.getElement().DisableCollisionDetection||OrgChart.Layout.LayoutAlgorithm.IsZero(t.getState().Size.Height)||(this.m_spacerMerger.PrepareForHorizontalLayout(t),this.MergeFrom(this.m_spacerMerger))},ValidateState:function(){for(var t,e=1;e<this.Left.getCount();e=e+1|0)if(OrgChart.Layout.LayoutAlgorithm.IsEqual(this.Left.getItem(e).Top,this.Left.getItem(e).Bottom)||this.Left.getItem(e).Top<this.Left.getItem(e-1|0).Bottom||this.Left.getItem(e).Top<=this.Left.getItem(e-1|0).Top||this.Left.getItem(e).Bottom<=this.Left.getItem(e).Top||this.Left.getItem(e).Bottom<=this.Left.getItem(e-1|0).Bottom)throw new System.Exception("State error at Left index "+e);for(t=1;t<this.Right.getCount();t=t+1|0)if(OrgChart.Layout.LayoutAlgorithm.IsEqual(this.Right.getItem(t).Top,this.Right.getItem(t).Bottom)||this.Right.getItem(t).Top<this.Right.getItem(t-1|0).Bottom||this.Right.getItem(t).Top<=this.Right.getItem(t-1|0).Top||this.Right.getItem(t).Bottom<=this.Right.getItem(t).Top||this.Right.getItem(t).Bottom<=this.Right.getItem(t-1|0).Bottom)throw new System.Exception("State error at Right index "+t)},ComputeOverlap:function(t,e,n){for(var r,i,o,s,a=0,u=0,l=0;a<this.Right.getCount()&&u<t.Left.getCount();)r=this.Right.getItem(a),i=t.Left.getItem(u),r.Bottom<=i.Top?a=a+1|0:i.Bottom<=r.Top?u=u+1|0:(r.Node.getElement().DisableCollisionDetection||i.Node.getElement().DisableCollisionDetection||(o=r.Node.getElement().IsSpecial||i.Node.getElement().IsSpecial?0:r.Node.getElement().ParentId===i.Node.getElement().ParentId?e:n,(s=r.X+o-i.X)>l&&(l=s)),r.Bottom>=i.Bottom&&(u=u+1|0),i.Bottom>=r.Bottom&&(a=a+1|0));return l},ReloadFromBranch:function(t){for(var e,n,r,i,o,s=System.Double.max,a=System.Double.min,u=0;u<this.Left.getCount();u=u+1|0)n=(e=this.Left.getItem(u)).Node.getState().getLeft(),this.Left.setItem(u,e.ChangeX(n)),s=Math.min(s,n);for(r=0;r<this.Right.getCount();r=r+1|0)o=(i=this.Right.getItem(r)).Node.getState().getRight(),this.Right.setItem(r,i.ChangeX(o)),a=Math.max(a,o);s=Math.min(t.getState().getLeft(),s),a=Math.max(t.getState().getRight(),a),this.setBoundingRect(new OrgChart.Layout.Rect.$ctor1(new OrgChart.Layout.Point.$ctor1(s,this.getBoundingRect().getTop()),new OrgChart.Layout.Size.$ctor1(a-s,this.getBoundingRect().Size.Height)))}}),Bridge.define("OrgChart.Layout.Boundary.Step",{$kind:"struct",statics:{getDefaultValue:function(){return new OrgChart.Layout.Boundary.Step}},Node:null,X:0,Top:0,Bottom:0,$ctor1:function(t,e,n,r){this.$initialize(),this.Node=t,this.X=e,this.Top=n,this.Bottom=r},ctor:function(){this.$initialize()},ChangeTop:function(t){return new OrgChart.Layout.Boundary.Step.$ctor1(this.Node,this.X,t,this.Bottom)},ChangeBottom:function(t){return new OrgChart.Layout.Boundary.Step.$ctor1(this.Node,this.X,this.Top,t)},ChangeOwner:function(t,e){return new OrgChart.Layout.Boundary.Step.$ctor1(t,e,this.Top,this.Bottom)},ChangeX:function(t){return new OrgChart.Layout.Boundary.Step.$ctor1(this.Node,t,this.Top,this.Bottom)},getHashCode:function(){return Bridge.addHash([1885697107,this.Node,this.X,this.Top,this.Bottom])},equals:function(t){return!!Bridge.is(t,OrgChart.Layout.Boundary.Step)&&Bridge.equals(this.Node,t.Node)&&Bridge.equals(this.X,t.X)&&Bridge.equals(this.Top,t.Top)&&Bridge.equals(this.Bottom,t.Bottom)},$clone:function(t){var e=t||new OrgChart.Layout.Boundary.Step;return e.Node=this.Node,e.X=this.X,e.Top=this.Top,e.Bottom=this.Bottom,e}}),Bridge.define("OrgChart.Layout.BoundaryChangedEventArgs",{State:null,LayoutLevel:null,Boundary:null,ctor:function(t,e,n){this.$initialize(),this.Boundary=t,this.LayoutLevel=e,this.State=n}}),Bridge.define("OrgChart.Layout.Box",{statics:{None:-1,Special:function(t,e,n){return new OrgChart.Layout.Box.$ctor1(null,t,e,!0,n,!1)}},Id:0,ParentId:0,DataId:null,IsSpecial:!1,IsAssistant:!1,DisableCollisionDetection:!1,LayoutStrategyId:null,AssistantLayoutStrategyId:null,IsCollapsed:!1,config:{init:function(){this.Size=new OrgChart.Layout.Size}},ctor:function(t,e,n,r){OrgChart.Layout.Box.$ctor1.call(this,t,e,n,!1,!1,r)},$ctor1:function(t,e,n,r,i,o){if(this.$initialize(),0===e)throw new System.ArgumentOutOfRangeException("id");this.Id=e,this.ParentId=n,this.DataId=t,this.IsSpecial=r,this.IsAssistant=o,this.DisableCollisionDetection=i},getIsDataBound:function(){return!System.String.isNullOrEmpty(this.DataId)}}),Bridge.define("OrgChart.Layout.BoxContainer",{m_lastBoxId:0,m_boxesById:null,m_boxesByDataId:null,config:{properties:{SystemRoot:null},init:function(){this.m_boxesById=new(System.Collections.Generic.Dictionary$2(System.Int32,OrgChart.Layout.Box)),this.m_boxesByDataId=new(System.Collections.Generic.Dictionary$2(String,OrgChart.Layout.Box))}},ctor:function(){this.$initialize()},$ctor1:function(t){this.$initialize(),this.ReloadBoxes(t)},getBoxesById:function(){return this.m_boxesById},getBoxesByDataId:function(){return this.m_boxesByDataId},ReloadBoxes:function(t){var e,n,r,i,o;for(this.m_boxesByDataId.clear(),this.m_boxesById.clear(),this.m_lastBoxId=0,this.setSystemRoot(OrgChart.Layout.Box.Special(this.m_lastBoxId=this.m_lastBoxId+1|0,OrgChart.Layout.Box.None,!0)),this.m_boxesById.add(this.getSystemRoot().Id,this.getSystemRoot()),r=new(System.Collections.Generic.Dictionary$2(String,System.Int32)),e=Bridge.getEnumerator(t.OrgChart$Layout$IChartDataSource$getAllDataItemIds(),String);e.moveNext();)i=e.getCurrent(),r.add(i,this.NextBoxId());for(o=t.OrgChart$Layout$IChartDataSource$getGetDataItemFunc(),n=Bridge.getEnumerator(t.OrgChart$Layout$IChartDataSource$getAllDataItemIds(),String);n.moveNext();){var s=n.getCurrent(),a=System.String.isNullOrEmpty(s)?null:t.OrgChart$Layout$IChartDataSource$getGetParentKeyFunc()(s),u=System.String.isNullOrEmpty(a)?this.getSystemRoot().Id:r.get(a);this.AddBox$1(s,r.get(s),u,o(s).OrgChart$Layout$IChartDataItem$getIsAssistant())}},AddBox:function(t,e,n){return this.AddBox$1(t,this.NextBoxId(),e,n)},AddBox$1:function(t,e,n,r){var i=new OrgChart.Layout.Box.ctor(t,e,n,r);return this.m_boxesById.add(i.Id,i),System.String.isNullOrEmpty(t)||this.m_boxesByDataId.add(i.DataId,i),i},NextBoxId:function(){return this.m_lastBoxId=this.m_lastBoxId+1|0,this.m_lastBoxId}}),Bridge.define("OrgChart.Layout.BoxTree",{statics:{Build:function(t){for(var e,n,r,i=new OrgChart.Layout.BoxTree,o=Bridge.getEnumerator(t.getDiagram().getBoxes().getBoxesById().System$Collections$Generic$IDictionary$2$System$Int32$OrgChart$Layout$Box$getValues(),OrgChart.Layout.Box);o.moveNext();)n=o.getCurrent(),r=new OrgChart.Layout.BoxTree.Node(n),i.getNodes().add(n.Id,r);for(e=Bridge.getEnumerator(i.getNodes().getValues(),OrgChart.Layout.BoxTree.Node);e.moveNext();){var s=e.getCurrent(),a=s.getElement().ParentId,u={};if(i.getNodes().tryGetValue(a,u))s.getElement().IsAssistant&&u.v.getElement().ParentId!==OrgChart.Layout.Box.None?u.v.AddAssistantChild(s):u.v.AddRegularChild$1(s);else{if(null!=i.getRoot())throw new System.InvalidOperationException("More then one root found: "+s.getElement().Id);i.setRoot(s)}}return i}},config:{properties:{Root:null,Nodes:null,Depth:0}},ctor:function(){this.$initialize(),this.setNodes(new(System.Collections.Generic.Dictionary$2(System.Int32,OrgChart.Layout.BoxTree.Node)))},IterateChildFirst:function(t){return this.getRoot().IterateChildFirst(t)},IterateParentFirst:function(t,e){void 0===e&&(e=null),this.getRoot().IterateParentFirst(t,e)},UpdateHierarchyStats:function(){this.setDepth(0),this.IterateParentFirst(Bridge.fn.bind(this,t.$.OrgChart.Layout.BoxTree.f1))}}),Bridge.ns("OrgChart.Layout.BoxTree",t.$),Bridge.apply(t.$.OrgChart.Layout.BoxTree,{f1:function(t){return null!=t.getParentNode()?(t.setLevel(t.getParentNode().getLevel()),t.getParentNode().getIsAssistantRoot()||t.setLevel(t.getLevel()+1|0),this.setDepth(Math.max(1+t.getLevel()|0,this.getDepth()))):(t.setLevel(0),this.setDepth(1)),!0}}),Bridge.define("OrgChart.Layout.BoxTree.Node",{config:{properties:{Level:0,Element:null,State:null,ParentNode:null,Children:null,AssistantsRoot:null}},ctor:function(t){this.$initialize(),this.setElement(t),this.setState(new OrgChart.Layout.NodeLayoutInfo)},getChildCount:function(){return null==this.getChildren()?0:System.Array.getCount(this.getChildren(),OrgChart.Layout.BoxTree.Node)},getIsAssistantRoot:function(){var t;return Bridge.referenceEquals(null!=(t=this.getParentNode())?t.getAssistantsRoot():null,this)},AddAssistantChild:function(t){return null==this.getAssistantsRoot()&&this.setAssistantsRoot(Bridge.merge(new OrgChart.Layout.BoxTree.Node(OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,this.getElement().Id,!0)),{setParentNode:this,setLevel:this.getLevel()+1|0})),this.getAssistantsRoot().AddRegularChild$1(t),this},AddRegularChild$1:function(t){return this.InsertRegularChild$1(this.getChildCount(),t)},AddRegularChild:function(t){return this.InsertRegularChild(this.getChildCount(),t)},InsertRegularChild:function(t,e){return this.InsertRegularChild$1(t,new OrgChart.Layout.BoxTree.Node(e))},InsertRegularChild$1:function(t,e){return null==this.getChildren()&&this.setChildren(new(System.Collections.Generic.List$1(OrgChart.Layout.BoxTree.Node))),System.Array.insert(this.getChildren(),t,e,OrgChart.Layout.BoxTree.Node),e.setParentNode(this),e.setLevel(this.getLevel()+1|0),this},IterateChildFirst:function(t){var e;if(null!=this.getAssistantsRoot()&&!this.getAssistantsRoot().IterateChildFirst(t))return!1;if(null!=this.getChildren())for(e=Bridge.getEnumerator(this.getChildren(),OrgChart.Layout.BoxTree.Node);e.moveNext();)if(!e.getCurrent().IterateChildFirst(t))return!1;return t(this)},IterateParentFirst:function(t,e){var n,r;if(void 0===e&&(e=null),!t(this))return Bridge.staticEquals(e,null)||e(this),!1;if(null!=(n=this.getAssistantsRoot())&&n.IterateParentFirst(t,e),null!=this.getChildren())for(r=Bridge.getEnumerator(this.getChildren(),OrgChart.Layout.BoxTree.Node);r.moveNext();)r.getCurrent().IterateParentFirst(t,e);return Bridge.staticEquals(e,null)||e(this),!0},SuppressAssistants:function(){var t,e;if(null!=this.getAssistantsRoot()){for(t=Bridge.getEnumerator(this.getAssistantsRoot().getChildren(),OrgChart.Layout.BoxTree.Node);t.moveNext();)e=t.getCurrent(),this.AddRegularChild$1(e);this.setAssistantsRoot(null)}}}),Bridge.define("OrgChart.Layout.BranchParentAlignment",{$kind:"enum",statics:{InvalidValue:0,Left:1,Center:2,Right:3}}),Bridge.define("OrgChart.Layout.Connector",{config:{properties:{Segments:null}},ctor:function(t){if(this.$initialize(),0===t.length)throw new System.ArgumentException("Need at least one segment","segments");this.setSegments(t)}}),Bridge.define("OrgChart.Layout.Diagram",{m_visualTree:null,m_boxes:null,config:{properties:{LayoutSettings:null}},ctor:function(){this.$initialize(),this.setLayoutSettings(new OrgChart.Layout.DiagramLayoutSettings)},getBoxes:function(){return this.m_boxes},setBoxes:function(t){this.m_visualTree=null,this.m_boxes=t},getVisualTree:function(){return this.m_visualTree},setVisualTree:function(t){this.m_visualTree=t}}),Bridge.define("OrgChart.Layout.DiagramLayoutSettings",{m_branchSpacing:0,config:{properties:{LayoutStrategies:null,DefaultAssistantLayoutStrategyId:null,DefaultLayoutStrategyId:null}},ctor:function(){this.$initialize(),this.setBranchSpacing(50),this.setLayoutStrategies(new(System.Collections.Generic.Dictionary$2(String,OrgChart.Layout.LayoutStrategyBase)))},getBranchSpacing:function(){return this.m_branchSpacing},setBranchSpacing:function(t){if(t<0)throw new System.ArgumentOutOfRangeException("value","Cannot be negative",null,t);this.m_branchSpacing=t},RequireDefaultLayoutStrategy:function(){var t={};if(System.String.isNullOrEmpty(this.getDefaultLayoutStrategyId())||!this.getLayoutStrategies().tryGetValue(this.getDefaultLayoutStrategyId(),t))throw new System.InvalidOperationException("defaultLayoutStrategyId is null or not valid");return t.v},RequireDefaultAssistantLayoutStrategy:function(){var t={};if(System.String.isNullOrEmpty(this.getDefaultAssistantLayoutStrategyId())||!this.getLayoutStrategies().tryGetValue(this.getDefaultAssistantLayoutStrategyId(),t))throw new System.InvalidOperationException("defaultAssistantLayoutStrategyId is null or not valid");return t.v}}),Bridge.define("OrgChart.Layout.DiagramLayoutTemplates"),Bridge.define("OrgChart.Layout.Dimensions",{$kind:"struct",statics:{MinMax:function(){return new OrgChart.Layout.Dimensions.$ctor1(System.Double.max,System.Double.min)},op_Addition:function(t,e){return new OrgChart.Layout.Dimensions.$ctor1(Math.min(t.From,e.From),Math.max(t.To,e.To))},getDefaultValue:function(){return new OrgChart.Layout.Dimensions}},From:0,To:0,$ctor1:function(t,e){this.$initialize(),this.From=t,this.To=e},ctor:function(){this.$initialize()},getHashCode:function(){return Bridge.addHash([3570880544,this.From,this.To])},equals:function(t){return!!Bridge.is(t,OrgChart.Layout.Dimensions)&&Bridge.equals(this.From,t.From)&&Bridge.equals(this.To,t.To)},$clone:function(t){var e=t||new OrgChart.Layout.Dimensions;return e.From=this.From,e.To=this.To,e}}),Bridge.define("OrgChart.Layout.Edge",{$kind:"struct",statics:{getDefaultValue:function(){return new OrgChart.Layout.Edge}},config:{init:function(){this.From=new OrgChart.Layout.Point,this.To=new OrgChart.Layout.Point}},$ctor1:function(t,e){this.$initialize(),this.From=t,this.To=e},ctor:function(){this.$initialize()},getHashCode:function(){return Bridge.addHash([1701274693,this.From,this.To])},equals:function(t){return!!Bridge.is(t,OrgChart.Layout.Edge)&&Bridge.equals(this.From,t.From)&&Bridge.equals(this.To,t.To)},$clone:function(t){var e=t||new OrgChart.Layout.Edge;return e.From=this.From,e.To=this.To,e}}),Bridge.define("OrgChart.Layout.LayoutStrategyBase",{ParentAlignment:0,ParentChildSpacing:20,ParentConnectorShield:50,SiblingSpacing:20,ChildConnectorHookLength:5}),Bridge.define("OrgChart.Layout.Frame1",{Connector:null,config:{init:function(){this.Exterior=new OrgChart.Layout.Rect,this.BranchExterior=new OrgChart.Layout.Rect,this.SiblingsRowV=new OrgChart.Layout.Dimensions}}}),Bridge.define("OrgChart.Layout.IChartDataItem",{$kind:"interface"}),Bridge.define("OrgChart.Layout.IChartDataSource",{$kind:"interface"}),Bridge.define("OrgChart.Layout.LayoutAlgorithm",{statics:{ComputeBranchVisualBoundingRect:function(t){var e=new OrgChart.Layout.Rect.ctor,n=!1;return t.getRoot().IterateParentFirst((function(t){var r=t.getElement();return t.getState().IsHidden||r.IsSpecial||(n?e=OrgChart.Layout.Rect.op_Addition(e,new OrgChart.Layout.Rect.$ctor1(t.getState().TopLeft,t.getState().Size)):(n=!0,e=new OrgChart.Layout.Rect.$ctor1(t.getState().TopLeft,t.getState().Size))),!r.IsCollapsed})),e},Apply:function(e){var n,r,i,o,s;if(null==e.getDiagram().getBoxes().getSystemRoot())throw new System.InvalidOperationException("SystemRoot is not initialized on the box container");if(e.setCurrentOperation(OrgChart.Layout.LayoutState.Operation.Preparing),i=OrgChart.Layout.BoxTree.Build(e),e.getDiagram().setVisualTree(i),null==i.getRoot()||i.getRoot().getElement().Id!==e.getDiagram().getBoxes().getSystemRoot().Id)throw new System.Exception("SystemRoot is not on the top of the visual tree");if(i.UpdateHierarchyStats(),e.AttachVisualTree(i),i.IterateParentFirst(t.$.OrgChart.Layout.LayoutAlgorithm.f1),e.setCurrentOperation(OrgChart.Layout.LayoutState.Operation.PreprocessVisualTree),!Bridge.staticEquals(e.getBoxSizeFunc(),null))for(n=Bridge.getEnumerator(System.Linq.Enumerable.from(e.getDiagram().getBoxes().getBoxesById().System$Collections$Generic$IDictionary$2$System$Int32$OrgChart$Layout$Box$getValues()).where(t.$.OrgChart.Layout.LayoutAlgorithm.f2));n.moveNext();)(o=n.getCurrent()).Size=e.getBoxSizeFunc()(o.DataId);for(r=Bridge.getEnumerator(e.getDiagram().getBoxes().getBoxesById().System$Collections$Generic$IDictionary$2$System$Int32$OrgChart$Layout$Box$getValues(),OrgChart.Layout.Box);r.moveNext();)s=r.getCurrent(),OrgChart.Layout.LayoutAlgorithm.AssertBoxSize(s);i.IterateParentFirst(t.$.OrgChart.Layout.LayoutAlgorithm.f3),OrgChart.Layout.LayoutAlgorithm.PreprocessVisualTree(e,i),i.UpdateHierarchyStats(),e.setCurrentOperation(OrgChart.Layout.LayoutState.Operation.VerticalLayout),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(e,i.getRoot()),e.setCurrentOperation(OrgChart.Layout.LayoutState.Operation.HorizontalLayout),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(e,i.getRoot()),e.setCurrentOperation(OrgChart.Layout.LayoutState.Operation.ConnectorsLayout),OrgChart.Layout.LayoutAlgorithm.RouteConnectors(e,i),e.setCurrentOperation(OrgChart.Layout.LayoutState.Operation.Completed)},AssertBoxSize:function(t){if(!(t.Size.Width>=0&&t.Size.Width<=1e9&&t.Size.Height>=0&&t.Size.Width<=1e9))throw new System.InvalidOperationException(System.String.format("Box {0} has invalid size: {1}x{2}",t.Id,t.Size.Width,t.Size.Height))},PreprocessVisualTree:function(t,e){var n,r=t.getDiagram().getLayoutSettings().RequireDefaultLayoutStrategy(),i=t.getDiagram().getLayoutSettings().RequireDefaultAssistantLayoutStrategy(),o=new(System.Collections.Generic.Stack$1(OrgChart.Layout.LayoutStrategyBase).ctor);o.push(r),(n=new(System.Collections.Generic.Stack$1(OrgChart.Layout.LayoutStrategyBase).ctor)).push(i),e.IterateParentFirst((function(e){var r,i;return!e.getState().IsHidden&&(r=null,Bridge.staticEquals(t.getLayoutOptimizerFunc(),null)||(i=t.getLayoutOptimizerFunc()(e),System.String.isNullOrEmpty(i)||(r=t.getDiagram().getLayoutSettings().getLayoutStrategies().get(i))),e.getIsAssistantRoot()?(null==r&&(r=null!=e.getParentNode().getElement().AssistantLayoutStrategyId?t.getDiagram().getLayoutSettings().getLayoutStrategies().get(e.getParentNode().getElement().AssistantLayoutStrategyId):n.peek()),n.push(r)):(null==r&&(r=null!=e.getElement().LayoutStrategyId?t.getDiagram().getLayoutSettings().getLayoutStrategies().get(e.getElement().LayoutStrategyId):o.peek()),o.push(r),r.getSupportsAssistants()||e.SuppressAssistants()),e.getState().setEffectiveLayoutStrategy(r),e.getState().RequireLayoutStrategy().PreProcessThisNode(t,e),!e.getElement().IsCollapsed&&e.getChildCount()>0||null!=e.getAssistantsRoot())}),(function(t){t.getState().IsHidden||(t.getIsAssistantRoot()?n.pop():o.pop())}))},HorizontalLayout:function(t,e){if(e.getState().IsHidden)throw new System.InvalidOperationException(System.String.format("Branch root {0} does not affect layout",e.getElement().Id));var n=t.PushLayoutLevel(e);try{(0===e.getLevel()||(e.getState().NumberOfSiblings>0||null!=e.getAssistantsRoot())&&!e.getElement().IsCollapsed)&&e.getState().RequireLayoutStrategy().ApplyHorizontalLayout(t,n)}finally{t.PopLayoutLevel()}},VerticalLayout:function(t,e){if(e.getState().IsHidden)throw new System.InvalidOperationException(System.String.format("Branch root {0} does not affect layout",e.getElement().Id));var n=t.PushLayoutLevel(e);try{(0===e.getLevel()||(e.getState().NumberOfSiblings>0||null!=e.getAssistantsRoot())&&!e.getElement().IsCollapsed)&&e.getState().RequireLayoutStrategy().ApplyVerticalLayout(t,n)}finally{t.PopLayoutLevel()}},RouteConnectors:function(t,e){e.IterateParentFirst((function(e){return!(e.getElement().IsCollapsed||0===e.getState().NumberOfSiblings&&null==e.getAssistantsRoot()||0!==e.getLevel()&&(e.getElement().IsSpecial&&!e.getIsAssistantRoot()||(e.getState().RequireLayoutStrategy().RouteConnectors(t,e),0)))}))},MoveChildrenOnly:function(t,e,n){var r,i,o=e.BranchRoot.getChildren();if(null==o||0===System.Array.getCount(o,OrgChart.Layout.BoxTree.Node))throw new System.InvalidOperationException("Should never be invoked when children not set");for(i=function(t){return t.getState().IsHidden||(t.getState().TopLeft=t.getState().TopLeft.MoveH(n),t.getState().BranchExterior=t.getState().BranchExterior.MoveH(n)),!0},r=Bridge.getEnumerator(o,OrgChart.Layout.BoxTree.Node);r.moveNext();)r.getCurrent().IterateChildFirst(i);e.Boundary.ReloadFromBranch(e.BranchRoot),e.BranchRoot.getState().BranchExterior=e.Boundary.getBoundingRect()},MoveOneChild:function(t,e,n){e.IterateChildFirst((function(t){return t.getState().IsHidden||(t.getState().TopLeft=t.getState().TopLeft.MoveH(n),t.getState().BranchExterior=t.getState().BranchExterior.MoveH(n)),!0}))},MoveBranch:function(t,e,n){OrgChart.Layout.LayoutAlgorithm.MoveOneChild(t,e.BranchRoot,n),e.Boundary.ReloadFromBranch(e.BranchRoot),e.BranchRoot.getState().BranchExterior=e.Boundary.getBoundingRect()},AlignHorizontalCenters:function(t,e,n){for(var r,i,o,s,a,u=System.Double.min,l=Bridge.getEnumerator(n,OrgChart.Layout.BoxTree.Node);l.moveNext();)(i=l.getCurrent().getState().getCenterH())>u&&(u=i);for(o=System.Double.max,s=System.Double.min,r=Bridge.getEnumerator(n,OrgChart.Layout.BoxTree.Node);r.moveNext();){var c=r.getCurrent(),g=c.getState().getCenterH();OrgChart.Layout.LayoutAlgorithm.IsEqual(g,u)||(a=u-g,OrgChart.Layout.LayoutAlgorithm.MoveOneChild(t,c,a)),o=Math.min(o,c.getState().BranchExterior.getLeft()),s=Math.max(s,c.getState().BranchExterior.getRight())}return e.Boundary.ReloadFromBranch(e.BranchRoot),new OrgChart.Layout.Dimensions.$ctor1(o,s)},CopyExteriorFrom:function(t,e){t.TopLeft=e.TopLeft,t.Size=e.Size,t.BranchExterior=e.BranchExterior,t.SiblingsRowV=e.SiblingsRowV},IsMinValue:function(t){return t<=System.Double.min+5e-324},IsMaxValue:function(t){return t>=System.Double.max-5e-324},IsZero:function(t){return t<=5e-324&&t>=-5e-324},IsEqual:function(t,e){return Math.abs(t-e)<=5e-324},MoveTo:function(t,e,n){t.TopLeft=new OrgChart.Layout.Point.$ctor1(e,n)},AdjustSpacer:function(t,e,n,r,i){t.TopLeft=new OrgChart.Layout.Point.$ctor1(e,n),t.Size=new OrgChart.Layout.Size.$ctor1(r,i),t.BranchExterior=new OrgChart.Layout.Rect.$ctor3(e,n,r,i)}}}),Bridge.ns("OrgChart.Layout.LayoutAlgorithm",t.$),Bridge.apply(t.$.OrgChart.Layout.LayoutAlgorithm,{f1:function(t){return t.getState().IsHidden=null!=t.getParentNode()&&(t.getParentNode().getState().IsHidden||t.getParentNode().getElement().IsCollapsed),!0},f2:function(t){return t.getIsDataBound()},f3:function(t){return OrgChart.Layout.LayoutAlgorithm.MoveTo(t.getState(),0,0),t.getState().Size=t.getElement().Size,t.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(new OrgChart.Layout.Point.$ctor1(0,0),t.getElement().Size),!0}}),Bridge.define("OrgChart.Layout.LayoutState",{m_layoutStack:null,m_pooledBoundaries:null,m_currentOperation:0,config:{events:{BoundaryChanged:null,OperationChanged:null},properties:{Diagram:null,BoxSizeFunc:null,LayoutOptimizerFunc:null},init:function(){this.m_layoutStack=new(System.Collections.Generic.Stack$1(OrgChart.Layout.LayoutState.LayoutLevel).ctor),this.m_pooledBoundaries=new(System.Collections.Generic.Stack$1(OrgChart.Layout.Boundary).ctor)}},ctor:function(t){this.$initialize(),this.setDiagram(t)},getCurrentOperation:function(){return this.m_currentOperation},setCurrentOperation:function(t){this.m_currentOperation=t,!Bridge.staticEquals(this.OperationChanged,null)&&this.OperationChanged(this,new OrgChart.Layout.LayoutStateOperationChangedEventArgs(this))},AttachVisualTree:function(t){for(;this.m_pooledBoundaries.getCount()<t.getDepth();)this.m_pooledBoundaries.push(new OrgChart.Layout.Boundary.ctor)},PushLayoutLevel:function(t){var e,n;switch(0===this.m_pooledBoundaries.getCount()&&this.m_pooledBoundaries.push(new OrgChart.Layout.Boundary.ctor),e=this.m_pooledBoundaries.pop(),this.getCurrentOperation()){case OrgChart.Layout.LayoutState.Operation.VerticalLayout:e.Prepare(t);break;case OrgChart.Layout.LayoutState.Operation.HorizontalLayout:e.PrepareForHorizontalLayout(t);break;default:throw new System.InvalidOperationException("This operation can only be invoked when performing vertical or horizontal layouts")}return n=new OrgChart.Layout.LayoutState.LayoutLevel(t,e),this.m_layoutStack.push(n),Bridge.staticEquals(this.BoundaryChanged,null)||this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(e,n,this)),n},MergeSpacer:function(t){if(this.getCurrentOperation()!==OrgChart.Layout.LayoutState.Operation.HorizontalLayout)throw new System.InvalidOperationException("Spacers can only be merged during horizontal layout");if(0===this.m_layoutStack.getCount())throw new System.InvalidOperationException("Cannot merge spacers at top nesting level");var e=this.m_layoutStack.peek();e.Boundary.MergeFrom$1(t),!Bridge.staticEquals(this.BoundaryChanged,null)&&this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(e.Boundary,e,this))},PopLayoutLevel:function(){var t,e,n,r=this.m_layoutStack.pop();if(Bridge.staticEquals(this.BoundaryChanged,null)||this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(r.Boundary,r,this)),this.m_layoutStack.getCount()>0){switch(t=this.m_layoutStack.peek(),this.getCurrentOperation()){case OrgChart.Layout.LayoutState.Operation.VerticalLayout:t.Boundary.VerticalMergeFrom(r.Boundary),t.BranchRoot.getState().BranchExterior=t.Boundary.getBoundingRect();break;case OrgChart.Layout.LayoutState.Operation.HorizontalLayout:Bridge.referenceEquals(t.BranchRoot.getAssistantsRoot(),r.BranchRoot)||(e=t.BranchRoot.getState().RequireLayoutStrategy(),(n=t.Boundary.ComputeOverlap(r.Boundary,e.SiblingSpacing,this.getDiagram().getLayoutSettings().getBranchSpacing()))>0&&(OrgChart.Layout.LayoutAlgorithm.MoveBranch(this,r,n),!Bridge.staticEquals(this.BoundaryChanged,null)&&this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(r.Boundary,r,this)))),t.Boundary.MergeFrom(r.Boundary),t.BranchRoot.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor3(t.Boundary.getBoundingRect().getLeft(),t.BranchRoot.getState().BranchExterior.getTop(),t.Boundary.getBoundingRect().Size.Width,t.BranchRoot.getState().BranchExterior.Size.Height);break;default:throw new System.InvalidOperationException("This operation can only be invoked when performing vertical or horizontal layouts")}!Bridge.staticEquals(this.BoundaryChanged,null)&&this.BoundaryChanged(this,new OrgChart.Layout.BoundaryChangedEventArgs(t.Boundary,t,this))}this.m_pooledBoundaries.push(r.Boundary)}}),Bridge.define("OrgChart.Layout.LayoutState.LayoutLevel",{BranchRoot:null,Boundary:null,ctor:function(t,e){this.$initialize(),this.BranchRoot=t,this.Boundary=e}}),Bridge.define("OrgChart.Layout.LayoutState.Operation",{$kind:"enum",statics:{Idle:0,Preparing:1,PreprocessVisualTree:2,VerticalLayout:3,HorizontalLayout:4,ConnectorsLayout:5,Completed:6}}),Bridge.define("OrgChart.Layout.LayoutStateOperationChangedEventArgs",{State:null,ctor:function(t){this.$initialize(),this.State=t}}),Bridge.define("OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.GroupIterator",{m_numberOfSiblings:0,m_numberOfGroups:0,Group:0,FromIndex:0,Count:0,MaxOnLeft:0,ctor:function(t,e){this.$initialize(),this.m_numberOfSiblings=t,this.m_numberOfGroups=e},CountInGroup:function(){for(var t,e=2*this.m_numberOfGroups|0,n=0,r=2+(2*this.Group|0)|0,i=0;;){if(!((t=i>=(this.m_numberOfSiblings-e|0)?this.m_numberOfSiblings-i|0:e)>=r)){t>=(r=r-1|0)&&(n=n+1|0);break}n=n+2|0,i=i+e|0}return n},NextGroup:function(){return this.FromIndex=this.FromIndex+this.Count|0,this.FromIndex>0&&(this.Group=this.Group+1|0),this.Count=this.CountInGroup(),this.MaxOnLeft=(0|Bridge.Int.div(this.Count,2))+this.Count%2|0,0!==this.Count}}),Bridge.define("OrgChart.Layout.NodeLayoutInfo",{IsHidden:!1,NumberOfSiblings:0,NumberOfSiblingRows:0,NumberOfSiblingColumns:0,Connector:null,m_effectiveLayoutStrategy:null,config:{init:function(){this.TopLeft=new OrgChart.Layout.Point,this.Size=new OrgChart.Layout.Size,this.BranchExterior=new OrgChart.Layout.Rect,this.SiblingsRowV=new OrgChart.Layout.Dimensions}},setEffectiveLayoutStrategy:function(t){this.m_effectiveLayoutStrategy=t},getLeft:function(){return this.TopLeft.X},getRight:function(){return this.TopLeft.X+this.Size.Width},getTop:function(){return this.TopLeft.Y},getBottom:function(){return this.TopLeft.Y+this.Size.Height},getCenterH:function(){return this.TopLeft.X+this.Size.Width/2},getCenterV:function(){return this.TopLeft.Y+this.Size.Height/2},RequireLayoutStrategy:function(){if(null==this.m_effectiveLayoutStrategy)throw new System.Exception("effectiveLayoutStrategy is not set");return this.m_effectiveLayoutStrategy}}),Bridge.define("OrgChart.Layout.Point",{$kind:"struct",statics:{getDefaultValue:function(){return new OrgChart.Layout.Point}},X:0,Y:0,$ctor1:function(t,e){this.$initialize(),this.X=t,this.Y=e},ctor:function(){this.$initialize()},MoveH:function(t){return new OrgChart.Layout.Point.$ctor1(this.X+t,this.Y)},getHashCode:function(){return Bridge.addHash([1852403652,this.X,this.Y])},equals:function(t){return!!Bridge.is(t,OrgChart.Layout.Point)&&Bridge.equals(this.X,t.X)&&Bridge.equals(this.Y,t.Y)},$clone:function(t){var e=t||new OrgChart.Layout.Point;return e.X=this.X,e.Y=this.Y,e}}),Bridge.define("OrgChart.Layout.Rect",{$kind:"struct",statics:{op_Addition:function(t,e){var n=Math.min(t.getLeft(),e.getLeft()),r=Math.min(t.getTop(),e.getTop()),i=Math.max(t.getRight(),e.getRight()),o=Math.max(t.getBottom(),e.getBottom());return new OrgChart.Layout.Rect.$ctor3(n,r,i-n,o-r)},getDefaultValue:function(){return new OrgChart.Layout.Rect}},config:{init:function(){this.TopLeft=new OrgChart.Layout.Point,this.Size=new OrgChart.Layout.Size}},$ctor3:function(t,e,n,r){if(this.$initialize(),n<0)throw new System.ArgumentOutOfRangeException("w");if(r<0)throw new System.ArgumentOutOfRangeException("h");this.TopLeft=new OrgChart.Layout.Point.$ctor1(t,e),this.Size=new OrgChart.Layout.Size.$ctor1(n,r)},$ctor1:function(t,e){this.$initialize(),this.TopLeft=t,this.Size=e},$ctor2:function(t){this.$initialize(),this.TopLeft=new OrgChart.Layout.Point.$ctor1(0,0),this.Size=t},ctor:function(){this.$initialize()},getBottomRight:function(){return new OrgChart.Layout.Point.$ctor1(this.TopLeft.X+this.Size.Width,this.TopLeft.Y+this.Size.Height)},getLeft:function(){return this.TopLeft.X},getRight:function(){return this.TopLeft.X+this.Size.Width},getCenterH:function(){return this.TopLeft.X+this.Size.Width/2},getCenterV:function(){return this.TopLeft.Y+this.Size.Height/2},getTop:function(){return this.TopLeft.Y},getBottom:function(){return this.TopLeft.Y+this.Size.Height},MoveH:function(t){return new OrgChart.Layout.Rect.$ctor1(new OrgChart.Layout.Point.$ctor1(this.getLeft()+t,this.getTop()),this.Size)},getHashCode:function(){return Bridge.addHash([1952671058,this.TopLeft,this.Size])},equals:function(t){return!!Bridge.is(t,OrgChart.Layout.Rect)&&Bridge.equals(this.TopLeft,t.TopLeft)&&Bridge.equals(this.Size,t.Size)},$clone:function(t){var e=t||new OrgChart.Layout.Rect;return e.TopLeft=this.TopLeft,e.Size=this.Size,e}}),Bridge.define("OrgChart.Layout.Size",{$kind:"struct",statics:{getDefaultValue:function(){return new OrgChart.Layout.Size}},Width:0,Height:0,$ctor1:function(t,e){this.$initialize(),this.Width=t,this.Height=e},ctor:function(){this.$initialize()},getHashCode:function(){return Bridge.addHash([1702521171,this.Width,this.Height])},equals:function(t){return!!Bridge.is(t,OrgChart.Layout.Size)&&Bridge.equals(this.Width,t.Width)&&Bridge.equals(this.Height,t.Height)},$clone:function(t){var e=t||new OrgChart.Layout.Size;return e.Width=this.Width,e.Height=this.Height,e}}),Bridge.define("OrgChart.Layout.StackOrientation",{$kind:"enum",statics:{InvalidValue:0,SingleRowHorizontal:1,SingleColumnVertical:2}}),Bridge.define("OrgChart.Test.TestDataGen",{statics:{GenerateBoxSizes:function(t){var e,n,r;for(System.Diagnostics.Debug.writeln((0).toString()),n=new System.Random.$ctor1(0),e=Bridge.getEnumerator(t.getBoxesById().System$Collections$Generic$IDictionary$2$System$Int32$OrgChart$Layout$Box$getValues(),OrgChart.Layout.Box);e.moveNext();)(r=e.getCurrent()).IsSpecial||(r.Size=new OrgChart.Layout.Size.$ctor1(50+n.next$1(50)|0,50+n.next$1(50)|0))}},GenerateDataItems:function(t,e,n){for(var r,i=Bridge.getEnumerator(this.GenerateRandomDataItems(e,n));i.moveNext();)r=i.getCurrent(),t.Items.add(r.getId(),r)},GenerateRandomDataItems:function(t,e){var n,r,i,o,s,a,u,l,c,g,h;if(t<0)throw new System.ArgumentOutOfRangeException("itemCount","Count must be zero or positive",null,t);for(n=new System.Random.$ctor1(0),r=new(System.Collections.Generic.List$1(OrgChart.Test.TestDataItem))(t),i=0;i<t;i=i+1|0)r.add(Bridge.merge(new OrgChart.Test.TestDataItem,{setId:i.toString()}));for(o=1,s=1;o<t;){for(a=(15+s|0)+n.next$1(2*s|0)|0,u=o;u<(o+a|0)&&u<t;u=u+1|0)l=(o-1|0)-n.next$1(s)|0,r.getItem(u).setParentId(r.getItem(l).getId());o=o+a|0,s=a}for(c=0;c<(0|Bridge.Int.div(r.getCount(),2));c=c+1|0){var m=n.next$1(r.getCount()),f=n.next$1(r.getCount()),d=r.getItem(m);r.setItem(m,r.getItem(f)),r.setItem(f,d)}if(e>0)for(g=Math.min(r.getCount(),Bridge.Int.clip32(Math.ceil((r.getCount()*e|0)/100))),h=0;h<g;h=h+1|0)r.getItem(n.next$1(r.getCount())).setIsAssistant(!0);return r}}),Bridge.define("System.Diagnostics.DebuggerDisplayAttribute",{inherits:[System.Attribute],ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}),Bridge.define("OrgChart.Layout.FishboneAssistantsLayoutStrategy",{inherits:[OrgChart.Layout.LayoutStrategyBase],getSupportsAssistants:function(){return!1},PreProcessThisNode:function(t,e){if(e.getState().NumberOfSiblings=e.getChildCount(),e.getState().NumberOfSiblings>0){e.getState().NumberOfSiblingColumns=1,e.getState().NumberOfSiblingRows=0|Bridge.Int.div(e.getState().NumberOfSiblings,2),e.getState().NumberOfSiblings%2!=0&&(e.getState().NumberOfSiblingRows=e.getState().NumberOfSiblingRows+1|0);var n=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1);e.AddRegularChild(n)}},ApplyVerticalLayout:function(t,e){var n,r,i,o,s,a,u,l=e.BranchRoot;if(0===l.getLevel())throw new System.InvalidOperationException("Should never be invoked on root node");for(n=l.getState().SiblingsRowV.To,r=this.MaxOnLeft(l),i=0;i<r;i=i+1|0){var c=0===i?this.ParentChildSpacing:this.SiblingSpacing,g=System.Array.getItem(l.getChildren(),i,OrgChart.Layout.BoxTree.Node),h=g.getState();OrgChart.Layout.LayoutAlgorithm.MoveTo(h,h.getLeft(),n+c),o=new OrgChart.Layout.Dimensions.$ctor1(h.getTop(),h.getBottom()),(s=i+r|0)<l.getState().NumberOfSiblings&&(u=(a=System.Array.getItem(l.getChildren(),s,OrgChart.Layout.BoxTree.Node)).getState(),OrgChart.Layout.LayoutAlgorithm.MoveTo(u,u.getLeft(),n+c),u.getBottom()>h.getBottom()?OrgChart.Layout.LayoutAlgorithm.MoveTo(h,h.getLeft(),u.getCenterV()-h.Size.Height/2):u.getBottom()<h.getBottom()&&OrgChart.Layout.LayoutAlgorithm.MoveTo(u,u.getLeft(),h.getCenterV()-u.Size.Height/2),u.BranchExterior=new OrgChart.Layout.Rect.$ctor1(u.TopLeft,u.Size),o=OrgChart.Layout.Dimensions.op_Addition(o,new OrgChart.Layout.Dimensions.$ctor1(u.getTop(),u.getBottom())),u.SiblingsRowV=o,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,a),n=u.BranchExterior.getBottom()),h.BranchExterior=new OrgChart.Layout.Rect.$ctor1(h.TopLeft,h.Size),h.SiblingsRowV=o,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,g),n=Math.max(n,h.BranchExterior.getBottom())}},ApplyHorizontalLayout:function(t,e){var n,r,i,o,s,a,u,l,c=e.BranchRoot;0===c.getLevel()&&(c.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(c.getState().getTop(),c.getState().getBottom()));var g=!0,h=0,m=this.MaxOnLeft(c);for(n=0;n<c.getState().NumberOfSiblings;n=n+1|0)if(r=System.Array.getItem(c.getChildren(),n,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,r),(h=h+1|0)===m&&g){for(OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,this.EnumerateSiblings(c,0,m)),g=!1,h=0,i=System.Double.min,o=0;o<=n;o=o+1|0)i=Math.max(i,System.Array.getItem(c.getChildren(),o,OrgChart.Layout.BoxTree.Node).getState().BranchExterior.getRight());i=c.getState().NumberOfSiblings%2!=0||(s=System.Array.getItem(c.getChildren(),c.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node)).getElement().IsCollapsed||0===s.getChildCount()?Math.max(i,r.getState().getRight()):Math.max(i,r.getState().BranchExterior.getRight()),a=System.Array.getItem(c.getChildren(),c.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(a.getState(),i,c.getState().getBottom(),this.ParentConnectorShield,c.getState().BranchExterior.getBottom()-c.getState().getBottom()),e.Boundary.MergeFrom$1(a)}OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,this.EnumerateSiblings(c,m,c.getState().NumberOfSiblings)),c.getLevel()>0&&c.getState().NumberOfSiblings>0&&(l=System.Array.getItem(c.getChildren(),c.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),u=c.getState().getCenterH()-l,OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,u))},RouteConnectors:function(t,e){var n,r,i,o=e.getState().NumberOfSiblings;if(0!==o){this.NeedCarrierProtector(e)&&(o=o+1|0);var s=System.Array.init(o,(function(){return new OrgChart.Layout.Edge})),a=0,u=this.MaxOnLeft(e),l=System.Array.getItem(e.getChildren(),e.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node).getState(),c=l.getCenterH(),g=!0,h=0,m=System.Double.min;for(n=0;n<e.getState().NumberOfSiblings;n=n+1|0)r=g?System.Array.getItem(e.getChildren(),n,OrgChart.Layout.BoxTree.Node).getState().getRight():System.Array.getItem(e.getChildren(),n,OrgChart.Layout.BoxTree.Node).getState().getLeft(),i=System.Array.getItem(e.getChildren(),n,OrgChart.Layout.BoxTree.Node).getState().getCenterV(),m=Math.max(m,i),s[Bridge.identity(a,a=a+1|0)]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(c,i),new OrgChart.Layout.Point.$ctor1(r,i)),(h=h+1|0)===u&&(h=0,g=!g);this.NeedCarrierProtector(e)&&(s[e.getState().NumberOfSiblings]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(l.getCenterH(),l.getTop()),new OrgChart.Layout.Point.$ctor1(l.getCenterH(),m))),e.getState().Connector=new OrgChart.Layout.Connector(s)}},MaxOnLeft:function(t){return(0|Bridge.Int.div(t.getState().NumberOfSiblings,2))+t.getState().NumberOfSiblings%2|0},NeedCarrierProtector:function(t){return 0===t.getParentNode().getChildCount()},EnumerateSiblings:function(t,e,n){for(var r=[],i=e;i<n;i=i+1|0)r.push(System.Array.getItem(t.getChildren(),i,OrgChart.Layout.BoxTree.Node));return System.Array.toEnumerable(r)}}),Bridge.define("OrgChart.Layout.LinearLayoutStrategy",{inherits:[OrgChart.Layout.LayoutStrategyBase],getSupportsAssistants:function(){return!0},PreProcessThisNode:function(t,e){var n,r;e.getChildCount()>0&&(e.getState().NumberOfSiblings=e.getElement().IsCollapsed?0:e.getChildCount(),e.getElement().IsCollapsed||(n=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(n),r=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(r)))},ApplyVerticalLayout:function(t,e){var n,r,i,o,s,a,u,l=e.BranchRoot;if(0===l.getLevel()&&(l.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(l.getState().getTop(),l.getState().getBottom())),null!=l.getAssistantsRoot()&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(l.getAssistantsRoot().getState(),l.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,l.getAssistantsRoot())),0!==l.getState().NumberOfSiblings){for(n=OrgChart.Layout.Dimensions.MinMax(),r=null==l.getAssistantsRoot()?l.getState().SiblingsRowV.To+this.ParentChildSpacing:l.getState().BranchExterior.getBottom()+this.ParentChildSpacing,i=0;i<l.getState().NumberOfSiblings;i=i+1|0)s=(o=System.Array.getItem(l.getChildren(),i,OrgChart.Layout.BoxTree.Node)).getState(),OrgChart.Layout.LayoutAlgorithm.MoveTo(o.getState(),0,r),o.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(o.getState().TopLeft,o.getState().Size),n=OrgChart.Layout.Dimensions.op_Addition(n,new OrgChart.Layout.Dimensions.$ctor1(r,r+s.Size.Height));for(n=new OrgChart.Layout.Dimensions.$ctor1(n.From,n.To),a=0;a<l.getState().NumberOfSiblings;a=a+1|0)(u=System.Array.getItem(l.getChildren(),a,OrgChart.Layout.BoxTree.Node)).getState().SiblingsRowV=n,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,u)}},ApplyHorizontalLayout:function(t,e){var n,r,i,o,s,a=e.BranchRoot;for(null!=a.getAssistantsRoot()&&OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,a.getAssistantsRoot()),n=0;n<a.getState().NumberOfSiblings;n=n+1|0)r=System.Array.getItem(a.getChildren(),n,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,r);if(a.getLevel()>0&&a.getChildCount()>0){var u=a.getState(),l=System.Array.getItem(a.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),c=System.Array.getItem(a.getChildren(),a.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),g=1===a.getState().NumberOfSiblings||this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Center?l+(c-l)/2:this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left?l+this.ChildConnectorHookLength:c-this.ChildConnectorHookLength,h=u.getCenterH(),m=h-g;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,m),i=System.Array.getItem(a.getChildren(),a.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(i.getState(),h-this.ParentConnectorShield/2,u.getBottom(),this.ParentConnectorShield,System.Array.getItem(a.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-u.getBottom()),t.MergeSpacer(i),o=System.Array.getItem(a.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState(),s=System.Array.getItem(a.getChildren(),a.getState().NumberOfSiblings+1|0,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(s.getState(),o.getLeft(),o.SiblingsRowV.From-this.ParentChildSpacing,System.Array.getItem(a.getChildren(),a.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight()-o.getLeft(),this.ParentChildSpacing),t.MergeSpacer(s)}},RouteConnectors:function(t,e){var n,r,i,o,s=e.getState().NumberOfSiblings,a=0===s?0:1===s?1:2+s|0;if(0!==a){var u=System.Array.init(a,(function(){return new OrgChart.Layout.Edge})),l=e.getState(),c=l.getCenterH();if(null==e.getChildren())throw new System.Exception("State is present, but children not set");if(1===a)u[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(c,l.getBottom()),new OrgChart.Layout.Point.$ctor1(c,System.Array.getItem(e.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getTop()));else{for(n=System.Array.getItem(e.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-l.getBottom(),u[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(c,l.getBottom()),new OrgChart.Layout.Point.$ctor1(c,l.getBottom()+n-this.ChildConnectorHookLength)),r=0;r<s;r=r+1|0)o=(i=System.Array.getItem(e.getChildren(),r,OrgChart.Layout.BoxTree.Node).getState()).getCenterH(),u[1+r|0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(o,i.getTop()),new OrgChart.Layout.Point.$ctor1(o,i.getTop()-this.ChildConnectorHookLength));u[a-1|0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(u[1].To.X,u[1].To.Y),new OrgChart.Layout.Point.$ctor1(u[a-2|0].To.X,u[1].To.Y))}e.getState().Connector=new OrgChart.Layout.Connector(u)}else e.getState().Connector=null}}),Bridge.define("OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter",{inherits:[OrgChart.Layout.LayoutStrategyBase],RealRoot:null,SpecialRoot:null,Iterator:null,ctor:function(t){this.$initialize(),OrgChart.Layout.LayoutStrategyBase.ctor.call(this),this.Iterator=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.GroupIterator(t.getState().NumberOfSiblings,t.getState().NumberOfSiblingColumns),this.RealRoot=t,this.SpecialRoot=Bridge.merge(new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.TreeNodeView(OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,t.getElement().Id,!0)),{setLevel:this.RealRoot.getLevel(),setParentNode:this.RealRoot}),this.SpecialRoot.getState().setEffectiveLayoutStrategy(this);var e=Bridge.cast(t.getState().RequireLayoutStrategy(),OrgChart.Layout.MultiLineFishboneLayoutStrategy);this.SiblingSpacing=e.SiblingSpacing,this.ParentConnectorShield=e.ParentConnectorShield,this.ParentChildSpacing=e.ParentChildSpacing,this.ParentAlignment=e.ParentAlignment,this.ChildConnectorHookLength=e.ChildConnectorHookLength},getSupportsAssistants:function(){return!1},NextGroup:function(){var t,e;if(!this.Iterator.NextGroup())return!1;for(this.SpecialRoot.getState().NumberOfSiblings=this.Iterator.Count,this.SpecialRoot.Prepare(2*this.RealRoot.getState().NumberOfSiblingRows|0),t=0;t<this.Iterator.Count;t=t+1|0)this.SpecialRoot.AddChildView(System.Array.getItem(this.RealRoot.getChildren(),this.Iterator.FromIndex+t|0,OrgChart.Layout.BoxTree.Node));return e=System.Array.getItem(this.RealRoot.getChildren(),(this.RealRoot.getState().NumberOfSiblings+1|0)+this.Iterator.Group|0,OrgChart.Layout.BoxTree.Node),this.SpecialRoot.AddChildView(e),OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(this.SpecialRoot.getState(),this.RealRoot.getState()),!0},PreProcessThisNode:function(){throw new System.NotSupportedException},ApplyVerticalLayout:function(t){for(var e,n,r,i,o,s=null!=(o=this.RealRoot.getAssistantsRoot())?o.getState().BranchExterior.getBottom():this.SpecialRoot.getState().SiblingsRowV.To,a=0;a<this.Iterator.MaxOnLeft;a=a+1|0){var u=0===a?this.ParentChildSpacing:this.SiblingSpacing,l=System.Array.getItem(this.SpecialRoot.getChildren(),a,OrgChart.Layout.BoxTree.Node),c=l.getState();OrgChart.Layout.LayoutAlgorithm.MoveTo(c,c.getLeft(),s+u),e=new OrgChart.Layout.Dimensions.$ctor1(c.getTop(),c.getBottom()),(n=a+this.Iterator.MaxOnLeft|0)<this.Iterator.Count&&(i=(r=System.Array.getItem(this.SpecialRoot.getChildren(),n,OrgChart.Layout.BoxTree.Node)).getState(),OrgChart.Layout.LayoutAlgorithm.MoveTo(i,i.getLeft(),s+u),i.getBottom()>c.getBottom()?OrgChart.Layout.LayoutAlgorithm.MoveTo(c,c.getLeft(),i.getCenterV()-c.Size.Height/2):i.getBottom()<c.getBottom()&&OrgChart.Layout.LayoutAlgorithm.MoveTo(i,i.getLeft(),c.getCenterV()-i.Size.Height/2),i.BranchExterior=new OrgChart.Layout.Rect.$ctor1(i.TopLeft,i.Size),e=OrgChart.Layout.Dimensions.op_Addition(e,new OrgChart.Layout.Dimensions.$ctor1(i.getTop(),i.getBottom())),i.SiblingsRowV=e,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,r),s=i.BranchExterior.getBottom()),c.BranchExterior=new OrgChart.Layout.Rect.$ctor1(c.TopLeft,c.Size),c.SiblingsRowV=e,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,l),s=Math.max(s,c.BranchExterior.getBottom())}},ApplyHorizontalLayout:function(t,e){var n,r,i,o,s,a,u;if(!Bridge.referenceEquals(e.BranchRoot,this.SpecialRoot))throw new System.InvalidOperationException("Wrong root node received");for(n=!0,r=0,i=0;i<this.Iterator.Count;i=i+1|0)if(o=System.Array.getItem(this.SpecialRoot.getChildren(),i,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,o),(r=r+1|0)===this.Iterator.MaxOnLeft&&n){for(OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,this.EnumerateSiblings(0,this.Iterator.MaxOnLeft)),n=!1,r=0,s=System.Double.min,a=0;a<i;a=a+1|0)s=Math.max(s,System.Array.getItem(this.SpecialRoot.getChildren(),a,OrgChart.Layout.BoxTree.Node).getState().BranchExterior.getRight());s=Math.max(s,o.getState().getRight()),u=System.Array.getItem(this.SpecialRoot.getChildren(),this.SpecialRoot.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(u.getState(),s,System.Array.getItem(this.SpecialRoot.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From,this.SiblingSpacing,o.getState().SiblingsRowV.To-System.Array.getItem(this.SpecialRoot.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From),e.Boundary.MergeFrom$1(u)}OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,this.EnumerateSiblings(this.Iterator.MaxOnLeft,this.Iterator.Count))},EnumerateSiblings:function(t,e){for(var n=[],r=t;r<e;r=r+1|0)n.push(System.Array.getItem(this.SpecialRoot.getChildren(),r,OrgChart.Layout.BoxTree.Node));return System.Array.toEnumerable(n)},RouteConnectors:function(){throw new System.NotSupportedException}}),Bridge.define("OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.TreeNodeView",{inherits:[OrgChart.Layout.BoxTree.Node],ctor:function(t){this.$initialize(),OrgChart.Layout.BoxTree.Node.ctor.call(this,t)},Prepare:function(t){null==this.getChildren()?this.setChildren(new(System.Collections.Generic.List$1(OrgChart.Layout.BoxTree.Node))(t)):System.Array.clear(this.getChildren(),OrgChart.Layout.BoxTree.Node)},AddChildView:function(t){System.Array.add(this.getChildren(),t,OrgChart.Layout.BoxTree.Node)}}),Bridge.define("OrgChart.Layout.SingleColumnLayoutStrategy",{inherits:[OrgChart.Layout.LayoutStrategyBase],getSupportsAssistants:function(){return!0},PreProcessThisNode:function(t,e){if(this.ParentAlignment!==OrgChart.Layout.BranchParentAlignment.Left&&this.ParentAlignment!==OrgChart.Layout.BranchParentAlignment.Right)throw new System.InvalidOperationException("Unsupported value for ParentAlignment");if(e.getState().NumberOfSiblings=e.getElement().IsCollapsed?0:e.getChildCount(),e.getState().NumberOfSiblings>0&&e.getLevel()>0){e.getState().NumberOfSiblingColumns=1,e.getState().NumberOfSiblingRows=e.getChildCount();var n=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1);e.AddRegularChild(n)}},ApplyVerticalLayout:function(t,e){var n,r,i,o,s=e.BranchRoot;for(0===s.getLevel()&&(s.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(s.getState().getTop(),s.getState().getBottom())),null!=s.getAssistantsRoot()&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(s.getAssistantsRoot().getState(),s.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,s.getAssistantsRoot())),n=new OrgChart.Layout.Dimensions.$ctor1(s.getState().SiblingsRowV.From,null==s.getAssistantsRoot()?s.getState().SiblingsRowV.To:s.getState().BranchExterior.getBottom()),r=0;r<s.getState().NumberOfSiblings;r=r+1|0){var a=System.Array.getItem(s.getChildren(),r,OrgChart.Layout.BoxTree.Node),u=a.getState(),l=n.To+(0===r?this.ParentChildSpacing:this.SiblingSpacing);OrgChart.Layout.LayoutAlgorithm.MoveTo(a.getState(),u.getLeft(),l),a.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(a.getState().TopLeft,a.getState().Size),i=new OrgChart.Layout.Dimensions.$ctor1(l,l+u.Size.Height),(a=System.Array.getItem(s.getChildren(),r,OrgChart.Layout.BoxTree.Node)).getState().SiblingsRowV=i,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,a),o=a.getState().BranchExterior.getBottom(),n=new OrgChart.Layout.Dimensions.$ctor1(i.From,Math.max(o,i.To))}},ApplyHorizontalLayout:function(t,e){var n,r,i,o,s,a,u,l,c=e.BranchRoot,g=c.getState();for(null!=c.getAssistantsRoot()&&OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,c.getAssistantsRoot()),n=0;n<g.NumberOfSiblings;n=n+1|0)r=System.Array.getItem(c.getChildren(),n,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,r);if(i=OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,this.EnumerateColumn(c)),c.getLevel()>0&&c.getChildCount()>0){if(o=c.getState(),this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left)s=o.getCenterH()+this.ParentConnectorShield/2-i.From;else{if(this.ParentAlignment!==OrgChart.Layout.BranchParentAlignment.Right)throw new System.InvalidOperationException("Invalid ParentAlignment setting");s=o.getCenterH()-this.ParentConnectorShield/2-i.To}OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,s),null!=(a=c.getLevel()>0?System.Array.getItem(c.getChildren(),c.getChildCount()-1|0,OrgChart.Layout.BoxTree.Node):null)&&(u=c.getState().getBottom(),l=System.Array.getItem(c.getChildren(),c.getChildCount()-2|0,OrgChart.Layout.BoxTree.Node).getState().getBottom(),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(a.getState(),o.getCenterH()-this.ParentConnectorShield/2,u,this.ParentConnectorShield,l-u),t.MergeSpacer(a))}},EnumerateColumn:function(t){for(var e=[],n=0;n<t.getState().NumberOfSiblings;n=n+1|0)e.push(System.Array.getItem(t.getChildren(),n,OrgChart.Layout.BoxTree.Node));return System.Array.toEnumerable(e)},RouteConnectors:function(t,e){var n,r,i;if(0!==e.getChildCount()){var o=1+e.getState().NumberOfSiblings|0,s=System.Array.init(o,(function(){return new OrgChart.Layout.Edge})),a=e.getState(),u=a.getCenterH(),l=System.Array.getItem(e.getChildren(),e.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getCenterV()-e.getState().getBottom();for(s[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(u,a.getBottom()),new OrgChart.Layout.Point.$ctor1(u,a.getBottom()+l)),n=0;n<e.getState().NumberOfSiblings;n=n+1|0)r=System.Array.getItem(e.getChildren(),n,OrgChart.Layout.BoxTree.Node).getState(),i=this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left?r.getLeft():r.getRight(),s[1+n|0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(u,r.getCenterV()),new OrgChart.Layout.Point.$ctor1(i,r.getCenterV()));e.getState().Connector=new OrgChart.Layout.Connector(s)}}}),Bridge.define("OrgChart.Layout.StackingLayoutStrategy",{inherits:[OrgChart.Layout.LayoutStrategyBase],Orientation:0,ctor:function(){this.$initialize(),OrgChart.Layout.LayoutStrategyBase.ctor.call(this),this.Orientation=OrgChart.Layout.StackOrientation.SingleRowHorizontal,this.ParentAlignment=OrgChart.Layout.BranchParentAlignment.InvalidValue,this.ChildConnectorHookLength=0,this.ParentConnectorShield=0,this.SiblingSpacing=5},getSupportsAssistants:function(){return!1},PreProcessThisNode:function(t,e){if(e.getState().NumberOfSiblings=e.getElement().IsCollapsed?0:e.getChildCount(),e.getState().NumberOfSiblings>0&&this.Orientation!==OrgChart.Layout.StackOrientation.SingleRowHorizontal&&this.Orientation!==OrgChart.Layout.StackOrientation.SingleColumnVertical)throw new System.InvalidOperationException("Unsupported value for orientation: "+System.Enum.toString(OrgChart.Layout.StackOrientation,this.Orientation))},ApplyVerticalLayout:function(t,e){var n,r,i,o,s,a,u,l,c,g,h,m=e.BranchRoot;if(0===m.getLevel()&&(m.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(m.getState().getTop(),m.getState().getBottom())),0!==m.getState().NumberOfSiblings)if(n=OrgChart.Layout.Dimensions.MinMax(),this.Orientation===OrgChart.Layout.StackOrientation.SingleRowHorizontal){for(r=null==m.getAssistantsRoot()?m.getState().SiblingsRowV.To+this.ParentChildSpacing:m.getState().BranchExterior.getBottom()+this.ParentChildSpacing,i=0;i<m.getState().NumberOfSiblings;i=i+1|0)s=(o=System.Array.getItem(m.getChildren(),i,OrgChart.Layout.BoxTree.Node)).getState(),OrgChart.Layout.LayoutAlgorithm.MoveTo(o.getState(),0,r),o.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(o.getState().TopLeft,o.getState().Size),n=OrgChart.Layout.Dimensions.op_Addition(n,new OrgChart.Layout.Dimensions.$ctor1(r,r+s.Size.Height));for(n=new OrgChart.Layout.Dimensions.$ctor1(n.From,n.To),a=0;a<m.getState().NumberOfSiblings;a=a+1|0)(u=System.Array.getItem(m.getChildren(),a,OrgChart.Layout.BoxTree.Node)).getState().SiblingsRowV=n,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,u)}else if(this.Orientation===OrgChart.Layout.StackOrientation.SingleColumnVertical)for(l=new OrgChart.Layout.Dimensions.$ctor1(m.getState().SiblingsRowV.From,m.getState().SiblingsRowV.To),c=0;c<m.getState().NumberOfSiblings;c=c+1|0){var f=System.Array.getItem(m.getChildren(),c,OrgChart.Layout.BoxTree.Node),d=f.getState(),y=l.To+(0===c?this.ParentChildSpacing:this.SiblingSpacing);OrgChart.Layout.LayoutAlgorithm.MoveTo(f.getState(),d.getLeft(),y),f.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(f.getState().TopLeft,f.getState().Size),g=new OrgChart.Layout.Dimensions.$ctor1(y,y+d.Size.Height),(f=System.Array.getItem(m.getChildren(),c,OrgChart.Layout.BoxTree.Node)).getState().SiblingsRowV=g,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,f),h=f.getState().BranchExterior.getBottom(),l=new OrgChart.Layout.Dimensions.$ctor1(g.From,Math.max(h,g.To))}},ApplyHorizontalLayout:function(t,e){for(var n,r,i=e.BranchRoot,o=Bridge.getEnumerator(i.getChildren(),OrgChart.Layout.BoxTree.Node);o.moveNext();)n=o.getCurrent(),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,n);if(i.getChildCount()>0)if(this.Orientation===OrgChart.Layout.StackOrientation.SingleRowHorizontal){r=System.Array.getItem(i.getChildren(),i.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight()-System.Array.getItem(i.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getLeft(),i.getState().Size=new OrgChart.Layout.Size.$ctor1(Math.max(i.getState().Size.Width,r),i.getState().Size.Height);var s=(System.Array.getItem(i.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getLeft()+System.Array.getItem(i.getChildren(),i.getChildCount()-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight())/2,a=i.getState().getCenterH()-s;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,a)}else if(this.Orientation===OrgChart.Layout.StackOrientation.SingleColumnVertical){OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,i.getChildren());var u=System.Array.getItem(i.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),l=i.getState().getCenterH()-u;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,l)}},RouteConnectors:function(){}}),Bridge.define("OrgChart.Test.TestDataItem",{inherits:[OrgChart.Layout.IChartDataItem],config:{properties:{Id:null,IsAssistant:!1,ParentId:null,String1:null,String2:null,Date1:null},alias:["getId","OrgChart$Layout$IChartDataItem$getId","setId","OrgChart$Layout$IChartDataItem$setId","getIsAssistant","OrgChart$Layout$IChartDataItem$getIsAssistant","setIsAssistant","OrgChart$Layout$IChartDataItem$setIsAssistant"],init:function(){this.Date1=new Date(-864e13)}}}),Bridge.define("OrgChart.Test.TestDataSource",{inherits:[OrgChart.Layout.IChartDataSource],Items:null,config:{alias:["getAllDataItemIds","OrgChart$Layout$IChartDataSource$getAllDataItemIds","getGetParentKeyFunc","OrgChart$Layout$IChartDataSource$getGetParentKeyFunc","getGetDataItemFunc","OrgChart$Layout$IChartDataSource$getGetDataItemFunc"],init:function(){this.Items=new(System.Collections.Generic.Dictionary$2(String,OrgChart.Test.TestDataItem))}},getAllDataItemIds:function(){return System.Linq.Enumerable.from(this.Items.getKeys()).orderBy(t.$.OrgChart.Test.TestDataSource.f1)},getGetParentKeyFunc:function(){return Bridge.fn.bind(this,this.GetParentKey)},getGetDataItemFunc:function(){return Bridge.fn.bind(this,this.GetDataItem)},GetParentKey:function(t){return this.Items.get(t).getParentId()},GetDataItem:function(t){return this.Items.get(t)}}),Bridge.ns("OrgChart.Test.TestDataSource",t.$),Bridge.apply(t.$.OrgChart.Test.TestDataSource,{f1:function(t){return t}}),Bridge.define("OrgChart.Layout.MultiLineFishboneLayoutStrategy",{inherits:[OrgChart.Layout.LinearLayoutStrategy],MaxGroups:4,getSupportsAssistants:function(){return!0},PreProcessThisNode:function(t,e){var n,r,i,o;if(this.MaxGroups<=0)throw new System.InvalidOperationException("MaxGroups must be a positive value");if(e.getChildCount()<=(2*this.MaxGroups|0))OrgChart.Layout.LinearLayoutStrategy.prototype.PreProcessThisNode.call(this,t,e);else if(e.getState().NumberOfSiblings=e.getChildCount(),e.getState().NumberOfSiblings>0){for(e.getState().NumberOfSiblingColumns=this.MaxGroups,e.getState().NumberOfSiblingRows=0|Bridge.Int.div(e.getState().NumberOfSiblings,2*this.MaxGroups|0),e.getState().NumberOfSiblings%(2*this.MaxGroups|0)!=0&&(e.getState().NumberOfSiblingRows=e.getState().NumberOfSiblingRows+1|0),n=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(n),r=0;r<e.getState().NumberOfSiblingColumns;r=r+1|0)i=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(i);e.getState().NumberOfSiblingColumns>1&&(o=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(o))}},ApplyVerticalLayout:function(t,e){var n,r=e.BranchRoot;if(r.getState().NumberOfSiblings<=(2*this.MaxGroups|0))OrgChart.Layout.LinearLayoutStrategy.prototype.ApplyVerticalLayout.call(this,t,e);else for(0===r.getLevel()&&(r.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(r.getState().getTop(),r.getState().getBottom())),null!=r.getAssistantsRoot()&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(r.getAssistantsRoot().getState(),r.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,r.getAssistantsRoot())),n=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter(r);n.NextGroup();)OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,n.SpecialRoot)},ApplyHorizontalLayout:function(t,e){var n,r,i,o,s,a,u=e.BranchRoot;if(u.getState().NumberOfSiblings<=(2*this.MaxGroups|0))OrgChart.Layout.LinearLayoutStrategy.prototype.ApplyHorizontalLayout.call(this,t,e);else{for(0===u.getLevel()&&(u.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(u.getState().getTop(),u.getState().getBottom())),null!=u.getAssistantsRoot()&&OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,u.getAssistantsRoot()),n=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter(u);n.NextGroup();)OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,n.SpecialRoot);if(r=u.getState(),u.getLevel()>0){if(u.getState().NumberOfSiblingColumns>1){var l=System.Array.getItem(u.getChildren(),u.getState().NumberOfSiblings+1|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),c=System.Array.getItem(u.getChildren(),u.getState().NumberOfSiblings+u.getState().NumberOfSiblingColumns|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),g=1===u.getState().NumberOfSiblings||this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Center?l+(c-l)/2:this.ParentAlignment===OrgChart.Layout.BranchParentAlignment.Left?l+this.ChildConnectorHookLength:c-this.ChildConnectorHookLength;i=r.getCenterH()-g}else o=System.Array.getItem(u.getChildren(),1+u.getState().NumberOfSiblings|0,OrgChart.Layout.BoxTree.Node).getState().getCenterH(),i=r.getCenterH()-o;OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,i)}if(u.getLevel()>0&&(s=u.getState().NumberOfSiblings,a=System.Array.getItem(u.getChildren(),s,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(a.getState(),r.getCenterH()-this.ParentConnectorShield/2,r.getBottom(),this.ParentConnectorShield,System.Array.getItem(u.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-r.getBottom()),t.MergeSpacer(a),s=(s=s+1|0)+u.getState().NumberOfSiblingColumns|0,u.getState().NumberOfSiblingColumns>1)){var h=System.Array.getItem(u.getChildren(),s,OrgChart.Layout.BoxTree.Node),m=System.Array.getItem(u.getChildren(),u.getState().NumberOfSiblings+1|0,OrgChart.Layout.BoxTree.Node).getState().TopLeft,f=System.Array.getItem(u.getChildren(),s-1|0,OrgChart.Layout.BoxTree.Node).getState().getRight();OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(h.getState(),m.X,m.Y-this.ParentChildSpacing,f-m.X,this.ParentChildSpacing),t.MergeSpacer(h)}}},RouteConnectors:function(t,e){var n,r,i,o,s,a,u;if(e.getState().NumberOfSiblings<=(2*this.MaxGroups|0))OrgChart.Layout.LinearLayoutStrategy.prototype.RouteConnectors.call(this,t,e);else{n=(1+e.getState().NumberOfSiblings|0)+e.getState().NumberOfSiblingColumns|0,e.getState().NumberOfSiblingColumns>1&&(n=n+1|0);var l=System.Array.init(n,(function(){return new OrgChart.Layout.Edge})),c=e.getState(),g=c.getCenterH(),h=0,m=System.Array.getItem(e.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-c.getBottom();for(l[Bridge.identity(h,h=h+1|0)]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(g,c.getBottom()),new OrgChart.Layout.Point.$ctor1(g,c.getBottom()+m-this.ChildConnectorHookLength)),r=new OrgChart.Layout.MultiLineFishboneLayoutStrategy.SingleFishboneLayoutAdapter.GroupIterator(e.getState().NumberOfSiblings,e.getState().NumberOfSiblingColumns);r.NextGroup();){var f=System.Array.getItem(e.getChildren(),(1+e.getState().NumberOfSiblings|0)+r.Group|0,OrgChart.Layout.BoxTree.Node).getState(),d=f.getCenterH(),y=!0,p=0;for(i=r.FromIndex;i<(r.FromIndex+r.Count|0);i=i+1|0)o=y?System.Array.getItem(e.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getRight():System.Array.getItem(e.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getLeft(),s=System.Array.getItem(e.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getCenterV(),l[Bridge.identity(h,h=h+1|0)]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(d,s),new OrgChart.Layout.Point.$ctor1(o,s)),(p=p+1|0)===r.MaxOnLeft&&(p=0,y&&(l[(1+e.getState().NumberOfSiblings|0)+r.Group|0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(f.getCenterH(),f.getTop()-this.ChildConnectorHookLength),new OrgChart.Layout.Point.$ctor1(f.getCenterH(),System.Array.getItem(e.getChildren(),i,OrgChart.Layout.BoxTree.Node).getState().getCenterV()))),y=!y)}h=h+e.getState().NumberOfSiblingColumns|0,e.getState().NumberOfSiblingColumns>1&&(a=System.Array.getItem(e.getChildren(),1+e.getState().NumberOfSiblings|0,OrgChart.Layout.BoxTree.Node).getState(),u=System.Array.getItem(e.getChildren(),((1+e.getState().NumberOfSiblings|0)+e.getState().NumberOfSiblingColumns|0)-1|0,OrgChart.Layout.BoxTree.Node).getState(),l[h]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(a.getCenterH(),a.getTop()-this.ChildConnectorHookLength),new OrgChart.Layout.Point.$ctor1(u.getCenterH(),u.getTop()-this.ChildConnectorHookLength))),e.getState().Connector=new OrgChart.Layout.Connector(l)}}}),Bridge.define("OrgChart.Layout.MultiLineHangerLayoutStrategy",{inherits:[OrgChart.Layout.LinearLayoutStrategy],MaxSiblingsPerRow:4,getSupportsAssistants:function(){return!0},PreProcessThisNode:function(t,e){var n,r,i,o,s,a;if(this.MaxSiblingsPerRow<=0||this.MaxSiblingsPerRow%2!=0)throw new System.InvalidOperationException("MaxSiblingsPerRow must be a positive even value");if(e.getChildCount()<=this.MaxSiblingsPerRow)OrgChart.Layout.LinearLayoutStrategy.prototype.PreProcessThisNode.call(this,t,e);else if(e.getState().NumberOfSiblings=e.getChildCount(),e.getState().NumberOfSiblings>0){for(n=e.getChildCount()%this.MaxSiblingsPerRow,e.getState().NumberOfSiblingColumns=1+this.MaxSiblingsPerRow|0,e.getState().NumberOfSiblingRows=0|Bridge.Int.div(e.getChildCount(),this.MaxSiblingsPerRow),0!==n&&(e.getState().NumberOfSiblingRows=e.getState().NumberOfSiblingRows+1|0),e.getState().NumberOfSiblings=e.getChildCount()+e.getState().NumberOfSiblingRows|0,n>0&&n<=(0|Bridge.Int.div(this.MaxSiblingsPerRow,2))&&(e.getState().NumberOfSiblings=e.getState().NumberOfSiblings-1|0),r=0|Bridge.Int.div(this.MaxSiblingsPerRow,2);r<e.getState().NumberOfSiblings;)i=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.InsertRegularChild(r,i),r=r+e.getState().NumberOfSiblingColumns|0;for(o=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(o),s=0;s<e.getState().NumberOfSiblingRows;s=s+1|0)a=OrgChart.Layout.Box.Special(OrgChart.Layout.Box.None,e.getElement().Id,!1),e.AddRegularChild(a)}},ApplyVerticalLayout:function(t,e){var n,r,i,o,s,a,u,l,c,g,h,m,f=e.BranchRoot;if(f.getState().NumberOfSiblings<=this.MaxSiblingsPerRow)OrgChart.Layout.LinearLayoutStrategy.prototype.ApplyVerticalLayout.call(this,t,e);else for(0===f.getLevel()&&(f.getState().SiblingsRowV=new OrgChart.Layout.Dimensions.$ctor1(f.getState().getTop(),f.getState().getBottom())),null!=f.getAssistantsRoot()&&(OrgChart.Layout.LayoutAlgorithm.CopyExteriorFrom(f.getAssistantsRoot().getState(),f.getState()),OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,f.getAssistantsRoot())),n=new OrgChart.Layout.Dimensions.$ctor1(f.getState().SiblingsRowV.From,null==f.getAssistantsRoot()?f.getState().SiblingsRowV.To:f.getState().BranchExterior.getBottom()),r=0;r<f.getState().NumberOfSiblingRows;r=r+1|0){var d=OrgChart.Layout.Dimensions.MinMax(),y=0===r?this.ParentChildSpacing:this.SiblingSpacing,p=r*f.getState().NumberOfSiblingColumns|0,S=Math.min(p+f.getState().NumberOfSiblingColumns|0,f.getState().NumberOfSiblings);for(i=p;i<S;i=i+1|0)(o=System.Array.getItem(f.getChildren(),i,OrgChart.Layout.BoxTree.Node)).getElement().IsSpecial||(s=o.getState(),a=n.To+y,OrgChart.Layout.LayoutAlgorithm.MoveTo(o.getState(),s.getLeft(),a),o.getState().BranchExterior=new OrgChart.Layout.Rect.$ctor1(o.getState().TopLeft,o.getState().Size),d=OrgChart.Layout.Dimensions.op_Addition(d,new OrgChart.Layout.Dimensions.$ctor1(a,a+s.Size.Height)));for(d=new OrgChart.Layout.Dimensions.$ctor1(d.From,d.To),u=System.Double.min,l=p;l<S;l=l+1|0)(c=System.Array.getItem(f.getChildren(),l,OrgChart.Layout.BoxTree.Node)).getState().SiblingsRowV=d,OrgChart.Layout.LayoutAlgorithm.VerticalLayout(t,c),u=Math.max(u,c.getState().BranchExterior.getBottom());n=new OrgChart.Layout.Dimensions.$ctor1(d.From,Math.max(u,d.To)),(g=p+(0|Bridge.Int.div(f.getState().NumberOfSiblingColumns,2))|0)<f.getState().NumberOfSiblings&&(h=r===(f.getState().NumberOfSiblingRows-1|0)?System.Array.getItem(f.getChildren(),g-1|0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.To:n.To,m=System.Array.getItem(f.getChildren(),g,OrgChart.Layout.BoxTree.Node).getState(),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(m,0,n.From,this.ParentConnectorShield,h-n.From))}},ApplyHorizontalLayout:function(t,e){var n,r,i,o,s,a,u,l=e.BranchRoot;if(l.getState().NumberOfSiblings<=this.MaxSiblingsPerRow)OrgChart.Layout.LinearLayoutStrategy.prototype.ApplyHorizontalLayout.call(this,t,e);else{for(null!=l.getAssistantsRoot()&&OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,l.getAssistantsRoot()),n=0;n<l.getState().NumberOfSiblingColumns;n=n+1|0){for(r=0;r<l.getState().NumberOfSiblingRows&&!((i=(r*l.getState().NumberOfSiblingColumns|0)+n|0)>=l.getState().NumberOfSiblings);r=r+1|0)o=System.Array.getItem(l.getChildren(),i,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.HorizontalLayout(t,o);OrgChart.Layout.LayoutAlgorithm.AlignHorizontalCenters(t,e,this.EnumerateColumn(l,n))}var c=l.getState(),g=System.Array.getItem(l.getChildren(),0|Bridge.Int.div(l.getState().NumberOfSiblingColumns,2),OrgChart.Layout.BoxTree.Node).getState().getCenterH(),h=c.getCenterH()-g;for(OrgChart.Layout.LayoutAlgorithm.MoveChildrenOnly(t,e,h),s=System.Array.getItem(l.getChildren(),l.getState().NumberOfSiblings,OrgChart.Layout.BoxTree.Node),OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(s.getState(),c.getCenterH()-this.ParentConnectorShield/2,c.getBottom(),this.ParentConnectorShield,System.Array.getItem(l.getChildren(),0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-c.getBottom()),t.MergeSpacer(s),a=this.ParentChildSpacing,u=0;u<l.getState().NumberOfSiblings;u=u+l.getState().NumberOfSiblingColumns|0){var m=System.Array.getItem(l.getChildren(),u,OrgChart.Layout.BoxTree.Node).getState(),f=System.Array.getItem(l.getChildren(),Math.min((u+l.getState().NumberOfSiblingColumns|0)-1|0,l.getState().NumberOfSiblings-1|0),OrgChart.Layout.BoxTree.Node).getState(),d=System.Array.getItem(l.getChildren(),(1+l.getState().NumberOfSiblings|0)+(0|Bridge.Int.div(u,l.getState().NumberOfSiblingColumns))|0,OrgChart.Layout.BoxTree.Node),y=f.getRight()>=s.getState().getRight()?f.getRight()-m.getLeft():s.getState().getRight()-m.getLeft();OrgChart.Layout.LayoutAlgorithm.AdjustSpacer(d.getState(),m.getLeft(),m.SiblingsRowV.From-a,y,a),t.MergeSpacer(d),a=this.SiblingSpacing}}},EnumerateColumn:function(t,e){for(var n,r=[],i=0;i<t.getState().NumberOfSiblingRows&&!((n=(i*t.getState().NumberOfSiblingColumns|0)+e|0)>=t.getState().NumberOfSiblings);i=i+1|0)r.push(System.Array.getItem(t.getChildren(),n,OrgChart.Layout.BoxTree.Node));return System.Array.toEnumerable(r)},RouteConnectors:function(t,e){var n,r,i,o,s,a,u,l,c,g,h;if(e.getState().NumberOfSiblings<=this.MaxSiblingsPerRow)OrgChart.Layout.LinearLayoutStrategy.prototype.RouteConnectors.call(this,t,e);else{for(r=1+e.getState().NumberOfSiblingRows|0,n=Bridge.getEnumerator(e.getChildren(),OrgChart.Layout.BoxTree.Node);n.moveNext();)n.getCurrent().getElement().IsSpecial||(r=r+1|0);var m=System.Array.init(r,(function(){return new OrgChart.Layout.Edge})),f=e.getState(),d=f.getCenterH(),y=System.Array.getItem(e.getChildren(),e.getState().NumberOfSiblings-1|0,OrgChart.Layout.BoxTree.Node).getState().SiblingsRowV.From-this.ChildConnectorHookLength-f.getBottom();for(m[0]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(d,f.getBottom()),new OrgChart.Layout.Point.$ctor1(d,f.getBottom()+y)),i=1,o=0;o<e.getState().NumberOfSiblings;o=o+1|0)(s=System.Array.getItem(e.getChildren(),o,OrgChart.Layout.BoxTree.Node)).getElement().IsSpecial||(u=(a=s.getState()).getCenterH(),m[Bridge.identity(i,i=i+1|0)]=new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(u,a.getTop()),new OrgChart.Layout.Point.$ctor1(u,a.getTop()-this.ChildConnectorHookLength)));for(l=(r-e.getState().NumberOfSiblingRows|0)-1|0,c=1;c<(r-e.getState().NumberOfSiblingRows|0);c=c+this.MaxSiblingsPerRow|0)g=m[c],h=m[Math.min((c+this.MaxSiblingsPerRow|0)-1|0,l)],m[Bridge.identity(i,i=i+1|0)]=h.From.X<m[0].From.X?new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(g.To.X,g.To.Y),new OrgChart.Layout.Point.$ctor1(m[0].To.X,g.To.Y)):new OrgChart.Layout.Edge.$ctor1(new OrgChart.Layout.Point.$ctor1(g.To.X,g.To.Y),new OrgChart.Layout.Point.$ctor1(h.To.X,g.To.Y));e.getState().Connector=new OrgChart.Layout.Connector(m)}}});var e=Bridge.setMetadata,n=[OrgChart.Layout,System,System.Collections.Generic,OrgChart.Annotations,OrgChart.Test];e(n[3].ContractAnnotationAttribute,(function(){return{m:[{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Contract",t:16,rt:String,g:{a:2,n:"get_Contract",t:8,sn:"getContract",rt:String},s:{a:1,n:"set_Contract",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setContract",rt:Object,p:[String]}}],am:!0}})),e(n[0].Boundary.Step,(function(){return{at:[new System.Diagnostics.DebuggerDisplayAttribute("{X}, {Top} - {Bottom}, {Node.Element.Id}")],m:[{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Node",t:4,rt:n[0].BoxTree.Node,sn:"Node",ro:!0}]}})),e(n[0].Box,(function(){return{at:[new System.Diagnostics.DebuggerDisplayAttribute("{Id}, Size.Width}x{Size.Height}")],m:[{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Special",is:!0,t:8,pi:[{n:"id",pt:n[1].Int32,ps:0},{n:"visualParentId",pt:n[1].Int32,ps:1},{n:"disableCollisionDetection",pt:Boolean,ps:2}],sn:"Special",rt:n[0].Box,p:[n[1].Int32,n[1].Int32,Boolean]},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"AssistantLayoutStrategyId",t:4,rt:String,sn:"AssistantLayoutStrategyId"},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"DataId",t:4,rt:String,sn:"DataId",ro:!0},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"LayoutStrategyId",t:4,rt:String,sn:"LayoutStrategyId"}]}})),e(n[0].BoxContainer,(function(){return{m:[{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"SystemRoot",t:16,rt:n[0].Box,g:{a:2,n:"get_SystemRoot",t:8,sn:"getSystemRoot",rt:n[0].Box},s:{a:2,n:"set_SystemRoot",t:8,pi:[{n:"value",pt:n[0].Box,ps:0}],sn:"setSystemRoot",rt:Object,p:[n[0].Box]}}]}})),e(n[0].BoxTree.Node,(function(){return{m:[{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"AssistantsRoot",t:16,rt:n[0].BoxTree.Node,g:{a:2,n:"get_AssistantsRoot",t:8,sn:"getAssistantsRoot",rt:n[0].BoxTree.Node},s:{a:3,n:"set_AssistantsRoot",t:8,pi:[{n:"value",pt:n[0].BoxTree.Node,ps:0}],sn:"setAssistantsRoot",rt:Object,p:[n[0].BoxTree.Node]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"Children",t:16,rt:n[2].IList$1(OrgChart.Layout.BoxTree.Node),g:{a:2,n:"get_Children",t:8,sn:"getChildren",rt:n[2].IList$1(OrgChart.Layout.BoxTree.Node)},s:{a:3,n:"set_Children",t:8,pi:[{n:"value",pt:n[2].IList$1(OrgChart.Layout.BoxTree.Node),ps:0}],sn:"setChildren",rt:Object,p:[n[2].IList$1(OrgChart.Layout.BoxTree.Node)]}},{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Element",t:16,rt:n[0].Box,g:{a:2,n:"get_Element",t:8,sn:"getElement",rt:n[0].Box},s:{a:1,n:"set_Element",t:8,pi:[{n:"value",pt:n[0].Box,ps:0}],sn:"setElement",rt:Object,p:[n[0].Box]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"ParentNode",t:16,rt:n[0].BoxTree.Node,g:{a:2,n:"get_ParentNode",t:8,sn:"getParentNode",rt:n[0].BoxTree.Node},s:{a:2,n:"set_ParentNode",t:8,pi:[{n:"value",pt:n[0].BoxTree.Node,ps:0}],sn:"setParentNode",rt:Object,p:[n[0].BoxTree.Node]}},{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"State",t:16,rt:n[0].NodeLayoutInfo,g:{a:2,n:"get_State",t:8,sn:"getState",rt:n[0].NodeLayoutInfo},s:{a:1,n:"set_State",t:8,pi:[{n:"value",pt:n[0].NodeLayoutInfo,ps:0}],sn:"setState",rt:Object,p:[n[0].NodeLayoutInfo]}}]}})),e(n[0].Connector,(function(){return{m:[{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Segments",t:16,rt:Array,g:{a:2,n:"get_Segments",t:8,sn:"getSegments",rt:Array},s:{a:1,n:"set_Segments",t:8,pi:[{n:"value",pt:Array,ps:0}],sn:"setSegments",rt:Object,p:[Array]}}]}})),e(n[0].Diagram,(function(){return{m:[{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"VisualTree",t:16,rt:n[0].BoxTree,g:{a:2,n:"get_VisualTree",t:8,sn:"getVisualTree",rt:n[0].BoxTree},s:{a:2,n:"set_VisualTree",t:8,pi:[{n:"value",pt:n[0].BoxTree,ps:0}],sn:"setVisualTree",rt:Object,p:[n[0].BoxTree]}}]}})),e(n[0].DiagramLayoutSettings,(function(){return{m:[{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"DefaultAssistantLayoutStrategyId",t:16,rt:String,g:{a:2,n:"get_DefaultAssistantLayoutStrategyId",t:8,sn:"getDefaultAssistantLayoutStrategyId",rt:String},s:{a:2,n:"set_DefaultAssistantLayoutStrategyId",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setDefaultAssistantLayoutStrategyId",rt:Object,p:[String]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"DefaultLayoutStrategyId",t:16,rt:String,g:{a:2,n:"get_DefaultLayoutStrategyId",t:8,sn:"getDefaultLayoutStrategyId",rt:String},s:{a:2,n:"set_DefaultLayoutStrategyId",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setDefaultLayoutStrategyId",rt:Object,p:[String]}},{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"LayoutStrategies",t:16,rt:n[2].Dictionary$2(String,OrgChart.Layout.LayoutStrategyBase),g:{a:2,n:"get_LayoutStrategies",t:8,sn:"getLayoutStrategies",rt:n[2].Dictionary$2(String,OrgChart.Layout.LayoutStrategyBase)},s:{a:1,n:"set_LayoutStrategies",t:8,pi:[{n:"value",pt:n[2].Dictionary$2(String,OrgChart.Layout.LayoutStrategyBase),ps:0}],sn:"setLayoutStrategies",rt:Object,p:[n[2].Dictionary$2(String,OrgChart.Layout.LayoutStrategyBase)]}}]}})),e(n[0].Frame1,(function(){return{at:[new System.Diagnostics.DebuggerDisplayAttribute("{Exterior.Left}:{Exterior.Top}, {Exterior.Size.Width}x{Exterior.Size.Height}")],m:[{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"Connector",t:4,rt:n[0].Connector,sn:"Connector"}]}})),e(n[0].IChartDataSource,(function(){return{m:[{at:[new OrgChart.Annotations.NotNullAttribute],ab:!0,a:2,n:"AllDataItemIds",t:16,rt:n[2].IEnumerable$1(String),g:{ab:!0,a:2,n:"get_AllDataItemIds",t:8,sn:"OrgChart$Layout$IChartDataSource$getAllDataItemIds",rt:n[2].IEnumerable$1(String)},s:{ab:!0,a:1,n:"set_AllDataItemIds",t:8,pi:[{n:"value",pt:n[2].IEnumerable$1(String),ps:0}],sn:"OrgChart$Layout$IChartDataSource$setAllDataItemIds",rt:Object,p:[n[2].IEnumerable$1(String)]}},{at:[new OrgChart.Annotations.NotNullAttribute],ab:!0,a:2,n:"GetDataItemFunc",t:16,rt:Function,g:{ab:!0,a:2,n:"get_GetDataItemFunc",t:8,sn:"OrgChart$Layout$IChartDataSource$getGetDataItemFunc",rt:Function},s:{ab:!0,a:1,n:"set_GetDataItemFunc",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"OrgChart$Layout$IChartDataSource$setGetDataItemFunc",rt:Object,p:[Function]}},{at:[new OrgChart.Annotations.NotNullAttribute],ab:!0,a:2,n:"GetParentKeyFunc",t:16,rt:Function,g:{ab:!0,a:2,n:"get_GetParentKeyFunc",t:8,sn:"OrgChart$Layout$IChartDataSource$getGetParentKeyFunc",rt:Function},s:{ab:!0,a:1,n:"set_GetParentKeyFunc",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"OrgChart$Layout$IChartDataSource$setGetParentKeyFunc",rt:Object,p:[Function]}}]}})),e(n[0].LayoutState,(function(){return{m:[{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"BoxSizeFunc",t:16,rt:Function,g:{a:2,n:"get_BoxSizeFunc",t:8,sn:"getBoxSizeFunc",rt:Function},s:{a:2,n:"set_BoxSizeFunc",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"setBoxSizeFunc",rt:Object,p:[Function]}},{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Diagram",t:16,rt:n[0].Diagram,g:{a:2,n:"get_Diagram",t:8,sn:"getDiagram",rt:n[0].Diagram},s:{a:1,n:"set_Diagram",t:8,pi:[{n:"value",pt:n[0].Diagram,ps:0}],sn:"setDiagram",rt:Object,p:[n[0].Diagram]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"LayoutOptimizerFunc",t:16,rt:Function,g:{a:2,n:"get_LayoutOptimizerFunc",t:8,sn:"getLayoutOptimizerFunc",rt:Function},s:{a:2,n:"set_LayoutOptimizerFunc",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"setLayoutOptimizerFunc",rt:Object,p:[Function]}},{at:[new OrgChart.Annotations.NotNullAttribute],a:1,n:"m_layoutStack",t:4,rt:n[2].Stack$1(OrgChart.Layout.LayoutState.LayoutLevel),sn:"m_layoutStack",ro:!0},{at:[new OrgChart.Annotations.NotNullAttribute],a:1,n:"m_pooledBoundaries",t:4,rt:n[2].Stack$1(OrgChart.Layout.Boundary),sn:"m_pooledBoundaries",ro:!0},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"BoundaryChanged",t:2,ad:{a:2,n:"add_BoundaryChanged",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"addBoundaryChanged",rt:Object,p:[Function]},r:{a:2,n:"remove_BoundaryChanged",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"removeBoundaryChanged",rt:Object,p:[Function]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"OperationChanged",t:2,ad:{a:2,n:"add_OperationChanged",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"addOperationChanged",rt:Object,p:[Function]},r:{a:2,n:"remove_OperationChanged",t:8,pi:[{n:"value",pt:Function,ps:0}],sn:"removeOperationChanged",rt:Object,p:[Function]}}]}})),e(n[0].LayoutState.LayoutLevel,(function(){return{at:[new System.Diagnostics.DebuggerDisplayAttribute("{BranchRoot.Element.Id}, {Boundary.BoundingRect.Top}..{Boundary.BoundingRect.Bottom}")]}})),e(n[0].NodeLayoutInfo,(function(){return{m:[{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"RequireLayoutStrategy",t:8,sn:"RequireLayoutStrategy",rt:n[0].LayoutStrategyBase},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"Connector",t:4,rt:n[0].Connector,sn:"Connector"}]}})),e(n[0].Rect,(function(){return{at:[new System.Diagnostics.DebuggerDisplayAttribute("{TopLeft.X}:{TopLeft.Y}, {Size.Width}x{Size.Height}")]}})),e(n[4].TestDataItem,(function(){return{m:[{at:[new OrgChart.Annotations.NotNullAttribute],a:2,n:"Id",t:16,rt:String,g:{a:2,n:"get_Id",t:8,sn:"getId",rt:String},s:{a:2,n:"set_Id",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setId",rt:Object,p:[String]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"ParentId",t:16,rt:String,g:{a:2,n:"get_ParentId",t:8,sn:"getParentId",rt:String},s:{a:2,n:"set_ParentId",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setParentId",rt:Object,p:[String]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"String1",t:16,rt:String,g:{a:2,n:"get_String1",t:8,sn:"getString1",rt:String},s:{a:2,n:"set_String1",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setString1",rt:Object,p:[String]}},{at:[new OrgChart.Annotations.CanBeNullAttribute],a:2,n:"String2",t:16,rt:String,g:{a:2,n:"get_String2",t:8,sn:"getString2",rt:String},s:{a:2,n:"set_String2",t:8,pi:[{n:"value",pt:String,ps:0}],sn:"setString2",rt:Object,p:[String]}}]}}))})),mxOrgChartLayout.prototype=new mxGraphLayout,mxOrgChartLayout.prototype.constructor=mxOrgChartLayout,mxOrgChartLayout.prototype.BRANCH_OPT_LINEAR="branchOptimizerAllLinear",mxOrgChartLayout.prototype.BRANCH_OPT_HANGER2="branchOptimizerAllHanger2",mxOrgChartLayout.prototype.BRANCH_OPT_HANGER4="branchOptimizerAllHanger4",mxOrgChartLayout.prototype.BRANCH_OPT_FISHBONE1="branchOptimizerAllFishbone1",mxOrgChartLayout.prototype.BRANCH_OPT_FISHBONE2="branchOptimizerAllFishbone2",mxOrgChartLayout.prototype.BRANCH_OPT_1COLUMN_L="branchOptimizerAllSingleColumnLeft",mxOrgChartLayout.prototype.BRANCH_OPT_1COLUMN_R="branchOptimizerAllSingleColumnRight",mxOrgChartLayout.prototype.BRANCH_OPT_SMART="branchOptimizerSmart",mxOrgChartLayout.prototype.execute=function(t){this.graph.model.beginUpdate();try{RPOrgChart.main(this.graph,t,this.branchOptimizer,this.parentChildSpacing,this.siblingSpacing,this.correctY)}finally{this.graph.model.endUpdate()}},Bridge.define("RPOrgChart",{statics:{config:{init:function(){}},main:function(t,e,n,r,i,o){Bridge.Console.log=console.log,Bridge.Console.error=console.error,Bridge.Console.debug=console.debug,RPOrgChart.graph=t,RPOrgChart.parent=e,RPOrgChart.dx=0,RPOrgChart.dy=0,"group"==e.style&&e.geometry&&(RPOrgChart.dx=e.geometry.x,RPOrgChart.dy=e.geometry.y),RPOrgChart.branchOptimizer=n,RPOrgChart.correctY=o,RPOrgChart.parentChildSpacing=parseInt(r),RPOrgChart.siblingSpacing=parseInt(i),RPOrgChart.buildChart(!0)},diagram:{},dataSource:{},buildChart:function(t){t&&RPOrgChart.initDiagram(),RPOrgChart.positionBoxes()},collapseAllBoxes:function(t,e){for(var n=t.getBoxesById().getValues().getEnumerator();n.moveNext();){var r=n.getCurrent();r.IsSpecial||(r.IsCollapsed=e)}},generateData:function(){for(var t=new OrgChart.Test.TestDataSource,e=RPOrgChart.graph,n=e.getChildVertices(RPOrgChart.parent),r=0;r<n.length;r++){var i=n[r];if(null!=i.geometry&&i.vertex&&i.parent==RPOrgChart.parent){var o=null,s=e.getIncomingEdges(i)[0];null!=s&&null!=s.source&&(o=s.source.id),(s=new OrgChart.Test.TestDataItem).Id=i.id,s.ParentId=o,t.Items.add(s.getId(),s)}}return t},initDiagram:function(){var t=RPOrgChart.generateData();RPOrgChart.dataSource=t;var e=new OrgChart.Layout.BoxContainer.$ctor1(t);RPOrgChart.diagram=new OrgChart.Layout.Diagram,(t=RPOrgChart.diagram).setBoxes(e),(e=new OrgChart.Layout.LinearLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Center,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("linear",e),(e=new OrgChart.Layout.MultiLineHangerLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Center,e.MaxSiblingsPerRow=2,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("hanger2",e),(e=new OrgChart.Layout.MultiLineHangerLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Center,e.MaxSiblingsPerRow=4,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("hanger4",e),(e=new OrgChart.Layout.SingleColumnLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Right,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("singleColumnRight",e),(e=new OrgChart.Layout.SingleColumnLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Left,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("singleColumnLeft",e),(e=new OrgChart.Layout.MultiLineFishboneLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Center,e.MaxGroups=1,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("fishbone1",e),(e=new OrgChart.Layout.MultiLineFishboneLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Center,e.MaxGroups=2,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("fishbone2",e),(e=new OrgChart.Layout.StackingLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.InvalidValue,e.Orientation=OrgChart.Layout.StackOrientation.SingleRowHorizontal,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("hstack",e),(e=new OrgChart.Layout.StackingLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.InvalidValue,e.Orientation=OrgChart.Layout.StackOrientation.SingleColumnVertical,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("vstack",e),(e=new OrgChart.Layout.StackingLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.InvalidValue,e.Orientation=OrgChart.Layout.StackOrientation.SingleColumnVertical,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("vstackMiddle",e),(e=new OrgChart.Layout.StackingLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.InvalidValue,e.Orientation=OrgChart.Layout.StackOrientation.SingleColumnVertical,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("vstackTop",e),(e=new OrgChart.Layout.FishboneAssistantsLayoutStrategy).ParentAlignment=OrgChart.Layout.BranchParentAlignment.Center,e.ParentChildSpacing=RPOrgChart.parentChildSpacing,e.SiblingSpacing=RPOrgChart.siblingSpacing,t.LayoutSettings.LayoutStrategies.add("assistants",e),t.LayoutSettings.DefaultLayoutStrategyId="vstack",t.LayoutSettings.DefaultAssistantLayoutStrategyId="assistants"},getBoxLevel:function(t,e){for(var n=0,r={};0<e.ParentId&&t.getBoxesById().tryGetValue(e.ParentId,r);)e=r.v,n++;return n},onLayoutStateChanged:function(t,e){e.State.getCurrentOperation()===OrgChart.Layout.LayoutState.Operation.PreprocessVisualTree&&RPOrgChart.renderBoxes()},renderBoxes:function(){RPOrgChart.diagram.getVisualTree().IterateParentFirst((function(t){var e=t.Element;if(e.getIsDataBound()){if(t.State.IsHidden)return!0;e.Size=RPOrgChart.getBoxElementSize(e.DataId)}return!0}))},getBranchOptimizerFunc:function(){return RPOrgChart[RPOrgChart.branchOptimizer]},branchOptimizerAllLinear:function(t){return t.getIsAssistantRoot()?null:"linear"},branchOptimizerAllHanger2:function(t){return t.getIsAssistantRoot()?null:"hanger2"},branchOptimizerAllHanger4:function(t){return t.getIsAssistantRoot()?null:"hanger4"},branchOptimizerAllFishbone1:function(t){return t.getIsAssistantRoot()?null:"fishbone1"},branchOptimizerAllFishbone2:function(t){return t.getIsAssistantRoot()?null:"fishbone2"},branchOptimizerAllSingleColumnLeft:function(t){return t.getIsAssistantRoot()?null:"singleColumnRight"},branchOptimizerAllSingleColumnRight:function(t){return t.getIsAssistantRoot()?null:"singleColumnLeft"},branchOptimizerStackers:function(t){return t.getIsAssistantRoot()?null:0===t.Level?"vstackTop":1===t.Level?"vstackMiddle":"hstack"},branchOptimizerSmart:function(t){if(t.getIsAssistantRoot())return null;var e=t.getChildCount();if(1>=e)return"vstack";for(var n=0,r=0;r<e;r++)0<t.Children.getItem(r).getChildCount()&&n++;return 1>=n?4>=e?"vstack":8>=e?"fishbone1":"fishbone2":"hanger4"},boxSizeFunc:function(t){return t=RPOrgChart.diagram.getBoxes().getBoxesByDataId().getItem(t).Id,RPOrgChart.diagram.getBoxes().getBoxesById().getItem(t).Size},getBoxElementSize:function(t){return t=RPOrgChart.graph.model.cells[t].geometry,new OrgChart.Layout.Size.$ctor1(t.width,t.height)},positionBoxes:function(){var t=RPOrgChart.diagram;(e=new OrgChart.Layout.LayoutState(t)).addOperationChanged(RPOrgChart.onLayoutStateChanged),e.BoxSizeFunc=Bridge.fn.bind(this,RPOrgChart.boxSizeFunc,null,!0),e.LayoutOptimizerFunc=Bridge.fn.bind(this,RPOrgChart.getBranchOptimizerFunc(),null,!0),OrgChart.Layout.LayoutAlgorithm.Apply(e);var e,n=-(e=OrgChart.Layout.LayoutAlgorithm.ComputeBranchVisualBoundingRect(t.getVisualTree())).getLeft()+e.getTop(),r=RPOrgChart.graph,i=r.model.cells,o=[];for(t.getVisualTree().IterateParentFirst((function(t){if(t.State.IsHidden)return!1;if((e=t.Element).getIsDataBound()){var e,o=(e=i[e.DataId]).geometry.clone();o.x=t.State.TopLeft.X+n,o.y=t.State.TopLeft.Y,r.model.setGeometry(e,o)}return!0})),t.getVisualTree().IterateParentFirst((function(t){var e=RPOrgChart.correctY?Math.min(0,-RPOrgChart.parentChildSpacing/2+5):0;if(null!=t.State.Connector){for(var s=function(t,n){for(var i=t.geometry.clone(),o=0;n&&o<n.length;o++)n[o].corrected||(n[o].y+=e,n[o].corrected=!0);i.points=n,r.model.setGeometry(t,i),r.setCellStyles("entryX",null,[t]),r.setCellStyles("entryY",null,[t]),r.setCellStyles("exitX",null,[t]),r.setCellStyles("exitY",null,[t]),r.setCellStyles("edgeStyle","orthogonalEdgeStyle",[t])},a=function(t,e){return e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height},u=i[t.Element.DataId],l=r.getOutgoingEdges(u),c=(l={},0);c<t.State.Connector.Segments.length;c++){var g=t.State.Connector.Segments[c];g.mark=1<<c,g.From.X+=n,g.To.X+=n;var h=g.From.X,m=g.From.Y,f=g.To.X,d=g.To.Y;if(h==f&&m>d||m==d&&h>f){var y=g.From;g.From=g.To,g.To=y}}for(c=0;c<t.State.Connector.Segments.length;c++)for(h=(g=t.State.Connector.Segments[c]).From.X,m=g.From.Y,f=g.To.X,d=g.To.Y,y=new mxPoint(h,m),o.push(y),y.mark=g.mark,null!=(p=l[h+","+m])?p.mark|=y.mark:l[h+","+m]=y,y=new mxPoint(f,d),o.push(y),y.mark=g.mark,null!=(p=l[f+","+d])?p.mark|=y.mark:l[f+","+d]=y,y=c+1;y<t.State.Connector.Segments.length;y++){var p,S=(p=t.State.Connector.Segments[y]).From.X,C=p.From.Y,x=p.To.X,v=p.To.Y;h==f&&m<=C&&d>=C&&S<=h&&x>=h?(x=new mxPoint(h,C),o.push(x),x.mark=g.mark|p.mark,null!=(p=l[h+","+C])?p.mark|=x.mark:l[h+","+C]=x):m==d&&h<=S&&f>=S&&C<=m&&v>=m&&(x=new mxPoint(S,m),o.push(x),x.mark=g.mark|p.mark,null!=(p=l[S+","+m])?p.mark|=x.mark:l[S+","+m]=x)}var w,b=[];for(w in l)b.push(l[w]);if(b.sort((function(t,e){var n=t.y-e.y;return 0==n?t.x-e.x:n})),l=r.getOutgoingEdges(u),2==b.length&&1==l.length)s(l[0],b);else{var B,I;for(t=function(t){for(var e=0;e<b.length;e++){var n=b[e];if(!I[n.x+","+n.y]&&n.mark&t.mark)return I[n.x+","+n.y]=!0,n}},y=u.geometry,w=0;w<b.length;w++)if(a(y,b[w])){B=b[w];break}for(y=0;y<l.length;y++)if(null!=l[y].target){for((I={})[B.x+","+B.y]=!0,w=l[y].target.geometry,u=[B],c=B,g=0;1e3>g;)if(g++,null==(h=t(c)))u.pop(),c=u[u.length-1];else if(u.push(h),c=h,a(w,h))break;if(2<u.length)for(c=u[0].x,g=u[u.length-1].x,w=u.length-2;0<w;w--)(c>g&&u[w].x<g||c<g&&u[w].x<c)&&u.splice(w,1);(w=l[y].geometry.clone()).points=u,RPOrgChart.graph.model.setGeometry(l[y],w),s(l[y],u)}}}return!0})),t=0;t<o.length;t++)delete o[t].mark,delete o[t].corrected}}}),Bridge.init();