function createBindingHandler(n){return{init:function(t,i,r,u,f){var e={};n.init.call(e,t,i,r,u,f);n.update&&ko.computed({read:n.update.bind(e,t,i,r,u,f),disposeWhenNodeIsRemoved:t})}}}var SignalRClient,Guid,FrameEventsBus,FrameEventType,FrameEventsHelper;(function(n){var i={transport:["serverSentEvents","foreverFrame"]},r=2e3,u=3,t,f;(function(n){n[n.NotInitiated=0]="NotInitiated";n[n.Connected=1]="Connected";n[n.Disconnected=2]="Disconnected";n[n.Reconnecting=3]="Reconnecting"})(t=n.ConnectionStatus||(n.ConnectionStatus={}));f=function(){function n(n,f,e){var o=this;f===void 0&&(f="contentUpdateHub");e===void 0&&(e=!1);this.runningJob=!1;this.retryAmount=0;this.resume=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];o.connectionState||console.error("No connection state to resume from, calling start again");o.runningJob=!0;o.currentStatus=t.Reconnecting;o.hubConnection.start(i).done(function(){clearTimeout(o.retryDisconnectTimeoutId);o.retryAmount=0;o.currentStatus=t.Connected;o.hubProxy.invoke.apply(o.hubProxy,["resume",JSON.stringify(o.connectionState)].concat(r)).fail(function(n){if(o.runningJob&&o.props.onSignalRCallError)o.props.onSignalRCallError(n)})}).fail(function(n){if(o.props.onSignalRConnectionError)o.props.onSignalRConnectionError(n)})};this.onDisconnect=function(){if(o.runningJob&&o.currentStatus===t.Connected&&o.props.onResume)if(o.retryAmount<=u)o.retryDisconnectTimeoutId=setTimeout(function(){o.props.onResume(o.resume);o.retryAmount++},r);else if(o.currentStatus=t.Connected,o.runningJob=!1,o.props.onSignalRConnectionError)o.props.onSignalRConnectionError("Couldn't reconnect")};this.onReconnect=function(){if(o.runningJob){if(o.currentStatus=t.Reconnecting,o.props.onResume)o.props.onResume(o.resume);o.props.onSignalRReconnected&&o.props.onSignalRReconnected()}};this.props=n;this.hubConnection=$.hubConnection();this.hubProxy=this.hubConnection.createHubProxy(f);this.hubConnection.logging=e;this.clientEvents()}return n.prototype.start=function(){for(var n=this,o=[],f=0;f<arguments.length;f++)o[f]=arguments[f];var s=0,h=function(){n.hubProxy.invoke.apply(n.hubProxy,["start"].concat(o)).fail(function(t){if(n.props.onSignalRCallError)n.props.onSignalRCallError(t)})},e=function(){n.hubConnection.start(i).done(function(){n.currentStatus=t.Connected;n.retryAmount=0;clearTimeout(n.retryStartTimeoutId);h()}).fail(c)},c=function(t){n.retryStartTimeoutId=setTimeout(function(){if(s<=u){if(n.props.onSignalRReconnecting)n.props.onSignalRReconnecting(t);s++;e()}else if(n.props.onSignalRConnectionError)n.props.onSignalRConnectionError(t)},r)};this.currentStatus===t.Connected?h():(e(),setTimeout(function(){n.props.onResume&&!n.connectionState&&(n.stop(),n.currentStatus=t.Reconnecting,e())},5e3));this.runningJob=!0},n.prototype.stop=function(){this.runningJob=!1;this.currentStatus=t.Disconnected;this.hubConnection.stop()},n.prototype.clientEvents=function(){var i=this,n=this.props;this.hubProxy.on("connectionState",function(t){i.connectionState=t;n.onConnectionStateSet&&n.onConnectionStateSet.apply(null,t)});this.hubProxy.on("exception",function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];n.onException&&n.onException.apply(null,r);i.runningJob=!1;i.hubConnection.stop()});this.hubProxy.on("progress",function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];n.onProgress&&n.onProgress.apply(null,i)});this.hubProxy.on("finish",function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];n.onFinish&&n.onFinish.apply(null,r);i.runningJob=!1;i.hubConnection.stop()});this.hubConnection.error(function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];n.onSignalRError&&n.onSignalRError.apply(null,i)});this.hubConnection.reconnecting(function(){this.status=t.Reconnecting;n.onSignalRReconnecting&&n.onSignalRReconnecting.apply(null,arguments)});this.hubConnection.connectionSlow(function(){n.onSignalRConnectionIssues&&n.onSignalRConnectionIssues.apply(null,arguments)});this.hubConnection.reconnected(this.onReconnect);this.hubConnection.disconnected(this.onDisconnect)},n}();n.Client=f})(SignalRClient||(SignalRClient={}));ko.bindingHandlers.stopBinding={init:function(){return{controlsDescendantBindings:!0}}};ko.bindingHandlers.onLeave={init:function(n,t,i,r){var u=t();$(n).on("keydown",function(n){var t=n.which?n.which:n.keyCode;return[9,13].indexOf(t)>-1&&!n.shiftKey&&u.call(r),!0})}},function(n){function u(){return i()}function i(n){n===void 0&&(n=0);var u=f();return t[u]?n>=r?"":i(++n):(t[u]=u,u)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n==="x"?t:t&3|8;return i.toString(16)})}var t={},r=10;n.get=u}(Guid||(Guid={}));String.prototype.endsWith||(String.prototype.endsWith=function(n,t){var i=t;return(void 0===t||t>this.length)&&(i=this.length),this.substring(i-n.length,i)===n}),function(n){var i=[];n.notify=function(n,t,i){void 0===i&&(i=window.parent);i.postMessage(JSON.stringify({type:n,params:t,source:window.location.toString()}),"*")};n.subscribe=function(n,t,r){i.push({type:n,eventSourceFrameSelector:t,callback:r})};window.addEventListener("message",function(n){var e=r(n),o,s,t,f;if(e)for(o=0,s=i;o<s.length;o++)if(t=s[o],t.type===e.type){if(f=document.querySelector(t.eventSourceFrameSelector),t.eventSourceFrameSelector&&!f)continue;t.eventSourceFrameSelector&&!u(e.source,f&&f.getAttribute("src"))||t.callback({frame:f,params:e.params})}});var r=function(n){if(!t(n.origin))return null;try{if(n.data&&"string"==typeof n.data){var i=JSON.parse(n.data);if(i.type&&i.source)return i}}catch(n){return null}return null},u=function(n,t){if(!t)return!0;var r=-1===n.indexOf("?")?n:n.split("?")[0],i=-1===t.indexOf("?")?t:t.split("?")[0];return r.indexOf("http://localhost")>-1&&n!==window.location.toString()||(0!==i.indexOf("http")?0===i.indexOf("//")?r===window.location.protocol+i:r===window.location.origin+i:r===i)},t=function(n){var i,r,u;if(n.indexOf("?")>-1)return t(n.substring(0,n.indexOf("?")));if(n.indexOf("#")>-1)return t(n.substring(0,n.indexOf("#")));if(n.indexOf("http://localhost")>-1)return!0;for(i=0,r=["uptrends.com","uptrends.nl","uptrends.de","uptrends.fr","uptrends.lan","uptrends.net"];i<r.length;i++)if(u=r[i],n.endsWith(u))return!0;return!1}}(FrameEventsBus||(FrameEventsBus={}));!function(n){n.RESIZE="SIZE";n.SIZEREQUEST="SIZEREQUEST";n.GETMETADATA="GET-METADATA";n.SETMETADATA="SET-METADATA";n.SIGNUPANALYTICS="SIGNUPANALYTICS";n.SIGNUPSUCCESS="SUCCESS";n.RequestParentUrl="RequestParentUrl";n.ParentUrlResponse="ParentUrlResponse";n.RequestParentParams="RequestParentParams";n.ParentParamsResponse="ParentParamsResponse"}(FrameEventType||(FrameEventType={}));FrameEventsHelper=function(){function n(){}return n.HandleFrameEvents=function(n,t){var u=this,r,i;void 0===t&&(t="{}");r={};try{r=JSON.parse(t)}catch(n){throw Error("Invalid parameter string passed to FrameEventsHelper: "+t+". "+n.toString());}FrameEventsBus.subscribe(FrameEventType.RESIZE,n,function(n){n.frame.style.height=n.params.height+"px"});FrameEventsBus.subscribe(FrameEventType.SIGNUPANALYTICS,n,function(n){"function"==typeof registerSignup&&n.params&&n.params.data&&window.registerSignup(n.params.data)});FrameEventsBus.subscribe(FrameEventType.GETMETADATA,n,function(n){u.EmitMetadata(n.frame.contentWindow)});i=document.querySelector(n);i&&(i.addEventListener("load",function(){FrameEventsBus.notify(FrameEventType.SIZEREQUEST,null,i.contentWindow);window.requestAnimationFrame(function(){FrameEventsBus.notify(FrameEventType.SIZEREQUEST,null,i.contentWindow)});setTimeout(function(){FrameEventsBus.notify(FrameEventType.SIZEREQUEST,null,i.contentWindow)},1e3)}),FrameEventsBus.subscribe(FrameEventType.RequestParentUrl,n,function(){FrameEventsBus.notify(FrameEventType.ParentUrlResponse,{url:window.location.href},i.contentWindow)}),FrameEventsBus.subscribe(FrameEventType.RequestParentParams,n,function(n){var e={},t,f,u,o;if(n.params.paramNames){for(t=0,f=n.params.paramNames;t<f.length;t++)u=f[t],o=ToolsHelpers.getQueryStringParameter(u),e[u]=o||r[u];FrameEventsBus.notify(FrameEventType.ParentParamsResponse,e,i.contentWindow)}}))},n.EmitMetadata=function(n){var t=document.querySelector("#cloudamp__data__c");FrameEventsBus.notify(FrameEventType.SETMETADATA,{CloudAmp:t.value},n)},n.SupplyAppAuthToken=function(n){FrameEventsBus.notify(FrameEventType.SIGNUPSUCCESS,n)},n}();Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(n){var i,u,f,t,r;if(this==null)throw new TypeError('"'+this+'" is null or not defined');if(i=Object(this),u=i.length>>>0,typeof n!="function")throw new TypeError("predicate must be a function");for(f=arguments[1],t=0;t<u;){if(r=i[t],n.call(f,r,t,i))return r;t++}return undefined},configurable:!0,writable:!0})