var clienttelemetry_build,Microsoft,sct,microsoft;!function(n){n.version="2.4.0"}(clienttelemetry_build||(clienttelemetry_build={})),!function(n){!function(n){!function(n){n[n.BT_STOP=0]="BT_STOP",n[n.BT_STOP_BASE=1]="BT_STOP_BASE",n[n.BT_BOOL=2]="BT_BOOL",n[n.BT_UINT8=3]="BT_UINT8",n[n.BT_UINT16=4]="BT_UINT16",n[n.BT_UINT32=5]="BT_UINT32",n[n.BT_UINT64=6]="BT_UINT64",n[n.BT_FLOAT=7]="BT_FLOAT",n[n.BT_DOUBLE=8]="BT_DOUBLE",n[n.BT_STRING=9]="BT_STRING",n[n.BT_STRUCT=10]="BT_STRUCT",n[n.BT_LIST=11]="BT_LIST",n[n.BT_SET=12]="BT_SET",n[n.BT_MAP=13]="BT_MAP",n[n.BT_INT8=14]="BT_INT8",n[n.BT_INT16=15]="BT_INT16",n[n.BT_INT32=16]="BT_INT32",n[n.BT_INT64=17]="BT_INT64",n[n.BT_WSTRING=18]="BT_WSTRING",n[n.BT_UNAVAILABLE=127]="BT_UNAVAILABLE"}(n.BondDataType||(n.BondDataType={})),n.BondDataType,!function(n){n[n.MARSHALED_PROTOCOL=0]="MARSHALED_PROTOCOL",n[n.MAFIA_PROTOCOL=17997]="MAFIA_PROTOCOL",n[n.COMPACT_PROTOCOL=16963]="COMPACT_PROTOCOL",n[n.JSON_PROTOCOL=21322]="JSON_PROTOCOL",n[n.PRETTY_JSON_PROTOCOL=20554]="PRETTY_JSON_PROTOCOL",n[n.SIMPLE_PROTOCOL=20563]="SIMPLE_PROTOCOL"}(n.ProtocolType||(n.ProtocolType={})),n.ProtocolType}(n.Bond||(n.Bond={})),n.Bond}(Microsoft||(Microsoft={})),!function(n){!function(n){!function(n){var i=function(){function n(){this._buffer=[]}return n.prototype.Add=function(n){for(var t=0;t<this._buffer.length&&this._buffer[t]!=n;++t);t==this._buffer.length&&this._buffer.push(n)},n.prototype.Count=function(){return this._buffer.length},n.prototype.GetBuffer=function(){return this._buffer},n}(),t;n.Set=i,t=function(){function n(){this._buffer=[]}return n.prototype.Add=function(n,t){-1==this._getIndex(n)&&this._buffer.push({Key:n,Value:t})},n.prototype.AddOrReplace=function(n,t){var i=this._getIndex(n);i>=0?this._buffer[i]={Key:n,Value:t}:this._buffer.push({Key:n,Value:t})},n.prototype.Remove=function(n){var t=this._getIndex(n);t>=0&&this._buffer.splice(t,1)},n.prototype.Count=function(){return this._buffer.length},n.prototype.GetBuffer=function(){return this._buffer},n.prototype.ContainsKey=function(n){return this._getIndex(n)>=0?!0:!1},n.prototype.Get=function(n){var t=this._getIndex(n);return t>=0?this._buffer[t].Value:null},n.prototype._getIndex=function(n){for(var t=0,i=-1;t<this._buffer.length;++t)if(this._buffer[t].Key==n){i=t;break}return i},n}(),n.Map=t}(n.Collections||(n.Collections={})),n.Collections}(n.Bond||(n.Bond={})),n.Bond}(Microsoft||(Microsoft={})),!function(n){!function(t){!function(n){var h=function(){function n(){}return n.GetBytes=function(n){for(var t,i=[],r=0;r<n.length;++r)t=n.charCodeAt(r),128>t?i.push(t):2048>t?i.push(192|t>>6,128|63&t):55296>t||t>=57344?i.push(224|t>>12,128|t>>6&63,128|63&t):(t=65536+((1023&t)<<10|1023&n.charCodeAt(++r)),i.push(240|t>>18,128|t>>12&63,128|t>>6&63,128|63&t));return i},n}(),r,u,f,e,o,s;n.Utf8=h,r=function(){function n(){}return n.GetString=function(n){for(var t,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[],f=n.length%3,o=function(n){return[i.charAt(n>>18&63),i.charAt(n>>12&63),i.charAt(n>>6&63),i.charAt(63&n)].join("")},u=0,e=n.length-f;e>u;u+=3)t=(n[u]<<16)+(n[u+1]<<8)+n[u+2],r.push(o(t));switch(f){case 1:t=n[n.length-1],r.push(i.charAt(t>>2)),r.push(i.charAt(t<<4&63)),r.push("==");break;case 2:t=(n[n.length-2]<<8)+n[n.length-1],r.push(i.charAt(t>>10)),r.push(i.charAt(t>>4&63)),r.push(i.charAt(t<<2&63)),r.push("=")}return r.join("")},n}(),n.Base64=r,u=function(){function n(){}return n.GetBytes=function(n){for(var t=[];4294967168&n;)t.push(127&n|128),n>>>=7;return t.push(127&n),t},n}(),n.Varint=u,f=function(){function n(){}return n.GetBytes=function(n){for(var t=n.low,i=n.high,r=[];i||4294967168&t;)r.push(127&t|128),t=(127&i)<<25|t>>>7,i>>>=7;return r.push(127&t),r},n}(),n.Varint64=f,e=function(){function n(){}return n.GetBytes=function(n){var u,f,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(4)),u.setFloat32(0,n,!0),f=[],r=0;4>r;++r)f.push(u.getUint8(r));return f}return i.ConvertNumberToArray(n,!1)},n}(),n.Float=e,o=function(){function n(){}return n.GetBytes=function(n){var u,f,r;if(t.BrowserChecker.IsDataViewSupport()){for(u=new DataView(new ArrayBuffer(8)),u.setFloat64(0,n,!0),f=[],r=0;8>r;++r)f.push(u.getUint8(r));return f}return i.ConvertNumberToArray(n,!0)},n}(),n.Double=o,s=function(){function n(){}return n.EncodeZigzag16=function(n){return n=t.Number.ToInt16(n),n<<1^n>>15},n.EncodeZigzag32=function(n){return n=t.Number.ToInt32(n),n<<1^n>>31},n.EncodeZigzag64=function(n){var f=n.low,e=n.high,r=e<<1|f>>>31,u=f<<1,i;return 2147483648&e&&(r=~r,u=~u),i=new t.UInt64("0"),i.low=u,i.high=r,i},n}(),n.Zigzag=s}(t.Encoding||(t.Encoding={})),t.Encoding,!function(r){var h=function(){function n(){}return n.GetString=function(n){for(var t,u,f,r=[],i=0;i<n.length;++i)if(t=n[i],191>=t)r.push(String.fromCharCode(t));else if(223>=t)u=n[++i],r.push(String.fromCharCode((31&t)<<6|63&u));else if(239>=t)u=n[++i],f=n[++i],r.push(String.fromCharCode((15&t)<<12|(63&u)<<6|63&f));else{var u=n[++i],f=n[++i],e=n[++i];t=(7&t)<<18|(63&u)<<12|(63&f)<<6|63&e,t-=65536,r.push(String.fromCharCode(55296|t>>10&1023)),r.push(String.fromCharCode(56320|1023&t))}return r.join("")},n}(),u,f,e,o,s;r.Utf8=h,u=function(){function n(){}return n.GetBytes=function(n){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[],t=0;t<n.length;++t){var o=i.indexOf(n.charAt(t++)),f=i.indexOf(n.charAt(t++)),u=i.indexOf(n.charAt(t++)),e=i.indexOf(n.charAt(t));r.push(o<<2|f>>4),u>=0&&(r.push(f<<4&240|u>>2),e>=0&&r.push(u<<6&192|e))}return r},n}(),r.Base64=u,f=function(){function t(){}return t.GetInt64=function(t){var i=new n.Bond.Int64("0"),r=this._Read(t);return i.low=r[0],r.length>1&&(i.high=r[1]),i},t.GetNumber=function(n){return this._Read(n)[0]},t._Read=function(n){for(var t,f=[],r=0,u=!0,i=0;u;){if(t=n.shift(),u=0!=(128&t),t=127&t,!(28>i)){r|=t<<i,f.push(r),r=t>>4,i=3;break}r|=t<<i,i+=7}for(;u;)if(t=n.shift(),u=0!=(128&t),t=127&t,r|=t<<i,i+=7,i>=32)break;return f.push(r),f},t}(),r.Varint=f,e=function(){function n(){}return n.GetNumber=function(n){if(t.BrowserChecker.IsDataViewSupport()){for(var u=new DataView(new ArrayBuffer(4)),r=0;4>r;++r)u.setUint8(r,n[r]);return u.getFloat32(0,!0)}return i.ConvertArrayToNumber(n,!1)},n}(),r.Float=e,o=function(){function n(){}return n.GetNumber=function(n){if(t.BrowserChecker.IsDataViewSupport()){for(var u=new DataView(new ArrayBuffer(8)),r=0;8>r;++r)u.setUint8(r,n[r]);return u.getFloat64(0,!0)}return i.ConvertArrayToNumber(n,!0)},n}(),r.Double=o,s=function(){function t(){}return t.DecodeZigzag16=function(n){return((65535&n)>>>1^-(1&n))<<16>>16},t.DecodeZigzag32=function(n){return n>>>1^-(1&n)},t.DecodeZigzag64=function(t){var f=1&t.high,u=t.high>>>1,e=1&t.low,i=t.low>>>1,r;return i=f<<31|i,e&&(i^=4294967295,u^=4294967295),r=new n.Bond.UInt64("0"),r.low=i,r.high=u,r},t}(),r.Zigzag=s}(t.Decoding||(t.Decoding={}));var i=(t.Decoding,function(){function n(){}return n.ConvertNumberToArray=function(n,t){var u,c,p,f,s,e,v;if(!n)return t?this._doubleZero:this._floatZero;var b=t?11:8,w=t?52:23,o=(1<<b-1)-1,k=1-o,d=o,y=0>n?1:0;n=Math.abs(n);for(var h=Math.floor(n),l=n-h,a=2*(o+2)+w,r=new Array(a),i=0;a>i;)r[i++]=0;for(i=o+2;i&&h;)r[--i]=h%2,h=Math.floor(h/2);for(i=o+1;a-1>i&&l>0;)l*=2,l>=1?(r[++i]=1,--l):r[++i]=0;for(u=0;a>u&&!r[u];++u);if(c=o+1-u,p=u+w,r[p+1]){for(i=p;i>u&&!(r[i]=1-r[i]);--i);i==u&&++c}if(c>d||h)return y?t?this._doubleNegInifinity:this._floatNegInifinity:t?this._doubleInifinity:this._floatInifinity;if(k>c)return t?this._doubleZero:this._floatZero;if(t){for(f=0,i=0;20>i;++i)f=f<<1|r[++u];for(s=0;52>i;++i)s=s<<1|r[++u];return f|=c+o<<20,f=y<<31|2147483647&f,v=[255&s,s>>8&255,s>>16&255,s>>>24,255&f,f>>8&255,f>>16&255,f>>>24]}for(e=0,i=0;23>i;++i)e=e<<1|r[++u];return e|=c+o<<23,e=y<<31|2147483647&e,v=[255&e,e>>8&255,e>>16&255,e>>>24]},n.ConvertArrayToNumber=function(n,i){var c=i?11:8,l=(1<<c-1)-1,a=0!=(128&n[i?7:3]),e=i?(127&n[7])<<4|(240&n[6])>>4:(127&n[3])<<1|(128&n[2])>>7,u,f,o,s,h,r;if(255==e)throw new t.Exception("Not a valid float/double buffer.");if(u=1,f=1,i){if(o=(15&n[6])<<28|(255&n[5])<<20|(255&n[4])<<12,s=n[3]<<24|(255&n[2])<<16|(255&n[1])<<8|255&n[0],!e&&!o&&!s)return 0;for(r=0;20>r;++r)f/=2,0>o&&(u+=f),o<<=1;for(r=0;32>r;++r)f/=2,0>s&&(u+=f),s<<=1}else{if(h=(127&n[2])<<25|(255&n[1])<<17|(255&n[0])<<9,!e&&!h)return 0;for(r=0;23>r;++r)f/=2,0>h&&(u+=f),h<<=1}return u*=Math.pow(2,e-l),a?0-u:u},n._floatZero=[0,0,0,0],n._doubleZero=[0,0,0,0,0,0,0,0],n._floatInifinity=[0,0,128,127],n._floatNegInifinity=[0,0,128,255],n._doubleInifinity=[0,0,0,0,0,0,240,127],n._doubleNegInifinity=[0,0,0,0,0,0,240,255],n}())}(n.Bond||(n.Bond={})),n.Bond}(Microsoft||(Microsoft={})),!function(n){!function(n){!function(t){var i=function(){function t(){this._buffer=[]}return t.prototype.WriteByte=function(t){this._buffer.push(n.Number.ToByte(t))},t.prototype.Write=function(n,t,i){for(;i--;)this.WriteByte(n[t++])},t.prototype.GetBuffer=function(){return this._buffer},t}();t.MemoryStream=i}(n.IO||(n.IO={})),n.IO}(n.Bond||(n.Bond={})),n.Bond}(Microsoft||(Microsoft={})),!function(n){!function(n){var c=function(){function n(n,t){this.Type=n,this.Id=t}return n}(),t,i,r,u,f,e,o,s,h;n.FieldTag=c,t=function(){function n(n,t){this.ElementType=n,this.Size=t}return n}(),n.ContainerTag=t,i=function(){function n(n,t,i){this.KeyType=n,this.ValueType=t,this.Size=i}return n}(),n.KeyValueContainerTag=i,r=function(){function n(){}return n}(),n.Bonded=r,u=function(){function n(n){this.low=0,this.high=0,this.low=parseInt(n),this.low<0&&(this.high=-1)}return n.prototype.Equals=function(t){var i=new n(t);return this.low==i.low&&this.high==i.high},n}(),n.Int64=u,f=function(){function n(n){this.low=0,this.high=0,this.low=parseInt(n)}return n.prototype.Equals=function(t){var i=new n(t);return this.low==i.low&&this.high==i.high},n}(),n.UInt64=f,e=function(){function n(){}return n.ToByte=function(n){return this.ToUInt8(n)},n.ToInt8=function(n){var t=(128&n)<<24>>24;return 127&n|t},n.ToInt16=function(n){var t=(32768&n)<<16>>16;return 32767&n|t},n.ToInt32=function(n){var t=2147483648&n;return 2147483647&n|t},n.ToUInt8=function(n){return 255&n},n.ToUInt16=function(n){return 65535&n},n.ToUInt32=function(n){return 4294967295&n},n}(),n.Number=e,o=function(){function n(n){this.Message=n}return n}(),n.Exception=o,s=function(){function n(){}return n}(),n.KeyValuePair=s,h=function(){function n(){}return n.IsDataViewSupport=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},n}(),n.BrowserChecker=h}(n.Bond||(n.Bond={})),n.Bond}(Microsoft||(Microsoft={})),!function(n){!function(n){var i=function(){function t(n){this._stream=n}return t.prototype.WriteBlob=function(n){this._stream.Write(n,0,n.length)},t.prototype.WriteBool=function(n){this._stream.WriteByte(n?1:0)},t.prototype.WriteContainerBegin=function(n,t){this.WriteUInt8(t),this.WriteUInt32(n)},t.prototype.WriteMapContainerBegin=function(n,t,i){this.WriteUInt8(t),this.WriteUInt8(i),this.WriteUInt32(n)},t.prototype.WriteContainerEnd=function(){},t.prototype.WriteDouble=function(t){var i=n.Encoding.Double.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteFloat=function(t){var i=n.Encoding.Float.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteFieldBegin=function(n,t){5>=t?this._stream.WriteByte(n|t<<5):255>=t?(this._stream.WriteByte(192|n),this._stream.WriteByte(t)):(this._stream.WriteByte(224|n),this._stream.WriteByte(t),this._stream.WriteByte(t>>8))},t.prototype.WriteFieldEnd=function(){},t.prototype.WriteFieldOmitted=function(){},t.prototype.WriteInt16=function(t){t=n.Encoding.Zigzag.EncodeZigzag16(t),this.WriteUInt16(t)},t.prototype.WriteInt32=function(t){t=n.Encoding.Zigzag.EncodeZigzag32(t),this.WriteUInt32(t)},t.prototype.WriteInt64=function(t){this.WriteUInt64(n.Encoding.Zigzag.EncodeZigzag64(t))},t.prototype.WriteInt8=function(t){this._stream.WriteByte(n.Number.ToInt8(t))},t.prototype.WriteString=function(t){if(""==t)this.WriteUInt32(0);else{var i=n.Encoding.Utf8.GetBytes(t);this.WriteUInt32(i.length),this._stream.Write(i,0,i.length)}},t.prototype.WriteStructBegin=function(){},t.prototype.WriteStructEnd=function(n){this.WriteUInt8(n?1:0)},t.prototype.WriteUInt16=function(t){var i=n.Encoding.Varint.GetBytes(n.Number.ToUInt16(t));this._stream.Write(i,0,i.length)},t.prototype.WriteUInt32=function(t){var i=n.Encoding.Varint.GetBytes(n.Number.ToUInt32(t));this._stream.Write(i,0,i.length)},t.prototype.WriteUInt64=function(t){var i=n.Encoding.Varint64.GetBytes(t);this._stream.Write(i,0,i.length)},t.prototype.WriteUInt8=function(t){this._stream.WriteByte(n.Number.ToUInt8(t))},t.prototype.WriteWString=function(n){var t,i;for(this.WriteUInt32(n.length),t=0;t<n.length;++t)i=n.charCodeAt(t),this._stream.WriteByte(i),this._stream.WriteByte(i>>>8)},t}(),t;n.CompactBinaryProtocolWriter=i,t=function(){function n(){}return n}(),n.CompactBinaryProtocolReader=t}(n.Bond||(n.Bond={})),n.Bond}(Microsoft||(Microsoft={})),!function(n){var t=function(){function n(){}return n.IsSafari=function(){return null===n._isSafari&&n._DetectBrowser(),n._isSafari},n.ajax=function(t){var i=n._createConnection(),r,u;if(t.headers){r="qsp=true";for(u in t.headers)r+="&",r+=encodeURIComponent(u),r+="=",r+=encodeURIComponent(t.headers[u]);t.url+=t.url.indexOf("?")<0?"?":"&",t.url+=r}i.open(t.type,t.url),t.complete&&(i.onload=function(){"undefined"==typeof i.status&&(i.status=200),t.complete(i)},i.ontimeout=function(){"undefined"==typeof i.status&&(i.status=500),t.complete(i)},i.onerror=function(){t.complete(i)}),i.send(t.data)},n.keys=function(n){var t,i;if(Object.keys)return Object.keys(n);t=[];for(i in n)n.hasOwnProperty(i)&&t.push(i);return t},n.IsUsingXDomainRequest=function(){if(null==n._usingXDomainRequest){var t=new XMLHttpRequest;n._usingXDomainRequest="undefined"==typeof t.withCredentials&&"undefined"!=typeof XDomainRequest?!0:!1}return n._usingXDomainRequest},n._createConnection=function(){var t=new XMLHttpRequest;return n.IsUsingXDomainRequest()?new XDomainRequest:t},n._DetectBrowser=function(){var t=navigator.userAgent.toLowerCase();n._isSafari=t.indexOf("safari")>=0&&t.indexOf("chrome")<0?!0:!1},n._isSafari=null,n._usingXDomainRequest=null,n}();n.Utils=t}(sct||(sct={})),!function(n){!function(n){!function(n){!function(t){var i=function(){function n(){}return n.GetGuid=function(){var n=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1,5)};return[n(),n(),"-",n(),"-",n(),"-",n(),"-",n(),n(),n()].join("")},n.GetTimeStamp=function(){var t=+new Date,n=new Microsoft.Bond.Int64("0");return n.low=4294967295&t,n.high=Math.floor(t/4294967296),n},n.GetTimeStampWithValue=function(n){var t=new Microsoft.Bond.Int64("0");return t.low=4294967295&n,t.high=Math.floor(n/4294967296),t},n}(),r,u,f,e;t.utils=i,function(n){n[n.NotSet=0]="NotSet",n[n.Event=1]="Event",n[n.PerformanceCounter=2]="PerformanceCounter",n[n.Anomaly=3]="Anomaly",n[n.Prediction=4]="Prediction",n[n.TraceLog=5]="TraceLog",n[n.EventSourceLog=6]="EventSourceLog",n[n.HttpLog=7]="HttpLog",n[n.PerformanceCounterAzure=8]="PerformanceCounterAzure",n[n.PerformanceCounterGfs=9]="PerformanceCounterGfs"}(t.RecordType||(t.RecordType={})),t.RecordType,!function(n){n[n.NotSet=0]="NotSet",n[n.O365=1]="O365",n[n.SkypeBI=2]="SkypeBI",n[n.SkypeData=3]="SkypeData"}(t.PIIScrubber||(t.PIIScrubber={})),t.PIIScrubber,!function(n){n[n.NotSet=0]="NotSet",n[n.DistinguishedName=1]="DistinguishedName",n[n.GenericData=2]="GenericData",n[n.IPV4Address=3]="IPV4Address",n[n.IPv6Address=4]="IPv6Address",n[n.MailSubject=5]="MailSubject",n[n.PhoneNumber=6]="PhoneNumber",n[n.QueryString=7]="QueryString",n[n.SipAddress=8]="SipAddress",n[n.SmtpAddress=9]="SmtpAddress",n[n.Identity=10]="Identity",n[n.Uri=11]="Uri",n[n.Fqdn=12]="Fqdn",n[n.IPV4AddressLegacy=13]="IPV4AddressLegacy"}(t.PIIKind||(t.PIIKind={})),r=(t.PIIKind,function(){function n(){this.ScrubType=0,this.Kind=0,this.RawContent=""}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){n.WriteStructBegin(null,t),0!=this.ScrubType?(n.WriteFieldBegin(16,1,null),n.WriteInt32(this.ScrubType),n.WriteFieldEnd()):n.WriteFieldOmitted(16,1,null),0!=this.Kind?(n.WriteFieldBegin(16,2,null),n.WriteInt32(this.Kind),n.WriteFieldEnd()):n.WriteFieldOmitted(16,2,null),""!=this.RawContent?(n.WriteFieldBegin(9,3,null),n.WriteString(this.RawContent),n.WriteFieldEnd()):n.WriteFieldOmitted(9,3,null),n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}()),t.PII=r,u=function(){function t(){this.Id=i.GetGuid(),this.Timestamp=i.GetTimeStamp(),this.Type="",this.EventType="",this.Extension=new Microsoft.Bond.Collections.Map,this.RecordType=0,this.PIIExtensions=new Microsoft.Bond.Collections.Map}return t.prototype.AddOrReplacePII=function(t,i,r){var u=new n.datamodels.PII;u.RawContent=i,u.Kind=r,u.ScrubType=1,this.PIIExtensions.AddOrReplace(t,u)},t.prototype.Write=function(n){this.WriteImpl(n,!1)},t.prototype.WriteImpl=function(n,t){var i,r;if(n.WriteStructBegin(null,t),""!=this.Id?(n.WriteFieldBegin(9,1,null),n.WriteString(this.Id),n.WriteFieldEnd()):n.WriteFieldOmitted(9,1,null),this.Timestamp.Equals("0")?n.WriteFieldOmitted(17,3,null):(n.WriteFieldBegin(17,3,null),n.WriteInt64(this.Timestamp),n.WriteFieldEnd()),""!=this.Type?(n.WriteFieldBegin(9,5,null),n.WriteString(this.Type),n.WriteFieldEnd()):n.WriteFieldOmitted(9,5,null),""!=this.EventType?(n.WriteFieldBegin(9,6,null),n.WriteString(this.EventType),n.WriteFieldEnd()):n.WriteFieldOmitted(9,6,null),this.Extension.Count()){for(n.WriteFieldBegin(13,13,null),n.WriteMapContainerBegin(this.Extension.Count(),9,9),i=0;i<this.Extension.GetBuffer().length;++i)n.WriteString(this.Extension.GetBuffer()[i].Key),n.WriteString(this.Extension.GetBuffer()[i].Value);n.WriteContainerEnd(),n.WriteFieldEnd()}else n.WriteFieldOmitted(13,13,null);if(0!=this.RecordType?(n.WriteFieldBegin(16,24,null),n.WriteInt32(this.RecordType),n.WriteFieldEnd()):n.WriteFieldOmitted(16,24,null),this.PIIExtensions.Count()){for(n.WriteFieldBegin(13,30,null),n.WriteMapContainerBegin(this.PIIExtensions.Count(),9,10),r=0;r<this.PIIExtensions.GetBuffer().length;++r)n.WriteString(this.PIIExtensions.GetBuffer()[r].Key),this.PIIExtensions.GetBuffer()[r].Value.WriteImpl(n,!1);n.WriteContainerEnd(),n.WriteFieldEnd()}else n.WriteFieldOmitted(13,30,null);n.WriteStructEnd(t)},t.prototype.Read=function(n){this.ReadImpl(n,!1)},t.prototype.ReadImpl=function(){},t}(),t.Record=u,f=function(){function n(){this.Source="",this.DataPackageId="",this.Timestamp=new Microsoft.Bond.Int64("0"),this.Records=[]}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){if(n.WriteStructBegin(null,t),""!=this.Source?(n.WriteFieldBegin(9,2,null),n.WriteString(this.Source),n.WriteFieldEnd()):n.WriteFieldOmitted(9,2,null),""!=this.DataPackageId?(n.WriteFieldBegin(9,5,null),n.WriteString(this.DataPackageId),n.WriteFieldEnd()):n.WriteFieldOmitted(9,5,null),this.Timestamp.Equals("0")?n.WriteFieldOmitted(17,6,null):(n.WriteFieldBegin(17,6,null),n.WriteInt64(this.Timestamp),n.WriteFieldEnd()),this.Records.length){n.WriteFieldBegin(11,8,null),n.WriteContainerBegin(this.Records.length,10);for(var i=0;i<this.Records.length;++i)this.Records[i].WriteImpl(n,!1);n.WriteContainerEnd(),n.WriteFieldEnd()}else n.WriteFieldOmitted(11,8,null);n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}(),t.DataPackage=f,e=function(){function n(){this.DataPackages=[],this.RequestRetryCount=0}return n.prototype.Write=function(n){this.WriteImpl(n,!1)},n.prototype.WriteImpl=function(n,t){if(n.WriteStructBegin(null,t),this.DataPackages.length){n.WriteFieldBegin(11,1,null),n.WriteContainerBegin(this.DataPackages.length,10);for(var i=0;i<this.DataPackages.length;++i)this.DataPackages[i].WriteImpl(n,!1);n.WriteContainerEnd(),n.WriteFieldEnd()}else n.WriteFieldOmitted(11,1,null);0!=this.RequestRetryCount?(n.WriteFieldBegin(16,2,null),n.WriteInt32(this.RequestRetryCount),n.WriteFieldEnd()):n.WriteFieldOmitted(16,2,null),n.WriteStructEnd(t)},n.prototype.Read=function(n){this.ReadImpl(n,!1)},n.prototype.ReadImpl=function(){},n}(),t.ClientToCollectorRequest=e}(n.datamodels||(n.datamodels={})),n.datamodels}(n.telemetry||(n.telemetry={})),n.telemetry}(n.applications||(n.applications={})),n.applications}(microsoft||(microsoft={})),!function(n){!function(n){!function(n){!function(t){var i,u,f,e,r,o,s;!function(n){n[n.SENT=0]="SENT",n[n.SEND_FAILED=1]="SEND_FAILED"}(t.CallbackEventType||(t.CallbackEventType={})),t.CallbackEventType,!function(n){n[n.DATARV_ERROR_OK=0]="DATARV_ERROR_OK",n[n.DATARV_ERROR_INVALID_EVENT=1]="DATARV_ERROR_INVALID_EVENT",n[n.DATARV_ERROR_INVALID_CONFIG=2]="DATARV_ERROR_INVALID_CONFIG",n[n.DATARV_ERROR_INVALID_DEPENDENCIES=3]="DATARV_ERROR_INVALID_DEPENDENCIES",n[n.DATARV_ERROR_INVALID_STATUS=4]="DATARV_ERROR_INVALID_STATUS",n[n.DATARV_ERROR_INVALID_ARG=5]="DATARV_ERROR_INVALID_ARG"}(t.DATARV_ERROR||(t.DATARV_ERROR={})),i=(t.DATARV_ERROR,function(){function n(n){this._errorCode=0,this._errorCode=n}return n.prototype.ErrorCode=function(){return this._errorCode},n.prototype.toString=function(){switch(this._errorCode){case 0:return"DATARV_ERROR_OK";case 1:return"Event is invalid. Either event.Id is empty, or event.Timestamp is empty, or event.EventType is empty.";case 2:return"Invalid configuration. CollectorUrl is missing.";case 3:return"DATARV_ERROR_INVALID_DEPENDENCIES";case 4:return"Telemetry Manager is not initialized.";case 5:return"TenantToken is null or empty, or events is null.";default:return"Unknown error"}},n}()),t.Exception=i,u=function(){function n(){}return n}(),t.TelemetryConfig=u,f=function(){function n(){}return n.CreateTelemetryManager=function(){return new o},n}(),t.TelemetryManagerFactory=f,r=function(){function n(){}return n.MaxPackageSizeInBytes=function(){return 3e6},n.TimeIntervalForNextSendInMS=function(){return 1e3},n}(),!function(n){n[n.Created=0]="Created",n[n.Initialized=1]="Initialized",n[n.Started=2]="Started"}(e||(e={})),o=function(){function t(){this._MaxPackageSizeInBytes=r.MaxPackageSizeInBytes(),this._listeners=[],this._status=0,this._ecsClient=null,this._etag=null,this._ecsCallback=null,this._testServerResponseHook=null}return t.prototype.Initialize=function(n){if(0!=this._status)throw new i(4);if(!n||!n.collectorUrl)throw new i(2);this._config=n,this._Reset(),this._status=1,n.ecsClient&&(this._Verbose("ECS object assigned. Do integration"),this._ecsClient=n.ecsClient),this._Verbose("Initialize() done")},t.prototype.AddListener=function(n){if(this._status<1)throw new i(4);this._Verbose(["AddListener(), status: ",this._status," old length: ",this._listeners.length," func: ",n].join(""));for(var t=0;t<this._listeners.length;++t)if(this._listeners[t]==n)return void this._Verbose("the listener has been added already, index: "+t);this._listeners.push(n),this._Verbose("AddListener() done, the new length: "+this._listeners.length)},t.prototype.RemoveListener=function(n){if(this._status<1)throw new i(4);this._Verbose(["RemoveListener(), status: ",this._status," old length: ",this._listeners.length," func: ",n].join(""));for(var t=0;t<this._listeners.length;++t)if(this._listeners[t]==n)return 1==this._listeners.length?this._listeners=[]:t==this._listeners.length-1?this._listeners.pop():this._listeners[t]=this._listeners.pop(),void this._Verbose(["this listener has been found, index: ",t,"new length: ",this._listeners.length].join(""));this._Verbose("listener isn't been found, new length"+this._listeners.length)},t.prototype.Start=function(){if(this._status<1)throw new i(4);this._Verbose(["Start(), status:",this._status,"tag:",t._tag].join(" ")),this._status>=2&&this._Verbose("Start() already, ignore"),this._ecsClient&&(this._ecsCallback=this._CreateEcsCallback(),this._ecsClient.AddListener(this._ecsCallback),this._etag=this._ecsClient.GetETag()),++t._tag,this._status=2,this._Verbose(["Start() done, status: ",this._status,"tag: ",t._tag].join(""))},t.prototype.Stop=function(){if(this._status<1)throw new i(4);return this._Verbose("Stop(), status: "+this._status),1==this._status?void this._Verbose("Stop() already, ignore"):(this._Reset(),this._status=1,void this._Verbose("Stop() done, status: "+this._status))},t.prototype.Flush=function(n){this._eventsCache.IsEmpty()||this._WorkThread(n)},t.prototype.SendAsync=function(n,r){if(this._status<1)throw new i(4);if(this._Verbose(["SendAsync(), status:",this._status,"tenantToken:",n,"count:",r.length].join(" ")),this._status<2)return this._Info("SendAsync(), not started, ignore, return false"),!1;if(!n||!r)throw this._Error("SendAsync(), tenantToken or events is null or empty"),new i(5);for(var u=0;u<r.length;++u)if(!r[u].Id||!t._eventTypeRegex.test(r[u].EventType)||r[u].Timestamp.Equals("0"))throw this._Error(["eventId:",r[u].Id,"eventType:",r[u].EventType,"timestamp high:",r[u].Timestamp.high,"timestamp low:",r[u].Timestamp.low].join("")),new i(1);return this._eventsCache.AddEvents(n,r),this._Verbose(["SendAsync(), currentTimer: ",this._timer,"eventsCacheIsEmpty",this._eventsCache.IsEmpty()].join(" ")),this._eventsCache.IsEmpty()||this._timer||this._ScheduleTimer(!1),this._Verbose("SendAsync() done"),!0},t.prototype._WorkThread=function(n){var o=this,i,r,e,u,f;try{if(this._Verbose("_WorkThread, status: "+this._status),this._status<2)return void this._Verbose("_WorkThread, status is not started, return");if(i=this._eventsCache.DequeuEvents(),null==i)return this._Verbose("_WorkThread, No events found, return"),void this._CleanTimer();if(r=this._PackEvents(i.tenantToken,i.events),this._eventsCache.AddEvents(i.tenantToken,r.remainedEvents),null==r.buffer||0==r.buffer.length)return void(this._eventsCache.IsEmpty()?(this._Verbose("eventsCache is empty, stop schedule"),this._CleanTimer()):(this._Verbose("eventsCache is not empty, schedule for next run"),this._ScheduleTimer(!1)));if(this._testServerResponseHook)return e=this._testServerResponseHook(),void setTimeout(this._SendCallback(f,i.tenantToken,r.sendEvents,e,null),100);u={type:"POST",url:this._config.collectorUrl,processData:!1,headers:{"content-type":"application/bond-compact-binary","client-id":"NO_AUTH","sdk-version":"ACT-Web-JS-"+clienttelemetry_build.version},complete:function(t){return o._SendCallback(f,i.tenantToken,r.sendEvents,t,n)}},sct.Utils.IsSafari()||"undefined"==typeof Uint8Array?(this._Verbose("Uint8Array is undefined, send with base64 encode."),u.data=Microsoft.Bond.Encoding.Base64.GetString(r.buffer),u.headers["content-encoding"]="base64"):(this._Verbose("Uint8Array is defined, send with binary format directly."),u.data=new Uint8Array(r.buffer)),i.tenantToken&&(u.headers["x-apikey"]=i.tenantToken),f=t._tag,this._lastActiveTime=+new Date,sct.Utils.ajax(u),this._Verbose("_Workthread, send via jquery, tag: "+f)}catch(s){this._Error("_WorkThread, exception: "+s)}},t.prototype._PackEvents=function(t,i){var e,u,f,r,o;for(this._Verbose("_PackageEvents, total Count: "+i.length),e=new n.datamodels.ClientToCollectorRequest,u=new n.datamodels.DataPackage,u.Source="JS_default_source",u.DataPackageId=n.datamodels.utils.GetGuid(),u.Timestamp=n.datamodels.utils.GetTimeStamp(),r=i,i=[];;){if(u.Records=[],u.Records.push.apply(u.Records,r),e.DataPackages=[],e.DataPackages.push(u),f=this._Serialize(e),this._Verbose(["_PackageEvents, sendEvents.length:",r.length,"buffer.length:",f.length,"MaxPackageSize:",this._MaxPackageSizeInBytes].join("")),f.length<this._MaxPackageSizeInBytes)break;if(1==r.length){r=[],f=null;break}o=r.splice(0,Math.floor(r.length/2)),this._Verbose("_PackageEvents, too large, package again"),i.push.apply(i,r),r=o}return this._Verbose(["_PakcageEvents done, sendEventsCount:",r.length,"buffer.length:",null==f?0:f.length,"remained events:",i.length].join("")),{buffer:f,sendEvents:r,remainedEvents:i}},t.prototype._Serialize=function(n){var t=new Microsoft.Bond.IO.MemoryStream,i=new Microsoft.Bond.CompactBinaryProtocolWriter(t);return n.Write(i),t.GetBuffer()},t.prototype._SendCallback=function(n,i,r,u,f){var o,e;if(this._Verbose(["_SendCallback","tag:",n,"current tag:",t._tag,"tenantToken:",i,"events count:",r.length,"jqXHR:",u].join("")),null!=f)return void f(u?u.status:0,i,r);if(o=null!=u&&u.status>=200&&u.status<300,this._status<2||n<t._tag)return void this._Verbose("_SendCallback, is not started, or tag is not the same, return");if(!o&&(!u||u.status&&400!=u.status))return this._Verbose("retry statusCode: "+(u?u.status:0)),this._eventsCache.AddEvents(i,r),void this._ScheduleTimer(!0);for(e=0;e<this._listeners.length;++e)this._listeners[e](o?0:1,u?u.status:0,i,r);this._eventsCache.IsEmpty()?(this._Verbose("eventsCache is empty, stop schedule"),this._CleanTimer()):(this._Verbose("eventsCache is not empty, schedule for next run"),this._ScheduleTimer(!1))},t.prototype._CleanTimer=function(){this._Verbose("_CleanTimer(), timer: "+this._timer),this._timer&&(clearTimeout(this._timer),this._timer=null)},t.prototype._ScheduleTimer=function(n){var i=this,t;if(this._Verbose("_ScheduleTimer: isRetry: "+n),this._CleanTimer(),n)this._Verbose("_ScheduleTimer, current factor: "+this._rescheduleFactor),t=Math.floor(5*this._rescheduleFactor*(1+Math.random())),this._timer=setTimeout(function(){return i._WorkThread(null)},1e3*t),this._Verbose("_ScheduleTimer, next try (s): "+t),this._rescheduleFactor<<=1,this._rescheduleFactor>64&&(this._rescheduleFactor=1);else{var t=0,f=+new Date,u=f-this._lastActiveTime;t=u>r.TimeIntervalForNextSendInMS()?0:r.TimeIntervalForNextSendInMS()-u,this._timer=setTimeout(function(){return i._WorkThread(null)},t),this._Verbose("_ScheduleTimer, next try: "+t),this._rescheduleFactor=1}},t.prototype._Verbose=function(n){this._config.log&&this._config.log.Verbose("[TelemetryManagerImpl]: "+n)},t.prototype._Info=function(n){this._config.log&&this._config.log.Info("[TelemetryManagerImpl]: "+n)},t.prototype._Error=function(n){this._config.log&&this._config.log.Error("[TelemetryManagerImpl]: "+n)},t.prototype._Reset=function(){this._Verbose("Reset()"),this._CleanTimer(),this._lastActiveTime=0,this._rescheduleFactor=1,this._sendingEvents=[],this._eventsCache=new s,this._ecsClient&&(this._ecsClient.RemoveListener(this._ecsCallback),this._ecsCallback=null)},t.prototype._CreateEcsCallback=function(){var n=this;return function(t){0==t&&(n._etag=n._ecsClient.GetETag())}},t.prototype.__GetListenerArray=function(){return this._listeners},t.prototype.__GetTotalEventsCount=function(){return this._eventsCache.GetTotalEventsCount()},t.prototype.__IsScheduled=function(){return null!=this._timer},t.prototype.__ChageMaxPackageSizeInKB=function(n){this._MaxPackageSizeInBytes=1024*n},t.prototype.__SetTestServerResponseHook=function(n){this._testServerResponseHook=n},t._eventTypeRegex=/^[a-zA-Z0-9]([a-zA-Z0-9]|_){2,98}[a-zA-Z0-9]$/,t._tag=0,t}(),s=function(){function n(){this._events={},this._tokens=[]}return n.prototype.AddEvents=function(n,t){t.length&&(this._events[n]||(this._events[n]=[],this._tokens.push(n)),this._events[n].push.apply(this._events[n],t))},n.prototype.IsEmpty=function(){return 0==this._tokens.length},n.prototype.DequeuEvents=function(){if(0==this._tokens.length)return null;var n=this._tokens.shift(),t=this._events[n];return delete this._events[n],{tenantToken:n,events:t}},n.prototype.GetTotalEventsCount=function(){var n=0,t;for(t in this._events)n+=this._events[t].length;return n},n}()}(n._sender||(n._sender={})),n._sender}(n.telemetry||(n.telemetry={})),n.telemetry}(n.applications||(n.applications={})),n.applications}(microsoft||(microsoft={})),!function(n){!function(n){!function(n){var i=n._sender.TelemetryManagerFactory.CreateTelemetryManager(),h=function(){function n(){this.collectorUrl=null}return n}(),o,u,t,f,e,r,s;n.LogConfiguration=h,o=function(){function n(){this.key=null,this.value=null,this.pii=null}return n}(),n.Property=o,u=function(){function n(){this.name=null,this.timestamp=null,this.properties=[],this.eventType=null}return n.prototype.setProperty=function(i,r,u){if(!i||!n._propertyNameRegex.test(i))throw new t(3);this.properties.push(u?{key:i,value:r,pii:0!=u?u:null}:{key:i,value:r,pii:null})},n._propertyNameRegex=/^[a-zA-Z0-9](([a-zA-Z0-9|_]){0,98}[a-zA-Z0-9])?$/,n}(),n.EventProperties=u,function(n){n[n.INVALID_TENANT_TOKEN=1]="INVALID_TENANT_TOKEN",n[n.MISSING_EVENT_PROPERTIES_NAME=2]="MISSING_EVENT_PROPERTIES_NAME",n[n.INVALID_PROPERTY_NAME=3]="INVALID_PROPERTY_NAME",n[n.INVALID_COLLECTOR_URL=4]="INVALID_COLLECTOR_URL",n[n.MISSING_FAILURE_SIGNATURE=5]="MISSING_FAILURE_SIGNATURE",n[n.MISSING_FAILURE_DETAIL=6]="MISSING_FAILURE_DETAIL",n[n.MISSING_PAGEVIEW_ID=7]="MISSING_PAGEVIEW_ID",n[n.MISSING_PAGEVIEW_NAME=8]="MISSING_PAGEVIEW_NAME",n[n.INVALID_SESSION_STATE=9]="INVALID_SESSION_STATE"}(n.TelemetryError||(n.TelemetryError={})),t=(n.TelemetryError,function(){function n(n){this.errorCode=null,this.errorCode=n}return n.prototype.ErrorCode=function(){return this.errorCode},n.prototype.toString=function(){switch(this.errorCode){case 1:return"Invalid tenant token";case 2:return"Eventproperties.name can not be null or empty";case 3:return"Invalid Key. Key does not conform to regular expression ^[a-zA-Z0-9](([a-zA-Z0-9|_|.]){0,98}[a-zA-Z0-9])?$";case 4:return"Collector url can't be null or empty.";case 5:return"Failure signature can't be null or empty.";case 6:return"Failure detail can't be null or empty.";case 7:return"Pageview id can't be null or empty.";case 8:return"Pageview name can't be null or empty.";case 9:return"Session state has to be a value from the SessionState enum.";default:return"Unknown error"}},n}()),n.Exception=t,f=function(){function n(){this.contextMap=new Microsoft.Bond.Collections.Map,this.piiKind=10}return n.prototype.setAppId=function(n){n&&this.contextMap.Add("AppInfo.Id",n)},n.prototype.setAppVersion=function(n){n&&this.contextMap.Add("AppInfo.Version",n)},n.prototype.setAppLanguage=function(n){n&&this.contextMap.Add("AppInfo.Language",n)},n.prototype.setDeviceId=function(n){n&&this.contextMap.Add("DeviceInfo.Id",n)},n.prototype.setDeviceOsName=function(n){n&&this.contextMap.Add("DeviceInfo.OsName",n)},n.prototype.setDeviceOsVersion=function(n){n&&this.contextMap.Add("DeviceInfo.OsVersion",n)},n.prototype.setDeviceBrowserName=function(n){n&&this.contextMap.Add("DeviceInfo.BrowserName",n)},n.prototype.setDeviceBrowserVersion=function(n){n&&this.contextMap.Add("DeviceInfo.BrowserVersion",n)},n.prototype.setUserId=function(n,t){n&&this.contextMap.Add("UserInfo.Id",n),t&&(this.piiKind=t)},n.prototype.setUserMsaId=function(n){n&&this.contextMap.Add("UserInfo.MsaId",n)},n.prototype.setUserANID=function(n){n&&this.contextMap.Add("UserInfo.ANID",n)},n.prototype.setUserAdvertisingId=function(n){n&&this.contextMap.Add("UserInfo.AdvertisingId",n)},n.prototype.setUserTimeZone=function(n){n&&this.contextMap.Add("UserInfo.TimeZone",n)},n.prototype.setUserLanguage=function(n){n&&this.contextMap.Add("UserInfo.Language",n)},n}(),e=function(){function t(){}return t.initialize=function(){var u=document.documentElement.lang,r;u&&t.semanticContext.setAppLanguage(u),r=window.navigator.userLanguage||window.navigator.language,r&&t.semanticContext.setUserLanguage(r);var f=(new Date).getTimezoneOffset(),n=f%60,i=(f-n)/60,e="+";i>0&&(e="-"),t.semanticContext.setUserTimeZone(e+(10>i?"0"+i:i.toString())+":"+(10>n?"0"+n:n.toString())),t.semanticContext.setDeviceBrowserName(t._getBrowserName()),t.semanticContext.setDeviceBrowserVersion(t._getBrowserVersion()),t.semanticContext.setDeviceOsName(t._getOsName()),t.semanticContext.setDeviceOsVersion(t._getOsVersion()),t._setupCookies()},t._setupCookies=function(){var i=t._getCookie(t.DEVICE_ID_COOKIE),r;""==i?(i=n.datamodels.utils.GetGuid(),t._setCookie(t.DEVICE_ID_COOKIE,i),t.semanticContext.setDeviceId(i)):t.semanticContext.setDeviceId(i),r=t._getCookie(t.FIRST_LAUNCH_TIME_COOKIE),""==r&&(r=(+new Date).toString(),t._setCookie(t.FIRST_LAUNCH_TIME_COOKIE,r)),t.firstLaunchTime=parseInt(r)},t._setCookie=function(n,t){var i="expires=Mon, 31 Dec 2029 23:59:59 GMT";document.cookie=n+"="+t+"; "+i},t._getCookie=function(n){for(var t,i,u=n+"=",f=document.cookie.split(";"),r=0;r<f.length;r++){for(t=f[r],i=0;" "==t.charAt(i);)i++;if(t=t.substring(i),0==t.indexOf(u))return t.substring(u.length,t.length)}return""},t._getUserAgent=function(){return window.navigator.userAgent},t._userAgentContainsString=function(n){return t._getUserAgent().indexOf(n)>-1},t._isIe=function(){return t._userAgentContainsString("Trident")},t._isEdge=function(){return t._userAgentContainsString(t.BROWSERS.EDGE)},t._isOpera=function(){return t._userAgentContainsString("OPR/")},t._getBrowserName=function(){return t._isOpera()?t.BROWSERS.UNKNOWN:t._userAgentContainsString(t.BROWSERS.PHANTOMJS)?t.BROWSERS.PHANTOMJS:t._isEdge()?t.BROWSERS.EDGE:t._userAgentContainsString(t.BROWSERS.ELECTRON)?t.BROWSERS.ELECTRON:t._userAgentContainsString(t.BROWSERS.CHROME)?t.BROWSERS.CHROME:t._userAgentContainsString(t.BROWSERS.FIREFOX)?t.BROWSERS.FIREFOX:t._userAgentContainsString(t.BROWSERS.SAFARI)?t.BROWSERS.SAFARI:t._userAgentContainsString(t.BROWSERS.SKYPE_SHELL)?t.BROWSERS.SKYPE_SHELL:t._isIe()?t.BROWSERS.MSIE:t.BROWSERS.UNKNOWN},t._getBrowserVersion=function(){function n(){var n,i=t._getUserAgent(),r=i.match(new RegExp(t.BROWSERS.MSIE+" "+t.REGEX_VERSION));return r?r[1]:(n=i.match(new RegExp("rv:"+t.REGEX_VERSION)))?n[1]:void 0}function i(n){var i;return n===t.BROWSERS.SAFARI&&(n="Version"),i=t._getUserAgent().match(new RegExp(n+"/"+t.REGEX_VERSION)),i?i[1]:t.UNKNOWN_VERSION}return t._isIe()?n():i(t._getBrowserName())},t._getOsName=function(){var n=/(windows|win32)/i,i=/ arm;/i,r=/windows\sphone\s\d+\.\d+/i,u=/(macintosh|mac os x)/i,f=/(iPad|iPhone|iPod)(?=.*like Mac OS X)/i,e=/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)/i,o=/android/i;return t._getUserAgent().match(r)?t.OPERATING_SYSTEMS.WINDOWS_PHONE:t._getUserAgent().match(i)?t.OPERATING_SYSTEMS.WINDOWS_RT:t._getUserAgent().match(f)?t.OPERATING_SYSTEMS.IOS:t._getUserAgent().match(o)?t.OPERATING_SYSTEMS.ANDROID:t._getUserAgent().match(e)?t.OPERATING_SYSTEMS.LINUX:t._getUserAgent().match(u)?t.OPERATING_SYSTEMS.MACOSX:t._getUserAgent().match(n)?t.OPERATING_SYSTEMS.WINDOWS:t.OPERATING_SYSTEMS.UNKNOWN},t._getOsVersion=function(){function n(){var n=t._getUserAgent().match(new RegExp("Windows NT "+t.REGEX_VERSION));return n&&t.VERSION_MAPPINGS[n[1]]?t.VERSION_MAPPINGS[n[1]]:t.UNKNOWN_VERSION}function i(){var f=t._getUserAgent().match(new RegExp(t.OPERATING_SYSTEMS.MACOSX+" "+t.REGEX_VERSION_MAC)),n,i,u;return f&&(n=f[1].replace(/_/g,"."),i=[],n)?(u=r(n),u?(i=n.split(u),i[0]):n):t.UNKNOWN_VERSION}function r(n){return n.indexOf(".")>-1?".":n.indexOf("_")>-1?"_":null}return t._getOsName()===t.OPERATING_SYSTEMS.WINDOWS?n():t._getOsName()===t.OPERATING_SYSTEMS.MACOSX?i():t.UNKNOWN_VERSION},t.semanticContext=new f,t.firstLaunchTime=-1,t.BROWSERS={MSIE:"MSIE",CHROME:"Chrome",FIREFOX:"Firefox",SAFARI:"Safari",EDGE:"Edge",ELECTRON:"Electron",SKYPE_SHELL:"SkypeShell",PHANTOMJS:"PhantomJS",UNKNOWN:"Unknown"},t.OPERATING_SYSTEMS={WINDOWS:"Windows",MACOSX:"Mac OS X",WINDOWS_PHONE:"Windows Phone",WINDOWS_RT:"Windows RT",IOS:"iOS",ANDROID:"Android",LINUX:"Linux",UNKNOWN:"Unknown"},t.VERSION_MAPPINGS={5.1:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1","10.0":"10"},t.REGEX_VERSION="([\\d,.]+)",t.REGEX_VERSION_MAC="([\\d,_,.]+)",t.UNKNOWN_VERSION="Unknown",t.DEVICE_ID_COOKIE="MicrosoftApplicationsTelemetryDeviceId",t.FIRST_LAUNCH_TIME_COOKIE="MicrosoftApplicationsTelemetryFirstLaunchTime",t}(),!function(n){n[n.STARTED=0]="STARTED",n[n.ENDED=1]="ENDED"}(n.SessionState||(n.SessionState={})),r=(n.SessionState,function(){function r(){}return r.initialize=function(n){if(!r._initialized){if(!n)throw new t(1);r._defaultToken=n,r._config.collectorUrl||(r._config.collectorUrl="https://browser.pipe.aria.microsoft.com/Collector/3.0/"),i.Initialize(r._config),i.Start(),e.initialize(),r._initialized=!0}},r.initializeWithConfiguration=function(n,i){if(!i.collectorUrl)throw new t(4);r._config.collectorUrl=i.collectorUrl,r.initialize(n)},r.flush=function(n){i.Flush(n)},r.addCallbackListener=function(n){r._initialized&&i.AddListener(n)},r.setContext=function(n,t,i){r._contextProperties.setProperty(n,t,i)},r.isInitialized=function(){return r._initialized},r.getDefaultToken=function(){return r._defaultToken},r.getSemanticContext=function(){return r._semanticContext},r.__backToUninitialized=function(){r._config=new n._sender.TelemetryConfig,r._semanticContext=new f,r._contextProperties=new u,i=n._sender.TelemetryManagerFactory.CreateTelemetryManager(),r._initialized=!1},r._initialized=!1,r._defaultToken=null,r._config=new n._sender.TelemetryConfig,r._contextProperties=new u,r._semanticContext=new f,r}()),n.LogManager=r,s=function(){function o(t){this._initId=n.datamodels.utils.GetGuid(),this._sequence=0,this._tenantToken=null,this._contextProperties=new u,this._semanticContext=new f,this._sessionStartTime=0,this._sessionId=null,this._tenantToken=t?t:r.getDefaultToken()}return o.prototype.logEvent=function(n){if(!n.name)throw new t(2);var i=this._createEventRecord(n.name,n.eventType);this._addCustomPropertiesToEvent(i,n),this._sendRecord(i)},o.prototype.logFailure=function(n,i,r,u,f){if(!n)throw new t(5);if(!i)throw new t(6);var e=this._createEventRecord("failure","failure");e.Extension.Add("Failure.Signature",n),e.Extension.Add("Failure.Detail",i),r&&e.Extension.Add("Failure.Category",r),u&&e.Extension.Add("Failure.Id",u),this._addCustomPropertiesToEvent(e,f),this._sendRecord(e)},o.prototype.logPageView=function(n,i,r,u,f,e){if(!n)throw new t(7);if(!i)throw new t(8);var o=this._createEventRecord("pageview","pageview");o.Extension.Add("PageView.Id",n),o.Extension.Add("PageView.Name",i),r&&o.Extension.Add("PageView.Category",r),u&&o.Extension.Add("PageView.Uri",u),f&&o.Extension.Add("PageView.ReferrerUri",f),this._addCustomPropertiesToEvent(o,e),this._sendRecord(o)},o.prototype.logSession=function(i,r){var u,f;if(0!==i&&1!==i)throw new t(9);if(u=this._createEventRecord("session","session"),0===i){if(this._sessionStartTime>0)return;this._sessionStartTime=+new Date,this._sessionId=n.datamodels.utils.GetGuid(),u.Extension.Add("Session.Id",this._sessionId),u.Extension.Add("Session.State","Started")}else if(1===i){if(0==this._sessionStartTime)return;f=Math.floor((+new Date-this._sessionStartTime)/1e3),u.Extension.Add("Session.Duration",f.toString()),u.Extension.Add("Session.DurationBucket",this._getSessionDurationFromTime(f)),u.Extension.Add("Session.Id",this._sessionId),u.Extension.Add("Session.State","Ended"),this._sessionId=null,this._sessionStartTime=0}u.Extension.Add("Session.FirstLaunchTime",this._getISOString(new Date(e.firstLaunchTime))),this._addCustomPropertiesToEvent(u,r),this._sendRecord(u)},o.prototype.getSessionId=function(){return this._sessionId},o.prototype.setContext=function(n,t,i){this._contextProperties.setProperty(n,t,i)},o.prototype.getSemanticContext=function(){return this._semanticContext},o.prototype._getSessionDurationFromTime=function(n){return 0>n?"Undefined":3>=n?"UpTo3Sec":10>=n?"UpTo10Sec":30>=n?"UpTo30Sec":60>=n?"UpTo60Sec":180>=n?"UpTo3Min":600>=n?"UpTo10Min":1800>=n?"UpTo30Min":"Above30Min"},o.prototype._createEventRecord=function(t,i){var r=new n.datamodels.Record,u;return i||(i="custom"),r.EventType=t.toLowerCase(),r.Type=i.toLowerCase(),r.Extension.Add("EventInfo.Source","JS_default_source"),r.Extension.Add("EventInfo.InitId",this._initId),this._sequence++,r.Extension.Add("EventInfo.Sequence",this._sequence.toString()),r.Extension.Add("EventInfo.Name",t.toLowerCase()),u=new Date,r.Timestamp=n.datamodels.utils.GetTimeStampWithValue(u.getTime()),r.Extension.Add("EventInfo.Time",this._getISOString(u)),r.Extension.Add("EventInfo.SdkVersion","ACT-Web-JS-"+clienttelemetry_build.version),r},o.prototype._getISOString=function(n){function t(n){return 10>n?"0"+n:n.toString()}function i(n){return 10>n?"00"+n:100>n?"0"+n:n.toString()}return n.getUTCFullYear()+"-"+t(n.getUTCMonth()+1)+"-"+t(n.getUTCDate())+"T"+t(n.getUTCHours())+":"+t(n.getUTCMinutes())+":"+t(n.getUTCSeconds())+":"+i(n.getUTCMilliseconds())+"Z"},o.prototype._addCustomPropertiesToEvent=function(n,t){this._addSemanticContext(n,e.semanticContext),this._addSemanticContext(n,r._semanticContext),this._addSemanticContext(n,this._semanticContext),this._sessionId&&n.Extension.Add("Session.Id",this._sessionId),this._addEventPropertiesToEvent(n,r._contextProperties),this._addEventPropertiesToEvent(n,this._contextProperties),this._addEventPropertiesToEvent(n,t)},o.prototype._addSemanticContext=function(n,t){if(t&&t.contextMap.Count()>0)for(var r=t.contextMap.GetBuffer(),i=0;i<r.length;i++)"UserInfo.Id"==r[i].Key&&0!=t.piiKind?n.AddOrReplacePII(r[i].Key,r[i].Value,t.piiKind):n.Extension.AddOrReplace(r[i].Key,r[i].Value)},o.prototype._addEventPropertiesToEvent=function(t,i){var r,u;if(i&&(i.timestamp&&i.timestamp>=+new Date("1/1/2000")&&(t.Timestamp=n.datamodels.utils.GetTimeStampWithValue(i.timestamp),t.Extension.AddOrReplace("EventInfo.Time",new Date(i.timestamp).toISOString())),i.name&&(t.EventType=i.name.toLowerCase(),t.Extension.AddOrReplace("EventInfo.Name",i.name.toLowerCase())),r=i.properties,r&&r.length>0))for(u=0;u<r.length;u++)r[u].key&&"string"==typeof r[u].key&&(r[u].value||0==r[u].value||0==r[u].value||""==r[u].value)&&(this._isPii(r[u].pii)?(t.AddOrReplacePII(r[u].key,r[u].value.toString(),r[u].pii),t.Extension.Remove(r[u].key)):(t.Extension.AddOrReplace(r[u].key,r[u].value.toString()),t.PIIExtensions.Remove(r[u].key)))},o.prototype._isPii=function(t){var i,r;if(0==t)return!1;i=!1;for(r in n.datamodels.PIIKind)isNaN(r)||r==t&&(i=!0);return i},o.prototype._sendRecord=function(n){r.isInitialized()&&i.SendAsync(this._tenantToken,[n])},o}(),n.Logger=s}(n.telemetry||(n.telemetry={})),n.telemetry}(n.applications||(n.applications={})),n.applications}(microsoft||(microsoft={})),microsoft.applications.telemetry.LogManager.initialize(ariaToken);var LoggingEvents={pageLoad:"Page_Load",clientError:"Client_Error"},PageTypes={landingPage:"Landing_Page",searchResults:"Search_Results",pageNotFound:"Page_Not_Found",serviceError:"Service_Error"},EventProperties={eventType:"Event_Type"},ErrorEventProperties={errorEvent:"Error",errorMessage:"Error_Message",errorSourceUrl:"Error_Source_URL",errorSourceHostAndPathName:"Error_Source_Host_And_Path_Name",lineNumber:"Line_Number"},ClientSideLogging={ariaLogger:new microsoft.applications.telemetry.Logger,pageKeyValues:[],eventKeyValues:[],addPageProperty:function(n,t){this.pageKeyValues.push({key:n,value:t})},addEventProperty:function(n,t){this.eventKeyValues.push({key:n,value:t})},sendEvent:function(n){var t=this.pageKeyValues.concat(this.eventKeyValues);this.ariaLogger.logEvent({name:n,properties:t}),this.eventKeyValues=[]},logError:function(n,t,i){return!t||!n||(this.addEventProperty(EventProperties.eventType,ErrorEventProperties.error),this.addEventProperty(ErrorEventProperties.errorMessage,n),this.addEventProperty(ErrorEventProperties.errorSourceUrl,t),this.addEventProperty(ErrorEventProperties.errorSourceHostAndPathName,t.split("?")[0]),this.addEventProperty(ErrorEventProperties.lineNumber,i),this.sendEvent(LoggingEvents.clientError)),!0},addListeners:function(){var n=function(n){ClientSideLogging.logError(n.message,n.filename,n.lineno)},t=function(){ClientSideLogging.sendEvent(LoggingEvents.pageLoad)};window.addEventListener?(window.addEventListener("error",n),window.addEventListener("load",t)):window.attachEvent&&(window.attachEvent("error",n),window.attachEvent("load",t))}},PageProperties={ieDocumentMode:"IE_Doc_Mode",pageType:"Page_Type",pageCulture:"Page_Culture",pageUrl:"Page_Url",referrer:"Referrer",helpViewer:"Help_Viewer",region:"Machine_Region",machineId:"Machine_ID",build:"Site_Build"},HelpViewers={client:"Client",web:"Web"};ClientSideLogging.setPageProperties=function(n){this.addPageProperty(PageProperties.ieDocumentMode,document.documentMode?document.documentMode:"N/A"),this.addPageProperty(PageProperties.pageCulture,n.cultureName),this.addPageProperty(PageProperties.pageUrl,window.location.href),this.addPageProperty(PageProperties.referrer,document.referrer),this.addPageProperty(PageProperties.helpViewer,n.helpViewer),this.addPageProperty(PageProperties.machineId,n.machineId),this.addPageProperty(PageProperties.region,n.region),this.addPageProperty(PageProperties.build,n.build)}