polfan-server-js-client 0.0.95 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/build/index.js +1 -1
  2. package/build/index.js.map +1 -1
  3. package/build/types/AbstractClient.d.ts +78 -0
  4. package/build/types/EventTarget.d.ts +16 -0
  5. package/build/types/IndexedObjectCollection.d.ts +53 -0
  6. package/build/types/WebApiClient.d.ts +30 -0
  7. package/build/types/WebSocketClient.d.ts +36 -0
  8. package/build/types/WebSocketStateTracker.d.ts +54 -0
  9. package/build/types/index.d.ts +4 -68
  10. package/package.json +65 -64
  11. package/src/AbstractClient.ts +174 -0
  12. package/src/EventTarget.ts +39 -0
  13. package/src/IndexedObjectCollection.ts +209 -0
  14. package/src/{connections/WebApiConnection.ts → WebApiClient.ts} +94 -81
  15. package/src/WebSocketClient.ts +125 -0
  16. package/src/WebSocketStateTracker.ts +326 -0
  17. package/src/index.ts +13 -123
  18. package/build/types/Client.d.ts +0 -107
  19. package/build/types/ObservableInterface.d.ts +0 -16
  20. package/build/types/connections/ConnectionAssets.d.ts +0 -17
  21. package/build/types/connections/RestApiConnection.d.ts +0 -14
  22. package/build/types/connections/WebApiConnection.d.ts +0 -21
  23. package/build/types/connections/WebSocketConnection.d.ts +0 -22
  24. package/build/types/dtos/Dto.d.ts +0 -16
  25. package/build/types/dtos/Message.d.ts +0 -9
  26. package/build/types/dtos/Permission.d.ts +0 -7
  27. package/build/types/dtos/Role.d.ts +0 -7
  28. package/build/types/dtos/Room.d.ts +0 -8
  29. package/build/types/dtos/RoomMember.d.ts +0 -6
  30. package/build/types/dtos/RoomSummary.d.ts +0 -7
  31. package/build/types/dtos/Space.d.ts +0 -8
  32. package/build/types/dtos/SpaceMember.d.ts +0 -7
  33. package/build/types/dtos/Topic.d.ts +0 -7
  34. package/build/types/dtos/User.d.ts +0 -9
  35. package/build/types/dtos/UserState.d.ts +0 -8
  36. package/build/types/dtos/protocol/Envelope.d.ts +0 -7
  37. package/build/types/dtos/protocol/commands/AssignRole.d.ts +0 -7
  38. package/build/types/dtos/protocol/commands/CreateMessage.d.ts +0 -7
  39. package/build/types/dtos/protocol/commands/CreateRole.d.ts +0 -7
  40. package/build/types/dtos/protocol/commands/CreateRoom.d.ts +0 -7
  41. package/build/types/dtos/protocol/commands/CreateSpace.d.ts +0 -5
  42. package/build/types/dtos/protocol/commands/CreateTopic.d.ts +0 -7
  43. package/build/types/dtos/protocol/commands/DeassignRole.d.ts +0 -7
  44. package/build/types/dtos/protocol/commands/DeleteRole.d.ts +0 -6
  45. package/build/types/dtos/protocol/commands/DeleteRoom.d.ts +0 -5
  46. package/build/types/dtos/protocol/commands/DeleteSpace.d.ts +0 -5
  47. package/build/types/dtos/protocol/commands/DeleteTopic.d.ts +0 -5
  48. package/build/types/dtos/protocol/commands/GetComputedPermissions.d.ts +0 -8
  49. package/build/types/dtos/protocol/commands/GetRolePermissions.d.ts +0 -8
  50. package/build/types/dtos/protocol/commands/GetRoomMembers.d.ts +0 -5
  51. package/build/types/dtos/protocol/commands/GetSession.d.ts +0 -4
  52. package/build/types/dtos/protocol/commands/GetSpaceMembers.d.ts +0 -5
  53. package/build/types/dtos/protocol/commands/GetSpaceRooms.d.ts +0 -5
  54. package/build/types/dtos/protocol/commands/GetUserPermissions.d.ts +0 -8
  55. package/build/types/dtos/protocol/commands/JoinRoom.d.ts +0 -5
  56. package/build/types/dtos/protocol/commands/JoinSpace.d.ts +0 -5
  57. package/build/types/dtos/protocol/commands/LeaveRoom.d.ts +0 -5
  58. package/build/types/dtos/protocol/commands/LeaveSpace.d.ts +0 -5
  59. package/build/types/dtos/protocol/commands/SetRolePermissions.d.ts +0 -9
  60. package/build/types/dtos/protocol/commands/SetUserPermissions.d.ts +0 -9
  61. package/build/types/dtos/protocol/events/Bye.d.ts +0 -5
  62. package/build/types/dtos/protocol/events/Error.d.ts +0 -6
  63. package/build/types/dtos/protocol/events/NewMessage.d.ts +0 -6
  64. package/build/types/dtos/protocol/events/NewRole.d.ts +0 -7
  65. package/build/types/dtos/protocol/events/NewRoom.d.ts +0 -7
  66. package/build/types/dtos/protocol/events/NewTopic.d.ts +0 -7
  67. package/build/types/dtos/protocol/events/Ok.d.ts +0 -4
  68. package/build/types/dtos/protocol/events/Permissions.d.ts +0 -6
  69. package/build/types/dtos/protocol/events/RoleDeleted.d.ts +0 -6
  70. package/build/types/dtos/protocol/events/RoomDeleted.d.ts +0 -5
  71. package/build/types/dtos/protocol/events/RoomJoined.d.ts +0 -6
  72. package/build/types/dtos/protocol/events/RoomLeft.d.ts +0 -5
  73. package/build/types/dtos/protocol/events/RoomMemberJoined.d.ts +0 -6
  74. package/build/types/dtos/protocol/events/RoomMemberLeft.d.ts +0 -5
  75. package/build/types/dtos/protocol/events/RoomMembers.d.ts +0 -6
  76. package/build/types/dtos/protocol/events/Session.d.ts +0 -9
  77. package/build/types/dtos/protocol/events/SpaceDeleted.d.ts +0 -5
  78. package/build/types/dtos/protocol/events/SpaceJoined.d.ts +0 -6
  79. package/build/types/dtos/protocol/events/SpaceLeft.d.ts +0 -5
  80. package/build/types/dtos/protocol/events/SpaceMemberJoined.d.ts +0 -6
  81. package/build/types/dtos/protocol/events/SpaceMemberLeft.d.ts +0 -5
  82. package/build/types/dtos/protocol/events/SpaceMemberUpdate.d.ts +0 -6
  83. package/build/types/dtos/protocol/events/SpaceMembers.d.ts +0 -6
  84. package/build/types/dtos/protocol/events/SpaceRooms.d.ts +0 -6
  85. package/build/types/dtos/protocol/events/TopicDeleted.d.ts +0 -5
  86. package/build/types/protocol.d.ts +0 -102
  87. package/src/Client.ts +0 -267
  88. package/src/ObservableInterface.ts +0 -39
  89. package/src/connections/ConnectionAssets.ts +0 -20
  90. package/src/connections/RestApiConnection.ts +0 -47
  91. package/src/connections/WebSocketConnection.ts +0 -103
  92. package/src/dtos/Dto.ts +0 -45
  93. package/src/dtos/Message.ts +0 -16
  94. package/src/dtos/Permission.ts +0 -12
  95. package/src/dtos/Role.ts +0 -12
  96. package/src/dtos/Room.ts +0 -15
  97. package/src/dtos/RoomMember.ts +0 -13
  98. package/src/dtos/RoomSummary.ts +0 -12
  99. package/src/dtos/Space.ts +0 -15
  100. package/src/dtos/SpaceMember.ts +0 -14
  101. package/src/dtos/Topic.ts +0 -12
  102. package/src/dtos/User.ts +0 -15
  103. package/src/dtos/UserState.ts +0 -16
  104. package/src/dtos/protocol/Envelope.ts +0 -12
  105. package/src/dtos/protocol/commands/AssignRole.ts +0 -12
  106. package/src/dtos/protocol/commands/CreateMessage.ts +0 -12
  107. package/src/dtos/protocol/commands/CreateRole.ts +0 -12
  108. package/src/dtos/protocol/commands/CreateRoom.ts +0 -12
  109. package/src/dtos/protocol/commands/CreateSpace.ts +0 -10
  110. package/src/dtos/protocol/commands/CreateTopic.ts +0 -12
  111. package/src/dtos/protocol/commands/DeassignRole.ts +0 -12
  112. package/src/dtos/protocol/commands/DeleteRole.ts +0 -11
  113. package/src/dtos/protocol/commands/DeleteRoom.ts +0 -10
  114. package/src/dtos/protocol/commands/DeleteSpace.ts +0 -10
  115. package/src/dtos/protocol/commands/DeleteTopic.ts +0 -10
  116. package/src/dtos/protocol/commands/GetComputedPermissions.ts +0 -13
  117. package/src/dtos/protocol/commands/GetRolePermissions.ts +0 -13
  118. package/src/dtos/protocol/commands/GetRoomMembers.ts +0 -10
  119. package/src/dtos/protocol/commands/GetSession.ts +0 -8
  120. package/src/dtos/protocol/commands/GetSpaceMembers.ts +0 -10
  121. package/src/dtos/protocol/commands/GetSpaceRooms.ts +0 -10
  122. package/src/dtos/protocol/commands/GetUserPermissions.ts +0 -13
  123. package/src/dtos/protocol/commands/JoinRoom.ts +0 -10
  124. package/src/dtos/protocol/commands/JoinSpace.ts +0 -10
  125. package/src/dtos/protocol/commands/LeaveRoom.ts +0 -10
  126. package/src/dtos/protocol/commands/LeaveSpace.ts +0 -10
  127. package/src/dtos/protocol/commands/SetRolePermissions.ts +0 -16
  128. package/src/dtos/protocol/commands/SetUserPermissions.ts +0 -16
  129. package/src/dtos/protocol/events/Bye.ts +0 -10
  130. package/src/dtos/protocol/events/Error.ts +0 -11
  131. package/src/dtos/protocol/events/NewMessage.ts +0 -13
  132. package/src/dtos/protocol/events/NewRole.ts +0 -14
  133. package/src/dtos/protocol/events/NewRoom.ts +0 -14
  134. package/src/dtos/protocol/events/NewTopic.ts +0 -14
  135. package/src/dtos/protocol/events/Ok.ts +0 -8
  136. package/src/dtos/protocol/events/Permissions.ts +0 -13
  137. package/src/dtos/protocol/events/RoleDeleted.ts +0 -11
  138. package/src/dtos/protocol/events/RoomDeleted.ts +0 -10
  139. package/src/dtos/protocol/events/RoomJoined.ts +0 -13
  140. package/src/dtos/protocol/events/RoomLeft.ts +0 -10
  141. package/src/dtos/protocol/events/RoomMemberJoined.ts +0 -13
  142. package/src/dtos/protocol/events/RoomMemberLeft.ts +0 -10
  143. package/src/dtos/protocol/events/RoomMembers.ts +0 -13
  144. package/src/dtos/protocol/events/Session.ts +0 -17
  145. package/src/dtos/protocol/events/SpaceDeleted.ts +0 -10
  146. package/src/dtos/protocol/events/SpaceJoined.ts +0 -13
  147. package/src/dtos/protocol/events/SpaceLeft.ts +0 -10
  148. package/src/dtos/protocol/events/SpaceMemberJoined.ts +0 -13
  149. package/src/dtos/protocol/events/SpaceMemberLeft.ts +0 -10
  150. package/src/dtos/protocol/events/SpaceMemberUpdate.ts +0 -13
  151. package/src/dtos/protocol/events/SpaceMembers.ts +0 -13
  152. package/src/dtos/protocol/events/SpaceRooms.ts +0 -13
  153. package/src/dtos/protocol/events/TopicDeleted.ts +0 -10
  154. package/src/protocol.ts +0 -113
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.PServ=e():t.PServ=e()}(self,(()=>(()=>{"use strict";var t,e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},r={};function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function c(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n(e)?e:String(e)}e.r(r),e.d(r,{AssignRole:()=>nf,Bye:()=>M,ChatConnectionEvent:()=>t,Client:()=>Ml,ClientEvent:()=>dl,CreateMessage:()=>el,CreateRole:()=>Mc,CreateRoom:()=>fa,CreateSpace:()=>tc,CreateTopic:()=>Ia,DeassignRole:()=>bf,DeleteRole:()=>zc,DeleteRoom:()=>ha,DeleteSpace:()=>ac,DeleteTopic:()=>Ha,Dto:()=>d,Envelope:()=>T,Error:()=>tt,GetComputedPermissions:()=>Eu,GetRolePermissions:()=>Df,GetRoomMembers:()=>Ra,GetSession:()=>Ki,GetSpaceMembers:()=>dc,GetSpaceRooms:()=>Ec,GetUserPermissions:()=>hu,JoinRoom:()=>Qf,JoinSpace:()=>Iu,LeaveRoom:()=>Xf,LeaveSpace:()=>Hu,Message:()=>Li,NewMessage:()=>Wi,NewRole:()=>kn,NewRoom:()=>Ko,NewTopic:()=>mi,Ok:()=>W,Permission:()=>Re,Permissions:()=>Le,RestApiConnection:()=>wl,Role:()=>lt,RoleDeleted:()=>Un,Room:()=>Ut,RoomDeleted:()=>ui,RoomJoined:()=>qn,RoomLeft:()=>oo,RoomMember:()=>yo,RoomMemberJoined:()=>Po,RoomMemberLeft:()=>Co,RoomMembers:()=>Jo,RoomSummary:()=>sn,Session:()=>me,SetRolePermissions:()=>Sf,SetUserPermissions:()=>cu,Space:()=>Ot,SpaceDeleted:()=>Hr,SpaceJoined:()=>We,SpaceLeft:()=>Ze,SpaceMember:()=>ar,SpaceMemberJoined:()=>dr,SpaceMemberLeft:()=>Er,SpaceMemberUpdate:()=>Ir,SpaceMembers:()=>tn,SpaceRooms:()=>On,Topic:()=>kt,TopicDeleted:()=>_i,User:()=>ue,UserState:()=>Vt,WebApiConnection:()=>$l,WebSocketConnection:()=>yl}),function(t){t.message="message",t.destroy="destroy",t.ready="ready",t.error="error"}(t||(t={}));var a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,"events",new Map),c(this,"onceEvents",new Map)}var e,r,n;return e=t,r=[{key:"on",value:function(t,e){return this.addHandler(this.events,t,e),this}},{key:"once",value:function(t,e){return this.addHandler(this.onceEvents,t,e),this}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return this.callHandlers(this.events,t,r),this.callHandlers(this.onceEvents,t,r),this.onceEvents.delete(t),this}},{key:"addHandler",value:function(t,e,r){var n,o=null!==(n=t.get(e))&&void 0!==n?n:[];o.push(r),t.set(e,o)}},{key:"callHandlers",value:function(t,e,r){var n;null===(n=t.get(e))||void 0===n||n.forEach((function(t){return t.apply(void 0,o(r))}))}}],r&&u(e.prototype,r),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function y(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n)}}function v(t){var e=function(t,e){if("object"!==l(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===l(e)?e:String(e)}function m(t,e){return t instanceof e?t:new e(t)}function h(t,e){if(!Array.isArray(t))throw new Error("Passed data is not an array of ".concat(e.name));return t.map((function(t){return m(t,e)}))}var d=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,r=[{key:"toJson",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return JSON.stringify(this.toRaw(t))}},{key:"toRaw",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return Object.keys(this).forEach((function(o){r.hasOwnProperty(o)?n[o]=r[o]:e[o]instanceof t?n[o]=e[o].toRaw():n[o]=e[o]})),n}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new this.constructor(this.toRaw(t))}},{key:"fill",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.assign(this,p(p({},t),e))}}],r&&b(e.prototype,r),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E(n.key),n)}}function j(t,e){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},j(t,e)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return P(this,r)}}function P(t,e){if(e&&("object"===w(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return S(t)}function S(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_(t)}function R(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t){var e=function(t,e){if("object"!==w(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===w(e)?e:String(e)}var T=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}(i,t);var e,r,n,o=g(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),R(S(e=o.call(this)),"type",void 0),R(S(e),"ref",void 0),R(S(e),"data",void 0),e.fill(t),e}return e=i,r&&O(e.prototype,r),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function B(t,e){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},B(t,e)}function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=L(t);if(e){var o=L(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return N(this,r)}}function N(t,e){if(e&&("object"===x(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return D(t)}function D(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},L(t)}function I(t){var e=function(t,e){if("object"!==x(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===x(e)?e:String(e)}var M=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&B(t,e)}(i,t);var e,r,n,o=C(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=D(e),u=void 0,(n=I(n="reason"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&k(e.prototype,r),n&&k(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==A(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===A(i)?i:String(i)),n)}var o,i}function U(t,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U(t,e)}function J(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Q(t);if(e){var o=Q(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return F(this,r)}}function F(t,e){if(e&&("object"===A(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}var W=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&U(t,e)}(i,t);var e,r,n,o=J(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this)).fill(t),e}return e=i,r&&G(e.prototype,r),n&&G(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Z(n.key),n)}}function z(t,e){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},z(t,e)}function $(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=K(t);if(e){var o=K(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return q(this,r)}}function q(t,e){if(e&&("object"===H(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return V(t)}function V(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function K(t){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},K(t)}function X(t,e,r){return(e=Z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z(t){var e=function(t,e){if("object"!==H(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===H(e)?e:String(e)}var tt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&z(t,e)}(i,t);var e,r,n,o=$(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),X(V(e=o.call(this)),"code",void 0),X(V(e),"message",void 0),e.fill(t),e}return e=i,r&&Y(e.prototype,r),n&&Y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,at(n.key),n)}}function nt(t,e){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nt(t,e)}function ot(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ct(t);if(e){var o=ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return it(this,r)}}function it(t,e){if(e&&("object"===et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ut(t)}function ut(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ct(t)}function ft(t,e,r){return(e=at(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function at(t){var e=function(t,e){if("object"!==et(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===et(e)?e:String(e)}var lt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nt(t,e)}(i,t);var e,r,n,o=ot(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),ft(ut(e=o.call(this)),"id",void 0),ft(ut(e),"name",void 0),ft(ut(e),"color",void 0),e.fill(t),e}return e=i,r&&rt(e.prototype,r),n&&rt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function pt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wt(n.key),n)}}function yt(t,e){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yt(t,e)}function bt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ht(t);if(e){var o=ht(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vt(this,r)}}function vt(t,e){if(e&&("object"===st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return mt(t)}function mt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ht(t){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ht(t)}function dt(t,e,r){return(e=wt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wt(t){var e=function(t,e){if("object"!==st(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===st(e)?e:String(e)}var Ot=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yt(t,e)}(i,t);var e,r,n,o=bt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),dt(mt(e=o.call(this)),"id",void 0),dt(mt(e),"name",void 0),dt(mt(e),"roles",void 0),e.fill(t,{roles:h(t.roles,lt)}),e}return e=i,r&&pt(e.prototype,r),n&&pt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function jt(t){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xt(n.key),n)}}function Pt(t,e){return Pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pt(t,e)}function St(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Et(t);if(e){var o=Et(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _t(this,r)}}function _t(t,e){if(e&&("object"===jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Rt(t)}function Rt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Et(t){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Et(t)}function Tt(t,e,r){return(e=xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xt(t){var e=function(t,e){if("object"!==jt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===jt(e)?e:String(e)}var kt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pt(t,e)}(i,t);var e,r,n,o=St(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Tt(Rt(e=o.call(this)),"id",void 0),Tt(Rt(e),"name",void 0),Tt(Rt(e),"description",void 0),e.fill(t),e}return e=i,r&&gt(e.prototype,r),n&&gt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Bt(t){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(t)}function Ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gt(n.key),n)}}function Nt(t,e){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nt(t,e)}function Dt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Mt(t);if(e){var o=Mt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lt(this,r)}}function Lt(t,e){if(e&&("object"===Bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return It(t)}function It(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mt(t){return Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mt(t)}function At(t,e,r){return(e=Gt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gt(t){var e=function(t,e){if("object"!==Bt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Bt(e)?e:String(e)}var Ut=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nt(t,e)}(i,t);var e,r,n,o=Dt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),At(It(e=o.call(this)),"id",void 0),At(It(e),"name",void 0),At(It(e),"topics",void 0),e.fill(t,{topics:h(t.topics,kt)}),e}return e=i,r&&Ct(e.prototype,r),n&&Ct(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Jt(t){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(t)}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qt(n.key),n)}}function Qt(t,e){return Qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qt(t,e)}function Wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=zt(t);if(e){var o=zt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ht(this,r)}}function Ht(t,e){if(e&&("object"===Jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Yt(t)}function Yt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zt(t){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zt(t)}function $t(t,e,r){return(e=qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t){var e=function(t,e){if("object"!==Jt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Jt(e)?e:String(e)}var Vt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qt(t,e)}(i,t);var e,r,n,o=Wt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),$t(Yt(e=o.call(this)),"spaces",void 0),$t(Yt(e),"rooms",void 0),e.fill(t,{spaces:h(t.spaces,Ot),rooms:h(t.rooms,Ut)}),e}return e=i,r&&Ft(e.prototype,r),n&&Ft(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function Xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ie(n.key),n)}}function Zt(t,e){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zt(t,e)}function te(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ne(t);if(e){var o=ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ee(this,r)}}function ee(t,e){if(e&&("object"===Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return re(t)}function re(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ne(t){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ne(t)}function oe(t,e,r){return(e=ie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ie(t){var e=function(t,e){if("object"!==Kt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Kt(e)?e:String(e)}var ue=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zt(t,e)}(i,t);var e,r,n,o=te(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),oe(re(e=o.call(this)),"id",void 0),oe(re(e),"nick",void 0),oe(re(e),"avatar",void 0),oe(re(e),"flags",void 0),e.fill(t),e}return e=i,r&&Xt(e.prototype,r),n&&Xt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function fe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ve(n.key),n)}}function ae(t,e){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ae(t,e)}function le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ye(t);if(e){var o=ye(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return se(this,r)}}function se(t,e){if(e&&("object"===ce(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return pe(t)}function pe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ye(t){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ye(t)}function be(t,e,r){return(e=ve(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ve(t){var e=function(t,e){if("object"!==ce(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ce(e)?e:String(e)}var me=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ae(t,e)}(i,t);var e,r,n,o=le(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),be(pe(e=o.call(this)),"serverVersion",void 0),be(pe(e),"state",void 0),be(pe(e),"user",void 0),e.fill(t,{state:m(t.state,Vt),user:m(t.user,ue)}),e}return e=i,r&&fe(e.prototype,r),n&&fe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function he(t){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(t)}function de(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_e(n.key),n)}}function we(t,e){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},we(t,e)}function Oe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pe(t);if(e){var o=Pe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return je(this,r)}}function je(t,e){if(e&&("object"===he(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ge(t)}function ge(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pe(t){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pe(t)}function Se(t,e,r){return(e=_e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _e(t){var e=function(t,e){if("object"!==he(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===he(e)?e:String(e)}var Re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&we(t,e)}(i,t);var e,r,n,o=Oe(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Se(ge(e=o.call(this,t)),"name",void 0),Se(ge(e),"value",void 0),Se(ge(e),"skip",void 0),e.fill(t),e}return e=i,r&&de(e.prototype,r),n&&de(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ee(t){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(t)}function Te(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,De(n.key),n)}}function xe(t,e){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xe(t,e)}function ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ne(t);if(e){var o=Ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Be(this,r)}}function Be(t,e){if(e&&("object"===Ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ce(t)}function Ce(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ne(t){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ne(t)}function De(t){var e=function(t,e){if("object"!==Ee(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ee(e)?e:String(e)}var Le=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xe(t,e)}(i,t);var e,r,n,o=ke(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Ce(e),u=void 0,(n=De(n="permissions"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{permissions:h(t.permissions,Re)}),e}return e=i,r&&Te(e.prototype,r),n&&Te(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function Me(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qe(n.key),n)}}function Ae(t,e){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ae(t,e)}function Ge(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fe(t);if(e){var o=Fe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ue(this,r)}}function Ue(t,e){if(e&&("object"===Ie(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Je(t)}function Je(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fe(t){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fe(t)}function Qe(t){var e=function(t,e){if("object"!==Ie(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ie(e)?e:String(e)}var We=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ae(t,e)}(i,t);var e,r,n,o=Ge(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Je(e),u=void 0,(n=Qe(n="space"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{space:m(t.space,Ot)}),e}return e=i,r&&Me(e.prototype,r),n&&Me(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function He(t){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(t)}function Ye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xe(n.key),n)}}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ke(t);if(e){var o=Ke(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qe(this,r)}}function qe(t,e){if(e&&("object"===He(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ve(t)}function Ve(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ke(t){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ke(t)}function Xe(t){var e=function(t,e){if("object"!==He(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==He(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===He(e)?e:String(e)}var Ze=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ze(t,e)}(i,t);var e,r,n,o=$e(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Ve(e),u=void 0,(n=Xe(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Ye(e.prototype,r),n&&Ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function tr(t){return tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(t)}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fr(n.key),n)}}function rr(t,e){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rr(t,e)}function nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ur(t);if(e){var o=ur(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return or(this,r)}}function or(t,e){if(e&&("object"===tr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ir(t)}function ir(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ur(t){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ur(t)}function cr(t,e,r){return(e=fr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fr(t){var e=function(t,e){if("object"!==tr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tr(e)?e:String(e)}var ar=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rr(t,e)}(i,t);var e,r,n,o=nr(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),cr(ir(e=o.call(this)),"user",void 0),cr(ir(e),"roles",void 0),e.fill(t,{user:h(t.user,ue)}),e}return e=i,r&&er(e.prototype,r),n&&er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function sr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hr(n.key),n)}}function pr(t,e){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pr(t,e)}function yr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mr(t);if(e){var o=mr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return br(this,r)}}function br(t,e){if(e&&("object"===lr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vr(t)}function vr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mr(t){return mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mr(t)}function hr(t){var e=function(t,e){if("object"!==lr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===lr(e)?e:String(e)}var dr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pr(t,e)}(i,t);var e,r,n,o=yr(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=vr(e),u=void 0,(n=hr(n="member"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{member:m(t.member,ar)}),e}return e=i,r&&sr(e.prototype,r),n&&sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function wr(t){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wr(t)}function Or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rr(n.key),n)}}function jr(t,e){return jr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jr(t,e)}function gr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_r(t);if(e){var o=_r(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pr(this,r)}}function Pr(t,e){if(e&&("object"===wr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Sr(t)}function Sr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _r(t){return _r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_r(t)}function Rr(t){var e=function(t,e){if("object"!==wr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==wr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wr(e)?e:String(e)}var Er=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jr(t,e)}(i,t);var e,r,n,o=gr(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Sr(e),u=void 0,(n=Rr(n="userId"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Or(e.prototype,r),n&&Or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Tr(t){return Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(t)}function xr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Lr(n.key),n)}}function kr(t,e){return kr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kr(t,e)}function Br(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Dr(t);if(e){var o=Dr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cr(this,r)}}function Cr(t,e){if(e&&("object"===Tr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Nr(t)}function Nr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dr(t){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dr(t)}function Lr(t){var e=function(t,e){if("object"!==Tr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Tr(e)?e:String(e)}var Ir=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kr(t,e)}(i,t);var e,r,n,o=Br(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Nr(e),u=void 0,(n=Lr(n="member"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{member:m(t.member,ar)}),e}return e=i,r&&xr(e.prototype,r),n&&xr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Mr(t){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(t)}function Ar(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wr(n.key),n)}}function Gr(t,e){return Gr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gr(t,e)}function Ur(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Qr(t);if(e){var o=Qr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jr(this,r)}}function Jr(t,e){if(e&&("object"===Mr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fr(t)}function Fr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}function Wr(t){var e=function(t,e){if("object"!==Mr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Mr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Mr(e)?e:String(e)}var Hr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gr(t,e)}(i,t);var e,r,n,o=Ur(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Fr(e),u=void 0,(n=Wr(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Ar(e.prototype,r),n&&Ar(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function zr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zr(n.key),n)}}function $r(t,e){return $r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$r(t,e)}function qr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Xr(t);if(e){var o=Xr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vr(this,r)}}function Vr(t,e){if(e&&("object"===Yr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Kr(t)}function Kr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}function Zr(t){var e=function(t,e){if("object"!==Yr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Yr(e)?e:String(e)}var tn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$r(t,e)}(i,t);var e,r,n,o=qr(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Kr(e),u=void 0,(n=Zr(n="members"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{members:h(t.members,ar)}),e}return e=i,r&&zr(e.prototype,r),n&&zr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function en(t){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(t)}function rn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ln(n.key),n)}}function nn(t,e){return nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nn(t,e)}function on(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=fn(t);if(e){var o=fn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return un(this,r)}}function un(t,e){if(e&&("object"===en(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return cn(t)}function cn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fn(t){return fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fn(t)}function an(t,e,r){return(e=ln(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ln(t){var e=function(t,e){if("object"!==en(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==en(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===en(e)?e:String(e)}var sn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nn(t,e)}(i,t);var e,r,n,o=on(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),an(cn(e=o.call(this)),"id",void 0),an(cn(e),"name",void 0),an(cn(e),"description",void 0),e.fill(t),e}return e=i,r&&rn(e.prototype,r),n&&rn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function yn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wn(n.key),n)}}function bn(t,e){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bn(t,e)}function vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=dn(t);if(e){var o=dn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mn(this,r)}}function mn(t,e){if(e&&("object"===pn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return hn(t)}function hn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dn(t){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dn(t)}function wn(t){var e=function(t,e){if("object"!==pn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===pn(e)?e:String(e)}var On=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bn(t,e)}(i,t);var e,r,n,o=vn(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=hn(e),u=void 0,(n=wn(n="summaries"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{summaries:h(t.summaries,sn)}),e}return e=i,r&&yn(e.prototype,r),n&&yn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function jn(t){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(t)}function gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xn(n.key),n)}}function Pn(t,e){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pn(t,e)}function Sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=En(t);if(e){var o=En(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _n(this,r)}}function _n(t,e){if(e&&("object"===jn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Rn(t)}function Rn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function En(t){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},En(t)}function Tn(t,e,r){return(e=xn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xn(t){var e=function(t,e){if("object"!==jn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===jn(e)?e:String(e)}var kn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pn(t,e)}(i,t);var e,r,n,o=Sn(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Tn(Rn(e=o.call(this)),"spaceId",void 0),Tn(Rn(e),"role",void 0),e.fill(t,{role:m(t.role,lt)}),e}return e=i,r&&gn(e.prototype,r),n&&gn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Bn(t){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(t)}function Cn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gn(n.key),n)}}function Nn(t,e){return Nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nn(t,e)}function Dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Mn(t);if(e){var o=Mn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ln(this,r)}}function Ln(t,e){if(e&&("object"===Bn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return In(t)}function In(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mn(t){return Mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mn(t)}function An(t,e,r){return(e=Gn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gn(t){var e=function(t,e){if("object"!==Bn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Bn(e)?e:String(e)}var Un=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nn(t,e)}(i,t);var e,r,n,o=Dn(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),An(In(e=o.call(this)),"roleId",void 0),An(In(e),"spaceId",void 0),e.fill(t),e}return e=i,r&&Cn(e.prototype,r),n&&Cn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Jn(t){return Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(t)}function Fn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$n(n.key),n)}}function Qn(t,e){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qn(t,e)}function Wn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=zn(t);if(e){var o=zn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hn(this,r)}}function Hn(t,e){if(e&&("object"===Jn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Yn(t)}function Yn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zn(t)}function $n(t){var e=function(t,e){if("object"!==Jn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Jn(e)?e:String(e)}var qn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qn(t,e)}(i,t);var e,r,n,o=Wn(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Yn(e),u=void 0,(n=$n(n="room"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{room:m(t.room,Ut)}),e}return e=i,r&&Fn(e.prototype,r),n&&Fn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Vn(t){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vn(t)}function Kn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,no(n.key),n)}}function Xn(t,e){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xn(t,e)}function Zn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ro(t);if(e){var o=ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return to(this,r)}}function to(t,e){if(e&&("object"===Vn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return eo(t)}function eo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ro(t){return ro=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ro(t)}function no(t){var e=function(t,e){if("object"!==Vn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Vn(e)?e:String(e)}var oo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xn(t,e)}(i,t);var e,r,n,o=Zn(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=eo(e),u=void 0,(n=no(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Kn(e.prototype,r),n&&Kn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function io(t){return io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},io(t)}function uo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,po(n.key),n)}}function co(t,e){return co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},co(t,e)}function fo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=so(t);if(e){var o=so(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ao(this,r)}}function ao(t,e){if(e&&("object"===io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return lo(t)}function lo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function so(t){return so=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},so(t)}function po(t){var e=function(t,e){if("object"!==io(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===io(e)?e:String(e)}var yo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&co(t,e)}(i,t);var e,r,n,o=fo(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=lo(e),u=void 0,(n=po(n="user"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{user:m(t.user,ue)}),e}return e=i,r&&uo(e.prototype,r),n&&uo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function bo(t){return bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bo(t)}function vo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,go(n.key),n)}}function mo(t,e){return mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mo(t,e)}function ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=jo(t);if(e){var o=jo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return wo(this,r)}}function wo(t,e){if(e&&("object"===bo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Oo(t)}function Oo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jo(t){return jo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jo(t)}function go(t){var e=function(t,e){if("object"!==bo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===bo(e)?e:String(e)}var Po=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mo(t,e)}(i,t);var e,r,n,o=ho(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Oo(e),u=void 0,(n=go(n="member"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{member:m(t.member,yo)}),e}return e=i,r&&vo(e.prototype,r),n&&vo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function So(t){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},So(t)}function _o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bo(n.key),n)}}function Ro(t,e){return Ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ro(t,e)}function Eo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ko(t);if(e){var o=ko(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return To(this,r)}}function To(t,e){if(e&&("object"===So(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return xo(t)}function xo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ko(t){return ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ko(t)}function Bo(t){var e=function(t,e){if("object"!==So(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==So(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===So(e)?e:String(e)}var Co=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ro(t,e)}(i,t);var e,r,n,o=Eo(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=xo(e),u=void 0,(n=Bo(n="userId"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&_o(e.prototype,r),n&&_o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function No(t){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(t)}function Do(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Uo(n.key),n)}}function Lo(t,e){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lo(t,e)}function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Go(t);if(e){var o=Go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Mo(this,r)}}function Mo(t,e){if(e&&("object"===No(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ao(t)}function Ao(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Go(t){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Go(t)}function Uo(t){var e=function(t,e){if("object"!==No(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==No(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===No(e)?e:String(e)}var Jo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lo(t,e)}(i,t);var e,r,n,o=Io(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Ao(e),u=void 0,(n=Uo(n="members"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{members:h(t.members,yo)}),e}return e=i,r&&Do(e.prototype,r),n&&Do(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Fo(t){return Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(t)}function Qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vo(n.key),n)}}function Wo(t,e){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wo(t,e)}function Ho(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=$o(t);if(e){var o=$o(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Yo(this,r)}}function Yo(t,e){if(e&&("object"===Fo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return zo(t)}function zo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $o(t){return $o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$o(t)}function qo(t,e,r){return(e=Vo(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vo(t){var e=function(t,e){if("object"!==Fo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Fo(e)?e:String(e)}var Ko=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wo(t,e)}(i,t);var e,r,n,o=Ho(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),qo(zo(e=o.call(this)),"summary",void 0),qo(zo(e),"spaceId",void 0),e.fill(t,{summary:m(t.summary,sn)}),e}return e=i,r&&Qo(e.prototype,r),n&&Qo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Xo(t){return Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xo(t)}function Zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ii(n.key),n)}}function ti(t,e){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ti(t,e)}function ei(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=oi(t);if(e){var o=oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ri(this,r)}}function ri(t,e){if(e&&("object"===Xo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ni(t)}function ni(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oi(t){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oi(t)}function ii(t){var e=function(t,e){if("object"!==Xo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Xo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Xo(e)?e:String(e)}var ui=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ti(t,e)}(i,t);var e,r,n,o=ei(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=ni(e),u=void 0,(n=ii(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Zo(e.prototype,r),n&&Zo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function ci(t){return ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(t)}function fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vi(n.key),n)}}function ai(t,e){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ai(t,e)}function li(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yi(t);if(e){var o=yi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return si(this,r)}}function si(t,e){if(e&&("object"===ci(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return pi(t)}function pi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yi(t){return yi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yi(t)}function bi(t,e,r){return(e=vi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vi(t){var e=function(t,e){if("object"!==ci(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ci(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ci(e)?e:String(e)}var mi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ai(t,e)}(i,t);var e,r,n,o=li(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),bi(pi(e=o.call(this)),"roomId",void 0),bi(pi(e),"topic",void 0),e.fill(t,{topic:m(t.topic,kt)}),e}return e=i,r&&fi(e.prototype,r),n&&fi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function hi(t){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hi(t)}function di(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Si(n.key),n)}}function wi(t,e){return wi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wi(t,e)}function Oi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pi(t);if(e){var o=Pi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ji(this,r)}}function ji(t,e){if(e&&("object"===hi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return gi(t)}function gi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pi(t){return Pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pi(t)}function Si(t){var e=function(t,e){if("object"!==hi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===hi(e)?e:String(e)}var _i=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wi(t,e)}(i,t);var e,r,n,o=Oi(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=gi(e),u=void 0,(n=Si(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&di(e.prototype,r),n&&di(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ri(t){return Ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(t)}function Ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Di(n.key),n)}}function Ti(t,e){return Ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ti(t,e)}function xi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ci(t);if(e){var o=Ci(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ki(this,r)}}function ki(t,e){if(e&&("object"===Ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Bi(t)}function Bi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ci(t){return Ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ci(t)}function Ni(t,e,r){return(e=Di(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Di(t){var e=function(t,e){if("object"!==Ri(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ri(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ri(e)?e:String(e)}var Li=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ti(t,e)}(i,t);var e,r,n,o=xi(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Ni(Bi(e=o.call(this)),"id",void 0),Ni(Bi(e),"author",void 0),Ni(Bi(e),"topicId",void 0),Ni(Bi(e),"content",void 0),e.fill(t,{author:m(t.author,ue)}),e}return e=i,r&&Ei(e.prototype,r),n&&Ei(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ii(t){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(t)}function Mi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qi(n.key),n)}}function Ai(t,e){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ai(t,e)}function Gi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fi(t);if(e){var o=Fi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ui(this,r)}}function Ui(t,e){if(e&&("object"===Ii(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ji(t)}function Ji(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fi(t){return Fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fi(t)}function Qi(t){var e=function(t,e){if("object"!==Ii(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ii(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ii(e)?e:String(e)}var Wi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ai(t,e)}(i,t);var e,r,n,o=Gi(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Ji(e),u=void 0,(n=Qi(n="message"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t,{message:m(t.message,Li)}),e}return e=i,r&&Mi(e.prototype,r),n&&Mi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Hi(t){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hi(t)}function Yi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==Hi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===Hi(i)?i:String(i)),n)}var o,i}function zi(t,e){return zi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zi(t,e)}function $i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vi(t);if(e){var o=Vi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qi(this,r)}}function qi(t,e){if(e&&("object"===Hi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Vi(t){return Vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vi(t)}var Ki=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zi(t,e)}(i,t);var e,r,n,o=$i(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this)).fill(t),e}return e=i,r&&Yi(e.prototype,r),n&&Yi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Xi(t){return Xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xi(t)}function Zi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uu(n.key),n)}}function tu(t,e){return tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tu(t,e)}function eu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ou(t);if(e){var o=ou(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ru(this,r)}}function ru(t,e){if(e&&("object"===Xi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return nu(t)}function nu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ou(t){return ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ou(t)}function iu(t,e,r){return(e=uu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uu(t){var e=function(t,e){if("object"!==Xi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Xi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Xi(e)?e:String(e)}var cu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tu(t,e)}(i,t);var e,r,n,o=eu(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),iu(nu(e=o.call(this)),"permissions",void 0),iu(nu(e),"layer",void 0),iu(nu(e),"layerId",void 0),iu(nu(e),"userId",void 0),e.fill(t,{permissions:h(t.permissions,Re)}),e}return e=i,r&&Zi(e.prototype,r),n&&Zi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function fu(t){return fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(t)}function au(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mu(n.key),n)}}function lu(t,e){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lu(t,e)}function su(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=bu(t);if(e){var o=bu(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return pu(this,r)}}function pu(t,e){if(e&&("object"===fu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return yu(t)}function yu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bu(t){return bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bu(t)}function vu(t,e,r){return(e=mu(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mu(t){var e=function(t,e){if("object"!==fu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===fu(e)?e:String(e)}var hu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lu(t,e)}(i,t);var e,r,n,o=su(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),vu(yu(e=o.call(this)),"layer",void 0),vu(yu(e),"layerId",void 0),vu(yu(e),"userId",void 0),vu(yu(e),"names",void 0),e.fill(t),e}return e=i,r&&au(e.prototype,r),n&&au(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function du(t){return du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(t)}function wu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ru(n.key),n)}}function Ou(t,e){return Ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ou(t,e)}function ju(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Su(t);if(e){var o=Su(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gu(this,r)}}function gu(t,e){if(e&&("object"===du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pu(t)}function Pu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Su(t)}function _u(t,e,r){return(e=Ru(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ru(t){var e=function(t,e){if("object"!==du(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==du(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===du(e)?e:String(e)}var Eu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ou(t,e)}(i,t);var e,r,n,o=ju(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),_u(Pu(e=o.call(this)),"names",void 0),_u(Pu(e),"spaceId",void 0),_u(Pu(e),"roomId",void 0),_u(Pu(e),"topicId",void 0),e.fill(t),e}return e=i,r&&wu(e.prototype,r),n&&wu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Tu(t){return Tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tu(t)}function xu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Lu(n.key),n)}}function ku(t,e){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ku(t,e)}function Bu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Du(t);if(e){var o=Du(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cu(this,r)}}function Cu(t,e){if(e&&("object"===Tu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Nu(t)}function Nu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Du(t){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Du(t)}function Lu(t){var e=function(t,e){if("object"!==Tu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Tu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Tu(e)?e:String(e)}var Iu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ku(t,e)}(i,t);var e,r,n,o=Bu(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Nu(e),u=void 0,(n=Lu(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&xu(e.prototype,r),n&&xu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Mu(t){return Mu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(t)}function Au(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wu(n.key),n)}}function Gu(t,e){return Gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gu(t,e)}function Uu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Qu(t);if(e){var o=Qu(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ju(this,r)}}function Ju(t,e){if(e&&("object"===Mu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fu(t)}function Fu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qu(t){return Qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qu(t)}function Wu(t){var e=function(t,e){if("object"!==Mu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Mu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Mu(e)?e:String(e)}var Hu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gu(t,e)}(i,t);var e,r,n,o=Uu(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Fu(e),u=void 0,(n=Wu(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Au(e.prototype,r),n&&Au(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Yu(t){return Yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yu(t)}function zu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zu(n.key),n)}}function $u(t,e){return $u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$u(t,e)}function qu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Xu(t);if(e){var o=Xu(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vu(this,r)}}function Vu(t,e){if(e&&("object"===Yu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ku(t)}function Ku(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xu(t){return Xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xu(t)}function Zu(t){var e=function(t,e){if("object"!==Yu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Yu(e)?e:String(e)}var tc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$u(t,e)}(i,t);var e,r,n,o=qu(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Ku(e),u=void 0,(n=Zu(n="name"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&zu(e.prototype,r),n&&zu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function ec(t){return ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(t)}function rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fc(n.key),n)}}function nc(t,e){return nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nc(t,e)}function oc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=cc(t);if(e){var o=cc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ic(this,r)}}function ic(t,e){if(e&&("object"===ec(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return uc(t)}function uc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cc(t){return cc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cc(t)}function fc(t){var e=function(t,e){if("object"!==ec(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ec(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ec(e)?e:String(e)}var ac=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nc(t,e)}(i,t);var e,r,n,o=oc(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=uc(e),u=void 0,(n=fc(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&rc(e.prototype,r),n&&rc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function lc(t){return lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(t)}function sc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hc(n.key),n)}}function pc(t,e){return pc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pc(t,e)}function yc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mc(t);if(e){var o=mc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bc(this,r)}}function bc(t,e){if(e&&("object"===lc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vc(t)}function vc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mc(t){return mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mc(t)}function hc(t){var e=function(t,e){if("object"!==lc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==lc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===lc(e)?e:String(e)}var dc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pc(t,e)}(i,t);var e,r,n,o=yc(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=vc(e),u=void 0,(n=hc(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&sc(e.prototype,r),n&&sc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function wc(t){return wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(t)}function Oc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rc(n.key),n)}}function jc(t,e){return jc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jc(t,e)}function gc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_c(t);if(e){var o=_c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pc(this,r)}}function Pc(t,e){if(e&&("object"===wc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Sc(t)}function Sc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _c(t){return _c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_c(t)}function Rc(t){var e=function(t,e){if("object"!==wc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==wc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===wc(e)?e:String(e)}var Ec=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jc(t,e)}(i,t);var e,r,n,o=gc(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Sc(e),u=void 0,(n=Rc(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Oc(e.prototype,r),n&&Oc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Tc(t){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(t)}function xc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ic(n.key),n)}}function kc(t,e){return kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kc(t,e)}function Bc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Dc(t);if(e){var o=Dc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cc(this,r)}}function Cc(t,e){if(e&&("object"===Tc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Nc(t)}function Nc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dc(t){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dc(t)}function Lc(t,e,r){return(e=Ic(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ic(t){var e=function(t,e){if("object"!==Tc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Tc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Tc(e)?e:String(e)}var Mc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kc(t,e)}(i,t);var e,r,n,o=Bc(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Lc(Nc(e=o.call(this)),"spaceId",void 0),Lc(Nc(e),"name",void 0),Lc(Nc(e),"color",void 0),e.fill(t),e}return e=i,r&&xc(e.prototype,r),n&&xc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ac(t){return Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(t)}function Gc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yc(n.key),n)}}function Uc(t,e){return Uc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uc(t,e)}function Jc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wc(t);if(e){var o=Wc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Fc(this,r)}}function Fc(t,e){if(e&&("object"===Ac(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Qc(t)}function Qc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wc(t){return Wc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wc(t)}function Hc(t,e,r){return(e=Yc(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yc(t){var e=function(t,e){if("object"!==Ac(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ac(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ac(e)?e:String(e)}var zc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uc(t,e)}(i,t);var e,r,n,o=Jc(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Hc(Qc(e=o.call(this)),"roleId",void 0),Hc(Qc(e),"spaceId",void 0),e.fill(t),e}return e=i,r&&Gc(e.prototype,r),n&&Gc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function $c(t){return $c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(t)}function qc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rf(n.key),n)}}function Vc(t,e){return Vc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vc(t,e)}function Kc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=tf(t);if(e){var o=tf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Xc(this,r)}}function Xc(t,e){if(e&&("object"===$c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Zc(t)}function Zc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tf(t){return tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tf(t)}function ef(t,e,r){return(e=rf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rf(t){var e=function(t,e){if("object"!==$c(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$c(e)?e:String(e)}var nf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vc(t,e)}(i,t);var e,r,n,o=Kc(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),ef(Zc(e=o.call(this)),"roleId",void 0),ef(Zc(e),"spaceId",void 0),ef(Zc(e),"userId",void 0),e.fill(t),e}return e=i,r&&qc(e.prototype,r),n&&qc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function of(t){return of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},of(t)}function uf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yf(n.key),n)}}function cf(t,e){return cf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cf(t,e)}function ff(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=sf(t);if(e){var o=sf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return af(this,r)}}function af(t,e){if(e&&("object"===of(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return lf(t)}function lf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sf(t){return sf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sf(t)}function pf(t,e,r){return(e=yf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yf(t){var e=function(t,e){if("object"!==of(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==of(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===of(e)?e:String(e)}var bf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cf(t,e)}(i,t);var e,r,n,o=ff(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),pf(lf(e=o.call(this)),"roleId",void 0),pf(lf(e),"spaceId",void 0),pf(lf(e),"userId",void 0),e.fill(t),e}return e=i,r&&uf(e.prototype,r),n&&uf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function vf(t){return vf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vf(t)}function mf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pf(n.key),n)}}function hf(t,e){return hf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hf(t,e)}function df(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=jf(t);if(e){var o=jf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return wf(this,r)}}function wf(t,e){if(e&&("object"===vf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Of(t)}function Of(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jf(t){return jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jf(t)}function gf(t,e,r){return(e=Pf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pf(t){var e=function(t,e){if("object"!==vf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==vf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===vf(e)?e:String(e)}var Sf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hf(t,e)}(i,t);var e,r,n,o=df(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),gf(Of(e=o.call(this)),"permissions",void 0),gf(Of(e),"layer",void 0),gf(Of(e),"layerId",void 0),gf(Of(e),"roleId",void 0),e.fill(t,{permissions:h(t.permissions,Re)}),e}return e=i,r&&mf(e.prototype,r),n&&mf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function _f(t){return _f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_f(t)}function Rf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nf(n.key),n)}}function Ef(t,e){return Ef=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ef(t,e)}function Tf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bf(t);if(e){var o=Bf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return xf(this,r)}}function xf(t,e){if(e&&("object"===_f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return kf(t)}function kf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bf(t){return Bf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bf(t)}function Cf(t,e,r){return(e=Nf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nf(t){var e=function(t,e){if("object"!==_f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_f(e)?e:String(e)}var Df=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ef(t,e)}(i,t);var e,r,n,o=Tf(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Cf(kf(e=o.call(this)),"layer",void 0),Cf(kf(e),"layerId",void 0),Cf(kf(e),"roleId",void 0),Cf(kf(e),"names",void 0),e.fill(t),e}return e=i,r&&Rf(e.prototype,r),n&&Rf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Lf(t){return Lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lf(t)}function If(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ff(n.key),n)}}function Mf(t,e){return Mf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mf(t,e)}function Af(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Jf(t);if(e){var o=Jf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gf(this,r)}}function Gf(t,e){if(e&&("object"===Lf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Uf(t)}function Uf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jf(t){return Jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jf(t)}function Ff(t){var e=function(t,e){if("object"!==Lf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Lf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Lf(e)?e:String(e)}var Qf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mf(t,e)}(i,t);var e,r,n,o=Af(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Uf(e),u=void 0,(n=Ff(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&If(e.prototype,r),n&&If(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Wf(t){return Wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(t)}function Hf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kf(n.key),n)}}function Yf(t,e){return Yf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yf(t,e)}function zf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Vf(t);if(e){var o=Vf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $f(this,r)}}function $f(t,e){if(e&&("object"===Wf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return qf(t)}function qf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vf(t){return Vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vf(t)}function Kf(t){var e=function(t,e){if("object"!==Wf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Wf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Wf(e)?e:String(e)}var Xf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yf(t,e)}(i,t);var e,r,n,o=zf(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=qf(e),u=void 0,(n=Kf(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Hf(e.prototype,r),n&&Hf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Zf(t){return Zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(t)}function ta(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ca(n.key),n)}}function ea(t,e){return ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ea(t,e)}function ra(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ia(t);if(e){var o=ia(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return na(this,r)}}function na(t,e){if(e&&("object"===Zf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return oa(t)}function oa(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ia(t){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ia(t)}function ua(t,e,r){return(e=ca(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ca(t){var e=function(t,e){if("object"!==Zf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Zf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Zf(e)?e:String(e)}var fa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ea(t,e)}(i,t);var e,r,n,o=ra(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),ua(oa(e=o.call(this)),"spaceId",void 0),ua(oa(e),"name",void 0),ua(oa(e),"description",void 0),e.fill(t),e}return e=i,r&&ta(e.prototype,r),n&&ta(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function aa(t){return aa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(t)}function la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ma(n.key),n)}}function sa(t,e){return sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sa(t,e)}function pa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=va(t);if(e){var o=va(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ya(this,r)}}function ya(t,e){if(e&&("object"===aa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ba(t)}function ba(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function va(t){return va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},va(t)}function ma(t){var e=function(t,e){if("object"!==aa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==aa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===aa(e)?e:String(e)}var ha=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sa(t,e)}(i,t);var e,r,n,o=pa(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=ba(e),u=void 0,(n=ma(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&la(e.prototype,r),n&&la(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function da(t){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},da(t)}function wa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_a(n.key),n)}}function Oa(t,e){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oa(t,e)}function ja(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Sa(t);if(e){var o=Sa(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ga(this,r)}}function ga(t,e){if(e&&("object"===da(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pa(t)}function Pa(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sa(t){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sa(t)}function _a(t){var e=function(t,e){if("object"!==da(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===da(e)?e:String(e)}var Ra=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oa(t,e)}(i,t);var e,r,n,o=ja(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Pa(e),u=void 0,(n=_a(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&wa(e.prototype,r),n&&wa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ea(t){return Ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(t)}function Ta(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,La(n.key),n)}}function xa(t,e){return xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xa(t,e)}function ka(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Na(t);if(e){var o=Na(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ba(this,r)}}function Ba(t,e){if(e&&("object"===Ea(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ca(t)}function Ca(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Na(t){return Na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Na(t)}function Da(t,e,r){return(e=La(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function La(t){var e=function(t,e){if("object"!==Ea(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ea(e)?e:String(e)}var Ia=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xa(t,e)}(i,t);var e,r,n,o=ka(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Da(Ca(e=o.call(this)),"roomId",void 0),Da(Ca(e),"name",void 0),Da(Ca(e),"description",void 0),e.fill(t),e}return e=i,r&&Ta(e.prototype,r),n&&Ta(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ma(t){return Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ma(t)}function Aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wa(n.key),n)}}function Ga(t,e){return Ga=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ga(t,e)}function Ua(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Qa(t);if(e){var o=Qa(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ja(this,r)}}function Ja(t,e){if(e&&("object"===Ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fa(t)}function Fa(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qa(t){return Qa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qa(t)}function Wa(t){var e=function(t,e){if("object"!==Ma(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ma(e)?e:String(e)}var Ha=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ga(t,e)}(i,t);var e,r,n,o=Ua(i);function i(t){var e,r,n,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this),r=Fa(e),u=void 0,(n=Wa(n="id"))in r?Object.defineProperty(r,n,{value:u,enumerable:!0,configurable:!0,writable:!0}):r[n]=u,e.fill(t),e}return e=i,r&&Aa(e.prototype,r),n&&Aa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d);function Ya(t){return Ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ya(t)}function za(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tl(n.key),n)}}function $a(t,e){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$a(t,e)}function qa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Xa(t);if(e){var o=Xa(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Va(this,r)}}function Va(t,e){if(e&&("object"===Ya(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ka(t)}function Ka(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xa(t){return Xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xa(t)}function Za(t,e,r){return(e=tl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tl(t){var e=function(t,e){if("object"!==Ya(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ya(e)?e:String(e)}var el=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$a(t,e)}(i,t);var e,r,n,o=qa(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),Za(Ka(e=o.call(this)),"topicId",void 0),Za(Ka(e),"content",void 0),e.fill(t),e}return e=i,r&&za(e.prototype,r),n&&za(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(d),rl={Bye:M,Ok:W,Error:tt,Session:me,Permissions:Le,SpaceJoined:We,SpaceLeft:Ze,SpaceMemberJoined:dr,SpaceMemberLeft:Er,SpaceMemberUpdate:Ir,SpaceDeleted:Hr,SpaceMembers:tn,SpaceRooms:On,NewRole:kn,RoleDeleted:Un,RoomJoined:qn,RoomLeft:oo,RoomMemberJoined:Po,RoomMemberLeft:Co,RoomMembers:Jo,NewRoom:Ko,RoomDeleted:ui,NewTopic:mi,TopicDeleted:_i,NewMessage:Wi},nl={GetSession:Ki,SetUserPermissions:cu,GetUserPermissions:hu,GetComputedPermissions:Eu,JoinSpace:Iu,LeaveSpace:Hu,CreateSpace:tc,DeleteSpace:ac,GetSpaceMembers:dc,GetSpaceRooms:Ec,CreateRole:Mc,DeleteRole:zc,AssignRole:nf,DeassignRole:bf,SetRolePermissions:Sf,GetRolePermissions:Df,JoinRoom:Qf,LeaveRoom:Xf,CreateRoom:fa,DeleteRoom:ha,GetRoomMembers:Ra,CreateTopic:Ia,DeleteTopic:Ha,CreateMessage:el};function ol(t){return ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(t)}function il(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pl(n.key),n)}}function ul(t,e){return ul=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ul(t,e)}function cl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ll(t);if(e){var o=ll(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return fl(this,r)}}function fl(t,e){if(e&&("object"===ol(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return al(t)}function al(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ll(t){return ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ll(t)}function sl(t,e,r){return(e=pl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pl(t){var e=function(t,e){if("object"!==ol(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ol(e)?e:String(e)}var yl=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ul(t,e)}(u,e);var r,n,o,i=cl(u);function u(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(e=i.call(this)).options=t,sl(al(e),"ws",null),sl(al(e),"sendQueue",[]),sl(al(e),"connectingTimeoutId",void 0),sl(al(e),"authenticated",void 0),!e.options.token&&!e.options.temporaryNick)throw new Error("Token or temporary nick is required");return e}return r=u,(n=[{key:"init",value:function(){this.ws&&this.destroy(),this.connect()}},{key:"send",value:function(e){if(this.ws&&this.ws.readyState!==this.ws.CLOSED||this.connect(),this.ws.readyState!==this.ws.CONNECTING&&this.authenticated){var r=JSON.stringify(e);this.ws.readyState===this.ws.OPEN?this.ws.send(r):this.emit(t.error,new Error("Cannot send ".concat(r,"; invalid connection state")))}else this.sendQueue.push(e)}},{key:"destroy",value:function(){var t;this.sendQueue=[],null===(t=this.ws)||void 0===t||t.close(),this.ws=null}},{key:"connect",value:function(){var t,e=this;this.authenticated=!1;var r=this.options.token?"token=".concat(this.options.token):"nick=".concat(this.options.temporaryNick);this.ws=new WebSocket("".concat(this.options.url,"?").concat(r)),this.ws.onclose=function(t){return e.onClose(t)},this.ws.onmessage=function(t){return e.onMessage(t)},this.connectingTimeoutId=setTimeout((function(){return e.triggerConnectionTimeout()}),null!==(t=this.options.connectingTimeoutMs)&&void 0!==t?t:1e4)}},{key:"onMessage",value:function(e){var r=JSON.parse(e.data);!this.authenticated&&r.type&&"Error"!==r.type&&(this.authenticated=!0,this.emit(t.ready),this.sendFromQueue()),this.emit(t.message,r)}},{key:"onClose",value:function(e){clearTimeout(this.connectingTimeoutId);var r=1e3!==e.code;r&&this.connect(),this.emit(t.destroy,r)}},{key:"sendFromQueue",value:function(){var t=this,e=0,r=function(r){var n,o=t.sendQueue[r];setTimeout((function(){return t.send(o)}),e),e+=null!==(n=t.options.awaitQueueSendDelayMs)&&void 0!==n?n:500};for(var n in this.sendQueue)r(n);this.sendQueue=[],clearTimeout(this.connectingTimeoutId)}},{key:"triggerConnectionTimeout",value:function(){this.destroy(),this.emit(t.error,new Error("Connection timeout"))}}])&&il(r.prototype,n),o&&il(r,o),Object.defineProperty(r,"prototype",{writable:!1}),u}(a);function bl(t){return bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bl(t)}function vl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */vl=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function a(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,u=Object.create(i.prototype),c=new _(o||[]);return n(u,"_invoke",{value:j(t,r,c)}),u}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var s={};function p(){}function y(){}function b(){}var v={};f(v,i,(function(){return this}));var m=Object.getPrototypeOf,h=m&&m(m(R([])));h&&h!==e&&r.call(h,i)&&(v=h);var d=b.prototype=p.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,u,c){var f=l(t[n],t,i);if("throw"!==f.type){var a=f.arg,s=a.value;return s&&"object"==bl(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(s).then((function(t){a.value=t,u(a)}),(function(t){return o("throw",t,u,c)}))}c(f.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var c=g(u,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=l(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}function g(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,g(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),s;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,s;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return y.prototype=b,n(d,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:y,configurable:!0}),y.displayName=f(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,c,"GeneratorFunction")),t.prototype=Object.create(d),t},t.awrap=function(t){return{__await:t}},w(O.prototype),f(O.prototype,u,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var u=new O(a(e,r,n,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},w(d),f(d,c,"Generator"),f(d,i,(function(){return this})),f(d,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=R,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return u.type="throw",u.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:R(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}function ml(t,e,r,n,o,i,u){try{var c=t[i](u),f=c.value}catch(t){return void r(t)}c.done?e(f):Promise.resolve(f).then(n,o)}function hl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==bl(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==bl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===bl(i)?i:String(i)),n)}var o,i}var dl,wl=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.options.temporaryNick)throw new Error("Temporary nick is not supported authentication method for REST API")}var e,r,n,o,i;return e=t,r=[{key:"send",value:(o=vl().mark((function t(e,r){var n,o,i,u,c=arguments;return vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>2&&void 0!==c[2]?c[2]:void 0,o={"Content-Type":"application/json",Accept:"application/json"},this.options.token&&(o.Authorization="Bearer ".concat(this.options.token)),i=void 0===n?void 0:JSON.stringify(n),t.next=6,fetch(this.getUrl(r),{method:e,body:i,headers:o});case 6:return u=t.sent,t.t0=u.ok,t.t1=u.status,t.next=11,u.json();case 11:return t.t2=t.sent,t.abrupt("return",{ok:t.t0,status:t.t1,data:t.t2});case 13:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function u(t){ml(i,r,n,u,c,"next",t)}function c(t){ml(i,r,n,u,c,"throw",t)}u(void 0)}))},function(t,e){return i.apply(this,arguments)})},{key:"getUrl",value:function(t){return this.removeEndingSlash(this.options.url)+"/"+this.removeStartingSlash(t)}},{key:"removeStartingSlash",value:function(t){return t.replace(/^\/+/,"")}},{key:"removeEndingSlash",value:function(t){return t.replace(/\/+$/,"")}}],r&&hl(e.prototype,r),n&&hl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ol(t){return Ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(t)}function jl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,c=[],f=!0,a=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;f=!1}else for(;!(f=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);f=!0);}catch(t){a=!0,o=t}finally{try{if(!f&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(a)throw o}}return c}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return gl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gl(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Pl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Sl(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pl(Object(r),!0).forEach((function(e){Dl(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pl(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_l=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function a(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,u=Object.create(i.prototype),c=new _(o||[]);return n(u,"_invoke",{value:j(t,r,c)}),u}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var s={};function p(){}function y(){}function b(){}var v={};f(v,i,(function(){return this}));var m=Object.getPrototypeOf,h=m&&m(m(R([])));h&&h!==e&&r.call(h,i)&&(v=h);var d=b.prototype=p.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,u,c){var f=l(t[n],t,i);if("throw"!==f.type){var a=f.arg,s=a.value;return s&&"object"==Ol(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(s).then((function(t){a.value=t,u(a)}),(function(t){return o("throw",t,u,c)}))}c(f.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var c=g(u,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=l(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}function g(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,g(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),s;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,s;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return y.prototype=b,n(d,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:y,configurable:!0}),y.displayName=f(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,c,"GeneratorFunction")),t.prototype=Object.create(d),t},t.awrap=function(t){return{__await:t}},w(O.prototype),f(O.prototype,u,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var u=new O(a(e,r,n,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},w(d),f(d,c,"Generator"),f(d,i,(function(){return this})),f(d,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=R,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return u.type="throw",u.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:R(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}function Rl(t,e,r,n,o,i,u){try{var c=t[i](u),f=c.value}catch(t){return void r(t)}c.done?e(f):Promise.resolve(f).then(n,o)}function El(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){Rl(i,n,o,u,c,"next",t)}function c(t){Rl(i,n,o,u,c,"throw",t)}u(void 0)}))}}function Tl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ll(n.key),n)}}function xl(t,e){return xl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xl(t,e)}function kl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Nl(t);if(e){var o=Nl(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Bl(this,r)}}function Bl(t,e){if(e&&("object"===Ol(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Cl(t)}function Cl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nl(t){return Nl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nl(t)}function Dl(t,e,r){return(e=Ll(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ll(t){var e=function(t,e){if("object"!==Ol(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ol(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ol(e)?e:String(e)}function Il(t){for(var e in nl)if(t instanceof nl[e])return e;return Object.getPrototypeOf(t).constructor.name}!function(t){t.message="message",t.ready="ready",t.renewal="renewalStart",t.renewalSuccess="renewalSuccess",t.renewalError="renewalError"}(dl||(dl={}));var Ml=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xl(t,e)}(l,e);var r,n,o,i,u,c,f,a=kl(l);function l(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(n=a.call(this)).chatConnection=e,n.restConnection=r,Dl(Cl(n),"commandsCount",0),Dl(Cl(n),"awaitingResponse",new Map),Dl(Cl(n),"eventsMap",void 0),Dl(Cl(n),"reconnecting",void 0),n.setCustomEventMap({}),n.chatConnection.on(t.message,(function(t){return n.onMessage(t)})),n.chatConnection.on(t.destroy,(function(t){return n.onDisconnect(t)})),n.chatConnection.on(t.ready,(function(){if(n.reconnecting)return n.reconnecting=!1,void n.emit(dl.renewalSuccess);n.emit(dl.ready)})),n.chatConnection.on(t.error,(function(){n.reconnecting&&(n.reconnecting=!1,n.emit(dl.renewalError))})),n}return r=l,n=[{key:"sendCommand",value:(f=El(_l().mark((function t(e,r){var n,o=this;return _l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.createEnvelope(null!=r?r:Il(e),e),this.chatConnection.send(n.toRaw()),t.abrupt("return",new Promise((function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return o.awaitingResponse.set(n.ref,e)})));case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return f.apply(this,arguments)})},{key:"setCustomEventMap",value:function(t){return this.eventsMap=Sl(Sl({},rl),t),this}},{key:"init",value:function(){return this.chatConnection.init(),this}},{key:"destroy",value:function(){return this.chatConnection.destroy(),this}},{key:"getMe",value:(c=El(_l().mark((function t(){var e;return _l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.restConnection.send("GET","auth/me");case 2:if(!(e=t.sent).ok){t.next=6;break}return e.data.id=e.data.id.toString(),t.abrupt("return",e.data);case 6:throw new Error("Cannot get current user account: ".concat(e.data.errors[0]));case 7:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"deleteToken",value:(u=El(_l().mark((function t(e){var r;return _l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.restConnection.send("DELETE","auth/tokens/".concat(e));case 2:if((r=t.sent).ok){t.next=5;break}throw new Error("Cannot delete access token: ".concat(r.data.errors[0]));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"onMessage",value:function(t){var e,r,n,o=this.createEvent(t),i=jl(null!==(e=this.awaitingResponse.get(null!==(r=t.ref)&&void 0!==r?r:""))&&void 0!==e?e:[],1)[0];i&&(i(null!=o?o:t.data),this.awaitingResponse.delete(t.ref)),this.emit(dl.message,t),this.emit(null!==(n=t.type)&&void 0!==n?n:"unknown",o,t)}},{key:"onDisconnect",value:function(t){var e=this;this.awaitingResponse.forEach((function(t,r){var n=jl(t,2);n[0],(0,n[1])("Disconnected"),e.awaitingResponse.delete(r)})),t&&(this.reconnecting=!0,this.emit(dl.renewal))}},{key:"createEnvelope",value:function(t,e){return new T({type:t,ref:(++this.commandsCount).toString(),data:e})}},{key:"createEvent",value:function(t){var e;return null!==(e=t.type)&&void 0!==e&&e&&this.eventsMap.hasOwnProperty(t.type)?new this.eventsMap[t.type](t.data):null}}],o=[{key:"getToken",value:(i=El(_l().mark((function t(e,r){var n,o,i,u=arguments;return _l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>2&&void 0!==u[2]?u[2]:l.defaultClientName,o=new wl({url:l.defaultRestApiUrl}),t.next=4,o.send("POST","auth/tokens",{login:e,password:r,client_name:n});case 4:if(!(i=t.sent).ok){t.next=7;break}return t.abrupt("return",i.data);case 7:throw new Error("Cannot create user token: ".concat(i.data.errors[0]));case 8:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})},{key:"createByToken",value:function(t){return new l(new yl({token:t,url:l.defaultWebSocketUrl}),new wl({token:t,url:l.defaultRestApiUrl}))}},{key:"createByTemporaryNick",value:function(t){return new l(new yl({temporaryNick:t,url:l.defaultWebSocketUrl}),new wl({url:l.defaultRestApiUrl}))}}],n&&Tl(r.prototype,n),o&&Tl(r,o),Object.defineProperty(r,"prototype",{writable:!1}),l}(a);function Al(t){return Al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Al(t)}function Gl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Gl=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function a(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,u=Object.create(i.prototype),c=new _(o||[]);return n(u,"_invoke",{value:j(t,r,c)}),u}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var s={};function p(){}function y(){}function b(){}var v={};f(v,i,(function(){return this}));var m=Object.getPrototypeOf,h=m&&m(m(R([])));h&&h!==e&&r.call(h,i)&&(v=h);var d=b.prototype=p.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,u,c){var f=l(t[n],t,i);if("throw"!==f.type){var a=f.arg,s=a.value;return s&&"object"==Al(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(s).then((function(t){a.value=t,u(a)}),(function(t){return o("throw",t,u,c)}))}c(f.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var c=g(u,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=l(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}function g(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,g(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),s;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,s;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return y.prototype=b,n(d,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:y,configurable:!0}),y.displayName=f(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,c,"GeneratorFunction")),t.prototype=Object.create(d),t},t.awrap=function(t){return{__await:t}},w(O.prototype),f(O.prototype,u,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var u=new O(a(e,r,n,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},w(d),f(d,c,"Generator"),f(d,i,(function(){return this})),f(d,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=R,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return u.type="throw",u.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:R(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}function Ul(t,e,r,n,o,i,u){try{var c=t[i](u),f=c.value}catch(t){return void r(t)}c.done?e(f):Promise.resolve(f).then(n,o)}function Jl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zl(n.key),n)}}function Fl(t,e){return Fl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fl(t,e)}function Ql(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Yl(t);if(e){var o=Yl(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wl(this,r)}}function Wl(t,e){if(e&&("object"===Al(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Hl(t)}function Hl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yl(t){return Yl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yl(t)}function zl(t){var e=function(t,e){if("object"!==Al(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Al(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Al(e)?e:String(e)}Dl(Ml,"defaultClientName","polfan-server-js-client"),Dl(Ml,"defaultWebSocketUrl","ws://pserv.shado.p5.tiktalik.io:1600/ws"),Dl(Ml,"defaultWebApiUrl","http://pserv.shado.p5.tiktalik.io:1600/api"),Dl(Ml,"defaultRestApiUrl","https://polfan.pl/webservice/api"),Dl(Ml,"defaultAvatarUrlPrefix","https://polfan.pl/modules/users/avatars/");var $l=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fl(t,e)}(f,e);var r,n,o,i,u,c=Ql(f);function f(t){var e,r,n,o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),(e=c.call(this)).options=t,r=Hl(e),o=void 0,(n=zl(n="sendStack"))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,!e.options.token&&!e.options.temporaryNick)throw new Error("Token or temporary nick is required for authentication");return e}return r=f,n=[{key:"init",value:function(){this.emit(t.ready)}},{key:"send",value:function(t){this.sendStack.push({data:t,attempts:0,lastTimeoutId:null}),this.makeApiCall(this.sendStack.length-1)}},{key:"destroy",value:function(){this.sendStack.forEach((function(t){t.lastTimeoutId&&clearTimeout(t.lastTimeoutId)})),this.sendStack=[],this.emit(t.destroy,!1)}},{key:"onMessage",value:(i=Gl().mark((function e(r,n){return Gl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendStack.splice(r,1),e.t0=this,e.t1=t.message,e.next=5,n.json();case 5:e.t2=e.sent,e.t0.emit.call(e.t0,e.t1,e.t2);case 7:case"end":return e.stop()}}),e,this)})),u=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function u(t){Ul(o,r,n,u,c,"next",t)}function c(t){Ul(o,r,n,u,c,"throw",t)}u(void 0)}))},function(t,e){return u.apply(this,arguments)})},{key:"onError",value:function(e,r){var n,o,i=this;if(this.sendStack[e].attempts>=(null!==(n=this.options.attemptsToSend)&&void 0!==n?n:10))return this.sendStack.splice(e,1),void this.emit(t.error,new Error("Cannot send ".concat(r,"; aborting after reaching the maximum connection errors")));this.sendStack[e].lastTimeoutId=setTimeout((function(){return i.makeApiCall(e)}),null!==(o=this.options.attemptDelayMs)&&void 0!==o?o:3e3)}},{key:"makeApiCall",value:function(t){var e=this;this.sendStack[t].attempts++;var r=JSON.stringify(this.sendStack[t].data),n={"Content-Type":"application/json",Accept:"application/json"};this.options.token?n.Authorization="Bearer ".concat(this.options.token):this.options.temporaryNick&&(n.Authorization="Temp ".concat(this.options.temporaryNick)),fetch(this.options.url,{headers:n,body:r,method:"POST"}).then((function(r){return e.onMessage(t,r)})).catch((function(){return e.onError(t,r)}))}}],n&&Jl(r.prototype,n),o&&Jl(r,o),Object.defineProperty(r,"prototype",{writable:!1}),f}(a);return r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PServ=t():e.PServ=t()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function o(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}e.r(t),e.d(t,{IndexedCollection:()=>D,IndexedObjectCollection:()=>J,ObservableIndexedCollection:()=>F,ObservableIndexedObjectCollection:()=>B,WebApiClient:()=>Re,WebSocketClient:()=>de});var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"events",new Map),o(this,"onceEvents",new Map)}var t,r,i;return t=e,(r=[{key:"on",value:function(e,t){return this.addHandler(this.events,e,t),this}},{key:"once",value:function(e,t){return this.addHandler(this.onceEvents,e,t),this}},{key:"emit",value:function(e,t){return this.callHandlers(this.events,e,t),this.callHandlers(this.onceEvents,e,t),this.onceEvents.delete(e),this}},{key:"addHandler",value:function(e,t,r){var n,o=null!==(n=e.get(t))&&void 0!==n?n:[];o.push(r),e.set(t,o)}},{key:"callHandlers",value:function(e,t,r){var n;null===(n=e.get(t))||void 0===n||n.forEach((function(e){return e(r)}))}}])&&n(t.prototype,r),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,b(n.key),n)}}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=f(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},l.apply(this,arguments)}function f(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var o=v(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t,r){return(t=b(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(i,e);var t,r,n,o=p(i);function i(){var e;c(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return m(y(e=o.call.apply(o,[this].concat(r))),"awaitingResponse",new Map),m(y(e),"sentCounter",0),e}return t=i,r=[{key:"on",value:function(e,t){return l(v(i.prototype),"on",this).call(this,e,t)}},{key:"once",value:function(e,t){return l(v(i.prototype),"once",this).call(this,e,t)}},{key:"createEnvelope",value:function(e,t){return{type:e,data:t,ref:(++this.sentCounter).toString()}}},{key:"createPromiseFromCommandEnvelope",value:function(e){var t=this;return new Promise((function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.awaitingResponse.set(e.ref,n)}))}},{key:"handleIncomingEnvelope",value:function(e){if(this.awaitingResponse.has(e.ref)){var t="Error"===e.type;this.awaitingResponse.get(e.ref)[0]({data:t?null:e.data,error:t?e.data:null}),this.awaitingResponse.delete(e.ref)}}},{key:"handleEnvelopeSendError",value:function(e,t){this.awaitingResponse.has(e.ref)&&(this.awaitingResponse.get(e.ref)[0](t),this.awaitingResponse.delete(e.ref))}}],r&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=S(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},k.apply(this,arguments)}function S(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=P(e);if(t){var o=P(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return R(e)}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}function L(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function T(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C(n.key),n)}}function N(e,t,r){return t&&A(e.prototype,t),r&&A(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function G(e,t,r){return(t=C(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e){var t=function(e,t){if("object"!==w(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===w(t)?t:String(t)}var D=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];I(this,e),G(this,"_items",new Map),this.set.apply(this,T(t))}return N(e,[{key:"items",get:function(){return this._items}},{key:"length",get:function(){return this._items.size}},{key:"set",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,o=t;n<o.length;n++){var i=o[n];this._items.set(i[0],i[1])}}},{key:"get",value:function(e){return this.items.get(e)}},{key:"has",value:function(e){return this.items.has(e)}},{key:"delete",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,o=t;n<o.length;n++){var i=o[n];this.items.delete(i)}}},{key:"deleteAll",value:function(){this.items.clear()}},{key:"findBy",value:function(t,r){for(var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new e;!((n=this.items.entries().next().value).done||o&&i.length===o);)n[1][t]===r&&i.set(n);return i}},{key:"map",value:function(e){return Array.from(this.items.entries()).map((function(t){return e(t[1],t[0])}))}}]),e}(),J=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];I(this,e),this.id=t,G(this,"_items",void 0),this._items=new D,this.set.apply(this,T(r))}return N(e,[{key:"items",get:function(){return Array.from(this._items.items.values())}},{key:"length",get:function(){return this._items.length}},{key:"set",value:function(){for(var e,t=this,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=this._items).set.apply(e,T(n.map((function(e){return[t.getId(e),e]}))))}},{key:"get",value:function(e){return this._items.get(e)}},{key:"getAt",value:function(e){return this.items[e]}},{key:"has",value:function(e){return this._items.has(e)}},{key:"delete",value:function(){var e;(e=this._items).delete.apply(e,arguments)}},{key:"deleteAll",value:function(){this._items.deleteAll()}},{key:"findBy",value:function(t,r){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new e(this.id),a=L(this.items);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(o&&i.length===o)break;s[t]===r&&i.set(s)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"map",value:function(e){return this.items.map(e)}},{key:"getId",value:function(e){return"function"==typeof this.id?this.id(e):e[this.id]}}]),e}(),F=function(e){j(r,e);var t=E(r);function r(){var e;I(this,r);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return G(R(e=t.call.apply(t,[this].concat(o))),"eventTarget",void 0),e}return N(r,[{key:"set",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o;t.length&&((o=k(P(r.prototype),"set",this)).call.apply(o,[this].concat(t)),this.eventTarget.emit("change",{setItems:t.map((function(e){return e[0]}))}))}},{key:"delete",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o;t.length&&((o=k(P(r.prototype),"delete",this)).call.apply(o,[this].concat(t)),this.eventTarget.emit("change",{deletedItems:t}))}},{key:"deleteAll",value:function(){if(this.length){var e=this._items.keys();k(P(r.prototype),"deleteAll",this).call(this),this.eventTarget.emit("change",{deletedItems:Array.from(e)})}}},{key:"on",value:function(e,t){return this.eventTarget.on(e,t),this}},{key:"once",value:function(e,t){return this.eventTarget.once(e,t),this}}]),r}(D),B=function(e){j(r,e);var t=E(r);function r(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return I(this,r),(n=t.call(this,e,o)).id=e,G(R(n),"eventTarget",void 0),n.eventTarget=new a,n}return N(r,[{key:"set",value:function(){for(var e,t=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];o.length&&((e=k(P(r.prototype),"set",this)).call.apply(e,[this].concat(o)),this.eventTarget.emit("change",{setItems:o.map((function(e){return t.getId(e)}))}))}},{key:"delete",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o;t.length&&((o=k(P(r.prototype),"delete",this)).call.apply(o,[this].concat(t)),this.eventTarget.emit("change",{deletedItems:t}))}},{key:"deleteAll",value:function(){if(this.length){var e=this._items.items.keys();k(P(r.prototype),"deleteAll",this).call(this),this.eventTarget.emit("change",{deletedItems:Array.from(e)})}}},{key:"on",value:function(e,t){return this.eventTarget.on(e,t),this}},{key:"once",value:function(e,t){return this.eventTarget.once(e,t),this}}]),r}(J);function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function H(e){return function(e){if(Array.isArray(e))return U(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return U(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Y=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),s=new E(o||[]);return n(a,"_invoke",{value:k(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function p(){}function d(){}var y={};c(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(x([])));m&&m!==t&&r.call(m,i)&&(y=m);var b=d.prototype=h.prototype=Object.create(y);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(n,i,a,s){var c=l(e[n],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Q(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function k(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:R}}function R(){return{value:void 0,done:!0}}return p.prototype=d,n(b,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function z(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function W(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){z(i,n,o,a,s,"next",e)}function s(e){z(i,n,o,a,s,"throw",e)}a(void 0)}))}}function $(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,K(n.key),n)}}function q(e,t,r){return(t=K(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K(e){var t=function(e,t){if("object"!==Q(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Q(t)?t:String(t)}var V,X=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.client=t,q(this,"joinedSpaces",new B("id")),q(this,"joinedRooms",new B("id")),q(this,"spacesRoles",new D),q(this,"roomsTopics",new D),q(this,"topicsMessages",new D),q(this,"spacesRooms",new D),q(this,"spacesMembers",new D),q(this,"roomsMembers",new D),q(this,"deferredGetters",new D),q(this,"reconnecting",!1),q(this,"me",null),this.bind()}var t,r,n,o,i,a,s,c,u,l,f,h,p;return t=e,r=[{key:"getMe",value:(p=W(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deferredGetterReadiness("session");case 2:return e.abrupt("return",this.me);case 3:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getJoinedSpaces",value:(h=W(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deferredGetterReadiness("session");case 2:return e.abrupt("return",this.joinedSpaces);case 3:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getJoinedRooms",value:(f=W(Y().mark((function e(){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deferredGetterReadiness("session");case 2:return e.abrupt("return",this.joinedRooms);case 3:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getSpaceRoles",value:(l=W(Y().mark((function e(t){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deferredGetterReadiness("session");case 2:return e.abrupt("return",this.spacesRoles.get(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getRoomTopics",value:(u=W(Y().mark((function e(t){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deferredGetterReadiness("session");case 2:return e.abrupt("return",this.roomsTopics.get(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"getTopicMessages",value:(c=W(Y().mark((function e(t){return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.topicsMessages.get(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getSpaceRooms",value:(s=W(Y().mark((function e(t){var r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="spaces-rooms-".concat(t),this.spacesRooms.has(t)||this.deferredGetters.has(r)||(this.createDeferredGetter(r),this.client.send("GetSpaceRooms",{id:t})),e.next=4,this.deferredGetterReadiness(r);case 4:return e.abrupt("return",this.spacesRooms.get(t));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"getSpaceMembers",value:(a=W(Y().mark((function e(t){var r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="spaces-members-".concat(t),this.spacesMembers.has(t)||this.deferredGetters.has(r)||(this.createDeferredGetter(r),this.client.send("GetSpaceMembers",{id:t})),e.next=4,this.deferredGetterReadiness(r);case 4:return e.abrupt("return",this.spacesMembers.get(t));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getRoomMembers",value:(i=W(Y().mark((function e(t){var r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="rooms-members-".concat(t),this.roomsMembers.has(t)||this.deferredGetters.has(r)||(this.createDeferredGetter(r),this.client.send("GetRoomMembers",{id:t})),e.next=4,this.deferredGetterReadiness(r);case 4:return e.abrupt("return",this.roomsMembers.get(t));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"deferredGetterReadiness",value:(o=W(Y().mark((function e(t){var r;return Y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.deferredGetters.has(t)){e.next=3;break}return e.next=3,null===(r=this.deferredGetters.get(t))||void 0===r?void 0:r.promise;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"bind",value:function(){var e=this;this.client.on(this.client.Event.disconnect,(function(t){return e.handleDisconnect(t)})),this.client.on("NewMessage",(function(t){return e.handleNewMessage(t)})),this.client.on("NewRole",(function(t){return e.handleNewRole(t)})),this.client.on("NewRoom",(function(t){return e.handleNewRoom(t)})),this.client.on("NewTopic",(function(t){return e.handleNewTopic(t)})),this.client.on("RoleDeleted",(function(t){return e.handleRoleDeleted(t)})),this.client.on("RoomDeleted",(function(t){return e.handleRoomDeleted(t)})),this.client.on("RoomJoined",(function(t){return e.handleRoomJoined(t)})),this.client.on("RoomLeft",(function(t){return e.handleRoomLeft(t)})),this.client.on("RoomMemberJoined",(function(t){return e.handleRoomMemberJoined(t)})),this.client.on("RoomMemberLeft",(function(t){return e.handleRoomMemberLeft(t)})),this.client.on("RoomMembers",(function(t){return e.handleRoomMembers(t)})),this.client.on("Session",(function(t){return e.handleSession(t)})),this.client.on("SpaceDeleted",(function(t){return e.handleSpaceDeleted(t)})),this.client.on("SpaceJoined",(function(t){return e.handleSpaceJoined(t)})),this.client.on("SpaceLeft",(function(t){return e.handleSpaceLeft(t)})),this.client.on("SpaceMemberJoined",(function(t){return e.handleSpaceMemberJoined(t)})),this.client.on("SpaceMemberLeft",(function(t){return e.handleSpaceMemberLeft(t)})),this.client.on("SpaceMembers",(function(t){return e.handleSpaceMembers(t)})),this.client.on("SpaceRooms",(function(t){return e.handleSpaceRooms(t)})),this.client.on("SpaceMemberUpdate",(function(t){return e.handleSpaceMemberUpdate(t)})),this.client.on("TopicDeleted",(function(t){return e.handleTopicDeleted(t)}))}},{key:"createDeferredGetter",value:function(e){if(!this.deferredGetters.has(e)){var t={promise:void 0,resolver:void 0};t.promise=new Promise((function(e){return t.resolver=e})),this.deferredGetters.set([e,t])}}},{key:"handleDisconnect",value:function(e){e&&(this.reconnecting=!0)}},{key:"handleNewMessage",value:function(e){this.topicsMessages.get(e.topicId).set(e.message)}},{key:"handleNewRole",value:function(e){var t=this.spacesRoles.get(e.spaceId);t.set(e.role),this.joinedSpaces.get(e.spaceId).roles=t.items}},{key:"handleNewRoom",value:function(e){var t;null===(t=this.spacesRooms.get(e.spaceId))||void 0===t||t.set(e.summary)}},{key:"handleNewTopic",value:function(e){var t=this.roomsTopics.get(e.roomId);t.set(e.topic),this.joinedRooms.get(e.roomId).topics=t.items}},{key:"handleRoleDeleted",value:function(e){var t=this.spacesRoles.get(e.spaceId);t.delete(e.id),this.joinedSpaces.get(e.spaceId).roles=t.items}},{key:"handleRoomDeleted",value:function(e){e.spaceId&&this.spacesRooms.get(e.spaceId).delete(e.id),this.joinedRooms.delete(e.id),this.roomsMembers.delete(e.id),this.roomsTopics.delete(e.id)}},{key:"handleRoomJoined",value:function(e){this.addJoinedRooms(e.room)}},{key:"addJoinedRooms",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=this.roomsTopics).set.apply(e,H(n.map((function(e){return[e.id,new B("id",e.topics)]})))),(t=this.joinedRooms).set.apply(t,n)}},{key:"handleRoomLeft",value:function(e){this.joinedRooms.delete(e.id),this.roomsMembers.delete(e.id),this.roomsTopics.delete(e.id)}},{key:"handleRoomMemberJoined",value:function(e){this.roomsMembers.has(e.roomId)&&this.roomsMembers.get(e.roomId).set(e.member)}},{key:"handleRoomMemberLeft",value:function(e){this.roomsMembers.has(e.roomId)&&this.roomsMembers.get(e.roomId).delete(e.userId)}},{key:"handleRoomMembers",value:function(e){var t;this.roomsMembers.has(e.id)||(this.roomsMembers.set([e.id,new B((function(e){var t;return null!==(t=null==e?void 0:e.user.id)&&void 0!==t?t:e.spaceMember.user.id}),e.members)]),null===(t=this.deferredGetters.get("rooms-members-".concat(e.id)))||void 0===t||t.resolver())}},{key:"handleSession",value:function(e){var t;this.me=e.user,this.me&&!this.reconnecting||(this.reconnecting=!1,this.joinedRooms.deleteAll(),this.roomsTopics.deleteAll(),this.roomsMembers.deleteAll(),this.joinedSpaces.deleteAll(),this.spacesRoles.deleteAll(),this.spacesRooms.deleteAll(),this.spacesMembers.deleteAll(),this.addJoinedRooms.apply(this,H(e.state.rooms)),this.addJoinedSpaces.apply(this,H(e.state.spaces)),null===(t=this.deferredGetters.get("session"))||void 0===t||t.resolver())}},{key:"handleSpaceDeleted",value:function(e){this.spacesRoles.delete(e.id),this.spacesMembers.delete(e.id),this.spacesRooms.delete(e.id),this.joinedSpaces.delete(e.id)}},{key:"handleSpaceJoined",value:function(e){this.addJoinedSpaces(e.space)}},{key:"addJoinedSpaces",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=this.spacesRoles).set.apply(e,H(n.map((function(e){return[e.id,new B("id",e.roles)]})))),(t=this.joinedSpaces).set.apply(t,n)}},{key:"handleSpaceLeft",value:function(e){this.spacesRoles.delete(e.id),this.spacesMembers.delete(e.id),this.spacesRooms.delete(e.id),this.joinedSpaces.delete(e.id)}},{key:"handleSpaceMemberJoined",value:function(e){this.spacesMembers.has(e.spaceId)&&this.spacesMembers.get(e.spaceId).set(e.member)}},{key:"handleSpaceMemberLeft",value:function(e){this.spacesMembers.has(e.spaceId)&&this.spacesMembers.get(e.spaceId).delete(e.userId)}},{key:"handleSpaceMembers",value:function(e){var t;this.spacesMembers.has(e.id)||(this.spacesMembers.set([e.id,new B((function(e){return null==e?void 0:e.user.id}),e.members)]),null===(t=this.deferredGetters.get("spaces-members-".concat(e.id)))||void 0===t||t.resolver())}},{key:"handleSpaceRooms",value:function(e){var t;this.spacesRooms.has(e.id)||(this.spacesRooms.set([e.id,new B("id",e.summaries)]),null===(t=this.deferredGetters.get("spaces-rooms-".concat(e.id)))||void 0===t||t.resolver())}},{key:"handleSpaceMemberUpdate",value:function(e){this.spacesMembers.has(e.spaceId)&&this.spacesMembers.get(e.spaceId).set(e.member)}},{key:"handleTopicDeleted",value:function(e){var t=this.roomsTopics.get(e.roomId);t.delete(e.id),this.joinedRooms.get(e.roomId).topics=t.items}}],r&&$(t.prototype,r),n&&$(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function ee(e){return function(e){if(Array.isArray(e))return te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function re(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */re=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),s=new E(o||[]);return n(a,"_invoke",{value:k(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function p(){}function d(){}var y={};c(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(x([])));m&&m!==t&&r.call(m,i)&&(y=m);var b=d.prototype=h.prototype=Object.create(y);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(n,i,a,s){var c=l(e[n],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Z(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function k(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:R}}function R(){return{value:void 0,done:!0}}return p.prototype=d,n(b,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function ne(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function oe(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ne(i,n,o,a,s,"next",e)}function s(e){ne(i,n,o,a,s,"throw",e)}a(void 0)}))}}function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,he(n.key),n)}}function ae(e,t){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ae(e,t)}function se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=le(e);if(t){var o=le(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ce(this,r)}}function ce(e,t){if(t&&("object"===Z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ue(e)}function ue(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function le(e){return le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},le(e)}function fe(e,t,r){return(t=he(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function he(e){var t=function(e,t){if("object"!==Z(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Z(t)?t:String(t)}!function(e){e.connect="connect",e.disconnect="disconnect",e.message="message",e.error="error"}(V||(V={}));var pe,de=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ae(e,t)}(s,e);var t,r,n,o,i,a=se(s);function s(e){var t,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(r=a.call(this)).options=e,fe(ue(r),"Event",V),fe(ue(r),"state",void 0),fe(ue(r),"ws",null),fe(ue(r),"sendQueue",[]),fe(ue(r),"connectingTimeoutId",void 0),fe(ue(r),"authenticated",void 0),fe(ue(r),"authenticatedResolvers",void 0),!r.options.token&&!r.options.temporaryNick)throw new Error("Token or temporary nick is required");return(null===(t=r.options.stateTracking)||void 0===t||t)&&(r.state=new X(ue(r))),r}return t=s,r=[{key:"connect",value:(i=oe(re().mark((function e(){var t,r,n=this;return re().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.options.token?"token=".concat(this.options.token):"nick=".concat(this.options.temporaryNick),this.ws=new WebSocket("".concat(this.options.url,"?").concat(r)),this.ws.onclose=function(e){return n.onClose(e)},this.ws.onmessage=function(e){return n.onMessage(e)},this.connectingTimeoutId=setTimeout((function(){return n.triggerConnectionTimeout()}),null!==(t=this.options.connectingTimeoutMs)&&void 0!==t?t:1e4),this.authenticated=!1,e.abrupt("return",new Promise((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.authenticatedResolvers=t})));case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"disconnect",value:function(){var e;this.sendQueue=[],null===(e=this.ws)||void 0===e||e.close(),this.ws=null}},{key:"send",value:(o=oe(re().mark((function e(t,r){var n;return re().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.ws&&![this.ws.CLOSED,this.ws.CLOSING].includes(this.ws.readyState)){e.next=2;break}throw new Error("Cannot send; close or closing connection state");case 2:if(this.ws.readyState!==this.ws.CONNECTING&&this.authenticated){e.next=5;break}return this.sendQueue.push([t,r]),e.abrupt("return");case 5:if(this.ws.readyState===this.ws.OPEN){e.next=7;break}throw new Error("Invalid websocket state=".concat(this.ws.readyState));case 7:return n=this.createEnvelope(t,r),this.ws.send(JSON.stringify(n)),e.abrupt("return",this.createPromiseFromCommandEnvelope(n));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"onMessage",value:function(e){var t=JSON.parse(e.data);if(!this.authenticated){var r="Error"!==t.type;this.authenticated=r,r?(this.authenticatedResolvers[0](),this.emit(this.Event.connect),this.sendFromQueue()):this.authenticatedResolvers[1](t.data)}this.handleIncomingEnvelope(t),this.emit(t.type,t),this.emit(this.Event.message,t)}},{key:"onClose",value:function(e){clearTimeout(this.connectingTimeoutId);var t=1e3!==e.code;t&&this.connect(),this.emit(this.Event.disconnect,t)}},{key:"sendFromQueue",value:function(){var e=this,t=0,r=function(r){var n,o=e.sendQueue[r];setTimeout((function(){return e.send.apply(e,ee(o))}),t),t+=null!==(n=e.options.awaitQueueSendDelayMs)&&void 0!==n?n:500};for(var n in this.sendQueue)r(n);this.sendQueue=[],clearTimeout(this.connectingTimeoutId)}},{key:"triggerConnectionTimeout",value:function(){this.disconnect(),this.emit(this.Event.error,new Error("Connection timeout"))}}],r&&ie(t.prototype,r),n&&ie(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(g);function ye(e){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ye(e)}function ve(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ve=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),s=new E(o||[]);return n(a,"_invoke",{value:k(e,r,s)}),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function p(){}function d(){}var y={};c(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(x([])));m&&m!==t&&r.call(m,i)&&(y=m);var b=d.prototype=h.prototype=Object.create(y);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(n,i,a,s){var c=l(e[n],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==ye(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function k(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:R}}function R(){return{value:void 0,done:!0}}return p.prototype=d,n(b,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=c(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function me(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function be(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){me(i,n,o,a,s,"next",e)}function s(e){me(i,n,o,a,s,"throw",e)}a(void 0)}))}}function ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xe(n.key),n)}}function we(e,t){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},we(e,t)}function ke(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Oe(e);if(t){var o=Oe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Se(this,r)}}function Se(e,t){if(t&&("object"===ye(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return je(e)}function je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oe(e){return Oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oe(e)}function Ee(e,t,r){return(t=xe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xe(e){var t=function(e,t){if("object"!==ye(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ye(t)?t:String(t)}!function(e){e.message="message",e.error="error",e.destroy="destroy"}(pe||(pe={}));var Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(s,e);var t,r,n,o,i,a=ke(s);function s(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this)).options=e,Ee(je(t),"Event",pe),Ee(je(t),"sendStack",void 0),!t.options.token&&!t.options.temporaryNick)throw new Error("Token or temporary nick is required");return t}return t=s,r=[{key:"send",value:(i=be(ve().mark((function e(t,r){var n;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.createEnvelope(t,r),this.sendStack.push({data:n,attempts:0,lastTimeoutId:null}),this.makeApiCall(this.sendStack.length-1),e.abrupt("return",this.createPromiseFromCommandEnvelope(n));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"destroy",value:function(){var e=this;this.sendStack.forEach((function(t){t.lastTimeoutId&&clearTimeout(t.lastTimeoutId),e.awaitingResponse.delete(t.data.ref)})),this.sendStack=[],this.emit(this.Event.destroy,!1)}},{key:"onMessage",value:(o=be(ve().mark((function e(t,r){var n;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendStack.splice(t,1),e.next=3,r.json();case 3:n=e.sent,this.handleIncomingEnvelope(n),this.emit(n.type,n),this.emit(this.Event.message,n);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"onError",value:function(e,t){var r,n,o=this;if(this.sendStack[e].attempts>=(null!==(r=this.options.attemptsToSend)&&void 0!==r?r:10))return this.sendStack.splice(e,1),void this.handleEnvelopeSendError(this.sendStack[e].data,new Error("Cannot send ".concat(t,"; aborting after reaching the maximum connection errors")));this.sendStack[e].lastTimeoutId=setTimeout((function(){return o.makeApiCall(e)}),null!==(n=this.options.attemptDelayMs)&&void 0!==n?n:3e3)}},{key:"makeApiCall",value:function(e){var t=this;this.sendStack[e].attempts++;var r=JSON.stringify(this.sendStack[e].data),n={"Content-Type":"application/json",Accept:"application/json"};this.options.token?n.Authorization="Bearer ".concat(this.options.token):this.options.temporaryNick&&(n.Authorization="Temp ".concat(this.options.temporaryNick)),fetch(this.options.url,{headers:n,body:r,method:"POST"}).then((function(r){return t.onMessage(e,r)})).catch((function(){return t.onError(e,r)}))}}],r&&ge(t.prototype,r),n&&ge(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(g);return t})()));
2
2
  //# sourceMappingURL=index.js.map