var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),dps;(function(n){var t;(function(n){"use strict";var t=function(){function n(n){var r,t,i;this._enabled=!1;this._eventLog="";this.subscribed=!1;r=this;t=!!n;typeof n=="undefined"&&(i=this.decodeUrlParams(),typeof i=="object"&&i!==null&&typeof i.logevents!="undefined"&&(t=!0));this.enabled(t);this.logLine("logger: ctor()",!0);t&&this.subscribeToWindowOnError()}return n.prototype.enabled=function(n){if(arguments.length>0)this._enabled=n;else return this._enabled},n.prototype.eventLog=function(n){if(arguments.length>0)this._eventLog=n;else return this._eventLog},n.prototype.subscribeToWindowOnError=function(){if(this.subscribed)return!1;this.subscribed=!0;this.logLine("logger: subscr()",!0);this.windowOnErrorOriginal=window.onerror;var n=this;window.onerror=function(t,i,r,u,f){try{n.enabled()&&n.logLine("ERR: "+t+"\r\n  Script: "+i+"\r\n  Line: "+r+"\r\n  Column: "+u+"\r\n  StackTrace: "+f)}catch(e){}if(typeof n.windowOnErrorOriginal=="function")return n.windowOnErrorOriginal.apply(this,arguments)};window.addEventListener("error",function(t){try{var r=t,i=t.target,f="",u="";i&&(i.tagName&&(u+="\r\n  TagName: "+i.tagName),i.src&&(u+="\r\n  src: "+i.src));f=r.error?r.error.stack?r.error.stack:r.error.toString():"Target error";n.logLine("ERR: "+f+u+"")}catch(t){}},!0)},n.prototype.decodeUrlParams=function(){for(var n,r=/\+/g,u=/([^&=]+)=?([^&]*)/g,t=function(n){return decodeURIComponent(n.replace(r," "))},f=window.location.search.substring(1),i={};n=u.exec(f);)i[t(n[1]).toLowerCase()]=t(n[2]);return i},n.prototype.getTimestamp=function(){var n,i;if(typeof moment=="function"){var t=moment(),r=t.toDate(),u=r.getTime();return u.toString()+" "+t.toString()}return n=new Date,i=n.getTime(),i.toString()+" "+n.toString()},n.prototype.logLine=function(n,t){if(t||this.enabled()){var i=this.getTimestamp()+" "+n+"\r\n";this.eventLog(this.eventLog()+i)}},n.prototype.clear=function(){this.eventLog("")},n.prototype.convertToKoObservable=function(){ko.isObservable(this.enabled)||(this.enabled=ko.observable(this._enabled),this.eventLog=ko.observable(this._eventLog))},n}(),i;n.JsLogger=t;i=function(n){function t(t){var i=n.call(this,t)||this;return i.convertToKoObservable(),i}return __extends(t,n),t}(t);n.JsLoggerKo=i})(t=n.jslogger||(n.jslogger={}))})(dps||(dps={}))