/* Minification failed. Returning unminified contents.
(8,3-7): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: 'occe': occe
 */
// Wrapper for wedcs object to allow for modification of strings in the wedcs object that have broken our data stream.
// See https://office.visualstudio.com/MAX/_workitems/edit/1120904 and https://office.visualstudio.com/MAX/_workitems/edit/998519
// for additional details. This wrapper can be removed when SOC and TOC move from WEDCS telemetry to ASIMOV.
(function ($) {
	'use strict';

	$(function () {
		occe = occe || {};
		occe.WedcsWrapper = (function () {

			var truncateStringLength = 255;
			var cnValue = 'wcs.cn';
			var ctValue = 'wcs.ct';
			var truncateValues = [
				cnValue,
				ctValue
			];

			function initialize() {
				var copyOfMscomGetStrFromArray = window.MscomGetStrFromArray || $.noop;
				window.MscomGetStrFromArray = function (args) {
					removeWhiteSpaceInWcscnValue(args);
					truncateWscValue(args, truncateValues);
					return copyOfMscomGetStrFromArray(args);
				}
			}

			function removeWhiteSpaceInWcscnValue(args) {
				if (args[cnValue]) {
					args[cnValue] = args[cnValue].trim().replace(/\s+/g, ' ');
				}
			}

			function truncateWscValue(args, valueNames) {
				for (var i = 0; i < valueNames.length; i++) {
					if (args[valueNames[i]]) {
						args[valueNames[i]] = args[valueNames[i]].substring(0, truncateStringLength);
					}
				}
			}

			return {
				initialize: initialize,
				removeWhiteSpaceInWcscnValue: removeWhiteSpaceInWcscnValue,
				truncateWscValue: truncateWscValue,
				truncateStringLength: truncateStringLength
			};

		})();
	});
})(jQuery);;//Initialization of wedcsWrapper to sanitize data in wedcs object
(function ($) {
	'use strict';

	$(function () {
		occe.WedcsWrapper.initialize();
	});
})(jQuery);;