UNPKG

lightstreamer-client-web

Version:

This package includes the resources needed to write a Lightstreamer client.

12 lines 267 kB
/** * @preserve * LIGHTSTREAMER - www.lightstreamer.com * Lightstreamer Web Client * Version 9.2.3+20250225 * Copyright (c) Lightstreamer Srl. All Rights Reserved. * Contains: LightstreamerClient, Subscription, ConsoleLogLevel, * ConsoleLoggerProvider, Logger, LoggerProvider, ClientListener, * ClientMessageListener, ItemUpdate, SubscriptionListener * UMD */ !function(t,e){var s,i=(s=function(t){"use strict";function e(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var s=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),s}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;const s=t=>(e,s)=>(t.set(e,s),s),i=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,r=2*n,a=(t,e)=>s=>{const a=e.get(s);let o=void 0===a?s.size:a<r?a+1:0;if(!s.has(o))return t(s,o);if(s.size<n){for(;s.has(o);)o=Math.floor(Math.random()*r);return t(s,o)}if(s.size>i)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;s.has(o);)o=Math.floor(Math.random()*i);return t(s,o)},o=new WeakMap,h=a(s(o),o),c=t=>void 0!==t.method&&"call"===t.method,l=t=>null===t.error&&"number"==typeof t.id,u=t=>{const e=new Map([[0,()=>{}]]),s=new Map([[0,()=>{}]]),i=new Map,n=new Worker(t);return n.addEventListener("message",(({data:t})=>{if(c(t)){const{params:{timerId:n,timerType:r}}=t;if("interval"===r){const t=e.get(n);if("number"==typeof t){const e=i.get(t);if(void 0===e||e.timerId!==n||e.timerType!==r)throw new Error("The timer is in an undefined state.")}else{if(void 0===t)throw new Error("The timer is in an undefined state.");t()}}else if("timeout"===r){const t=s.get(n);if("number"==typeof t){const e=i.get(t);if(void 0===e||e.timerId!==n||e.timerType!==r)throw new Error("The timer is in an undefined state.")}else{if(void 0===t)throw new Error("The timer is in an undefined state.");t(),s.delete(n)}}}else{if(!l(t)){const{error:{message:e}}=t;throw new Error(e)}{const{id:n}=t,r=i.get(n);if(void 0===r)throw new Error("The timer is in an undefined state.");const{timerId:a,timerType:o}=r;i.delete(n),"interval"===o?e.delete(a):s.delete(a)}}})),{clearInterval:t=>{const s=h(i);i.set(s,{timerId:t,timerType:"interval"}),e.set(t,s),n.postMessage({id:s,method:"clear",params:{timerId:t,timerType:"interval"}})},clearTimeout:t=>{const e=h(i);i.set(e,{timerId:t,timerType:"timeout"}),s.set(t,e),n.postMessage({id:e,method:"clear",params:{timerId:t,timerType:"timeout"}})},setInterval:(t,s=0)=>{const i=h(e);return e.set(i,(()=>{t(),"function"==typeof e.get(i)&&n.postMessage({id:null,method:"set",params:{delay:s,now:performance.now(),timerId:i,timerType:"interval"}})})),n.postMessage({id:null,method:"set",params:{delay:s,now:performance.now(),timerId:i,timerType:"interval"}}),i},setTimeout:(t,e=0)=>{const i=h(s);return s.set(i,t),n.postMessage({id:null,method:"set",params:{delay:e,now:performance.now(),timerId:i,timerType:"timeout"}}),i}}},_=(t,e)=>{let s=null;return()=>{if(null!==s)return s;const i=new Blob([e],{type:"application/javascript; charset=utf-8"}),n=URL.createObjectURL(i);return s=t(n),setTimeout((()=>URL.revokeObjectURL(n))),s}},d=_(u,'(()=>{"use strict";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:"call",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener("message",(i=>{let{data:s}=i;try{if("clear"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if("interval"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));(e=>{const r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if("set"!==s.method)throw new Error(\'The given method "\'.concat(s.method,\'" is not supported\'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if("interval"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,"interval"))})(i,a,n);else{if("timeout"!==d)throw new Error(\'The given type "\'.concat(d,\'" is not supported\'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,"timeout"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();'),f=t=>d().clearInterval(t),m=t=>d().clearTimeout(t),p=(...t)=>d().setInterval(...t),g=(...t)=>d().setTimeout(...t);var v,S=e(Object.freeze({__proto__:null,clearInterval:f,clearTimeout:m,setInterval:p,setTimeout:g})),y={exports:{}};function b(){return v||(v=1,t=y,function(e,s){s(t.exports)}(0,(function(t){var e,s,i,n;function r(t){Error.call(this,t),this.message=t}function a(t){Error.call(this,t),this.message=t}function o(t){var e,s;if(n(t))return t.slice();if(null===t)return t;if("object"==typeof t){for(s in e={},t)Object.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}return t}function h(t,e){var s;if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){var i=n(t);if(i!==n(e))return!1;if(i){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!h(t[r],e[r]))return!1;return!0}for(s in t)if(Object.hasOwnProperty(t,s)&&(!Object.hasOwnProperty(e,s)||!h(t[s],e[s])))return!1;for(s in e)if(Object.hasOwnProperty(e,s)&&!Object.hasOwnProperty(t,s))return!1;return!0}return!1}function c(t){var e,s;if(!t.op)throw new r("Operation missing!");if(!i.hasOwnProperty(t.op))throw new r("Invalid operation!");if(!("path"in t))throw new r("Path missing!");for(s=i[t.op],e=0;e<s.length;e++)if(!(s[e]in t))throw new r(t.op+" must have key "+s[e])}function l(t,e){c(t);var i=t.op,n=new s(t.path),o=t.value,l=t.from?new s(t.from):null;switch(i){case"add":return function(t){return n.add(t,o,e)};case"remove":return function(t){return n.remove(t,e)};case"replace":return function(t){return n.replace(t,o,e)};case"move":if(n.subsetOf(l))throw new r("destination must not be a child of source");return function(t){var s=l.get(t),i=l.remove(t,e);return n.add(i,s,e)};case"copy":return function(t){var s=l.get(t);return n.add(t,s,e)};case"test":return function(t){if(!h(n.get(t),o))throw new a("Test operation failed. Value did not match.");return t}}}n=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},t.apply_patch=function(t,s){return new e(s).apply(t)},t.InvalidPatch=r,r.prototype=new Error,t.PatchApplyError=a,a.prototype=new Error,t.JSONPointer=s=function(t){var e,s,i=[];if(""!==(s=t.split("/"))[0])throw new r("JSONPointer must start with a slash (or be an empty string)!");for(e=1;e<s.length;e++)i[e-1]=s[e].replace(/~1/g,"/").replace(/~0/g,"~");this.path=i,this.length=i.length},s.prototype._get_segment=function(t,e){var s=this.path[t];if(n(e))if("-"===s)s=e.length;else{if(!s.match(/^0$|^[1-9][0-9]*$/))throw new a("Expected a number to segment an array");s=parseInt(s,10)}return s},s.prototype._action=function(t,e,s){var i=this;function r(t,h){var c,l;if(s||(t=o(t)),c=i._get_segment(h,t),h==i.path.length-1)t=e(t,c);else{if(n(t)){if(t.length<=c)throw new a("Path not found in document")}else{if("object"!=typeof t)throw new a("Path not found in document");if(!Object.hasOwnProperty.call(t,c))throw new a("Path not found in document")}l=r(t[c],h+1),s||(t[c]=l)}return t}return r(t,0)},s.prototype.add=function(t,e,s){return 0===this.length?e:this._action(t,(function(t,s){if(n(t)){if(s>t.length)throw new a("Add operation must not attempt to create a sparse array!");t.splice(s,0,e)}else t[s]=e;return t}),s)},s.prototype.remove=function(t,e){if(0!==this.length)return this._action(t,(function(t,e){if(!Object.hasOwnProperty.call(t,e))throw new a("Remove operation must point to an existing value!");return n(t)?t.splice(e,1):delete t[e],t}),e)},s.prototype.replace=function(t,e,s){return 0===this.length?e:this._action(t,(function(t,s){if(!Object.hasOwnProperty.call(t,s))throw new a("Replace operation must point to an existing value!");return n(t)?t.splice(s,1,e):t[s]=e,t}),s)},s.prototype.get=function(t){var e;return 0===this.length?t:(this._action(t,(function(t,s){if(!Object.hasOwnProperty.call(t,s))throw new a("Path not found in document");return e=t[s],t}),!0),e)},s.prototype.subsetOf=function(t){if(this.length<=t.length)return!1;for(var e=0;e<t.length;e++)if(t.path[e]!==this.path[e])return!1;return!0},i={add:["value"],replace:["value"],test:["value"],remove:[],move:["from"],copy:["from"]},t.JSONPatch=e=function(t,e){this._compile(t,e)},e.prototype._compile=function(t,e){var s,i=this;if(this.compiledOps=[],"string"==typeof t&&(t=JSON.parse(t)),!n(t))throw new r("Patch must be an array of operations");for(s=0;s<t.length;s++){var a=l(t[s],e);i.compiledOps.push(a)}},t.JSONPatch.prototype.apply=function(t){var e;for(e=0;e<this.compiledOps.length;e++)t=this.compiledOps[e](t);return t}}))),y.exports;var t}var w=function(){};w.prototype={fatal:function(t,e){},isFatalEnabled:function(){},error:function(t,e){},isErrorEnabled:function(){},warn:function(t,e){},isWarnEnabled:function(){},info:function(t,e){},isInfoEnabled:function(){},debug:function(t,e){},isDebugEnabled:function(){},trace:function(t,e){},isTraceEnabled:function(){}};var E=function(){};function T(){}function R(){}E.prototype={getLogger:function(t){}},T.prototype={onServerError:function(t,e){},onStatusChange:function(t){},onPropertyChange:function(t){},onListenStart:function(){},onListenEnd:function(){},onServerKeepalive:function(){}},R.prototype={onAbort:function(t,e){},onError:function(t){},onDiscarded:function(t){},onDeny:function(t,e,s){},onProcessed:function(t,e){}};var I=function(){};I.prototype={getItemName:function(){},getItemPos:function(){},getValue:function(t){},getValueAsJSONPatchIfAvailable:function(t){return null},isValueChanged:function(t){},isSnapshot:function(){},forEachChangedField:function(t){},forEachField:function(t){}};var x=function(){};x.prototype={onItemUpdate:function(t){},onItemLostUpdates:function(t,e,s){},onCommandSecondLevelItemLostUpdates:function(t,e){},onEndOfSnapshot:function(t,e){},onClearSnapshot:function(t,e){},onSubscription:function(){},onUnsubscription:function(){},onSubscriptionError:function(t,e){},onCommandSecondLevelSubscriptionError:function(t,e,s){},onListenStart:function(){},onListenEnd:function(){},onRealMaxFrequency:function(t){}};var C={};!function(t){var e,s=function(){return B.__string_rec(this,"")},i=i||{};function n(t,e){var s=Object.create(t);for(var i in e)s[i]=e[i];return e.toString!==Object.prototype.toString&&(s.toString=e.toString),s}var r=function(t,e){this.r=new RegExp(t,e.split("u").join(""))};r.__name__=!0,r.prototype={match:function(t){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(t),this.r.s=t,null!=this.r.m},__class__:r};var a=function(){};a.__name__=!0,a.dateStr=function(t){var e=t.getMonth()+1,s=t.getDate(),i=t.getHours(),n=t.getMinutes(),r=t.getSeconds();return t.getFullYear()+"-"+(e<10?"0"+e:""+e)+"-"+(s<10?"0"+s:""+s)+" "+(i<10?"0"+i:""+i)+":"+(n<10?"0"+n:""+n)+":"+(r<10?"0"+r:""+r)},a.cca=function(t,e){var s=t.charCodeAt(e);if(s==s)return s},a.substr=function(t,e,s){if(null==s)s=t.length;else if(s<0){if(0!=e)return"";s=t.length+s}return t.substr(e,s)},a.remove=function(t,e){var s=t.indexOf(e);return-1!=s&&(t.splice(s,1),!0)},a.now=function(){return Date.now()};var o=function(t,e){this.min=t,this.max=e};o.__name__=!0,o.prototype={hasNext:function(){return this.min<this.max},next:function(){return this.min++},__class__:o};var h=function(){};h.__name__=!0,h.has=function(t,e){for(var s=vs(t);s.hasNext();)if(s.next()==e)return!0;return!1},h.exists=function(t,e){for(var s=vs(t);s.hasNext();)if(e(s.next()))return!0;return!1},h.count=function(t,e){var s=0;if(null==e)for(var i=vs(t);i.hasNext();)i.next(),++s;else for(var n=vs(t);n.hasNext();)e(n.next())&&++s;return s},h.empty=function(t){return!vs(t).hasNext()},h.find=function(t,e){for(var s=vs(t);s.hasNext();){var i=s.next();if(e(i))return i}return null},Math.__name__=!0;var c=function(){};c.__name__=!0,c.field=function(t,e){try{return t[e]}catch(t){return null}},c.fields=function(t){var e=[];if(null!=t){var s=Object.prototype.hasOwnProperty;for(var i in t)"__id__"!=i&&"hx__closures__"!=i&&s.call(t,i)&&e.push(i)}return e},c.copy=function(t){if(null==t)return null;for(var e={},s=0,i=c.fields(t);s<i.length;){var n=i[s];++s,e[n]=c.field(t,n)}return e};var l=function(){};l.__name__=!0,l.string=function(t){return B.__string_rec(t,"")},l.parseInt=function(t){var e=parseInt(t);return isNaN(e)?null:e},l.random=function(t){return t<=0?0:Math.floor(Math.random()*t)};var u=function(){this.b=""};u.__name__=!0,u.prototype={__class__:u};var _=function(){};_.__name__=!0,_.startsWith=function(t,e){return t.length>=e.length&&0==t.lastIndexOf(e,0)},_.endsWith=function(t,e){var s=e.length,i=t.length;return i>=s&&t.indexOf(e,i-s)==i-s},_.isSpace=function(t,e){var s=a.cca(t,e);return s>8&&s<14||32==s},_.ltrim=function(t){for(var e=t.length,s=0;s<e&&_.isSpace(t,s);)++s;return s>0?a.substr(t,s,e-s):t},_.rtrim=function(t){for(var e=t.length,s=0;s<e&&_.isSpace(t,e-s-1);)++s;return s>0?a.substr(t,0,e-s):t},_.trim=function(t){return _.ltrim(_.rtrim(t))},_.replace=function(t,e,s){return t.split(e).join(s)};var d=function(){};d.__name__=!0,d.enumEq=function(t,e){if(t==e)return!0;try{var s=t.__enum__;if(null==s||s!=e.__enum__)return!1;if(t._hx_index!=e._hx_index)return!1;for(var n=i[s].__constructs__[t._hx_index].__params__,r=0;r<n.length;){var a=n[r];if(++r,!d.enumEq(t[a],e[a]))return!1}}catch(r){return!1}return!0};var f=C.LSConnectionDetails=function(t){this.serverAddress=xs,this.client=t,this.lock=t.lock};f.__name__=!0,f.prototype={getServerAddress:function(){return this.serverAddress},setServerAddress:function(t){var e=p.fromString(t);if(e!=this.serverAddress){As.isInfoEnabled()&&As.info("serverAddress changed: "+e);var s=this.serverAddress;this.serverAddress=e,this.client.eventDispatcher.onPropertyChange("serverAddress"),s!=e&&this.client.machine.evtServerAddressChanged()}},getAdapterSet:function(){return this.adapterSet},setAdapterSet:function(t){t!=this.adapterSet&&(As.isInfoEnabled()&&As.info("adapterSet changed: "+t),this.adapterSet=t,this.client.eventDispatcher.onPropertyChange("adapterSet"))},getUser:function(){return this.user},setUser:function(t){t!=this.user&&(As.isInfoEnabled()&&As.info("user changed: "+t),this.user=t,this.client.eventDispatcher.onPropertyChange("user"))},setPassword:function(t){t!=this.password&&(As.isInfoEnabled()&&As.info("password changed"),this.password=t,this.client.eventDispatcher.onPropertyChange("password"))},getSessionId:function(){return this.sessionId},setSessionId:function(t){t!=this.sessionId&&(this.sessionId=t,this.client.eventDispatcher.onPropertyChange("sessionId"))},getServerInstanceAddress:function(){return this.serverInstanceAddress},setServerInstanceAddress:function(t){t!=this.serverInstanceAddress&&(this.serverInstanceAddress=t,this.client.eventDispatcher.onPropertyChange("serverInstanceAddress"))},getServerSocketName:function(){return this.serverSocketName},setServerSocketName:function(t){t!=this.serverSocketName&&(this.serverSocketName=t,this.client.eventDispatcher.onPropertyChange("serverSocketName"))},getClientIp:function(){return this.clientIp},setClientIp:function(t){t!=this.clientIp&&(this.clientIp=t,this.client.eventDispatcher.onPropertyChange("clientIp"))},toString:function(){var t=se._new();return se.set(t,"serverAddress",this.serverAddress),se.set(t,"adapterSet",this.adapterSet),se.set(t,"user",this.user),se.set(t,"sessionId",this.sessionId),se.set(t,"serverInstanceAddress",this.serverInstanceAddress),se.set(t,"serverSocketName",this.serverSocketName),se.set(t,"clientIp",this.clientIp),se.set(t,"libVersion",L.LIB_NAME+" "+L.LIB_VERSION),ls.stringify(t.h)},__class__:f};var m=function(){};m.__name__=!0,m.get_supported=function(){return"undefined"!=typeof window&&void 0!==window.location&&"string"==typeof window.location.protocol};var p={_new:function(t){return t},fromString:function(t){if(null==t)return null;if(_.startsWith(t,"http://")||_.startsWith(t,"https://"))return t;throw new v("address is malformed")}},g=function(t,e,s){Error.call(this,t),this.message=t,this.__previousException=e,this.__nativeException=null!=s?s:this,this.__skipStack=0;var i=Error.prepareStackTrace;if(Error.prepareStackTrace=function(t){return t.stack},s instanceof Error)this.stack=s.stack;else{var n=null;if(Error.captureStackTrace)Error.captureStackTrace(this,g),n=this;else if(void 0===(n=new Error).stack){try{throw n}catch(t){}this.__skipStack++}this.stack=n.stack}Error.prepareStackTrace=i};g.__name__=!0,g.caught=function(t){return t instanceof g?t:t instanceof Error?new g(t.message,null,t):new hs(t,null,t)},g.thrown=function(t){if(t instanceof g)return t.get_native();if(t instanceof Error)return t;var e=new hs(t);return e.__skipStack++,e},g.__super__=Error,g.prototype=n(Error.prototype,{toString:function(){return this.get_message()},details:function(){if(null==this.get_previous()){var t="Exception: "+this.toString(),e=this.get_stack();return t+(null==e?"null":as.toString(e))}for(var s="",i=this,n=null;null!=i;){if(null==n)s="Exception: "+i.get_message()+(null==(t=i.get_stack())?"null":as.toString(t))+s;else{var r=as.subtract(i.get_stack(),n.get_stack());s="Exception: "+i.get_message()+(null==r?"null":as.toString(r))+"\n\nNext "+s}n=i,i=i.get_previous()}return s},__shiftStack:function(){this.__skipStack++},get_message:function(){return this.message},get_previous:function(){return this.__previousException},get_native:function(){return this.__nativeException},get_stack:function(){var t=this.__exceptionStack;if(null==t){var e=os.toHaxe(os.normalize(this.stack),this.__skipStack);return this.setProperty("__exceptionStack",e),e}return t},setProperty:function(t,e){try{Object.defineProperty(this,t,{value:e})}catch(s){this[t]=e}},__class__:g});var v=function(t,e,s){g.call(this,t,e,s),this.__skipStack++};v.__name__=!0,v.__super__=g,v.prototype=n(g.prototype,{__class__:v});var y=C.LSConnectionOptions=function(t){this.cookieHandlingRequired=!1,this.slowingEnabled=!1,this.serverInstanceAddressIgnored=!1,this.httpExtraHeadersOnSessionCreationOnly=!1,this.stalledTimeout=2e3,this.sessionRecoveryTimeout=15e3,this.reverseHeartbeatInterval=0,this.retryDelay=4e3,this.reconnectTimeout=3e3,this.pollingInterval=0,this.realMaxBandwidth=null,this.requestedMaxBandwidth=Me.BWUnlimited,this.keepaliveInterval=0,this.idleTimeout=19e3,this.httpExtraHeaders=null,this.forcedTransport=null,this.firstRetryMaxDelay=100,this.contentLength=5e7,this.client=t,this.lock=t.lock};y.__name__=!0,y.prototype={getContentLength:function(){return this.contentLength},setContentLength:function(t){var e=Ne.fromIntGt0(t);e!=this.contentLength&&(As.isInfoEnabled()&&As.info("contentLength changed: "+e),this.contentLength=e,this.client.eventDispatcher.onPropertyChange("contentLength"))},getFirstRetryMaxDelay:function(){return this.firstRetryMaxDelay},setFirstRetryMaxDelay:function(t){var e=De.fromIntGt0(t);e!=this.firstRetryMaxDelay&&(As.isInfoEnabled()&&As.info("firstRetryMaxDelay changed: "+e),this.firstRetryMaxDelay=e,this.client.eventDispatcher.onPropertyChange("firstRetryMaxDelay"))},getForcedTransport:function(){return this.forcedTransport},setForcedTransport:function(t){var e=Pe.fromString(t);e!=this.forcedTransport&&(As.isInfoEnabled()&&As.info("forcedTransport changed: "+e),this.forcedTransport=e,this.client.eventDispatcher.onPropertyChange("forcedTransport"),this.client.machine.evtExtSetForcedTransport())},getHttpExtraHeaders:function(){return null==this.httpExtraHeaders?null:oe.fromMapToDynamicAccess(this.httpExtraHeaders)},setHttpExtraHeaders:function(t){var e=null!=t?oe.toHaxe(t):null;this.mapEq(e,this.httpExtraHeaders)||(As.isInfoEnabled()&&As.info("httpExtraHeaders changed: "+(null==e?"null":ls.stringify(e.h))),this.httpExtraHeaders=e,this.client.eventDispatcher.onPropertyChange("httpExtraHeaders"))},mapEq:function(t,e){if(t==e)return!0;if(null==t||null==e)return!1;if(h.count(t)!=h.count(e))return!1;for(var s=t.h,i=Object.keys(s),n=i.length,r=0;r<n;){var a=i[r++];if(s[a]!=e.h[a])return!1}return!0},getIdleTimeout:function(){return this.idleTimeout},setIdleTimeout:function(t){var e=De.fromIntGtEq0(t);e!=this.idleTimeout&&(As.isInfoEnabled()&&As.info("idleTimeout changed: "+e),this.idleTimeout=e,this.client.eventDispatcher.onPropertyChange("idleTimeout"))},getKeepaliveInterval:function(){return this.keepaliveInterval},setKeepaliveInterval:function(t){var e=De.fromIntGtEq0(t);e!=this.keepaliveInterval&&(As.isInfoEnabled()&&As.info("keepaliveInterval changed: "+e),this.keepaliveInterval=e,this.client.eventDispatcher.onPropertyChange("keepaliveInterval"))},getRequestedMaxBandwidth:function(){return ke.toString(this.requestedMaxBandwidth)},setRequestedMaxBandwidth:function(t){null!=t&&(t=null==t?"null":""+t);var e=ke.fromString(t);d.enumEq(e,this.requestedMaxBandwidth)||(As.isInfoEnabled()&&As.info("requestedMaxBandwidth changed: "+ke.toString(e)),this.requestedMaxBandwidth=e,this.client.eventDispatcher.onPropertyChange("requestedMaxBandwidth"),this.client.machine.evtExtSetRequestedMaxBandwidth())},getRealMaxBandwidth:function(){return Ke.toString(this.realMaxBandwidth)},setRealMaxBandwidth:function(t){Ke.eq(t,this.realMaxBandwidth)||(this.realMaxBandwidth=t,this.client.eventDispatcher.onPropertyChange("realMaxBandwidth"))},getPollingInterval:function(){return this.pollingInterval},setPollingInterval:function(t){var e=De.fromIntGtEq0(t);e!=this.pollingInterval&&(As.isInfoEnabled()&&As.info("pollingInterval changed: "+e),this.pollingInterval=e,this.client.eventDispatcher.onPropertyChange("pollingInterval"))},getReconnectTimeout:function(){return this.reconnectTimeout},setReconnectTimeout:function(t){var e=De.fromIntGt0(t);e!=this.reconnectTimeout&&(As.isInfoEnabled()&&As.info("reconnectTimeout changed: "+e),this.reconnectTimeout=e,this.client.eventDispatcher.onPropertyChange("reconnectTimeout"))},getRetryDelay:function(){return this.retryDelay},setRetryDelay:function(t){var e=De.fromIntGt0(t);e!=this.retryDelay&&(As.isInfoEnabled()&&As.info("retryDelay changed: "+e),this.retryDelay=e,this.client.eventDispatcher.onPropertyChange("retryDelay"))},getReverseHeartbeatInterval:function(){return this.reverseHeartbeatInterval},setReverseHeartbeatInterval:function(t){var e=De.fromIntGtEq0(t);e!=this.reverseHeartbeatInterval&&(As.isInfoEnabled()&&As.info("reverseHeartbeatInterval changed: "+e),this.reverseHeartbeatInterval=e,this.client.eventDispatcher.onPropertyChange("reverseHeartbeatInterval"),this.client.machine.evtExtSetReverseHeartbeatInterval())},getSessionRecoveryTimeout:function(){return this.sessionRecoveryTimeout},setSessionRecoveryTimeout:function(t){var e=De.fromIntGtEq0(t);e!=this.sessionRecoveryTimeout&&(As.isInfoEnabled()&&As.info("sessionRecoveryTimeout changed: "+e),this.sessionRecoveryTimeout=e,this.client.eventDispatcher.onPropertyChange("sessionRecoveryTimeout"))},getStalledTimeout:function(){return this.stalledTimeout},setStalledTimeout:function(t){var e=De.fromIntGt0(t);e!=this.stalledTimeout&&(As.isInfoEnabled()&&As.info("stalledTimeout changed: "+e),this.stalledTimeout=e,this.client.eventDispatcher.onPropertyChange("stalledTimeout"))},isHttpExtraHeadersOnSessionCreationOnly:function(){return this.httpExtraHeadersOnSessionCreationOnly},setHttpExtraHeadersOnSessionCreationOnly:function(t){t!=this.httpExtraHeadersOnSessionCreationOnly&&(As.isInfoEnabled()&&As.info("httpExtraHeadersOnSessionCreationOnly changed: "+(null==t?"null":""+t)),this.httpExtraHeadersOnSessionCreationOnly=t,this.client.eventDispatcher.onPropertyChange("httpExtraHeadersOnSessionCreationOnly"))},isServerInstanceAddressIgnored:function(){return this.serverInstanceAddressIgnored},setServerInstanceAddressIgnored:function(t){t!=this.serverInstanceAddressIgnored&&(As.isInfoEnabled()&&As.info("serverInstanceAddressIgnored changed: "+(null==t?"null":""+t)),this.serverInstanceAddressIgnored=t,this.client.eventDispatcher.onPropertyChange("serverInstanceAddressIgnored"))},setCookieHandlingRequired:function(t){t!=this.cookieHandlingRequired&&(As.isInfoEnabled()&&As.info("cookieHandlingRequired changed: "+(null==t?"null":""+t)),this.cookieHandlingRequired=t,this.client.eventDispatcher.onPropertyChange("cookieHandlingRequired"))},isCookieHandlingRequired:function(){return this.cookieHandlingRequired},isSlowingEnabled:function(){return this.slowingEnabled},setSlowingEnabled:function(t){t!=this.slowingEnabled&&(As.isInfoEnabled()&&As.info("slowingEnabled changed: "+(null==t?"null":""+t)),this.slowingEnabled=t,this.client.eventDispatcher.onPropertyChange("slowingEnabled"))},toString:function(){var t=se._new();return se.set(t,"forcedTransport",this.forcedTransport),se.set(t,"requestedMaxBandwidth",this.requestedMaxBandwidth),se.set(t,"realMaxBandwidth",this.realMaxBandwidth),se.set(t,"retryDelay",this.retryDelay),se.set(t,"firstRetryMaxDelay",this.firstRetryMaxDelay),se.set(t,"sessionRecoveryTimeout",this.sessionRecoveryTimeout),se.set(t,"reverseHeartbeatInterval",this.reverseHeartbeatInterval),se.set(t,"stalledTimeout",this.stalledTimeout),se.set(t,"reconnectTimeout",this.reconnectTimeout),se.set(t,"keepaliveInterval",this.keepaliveInterval),se.set(t,"pollingInterval",this.pollingInterval),se.set(t,"idleTimeout",this.idleTimeout),se.set(t,"contentLength",this.contentLength),se.set(t,"slowingEnabled",this.slowingEnabled),se.set(t,"serverInstanceAddressIgnored",this.serverInstanceAddressIgnored),se.set(t,"HTTPExtraHeadersOnSessionCreationOnly",this.httpExtraHeadersOnSessionCreationOnly),se.set(t,"HTTPExtraHeaders",this.httpExtraHeaders),se.set(t,"cookieHandlingRequired",this.cookieHandlingRequired),ls.stringify(t.h)},__class__:y};var T=function(){this.listeners=[]};T.__name__=!0,T.prototype={addListener:function(t){return-1==this.listeners.indexOf(t)&&(this.listeners.push(t),!0)},removeListener:function(t){return a.remove(this.listeners,t)},getListeners:function(){return this.listeners},dispatchToAll:function(t){for(var e=0,s=this.listeners;e<s.length;)this.dispatchToOne(s[e++],t)},dispatchToOne:function(t,e){Qs((function(){try{e(t)}catch(t){var s=g.caught(t);As.isErrorEnabled()&&As.error("Uncaught exception\n"+s.details())}}))},__class__:T};var R=function(){T.call(this)};R.__name__=!0,R.__super__=T,R.prototype=n(T.prototype,{removeListenerAndFireOnListenEnd:function(t,e){this.removeListener(t)&&this.dispatchToOne(t,(function(t){null!=t.onListenEnd&&t.onListenEnd(e)}))},addListenerAndFireOnListenStart:function(t,e){this.addListener(t)&&this.dispatchToOne(t,(function(t){null!=t.onListenStart&&t.onListenStart(e)}))},onServerError:function(t,e){this.dispatchToAll((function(s){null!=s.onServerError&&s.onServerError(t,e)}))},onStatusChange:function(t){this.dispatchToAll((function(e){null!=e.onStatusChange&&e.onStatusChange(t)}))},onPropertyChange:function(t){this.dispatchToAll((function(e){null!=e.onPropertyChange&&e.onPropertyChange(t)}))},onServerKeepalive:function(){this.dispatchToAll((function(t){null!=t.onServerKeepalive&&t.onServerKeepalive()}))},__class__:R});var L=C.LSLightstreamerClient=function(t,e){this.lock=new q,this.eventDispatcher=new R,this.connectionDetails=new f(this),this.connectionOptions=new y(this),this.machine=new U(this,new Se(this)),null!=t&&this.connectionDetails.setServerAddress(t),null!=e&&this.connectionDetails.setAdapterSet(e)};L.__name__=!0,L.setLoggerProvider=function(t){A.setLoggerProvider(t)},L.prototype={addListener:function(t){this.eventDispatcher.addListenerAndFireOnListenStart(t,this)},removeListener:function(t){this.eventDispatcher.removeListenerAndFireOnListenEnd(t,this)},getListeners:function(){return this.eventDispatcher.getListeners().slice()},connect:function(){this.machine.connect()},disconnect:function(){this.machine.disconnect()},getStatus:function(){return this.machine.getStatus()},sendMessage:function(t,e,s,i,n){null==n&&(n=!1),null==s&&(s=-1),this.machine.sendMessage(t,e,null!=s?s:-1,i,null!=n&&n)},subscribe:function(t){this.machine.subscribeExt(t)},unsubscribe:function(t){this.machine.unsubscribe(t)},getSubscriptions:function(){return this.machine.getSubscriptions().slice()},getSubscriptionWrappers:function(){for(var t=[],e=0,s=this.machine.getSubscriptions();e<s.length;){var i=s[e];++e,null!=i.wrapper&&t.push(i.wrapper)}return t.slice()},__class__:L};var O=i["com.lightstreamer.client._Subscription.SubscriptionState"]={__ename__:!0,__constructs__:null,Inactive:{_hx_name:"Inactive",_hx_index:0,__enum__:"com.lightstreamer.client._Subscription.SubscriptionState",toString:s},Active:{_hx_name:"Active",_hx_index:1,__enum__:"com.lightstreamer.client._Subscription.SubscriptionState",toString:s},Subscribed:{_hx_name:"Subscribed",_hx_index:2,__enum__:"com.lightstreamer.client._Subscription.SubscriptionState",toString:s}};O.__constructs__=[O.Inactive,O.Active,O.Subscribed];var D=function(){T.call(this)};D.__name__=!0,D.__super__=T,D.prototype=n(T.prototype,{onClearSnapshot:function(t,e){this.dispatchToAll((function(s){null!=s.onClearSnapshot&&s.onClearSnapshot(t,e)}))},onCommandSecondLevelItemLostUpdates:function(t,e){this.dispatchToAll((function(s){null!=s.onCommandSecondLevelItemLostUpdates&&s.onCommandSecondLevelItemLostUpdates(t,e)}))},onCommandSecondLevelSubscriptionError:function(t,e,s){this.dispatchToAll((function(i){null!=i.onCommandSecondLevelSubscriptionError&&i.onCommandSecondLevelSubscriptionError(t,e,s)}))},onEndOfSnapshot:function(t,e){this.dispatchToAll((function(s){null!=s.onEndOfSnapshot&&s.onEndOfSnapshot(t,e)}))},onItemLostUpdates:function(t,e,s){this.dispatchToAll((function(i){null!=i.onItemLostUpdates&&i.onItemLostUpdates(t,e,s)}))},onItemUpdate:function(t){this.dispatchToAll((function(e){null!=e.onItemUpdate&&e.onItemUpdate(t)}))},removeListenerAndFireOnListenEnd:function(t,e){this.removeListener(t)&&this.dispatchToOne(t,(function(t){null!=t.onListenEnd&&t.onListenEnd(e)}))},addListenerAndFireOnListenStart:function(t,e){this.addListener(t)&&this.dispatchToOne(t,(function(t){null!=t.onListenStart&&t.onListenStart(e)}))},onSubscription:function(){this.dispatchToAll((function(t){null!=t.onSubscription&&t.onSubscription()}))},onSubscriptionError:function(t,e){this.dispatchToAll((function(s){null!=s.onSubscriptionError&&s.onSubscriptionError(t,e)}))},onUnsubscription:function(){this.dispatchToAll((function(t){null!=t.onUnsubscription&&t.onUnsubscription()}))},onRealMaxFrequency:function(t){this.dispatchToAll((function(e){null!=e.onRealMaxFrequency&&e.onRealMaxFrequency(t)}))},__class__:D});var N=C.LSSubscription=function(t,e,s,i){this.lock=new q,this.m_internal=!1,this.state=O.Inactive,this.eventDispatcher=new D,this.wrapper=i,this.mode=Ge.fromString(t),this.initSnapshot(),this.initItemsAndFields("string"==typeof e?[e].slice():e,s)};N.__name__=!0,N.prototype={initSnapshot:function(){this.snapshot="RAW"==this.mode?null:Ae.SnpYes},initItemsAndFields:function(t,e){if(null!=t){if(null==e)throw new v("Please specify a valid field list");if(this.items=ze.fromArray(he.copy(t,t)),this.fields=Ye.fromArray(he.copy(e,e)),"COMMAND"==this.mode&&-1==this.fields.indexOf("key"))throw new v("Field 'key' is missing");if("COMMAND"==this.mode&&-1==this.fields.indexOf("command"))throw new v("Field 'command' is missing")}else if(null!=e)throw new v("Please specify a valid item or item list")},addListener:function(t){this.eventDispatcher.addListenerAndFireOnListenStart(t,this)},removeListener:function(t){this.eventDispatcher.removeListenerAndFireOnListenEnd(t,this)},getListeners:function(){return this.eventDispatcher.getListeners().slice()},isActive:function(){return this.state!=O.Inactive},isSubscribed:function(){return this.state==O.Subscribed},getDataAdapter:function(){return this.dataAdapter},setDataAdapter:function(t){this.checkActive(),this.dataAdapter=je.fromString(t)},getMode:function(){return this.mode},getItems:function(){return null==this.items?null:this.items.slice()},fetchItems:function(){return this.items},setItems:function(t){this.checkActive(),this.items=ze.fromArray(null==t?null:he.copy(t,t)),this.group=null},getItemGroup:function(){return this.group},setItemGroup:function(t){this.checkActive(),this.group=je.fromString(t),this.items=null},getFields:function(){return null==this.fields?null:this.fields.slice()},fetchFields:function(){return this.fields},setFields:function(t){this.checkActive();var e=Ye.fromArray(null==t?null:he.copy(t,t));if("COMMAND"==this.mode&&null!=e){if(-1==e.indexOf("command"))throw new v("Field 'command' is missing");if(-1==e.indexOf("key"))throw new v("Field 'key' is missing")}this.fields=e,this.schema=null},getFieldSchema:function(){return this.schema},setFieldSchema:function(t){this.checkActive(),this.schema=je.fromString(t),this.fields=null},getRequestedBufferSize:function(){return qe.toString(this.bufferSize)},setRequestedBufferSize:function(t){null!=t&&(t=null==t?"null":""+t),this.checkActive(),this.bufferSize=qe.fromString(t)},getRequestedSnapshot:function(){return We.toString(this.snapshot)},setRequestedSnapshot:function(t){null!=t&&(t=null==t?"null":""+t),this.checkActive();var e=We.fromString(t);switch(this.mode){case"COMMAND":case"MERGE":if(null!=e&&null!=e&&2==e._hx_index)throw new v("Snapshot length is not permitted if MERGE or COMMAND was specified as mode");break;case"RAW":if(null!=e)throw new v("Snapshot is not permitted if RAW was specified as mode")}this.snapshot=e},getRequestedMaxFrequency:function(){return Ue.toString(this.requestedMaxFrequency)},setRequestedMaxFrequency:function(t){var e,s=this;null!=t&&(t=null==t?"null":""+t),this.lock.synchronized((function(){var i=Ue.fromString(t);switch(s.mode){case"COMMAND":case"DISTINCT":case"MERGE":break;default:throw new v("The operation in only available on MERGE, DISTINCT and COMMAND Subscripitons")}if(s.isActive()&&(null==i||i==Be.FreqUnfiltered||s.requestedMaxFrequency==Be.FreqUnfiltered))throw new v("Cannot change the frequency from/to 'unfiltered' or to null while the Subscription is active");return null!=s.subId&&Bs.isInfoEnabled()&&Bs.info("Subscription "+s.subId+" requested max frequency changed: "+t),s.requestedMaxFrequency=i,e=s.manager})),null!=e&&e.evtExtConfigure()},getSelector:function(){return this.selector},setSelector:function(t){this.checkActive(),this.selector=je.fromString(t)},getCommandPosition:function(){if(this.checkCommand(),null==this.cmdIdx)throw new ae("The position of the command field is currently unknown");return this.cmdIdx},getKeyPosition:function(){if(this.checkCommand(),null==this.keyIdx)throw new ae("The position of the key field is currently unknown");return this.keyIdx},getCommandSecondLevelDataAdapter:function(){return this.dataAdapter2},setCommandSecondLevelDataAdapter:function(t){this.checkActive(),this.checkCommand(),this.dataAdapter2=je.fromString(t)},getCommandSecondLevelFields:function(){return null==this.fields2?null:this.fields2.slice()},setCommandSecondLevelFields:function(t){this.checkActive(),this.checkCommand(),this.fields2=Ye.fromArray(null==t?null:he.copy(t,t)),this.schema2=null},getCommandSecondLevelFieldSchema:function(){return this.schema2},setCommandSecondLevelFieldSchema:function(t){this.checkActive(),this.checkCommand(),this.schema2=je.fromString(t),this.fields2=null},getValue:function(t,e){var s="number"==typeof t&&(0|t)===t,i="string"==typeof t,n="number"==typeof e&&(0|e)===e,r="string"==typeof e;if(s&&n)return this.getValuePosPos(t,e);if(s&&r)return this.getValuePosName(t,e);if(i&&n)return this.getValueNamePos(t,e);if(i&&r)return this.getValueNameName(t,e);throw new v("Invalid argument type")},getCommandValue:function(t,e,s){var i="number"==typeof t&&(0|t)===t,n="string"==typeof t,r="number"==typeof s&&(0|s)===s,a="string"==typeof s;if(i&&r)return this.getCommandValuePosPos(t,e,s);if(i&&a)return this.getCommandValuePosName(t,e,s);if(n&&r)return this.getCommandValueNamePos(t,e,s);if(n&&a)return this.getCommandValueNameName(t,e,s);throw new v("Invalid argument type")},getValuePosPos:function(t,e){var s,i=this;if(t<1||e<1)throw new v("The specified position is out of bounds");return this.lock.synchronized((function(){return s=i.manager})),null!=s?s.getValue(t,e):null},getValuePosName:function(t,e){var s=this;return this.getValuePosPos(t,this.lock.synchronized((function(){return s.getFieldPos(e)})))},getValueNamePos:function(t,e){var s=this;return this.getValuePosPos(this.lock.synchronized((function(){return s.getItemPos(t)})),e)},getValueNameName:function(t,e){var s=this;return this.getValuePosPos(this.lock.synchronized((function(){return s.getItemPos(t)})),this.lock.synchronized((function(){return s.getFieldPos(e)})))},getCommandValuePosPos:function(t,e,s){var i,n=this;if(this.checkCommand(),t<1||s<1)throw new v("The specified position is out of bounds");return this.lock.synchronized((function(){return i=n.manager})),null!=i?i.getCommandValue(t,e,s):null},getCommandValuePosName:function(t,e,s){var i=this;return this.getCommandValuePosPos(t,e,this.lock.synchronized((function(){return i.getFieldPos(s)})))},getCommandValueNamePos:function(t,e,s){var i=this;return this.getCommandValuePosPos(this.lock.synchronized((function(){return i.getItemPos(t)})),e,s)},getCommandValueNameName:function(t,e,s){var i=this;return this.getCommandValuePosPos(this.lock.synchronized((function(){return i.getItemPos(t)})),e,this.lock.synchronized((function(){return i.getFieldPos(s)})))},getItemPos:function(t){var e;if(null==this.items||-1==(e=ze.getPos(this.items,t)))throw new v("Unknown item name");return e},getFieldPos:function(t){var e;if(null==this.fields||-1==(e=Ye.getPos(this.fields,t)))throw new v("Unknown field name");return e},checkActive:function(){if(this.isActive())throw new ae("Cannot modify an active Subscription. Please unsubscribe before applying any change")},checkCommand:function(){if("COMMAND"!=this.mode)throw new ae("This method can only be used on COMMAND subscriptions")},fetch_items:function(){return this.items},fetch_fields:function(){return this.fields},fetch_fields2:function(){return this.fields2},fetch_mode:function(){return this.mode},fetch_requestedBufferSize:function(){return this.bufferSize},fetch_requestedSnapshot:function(){return this.snapshot},fetch_requestedMaxFrequency:function(){return this.requestedMaxFrequency},fetch_nItems:function(){return this.nItems},fetch_subManager:function(){return this.manager},setActive:function(){this.state=O.Active},setInactive:function(){this.state=O.Inactive,this.subId=null,this.cmdIdx=null,this.keyIdx=null,this.nItems=null,this.nFields=null},setSubscribed:function(t,e,s){this.state=O.Subscribed,this.subId=t,this.nItems=e,this.nFields=s},setSubscribedCMD:function(t,e,s,i,n){this.state=O.Subscribed,this.subId=t,this.cmdIdx=i,this.keyIdx=n,this.nItems=e,this.nFields=s},fetch_nFields:function(){return this.nFields},isInternal:function(){return this.m_internal},setInternal:function(){this.m_internal=!0},getItemName:function(t){return null!=this.items?this.items[t-1]:null},relate:function(t){this.manager=t},unrelate:function(t){this.manager==t&&(this.manager=null)},hasSnapshot:function(){return!(null==this.snapshot||this.snapshot==Ae.SnpNo)},getItemNameOrPos:function(t){return null!=this.items?this.items[t-1]:""+t},fireOnSubscription:function(t){Bs.isInfoEnabled()&&Bs.info("Subscription "+t+" added"),this.eventDispatcher.onSubscription()},fireOnUnsubscription:function(t){Bs.isInfoEnabled()&&Bs.info("Subscription "+t+" deleted"),this.eventDispatcher.onUnsubscription()},fireOnSubscriptionError:function(t,e,s){Bs.isWarnEnabled()&&Bs.warn("Subscription "+t+" failed: "+e+" - "+s),this.eventDispatcher.onSubscriptionError(e,s)},fireOnEndOfSnapshot:function(t,e){Bs.isDebugEnabled()&&Bs.debug("Subscription "+e+":"+this.getItemNameOrPos(t)+": snapshot ended"),this.eventDispatcher.onEndOfSnapshot(this.getItemName(t),t)},fireOnClearSnapshot:function(t,e){Bs.isDebugEnabled()&&Bs.debug("Subscription "+e+":"+this.getItemNameOrPos(t)+": snapshot cleared"),this.eventDispatcher.onClearSnapshot(this.getItemName(t),t)},fireOnLostUpdates:function(t,e,s){Bs.isDebugEnabled()&&Bs.debug("Subscription "+s+":"+this.getItemNameOrPos(t)+": lost "+e+" updates"),this.eventDispatcher.onItemLostUpdates(this.getItemName(t),t,e)},fireOnItemUpdate:function(t,e){Bs.isDebugEnabled()&&Bs.debug("Subscription "+e+":"+this.getItemNameOrPos(t.getItemPos())+" update: "+l.string(t)),this.eventDispatcher.onItemUpdate(t)},fireOnRealMaxFrequency:function(t,e){Bs.isDebugEnabled()&&Bs.debug("Subscription "+e+" real max frequency changed: "+l.string(t)),this.eventDispatcher.onRealMaxFrequency(Qe(t))},fireOnSubscriptionError2Level:function(t,e,s,i,n){Bs.isWarnEnabled()&&Bs.warn("Subscription "+i+":"+this.getItemNameOrPos(n)+":"+t+" failed: "+e+" - "+s),this.eventDispatcher.onCommandSecondLevelSubscriptionError(e,s,t)},fireOnLostUpdates2Level:function(t,e,s,i){Bs.isDebugEnabled()&&Bs.debug("Subscription "+s+":"+this.getItemNameOrPos(i)+":"+t+": lost "+e+" updates"),this.eventDispatcher.onCommandSecondLevelItemLostUpdates(e,t)},toString:function(){var t=se._new();return se.set(t,"mode",this.mode),se.set(t,"items",null!=this.items?l.string(this.items):this.group),se.set(t,"fields",null!=this.fields?l.string(this.fields):this.schema),se.set(t,"dataAdapter",this.dataAdapter),se.set(t,"requestedBufferSize",this.bufferSize),se.set(t,"requestedSnapshot",this.snapshot),se.set(t,"requestedMaxFrequency",this.requestedMaxFrequency),se.set(t,"selector",this.selector),se.set(t,"secondLevelFields",null!=this.fields2?l.string(this.fields2):this.schema2),se.set(t,"secondLevelDataAdapter",this.dataAdapter2),ls.stringify(t.h)},__class__:N};var P=function(){};P.__name__=!0,P.__isInterface__=!0,P.prototype={__class__:P};var M=function(t){this.frozen=!1,this.onEvent=t};M.__name__=!0,M.__interfaces__=[P],M.newLoggingInstance=function(){var t=new M((function(t){Hs.isWarnEnabled()&&Hs.warn(l.string(t)+" event detected")}));return t.startListening(),t},M.prototype={handleFrozen:function(){this.frozen=!0,this.onEvent(ge.Frozen)},handleResumed:function(){this.frozen=!1,this.onEvent(ge.Resumed)},startListening:function(){m.get_supported()&&(window.addEventListener("freeze",Ss(this,this.handleFrozen),{capture:!0}),window.addEventListener("resume",Ss(this,this.handleResumed),{capture:!0}))},stopListening:function(){m.get_supported()&&(window.removeEventListener("freeze",Ss(this,this.handleFrozen),{capture:!0}),window.removeEventListener("resume",Ss(this,this.handleResumed),{capture:!0}))},__class__:M};var k=function(){};k.__name__=!0,k.__interfaces__=[w],k.prototype={__class__:k};var F=function(){};F.__name__=!0,F.__super__=k,F.prototype=n(k.prototype,{fatal:function(t,e){},error:function(t,e){},warn:function(t,e){},info:function(t,e){},debug:function(t,e){},trace:function(t,e){},isFatalEnabled:function(){return!1},isErrorEnabled:function(){return!1},isWarnEnabled:function(){return!1},isInfoEnabled:function(){return!1},isDebugEnabled:function(){return!1},isTraceEnabled:function(){return!1},__class__:F});var q=function(){};q.__name__=!0,q.prototype={acquire:function(){},release:function(){},synchronized:function(t){var e=null,s=null;try{s=t()}catch(t){e=g.caught(t)}if(null!=e)throw g.thrown(e);return s},__class__:q};var A=function(){};A.__name__=!0,A.getLogger=function(t){return A.lock.synchronized((function(){var e=A.logInstances.h[t];if(null==e){var s=new W(null==A.currentLoggerProvider?A.emptyLogger:A.currentLoggerProvider.getLogger(t));A.logInstances.h[t]=s,e=s}return e}))},A.setLoggerProvider=function(t){A.lock.synchronized((function(){A.currentLoggerProvider=t;for(var e=A.logInstances.h,s=Object.keys(e),i=s.length,n=0;n<i;){var r=s[n++];e[r].wrappedLogger=null==A.currentLoggerProvider?A.emptyLogger:A.currentLoggerProvider.getLogger(r)}}))},A.newLogger=function(t){return null==A.currentLoggerProvider?A.emptyLogger:A.currentLoggerProvider.getLogger(t)};var W=function(t){this.wrappedLogger=t};W.__name__=!0,W.__super__=k,W.prototype=n(k.prototype,{fatal:function(t,e){this.wrappedLogger.fatal(t,e)},error:function(t,e){this.wrappedLogger.error(t,e)},warn:function(t,e){this.wrappedLogger.warn(t,e)},info:function(t,e){this.wrappedLogger.info(t,e)},debug:function(t,e){this.wrappedLogger.debug(t,e)},trace:function(t,e){this.wrappedLogger.trace(t,e)},isFatalEnabled:function(){return this.wrappedLogger.isFatalEnabled()},isErrorEnabled:function(){return this.wrappedLogger.isErrorEnabled()},isWarnEnabled:function(){return this.wrappedLogger.isWarnEnabled()},isInfoEnabled:function(){return this.wrappedLogger.isInfoEnabled()},isDebugEnabled:function(){return this.wrappedLogger.isDebugEnabled()},isTraceEnabled:function(){return this.wrappedLogger.isTraceEnabled()},__class__:W});var B=function(){};B.__name__=!0,B.getClass=function(t){if(null==t)return null;if(t instanceof Array)return Array;var e=t.__class__;if(null!=e)return e;var s=B.__nativeClassName(t);return null!=s?B.__resolveNativeClass(s):null},B.__string_rec=function(t,e){if(null==t)return"null";if(e.length>=5)return"<...>";var s=typeof t;switch("function"==s&&(t.__name__||t.__ename__)&&(s="object"),s){case"function":return"<function>";case"object":if(t.__enum__){var n=i[t.__enum__].__constructs__[t._hx_index],r=n._hx_name;return n.__params__?(e+="\t",r+"("+function(s){for(var i=[],r=0,a=n.__params__;r<a.length;){var o=a[r];r+=1,i.push(B.__string_rec(t[o],e))}return i}().join(",")+")"):r}if(t instanceof Array){var a="[";e+="\t";for(var o=0,h=t.length;o<h;){var c=o++;a+=(c>0?",":"")+B.__string_rec(t[c],e)}return a+="]"}var l;try{l=t.toString}catch(o){return"???"}if(null!=l&&l!=Object.toString&&"function"==typeof l){var u=t.toString();if("[object Object]"!=u)return u}a="{\n",e+="\t";var _=null!=t.hasOwnProperty,d=null;for(d in t)_&&!t.hasOwnProperty(d)||"prototype"!=d&&"__class__"!=d&&"__super__"!=d&&"__interfaces__"!=d&&"__properties__"!=d&&(2!=a.length&&(a+=", \n"),a+=e+d+" : "+B.__string_rec(t[d],e));return a+="\n"+(e=e.substring(1))+"}";case"string":return t;default:return String(t)}},B.__interfLoop=function(t,e){for(;;){if(null==t)return!1;if(t==e)return!0;var s=t.__interfaces__;if(null!=s)for(var i=0,n=s.length;i<n;){var r=s[i++];if(r==e||B.__interfLoop(r,e))return!0}t=t.__super__}},B.__instanceof=function(t,e){if(null==e)return!1;switch(e){case Array:return t instanceof Array;case Es:return"boolean"==typeof t;case bs:return null!=t;case ws:return"number"==typeof t;case ys:return"number"==typeof t&&(0|t)===t;case String:return"string"==typeof t;default:if(null==t)return!1;if("function"==typeof e){if(B.__downcastCheck(t,e))return!0}else if("object"==typeof e&&B.__isNativeObj(e)&&t instanceof e)return!0;return e==Ts&&null!=t.__name__||e==Rs&&null!=t.__ename__||null!=t.__enum__&&i[t.__enum__]==e}},B.__downcastCheck=function(t,e){return t instanceof e||!!e.__isInterface__&&B.__interfLoop(B.getClass(t),e)},B.__cast=function(t,e){if(null==t||B.__instanceof(t,e))return t;throw g.thrown("Cannot cast "+l.string(t)+" to "+l.string(e))},B.__nativeClassName=function(t){var e=B.__toStr.call(t).slice(8,-1);return"Object"==e||"Function"==e||"Math"==e||"JSON"==e?null:e},B.__isNativeObj=function(t){return null!=B.__nativeClassName(t)},B.__resolveNativeClass=function(e){return t[e]};var U=function(t,e){this.slw_m=.5,this.slw_hugeDelayMs=2e4,this.slw_maxAvgDelayMs=7e3,this.slw_avgDelayMs=0,this.slw_refTime=0,this.rec_clientProg=0,this.rec_serverProg=0,this.subscriptionManagers=new ue,this.messageManagers=new ie,this.sequenceMap=new ls,this.disabledTransports=new Ee,this.suspendedTransports=new Ee,this.ctrl_connectTs=0,this.recoverTs=0,this.connectTs=0,this.m_nextSubId=0,this.m_nextReqId=0,this.m_status="DISCONNECTED",this.delayCounter=new Et,this.state=new it,this.client=t,this.lock=t.lock,this.details=t.connectionDetails,this.options=t.connectionOptions,this.wsFactory=Ss(e,e.createWsClient),this.httpFactory=Ss(e,e.createHttpClient),this.ctrlFactory=Ss(e,e.createCtrlClient),this.timerFactory=Ss(e,e.createTimer),this.randomGenerator=Ss(e,e.randomMillis),this.reachabilityFactory=Ss(e,e.createReachabilityManager),this.frz_pageLifecycleFactory=Ss(e,e.createPageLifecycleFactory),this.clientEventDispatcher=t.eventDispatcher,this.switchRequest=new J(this),this.constrainRequest=new $(this),this.delayCounter.reset(this.options.retryDelay)};U.__name__=!0,U.prototype={disposeSession:function(){this.disposeWS(),this.disposeHTTP(),this.disposeCtrl(),this.details.setServerInstanceAddress(null),this.details.setSessionId(null),this.details.setServerSocketName(null),this.details.setClientIp(null),this.options.setRealMaxBandwidth(null),this.lastKnownClientIp=null,this.resetSequenceMap(),this.rec_serverProg=0,this.rec_clientProg=0,this.bw_lastReqId=null,this.bw_requestedMaxBandwidth=null,this.swt_lastReqId=null},disposeClient:function(){this.sessionId=null,this.enableAllTransports(),this.resetCurrentRetryDelay(),this.resetSequenceMap(),this.cause=null},evtExtConnect:function(){this.traceEvent("connect");var t,e=!0;100==this.state.s_m&&(U.frz_globalPageLifecycle.frozen?(Hs.isWarnEnabled()&&Hs.warn("connection requested while page is frozen"),this.cause="page.frozen",this.resetCurrentRetryDelay(),this.doInstallPageLifecycle(),this.state.s_m=117,this.state.traceState(),e=this.evtExtConnect_NextRegion(),null!=(t=this.frz_pageLifecycle)&&t.startListening(),this.evtRetry(G.page_frozen)):(this.cause="api",this.resetCurrentRetryD