!function(a,b){"use strict";if("object"==typeof exports)b(a,exports);else{a.Chronos=a.Chronos||{};b(a,a.Chronos)}}(void 0===window.lpTag?this:window.lpTag,function(a,b,c){"use strict";function d(a,b,c){var d=[];if(a[b]&&a[b].length)for(var e=0;e0){a.index>=a.eventBufferLimit&&(a.index=0);a.fired[a.index]=b;a.index++}else a.fired.push(b);a=null}}function j(a,b){var c=!1;if(!b){e("Ev listen id not spec for unregister","ERROR","Events");return null}for(var d in a)if(a.hasOwnProperty(d))for(var f=0;f0)for(var g=0;g0}function h(a,b,d){return function(){try{a.func.call(a.context,b,d);b=null;a.triggerOnce&&e(a);a=null}catch(b){c.log("Error executing "+d.eventName+" eventId: "+a.id+"e="+b.message,"ERROR","Events")}}}function i(a){c.storeEventData({triggerData:a,eventBufferLimit:k,attrName:n,fired:q,index:s})}var j,k,l,m="Events",n="eventName",o=0,p={},q=[],r="evId_",s=0;l=a&&a.appName||"*";j=!(!a||"boolean"!=typeof a.cloneEventData)&&a.cloneEventData;k=a&&!isNaN(a.eventBufferLimit)?a.eventBufferLimit:-1;this.once=b;this.hasFired=f;this.trigger=g;this.publish=g;this.bind=d;this.register=d;this.unbind=e;this.unregister=e}d||(b.Events=b.Events||e);return e});!function(a,b){"use strict";if("object"==typeof exports)b(a,exports,require("./EventsUtil").EventsUtil);else{a.Chronos=a.Chronos||{};b(a,a.Chronos,a.Chronos.EventsUtil)}}(void 0===window.lpTag?this:window.lpTag,function(a,b,c,d){"use strict";function e(a){var b=a.cmd[a.attrName];if(!b||!a.cmd.func||"function"!=typeof a.cmd.func||!f(a.cmd,b)){c.log("comply: has invalid params: command=["+b+"]","ERROR",a.loggerName);return null}if(a.lstnrs[b]&&a.lstnrs[b].length){c.log("comply: cannot comply because command already exist command="+b,"ERROR",a.loggerName);return null}var d=a.prefix+a.id++,e={id:d,func:a.cmd.func,context:a.cmd.context||null,appName:a.cmd.appName};a.lstnrs[b]=a.lstnrs[b]||[];a.lstnrs[b].push(e);c.log("Cmd comply: evName=["+b+"] appName="+e.appName,"DEBUG",a.loggerName);return d}function f(a,b){return!(b&&"*"===b||a.appName&&"*"===a.appName)}var g={bind:e,valid:f};d||(b.CommandsUtil=b.CommandsUtil||g);return g});!function(a,b){"use strict";if("object"==typeof exports)b(a,exports,require("./util/EventsUtil").EventsUtil,require("./util/CommandsUtil").CommandsUtil);else{a.Chronos=a.Chronos||{};b(a,a.Chronos,a.Chronos.EventsUtil,a.Chronos.CommandsUtil)}}(void 0===window.lpTag?this:window.lpTag,function(a,b,c,d,e){"use strict";function f(a){function b(a){"*"!==k&&(a.appName=a.appName||k);return d.bind({cmd:a,attrName:m,loggerName:l,prefix:q,id:n,lstnrs:o})}function e(a){"*"!==k&&(a.appName=a.appName||k);return c.unbind({unbindObj:a,attrName:m,loggerName:l,lstnrs:o})}function f(a,b){if(void 0===b){b=a;a=k}return c.hasFired(p,a,b)}function g(a,b){if(!a||void 0===a.cmdName||!d.valid(a,a.cmdName)){c.log("CMD name not spec for command","ERROR","Commands");return null}"*"!==k&&(a.appName=a.appName||k);a.passDataByRef=a.passDataByRef||!i;h(a);if(!o[a.cmdName])return!1;var e=c.getListeners(o,a.cmdName,a.appName);if(e.length>0)for(var f=0;f0}function h(a){c.storeEventData({triggerData:a,eventBufferLimit:j,attrName:m,fired:p,index:r})}var i,j,k,l="Commands",m="cmdName",n=0,o={},p=[],q="cmdId_",r=0;k=a&&a.appName||"*";i=!(!a||"boolean"!=typeof a.cloneEventData)&&a.cloneEventData;j=a&&!isNaN(a.eventBufferLimit)?a.eventBufferLimit:-1;this.hasFired=f;this.comply=b;this.stopComplying=e;this.command=g}e||(b.Commands=b.Commands||f);return f});!function(a,b){"use strict";if("object"==typeof exports)b(a,exports,require("./util/EventsUtil").EventsUtil,require("./util/CommandsUtil").CommandsUtil);else{a.Chronos=a.Chronos||{};b(a,a.Chronos,a.Chronos.EventsUtil,a.Chronos.CommandsUtil)}}(void 0===window.lpTag?this:window.lpTag,function(a,b,c,d,e){function f(a){function b(a){"*"!==k&&(a.appName=a.appName||k);return d.bind({cmd:a,attrName:m,loggerName:l,prefix:q,id:n,lstnrs:o})}function e(a){"*"!==k&&(a.appName=a.appName||k);return c.unbind({unbindObj:a,attrName:m,loggerName:l,lstnrs:o})}function f(a,b){if(void 0===b){b=a;a=k}return c.hasFired(p,a,b)}function g(a,b){var e;if(!a||void 0===a.reqName||!d.valid(a,a.reqName)){c.log("request: name not spec for command","ERROR","ReqRes");throw new Error("Invalid request object")}"*"!==k&&(a.appName=a.appName||k);a.passDataByRef=a.passDataByRef||!i;h(a);if(!o[a.reqName])return e;var f=c.getListeners(o,a.reqName,a.appName);if(f.length>0)for(var g=0;g0?c:1)*100;return{total:c,error:d,percent:b}}function j(){this.timer&&clearTimeout(this.timer);n.call(this);if(this.bucketIndex>this.bucketsNumber){this.bucketIndex=0;h.call(this)&&(this.state=d.HALF_OPEN)}this.timer=setTimeout(j.bind(this),this.bucket)}function k(){this.bucketIndex=0;this.bucket=this.slidingTimeWindow/this.bucketsNumber;this.timer&&clearTimeout(this.timer);this.timer=setTimeout(j.bind(this),this.bucket)}function l(){var a={};a[e.FAILURE]=0;a[e.SUCCESS]=0;a[e.TIMEOUT]=0;a[e.OUTAGE]=0;return a}function m(){return this.buckets[this.buckets.length-1]}function n(){this.bucketIndex++;this.buckets.push(l.call(this));this.buckets.length>this.bucketsNumber&&this.buckets.shift()}function o(a,b){return function(){if(!b.done){if(b.timer){clearTimeout(b.timer);b.timer=null;delete b.timer}m.call(this)[a]++;this.forced||r.call(this);b.done=!0}}.bind(this)}function p(a,b){var c={done:!1},d=o.call(this,e.SUCCESS,c),f=o.call(this,e.FAILURE,c),g=o.call(this,e.TIMEOUT,c);b=!isNaN(b)&&0this.tolerance;if(a.total>this.calibration&&b){this.state=d.OPEN;this.onopen(a)}}}return{initialize:a,run:b,close:f,open:c,reset:g,isOpen:h,calculate:i}}();b.STATE=d;Function.prototype.bind||(Function.prototype.bind=c);a.CircuitBreaker=a.CircuitBreaker||b});!function(a,b){"use strict";b("object"==typeof exports?exports:a)}(void 0===window.lpTag?this:window.lpTag,function(a){"use strict";function b(a){if(!1==this instanceof b)return new b(a);this.initialize(a)}b.prototype=function(){function a(a){function b(a,b){d.nostore=!0;c.call(d,b.key,b.value,b.ttl);delete d.nostore}var d=this,e=!1,f=0;if(!this.initialized){a=a||{};this.cache={};this.length=0;this.max=!isNaN(a.max)&&0=b)?c=setImmediate(a):!1===b?a():c=setTimeout(a,isNaN(b)||0>=b?0:parseInt(b,10));return function(){n(c)}}function n(a){var b=g(a);b&&("undefined"!=typeof clearImmediate?clearImmediate(b):clearTimeout(b))}function o(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c);return function(){p(a,b,c)}}function p(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent("on"+b,c)}function q(b,c,d){a&&"function"==typeof a.log&&a.log(b,c,d)}function r(a){function b(){}function c(){return e.apply(this instanceof b&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}var d,e;if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");d=Array.prototype.slice.call(arguments,1);e=this;b.prototype=this.prototype;c.prototype=new b;return c}var s="_xxxxxx-4xxx-yxxx";Function.prototype.bind||(Function.prototype.bind=r);var t={SEQUENCE_FORMAT:s,stringify:d,hasPostMessageObjectsSupport:e,createUniqueSequence:f,parseNumber:g,parseFunction:h,getHost:i,resolveOrigin:k,getURLParameter:l,delay:m,addEventListener:o,removeEventListener:p,log:q,bind:r};c||(b.PostMessageUtilities=b.PostMessageUtilities||t);return t});!function(a,b,c){"use strict";if("object"!=typeof exports){b.Chronos=b.Chronos||{};c(a,b.Chronos,b.Chronos.PostMessageUtilities)}}(this,void 0===window.lpTag?this:window.lpTag,function(a,b,c,d){"use strict";function e(a,b){if(!1==this instanceof e)return new e(a,b);this.initialize(a,b)}var f="LPPort_";e.prototype=function(){function b(b,d){if(!this.initialized){d=d||{};this.target=b||a.top;this.hosted=this.target===a||this.target===a.top;this.portId=c.createUniqueSequence(f+c.SEQUENCE_FORMAT);this.serialize=c.parseFunction(d.serialize,c.stringify);this.deserialize=c.parseFunction(d.deserialize,JSON.parse);this.initialized=!0}}function d(a){var b,d,e=g.call(this),f=this.target;if(a)try{this.hosted||(f=this.target.contentWindow);b=h.call(this,a);d=this.serialize(b);f.postMessage(d,e)}catch(a){c.log("Error while trying to post the message","ERROR","PostMessageChannelPolyfill");return!1}}function e(a){var b;if("function"==typeof this.onmessage){b=i.call(this,a);return this.onmessage(b)}}function g(){this.origin||(this.origin=c.resolveOrigin(this.target));return this.origin}function h(a){return{port:this.portId,message:a}}function i(a){var b;if(a&&a.data)try{b=this.deserialize(a.data);if(b.port&&0===b.port.indexOf(f))return{origin:a.origin,data:b.message}}catch(a){c.log("Error while trying to deserialize the message","ERROR","PostMessageChannelPolyfill")}return b||a}return{initialize:b,postMessage:d,receive:e}}();d||(b.PostMessageChannelPolyfill=b.PostMessageChannelPolyfill||e);return e});!function(a,b,c){"use strict";if("object"!=typeof exports){b.Chronos=b.Chronos||{};c(a,b.Chronos,b.Chronos.PostMessageUtilities,b.Chronos.PostMessageChannelPolyfill)}}(this,void 0===window.lpTag?this:window.lpTag,function(a,b,c,d,e){"use strict";function f(a,b){if(!1==this instanceof f)return new f(a,b);this.initialize(a,b)}var g="LPTKN",h="HNDSK";f.prototype=function(){function b(b,e){var f,g;if(!this.initialized){this.hosted=!1;this.messageQueue=[];b=b||{};g=m.call(this,b,e);if(!x.call(this)){this.receiver=new d(this.target,{serialize:this.serialize,deserialize:this.deserialize});this.receiver.onmessage=g}if(this.hosted||!x.call(this)){f=o(g).bind(this);this.removeListener=c.addEventListener(a,"message",f)}else x.call(this)&&this.channelFactory();!this.target||this.loading||this.ready||l.call(this,g,f);this.initialized=!0}}function e(a,b){var d=c.parseFunction(this[a]);if(d){b||d.call(this);this[a]=void 0;delete this[a]}}function f(a){e.call(this,"rmtimer",a)}function i(a){e.call(this,"rmload",a)}function j(){if(!this.disposed){if(this.removeListener){this.removeListener.call(this);this.removeListener=void 0}if(this.targetUrl&&this.target||this.removeDispose)try{this.targetContainer?this.targetContainer.removeChild(this.target):document.body.removeChild(this.target)}catch(a){c.log("Error while trying to remove the iframe from the container","ERROR","PostMessageChannel")}f.call(this);i.call(this);this.messageQueue.length=0;this.messageQueue=void 0;this.channel=void 0;this.onready=void 0;this.disposed=!0}}function k(a,b,d){var e,f;if(!this.disposed)try{if(a){if(this.ready||d){e=b||this.receiver;f=p.call(this,a);e.postMessage(f);return!0}if(this.maxConcurrency>=this.messageQueue.length){this.messageQueue.push(a);return!0}return!1}}catch(a){c.log("Error while trying to post the message","ERROR","PostMessageChannel");return!1}}function l(b,e){var f;try{f=y.call(this)}catch(a){f=!1}if(!f){this.channel=!1;this.receiver=new d(this.target,{serialize:this.serialize,deserialize:this.deserialize});this.receiver.onmessage=b;if(!this.hosted){e=o(b).bind(this);this.removeListener=c.addEventListener(a,"message",e)}y.call(this)}this.handshakeAttempts--;c.delay(function(){if(!this.disposed&&!this.hosted&&!this.ready){this.rmload=C.call(this,this.target);this.rmtimer=c.delay(y.bind(this,this.handshakeInterval),this.handshakeInterval)}}.bind(this))}function m(b,d){var e;n.call(this,b);e=w(d).bind(this);this.channelFactory=r.call(this,e);if(!b.target||(b.target!==a||b.target===a.top)&&"undefined"!=typeof Window&&b.target instanceof Window){this.hosted=!0;this.target=b.target||a.top}else if(b.target.contentWindow)this.target=b.target;else if(b.target.url){this.targetUrl=b.target.url;this.targetOrigin=this.targetOrigin||c.getHost(b.target.url)}this.hosted||(this.token=c.createUniqueSequence(g+c.SEQUENCE_FORMAT));if(this.targetUrl){this.loading=!0;this.targetContainer=b.target.container||document.body;this.target=B.call(this,b.target,this.targetContainer)}return e}function n(a){this.serialize=c.parseFunction(a.serialize,c.stringify);this.deserialize=c.parseFunction(a.deserialize,JSON.parse);this.targetOrigin=a.targetOrigin;this.maxConcurrency=c.parseNumber(a.maxConcurrency,100);this.handshakeInterval=c.parseNumber(a.handshakeInterval,5e3);this.handshakeAttemptsOrig=c.parseNumber(a.handshakeAttempts,3);this.handshakeAttempts=this.handshakeAttemptsOrig;this.hostParam=a.hostParam;this.channel=void 0!==a.channel?a.channel:q();this.useObjects=a.useObjects;this.onready=v(a.onready,a.target).bind(this);this.removeDispose=a.removeDispose}function o(a){return function(b){var d,e;if(b.ports&&0