diff --git a/nohassleav-videowallprocessor/.build-info b/nohassleav-videowallprocessor/.build-info new file mode 100644 index 00000000..85f81da6 --- /dev/null +++ b/nohassleav-videowallprocessor/.build-info @@ -0,0 +1,4 @@ +MODULE_NAME=nohassleav-videowallprocessor +GIT_REF=v1.0.0 +RUN_URL=https://github.com/bitfocus/companion-bundled-modules/actions/runs/11560731432 +UPDATE_DATE=2024-10-28 diff --git a/nohassleav-videowallprocessor/companion/HELP.md b/nohassleav-videowallprocessor/companion/HELP.md new file mode 100644 index 00000000..e3e99363 --- /dev/null +++ b/nohassleav-videowallprocessor/companion/HELP.md @@ -0,0 +1,5 @@ +## NoHassleAV Videowall Controller Module + +This module is for controlling the NoHassleAV 4x4 HDMI Videowall Controller. Please install the module and scroll through the lists, to have a look at all available actions, feedbacks, variables and presets. + +The module connects to the device using a Telnet/TCP connection. Make sure to adjust the module settings to the correct IP address and port of your device. diff --git a/nohassleav-videowallprocessor/companion/manifest.json b/nohassleav-videowallprocessor/companion/manifest.json new file mode 100644 index 00000000..7377e122 --- /dev/null +++ b/nohassleav-videowallprocessor/companion/manifest.json @@ -0,0 +1 @@ +{"id":"nohassleav-videowallprocessor","name":"nohassleav-videowallprocessor","shortname":"nohassleav-vidwallproc","description":"Control NoHassleAV videowall processors over a Telnet connection","version":"1.0.0","license":"MIT","repository":"git+https://github.com/bitfocus/companion-module-nohassleav-videowallprocessor.git","bugs":"https://github.com/bitfocus/companion-module-nohassleav-videowallprocessor/issues","maintainers":[{"name":"Leon Reucher","email":"leon.reucher@ultimate-technology.de"}],"legacyIds":[],"runtime":{"type":"node22","api":"nodejs-ipc","apiVersion":"1.11.0","entrypoint":"../main.js"},"manufacturer":"NoHassleAV","products":["HDP MXB44VW","Video Wall Processor 4x4"],"keywords":[]} \ No newline at end of file diff --git a/nohassleav-videowallprocessor/main.js b/nohassleav-videowallprocessor/main.js new file mode 100644 index 00000000..67ac9f9e --- /dev/null +++ b/nohassleav-videowallprocessor/main.js @@ -0,0 +1 @@ +(()=>{var e={169:(e,t,r)=>{"use strict";const i=r(17);i.code='require("ajv/dist/runtime/equal").default',t.A=i},284:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},n=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},o=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},s=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},a=function(e){return{r:o(e.r,0,255),g:o(e.g,0,255),b:o(e.b,0,255),a:o(e.a)}},u=function(e){return{r:n(e.r),g:n(e.g),b:n(e.b),a:n(e.a,3)}},c=/^#([0-9a-f]{3,8})$/i,l=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},d=function(e){var t=e.r,r=e.g,i=e.b,n=e.a,o=Math.max(t,r,i),s=o-Math.min(t,r,i),a=s?o===t?(r-i)/s:o===r?2+(i-t)/s:4+(t-r)/s:0;return{h:60*(a<0?a+6:a),s:o?s/o*100:0,v:o/255*100,a:n}},p=function(e){var t=e.h,r=e.s,i=e.v,n=e.a;t=t/360*6,r/=100,i/=100;var o=Math.floor(t),s=i*(1-r),a=i*(1-(t-o)*r),u=i*(1-(1-t+o)*r),c=o%6;return{r:255*[i,a,s,s,u,i][c],g:255*[u,i,i,a,s,s][c],b:255*[s,s,u,i,i,a][c],a:n}},h=function(e){return{h:s(e.h),s:o(e.s,0,100),l:o(e.l,0,100),a:o(e.a)}},f=function(e){return{h:n(e.h),s:n(e.s),l:n(e.l),a:n(e.a,3)}},b=function(e){return p((r=(t=e).s,{h:t.h,s:(r*=((i=t.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:t.a}));var t,r,i},m=function(e){return{h:(t=d(e)).h,s:(n=(200-(r=t.s))*(i=t.v)/100)>0&&n<200?r*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,r,i,n},y=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,g=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w={string:[[function(e){var t=c.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?n(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?n(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=v.exec(e)||_.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=y.exec(e)||g.exec(e);if(!t)return null;var i,n,o=h({h:(i=t[1],n=t[2],void 0===n&&(n="deg"),Number(i)*(r[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return b(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,s=void 0===o?1:o;return i(t)&&i(r)&&i(n)?a({r:Number(t),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,s=void 0===o?1:o;if(!i(t)||!i(r)||!i(n))return null;var a=h({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return b(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,a=e.a,u=void 0===a?1:a;if(!i(t)||!i(r)||!i(n))return null;var c=function(e){return{h:s(e.h),s:o(e.s,0,100),v:o(e.v,0,100),a:o(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(u)});return p(c)},"hsv"]]},I=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=u(this.rgba)).r,r=e.g,i=e.b,s=(o=e.a)<1?l(n(255*o)):"","#"+l(t)+l(r)+l(i)+s;var e,t,r,i,o,s},e.prototype.toRgb=function(){return u(this.rgba)},e.prototype.toRgbString=function(){return t=(e=u(this.rgba)).r,r=e.g,i=e.b,(n=e.a)<1?"rgba("+t+", "+r+", "+i+", "+n+")":"rgb("+t+", "+r+", "+i+")";var e,t,r,i,n},e.prototype.toHsl=function(){return f(m(this.rgba))},e.prototype.toHslString=function(){return t=(e=f(m(this.rgba))).h,r=e.s,i=e.l,(n=e.a)<1?"hsla("+t+", "+r+"%, "+i+"%, "+n+")":"hsl("+t+", "+r+"%, "+i+"%)";var e,t,r,i,n},e.prototype.toHsv=function(){return e=d(this.rgba),{h:n(e.h),s:n(e.s),v:n(e.v),a:n(e.a,3)};var e},e.prototype.invert=function(){return M({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),M(O(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),M(O(this.rgba,-e))},e.prototype.grayscale=function(){return M(O(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),M(P(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),M(P(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?M({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):n(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=m(this.rgba);return"number"==typeof e?M({h:e,s:t.s,l:t.l,a:t.a}):n(t.h)},e.prototype.isEqual=function(e){return this.toHex()===M(e).toHex()},e}(),M=function(e){return e instanceof x?e:new x(e)},A=[];t.Colord=x,t.colord=M,t.extend=function(e){e.forEach((function(e){A.indexOf(e)<0&&(e(x,w),A.push(e))}))},t.getFormat=function(e){return k(e)[1]},t.random=function(){return new x({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}},22:e=>{!function(){"use strict";var t=[,function(e,t){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");e[r]=n}}for(var s=[],a=null,u=null,c=null,l=null,d=0;d>2&63,u=(3&e[d])<<4;break;case 1:u|=e[d]>>4&15,c=(15&e[d])<<2;break;case 2:c|=e[d]>>6&3,l=63&e[d],s.push(i(a)),s.push(i(u)),s.push(i(c)),s.push(i(l)),a=null,u=null,c=null,l=null}return null!=a&&(s.push(i(a)),s.push(i(u)),null==c?s.push("="):s.push(i(c)),null==l&&s.push("=")),s.join("")},decode:function(e){var t=Math.floor(3*e.length/4);"="==e.charAt(e.length-1)&&(t--,"="==e.charAt(e.length-2)&&t--);for(var i,n=o(t),s=null,a=null,u=null,c=0,l=0;l>4,n[c++]=s,a=(15&d)<<4;break;case 2:d>=0&&(a|=d>>2,n[c++]=a,u=(3&d)<<6);break;case 3:d>=0&&(n[c++]=u|d)}}return n},newBinary:o};t.Base64=s},function(e){e.exports={_noYieldsAllowed:function(e){return e()}}},function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function e(t,n,o,s,a){var u=n[t];switch(r(u)){case"string":return i(u);case"number":return isFinite(u)?String(u):"null";case"boolean":return String(u);case"object":if(!u)return"null";var c,l=s+o,d=[];if(Array.isArray(u)||{}.hasOwnProperty.call(u,"callee")){for(var p=u.length,h=0;h0&&void 0!==arguments[0]&&arguments[0]?a:(0,o.convertMapToObject)(a)},s._getConverters=function(){return u};var c=function(e){for(var t=0;t=d.length||n!==d[i]||!s.equals(e[n],t[d[i]],r)||(i++,0))}))):(i=0,a=l.every((function(n){return!!(0,o.hasOwn)(t,n)&&!!s.equals(e[n],t[n],r)&&(i++,!0)}))),a&&i===d.length},s.clone=function(e){var t;if(!(0,o.isObject)(e))return e;if(null===e)return null;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return e;if(s.isBinary(e)){t=s.newBinary(e.length);for(var r=0;r{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,i,n=[];if(0===this._eventsCount)return n;for(i in e=this._events)t.call(e,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(t)){if((i=t.length)!=r.length)return!1;for(n=i;0!=n--;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;0!=n--;){var s=o[n];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},865:e=>{"use strict";const t=(e,t,i,n)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const o=Object.getOwnPropertyDescriptor(e,i),s=Object.getOwnPropertyDescriptor(t,i);!r(o,s)&&n||Object.defineProperty(e,i,s)},r=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},i=(e,t)=>`/* Wrapped ${e}*/\n${t}`,n=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),o=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");e.exports=(e,r,{ignoreNonConfigurable:s=!1}={})=>{const{name:a}=e;for(const i of Reflect.ownKeys(r))t(e,r,i,s);return((e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)})(e,r),((e,t,r)=>{const s=""===r?"":`with ${r.trim()}() `,a=i.bind(null,s,t.toString());Object.defineProperty(a,"name",o),Object.defineProperty(e,"toString",{...n,value:a})})(e,r,a),e}},617:e=>{"use strict";e.exports=(e,t)=>(t=t||(()=>{}),e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e})))))},290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(368),n=r(685),o=r(774),s=()=>{},a=new n.TimeoutError;t.default=class extends i{constructor(e){var t,r,i,n;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:o.default},e)).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==r?r:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(n=null===(i=e.interval)||void 0===i?void 0:i.toString())&&void 0!==n?n:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()}),t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise(((r,i)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const o=void 0===this._timeout&&void 0===t.timeout?e():n.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,(()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&i(a)}));r(await o)}catch(e){i(e)}this._next()}),t),this._tryToStartAnother(),this.emit("add")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}},998:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let i=0,n=e.length;for(;n>0;){const o=n/2|0;let s=i+o;r(e[s],t)<=0?(i=++s,n-=o+1):n=o}return i}},774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(998);t.default=class{constructor(){this._queue=[]}enqueue(e,t){const r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);const n=i.default(this._queue,r,((e,t)=>t.priority-e.priority));this._queue.splice(n,0,r)}dequeue(){const e=this._queue.shift();return null==e?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}},368:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,i,n=[];if(0===this._eventsCount)return n;for(i in e=this._events)t.call(e,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n{"use strict";const i=r(617);class n extends Error{constructor(e){super(e),this.name="TimeoutError"}}const o=(e,t,r)=>new Promise(((o,s)=>{if("number"!=typeof t||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void o(e);const a=setTimeout((()=>{if("function"==typeof r){try{o(r())}catch(e){s(e)}return}const i=r instanceof Error?r:new n("string"==typeof r?r:`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),s(i)}),t);i(e.then(o,s),(()=>{clearTimeout(a)}))}));e.exports=o,e.exports.default=o,e.exports.TimeoutError=n},194:e=>{"use strict";e.exports=require("dgram")},943:e=>{"use strict";e.exports=require("fs/promises")},897:e=>{"use strict";e.exports=require("net")},928:e=>{"use strict";e.exports=require("path")},203:e=>{"use strict";e.exports=require("stream")},581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},326:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runEntrypoint=function(e,t){Promise.resolve().then((async()=>{if(l)throw new Error("runEntrypoint can only be called once");l=!0;const r=process.env.MODULE_MANIFEST;if(!r)throw new Error("Module initialise is missing MODULE_MANIFEST");const i=await o.default.readFile(r),d=JSON.parse(i.toString());if(d.runtime?.api!==n.HostApiNodeJsIpc)throw new Error("Module manifest 'api' mismatch");if(!d.runtime.apiVersion)throw new Error("Module manifest 'apiVersion' missing");let p=d.runtime.apiVersion;if("0.0.0"===p)try{const e=await o.default.readFile(u.default.join(__dirname,"../package.json")),t=JSON.parse(e.toString());"@companion-module/base"===t.name&&(p=t.version)}catch(e){throw new Error("Failed to determine module api version")}if(!process.send)throw new Error("Module is not being run with ipc");console.log(`Starting up module class: ${e.name}`);const h=process.env.CONNECTION_ID;if("string"!=typeof h||!h)throw new Error("Module initialise is missing CONNECTION_ID");const f=process.env.VERIFICATION_TOKEN;if("string"!=typeof f||!f)throw new Error("Module initialise is missing VERIFICATION_TOKEN");const b=new a.IpcWrapper({},(e=>{process.send(e)}),5e3);process.once("message",(e=>{b.receivedMessage(e)})),c=new e((0,s.literal)({id:h,upgradeScripts:t,_isInstanceBaseProps:!0})),b.sendWithCb("register",{apiVersion:p,connectionId:h,verificationToken:f}).then((()=>{console.log("Module-host accepted registration")}),(e=>{console.error("Module registration failed",e),process.exit(11)}))})).catch((e=>{console.error("Failed to startup module:"),console.error(e.stack||e.message),process.exit(1)}))};const i=r(635),n=r(967),o=i.__importDefault(r(943)),s=r(360),a=r(44),u=i.__importDefault(r(928));let c,l=!1},160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UDPHelper=t.TelnetHelper=t.TCPHelper=void 0;var i=r(895);Object.defineProperty(t,"TCPHelper",{enumerable:!0,get:function(){return i.TCPHelper}});var n=r(118);Object.defineProperty(t,"TelnetHelper",{enumerable:!0,get:function(){return n.TelnetHelper}});var o=r(259);Object.defineProperty(t,"UDPHelper",{enumerable:!0,get:function(){return o.UDPHelper}})},895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TCPHelper=void 0;const i=r(635).__importDefault(r(897)),n=r(228),o=r(400);class s extends n.EventEmitter{#e;#t;_socket;#r;#i=!1;#n=!1;#o=!1;#s;#a;#u;get isConnected(){return this.#i}get isConnecting(){return this.#n}get isDestroyed(){return this.#o}constructor(e,t,r){super(),this.#e=e,this.#t=t,this.#r={reconnect_interval:2e3,reconnect:!0,...r},this._socket=new i.default.Socket,this._socket.setKeepAlive(!0),this._socket.setNoDelay(!0),this._socket.on("error",(e=>{this.#n=!1,this.#i=!1,this.#r.reconnect&&this.#c(),this.#l(o.InstanceStatus.UnknownError,e.message),this.emit("error",e)})),this._socket.on("ready",(()=>{this.#i=!0,this.#n=!1,this.#l(o.InstanceStatus.Ok),this.emit("connect")})),this._socket.on("end",(()=>{this.#i=!1,this.#l(o.InstanceStatus.Disconnected),!this.#n&&this.#r.reconnect&&this.#c(),this.emit("end")})),this._socket.on("data",(e=>this.emit("data",e))),this._socket.on("drain",(()=>this.emit("drain"))),setImmediate((()=>{this.#o||this.connect()})),this.#u=setTimeout((()=>{this.#u=void 0,this.#o||this.listenerCount("error")||console.error(`Danger: TCP client for ${this.#e}:${this.#t} is missing an error handler!`)}),5e3)}connect(){if(this.#o)throw new Error("Cannot connect destroyed socket");return!this.#n&&(this.#n=!0,this._socket.connect(this.#t,this.#e),!0)}async send(e){if(this.#o||this._socket.destroyed)throw new Error("Cannot write to destroyed socket");if(!e||!e.length)throw new Error("No message to send");if(!this.#i)return!1;try{return new Promise(((t,r)=>{this._socket.write(e,(e=>{e?r(e):t(!0)}))}))}catch(e){this.#i=!1;const t=e instanceof Error?e:new Error(`${e}`);throw this.#l(o.InstanceStatus.UnknownError,t.message),this.emit("error",t),t}}destroy(){this.#o=!0,void 0!==this.#a&&(clearTimeout(this.#a),this.#a=void 0),void 0!==this.#u&&(clearTimeout(this.#u),this.#u=void 0),this._socket.removeAllListeners(),this.removeAllListeners(),this._socket.destroy()}#c(){void 0!==this.#a&&clearTimeout(this.#a),this.#a=setTimeout((()=>{this.#a=void 0,this.#l(o.InstanceStatus.Connecting),this.connect()}),this.#r.reconnect_interval)}#l(e,t){this.#s!=e&&(this.#s=e,this.emit("status_change",e,t))}}t.TCPHelper=s},118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TelnetHelper=void 0;const i=r(635).__importDefault(r(228)),n=r(203),o=r(895);class s extends i.default{#d;#p;#u;get isConnected(){return this.#d.isConnected}get isConnecting(){return this.#d.isConnecting}get isDestroyed(){return this.#d.isDestroyed}constructor(e,t,r){super(),this.#d=new o.TCPHelper(e,t,r),this.#p=new a,this.#d._socket.pipe(this.#p),this.#d.on("connect",(()=>this.emit("connect"))),this.#d.on("end",(()=>this.emit("end"))),this.#d.on("error",(e=>this.emit("error",e))),this.#d.on("status_change",((e,t)=>this.emit("status_change",e,t))),this.#p.on("iac",((e,t)=>this.emit("iac",e,t))),this.#p.on("sb",(e=>this.emit("sb",e))),this.#p.on("data",(e=>this.emit("data",e))),this.#p.on("drain",(()=>this.emit("drain"))),this.#u=setTimeout((()=>{this.#u=void 0,this.isDestroyed||this.listenerCount("error")||console.error(`Danger: Telnet client for ${e}:${t} is missing an error handler!`)}),5e3)}connect(){return this.#d.connect()}async send(e){return this.#d.send(e)}destroy(){this.#d.destroy(),void 0!==this.#u&&(clearTimeout(this.#u),this.#u=void 0),this.#p.removeAllListeners(),this.#p.destroy()}}t.TelnetHelper=s;class a extends n.Transform{#h;#f;#b;constructor(e){super(e),this.#h=Buffer.alloc(0),this.#f=Buffer.alloc(0),this.#b=0}_transform(e,t,r){for(let t=0;t=251&&this.#b<=254){let t;switch(this.#b){case 251:t="WILL";break;case 252:t="WONT";break;case 253:t="DO";break;case 254:t="DONT";break;default:return}return this.emit("iac",t,e),void(this.#b=0)}if(250===this.#b){if(240===e)return this.emit("sb",this.#f),this.#b=0,void(this.#f=Buffer.alloc(0));this.#f=Buffer.concat([this.#f,Buffer.from([e])])}}}#y(){const e=this.#h;return this.#h=Buffer.alloc(0),e}}},259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UDPHelper=void 0;const i=r(635).__importDefault(r(194)),n=r(228),o=r(400);class s extends n.EventEmitter{#e;#t;#g;#r;#o=!1;#s;#u;get isDestroyed(){return this.#o}constructor(e,t,r){super(),this.#e=e,this.#t=t,this.#r={...r},this.#g=i.default.createSocket("udp4");try{this.#g.bind(this.#r.bind_port||0,this.#r.bind_ip)}catch(e){throw new Error(`Unable to bind to ip/port: ${this.#r.bind_ip||"0.0.0.0"}:${this.#r.bind_port||0}`)}this.#r.broadcast&&this.#g.setBroadcast(!0),void 0!==this.#r.ttl&&this.#g.setTTL(this.#r.ttl),void 0!==this.#r.multicast_ttl&&this.#g.setMulticastTTL(this.#r.multicast_ttl),this.#g.on("error",(e=>{this.#l(o.InstanceStatus.UnknownError,e.message),this.emit("error",e)})),this.#g.on("listening",(()=>{this.#r.multicast_interface&&this.#g.setMulticastInterface(this.#r.multicast_interface),this.#l(o.InstanceStatus.Ok),this.emit("listening")})),this.#g.on("message",(e=>this.emit("data",e))),this.#u=setTimeout((()=>{this.#o||this.listenerCount("error")||console.error(`Danger: UDP socket for ${this.#e}:${this.#t} is missing an error handler!`)}),5e3)}async send(e){if(this.#o)throw new Error("Cannot write to destroyed socket");if(!e||!e.length)throw new Error("No message to send");return new Promise(((t,r)=>{this.#g.send(e,this.#t,this.#e,(e=>{e?r(e):t()}))}))}destroy(){this.#o=!0,void 0!==this.#u&&(clearTimeout(this.#u),this.#u=void 0),this.#g.removeAllListeners(),this.#g.close(),this.removeAllListeners()}#l(e,t){this.#s!=e&&(this.#s=e,this.emit("status_change",e,t))}}t.UDPHelper=s},44:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IpcWrapper=void 0;const i=r(635),n=r(360),o=i.__importDefault(r(22));t.IpcWrapper=class{#v;#_;#w;#I=1;#k=new Map;constructor(e,t,r){this.#v=e,this.#_=t,this.#w=r}async sendWithCb(e,t,r,i=0){i<=0&&(i=this.#w);const n={timeout:void 0,resolve:()=>null,reject:()=>null},s=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));this.#I>268435456&&(this.#I=1);const a=this.#I++;this.#k.set(a,n),this.#_({direction:"call",name:String(e),payload:o.default.stringify(t),callbackId:a});const u=new Error("Call timed out");return n.timeout=setTimeout((()=>{n.reject(r?r():u),this.#k.delete(a)}),i),s}sendWithNoCb(e,t){this.#_({direction:"call",name:String(e),payload:o.default.stringify(t),callbackId:void 0})}receivedMessage(e){const t=e;switch(e.direction){case"call":{const t=this.#v[e.name];if(!t)return void(e.callbackId&&this.#_({direction:"response",callbackId:e.callbackId,success:!1,payload:o.default.stringify({message:`Unknown command "${e.name}"`})}));t(e.payload?o.default.parse(e.payload):void 0).then((t=>{e.callbackId&&this.#_({direction:"response",callbackId:e.callbackId,success:!0,payload:o.default.stringify(t)})}),(t=>{e.callbackId&&this.#_({direction:"response",callbackId:e.callbackId,success:!1,payload:t instanceof Error?JSON.stringify(t,Object.getOwnPropertyNames(t)):o.default.stringify(t)})}));break}case"response":{if(!e.callbackId)return void console.error("Ipc: Response message has no callbackId");const t=this.#k.get(e.callbackId);if(this.#k.delete(e.callbackId),!t)return;clearTimeout(t.timeout);const r=e.payload?o.default.parse(e.payload):void 0;if(e.success)t.resolve(r);else{let e=r;r&&"object"==typeof r&&"message"in r&&(e=new Error(r.message),r.stack&&(e.stack=r.stack)),t.reject(e)}break}default:(0,n.assertNever)(e),console.error(`Ipc: Message of unknown direction "${t.direction}"`)}}}},967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HostApiNodeJsIpc=void 0,t.HostApiNodeJsIpc="nodejs-ipc"},278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runEntrypoint=t.assertNever=t.splitHex=t.splitHsv=t.splitHsl=t.splitRgb=t.combineRgb=t.literal=void 0;const i=r(635);i.__exportStar(r(77),t),i.__exportStar(r(18),t),i.__exportStar(r(581),t);var n=r(360);Object.defineProperty(t,"literal",{enumerable:!0,get:function(){return n.literal}}),Object.defineProperty(t,"combineRgb",{enumerable:!0,get:function(){return n.combineRgb}}),Object.defineProperty(t,"splitRgb",{enumerable:!0,get:function(){return n.splitRgb}}),Object.defineProperty(t,"splitHsl",{enumerable:!0,get:function(){return n.splitHsl}}),Object.defineProperty(t,"splitHsv",{enumerable:!0,get:function(){return n.splitHsv}}),Object.defineProperty(t,"splitHex",{enumerable:!0,get:function(){return n.splitHex}}),Object.defineProperty(t,"assertNever",{enumerable:!0,get:function(){return n.assertNever}}),i.__exportStar(r(160),t);var o=r(326);Object.defineProperty(t,"runEntrypoint",{enumerable:!0,get:function(){return o.runEntrypoint}})},289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionManager=void 0;const i=r(593);function n(e){return{id:e.id,actionId:e.actionId,controlId:e.controlId,options:e.options}}t.ActionManager=class{#O;#S;#P;#x=new Map;#M=new Map;constructor(e,t,r){this.#O=e,this.#S=t,this.#P=r}async handleExecuteAction(e){const t=this.#x.get(e.action.actionId);if(!t)throw new Error(`Unknown action: ${e.action.actionId}`);const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.action.controlId,actionInstanceId:e.action.id,feedbackInstanceId:void 0})).text};await t.callback({id:e.action.id,actionId:e.action.actionId,controlId:e.action.controlId,options:e.action.options,surfaceId:e.surfaceId},r)}handleUpdateActions(e){for(const[t,r]of Object.entries(e)){const e=this.#M.get(t);if(e){const t=this.#x.get(e.actionId);if(t?.unsubscribe){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.controlId,actionInstanceId:e.id,feedbackInstanceId:void 0})).text};Promise.resolve(t.unsubscribe(n(e),r)).catch((t=>{this.#P("error",`Action unsubscribe failed: ${JSON.stringify(e)} - ${t?.message??t} ${t?.stack}`)}))}}if(!r||r.disabled)this.#M.delete(t);else{this.#M.set(t,r);const e=this.#x.get(r.actionId);if(e?.subscribe){const t={parseVariablesInString:async e=>(await this.#O({text:e,controlId:r.controlId,actionInstanceId:r.id,feedbackInstanceId:void 0})).text};Promise.resolve(e.subscribe(n(r),t)).catch((e=>{this.#P("error",`Action subscribe failed: ${JSON.stringify(r)} - ${e?.message??e} ${e?.stack}`)}))}}}}async handleLearnAction(e){const t=this.#x.get(e.action.actionId);if(t&&t.learn){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.action.controlId,actionInstanceId:e.action.id,feedbackInstanceId:void 0})).text};return{options:await t.learn({id:e.action.id,actionId:e.action.actionId,controlId:e.action.controlId,options:e.action.options,surfaceId:void 0},r)}}return{options:void 0}}setActionDefinitions(e){const t=[];this.#x.clear();for(const[r,n]of Object.entries(e))n&&(t.push({id:r,name:n.name,description:n.description,options:(0,i.serializeIsVisibleFn)(n.options),hasLearn:!!n.learn,learnTimeout:n.learnTimeout}),this.#x.set(r,n));this.#S({actions:t})}_getAllActions(){return Array.from(this.#M.values()).map((e=>({id:e.id,actionId:e.actionId,controlId:e.controlId,options:e.options})))}subscribeActions(e){let t=Array.from(this.#M.values());const r=new Set(e);r.size&&(t=t.filter((e=>r.has(e.actionId))));for(const e of t){const t=this.#x.get(e.actionId);if(t?.subscribe){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.controlId,actionInstanceId:e.id,feedbackInstanceId:void 0})).text};Promise.resolve(t.subscribe(n(e),r)).catch((t=>{this.#P("error",`Action subscribe failed: ${JSON.stringify(e)} - ${t?.message??t} ${t?.stack}`)}))}}}unsubscribeActions(e){let t=Array.from(this.#M.values());const r=new Set(e);r.size&&(t=t.filter((e=>r.has(e.actionId))));for(const e of t){const t=this.#x.get(e.actionId);if(t&&t.unsubscribe){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.controlId,actionInstanceId:e.id,feedbackInstanceId:void 0})).text};Promise.resolve(t.unsubscribe(n(e),r)).catch((t=>{this.#P("error",`Action unsubscribe failed: ${JSON.stringify(e)} - ${t?.message??t} ${t?.stack}`)}))}}}}},593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeIsVisibleFn=function(e){return(e??[]).map((e=>"isVisible"in e&&"function"==typeof e.isVisible?{...e,isVisibleFn:e.isVisible.toString(),isVisible:void 0}:{...e,isVisibleFn:void 0}))},t.isInstanceBaseProps=function(e){const t=e;return"object"==typeof t&&"string"==typeof t.id&&!0===t._isInstanceBaseProps}},39:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeedbackManager=void 0;const i=r(635),n=r(593),o=i.__importDefault(r(0));function s(e,t){return{type:e,id:t.id,feedbackId:t.feedbackId,controlId:t.controlId,options:t.options}}t.FeedbackManager=class{#O;#A;#j;#P;#E=new Map;#C=new Map;#$=new Map;#V=new Map;#T;get parseVariablesContext(){return this.#T}constructor(e,t,r,i){this.#O=e,this.#A=t,this.#j=r,this.#P=i}getDefinitionIds(){return Array.from(this.#E.keys())}getInstanceIds(){return Array.from(this.#C.keys())}handleUpdateFeedbacks(e){for(const[t,r]of Object.entries(e)){const e=this.#C.get(t);if(e){const t=this.#E.get(e.feedbackId);if(t?.unsubscribe){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.controlId,actionInstanceId:void 0,feedbackInstanceId:e.id})).text};Promise.resolve(t.unsubscribe(s(t.type,e),r)).catch((t=>{this.#P("error",`Feedback unsubscribe failed: ${JSON.stringify(e)} - ${t?.message??t} ${t?.stack}`)}))}}if(!r||r.disabled)this.#C.delete(t);else{this.#C.set(t,{...r,referencedVariables:null});const e=this.#E.get(r.feedbackId);if(e?.subscribe){const t={parseVariablesInString:async e=>(await this.#O({text:e,controlId:r.controlId,actionInstanceId:void 0,feedbackInstanceId:r.id})).text};Promise.resolve(e.subscribe(s(e.type,r),t)).catch((e=>{this.#P("error",`Feedback subscribe failed: ${JSON.stringify(r)} - ${e?.message??e} ${e?.stack}`)}))}this.#D(t)}}}async handleLearnFeedback(e){const t=this.#E.get(e.feedback.feedbackId);if(t&&t.learn){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.feedback.controlId,actionInstanceId:void 0,feedbackInstanceId:e.feedback.id})).text};return{options:await t.learn({id:e.feedback.id,feedbackId:e.feedback.feedbackId,controlId:e.feedback.controlId,options:e.feedback.options,type:t.type},r)}}return{options:void 0}}handleVariablesChanged(e){if(!e.variablesIds.length)return;const t=new Set(e.variablesIds);for(const t of this.#V.values())for(const r of e.variablesIds)t.changedVariables.add(r);const r=new Set;for(const e of this.#C.values())if(!this.#V.has(e.id)&&e.referencedVariables)for(const i of e.referencedVariables)if(t.has(i)){r.add(e.id);break}for(const e of r)setImmediate((()=>{this.#D(e)}))}#D(e){const t=this.#V.get(e);if(t)return void(t.needsRecheck=!0);const r=this.#C.get(e);if(!r)return;const i=r,n={needsRecheck:!1,changedVariables:new Set};this.#V.set(e,n),Promise.resolve().then((async()=>{const t=this.#E.get(i.feedbackId);let r;const n=new Set;if(t){this.#T=`Feedback ${i.feedbackId} (${e})`;const o={parseVariablesInString:async t=>{const r=await this.#O({text:t,controlId:i.controlId,actionInstanceId:void 0,feedbackInstanceId:e});if(r.variableIds&&r.variableIds.length)for(const e of r.variableIds)n.add(e);return r.text}};r="boolean"===t.type?t.callback({...s("boolean",i),type:"boolean"},o):t.callback({...s("advanced",i),type:"advanced",image:i.image},o),this.#T=void 0}const o=await r;this.#$.set(e,{id:e,controlId:i.controlId,value:o}),this.#N(),i.referencedVariables=n.size>0?Array.from(n):null})).catch((e=>{console.error(`Feedback check failed: ${JSON.stringify(i)} - ${e?.message??e} ${e?.stack}`)})).finally((()=>{this.#T=void 0,this.#V.delete(e);let t=!1;if(i.referencedVariables)for(const e of i.referencedVariables)if(n.changedVariables.has(e)){t=!0;break}(t||n.needsRecheck)&&setImmediate((()=>{this.#D(e)}))}))}#N=(0,o.default)((()=>{const e=this.#$;this.#$=new Map,e.size>0&&this.#A({values:Array.from(e.values())})}),{wait:5,maxWait:25});setFeedbackDefinitions(e){const t=[];this.#E.clear();for(const[r,i]of Object.entries(e))i&&(t.push({id:r,name:i.name,description:i.description,options:(0,n.serializeIsVisibleFn)(i.options),type:i.type,defaultStyle:"boolean"===i.type?i.defaultStyle:void 0,hasLearn:!!i.learn,learnTimeout:i.learnTimeout,showInvert:"boolean"===i.type&&i.showInvert}),this.#E.set(r,i));this.#j({feedbacks:t})}checkFeedbacks(e){const t=new Set(e);for(const[e,r]of this.#C.entries())this.#E.get(r.feedbackId)&&(0===t.size||t.has(r.feedbackId))&&this.#D(e)}checkFeedbacksById(e){for(const t of e)this.#D(t)}_getAllFeedbacks(){return Array.from(this.#C.values()).map((e=>({id:e.id,feedbackId:e.feedbackId,controlId:e.controlId,options:e.options})))}subscribeFeedbacks(e){let t=Array.from(this.#C.values());const r=new Set(e);r.size&&(t=t.filter((e=>r.has(e.feedbackId))));for(const e of t){const t=this.#E.get(e.feedbackId);if(t?.subscribe){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.controlId,actionInstanceId:void 0,feedbackInstanceId:e.id})).text};Promise.resolve(t.subscribe(s(t.type,e),r)).catch((t=>{this.#P("error",`Feedback subscribe failed: ${JSON.stringify(e)} - ${t?.message??t} ${t?.stack}`)}))}}}unsubscribeFeedbacks(e){let t=Array.from(this.#C.values());const r=new Set(e);r.size&&(t=t.filter((e=>r.has(e.feedbackId))));for(const e of t){const t=this.#E.get(e.feedbackId);if(t&&t.unsubscribe){const r={parseVariablesInString:async t=>(await this.#O({text:t,controlId:e.controlId,actionInstanceId:void 0,feedbackInstanceId:e.id})).text};Promise.resolve(t.unsubscribe(s(t.type,e),r)).catch((t=>{this.#P("error",`Feedback unsubscribe failed: ${JSON.stringify(e)} - ${t?.message??t} ${t?.stack}`)}))}}}}},706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runThroughUpgradeScripts=function(e,t,r,o,s,a){const u=new Map,c=e=>{let t=u.get(e);return t||(t={actions:[],feedbacks:[],config:!1},u.set(e,t)),t};for(const t of Object.values(e)){const e=t?.upgradeIndex??r;t&&"number"==typeof e&&c(e).actions.push(t.id)}for(const e of Object.values(t)){const t=e?.upgradeIndex??r;e&&"number"==typeof t&&c(t).feedbacks.push(e.id)}if(!a)for(let e=r??-1;e0){const a=Array.from(u.keys()).sort(),c=Math.min(...a,r??-1)+1,h=[],f=[],b=o.length;for(let r=c;r{const r=e[t];if(r)return(0,i.literal)({id:r.id,controlId:r.controlId,actionId:r.actionId,options:void 0!==r.options?n(r.options):{}})})).filter((e=>!!e)),feedbacks:f.map((e=>{const r=t[e];if(r)return(0,i.literal)({id:r.id,controlId:r.controlId,feedbackId:r.feedbackId,options:void 0!==r.options?n(r.options):{},isInverted:r.isInverted})})).filter((e=>!!e))});c&&m.updatedConfig&&(p=m.updatedConfig);for(const t of m.updatedActions)if(t){const r=e[t.id];r&&(r.actionId=t.actionId,r.options=t.options,d[t.id]=r)}for(const e of m.updatedFeedbacks)if(e){const r=t[e.id];r&&(r.feedbackId=e.feedbackId,r.options=e.options,l[e.id]={...r,style:l[e.id]?.style??e.style,isInverted:e.isInverted??!1})}}for(const[t,r]of Object.entries(e))d[t]||"number"!=typeof r?.upgradeIndex||(d[t]=r);for(const[e,r]of Object.entries(t))l[e]||"number"!=typeof r?.upgradeIndex||(l[e]=r)}return{updatedActions:d,updatedFeedbacks:l,updatedConfig:p}};const i=r(360);function n(e){return JSON.parse(JSON.stringify(e))}},77:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateManifest=function(e){const t=JSON.stringify(e);if(t.includes("companion-module-your-module-name"))throw new Error("Manifest incorrectly references template module 'companion-module-your-module-name'");if(t.includes("module-shortname"))throw new Error("Manifest incorrectly references template module 'module-shortname'");if(t.includes("A short one line description of your module"))throw new Error("Manifest incorrectly references template module 'A short one line description of your module'");if(t.includes("Your name"))throw new Error("Manifest incorrectly references template module 'Your name'");if(t.includes("Your email"))throw new Error("Manifest incorrectly references template module 'Your email'");if(t.includes("Your company"))throw new Error("Manifest incorrectly references template module 'Your company'");if(t.includes("Your product"))throw new Error("Manifest incorrectly references template module 'Your product'");if(!(0,i.default)(e)){const e=i.default.errors;if(!e)throw new Error("Manifest failed validation with unknown reason");throw new Error(`Manifest validation failed: ${JSON.stringify(e)}`)}};const i=r(635).__importDefault(r(281))},730:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InstanceBase=void 0;const i=r(635),n=r(360),o=i.__importDefault(r(290)),s=r(593),a=r(706),u=r(39),c=r(44),l=r(289),d=r(365);t.InstanceBase=class{#F;#R;id;#H=new o.default({concurrency:1});#W=!1;#q=!1;#U={};#B;#z;#J=new Map;#L=new Map;#Q=new Map;#r;#G;get instanceOptions(){return this.#r}get label(){return this.#G}constructor(e){if(!(0,s.isInstanceBaseProps)(e)||!e._isInstanceBaseProps)throw new Error("Module instance is being constructed incorrectly. Make sure you aren't trying to do this manually");this.createSharedUdpSocket=this.createSharedUdpSocket.bind(this),this.#r={disableVariableValidation:!1},this.#F=new c.IpcWrapper({init:this._handleInit.bind(this),destroy:this._handleDestroy.bind(this),updateConfigAndLabel:this._handleConfigUpdateAndLabel.bind(this),updateConfig:async()=>{},executeAction:this._handleExecuteAction.bind(this),updateFeedbacks:this._handleUpdateFeedbacks.bind(this),updateActions:this._handleUpdateActions.bind(this),getConfigFields:this._handleGetConfigFields.bind(this),handleHttpRequest:this._handleHttpRequest.bind(this),learnAction:this._handleLearnAction.bind(this),learnFeedback:this._handleLearnFeedback.bind(this),startStopRecordActions:this._handleStartStopRecordActions.bind(this),variablesChanged:this._handleVariablesChanged.bind(this),sharedUdpSocketMessage:this._handleSharedUdpSocketMessage.bind(this),sharedUdpSocketError:this._handleSharedUdpSocketError.bind(this)},(e=>{process.send(e)}),5e3),process.on("message",(e=>{this.#F.receivedMessage(e)})),this.#B=new l.ActionManager((async e=>this.#F.sendWithCb("parseVariablesInString",e)),(e=>this.#F.sendWithNoCb("setActionDefinitions",e)),this.log.bind(this)),this.#z=new u.FeedbackManager((async e=>this.#F.sendWithCb("parseVariablesInString",e)),(e=>this.#F.sendWithNoCb("updateFeedbackValues",e)),(e=>this.#F.sendWithNoCb("setFeedbackDefinitions",e)),this.log.bind(this)),this.#R=e.upgradeScripts,this.id=e.id,this.#G=e.id,this.log("debug","Initializing")}async _handleInit(e){return this.#H.add((async()=>{if(this.#W)throw new Error("Already initialized");const t=e.actions,r=e.feedbacks;if(this.#U=e.config,this.#G=e.label,e.isFirstInit){const t={},r=this.getConfigFields();for(const e of r)"default"in e&&(t[e.id]=e.default);this.#U=t,this.saveConfig(this.#U),e.lastUpgradeIndex=this.#R.length-1}const{updatedActions:i,updatedFeedbacks:n,updatedConfig:o}=(0,a.runThroughUpgradeScripts)(t,r,e.lastUpgradeIndex,this.#R,this.#U,!1);this.#U=o??this.#U;const s=this.#F.sendWithCb("upgradedItems",{updatedActions:i,updatedFeedbacks:n});try{await this.init(this.#U,!!e.isFirstInit),this.#W=!0}catch(e){throw console.trace(`Init failed: ${e}`),e}finally{await s}return setImmediate((()=>{this._handleUpdateActions({actions:t},!0).catch((e=>{this.log("error",`Receive actions failed: ${e}`)})),this._handleUpdateFeedbacks({feedbacks:r},!0).catch((e=>{this.log("error",`Receive feedbacks failed: ${e}`)}))})),{hasHttpHandler:"function"==typeof this.handleHttpRequest,hasRecordActionsHandler:"function"==typeof this.handleStartStopRecordActions,newUpgradeIndex:this.#R.length-1,updatedConfig:this.#U}}))}async _handleDestroy(){await this.#H.add((async()=>{if(!this.#W)throw new Error("Not initialized");await this.destroy(),this.#W=!1}))}async _handleConfigUpdateAndLabel(e){await this.#H.add((async()=>{if(!this.#W)throw new Error("Not initialized");this.#G=e.label,this.#U=e.config,await this.configUpdated(this.#U)}))}async _handleExecuteAction(e){return this.#B.handleExecuteAction(e)}async _handleUpdateFeedbacks(e,t){if(!t){const t=(0,a.runThroughUpgradeScripts)({},e.feedbacks,null,this.#R,this.#U,!0);this.#F.sendWithCb("upgradedItems",{updatedActions:t.updatedActions,updatedFeedbacks:t.updatedFeedbacks}).catch((e=>{this.log("error",`Failed to save upgraded feedbacks: ${e}`)}))}this.#z.handleUpdateFeedbacks(e.feedbacks)}async _handleUpdateActions(e,t){if(!t){const t=(0,a.runThroughUpgradeScripts)(e.actions,{},null,this.#R,this.#U,!0);this.#F.sendWithCb("upgradedItems",{updatedActions:t.updatedActions,updatedFeedbacks:t.updatedFeedbacks}).catch((e=>{this.log("error",`Failed to save upgraded actions: ${e}`)}))}this.#B.handleUpdateActions(e.actions)}async _handleGetConfigFields(e){return{fields:(0,s.serializeIsVisibleFn)(this.getConfigFields())}}async _handleHttpRequest(e){if(!this.handleHttpRequest)throw new Error("handleHttpRequest is not supported!");return{response:await this.handleHttpRequest(e.request)}}async _handleLearnAction(e){return this.#B.handleLearnAction(e)}async _handleLearnFeedback(e){return this.#z.handleLearnFeedback(e)}async _handleStartStopRecordActions(e){if(e.recording){if(this.#q)return}else if(!this.#q)return;if(!this.handleStartStopRecordActions)throw this.#q=!1,new Error("Recording actions is not supported by this module!");this.#q=e.recording,this.handleStartStopRecordActions(this.#q)}async _handleVariablesChanged(e){this.#z.handleVariablesChanged(e)}async _handleSharedUdpSocketMessage(e){for(const t of this.#J.values())t.handleId===e.handleId&&t.receiveSocketMessage(e)}async _handleSharedUdpSocketError(e){for(const t of this.#J.values())t.handleId===e.handleId&&t.receiveSocketError(e.error)}saveConfig(e){this.#U=e,this.#F.sendWithNoCb("saveConfig",{config:e})}setActionDefinitions(e){this.#B.setActionDefinitions(e)}setFeedbackDefinitions(e){this.#z.setFeedbackDefinitions(e)}setPresetDefinitions(e){const t=[];for(const[r,i]of Object.entries(e))i&&t.push({...i,id:r});this.#F.sendWithNoCb("setPresetDefinitions",{presets:t})}setVariableDefinitions(e){const t=[],r=[];this.#L.clear();for(const i of e)t.push({id:i.variableId,name:i.name}),this.#L.set(i.variableId,i),this.#Q.has(i.variableId)||(this.#Q.set(i.variableId,""),r.push({id:i.variableId,value:""}));if(!this.#r.disableVariableValidation){const e=new Set(this.#L.keys());for(const t of this.#Q.keys())e.has(t)||(this.#Q.delete(t),r.push({id:t,value:void 0}))}this.#F.sendWithNoCb("setVariableDefinitions",{variables:t,newValues:r})}setVariableValues(e){const t=[];for(const[r,i]of Object.entries(e))this.#r.disableVariableValidation?(void 0===i?this.#Q.delete(r):this.#Q.set(r,i),t.push({id:r,value:i})):this.#L.has(r)?(this.#Q.set(r,i??""),t.push({id:r,value:i??""})):t.push({id:r,value:void 0});this.#F.sendWithNoCb("setVariableValues",{newValues:t})}getVariableValue(e){return this.#Q.get(e)}async parseVariablesInString(e){const t=this.#z.parseVariablesContext;return t&&this.log("debug",`parseVariablesInString called while in: ${t}. You should use the parseVariablesInString provided to the callback instead`),(await this.#F.sendWithCb("parseVariablesInString",{text:e,controlId:void 0,actionInstanceId:void 0,feedbackInstanceId:void 0})).text}checkFeedbacks(...e){this.#z.checkFeedbacks(e)}checkFeedbacksById(...e){this.#z.checkFeedbacksById(e)}_getAllActions(){return this.#B._getAllActions()}subscribeActions(...e){this.#B.subscribeActions(e)}unsubscribeActions(...e){this.#B.unsubscribeActions(e)}_getAllFeedbacks(){return this.#z._getAllFeedbacks()}subscribeFeedbacks(...e){this.#z.subscribeFeedbacks(e)}unsubscribeFeedbacks(...e){this.#z.unsubscribeFeedbacks(e)}recordAction(e,t){if(!this.#q)throw new Error("Not currently recording actions");this.#F.sendWithNoCb("recordAction",{uniquenessId:t??null,actionId:e.actionId,options:e.options,delay:e.delay})}setCustomVariableValue(e,t){this.#F.sendWithNoCb("setCustomVariable",{customVariableId:e,value:t})}oscSend(e,t,r,i){this.#F.sendWithNoCb("send-osc",(0,n.literal)({host:e,port:t,path:r,args:i}))}updateStatus(e,t){this.#F.sendWithNoCb("set-status",(0,n.literal)({status:e,message:t??null}))}log(e,t){this.#F.sendWithNoCb("log-message",(0,n.literal)({level:e,message:t}))}createSharedUdpSocket(e,t){const r="string"==typeof e?{type:e}:e,i=new d.SharedUdpSocketImpl(this.#F,this.#J,r);return t&&i.on("message",t),i}}},386:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},400:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.Regex=t.InstanceStatus=void 0,function(e){e.Ok="ok",e.Connecting="connecting",e.Disconnected="disconnected",e.ConnectionFailure="connection_failure",e.BadConfig="bad_config",e.UnknownError="unknown_error",e.UnknownWarning="unknown_warning",e.AuthenticationFailure="authentication_failure"}(r||(t.InstanceStatus=r={})),function(e){e.IP="/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/",e.HOSTNAME="/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/",e.BOOLEAN="/^(true|false|0|1)$/i",e.PORT="/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/",e.MAC_ADDRESS="/^(?:[a-fA-F0-9]{2}:){5}([a-fA-F0-9]{2})$/",e.PERCENT="/^(100|[0-9]|[0-9][0-9])$/",e.FLOAT="/^([0-9]*\\.)?[0-9]+$/",e.SIGNED_FLOAT="/^[+-]?([0-9]*\\.)?[0-9]+$/",e.FLOAT_OR_INT="/^([0-9]+)(\\.[0-9]+)?$/",e.NUMBER="/^\\d+$/",e.SIGNED_NUMBER="/^[+-]?\\d+$/",e.SOMETHING="/^.+$/",e.TIMECODE="/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/"}(i||(t.Regex=i={}))},983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},104:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(635);i.__exportStar(r(730),t),i.__exportStar(r(649),t),i.__exportStar(r(386),t),i.__exportStar(r(400),t),i.__exportStar(r(983),t),i.__exportStar(r(104),t),i.__exportStar(r(258),t),i.__exportStar(r(131),t),i.__exportStar(r(371),t),i.__exportStar(r(786),t),i.__exportStar(r(132),t)},258:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},131:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedUdpSocketImpl=void 0;const i=r(635).__importDefault(r(228)),n=r(360);class o extends i.default{#F;#Y;#r;get handleId(){return this.boundState?.handleId}get portNumber(){return this.boundState?.portNumber}get boundState(){return this.#b&&"object"==typeof this.#b?this.#b:void 0}#b="pending";constructor(e,t,r){super(),this.#F=e,this.#Y=t,this.#r={...r}}bind(e,t,r){if(this.#b&&"object"==typeof this.#b)throw new Error("Socket is already bound");switch(this.#b){case"fatalError":throw new Error("Socket has encountered fatal error");case"binding":throw new Error("Socket is already bound");case"closed":throw new Error("Socket is closing");case"pending":break;default:throw(0,n.assertNever)(this.#b),new Error("Invalid socket state")}this.#b="binding",r&&this.on("listening",r),this.#F.sendWithCb("sharedUdpSocketJoin",{family:this.#r.type,portNumber:e}).then((t=>{this.#b={portNumber:e,handleId:t},this.#Y.set(t,this),this.emit("listening")}),(e=>{this.#b="closed",this.emit("error",e instanceof Error?e:new Error(e))})).catch((()=>null))}close(e){if(this.#b&&"object"==typeof this.#b);else switch(this.#b){case"fatalError":throw new Error("Socket has encountered fatal error");case"pending":case"closed":case"binding":throw new Error("Socket is not open");default:throw(0,n.assertNever)(this.#b),new Error("Invalid socket state")}const t=this.#b.handleId;this.#b="closed",e&&this.on("close",e),this.#F.sendWithCb("sharedUdpSocketLeave",{handleId:t}).then((()=>{this.#Y.delete(t),this.emit("close")}),(e=>{this.#Y.delete(t),this.emit("error",e instanceof Error?e:new Error(e))})).catch((()=>null))}send(e,t,r,i,n,o){if("number"!=typeof t)throw new Error("Invalid arguments");if("number"==typeof r){if("number"!=typeof i||"string"!=typeof n)throw new Error("Invalid arguments");if(void 0!==o&&"number"!=typeof o)throw new Error("Invalid arguments");const s=this.#Z(e,t,r);this.#K(s,i,n,o)}else{if("string"!=typeof r)throw new Error("Invalid arguments");{if(void 0!==i&&"function"!=typeof i)throw new Error("Invalid arguments");const n=this.#Z(e,0,void 0);this.#K(n,t,r,i)}}}#Z(e,t,r){let i;if("string"==typeof e)i=Buffer.from(e,"utf-8");else if(Buffer.isBuffer(e))i=e;else{if(Array.isArray(e))return Buffer.from(e);i=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}return i.subarray(t,void 0!==r?r+t:void 0)}#K(e,t,r,i){if(!this.#b||"object"!=typeof this.#b)throw new Error("Socket is not open");this.#F.sendWithCb("sharedUdpSocketSend",{handleId:this.#b.handleId,message:e,address:r,port:t}).then((()=>{i?.()}),(e=>{this.emit("error",e instanceof Error?e:new Error(e))})).catch((()=>null))}receiveSocketMessage(e){try{this.emit("message",e.message,e.source)}catch(e){}}receiveSocketError(e){this.#b="fatalError";const t=this.boundState;t&&this.#Y.delete(t.handleId);try{this.emit("error",e)}catch(e){}}}t.SharedUdpSocketImpl=o},371:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},786:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyUpgradeScript=void 0,t.CreateConvertToBooleanFeedbackUpgradeScript=function(e){return(t,r)=>{const i=[];for(const t of r.feedbacks){let r=e[t.feedbackId];if(!0===r&&(r={bg:"bgcolor",bgcolor:"bgcolor",fg:"color",color:"color",png64:"png64",png:"png64"}),r){t.style||(t.style={});for(const[e,n]of Object.entries(r))void 0!==t.options[e]&&(t.style[n]=t.options[e],delete t.options[e],i.push(t))}}return{updatedConfig:null,updatedActions:[],updatedFeedbacks:i}}},t.CreateUseBuiltinInvertForFeedbacksUpgradeScript=function(e){return(t,r)=>{const i=[];for(const t of r.feedbacks){const r=e[t.feedbackId];if("string"!=typeof r)continue;const n=t.options[r];void 0!==n&&(delete t.options[r],t.isInverted="true"===n||!0===n||Number(n)>0,i.push(t))}return{updatedConfig:null,updatedActions:[],updatedFeedbacks:i}}},t.EmptyUpgradeScript=()=>({updatedConfig:null,updatedActions:[],updatedFeedbacks:[]})},132:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.literal=function(e){return e},t.assertNever=function(e){},t.combineRgb=function(e,t,r,i){let n=(255&e)<<16|(255&t)<<8|255&r;return i&&i>=0&&i<1&&(n+=16777216*Math.round(255*(1-i))),n},t.splitRgb=n,t.splitHsl=function(e){const t=n(e);return(0,i.colord)(`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`).toHsl()},t.splitHsv=function(e){const t=n(e);return(0,i.colord)(`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`).toHsv()},t.splitHex=function(e){const t=n(e);return(0,i.colord)(`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`).toHex()};const i=r(284);function n(e){if("number"==typeof e)return e>16777215?{r:e>>16&255,g:e>>8&255,b:255&e,a:(255-(e>>24&255))/255}:{r:e>>16&255,g:e>>8&255,b:255&e,a:1};if("string"==typeof e&&(0,i.colord)(e).isValid()){const t=(0,i.colord)(e).toRgb();return{r:t.r,g:t.g,b:t.b,a:t.a}}return{r:0,g:0,b:0,a:1}}},281:(e,t,r)=>{"use strict";e.exports=u,e.exports.default=u;const i={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ModuleManifest",properties:{$schema:{type:"string"},id:{type:"string",description:"Unique identifier for the module"},name:{type:"string",description:"Name of the module"},shortname:{type:"string"},description:{type:"string",description:"Description of the module "},version:{type:"string",description:"Current version of the module"},license:{type:"string",description:"SPDX identifier for license of the module"},repository:{type:"string",description:"URL to the source repository"},bugs:{type:"string",description:"URL to bug tracker"},maintainers:{type:"array",description:"List of active maintiners",uniqueItems:!0,items:{type:"object",title:"ModuleManifestMaintainer",properties:{name:{type:"string"},email:{type:"string"},github:{type:"string"}},required:["name"]}},legacyIds:{type:"array",description:"If the module had a different unique identifier previously, then specify it here",uniqueItems:!0,items:{type:"string"}},runtime:{type:"object",title:"ModuleManifestRuntime",description:"Information on how to execute the module",properties:{type:{type:"string",description:"Type of the module. Must be: node18 or node22",enum:["node18","node22"]},api:{type:"string",description:"Which host-api does it use. In the future alternate options will be allowed",enum:["nodejs-ipc"]},apiVersion:{type:"string",description:"The version of the host-api used"},entrypoint:{type:"string",description:"Entrypoint to pass to the runtime. eg index.js"}},required:["type","api","apiVersion","entrypoint"]},manufacturer:{type:"string"},products:{type:"array",uniqueItems:!0,items:{type:"string"},minItems:1},keywords:{type:"array",uniqueItems:!0,items:{type:"string"}},bonjourQueries:{type:"object",description:"If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name",patternProperties:{"":{oneOf:[{$ref:"#/definitions/bonjourQuery"},{type:"array",items:{$ref:"#/definitions/bonjourQuery"}}]}},additionalProperties:!1}},additionalProperties:!1,required:["id","name","shortname","description","version","license","repository","bugs","maintainers","legacyIds","runtime","manufacturer","products","keywords"],definitions:{bonjourQuery:{type:"object",title:"ModuleBonjourQuery",description:"",properties:{type:{type:"string"},protocol:{type:"string",enum:["tcp","udp"]},txt:{type:"object",description:"Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",patternProperties:{"":{type:"string"}},additionalProperties:!1}},required:["type","protocol"],additionalProperties:!1}}},n={type:"object",title:"ModuleBonjourQuery",description:"",properties:{type:{type:"string"},protocol:{type:"string",enum:["tcp","udp"]},txt:{type:"object",description:"Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",patternProperties:{"":{type:"string"}},additionalProperties:!1}},required:["type","protocol"],additionalProperties:!1},o=Object.prototype.hasOwnProperty,s=r(169).A,a=new RegExp("","u");function u(e,{instancePath:t="",parentData:r,parentDataProperty:c,rootData:l=e}={}){let d=null,p=0;if(0===p){if(!e||"object"!=typeof e||Array.isArray(e))return u.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{let r;if(void 0===e.id&&(r="id")||void 0===e.name&&(r="name")||void 0===e.shortname&&(r="shortname")||void 0===e.description&&(r="description")||void 0===e.version&&(r="version")||void 0===e.license&&(r="license")||void 0===e.repository&&(r="repository")||void 0===e.bugs&&(r="bugs")||void 0===e.maintainers&&(r="maintainers")||void 0===e.legacyIds&&(r="legacyIds")||void 0===e.runtime&&(r="runtime")||void 0===e.manufacturer&&(r="manufacturer")||void 0===e.products&&(r="products")||void 0===e.keywords&&(r="keywords"))return u.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:r},message:"must have required property '"+r+"'"}],!1;{const r=p;for(const r in e)if(!o.call(i.properties,r))return u.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"}],!1;if(r===p){if(void 0!==e.$schema){const r=p;if("string"!=typeof e.$schema)return u.errors=[{instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var h=r===p}else h=!0;if(h){if(void 0!==e.id){const r=p;if("string"!=typeof e.id)return u.errors=[{instancePath:t+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.name){const r=p;if("string"!=typeof e.name)return u.errors=[{instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.shortname){const r=p;if("string"!=typeof e.shortname)return u.errors=[{instancePath:t+"/shortname",schemaPath:"#/properties/shortname/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.description){const r=p;if("string"!=typeof e.description)return u.errors=[{instancePath:t+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.version){const r=p;if("string"!=typeof e.version)return u.errors=[{instancePath:t+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.license){const r=p;if("string"!=typeof e.license)return u.errors=[{instancePath:t+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.repository){const r=p;if("string"!=typeof e.repository)return u.errors=[{instancePath:t+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.bugs){const r=p;if("string"!=typeof e.bugs)return u.errors=[{instancePath:t+"/bugs",schemaPath:"#/properties/bugs/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.maintainers){let r=e.maintainers;const i=p;if(p===i){if(!Array.isArray(r))return u.errors=[{instancePath:t+"/maintainers",schemaPath:"#/properties/maintainers/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var f=!0;const e=r.length;for(let i=0;i1)for(;i--;)for(e=i;e--;)if(s(r[i],r[e]))return u.errors=[{instancePath:t+"/maintainers",schemaPath:"#/properties/maintainers/uniqueItems",keyword:"uniqueItems",params:{i,j:e},message:"must NOT have duplicate items (items ## "+e+" and "+i+" are identical)"}],!1}}}h=i===p}else h=!0;if(h){if(void 0!==e.legacyIds){let r=e.legacyIds;const i=p;if(p===i){if(!Array.isArray(r))return u.errors=[{instancePath:t+"/legacyIds",schemaPath:"#/properties/legacyIds/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var m=!0;const e=r.length;for(let i=0;i1){const n={};for(;i--;){let o=r[i];if("string"==typeof o){if("number"==typeof n[o])return e=n[o],u.errors=[{instancePath:t+"/legacyIds",schemaPath:"#/properties/legacyIds/uniqueItems",keyword:"uniqueItems",params:{i,j:e},message:"must NOT have duplicate items (items ## "+e+" and "+i+" are identical)"}],!1;n[o]=i}}}}}}h=i===p}else h=!0;if(h){if(void 0!==e.runtime){let r=e.runtime;const n=p;if(p===n){if(!r||"object"!=typeof r||Array.isArray(r))return u.errors=[{instancePath:t+"/runtime",schemaPath:"#/properties/runtime/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{let e;if(void 0===r.type&&(e="type")||void 0===r.api&&(e="api")||void 0===r.apiVersion&&(e="apiVersion")||void 0===r.entrypoint&&(e="entrypoint"))return u.errors=[{instancePath:t+"/runtime",schemaPath:"#/properties/runtime/required",keyword:"required",params:{missingProperty:e},message:"must have required property '"+e+"'"}],!1;if(void 0!==r.type){let e=r.type;const n=p;if("string"!=typeof e)return u.errors=[{instancePath:t+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if("node18"!==e&&"node22"!==e)return u.errors=[{instancePath:t+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/enum",keyword:"enum",params:{allowedValues:i.properties.runtime.properties.type.enum},message:"must be equal to one of the allowed values"}],!1;var y=n===p}else y=!0;if(y){if(void 0!==r.api){let e=r.api;const n=p;if("string"!=typeof e)return u.errors=[{instancePath:t+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if("nodejs-ipc"!==e)return u.errors=[{instancePath:t+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/enum",keyword:"enum",params:{allowedValues:i.properties.runtime.properties.api.enum},message:"must be equal to one of the allowed values"}],!1;y=n===p}else y=!0;if(y){if(void 0!==r.apiVersion){const e=p;if("string"!=typeof r.apiVersion)return u.errors=[{instancePath:t+"/runtime/apiVersion",schemaPath:"#/properties/runtime/properties/apiVersion/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;y=e===p}else y=!0;if(y)if(void 0!==r.entrypoint){const e=p;if("string"!=typeof r.entrypoint)return u.errors=[{instancePath:t+"/runtime/entrypoint",schemaPath:"#/properties/runtime/properties/entrypoint/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;y=e===p}else y=!0}}}}h=n===p}else h=!0;if(h){if(void 0!==e.manufacturer){const r=p;if("string"!=typeof e.manufacturer)return u.errors=[{instancePath:t+"/manufacturer",schemaPath:"#/properties/manufacturer/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;h=r===p}else h=!0;if(h){if(void 0!==e.products){let r=e.products;const i=p;if(p===i){if(!Array.isArray(r))return u.errors=[{instancePath:t+"/products",schemaPath:"#/properties/products/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;if(r.length<1)return u.errors=[{instancePath:t+"/products",schemaPath:"#/properties/products/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{var g=!0;const e=r.length;for(let i=0;i1){const n={};for(;i--;){let o=r[i];if("string"==typeof o){if("number"==typeof n[o])return e=n[o],u.errors=[{instancePath:t+"/products",schemaPath:"#/properties/products/uniqueItems",keyword:"uniqueItems",params:{i,j:e},message:"must NOT have duplicate items (items ## "+e+" and "+i+" are identical)"}],!1;n[o]=i}}}}}}h=i===p}else h=!0;if(h){if(void 0!==e.keywords){let r=e.keywords;const i=p;if(p===i){if(!Array.isArray(r))return u.errors=[{instancePath:t+"/keywords",schemaPath:"#/properties/keywords/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;{var v=!0;const e=r.length;for(let i=0;i1){const n={};for(;i--;){let o=r[i];if("string"==typeof o){if("number"==typeof n[o])return e=n[o],u.errors=[{instancePath:t+"/keywords",schemaPath:"#/properties/keywords/uniqueItems",keyword:"uniqueItems",params:{i,j:e},message:"must NOT have duplicate items (items ## "+e+" and "+i+" are identical)"}],!1;n[o]=i}}}}}}h=i===p}else h=!0;if(h)if(void 0!==e.bonjourQueries){let r=e.bonjourQueries;const i=p;if(p===i){if(!r||"object"!=typeof r||Array.isArray(r))return u.errors=[{instancePath:t+"/bonjourQueries",schemaPath:"#/properties/bonjourQueries/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;{const e=p;for(const e in r)if(!a.test(e))return u.errors=[{instancePath:t+"/bonjourQueries",schemaPath:"#/properties/bonjourQueries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"}],!1;if(e===p)for(const e in r)if(a.test(e)){let i=r[e];const o=p,s=p;let c=!1,l=null;const h=p;if(p==p)if(i&&"object"==typeof i&&!Array.isArray(i)){let r;if(void 0===i.type&&(r="type")||void 0===i.protocol&&(r="protocol")){const i={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/bonjourQuery/required",keyword:"required",params:{missingProperty:r},message:"must have required property '"+r+"'"};null===d?d=[i]:d.push(i),p++}else{const r=p;for(const r in i)if("type"!==r&&"protocol"!==r&&"txt"!==r){const i={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/bonjourQuery/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};null===d?d=[i]:d.push(i),p++;break}if(r===p){if(void 0!==i.type){const r=p;if("string"!=typeof i.type){const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1")+"/type",schemaPath:"#/definitions/bonjourQuery/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};null===d?d=[r]:d.push(r),p++}var _=r===p}else _=!0;if(_){if(void 0!==i.protocol){let r=i.protocol;const o=p;if("string"!=typeof r){const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1")+"/protocol",schemaPath:"#/definitions/bonjourQuery/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};null===d?d=[r]:d.push(r),p++}if("tcp"!==r&&"udp"!==r){const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1")+"/protocol",schemaPath:"#/definitions/bonjourQuery/properties/protocol/enum",keyword:"enum",params:{allowedValues:n.properties.protocol.enum},message:"must be equal to one of the allowed values"};null===d?d=[r]:d.push(r),p++}_=o===p}else _=!0;if(_)if(void 0!==i.txt){let r=i.txt;const n=p;if(p===n)if(r&&"object"==typeof r&&!Array.isArray(r)){const i=p;for(const i in r)if(!a.test(i)){const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1")+"/txt",schemaPath:"#/definitions/bonjourQuery/properties/txt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};null===d?d=[r]:d.push(r),p++;break}if(i===p)for(const i in r)if(a.test(i)){const n=p;if("string"!=typeof r[i]){const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1")+"/txt/"+i.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/bonjourQuery/properties/txt/patternProperties//type",keyword:"type",params:{type:"string"},message:"must be string"};null===d?d=[r]:d.push(r),p++}if(n!==p)break}}else{const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1")+"/txt",schemaPath:"#/definitions/bonjourQuery/properties/txt/type",keyword:"type",params:{type:"object"},message:"must be object"};null===d?d=[r]:d.push(r),p++}_=n===p}else _=!0}}}}else{const r={instancePath:t+"/bonjourQueries/"+e.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/bonjourQuery/type",keyword:"type",params:{type:"object"},message:"must be object"};null===d?d=[r]:d.push(r),p++}h===p&&(c=!0,l=0);const f=p;if(p===f)if(Array.isArray(i)){const r=i.length;for(let o=0;o{"use strict";const i=r(865);e.exports=(e,t={})=>{if("function"!=typeof e)throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:r=0,maxWait:n=0,before:o=!1,after:s=!0}=t;if(!o&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,u,c;const l=function(...t){const i=this,l=o&&!a;return clearTimeout(a),a=setTimeout((()=>{a=void 0,u&&(clearTimeout(u),u=void 0),s&&(c=e.apply(i,t))}),r),n>0&&!u&&s&&(u=setTimeout((()=>{u=void 0,a&&(clearTimeout(a),a=void 0),c=e.apply(i,t)}),n)),l&&(c=e.apply(i,t)),c};return i(l,e),l.cancel=()=>{a&&(clearTimeout(a),a=void 0),u&&(clearTimeout(u),u=void 0)},l}},635:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>V,__assign:()=>o,__asyncDelegator:()=>S,__asyncGenerator:()=>O,__asyncValues:()=>P,__await:()=>k,__awaiter:()=>f,__classPrivateFieldGet:()=>E,__classPrivateFieldIn:()=>$,__classPrivateFieldSet:()=>C,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>D,__esDecorate:()=>c,__exportStar:()=>y,__extends:()=>n,__generator:()=>b,__importDefault:()=>j,__importStar:()=>A,__makeTemplateObject:()=>x,__metadata:()=>h,__param:()=>u,__propKey:()=>d,__read:()=>v,__rest:()=>s,__rewriteRelativeImportExtension:()=>N,__runInitializers:()=>l,__setFunctionName:()=>p,__spread:()=>_,__spreadArray:()=>I,__spreadArrays:()=>w,__values:()=>g,default:()=>F});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function u(e,t){return function(r,i){t(r,i,e)}}function c(e,t,r,i,n,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,u=i.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?i.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var f={};for(var b in i)f[b]="access"===b?{}:i[b];for(var b in i.access)f.access[b]=i.access[b];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var m=(0,r[h])("accessor"===u?{get:d.get,set:d.set}:d[c],f);if("accessor"===u){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(d.get=a),(a=s(m.set))&&(d.set=a),(a=s(m.init))&&n.unshift(a)}else(a=s(m))&&("field"===u?n.unshift(a):d[c]=a)}l&&Object.defineProperty(l,i.name,d),p=!0}function l(e,t,r){for(var i=arguments.length>2,n=0;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function _(){for(var e=[],t=0;t1||a(e,t)}))},t&&(i[e]=t(i[e])))}function a(e,t){try{(r=n[e](t)).value instanceof k?Promise.resolve(r.value.v).then(u,c):l(o[0][2],r)}catch(e){l(o[0][3],e)}var r}function u(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function S(e){var t,r;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:k(e[i](t)),done:!1}:n?n(t):t}:n}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=g(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise((function(i,n){!function(e,t,r,i){Promise.resolve(i).then((function(t){e({value:t,done:r})}),t)}(i,n,(t=e[r](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&m(t,e,r);return M(t,e),t}function j(e){return e&&e.__esModule?e:{default:e}}function E(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function C(e,t,r,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,r):n?n.value=r:t.set(e,r),r}function $(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function V(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],r&&(n=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:r})}else r&&e.stack.push({async:!0});return t}var T="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};function D(e){function t(t){e.error=e.hasError?new T(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,i=0;return function n(){for(;r=e.stack.pop();)try{if(!r.async&&1===i)return i=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,(function(e){return t(e),n()}))}else i|=1}catch(e){t(e)}if(1===i)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function N(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,r,i,n,o){return r?t?".jsx":".js":!i||n&&o?i+n+"."+o.toLowerCase()+"js":e})):e}const F={__extends:n,__assign:o,__rest:s,__decorate:a,__param:u,__esDecorate:c,__runInitializers:l,__propKey:d,__setFunctionName:p,__metadata:h,__awaiter:f,__generator:b,__createBinding:m,__exportStar:y,__values:g,__read:v,__spread:_,__spreadArrays:w,__spreadArray:I,__await:k,__asyncGenerator:O,__asyncDelegator:S,__asyncValues:P,__makeTemplateObject:x,__importStar:A,__importDefault:j,__classPrivateFieldGet:E,__classPrivateFieldSet:C,__classPrivateFieldIn:$,__addDisposableResource:V,__disposeResources:D,__rewriteRelativeImportExtension:N}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=r(278);const t=[{type:"textinput",id:"host",label:"IP Address",tooltip:"Enter the IP adress of the HDMI matrix and make sure it is reachable from your network.",width:8,regex:e.Regex.IP},{type:"number",id:"port",label:"Telnet Port",default:23,width:4,tooltip:"The default port is 23 - if you don't have any complex network setups, you don't need to change this port. ",regex:e.Regex.PORT},{type:"checkbox",id:"autoReconnect",label:"Auto Reconnect",default:!0}],i=[{name:"Output 1: Resolution",variableId:"output1_resolution"},{name:"Output 2: Resolution",variableId:"output2_resolution"},{name:"Output 3: Resolution",variableId:"output3_resolution"},{name:"Output 4: Resolution",variableId:"output4_resolution"},{name:"Output 1: Color Space",variableId:"output1_csc"},{name:"Output 2: Color Space",variableId:"output2_csc"},{name:"Output 3: Color Space",variableId:"output3_csc"},{name:"Output 4: Color Space",variableId:"output4_csc"},{name:"Output 1: HDCP Status",variableId:"output1_hdcp"},{name:"Output 2: HDCP Status",variableId:"output2_hdcp"},{name:"Output 3: HDCP Status",variableId:"output3_hdcp"},{name:"Output 4: HDCP Status",variableId:"output4_hdcp"},{name:"Output 1: H-Mirror state",variableId:"output1_hmirror"},{name:"Output 2: H-Mirror state",variableId:"output2_hmirror"},{name:"Output 3: H-Mirror state",variableId:"output3_hmirror"},{name:"Output 4: H-Mirror state",variableId:"output4_hmirror"},{name:"Output 1: V-Mirror state",variableId:"output1_vmirror"},{name:"Output 2: V-Mirror state",variableId:"output2_vmirror"},{name:"Output 3: V-Mirror state",variableId:"output3_vmirror"},{name:"Output 4: V-Mirror state",variableId:"output4_vmirror"},{name:"Output 1: Stream state",variableId:"output1_stream"},{name:"Output 2: Stream state",variableId:"output2_stream"},{name:"Output 3: Stream state",variableId:"output3_stream"},{name:"Output 4: Stream state",variableId:"output4_stream"},{name:"Output 1: Input Source",variableId:"output1_input_source"},{name:"Output 2: Input Source",variableId:"output2_input_source"},{name:"Output 3: Input Source",variableId:"output3_input_source"},{name:"Output 4: Input Source",variableId:"output4_input_source"},{name:"Output 1: External Audio enabled",variableId:"output1_external_audio_enabled"},{name:"Output 2: External Audio enabled",variableId:"output2_external_audio_enabled"},{name:"Output 3: External Audio enabled",variableId:"output3_external_audio_enabled"},{name:"Output 4: External Audio enabled",variableId:"output4_external_audio_enabled"},{name:"Output 1: External Audio source",variableId:"output1_external_audio_source"},{name:"Output 2: External Audio source",variableId:"output2_external_audio_source"},{name:"Output 3: External Audio source",variableId:"output3_external_audio_source"},{name:"Output 4: External Audio source",variableId:"output4_external_audio_source"},{name:"Input 1: EDID mode",variableId:"input1_edid"},{name:"Input 2: EDID mode",variableId:"input2_edid"},{name:"Input 3: EDID mode",variableId:"input3_edid"},{name:"Input 4: EDID mode",variableId:"input4_edid"},{name:"Input 1: Audio Setting",variableId:"input1_audio_setting"},{name:"Input 2: Audio Setting",variableId:"input2_audio_setting"},{name:"Input 3: Audio Setting",variableId:"input3_audio_setting"},{name:"Input 4: Audio Setting",variableId:"input4_audio_setting"},{name:"Output: Background display mode",variableId:"output_background"},{name:"Output: Display mode",variableId:"output_display_mode"},{name:"Output: External Audio mode",variableId:"output_external_audio_mode"},{name:"TV Wall: Display mode",variableId:"tv_wall_display_mode"},{name:"TV Wall: Resolution",variableId:"tv_wall_resolution"},{name:"TV Wall Group 1: Input Source",variableId:"tv_wall_group1_input"},{name:"TV Wall Group 2: Input Source",variableId:"tv_wall_group2_input"},{name:"TV Wall Group 3: Input Source",variableId:"tv_wall_group3_input"},{name:"TV Wall Group 4: Input Source",variableId:"tv_wall_group4_input"},{name:"MultiView: Resolution",variableId:"multiview_resolution"},{name:"MultiView: Audio Source",variableId:"multiview_audio_source"},{name:"MultiView: Window 1 Input",variableId:"multiview_window1_input"},{name:"MultiView: Window 2 Input",variableId:"multiview_window2_input"},{name:"MultiView: Window 3 Input",variableId:"multiview_window3_input"},{name:"MultiView: Window 4 Input",variableId:"multiview_window4_input"},{name:"PiP: Position",variableId:"pip_position"},{name:"PiP: Size",variableId:"pip_size"},{name:"Device: Front Panel Button Lock",variableId:"device_panel_locked"},{name:"Last loaded preset",variableId:"last_loaded_preset"},{name:"Device: Power State",variableId:"device_powered_on"},{name:"Device: Button Beep Enabled",variableId:"device_beep_enabled"}];var n=r(897);class o extends e.InstanceBase{async init(t){var r;this.config=t,this.setActionDefinitions((r=this,{lock:{name:"Device: Lock panel buttons",description:"Lock/Unlock the button on the panel",options:[{type:"dropdown",id:"command",label:"Action",default:"lock",choices:[{id:"lock",label:"Lock"},{id:"unlock",label:"Unlock"},{id:"toggle",label:"Toggle"}]}],callback:async e=>{r.setPanelLockState(e.options.command)}},device_power:{name:"Device: Control power",description:"Power On/Off the device",options:[{type:"dropdown",id:"power",label:"Action",default:"2",choices:[{id:"0",label:"Power Off"},{id:"1",label:"Power On"},{id:"2",label:"Toggle"}]}],callback:async e=>{r.setPowerState(e.options.power)}},device_beep:{name:"Device: Control beep",description:"Enable/Disable the button beep on the device",options:[{type:"dropdown",id:"beep",label:"Action",default:"2",choices:[{id:"0",label:"Beep Off"},{id:"1",label:"Beep On"},{id:"2",label:"Toggle"}]}],callback:async e=>{r.setBeepMode(e.options.beep)}},reboot_device:{name:"Device: Reboot",description:"Send a reboot command to the complete device",options:[],callback:async()=>{r.sendReboot()}},reboot_network_modules:{name:"Device: Reboot Network module",description:"Send a reboot command to the network module in the device",options:[],callback:async()=>{r.sendNetworkReboot()}},recall_preset:{name:"Preset: Recall",description:"Recall a preset on the device",options:[{type:"dropdown",id:"preset",label:"Preset",default:"1",choices:[{id:"1",label:"Preset 1"},{id:"2",label:"Preset 2"},{id:"3",label:"Preset 3"},{id:"4",label:"Preset 4"},{id:"5",label:"Preset 5"},{id:"6",label:"Preset 6"},{id:"7",label:"Preset 7"},{id:"8",label:"Preset 8"}]}],callback:async e=>{r.recallPreset(e.options.preset)}},save_preset:{name:"Preset: Save",description:"Save the current configuration to a preset in the device",options:[{type:"dropdown",id:"preset",label:"Preset",default:"1",choices:[{id:"1",label:"Preset 1"},{id:"2",label:"Preset 2"},{id:"3",label:"Preset 3"},{id:"4",label:"Preset 4"},{id:"5",label:"Preset 5"},{id:"6",label:"Preset 6"},{id:"7",label:"Preset 7"},{id:"8",label:"Preset 8"}]}],callback:async e=>{r.savePreset(e.options.preset)}},clear_preset:{name:"Preset: Clear",description:"Clear a preset in the device",options:[{type:"dropdown",id:"preset",label:"Preset",default:"1",choices:[{id:"1",label:"Preset 1"},{id:"2",label:"Preset 2"},{id:"3",label:"Preset 3"},{id:"4",label:"Preset 4"},{id:"5",label:"Preset 5"},{id:"6",label:"Preset 6"},{id:"7",label:"Preset 7"},{id:"8",label:"Preset 8"}]}],callback:async e=>{r.clearPreset(e.options.preset)}},output_display_mode:{name:"Output: Set display mode",description:"Set the output display mode",options:[{type:"dropdown",id:"mode",label:"Display mode",default:"0",choices:[{id:"0",label:"Matrix Mode"},{id:"1",label:"Video Wall Mode"},{id:"2",label:"Multi-Viewer Mode"}]}],callback:async e=>{r.setOutputDisplayMode(e.options.mode)}},output_resolution:{name:"Output: Set resolution",description:"Set the resolution for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"resolution",label:"Resolution",default:"16",choices:[{id:"1",label:"4096x2160p60"},{id:"2",label:"4096x2160p50"},{id:"3",label:"3840x2160p60"},{id:"4",label:"3840x2160p50"},{id:"5",label:"3840x2160p30"},{id:"6",label:"1920x1080p60"},{id:"7",label:"1920x1080p50"},{id:"8",label:"1920x1080i60"},{id:"9",label:"1920x1080i50"},{id:"10",label:"1920x1200p60rb"},{id:"11",label:"1360x768p60"},{id:"12",label:"1280x800p60"},{id:"13",label:"1280x720p60"},{id:"14",label:"1280x720p50"},{id:"15",label:"1024x768p60"},{id:"16",label:"Auto"}]}],callback:async e=>{r.setOutputResolution(e.options.output,e.options.resolution)}},output_color_space:{name:"Output: Set color space",description:"Set the color space for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"csc",label:"Color space",default:"1",choices:[{id:"1",label:"rgb444"},{id:"2",label:"ycbcr444"},{id:"3",label:"ycbcr422"},{id:"4",label:"ycbcr420"}]}],callback:async e=>{r.setOutputColorSpace(e.options.output,e.options.csc)}},output_hdcp:{name:"Output: Set HDCP mode",description:"Set the HDCP mode for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"hdcp",label:"HDCP",default:"1",choices:[{id:"1",label:"HDCP 1.4"},{id:"2",label:"HDCP 2.2"},{id:"3",label:"Follow Sink"},{id:"4",label:"Follow Source"}]}],callback:async e=>{r.setOutputHDCP(e.options.output,e.options.hdcp)}},output_mirror_v:{name:"Output: Mirror vertical",description:"Set the y-mirror mode for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"mirror",label:"V-Mirror",default:"0",choices:[{id:"0",label:"V-Mirror Off"},{id:"1",label:"V-Mirror On"}]}],callback:async e=>{r.setOutputVMirror(e.options.output,e.options.mirror)}},output_mirror_h:{name:"Output: Mirror horizontal",description:"Set the h-mirror mode for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"mirror",label:"H-Mirror",default:"0",choices:[{id:"0",label:"H-Mirror Off"},{id:"1",label:"H-Mirror On"}]}],callback:async e=>{r.setOutputHMirror(e.options.output,e.options.mirror)}},output_stream:{name:"Output: Set stream mode",description:"Set the stream mode for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"stream",label:"Stream",default:"0",choices:[{id:"0",label:"Stream Disable"},{id:"1",label:"Stream Enable"},{id:"2",label:"Toggle"}]}],callback:async e=>{r.setOutputStream(e.options.output,e.options.stream)}},output_cec_commands:{name:"Output: Send CEC command",description:"Send a CEC command to all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"cec",label:"CEC Command",default:"on",choices:[{id:"on",label:"Power On"},{id:"off",label:"Power Off"},{id:"mute",label:"Volume: Mute"},{id:"vol-",label:"Volume: Down"},{id:"vol+",label:"Volume: Up"},{id:"active",label:"Active Source"}]}],callback:async e=>{r.setOutputCECCommand(e.options.output,e.options.cec)}},output_external_audio_state:{name:"Output: Enable/Disable External Audio",description:"Enable or disable the external audio for all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"audio",label:"External Audio State",default:"0",choices:[{id:"0",label:"Disable External Audio"},{id:"1",label:"Enable External Audio"}]}],callback:async e=>{r.setOutputExternalAudioState(e.options.output,e.options.audio)}},output_external_audio_mode:{name:"Output: Set External Audio Mode",description:"Set the external audio mode for all outputs",options:[{type:"dropdown",id:"audio",label:"External Audio Mode",default:"0",choices:[{id:"0",label:"Bind to Input"},{id:"1",label:"Bind to Output"},{id:"2",label:"Matrix"}]}],callback:async e=>{r.setOutputExternalAudioState(e.options.output,e.options.audio)}},output_background:{name:"Output: Set background",description:"Set the no-signal background mode for all outputs",options:[{type:"dropdown",id:"background",label:"Background mode",default:"1",choices:[{id:"1",label:"Black Screen"},{id:"2",label:"Blue Screen"},{id:"3",label:"Color Bar"},{id:"4",label:"Gray Scale"},{id:"5",label:"Cross"},{id:"6",label:"Cross Hatch"}]}],callback:async e=>{r.setOutputBackground(e.options.background)}},input_edid:{name:"Input: Set EDID mode",description:"Set the EDID mode for all or a specific input",options:[{type:"dropdown",id:"input",label:"Input",default:"0",choices:[{id:"0",label:"All Inputs"},{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]},{type:"dropdown",id:"edid",label:"EDID Mode",default:"1",choices:[{id:"1",label:"4k60, 2.0ch"},{id:"2",label:"4k60, 5.1ch"},{id:"3",label:"4k60, 7.1ch"},{id:"4",label:"4k30, 2.0ch"},{id:"5",label:"4k30, 5.1ch"},{id:"6",label:"4k30, 7.1ch"},{id:"7",label:"1080p, 2.0ch"},{id:"8",label:"1080p, 5.1ch"},{id:"9",label:"1080p, 7.1ch"},{id:"10",label:"wuxga, 2.0ch"},{id:"11",label:"768p, 2.0ch"},{id:"12",label:"xga, 2.0ch"},{id:"13",label:"User 1"},{id:"14",label:"User 2"},{id:"15",label:"Copy Output 1"},{id:"16",label:"Copy Output 2"},{id:"17",label:"Copy Output 3"},{id:"18",label:"Copy Output 4"}]}],callback:async e=>{r.setInputEDID(e.options.input,e.options.edid)}},route_input_to_output:{name:"Route: Input to Output",description:"Route an input to all or a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"input",label:"Input",default:"1",choices:[{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]}],callback:async e=>{r.routeInputToOutput(e.options.output,e.options.input)}},input_cec_commands:{name:"Input: Send CEC command",description:"Send a CEC command to all or a specific input",options:[{type:"dropdown",id:"input",label:"Input",default:"0",choices:[{id:"0",label:"All Inputs"},{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]},{type:"dropdown",id:"cec",label:"CEC Command",default:"on",choices:[{id:"on",label:"Power On"},{id:"off",label:"Power Off"},{id:"menu",label:"Menu"},{id:"back",label:"Back"},{id:"up",label:"Menu: Up"},{id:"down",label:"Menu: Down"},{id:"left",label:"Menu: Left"},{id:"right",label:"Menu: Right"},{id:"enter",label:"Menu: Enter"},{id:"play",label:"Play"},{id:"pause",label:"Pause"},{id:"stop",label:"Stop"},{id:"rew",label:"Rewind"},{id:"ff",label:"Fast Forward"},{id:"mute",label:"Volume: Mute"},{id:"vol-",label:"Volume: Down"},{id:"vol+",label:"Volume: Up"},{id:"previuos",label:"Previous"},{id:"next",label:" Next"}]}],callback:async e=>{r.setInputCECCommand(e.options.input,e.options.cec)}},mv_display_mode:{name:"MultiView: Set display mode",description:"Set the display mode for the MultiView",options:[{type:"dropdown",id:"mode",label:"Display mode",default:"1",choices:[{id:"1",label:"Single"},{id:"2",label:"PiP"},{id:"3",label:"Dual"},{id:"4",label:"Triple"},{id:"5",label:"Quad"},{id:"6",label:"User"}]}],callback:async e=>{r.setMultiViewDisplayMode(e.options.mode)}},mv_window_input:{name:"MultiView: Set window input",description:"Set the input for a window in the current MultiView mode",options:[{type:"dropdown",id:"window",label:"Window",default:"0",choices:[{id:"0",label:"All Windows"},{id:"1",label:"Window 1"},{id:"2",label:"Window 2"},{id:"3",label:"Window 3"},{id:"4",label:"Window 4"}]},{type:"dropdown",id:"input",label:"Input",default:"1",choices:[{id:"1",label:"HDMI 1"},{id:"2",label:"HDMI 2"},{id:"3",label:"HDMI 3"},{id:"4",label:"HDMI 4"}]}],callback:async e=>{r.setMultiViewWindowInput(e.options.window,e.options.input)}},pip_position:{name:"PiP: Set position",description:"Set the position for the PiP window",options:[{type:"dropdown",id:"position",label:"Position",default:"1",choices:[{id:"1",label:"Upper Left"},{id:"2",label:"Lower Left"},{id:"3",label:"Upper Right"},{id:"4",label:"Lower Right"}]}],callback:async e=>{r.setPiPPosition(e.options.position)}},pip_size:{name:"PiP: Set size",description:"Set the size for the PiP window",options:[{type:"dropdown",id:"size",label:"Size",default:"1",choices:[{id:"1",label:"Small"},{id:"2",label:"Middle"},{id:"3",label:"Large"}]}],callback:async e=>{r.setPiPSize(e.options.size)}},tw_mode:{name:"TV Wall: Set display mode",description:"Set the display mode for the TV wall",options:[{type:"dropdown",id:"mode",label:"Mode",default:"1",choices:[{id:"1",label:"2x2 mode"},{id:"2",label:"2x1 mode"},{id:"3",label:"2x1-2 mode"},{id:"4",label:"1x2 mode"},{id:"5",label:"1x2-2 mode"},{id:"6",label:"3x1 mode"},{id:"7",label:"4x1 mode"},{id:"8",label:"1x3 mode"},{id:"9",label:"1x4 mode"}]}],callback:async e=>{r.setTWDisplayMode(e.options.mode)}},tw_group_input:{name:"TV Wall: Set group input source",description:"Set the input source for a TV Wall group",options:[{type:"dropdown",id:"group",label:"TV Wall Group",default:"0",choices:[{id:"0",label:"Group All"},{id:"1",label:"Group 1"},{id:"2",label:"Group 2"},{id:"3",label:"Group 3"},{id:"4",label:"Group 4"}]},{type:"dropdown",id:"input",label:"Input",default:"1",choices:[{id:"1",label:"HDMI 1"},{id:"2",label:"HDMI 2"},{id:"3",label:"HDMI 3"},{id:"4",label:"HDMI 4"}]}],callback:async e=>{r.setTWGroupInput(e.options.group,e.options.input)}},tw_resolution:{name:"TV Wall: Set resolution",description:"Set the resolution for the TV Wall",options:[{type:"dropdown",id:"resolution",label:"Resolution",default:"1",choices:[{id:"1",label:"4096x2160p60"},{id:"2",label:"4096x2160p50"},{id:"3",label:"3840x2160p60"},{id:"4",label:"3840x2160p50"},{id:"5",label:"3840x2160p30"},{id:"6",label:"1920x1080p60"},{id:"7",label:"1920x1080p50"},{id:"8",label:"1920x1080i60"},{id:"9",label:"1920x1080i50"},{id:"10",label:"1920x1200p60rb"},{id:"11",label:"1360x768p60"},{id:"12",label:"1280x800p60"},{id:"13",label:"1280x720p60"},{id:"14",label:"1280x720p50"},{id:"15",label:"1024x768p60"}]}],callback:async e=>{r.setTWResolution(e.options.resolution)}},input_audio_embedded:{name:"Input: Audio Setting",description:"Select HDMI original audio or embed analog audio for all or a specific input",options:[{type:"dropdown",id:"input",label:"Input",default:"0",choices:[{id:"0",label:"All Inputs"},{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]},{type:"dropdown",id:"audio",label:"Audio setting",default:"0",choices:[{id:"0",label:"HDMI Original Audio"},{id:"1",label:"Embed Analog Audio"}]}],callback:async e=>{r.setInputAudioConfig(e.options.input,e.options.audio)}},route_input_audio_to_output_ext_audio:{name:"Route input audio to output external audio",description:"Route an audio input to a specific or all external audio outputs",options:[{type:"dropdown",id:"output",label:"Output",default:"0",choices:[{id:"0",label:"All Outputs"},{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"input",label:"Input",default:"1",choices:[{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]}],callback:async e=>{r.routeAudioInputSourceToOutputExternalAudio(e.options.output,e.options.input)}},mv_resolution:{name:"MultiView: Set resolution",description:"Set the resolution for the MultiView",options:[{type:"dropdown",id:"resolution",label:"Resolution",default:"1",choices:[{id:"1",label:"4096x2160p60"},{id:"2",label:"4096x2160p50"},{id:"3",label:"3840x2160p60"},{id:"4",label:"3840x2160p50"},{id:"5",label:"3840x2160p30"},{id:"6",label:"1920x1080p60"},{id:"7",label:"1920x1080p50"},{id:"8",label:"1920x1080i60"},{id:"9",label:"1920x1080i50"},{id:"10",label:"1920x1200p60rb"},{id:"11",label:"1360x768p60"},{id:"12",label:"1280x800p60"},{id:"13",label:"1280x720p60"},{id:"14",label:"1280x720p50"},{id:"15",label:"1024x768p60"}]}],callback:async e=>{r.setMultiViewResolution(e.options.resolution)}},mv_audio_source:{name:"MultiView: Set audio Source",description:"Set the audio source for the MultiView",options:[{type:"dropdown",id:"audiosource",label:"Audio source",default:"0",choices:[{id:"0",label:"Follow Window 1 Selected Source"},{id:"1",label:"Input 1 Audio"},{id:"2",label:"Input 2 Audio"},{id:"3",label:"Input 3 Audio"},{id:"4",label:"Input 4 Audio"}]}],callback:async e=>{r.setMultiViewAudioSource(e.options.audiosource)}}})),this.setFeedbackDefinitions(function(e){return{panel_lock:{type:"boolean",name:"Device: Panel buttons locked",description:"Check if the panel buttons are currently locked",options:[],callback:t=>e.getVariableValue("device_panel_locked")},device_power:{type:"boolean",name:"Device: Powered on",description:"Check the current power state of the device",options:[],callback:t=>e.getVariableValue("device_powered_on")},device_beep:{type:"boolean",name:"Device: Beep enabled",description:"Check the current button beep state of the device",options:[],callback:t=>e.getVariableValue("device_beep_enabled")},output_at_input:{type:"boolean",name:"Output: Specific input is active source",description:"Check if a specific input source is currently selected for a specific output",options:[{type:"dropdown",id:"output",label:"Output",default:"1",choices:[{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"input",label:"Input",default:"1",choices:[{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]}],callback:t=>{const r=t.options.output,i=`input${t.options.input}`;return e.getVariableValue(`output${r}_input_source`)===i}},output_at_audio_input:{type:"boolean",name:"Output: Specific audio input is active external audio source",description:"Check if a specific input audio source is currently selected as a specific output external audio source",options:[{type:"dropdown",id:"output",label:"Output",default:"1",choices:[{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]},{type:"dropdown",id:"input",label:"Input",default:"1",choices:[{id:"1",label:"Input 1"},{id:"2",label:"Input 2"},{id:"3",label:"Input 3"},{id:"4",label:"Input 4"}]}],callback:t=>{const r=t.options.output,i=`input${t.options.input}`;return e.getVariableValue(`output${r}_external_audio_source`)===i}},output_streaming:{type:"boolean",name:"Output: Stream State",description:"Check if a specific outputcurrently streaming or not",options:[{type:"dropdown",id:"output",label:"Output",default:"1",choices:[{id:"1",label:"Output 1"},{id:"2",label:"Output 2"},{id:"3",label:"Output 3"},{id:"4",label:"Output 4"}]}],callback:t=>e.getVariableValue(`output${t.options.output}_stream`)}}}(this)),this.setPresetDefinitions(function(){const t=[];for(let r=1;r<=4;r++)for(let i=1;i<=4;i++)t.push({category:"Video Routing",name:`Route ${r+i} `,type:"button",style:{text:`Out ${r}: IN ${i}`,size:"18",bgcolor:(0,e.combineRgb)(36,36,36),color:(0,e.combineRgb)(255,255,255)},steps:[{down:[{actionId:"route_input_to_output",options:{input:i.toString(),output:r.toString()}}]}],feedbacks:[{feedbackId:"output_at_input",options:{output:r.toString(),input:i.toString()},style:{bgcolor:(0,e.combineRgb)(0,255,0)}}]});for(let r=1;r<=4;r++)for(let i=1;i<=4;i++)t.push({category:"External Audio Routing",name:`Route ${r+i} `,type:"button",style:{text:`Out ${r}: IN ${i}`,size:"18",bgcolor:(0,e.combineRgb)(36,36,36),color:(0,e.combineRgb)(255,255,255)},steps:[{down:[{actionId:"route_input_audio_to_output_ext_audio",options:{input:i.toString(),output:r.toString()}}]}],feedbacks:[{feedbackId:"output_at_audio_input",options:{output:r.toString(),input:i.toString()},style:{bgcolor:(0,e.combineRgb)(0,255,0)}}]});return t.push({category:"Device Controls",name:"Toggle Panel Lock",type:"button",style:{text:"Panel unlocked",size:"14",bgcolor:(0,e.combineRgb)(0,255,0),color:(0,e.combineRgb)(0,0,0)},steps:[{down:[{actionId:"lock",options:{command:"toggle"}}]}],feedbacks:[{feedbackId:"panel_lock",options:{},style:{text:"Panel locked",bgcolor:(0,e.combineRgb)(255,0,0),color:(0,e.combineRgb)(255,255,255)}}]}),t.push({category:"Device Controls",name:"Toggle Power",type:"button",style:{text:"Device OFF",size:"18",bgcolor:(0,e.combineRgb)(255,0,0),color:(0,e.combineRgb)(255,255,255)},steps:[{down:[{actionId:"device_power",options:{power:"2"}}]}],feedbacks:[{feedbackId:"device_power",options:{},style:{text:"Device ON",bgcolor:(0,e.combineRgb)(0,255,0),color:(0,e.combineRgb)(0,0,0)}}]}),t.push({category:"Device Controls",name:"Toggle Beep",type:"button",style:{text:"Beep OFF",size:"18",bgcolor:(0,e.combineRgb)(255,0,0),color:(0,e.combineRgb)(255,255,255)},steps:[{down:[{actionId:"device_beep",options:{beep:"2"}}]}],feedbacks:[{feedbackId:"device_beep",options:{},style:{text:"Beep ON",bgcolor:(0,e.combineRgb)(0,255,0),color:(0,e.combineRgb)(0,0,0)}}]}),t}()),this.setVariableDefinitions(i),this.init_tcp()}delay(e){return new Promise((t=>setTimeout(t,e)))}init_tcp(){this.socket&&(this.socket.destroy(),this.socket=null),this.config.host&&this.createSocket()}createSocket(){this.socket=new n.Socket,this.socket.setKeepAlive(!0,1e4),this.socket.setTimeout(5e3),this.socket.connect(this.config.port,this.config.host,(()=>{this.log("debug","Connected"),this.updateStatus(e.InstanceStatus.Ok)})),this.socket.on("data",(e=>{const t=e.toString("utf8");this.parseIncomingData(t)})),this.socket.on("error",(t=>{this.log("error","Network error: "+t.message),this.updateStatus(e.InstanceStatus.Error,t.message),this.reconnect()})),this.socket.on("end",(()=>{this.log("error","Connection ended"),this.updateStatus(e.InstanceStatus.Disconnected),this.reconnect()})),this.socket.on("close",(t=>{t?this.log("error","Socket closed due to an error."):this.log("error","Socket closed."),this.updateStatus(e.InstanceStatus.Disconnected),this.reconnect()}))}reconnect(){this.config.autoReconnect&&!this.reconnectTimeout&&(this.log("debug","Attempting to reconnect in 5 seconds..."),this.reconnectTimeout=setTimeout((()=>{this.reconnectTimeout=null,this.createSocket()}),5e3))}destroySocket(){this.socket&&(this.socket.destroy(),this.socket=null),this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}async sendMessage(e){try{return await this.socket.write(e+"\r\n"),!0}catch(e){return this.log("error","Failed to send message: "+e.message),!1}}async sendMessage(e){return new Promise(((t,r)=>{this.socket.write(e+"\r\n",(e=>{if(e)return r(e);t(!0)}))}))}getStatus(){this.sendMessage("r status!")}setPanelLockState(e){var t="";switch(e){case"toggle":t=`s lock ${this.getVariableValue("device_panel_locked")?"0":"1"}!`;break;case"lock":t="s lock 1!";break;case"unlock":t="s lock 0!"}this.sendMessage(t)}getPanelLockState(){this.socket.write("r lock!")}setPowerState(e){let t="";switch(e){case"0":case"1":t=`s power ${e}!`;break;case"2":t=`s power ${this.getVariableValue("device_powered_on")?"0":"1"}!`}this.sendMessage(t)}getPowerState(){this.sendMessage("r power!")}setBeepMode(e){let t="";switch(e){case"0":case"1":t=`s beep ${e}!`;break;case"2":t=`s beep ${this.getVariableValue("device_beep_enabled")?"0":"1"}!`}this.sendMessage(t)}getBeepMode(){this.sendMessage("r beep!")}async recallPreset(e){const t=`s recall preset ${e}!`;this.sendMessage(t)}savePreset(e){const t=`s save preset ${e}!`;this.sendMessage(t)}clearPreset(e){const t=`s clear preset ${e}!`;this.sendMessage(t)}setOutputDisplayMode(e){const t=`s display mode ${e}!`;this.sendMessage(t)}getOutputDisplayMode(){this.sendMessage("r display mode!")}setOutputResolution(e,t){const r=`s output ${e} res ${t}!`;this.sendMessage(r)}getOutputResolution(e){const t=`r output ${e} res!`;this.sendMessage(t)}setOutputColorSpace(e,t){const r=`s output ${e} csc ${t}!`;this.sendMessage(r)}getOutputColorSpace(e){const t=`r output ${e} csc!`;this.sendMessage(t)}setOutputHDCP(e,t){const r=`s output ${e} hdcp ${t}!`;this.sendMessage(r)}getOutputHDCP(e){const t=`r output ${e} hdcp!`;this.sendMessage(t)}setOutputVMirror(e,t){const r=`s output ${e} vmirror ${t}!`;this.sendMessage(r)}setOutputHMirror(e,t){const r=`s output ${e} hmirror ${t}!`;this.sendMessage(r)}getOutputMirror(e){const t=`r output ${e} mirror!`;this.sendMessage(t)}setOutputStream(e,t){let r="";switch(t){case"0":case"1":r=`s output ${e} stream ${t}!`;break;case"2":const i=`output${e}_stream`;r=`s output ${e} stream ${this.getVariableValue(i)?"0":"1"}!`}this.sendMessage(r)}getOutputStream(e){const t=`r output ${e} stream!`;this.sendMessage(t)}setOutputBackground(e){const t=`s output bg ${e}!`;this.sendMessage(t)}getOutputBackground(){this.sendMessage("r output bg!")}setInputEDID(e,t){const r=`s input ${e} edid ${t}!`;this.sendMessage(r)}getInputEDID(e){const t=`r input ${e} edid!`;this.sendMessage(t)}routeInputToOutput(e,t){const r=`s output ${e} in source ${t}!`;this.sendMessage(r)}getInputToOutputRouting(e){const t=`r output ${e} in source!`;this.sendMessage(t)}setInputCECCommand(e,t){const r=`s cec in ${e} ${t}!`;this.sendMessage(r)}setOutputCECCommand(e,t){const r=`s cec hdmi out ${e} ${t}!`;this.sendMessage(r)}sendNetworkReboot(){this.sendMessage("s net reboot!")}sendReboot(){this.sendMessage("s reboot!")}setMultiViewDisplayMode(e){const t=`s multiview ${e}!`;this.sendMessage(t)}getMultiViewDisplayMode(){this.sendMessage("r multiview!")}setMultiViewWindowInput(e,t){const r=`s window ${e} in ${t}!`;this.sendMessage(r)}getMultiViewWindowInput(e){const t=`r window ${e} in!`;this.sendMessage(t)}setPiPPosition(e){const t=`s pip position ${e}!`;this.sendMessage(t)}getPiPPosition(){this.sendMessage("r pip position!")}setPiPSize(e){const t=`s pip size ${e}!`;this.sendMessage(t)}getPiPSize(){this.sendMessage("r pip size!")}setTWDisplayMode(e){const t=`s tw mode ${e}!`;this.sendMessage(t)}getTWDisplayMode(){this.sendMessage("r tw mode!")}setTWGroupInput(e,t){const r=`s tw group ${e} input ${t}!`;this.sendMessage(r)}getTWGroupInput(e){const t=`r tw group ${e} source!`;this.sendMessage(t)}setTWResolution(e){const t=`s tw res ${e}!`;this.sendMessage(t)}getTWResolution(){this.sendMessage("r tw res!")}setInputAudioConfig(e,t){const r=`s input ${e} as ${t}!`;this.sendMessage(r)}getInputAudioConfig(e){const t=`r input ${e} as!`;this.sendMessage(t)}setOutputExternalAudioState(e,t){const r=`s output ${e} exa ${t}!`;this.sendMessage(r)}getOutputExternalAudioState(e){const t=`r output ${e} exa!`;this.sendMessage(t)}setOutputExternalAudioMode(e){const t=`s output exa mode ${e}!`;this.sendMessage(t)}getOutputExternalAudioMode(){this.sendMessage("r output exa mode!")}routeAudioInputSourceToOutputExternalAudio(e,t){const r=`s output ${e} exa in source ${t}!`;this.sendMessage(r)}getAudioInputSourceToOutputExternalAudioRoute(e){const t=`r output ${e} in source!`;this.sendMessage(t)}setMultiViewResolution(e){const t=`s mv res ${e}!`;this.sendMessage(t)}getMultiViewResolution(){this.sendMessage("r mv res!")}setMultiViewAudioSource(e){const t=`s mv output audio ${e}!`;this.sendMessage(t)}getMultiViewAudioSource(){this.sendMessage("r mv output audio!")}parseIncomingData(e){this.log("debug","Received: "+e);const t={outputResolution:/output (\d+) resolution: (.+)$/,outputColorSpace:/output (\d+) csc: (.+)$/,outputHdcp:/output (\d+) hdcp: (.+)$/,outputHMirror:/output (\d+) h mirror (on|off)$/,outputVMirror:/output (\d+) v mirror (on|off)$/,outputMirror:/output (\d+) h mirror (on|off), v mirror (on|off)$/,outputStream:/output (\d+) stream: (enable|disable)$/,outputBackground:/output background: (.+)$/,inputEdid:/input (\d+) edid: (.+)$/,outputInputSource:/output (\d+) -> input (\d+)/,inputOutputTarget:/input (\d+) -> output (\d+)/,panelLock:/panel button lock (on|off)/,displayMode:/display mode: (.+)$/,tvWallMode:/tv wall mode: (.+)$/,tvWallGroupInput:/tv wall group (\d+) input: (.+)$/,tvWallResolution:/tv wall resolution: (.+)$/,inputAudioSetting:/input (\d+) select (hdmi original audio|embed analog audio)$/,outputExtAudio:/output (\d+) ext-audio: (enable|disable)$/,outputExtAudioMode:/output ext-audio mode: (.+)$/,outputExtAudioSource:/output (\d+) ext-audio->input (\d+)$/,multiViewResolution:/multi-viewer resolution: (.+)$/,multiViewAudioSource:/output audio: (.+)$/,pipPosition:/pip on (.+)$/,pipSize:/pip size: (.+)$/,multiviewWindowInput:/window (\d+) select (.+)$/,activePreset:/recall from preset (\d+)$/,devicePower:/power (on|off)/,deviceBeep:/beep (on|off)/,telnetConnected:/^\*{38}$/},r={outputResolution:(e,t)=>[`output${e}_resolution`,t],outputColorSpace:(e,t)=>[`output${e}_csc`,t],outputHdcp:(e,t)=>[`output${e}_hdcp`,t],outputHMirror:(e,t)=>[`output${e}_hmirror`,"on"===t],outputVMirror:(e,t)=>[`output${e}_vmirror`,"on"===t],outputMirror:(e,t,r)=>[[`output${e}_hmirror`,"on"===t],[`output${e}_vmirror`,"on"===r]],outputStream:(e,t)=>[`output${e}_stream`,"enable"===t],outputBackground:e=>["output_background",e],inputEdid:(e,t)=>[`input${e}_edid`,t],outputInputSource:(e,t)=>[`output${e}_input_source`,`input${t}`],inputOutputTarget:(e,t)=>[`output${t}_input_source`,`input${e}`],panelLock:e=>["device_panel_locked","on"===e],displayMode:e=>["output_display_mode",e],tvWallMode:e=>["tv_wall_display_mode",e],tvWallGroupInput:(e,t)=>[`tv_wall_group${e}_input`,t],tvWallResolution:e=>["tv_wall_resolution",e],inputAudioSetting:(e,t)=>[`input${e}_audio_setting`,t],outputExtAudio:(e,t)=>[`output${e}_external_audio_enabled`,"enable"===t],outputExtAudioMode:e=>["output_external_audio_mode",e],outputExtAudioSource:(e,t)=>[`output${e}_external_audio_source`,`input${t}`],multiViewResolution:e=>["multiview_resolution",e],multiViewAudioSource:e=>["multiview_audio_source",e],pipPosition:e=>["pip_position",e],pipSize:e=>["pip_size",e],multiviewWindowInput:(e,t)=>[`multiview_window${e}_input`,`${t}`],activePreset:e=>["last_loaded_preset",e],devicePower:e=>["device_powered_on","on"===e],deviceBeep:e=>["device_beep_enabled","on"===e]},n=(e,i)=>{const n=i.match(t[e]);if(!n)return;const[s,...a]=n.slice(1),u=r[e]?.(s,...a);if(Array.isArray(u?.[0]))u.forEach((([e,t])=>o(e,t)));else if(u){const[e,t]=u;o(e,t)}},o=(e,t)=>{if(i.find((t=>t.variableId===e))){const r={[e]:t};this.setVariableValues(r),this.log("info",`Set ${e} to ${t}`)}else this.log("error",`Variable not found for ${e}`)};e.split(/\r/).forEach((e=>{if(""!==e.trim()){for(const r in t)n(r,e);(e.match(t.outputInputSource)||e.match(t.inputOutputTarget))&&this.checkFeedbacks("output_at_input"),e.match(t.outputExtAudioSource)&&this.checkFeedbacks("output_at_audio_input"),e.match(t.panelLock)&&this.checkFeedbacks("panel_lock"),e.match(t.outputStream)&&this.checkFeedbacks("output_streaming"),e.match(t.devicePower)&&this.checkFeedbacks("device_power"),e.match(t.deviceBeep)&&this.checkFeedbacks("device_beep"),e.match(t.activePreset)&&this.getStatus(),e.match(t.telnetConnected)&&(this.log("info","Telnet connection successfull - retreiving status."),this.getStatus())}}))}async configUpdated(e){this.config=e,this.init_tcp()}async destroy(){}getConfigFields(){return t}}(0,e.runEntrypoint)(o,[])})()})(); \ No newline at end of file diff --git a/nohassleav-videowallprocessor/package.json b/nohassleav-videowallprocessor/package.json new file mode 100644 index 00000000..96b0b02d --- /dev/null +++ b/nohassleav-videowallprocessor/package.json @@ -0,0 +1 @@ +{"name":"nohassleav-videowallprocessor","version":"1.0.0","license":"MIT","type":"commonjs","dependencies":{}} \ No newline at end of file