aes70 1.6.0 → 1.6.1

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 (34) hide show
  1. package/Changelog +30 -0
  2. package/dist/AES70.es5.js +1 -1
  3. package/package.json +1 -1
  4. package/src/OCP1/encoded_arguments.js +31 -19
  5. package/src/connection.d.ts +5 -0
  6. package/src/controller/ControlClasses/OcaBlock.d.ts +15 -15
  7. package/src/controller/ControlClasses/OcaBlock.js +16 -16
  8. package/src/controller/ControlClasses/OcaControlNetwork.d.ts +5 -0
  9. package/src/controller/ControlClasses/OcaControlNetwork.js +5 -0
  10. package/src/controller/ControlClasses/OcaFilterParametric.d.ts +4 -0
  11. package/src/controller/ControlClasses/OcaFilterParametric.js +5 -0
  12. package/src/controller/ControlClasses/OcaGrouper.d.ts +12 -0
  13. package/src/controller/ControlClasses/OcaGrouper.js +15 -0
  14. package/src/controller/ControlClasses/OcaMediaClockManager.d.ts +4 -0
  15. package/src/controller/ControlClasses/OcaMediaClockManager.js +5 -0
  16. package/src/controller/ControlClasses/OcaMediaTransportNetwork.d.ts +4 -0
  17. package/src/controller/ControlClasses/OcaMediaTransportNetwork.js +5 -0
  18. package/src/controller/ControlClasses/OcaNetworkSignalChannel.d.ts +68 -68
  19. package/src/controller/ControlClasses/OcaNetworkSignalChannel.js +72 -72
  20. package/src/controller/ControlClasses/OcaSecurityManager.d.ts +31 -31
  21. package/src/controller/ControlClasses/OcaSecurityManager.js +29 -29
  22. package/src/controller/ControlClasses/OcaStreamConnector.d.ts +70 -70
  23. package/src/controller/ControlClasses/OcaStreamConnector.js +80 -80
  24. package/src/controller/ControlClasses/OcaStreamNetwork.d.ts +18 -18
  25. package/src/controller/ControlClasses/OcaStreamNetwork.js +49 -49
  26. package/src/controller/ControlClasses/OcaSubscriptionManager.d.ts +13 -13
  27. package/src/controller/ControlClasses/OcaSubscriptionManager.js +12 -12
  28. package/src/controller/base_event.js +2 -2
  29. package/src/controller/client_connection.js +7 -3
  30. package/src/controller/fetch_device_content.js +8 -3
  31. package/src/controller/make_control_class.js +30 -4
  32. package/src/controller/object_base.d.ts +34 -0
  33. package/src/controller/tcp_connection.d.ts +4 -2
  34. package/src/controller/tcp_connection.js +23 -6
package/Changelog CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  All notable changes and version updates will be documented in this file.
4
4
 
5
+ ## [1.6.1] - 2025-05-06
6
+
7
+ - TCPConnection.connect: Add connecSignal to abort
8
+ connection attempts.
9
+
10
+ - Encode arguments earlier. This means that when calling
11
+ a remove oca method with invalid arguments, and error
12
+ is thrown right away. This helps with debugging user
13
+ errors.
14
+
15
+ - Add typescript declarations for ObjectBase.
16
+
17
+ ## [1.6.0] - 2025-01-30
18
+
19
+ - Add stack debug feature to RemoteDevice
20
+
21
+ - Add support for OcaPolynomialFilter property
22
+ getters and setters.
23
+
24
+ - Add PropertyObserver feature
25
+
26
+ - Make Arguments type iterable. This allows to
27
+ use destructuring syntax.
28
+
29
+ - printDevice: Support udp
30
+
31
+ ## [1.5.4] - 2025-01-16
32
+
33
+ - Add --json argument to printDevice tool
34
+
5
35
  ## [1.5.3] - 2024-06-29
6
36
 
7
37
  - Fixed an error in keepalive handling and timeout detection.
package/dist/AES70.es5.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";function e(...e){try{console.warn(...e)}catch(e){}}function t(...e){try{console.error(...e)}catch(e){}}class n{constructor(){this.event_handlers=new Map}emit(e){const t=this.event_handlers.get(e),n=Array.prototype.slice.call(arguments,1);t&&t.forEach(e=>{try{e.apply(this,n)}catch(t){console.warn("ERROR when calling %o: %o",e,t)}})}on(e,t){let n=this.event_handlers.get(e);n||this.event_handlers.set(e,n=new Set),n.add(t)}addEventListener(e,t){this.on(e,t)}removeEventListener(e,t){const n=this.event_handlers.get(e);if(!n||!n.has(t))throw new Error("removeEventListeners(): not installed.");n.delete(t)}removeAllEventListeners(){this.event_handlers.clear()}}class r{get messageType(){return this.constructor.messageType}}class s{get byteLength(){let e=this._byteLength;if(-1===e){const t=this.encoders,n=this.data;e=0;for(let r=0;r<t.length;r++)e+=t[r].encodedLength(n[r]);this._byteLength=e}return e}constructor(e,t){this.encoders=e,this.data=t,this._byteLength=-1}encodeTo(e,t){t|=0;const{encoders:n,data:r}=this;for(let s=0;s<n.length;s++)t=n[s].encodeTo(e,t,r[s]);return t}}class o extends r{constructor(e,t,n,r,s){super(),this.target=+e,this.method_level=0|t,this.method_index=0|n,this.param_count=0|r,this.parameters=s||null,this.handle=0}static get messageType(){return 0}encode_to(e,t){if(t|=0,e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++,this.param_count){const n=this.parameters;n instanceof s?t=n.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(n),e.byteOffset+t),t+=n.byteLength)}return t}encoded_length(){return 17+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++,r-=17,r<0)throw new Error("Bad Command Length.");if(r>0){if(!this.param_count)throw new Error("Expected no parameter bytes.");this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}response(e,t,n){return new Response(this.handle,e,t,n)}}class i extends o{static get messageType(){return 1}}function a(e){if(!e.isConstantLength)return e;const t=e.encodedLength(),n=e.decode,r=e.encodeTo;return{isConstantLength:!0,encodedLength:e.encodedLength,encodeTo:r,decode:n,decodeFrom:function(e,r){const s=n(e,r);return[r+t,s]},decodeLength:function(e,n){return n+t}}}const c=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setUint16(t,0|n,!1),t+2},decode:function(e,t){return e.getUint16(t,!1)}});function l(e,t){const n=Object.keys(e).length;return t||(t=class{constructor(...t){if(t.length===n){let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this[r]=t[n++])}else{if(1!==t.length||"object"!=typeof t[0])throw new TypeError("Unexpected arguments.");{const n=t[0];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=n[t])}}}}),a({type:t,isConstantLength:!1,encodedLength:function(t){let n=0;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n+=e[r].encodedLength(t[r])}return n},encodeTo:function(t,n,r){for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;n=e[s].encodeTo(t,n,r[s])}return n},decodeFrom:function(n,r){const s=new Array(e.length);let o=0;for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const i=e[t];let a;[r,a]=i.decodeFrom(n,r),s[o++]=a}return[r,new t(...s)]},decodeLength:function(t,n){for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n=e[r].decodeLength(t,n)}return n}})}class u{constructor(e,t){this.DefLevel=e,this.EventIndex=t}}const h=l({DefLevel:c,EventIndex:c},u),d=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setUint32(t,n,!1),t+4},decode:function(e,t){return e.getUint32(t,!1)}});class g{constructor(e,t){this.EmitterONo=e,this.EventID=t}}const f=l({EmitterONo:d,EventID:h},g);class p extends r{constructor(e,t,n,r,s,o,i){super(),this.target=e,this.method_level=0|t,this.method_index=0|n,this.context=r,this.event=s,this.param_count=0|o,this.parameters=i||null}static get messageType(){return 2}encode_to(e,t){e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++;const n=this.context;if(n){const r=n.byteLength;e.setUint16(t,r),t+=2,r>0&&(new Uint8Array(e.buffer).set(new Uint8Array(this.context),e.byteOffset+t),t+=r)}else e.setUint16(t,0),t+=2;return e.setUint32(t,this.event.EmitterONo),t+=4,e.setUint16(t,this.event.EventID.DefLevel),t+=2,e.setUint16(t,this.event.EventID.EventIndex),t+=2,this.param_count>1&&(this.parameters instanceof s?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}encoded_length(){return 23+(this.param_count>1?this.parameters.byteLength:0)+(this.context?this.context.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++;const s=e.getUint16(t);let o;if(t+=2,s?(this.context=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+s),t+=s):this.context=null,[t,o]=f.decodeFrom(e,t),this.event=o,r-=23+s,r<0)throw new Error("Bad Notification Length.");return r>0&&(this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r),t}}class m extends r{constructor(e,t,n,r){super(),this.handle=e,this.status_code=0|t,this.param_count=0|n,this.parameters=r||null}static get messageType(){return 3}encoded_length(){return 10+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.status_code=e.getUint8(t),t++,this.param_count=e.getUint8(t),t++,r-=10,r<0)throw new Error("Bad Response length.");if(r>0){if(!this.param_count)throw new Error("Decoding response with parameterCount=0 but %o bytes of parameters",r);this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}encode_to(e,t){return e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint8(t,this.status_code),t++,e.setUint8(t,this.param_count),t++,this.param_count&&(this.parameters instanceof s?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}}class S extends r{static get messageType(){return 4}constructor(e){super(),this.time=e||0}decode_from(e,t,n){if(4==n)this.time=e.getUint32(t),t+=4;else{if(2!=n)throw new Error("Bad keepalive timeout length.");this.time=1e3*e.getUint16(t),t+=2}return t}encode_to(e,t){return this.time%1e3?(e.setUint32(t,this.time),t+=4):(e.setUint16(t,this.time/1e3),t+=2),t}encoded_length(){return this.time%1e3?4:2}}const y=[o,i,p,m,S];function b(e,t,n){if(e.byteLength<e.byteOffset+t+10)return-1;if(t|=0,59!=e.getUint8(t))throw new Error("Bad sync value.");t++,t+=2;const r=e.getUint32(t);t+=4;const s=e.getUint8(t);t++;const o=e.getUint16(t);t+=2;const i=e.byteOffset+t-9+r;if(i>e.byteLength)return-1;n.length=o;const a=y[s];if(void 0===a)throw new Error("Bad Message Type");if(a===S&&1!==o)throw new Error("Bad KeepAlive message count.");for(let r=0;r<o;r++)n[r]=new a,t=n[r].decode_from(e,t,i-e.byteOffset-t);if(t!=i)throw new Error("Decode error: "+t+" vs "+i);return t}function O(e,t,n,r,s){r||(r=0),s||(s=n.length);if(!(s-r<=65535))throw new Error("Too many PDUs.");e.setUint8(t,59);const o=t+=1;e.setUint16(t,1);const i=t+=2;t+=4,e.setUint8(t,n[r].messageType),t++,e.setUint16(t,s-r),t+=2;for(let o=r;o<s;o++)t=n[o].encode_to(e,t);return e.setUint32(i,t-o),t}function w(e){Array.isArray(e)||(e=[e]);const t=function(e){let t=10;const n=e[0].messageType;for(let r=0;r<e.length;r++){const s=e[r];if(s.messageType!=n)throw new Error("Cannot combine different types in one message.");t+=s.encoded_length()}return t}(e),n=new ArrayBuffer(t);if(O(new DataView(n),0,e,0,e.length)!=t)throw new Error("Message length mismatch.");return n}class C{constructor(e,t){if(!(e<=4294967295))throw new TypeError("Invalid batch size.");this._pdus=[],this._batchSize=e,this._resultCallback=t,this._currentSize=0,this._currentCount=0,this._lastMessageType=-1,this._flushScheduled=!1,this._flushCb=()=>{this._flushScheduled=!1,null!==this._pdus&&this.flush()}}add(e){const t=this._currentSize,n=e.encoded_length(),r=e.messageType,s=this._lastMessageType===r&&4!==r&&this._currentCount<65535;let o=n;s||(o+=10),t&&t+o>this._batchSize&&(this.flush(),o=n+10),this._pdus.push(e),this._currentSize+=o,s?this._currentCount++:this._currentCount=1,this._lastMessageType=r,this._currentSize>this._batchSize?this.flush():1===this._pdus.length&&this.scheduleFlush()}scheduleFlush(){this._flushScheduled||(this._flushScheduled=!0,Promise.resolve().then(this._flushCb).catch(e=>{console.error(e)}))}flush(){if(!this._currentSize)return;const e=this._pdus,t=new ArrayBuffer(this._currentSize),n=new DataView(t),r=e.length;for(let t=0,s=0,o=0;t<r;t++){const i=e[t].messageType;t!==r-1&&t+1-s!=65535&&4!==i&&i===e[t+1].messageType||(o=O(n,o,e,s,t+1),s=t+1)}this._currentSize=0,this._lastMessageType=-1,this._currentCount=0,this._pdus.length=0,this._resultCallback(t)}dispose(){this._pdus=null}}class _ extends n{constructor(e){e||(e={}),super();const t=this._now();this.options=e;const n=e.batch>=0?e.batch:65536;this._message_generator=new C(n,e=>this.write(e)),this.inbuf=null,this.inpos=0,this.last_rx_time=t,this.last_tx_time=t,this.rx_bytes=0,this.tx_bytes=0,this.keepalive_interval=-1,this._keepalive_interval_id=null;const r=()=>{this.removeEventListener("close",r),this.removeEventListener("error",r),this.cleanup()};this.on("close",r),this.on("error",r)}get is_reliable(){return!0}send(e){if(this.is_closed())throw new Error("Connection is closed.");this._message_generator.add(e)}tx_idle_time(){return this._now()-this.last_tx_time}rx_idle_time(){return this._now()-this.last_rx_time}read(e){if(this.rx_bytes+=e.byteLength,this.last_rx_time=this._now(),this.inbuf){const t=this.inbuf.byteLength-this.inpos,n=new Uint8Array(new ArrayBuffer(t+e.byteLength));n.set(new Uint8Array(this.inbuf,this.inpos)),n.set(new Uint8Array(e),t),this.inbuf=null,this.inpos=0,e=n.buffer}let t=0;const n=new DataView(e);try{do{const r=[],s=b(n,t,r);if(-1==s){this.inbuf=e,this.inpos=t;break}t=s,this.incoming(r)}while(t<e.byteLength)}catch(e){if(this.is_reliable)return void this.emit("error",e);console.error(e)}this._check_keepalive()}incoming(e){}write(e){this.last_tx_time=this._now(),this.tx_bytes+=e.byteLength}is_closed(){return null===this._message_generator}close(){this.is_closed()||this.emit("close")}error(e){this.is_closed()||this.emit("error",e)}cleanup(){if(this.is_closed())throw new Error("cleanup() called twice.");this.set_keepalive_interval(0),this._message_generator.dispose(),this._message_generator=null,this.removeAllEventListeners()}_check_keepalive(){if(!(this.keepalive_interval>0))return;const e=this.keepalive_interval;this.rx_idle_time()>3*e?(this.emit("timeout"),this.error(new Error("Keepalive timeout."))):this.tx_idle_time()>.75*e&&(this.flush(),this.tx_idle_time()>.75*e&&this.send(new S(e)))}flush(){this._message_generator.flush()}set_keepalive_interval(e){const t=1e3*e;null!==this._keepalive_interval_id&&(clearInterval(this._keepalive_interval_id),this._keepalive_interval_id=null),this.keepalive_interval=t,this.is_closed()||(this.send(new S(t)),t>0&&(this._keepalive_interval_id=setInterval(()=>{this._check_keepalive()},t/2)))}}class P extends Error{constructor(e,t){super("Call failed with OcaStatus "+e.name),this.name="aes70.RemoteError",this.status=e,this.cmd=t}static check_status(e,t){return e instanceof this&&e.status===t}}class v{constructor(e){this.values=e}item(e){return this.values[e]}get length(){return this.values.length}[Symbol.iterator](){return this.values[Symbol.iterator]()}}function G(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D(e){let t=null;function n(n){if(null===t){t=new Map;for(const n in e)G(e,n)&&t.set(e[n],n)}return t.get(n)}let r=null;const s=class{get isEnum(){return!0}constructor(t){if("string"==typeof t){if(!G(e,t))throw new Error("No such enum value.");return this.constructor[t]}if(null!==r&&r.has(t))return r.get(t);this.value=t,function(e,t){null===r&&(r=new Map),r.set(e,t)}(t,this)}get name(){return n(this.value)}valueOf(){return this.value}toString(){return this.name}static getName(e){const t=n(e);if(void 0===t)throw new Error("No such enum value.");return t}static getValue(t){const n=function(t){if(G(e,t))return e[t]}(t);if(void 0===n)throw new Error("No such enum value.");return n}static values(){return e}};for(const t in e)G(e,t)&&Object.defineProperty(s,t,{get:function(){return new this(e[t])},enumerable:!1,configurable:!0});return s}class T extends(D({OK:0,ProtocolVersionError:1,DeviceError:2,Locked:3,BadFormat:4,BadONo:5,ParameterError:6,ParameterOutOfRange:7,NotImplemented:8,InvalidRequest:9,ProcessingFailed:10,BadMethod:11,PartiallySucceeded:12,Timeout:13,BufferOverflow:14})){}class M{get handle(){return this.command.handle}constructor(e,t,n,r,s){this.resolve=e,this.reject=t,this.returnTypes=n,this.command=r,this.stack=s,this.lastSent=0,this.retries=0}response(e){const{resolve:t,reject:n,returnTypes:r,command:s}=this;if(0!==e.status_code){const t=new P(new T(e.status_code),s);this.stack&&(t.stack=this.stack),n(t)}else if(r)try{const n=Math.min(e.param_count,r.length);if(0===n)t();else{const s=new Array(n),o=new DataView(e.parameters);for(let e=0,t=0;e<n;e++){let n;[t,n]=r[e].decodeFrom(o,t),s[e]=n}t(1===n?s[0]:new v(s))}}catch(e){n(e)}else t(e)}}function I(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}class A extends _{constructor(e){super(e),this._pendingCommands=new Map,this._nextCommandHandle=0,this._subscribers=new Map}cleanup(){super.cleanup(),this._subscribers=null;const e=this._pendingCommands;this._pendingCommands=null;const t=new Error("closed");e.forEach((e,n)=>{e.reject(t)})}_addSubscriber(e,t){const n=I(e),r=this._subscribers;if(r.has(n))throw new Error("Subscriber already exists.");r.set(n,t)}_removeSubscriber(e){const t=I(e),n=this._subscribers;if(!n.has(t))throw new Error("Unknown subscriber.");n.delete(t)}_getNextCommandHandle(){let e;const t=this._pendingCommands;if(null===t)throw new Error("Connection not open.");do{e=this._nextCommandHandle,this._nextCommandHandle=e+1|0}while(t.has(e));return e}_estimate_next_tx_time(){return this._now()}send_command(e,t,n,r){const s=(n,s)=>{const o=this._getNextCommandHandle();e.handle=o;const i=new M(n,s,t,e,r);this._pendingCommands.set(o,i),i.lastSent=this._estimate_next_tx_time(),this.send(e)};if(!n)return new Promise(s);s(e=>n(!0,e),e=>n(!1,e))}_removePendingCommand(e){const t=this._pendingCommands,n=t.get(e);return n?(t.delete(e),n):null}incoming(e){for(let t=0;t<e.length;t++){if(null===this._pendingCommands)return;const n=e[t];if(n instanceof m){const e=this._removePendingCommand(n.handle);if(null===e){if(this.is_reliable)return void this.error(new Error("Unknown handle."));continue}e.response(n)}else if(n instanceof p){const e=this._subscribers,t=I(n.event),r=e.get(t);if(!r)continue;r(n)}else{if(!(n instanceof S))throw new Error("Unexpected PDU");if(!(n.time>0))throw new Error("Bad keepalive timeout.")}}}}const L=a({isConstantLength:!1,encodedLength:function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(Array.isArray(e)||e instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+t},encodeTo:function(e,t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));const r=n.length;e.setUint16(t,r),t+=2;return new Uint8Array(e.buffer,e.byteOffset).set(n,t),t+r},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+n,new Uint8Array(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+2+e.getUint16(t)}});function E(e){return a({isConstantLength:!0,encodedLength:function(t){return e},encodeTo:function(t,n,r){if(!(Array.isArray(r)||r instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");if(r.length!==e)throw new Error("Length mismatch.");return new Uint8Array(t.buffer,t.byteOffset).set(r,n),n+e},decode:function(t,n){return new Uint8Array(t.buffer,t.byteOffset+n,e)}})}const k=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,n?1:0),t+1},decode:function(e,t){return 0!==e.getUint8(t)}}),x=c,N=x;function U(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function R(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");return 2+n*t},encodeTo:function(e,t,r){const s=r.length;e.setUint16(t,s),t+=2;for(let o=0;o<s;o++)t=n(e,t,r[o]);return t},decodeFrom:function(e,n){const s=e.getUint16(n);n+=2;const o=new Array(s);for(let i=0;i<s;i++)o[i]=r(e,n),n+=t;return[n,o]},decodeLength:function(e,n){return n+(2+e.getUint16(n)*t)}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,s=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");let r=2;for(let s=0;s<n;s++)r+=t(e[s]);return r},encodeTo:function(e,t,r){const s=r.length;e.setUint16(t,s),t+=2;for(let o=0;o<s;o++)t=n(e,t,r[o]);return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const s=new Array(n);for(let o=0;o<n;o++){let n;[t,n]=r(e,t),s[o]=n}return[t,s]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=s(e,t);return t}})}(e)}const F=new TextEncoder,B=new TextDecoder;function V(e){return F.encode(e)}function j(e,t,n){const r=t;for(;n--;){const n=e.getUint8(t);if(t++,!(n<=127)){if(n<194)throw new Error("Invalid UTF8 sequence.");if(t++,!(n<=223||(t++,n<=239||(t++,n<=244))))throw new Error("Invalid UTF8 sequence.")}}return t-r}const z=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");return 2+V(e).byteLength},encodeTo:function(e,t,n){const r=function(e){let t=0;for(let n=0;n<e.length;n++,t++){const t=e.charCodeAt(n);if(t>=55296&&t<=56319){n++;const t=e.charCodeAt(n);if(t<56320||t>57343)throw new TypeError("Expected valid unicode string.")}}return t}(n);if(r>65535)throw new Error("String too long for OcaString OCP.1 encoding.");e.setUint16(t,r),t+=2;const s=new Uint8Array(V(n));return new Uint8Array(e.buffer,e.byteOffset).set(s,t),t+s.length},decodeFrom:function(e,t){const n=e.getUint16(t),r=j(e,t+=2,n),s=new Uint8Array(e.buffer,e.byteOffset+t,r);return[t+r,(o=s,B.decode(o))];var o},decodeLength:function(e,t){const n=e.getUint16(t);return(t+=2)+j(e,t,n)}}),q=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");const t=e.length;if(t>65535)throw new Error("Array too long for String16 OCP.1 encoding.");return 2+2*t},encodeTo:function(e,t,n){const r=n.length;e.setUint16(t,r,!1),t+=2;for(let s=0;s<r;s++,t+=2)e.setUint16(t,n.charCodeAt(s),!1);return t},decodeFrom:function(e,t){const n=e.getUint16(t,!1);t+=2;const r=new Array(n);for(let s=0;s<n;s++,t+=2)r[s]=e.getUint16(t,!1);return[t,String.fromCharCode.apply(String,r)]},decodeLength:function(e,t){return t+2+2*e.getUint16(t)}});class H{constructor(e,t,n,r){this.ObjectNumber=e,this.Name=t,this.ClassID=n,this.ClassVersion=r}}const W=l({ObjectNumber:d,Name:z,ClassID:q,ClassVersion:c},H);class K{constructor(e,t,n){this.Manufacturer=e,this.Name=t,this.Version=n}}const $=l({Manufacturer:z,Name:z,Version:z},K);class X{constructor(e,t,n){this.Reserved=e,this.MfrCode=t,this.ModelCode=n}}const Y=l({Reserved:E(1),MfrCode:E(3),ModelCode:E(4)},X),Q=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,0|n),t+1},decode:function(e,t){return e.getUint8(t)}});function J(e,t){const n=t.encodeTo,r=t.decode,s=a({isConstantLength:!0,encodedLength:t.encodedLength,encodeTo:function(t,r,s){if("object"==typeof s&&s instanceof e)s=s.value;else if("string"==typeof s)s=e.getValue(s);else{if("number"!=typeof s)throw new TypeError("Unsupported type.");e.getName(s)}return n(t,r,s)},decode:function(t,n){const s=r(t,n);return new e(s)}});for(const t in e.values())Object.defineProperty(s,t,{get:function(){return e[t]},enumerable:!1,configurable:!0});return s}function Z(e){return J(e,Q)}class ee extends(D({PowerOn:0,InternalError:1,Upgrade:2,ExternalRequest:3})){}const te=Z(ee);class ne{constructor(e,t,n){this.object=e,this.id=t,this.handlers=new Set,this.result=null,this.argumentTypes=n}GetOcaEvent(){return new g(this.object.ObjectNumber,this.id)}do_subscribe(){}do_unsubscribe(){}subscribe(e){return this.handlers.add(e),1===this.handlers.size?this.result=this.do_subscribe().then(()=>(this.result=null,!0)):null!==this.result?this.result:Promise.resolve(!0)}unsubscribe(e){return this.handlers.delete(e),this.handlers.size||this.do_unsubscribe().catch((function(){})),Promise.resolve(!0)}Dipose(){this.handlers.clear(),this.handlers.size&&this.do_unsubscribe().catch((function(){}))}}const re=new ArrayBuffer;class se extends ne{constructor(e,n,r){super(e,n,r),this.callback=e=>{if(!this.handlers.size)return;const n=new Array(r.length),s=new DataView(e.parameters||re);for(let e=0,t=0;t<r.length;t++){let o;[e,o]=r[t].decodeFrom(s,e),n[t]=o}const o=this.object;this.handlers.forEach((function(e){try{e.apply(o,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.device.add_subscription(this.GetOcaEvent(),this.callback)}do_unsubscribe(e){return this.object.device.remove_subscription(this.GetOcaEvent(),this.callback)}}class oe extends ne{constructor(e,n,r){super(e,n,r),this.callback=([n,s,o])=>{if(n.DefLevel!==this.id.DefLevel||n.PropertyIndex!==this.id.PropertyIndex)return;const i=r[0].decodeFrom(s,0)[1];this.handlers.forEach((function(r){try{r.call(e,i,o,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.OnPropertyChanged.subscribe(this.callback)}do_unsubscribe(e){return this.object.OnPropertyChanged.unsubscribe(this.callback)}}class ie extends(D({CurrentChanged:1,MinChanged:2,MaxChanged:3,ItemAdded:4,ItemChanged:5,ItemDeleted:6})){}class ae{init(e){this.o=e,this.values=[],this.synchronized=!1,this.subscriptions=[]}sync(){if(this.synchronized)return Promise.resolve();let e=0;const t=[];return this.o.get_properties().forEach(n=>{const r=n.getter(this.o);if(!r)return;const s=n.event(this.o);if(s){const n=function(e,t,n){n===ie.CurrentChanged&&(this.values[e]=t)}.bind(this,e);this.subscriptions.push(s.unsubscribe.bind(s,n)),t.push(s.subscribe(n).catch((function(){})))}t.push(r().then(function(e,t){t instanceof v&&(t=t.item(0)),this.values[e]=t}.bind(this,e),(function(){}))),e++}),Promise.all(t)}forEach(e,t){let n=0;t||(t=this),this.o.get_properties().forEach(r=>{r.getter(this.o)&&(e.call(t,this.values[n],r.name),n++)})}Dispose(){this.o=null,this.subscriptions.forEach(e=>e()),this.subscriptions=null}}class ce{constructor(e,t){this.DefLevel=e,this.PropertyIndex=t}}class le{constructor(e,t,n){const r=new Map,s=[];this.by_name=r,this.parent=n,this.properties=s,this.level=t;for(let t=0;t<e.length;t++){const n=e[t];if(r.set(n.name,n),s[n.index]=n,n.aliases){const e=n.aliases;for(let t=0;t<e.length;t++)r.set(e[t],n)}}}find_property(e){if(e instanceof ce){if(e.DefLevel==this.level)return this.properties[e.PropertyIndex];if(this.parent)return this.parent.find_property(e)}else{if("string"!=typeof e)throw new Error("Expected PropertyID");{const t=this.by_name.get(e);if(t)return t;if(this.parent)return this.parent.find_property(e)}}}find_name(e){const t=this.find_property(e);if(t)return t.name}forEach(e,t){const n=this.parent?this.parent.forEach(e,t):[],r=this.properties;for(let s=0;s<r.length;s++){const o=r[s];void 0!==o&&n.push(e.call(t,o))}return n}}class ue{constructor(e,t,n,r,s,o,i,a){this.name=e,this.type=t,this.level=n,this.index=r,this.readonly=s,this.static=o,this.aliases=i,i||a||o||(a={get:"Get"+e}),this.accessors=a}GetPropertyID(){return new ce(this.level,this.index)}GetName(){return this.name}getter(e,t){let n=this.name,r=0;const s=this.aliases,o=this.accessors;if(o){const n=o.get;if(!n)return null;let r;if("string"==typeof n)r=e[n];else{if("object"!=typeof n)throw new Error("Unexpected accessor.");{const{name:t,index:s}=n;r=s>=0?function(e){if("function"!=typeof e)return this[t]().then(e=>e.item(s));this[t]((t,n)=>{t&&(n=n.item(s)),e(t,n)})}:e[t]}}return r?t?r:r.bind(e):null}if(this.static){const t=e.constructor[n];if(void 0!==t)return function(){return Promise.resolve(t)}}else{const r=e["Get"+n];if(r)return t?r:r.bind(e)}return s&&r<s.length&&(n=s[r++]),null}setter(e,t){if(this.readonly||this.static)return null;let n=this.name,r=0;const s=this.aliases;{const o=e["Set"+n];if(o)return t?o:o.bind(e);s&&r<s.length&&(n=s[r++])}return null}event(e){let t=this.name,n=0;const r=this.aliases;{const s=e["On"+t+"Changed"];if(s)return s;r&&n<r.length&&(t=r[n++])}return null}subscribe(e,n){const r=this.event(e),s=this.getter(e);return r&&r.subscribe(n).catch(t),s&&s().then(n,t),r||!!s}}function he(e,t){if(!t||!t.length)return;const[n,r,o,a,c]=t;e.prototype[n]=function(...e){const t=a.length;let n=null;t<e.length&&t+1===e.length&&"function"==typeof e[t]&&(n=e[t],e.length=t);const l=new i(this.ono,r,o,t,new s(a,e));return this.device.send_command(l,c,n)}}function de(e,t){const[n,r,s,o]=t;Object.defineProperty(e.prototype,"On"+n,{get:function(){const e="_On"+n,t=this[e];return t||(this[e]=new se(this,new u(r,s),o))}})}function ge(e,t){t.static||"ObjectNumber"!==t.name&&Object.defineProperty(e.prototype,"On"+t.name+"Changed",{get:function(){const e="_On"+t.name+"Changed",n=this[e];return n||(this[e]=new oe(this,new ce(t.level,t.index),t.type))}})}function fe(e){if("object"==typeof e&&e instanceof ue)return e;if(Array.isArray(e))return"object"!=typeof e[1]&&(e[1]=function(e){throw new Error("Not implemented.")}(e[1])),new ue(...e);throw new Error("Bad property.")}function pe(e,t,n,r,s,o,i,a){let c=null,l=null;i=i.map(e=>fe(e));const u=class extends s{static get ClassID(){return n}static get ClassVersion(){return r}static get ClassName(){return e}static get_properties(){return null===l&&(l=new le(i,t,s.get_properties())),l}static GetPropertySync(){return null===c&&(c=function(e){const t=Object.create(ae.prototype),n=Object.create(e.prototype);let r=0;e.get_properties().forEach(e=>{const s=!!e.setter(n,!0);if(!e.getter(n,!0))return;const o={enumerable:!0,get:(i=r,function(){return this.values[i]})};var i,a;s&&(o.set=(a=e.setter(n,!0),function(e){return a.call(this.o,e),e})),Object.defineProperty(t,e.name,o),r++});const s=function(e){this.init(e)};return s.prototype=t,s}(this)),c}constructor(e,t){super(e,t);for(let e=0;e<i.length;e++){this["_On"+i[e].name+"Changed"]=null}for(let e=0;e<a.length;e++){this["_On"+a[e][0]]=null}}Dispose(){super.Dispose();for(let e=0;e<i.length;e++){const t=this["_On"+i[e].name+"Changed"];t&&t.Dispose()}for(let e=0;e<a.length;e++){const t=this["_On"+a[e][0]];t&&t.Dispose()}}};for(let e=0;e<o.length;e++)he(u,o[e]);for(let e=0;e<i.length;e++)ge(u,i[e]);for(let e=0;e<a.length;e++)de(u,a[e]);return u}class me{constructor(e,t){this.ClassID=e,this.ClassVersion=t}}const Se=l({ClassID:q,ClassVersion:c},me),ye=l({DefLevel:c,PropertyIndex:c},ce),be=Z(ie);function Oe(...e){const t=e.length;return a({isConstantLength:!1,encodedLength:function(n){if(!Array.isArray(n)&&!U(n))throw new TypeError("Expected array.");if(n.length!==t)throw new Error("Length mismatch.");let r=0;for(let s=0;s<t;s++)r+=e[s].encodedLength(n[s]);return r},encodeTo:function(n,r,s){for(let o=0;o<t;o++)r=e[o].encodeTo(n,r,s[o]);return r},decodeFrom:function(n,r){const s=new Array(t);for(let o=0;o<t;o++){let t;[r,t]=e[o].decodeFrom(n,r),s[o]=t}return[r,s]},decodeLength:function(n,r){for(let s=0;s<t;s++)r=e[s].decodeLength(n,r);return r}})}const we=Oe(ye,(Ce=1,a({isConstantLength:!1,encodedLength:function(e){if(!("object"==typeof e&&e instanceof DataView))throw new TypeError("Expected DataView.");return e.byteLength-Ce},encodeTo:function(e,t,n){const r=n.byteLength,s=new Uint8Array(n.buffer,n.byteOffset,r);return new Uint8Array(e.buffer,e.byteOffset+t).set(s),t+r},decodeFrom:function(e,t){const n=e.byteLength-t-Ce;return[t+n,new DataView(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+(e.byteLength-t-Ce)}})),be);var Ce;const _e=pe("OcaRoot",1,"",2,class{constructor(e,t){this.ono=e,this.device=t}get ObjectNumber(){return this.ono}get ClassVersion(){return this.constructor.ClassVersion}get ClassID(){return this.constructor.ClassID}get ClassName(){return this.constructor.ClassName}sendCommandRrq(e,t,n,r,s){const o=new i(this.ono,e,t,n,r);return this.device.send_command(o,s)}GetPropertyName(e){return this.get_properties().find_name(e)}GetPropertyID(e){const t=this.get_properties().find_property(e);if(t)return t.GetPropertyID()}static get_properties(){return null}get_properties(){return this.constructor.get_properties()}get __oca_properties__(){return this.get_properties()}GetPropertySync(){return new(this.constructor.GetPropertySync())(this)}Dispose(){}},[["GetClassIdentification",1,1,[],[Se]],["GetLockable",1,2,[],[k]],["LockTotal",1,3,[],[]],["Unlock",1,4,[],[]],["GetRole",1,5,[],[z]],["LockReadonly",1,6,[],[]]],[["ClassID",[q],1,1,!0,!0,null],["ClassVersion",[c],1,2,!0,!0,null],["ObjectNumber",[d],1,3,!0,!1,null],["Lockable",[k],1,4,!0,!1,null],["Role",[z],1,5,!0,!1,null]],[["PropertyChanged",1,1,[we]]]),Pe=pe("OcaManager",2,"",2,_e,[],[],[]),ve=pe("OcaDeviceManager",3,"",2,Pe,[["GetOcaVersion",3,1,[],[c]],["GetModelGUID",3,2,[],[Y]],["GetSerialNumber",3,3,[],[z]],["GetDeviceName",3,4,[],[z]],["SetDeviceName",3,5,[z],[]],["GetModelDescription",3,6,[],[$]],["GetDeviceRole",3,7,[],[z]],["SetDeviceRole",3,8,[z],[]],["GetUserInventoryCode",3,9,[],[z]],["SetUserInventoryCode",3,10,[z],[]],["GetEnabled",3,11,[],[k]],["SetEnabled",3,12,[k],[]],["GetState",3,13,[],[N]],["SetResetKey",3,14,[E(16),L],[]],["GetResetCause",3,15,[],[te]],["ClearResetCause",3,16,[],[]],["GetMessage",3,17,[],[z]],["SetMessage",3,18,[z],[]],["GetManagers",3,19,[],[R(W)]],["GetDeviceRevisionID",3,20,[],[z]]],[["ModelGUID",[Y],3,1,!1,!1,null],["SerialNumber",[z],3,2,!1,!1,null],["ModelDescription",[$],3,3,!1,!1,null],["DeviceName",[z],3,4,!1,!1,null],["OcaVersion",[c],3,5,!1,!1,null],["DeviceRole",[z],3,6,!1,!1,null],["UserInventoryCode",[z],3,7,!1,!1,null],["Enabled",[k],3,8,!1,!1,null],["State",[N],3,9,!1,!1,null],["Busy",[k],3,10,!1,!1,null],["ResetCause",[te],3,11,!1,!1,null],["Message",[z],3,12,!1,!1,null],["Managers",[R(W)],3,13,!1,!1,null],["DeviceRevisionID",[z],3,14,!0,!1,null]],[]),Ge=pe("OcaSecurityManager",3,"",2,Pe,[["AddPreSharedKey",3,4,[z,L],[]],["ChangePreSharedKey",3,3,[z,L],[]],["DeletePreSharedKey",3,5,[z],[]],["DisableControlSecurity",3,2,[],[]],["EnableControlSecurity",3,1,[],[]]],[["secureControlData",[k],3,1,!1,!1,null]],[]);class De extends(D({BootLoader:0})){}const Te=J(De,c);class Me{constructor(e,t,n,r){this.Major=e,this.Minor=t,this.Build=n,this.Component=r}}const Ie=l({Major:d,Minor:d,Build:d,Component:Te},Me),Ae=pe("OcaFirmwareManager",3,"",2,Pe,[["GetComponentVersions",3,1,[],[R(Ie)]],["StartUpdateProcess",3,2,[],[]],["BeginActiveImageUpdate",3,3,[Te],[]],["AddImageData",3,4,[d,L],[]],["VerifyImage",3,5,[L],[]],["EndActiveImageUpdate",3,6,[],[]],["BeginPassiveComponentUpdate",3,7,[Te,L,z],[]],["EndUpdateProcess",3,8,[],[]]],[["ComponentVersions",[R(Ie)],3,1,!1,!1,null]],[]);class Le{constructor(e,t){this.DefLevel=e,this.MethodIndex=t}}const Ee=l({DefLevel:c,MethodIndex:c},Le);class ke{constructor(e,t){this.ONo=e,this.MethodID=t}}const xe=l({ONo:d,MethodID:Ee},ke);class Ne extends(D({Reliable:1,Fast:2})){}const Ue=Z(Ne);class Re{constructor(e){this.objectList=e}}const Fe=l({objectList:R(d)},Re);class Be extends(D({Normal:1,EventsDisabled:2})){}const Ve=Z(Be),je=pe("OcaSubscriptionManager",3,"",2,Pe,[["RemoveSubscription",3,2,[f,xe],[]],["AddSubscription",3,1,[f,xe,L,Ue,L],[]],["DisableNotifications",3,3,[],[]],["ReEnableNotifications",3,4,[],[]],["AddPropertyChangeSubscription",3,5,[d,ye,xe,L,Ue,L],[]],["RemovePropertyChangeSubscription",3,6,[d,ye,xe],[]],["GetMaximumSubscriberContextLength",3,7,[],[c]]],[["State",[Ve],3,1,!1,!1,null]],[["NotificationsDisabled",3,1,[]],["SynchronizeState",3,2,[Fe]]]);class ze extends(D({None:0,Working:1,Standby:2,Off:3})){}const qe=Z(ze),He=pe("OcaPowerManager",3,"",2,Pe,[["GetState",3,1,[],[qe]],["SetState",3,2,[qe],[]],["GetPowerSupplies",3,3,[],[R(d)]],["GetActivePowerSupplies",3,4,[],[R(d)]],["ExchangePowerSupply",3,5,[d,d,k],[]],["GetAutoState",3,6,[],[k]]],[["State",[qe],3,1,!1,!1,null],["PowerSupplies",[R(d)],3,2,!1,!1,null],["ActivePowerSupplies",[R(d)],3,3,!1,!1,null],["AutoState",[k],3,4,!1,!1,null],["TargetState",[qe],3,5,!1,!1,null]],[]),We=pe("OcaNetworkManager",3,"",2,Pe,[["GetNetworks",3,1,[],[R(d)]],["GetStreamNetworks",3,2,[],[R(d)]],["GetControlNetworks",3,3,[],[R(d)]],["GetMediaTransportNetworks",3,4,[],[R(d)]]],[["Networks",[R(d)],3,1,!1,!1,null],["StreamNetworks",[R(d)],3,2,!1,!1,null],["ControlNetworks",[R(d)],3,3,!1,!1,null],["MediaTransportNetworks",[R(d)],3,4,!1,!1,null]],[]);class Ke extends(D({None:0,Internal:1,Network:2,External:3})){}const $e=Z(Ke),Xe=pe("OcaMediaClockManager",3,"",2,Pe,[["GetClocks",3,1,[],[R(d)]],["GetMediaClockTypesSupported",3,2,[],[R($e)]],["GetClock3s",3,3,[],[R(d)]]],[["ClockSourceTypesSupported",[R($e)],3,1,!1,!1,["MediaClockTypesSupported"]],["Clocks",[R(d)],3,2,!1,!1,null],["Clock3s",[R(d)],3,3,!1,!1,null]],[]);class Ye{constructor(e,t){this.Library=e,this.ID=t}}const Qe=l({Library:d,ID:d},Ye);class Je{constructor(e,t){this.Authority=e,this.ID=t}}const Ze=l({Authority:E(3),ID:d},Je);class et{constructor(e,t){this.Type=e,this.ONo=t}}const tt=l({Type:Ze,ONo:d},et),nt=pe("OcaLibraryManager",3,"\b",2,Pe,[["AddLibrary",3,1,[Ze],[tt]],["DeleteLibrary",3,2,[d],[]],["GetLibraryCount",3,3,[Ze],[c]],["GetLibraryList",3,4,[Ze],[R(tt)]],["GetCurrentPatch",3,5,[],[Qe]],["ApplyPatch",3,6,[Qe],[]]],[["Libraries",[R(tt)],3,1,!1,!1,null],["CurrentPatch",[Qe],3,2,!1,!1,null]],[]),rt=pe("OcaAudioProcessingManager",3,"\t",2,Pe,[],[],[]),st="undefined"!=typeof BigInt,ot=st&&(BigInt(1)<<BigInt(64))-BigInt(1),it=st&&ot>>BigInt(1),at=st&&-it-BigInt(1),ct=st&&(BigInt(1)<<BigInt(55))-BigInt(1);st&&BigInt(1);function lt(){if(!st)throw new Error("Missing BigInt support")}const ut=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(lt(),!(n<=ot&&n>=0))throw new TypeError("Uint64 out of range.");return e.setBigUint64(t,BigInt(n),!1),t+8},decode:function(e,t){lt();const n=e.getBigUint64(t,!1);return n<=Number.MAX_SAFE_INTEGER?Number(n):n}});class ht{constructor(e,t,n){this.Negative=e,this.Seconds=t,this.Nanoseconds=n}}const dt=l({Negative:k,Seconds:ut,Nanoseconds:d},ht),gt=pe("OcaDeviceTimeManager",3,"\n",2,Pe,[["GetDeviceTimeNTP",3,1,[],[ut]],["SetDeviceTimeNTP",3,2,[ut],[]],["GetTimeSources",3,3,[],[R(d)]],["GetCurrentDeviceTimeSource",3,4,[],[d]],["SetCurrentDeviceTimeSource",3,5,[d],[]],["GetDeviceTimePTP",3,6,[],[dt]],["SetDeviceTimePTP",3,7,[dt],[]]],[["TimeSources",[R(d)],3,1,!1,!1,null],["CurrentDeviceTimeSource",[d],3,2,!1,!1,null]],[]);function ft(e,t){const n=e.encodedLength,r=e.encodeTo,s=e.decodeFrom,o=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r),t+=i(e)}),t},encodeTo:function(e,t,n){return e.setUint16(t,n.size),t+=2,n.forEach((n,s)=>{t=r(e,t,s),t=c(e,t,n)}),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let o=0;o<r;o++){let r,o;[t,r]=s(e,t),[t,o]=l(e,t),n.set(r,o)}if(n.size!==r)throw new Error("Key appeared twice in decoded Map.");return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=o(e,t),t=u(e,t);return t}})}class pt extends(D({Absolute:1,Relative:2})){}const mt=Z(pt);class St{constructor(e,t,n,r,s,o,i,a,c){this.ID=e,this.Label=t,this.ProgramID=n,this.GroupID=r,this.TimeMode=s,this.TimeSourceONo=o,this.StartTime=i,this.Duration=a,this.ApplicationSpecificParameters=c}}const yt=l({ID:d,Label:z,ProgramID:Qe,GroupID:c,TimeMode:mt,TimeSourceONo:d,StartTime:dt,Duration:dt,ApplicationSpecificParameters:L},St);class bt extends(D({None:0,Prepare:1,Enable:2,Start:3,Stop:4,Abort:5,Disable:6,Clear:7})){}const Ot=Z(bt);class wt extends(D({None:0,Enabled:1,Disabled:2})){}const Ct=Z(wt);class _t extends(D({None:0,NotPrepared:1,Disabled:2,Enabled:3,Running:4,Completed:5,Failed:6,Stopped:7,Aborted:8})){}const Pt=Z(_t);class vt{constructor(e,t,n){this.ID=e,this.State=t,this.ErrorCode=n}}const Gt=l({ID:d,State:Pt,ErrorCode:c},vt);class Dt{constructor(e,t,n){this.TaskID=e,this.ProgramID=t,this.Status=n}}const Tt=l({TaskID:d,ProgramID:Qe,Status:Gt},Dt),Mt=pe("OcaTaskManager",3,"\v",1,Pe,[["Enable",3,1,[k],[]],["ControlAllTasks",3,2,[Ot,L],[]],["ControlTaskGroup",3,3,[c,Ot,L],[]],["ControlTask",3,4,[d,Ot,L],[]],["GetState",3,5,[],[Ct]],["GetTaskStatuses",3,6,[],[Gt]],["GetTaskStatus",3,7,[d],[Gt]],["AddTask",3,8,[yt],[yt]],["GetTasks",3,9,[],[ft(d,yt)]],["GetTask",3,10,[d],[yt]],["SetTask",3,11,[d,yt],[]],["DeleteTask",3,12,[d],[]]],[["State",[Ct],3,1,!1,!1,null],["Tasks",[ft(d,yt)],3,2,!1,!1,null]],[["TaskStateChanged",3,1,[Tt]]]),It=pe("OcaCodingManager",3,"\f",1,Pe,[["GetAvailableEncodingSchemes",3,1,[],[ft(c,z)]],["GetAvailableDecodingSchemes",3,2,[],[ft(c,z)]]],[["AvailableEncodingSchemes",[ft(c,z)],3,1,!1,!1,null],["AvailableDecodingSchemes",[ft(c,z)],3,2,!1,!1,null]],[]),At=pe("OcaDiagnosticManager",3,"\r",1,Pe,[["GetLockStatus",3,1,[d],[z]]],[],[]);class Lt{constructor(e,t){this.ONo=e,this.ClassIdentification=t}}const Et=l({ONo:d,ClassIdentification:Se},Lt);class kt{constructor(e,t){this.MemberObjectIdentification=e,this.ContainerObjectNumber=t}}const xt=l({MemberObjectIdentification:Et,ContainerObjectNumber:d},kt);class Nt{constructor(e,t){this.Authority=e,this.ID=t}}const Ut=l({Authority:E(3),ID:d},Nt);class Rt{constructor(e,t){this.TargetBlockType=e,this.ParData=t}}const Ft=l({TargetBlockType:d,ParData:L},Rt);class Bt{constructor(e,t,n,r,s){this.ONo=e,this.ClassIdentification=t,this.ContainerPath=n,this.Role=r,this.Label=s}}const Vt=l({ONo:d,ClassIdentification:Se,ContainerPath:R(d),Role:z,Label:z},Bt),jt=x;class zt extends(D({Input:1,Output:2})){}const qt=Z(zt);class Ht{constructor(e,t){this.Mode=e,this.Index=t}}const Wt=l({Mode:qt,Index:c},Ht);class Kt{constructor(e,t,n){this.Owner=e,this.ID=t,this.Name=n}}const $t=l({Owner:d,ID:Wt,Name:z},Kt);class Xt{constructor(e,t){this.SourcePort=e,this.SinkPort=t}}const Yt=l({SourcePort:$t,SinkPort:$t},Xt);class Qt extends(D({Exact:0,Substring:1,Contains:2,ExactCaseInsensitive:3,SubstringCaseInsensitive:4,ContainsCaseInsensitive:5})){}const Jt=Z(Qt),Zt=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setFloat32(t,+n,!1),t+4},decode:function(e,t){return e.getFloat32(t,!1)}}),en=pe("OcaWorker",2,"",2,_e,[["GetEnabled",2,1,[],[k]],["SetEnabled",2,2,[k],[]],["AddPort",2,3,[z,qt],[Wt]],["DeletePort",2,4,[Wt],[]],["GetPorts",2,5,[],[R($t)]],["GetPortName",2,6,[Wt],[z]],["SetPortName",2,7,[Wt,z],[]],["GetLabel",2,8,[],[z]],["SetLabel",2,9,[z],[]],["GetOwner",2,10,[],[d]],["GetLatency",2,11,[],[Zt]],["SetLatency",2,12,[Zt],[]],["GetPath",2,13,[],[R(z),R(d)]]],[["Enabled",[k],2,1,!1,!1,null],["Ports",[R($t)],2,2,!1,!1,null],["Label",[z],2,3,!1,!1,null],["Owner",[d],2,4,!1,!1,null],["Latency",[Zt],2,5,!1,!1,null]],[]),tn=pe("OcaBlock",3,"",2,en,[["GetType",3,1,[],[d]],["ConstructMemberUsingFactory",3,3,[d],[d]],["DeleteMember",3,4,[d],[]],["GetMembers",3,5,[],[R(Et)]],["GetMembersRecursive",3,6,[],[R(xt)]],["AddSignalPath",3,7,[Yt],[c]],["DeleteSignalPath",3,8,[c],[]],["GetSignalPaths",3,9,[],[ft(c,Yt)]],["GetSignalPathsRecursive",3,10,[],[ft(c,Yt)]],["GetMostRecentParamSetIdentifier",3,11,[],[Qe]],["ApplyParamSet",3,12,[],[Qe]],["GetCurrentParamSetData",3,13,[],[Ft]],["StoreCurrentParamSetData",3,14,[Qe],[]],["GetGlobalType",3,15,[],[Ut]],["GetONoMap",3,16,[],[ft(d,d)]],["FindObjectsByRole",3,17,[z,Jt,q,jt],[R(Vt)]],["FindObjectsByRoleRecursive",3,18,[z,Jt,q,jt],[R(Vt)]],["FindObjectsByPath",3,20,[R(z),jt],[R(Vt)]],["FindObjectsByLabelRecursive",3,19,[z,Jt,q,jt],[R(Vt)]]],[["Type",[d],3,1,!0,!1,null],["Members",[R(Et)],3,2,!1,!1,null],["SignalPaths",[ft(c,Yt)],3,3,!1,!1,null],["MostRecentParamSetIdentifier",[Qe],3,4,!1,!1,null],["GlobalType",[Ut],3,5,!0,!1,null],["ONoMap",[ft(d,d)],3,6,!0,!1,null]],[]);const nn=pe("OcaActuator",3,"",2,en,[],[],[]);class rn extends(D({Muted:1,Unmuted:2})){}const sn=Z(rn),on=pe("OcaMute",4,"",2,nn,[["GetState",4,1,[],[sn]],["SetState",4,2,[sn],[]]],[["State",[sn],4,1,!1,!1,null]],[]);class an extends(D({NonInverted:1,Inverted:2})){}const cn=Z(an),ln=pe("OcaPolarity",4,"",2,nn,[["GetState",4,1,[],[cn]],["SetState",4,2,[cn],[]]],[["State",[cn],4,1,!1,!1,null]],[]),un=pe("OcaSwitch",4,"",2,nn,[["GetPosition",4,1,[],[c,c,c]],["SetPosition",4,2,[c],[]],["GetPositionName",4,3,[c],[z]],["SetPositionName",4,4,[c,z],[]],["GetPositionNames",4,5,[],[R(z)]],["SetPositionNames",4,6,[R(z)],[]],["GetPositionEnabled",4,7,[c],[k]],["SetPositionEnabled",4,8,[c,k],[]],["GetPositionEnableds",4,9,[],[R(k)]],["SetPositionEnableds",4,10,[R(k)],[]]],[["Position",[c],4,1,!1,!1,null],["PositionNames",[R(z)],4,2,!1,!1,null],["PositionEnableds",[R(k)],4,3,!1,!1,null]],[]),hn=pe("OcaGain",4,"",2,nn,[["GetGain",4,1,[],[Zt,Zt,Zt]],["SetGain",4,2,[Zt],[]]],[["Gain",[Zt],4,1,!1,!1,null]],[]),dn=pe("OcaPanBalance",4,"",2,nn,[["GetPosition",4,1,[],[Zt,Zt,Zt]],["SetPosition",4,2,[Zt],[]],["GetMidpointGain",4,3,[],[Zt,Zt,Zt]],["SetMidpointGain",4,4,[Zt],[]]],[["Position",[Zt],4,1,!1,!1,null],["MidpointGain",[Zt],4,2,!1,!1,null]],[]),gn=pe("OcaDelay",4,"",2,nn,[["GetDelayTime",4,1,[],[Zt,Zt,Zt]],["SetDelayTime",4,2,[Zt],[]]],[["DelayTime",[Zt],4,1,!1,!1,null]],[]);class fn extends(D({Time:1,Distance:2,Samples:3,Microseconds:4,Milliseconds:5,Centimeters:6,Inches:7,Feet:8})){}const pn=Z(fn);class mn{constructor(e,t){this.DelayValue=e,this.DelayUnit=t}}const Sn=l({DelayValue:Zt,DelayUnit:pn},mn),yn=pe("OcaDelayExtended",5,"",2,gn,[["GetDelayValue",5,1,[],[Sn,Sn,Sn]],["SetDelayValue",5,2,[Sn],[]],["GetDelayValueConverted",5,3,[pn],[Sn]]],[["DelayValue",[Sn],5,1,!1,!1,null]],[]),bn=pe("OcaFrequencyActuator",4,"\b",2,nn,[["GetFrequency",4,1,[],[Zt,Zt,Zt]],["SetFrequency",4,2,[Zt],[]]],[["Frequency",[Zt],4,1,!1,!1,null]],[]);class On extends(D({Butterworth:1,Bessel:2,Chebyshev:3,LinkwitzRiley:4})){}const wn=Z(On);class Cn extends(D({HiPass:1,LowPass:2,BandPass:3,BandReject:4,AllPass:5})){}const _n=Z(Cn),Pn=x,vn=pe("OcaFilterClassical",4,"\t",2,nn,[["GetFrequency",4,1,[],[Zt,Zt,Zt]],["SetFrequency",4,2,[Zt],[]],["GetPassband",4,3,[],[_n]],["SetPassband",4,4,[_n],[]],["GetShape",4,5,[],[wn]],["SetShape",4,6,[wn],[]],["GetOrder",4,7,[],[c,c,c]],["SetOrder",4,8,[c],[]],["GetParameter",4,9,[],[Zt,Zt,Zt]],["SetParameter",4,10,[Zt],[]],["SetMultiple",4,11,[Pn,Zt,_n,wn,c,Zt],[]]],[["Frequency",[Zt],4,1,!1,!1,null],["Passband",[_n],4,2,!1,!1,null],["Shape",[wn],4,3,!1,!1,null],["Order",[c],4,4,!1,!1,null],["Parameter",[Zt],4,5,!1,!1,null]],[]);class Gn extends(D({None:0,PEQ:1,LowShelv:2,HighShelv:3,LowPass:4,HighPass:5,BandPass:6,AllPass:7,Notch:8,ToneControlLowFixed:9,ToneControlLowSliding:10,ToneControlHighFixed:11,ToneControlHighSliding:12})){}const Dn=Z(Gn),Tn=pe("OcaFilterParametric",4,"\n",2,nn,[["GetFrequency",4,1,[],[Zt,Zt,Zt]],["SetFrequency",4,2,[Zt],[]],["GetShape",4,3,[],[Dn]],["SetShape",4,4,[Dn],[]],["GetWidthParameter",4,5,[],[Zt,Zt,Zt]],["SetWidthParameter",4,6,[Zt],[]],["GetInbandGain",4,7,[],[Zt,Zt,Zt]],["SetInbandGain",4,8,[Zt],[]],["GetShapeParameter",4,9,[],[Zt,Zt,Zt]],["SetShapeParameter",4,10,[Zt],[]],["SetMultiple",4,11,[Pn,Zt,Dn,Zt,Zt,Zt],[]]],[["Frequency",[Zt],4,1,!1,!1,null],["Shape",[Dn],4,2,!1,!1,null],["WidthParameter",[Zt],4,3,!1,!1,["Q"]],["InbandGain",[Zt],4,4,!1,!1,null],["ShapeParameter",[Zt],4,5,!1,!1,null]],[]),Mn=pe("OcaFilterPolynomial",4,"\v",2,nn,[["GetCoefficients",4,1,[],[R(Zt),R(Zt)]],["SetCoefficients",4,2,[R(Zt),R(Zt)],[]],["GetSampleRate",4,3,[],[Zt,Zt,Zt]],["SetSampleRate",4,4,[Zt],[]],["GetMaxOrder",4,5,[],[Q]]],[["A",[R(Zt)],4,1,!1,!1,null,{get:{name:"GetCoefficients",index:0},set:{name:"SetCoefficients",index:0}}],["B",[R(Zt)],4,2,!1,!1,null,{get:{name:"GetCoefficients",index:1},set:{name:"SetCoefficients",index:1}}],["SampleRate",[Zt],4,3,!1,!1,null],["MaxOrder",[Q],4,4,!0,!1,null]],[]),In=pe("OcaFilterFIR",4,"\f",2,nn,[["GetLength",4,1,[],[d,d,d]],["GetCoefficients",4,2,[],[R(Zt)]],["SetCoefficients",4,3,[R(Zt)],[]],["GetSampleRate",4,4,[],[Zt,Zt,Zt]],["SetSampleRate",4,5,[Zt],[]]],[["Length",[d],4,1,!1,!1,null],["Coefficients",[R(Zt)],4,2,!1,!1,null],["SampleRate",[Zt],4,3,!1,!1,null]],[]);class An{constructor(e,t,n){this.Frequency=e,this.Amplitude=t,this.Phase=n}}const Ln=l({Frequency:R(Zt),Amplitude:R(Zt),Phase:R(Zt)},An),En=pe("OcaFilterArbitraryCurve",4,"\r",2,nn,[["GetTransferFunction",4,1,[],[Ln]],["SetTransferFunction",4,2,[Ln],[]],["GetSampleRate",4,3,[],[Zt,Zt,Zt]],["SetSampleRate",4,4,[Zt],[]],["GetTFMinLength",4,5,[],[c]],["GetTFMaxLength",4,6,[],[c]]],[["TransferFunction",[Ln],4,1,!1,!1,null],["SampleRate",[Zt],4,2,!1,!1,null],["TFMinLength",[c],4,3,!1,!1,null],["TFMaxLength",[c],4,4,!1,!1,null]],[]);class kn{constructor(e,t){this.Value=e,this.Ref=t}}const xn=l({Value:Zt,Ref:Zt},kn);class Nn extends(D({None:0,Compress:1,Limit:2,Expand:3,Gate:4})){}const Un=Z(Nn);class Rn extends(D({None:0,RMS:1,Peak:2})){}const Fn=Z(Rn);class Bn extends(D({dBu:0,dBV:1,V:2})){}const Vn=Z(Bn),jn=pe("OcaDynamics",4,"",2,nn,[["GetTriggered",4,1,[],[k]],["GetDynamicGain",4,2,[],[Zt]],["GetFunction",4,3,[],[Un]],["SetFunction",4,4,[Un],[]],["GetRatio",4,5,[],[Zt,Zt,Zt]],["SetRatio",4,6,[Zt],[]],["GetThreshold",4,7,[],[xn,Zt,Zt]],["SetThreshold",4,8,[xn],[]],["GetThresholdPresentationUnits",4,9,[],[Vn]],["SetThresholdPresentationUnits",4,10,[Vn],[]],["GetDetectorLaw",4,11,[],[Fn]],["SetDetectorLaw",4,12,[Fn],[]],["GetAttackTime",4,13,[],[Zt,Zt,Zt]],["SetAttackTime",4,14,[Zt],[]],["GetReleaseTime",4,15,[],[Zt,Zt,Zt]],["SetReleaseTime",4,16,[Zt],[]],["GetHoldTime",4,17,[],[Zt,Zt,Zt]],["SetHoldTime",4,18,[Zt],[]],["GetDynamicGainFloor",4,19,[],[Zt,Zt,Zt]],["SetDynamicGainFloor",4,20,[Zt],[]],["GetDynamicGainCeiling",4,21,[],[Zt,Zt,Zt]],["SetDynamicGainCeiling",4,22,[Zt],[]],["GetKneeParameter",4,23,[],[Zt,Zt,Zt]],["SetKneeParameter",4,24,[Zt],[]],["GetSlope",4,25,[],[Zt,Zt,Zt]],["SetSlope",4,26,[Zt],[]],["SetMultiple",4,27,[Pn,Un,xn,Vn,Fn,Zt,Zt,Zt,Zt,Zt,Zt,Zt],[]]],[["Triggered",[k],4,1,!1,!1,null],["DynamicGain",[Zt],4,2,!1,!1,null],["Function",[Un],4,3,!1,!1,null],["Ratio",[Zt],4,4,!1,!1,null],["Threshold",[xn],4,5,!1,!1,null],["ThresholdPresentationUnits",[Vn],4,6,!1,!1,null],["DetectorLaw",[Fn],4,7,!1,!1,null],["AttackTime",[Zt],4,8,!1,!1,null],["ReleaseTime",[Zt],4,9,!1,!1,null],["HoldTime",[Zt],4,10,!1,!1,null],["DynamicGainCeiling",[Zt],4,11,!1,!1,null],["DynamicGainFloor",[Zt],4,12,!1,!1,null],["KneeParameter",[Zt],4,13,!1,!1,null],["Slope",[Zt],4,14,!1,!1,null]],[]),zn=pe("OcaDynamicsDetector",4,"",2,nn,[["GetLaw",4,1,[],[Fn]],["SetLaw",4,2,[Fn],[]],["GetAttackTime",4,3,[],[Zt,Zt,Zt]],["SetAttackTime",4,4,[Zt],[]],["GetReleaseTime",4,5,[],[Zt,Zt,Zt]],["SetReleaseTime",4,6,[Zt],[]],["GetHoldTime",4,7,[],[Zt,Zt,Zt]],["SetHoldTime",4,8,[Zt],[]],["SetMultiple",4,9,[Pn,Fn,Zt,Zt,Zt],[]]],[["Law",[Fn],4,1,!1,!1,null],["AttackTime",[Zt],4,2,!1,!1,null],["ReleaseTime",[Zt],4,3,!1,!1,null],["HoldTime",[Zt],4,4,!1,!1,null]],[]),qn=pe("OcaDynamicsCurve",4,"",2,nn,[["GetNSegments",4,1,[],[Q,Q,Q]],["SetNSegments",4,2,[Q],[]],["GetThreshold",4,3,[],[R(xn),Zt,Zt]],["SetThreshold",4,4,[R(xn)],[]],["GetSlope",4,5,[],[R(Zt),R(Zt),R(Zt)]],["SetSlope",4,6,[R(Zt)],[]],["GetKneeParameter",4,7,[],[R(Zt),R(Zt),R(Zt)]],["SetKneeParameter",4,8,[R(Zt)],[]],["GetDynamicGainCeiling",4,9,[],[Zt,Zt,Zt]],["SetDynamicGainCeiling",4,10,[Zt],[]],["GetDynamicGainFloor",4,11,[],[Zt,Zt,Zt]],["SetDynamicGainFloor",4,12,[Zt],[]],["SetMultiple",4,13,[Pn,Q,R(xn),R(Zt),R(Zt),Zt,Zt],[]]],[["NSegments",[Q],4,1,!1,!1,null],["Threshold",[R(xn)],4,2,!1,!1,null],["Slope",[R(Zt)],4,3,!1,!1,null],["KneeParameter",[R(Zt)],4,4,!1,!1,null],["DynamicGainFloor",[Zt],4,5,!1,!1,null],["DynamicGainCeiling",[Zt],4,6,!1,!1,null]],[]);class Hn extends(D({Linear:1,Logarithmic:2,None:0})){}const Wn=Z(Hn);class Kn extends(D({None:0,DC:1,Sine:2,Square:3,Impulse:4,NoisePink:5,NoiseWhite:6,PolarityTest:7})){}const $n=Z(Kn),Xn=pe("OcaSignalGenerator",4,"",2,nn,[["GetFrequency1",4,1,[],[Zt,Zt,Zt]],["SetFrequency1",4,2,[Zt],[]],["GetFrequency2",4,3,[],[Zt,Zt,Zt]],["SetFrequency2",4,4,[Zt],[]],["GetLevel",4,5,[],[Zt,Zt,Zt]],["SetLevel",4,6,[Zt],[]],["GetWaveform",4,7,[],[$n]],["SetWaveform",4,8,[$n],[]],["GetSweepType",4,9,[],[Wn]],["SetSweepType",4,10,[Wn],[]],["GetSweepTime",4,11,[],[Zt,Zt,Zt]],["SetSweepTime",4,12,[Zt],[]],["GetSweepRepeat",4,13,[],[k]],["SetSweepRepeat",4,14,[k],[]],["GetGenerating",4,15,[],[k]],["Start",4,16,[],[]],["Stop",4,17,[],[]],["SetMultiple",4,18,[Pn,Zt,Zt,Zt,$n,Wn,Zt,k],[]]],[["Frequency1",[Zt],4,1,!1,!1,null],["Frequency2",[Zt],4,2,!1,!1,null],["Level",[Zt],4,3,!1,!1,null],["Waveform",[$n],4,4,!1,!1,null],["SweepType",[Wn],4,5,!1,!1,null],["SweepTime",[Zt],4,6,!1,!1,null],["SweepRepeat",[k],4,7,!1,!1,null],["Generating",[k],4,8,!1,!1,null]],[]),Yn=pe("OcaSignalInput",4,"",2,nn,[],[],[]),Qn=pe("OcaSignalOutput",4,"",2,nn,[],[],[]),Jn=pe("OcaTemperatureActuator",4,"",2,nn,[["GetTemperature",4,1,[],[Zt,Zt,Zt]],["SetTemperature",4,2,[Zt],[]]],[["Temperature",[Zt],4,1,!1,!1,null]],[]),Zn=pe("OcaIdentificationActuator",4,"",2,nn,[["GetActive",4,1,[],[k]],["SetActive",4,2,[k],[]]],[["Active",[k],4,1,!1,!1,null]],[]),er=pe("OcaSummingPoint",4,"",1,nn,[],[],[]),tr=pe("OcaBasicActuator",4,"",2,nn,[],[],[]),nr=pe("OcaBooleanActuator",5,"",2,tr,[["GetSetting",5,1,[],[k]],["SetSetting",5,2,[k],[]]],[["Setting",[k],5,1,!1,!1,null]],[]),rr=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setInt8(t,0|n),t+1},decode:function(e,t){return e.getInt8(t)}}),sr=pe("OcaInt8Actuator",5,"",2,tr,[["GetSetting",5,1,[],[rr,rr,rr]],["SetSetting",5,2,[rr],[]]],[["Setting",[rr],5,1,!1,!1,null]],[]),or=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setInt16(t,0|n,!1),t+2},decode:function(e,t){return e.getInt16(t,!1)}}),ir=pe("OcaInt16Actuator",5,"",2,tr,[["GetSetting",5,1,[],[or,or,or]],["SetSetting",5,2,[or],[]]],[["Setting",[or],5,1,!1,!1,null]],[]),ar=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setInt32(t,0|n,!1),t+4},decode:function(e,t){return e.getInt32(t,!1)}}),cr=pe("OcaInt32Actuator",5,"",2,tr,[["GetSetting",5,1,[],[ar,ar,ar]],["SetSetting",5,2,[ar],[]]],[["Setting",[ar],5,1,!1,!1,null]],[]);function lr(){if(!st)throw new Error("Missing BigInt support")}const ur=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(lr(),!(n>=at&&n<=it))throw new TypeError("Int64 out of range.");return e.setBigInt64(t,BigInt(n),!1),t+8},decode:function(e,t){lr();const n=e.getBigInt64(t,!1);return n>=Number.MIN_SAFE_INTEGER&&n<=Number.MAX_SAFE_INTEGER?Number(n):n}}),hr=pe("OcaInt64Actuator",5,"",2,tr,[["GetSetting",5,1,[],[ur,ur,ur]],["SetSetting",5,2,[ur],[]]],[["Setting",[ur],5,1,!1,!1,null]],[]),dr=pe("OcaUint8Actuator",5,"",2,tr,[["GetSetting",5,1,[],[Q,Q,Q]],["SetSetting",5,2,[Q],[]]],[["Setting",[Q],5,1,!1,!1,null]],[]),gr=pe("OcaUint16Actuator",5,"",2,tr,[["GetSetting",5,1,[],[c,c,c]],["SetSetting",5,2,[c],[]]],[["Setting",[c],5,1,!1,!1,null]],[]),fr=pe("OcaUint32Actuator",5,"\b",2,tr,[["GetSetting",5,1,[],[d,d,d]],["SetSetting",5,2,[d],[]]],[["Setting",[d],5,1,!1,!1,null]],[]),pr=pe("OcaUint64Actuator",5,"\t",2,tr,[["GetSetting",5,1,[],[ut,ut,ut]],["SetSetting",5,2,[ut],[]]],[["Setting",[ut],5,1,!1,!1,null]],[]),mr=pe("OcaFloat32Actuator",5,"\n",2,tr,[["GetSetting",5,1,[],[Zt,Zt,Zt]],["SetSetting",5,2,[Zt],[]]],[["Setting",[Zt],5,1,!1,!1,null]],[]),Sr=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){return e.setFloat64(t,+n,!1),t+8},decode:function(e,t){return e.getFloat64(t,!1)}}),yr=pe("OcaFloat64Actuator",5,"\v",2,tr,[["GetSetting",5,1,[],[Sr,Sr,Sr]],["SetSetting",5,2,[Sr],[]]],[["Setting",[Sr],5,1,!1,!1,null]],[]),br=pe("OcaStringActuator",5,"\f",2,tr,[["GetSetting",5,1,[],[z]],["SetSetting",5,2,[z],[]],["GetMaxLen",5,3,[],[c]]],[["Setting",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!0,!1,null]],[]);function Or(e){return e+7>>3}function wr(e,t,n){const r=new Array(n),s=Or(n),o=new Uint8Array(e.buffer,e.byteOffset+t,s);for(let e=0;e<n;e++)r[e]=!!(o[e>>3]&128>>(7&e));return r}const Cr=a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e))throw new TypeError("Expected Array.");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+(t+7>>3)},encodeTo:function(e,t,n){const r=n.length;return e.setUint16(t,r),function(e,t,n){const r=n.length,s=Or(r),o=new Uint8Array(e.buffer,e.byteOffset+t,s);for(let e=0,t=0;t<s;t++){let s=0;for(let t=0;t<8&&e<r;t++,e++)n[e]&&(s|=128>>t);o[t]=s}return t+s}(e,t+=2,n)},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+Or(n),wr(e,t,n)]},decodeLength:function(e,t){return t+2+Or(e.getUint16(t))}}),_r=pe("OcaBitstringActuator",5,"\r",2,tr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[k]],["SetBit",5,3,[c,k],[]],["GetBitstring",5,4,[],[Cr]],["SetBitstring",5,5,[Cr],[]]],[["Bitstring",[Cr],5,1,!1,!1,null]],[]);class Pr extends(D({Unknown:0,Valid:1,Underrange:2,Overrange:3,Error:4})){}const vr=Z(Pr),Gr=pe("OcaSensor",3,"",2,en,[["GetReadingState",3,1,[],[vr]]],[["ReadingState",[vr],3,1,!1,!1,null]],[]),Dr=pe("OcaLevelSensor",4,"",2,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]);class Tr extends(D({VU:1,StandardVU:2,PPM1:3,PPM2:4,LKFS:5,RMS:6,Peak:7,ProprietaryValueBase:128})){}const Mr=Z(Tr),Ir=pe("OcaAudioLevelSensor",5,"",2,Dr,[["GetLaw",5,1,[],[Mr]],["SetLaw",5,2,[Mr],[]]],[["Law",[Mr],5,1,!1,!1,null]],[]),Ar=pe("OcaTimeIntervalSensor",4,"",2,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]),Lr=pe("OcaFrequencySensor",4,"",2,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]),Er=pe("OcaTemperatureSensor",4,"",2,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]),kr=pe("OcaIdentificationSensor",4,"",2,Gr,[],[],[["Identify",4,1,[]]]),xr=pe("OcaVoltageSensor",4,"",1,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]),Nr=pe("OcaCurrentSensor",4,"\b",1,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]);class Ur{constructor(e,t){this.Magnitude=e,this.Phase=t}}const Rr=l({Magnitude:Zt,Phase:Zt},Ur),Fr=pe("OcaImpedanceSensor",4,"\t",1,Gr,[["GetReading",4,1,[],[Rr,Rr,Rr]]],[["Reading",[Rr],4,1,!1,!1,null]],[]),Br=pe("OcaGainSensor",4,"\n",1,Gr,[["GetReading",4,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],4,1,!1,!1,null]],[]),Vr=pe("OcaBasicSensor",4,"",2,Gr,[],[],[]),jr=pe("OcaBooleanSensor",5,"",2,Vr,[["GetReading",5,1,[],[k]]],[["Reading",[k],5,1,!1,!1,null]],[]),zr=pe("OcaInt8Sensor",5,"",2,Vr,[["GetReading",5,1,[],[rr,rr,rr]]],[["Reading",[rr],5,1,!1,!1,null]],[]),qr=pe("OcaInt16Sensor",5,"",2,Vr,[["GetReading",5,1,[],[or,or,or]]],[["Reading",[or],5,1,!1,!1,null]],[]),Hr=pe("OcaInt32Sensor",5,"",2,Vr,[["GetReading",5,1,[],[ar,ar,ar]]],[["Reading",[ar],5,1,!1,!1,null]],[]),Wr=pe("OcaInt64Sensor",5,"",2,Vr,[["GetReading",5,1,[],[ur,ur,ur]]],[["Reading",[ur],5,1,!1,!1,null]],[]),Kr=pe("OcaUint8Sensor",5,"",2,Vr,[["GetReading",5,1,[],[Q,Q,Q]]],[["Reading",[Q],5,1,!1,!1,null]],[]),$r=pe("OcaUint16Sensor",5,"",2,Vr,[["GetReading",5,1,[],[c,c,c]]],[["Reading",[c],5,1,!1,!1,null]],[]),Xr=pe("OcaUint32Sensor",5,"\b",2,Vr,[["GetReading",5,1,[],[d,d,d]]],[["Reading",[d],5,1,!1,!1,null]],[]),Yr=pe("OcaFloat32Sensor",5,"\n",2,Vr,[["GetReading",5,1,[],[Zt,Zt,Zt]]],[["Reading",[Zt],5,1,!1,!1,null]],[]),Qr=pe("OcaFloat64Sensor",5,"\v",2,Vr,[["GetReading",5,1,[],[Sr,Sr,Sr]]],[["Reading",[Sr],5,1,!1,!1,null]],[]),Jr=pe("OcaStringSensor",5,"\f",2,Vr,[["GetString",5,1,[],[z]],["GetMaxLen",5,2,[],[c]],["SetMaxLen",5,3,[c],[]]],[["String",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!1,!1,null]],[]),Zr=pe("OcaBitstringSensor",5,"\r",2,Vr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[Q]],["GetBitString",5,3,[],[Cr]]],[["BitString",[Cr],5,1,!1,!1,null]],[]),es=pe("OcaUint64Sensor",5,"\t",2,Vr,[["GetReading",5,1,[],[ut,ut,ut]]],[["Reading",[ut],5,1,!1,!1,null]],[]);class ts{constructor(e,t){this.POno=e,this.ClassIdentification=t}}const ns=l({POno:d,ClassIdentification:Se},ts);class rs{constructor(e,t){this.Mode=e,this.Index=t}}const ss=l({Mode:qt,Index:c},rs);class os{constructor(e,t,n){this.Owner=e,this.ProtoID=t,this.Name=n}}const is=l({Owner:d,ProtoID:ss,Name:z},os);class as{constructor(e,t){this.SourceProtoPort=e,this.SinkProtoPort=t}}const cs=l({SourceProtoPort:is,SinkProtoPort:is},as),ls=pe("OcaBlockFactory",3,"",2,en,[["DefineProtoPort",3,1,[z,qt],[ss]],["UndefineProtoPort",3,2,[ss],[]],["GetProtoPorts",3,3,[],[R(is)]],["DefineProtoMemberUsingFactory",3,5,[d],[d]],["UndefineProtoMember",3,6,[d],[]],["GetProtoMembers",3,7,[],[R(ns)]],["DefineProtoSignalPath",3,8,[cs],[c]],["UndefineProtoSignalPath",3,9,[],[c]],["GetProtoSignalPaths",3,10,[],[ft(c,cs)]],["GetGlobalType",3,11,[],[Ut]],["SetGlobalType",3,12,[Ut],[]]],[["ProtoPorts",[R(is)],3,1,!1,!1,null],["ProtoMembers",[R(ns)],3,2,!1,!1,null],["ProtoSignalPaths",[ft(c,cs)],3,3,!1,!1,null],["GlobalType",[Ut],3,4,!1,!1,null]],[]);function us(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!U(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");return 4+n*r*t},encodeTo:function(e,t,r){const s=r.length,o=0===s?0:r[0].length;e.setUint16(t,s),t+=2,e.setUint16(t,o),t+=2;for(let i=0;i<s;i++){const s=r[i];for(let r=0;r<o;r++)t=n(e,t,s[r])}return t},decodeFrom:function(e,n){const s=e.getUint16(n);n+=2;const o=e.getUint16(n);n+=2;const i=new Array(s).fill().map(()=>new Array(o));for(let a=0;a<s;a++){const s=i[a];for(let i=0;i<o;i++)s[i]=r(e,n),n+=t}return[n,i]},decodeLength:function(e,n){const r=e.getUint16(n);n+=2;const s=e.getUint16(n);return(n+=2)+r*s*t}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,s=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!U(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");let s=4;for(let o=0;o<n;o++){const n=e[o];for(let e=0;e<r;e++)s+=t(n[e])}return s},encodeTo:function(e,t,r){const s=r.length,o=0===s?0:r[0].length;e.setUint16(t,s),t+=2,e.setUint16(t,o),t+=2;for(let i=0;i<s;i++){const s=r[i];for(let r=0;r<o;r++)t=n(e,t,s[r])}return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const s=e.getUint16(t);t+=2;const o=new Array(n).fill().map(()=>new Array(s));for(let i=0;i<n;i++){const n=o[i];for(let o=0;o<s;o++){let s;[t,s]=r(e,t),n[o]=s}}return[t,o]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;const r=e.getUint16(t);t+=2;for(let o=0;o<n;o++)for(let n=0;n<r;n++)t=s(e,t);return t}})}(e)}const hs=pe("OcaMatrix",3,"",2,en,[["GetCurrentXY",3,1,[],[c,c]],["SetCurrentXY",3,2,[c,c],[]],["GetSize",3,3,[],[c,c,c,c,c,c]],["SetSize",3,4,[c,c],[]],["GetMembers",3,5,[],[us(d)]],["SetMembers",3,6,[us(d)],[]],["GetMember",3,7,[c,c],[d]],["SetMember",3,8,[c,c,d],[]],["GetProxy",3,9,[],[d]],["SetProxy",3,10,[d],[]],["GetPortsPerRow",3,11,[],[Q]],["SetPortsPerRow",3,12,[Q],[]],["GetPortsPerColumn",3,13,[],[Q]],["SetPortsPerColumn",3,14,[Q],[]],["SetCurrentXYLock",3,15,[c,c],[]],["UnlockCurrent",3,16,[],[]]],[["X",[c],3,1,!1,!1,null],["Y",[c],3,2,!1,!1,null],["xSize",[c],3,3,!1,!1,null],["ySize",[c],3,4,!1,!1,null],["Members",[us(d)],3,5,!1,!1,null],["Proxy",[d],3,6,!1,!1,null],["PortsPerRow",[Q],3,7,!1,!1,null],["PortsPerColumn",[Q],3,8,!1,!1,null]],[]),ds=pe("OcaAgent",2,"",2,_e,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetPath",2,4,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!1,null],["Owner",[d],2,2,!1,!1,null]],[]);class gs{constructor(e,t){this.HostID=e,this.ONo=t}}const fs=l({HostID:L,ONo:d},gs);class ps{constructor(e,t,n){this.Index=e,this.ObjectPath=t,this.Online=n}}const ms=l({Index:c,ObjectPath:fs,Online:k},ps);class Ss{constructor(e,t){this.GroupIndex=e,this.CitizenIndex=t}}const ys=l({GroupIndex:c,CitizenIndex:c},Ss);class bs{constructor(e,t,n){this.Index=e,this.Name=t,this.ProxyONo=n}}const Os=l({Index:c,Name:z,ProxyONo:d},bs);class ws extends(D({MasterSlave:1,PeerToPeer:2})){}const Cs=Z(ws);class _s extends(D({citizenAdded:1,citizenDeleted:2,citizenConnectionLost:3,citizenConnectionReEstablished:4,citizenError:5,enrollment:6,unEnrollment:7})){}const Ps=Z(_s);class vs{constructor(e,t,n){this.groupIndex=e,this.citizenIndex=t,this.changeType=n}}const Gs=l({groupIndex:c,citizenIndex:c,changeType:Ps},vs),Ds=pe("OcaGrouper",3,"",2,ds,[["AddGroup",3,1,[z],[c,d]],["DeleteGroup",3,2,[c],[]],["GetGroupCount",3,3,[],[c]],["GetGroupList",3,4,[],[R(Os)]],["AddCitizen",3,5,[ms],[c]],["DeleteCitizen",3,6,[c],[]],["GetCitizenCount",3,7,[],[c]],["GetCitizenList",3,8,[],[R(ms)]],["GetEnrollment",3,9,[ys],[k]],["SetEnrollment",3,10,[ys,k],[]],["GetGroupMemberList",3,11,[c],[R(ms)]],["GetActuatorOrSensor",3,12,[],[k]],["SetActuatorOrSensor",3,13,[k],[]],["GetMode",3,14,[],[Cs]],["SetMode",3,15,[Cs],[]]],[["ActuatorOrSensor",[k],3,1,!1,!1,null],["Groups",[R(Os)],3,2,!1,!1,["GroupList"]],["Citizens",[R(ms)],3,3,!1,!1,["CitizenList"]],["Enrollments",[R(ys)],3,4,!1,!1,["EnrollmentList"]],["Mode",[Cs],3,5,!1,!1,null]],[["StatusChange",3,1,[Gs]]]);class Ts extends(D({None:0,OcaBoolean:1,OcaInt8:2,OcaInt16:3,OcaInt32:4,OcaInt64:5,OcaUint8:6,OcaUint16:7,OcaUint32:8,OcaUint64:9,OcaFloat32:10,OcaFloat64:11,OcaString:12,OcaBitstring:13,OcaBlob:14,OcaBlobFixedLen:15,OcaBit:16})){}const Ms=Z(Ts);class Is{constructor(e,t,n,r){this.PropertyID=e,this.BaseDataType=t,this.GetterMethodID=n,this.SetterMethodID=r}}const As=l({PropertyID:ye,BaseDataType:Ms,GetterMethodID:Ee,SetterMethodID:Ee},Is);class Ls{constructor(e,t){this.ONo=e,this.Descriptor=t}}const Es=l({ONo:d,Descriptor:As},Ls);class ks extends(D({Enable:1,Start:2,Halt:3})){}const xs=Z(ks);class Ns extends(D({Linear:1,ReverseLinear:2,Sine:3,Exponential:4})){}const Us=Z(Ns);class Rs extends(D({NotInitialized:1,Iniitialized:2,Scheduled:3,Enabled:4,Ramping:5})){}const Fs=Z(Rs),Bs=pe("OcaRamper",3,"",2,ds,[["Control",3,1,[xs],[]],["GetState",3,2,[],[Fs]],["GetRampedProperty",3,3,[],[Es]],["SetRampedProperty",3,4,[Es],[]],["GetTimeMode",3,5,[],[mt]],["SetTimeMode",3,6,[mt],[]],["GetStartTime",3,7,[],[ut]],["SetStartTime",3,8,[ut],[]],["GetDuration",3,9,[],[Zt,Zt,Zt]],["SetDuration",3,10,[Zt],[]],["GetInterpolationLaw",3,11,[],[Us]],["SetInterpolationLaw",3,12,[Us],[]],["GetGoal",3,13,[],[Sr]],["SetGoal",3,14,[Sr],[]]],[["State",[Fs],3,1,!1,!1,null],["RampedProperty",[Es],3,2,!1,!1,null],["TimeMode",[mt],3,3,!1,!1,null],["StartTime",[ut],3,4,!1,!1,null],["Duration",[Zt],3,5,!1,!1,null],["InterpolationLaw",[Us],3,6,!1,!1,null],["Goal",[Sr],3,7,!1,!1,null]],[]);class Vs{constructor(e){this.Reading=e}}const js=l({Reading:Sr},Vs);class zs extends(D({NotTriggered:0,Triggered:1})){}const qs=Z(zs);class Hs extends(D({None:0,Equality:1,Inequality:2,GreaterThan:3,GreaterThanOrEqual:4,LessThan:5,LessThanOrEqual:6})){}const Ws=Z(Hs),Ks=pe("OcaNumericObserver",3,"",2,ds,[["GetLastObservation",3,1,[],[Sr]],["GetState",3,2,[],[qs]],["GetObservedProperty",3,3,[],[Es]],["SetObservedProperty",3,4,[Es],[]],["GetThreshold",3,5,[],[Sr]],["SetThreshold",3,6,[Sr],[]],["GetOperator",3,7,[],[Ws]],["SetOperator",3,8,[Ws],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[Sr]],["SetHysteresis",3,12,[Sr],[]],["GetPeriod",3,13,[],[Zt]],["SetPeriod",3,14,[Zt],[]]],[["State",[qs],3,1,!1,!1,null],["ObservedProperty",[Es],3,2,!1,!1,null],["Threshold",[Sr],3,3,!1,!1,null],["Operator",[Ws],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[Sr],3,6,!1,!1,null],["Period",[Zt],3,7,!1,!1,null]],[["Observation",3,1,[js]]]);class $s extends(D({None:0,ReadOnly:1,ReadExpand:2,Full:3})){}const Xs=Z($s);class Ys{constructor(e,t,n,r,s,o){this.Name=e,this.VolType=t,this.Access=n,this.Version=r,this.Creator=s,this.UpDate=o}}const Qs=l({Name:z,VolType:Ze,Access:Xs,Version:d,Creator:z,UpDate:dt},Ys);class Js{constructor(e,t){this.Metadata=e,this.Data=t}}const Zs=l({Metadata:Qs,Data:L},Js);class eo{constructor(e,t){this.VolumeID=e,this.ChangeType=t}}const to=l({VolumeID:d,ChangeType:be},eo),no=pe("OcaLibrary",3,"",2,ds,[["AddVolume",3,1,[Zs],[d]],["ReplaceVolume",3,2,[d,Zs],[]],["DeleteVolume",3,3,[d],[]],["GetVolume",3,4,[d],[Zs]],["GetVolumeCount",3,5,[],[c]],["GetVolumes",3,6,[],[ft(d,Zs)]],["GetAccess",3,7,[],[Xs]],["SetAccess",3,8,[Xs],[]]],[["VolumeType",[Ze],3,1,!1,!1,null],["Access",[Xs],3,2,!1,!1,null],["Volumes",[ft(d,Zs)],3,3,!1,!1,null]],[["OcaLibVolChanged",3,1,[to]]]);class ro extends(D({Unspecified:1,Internal:2,External:3})){}const so=Z(ro);class oo extends(D({Off:0,Unavailable:1,Available:2,Active:3})){}const io=Z(oo);class ao extends(D({None:0,Mains:1,Battery:2,Phantom:3,Solar:4})){}const co=Z(ao),lo=pe("OcaPowerSupply",3,"",3,ds,[["GetType",3,1,[],[co]],["GetModelInfo",3,2,[],[z]],["GetState",3,3,[],[io]],["SetState",3,4,[io],[]],["GetCharging",3,5,[],[k]],["GetLoadFractionAvailable",3,6,[],[Zt]],["GetStorageFractionAvailable",3,7,[],[Zt]],["GetLocation",3,8,[],[so]]],[["Type",[co],3,1,!1,!1,null],["ModelInfo",[z],3,2,!1,!1,null],["State",[io],3,3,!1,!1,null],["Charging",[k],3,4,!1,!1,null],["LoadFractionAvailable",[Zt],3,5,!1,!1,null],["StorageFractionAvailable",[Zt],3,6,!1,!1,null],["Location",[so],3,7,!0,!1,null]],[]),uo=pe("OcaEventHandler",3,"\b",2,ds,[["OnEvent",3,1,[L,f],[]]],[],[]);class ho{constructor(e){this.Reading=e}}const go=l({Reading:R(Sr)},ho),fo=pe("OcaNumericObserverList",3,"\t",2,ds,[["GetLastObservation",3,1,[],[R(Sr)]],["GetState",3,2,[],[qs]],["GetObservedProperties",3,3,[],[R(Es)]],["SetObservedProperties",3,4,[R(Es)],[]],["GetThreshold",3,5,[],[Sr]],["SetThreshold",3,6,[Sr],[]],["GetOperator",3,7,[],[Ws]],["SetOperator",3,8,[Ws],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[Sr]],["SetHysteresis",3,12,[Sr],[]],["GetPeriod",3,13,[],[Zt]],["SetPeriod",3,14,[Zt],[]]],[["State",[qs],3,1,!1,!1,null],["ObservedProperties",[R(Es)],3,2,!1,!1,null],["Threshold",[Sr],3,3,!1,!1,null],["Operator",[Ws],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[Sr],3,6,!1,!1,null],["Period",[Zt],3,7,!1,!1,null]],[["Observation",3,1,[go]]]);class po extends(D({Unavailable:0,Available:1})){}const mo=Z(po);class So{constructor(e,t,n,r){this.NominalRate=e,this.PullRange=t,this.Accuracy=n,this.JitterMax=r}}const yo=l({NominalRate:Zt,PullRange:Zt,Accuracy:Zt,JitterMax:Zt},So),bo=pe("OcaMediaClock3",3,"",1,ds,[["GetAvailability",3,1,[],[mo]],["SetAvailability",3,2,[mo],[]],["GetCurrentRate",3,3,[],[yo,d]],["SetCurrentRate",3,4,[yo,d],[]],["GetOffset",3,5,[],[dt]],["SetOffset",3,6,[dt],[]],["GetSupportedRates",3,7,[],[ft(d,R(yo))]]],[["Availability",[mo],3,1,!1,!1,null],["TimeSourceONo",[d],3,2,!1,!1,null],["Offset",[dt],3,3,!1,!1,null],["CurrentRate",[yo],3,4,!1,!1,null],["SupportedRates",[ft(d,R(yo))],3,5,!1,!1,null]],[]);class Oo extends(D({Undefined:0,None:1,Private:2,NTP:3,SNTP:4,IEEE1588_2002:5,IEEE1588_2008:6,IEEE_AVB:7,AES11:8,Genlock:9})){}const wo=Z(Oo);class Co extends(D({Undefined:0,Local:1,Private:2,GPS:3,Galileo:4,GLONASS:5})){}const _o=Z(Co);class Po extends(D({Unavailable:0,Available:1})){}const vo=Z(Po);class Go extends(D({Undefined:0,Unsynchronized:1,Synchronizing:2,Synchronized:3})){}const Do=Z(Go),To=pe("OcaTimeSource",3,"",1,ds,[["GetAvailability",3,1,[],[vo]],["GetProtocol",3,2,[],[wo]],["SetProtocol",3,3,[wo],[]],["GetParameters",3,4,[],[z]],["SetParameters",3,5,[z],[]],["GetReferenceType",3,6,[],[_o]],["SetReferenceType",3,7,[_o],[]],["GetReferenceID",3,8,[],[z]],["SetReferenceID",3,9,[z],[]],["GetSyncStatus",3,10,[],[Do]],["Reset",3,11,[],[]]],[["Availability",[vo],3,1,!1,!1,null],["Protocol",[wo],3,2,!1,!1,null],["Parameters",[z],3,3,!1,!1,null],["ReferenceType",[_o],3,4,!1,!1,null],["ReferenceID",[z],3,5,!1,!1,null],["SyncStatus",[Do],3,6,!1,!1,null]],[]);class Mo extends(D({Robotic:1,ItuAudioObjectBasedPolar:2,ItuAudioObjectBasedCartesian:3,ItuAudioSceneBasedPolar:4,ItuAudioSceneBasedCartesian:5,NAV:6,ProprietaryBase:128})){}const Io=Z(Mo);const Ao=x;class Lo{constructor(e,t,n){this.CoordinateSystem=e,this.FieldFlags=t,this.Values=n}}const Eo=l({CoordinateSystem:Io,FieldFlags:Ao,Values:(ko=Zt,xo=6,Oe(...new Array(xo).fill(ko)))},Lo);var ko,xo;const No=pe("OcaPhysicalPosition",3,"",1,ds,[["GetCoordinateSystem",3,1,[],[Io]],["GetPositionDescriptorFieldFlags",3,2,[],[Ao]],["GetPositionDescriptor",3,3,[],[Eo,Eo,Eo]],["SetPositionDescriptor",3,4,[Eo],[]]],[["CoordinateSystem",[Io],3,1,!0,!1,null],["PositionDescriptorFieldFlags",[Ao],3,2,!0,!1,null],["PositionDescriptor",[Eo],3,3,!1,!1,null]],[]);class Uo extends(D({None:0,Prepare:1,Start:2,Pause:3,Stop:4,Reset:5})){}const Ro=Z(Uo);class Fo extends(D({Unknown:0,NotReady:1,Readying:2,Ready:3,Running:4,Paused:5,Stopping:6,Stopped:7,Fault:8})){}const Bo=Z(Fo);class Vo{constructor(e,t){this.SystemInterfaceParameters=e,this.MyNetworkAddress=t}}const jo=l({SystemInterfaceParameters:L,MyNetworkAddress:L},Vo),zo=pe("OcaApplicationNetwork",2,"",1,_e,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetServiceID",2,4,[],[L]],["SetServiceID",2,5,[L],[]],["GetSystemInterfaces",2,6,[],[R(jo)]],["SetSystemInterfaces",2,7,[R(jo)],[]],["GetState",2,8,[],[Bo]],["GetErrorCode",2,9,[],[c]],["Control",2,10,[Ro],[]],["GetPath",2,11,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!0,null],["Owner",[d],2,2,!1,!0,null],["ServiceID",[L],2,3,!1,!1,null],["SystemInterfaces",[R(jo)],2,4,!1,!1,null],["State",[Bo],2,5,!1,!1,null],["ErrorCode",[c],2,6,!1,!1,null]],[]);class qo extends(D({None:0,OCP01:1,OCP02:2,OCP03:3})){}const Ho=Z(qo),Wo=pe("OcaControlNetwork",3,"",1,zo,[["GetControlProtocol",3,1,[],[Ho]]],[["Protocol",[Ho],3,1,!1,!1,["ControlProtocol"]]],[]);class Ko{constructor(e,t,n){this.CodingSchemeID=e,this.CodecParameters=t,this.ClockONo=n}}const $o=l({CodingSchemeID:c,CodecParameters:z,ClockONo:d},Ko);class Xo extends(D({None:0,Unicast:1,Multicast:2})){}const Yo=Z(Xo);class Qo{constructor(e,t,n,r){this.Secure=e,this.StreamParameters=t,this.StreamCastMode=n,this.StreamChannelCount=r}}const Jo=l({Secure:k,StreamParameters:L,StreamCastMode:Yo,StreamChannelCount:c},Qo);class Zo extends(D({None:0,Start:1,Pause:2})){}const ei=Z(Zo);class ti extends(D({Stopped:0,SettingUp:1,Running:2,Paused:3,Fault:4})){}const ni=Z(ti);class ri{constructor(e,t,n){this.ConnectorID=e,this.State=t,this.ErrorCode=n}}const si=l({ConnectorID:c,State:ni,ErrorCode:c},ri);class oi{constructor(e){this.ConnectorStatus=e}}const ii=l({ConnectorStatus:si},oi);function ai(e,t){const n=e.encodedLength,r=e.encodeTo,s=e.decodeFrom,o=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r)*e.size,e.forEach(e=>{t+=i(e)})}),t},encodeTo:function(e,t,n){const s=t;let o=0;return t+=2,n.forEach((n,s)=>{o+=n.size,n.forEach(n=>{t=r(e,t,s),t=c(e,t,n)})}),e.setUint16(s,o),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let o=0;o<r;o++){let r,o;[t,r]=s(e,t),[t,o]=l(e,t);let i=n.get(r);i||n.set(r,i=new Set),i.add(o)}return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=o(e,t),t=u(e,t);return t}})}class ci{constructor(e,t,n,r,s,o,i,a,c){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=s,this.ChannelPinMap=o,this.AlignmentLevel=i,this.AlignmentGain=a,this.CurrentCoding=c}}const li=l({IDInternal:c,IDExternal:z,Connection:Jo,AvailableCodings:R($o),PinCount:c,ChannelPinMap:ai(c,Wt),AlignmentLevel:Zt,AlignmentGain:Zt,CurrentCoding:$o},ci),ui=x;class hi{constructor(e,t,n){this.SinkConnector=e,this.ChangeType=t,this.ChangedElement=n}}const di=l({SinkConnector:li,ChangeType:be,ChangedElement:ui},hi);class gi{constructor(e,t,n,r,s,o,i,a){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=s,this.ChannelPinMap=o,this.AlignmentLevel=i,this.CurrentCoding=a}}const fi=l({IDInternal:c,IDExternal:z,Connection:Jo,AvailableCodings:R($o),PinCount:c,ChannelPinMap:ft(c,Wt),AlignmentLevel:Zt,CurrentCoding:$o},gi);class pi{constructor(e,t,n){this.SourceConnector=e,this.ChangeType=t,this.ChangedElement=n}}const mi=l({SourceConnector:fi,ChangeType:be,ChangedElement:ui},pi);class Si extends(D({None:0,AV3:1,AVBTP:2,Dante:3,Cobranet:4,AES67:5,SMPTEAudio:6,LiveWire:7,ExtensionPoint:65})){}const yi=Z(Si),bi=pe("OcaMediaTransportNetwork",3,"",1,zo,[["GetMediaProtocol",3,1,[],[yi]],["GetPorts",3,2,[],[R($t)]],["GetPortName",3,3,[Wt],[z]],["SetPortName",3,4,[Wt,z],[]],["GetMaxSourceConnectors",3,5,[],[c]],["GetMaxSinkConnectors",3,6,[],[c]],["GetMaxPinsPerConnector",3,7,[],[c]],["GetMaxPortsPerPin",3,8,[],[c]],["GetSourceConnectors",3,9,[],[R(fi)]],["GetSourceConnector",3,10,[c],[fi]],["GetSinkConnectors",3,11,[],[R(li)]],["GetSinkConnector",3,12,[c],[li]],["GetConnectorsStatuses",3,13,[],[R(si)]],["GetConnectorStatus",3,14,[c],[si]],["AddSourceConnector",3,15,[fi,ni],[fi]],["AddSinkConnector",3,16,[si,li],[li]],["ControlConnector",3,17,[c,ei],[]],["SetSourceConnectorPinMap",3,18,[c,ft(c,Wt)],[]],["SetSinkConnectorPinMap",3,19,[c,ai(c,Wt)],[]],["SetConnectorConnection",3,20,[c,Jo],[]],["SetConnectorCoding",3,21,[c,$o],[]],["SetConnectorAlignmentLevel",3,22,[c,Zt],[]],["SetConnectorAlignmentGain",3,23,[c,Zt],[]],["DeleteConnector",3,24,[c],[]],["GetAlignmentLevel",3,25,[],[Zt,Zt,Zt]],["GetAlignmentGain",3,26,[],[Zt,Zt,Zt]]],[["Protocol",[yi],3,1,!1,!1,["MediaProtocol"]],["Ports",[R($t)],3,2,!1,!1,null],["MaxSourceConnectors",[c],3,3,!1,!1,null],["MaxSinkConnectors",[c],3,4,!1,!1,null],["MaxPinsPerConnector",[c],3,5,!1,!1,null],["MaxPortsPerPin",[c],3,6,!1,!1,null],["AlignmentLevel",[Zt],3,7,!1,!1,null],["AlignmentGain",[Zt],3,8,!1,!1,null]],[["SourceConnectorChanged",3,1,[mi]],["SinkConnectorChanged",3,2,[di]],["ConnectorStatusChanged",3,3,[ii]]]);class Oi extends(D({None:0,Source:1,Sink:2})){}const wi=Z(Oi);class Ci extends(D({NotConnected:0,Connected:1,Muted:2})){}const _i=Z(Ci),Pi=pe("OcaNetworkSignalChannel",3,"",2,en,[["AddToConnector",3,6,[d,c],[]],["GetConnectorPins",3,5,[],[ft(d,c)]],["GetIDAdvertised",3,1,[],[L]],["GetNetwork",3,3,[],[d]],["GetRemoteChannelID",3,8,[],[L]],["GetSourceOrSink",3,10,[],[wi]],["GetStatus",3,11,[],[_i]],["RemoveFromConnector",3,7,[d],[]],["SetIDAdvertised",3,2,[L],[]],["SetNetwork",3,4,[d],[]],["SetRemoteChannelID",3,9,[L],[]]],[["ConnectorPins",[ft(d,c)],3,3,!1,!1,null],["IDAdvertised",[L],3,1,!1,!1,null],["Network",[d],3,2,!1,!1,null],["RemoteChannelID",[L],3,4,!1,!1,null],["SourceOrSink",[wi],3,5,!1,!1,null],["Status",[_i],3,6,!1,!1,null]],[]);class vi extends(D({None:0,EthernetWired:1,EthernetWireless:2,USB:3,SerialP2P:4})){}const Gi=Z(vi);class Di{constructor(e,t){this.rxPacketErrors=e,this.txPacketErrors=t}}const Ti=l({rxPacketErrors:d,txPacketErrors:d},Di);class Mi extends(D({Unknown:0,Ready:1,StartingUp:2,Stopped:3})){}const Ii=Z(Mi);class Ai{constructor(e,t){this.SystemInterfaceHandle=e,this.MyNetworkAddress=t}}const Li=l({SystemInterfaceHandle:L,MyNetworkAddress:L},Ai),Ei=pe("OcaNetwork",3,"",2,ds,[["GetLinkType",3,1,[],[Gi]],["GetIDAdvertised",3,2,[],[L]],["SetIDAdvertised",3,3,[L],[]],["GetControlProtocol",3,4,[],[Ho]],["GetMediaProtocol",3,5,[],[yi]],["GetStatus",3,6,[],[Ii]],["GetStatistics",3,7,[],[Ti]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Li)]],["SetSystemInterfaces",3,10,[R(Li)],[]],["GetMediaPorts",3,11,[],[R(d)]],["Startup",3,12,[],[]],["Shutdown",3,13,[],[]]],[["LinkType",[Gi],3,1,!0,!1,null],["IDAdvertised",[L],3,2,!1,!1,null],["ControlProtocol",[Ho],3,3,!1,!1,null],["MediaProtocol",[yi],3,4,!1,!1,null],["Status",[Ii],3,5,!1,!1,null],["SystemInterfaces",[R(Li)],3,6,!1,!1,null],["MediaPorts",[R(d)],3,7,!1,!1,null],["Statistics",[Ti],3,8,!1,!1,null]],[]);class ki extends(D({Undefined:0,Locked:1,Synchronizing:2,FreeRun:3,Stopped:4})){}const xi=Z(ki),Ni=pe("OcaMediaClock",3,"",2,ds,[["GetType",3,1,[],[$e]],["SetType",3,2,[$e],[]],["GetDomainID",3,3,[],[c]],["SetDomainID",3,4,[c],[]],["GetSupportedRates",3,5,[],[R(yo)]],["GetCurrentRate",3,6,[],[yo]],["SetCurrentRate",3,7,[yo],[]],["GetLockState",3,8,[],[xi]]],[["Type",[$e],3,1,!1,!1,null],["DomainID",[c],3,2,!1,!1,null],["RatesSupported",[R(yo)],3,3,!1,!1,null],["CurrentRate",[yo],3,4,!1,!1,null],["LockState",[xi],3,5,!1,!1,null]],[]),Ui=pe("OcaStreamNetwork",3,"\n",2,ds,[["GetLinkType",3,1,[],[Gi]],["GetIDAdvertised",3,2,[],[L]],["SetIDAdvertised",3,3,[L],[]],["GetControlProtocol",3,4,[],[Ho]],["GetMediaProtocol",3,5,[],[yi]],["GetStatus",3,6,[],[Ii]],["GetStatistics",3,7,[],[Ti]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Li)]],["SetSystemInterfaces",3,10,[R(Li)],[]],["GetStreamConnectorsSource",3,11,[],[R(d)]],["SetStreamConnectorsSource",3,12,[R(d)],[]],["GetStreamConnectorsSink",3,13,[],[R(d)]],["SetStreamConnectorsSink",3,14,[R(d)],[]],["GetSignalChannelsSource",3,15,[],[R(d)]],["SetSignalChannelsSource",3,16,[R(d)],[]],["GetSignalChannelsSink",3,17,[],[R(d)]],["SetSignalChannelsSink",3,18,[R(d)],[]],["Startup",3,19,[],[]],["Shutdown",3,20,[],[]]],[["ControlProtocol",[Ho],3,3,!1,!1,null],["IDAdvertised",[L],3,2,!1,!1,null],["LinkType",[Gi],3,1,!0,!1,null],["MediaProtocol",[yi],3,4,!1,!1,null],["SignalChannelsSink",[R(d)],3,10,!1,!1,null],["SignalChannelsSource",[R(d)],3,9,!1,!1,null],["Statistics",[Ti],3,11,!1,!1,null],["Status",[Ii],3,5,!1,!1,null],["StreamConnectorsSink",[R(d)],3,8,!1,!1,null],["StreamConnectorsSource",[R(d)],3,7,!1,!1,null],["SystemInterfaces",[R(Li)],3,6,!1,!1,null]],[]);class Ri{constructor(e,t,n,r){this.HostID=e,this.NetworkAddress=t,this.NodeID=n,this.StreamConnectorID=r}}const Fi=l({HostID:L,NetworkAddress:L,NodeID:L,StreamConnectorID:L},Ri);class Bi extends(D({NotConnected:0,Connected:1,Paused:2})){}const Vi=Z(Bi);class ji extends(D({None:0,Unicast:1,Multicast:2})){}const zi=Z(ji);class qi{constructor(e,t,n,r,s,o,i,a,c,l,u){this.ErrorNumber=e,this.IDAdvertised=t,this.Index=n,this.Label=r,this.LocalConnectorONo=s,this.Priority=o,this.RemoteConnectorIdentification=i,this.Secure=a,this.Status=c,this.StreamParameters=l,this.StreamType=u}}const Hi=l({ErrorNumber:c,IDAdvertised:L,Index:c,Label:z,LocalConnectorONo:d,Priority:c,RemoteConnectorIdentification:Fi,Secure:k,Status:Vi,StreamParameters:L,StreamType:zi},qi);class Wi extends(D({NotAvailable:0,Idle:1,Connected:2,Paused:3})){}const Ki=Z(Wi),$i=pe("OcaStreamConnector",3,"\v",2,ds,[["ConnectStream",3,7,[Hi],[c]],["DisconnectStream",3,8,[c],[]],["GetIDAdvertised",3,3,[],[L]],["GetOwnerNetwork",3,1,[],[d]],["GetPins",3,10,[],[ft(c,d)]],["GetSourceOrSink",3,5,[],[wi]],["GetStatus",3,11,[],[Ki]],["GetStreams",3,9,[],[ft(c,Hi)]],["SetIDAdvertised",3,4,[L],[]],["SetOwnerNetwork",3,2,[d],[]],["SetSourceOrSink",3,6,[wi],[]]],[["IDAdvertised",[L],3,2,!1,!1,null],["OwnerNetwork",[d],3,1,!1,!1,null],["Pins",[ft(c,d)],3,5,!1,!1,null],["SourceOrSink",[wi],3,3,!1,!1,null],["Status",[Ki],3,6,!1,!1,null],["Streams",[ft(c,Hi)],3,4,!1,!1,null]],[]);var Xi=Object.freeze({__proto__:null,OcaRoot:_e,OcaWorker:en,OcaActuator:nn,OcaMute:on,OcaPolarity:ln,OcaSwitch:un,OcaGain:hn,OcaPanBalance:dn,OcaDelay:gn,OcaDelayExtended:yn,OcaFrequencyActuator:bn,OcaFilterClassical:vn,OcaFilterParametric:Tn,OcaFilterPolynomial:Mn,OcaFilterFIR:In,OcaFilterArbitraryCurve:En,OcaDynamics:jn,OcaDynamicsDetector:zn,OcaDynamicsCurve:qn,OcaSignalGenerator:Xn,OcaSignalInput:Yn,OcaSignalOutput:Qn,OcaTemperatureActuator:Jn,OcaIdentificationActuator:Zn,OcaSummingPoint:er,OcaBasicActuator:tr,OcaBooleanActuator:nr,OcaInt8Actuator:sr,OcaInt16Actuator:ir,OcaInt32Actuator:cr,OcaInt64Actuator:hr,OcaUint8Actuator:dr,OcaUint16Actuator:gr,OcaUint32Actuator:fr,OcaUint64Actuator:pr,OcaFloat32Actuator:mr,OcaFloat64Actuator:yr,OcaStringActuator:br,OcaBitstringActuator:_r,OcaSensor:Gr,OcaLevelSensor:Dr,OcaAudioLevelSensor:Ir,OcaTimeIntervalSensor:Ar,OcaFrequencySensor:Lr,OcaTemperatureSensor:Er,OcaIdentificationSensor:kr,OcaVoltageSensor:xr,OcaCurrentSensor:Nr,OcaImpedanceSensor:Fr,OcaGainSensor:Br,OcaBasicSensor:Vr,OcaBooleanSensor:jr,OcaInt8Sensor:zr,OcaInt16Sensor:qr,OcaInt32Sensor:Hr,OcaInt64Sensor:Wr,OcaUint8Sensor:Kr,OcaUint16Sensor:$r,OcaUint32Sensor:Xr,OcaFloat32Sensor:Yr,OcaFloat64Sensor:Qr,OcaStringSensor:Jr,OcaBitstringSensor:Zr,OcaUint64Sensor:es,OcaBlock:tn,OcaBlockFactory:ls,OcaMatrix:hs,OcaAgent:ds,OcaGrouper:Ds,OcaRamper:Bs,OcaNumericObserver:Ks,OcaLibrary:no,OcaPowerSupply:lo,OcaEventHandler:uo,OcaNumericObserverList:fo,OcaMediaClock3:bo,OcaTimeSource:To,OcaPhysicalPosition:No,OcaApplicationNetwork:zo,OcaControlNetwork:Wo,OcaMediaTransportNetwork:bi,OcaManager:Pe,OcaDeviceManager:ve,OcaSecurityManager:Ge,OcaFirmwareManager:Ae,OcaSubscriptionManager:je,OcaPowerManager:He,OcaNetworkManager:We,OcaMediaClockManager:Xe,OcaLibraryManager:nt,OcaAudioProcessingManager:rt,OcaDeviceTimeManager:gt,OcaTaskManager:Mt,OcaCodingManager:It,OcaDiagnosticManager:At,OcaNetworkSignalChannel:Pi,OcaNetwork:Ei,OcaMediaClock:Ni,OcaStreamNetwork:Ui,OcaStreamConnector:$i});const Yi={DeviceManager:1,SecurityManager:2,FirmwareManager:3,SubscriptionManager:4,PowerManager:5,NetworkManager:6,MediaClockManager:7,LibraryManager:8,AudioProcessingManager:9,DeviceTimeManager:10,TaskManager:11,CodingManager:12,DiagnosticManager:13};function Qi(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}const Ji={ONo:1055,MethodID:{DefLevel:1,MethodIndex:1}};const Zi=Object.values(Xi);function ea(e){return new Promise(t=>setTimeout(t,e))}function ta(e,t,n){let r;if("string"==typeof t){if(r=t,!(t=e.get_properties().find_property(r)))throw new Error(`Could not find property ${r} in ${e.ClassName}`)}else r=t.name;if(t.static)return n(!0,e[r]),()=>{};let s=null;const o=t=>{try{n(!0,s,t)}catch(t){console.error("Subscriber",n,"to property",r,"in",e,"threw exception",t)}},i=(e,t,n)=>{if(null!==s){switch(t.value){case 1:return s instanceof v?(s.values[0]=e,void o(0)):(s=e,void o());case 2:if(s instanceof v)return s.values[1]=e,void o(1);break;case 3:if(s instanceof v)return s.values[2]=e,void o(2)}console.warn("Unhandled event",e,t,n)}};let a=!0;const c=t.event(e),l=t.getter(e);if(!l)throw new Error(`Not getter found for ${r} in ${e.ClassName}`);if(c){const e=c.subscribe(i);e&&e.catch(e=>{a&&n(!1,e)})}return l((e,t)=>{a&&(e?(s=t,o()):n(!1,t))}),()=>{a=!1,c&&c.unsubscribe(i)}}function na(e,t){if("object"==typeof t){if(t instanceof v)return{[e]:t.item(0),["min"+e]:t.item(1),["max"+e]:t.item(2)};t=function e(t){if("object"==typeof t){if(t instanceof Uint8Array)return Array.from(t);if(null!==t&&t.isEnum)return t.name;for(const n in t)t[n]=e(t[n]);return t}return t}(t)}return{[e]:t}}async function ra(e){const t={type:e.ClassName,ObjectNumber:e.ObjectNumber},n=await e.GetClassIdentification();return Object.assign(t,function(e){const{ClassVersion:t,ClassID:n}=e;return{ClassVersion:t,ClassID:n.split("").map(e=>e.charCodeAt(0)).join(".")}}(n)),await Promise.all(e.get_properties().forEach(async n=>{const{name:r}=n;if("ClassID"===r||"ClassVersion"===r||"Owner"===r)return;if(e instanceof tn&&"Members"===r)return;const s=n.getter(e);if(s)try{const e=await s();Object.assign(t,na(r,e))}catch(t){8!=t.status&&console.error("Fetching property",e.ClassName,n.name,"failed:",t)}})),t}async function sa(e){try{return await e.GetClassIdentification(),!0}catch(e){if(5!=e.status)throw e;return!1}}class oa extends(D({None:0,ParamSet:1,Patch:2,Program:3})){}class ia extends(D({Ampere:4,DegreeCelsius:2,Hertz:1,None:0,Ohm:5,Volt:3})){}var aa=Object.freeze({__proto__:null,OcaApplicationNetworkCommand:Uo,OcaApplicationNetworkState:Fo,OcaBaseDataType:Ts,OcaBlockMember:kt,OcaClassAuthorityID:class{constructor(e,t,n){this.Sentinel=e,this.Reserved=t,this.OrganizationID=n}},OcaClassIdentification:me,OcaClassicalFilterShape:On,OcaComponent:De,OcaDBr:kn,OcaDelayUnit:fn,OcaDelayValue:mn,OcaDeviceState:{Operational:1,Disabled:2,Error:4,Initializing:8,Updating:16},OcaDynamicsFunction:Nn,OcaEnumItem:class{constructor(e){this.Value=e}},OcaEnumItem16:class{constructor(e){this.Value=e}},OcaEvent:g,OcaEventID:u,OcaFilterPassband:Cn,OcaGlobalTypeIdentifier:Nt,OcaGrouperCitizen:ps,OcaGrouperEnrollment:Ss,OcaGrouperGroup:bs,OcaGrouperMode:ws,OcaGrouperStatusChangeEventData:vs,OcaGrouperStatusChangeType:_s,OcaImpedance:Ur,OcaLevelDetectionLaw:Rn,OcaLevelMeterLaw:Tr,OcaLibAccess:$s,OcaLibParamSetAssignment:class{constructor(e,t){this.ParamSetIdentifier=e,this.TargetBlockONo=t}},OcaLibVol:Js,OcaLibVolChangedEventData:eo,OcaLibVolData_ParamSet:Rt,OcaLibVolIdentifier:Ye,OcaLibVolMetadata:Ys,OcaLibVolStandardTypeID:oa,OcaLibVolType:Je,OcaLibraryIdentifier:et,OcaManagerDefaultObjectNumbers:Yi,OcaManagerDescriptor:H,OcaMediaClockAvailability:po,OcaMediaClockLockState:ki,OcaMediaClockRate:So,OcaMediaClockType:Ke,OcaMediaCoding:Ko,OcaMediaConnection:Qo,OcaMediaConnectorCommand:Zo,OcaMediaConnectorElement:{PinMap:1,Connection:2,Coding:4,AlignmentLevel:8,AlignmentGain:16},OcaMediaConnectorState:ti,OcaMediaConnectorStatus:ri,OcaMediaConnectorStatusChangedEventData:oi,OcaMediaSinkConnector:ci,OcaMediaSinkConnectorChangedEventData:hi,OcaMediaSourceConnector:gi,OcaMediaSourceConnectorChangedEventData:pi,OcaMediaStreamCastMode:Xo,OcaMethod:ke,OcaMethodID:Le,OcaModelDescription:K,OcaModelGUID:X,OcaMuteState:rn,OcaNetworkControlProtocol:qo,OcaNetworkLinkType:vi,OcaNetworkMediaProtocol:Si,OcaNetworkMediaSourceOrSink:Oi,OcaNetworkSignalChannelStatus:Ci,OcaNetworkStatistics:Di,OcaNetworkStatus:Mi,OcaNetworkSystemInterfaceDescriptor:Vo,OcaNetworkSystemInterfaceID:Ai,OcaNotificationDeliveryMode:Ne,OcaOPath:gs,OcaObjectIdentification:Lt,OcaObjectListEventData:Re,OcaObjectSearchResult:Bt,OcaObjectSearchResultFlags:{ONo:1,ClassIdentification:2,ContainerPath:4,Role:8,Label:16},OcaObservationEventData:Vs,OcaObservationListEventData:ho,OcaObserverState:zs,OcaParametricEQShape:Gn,OcaPilotToneDetectorSpec:class{constructor(e,t,n){this.Threshold=e,this.Frequency=t,this.PollInterval=n}},OcaPolarityState:an,OcaPort:Kt,OcaPortID:Ht,OcaPortMode:zt,OcaPositionCoordinateSystem:Mo,OcaPositionDescriptor:Lo,OcaPowerState:ze,OcaPowerSupplyLocation:ro,OcaPowerSupplyState:oo,OcaPowerSupplyType:ao,OcaPresentationUnit:Bn,OcaProperty:Ls,OcaPropertyChangeType:ie,OcaPropertyDescriptor:Is,OcaPropertyID:ce,OcaProtoObjectIdentification:ts,OcaProtoPort:os,OcaProtoPortID:rs,OcaProtoSignalPath:as,OcaRamperCommand:ks,OcaRamperInterpolationLaw:Ns,OcaRamperState:Rs,OcaRelationalOperator:Hs,OcaResetCause:ee,OcaSensorReadingState:Pr,OcaSignalPath:Xt,OcaStatus:T,OcaStream:qi,OcaStreamConnectorIdentification:Ri,OcaStreamConnectorStatus:Wi,OcaStreamStatus:Bi,OcaStreamType:ji,OcaStringComparisonType:Qt,OcaSubscriptionManagerState:Be,OcaSweepType:Hn,OcaTask:St,OcaTaskCommand:bt,OcaTaskManagerState:wt,OcaTaskState:_t,OcaTaskStateChangedEventData:Dt,OcaTaskStatus:vt,OcaTimeMode:pt,OcaTimePTP:ht,OcaTimeProtocol:Oo,OcaTimeReferenceType:Co,OcaTimeSourceAvailability:Po,OcaTimeSourceSyncStatus:Go,OcaTransferFunction:An,OcaUnitOfMeasure:ia,OcaVersion:Me,OcaWaveformType:Kn});class ca extends A{constructor(e,t){super(t),this.ws=e,this._onmessage=e=>{try{this.read(e.data)}catch(e){this.emit("error",e)}},this._onclose=()=>{this.emit("close")},this._onerror=e=>{this.emit("error",e)},e.binaryType="arraybuffer",e.addEventListener("message",this._onmessage),e.addEventListener("close",this._onclose),e.addEventListener("error",this._onerror)}write(e){this.ws.send(e),super.write(e)}static connect(e,t){return new Promise((n,r)=>{const s=new e(t.url),o=function(e){r(e)};s.addEventListener("open",()=>{s.removeEventListener("error",o),n(new this(s,t))}),s.addEventListener("error",o)})}cleanup(){super.cleanup();const e=this.ws;if(e){this.ws=null;try{e.removeEventListener("message",this._onmessage),e.removeEventListener("close",this._onclose),e.removeEventListener("error",this._onerror),e.close()}catch(e){}}}}var la=Object.freeze({__proto__:null,warn:e,log:function(...e){try{console.log(...e)}catch(e){}},error:t,Connection:_,Command:o,CommandRrq:i,Response:m,Notification:p,KeepAlive:S,messageHeaderSize:10,encodeMessageTo:O,encodeMessage:w,decodeMessage:b,ClientConnection:A,RemoteDevice:class extends n{constructor(e,...t){super(),this.objects=new Map,this.connection=e,this._stackDebug=!1,e.on("error",e=>{this.emit("error",e)}),e.on("close",e=>{this.emit("close",e)}),this.modules=[],this.add_control_classes(Object.values(Xi)),t.map(e=>this.add_control_classes(e)),this.DeviceManager=new ve(Yi.DeviceManager,this),this.SecurityManager=new Ge(Yi.SecurityManager,this),this.FirmwareManager=new Ae(Yi.FirmwareManager,this),this.SubscriptionManager=new je(Yi.SubscriptionManager,this),this.PowerManager=new He(Yi.PowerManager,this),this.NetworkManager=new We(Yi.NetworkManager,this),this.MediaClockManager=new Xe(Yi.MediaClockManager,this),this.LibraryManager=new nt(Yi.LibraryManager,this),this.AudioProcessingManager=new rt(Yi.AudioProcessingManager,this),this.DeviceTimeManager=new gt(Yi.DeviceTimeManager,this),this.TaskManager=new Mt(Yi.TaskManager,this),this.CodingManager=new It(Yi.CodingManager,this),this.DiagnosticManager=new At(Yi.DiagnosticManager,this),this.Root=new tn(100,this),this.subscriptions=new Map}close(){this.connection.close()}send_command(e,t,n){const r=this._stackDebug?(new Error).stack:null;return this.connection.send_command(e,t,n,r)}_doSubscribe(e){return this.SubscriptionManager.AddSubscription(e,Ji,new Uint8Array(0),Ne.Reliable,new Uint8Array(0))}async add_subscription(n,r){if(this.connection.is_closed())throw new Error("Connection was closed.");const s=Qi(n),o=this.subscriptions;{const e=o.get(s);if(e)return e.callbacks.add(r),!0}const i=n=>{const r=this.subscriptions.get(s);if(!r)return void e("Subscription lost.");r.callbacks.forEach((function(e){try{e(n)}catch(e){t(e)}}))};this.connection._addSubscriber(n,i);const a={callbacks:new Set([r]),callback:i};o.set(s,a);try{await this._doSubscribe(n)}catch(e){throw o.delete(s),e}}remove_subscription(e,t){const n=Qi(e),r=this.subscriptions.get(n);if(!r)return Promise.reject("Callback not registered.");const s=r.callbacks;return s.delete(t),s.size?Promise.resolve(!0):(this.connection._removeSubscriber(e),this.subscriptions.delete(n),this.SubscriptionManager.RemoveSubscription(e,Ji))}find_best_class(e){for("object"==typeof e&&e.ClassID&&(e=e.ClassID);e.length;){const t=this.find_class_by_id(e);if(t)return t;e=e.substr(0,e.length-1)}return null}add_control_classes(e){if(Array.isArray(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.ClassID]=r}e=t}else if("object"!=typeof e)throw new Error("Unsupported module.");this.modules.push(e)}find_class_by_id(e){"object"==typeof e&&e.ClassID&&(e=e.ClassID);const t=this.modules;for(let n=t.length-1;n>=0;n--){const r=t[n][e];if(r)return r}return null}allocate(e,t){"object"==typeof t&&(t=t.valueOf());const n=this.objects;return n.has(t)||n.set(t,new e(t,this)),n.get(t)}resolve_object(e){if("MemberObjectIdentification"in e)return this.resolve_object(e.MemberObjectIdentification);if("ONo"in e&&"ClassIdentification"in e){const t=e.ONo,n=e.ClassIdentification;return this.allocate(this.find_best_class(n),t)}throw new TypeError("Expected OcaObjectIdentification or OcaBlockMember")}GetDeviceTree(){const e=t=>t.GetMembers().then(t=>{const n=[];t=t.map(this.resolve_object,this);for(let r=0;r<t.length;r++)n.push(Promise.resolve(t[r])),t[r].ClassID.startsWith(tn.ClassID)&&n.push(e(t[r]));return Promise.all(n)});return e(this.Root)}get_device_tree(){return this.GetDeviceTree()}get_role_map(e){return this.get_device_tree().then((function(t){return function(e,t){const n=new Map;t||(t="/");const r=[],s=e=>{Array.isArray(e)?e.forEach(s):r.push(e.GetRole().then(t=>{n.set(e,t)}))};return e.forEach(s),Promise.all(r).then((function(){const r=new Map,s=(e,o)=>{const i=null!=o?o+t:"",a=new Map;e.forEach((function(e,t){if(Array.isArray(e))return;const r=n.get(e);if(a.has(r)){const t=a.get(r);Array.isArray(t)?t.push(e):a.set(r,[t,e])}else a.set(r,e)})),a.forEach((function(e,t){if(Array.isArray(e)){let n=1;for(let r=0;r<e.length;r++){let s;for(;a.has(s=t+n);)n++;a.set(s,e[r]),a.set(e[r],s)}a.delete(t)}else a.set(e,t)})),e.forEach((t,n)=>{if(Array.isArray(t))s(t,i+a.get(e[n-1]));else{const e=i+a.get(t);r.set(e,t)}})};return s(e,null),r}))}(t,e)}))}discover_all_fallback(){return this.GetDeviceTree().then(e=>{const t=[],n=function(e){for(let r=0;r<e.length;r++)Array.isArray(e[r])?n(e[r]):t.push(e[r])};return n(e),t})}discover_all(){return this.Root.GetMembersRecursive().then(e=>e.map(this.resolve_object,this)).catch(()=>this.discover_all_fallback())}set_keepalive_interval(e){this.connection.set_keepalive_interval(e)}enable_stack_debug(e){this._stackDebug=!!e}},define_custom_class:function(e,t,n,r,s,o,i,a){if(n=String.fromCharCode.apply(String,n.split(".").map(e=>parseInt(e))),s){if("string"==typeof s)for(let e=0;e<Zi.length;e++)if(Zi[e].ClassName===s){s=Zi[e];break}}else{const e=n.substr(0,n.length-1);for(let t=0;t<Zi.length;t++)if(Zi[t].ClassID===e){s=Zi[t];break}}if("function"!=typeof s)throw new Error("Unknown parent class.");return pe(e,t,n,r,s,o,i,a)},AbstractUDPConnection:class extends A{constructor(e,t){t.batch>=0||(t.batch=128),super(t),this.socket=e,this.delay=t.delay>=0?t.delay:5,this.retry_interval=t.retry_interval>=0?t.retry_interval:250,this.retry_count=t.retry_count>=0?t.retry_count:3,this._write_out_id=-1,this._write_out_callback=()=>{this._write_out_id=-1,this._write_out()},this._retry_id=this.retry_interval>0?setInterval(()=>this._retryCommands(),this.retry_interval):-1,this.q=[],e.onmessage=e=>{try{this.read(e)}catch(e){console.warn("Failed to parse incoming AES70 packet: %o",e)}null!==this.inbuf&&this.close()},e.onerror=e=>this.error(e),this.set_keepalive_interval(1)}get is_reliable(){return!1}static async connect(e,t){const n=await e.connect(t.host,t.port,t.type);return await async function(e,t){const n=e.receiveMessage().then(e=>{const t=[],n=b(new DataView(e),0,t);if(1!==t.length)throw new Error("Expected keepalive response.");if(n!==e.byteLength)throw new Error("Trailing data in initial keepalive pdu.");return!0}),r=w(new S(1e3)),s=5*(t.retry_interval||250);for(let t=0;t<3;t++)if(e.send(r),await Promise.race([n,ea(s)]))return;throw new Error("Failed to connect.")}(n,t),new this(n,t)}write(e){this.q.push(e),this.tx_idle_time()>=this.delay?this._write_out():this._schedule_write_out()}flush(){super.flush(),this.tx_idle_time()>this.delay&&this._write_out()}cleanup(){super.cleanup(),this.socket&&(this.socket.close(),this.socket=null),-1!==this._write_out_id&&(clearTimeout(this._write_out_id),this._write_out_id=-1),-1!==this._retry_id&&(clearInterval(this._retry_id),this._retry_id=-1)}_estimate_next_tx_time(){return this._now()+(this.delay+2)*this.q.length}_write_out(){if(!this.socket)return;const e=this.q;if(!e.length)return;const t=e.shift();this.socket.send(t),super.write(t),e.length&&this._schedule_write_out()}_schedule_write_out(){const e=this.tx_idle_time(),t=this.delay;e>=t?this._write_out():-1===this._write_out_id&&(this._write_out_id=setTimeout(this._write_out_callback,t-e))}_retryCommands(){const e=this._now(),t=e-this.retry_interval,n=this.retry_interval/this.delay*5-this.q.length,r=this._pendingCommands,s=[],o=[];for(const e of r){const[,r]=e;if(r.lastSent>t)break;r.retries>=this.retry_count?o.push(e):s.length<n&&s.push(e)}if(o.length){const e=new Error("Timeout.");o.forEach(([t,n])=>{r.delete(t),n.reject(e)})}s.forEach(([t,n])=>{r.delete(t),r.set(t,n),this.send(n.command),n.lastSent=e,n.retries++})}},observeProperty:ta,PropertyObserver:class{constructor(e,t,n){if(this.o=e,this.propertyName=t,this.cacheSubscriptions=n,this.property=e.get_properties().find_property(t),this._subscribers=[],this._currentValue=null,this._unsubscribe=null,!this.property)throw new Error(`Could not find property ${t} in ${e.ClassName}`)}callSubscriber(e,t){try{e(!0,this._currentValue,t)}catch(e){console.error("Subscriber to",this,"threw and exception",e)}}subscribe(e){return this._subscribers.push(e),null===this._unsubscribe?this._unsubscribe=ta(this.o,this.property,(e,t,n)=>{if(e){this._currentValue=t;const e=this._subscribers;e.length||this.unsubscribeAll(),e.forEach(e=>this.callSubscriber(e,n))}}):null!==this._currentValue&&this.callSubscriber(e),()=>{this._subscribers=this._subscribers.filter(t=>t!==e),this.cacheSubscriptions||this._subscribers.length||this.unsubscribeAll()}}subscribeReturnValue(e,t){return this.subscribe((n,r,s)=>{if(n){if(s>=0&&s!==e)return;r instanceof v?t(!0,r.item(e)):t(!1,new Error(`Cannot index ${r} with ${e}.`))}else t(n,r)})}subscribeCurrent(e){return this.subscribeReturnValue(0,e)}subscribeMin(e){return this.subscribeReturnValue(1,e)}subscribeMax(e){return this.subscribeReturnValue(2,e)}subscribeValue(e){return this.subscribe((t,n,r)=>{if(t)if(n instanceof v){if(r>0)return;e(t,n.item(0))}else e(t,n);else e(t,n)})}unsubscribeAll(){this._subscribers.length=0,this._currentValue=null;const e=this._unsubscribe;if(e)try{e()}catch(e){console.error("Unsubscribe in",this,"threw an exception",e)}}dispose(){this.unsubscribeAll()}},fetchDeviceContent:async function(e){const t=await e.GetDeviceTree(),n=[e.DeviceManager,e.SecurityManager,e.FirmwareManager,e.SubscriptionManager,e.PowerManager,e.NetworkManager,e.MediaClockManager,e.LibraryManager,e.AudioProcessingManager,e.DeviceTimeManager,e.TaskManager,e.CodingManager,e.DiagnosticManager];for(const e of n)await sa(e)&&t.push(e);return await async function e(t){const n=[];for(let r=0;r<t.length;r++){const s=t[r],o=await ra(s);if(s instanceof tn){const n=t[r+1];if(!Array.isArray(n))throw new Error("Member missing for OcaBlock.");o.Members=await e(n),r++}n.push(o)}return n}(t)},RemoteError:P,RemoteControlClasses:Xi,Types:aa,WebSocketConnection:class extends ca{static connect(e){return super.connect(WebSocket,e)}_now(){return performance.now()}}});window.OCA=la}();
1
+ !function(){"use strict";function e(...e){try{console.warn(...e)}catch(e){}}function t(...e){try{console.error(...e)}catch(e){}}class n{constructor(){this.event_handlers=new Map}emit(e){const t=this.event_handlers.get(e),n=Array.prototype.slice.call(arguments,1);t&&t.forEach(e=>{try{e.apply(this,n)}catch(t){console.warn("ERROR when calling %o: %o",e,t)}})}on(e,t){let n=this.event_handlers.get(e);n||this.event_handlers.set(e,n=new Set),n.add(t)}addEventListener(e,t){this.on(e,t)}removeEventListener(e,t){const n=this.event_handlers.get(e);if(!n||!n.has(t))throw new Error("removeEventListeners(): not installed.");n.delete(t)}removeAllEventListeners(){this.event_handlers.clear()}}class r{get messageType(){return this.constructor.messageType}}class s{constructor(e,t){this.encoders=e,this.data=t,this.byteLength=function(e,t){let n=0;for(let r=0;r<e.length;r++)n+=e[r].encodedLength(t[r]);return n}(e,t),this.buffer=function(e,t,n){if(!n)return null;const r=new ArrayBuffer(n),s=new DataView(r);for(let n=0,r=0;n<e.length;n++)r=e[n].encodeTo(s,r,t[n]);return r}(e,t,this.byteLength)}encodeTo(e,t){t|=0;const{byteLength:n,buffer:r}=this;if(!n)return t;const s=new Uint8Array(r);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(s,t),t+n}}class o extends r{constructor(e,t,n,r,s){super(),this.target=+e,this.method_level=0|t,this.method_index=0|n,this.param_count=0|r,this.parameters=s||null,this.handle=0}static get messageType(){return 0}encode_to(e,t){if(t|=0,e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++,this.param_count){const n=this.parameters;n instanceof s?t=n.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(n),e.byteOffset+t),t+=n.byteLength)}return t}encoded_length(){return 17+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++,r-=17,r<0)throw new Error("Bad Command Length.");if(r>0){if(!this.param_count)throw new Error("Expected no parameter bytes.");this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}response(e,t,n){return new Response(this.handle,e,t,n)}}class i extends o{static get messageType(){return 1}}function a(e){if(!e.isConstantLength)return e;const t=e.encodedLength(),n=e.decode,r=e.encodeTo;return{isConstantLength:!0,encodedLength:e.encodedLength,encodeTo:r,decode:n,decodeFrom:function(e,r){const s=n(e,r);return[r+t,s]},decodeLength:function(e,n){return n+t}}}const c=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setUint16(t,0|n,!1),t+2},decode:function(e,t){return e.getUint16(t,!1)}});function l(e,t){const n=Object.keys(e).length;return t||(t=class{constructor(...t){if(t.length===n){let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this[r]=t[n++])}else{if(1!==t.length||"object"!=typeof t[0])throw new TypeError("Unexpected arguments.");{const n=t[0];for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=n[t])}}}}),a({type:t,isConstantLength:!1,encodedLength:function(t){let n=0;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n+=e[r].encodedLength(t[r])}return n},encodeTo:function(t,n,r){for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;n=e[s].encodeTo(t,n,r[s])}return n},decodeFrom:function(n,r){const s=new Array(e.length);let o=0;for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const i=e[t];let a;[r,a]=i.decodeFrom(n,r),s[o++]=a}return[r,new t(...s)]},decodeLength:function(t,n){for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;n=e[r].decodeLength(t,n)}return n}})}class u{constructor(e,t){this.DefLevel=e,this.EventIndex=t}}const h=l({DefLevel:c,EventIndex:c},u),d=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setUint32(t,n,!1),t+4},decode:function(e,t){return e.getUint32(t,!1)}});class g{constructor(e,t){this.EmitterONo=e,this.EventID=t}}const f=l({EmitterONo:d,EventID:h},g);class p extends r{constructor(e,t,n,r,s,o,i){super(),this.target=e,this.method_level=0|t,this.method_index=0|n,this.context=r,this.event=s,this.param_count=0|o,this.parameters=i||null}static get messageType(){return 2}encode_to(e,t){e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.target),t+=4,e.setUint16(t,this.method_level),t+=2,e.setUint16(t,this.method_index),t+=2,e.setUint8(t,this.param_count),t++;const n=this.context;if(n){const r=n.byteLength;e.setUint16(t,r),t+=2,r>0&&(new Uint8Array(e.buffer).set(new Uint8Array(this.context),e.byteOffset+t),t+=r)}else e.setUint16(t,0),t+=2;return e.setUint32(t,this.event.EmitterONo),t+=4,e.setUint16(t,this.event.EventID.DefLevel),t+=2,e.setUint16(t,this.event.EventID.EventIndex),t+=2,this.param_count>1&&(this.parameters instanceof s?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}encoded_length(){return 23+(this.param_count>1?this.parameters.byteLength:0)+(this.context?this.context.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);t+=4,this.target=e.getUint32(t),t+=4,this.method_level=e.getUint16(t),t+=2,this.method_index=e.getUint16(t),t+=2,this.param_count=e.getUint8(t),t++;const s=e.getUint16(t);let o;if(t+=2,s?(this.context=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+s),t+=s):this.context=null,[t,o]=f.decodeFrom(e,t),this.event=o,r-=23+s,r<0)throw new Error("Bad Notification Length.");return r>0&&(this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r),t}}class m extends r{constructor(e,t,n,r){super(),this.handle=e,this.status_code=0|t,this.param_count=0|n,this.parameters=r||null}static get messageType(){return 3}encoded_length(){return 10+(this.param_count?this.parameters.byteLength:0)}decode_from(e,t,n){let r=e.getUint32(t);if(t+=4,this.handle=e.getUint32(t),t+=4,this.status_code=e.getUint8(t),t++,this.param_count=e.getUint8(t),t++,r-=10,r<0)throw new Error("Bad Response length.");if(r>0){if(!this.param_count)throw new Error("Decoding response with parameterCount=0 but %o bytes of parameters",r);this.parameters=e.buffer.slice(e.byteOffset+t,e.byteOffset+t+r),t+=r}return t}encode_to(e,t){return e.setUint32(t,this.encoded_length()),t+=4,e.setUint32(t,this.handle),t+=4,e.setUint8(t,this.status_code),t++,e.setUint8(t,this.param_count),t++,this.param_count&&(this.parameters instanceof s?t=this.parameters.encodeTo(e,t):(new Uint8Array(e.buffer).set(new Uint8Array(this.parameters),e.byteOffset+t),t+=this.parameters.byteLength)),t}}class S extends r{static get messageType(){return 4}constructor(e){super(),this.time=e||0}decode_from(e,t,n){if(4==n)this.time=e.getUint32(t),t+=4;else{if(2!=n)throw new Error("Bad keepalive timeout length.");this.time=1e3*e.getUint16(t),t+=2}return t}encode_to(e,t){return this.time%1e3?(e.setUint32(t,this.time),t+=4):(e.setUint16(t,this.time/1e3),t+=2),t}encoded_length(){return this.time%1e3?4:2}}const y=[o,i,p,m,S];function b(e,t,n){if(e.byteLength<e.byteOffset+t+10)return-1;if(t|=0,59!=e.getUint8(t))throw new Error("Bad sync value.");t++,t+=2;const r=e.getUint32(t);t+=4;const s=e.getUint8(t);t++;const o=e.getUint16(t);t+=2;const i=e.byteOffset+t-9+r;if(i>e.byteLength)return-1;n.length=o;const a=y[s];if(void 0===a)throw new Error("Bad Message Type");if(a===S&&1!==o)throw new Error("Bad KeepAlive message count.");for(let r=0;r<o;r++)n[r]=new a,t=n[r].decode_from(e,t,i-e.byteOffset-t);if(t!=i)throw new Error("Decode error: "+t+" vs "+i);return t}function O(e,t,n,r,s){r||(r=0),s||(s=n.length);if(!(s-r<=65535))throw new Error("Too many PDUs.");e.setUint8(t,59);const o=t+=1;e.setUint16(t,1);const i=t+=2;t+=4,e.setUint8(t,n[r].messageType),t++,e.setUint16(t,s-r),t+=2;for(let o=r;o<s;o++)t=n[o].encode_to(e,t);return e.setUint32(i,t-o),t}function w(e){Array.isArray(e)||(e=[e]);const t=function(e){let t=10;const n=e[0].messageType;for(let r=0;r<e.length;r++){const s=e[r];if(s.messageType!=n)throw new Error("Cannot combine different types in one message.");t+=s.encoded_length()}return t}(e),n=new ArrayBuffer(t);if(O(new DataView(n),0,e,0,e.length)!=t)throw new Error("Message length mismatch.");return n}class C{constructor(e,t){if(!(e<=4294967295))throw new TypeError("Invalid batch size.");this._pdus=[],this._batchSize=e,this._resultCallback=t,this._currentSize=0,this._currentCount=0,this._lastMessageType=-1,this._flushScheduled=!1,this._flushCb=()=>{this._flushScheduled=!1,null!==this._pdus&&this.flush()}}add(e){const t=this._currentSize,n=e.encoded_length(),r=e.messageType,s=this._lastMessageType===r&&4!==r&&this._currentCount<65535;let o=n;s||(o+=10),t&&t+o>this._batchSize&&(this.flush(),o=n+10),this._pdus.push(e),this._currentSize+=o,s?this._currentCount++:this._currentCount=1,this._lastMessageType=r,this._currentSize>this._batchSize?this.flush():1===this._pdus.length&&this.scheduleFlush()}scheduleFlush(){this._flushScheduled||(this._flushScheduled=!0,Promise.resolve().then(this._flushCb).catch(e=>{console.error(e)}))}flush(){if(!this._currentSize)return;const e=this._pdus,t=new ArrayBuffer(this._currentSize),n=new DataView(t),r=e.length;for(let t=0,s=0,o=0;t<r;t++){const i=e[t].messageType;t!==r-1&&t+1-s!=65535&&4!==i&&i===e[t+1].messageType||(o=O(n,o,e,s,t+1),s=t+1)}this._currentSize=0,this._lastMessageType=-1,this._currentCount=0,this._pdus.length=0,this._resultCallback(t)}dispose(){this._pdus=null}}class _ extends n{constructor(e){e||(e={}),super();const t=this._now();this.options=e;const n=e.batch>=0?e.batch:65536;this._message_generator=new C(n,e=>this.write(e)),this.inbuf=null,this.inpos=0,this.last_rx_time=t,this.last_tx_time=t,this.rx_bytes=0,this.tx_bytes=0,this.keepalive_interval=-1,this._keepalive_interval_id=null;const r=()=>{this.removeEventListener("close",r),this.removeEventListener("error",r),this.cleanup()};this.on("close",r),this.on("error",r)}get is_reliable(){return!0}send(e){if(this.is_closed())throw new Error("Connection is closed.");this._message_generator.add(e)}tx_idle_time(){return this._now()-this.last_tx_time}rx_idle_time(){return this._now()-this.last_rx_time}read(e){if(this.rx_bytes+=e.byteLength,this.last_rx_time=this._now(),this.inbuf){const t=this.inbuf.byteLength-this.inpos,n=new Uint8Array(new ArrayBuffer(t+e.byteLength));n.set(new Uint8Array(this.inbuf,this.inpos)),n.set(new Uint8Array(e),t),this.inbuf=null,this.inpos=0,e=n.buffer}let t=0;const n=new DataView(e);try{do{const r=[],s=b(n,t,r);if(-1==s){this.inbuf=e,this.inpos=t;break}t=s,this.incoming(r)}while(t<e.byteLength)}catch(e){if(this.is_reliable)return void this.emit("error",e);console.error(e)}this._check_keepalive()}incoming(e){}write(e){this.last_tx_time=this._now(),this.tx_bytes+=e.byteLength}is_closed(){return null===this._message_generator}close(){this.is_closed()||this.emit("close")}error(e){this.is_closed()||this.emit("error",e)}cleanup(){if(this.is_closed())throw new Error("cleanup() called twice.");this.set_keepalive_interval(0),this._message_generator.dispose(),this._message_generator=null,this.removeAllEventListeners()}_check_keepalive(){if(!(this.keepalive_interval>0))return;const e=this.keepalive_interval;this.rx_idle_time()>3*e?(this.emit("timeout"),this.error(new Error("Keepalive timeout."))):this.tx_idle_time()>.75*e&&(this.flush(),this.tx_idle_time()>.75*e&&this.send(new S(e)))}flush(){this._message_generator.flush()}set_keepalive_interval(e){const t=1e3*e;null!==this._keepalive_interval_id&&(clearInterval(this._keepalive_interval_id),this._keepalive_interval_id=null),this.keepalive_interval=t,this.is_closed()||(this.send(new S(t)),t>0&&(this._keepalive_interval_id=setInterval(()=>{this._check_keepalive()},t/2)))}}class P extends Error{constructor(e,t){super("Call failed with OcaStatus "+e.name),this.name="aes70.RemoteError",this.status=e,this.cmd=t}static check_status(e,t){return e instanceof this&&e.status===t}}class v{constructor(e){this.values=e}item(e){return this.values[e]}get length(){return this.values.length}[Symbol.iterator](){return this.values[Symbol.iterator]()}}function G(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D(e){let t=null;function n(n){if(null===t){t=new Map;for(const n in e)G(e,n)&&t.set(e[n],n)}return t.get(n)}let r=null;const s=class{get isEnum(){return!0}constructor(t){if("string"==typeof t){if(!G(e,t))throw new Error("No such enum value.");return this.constructor[t]}if(null!==r&&r.has(t))return r.get(t);this.value=t,function(e,t){null===r&&(r=new Map),r.set(e,t)}(t,this)}get name(){return n(this.value)}valueOf(){return this.value}toString(){return this.name}static getName(e){const t=n(e);if(void 0===t)throw new Error("No such enum value.");return t}static getValue(t){const n=function(t){if(G(e,t))return e[t]}(t);if(void 0===n)throw new Error("No such enum value.");return n}static values(){return e}};for(const t in e)G(e,t)&&Object.defineProperty(s,t,{get:function(){return new this(e[t])},enumerable:!1,configurable:!0});return s}class T extends(D({OK:0,ProtocolVersionError:1,DeviceError:2,Locked:3,BadFormat:4,BadONo:5,ParameterError:6,ParameterOutOfRange:7,NotImplemented:8,InvalidRequest:9,ProcessingFailed:10,BadMethod:11,PartiallySucceeded:12,Timeout:13,BufferOverflow:14})){}class M{get handle(){return this.command.handle}constructor(e,t,n,r,s){this.resolve=e,this.reject=t,this.returnTypes=n,this.command=r,this.stack=s,this.lastSent=0,this.retries=0}handleError(e){this.stack&&e instanceof Error&&(e.stack=this.stack),this.reject(e)}response(e){const{resolve:t,reject:n,returnTypes:r,command:s}=this;if(0!==e.status_code){const t=new P(new T(e.status_code),s);this.handleError(t)}else if(r)try{const n=Math.min(e.param_count,r.length);if(0===n)t();else{const s=new Array(n),o=new DataView(e.parameters);for(let e=0,t=0;e<n;e++){let n;[t,n]=r[e].decodeFrom(o,t),s[e]=n}t(1===n?s[0]:new v(s))}}catch(e){n(e)}else t(e)}}function I(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}class A extends _{constructor(e){super(e),this._pendingCommands=new Map,this._nextCommandHandle=0,this._subscribers=new Map}cleanup(){super.cleanup(),this._subscribers=null;const e=this._pendingCommands;this._pendingCommands=null;const t=new Error("closed");e.forEach((e,n)=>{e.handleError(structuredClone(t))})}_addSubscriber(e,t){const n=I(e),r=this._subscribers;if(r.has(n))throw new Error("Subscriber already exists.");r.set(n,t)}_removeSubscriber(e){const t=I(e),n=this._subscribers;if(!n.has(t))throw new Error("Unknown subscriber.");n.delete(t)}_getNextCommandHandle(){let e;const t=this._pendingCommands;if(null===t)throw new Error("Connection not open.");do{e=this._nextCommandHandle,this._nextCommandHandle=e+1|0}while(t.has(e));return e}_estimate_next_tx_time(){return this._now()}send_command(e,t,n,r){const s=(n,s)=>{const o=this._getNextCommandHandle();e.handle=o;const i=new M(n,s,t,e,r);this._pendingCommands.set(o,i),i.lastSent=this._estimate_next_tx_time(),this.send(e)};if(!n)return new Promise(s);s(e=>n(!0,e),e=>n(!1,e))}_removePendingCommand(e){const t=this._pendingCommands,n=t.get(e);return n?(t.delete(e),n):null}incoming(e){for(let t=0;t<e.length;t++){if(null===this._pendingCommands)return;const n=e[t];if(n instanceof m){const e=this._removePendingCommand(n.handle);if(null===e){if(this.is_reliable)return void this.error(new Error("Unknown handle."));continue}e.response(n)}else if(n instanceof p){const e=this._subscribers,t=I(n.event),r=e.get(t);if(!r)continue;r(n)}else{if(!(n instanceof S))throw new Error("Unexpected PDU");if(!(n.time>0))throw new Error("Bad keepalive timeout.")}}}}const L=a({isConstantLength:!1,encodedLength:function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(Array.isArray(e)||e instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+t},encodeTo:function(e,t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));const r=n.length;e.setUint16(t,r),t+=2;return new Uint8Array(e.buffer,e.byteOffset).set(n,t),t+r},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+n,new Uint8Array(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+2+e.getUint16(t)}});function E(e){return a({isConstantLength:!0,encodedLength:function(t){return e},encodeTo:function(t,n,r){if(!(Array.isArray(r)||r instanceof Uint8Array))throw new TypeError("Expected Array or Uint8Array");if(r.length!==e)throw new Error("Length mismatch.");return new Uint8Array(t.buffer,t.byteOffset).set(r,n),n+e},decode:function(t,n){return new Uint8Array(t.buffer,t.byteOffset+n,e)}})}const k=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,n?1:0),t+1},decode:function(e,t){return 0!==e.getUint8(t)}}),x=c,N=x;function U(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function R(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");return 2+n*t},encodeTo:function(e,t,r){const s=r.length;e.setUint16(t,s),t+=2;for(let o=0;o<s;o++)t=n(e,t,r[o]);return t},decodeFrom:function(e,n){const s=e.getUint16(n);n+=2;const o=new Array(s);for(let i=0;i<s;i++)o[i]=r(e,n),n+=t;return[n,o]},decodeLength:function(e,n){return n+(2+e.getUint16(n)*t)}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,s=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(n>65535)throw new Error("Array too long for OcaList OCP.1 encoding");let r=2;for(let s=0;s<n;s++)r+=t(e[s]);return r},encodeTo:function(e,t,r){const s=r.length;e.setUint16(t,s),t+=2;for(let o=0;o<s;o++)t=n(e,t,r[o]);return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const s=new Array(n);for(let o=0;o<n;o++){let n;[t,n]=r(e,t),s[o]=n}return[t,s]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=s(e,t);return t}})}(e)}const F=new TextEncoder,B=new TextDecoder;function V(e){return F.encode(e)}function j(e,t,n){const r=t;for(;n--;){const n=e.getUint8(t);if(t++,!(n<=127)){if(n<194)throw new Error("Invalid UTF8 sequence.");if(t++,!(n<=223||(t++,n<=239||(t++,n<=244))))throw new Error("Invalid UTF8 sequence.")}}return t-r}const z=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");return 2+V(e).byteLength},encodeTo:function(e,t,n){const r=function(e){let t=0;for(let n=0;n<e.length;n++,t++){const t=e.charCodeAt(n);if(t>=55296&&t<=56319){n++;const t=e.charCodeAt(n);if(t<56320||t>57343)throw new TypeError("Expected valid unicode string.")}}return t}(n);if(r>65535)throw new Error("String too long for OcaString OCP.1 encoding.");e.setUint16(t,r),t+=2;const s=new Uint8Array(V(n));return new Uint8Array(e.buffer,e.byteOffset).set(s,t),t+s.length},decodeFrom:function(e,t){const n=e.getUint16(t),r=j(e,t+=2,n),s=new Uint8Array(e.buffer,e.byteOffset+t,r);return[t+r,(o=s,B.decode(o))];var o},decodeLength:function(e,t){const n=e.getUint16(t);return(t+=2)+j(e,t,n)}}),q=a({isConstantLength:!1,encodedLength:function(e){if("string"!=typeof e)throw new TypeError("Expected string.");const t=e.length;if(t>65535)throw new Error("Array too long for String16 OCP.1 encoding.");return 2+2*t},encodeTo:function(e,t,n){const r=n.length;e.setUint16(t,r,!1),t+=2;for(let s=0;s<r;s++,t+=2)e.setUint16(t,n.charCodeAt(s),!1);return t},decodeFrom:function(e,t){const n=e.getUint16(t,!1);t+=2;const r=new Array(n);for(let s=0;s<n;s++,t+=2)r[s]=e.getUint16(t,!1);return[t,String.fromCharCode.apply(String,r)]},decodeLength:function(e,t){return t+2+2*e.getUint16(t)}});class H{constructor(e,t,n,r){this.ObjectNumber=e,this.Name=t,this.ClassID=n,this.ClassVersion=r}}const W=l({ObjectNumber:d,Name:z,ClassID:q,ClassVersion:c},H);class K{constructor(e,t,n){this.Manufacturer=e,this.Name=t,this.Version=n}}const $=l({Manufacturer:z,Name:z,Version:z},K);class X{constructor(e,t,n){this.Reserved=e,this.MfrCode=t,this.ModelCode=n}}const Y=l({Reserved:E(1),MfrCode:E(3),ModelCode:E(4)},X),Q=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setUint8(t,0|n),t+1},decode:function(e,t){return e.getUint8(t)}});function J(e,t){const n=t.encodeTo,r=t.decode,s=a({isConstantLength:!0,encodedLength:t.encodedLength,encodeTo:function(t,r,s){if("object"==typeof s&&s instanceof e)s=s.value;else if("string"==typeof s)s=e.getValue(s);else{if("number"!=typeof s)throw new TypeError("Unsupported type.");e.getName(s)}return n(t,r,s)},decode:function(t,n){const s=r(t,n);return new e(s)}});for(const t in e.values())Object.defineProperty(s,t,{get:function(){return e[t]},enumerable:!1,configurable:!0});return s}function Z(e){return J(e,Q)}class ee extends(D({PowerOn:0,InternalError:1,Upgrade:2,ExternalRequest:3})){}const te=Z(ee);class ne{constructor(e,t,n){this.object=e,this.id=t,this.handlers=new Set,this.result=null,this.argumentTypes=n}GetOcaEvent(){return new g(this.object.ObjectNumber,this.id)}do_subscribe(){}do_unsubscribe(){}subscribe(e){return this.handlers.add(e),1===this.handlers.size?this.result=this.do_subscribe().then(()=>(this.result=null,!0)):null!==this.result?this.result:Promise.resolve(!0)}unsubscribe(e){return this.handlers.delete(e),this.handlers.size||this.do_unsubscribe().catch((function(){})),Promise.resolve(!0)}Dipose(){this.handlers.size&&this.do_unsubscribe().catch((function(){})),this.handlers.clear()}}const re=new ArrayBuffer;class se extends ne{constructor(e,n,r){super(e,n,r),this.callback=e=>{if(!this.handlers.size)return;const n=new Array(r.length),s=new DataView(e.parameters||re);for(let e=0,t=0;t<r.length;t++){let o;[e,o]=r[t].decodeFrom(s,e),n[t]=o}const o=this.object;this.handlers.forEach((function(e){try{e.apply(o,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.device.add_subscription(this.GetOcaEvent(),this.callback)}do_unsubscribe(e){return this.object.device.remove_subscription(this.GetOcaEvent(),this.callback)}}class oe extends ne{constructor(e,n,r){super(e,n,r),this.callback=([n,s,o])=>{if(n.DefLevel!==this.id.DefLevel||n.PropertyIndex!==this.id.PropertyIndex)return;const i=r[0].decodeFrom(s,0)[1];this.handlers.forEach((function(r){try{r.call(e,i,o,n)}catch(e){t(e)}}))}}do_subscribe(){return this.object.OnPropertyChanged.subscribe(this.callback)}do_unsubscribe(e){return this.object.OnPropertyChanged.unsubscribe(this.callback)}}class ie extends(D({CurrentChanged:1,MinChanged:2,MaxChanged:3,ItemAdded:4,ItemChanged:5,ItemDeleted:6})){}class ae{init(e){this.o=e,this.values=[],this.synchronized=!1,this.subscriptions=[]}sync(){if(this.synchronized)return Promise.resolve();let e=0;const t=[];return this.o.get_properties().forEach(n=>{const r=n.getter(this.o);if(!r)return;const s=n.event(this.o);if(s){const n=function(e,t,n){n===ie.CurrentChanged&&(this.values[e]=t)}.bind(this,e);this.subscriptions.push(s.unsubscribe.bind(s,n)),t.push(s.subscribe(n).catch((function(){})))}t.push(r().then(function(e,t){t instanceof v&&(t=t.item(0)),this.values[e]=t}.bind(this,e),(function(){}))),e++}),Promise.all(t)}forEach(e,t){let n=0;t||(t=this),this.o.get_properties().forEach(r=>{r.getter(this.o)&&(e.call(t,this.values[n],r.name),n++)})}Dispose(){this.o=null,this.subscriptions.forEach(e=>e()),this.subscriptions=null}}class ce{constructor(e,t){this.DefLevel=e,this.PropertyIndex=t}}class le{constructor(e,t,n){const r=new Map,s=[];this.by_name=r,this.parent=n,this.properties=s,this.level=t;for(let t=0;t<e.length;t++){const n=e[t];if(r.set(n.name,n),s[n.index]=n,n.aliases){const e=n.aliases;for(let t=0;t<e.length;t++)r.set(e[t],n)}}}find_property(e){if(e instanceof ce){if(e.DefLevel==this.level)return this.properties[e.PropertyIndex];if(this.parent)return this.parent.find_property(e)}else{if("string"!=typeof e)throw new Error("Expected PropertyID");{const t=this.by_name.get(e);if(t)return t;if(this.parent)return this.parent.find_property(e)}}}find_name(e){const t=this.find_property(e);if(t)return t.name}forEach(e,t){const n=this.parent?this.parent.forEach(e,t):[],r=this.properties;for(let s=0;s<r.length;s++){const o=r[s];void 0!==o&&n.push(e.call(t,o))}return n}}class ue{constructor(e,t,n,r,s,o,i,a){this.name=e,this.type=t,this.level=n,this.index=r,this.readonly=s,this.static=o,this.aliases=i,i||a||o||(a={get:"Get"+e}),this.accessors=a}GetPropertyID(){return new ce(this.level,this.index)}GetName(){return this.name}getter(e,t){let n=this.name,r=0;const s=this.aliases,o=this.accessors;if(o){const n=o.get;if(!n)return null;let r;if("string"==typeof n)r=e[n];else{if("object"!=typeof n)throw new Error("Unexpected accessor.");{const{name:t,index:s}=n;r=s>=0?function(e){if("function"!=typeof e)return this[t]().then(e=>e.item(s));this[t]((t,n)=>{t&&(n=n.item(s)),e(t,n)})}:e[t]}}return r?t?r:r.bind(e):null}if(this.static){const t=e.constructor[n];if(void 0!==t)return function(){return Promise.resolve(t)}}else{const r=e["Get"+n];if(r)return t?r:r.bind(e)}return s&&r<s.length&&(n=s[r++]),null}setter(e,t){if(this.readonly||this.static)return null;let n=this.name,r=0;const s=this.aliases;{const o=e["Set"+n];if(o)return t?o:o.bind(e);s&&r<s.length&&(n=s[r++])}return null}event(e){let t=this.name,n=0;const r=this.aliases;{const s=e["On"+t+"Changed"];if(s)return s;r&&n<r.length&&(t=r[n++])}return null}subscribe(e,n){const r=this.event(e),s=this.getter(e);return r&&r.subscribe(n).catch(t),s&&s().then(n,t),r||!!s}}function he(e,t){if(!t||!t.length)return;const[n,r,o,a,c,l]=t;e.prototype[n]=function(...e){const t=a.length;let n=null;t<e.length&&t+1===e.length&&"function"==typeof e[t]&&(n=e[t],e.length=t);const l=new i(this.ono,r,o,t,new s(a,e));return this.device.send_command(l,c,n)},l&&l.forEach(t=>{e.prototype[t]=function(...e){return this[n](...e)}})}function de(e,t){const[n,r,s,o]=t;Object.defineProperty(e.prototype,"On"+n,{get:function(){const e="_On"+n,t=this[e];return t||(this[e]=new se(this,new u(r,s),o))}})}function ge(e){return"On"+e+"Changed"}function fe(e,t){if(t.static)return;if("ObjectNumber"===t.name)return;const n=ge(t.name);Object.defineProperty(e.prototype,n,{get:function(){const e="_"+n,r=this[e];return r||(this[e]=new oe(this,new ce(t.level,t.index),t.type))}}),t.aliases&&t.aliases.forEach(t=>{const r=ge(t);e.prototype[r]||Object.defineProperty(e.prototype,r,{get:function(){return this[n]}})})}function pe(e){if("object"==typeof e&&e instanceof ue)return e;if(Array.isArray(e))return"object"!=typeof e[1]&&(e[1]=function(e){throw new Error("Not implemented.")}(e[1])),new ue(...e);throw new Error("Bad property.")}function me(e,t,n,r,s,o,i,a){let c=null,l=null;i=i.map(e=>pe(e));const u=class extends s{static get ClassID(){return n}static get ClassVersion(){return r}static get ClassName(){return e}static get_properties(){return null===l&&(l=new le(i,t,s.get_properties())),l}static GetPropertySync(){return null===c&&(c=function(e){const t=Object.create(ae.prototype),n=Object.create(e.prototype);let r=0;e.get_properties().forEach(e=>{const s=!!e.setter(n,!0);if(!e.getter(n,!0))return;const o={enumerable:!0,get:(i=r,function(){return this.values[i]})};var i,a;s&&(o.set=(a=e.setter(n,!0),function(e){return a.call(this.o,e),e})),Object.defineProperty(t,e.name,o),r++});const s=function(e){this.init(e)};return s.prototype=t,s}(this)),c}constructor(e,t){super(e,t);for(let e=0;e<i.length;e++){this["_On"+i[e].name+"Changed"]=null}for(let e=0;e<a.length;e++){this["_On"+a[e][0]]=null}}Dispose(){super.Dispose();for(let e=0;e<i.length;e++){const t=this["_On"+i[e].name+"Changed"];t&&t.Dispose()}for(let e=0;e<a.length;e++){const t=this["_On"+a[e][0]];t&&t.Dispose()}}};for(let e=0;e<o.length;e++)he(u,o[e]);for(let e=0;e<i.length;e++)fe(u,i[e]);for(let e=0;e<a.length;e++)de(u,a[e]);return u}class Se{constructor(e,t){this.ClassID=e,this.ClassVersion=t}}const ye=l({ClassID:q,ClassVersion:c},Se),be=l({DefLevel:c,PropertyIndex:c},ce),Oe=Z(ie);function we(...e){const t=e.length;return a({isConstantLength:!1,encodedLength:function(n){if(!Array.isArray(n)&&!U(n))throw new TypeError("Expected array.");if(n.length!==t)throw new Error("Length mismatch.");let r=0;for(let s=0;s<t;s++)r+=e[s].encodedLength(n[s]);return r},encodeTo:function(n,r,s){for(let o=0;o<t;o++)r=e[o].encodeTo(n,r,s[o]);return r},decodeFrom:function(n,r){const s=new Array(t);for(let o=0;o<t;o++){let t;[r,t]=e[o].decodeFrom(n,r),s[o]=t}return[r,s]},decodeLength:function(n,r){for(let s=0;s<t;s++)r=e[s].decodeLength(n,r);return r}})}const Ce=we(be,(_e=1,a({isConstantLength:!1,encodedLength:function(e){if(!("object"==typeof e&&e instanceof DataView))throw new TypeError("Expected DataView.");return e.byteLength-_e},encodeTo:function(e,t,n){const r=n.byteLength,s=new Uint8Array(n.buffer,n.byteOffset,r);return new Uint8Array(e.buffer,e.byteOffset+t).set(s),t+r},decodeFrom:function(e,t){const n=e.byteLength-t-_e;return[t+n,new DataView(e.buffer,e.byteOffset+t,n)]},decodeLength:function(e,t){return t+(e.byteLength-t-_e)}})),Oe);var _e;const Pe=me("OcaRoot",1,"",2,class{constructor(e,t){this.ono=e,this.device=t}get ObjectNumber(){return this.ono}get ClassVersion(){return this.constructor.ClassVersion}get ClassID(){return this.constructor.ClassID}get ClassName(){return this.constructor.ClassName}sendCommandRrq(e,t,n,r,s){const o=new i(this.ono,e,t,n,r);return this.device.send_command(o,s)}GetPropertyName(e){return this.get_properties().find_name(e)}GetPropertyID(e){const t=this.get_properties().find_property(e);if(t)return t.GetPropertyID()}static get_properties(){return null}get_properties(){return this.constructor.get_properties()}get __oca_properties__(){return this.get_properties()}GetPropertySync(){return new(this.constructor.GetPropertySync())(this)}Dispose(){}},[["GetClassIdentification",1,1,[],[ye]],["GetLockable",1,2,[],[k]],["LockTotal",1,3,[],[]],["Unlock",1,4,[],[]],["GetRole",1,5,[],[z]],["LockReadonly",1,6,[],[]]],[["ClassID",[q],1,1,!0,!0,null],["ClassVersion",[c],1,2,!0,!0,null],["ObjectNumber",[d],1,3,!0,!1,null],["Lockable",[k],1,4,!0,!1,null],["Role",[z],1,5,!0,!1,null]],[["PropertyChanged",1,1,[Ce]]]),ve=me("OcaManager",2,"",2,Pe,[],[],[]),Ge=me("OcaDeviceManager",3,"",2,ve,[["GetOcaVersion",3,1,[],[c]],["GetModelGUID",3,2,[],[Y]],["GetSerialNumber",3,3,[],[z]],["GetDeviceName",3,4,[],[z]],["SetDeviceName",3,5,[z],[]],["GetModelDescription",3,6,[],[$]],["GetDeviceRole",3,7,[],[z]],["SetDeviceRole",3,8,[z],[]],["GetUserInventoryCode",3,9,[],[z]],["SetUserInventoryCode",3,10,[z],[]],["GetEnabled",3,11,[],[k]],["SetEnabled",3,12,[k],[]],["GetState",3,13,[],[N]],["SetResetKey",3,14,[E(16),L],[]],["GetResetCause",3,15,[],[te]],["ClearResetCause",3,16,[],[]],["GetMessage",3,17,[],[z]],["SetMessage",3,18,[z],[]],["GetManagers",3,19,[],[R(W)]],["GetDeviceRevisionID",3,20,[],[z]]],[["ModelGUID",[Y],3,1,!1,!1,null],["SerialNumber",[z],3,2,!1,!1,null],["ModelDescription",[$],3,3,!1,!1,null],["DeviceName",[z],3,4,!1,!1,null],["OcaVersion",[c],3,5,!1,!1,null],["DeviceRole",[z],3,6,!1,!1,null],["UserInventoryCode",[z],3,7,!1,!1,null],["Enabled",[k],3,8,!1,!1,null],["State",[N],3,9,!1,!1,null],["Busy",[k],3,10,!1,!1,null],["ResetCause",[te],3,11,!1,!1,null],["Message",[z],3,12,!1,!1,null],["Managers",[R(W)],3,13,!1,!1,null],["DeviceRevisionID",[z],3,14,!0,!1,null]],[]),De=me("OcaSecurityManager",3,"",2,ve,[["EnableControlSecurity",3,1,[],[]],["DisableControlSecurity",3,2,[],[]],["ChangePreSharedKey",3,3,[z,L],[]],["AddPreSharedKey",3,4,[z,L],[]],["DeletePreSharedKey",3,5,[z],[]]],[["secureControlData",[k],3,1,!1,!1,null]],[]);class Te extends(D({BootLoader:0})){}const Me=J(Te,c);class Ie{constructor(e,t,n,r){this.Major=e,this.Minor=t,this.Build=n,this.Component=r}}const Ae=l({Major:d,Minor:d,Build:d,Component:Me},Ie),Le=me("OcaFirmwareManager",3,"",2,ve,[["GetComponentVersions",3,1,[],[R(Ae)]],["StartUpdateProcess",3,2,[],[]],["BeginActiveImageUpdate",3,3,[Me],[]],["AddImageData",3,4,[d,L],[]],["VerifyImage",3,5,[L],[]],["EndActiveImageUpdate",3,6,[],[]],["BeginPassiveComponentUpdate",3,7,[Me,L,z],[]],["EndUpdateProcess",3,8,[],[]]],[["ComponentVersions",[R(Ae)],3,1,!1,!1,null]],[]);class Ee{constructor(e,t){this.DefLevel=e,this.MethodIndex=t}}const ke=l({DefLevel:c,MethodIndex:c},Ee);class xe{constructor(e,t){this.ONo=e,this.MethodID=t}}const Ne=l({ONo:d,MethodID:ke},xe);class Ue extends(D({Reliable:1,Fast:2})){}const Re=Z(Ue);class Fe{constructor(e){this.objectList=e}}const Be=l({objectList:R(d)},Fe);class Ve extends(D({Normal:1,EventsDisabled:2})){}const je=Z(Ve),ze=me("OcaSubscriptionManager",3,"",2,ve,[["AddSubscription",3,1,[f,Ne,L,Re,L],[]],["RemoveSubscription",3,2,[f,Ne],[]],["DisableNotifications",3,3,[],[]],["ReEnableNotifications",3,4,[],[]],["AddPropertyChangeSubscription",3,5,[d,be,Ne,L,Re,L],[]],["RemovePropertyChangeSubscription",3,6,[d,be,Ne],[]],["GetMaximumSubscriberContextLength",3,7,[],[c]]],[["State",[je],3,1,!1,!1,null]],[["NotificationsDisabled",3,1,[]],["SynchronizeState",3,2,[Be]]]);class qe extends(D({None:0,Working:1,Standby:2,Off:3})){}const He=Z(qe),We=me("OcaPowerManager",3,"",2,ve,[["GetState",3,1,[],[He]],["SetState",3,2,[He],[]],["GetPowerSupplies",3,3,[],[R(d)]],["GetActivePowerSupplies",3,4,[],[R(d)]],["ExchangePowerSupply",3,5,[d,d,k],[]],["GetAutoState",3,6,[],[k]]],[["State",[He],3,1,!1,!1,null],["PowerSupplies",[R(d)],3,2,!1,!1,null],["ActivePowerSupplies",[R(d)],3,3,!1,!1,null],["AutoState",[k],3,4,!1,!1,null],["TargetState",[He],3,5,!1,!1,null]],[]),Ke=me("OcaNetworkManager",3,"",2,ve,[["GetNetworks",3,1,[],[R(d)]],["GetStreamNetworks",3,2,[],[R(d)]],["GetControlNetworks",3,3,[],[R(d)]],["GetMediaTransportNetworks",3,4,[],[R(d)]]],[["Networks",[R(d)],3,1,!1,!1,null],["StreamNetworks",[R(d)],3,2,!1,!1,null],["ControlNetworks",[R(d)],3,3,!1,!1,null],["MediaTransportNetworks",[R(d)],3,4,!1,!1,null]],[]);class $e extends(D({None:0,Internal:1,Network:2,External:3})){}const Xe=Z($e),Ye=me("OcaMediaClockManager",3,"",2,ve,[["GetClocks",3,1,[],[R(d)]],["GetMediaClockTypesSupported",3,2,[],[R(Xe)]],["GetClock3s",3,3,[],[R(d)]]],[["ClockSourceTypesSupported",[R(Xe)],3,1,!1,!1,["MediaClockTypesSupported"]],["Clocks",[R(d)],3,2,!1,!1,null],["Clock3s",[R(d)],3,3,!1,!1,null]],[]);class Qe{constructor(e,t){this.Library=e,this.ID=t}}const Je=l({Library:d,ID:d},Qe);class Ze{constructor(e,t){this.Authority=e,this.ID=t}}const et=l({Authority:E(3),ID:d},Ze);class tt{constructor(e,t){this.Type=e,this.ONo=t}}const nt=l({Type:et,ONo:d},tt),rt=me("OcaLibraryManager",3,"\b",2,ve,[["AddLibrary",3,1,[et],[nt]],["DeleteLibrary",3,2,[d],[]],["GetLibraryCount",3,3,[et],[c]],["GetLibraryList",3,4,[et],[R(nt)]],["GetCurrentPatch",3,5,[],[Je]],["ApplyPatch",3,6,[Je],[]]],[["Libraries",[R(nt)],3,1,!1,!1,null],["CurrentPatch",[Je],3,2,!1,!1,null]],[]),st=me("OcaAudioProcessingManager",3,"\t",2,ve,[],[],[]),ot="undefined"!=typeof BigInt,it=ot&&(BigInt(1)<<BigInt(64))-BigInt(1),at=ot&&it>>BigInt(1),ct=ot&&-at-BigInt(1),lt=ot&&(BigInt(1)<<BigInt(55))-BigInt(1);ot&&BigInt(1);function ut(){if(!ot)throw new Error("Missing BigInt support")}const ht=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(ut(),!(n<=it&&n>=0))throw new TypeError("Uint64 out of range.");return e.setBigUint64(t,BigInt(n),!1),t+8},decode:function(e,t){ut();const n=e.getBigUint64(t,!1);return n<=Number.MAX_SAFE_INTEGER?Number(n):n}});class dt{constructor(e,t,n){this.Negative=e,this.Seconds=t,this.Nanoseconds=n}}const gt=l({Negative:k,Seconds:ht,Nanoseconds:d},dt),ft=me("OcaDeviceTimeManager",3,"\n",2,ve,[["GetDeviceTimeNTP",3,1,[],[ht]],["SetDeviceTimeNTP",3,2,[ht],[]],["GetTimeSources",3,3,[],[R(d)]],["GetCurrentDeviceTimeSource",3,4,[],[d]],["SetCurrentDeviceTimeSource",3,5,[d],[]],["GetDeviceTimePTP",3,6,[],[gt]],["SetDeviceTimePTP",3,7,[gt],[]]],[["TimeSources",[R(d)],3,1,!1,!1,null],["CurrentDeviceTimeSource",[d],3,2,!1,!1,null]],[]);function pt(e,t){const n=e.encodedLength,r=e.encodeTo,s=e.decodeFrom,o=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r),t+=i(e)}),t},encodeTo:function(e,t,n){return e.setUint16(t,n.size),t+=2,n.forEach((n,s)=>{t=r(e,t,s),t=c(e,t,n)}),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let o=0;o<r;o++){let r,o;[t,r]=s(e,t),[t,o]=l(e,t),n.set(r,o)}if(n.size!==r)throw new Error("Key appeared twice in decoded Map.");return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=o(e,t),t=u(e,t);return t}})}class mt extends(D({Absolute:1,Relative:2})){}const St=Z(mt);class yt{constructor(e,t,n,r,s,o,i,a,c){this.ID=e,this.Label=t,this.ProgramID=n,this.GroupID=r,this.TimeMode=s,this.TimeSourceONo=o,this.StartTime=i,this.Duration=a,this.ApplicationSpecificParameters=c}}const bt=l({ID:d,Label:z,ProgramID:Je,GroupID:c,TimeMode:St,TimeSourceONo:d,StartTime:gt,Duration:gt,ApplicationSpecificParameters:L},yt);class Ot extends(D({None:0,Prepare:1,Enable:2,Start:3,Stop:4,Abort:5,Disable:6,Clear:7})){}const wt=Z(Ot);class Ct extends(D({None:0,Enabled:1,Disabled:2})){}const _t=Z(Ct);class Pt extends(D({None:0,NotPrepared:1,Disabled:2,Enabled:3,Running:4,Completed:5,Failed:6,Stopped:7,Aborted:8})){}const vt=Z(Pt);class Gt{constructor(e,t,n){this.ID=e,this.State=t,this.ErrorCode=n}}const Dt=l({ID:d,State:vt,ErrorCode:c},Gt);class Tt{constructor(e,t,n){this.TaskID=e,this.ProgramID=t,this.Status=n}}const Mt=l({TaskID:d,ProgramID:Je,Status:Dt},Tt),It=me("OcaTaskManager",3,"\v",1,ve,[["Enable",3,1,[k],[]],["ControlAllTasks",3,2,[wt,L],[]],["ControlTaskGroup",3,3,[c,wt,L],[]],["ControlTask",3,4,[d,wt,L],[]],["GetState",3,5,[],[_t]],["GetTaskStatuses",3,6,[],[Dt]],["GetTaskStatus",3,7,[d],[Dt]],["AddTask",3,8,[bt],[bt]],["GetTasks",3,9,[],[pt(d,bt)]],["GetTask",3,10,[d],[bt]],["SetTask",3,11,[d,bt],[]],["DeleteTask",3,12,[d],[]]],[["State",[_t],3,1,!1,!1,null],["Tasks",[pt(d,bt)],3,2,!1,!1,null]],[["TaskStateChanged",3,1,[Mt]]]),At=me("OcaCodingManager",3,"\f",1,ve,[["GetAvailableEncodingSchemes",3,1,[],[pt(c,z)]],["GetAvailableDecodingSchemes",3,2,[],[pt(c,z)]]],[["AvailableEncodingSchemes",[pt(c,z)],3,1,!1,!1,null],["AvailableDecodingSchemes",[pt(c,z)],3,2,!1,!1,null]],[]),Lt=me("OcaDiagnosticManager",3,"\r",1,ve,[["GetLockStatus",3,1,[d],[z]]],[],[]);class Et{constructor(e,t){this.ONo=e,this.ClassIdentification=t}}const kt=l({ONo:d,ClassIdentification:ye},Et);class xt{constructor(e,t){this.MemberObjectIdentification=e,this.ContainerObjectNumber=t}}const Nt=l({MemberObjectIdentification:kt,ContainerObjectNumber:d},xt);class Ut{constructor(e,t){this.Authority=e,this.ID=t}}const Rt=l({Authority:E(3),ID:d},Ut);class Ft{constructor(e,t){this.TargetBlockType=e,this.ParData=t}}const Bt=l({TargetBlockType:d,ParData:L},Ft);class Vt{constructor(e,t,n,r,s){this.ONo=e,this.ClassIdentification=t,this.ContainerPath=n,this.Role=r,this.Label=s}}const jt=l({ONo:d,ClassIdentification:ye,ContainerPath:R(d),Role:z,Label:z},Vt),zt=x;class qt extends(D({Input:1,Output:2})){}const Ht=Z(qt);class Wt{constructor(e,t){this.Mode=e,this.Index=t}}const Kt=l({Mode:Ht,Index:c},Wt);class $t{constructor(e,t,n){this.Owner=e,this.ID=t,this.Name=n}}const Xt=l({Owner:d,ID:Kt,Name:z},$t);class Yt{constructor(e,t){this.SourcePort=e,this.SinkPort=t}}const Qt=l({SourcePort:Xt,SinkPort:Xt},Yt);class Jt extends(D({Exact:0,Substring:1,Contains:2,ExactCaseInsensitive:3,SubstringCaseInsensitive:4,ContainsCaseInsensitive:5})){}const Zt=Z(Jt),en=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setFloat32(t,+n,!1),t+4},decode:function(e,t){return e.getFloat32(t,!1)}}),tn=me("OcaWorker",2,"",2,Pe,[["GetEnabled",2,1,[],[k]],["SetEnabled",2,2,[k],[]],["AddPort",2,3,[z,Ht],[Kt]],["DeletePort",2,4,[Kt],[]],["GetPorts",2,5,[],[R(Xt)]],["GetPortName",2,6,[Kt],[z]],["SetPortName",2,7,[Kt,z],[]],["GetLabel",2,8,[],[z]],["SetLabel",2,9,[z],[]],["GetOwner",2,10,[],[d]],["GetLatency",2,11,[],[en]],["SetLatency",2,12,[en],[]],["GetPath",2,13,[],[R(z),R(d)]]],[["Enabled",[k],2,1,!1,!1,null],["Ports",[R(Xt)],2,2,!1,!1,null],["Label",[z],2,3,!1,!1,null],["Owner",[d],2,4,!1,!1,null],["Latency",[en],2,5,!1,!1,null]],[]),nn=me("OcaBlock",3,"",2,tn,[["GetType",3,1,[],[d]],["ConstructMemberUsingFactory",3,3,[d],[d]],["DeleteMember",3,4,[d],[]],["GetMembers",3,5,[],[R(kt)]],["GetMembersRecursive",3,6,[],[R(Nt)]],["AddSignalPath",3,7,[Qt],[c]],["DeleteSignalPath",3,8,[c],[]],["GetSignalPaths",3,9,[],[pt(c,Qt)]],["GetSignalPathsRecursive",3,10,[],[pt(c,Qt)]],["GetMostRecentParamSetIdentifier",3,11,[],[Je]],["ApplyParamSet",3,12,[],[Je]],["GetCurrentParamSetData",3,13,[],[Bt]],["StoreCurrentParamSetData",3,14,[Je],[]],["GetGlobalType",3,15,[],[Rt]],["GetONoMap",3,16,[],[pt(d,d)]],["FindObjectsByRole",3,17,[z,Zt,q,zt],[R(jt)]],["FindObjectsByRoleRecursive",3,18,[z,Zt,q,zt],[R(jt)]],["FindObjectsByLabelRecursive",3,19,[z,Zt,q,zt],[R(jt)]],["FindObjectsByPath",3,20,[R(z),zt],[R(jt)]]],[["Type",[d],3,1,!0,!1,null],["Members",[R(kt)],3,2,!1,!1,null],["SignalPaths",[pt(c,Qt)],3,3,!1,!1,null],["MostRecentParamSetIdentifier",[Je],3,4,!1,!1,null],["GlobalType",[Rt],3,5,!0,!1,null],["ONoMap",[pt(d,d)],3,6,!0,!1,null]],[]);const rn=me("OcaActuator",3,"",2,tn,[],[],[]);class sn extends(D({Muted:1,Unmuted:2})){}const on=Z(sn),an=me("OcaMute",4,"",2,rn,[["GetState",4,1,[],[on]],["SetState",4,2,[on],[]]],[["State",[on],4,1,!1,!1,null]],[]);class cn extends(D({NonInverted:1,Inverted:2})){}const ln=Z(cn),un=me("OcaPolarity",4,"",2,rn,[["GetState",4,1,[],[ln]],["SetState",4,2,[ln],[]]],[["State",[ln],4,1,!1,!1,null]],[]),hn=me("OcaSwitch",4,"",2,rn,[["GetPosition",4,1,[],[c,c,c]],["SetPosition",4,2,[c],[]],["GetPositionName",4,3,[c],[z]],["SetPositionName",4,4,[c,z],[]],["GetPositionNames",4,5,[],[R(z)]],["SetPositionNames",4,6,[R(z)],[]],["GetPositionEnabled",4,7,[c],[k]],["SetPositionEnabled",4,8,[c,k],[]],["GetPositionEnableds",4,9,[],[R(k)]],["SetPositionEnableds",4,10,[R(k)],[]]],[["Position",[c],4,1,!1,!1,null],["PositionNames",[R(z)],4,2,!1,!1,null],["PositionEnableds",[R(k)],4,3,!1,!1,null]],[]),dn=me("OcaGain",4,"",2,rn,[["GetGain",4,1,[],[en,en,en]],["SetGain",4,2,[en],[]]],[["Gain",[en],4,1,!1,!1,null]],[]),gn=me("OcaPanBalance",4,"",2,rn,[["GetPosition",4,1,[],[en,en,en]],["SetPosition",4,2,[en],[]],["GetMidpointGain",4,3,[],[en,en,en]],["SetMidpointGain",4,4,[en],[]]],[["Position",[en],4,1,!1,!1,null],["MidpointGain",[en],4,2,!1,!1,null]],[]),fn=me("OcaDelay",4,"",2,rn,[["GetDelayTime",4,1,[],[en,en,en]],["SetDelayTime",4,2,[en],[]]],[["DelayTime",[en],4,1,!1,!1,null]],[]);class pn extends(D({Time:1,Distance:2,Samples:3,Microseconds:4,Milliseconds:5,Centimeters:6,Inches:7,Feet:8})){}const mn=Z(pn);class Sn{constructor(e,t){this.DelayValue=e,this.DelayUnit=t}}const yn=l({DelayValue:en,DelayUnit:mn},Sn),bn=me("OcaDelayExtended",5,"",2,fn,[["GetDelayValue",5,1,[],[yn,yn,yn]],["SetDelayValue",5,2,[yn],[]],["GetDelayValueConverted",5,3,[mn],[yn]]],[["DelayValue",[yn],5,1,!1,!1,null]],[]),On=me("OcaFrequencyActuator",4,"\b",2,rn,[["GetFrequency",4,1,[],[en,en,en]],["SetFrequency",4,2,[en],[]]],[["Frequency",[en],4,1,!1,!1,null]],[]);class wn extends(D({Butterworth:1,Bessel:2,Chebyshev:3,LinkwitzRiley:4})){}const Cn=Z(wn);class _n extends(D({HiPass:1,LowPass:2,BandPass:3,BandReject:4,AllPass:5})){}const Pn=Z(_n),vn=x,Gn=me("OcaFilterClassical",4,"\t",2,rn,[["GetFrequency",4,1,[],[en,en,en]],["SetFrequency",4,2,[en],[]],["GetPassband",4,3,[],[Pn]],["SetPassband",4,4,[Pn],[]],["GetShape",4,5,[],[Cn]],["SetShape",4,6,[Cn],[]],["GetOrder",4,7,[],[c,c,c]],["SetOrder",4,8,[c],[]],["GetParameter",4,9,[],[en,en,en]],["SetParameter",4,10,[en],[]],["SetMultiple",4,11,[vn,en,Pn,Cn,c,en],[]]],[["Frequency",[en],4,1,!1,!1,null],["Passband",[Pn],4,2,!1,!1,null],["Shape",[Cn],4,3,!1,!1,null],["Order",[c],4,4,!1,!1,null],["Parameter",[en],4,5,!1,!1,null]],[]);class Dn extends(D({None:0,PEQ:1,LowShelv:2,HighShelv:3,LowPass:4,HighPass:5,BandPass:6,AllPass:7,Notch:8,ToneControlLowFixed:9,ToneControlLowSliding:10,ToneControlHighFixed:11,ToneControlHighSliding:12})){}const Tn=Z(Dn),Mn=me("OcaFilterParametric",4,"\n",2,rn,[["GetFrequency",4,1,[],[en,en,en]],["SetFrequency",4,2,[en],[]],["GetShape",4,3,[],[Tn]],["SetShape",4,4,[Tn],[]],["GetWidthParameter",4,5,[],[en,en,en]],["SetWidthParameter",4,6,[en],[]],["GetInbandGain",4,7,[],[en,en,en]],["SetInbandGain",4,8,[en],[]],["GetShapeParameter",4,9,[],[en,en,en]],["SetShapeParameter",4,10,[en],[]],["SetMultiple",4,11,[vn,en,Tn,en,en,en],[]]],[["Frequency",[en],4,1,!1,!1,null],["Shape",[Tn],4,2,!1,!1,null],["WidthParameter",[en],4,3,!1,!1,["Q"]],["InbandGain",[en],4,4,!1,!1,null],["ShapeParameter",[en],4,5,!1,!1,null]],[]),In=me("OcaFilterPolynomial",4,"\v",2,rn,[["GetCoefficients",4,1,[],[R(en),R(en)]],["SetCoefficients",4,2,[R(en),R(en)],[]],["GetSampleRate",4,3,[],[en,en,en]],["SetSampleRate",4,4,[en],[]],["GetMaxOrder",4,5,[],[Q]]],[["A",[R(en)],4,1,!1,!1,null,{get:{name:"GetCoefficients",index:0},set:{name:"SetCoefficients",index:0}}],["B",[R(en)],4,2,!1,!1,null,{get:{name:"GetCoefficients",index:1},set:{name:"SetCoefficients",index:1}}],["SampleRate",[en],4,3,!1,!1,null],["MaxOrder",[Q],4,4,!0,!1,null]],[]),An=me("OcaFilterFIR",4,"\f",2,rn,[["GetLength",4,1,[],[d,d,d]],["GetCoefficients",4,2,[],[R(en)]],["SetCoefficients",4,3,[R(en)],[]],["GetSampleRate",4,4,[],[en,en,en]],["SetSampleRate",4,5,[en],[]]],[["Length",[d],4,1,!1,!1,null],["Coefficients",[R(en)],4,2,!1,!1,null],["SampleRate",[en],4,3,!1,!1,null]],[]);class Ln{constructor(e,t,n){this.Frequency=e,this.Amplitude=t,this.Phase=n}}const En=l({Frequency:R(en),Amplitude:R(en),Phase:R(en)},Ln),kn=me("OcaFilterArbitraryCurve",4,"\r",2,rn,[["GetTransferFunction",4,1,[],[En]],["SetTransferFunction",4,2,[En],[]],["GetSampleRate",4,3,[],[en,en,en]],["SetSampleRate",4,4,[en],[]],["GetTFMinLength",4,5,[],[c]],["GetTFMaxLength",4,6,[],[c]]],[["TransferFunction",[En],4,1,!1,!1,null],["SampleRate",[en],4,2,!1,!1,null],["TFMinLength",[c],4,3,!1,!1,null],["TFMaxLength",[c],4,4,!1,!1,null]],[]);class xn{constructor(e,t){this.Value=e,this.Ref=t}}const Nn=l({Value:en,Ref:en},xn);class Un extends(D({None:0,Compress:1,Limit:2,Expand:3,Gate:4})){}const Rn=Z(Un);class Fn extends(D({None:0,RMS:1,Peak:2})){}const Bn=Z(Fn);class Vn extends(D({dBu:0,dBV:1,V:2})){}const jn=Z(Vn),zn=me("OcaDynamics",4,"",2,rn,[["GetTriggered",4,1,[],[k]],["GetDynamicGain",4,2,[],[en]],["GetFunction",4,3,[],[Rn]],["SetFunction",4,4,[Rn],[]],["GetRatio",4,5,[],[en,en,en]],["SetRatio",4,6,[en],[]],["GetThreshold",4,7,[],[Nn,en,en]],["SetThreshold",4,8,[Nn],[]],["GetThresholdPresentationUnits",4,9,[],[jn]],["SetThresholdPresentationUnits",4,10,[jn],[]],["GetDetectorLaw",4,11,[],[Bn]],["SetDetectorLaw",4,12,[Bn],[]],["GetAttackTime",4,13,[],[en,en,en]],["SetAttackTime",4,14,[en],[]],["GetReleaseTime",4,15,[],[en,en,en]],["SetReleaseTime",4,16,[en],[]],["GetHoldTime",4,17,[],[en,en,en]],["SetHoldTime",4,18,[en],[]],["GetDynamicGainFloor",4,19,[],[en,en,en]],["SetDynamicGainFloor",4,20,[en],[]],["GetDynamicGainCeiling",4,21,[],[en,en,en]],["SetDynamicGainCeiling",4,22,[en],[]],["GetKneeParameter",4,23,[],[en,en,en]],["SetKneeParameter",4,24,[en],[]],["GetSlope",4,25,[],[en,en,en]],["SetSlope",4,26,[en],[]],["SetMultiple",4,27,[vn,Rn,Nn,jn,Bn,en,en,en,en,en,en,en],[]]],[["Triggered",[k],4,1,!1,!1,null],["DynamicGain",[en],4,2,!1,!1,null],["Function",[Rn],4,3,!1,!1,null],["Ratio",[en],4,4,!1,!1,null],["Threshold",[Nn],4,5,!1,!1,null],["ThresholdPresentationUnits",[jn],4,6,!1,!1,null],["DetectorLaw",[Bn],4,7,!1,!1,null],["AttackTime",[en],4,8,!1,!1,null],["ReleaseTime",[en],4,9,!1,!1,null],["HoldTime",[en],4,10,!1,!1,null],["DynamicGainCeiling",[en],4,11,!1,!1,null],["DynamicGainFloor",[en],4,12,!1,!1,null],["KneeParameter",[en],4,13,!1,!1,null],["Slope",[en],4,14,!1,!1,null]],[]),qn=me("OcaDynamicsDetector",4,"",2,rn,[["GetLaw",4,1,[],[Bn]],["SetLaw",4,2,[Bn],[]],["GetAttackTime",4,3,[],[en,en,en]],["SetAttackTime",4,4,[en],[]],["GetReleaseTime",4,5,[],[en,en,en]],["SetReleaseTime",4,6,[en],[]],["GetHoldTime",4,7,[],[en,en,en]],["SetHoldTime",4,8,[en],[]],["SetMultiple",4,9,[vn,Bn,en,en,en],[]]],[["Law",[Bn],4,1,!1,!1,null],["AttackTime",[en],4,2,!1,!1,null],["ReleaseTime",[en],4,3,!1,!1,null],["HoldTime",[en],4,4,!1,!1,null]],[]),Hn=me("OcaDynamicsCurve",4,"",2,rn,[["GetNSegments",4,1,[],[Q,Q,Q]],["SetNSegments",4,2,[Q],[]],["GetThreshold",4,3,[],[R(Nn),en,en]],["SetThreshold",4,4,[R(Nn)],[]],["GetSlope",4,5,[],[R(en),R(en),R(en)]],["SetSlope",4,6,[R(en)],[]],["GetKneeParameter",4,7,[],[R(en),R(en),R(en)]],["SetKneeParameter",4,8,[R(en)],[]],["GetDynamicGainCeiling",4,9,[],[en,en,en]],["SetDynamicGainCeiling",4,10,[en],[]],["GetDynamicGainFloor",4,11,[],[en,en,en]],["SetDynamicGainFloor",4,12,[en],[]],["SetMultiple",4,13,[vn,Q,R(Nn),R(en),R(en),en,en],[]]],[["NSegments",[Q],4,1,!1,!1,null],["Threshold",[R(Nn)],4,2,!1,!1,null],["Slope",[R(en)],4,3,!1,!1,null],["KneeParameter",[R(en)],4,4,!1,!1,null],["DynamicGainFloor",[en],4,5,!1,!1,null],["DynamicGainCeiling",[en],4,6,!1,!1,null]],[]);class Wn extends(D({Linear:1,Logarithmic:2,None:0})){}const Kn=Z(Wn);class $n extends(D({None:0,DC:1,Sine:2,Square:3,Impulse:4,NoisePink:5,NoiseWhite:6,PolarityTest:7})){}const Xn=Z($n),Yn=me("OcaSignalGenerator",4,"",2,rn,[["GetFrequency1",4,1,[],[en,en,en]],["SetFrequency1",4,2,[en],[]],["GetFrequency2",4,3,[],[en,en,en]],["SetFrequency2",4,4,[en],[]],["GetLevel",4,5,[],[en,en,en]],["SetLevel",4,6,[en],[]],["GetWaveform",4,7,[],[Xn]],["SetWaveform",4,8,[Xn],[]],["GetSweepType",4,9,[],[Kn]],["SetSweepType",4,10,[Kn],[]],["GetSweepTime",4,11,[],[en,en,en]],["SetSweepTime",4,12,[en],[]],["GetSweepRepeat",4,13,[],[k]],["SetSweepRepeat",4,14,[k],[]],["GetGenerating",4,15,[],[k]],["Start",4,16,[],[]],["Stop",4,17,[],[]],["SetMultiple",4,18,[vn,en,en,en,Xn,Kn,en,k],[]]],[["Frequency1",[en],4,1,!1,!1,null],["Frequency2",[en],4,2,!1,!1,null],["Level",[en],4,3,!1,!1,null],["Waveform",[Xn],4,4,!1,!1,null],["SweepType",[Kn],4,5,!1,!1,null],["SweepTime",[en],4,6,!1,!1,null],["SweepRepeat",[k],4,7,!1,!1,null],["Generating",[k],4,8,!1,!1,null]],[]),Qn=me("OcaSignalInput",4,"",2,rn,[],[],[]),Jn=me("OcaSignalOutput",4,"",2,rn,[],[],[]),Zn=me("OcaTemperatureActuator",4,"",2,rn,[["GetTemperature",4,1,[],[en,en,en]],["SetTemperature",4,2,[en],[]]],[["Temperature",[en],4,1,!1,!1,null]],[]),er=me("OcaIdentificationActuator",4,"",2,rn,[["GetActive",4,1,[],[k]],["SetActive",4,2,[k],[]]],[["Active",[k],4,1,!1,!1,null]],[]),tr=me("OcaSummingPoint",4,"",1,rn,[],[],[]),nr=me("OcaBasicActuator",4,"",2,rn,[],[],[]),rr=me("OcaBooleanActuator",5,"",2,nr,[["GetSetting",5,1,[],[k]],["SetSetting",5,2,[k],[]]],[["Setting",[k],5,1,!1,!1,null]],[]),sr=a({isConstantLength:!0,encodedLength:function(e){return 1},encodeTo:function(e,t,n){return e.setInt8(t,0|n),t+1},decode:function(e,t){return e.getInt8(t)}}),or=me("OcaInt8Actuator",5,"",2,nr,[["GetSetting",5,1,[],[sr,sr,sr]],["SetSetting",5,2,[sr],[]]],[["Setting",[sr],5,1,!1,!1,null]],[]),ir=a({isConstantLength:!0,encodedLength:function(e){return 2},encodeTo:function(e,t,n){return e.setInt16(t,0|n,!1),t+2},decode:function(e,t){return e.getInt16(t,!1)}}),ar=me("OcaInt16Actuator",5,"",2,nr,[["GetSetting",5,1,[],[ir,ir,ir]],["SetSetting",5,2,[ir],[]]],[["Setting",[ir],5,1,!1,!1,null]],[]),cr=a({isConstantLength:!0,encodedLength:function(e){return 4},encodeTo:function(e,t,n){return e.setInt32(t,0|n,!1),t+4},decode:function(e,t){return e.getInt32(t,!1)}}),lr=me("OcaInt32Actuator",5,"",2,nr,[["GetSetting",5,1,[],[cr,cr,cr]],["SetSetting",5,2,[cr],[]]],[["Setting",[cr],5,1,!1,!1,null]],[]);function ur(){if(!ot)throw new Error("Missing BigInt support")}const hr=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){if(ur(),!(n>=ct&&n<=at))throw new TypeError("Int64 out of range.");return e.setBigInt64(t,BigInt(n),!1),t+8},decode:function(e,t){ur();const n=e.getBigInt64(t,!1);return n>=Number.MIN_SAFE_INTEGER&&n<=Number.MAX_SAFE_INTEGER?Number(n):n}}),dr=me("OcaInt64Actuator",5,"",2,nr,[["GetSetting",5,1,[],[hr,hr,hr]],["SetSetting",5,2,[hr],[]]],[["Setting",[hr],5,1,!1,!1,null]],[]),gr=me("OcaUint8Actuator",5,"",2,nr,[["GetSetting",5,1,[],[Q,Q,Q]],["SetSetting",5,2,[Q],[]]],[["Setting",[Q],5,1,!1,!1,null]],[]),fr=me("OcaUint16Actuator",5,"",2,nr,[["GetSetting",5,1,[],[c,c,c]],["SetSetting",5,2,[c],[]]],[["Setting",[c],5,1,!1,!1,null]],[]),pr=me("OcaUint32Actuator",5,"\b",2,nr,[["GetSetting",5,1,[],[d,d,d]],["SetSetting",5,2,[d],[]]],[["Setting",[d],5,1,!1,!1,null]],[]),mr=me("OcaUint64Actuator",5,"\t",2,nr,[["GetSetting",5,1,[],[ht,ht,ht]],["SetSetting",5,2,[ht],[]]],[["Setting",[ht],5,1,!1,!1,null]],[]),Sr=me("OcaFloat32Actuator",5,"\n",2,nr,[["GetSetting",5,1,[],[en,en,en]],["SetSetting",5,2,[en],[]]],[["Setting",[en],5,1,!1,!1,null]],[]),yr=a({isConstantLength:!0,encodedLength:function(e){return 8},encodeTo:function(e,t,n){return e.setFloat64(t,+n,!1),t+8},decode:function(e,t){return e.getFloat64(t,!1)}}),br=me("OcaFloat64Actuator",5,"\v",2,nr,[["GetSetting",5,1,[],[yr,yr,yr]],["SetSetting",5,2,[yr],[]]],[["Setting",[yr],5,1,!1,!1,null]],[]),Or=me("OcaStringActuator",5,"\f",2,nr,[["GetSetting",5,1,[],[z]],["SetSetting",5,2,[z],[]],["GetMaxLen",5,3,[],[c]]],[["Setting",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!0,!1,null]],[]);function wr(e){return e+7>>3}function Cr(e,t,n){const r=new Array(n),s=wr(n),o=new Uint8Array(e.buffer,e.byteOffset+t,s);for(let e=0;e<n;e++)r[e]=!!(o[e>>3]&128>>(7&e));return r}const _r=a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e))throw new TypeError("Expected Array.");const t=e.length;if(t>65535)throw new Error("Array too long for OcaBlob OCP.1 encoding.");return 2+(t+7>>3)},encodeTo:function(e,t,n){const r=n.length;return e.setUint16(t,r),function(e,t,n){const r=n.length,s=wr(r),o=new Uint8Array(e.buffer,e.byteOffset+t,s);for(let e=0,t=0;t<s;t++){let s=0;for(let t=0;t<8&&e<r;t++,e++)n[e]&&(s|=128>>t);o[t]=s}return t+s}(e,t+=2,n)},decodeFrom:function(e,t){const n=e.getUint16(t);return[(t+=2)+wr(n),Cr(e,t,n)]},decodeLength:function(e,t){return t+2+wr(e.getUint16(t))}}),Pr=me("OcaBitstringActuator",5,"\r",2,nr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[k]],["SetBit",5,3,[c,k],[]],["GetBitstring",5,4,[],[_r]],["SetBitstring",5,5,[_r],[]]],[["Bitstring",[_r],5,1,!1,!1,null]],[]);class vr extends(D({Unknown:0,Valid:1,Underrange:2,Overrange:3,Error:4})){}const Gr=Z(vr),Dr=me("OcaSensor",3,"",2,tn,[["GetReadingState",3,1,[],[Gr]]],[["ReadingState",[Gr],3,1,!1,!1,null]],[]),Tr=me("OcaLevelSensor",4,"",2,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]);class Mr extends(D({VU:1,StandardVU:2,PPM1:3,PPM2:4,LKFS:5,RMS:6,Peak:7,ProprietaryValueBase:128})){}const Ir=Z(Mr),Ar=me("OcaAudioLevelSensor",5,"",2,Tr,[["GetLaw",5,1,[],[Ir]],["SetLaw",5,2,[Ir],[]]],[["Law",[Ir],5,1,!1,!1,null]],[]),Lr=me("OcaTimeIntervalSensor",4,"",2,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]),Er=me("OcaFrequencySensor",4,"",2,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]),kr=me("OcaTemperatureSensor",4,"",2,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]),xr=me("OcaIdentificationSensor",4,"",2,Dr,[],[],[["Identify",4,1,[]]]),Nr=me("OcaVoltageSensor",4,"",1,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]),Ur=me("OcaCurrentSensor",4,"\b",1,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]);class Rr{constructor(e,t){this.Magnitude=e,this.Phase=t}}const Fr=l({Magnitude:en,Phase:en},Rr),Br=me("OcaImpedanceSensor",4,"\t",1,Dr,[["GetReading",4,1,[],[Fr,Fr,Fr]]],[["Reading",[Fr],4,1,!1,!1,null]],[]),Vr=me("OcaGainSensor",4,"\n",1,Dr,[["GetReading",4,1,[],[en,en,en]]],[["Reading",[en],4,1,!1,!1,null]],[]),jr=me("OcaBasicSensor",4,"",2,Dr,[],[],[]),zr=me("OcaBooleanSensor",5,"",2,jr,[["GetReading",5,1,[],[k]]],[["Reading",[k],5,1,!1,!1,null]],[]),qr=me("OcaInt8Sensor",5,"",2,jr,[["GetReading",5,1,[],[sr,sr,sr]]],[["Reading",[sr],5,1,!1,!1,null]],[]),Hr=me("OcaInt16Sensor",5,"",2,jr,[["GetReading",5,1,[],[ir,ir,ir]]],[["Reading",[ir],5,1,!1,!1,null]],[]),Wr=me("OcaInt32Sensor",5,"",2,jr,[["GetReading",5,1,[],[cr,cr,cr]]],[["Reading",[cr],5,1,!1,!1,null]],[]),Kr=me("OcaInt64Sensor",5,"",2,jr,[["GetReading",5,1,[],[hr,hr,hr]]],[["Reading",[hr],5,1,!1,!1,null]],[]),$r=me("OcaUint8Sensor",5,"",2,jr,[["GetReading",5,1,[],[Q,Q,Q]]],[["Reading",[Q],5,1,!1,!1,null]],[]),Xr=me("OcaUint16Sensor",5,"",2,jr,[["GetReading",5,1,[],[c,c,c]]],[["Reading",[c],5,1,!1,!1,null]],[]),Yr=me("OcaUint32Sensor",5,"\b",2,jr,[["GetReading",5,1,[],[d,d,d]]],[["Reading",[d],5,1,!1,!1,null]],[]),Qr=me("OcaFloat32Sensor",5,"\n",2,jr,[["GetReading",5,1,[],[en,en,en]]],[["Reading",[en],5,1,!1,!1,null]],[]),Jr=me("OcaFloat64Sensor",5,"\v",2,jr,[["GetReading",5,1,[],[yr,yr,yr]]],[["Reading",[yr],5,1,!1,!1,null]],[]),Zr=me("OcaStringSensor",5,"\f",2,jr,[["GetString",5,1,[],[z]],["GetMaxLen",5,2,[],[c]],["SetMaxLen",5,3,[c],[]]],[["String",[z],5,1,!1,!1,null],["MaxLen",[c],5,2,!1,!1,null]],[]),es=me("OcaBitstringSensor",5,"\r",2,jr,[["GetNrBits",5,1,[],[c]],["GetBit",5,2,[c],[Q]],["GetBitString",5,3,[],[_r]]],[["BitString",[_r],5,1,!1,!1,null]],[]),ts=me("OcaUint64Sensor",5,"\t",2,jr,[["GetReading",5,1,[],[ht,ht,ht]]],[["Reading",[ht],5,1,!1,!1,null]],[]);class ns{constructor(e,t){this.POno=e,this.ClassIdentification=t}}const rs=l({POno:d,ClassIdentification:ye},ns);class ss{constructor(e,t){this.Mode=e,this.Index=t}}const os=l({Mode:Ht,Index:c},ss);class is{constructor(e,t,n){this.Owner=e,this.ProtoID=t,this.Name=n}}const as=l({Owner:d,ProtoID:os,Name:z},is);class cs{constructor(e,t){this.SourceProtoPort=e,this.SinkProtoPort=t}}const ls=l({SourceProtoPort:as,SinkProtoPort:as},cs),us=me("OcaBlockFactory",3,"",2,tn,[["DefineProtoPort",3,1,[z,Ht],[os]],["UndefineProtoPort",3,2,[os],[]],["GetProtoPorts",3,3,[],[R(as)]],["DefineProtoMemberUsingFactory",3,5,[d],[d]],["UndefineProtoMember",3,6,[d],[]],["GetProtoMembers",3,7,[],[R(rs)]],["DefineProtoSignalPath",3,8,[ls],[c]],["UndefineProtoSignalPath",3,9,[],[c]],["GetProtoSignalPaths",3,10,[],[pt(c,ls)]],["GetGlobalType",3,11,[],[Rt]],["SetGlobalType",3,12,[Rt],[]]],[["ProtoPorts",[R(as)],3,1,!1,!1,null],["ProtoMembers",[R(rs)],3,2,!1,!1,null],["ProtoSignalPaths",[pt(c,ls)],3,3,!1,!1,null],["GlobalType",[Rt],3,4,!1,!1,null]],[]);function hs(e){return e.isConstantLength?function(e){const t=e.encodedLength(void 0),n=e.encodeTo,r=e.decode;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!U(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");return 4+n*r*t},encodeTo:function(e,t,r){const s=r.length,o=0===s?0:r[0].length;e.setUint16(t,s),t+=2,e.setUint16(t,o),t+=2;for(let i=0;i<s;i++){const s=r[i];for(let r=0;r<o;r++)t=n(e,t,s[r])}return t},decodeFrom:function(e,n){const s=e.getUint16(n);n+=2;const o=e.getUint16(n);n+=2;const i=new Array(s).fill().map(()=>new Array(o));for(let a=0;a<s;a++){const s=i[a];for(let i=0;i<o;i++)s[i]=r(e,n),n+=t}return[n,i]},decodeLength:function(e,n){const r=e.getUint16(n);n+=2;const s=e.getUint16(n);return(n+=2)+r*s*t}})}(e):function(e){const t=e.encodedLength,n=e.encodeTo,r=e.decodeFrom,s=e.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!Array.isArray(e)&&!U(e))throw new TypeError("Expected array.");const n=e.length;if(0===n)return 4;if(!Array.isArray(e[0])&&!U(e[0]))throw new TypeError("Expected array.");const r=e[0].length;if(n>65535||r>65535)throw new Error("Array too long for OcaList2D OCP.1 encoding");let s=4;for(let o=0;o<n;o++){const n=e[o];for(let e=0;e<r;e++)s+=t(n[e])}return s},encodeTo:function(e,t,r){const s=r.length,o=0===s?0:r[0].length;e.setUint16(t,s),t+=2,e.setUint16(t,o),t+=2;for(let i=0;i<s;i++){const s=r[i];for(let r=0;r<o;r++)t=n(e,t,s[r])}return t},decodeFrom:function(e,t){const n=e.getUint16(t);t+=2;const s=e.getUint16(t);t+=2;const o=new Array(n).fill().map(()=>new Array(s));for(let i=0;i<n;i++){const n=o[i];for(let o=0;o<s;o++){let s;[t,s]=r(e,t),n[o]=s}}return[t,o]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;const r=e.getUint16(t);t+=2;for(let o=0;o<n;o++)for(let n=0;n<r;n++)t=s(e,t);return t}})}(e)}const ds=me("OcaMatrix",3,"",2,tn,[["GetCurrentXY",3,1,[],[c,c]],["SetCurrentXY",3,2,[c,c],[]],["GetSize",3,3,[],[c,c,c,c,c,c]],["SetSize",3,4,[c,c],[]],["GetMembers",3,5,[],[hs(d)]],["SetMembers",3,6,[hs(d)],[]],["GetMember",3,7,[c,c],[d]],["SetMember",3,8,[c,c,d],[]],["GetProxy",3,9,[],[d]],["SetProxy",3,10,[d],[]],["GetPortsPerRow",3,11,[],[Q]],["SetPortsPerRow",3,12,[Q],[]],["GetPortsPerColumn",3,13,[],[Q]],["SetPortsPerColumn",3,14,[Q],[]],["SetCurrentXYLock",3,15,[c,c],[]],["UnlockCurrent",3,16,[],[]]],[["X",[c],3,1,!1,!1,null],["Y",[c],3,2,!1,!1,null],["xSize",[c],3,3,!1,!1,null],["ySize",[c],3,4,!1,!1,null],["Members",[hs(d)],3,5,!1,!1,null],["Proxy",[d],3,6,!1,!1,null],["PortsPerRow",[Q],3,7,!1,!1,null],["PortsPerColumn",[Q],3,8,!1,!1,null]],[]),gs=me("OcaAgent",2,"",2,Pe,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetPath",2,4,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!1,null],["Owner",[d],2,2,!1,!1,null]],[]);class fs{constructor(e,t){this.HostID=e,this.ONo=t}}const ps=l({HostID:L,ONo:d},fs);class ms{constructor(e,t,n){this.Index=e,this.ObjectPath=t,this.Online=n}}const Ss=l({Index:c,ObjectPath:ps,Online:k},ms);class ys{constructor(e,t){this.GroupIndex=e,this.CitizenIndex=t}}const bs=l({GroupIndex:c,CitizenIndex:c},ys);class Os{constructor(e,t,n){this.Index=e,this.Name=t,this.ProxyONo=n}}const ws=l({Index:c,Name:z,ProxyONo:d},Os);class Cs extends(D({MasterSlave:1,PeerToPeer:2})){}const _s=Z(Cs);class Ps extends(D({citizenAdded:1,citizenDeleted:2,citizenConnectionLost:3,citizenConnectionReEstablished:4,citizenError:5,enrollment:6,unEnrollment:7})){}const vs=Z(Ps);class Gs{constructor(e,t,n){this.groupIndex=e,this.citizenIndex=t,this.changeType=n}}const Ds=l({groupIndex:c,citizenIndex:c,changeType:vs},Gs),Ts=me("OcaGrouper",3,"",2,gs,[["AddGroup",3,1,[z],[c,d]],["DeleteGroup",3,2,[c],[]],["GetGroupCount",3,3,[],[c]],["GetGroupList",3,4,[],[R(ws)]],["AddCitizen",3,5,[Ss],[c]],["DeleteCitizen",3,6,[c],[]],["GetCitizenCount",3,7,[],[c]],["GetCitizenList",3,8,[],[R(Ss)]],["GetEnrollment",3,9,[bs],[k]],["SetEnrollment",3,10,[bs,k],[]],["GetGroupMemberList",3,11,[c],[R(Ss)]],["GetActuatorOrSensor",3,12,[],[k]],["SetActuatorOrSensor",3,13,[k],[]],["GetMode",3,14,[],[_s]],["SetMode",3,15,[_s],[]]],[["ActuatorOrSensor",[k],3,1,!1,!1,null],["Groups",[R(ws)],3,2,!1,!1,["GroupList"]],["Citizens",[R(Ss)],3,3,!1,!1,["CitizenList"]],["Enrollments",[R(bs)],3,4,!1,!1,["EnrollmentList"]],["Mode",[_s],3,5,!1,!1,null]],[["StatusChange",3,1,[Ds]]]);class Ms extends(D({None:0,OcaBoolean:1,OcaInt8:2,OcaInt16:3,OcaInt32:4,OcaInt64:5,OcaUint8:6,OcaUint16:7,OcaUint32:8,OcaUint64:9,OcaFloat32:10,OcaFloat64:11,OcaString:12,OcaBitstring:13,OcaBlob:14,OcaBlobFixedLen:15,OcaBit:16})){}const Is=Z(Ms);class As{constructor(e,t,n,r){this.PropertyID=e,this.BaseDataType=t,this.GetterMethodID=n,this.SetterMethodID=r}}const Ls=l({PropertyID:be,BaseDataType:Is,GetterMethodID:ke,SetterMethodID:ke},As);class Es{constructor(e,t){this.ONo=e,this.Descriptor=t}}const ks=l({ONo:d,Descriptor:Ls},Es);class xs extends(D({Enable:1,Start:2,Halt:3})){}const Ns=Z(xs);class Us extends(D({Linear:1,ReverseLinear:2,Sine:3,Exponential:4})){}const Rs=Z(Us);class Fs extends(D({NotInitialized:1,Iniitialized:2,Scheduled:3,Enabled:4,Ramping:5})){}const Bs=Z(Fs),Vs=me("OcaRamper",3,"",2,gs,[["Control",3,1,[Ns],[]],["GetState",3,2,[],[Bs]],["GetRampedProperty",3,3,[],[ks]],["SetRampedProperty",3,4,[ks],[]],["GetTimeMode",3,5,[],[St]],["SetTimeMode",3,6,[St],[]],["GetStartTime",3,7,[],[ht]],["SetStartTime",3,8,[ht],[]],["GetDuration",3,9,[],[en,en,en]],["SetDuration",3,10,[en],[]],["GetInterpolationLaw",3,11,[],[Rs]],["SetInterpolationLaw",3,12,[Rs],[]],["GetGoal",3,13,[],[yr]],["SetGoal",3,14,[yr],[]]],[["State",[Bs],3,1,!1,!1,null],["RampedProperty",[ks],3,2,!1,!1,null],["TimeMode",[St],3,3,!1,!1,null],["StartTime",[ht],3,4,!1,!1,null],["Duration",[en],3,5,!1,!1,null],["InterpolationLaw",[Rs],3,6,!1,!1,null],["Goal",[yr],3,7,!1,!1,null]],[]);class js{constructor(e){this.Reading=e}}const zs=l({Reading:yr},js);class qs extends(D({NotTriggered:0,Triggered:1})){}const Hs=Z(qs);class Ws extends(D({None:0,Equality:1,Inequality:2,GreaterThan:3,GreaterThanOrEqual:4,LessThan:5,LessThanOrEqual:6})){}const Ks=Z(Ws),$s=me("OcaNumericObserver",3,"",2,gs,[["GetLastObservation",3,1,[],[yr]],["GetState",3,2,[],[Hs]],["GetObservedProperty",3,3,[],[ks]],["SetObservedProperty",3,4,[ks],[]],["GetThreshold",3,5,[],[yr]],["SetThreshold",3,6,[yr],[]],["GetOperator",3,7,[],[Ks]],["SetOperator",3,8,[Ks],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[yr]],["SetHysteresis",3,12,[yr],[]],["GetPeriod",3,13,[],[en]],["SetPeriod",3,14,[en],[]]],[["State",[Hs],3,1,!1,!1,null],["ObservedProperty",[ks],3,2,!1,!1,null],["Threshold",[yr],3,3,!1,!1,null],["Operator",[Ks],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[yr],3,6,!1,!1,null],["Period",[en],3,7,!1,!1,null]],[["Observation",3,1,[zs]]]);class Xs extends(D({None:0,ReadOnly:1,ReadExpand:2,Full:3})){}const Ys=Z(Xs);class Qs{constructor(e,t,n,r,s,o){this.Name=e,this.VolType=t,this.Access=n,this.Version=r,this.Creator=s,this.UpDate=o}}const Js=l({Name:z,VolType:et,Access:Ys,Version:d,Creator:z,UpDate:gt},Qs);class Zs{constructor(e,t){this.Metadata=e,this.Data=t}}const eo=l({Metadata:Js,Data:L},Zs);class to{constructor(e,t){this.VolumeID=e,this.ChangeType=t}}const no=l({VolumeID:d,ChangeType:Oe},to),ro=me("OcaLibrary",3,"",2,gs,[["AddVolume",3,1,[eo],[d]],["ReplaceVolume",3,2,[d,eo],[]],["DeleteVolume",3,3,[d],[]],["GetVolume",3,4,[d],[eo]],["GetVolumeCount",3,5,[],[c]],["GetVolumes",3,6,[],[pt(d,eo)]],["GetAccess",3,7,[],[Ys]],["SetAccess",3,8,[Ys],[]]],[["VolumeType",[et],3,1,!1,!1,null],["Access",[Ys],3,2,!1,!1,null],["Volumes",[pt(d,eo)],3,3,!1,!1,null]],[["OcaLibVolChanged",3,1,[no]]]);class so extends(D({Unspecified:1,Internal:2,External:3})){}const oo=Z(so);class io extends(D({Off:0,Unavailable:1,Available:2,Active:3})){}const ao=Z(io);class co extends(D({None:0,Mains:1,Battery:2,Phantom:3,Solar:4})){}const lo=Z(co),uo=me("OcaPowerSupply",3,"",3,gs,[["GetType",3,1,[],[lo]],["GetModelInfo",3,2,[],[z]],["GetState",3,3,[],[ao]],["SetState",3,4,[ao],[]],["GetCharging",3,5,[],[k]],["GetLoadFractionAvailable",3,6,[],[en]],["GetStorageFractionAvailable",3,7,[],[en]],["GetLocation",3,8,[],[oo]]],[["Type",[lo],3,1,!1,!1,null],["ModelInfo",[z],3,2,!1,!1,null],["State",[ao],3,3,!1,!1,null],["Charging",[k],3,4,!1,!1,null],["LoadFractionAvailable",[en],3,5,!1,!1,null],["StorageFractionAvailable",[en],3,6,!1,!1,null],["Location",[oo],3,7,!0,!1,null]],[]),ho=me("OcaEventHandler",3,"\b",2,gs,[["OnEvent",3,1,[L,f],[]]],[],[]);class go{constructor(e){this.Reading=e}}const fo=l({Reading:R(yr)},go),po=me("OcaNumericObserverList",3,"\t",2,gs,[["GetLastObservation",3,1,[],[R(yr)]],["GetState",3,2,[],[Hs]],["GetObservedProperties",3,3,[],[R(ks)]],["SetObservedProperties",3,4,[R(ks)],[]],["GetThreshold",3,5,[],[yr]],["SetThreshold",3,6,[yr],[]],["GetOperator",3,7,[],[Ks]],["SetOperator",3,8,[Ks],[]],["GetTwoWay",3,9,[],[k]],["SetTwoWay",3,10,[k],[]],["GetHysteresis",3,11,[],[yr]],["SetHysteresis",3,12,[yr],[]],["GetPeriod",3,13,[],[en]],["SetPeriod",3,14,[en],[]]],[["State",[Hs],3,1,!1,!1,null],["ObservedProperties",[R(ks)],3,2,!1,!1,null],["Threshold",[yr],3,3,!1,!1,null],["Operator",[Ks],3,4,!1,!1,null],["TwoWay",[k],3,5,!1,!1,null],["Hysteresis",[yr],3,6,!1,!1,null],["Period",[en],3,7,!1,!1,null]],[["Observation",3,1,[fo]]]);class mo extends(D({Unavailable:0,Available:1})){}const So=Z(mo);class yo{constructor(e,t,n,r){this.NominalRate=e,this.PullRange=t,this.Accuracy=n,this.JitterMax=r}}const bo=l({NominalRate:en,PullRange:en,Accuracy:en,JitterMax:en},yo),Oo=me("OcaMediaClock3",3,"",1,gs,[["GetAvailability",3,1,[],[So]],["SetAvailability",3,2,[So],[]],["GetCurrentRate",3,3,[],[bo,d]],["SetCurrentRate",3,4,[bo,d],[]],["GetOffset",3,5,[],[gt]],["SetOffset",3,6,[gt],[]],["GetSupportedRates",3,7,[],[pt(d,R(bo))]]],[["Availability",[So],3,1,!1,!1,null],["TimeSourceONo",[d],3,2,!1,!1,null],["Offset",[gt],3,3,!1,!1,null],["CurrentRate",[bo],3,4,!1,!1,null],["SupportedRates",[pt(d,R(bo))],3,5,!1,!1,null]],[]);class wo extends(D({Undefined:0,None:1,Private:2,NTP:3,SNTP:4,IEEE1588_2002:5,IEEE1588_2008:6,IEEE_AVB:7,AES11:8,Genlock:9})){}const Co=Z(wo);class _o extends(D({Undefined:0,Local:1,Private:2,GPS:3,Galileo:4,GLONASS:5})){}const Po=Z(_o);class vo extends(D({Unavailable:0,Available:1})){}const Go=Z(vo);class Do extends(D({Undefined:0,Unsynchronized:1,Synchronizing:2,Synchronized:3})){}const To=Z(Do),Mo=me("OcaTimeSource",3,"",1,gs,[["GetAvailability",3,1,[],[Go]],["GetProtocol",3,2,[],[Co]],["SetProtocol",3,3,[Co],[]],["GetParameters",3,4,[],[z]],["SetParameters",3,5,[z],[]],["GetReferenceType",3,6,[],[Po]],["SetReferenceType",3,7,[Po],[]],["GetReferenceID",3,8,[],[z]],["SetReferenceID",3,9,[z],[]],["GetSyncStatus",3,10,[],[To]],["Reset",3,11,[],[]]],[["Availability",[Go],3,1,!1,!1,null],["Protocol",[Co],3,2,!1,!1,null],["Parameters",[z],3,3,!1,!1,null],["ReferenceType",[Po],3,4,!1,!1,null],["ReferenceID",[z],3,5,!1,!1,null],["SyncStatus",[To],3,6,!1,!1,null]],[]);class Io extends(D({Robotic:1,ItuAudioObjectBasedPolar:2,ItuAudioObjectBasedCartesian:3,ItuAudioSceneBasedPolar:4,ItuAudioSceneBasedCartesian:5,NAV:6,ProprietaryBase:128})){}const Ao=Z(Io);const Lo=x;class Eo{constructor(e,t,n){this.CoordinateSystem=e,this.FieldFlags=t,this.Values=n}}const ko=l({CoordinateSystem:Ao,FieldFlags:Lo,Values:(xo=en,No=6,we(...new Array(No).fill(xo)))},Eo);var xo,No;const Uo=me("OcaPhysicalPosition",3,"",1,gs,[["GetCoordinateSystem",3,1,[],[Ao]],["GetPositionDescriptorFieldFlags",3,2,[],[Lo]],["GetPositionDescriptor",3,3,[],[ko,ko,ko]],["SetPositionDescriptor",3,4,[ko],[]]],[["CoordinateSystem",[Ao],3,1,!0,!1,null],["PositionDescriptorFieldFlags",[Lo],3,2,!0,!1,null],["PositionDescriptor",[ko],3,3,!1,!1,null]],[]);class Ro extends(D({None:0,Prepare:1,Start:2,Pause:3,Stop:4,Reset:5})){}const Fo=Z(Ro);class Bo extends(D({Unknown:0,NotReady:1,Readying:2,Ready:3,Running:4,Paused:5,Stopping:6,Stopped:7,Fault:8})){}const Vo=Z(Bo);class jo{constructor(e,t){this.SystemInterfaceParameters=e,this.MyNetworkAddress=t}}const zo=l({SystemInterfaceParameters:L,MyNetworkAddress:L},jo),qo=me("OcaApplicationNetwork",2,"",1,Pe,[["GetLabel",2,1,[],[z]],["SetLabel",2,2,[z],[]],["GetOwner",2,3,[],[d]],["GetServiceID",2,4,[],[L]],["SetServiceID",2,5,[L],[]],["GetSystemInterfaces",2,6,[],[R(zo)]],["SetSystemInterfaces",2,7,[R(zo)],[]],["GetState",2,8,[],[Vo]],["GetErrorCode",2,9,[],[c]],["Control",2,10,[Fo],[]],["GetPath",2,11,[],[R(z),R(d)]]],[["Label",[z],2,1,!1,!0,null],["Owner",[d],2,2,!1,!0,null],["ServiceID",[L],2,3,!1,!1,null],["SystemInterfaces",[R(zo)],2,4,!1,!1,null],["State",[Vo],2,5,!1,!1,null],["ErrorCode",[c],2,6,!1,!1,null]],[]);class Ho extends(D({None:0,OCP01:1,OCP02:2,OCP03:3})){}const Wo=Z(Ho),Ko=me("OcaControlNetwork",3,"",1,qo,[["GetControlProtocol",3,1,[],[Wo]]],[["Protocol",[Wo],3,1,!1,!1,["ControlProtocol"]]],[]);class $o{constructor(e,t,n){this.CodingSchemeID=e,this.CodecParameters=t,this.ClockONo=n}}const Xo=l({CodingSchemeID:c,CodecParameters:z,ClockONo:d},$o);class Yo extends(D({None:0,Unicast:1,Multicast:2})){}const Qo=Z(Yo);class Jo{constructor(e,t,n,r){this.Secure=e,this.StreamParameters=t,this.StreamCastMode=n,this.StreamChannelCount=r}}const Zo=l({Secure:k,StreamParameters:L,StreamCastMode:Qo,StreamChannelCount:c},Jo);class ei extends(D({None:0,Start:1,Pause:2})){}const ti=Z(ei);class ni extends(D({Stopped:0,SettingUp:1,Running:2,Paused:3,Fault:4})){}const ri=Z(ni);class si{constructor(e,t,n){this.ConnectorID=e,this.State=t,this.ErrorCode=n}}const oi=l({ConnectorID:c,State:ri,ErrorCode:c},si);class ii{constructor(e){this.ConnectorStatus=e}}const ai=l({ConnectorStatus:oi},ii);function ci(e,t){const n=e.encodedLength,r=e.encodeTo,s=e.decodeFrom,o=e.decodeLength,i=t.encodedLength,c=t.encodeTo,l=t.decodeFrom,u=t.decodeLength;return a({isConstantLength:!1,encodedLength:function(e){if(!(e instanceof Map||e instanceof WeakMap))throw new TypeError("Expected Map or WeakMap");let t=2;return e.forEach((e,r)=>{t+=n(r)*e.size,e.forEach(e=>{t+=i(e)})}),t},encodeTo:function(e,t,n){const s=t;let o=0;return t+=2,n.forEach((n,s)=>{o+=n.size,n.forEach(n=>{t=r(e,t,s),t=c(e,t,n)})}),e.setUint16(s,o),t},decodeFrom:function(e,t){const n=new Map,r=e.getUint16(t);t+=2;for(let o=0;o<r;o++){let r,o;[t,r]=s(e,t),[t,o]=l(e,t);let i=n.get(r);i||n.set(r,i=new Set),i.add(o)}return[t,n]},decodeLength:function(e,t){const n=e.getUint16(t);t+=2;for(let r=0;r<n;r++)t=o(e,t),t=u(e,t);return t}})}class li{constructor(e,t,n,r,s,o,i,a,c){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=s,this.ChannelPinMap=o,this.AlignmentLevel=i,this.AlignmentGain=a,this.CurrentCoding=c}}const ui=l({IDInternal:c,IDExternal:z,Connection:Zo,AvailableCodings:R(Xo),PinCount:c,ChannelPinMap:ci(c,Kt),AlignmentLevel:en,AlignmentGain:en,CurrentCoding:Xo},li),hi=x;class di{constructor(e,t,n){this.SinkConnector=e,this.ChangeType=t,this.ChangedElement=n}}const gi=l({SinkConnector:ui,ChangeType:Oe,ChangedElement:hi},di);class fi{constructor(e,t,n,r,s,o,i,a){this.IDInternal=e,this.IDExternal=t,this.Connection=n,this.AvailableCodings=r,this.PinCount=s,this.ChannelPinMap=o,this.AlignmentLevel=i,this.CurrentCoding=a}}const pi=l({IDInternal:c,IDExternal:z,Connection:Zo,AvailableCodings:R(Xo),PinCount:c,ChannelPinMap:pt(c,Kt),AlignmentLevel:en,CurrentCoding:Xo},fi);class mi{constructor(e,t,n){this.SourceConnector=e,this.ChangeType=t,this.ChangedElement=n}}const Si=l({SourceConnector:pi,ChangeType:Oe,ChangedElement:hi},mi);class yi extends(D({None:0,AV3:1,AVBTP:2,Dante:3,Cobranet:4,AES67:5,SMPTEAudio:6,LiveWire:7,ExtensionPoint:65})){}const bi=Z(yi),Oi=me("OcaMediaTransportNetwork",3,"",1,qo,[["GetMediaProtocol",3,1,[],[bi]],["GetPorts",3,2,[],[R(Xt)]],["GetPortName",3,3,[Kt],[z]],["SetPortName",3,4,[Kt,z],[]],["GetMaxSourceConnectors",3,5,[],[c]],["GetMaxSinkConnectors",3,6,[],[c]],["GetMaxPinsPerConnector",3,7,[],[c]],["GetMaxPortsPerPin",3,8,[],[c]],["GetSourceConnectors",3,9,[],[R(pi)]],["GetSourceConnector",3,10,[c],[pi]],["GetSinkConnectors",3,11,[],[R(ui)]],["GetSinkConnector",3,12,[c],[ui]],["GetConnectorsStatuses",3,13,[],[R(oi)]],["GetConnectorStatus",3,14,[c],[oi]],["AddSourceConnector",3,15,[pi,ri],[pi]],["AddSinkConnector",3,16,[oi,ui],[ui]],["ControlConnector",3,17,[c,ti],[]],["SetSourceConnectorPinMap",3,18,[c,pt(c,Kt)],[]],["SetSinkConnectorPinMap",3,19,[c,ci(c,Kt)],[]],["SetConnectorConnection",3,20,[c,Zo],[]],["SetConnectorCoding",3,21,[c,Xo],[]],["SetConnectorAlignmentLevel",3,22,[c,en],[]],["SetConnectorAlignmentGain",3,23,[c,en],[]],["DeleteConnector",3,24,[c],[]],["GetAlignmentLevel",3,25,[],[en,en,en]],["GetAlignmentGain",3,26,[],[en,en,en]]],[["Protocol",[bi],3,1,!1,!1,["MediaProtocol"]],["Ports",[R(Xt)],3,2,!1,!1,null],["MaxSourceConnectors",[c],3,3,!1,!1,null],["MaxSinkConnectors",[c],3,4,!1,!1,null],["MaxPinsPerConnector",[c],3,5,!1,!1,null],["MaxPortsPerPin",[c],3,6,!1,!1,null],["AlignmentLevel",[en],3,7,!1,!1,null],["AlignmentGain",[en],3,8,!1,!1,null]],[["SourceConnectorChanged",3,1,[Si]],["SinkConnectorChanged",3,2,[gi]],["ConnectorStatusChanged",3,3,[ai]]]);class wi extends(D({None:0,Source:1,Sink:2})){}const Ci=Z(wi);class _i extends(D({NotConnected:0,Connected:1,Muted:2})){}const Pi=Z(_i),vi=me("OcaNetworkSignalChannel",3,"",2,tn,[["GetIDAdvertised",3,1,[],[L]],["SetIDAdvertised",3,2,[L],[]],["GetNetwork",3,3,[],[d]],["SetNetwork",3,4,[d],[]],["GetConnectorPins",3,5,[],[pt(d,c)]],["AddToConnector",3,6,[d,c],[]],["RemoveFromConnector",3,7,[d],[]],["GetRemoteChannelID",3,8,[],[L]],["SetRemoteChannelID",3,9,[L],[]],["GetSourceOrSink",3,10,[],[Ci]],["GetStatus",3,11,[],[Pi]]],[["IDAdvertised",[L],3,1,!1,!1,null],["Network",[d],3,2,!1,!1,null],["ConnectorPins",[pt(d,c)],3,3,!1,!1,null],["RemoteChannelID",[L],3,4,!1,!1,null],["SourceOrSink",[Ci],3,5,!1,!1,null],["Status",[Pi],3,6,!1,!1,null]],[]);class Gi extends(D({None:0,EthernetWired:1,EthernetWireless:2,USB:3,SerialP2P:4})){}const Di=Z(Gi);class Ti{constructor(e,t){this.rxPacketErrors=e,this.txPacketErrors=t}}const Mi=l({rxPacketErrors:d,txPacketErrors:d},Ti);class Ii extends(D({Unknown:0,Ready:1,StartingUp:2,Stopped:3})){}const Ai=Z(Ii);class Li{constructor(e,t){this.SystemInterfaceHandle=e,this.MyNetworkAddress=t}}const Ei=l({SystemInterfaceHandle:L,MyNetworkAddress:L},Li),ki=me("OcaNetwork",3,"",2,gs,[["GetLinkType",3,1,[],[Di]],["GetIDAdvertised",3,2,[],[L]],["SetIDAdvertised",3,3,[L],[]],["GetControlProtocol",3,4,[],[Wo]],["GetMediaProtocol",3,5,[],[bi]],["GetStatus",3,6,[],[Ai]],["GetStatistics",3,7,[],[Mi]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Ei)]],["SetSystemInterfaces",3,10,[R(Ei)],[]],["GetMediaPorts",3,11,[],[R(d)]],["Startup",3,12,[],[]],["Shutdown",3,13,[],[]]],[["LinkType",[Di],3,1,!0,!1,null],["IDAdvertised",[L],3,2,!1,!1,null],["ControlProtocol",[Wo],3,3,!1,!1,null],["MediaProtocol",[bi],3,4,!1,!1,null],["Status",[Ai],3,5,!1,!1,null],["SystemInterfaces",[R(Ei)],3,6,!1,!1,null],["MediaPorts",[R(d)],3,7,!1,!1,null],["Statistics",[Mi],3,8,!1,!1,null]],[]);class xi extends(D({Undefined:0,Locked:1,Synchronizing:2,FreeRun:3,Stopped:4})){}const Ni=Z(xi),Ui=me("OcaMediaClock",3,"",2,gs,[["GetType",3,1,[],[Xe]],["SetType",3,2,[Xe],[]],["GetDomainID",3,3,[],[c]],["SetDomainID",3,4,[c],[]],["GetSupportedRates",3,5,[],[R(bo)]],["GetCurrentRate",3,6,[],[bo]],["SetCurrentRate",3,7,[bo],[]],["GetLockState",3,8,[],[Ni]]],[["Type",[Xe],3,1,!1,!1,null],["DomainID",[c],3,2,!1,!1,null],["RatesSupported",[R(bo)],3,3,!1,!1,null],["CurrentRate",[bo],3,4,!1,!1,null],["LockState",[Ni],3,5,!1,!1,null]],[]),Ri=me("OcaStreamNetwork",3,"\n",2,gs,[["GetLinkType",3,1,[],[Di]],["GetIDAdvertised",3,2,[],[L]],["SetIDAdvertised",3,3,[L],[]],["GetControlProtocol",3,4,[],[Wo]],["GetMediaProtocol",3,5,[],[bi]],["GetStatus",3,6,[],[Ai]],["GetStatistics",3,7,[],[Mi]],["ResetStatistics",3,8,[],[]],["GetSystemInterfaces",3,9,[],[R(Ei)]],["SetSystemInterfaces",3,10,[R(Ei)],[]],["GetStreamConnectorsSource",3,11,[],[R(d)]],["SetStreamConnectorsSource",3,12,[R(d)],[]],["GetStreamConnectorsSink",3,13,[],[R(d)]],["SetStreamConnectorsSink",3,14,[R(d)],[]],["GetSignalChannelsSource",3,15,[],[R(d)]],["SetSignalChannelsSource",3,16,[R(d)],[]],["GetSignalChannelsSink",3,17,[],[R(d)]],["SetSignalChannelsSink",3,18,[R(d)],[]],["Startup",3,19,[],[]],["Shutdown",3,20,[],[]]],[["LinkType",[Di],3,1,!0,!1,null],["IDAdvertised",[L],3,2,!1,!1,null],["ControlProtocol",[Wo],3,3,!1,!1,null],["MediaProtocol",[bi],3,4,!1,!1,null],["Status",[Ai],3,5,!1,!1,null],["SystemInterfaces",[R(Ei)],3,6,!1,!1,null],["StreamConnectorsSource",[R(d)],3,7,!1,!1,null],["StreamConnectorsSink",[R(d)],3,8,!1,!1,null],["SignalChannelsSource",[R(d)],3,9,!1,!1,null],["SignalChannelsSink",[R(d)],3,10,!1,!1,null],["Statistics",[Mi],3,11,!1,!1,null]],[]);class Fi{constructor(e,t,n,r){this.HostID=e,this.NetworkAddress=t,this.NodeID=n,this.StreamConnectorID=r}}const Bi=l({HostID:L,NetworkAddress:L,NodeID:L,StreamConnectorID:L},Fi);class Vi extends(D({NotConnected:0,Connected:1,Paused:2})){}const ji=Z(Vi);class zi extends(D({None:0,Unicast:1,Multicast:2})){}const qi=Z(zi);class Hi{constructor(e,t,n,r,s,o,i,a,c,l,u){this.ErrorNumber=e,this.IDAdvertised=t,this.Index=n,this.Label=r,this.LocalConnectorONo=s,this.Priority=o,this.RemoteConnectorIdentification=i,this.Secure=a,this.Status=c,this.StreamParameters=l,this.StreamType=u}}const Wi=l({ErrorNumber:c,IDAdvertised:L,Index:c,Label:z,LocalConnectorONo:d,Priority:c,RemoteConnectorIdentification:Bi,Secure:k,Status:ji,StreamParameters:L,StreamType:qi},Hi);class Ki extends(D({NotAvailable:0,Idle:1,Connected:2,Paused:3})){}const $i=Z(Ki),Xi=me("OcaStreamConnector",3,"\v",2,gs,[["GetOwnerNetwork",3,1,[],[d]],["SetOwnerNetwork",3,2,[d],[]],["GetIDAdvertised",3,3,[],[L]],["SetIDAdvertised",3,4,[L],[]],["GetSourceOrSink",3,5,[],[Ci]],["SetSourceOrSink",3,6,[Ci],[]],["ConnectStream",3,7,[Wi],[c]],["DisconnectStream",3,8,[c],[]],["GetStreams",3,9,[],[pt(c,Wi)]],["GetPins",3,10,[],[pt(c,d)]],["GetStatus",3,11,[],[$i]]],[["OwnerNetwork",[d],3,1,!1,!1,null],["IDAdvertised",[L],3,2,!1,!1,null],["SourceOrSink",[Ci],3,3,!1,!1,null],["Streams",[pt(c,Wi)],3,4,!1,!1,null],["Pins",[pt(c,d)],3,5,!1,!1,null],["Status",[$i],3,6,!1,!1,null]],[]);var Yi=Object.freeze({__proto__:null,OcaRoot:Pe,OcaWorker:tn,OcaActuator:rn,OcaMute:an,OcaPolarity:un,OcaSwitch:hn,OcaGain:dn,OcaPanBalance:gn,OcaDelay:fn,OcaDelayExtended:bn,OcaFrequencyActuator:On,OcaFilterClassical:Gn,OcaFilterParametric:Mn,OcaFilterPolynomial:In,OcaFilterFIR:An,OcaFilterArbitraryCurve:kn,OcaDynamics:zn,OcaDynamicsDetector:qn,OcaDynamicsCurve:Hn,OcaSignalGenerator:Yn,OcaSignalInput:Qn,OcaSignalOutput:Jn,OcaTemperatureActuator:Zn,OcaIdentificationActuator:er,OcaSummingPoint:tr,OcaBasicActuator:nr,OcaBooleanActuator:rr,OcaInt8Actuator:or,OcaInt16Actuator:ar,OcaInt32Actuator:lr,OcaInt64Actuator:dr,OcaUint8Actuator:gr,OcaUint16Actuator:fr,OcaUint32Actuator:pr,OcaUint64Actuator:mr,OcaFloat32Actuator:Sr,OcaFloat64Actuator:br,OcaStringActuator:Or,OcaBitstringActuator:Pr,OcaSensor:Dr,OcaLevelSensor:Tr,OcaAudioLevelSensor:Ar,OcaTimeIntervalSensor:Lr,OcaFrequencySensor:Er,OcaTemperatureSensor:kr,OcaIdentificationSensor:xr,OcaVoltageSensor:Nr,OcaCurrentSensor:Ur,OcaImpedanceSensor:Br,OcaGainSensor:Vr,OcaBasicSensor:jr,OcaBooleanSensor:zr,OcaInt8Sensor:qr,OcaInt16Sensor:Hr,OcaInt32Sensor:Wr,OcaInt64Sensor:Kr,OcaUint8Sensor:$r,OcaUint16Sensor:Xr,OcaUint32Sensor:Yr,OcaFloat32Sensor:Qr,OcaFloat64Sensor:Jr,OcaStringSensor:Zr,OcaBitstringSensor:es,OcaUint64Sensor:ts,OcaBlock:nn,OcaBlockFactory:us,OcaMatrix:ds,OcaAgent:gs,OcaGrouper:Ts,OcaRamper:Vs,OcaNumericObserver:$s,OcaLibrary:ro,OcaPowerSupply:uo,OcaEventHandler:ho,OcaNumericObserverList:po,OcaMediaClock3:Oo,OcaTimeSource:Mo,OcaPhysicalPosition:Uo,OcaApplicationNetwork:qo,OcaControlNetwork:Ko,OcaMediaTransportNetwork:Oi,OcaManager:ve,OcaDeviceManager:Ge,OcaSecurityManager:De,OcaFirmwareManager:Le,OcaSubscriptionManager:ze,OcaPowerManager:We,OcaNetworkManager:Ke,OcaMediaClockManager:Ye,OcaLibraryManager:rt,OcaAudioProcessingManager:st,OcaDeviceTimeManager:ft,OcaTaskManager:It,OcaCodingManager:At,OcaDiagnosticManager:Lt,OcaNetworkSignalChannel:vi,OcaNetwork:ki,OcaMediaClock:Ui,OcaStreamNetwork:Ri,OcaStreamConnector:Xi});const Qi={DeviceManager:1,SecurityManager:2,FirmwareManager:3,SubscriptionManager:4,PowerManager:5,NetworkManager:6,MediaClockManager:7,LibraryManager:8,AudioProcessingManager:9,DeviceTimeManager:10,TaskManager:11,CodingManager:12,DiagnosticManager:13};function Ji(e){const t=e.EmitterONo,n=e.EventID;return[t,n.DefLevel,n.EventIndex].join(",")}const Zi={ONo:1055,MethodID:{DefLevel:1,MethodIndex:1}};const ea=Object.values(Yi);function ta(e){return new Promise(t=>setTimeout(t,e))}function na(e,t,n){let r;if("string"==typeof t){if(r=t,!(t=e.get_properties().find_property(r)))throw new Error(`Could not find property ${r} in ${e.ClassName}`)}else r=t.name;if(t.static)return n(!0,e[r]),()=>{};let s=null;const o=t=>{try{n(!0,s,t)}catch(t){console.error("Subscriber",n,"to property",r,"in",e,"threw exception",t)}},i=(e,t,n)=>{if(null!==s){switch(t.value){case 1:return s instanceof v?(s.values[0]=e,void o(0)):(s=e,void o());case 2:if(s instanceof v)return s.values[1]=e,void o(1);break;case 3:if(s instanceof v)return s.values[2]=e,void o(2)}console.warn("Unhandled event",e,t,n)}};let a=!0;const c=t.event(e),l=t.getter(e);if(!l)throw new Error(`Not getter found for ${r} in ${e.ClassName}`);if(c){const e=c.subscribe(i);e&&e.catch(e=>{a&&n(!1,e)})}return l((e,t)=>{a&&(e?(s=t,o()):n(!1,t))}),()=>{a=!1,c&&c.unsubscribe(i)}}function ra(e,t){if("object"==typeof t){if(t instanceof v)return{[e]:t.item(0),["Min"+e]:t.item(1),["Max"+e]:t.item(2)};t=function e(t){if("object"==typeof t){if(t instanceof Uint8Array)return Array.from(t);if(null!==t&&t.isEnum)return t.name;for(const n in t)t[n]=e(t[n]);return t}return t}(t)}return{[e]:t}}async function sa(e){const t={type:e.ClassName,ObjectNumber:e.ObjectNumber},n=await e.GetClassIdentification();return Object.assign(t,function(e){const{ClassVersion:t,ClassID:n}=e;return{ClassVersion:t,ClassID:n.split("").map(e=>e.charCodeAt(0)).join(".")}}(n)),await Promise.all(e.get_properties().forEach(async n=>{const{name:r}=n;if("ClassID"===r||"ClassVersion"===r||"Owner"===r||"ObjectNumber"===r)return;if(e instanceof nn&&"Members"===r)return;const s=n.getter(e);if(s)try{const e=await s();Object.assign(t,ra(r,e))}catch(t){8!=t.status&&console.error("Fetching property",e.ClassName,n.name,"failed:",t)}})),t}async function oa(e){try{return await e.GetClassIdentification(),!0}catch(e){if(5!=e.status)throw e;return!1}}class ia extends(D({None:0,ParamSet:1,Patch:2,Program:3})){}class aa extends(D({Ampere:4,DegreeCelsius:2,Hertz:1,None:0,Ohm:5,Volt:3})){}var ca=Object.freeze({__proto__:null,OcaApplicationNetworkCommand:Ro,OcaApplicationNetworkState:Bo,OcaBaseDataType:Ms,OcaBlockMember:xt,OcaClassAuthorityID:class{constructor(e,t,n){this.Sentinel=e,this.Reserved=t,this.OrganizationID=n}},OcaClassIdentification:Se,OcaClassicalFilterShape:wn,OcaComponent:Te,OcaDBr:xn,OcaDelayUnit:pn,OcaDelayValue:Sn,OcaDeviceState:{Operational:1,Disabled:2,Error:4,Initializing:8,Updating:16},OcaDynamicsFunction:Un,OcaEnumItem:class{constructor(e){this.Value=e}},OcaEnumItem16:class{constructor(e){this.Value=e}},OcaEvent:g,OcaEventID:u,OcaFilterPassband:_n,OcaGlobalTypeIdentifier:Ut,OcaGrouperCitizen:ms,OcaGrouperEnrollment:ys,OcaGrouperGroup:Os,OcaGrouperMode:Cs,OcaGrouperStatusChangeEventData:Gs,OcaGrouperStatusChangeType:Ps,OcaImpedance:Rr,OcaLevelDetectionLaw:Fn,OcaLevelMeterLaw:Mr,OcaLibAccess:Xs,OcaLibParamSetAssignment:class{constructor(e,t){this.ParamSetIdentifier=e,this.TargetBlockONo=t}},OcaLibVol:Zs,OcaLibVolChangedEventData:to,OcaLibVolData_ParamSet:Ft,OcaLibVolIdentifier:Qe,OcaLibVolMetadata:Qs,OcaLibVolStandardTypeID:ia,OcaLibVolType:Ze,OcaLibraryIdentifier:tt,OcaManagerDefaultObjectNumbers:Qi,OcaManagerDescriptor:H,OcaMediaClockAvailability:mo,OcaMediaClockLockState:xi,OcaMediaClockRate:yo,OcaMediaClockType:$e,OcaMediaCoding:$o,OcaMediaConnection:Jo,OcaMediaConnectorCommand:ei,OcaMediaConnectorElement:{PinMap:1,Connection:2,Coding:4,AlignmentLevel:8,AlignmentGain:16},OcaMediaConnectorState:ni,OcaMediaConnectorStatus:si,OcaMediaConnectorStatusChangedEventData:ii,OcaMediaSinkConnector:li,OcaMediaSinkConnectorChangedEventData:di,OcaMediaSourceConnector:fi,OcaMediaSourceConnectorChangedEventData:mi,OcaMediaStreamCastMode:Yo,OcaMethod:xe,OcaMethodID:Ee,OcaModelDescription:K,OcaModelGUID:X,OcaMuteState:sn,OcaNetworkControlProtocol:Ho,OcaNetworkLinkType:Gi,OcaNetworkMediaProtocol:yi,OcaNetworkMediaSourceOrSink:wi,OcaNetworkSignalChannelStatus:_i,OcaNetworkStatistics:Ti,OcaNetworkStatus:Ii,OcaNetworkSystemInterfaceDescriptor:jo,OcaNetworkSystemInterfaceID:Li,OcaNotificationDeliveryMode:Ue,OcaOPath:fs,OcaObjectIdentification:Et,OcaObjectListEventData:Fe,OcaObjectSearchResult:Vt,OcaObjectSearchResultFlags:{ONo:1,ClassIdentification:2,ContainerPath:4,Role:8,Label:16},OcaObservationEventData:js,OcaObservationListEventData:go,OcaObserverState:qs,OcaParametricEQShape:Dn,OcaPilotToneDetectorSpec:class{constructor(e,t,n){this.Threshold=e,this.Frequency=t,this.PollInterval=n}},OcaPolarityState:cn,OcaPort:$t,OcaPortID:Wt,OcaPortMode:qt,OcaPositionCoordinateSystem:Io,OcaPositionDescriptor:Eo,OcaPowerState:qe,OcaPowerSupplyLocation:so,OcaPowerSupplyState:io,OcaPowerSupplyType:co,OcaPresentationUnit:Vn,OcaProperty:Es,OcaPropertyChangeType:ie,OcaPropertyDescriptor:As,OcaPropertyID:ce,OcaProtoObjectIdentification:ns,OcaProtoPort:is,OcaProtoPortID:ss,OcaProtoSignalPath:cs,OcaRamperCommand:xs,OcaRamperInterpolationLaw:Us,OcaRamperState:Fs,OcaRelationalOperator:Ws,OcaResetCause:ee,OcaSensorReadingState:vr,OcaSignalPath:Yt,OcaStatus:T,OcaStream:Hi,OcaStreamConnectorIdentification:Fi,OcaStreamConnectorStatus:Ki,OcaStreamStatus:Vi,OcaStreamType:zi,OcaStringComparisonType:Jt,OcaSubscriptionManagerState:Ve,OcaSweepType:Wn,OcaTask:yt,OcaTaskCommand:Ot,OcaTaskManagerState:Ct,OcaTaskState:Pt,OcaTaskStateChangedEventData:Tt,OcaTaskStatus:Gt,OcaTimeMode:mt,OcaTimePTP:dt,OcaTimeProtocol:wo,OcaTimeReferenceType:_o,OcaTimeSourceAvailability:vo,OcaTimeSourceSyncStatus:Do,OcaTransferFunction:Ln,OcaUnitOfMeasure:aa,OcaVersion:Ie,OcaWaveformType:$n});class la extends A{constructor(e,t){super(t),this.ws=e,this._onmessage=e=>{try{this.read(e.data)}catch(e){this.emit("error",e)}},this._onclose=()=>{this.emit("close")},this._onerror=e=>{this.emit("error",e)},e.binaryType="arraybuffer",e.addEventListener("message",this._onmessage),e.addEventListener("close",this._onclose),e.addEventListener("error",this._onerror)}write(e){this.ws.send(e),super.write(e)}static connect(e,t){return new Promise((n,r)=>{const s=new e(t.url),o=function(e){r(e)};s.addEventListener("open",()=>{s.removeEventListener("error",o),n(new this(s,t))}),s.addEventListener("error",o)})}cleanup(){super.cleanup();const e=this.ws;if(e){this.ws=null;try{e.removeEventListener("message",this._onmessage),e.removeEventListener("close",this._onclose),e.removeEventListener("error",this._onerror),e.close()}catch(e){}}}}var ua=Object.freeze({__proto__:null,warn:e,log:function(...e){try{console.log(...e)}catch(e){}},error:t,Connection:_,Command:o,CommandRrq:i,Response:m,Notification:p,KeepAlive:S,messageHeaderSize:10,encodeMessageTo:O,encodeMessage:w,decodeMessage:b,ClientConnection:A,RemoteDevice:class extends n{constructor(e,...t){super(),this.objects=new Map,this.connection=e,this._stackDebug=!1,e.on("error",e=>{this.emit("error",e)}),e.on("close",e=>{this.emit("close",e)}),this.modules=[],this.add_control_classes(Object.values(Yi)),t.map(e=>this.add_control_classes(e)),this.DeviceManager=new Ge(Qi.DeviceManager,this),this.SecurityManager=new De(Qi.SecurityManager,this),this.FirmwareManager=new Le(Qi.FirmwareManager,this),this.SubscriptionManager=new ze(Qi.SubscriptionManager,this),this.PowerManager=new We(Qi.PowerManager,this),this.NetworkManager=new Ke(Qi.NetworkManager,this),this.MediaClockManager=new Ye(Qi.MediaClockManager,this),this.LibraryManager=new rt(Qi.LibraryManager,this),this.AudioProcessingManager=new st(Qi.AudioProcessingManager,this),this.DeviceTimeManager=new ft(Qi.DeviceTimeManager,this),this.TaskManager=new It(Qi.TaskManager,this),this.CodingManager=new At(Qi.CodingManager,this),this.DiagnosticManager=new Lt(Qi.DiagnosticManager,this),this.Root=new nn(100,this),this.subscriptions=new Map}close(){this.connection.close()}send_command(e,t,n){const r=this._stackDebug?(new Error).stack:null;return this.connection.send_command(e,t,n,r)}_doSubscribe(e){return this.SubscriptionManager.AddSubscription(e,Zi,new Uint8Array(0),Ue.Reliable,new Uint8Array(0))}async add_subscription(n,r){if(this.connection.is_closed())throw new Error("Connection was closed.");const s=Ji(n),o=this.subscriptions;{const e=o.get(s);if(e)return e.callbacks.add(r),!0}const i=n=>{const r=this.subscriptions.get(s);if(!r)return void e("Subscription lost.");r.callbacks.forEach((function(e){try{e(n)}catch(e){t(e)}}))};this.connection._addSubscriber(n,i);const a={callbacks:new Set([r]),callback:i};o.set(s,a);try{await this._doSubscribe(n)}catch(e){throw o.delete(s),e}}remove_subscription(e,t){const n=Ji(e),r=this.subscriptions.get(n);if(!r)return Promise.reject("Callback not registered.");const s=r.callbacks;return s.delete(t),s.size?Promise.resolve(!0):(this.connection._removeSubscriber(e),this.subscriptions.delete(n),this.SubscriptionManager.RemoveSubscription(e,Zi))}find_best_class(e){for("object"==typeof e&&e.ClassID&&(e=e.ClassID);e.length;){const t=this.find_class_by_id(e);if(t)return t;e=e.substr(0,e.length-1)}return null}add_control_classes(e){if(Array.isArray(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.ClassID]=r}e=t}else if("object"!=typeof e)throw new Error("Unsupported module.");this.modules.push(e)}find_class_by_id(e){"object"==typeof e&&e.ClassID&&(e=e.ClassID);const t=this.modules;for(let n=t.length-1;n>=0;n--){const r=t[n][e];if(r)return r}return null}allocate(e,t){"object"==typeof t&&(t=t.valueOf());const n=this.objects;return n.has(t)||n.set(t,new e(t,this)),n.get(t)}resolve_object(e){if("MemberObjectIdentification"in e)return this.resolve_object(e.MemberObjectIdentification);if("ONo"in e&&"ClassIdentification"in e){const t=e.ONo,n=e.ClassIdentification;return this.allocate(this.find_best_class(n),t)}throw new TypeError("Expected OcaObjectIdentification or OcaBlockMember")}GetDeviceTree(){const e=t=>t.GetMembers().then(t=>{const n=[];t=t.map(this.resolve_object,this);for(let r=0;r<t.length;r++)n.push(Promise.resolve(t[r])),t[r].ClassID.startsWith(nn.ClassID)&&n.push(e(t[r]));return Promise.all(n)});return e(this.Root)}get_device_tree(){return this.GetDeviceTree()}get_role_map(e){return this.get_device_tree().then((function(t){return function(e,t){const n=new Map;t||(t="/");const r=[],s=e=>{Array.isArray(e)?e.forEach(s):r.push(e.GetRole().then(t=>{n.set(e,t)}))};return e.forEach(s),Promise.all(r).then((function(){const r=new Map,s=(e,o)=>{const i=null!=o?o+t:"",a=new Map;e.forEach((function(e,t){if(Array.isArray(e))return;const r=n.get(e);if(a.has(r)){const t=a.get(r);Array.isArray(t)?t.push(e):a.set(r,[t,e])}else a.set(r,e)})),a.forEach((function(e,t){if(Array.isArray(e)){let n=1;for(let r=0;r<e.length;r++){let s;for(;a.has(s=t+n);)n++;a.set(s,e[r]),a.set(e[r],s)}a.delete(t)}else a.set(e,t)})),e.forEach((t,n)=>{if(Array.isArray(t))s(t,i+a.get(e[n-1]));else{const e=i+a.get(t);r.set(e,t)}})};return s(e,null),r}))}(t,e)}))}discover_all_fallback(){return this.GetDeviceTree().then(e=>{const t=[],n=function(e){for(let r=0;r<e.length;r++)Array.isArray(e[r])?n(e[r]):t.push(e[r])};return n(e),t})}discover_all(){return this.Root.GetMembersRecursive().then(e=>e.map(this.resolve_object,this)).catch(()=>this.discover_all_fallback())}set_keepalive_interval(e){this.connection.set_keepalive_interval(e)}enable_stack_debug(e){this._stackDebug=!!e}},define_custom_class:function(e,t,n,r,s,o,i,a){if(n=String.fromCharCode.apply(String,n.split(".").map(e=>parseInt(e))),s){if("string"==typeof s)for(let e=0;e<ea.length;e++)if(ea[e].ClassName===s){s=ea[e];break}}else{const e=n.substr(0,n.length-1);for(let t=0;t<ea.length;t++)if(ea[t].ClassID===e){s=ea[t];break}}if("function"!=typeof s)throw new Error("Unknown parent class.");return me(e,t,n,r,s,o,i,a)},AbstractUDPConnection:class extends A{constructor(e,t){t.batch>=0||(t.batch=128),super(t),this.socket=e,this.delay=t.delay>=0?t.delay:5,this.retry_interval=t.retry_interval>=0?t.retry_interval:250,this.retry_count=t.retry_count>=0?t.retry_count:3,this._write_out_id=-1,this._write_out_callback=()=>{this._write_out_id=-1,this._write_out()},this._retry_id=this.retry_interval>0?setInterval(()=>this._retryCommands(),this.retry_interval):-1,this.q=[],e.onmessage=e=>{try{this.read(e)}catch(e){console.warn("Failed to parse incoming AES70 packet: %o",e)}null!==this.inbuf&&this.close()},e.onerror=e=>this.error(e),this.set_keepalive_interval(1)}get is_reliable(){return!1}static async connect(e,t){const n=await e.connect(t.host,t.port,t.type);return await async function(e,t){const n=e.receiveMessage().then(e=>{const t=[],n=b(new DataView(e),0,t);if(1!==t.length)throw new Error("Expected keepalive response.");if(n!==e.byteLength)throw new Error("Trailing data in initial keepalive pdu.");return!0}),r=w(new S(1e3)),s=5*(t.retry_interval||250);for(let t=0;t<3;t++)if(e.send(r),await Promise.race([n,ta(s)]))return;throw new Error("Failed to connect.")}(n,t),new this(n,t)}write(e){this.q.push(e),this.tx_idle_time()>=this.delay?this._write_out():this._schedule_write_out()}flush(){super.flush(),this.tx_idle_time()>this.delay&&this._write_out()}cleanup(){super.cleanup(),this.socket&&(this.socket.close(),this.socket=null),-1!==this._write_out_id&&(clearTimeout(this._write_out_id),this._write_out_id=-1),-1!==this._retry_id&&(clearInterval(this._retry_id),this._retry_id=-1)}_estimate_next_tx_time(){return this._now()+(this.delay+2)*this.q.length}_write_out(){if(!this.socket)return;const e=this.q;if(!e.length)return;const t=e.shift();this.socket.send(t),super.write(t),e.length&&this._schedule_write_out()}_schedule_write_out(){const e=this.tx_idle_time(),t=this.delay;e>=t?this._write_out():-1===this._write_out_id&&(this._write_out_id=setTimeout(this._write_out_callback,t-e))}_retryCommands(){const e=this._now(),t=e-this.retry_interval,n=this.retry_interval/this.delay*5-this.q.length,r=this._pendingCommands,s=[],o=[];for(const e of r){const[,r]=e;if(r.lastSent>t)break;r.retries>=this.retry_count?o.push(e):s.length<n&&s.push(e)}if(o.length){const e=new Error("Timeout.");o.forEach(([t,n])=>{r.delete(t),n.reject(e)})}s.forEach(([t,n])=>{r.delete(t),r.set(t,n),this.send(n.command),n.lastSent=e,n.retries++})}},observeProperty:na,PropertyObserver:class{constructor(e,t,n){if(this.o=e,this.propertyName=t,this.cacheSubscriptions=n,this.property=e.get_properties().find_property(t),this._subscribers=[],this._currentValue=null,this._unsubscribe=null,!this.property)throw new Error(`Could not find property ${t} in ${e.ClassName}`)}callSubscriber(e,t){try{e(!0,this._currentValue,t)}catch(e){console.error("Subscriber to",this,"threw and exception",e)}}subscribe(e){return this._subscribers.push(e),null===this._unsubscribe?this._unsubscribe=na(this.o,this.property,(e,t,n)=>{if(e){this._currentValue=t;const e=this._subscribers;e.length||this.unsubscribeAll(),e.forEach(e=>this.callSubscriber(e,n))}}):null!==this._currentValue&&this.callSubscriber(e),()=>{this._subscribers=this._subscribers.filter(t=>t!==e),this.cacheSubscriptions||this._subscribers.length||this.unsubscribeAll()}}subscribeReturnValue(e,t){return this.subscribe((n,r,s)=>{if(n){if(s>=0&&s!==e)return;r instanceof v?t(!0,r.item(e)):t(!1,new Error(`Cannot index ${r} with ${e}.`))}else t(n,r)})}subscribeCurrent(e){return this.subscribeReturnValue(0,e)}subscribeMin(e){return this.subscribeReturnValue(1,e)}subscribeMax(e){return this.subscribeReturnValue(2,e)}subscribeValue(e){return this.subscribe((t,n,r)=>{if(t)if(n instanceof v){if(r>0)return;e(t,n.item(0))}else e(t,n);else e(t,n)})}unsubscribeAll(){this._subscribers.length=0,this._currentValue=null;const e=this._unsubscribe;if(e)try{e()}catch(e){console.error("Unsubscribe in",this,"threw an exception",e)}}dispose(){this.unsubscribeAll()}},fetchDeviceContent:async function(e){const t=await e.GetDeviceTree(),n=[e.DeviceManager,e.SecurityManager,e.FirmwareManager,e.SubscriptionManager,e.PowerManager,e.NetworkManager,e.MediaClockManager,e.LibraryManager,e.AudioProcessingManager,e.DeviceTimeManager,e.TaskManager,e.CodingManager,e.DiagnosticManager];for(const e of n)await oa(e)&&t.push(e);return await async function e(t){const n=[];for(let r=0;r<t.length;r++){const s=t[r],o=await sa(s);if(s instanceof nn){const n=t[r+1];if(!Array.isArray(n))throw new Error("Member missing for OcaBlock.");o.Members=await e(n),r++}n.push(o)}return n}(t)},RemoteError:P,RemoteControlClasses:Yi,Types:ca,WebSocketConnection:class extends la{static connect(e){return super.connect(WebSocket,e)}_now(){return performance.now()}}});window.OCA=ua}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aes70",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A controller library for the AES70 protocol.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",