UNPKG

diffusion

Version:

Diffusion JavaScript client

8 lines 114 kB
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=26)}([function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.readOptional=e.writeOptional=e.writeBoolean=e.readBoolean=e.writeMap=e.readMap=e.readObject=e.writeObject=e.writeDictionary=e.readDictionary=e.readCollection=e.writeCollection=e.writeString=e.readString=e.writeBytes=e.readBytes=e.writeByte=e.writeInt32=e.readInt32=e.writeInt64=e.readInt64=e.readByte=void 0;var i=r(3),o=r(13),s=r(14),a=o.fromNumber(128),u=o.fromNumber(127),c=u.not();function l(t){var e=t.read();if(-1===e)throw new i.IOError("End of stream");return e}function f(t){for(var e=0,r=0;e<32;){var n=l(t);if(r|=(127&n)<<e,0==(128&n))return r;e+=7}throw new i.IOError("Malformed int32")}function p(t,e){for(;0!=(-128&e);)t.write(127&e|128),e>>>=7;t.write(e)}function h(t,e){t.write(e)}function d(t){var e=f(t);return t.readMany(e)}function y(t,e){p(t,e.length),t.writeMany(e)}function _(t){var e=d(t);return e?s.uint8toUtf8(e):""}function E(t,e){y(t,s.uint8FromUtf8(e))}function S(t,e,r,i){var o,s;p(t,Object.keys(e).length);try{for(var a=n(Object.getOwnPropertyNames(e)),u=a.next();!u.done;u=a.next()){var c=u.value;r(t,c),i(t,e[c])}}catch(t){o={error:t}}finally{try{u&&!u.done&&(s=a.return)&&s.call(a)}finally{if(o)throw o.error}}}function g(t,e,r){for(var n=f(t),i={},o=0;o<n;++o){i[e(t)]=r(t)}return i}e.readByte=l,e.readInt64=function(t){for(var e=o.fromNumber(0),r=0;r<64;){var n=l(t),s=o.fromNumber(n);if(e=e.or(s.and(u).shiftLeft(r)),s.and(a).equals(0))return e;r+=7}throw new i.IOError("Malformed int64")},e.writeInt64=function(t,e){for(var r=e instanceof o?e:o.fromNumber(e,!1);!r.and(c).equals(0);)t.write(r.and(u).or(a).toInt()),r=r.shiftRightUnsigned(7);t.write(r.toInt())},e.readInt32=f,e.writeInt32=p,e.writeByte=h,e.readBytes=d,e.writeBytes=y,e.readString=_,e.writeString=E,e.writeCollection=function(t,e,r){var i,o;p(t,e.length);try{for(var s=n(e),a=s.next();!a.done;a=s.next()){r(t,a.value)}}catch(t){i={error:t}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}},e.readCollection=function(t,e){for(var r=f(t),n=[],i=0;i<r;++i)n.push(e(t));return n},e.readDictionary=function(t,e){return g(t,_,e)},e.writeDictionary=function(t,e,r){S(t,e,E,r)},e.writeObject=S,e.readObject=g,e.readMap=function(t,e,r){for(var n=f(t),i=new Map,o=0;o<n;++o){var s=e(t);i.set(s,r(t))}return i},e.writeMap=function(t,e,r,n){p(t,e.size),e.forEach((function(e,i){r(t,i),n(t,e)}))},e.readBoolean=function(t){return 0!==t.readInt8()},e.writeBoolean=function(t,e){t.writeInt8(e?1:0)},e.writeOptional=function(t,e,r,n){void 0===n&&(n=function(t){return null!=t}),n(e)?(h(t,1),r(t,e)):h(t,0)},e.readOptional=function(t,e){return l(t)?e(t):void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSerialiser=void 0;var n=r(3),i=function(){function t(){}return t.prototype.read=function(t){throw new n.InternalError("AbstractSerialiser#read is not implemented")},t.prototype.write=function(t,e){throw new n.InternalError("AbstractSerialiser#write is not implemented")},t}();e.AbstractSerialiser=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.write=e.read=void 0;var n=r(3),i=r(0);e.read=function(t,e){var r=i.readByte(t);if(void 0===e[r])throw new n.IllegalArgumentError("Unable to decode enum value "+r);return e[e[r]]},e.write=function(t,e){"number"==typeof e?i.writeByte(t,e):i.writeByte(t,e.id)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InternalError=e.IllegalStateError=e.RetryLimitError=e.SchemaParseError=e.SchemaViolationError=e.InvalidFilterError=e.OutOfBoundsError=e.IllegalArgumentError=e.SessionError=e.IOError=e.InvalidDataError=e.AssertionError=e.RuntimeError=e.NullValueError=void 0;var o=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="null_value_error",e}(Error);e.NullValueError=o;var s=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return i(e,t),e.prototype.getType=function(){return e.type},e.type="runtime_error",e}(Error);e.RuntimeError=s;var a=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="assertion_error",e}(Error);e.AssertionError=a;var u=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_data_error",e}(Error);e.InvalidDataError=u;var c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="io_error",e}(Error);e.IOError=c;var l=function(t){function e(e,r){var n=t.call(this,e)||this;return n.cause=r,n}return i(e,t),e.prototype.getType=function(){return e.type},e.type="session_error",e}(Error);e.SessionError=l;var f=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_argument_error",e}(Error);e.IllegalArgumentError=f;var p=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="out_of_bounds_error",e}(Error);e.OutOfBoundsError=p;var h=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errors=r,n}return i(e,t),e.prototype.getType=function(){return e.type},e.type="invalid_filter_error",e}(Error);e.InvalidFilterError=h;var d=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="schema_violation_error",e}(Error);e.SchemaViolationError=d;var y=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="schema_parse_error",e}(Error);e.SchemaParseError=y;var _=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="retry_limit_error",e}(Error);e.RetryLimitError=_;var E=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="illegal_state_error",e}(Error);e.IllegalStateError=E;var S=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getType=function(){return e.type},e.type="internal_error",e}(Error);e.InternalError=S},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.requireNonNull=void 0;var n=r(3);e.requireNonNull=function(t,e){if(null==t)throw new n.NullValueError(e+" is null");return t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationType=e.PathPermission=e.GlobalPermission=void 0,function(t){t.AUTHENTICATE="AUTHENTICATE",t.VIEW_SESSION="VIEW_SESSION",t.MODIFY_SESSION="MODIFY_SESSION",t.REGISTER_HANDLER="REGISTER_HANDLER",t.VIEW_SERVER="VIEW_SERVER",t.CONTROL_SERVER="CONTROL_SERVER",t.VIEW_SECURITY="VIEW_SECURITY",t.MODIFY_SECURITY="MODIFY_SECURITY",t.UNKNOWN_GLOBAL_PERMISSION="UNKNOWN_GLOBAL_PERMISSION",t.READ_TOPIC_VIEWS="READ_TOPIC_VIEWS",t.MODIFY_TOPIC_VIEWS="MODIFY_TOPIC_VIEWS"}(e.GlobalPermission||(e.GlobalPermission={})),function(t){t.READ_TOPIC="READ_TOPIC",t.UPDATE_TOPIC="UPDATE_TOPIC",t.MODIFY_TOPIC="MODIFY_TOPIC",t.SEND_TO_MESSAGE_HANDLER="SEND_TO_MESSAGE_HANDLER",t.SEND_TO_SESSION="SEND_TO_SESSION",t.SELECT_TOPIC="SELECT_TOPIC",t.QUERY_OBSOLETE_TIME_SERIES_EVENTS="QUERY_OBSOLETE_TIME_SERIES_EVENTS",t.EDIT_TIME_SERIES_EVENTS="EDIT_TIME_SERIES_EVENTS",t.EDIT_OWN_TIME_SERIES_EVENTS="EDIT_OWN_TIME_SERIES_EVENTS",t.ACQUIRE_LOCK="ACQUIRE_LOCK",t.EXPOSE_BRANCH="EXPOSE_BRANCH",t.UNKNOWN_PATH_PERMISSION="UNKNOWN_PATH_PERMISSION"}(e.PathPermission||(e.PathPermission={})),function(t){t[t.REGEX=0]="REGEX",t[t.VALUES=1]="VALUES"}(e.ValidationType||(e.ValidationType={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CIDSerialiser=e.CIDSerialiserClass=void 0;var n=r(37),i=r(0),o=function(){function t(){}return t.prototype.read=function(t){return new n.ConversationId(i.readInt64(t))},t.prototype.write=function(t,e){i.writeInt64(t,e.val)},t}();e.CIDSerialiserClass=o,e.CIDSerialiser=new o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enumerize=void 0,e.enumerize=function(t){Object.keys(t).forEach((function(e){var r=t[e].id;void 0!==r&&(t[r]=e)}))}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ControlGroupSerialiser=e.ControlGroupSerialiserClass=void 0;var o=r(11),s=r(0),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.read=function(t){var e=s.readString(t);return new o.ControlGroup(e)},e.prototype.write=function(t,e){s.writeString(t,e.name)},e}(r(1).AbstractSerialiser);e.ControlGroupSerialiserClass=a,e.ControlGroupSerialiser=new a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TopicTypeEnum=e.TopicType=void 0;var n=r(7),i=function(t,e,r){this.id=t,this.stateful=e,this.functional=r};e.TopicType=i,e.TopicTypeEnum={BINARY:new i(14,!0,!1),JSON:new i(15,!0,!1),STRING:new i(17,!0,!1),INT64:new i(18,!0,!1),DOUBLE:new i(19,!0,!1),TIME_SERIES:new i(16,!0,!1),RECORD_V2:new i(20,!0,!1),UNKNOWN_TOPIC_TYPE:new i(21,!1,!1)},n.enumerize(e.TopicTypeEnum)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PathPermissionCode=e.GlobalPermissionCode=void 0,function(t){t[t.AUTHENTICATE=0]="AUTHENTICATE",t[t.VIEW_SESSION=1]="VIEW_SESSION",t[t.MODIFY_SESSION=2]="MODIFY_SESSION",t[t.REGISTER_HANDLER=3]="REGISTER_HANDLER",t[t.VIEW_SERVER=4]="VIEW_SERVER",t[t.CONTROL_SERVER=5]="CONTROL_SERVER",t[t.VIEW_SECURITY=6]="VIEW_SECURITY",t[t.MODIFY_SECURITY=7]="MODIFY_SECURITY",t[t.UNKNOWN_GLOBAL_PERMISSION=8]="UNKNOWN_GLOBAL_PERMISSION",t[t.READ_TOPIC_VIEWS=9]="READ_TOPIC_VIEWS",t[t.MODIFY_TOPIC_VIEWS=10]="MODIFY_TOPIC_VIEWS"}(e.GlobalPermissionCode||(e.GlobalPermissionCode={})),function(t){t[t.READ_TOPIC=0]="READ_TOPIC",t[t.UPDATE_TOPIC=1]="UPDATE_TOPIC",t[t.MODIFY_TOPIC=2]="MODIFY_TOPIC",t[t.SEND_TO_MESSAGE_HANDLER=3]="SEND_TO_MESSAGE_HANDLER",t[t.SEND_TO_SESSION=4]="SEND_TO_SESSION",t[t.SELECT_TOPIC=5]="SELECT_TOPIC",t[t.QUERY_OBSOLETE_TIME_SERIES_EVENTS=6]="QUERY_OBSOLETE_TIME_SERIES_EVENTS",t[t.EDIT_TIME_SERIES_EVENTS=7]="EDIT_TIME_SERIES_EVENTS",t[t.EDIT_OWN_TIME_SERIES_EVENTS=8]="EDIT_OWN_TIME_SERIES_EVENTS",t[t.ACQUIRE_LOCK=9]="ACQUIRE_LOCK",t[t.UNKNOWN_PATH_PERMISSION=10]="UNKNOWN_PATH_PERMISSION",t[t.EXPOSE_BRANCH=11]="EXPOSE_BRANCH"}(e.PathPermissionCode||(e.PathPermissionCode={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT=e.ControlGroup=void 0;var n=function(t){this.name=t};e.ControlGroup=n,e.DEFAULT=Object.freeze(new n("default"))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.MessageReceiverControlRegistrationParamsSerialiser=e.MessageReceiverControlRegistrationParamsSerialiserClass=void 0;var o=r(8),s=r(0),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.write=function(t,e){s.writeInt32(t,e.definition.id),o.ControlGroupSerialiser.write(t,e.group),s.writeString(t,e.path),s.writeCollection(t,e.keys,s.writeString)},e}(r(1).AbstractSerialiser);e.MessageReceiverControlRegistrationParamsSerialiserClass=a,e.MessageReceiverControlRegistrationParamsSerialiser=new a},function(t,e){t.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},s={};function a(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=s[t])?n:(r=c(t,(0|t)<0?-1:0,!0),i&&(s[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=c(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function u(t,e){if(isNaN(t))return e?S:E;if(e){if(t<0)return S;if(t>=d)return I}else{if(t<=-y)return O;if(t+1>=y)return T}return t<0?u(-t,e).neg():c(t%h|0,t/h|0,e)}function c(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=u,n.fromBits=c;var l=Math.pow;function f(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return E;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return f(t.substring(1),e,r).neg();for(var i=u(l(r,8)),o=E,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),c=parseInt(t.substring(s,s+a),r);if(a<8){var p=u(l(r,a));o=o.mul(p).add(u(c))}else o=(o=o.mul(i)).add(u(c))}return o.unsigned=e,o}function p(t,e){return"number"==typeof t?u(t,e):"string"==typeof t?f(t,e):c(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=f,n.fromValue=p;var h=4294967296,d=h*h,y=d/2,_=a(1<<24),E=a(0);n.ZERO=E;var S=a(0,!0);n.UZERO=S;var g=a(1);n.ONE=g;var v=a(1,!0);n.UONE=v;var w=a(-1);n.NEG_ONE=w;var T=c(-1,2147483647,!1);n.MAX_VALUE=T;var I=c(-1,-1,!0);n.MAX_UNSIGNED_VALUE=I;var O=c(0,-2147483648,!1);n.MIN_VALUE=O;var m=n.prototype;m.toInt=function(){return this.unsigned?this.low>>>0:this.low},m.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},m.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var e=u(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=u(l(t,6),this.unsigned),o=this,s="";;){var a=o.div(i),c=(o.sub(a.mul(i)).toInt()>>>0).toString(t);if((o=a).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},m.getHighBits=function(){return this.high},m.getHighBitsUnsigned=function(){return this.high>>>0},m.getLowBits=function(){return this.low},m.getLowBitsUnsigned=function(){return this.low>>>0},m.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},m.isZero=function(){return 0===this.high&&0===this.low},m.eqz=m.isZero,m.isNegative=function(){return!this.unsigned&&this.high<0},m.isPositive=function(){return this.unsigned||this.high>=0},m.isOdd=function(){return 1==(1&this.low)},m.isEven=function(){return 0==(1&this.low)},m.equals=function(t){return i(t)||(t=p(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},m.eq=m.equals,m.notEquals=function(t){return!this.eq(t)},m.neq=m.notEquals,m.ne=m.notEquals,m.lessThan=function(t){return this.comp(t)<0},m.lt=m.lessThan,m.lessThanOrEqual=function(t){return this.comp(t)<=0},m.lte=m.lessThanOrEqual,m.le=m.lessThanOrEqual,m.greaterThan=function(t){return this.comp(t)>0},m.gt=m.greaterThan,m.greaterThanOrEqual=function(t){return this.comp(t)>=0},m.gte=m.greaterThanOrEqual,m.ge=m.greaterThanOrEqual,m.compare=function(t){if(i(t)||(t=p(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},m.comp=m.compare,m.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(g)},m.neg=m.negate,m.add=function(t){i(t)||(t=p(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,u=t.low>>>16,l=0,f=0,h=0,d=0;return h+=(d+=o+(65535&t.low))>>>16,f+=(h+=n+u)>>>16,l+=(f+=r+a)>>>16,l+=e+s,c((h&=65535)<<16|(d&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},m.subtract=function(t){return i(t)||(t=p(t)),this.add(t.neg())},m.sub=m.subtract,m.multiply=function(t){if(this.isZero())return E;if(i(t)||(t=p(t)),r)return c(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return E;if(this.eq(O))return t.isOdd()?O:E;if(t.eq(O))return this.isOdd()?O:E;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(_)&&t.lt(_))return u(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,a=t.high>>>16,l=65535&t.high,f=t.low>>>16,h=65535&t.low,d=0,y=0,S=0,g=0;return S+=(g+=s*h)>>>16,y+=(S+=o*h)>>>16,S&=65535,y+=(S+=s*f)>>>16,d+=(y+=n*h)>>>16,y&=65535,d+=(y+=o*f)>>>16,y&=65535,d+=(y+=s*l)>>>16,d+=e*h+n*f+o*l+s*a,c((S&=65535)<<16|(g&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},m.mul=m.multiply,m.divide=function(t){if(i(t)||(t=p(t)),t.isZero())throw Error("division by zero");var e,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?c((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?S:E;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return S;if(t.gt(this.shru(1)))return v;o=S}else{if(this.eq(O))return t.eq(g)||t.eq(w)?O:t.eq(O)?g:(e=this.shr(1).div(t).shl(1)).eq(E)?t.isNegative()?g:w:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(O))return this.unsigned?S:E;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=E}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(e)/Math.LN2),a=s<=48?1:l(2,s-48),f=u(e),h=f.mul(t);h.isNegative()||h.gt(n);)h=(f=u(e-=a,this.unsigned)).mul(t);f.isZero()&&(f=g),o=o.add(f),n=n.sub(h)}return o},m.div=m.divide,m.modulo=function(t){return i(t)||(t=p(t)),r?c((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},m.mod=m.modulo,m.rem=m.modulo,m.not=function(){return c(~this.low,~this.high,this.unsigned)},m.and=function(t){return i(t)||(t=p(t)),c(this.low&t.low,this.high&t.high,this.unsigned)},m.or=function(t){return i(t)||(t=p(t)),c(this.low|t.low,this.high|t.high,this.unsigned)},m.xor=function(t){return i(t)||(t=p(t)),c(this.low^t.low,this.high^t.high,this.unsigned)},m.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?c(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):c(0,this.low<<t-32,this.unsigned)},m.shl=m.shiftLeft,m.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?c(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):c(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},m.shr=m.shiftRight,m.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?c(this.low>>>t|e<<32-t,e>>>t,this.unsigned):c(32===t?e:e>>>t-32,0,this.unsigned)},m.shru=m.shiftRightUnsigned,m.shr_u=m.shiftRightUnsigned,m.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},m.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},m.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},m.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},m.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},function(t,e,r){"use strict";(function(t){var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};function o(t){for(var e=[],r=0;r<t.length;r+=128)e.push(t.subarray(r,Math.min(r+128,t.length)));return e.map((function(t){return String.fromCharCode.apply(String,i([],n(t)))})).join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.isUint8Array=e.isEqualUint8Arrays=e.uint8toUtf8=e.uint8ToBase64=e.uint8ToAscii=e.uint8FromDoubleBE=e.uint8FromBase64=e.uint8FromUtf8=e.uint8FromBinary=e.writeInt32BE=e.writeInt8=e.readDoubleBE=e.readFloatBE=e.readInt32BE=e.readUInt32BE=e.readUInt16BE=e.readInt8=e.concatUint8Arrays=void 0,e.concatUint8Arrays=function(t){var e,n,i=t.reduce((function(t,e){return t+e.length}),0),o=new Uint8Array(i),s=0;try{for(var a=r(t),u=a.next();!u.done;u=a.next()){var c=u.value;o.set(c,s),s+=c.length}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o},e.readInt8=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(e)},e.readUInt16BE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(e,!1)},e.readUInt32BE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(e,!1)},e.readInt32BE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt32(e,!1)},e.readFloatBE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!1)},e.readDoubleBE=function(t,e){return new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!1)},e.writeInt8=function(t,e,r){t[e]=r},e.writeInt32BE=function(t,e,r){new DataView(t.buffer,t.byteOffset,t.byteLength).setInt32(e,r,!1)},e.uint8FromBinary=function(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e},e.uint8FromUtf8=function(t){return(new TextEncoder).encode(t)},e.uint8FromBase64="undefined"==typeof window||void 0===window.atob?function(e){return new Uint8Array(t.from(e,"base64"))}:function(t){return new Uint8Array(window.atob(t).split("").map((function(t){return t.charCodeAt(0)})))},e.uint8FromDoubleBE=function(t){var e=new ArrayBuffer(8);return new DataView(e).setFloat64(0,t,!1),new Uint8Array(e)},e.uint8ToAscii=o,e.uint8ToBase64="undefined"==typeof window||void 0===window.btoa?function(e){return t.from(e).toString("base64")}:function(t){return window.btoa(o(t))},e.uint8toUtf8=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=t.length),(new TextDecoder).decode(t.subarray(e,r))},e.isEqualUint8Arrays=function(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0},e.isUint8Array=function(t){return"function"==typeof Uint8Array&&t instanceof Uint8Array||"[object Uint8Array]"===Object.prototype.toString.call(t)}}).call(this,r(31).Buffer)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.TopicControlRegistrationParamsSerialiser=e.TopicControlRegistrationParamsSerialiserClass=void 0;var o=r(8),s=r(0),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.write=function(t,e){s.writeInt32(t,e.definition.id),o.ControlGroupSerialiser.write(t,e.group),s.writeString(t,e.path)},e}(r(1).AbstractSerialiser);e.TopicControlRegistrationParamsSerialiserClass=a,e.TopicControlRegistrationParamsSerialiser=new a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullSerialiser=void 0,e.NullSerialiser={read:function(){return null},write:function(){}}},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.TopicSpecification=void 0;var o=r(3),s=["PUBLISH_VALUES_ONLY","SCHEMA","VALIDATE_VALUES","TIDY_ON_UNSUBSCRIBE","TIME_SERIES_EVENT_VALUE_TYPE","TIME_SERIES_RETAINED_RANGE","TIME_SERIES_SUBSCRIPTION_RANGE","DONT_RETAIN_VALUE","PERSISTENT","REMOVAL","OWNER","COMPRESSION","CONFLATION","PRIORITY"],a=function(){function t(t,e){void 0===e&&(e={}),this.type=t,this.properties=e}return t.prototype.withProperty=function(e,r){var i;if("string"!=typeof e||s.indexOf(e.toUpperCase())<0)throw new o.IllegalArgumentError("Invalid key: "+e);if("string"!=typeof r)throw new o.IllegalArgumentError("Invalid value, must be string: "+r);var a=n(n({},this.properties),((i={})[e]=r,i));return new t(this.type,a)},t.prototype.withProperties=function(e){var r,a;try{for(var u=i(Object.getOwnPropertyNames(e)),c=u.next();!c.done;c=u.next()){var l=c.value;if("string"!=typeof l||s.indexOf(l.toUpperCase())<0)throw new o.IllegalArgumentError("Invalid key: "+l);var f=e[l];if("string"!=typeof f)throw new o.IllegalArgumentError("Invalid value, must be string: "+f)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}var p=n(n({},this.properties),e);return new t(this.type,p)},t.PUBLISH_VALUES_ONLY="PUBLISH_VALUES_ONLY",t.VALIDATE_VALUES="VALIDATE_VALUES",t.TIDY_ON_UNSUBSCRIBE="TIDY_ON_UNSUBSCRIBE",t.TIME_SERIES_EVENT_VALUE_TYPE="TIME_SERIES_EVENT_VALUE_TYPE",t.TIME_SERIES_RETAINED_RANGE="TIME_SERIES_RETAINED_RANGE",t.TIME_SERIES_SUBSCRIPTION_RANGE="TIME_SERIES_SUBSCRIPTION_RANGE",t.SCHEMA="SCHEMA",t.DONT_RETAIN_VALUE="DONT_RETAIN_VALUE",t.PERSISTENT="PERSISTENT",t.REMOVAL="REMOVAL",t.CONFLATION="CONFLATION",t.OWNER="OWNER",t.COMPRESSION="COMPRESSION",t.PRIORITY="PRIORITY",t}();e.TopicSpecification=a},function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.setLevel=e.create=e.LoggingLevel=void 0;var i,o=r(47);function s(t,e){var r="|"+t.toUpperCase()+"|"+e+"|",n=function(){return new Date};return function(e,i){i?o[t](n()+r+e,i):o[t](n()+r+e)}}!function(t){t.trace="trace",t.debug="debug",t.info="info",t.warn="warn",t.error="error"}(i=e.LoggingLevel||(e.LoggingLevel={})),e.create=function(t){var e,r,o={};try{for(var a=n(Object.keys(i)),u=a.next();!u.done;u=a.next()){var c=u.value;o[c]=s(c,t)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return o},e.setLevel=o.setLevel},function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function i(t){var e,r,i="";if(t.indexOf("'")<0&&t.indexOf("\\")<0)i+=t;else try{for(var o=n(t),s=o.next();!s.done;s=o.next()){var a=s.value;"'"!==a&&"\\"!==a||(i+="\\"),i+=a}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return"'"+i+"'"}Object.defineProperty(e,"__esModule",{value:!0}),e.permissionsToString=e.setToString=e.quoteAndEscape=void 0,e.quoteAndEscape=i,e.setToString=function(t){return"["+t.map(i).join(" ")+"]"},e.permissionsToString=function(t){return"["+t.join(" ")+"]"}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SecurityCommandScript=void 0;var n=r(4),i=function(){function t(t){this.script=n.requireNonNull(t,"script")}return t.prototype.toString=function(){return"SecurityCommandScript ["+this.script+"]"},t}();e.SecurityCommandScript=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionPropertyValidationImpl=void 0;var n=function(t){this.type=t};e.SessionPropertyValidationImpl=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.write=e.read=void 0;var n,i=r(0),o=r(2);!function(t){t[t.NONE=0]="NONE",t[t.PLAIN=1]="PLAIN",t[t.CUSTOM=2]="CUSTOM"}(n||(n={})),e.read=function(t){switch(o.read(t,n)){case n.PLAIN:return i.readString(t)||null;case n.CUSTOM:return i.readBytes(t);case n.NONE:default:return i.readBytes(t),null}},e.write=function(t,e){null!=e?"string"==typeof e?(o.write(t,n.PLAIN),i.writeString(t,e)):(o.write(t,n.CUSTOM),i.writeBytes(t,e)):(o.write(t,n.NONE),i.writeInt32(t,0))}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.AuthenticatorRegistrationParametersSerialiser=e.AuthenticatorRegistrationParametersSerialiserClass=void 0;var o=r(0),s=r(1),a=r(67),u=r(68),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.read=function(t){var e=a.ControlRegistrationParamsSerialiser.read(t),r=o.readString(t);return new u.AuthenticatorRegistrationParameters(r,e.definition,e.group)},e.prototype.write=function(t,e){a.ControlRegistrationParamsSerialiser.write(t,e),o.writeString(t,e.name)},e}(s.AbstractSerialiser);e.AuthenticatorRegistrationParametersSerialiserClass=c,e.AuthenticatorRegistrationParametersSerialiser=new c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ControlRegistrationParams=void 0;var n=function(t,e){this.definition=t,this.group=e};e.ControlRegistrationParams=n},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ABSTAIN=e.DENY=e.AuthenticatorResponse=e.TypeCode=void 0,function(t){t[t.DENY=0]="DENY",t[t.ABSTAIN=1]="ABSTAIN",t[t.ALLOW=2]="ALLOW"}(n=e.TypeCode||(e.TypeCode={}));var i=function(t,e){this.type=t,this.properties=e};e.AuthenticatorResponse=i,e.DENY=Object.freeze(new i(n.DENY)),e.ABSTAIN=Object.freeze(new i(n.ABSTAIN))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),void 0===window._diffusion_features&&(window._diffusion_features={client_control:{},gateway_control:{},log_retrieval:{},messages:{},metrics:{},ping:{},remote_servers:{},replace_license:{},security:{},session_lock:{},session_trees:{},topic_control:{},topic_notifications:{},topic_update:{},topic_views:{},time_series:{}});var n=r(27);window._diffusion_features.security.SecurityImpl=n.SecurityImpl},function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.SecurityImpl=void 0;var i=r(28),o=r(11),s=r(29),a=r(48),u=r(49),c=r(20),l=r(50),f=r(51),p=r(25),h=r(18),d=r(4),y=r(82),_=r(5),E=h.create("Session.Security"),S=function(){function t(t){this.GlobalPermission=_.GlobalPermission,this.PathPermission=_.PathPermission,this.internal=t;var e=t.getServiceLocator();this.CHANGE_PRINCIPAL=e.obtain(f.CHANGE_PRINCIPAL),this.GET_SECURITY_CONFIGURATION=e.obtain(f.GET_SECURITY_CONFIGURATION),this.GET_SYSTEM_AUTHENTICATION=e.obtain(f.GET_SYSTEM_AUTHENTICATION),this.UPDATE_SECURITY_CONFIGURATION=e.obtain(f.UPDATE_SECURITY_CONFIGURATION),this.UPDATE_SYSTEM_AUTHENTICATION=e.obtain(f.UPDATE_SYSTEM_AUTHENTICATION),this.AUTHENTICATOR_DEREGISTRATION=e.obtain(f.AUTHENTICATOR_DEREGISTRATION),this.LIST_GLOBAL_PERMISSIONS=e.obtain(f.LIST_GLOBAL_PERMISSIONS),this.LIST_PATH_PERMISSIONS=e.obtain(f.LIST_PATH_PERMISSIONS),t.getServiceRegistry().add(f.AUTHENTICATOR,i.create((function(t,e,r){t.getConversationSet().respondIfPresent(e.cid,{req:e,callback:r})})))}return t.prototype.getPrincipal=function(){return this.internal.getPrincipal()},t.prototype.changePrincipal=function(t,e){var r=this;return new Promise((function(n,i){r.internal.checkConnected(i)&&(E.debug("Changing principal",t),r.CHANGE_PRINCIPAL.send(new l.ChangePrincipalRequest(t,e),(function(e,o){e?i(e):o?(r.internal.setPrincipal(t),n()):i(new Error("Unable to change principal due to authentication failure"))})))}))},t.prototype.getSecurityConfiguration=function(){var t=this;return new Promise((function(e,r){t.internal.checkConnected(r)&&(E.debug("Getting security configuration"),t.GET_SECURITY_CONFIGURATION.send(null,(function(t,n){t?r(t):e(n)})))}))},t.prototype.getSystemAuthenticationConfiguration=function(){var t=this;return new Promise((function(e,r){t.internal.checkConnected(r)&&(E.debug("Getting system authentication"),t.GET_SYSTEM_AUTHENTICATION.send(null,(function(t,n){t?r(t):e(n)})))}))},t.prototype.setAuthenticator=function(t,e){var r=this;return new Promise((function(i,a){var u=!1;if(r.internal.checkConnected(a)){try{d.requireNonNull(t,"handlerName"),d.requireNonNull(e,"authenticator")}catch(t){return void a(t)}"function"==typeof e.authenticate&&"function"==typeof e.onError&&"function"==typeof e.onClose||a(new Error("authenticator does not implement the Authenticator interface")),E.debug("Adding authenticator",t);var c={name:t,definition:f.AUTHENTICATOR,group:o.DEFAULT},l={active:function(n,o){E.debug("Authenticator active",t),i({close:function(){return new Promise((function(t){u=!0,r.AUTHENTICATOR_DEREGISTRATION.send(c,(function(n,i){n?(r.internal.getConversationSet().discard(o,n),E.debug("Error with authenticator deregistration: ",n)):(r.internal.getConversationSet().respondIfPresent(o,i),e.onClose()),t()}))}))}})},respond:function(t){if(u)return!0;var r=t.req,i=t.callback;try{e.authenticate(r.principal,r.credentials,r.sessionProperties,r.proposedProperties,{allow:function(t){var e,o;if(t){t=Object.assign({},t);try{for(var s=n(Object.getOwnPropertyNames(r.sessionProperties)),a=s.next();!a.done;a=s.next()){var u=a.value;t[u]===r.sessionProperties[u]&&delete t[u]}}catch(t){e={error:t}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}}i.respond(new p.AuthenticatorResponse(p.TypeCode.ALLOW,t))},abstain:function(){i.respond(p.ABSTAIN)},deny:function(){i.respond(p.DENY)}})}catch(t){throw e.onError(t),i.fail(y.ErrorReason.CALLBACK_EXCEPTION,t&&t.message),t}return!1},close:function(r){r?(E.debug("'Authenticator closed with error for \""+t+"\"'"),e.onError(r)):(E.debug("'Authentication Handler closed for \""+t+"\"'"),e.onClose())}};s.registerHandler(r.internal,c,l,f.AUTHENTICATOR_REGISTRATION,f.AUTHENTICATOR_DEREGISTRATION).then(void 0,(function(t){a(t)}))}}))},t.prototype.updateStoreCallback=function(t,e,r,n){t?n(t):e.errors.length>0?n(e.errors):r()},t.prototype.updateStore=function(t,e){var r=this;return new Promise((function(n,i){""===e?n():e&&"string"==typeof e?r.internal.checkConnected(i)&&t.send(new c.SecurityCommandScript(e),(function(t,e){r.updateStoreCallback(t,e,n,i)})):i(new Error("Invalid argument for script: "+e))}))},t.prototype.updateSecurityStore=function(t){return E.debug("Updating security store"),this.updateStore(this.UPDATE_SECURITY_CONFIGURATION,t)},t.prototype.updateAuthenticationStore=function(t){return E.debug("Updating authentication store"),this.updateStore(this.UPDATE_SYSTEM_AUTHENTICATION,t)},t.prototype.securityScriptBuilder=function(){return new a.SecurityScriptBuilderImpl},t.prototype.authenticationScriptBuilder=function(){return new u.SystemAuthenticationScriptBuilderImpl},t.prototype.getGlobalPermissions=function(){var t=this;return new Promise((function(e,r){t.internal.checkConnected(r)&&(E.debug("Getting global permissions"),t.LIST_GLOBAL_PERMISSIONS.send(null,(function(t,n){t?r(t):e(n.permissions)})))}))},t.prototype.getPathPermissions=function(t){var e=this;return new Promise((function(r,n){e.internal.checkConnected(n)&&(E.debug("Getting path permissions"),e.LIST_PATH_PERMISSIONS.send(t,(function(t,e){t?n(t):r(e.permissions)})))}))},t}();e.SecurityImpl=S},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=void 0,e.create=function(t){return{onRequest:function(e,r,n){try{t(e,r,n)}catch(t){n.fail(e.getContext().ErrorReason.CALLBACK_EXCEPTION,t.message)}}}}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.registerTopicHandler=e.registerRequestHandler=e.registerHandler=e.registrationCallback=e.responseHandler=e.ResponseHandlerState=void 0;var c,l=r(30),f=r(18).create("Registration");!function(t){t[t.REGISTERING=0]="REGISTERING",t[t.ACTIVE=1]="ACTIVE",t[t.CLOSED=2]="CLOSED"}(c=e.ResponseHandlerState||(e.ResponseHandlerState={}));var p=function(t){function e(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=t.apply(this,u([],a(r)))||this;return i.cause=e,i}return i(e,t),e}(Error);function h(t,e,r){var n,i=c.REGISTERING;return{onDiscard:function(r,n){try{n instanceof t.getContext().CloseReason?e.close():e.close(n)}catch(n){f.error("REGISTERED_HANDLER_EXCEPTION",n)}i=c.CLOSED},onOpen:function(e){n=function(){return new Promise((function(n,o){i!==c.CLOSED?r(e,(function(r){r?(t.getConversationSet().discard(e,r),o(r)):(t.getConversationSet().respondIfPresent(e,c.CLOSED),n())})):o(new Error("Handler already closed"))}))}},onResponse:function(r,o){if(o===c.CLOSED){try{e.close()}catch(t){f.error("REGISTERED_HANDLER_EXCEPTION",t)}return i=o,!0}try{return o===c.ACTIVE?(e.active(n,r),i=o,!1):e.respond(o)}catch(e){f.error("REGISTERED_HANDLER_EXCEPTION",e),t.getConversationSet().discard(r,new p(e,"An error was thrown by the handler")),n().catch((function(t){f.debug("Failed to deregister with the server",t)}))}return!0}}}function d(t,e,r,n){return function(i){i?(t.discard(e,i),n(i)):(t.respondIfPresent(e,c.ACTIVE),r())}}function y(t,e,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,c,l;return s(this,(function(s){switch(s.label){case 0:return o=t.getConversationSet(),a=t.getServiceLocator(),u=a.obtain(n),c=a.obtain(i),[4,o.newConversation(h(t,r,(function(t,r){c.send(e,r)})))];case 1:return l=s.sent(),[2,new Promise((function(t,r){u.send({params:e,cid:l},d(o,l,t,r))}))]}}))}))}e.responseHandler=h,e.registrationCallback=d,e.registerHandler=y,e.registerRequestHandler=function(t,e,r){return y(t,e,r,l.MESSAGING_RECEIVER_CONTROL_REGISTRATION,l.MESSAGING_RECEIVER_CONTROL_DEREGISTRATION)},e.registerTopicHandler=function(t,e,r){return y(t,e,r,l.TOPIC_CONTROL_REGISTRATION,l.TOPIC_CONTROL_DEREGISTRATION)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MESSAGING_RECEIVER_CONTROL_DEREGISTRATION=e.MESSAGING_RECEIVER_CONTROL_REGISTRATION=e.NOTIFY_SUBSCRIPTION=e.MESSAGE_RECEIVER_CONTROL_DEREGISTRATION=e.MESSAGE_RECEIVER_CONTROL_REGISTRATION=e.UNSUBSCRIPTION_NOTIFICATION=e.TOPIC_CONTROL_DEREGISTRATION=e.TOPIC_CONTROL_REGISTRATION=void 0;var n=r(12),i=r(36),o=r(15),s=r(38),a=r(16),u=r(39),c=r(44);e.TOPIC_CONTROL_REGISTRATION={id:20,request:s.TopicControlRegistrationRequestSerialiser,response:a.NullSerialiser},e.TOPIC_CONTROL_DEREGISTRATION={id:21,request:o.TopicControlRegistrationParamsSerialiser,response:a.NullSerialiser},e.UNSUBSCRIPTION_NOTIFICATION={id:42,request:u.UnsubscriptionNotificationSerialiser,response:a.NullSerialiser},e.MESSAGE_RECEIVER_CONTROL_REGISTRATION={id:63,request:i.MessageReceiverControlRegistrationRequestSerialiser,response:a.NullSerialiser},e.MESSAGE_RECEIVER_CONTROL_DEREGISTRATION={id:64,request:n.MessageReceiverControlRegistrationParamsSerialiser,response:a.NullSerialiser},e.NOTIFY_SUBSCRIPTION={id:87,request:c.TopicSpecificationInfoSerialiser,response:a.NullSerialiser},e.MESSAGING_RECEIVER_CONTROL_REGISTRATION={id:97,request:i.MessageReceiverControlRegistrationRequestSerialiser,response:a.NullSerialiser},e.MESSAGING_RECEIVER_CONTROL_DEREGISTRATION={id:98,request:n.MessageReceiverControlRegistrationParamsSerialiser,response:a.NullSerialiser}},function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var n=r(33),i=r(34),o=r(35);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=p(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|h(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(l(e),t=a(t,e<0?0:0|h(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|h(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return x(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return x(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r)