diff --git a/bundle-v13715c3.js b/bundle-v13715c3.js deleted file mode 100644 index 4d96bae..0000000 --- a/bundle-v13715c3.js +++ /dev/null @@ -1 +0,0 @@ -var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(t)}function r(e){return"function"==typeof e}function s(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let i;function a(e,t){return e===t||(i||(i=document.createElement("a")),i.href=t,e===i.href)}var c="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};const l="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:c;function u(e,t){e.appendChild(t)}function d(e,t,n){e.insertBefore(t,n||null)}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function m(e,t){for(let n=0;ne.removeEventListener(t,n,o)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function b(e,t){t=""+t,e.data!==t&&(e.data=t)}function $(e,t){e.value=null==t?"":t}function S(e,t,n,o){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function L(e,t,n){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=function(e,t,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:o})}(t,n,{cancelable:o});return r.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const V=[],E=[];let I=[];const P=[],A=Promise.resolve();let O=!1;function B(e){I.push(e)}const T=new Set;let R=0;function j(){if(0!==R)return;const e=H;do{try{for(;R{D.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}function J(e){return void 0!==e?.length?e:Array.from(e)}function Y(e){e&&e.c()}function X(e,n,s){const{fragment:i,after_update:a}=e.$$;i&&i.m(n,s),B((()=>{const n=e.$$.on_mount.map(t).filter(r);e.$$.on_destroy?e.$$.on_destroy.push(...n):o(n),e.$$.on_mount=[]})),a.forEach(B)}function K(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];I.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),I=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Q(e,t){-1===e.$$.dirty[0]&&(V.push(e),O||(O=!0,A.then(j)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const r=o.length?o[0]:n;return m.ctx&&a(m.ctx[e],m.ctx[e]=r)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](r),p&&Q(t,e)),n})):[],m.update(),p=!0,o(m.before_update),m.fragment=!!i&&i(m.ctx),r.target){if(r.hydrate){const e=function(e){return Array.from(e.childNodes)}(r.target);m.fragment&&m.fragment.l(e),e.forEach(f)}else m.fragment&&m.fragment.c();r.intro&&Z(t.$$.fragment),X(t,r.target,r.anchor),j()}x(d)}class te{$$=void 0;$$set=void 0;$destroy(){K(this,1),this.$destroy=e}$on(t,n){if(!r(n))return e;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const e=o.indexOf(n);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");var ne="M14 12.8C13.5 12.31 12.78 12 12 12C10.34 12 9 13.34 9 15C9 16.31 9.84 17.41 11 17.82C11.07 15.67 12.27 13.8 14 12.8M11.09 19H5V5H16.17L19 7.83V12.35C19.75 12.61 20.42 13 21 13.54V7L17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H11.81C11.46 20.39 11.21 19.72 11.09 19M6 10H15V6H6V10M15.75 21L13 18L14.16 16.84L15.75 18.43L19.34 14.84L20.5 16.25L15.75 21",oe="M13 17H17V14L22 18.5L17 23V20H13V17M14 12.8C13.5 12.31 12.78 12 12 12C10.34 12 9 13.34 9 15C9 16.31 9.84 17.41 11 17.82C11.07 15.67 12.27 13.8 14 12.8M11.09 19H5V5H16.17L19 7.83V12.35C19.75 12.61 20.42 13 21 13.54V7L17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H11.81C11.46 20.39 11.21 19.72 11.09 19M6 10H15V6H6V10Z",re="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",se="M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z",ie="M22.7 14.3L21.7 15.3L19.7 13.3L20.7 12.3C20.8 12.2 20.9 12.1 21.1 12.1C21.2 12.1 21.4 12.2 21.5 12.3L22.8 13.6C22.9 13.8 22.9 14.1 22.7 14.3M13 19.9V22H15.1L21.2 15.9L19.2 13.9L13 19.9M21 5C21 3.9 20.1 3 19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H11V19.1L12.1 18H5L8.5 13.5L11 16.5L14.5 12L16.1 14.1L21 9.1V5Z",ae="M22.7 14.3L21.7 15.3L19.7 13.3L20.7 12.3C20.8 12.2 20.9 12.1 21.1 12.1C21.2 12.1 21.4 12.2 21.5 12.3L22.8 13.6C22.9 13.8 22.9 14.1 22.7 14.3M13 19.9V22H15.1L21.2 15.9L19.2 13.9L13 19.9M11.21 15.83L9.25 13.47L6.5 17H13.12L15.66 14.55L13.96 12.29L11.21 15.83M11 19.9V19.05L11.05 19H5V5H19V11.31L21 9.38V5C21 3.9 20.11 3 19 3H5C3.9 3 3 3.9 3 5V19C3 20.11 3.9 21 5 21H11V19.9Z",ce="M22 12C22 6.46 17.54 2 12 2C10.83 2 9.7 2.19 8.62 2.56L9.32 4.5C10.17 4.16 11.06 3.97 12 3.97C16.41 3.97 20.03 7.59 20.03 12C20.03 16.41 16.41 20.03 12 20.03C7.59 20.03 3.97 16.41 3.97 12C3.97 11.06 4.16 10.12 4.5 9.28L2.56 8.62C2.19 9.7 2 10.83 2 12C2 17.54 6.46 22 12 22C17.54 22 22 17.54 22 12M5.47 3.97C6.32 3.97 7 4.68 7 5.47C7 6.32 6.32 7 5.47 7C4.68 7 3.97 6.32 3.97 5.47C3.97 4.68 4.68 3.97 5.47 3.97M18 12C18 8.67 15.33 6 12 6C8.67 6 6 8.67 6 12C6 15.33 8.67 18 12 18C15.33 18 18 15.33 18 12M15 12L10 15V9",le="M10 16.5L16 12L10 7.5M22 12C22 6.46 17.54 2 12 2C10.83 2 9.7 2.19 8.62 2.56L9.32 4.5C10.17 4.16 11.06 3.97 12 3.97C16.41 3.97 20.03 7.59 20.03 12C20.03 16.41 16.41 20.03 12 20.03C7.59 20.03 3.97 16.41 3.97 12C3.97 11.06 4.16 10.12 4.5 9.28L2.56 8.62C2.19 9.7 2 10.83 2 12C2 17.54 6.46 22 12 22C17.54 22 22 17.54 22 12M5.47 3.97C6.32 3.97 7 4.68 7 5.47C7 6.32 6.32 7 5.47 7C4.68 7 3.97 6.32 3.97 5.47C3.97 4.68 4.68 3.97 5.47 3.97Z",ue="M19.5 8C21.43 8 23 6.43 23 4.5C23 2.57 21.43 1 19.5 1C17.57 1 16 2.57 16 4.5C16 6.43 17.57 8 19.5 8M19.5 10C20 10 20.5 9.93 21 9.79V16C21 18.76 18.76 21 16 21H8C5.24 21 3 18.76 3 16V8C3 5.24 5.24 3 8 3H14.21C14.07 3.5 14 4 14 4.5C14 7.54 16.46 10 19.5 10Z",de="M19.5 8C21.43 8 23 6.43 23 4.5C23 2.57 21.43 1 19.5 1C17.57 1 16 2.57 16 4.5C16 6.43 17.57 8 19.5 8M21 16V9.79C20.5 9.93 20 10 19.5 10C19.33 10 19.17 10 19 10V16C19 17.66 17.66 19 16 19H8C6.34 19 5 17.66 5 16V8C5 6.34 6.34 5 8 5H14C14 4.84 14 4.67 14 4.5C14 4 14.07 3.5 14.21 3H8C5.24 3 3 5.24 3 8V16C3 18.76 5.24 21 8 21H16C18.76 21 21 18.76 21 16Z";function fe(e){let t,n;return{c(){t=h("title"),n=g(e[2])},m(e,o){d(e,t,o),u(t,n)},p(e,t){4&t&&b(n,e[2])},d(e){e&&f(t)}}}function me(e){let t;return{c(){t=h("path"),y(t,"d",e[0])},m(e,n){d(e,t,n)},p(e,n){1&n&&y(t,"d",e[0])},d(e){e&&f(t)}}}function pe(e){let t,n,o;function r(e,t){return e[3]?ge:he}let s=r(e),i=s(e);return{c(){i.c(),t=h("g"),n=h("path"),y(n,"d",e[0]),y(t,"style",o=`animation: ${e[5]} linear ${e[6]}s infinite; transform-origin: center`)},m(e,o){i.m(e,o),d(e,t,o),u(t,n)},p(e,a){s!==(s=r(e))&&(i.d(1),i=s(e),i&&(i.c(),i.m(t.parentNode,t))),1&a&&y(n,"d",e[0]),96&a&&o!==(o=`animation: ${e[5]} linear ${e[6]}s infinite; transform-origin: center`)&&y(t,"style",o)},d(e){e&&f(t),i.d(e)}}}function he(e){let t,n;return{c(){t=h("style"),n=g("@keyframes spin { to { transform: rotate(360deg) } }")},m(e,o){d(e,t,o),u(t,n)},d(e){e&&f(t)}}}function ge(e){let t,n;return{c(){t=h("style"),n=g("@keyframes spin-inverse { to { transform: rotate(-360deg) } }")},m(e,o){d(e,t,o),u(t,n)},d(e){e&&f(t)}}}function Ce(t){let n,o,r=t[2]&&fe(t);function s(e,t){return!1!==e[1]?pe:me}let i=s(t),a=i(t);return{c(){n=h("svg"),r&&r.c(),o=w(),a.c(),y(n,"viewBox","0 0 24 24"),y(n,"style",t[4]),y(n,"class","svelte-dmmfjb")},m(e,t){d(e,n,t),r&&r.m(n,null),u(n,o),a.m(n,null)},p(e,[t]){e[2]?r?r.p(e,t):(r=fe(e),r.c(),r.m(n,o)):r&&(r.d(1),r=null),i===(i=s(e))&&a?a.p(e,t):(a.d(1),a=i(e),a&&(a.c(),a.m(n,null))),16&t&&y(n,"style",e[4])},i:e,o:e,d(e){e&&f(n),r&&r.d(),a.d()}}}function we(e,t,n){let o,r,s,i,{path:a}=t,{size:c=1}=t,{color:l=null}=t,{flip:u=null}=t,{rotate:d=0}=t,{spin:f=!1}=t,{title:m=""}=t;Number(c)&&(c=Number(c));return e.$$set=e=>{"path"in e&&n(0,a=e.path),"size"in e&&n(7,c=e.size),"color"in e&&n(8,l=e.color),"flip"in e&&n(9,u=e.flip),"rotate"in e&&n(10,d=e.rotate),"spin"in e&&n(1,f=e.spin),"title"in e&&n(2,m=e.title)},e.$$.update=()=>{2&e.$$.dirty&&n(3,o="boolean"!=typeof f&&f<0),2&e.$$.dirty&&n(6,r=Math.abs(!0===f?2:f)),8&e.$$.dirty&&n(5,s=o?"spin-inverse":"spin"),1920&e.$$.dirty&&n(4,i=(()=>{const e=[],t=[];if(null!==c){const e="string"==typeof c?c:1.5*c+"rem";t.push(["width",e]),t.push(["height",e])}return t.push(["fill",null!==l?l:"currentColor"]),!0!==u&&"h"!==u||e.push("scaleX(-1)"),!0!==u&&"v"!==u||e.push("scaleY(-1)"),0!=d&&e.push(`rotate(${d}deg)`),e.length>0&&(t.push(["transform",e.join(" ")]),t.push(["transform-origin","center"])),t.reduce(((e,t)=>`${e} ${t[0]}:${t[1]};`),"")})())},[a,f,m,o,i,s,r,c,l,u,d]}class ve extends te{constructor(e){super(),ee(this,e,we,Ce,s,{path:0,size:7,color:8,flip:9,rotate:10,spin:1,title:2})}}const ye=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,be=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(ye);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},$e=e=>"*"===e||"x"===e||"X"===e,Se=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Le=(e,t)=>{if($e(e)||$e(t))return 0;const[n,o]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Se(e),Se(t));return n>o?1:n{for(let n=0;n1)for(var n=1;n=1.5*n;return Math.round(e/n)+" "+o+(r?"s":"")}return Ke=function(a,c){c=c||{};var l=typeof a;if("string"===l&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===l&&isFinite(a))return c.long?function(r){var s=Math.abs(r);if(s>=o)return i(r,s,o,"day");if(s>=n)return i(r,s,n,"hour");if(s>=t)return i(r,s,t,"minute");if(s>=e)return i(r,s,e,"second");return r+" ms"}(a):function(r){var s=Math.abs(r);if(s>=o)return Math.round(r/o)+"d";if(s>=n)return Math.round(r/n)+"h";if(s>=t)return Math.round(r/t)+"m";if(s>=e)return Math.round(r/e)+"s";return r+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}var it,at=(nt||(nt=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(o++,"%c"===e&&(r=o))})),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"env"in ot&&(e=ot.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(tt||(tt=1,et=function(e){function t(e){let o,r,s,i=null;function a(...e){if(!a.enabled)return;const n=a,r=Number(new Date),s=r-(o||r);n.diff=s,n.prev=o,n.curr=r,o=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((o,r)=>{if("%%"===o)return"%";i++;const s=t.formatters[r];if("function"==typeof s){const t=e[i];o=s.call(n,t),e.splice(i,1),i--}return o})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(r!==t.namespaces&&(r=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),r=o.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t>>2]>>>24-s%4*8&255;t[o+s>>>2]|=i<<24-(o+s)%4*8}else for(var a=0;a>>2]=n[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-r%4*8&255;o.push((s>>>4).toString(16)),o.push((15&s).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new c.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],r=0;r>>2]>>>24-r%4*8&255;o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new c.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},m=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,o=this._data,r=o.words,s=o.sigBytes,i=this.blockSize,a=s/(4*i),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,u=e.min(4*l,s);if(l){for(var d=0;d>>7)^(p<<14|p>>>18)^p>>>3,g=c[m-2],C=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[m]=h+c[m-7]+C+c[m-16]}var w=o&r^o&s^r&s,v=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),y=f+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&u^~l&d)+a[m]+c[m];f=d,d=u,u=l,l=i+y|0,i=s,s=r,r=o,o=y+(v+w)|0}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+i|0,n[4]=n[4]+l|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(o/4294967296),n[15+(r+64>>>9<<4)]=o,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),yt.SHA256)),pt.exports)),St={exports:{}};var Lt=(bt||(bt=1,St.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function o(e,t,o){for(var r=[],s=0,i=0;i>>6-i%4*2;r[s>>>2]|=a<<24-s%4*8,s++}return n.create(r,s)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,o=this._map;e.clamp();for(var r=[],s=0;s>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a>>6*(3-a)&63));var c=o.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var s=0;s{const o=await this.createConnection(e);return this.emit("Hello",o),this.identify(o,t,n)})(),new Promise(((e,t)=>{r.then((e=>{e.message&&t(e)})),o.then((e=>{t(e)}))}))])}catch(e){throw await this.disconnect(),e}}async disconnect(){if(!this.socket||this.socket.readyState===mt.CLOSED)return;const e=this.internalEventPromise("ConnectionClosed");this.socket.close(),await e}async reidentify(e){const t=this.internalEventPromise("op:2");return await this.message(3,e),t}async call(t,n){const o=e.generateMessageId(),r=this.internalEventPromise(`res:${o}`);await this.message(6,{requestId:o,requestType:t,requestData:n});const{requestStatus:s,responseData:i}=await r;if(!s.result)throw new Ht(s.code,s.comment);return i}async callBatch(t,n={}){const o=e.generateMessageId(),r=this.internalEventPromise(`res:${o}`);await this.message(8,{requestId:o,requests:t,...n});const{results:s}=await r;return s}cleanup(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket=void 0,this._identified=!1,this.internalListeners.removeAllListeners())}async createConnection(e){var t;const n=this.internalEventPromise("ConnectionOpened"),o=this.internalEventPromise("op:0");this.socket=new mt(e,this.protocol),this.socket.onopen=this.onOpen.bind(this),this.socket.onmessage=this.onMessage.bind(this),this.socket.onerror=this.onError.bind(this),this.socket.onclose=this.onClose.bind(this),await n;const r=null==(t=this.socket)?void 0:t.protocol;if(!r)throw new Ht(-1,"Server sent no subprotocol");if(r!==this.protocol)throw new Ht(-1,"Server sent an invalid subprotocol");return o}async identify({authentication:e,rpcVersion:t,...n},o,r={}){const s={rpcVersion:t,...r};e&&o&&(s.authentication=function(e,t,n){const o=Mt.stringify($t(n+e));return Mt.stringify($t(o+t))}(e.salt,e.challenge,o));const i=this.internalEventPromise("op:2");await this.message(1,s);const a=await i;return this._identified=!0,this.emit("Identified",a),{rpcVersion:t,...n,...a}}async message(e,t){if(!this.socket)throw new Error("Not connected");if(!this.identified&&1!==e)throw new Error("Socket not identified");const n=await this.encodeMessage({op:e,d:t});this.socket.send(n)}async internalEventPromise(e){return new Promise((t=>{this.internalListeners.once(e,t)}))}onOpen(e){kt("socket.open"),this.emit("ConnectionOpened"),this.internalListeners.emit("ConnectionOpened",e)}async onMessage(e){try{const{op:t,d:n}=await this.decodeMessage(e.data);if(kt("socket.message: %d %j",t,n),void 0===t||void 0===n)return;switch(t){case 5:{const{eventType:e,eventData:t}=n;return void this.emit(e,t)}case 7:case 9:{const{requestId:e}=n;return void this.internalListeners.emit(`res:${e}`,n)}default:this.internalListeners.emit(`op:${t}`,n)}}catch(e){kt("error handling message: %o",e)}}onError(e){kt("socket.error: %o",e);const t=new Ht(-1,e.message);this.emit("ConnectionError",t),this.internalListeners.emit("ConnectionError",t)}onClose(e){kt("socket.close: %s (%d)",e.reason,e.code);const t=new Ht(e.code,e.reason);this.emit("ConnectionClosed",t),this.internalListeners.emit("ConnectionClosed",t),this.cleanup()}};"undefined"!=typeof exports&&Object.defineProperty(exports,"__esModule",{value:!0});const _t=new class extends xt{protocol="obswebsocket.json";async encodeMessage(e){return JSON.stringify(e)}async decodeMessage(e){return JSON.parse(e)}};async function Nt(e,t){try{return await _t.call(e,t||{})}catch(t){return console.log("Error sending command",e," - error is:",t.message),{}}}function Ft(e,t,n){const o=e.slice();return o[12]=t[n],o}function Vt(e){let t,n,o,r,s=J(e[3]),i=[];for(let t=0;t{let e;i||(e=await Nt("GetCurrentProgramScene"),n(5,i=e.currentProgramSceneName||"")),e=await Nt("GetStudioModeEnabled"),e&&e.studioModeEnabled&&(n(0,s=!0),e=await Nt("GetCurrentPreviewScene"),n(6,a=e.currentPreviewSceneName||"")),e=await Nt("GetSceneTransitionList"),console.log("GetSceneTransitionList",e),n(3,u=e.transitions||[]),o=setInterval(f,1e3)})),d=()=>{clearInterval(o)},_().$$.on_destroy.push(d),_t.on("StudioModeStateChanged",(async e=>{console.log("StudioModeStateChanged",e.studioModeEnabled),n(0,s=e.studioModeEnabled),s&&n(6,a=i)})),_t.on("CurrentPreviewSceneChanged",(async e=>{console.log("CurrentPreviewSceneChanged",e.sceneName),n(6,a=e.sceneName)})),_t.on("CurrentProgramSceneChanged",(async e=>{console.log("CurrentProgramSceneChanged",e.sceneName),n(5,i=e.sceneName)})),_t.on("SceneNameChanged",(async e=>{e.oldSceneName===i&&n(5,i=e.sceneName),e.oldSceneName===a&&n(6,a=e.sceneName)})),_t.on("TransitionListChanged",(async e=>{console.log("TransitionListChanged",e),n(3,u=e.transitions||[])}));return e.$$set=e=>{"imageFormat"in e&&n(4,r=e.imageFormat)},e.$$.update=()=>{96&e.$$.dirty&&f()},[s,c,l,u,r,i,a,function(e){E[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},async e=>{await Nt("SetCurrentSceneTransition",{transitionName:e.transitionName}),await Nt("TriggerStudioModeTransition")},function(e){E[e?"unshift":"push"]((()=>{c=e,n(1,c)}))}]}_t.on("error",(e=>{console.error("Socket error:",e)}));class At extends te{constructor(e){super(),ee(this,e,Pt,It,s,{imageFormat:4})}}function Ot(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[4])||y(t,"src",n),y(t,"alt",e[0]),y(t,"class","thumbnail svelte-xcafbk")},m(e,n){d(e,t,n)},p(e,o){16&o&&!a(t.src,n=e[4])&&y(t,"src",n),1&o&&y(t,"alt",e[0])},d(e){e&&f(t)}}}function Bt(e){let t;return{c(){t=g(e[0])},m(e,n){d(e,t,n)},p(e,n){1&n&&b(t,e[0])},d(e){e&&f(t)}}}function Tt(t){let n,o,r,s,i,a=t[4]&&Ot(t),c="icon"!==t[1]&&Bt(t);return{c(){n=p("button"),a&&a.c(),o=C(),c&&c.c(),y(n,"style",r="icon"===t[1]?t[5]:""),y(n,"title",t[0]),y(n,"class","svelte-xcafbk"),k(n,"title","text"===t[1]),k(n,"program",t[2]),k(n,"preview",t[3]),k(n,"with-icon","icon"===t[1])},m(e,r){d(e,n,r),a&&a.m(n,null),u(n,o),c&&c.m(n,null),s||(i=v(n,"click",t[8]),s=!0)},p(e,[t]){e[4]?a?a.p(e,t):(a=Ot(e),a.c(),a.m(n,o)):a&&(a.d(1),a=null),"icon"!==e[1]?c?c.p(e,t):(c=Bt(e),c.c(),c.m(n,null)):c&&(c.d(1),c=null),34&t&&r!==(r="icon"===e[1]?e[5]:"")&&y(n,"style",r),1&t&&y(n,"title",e[0]),2&t&&k(n,"title","text"===e[1]),4&t&&k(n,"program",e[2]),8&t&&k(n,"preview",e[3]),2&t&&k(n,"with-icon","icon"===e[1])},i:e,o:e,d(e){e&&f(n),a&&a.d(),c&&c.d(),s=!1,i()}}}function Rt(e,t,n){let o,{name:r}=t,{buttonStyle:s="text"}=t,{icon:i="#ffffff"}=t,{isProgram:a=!1}=t,{isPreview:c=!1}=t,{img:l=""}=t;const u=F();return e.$$set=e=>{"name"in e&&n(0,r=e.name),"buttonStyle"in e&&n(1,s=e.buttonStyle),"icon"in e&&n(7,i=e.icon),"isProgram"in e&&n(2,a=e.isProgram),"isPreview"in e&&n(3,c=e.isPreview),"img"in e&&n(4,l=e.img)},e.$$.update=()=>{128&e.$$.dirty&&n(5,o=i.startsWith("#")?`background-color: ${i};`:`background-image: url(${i});`)},[r,s,a,c,l,o,u,i,()=>u("click")]}class jt extends te{constructor(e){super(),ee(this,e,Rt,Tt,s,{name:0,buttonStyle:1,icon:7,isProgram:2,isPreview:3,img:4})}}function zt(e,t,n){const o=e.slice();return o[11]=t[n],o}function Dt(e,t,n){const o=e.slice();return o[11]=t[n],o}function Wt(e){let t,n,o=J(e[6]),r=[];for(let t=0;tU(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e{i[l]=null})),q(),o=i[n],o?o.p(e,c):(o=i[n]=s[n](e),o.c()),Z(o,1),o.m(t,null)),(!r||16&c)&&k(t,"column",e[4]),(!r||8&c)&&k(t,"with-icon","icon"===e[3])},i(e){r||(Z(o),r=!0)},o(e){U(o),r=!1},d(e){e&&f(t),i[n].d()}}}function Jt(e,t,n){let{programScene:o={}}=t,{previewScene:r={}}=t,{scenes:s=[]}=t,{buttonStyle:i="text"}=t,{editable:a=!1}=t,c=[],l=!1;const u=JSON.parse(window.localStorage.getItem("sceneIcons")||"{}");return N((async function(){let e=await Nt("GetSceneList");console.log("GetSceneList",e),n(1,o=e.currentProgramSceneName||""),n(2,r=e.currentPreviewSceneName),n(0,s=e.scenes),e=await Nt("GetStudioModeEnabled"),e&&e.studioModeEnabled&&(l=!0,n(2,r=e.currentPreviewSceneName||""))})),_t.on("StudioModeStateChanged",(async e=>{console.log("StudioModeStateChanged",e.studioModeEnabled),l=e.studioModeEnabled,n(2,r=o)})),_t.on("SceneListChanged",(async e=>{console.log("SceneListChanged",e.scenes.length),n(0,s=e.scenes)})),_t.on("SceneCreated",(async e=>{console.log("SceneCreated",e)})),_t.on("SceneRemoved",(async e=>{console.log("SceneRemoved",e);for(let t=0;t{console.log("SceneNameChanged",e);for(let t=0;t{console.log("CurrentProgramSceneChanged",e),n(1,o=e.sceneName||"")})),_t.on("CurrentPreviewSceneChanged",(async e=>{console.log("CurrentPreviewSceneChanged",e),n(2,r=e.sceneName)})),e.$$set=e=>{"programScene"in e&&n(1,o=e.programScene),"previewScene"in e&&n(2,r=e.previewScene),"scenes"in e&&n(0,s=e.scenes),"buttonStyle"in e&&n(3,i=e.buttonStyle),"editable"in e&&n(4,a=e.editable)},e.$$.update=()=>{1&e.$$.dirty&&n(6,c=s.filter((e=>-1===e.sceneName.indexOf("(hidden)"))).reverse()),32&e.$$.dirty&&window.localStorage.setItem("sceneIcons",JSON.stringify(u))},[s,o,r,i,a,u,c,function(e){return async function(){l?await Nt("SetCurrentPreviewScene",{sceneName:e.sceneName}):await Nt("SetCurrentProgramScene",{sceneName:e.sceneName})}},function(e){Nt("SetSceneName",{sceneName:e.target.title,newSceneName:e.target.value})},function(e){n(5,u[e.target.title]=e.target.value,u)}]}class Yt extends te{constructor(e){super(),ee(this,e,Jt,Ut,s,{programScene:1,previewScene:2,scenes:0,buttonStyle:3,editable:4})}}function Xt(e,t,n){const o=e.slice();return o[11]=t[n],o}function Kt(e){let t,n,o,s;return n=new jt({props:{name:e[11].sourceName,isProgram:e[11].sceneItemEnabled,img:e[11].img,buttonStyle:e[0]}}),n.$on("click",(function(){r(e[2](e[11].sceneItemId))&&e[2](e[11].sceneItemId).apply(this,arguments)})),{c(){t=p("li"),Y(n.$$.fragment),o=C(),y(t,"class","svelte-1mfq7n9")},m(e,r){d(e,t,r),X(n,t,null),u(t,o),s=!0},p(t,o){e=t;const r={};2&o&&(r.name=e[11].sourceName),2&o&&(r.isProgram=e[11].sceneItemEnabled),2&o&&(r.img=e[11].img),1&o&&(r.buttonStyle=e[0]),n.$set(r)},i(e){s||(Z(n.$$.fragment,e),s=!0)},o(e){U(n.$$.fragment,e),s=!1},d(e){e&&f(t),K(n)}}}function Qt(e){let t,n,o,r,s,i,a=J(e[1]),c=[];for(let t=0;tU(c[e],1,1,(()=>{c[e]=null}));return{c(){t=p("ol");for(let e=0;esetTimeout(e,500*Math.random()+100))),t=await Nt("GetSourceScreenshot",{sourceName:e.sourceName,imageFormat:s,width:192,height:108}),t&&t.imageData)return t.imageData}return N((async function(){await u()})),_t.on("SceneItemEnableStateChanged",(async e=>{if(e.sceneName===r){const t=a[e.sceneItemId];n(1,i[t].sceneItemEnabled=e.sceneItemEnabled,i),i[t].sceneItemEnabled&&!i[t].img&&(n(1,i[t].img=await d(i[t]),i),l.has(i[t].sceneItemId)&&(n(1,i[t].img=await d(i[t]),i),await Nt("SetSceneItemEnabled",{sceneName:r,sceneItemId:i[t].sceneItemId,sceneItemEnabled:!1}),l.delete(i[t].sceneItemId)))}})),_t.on("SceneItemListReindexed",(async e=>{e.sceneName===r&&await u()})),_t.on("SceneItemCreated",(async e=>{e.sceneName===r&&await u()})),_t.on("SceneItemRemoved",(async e=>{e.sceneName===r&&await u()})),e.$$set=e=>{"buttonStyle"in e&&n(0,o=e.buttonStyle),"name"in e&&n(4,r=e.name),"imageFormat"in e&&n(5,s=e.imageFormat)},[o,i,function(e){return async function(){await Nt("SetSceneItemEnabled",{sceneName:r,sceneItemId:e,sceneItemEnabled:!0}),c!==e&&await Nt("SetSceneItemEnabled",{sceneName:r,sceneItemId:c,sceneItemEnabled:!1}),c=e}},async function(){for(let e=0;et[3].call(r))),y(n,"class","select"),S(n,"margin","0 .5rem .5rem 0")},m(e,o){d(e,n,o),u(n,r);for(let e=0;e{console.log("CurrentProfileChanged",e.profileName),n(1,r=e.profileName||"")})),_t.on("ProfileListChanged",(async e=>{console.log("ProfileListChanged",e.profiles.length),n(0,o=e.profiles||[])})),[o,r,async function(e){Nt("SetCurrentProfile",{profileName:e.target.value})},function(){r=M(this),n(1,r),n(0,o)}]}class an extends te{constructor(e){super(),ee(this,e,sn,rn,s,{})}}function cn(e,t,n){const o=e.slice();return o[4]=t[n],o}function ln(e){let t,n,o,r=e[4]+"";return{c(){t=p("option"),n=g(r),t.__value=o=e[4],$(t,t.__value)},m(e,o){d(e,t,o),u(t,n)},p(e,s){1&s&&r!==(r=e[4]+"")&&b(n,r),1&s&&o!==(o=e[4])&&(t.__value=o,$(t,t.__value))},d(e){e&&f(t)}}}function un(t){let n,r,s,i,a=J(t[0]),c=[];for(let e=0;et[3].call(r))),y(n,"class","select"),S(n,"margin","0 .5rem .5rem 0")},m(e,o){d(e,n,o),u(n,r);for(let e=0;e{console.log("CurrentSceneCollectionChanged",e.sceneCollectionName),n(1,r=e.sceneCollectionName||""),_t.emit("SceneListChanged",await Nt("GetSceneList"))})),_t.on("SceneCollectionListChanged",(async e=>{console.log("SceneCollectionListChanged",e.sceneCollections.length),n(0,o=e.sceneCollections||[])})),[o,r,async function(e){Nt("SetCurrentSceneCollection",{sceneCollectionName:e.target.value})},function(){r=M(this),n(1,r),n(0,o)}]}class fn extends te{constructor(e){super(),ee(this,e,dn,un,s,{})}}const{document:mn}=l;function pn(e,t,n){const o=e.slice();return o[40]=t[n],o}function hn(t){let n,o,r=(t[13]||"Disconnected")+"";return{c(){n=p("button"),o=g(r),y(n,"class","button is-danger"),n.disabled=!0},m(e,t){d(e,n,t),u(n,o)},p(e,t){8192&t[0]&&r!==(r=(e[13]||"Disconnected")+"")&&b(o,r)},i:e,o:e,d(e){e&&f(n)}}}function gn(e){let t,n,r,s,i,a,c,l,m,h,g,w,b,$,S,L,M,H,x,_,N,F,V,E,I,P,A,O,B,T,R,j,z,D,W,J,Q,ee,te,re,se,fe,me,pe,he,ge,Ce;function we(e,t){return e[3]&&e[3].stats?wn:Cn}let ye=we(e),be=ye(e);const $e=[yn,vn],Se=[];function Le(e,t){return e[3]&&e[3].streaming&&e[3].streaming.outputActive?0:1}r=Le(e),s=Se[r]=$e[r](e);const Me=[$n,bn],ke=[];function He(e,t){return e[3]&&e[3].recording&&e[3].recording.outputActive?0:1}a=He(e),c=ke[a]=Me[a](e);const xe=[kn,Mn],_e=[];function Ne(e,t){return e[6]?0:1}m=Ne(e),h=_e[m]=xe[m](e),$=new ve({props:{path:"M15,13H17V11H15M15,21H17V19H15M15,5H17V3H15M19,9H21V7H19M19,5H21V3H19M19,13H21V11H19M19,21H21V19H19M11,21H13V3H11M19,17H21V15H19M7,5H9V3H7M3,17H5V15H3M3,21H5V19H3M3,13H5V11H3M7,13H9V11H7M7,21H9V19H7M3,5H5V3H3M3,9H5V7H3V9Z"}}),H=new ve({props:{path:"M8,18H11V15H2V13H22V15H13V18H16L12,22L8,18M12,2L8,6H11V9H2V11H22V9H13V6H16L12,2Z"}}),F=new ve({props:{path:e[8]?ae:ie}}),P=new ve({props:{path:e[1]?de:ue}}),T=new ve({props:{path:e[7]?le:ce}});let Fe=e[12]&&Hn(e);W=new ve({props:{path:e[15]?ne:oe}});let Ve=e[12]&&xn(e);return ee=new an({}),re=new fn({}),pe=new ve({props:{path:"M21.4 7.5C22.2 8.3 22.2 9.6 21.4 10.3L18.6 13.1L10.8 5.3L13.6 2.5C14.4 1.7 15.7 1.7 16.4 2.5L18.2 4.3L21.2 1.3L22.6 2.7L19.6 5.7L21.4 7.5M15.6 13.3L14.2 11.9L11.4 14.7L9.3 12.6L12.1 9.8L10.7 8.4L7.9 11.2L6.4 9.8L3.6 12.6C2.8 13.4 2.8 14.7 3.6 15.4L5.4 17.2L1.4 21.2L2.8 22.6L6.8 18.6L8.6 20.4C9.4 21.2 10.7 21.2 11.4 20.4L14.2 17.6L12.8 16.2L15.6 13.3Z"}}),{c(){t=p("button"),be.c(),n=C(),s.c(),i=C(),c.c(),l=C(),h.c(),g=C(),w=p("button"),b=p("span"),Y($.$$.fragment),S=C(),L=p("button"),M=p("span"),Y(H.$$.fragment),x=C(),_=p("button"),N=p("span"),Y(F.$$.fragment),V=C(),E=p("button"),I=p("span"),Y(P.$$.fragment),A=C(),O=p("button"),B=p("span"),Y(T.$$.fragment),R=C(),Fe&&Fe.c(),j=C(),z=p("button"),D=p("span"),Y(W.$$.fragment),J=C(),Ve&&Ve.c(),Q=C(),Y(ee.$$.fragment),te=C(),Y(re.$$.fragment),se=C(),fe=p("button"),me=p("span"),Y(pe.$$.fragment),y(t,"class","button is-info is-light"),t.disabled=!0,y(b,"class","icon"),y(w,"class","button is-link"),y(w,"title","Toggle Studio Mode"),k(w,"is-light",!e[5]),y(M,"class","icon"),y(L,"class","button is-link"),y(L,"title","Show Scene on Top"),k(L,"is-light",!e[0]),y(N,"class","icon"),y(_,"class","button is-link"),y(_,"title","Edit Scenes"),k(_,"is-light",!e[8]),y(I,"class","icon"),y(E,"class","button is-link"),y(E,"title","Show Scenes as Icons"),k(E,"is-light",!e[1]),y(B,"class","icon"),y(O,"class","button is-link"),y(O,"title","Toggle Replay Buffer"),k(O,"is-light",!e[7]),k(O,"is-danger",e[12]),y(D,"class","icon"),y(z,"class","button is-link"),y(z,"title","Save Replay Buffer"),k(z,"is-light",!e[15]),y(me,"class","icon"),y(fe,"class","button is-danger is-light"),y(fe,"title","Disconnect")},m(o,s){d(o,t,s),be.m(t,null),d(o,n,s),Se[r].m(o,s),d(o,i,s),ke[a].m(o,s),d(o,l,s),_e[m].m(o,s),d(o,g,s),d(o,w,s),u(w,b),X($,b,null),d(o,S,s),d(o,L,s),u(L,M),X(H,M,null),d(o,x,s),d(o,_,s),u(_,N),X(F,N,null),d(o,V,s),d(o,E,s),u(E,I),X(P,I,null),d(o,A,s),d(o,O,s),u(O,B),X(T,B,null),u(O,R),Fe&&Fe.m(O,null),d(o,j,s),d(o,z,s),u(z,D),X(W,D,null),u(z,J),Ve&&Ve.m(z,null),d(o,Q,s),X(ee,o,s),d(o,te,s),X(re,o,s),d(o,se,s),d(o,fe,s),u(fe,me),X(pe,me,null),he=!0,ge||(Ce=[v(w,"click",e[18]),v(L,"click",e[21]),v(_,"click",e[32]),v(E,"click",e[33]),v(O,"click",e[19]),v(z,"click",e[34]),v(fe,"click",e[31])],ge=!0)},p(e,n){ye===(ye=we(e))&&be?be.p(e,n):(be.d(1),be=ye(e),be&&(be.c(),be.m(t,null)));let o=r;r=Le(e),r===o?Se[r].p(e,n):(G(),U(Se[o],1,1,(()=>{Se[o]=null})),q(),s=Se[r],s?s.p(e,n):(s=Se[r]=$e[r](e),s.c()),Z(s,1),s.m(i.parentNode,i));let u=a;a=He(e),a===u?ke[a].p(e,n):(G(),U(ke[u],1,1,(()=>{ke[u]=null})),q(),c=ke[a],c?c.p(e,n):(c=ke[a]=Me[a](e),c.c()),Z(c,1),c.m(l.parentNode,l));let d=m;m=Ne(e),m===d?_e[m].p(e,n):(G(),U(_e[d],1,1,(()=>{_e[d]=null})),q(),h=_e[m],h?h.p(e,n):(h=_e[m]=xe[m](e),h.c()),Z(h,1),h.m(g.parentNode,g)),(!he||32&n[0])&&k(w,"is-light",!e[5]),(!he||1&n[0])&&k(L,"is-light",!e[0]);const f={};256&n[0]&&(f.path=e[8]?ae:ie),F.$set(f),(!he||256&n[0])&&k(_,"is-light",!e[8]);const p={};2&n[0]&&(p.path=e[1]?de:ue),P.$set(p),(!he||2&n[0])&&k(E,"is-light",!e[1]);const C={};128&n[0]&&(C.path=e[7]?le:ce),T.$set(C),e[12]?Fe?Fe.p(e,n):(Fe=Hn(e),Fe.c(),Fe.m(O,null)):Fe&&(Fe.d(1),Fe=null),(!he||128&n[0])&&k(O,"is-light",!e[7]),(!he||4096&n[0])&&k(O,"is-danger",e[12]);const v={};32768&n[0]&&(v.path=e[15]?ne:oe),W.$set(v),e[12]?Ve?Ve.p(e,n):(Ve=xn(e),Ve.c(),Ve.m(z,null)):Ve&&(Ve.d(1),Ve=null),(!he||32768&n[0])&&k(z,"is-light",!e[15])},i(e){he||(Z(s),Z(c),Z(h),Z($.$$.fragment,e),Z(H.$$.fragment,e),Z(F.$$.fragment,e),Z(P.$$.fragment,e),Z(T.$$.fragment,e),Z(W.$$.fragment,e),Z(ee.$$.fragment,e),Z(re.$$.fragment,e),Z(pe.$$.fragment,e),he=!0)},o(e){U(s),U(c),U(h),U($.$$.fragment,e),U(H.$$.fragment,e),U(F.$$.fragment,e),U(P.$$.fragment,e),U(T.$$.fragment,e),U(W.$$.fragment,e),U(ee.$$.fragment,e),U(re.$$.fragment,e),U(pe.$$.fragment,e),he=!1},d(e){e&&(f(t),f(n),f(i),f(l),f(g),f(w),f(S),f(L),f(x),f(_),f(V),f(E),f(A),f(O),f(j),f(z),f(Q),f(te),f(se),f(fe)),be.d(),Se[r].d(e),ke[a].d(e),_e[m].d(e),K($),K(H),K(F),K(P),K(T),Fe&&Fe.d(),K(W),Ve&&Ve.d(),K(ee,e),K(re,e),K(pe),ge=!1,o(Ce)}}}function Cn(t){let n;return{c(){n=g("Connected")},m(e,t){d(e,n,t)},p:e,d(e){e&&f(n)}}}function wn(e){let t,n,o,r,s,i,a=Math.round(e[3].stats.activeFps)+"",c=Math.round(e[3].stats.cpuUsage)+"",l=e[3].stats.renderSkippedFrames+"";return{c(){t=g(a),n=g(" fps, "),o=g(c),r=g("% CPU, "),s=g(l),i=g(" skipped frames")},m(e,a){d(e,t,a),d(e,n,a),d(e,o,a),d(e,r,a),d(e,s,a),d(e,i,a)},p(e,n){8&n[0]&&a!==(a=Math.round(e[3].stats.activeFps)+"")&&b(t,a),8&n[0]&&c!==(c=Math.round(e[3].stats.cpuUsage)+"")&&b(o,c),8&n[0]&&l!==(l=e[3].stats.renderSkippedFrames+"")&&b(s,l)},d(e){e&&(f(t),f(n),f(o),f(r),f(s),f(i))}}}function vn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M4.93,4.93C3.12,6.74 2,9.24 2,12C2,14.76 3.12,17.26 4.93,19.07L6.34,17.66C4.89,16.22 4,14.22 4,12C4,9.79 4.89,7.78 6.34,6.34L4.93,4.93M19.07,4.93L17.66,6.34C19.11,7.78 20,9.79 20,12C20,14.22 19.11,16.22 17.66,17.66L19.07,19.07C20.88,17.26 22,14.76 22,12C22,9.24 20.88,6.74 19.07,4.93M7.76,7.76C6.67,8.85 6,10.35 6,12C6,13.65 6.67,15.15 7.76,16.24L9.17,14.83C8.45,14.11 8,13.11 8,12C8,10.89 8.45,9.89 9.17,9.17L7.76,7.76M16.24,7.76L14.83,9.17C15.55,9.89 16,10.89 16,12C16,13.11 15.55,14.11 14.83,14.83L16.24,16.24C17.33,15.15 18,13.65 18,12C18,10.35 17.33,8.85 16.24,7.76M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger is-light"),y(n,"title","Start Stream")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[22]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function yn(e){let t,n,o,r,s,i,a,c,l,m=On(e[3].streaming.outputDuration)+"";return o=new ve({props:{path:"M20.84 22.73L12.1 14C12.06 14 12.03 14 12 14C10.9 14 10 13.11 10 12C10 11.97 10 11.94 10 11.9L8.4 10.29C8.15 10.81 8 11.38 8 12C8 13.11 8.45 14.11 9.17 14.83L7.76 16.24C6.67 15.15 6 13.65 6 12C6 10.83 6.34 9.74 6.93 8.82L5.5 7.37C4.55 8.67 4 10.27 4 12C4 14.22 4.89 16.22 6.34 17.66L4.93 19.07C3.12 17.26 2 14.76 2 12C2 9.72 2.77 7.63 4.06 5.95L1.11 3L2.39 1.73L22.11 21.46L20.84 22.73M15.93 12.73L17.53 14.33C17.83 13.61 18 12.83 18 12C18 10.35 17.33 8.85 16.24 7.76L14.83 9.17C15.55 9.89 16 10.89 16 12C16 12.25 15.97 12.5 15.93 12.73M19.03 15.83L20.5 17.28C21.44 15.75 22 13.94 22 12C22 9.24 20.88 6.74 19.07 4.93L17.66 6.34C19.11 7.78 20 9.79 20 12C20 13.39 19.65 14.7 19.03 15.83Z"}}),{c(){t=p("button"),n=p("span"),Y(o.$$.fragment),r=C(),s=p("span"),i=g(m),y(n,"class","icon"),y(t,"class","button is-danger"),y(t,"title","Stop Stream")},m(f,m){d(f,t,m),u(t,n),X(o,n,null),u(t,r),u(t,s),u(s,i),a=!0,c||(l=v(t,"click",e[23]),c=!0)},p(e,t){(!a||8&t[0])&&m!==(m=On(e[3].streaming.outputDuration)+"")&&b(i,m)},i(e){a||(Z(o.$$.fragment,e),a=!0)},o(e){U(o.$$.fragment,e),a=!1},d(e){e&&f(t),K(o),c=!1,l()}}}function bn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M19,12C19,15.86 15.86,19 12,19C8.14,19 5,15.86 5,12C5,8.14 8.14,5 12,5C15.86,5 19,8.14 19,12Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger is-light"),y(n,"title","Start Recording")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[24]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function $n(e){let t,n,o,r,s,i,a,c,l,m,h,w,$=On(e[3].recording.outputDuration)+"";const S=[Ln,Sn],L=[];function M(e,t){return e[3].recording.outputPaused?0:1}return t=M(e),n=L[t]=S[t](e),i=new ve({props:{path:"M18,18H6V6H18V18Z"}}),{c(){n.c(),o=C(),r=p("button"),s=p("span"),Y(i.$$.fragment),a=C(),c=p("span"),l=g($),y(s,"class","icon"),y(r,"class","button is-danger"),y(r,"title","Stop Recording")},m(n,f){L[t].m(n,f),d(n,o,f),d(n,r,f),u(r,s),X(i,s,null),u(r,a),u(r,c),u(c,l),m=!0,h||(w=v(r,"click",e[25]),h=!0)},p(e,r){let s=t;t=M(e),t===s?L[t].p(e,r):(G(),U(L[s],1,1,(()=>{L[s]=null})),q(),n=L[t],n?n.p(e,r):(n=L[t]=S[t](e),n.c()),Z(n,1),n.m(o.parentNode,o)),(!m||8&r[0])&&$!==($=On(e[3].recording.outputDuration)+"")&&b(l,$)},i(e){m||(Z(n),Z(i.$$.fragment,e),m=!0)},o(e){U(n),U(i.$$.fragment,e),m=!1},d(e){e&&(f(o),f(r)),L[t].d(e),K(i),h=!1,w()}}}function Sn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M14,19H18V5H14M6,19H10V5H6V19Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-success"),y(n,"title","Pause Recording")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[28]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function Ln(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger"),y(n,"title","Resume Recording")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[29]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function Mn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger is-light"),y(n,"title","Start Virtual Webcam")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[26]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function kn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M1.2,4.47L2.5,3.2L20,20.72L18.73,22L16.73,20H4A2,2 0 0,1 2,18V6C2,5.78 2.04,5.57 2.1,5.37L1.2,4.47M7,4L9,2H15L17,4H20A2,2 0 0,1 22,6V18C22,18.6 21.74,19.13 21.32,19.5L16.33,14.5C16.76,13.77 17,12.91 17,12A5,5 0 0,0 12,7C11.09,7 10.23,7.24 9.5,7.67L5.82,4H7M7,12A5,5 0 0,0 12,17C12.5,17 13.03,16.92 13.5,16.77L11.72,15C10.29,14.85 9.15,13.71 9,12.28L7.23,10.5C7.08,10.97 7,11.5 7,12M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger"),y(n,"title","Stop Virtual Webcam")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[27]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function Hn(e){let t,n;return{c(){t=p("span"),n=g(e[12])},m(e,o){d(e,t,o),u(t,n)},p(e,t){4096&t[0]&&b(n,e[12])},d(e){e&&f(t)}}}function xn(e){let t,n;return{c(){t=p("span"),n=g(e[12])},m(e,o){d(e,t,o),u(t,n)},p(e,t){4096&t[0]&&b(n,e[12])},d(e){e&&f(t)}}}function _n(t){let n,r,s,i,a,c,l,m,h,w,b,S,L,M,k,H,x,_,N,F,V,E,I,P,A,O,B,T="https:"===document.location.protocol&&function(){let t,n,o,r,s,i,a,c,l,m,h,C;return{c(){t=p("div"),n=g("You are checking this page on a secure HTTPS connection. That's great,\n but it means you can\n "),o=p("strong"),o.textContent="only",r=g("\n connect to WSS (secure websocket) addresses, for example OBS exposed with\n "),s=p("a"),s.textContent="ngrok",i=g("\n or\n "),a=p("a"),a.textContent="pagekite",c=g("\n . If you want to connect to a local OBS instance,\n "),l=p("strong"),m=p("a"),h=g("please click here to load the non-secure version of this page"),C=g("\n ."),y(s,"href","https://ngrok.com/"),y(a,"href","https://pagekite.net/"),y(m,"href","http://"+document.location.hostname+(document.location.port?":"+document.location.port:"")+document.location.pathname),y(t,"class","notification is-danger")},m(e,f){d(e,t,f),u(t,n),u(t,o),u(t,r),u(t,s),u(t,i),u(t,a),u(t,c),u(t,l),u(l,m),u(m,h),u(t,C)},p:e,d(e){e&&f(t)}}}();return{c(){n=p("h1"),n.innerHTML='Welcome to\n OBS-web\n - the easiest way to control\n OBS\n remotely!',r=C(),T&&T.c(),s=C(),i=p("p"),i.textContent='To get started, enter your OBS host:port below and click "connect".',a=C(),c=p("form"),l=p("div"),m=p("p"),h=p("input"),w=C(),b=p("input"),S=C(),L=p("p"),L.innerHTML='',M=C(),k=p("p"),H=g("Make sure that you use "),x=p("a"),x.textContent="OBS v28+",_=g("\n or install the\n "),N=p("a"),F=g("obs-websocket "),V=g(An),E=g(" plugin"),I=g("\n for v27. If you use an older version of OBS, see the\n "),P=p("a"),P.textContent="archived OBS-web v4",A=g(" page."),y(n,"class","subtitle"),y(h,"id","host"),y(h,"class","input"),y(h,"type","text"),y(h,"autocomplete",""),y(h,"placeholder","ws://localhost:4455"),y(b,"id","password"),y(b,"class","input"),y(b,"type","password"),y(b,"autocomplete","current-password"),y(b,"placeholder","password (leave empty if you have disabled authentication)"),y(m,"class","control is-expanded"),y(L,"class","control"),y(l,"class","field is-grouped"),y(x,"href","https://github.com/obsproject/obs-studio/releases"),y(N,"href","https://github.com/obsproject/obs-websocket/releases/tag/"+An),y(N,"target","_blank"),y(N,"rel","noreferrer"),y(P,"href","/v4/"),y(k,"class","help")},m(e,o){var f;d(e,n,o),d(e,r,o),T&&T.m(e,o),d(e,s,o),d(e,i,o),d(e,a,o),d(e,c,o),u(c,l),u(l,m),u(m,h),$(h,t[9]),u(m,w),u(m,b),$(b,t[10]),u(l,S),u(l,L),d(e,M,o),d(e,k,o),u(k,H),u(k,x),u(k,_),u(k,N),u(N,F),u(N,V),u(N,E),u(k,I),u(k,P),u(k,A),O||(B=[v(h,"input",t[36]),v(b,"input",t[37]),v(c,"submit",(f=t[30],function(e){return e.preventDefault(),f.call(this,e)}))],O=!0)},p(e,t){"https:"===document.location.protocol&&T.p(e,t),512&t[0]&&h.value!==e[9]&&$(h,e[9]),1024&t[0]&&b.value!==e[10]&&$(b,e[10])},i:e,o:e,d(e){e&&(f(n),f(r),f(s),f(i),f(a),f(c),f(M),f(k)),T&&T.d(e),O=!1,o(B)}}}function Nn(e){let t,n,o,r,s,i,a,c=e[0]&&Fn(e);function l(t){e[35](t)}let u={buttonStyle:e[1]?"icon":"text",editable:e[8]};void 0!==e[11]&&(u.scenes=e[11]),n=new Yt({props:u}),E.push((()=>function(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}(n,"scenes",l)));let p=!e[0]&&Vn(e),h=J(e[11]),g=[];for(let t=0;tU(g[e],1,1,(()=>{g[e]=null}));return{c(){c&&c.c(),t=C(),Y(n.$$.fragment),r=C(),p&&p.c(),s=C();for(let e=0;e{c=null})),q());const a={};var l;if(2&r[0]&&(a.buttonStyle=e[1]?"icon":"text"),256&r[0]&&(a.editable=e[8]),!o&&2048&r[0]&&(o=!0,a.scenes=e[11],l=()=>o=!1,P.push(l)),n.$set(a),e[0]?p&&(G(),U(p,1,1,(()=>{p=null})),q()):p?(p.p(e,r),1&r[0]&&Z(p,1)):(p=Vn(e),p.c(),Z(p,1),p.m(s.parentNode,s)),18432&r[0]){let t;for(h=J(e[11]),t=0;t0,r=o&&En(e);return{c(){r&&r.c(),t=w()},m(e,o){r&&r.m(e,o),d(e,t,o),n=!0},p(e,n){2048&n[0]&&(o=e[40].sceneName.indexOf("(switch)")>0),o?r?(r.p(e,n),2048&n[0]&&Z(r,1)):(r=En(e),r.c(),Z(r,1),r.m(t.parentNode,t)):r&&(G(),U(r,1,1,(()=>{r=null})),q())},i(e){n||(Z(r),n=!0)},o(e){U(r),n=!1},d(e){e&&f(t),r&&r.d(e)}}}function Pn(e){let t,n,o,r,s,i,a,c,l,m,h,g,w,b,$,S,L,M,H,x,_,N,F,V;const E=[gn,hn],I=[];function P(e,t){return e[2]?0:1}l=P(e),m=I[l]=E[l](e),b=new ve({props:{path:e[4]?se:re}});const A=[Nn,_n],O=[];function B(e,t){return e[2]?0:1}return M=B(e),H=O[M]=A[M](e),{c(){t=C(),n=p("nav"),o=p("div"),o.innerHTML='OBS-web ',r=C(),s=p("div"),i=p("div"),a=p("div"),c=p("div"),m.c(),h=C(),g=p("button"),w=p("span"),Y(b.$$.fragment),$=C(),S=p("section"),L=p("div"),H.c(),x=C(),_=p("footer"),_.innerHTML='

OBS-web\n by\n Niek van der Maas\n — see\n GitHub\n for source code.

',mn.title="OBS-web remote control",y(o,"class","navbar-brand"),y(w,"class","icon"),y(g,"class","button is-link"),y(g,"title","Toggle Fullscreen"),k(g,"is-light",!e[4]),y(c,"class","buttons"),y(a,"class","navbar-item"),y(i,"class","navbar-end"),y(s,"id","navmenu"),y(s,"class","navbar-menu"),y(n,"class","navbar is-primary"),y(n,"aria-label","main navigation"),y(L,"class","container"),y(S,"class","section"),y(_,"class","footer")},m(f,m){d(f,t,m),d(f,n,m),u(n,o),u(n,r),u(n,s),u(s,i),u(i,a),u(a,c),I[l].m(c,null),u(c,h),u(c,g),u(g,w),X(b,w,null),d(f,$,m),d(f,S,m),u(S,L),O[M].m(L,null),d(f,x,m),d(f,_,m),N=!0,F||(V=v(g,"click",e[17]),F=!0)},p(e,t){let n=l;l=P(e),l===n?I[l].p(e,t):(G(),U(I[n],1,1,(()=>{I[n]=null})),q(),m=I[l],m?m.p(e,t):(m=I[l]=E[l](e),m.c()),Z(m,1),m.m(c,h));const o={};16&t[0]&&(o.path=e[4]?se:re),b.$set(o),(!N||16&t[0])&&k(g,"is-light",!e[4]);let r=M;M=B(e),M===r?O[M].p(e,t):(G(),U(O[r],1,1,(()=>{O[r]=null})),q(),H=O[M],H?H.p(e,t):(H=O[M]=A[M](e),H.c()),Z(H,1),H.m(L,null))},i(e){N||(Z(m),Z(b.$$.fragment,e),Z(H),N=!0)},o(e){U(m),U(b.$$.fragment,e),U(H),N=!1},d(e){e&&(f(t),f(n),f($),f(S),f(x),f(_)),I[l].d(),K(b),O[M].d(),F=!1,V()}}}const An="5.0.1";function On(e){e=Math.round(e/1e3);const t=Math.floor(e/3600);e-=3600*t;const n=Math.floor(e/60);return e-=60*n,t>0?`${t}:${n<10?"0":""}${n}:${e<10?"0":""}${e}`:`${n<10?"0":""}${n}:${e<10?"0":""}${e}`}function Bn(e,t,n){let o;N((async()=>{if("serviceWorker"in navigator&&navigator.serviceWorker.register("/service-worker.js"),"wakeLock"in navigator)try{await navigator.wakeLock.request("screen"),document.addEventListener("visibilitychange",(async()=>{"visible"===document.visibilityState&&await navigator.wakeLock.request("screen")}))}catch(e){}const e=document.querySelector(".navbar-burger");e.addEventListener("click",(()=>{e.classList.toggle("is-active"),document.getElementById(e.dataset.target).classList.toggle("is-active")})),document.addEventListener("fullscreenchange",(()=>{n(4,s=document.fullscreenElement)})),document.addEventListener("webkitfullscreenchange",(()=>{n(4,s=document.webkitFullscreenElement)})),document.addEventListener("msfullscreenchange",(()=>{n(4,s=document.msFullscreenElement)})),""!==document.location.hash&&(n(9,l=document.location.hash.slice(1)),l.includes("#")&&n(9,[l,u]=l.split("#"),l,n(10,u)),await S()),window.sendCommand=Nt}));let r,s,i,a,c,l,u,d={},f=window.localStorage.getItem("isSceneOnTop")||!1,m=window.localStorage.getItem("isIconMode")||!1,p=!1,h=[],g="",C="",w="jpg",v=!1,y=!1;function b(e){n(12,g=e),setTimeout((()=>{n(12,g="")}),5e3)}async function $(){const e=await Nt("GetReplayBufferStatus");console.debug("GetReplayBufferStatus",e.outputActive),e.outputActive?(await Nt("SaveReplayBuffer"),n(16,y=!0),n(15,v=!0),setTimeout((()=>{n(15,v=!1),n(16,y=!1)}),2500)):b("Replay buffer is not enabled.")}async function S(){if(n(9,l=l||"ws://localhost:4455"),-1===l.indexOf("://")){const e="https:"===location.protocol||l.endsWith(":443");n(9,l=e?"wss://":"ws://"+l)}console.log("Connecting to:",l,"- using password:",u),await L();try{const{obsWebSocketVersion:e,negotiatedRpcVersion:t}=await _t.connect(l,u);console.log(`Connected to obs-websocket version ${e} (using RPC ${t})`)}catch(e){console.log(e),n(13,C=e.message)}}async function L(){await _t.disconnect(),clearInterval(r),n(2,o=!1),n(13,C="Disconnected")}_t.on("ConnectionClosed",(()=>{n(2,o=!1),window.history.pushState("",document.title,window.location.pathname+window.location.search),console.log("Connection closed")})),_t.on("Identified",(async()=>{console.log("Connected"),n(2,o=!0),document.location.hash=l;const e=await Nt("GetVersion"),t=e.obsWebSocketVersion||"";console.log("OBS-websocket version:",t),((e,t)=>{const n=be(e),o=be(t),r=n.pop(),s=o.pop(),i=Me(n,o);return 0!==i?i:r&&s?Me(r.split("."),s.split(".")):r||s?r?-1:1:0})(t,An)<0&&alert("You are running an outdated OBS-websocket (version "+t+"), please upgrade to the latest version for full compatibility."),e.supportedImageFormats.includes("webp")&&0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")&&n(14,w="webp"),r=setInterval((async()=>{const e=await Nt("GetStats"),t=await Nt("GetStreamStatus"),o=await Nt("GetRecordStatus");n(3,d={stats:e,streaming:t,recording:o})}),1e3),n(5,i=(await Nt("GetStudioModeEnabled")).studioModeEnabled||!1),n(6,a=(await Nt("GetVirtualCamStatus")).outputActive||!1)})),_t.on("ConnectionError",(async()=>{n(13,C="Please enter your password:"),document.getElementById("password").focus(),u?await S():n(2,o=!1)})),_t.on("VirtualcamStateChanged",(async e=>{console.log("VirtualcamStateChanged",e.outputActive),n(6,a=e&&e.outputActive)})),_t.on("StudioModeStateChanged",(async e=>{console.log("StudioModeStateChanged",e.studioModeEnabled),n(5,i=e&&e.studioModeEnabled)})),_t.on("ReplayBufferStateChanged",(async e=>{console.log("ReplayBufferStateChanged",e),n(7,c=e&&e.outputActive)}));return e.$$.update=()=>{1&e.$$.dirty[0]&&(f?window.localStorage.setItem("isSceneOnTop","true"):window.localStorage.removeItem("isSceneOnTop")),2&e.$$.dirty[0]&&(m?window.localStorage.setItem("isIconMode","true"):window.localStorage.removeItem("isIconMode"))},[f,m,o,d,s,i,a,c,p,l,u,h,g,C,w,v,y,function(){s?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.webkitRequestFullscreen?document.documentElement.webkitRequestFullscreen():document.documentElement.msRequestFullscreen&&document.documentElement.msRequestFullscreen()},async function(){await Nt("SetStudioModeEnabled",{studioModeEnabled:!i})},async function(){const e=await Nt("ToggleReplayBuffer");console.debug("ToggleReplayBuffer",e.outputActive),void 0===e.outputActive?b("Replay buffer is not enabled."):n(7,c=e.outputActive)},$,async function(){n(0,f=!f)},async function(){await Nt("StartStream")},async function(){await Nt("StopStream")},async function(){await Nt("StartRecord")},async function(){await Nt("StopRecord")},async function(){await Nt("StartVirtualCam")},async function(){await Nt("StopVirtualCam")},async function(){await Nt("PauseRecord")},async function(){await Nt("ResumeRecord")},S,L,()=>n(8,p=!p),()=>n(1,m=!m),()=>{y||$(),n(16,y=!y)},function(e){h=e,n(11,h)},function(){l=this.value,n(9,l)},function(){u=this.value,n(10,u)}]}return new class extends te{constructor(e){super(),ee(this,e,Bn,Pn,s,{},null,[-1,-1])}}({target:document.body})}(); diff --git a/bundle-v13715c3.css b/bundle-vb8db420.css similarity index 100% rename from bundle-v13715c3.css rename to bundle-vb8db420.css diff --git a/bundle-vb8db420.js b/bundle-vb8db420.js new file mode 100644 index 0000000..5d85fe8 --- /dev/null +++ b/bundle-vb8db420.js @@ -0,0 +1 @@ +var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(t)}function r(e){return"function"==typeof e}function s(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let i;function a(e,t){return e===t||(i||(i=document.createElement("a")),i.href=t,e===i.href)}var c="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};const l="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:c;function u(e,t){e.appendChild(t)}function d(e,t,n){e.insertBefore(t,n||null)}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function m(e,t){for(let n=0;ne.removeEventListener(t,n,o)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function b(e,t){t=""+t,e.data!==t&&(e.data=t)}function $(e,t){e.value=null==t?"":t}function S(e,t,n,o){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function L(e,t,n){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=function(e,t,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:o})}(t,n,{cancelable:o});return r.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const V=[],E=[];let I=[];const P=[],A=Promise.resolve();let O=!1;function B(e){I.push(e)}const T=new Set;let R=0;function j(){if(0!==R)return;const e=H;do{try{for(;R{D.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}function J(e){return void 0!==e?.length?e:Array.from(e)}function Y(e){e&&e.c()}function X(e,n,s){const{fragment:i,after_update:a}=e.$$;i&&i.m(n,s),B((()=>{const n=e.$$.on_mount.map(t).filter(r);e.$$.on_destroy?e.$$.on_destroy.push(...n):o(n),e.$$.on_mount=[]})),a.forEach(B)}function K(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];I.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),I=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Q(e,t){-1===e.$$.dirty[0]&&(V.push(e),O||(O=!0,A.then(j)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const r=o.length?o[0]:n;return m.ctx&&a(m.ctx[e],m.ctx[e]=r)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](r),p&&Q(t,e)),n})):[],m.update(),p=!0,o(m.before_update),m.fragment=!!i&&i(m.ctx),r.target){if(r.hydrate){const e=function(e){return Array.from(e.childNodes)}(r.target);m.fragment&&m.fragment.l(e),e.forEach(f)}else m.fragment&&m.fragment.c();r.intro&&Z(t.$$.fragment),X(t,r.target,r.anchor),j()}x(d)}class te{$$=void 0;$$set=void 0;$destroy(){K(this,1),this.$destroy=e}$on(t,n){if(!r(n))return e;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const e=o.indexOf(n);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");var ne="M14 12.8C13.5 12.31 12.78 12 12 12C10.34 12 9 13.34 9 15C9 16.31 9.84 17.41 11 17.82C11.07 15.67 12.27 13.8 14 12.8M11.09 19H5V5H16.17L19 7.83V12.35C19.75 12.61 20.42 13 21 13.54V7L17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H11.81C11.46 20.39 11.21 19.72 11.09 19M6 10H15V6H6V10M15.75 21L13 18L14.16 16.84L15.75 18.43L19.34 14.84L20.5 16.25L15.75 21",oe="M13 17H17V14L22 18.5L17 23V20H13V17M14 12.8C13.5 12.31 12.78 12 12 12C10.34 12 9 13.34 9 15C9 16.31 9.84 17.41 11 17.82C11.07 15.67 12.27 13.8 14 12.8M11.09 19H5V5H16.17L19 7.83V12.35C19.75 12.61 20.42 13 21 13.54V7L17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H11.81C11.46 20.39 11.21 19.72 11.09 19M6 10H15V6H6V10Z",re="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",se="M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z",ie="M22.7 14.3L21.7 15.3L19.7 13.3L20.7 12.3C20.8 12.2 20.9 12.1 21.1 12.1C21.2 12.1 21.4 12.2 21.5 12.3L22.8 13.6C22.9 13.8 22.9 14.1 22.7 14.3M13 19.9V22H15.1L21.2 15.9L19.2 13.9L13 19.9M21 5C21 3.9 20.1 3 19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H11V19.1L12.1 18H5L8.5 13.5L11 16.5L14.5 12L16.1 14.1L21 9.1V5Z",ae="M22.7 14.3L21.7 15.3L19.7 13.3L20.7 12.3C20.8 12.2 20.9 12.1 21.1 12.1C21.2 12.1 21.4 12.2 21.5 12.3L22.8 13.6C22.9 13.8 22.9 14.1 22.7 14.3M13 19.9V22H15.1L21.2 15.9L19.2 13.9L13 19.9M11.21 15.83L9.25 13.47L6.5 17H13.12L15.66 14.55L13.96 12.29L11.21 15.83M11 19.9V19.05L11.05 19H5V5H19V11.31L21 9.38V5C21 3.9 20.11 3 19 3H5C3.9 3 3 3.9 3 5V19C3 20.11 3.9 21 5 21H11V19.9Z",ce="M22 12C22 6.46 17.54 2 12 2C10.83 2 9.7 2.19 8.62 2.56L9.32 4.5C10.17 4.16 11.06 3.97 12 3.97C16.41 3.97 20.03 7.59 20.03 12C20.03 16.41 16.41 20.03 12 20.03C7.59 20.03 3.97 16.41 3.97 12C3.97 11.06 4.16 10.12 4.5 9.28L2.56 8.62C2.19 9.7 2 10.83 2 12C2 17.54 6.46 22 12 22C17.54 22 22 17.54 22 12M5.47 3.97C6.32 3.97 7 4.68 7 5.47C7 6.32 6.32 7 5.47 7C4.68 7 3.97 6.32 3.97 5.47C3.97 4.68 4.68 3.97 5.47 3.97M18 12C18 8.67 15.33 6 12 6C8.67 6 6 8.67 6 12C6 15.33 8.67 18 12 18C15.33 18 18 15.33 18 12M15 12L10 15V9",le="M10 16.5L16 12L10 7.5M22 12C22 6.46 17.54 2 12 2C10.83 2 9.7 2.19 8.62 2.56L9.32 4.5C10.17 4.16 11.06 3.97 12 3.97C16.41 3.97 20.03 7.59 20.03 12C20.03 16.41 16.41 20.03 12 20.03C7.59 20.03 3.97 16.41 3.97 12C3.97 11.06 4.16 10.12 4.5 9.28L2.56 8.62C2.19 9.7 2 10.83 2 12C2 17.54 6.46 22 12 22C17.54 22 22 17.54 22 12M5.47 3.97C6.32 3.97 7 4.68 7 5.47C7 6.32 6.32 7 5.47 7C4.68 7 3.97 6.32 3.97 5.47C3.97 4.68 4.68 3.97 5.47 3.97Z",ue="M19.5 8C21.43 8 23 6.43 23 4.5C23 2.57 21.43 1 19.5 1C17.57 1 16 2.57 16 4.5C16 6.43 17.57 8 19.5 8M19.5 10C20 10 20.5 9.93 21 9.79V16C21 18.76 18.76 21 16 21H8C5.24 21 3 18.76 3 16V8C3 5.24 5.24 3 8 3H14.21C14.07 3.5 14 4 14 4.5C14 7.54 16.46 10 19.5 10Z",de="M19.5 8C21.43 8 23 6.43 23 4.5C23 2.57 21.43 1 19.5 1C17.57 1 16 2.57 16 4.5C16 6.43 17.57 8 19.5 8M21 16V9.79C20.5 9.93 20 10 19.5 10C19.33 10 19.17 10 19 10V16C19 17.66 17.66 19 16 19H8C6.34 19 5 17.66 5 16V8C5 6.34 6.34 5 8 5H14C14 4.84 14 4.67 14 4.5C14 4 14.07 3.5 14.21 3H8C5.24 3 3 5.24 3 8V16C3 18.76 5.24 21 8 21H16C18.76 21 21 18.76 21 16Z";function fe(e){let t,n;return{c(){t=h("title"),n=g(e[2])},m(e,o){d(e,t,o),u(t,n)},p(e,t){4&t&&b(n,e[2])},d(e){e&&f(t)}}}function me(e){let t;return{c(){t=h("path"),y(t,"d",e[0])},m(e,n){d(e,t,n)},p(e,n){1&n&&y(t,"d",e[0])},d(e){e&&f(t)}}}function pe(e){let t,n,o;function r(e,t){return e[3]?ge:he}let s=r(e),i=s(e);return{c(){i.c(),t=h("g"),n=h("path"),y(n,"d",e[0]),y(t,"style",o=`animation: ${e[5]} linear ${e[6]}s infinite; transform-origin: center`)},m(e,o){i.m(e,o),d(e,t,o),u(t,n)},p(e,a){s!==(s=r(e))&&(i.d(1),i=s(e),i&&(i.c(),i.m(t.parentNode,t))),1&a&&y(n,"d",e[0]),96&a&&o!==(o=`animation: ${e[5]} linear ${e[6]}s infinite; transform-origin: center`)&&y(t,"style",o)},d(e){e&&f(t),i.d(e)}}}function he(e){let t,n;return{c(){t=h("style"),n=g("@keyframes spin { to { transform: rotate(360deg) } }")},m(e,o){d(e,t,o),u(t,n)},d(e){e&&f(t)}}}function ge(e){let t,n;return{c(){t=h("style"),n=g("@keyframes spin-inverse { to { transform: rotate(-360deg) } }")},m(e,o){d(e,t,o),u(t,n)},d(e){e&&f(t)}}}function Ce(t){let n,o,r=t[2]&&fe(t);function s(e,t){return!1!==e[1]?pe:me}let i=s(t),a=i(t);return{c(){n=h("svg"),r&&r.c(),o=w(),a.c(),y(n,"viewBox","0 0 24 24"),y(n,"style",t[4]),y(n,"class","svelte-dmmfjb")},m(e,t){d(e,n,t),r&&r.m(n,null),u(n,o),a.m(n,null)},p(e,[t]){e[2]?r?r.p(e,t):(r=fe(e),r.c(),r.m(n,o)):r&&(r.d(1),r=null),i===(i=s(e))&&a?a.p(e,t):(a.d(1),a=i(e),a&&(a.c(),a.m(n,null))),16&t&&y(n,"style",e[4])},i:e,o:e,d(e){e&&f(n),r&&r.d(),a.d()}}}function we(e,t,n){let o,r,s,i,{path:a}=t,{size:c=1}=t,{color:l=null}=t,{flip:u=null}=t,{rotate:d=0}=t,{spin:f=!1}=t,{title:m=""}=t;Number(c)&&(c=Number(c));return e.$$set=e=>{"path"in e&&n(0,a=e.path),"size"in e&&n(7,c=e.size),"color"in e&&n(8,l=e.color),"flip"in e&&n(9,u=e.flip),"rotate"in e&&n(10,d=e.rotate),"spin"in e&&n(1,f=e.spin),"title"in e&&n(2,m=e.title)},e.$$.update=()=>{2&e.$$.dirty&&n(3,o="boolean"!=typeof f&&f<0),2&e.$$.dirty&&n(6,r=Math.abs(!0===f?2:f)),8&e.$$.dirty&&n(5,s=o?"spin-inverse":"spin"),1920&e.$$.dirty&&n(4,i=(()=>{const e=[],t=[];if(null!==c){const e="string"==typeof c?c:1.5*c+"rem";t.push(["width",e]),t.push(["height",e])}return t.push(["fill",null!==l?l:"currentColor"]),!0!==u&&"h"!==u||e.push("scaleX(-1)"),!0!==u&&"v"!==u||e.push("scaleY(-1)"),0!=d&&e.push(`rotate(${d}deg)`),e.length>0&&(t.push(["transform",e.join(" ")]),t.push(["transform-origin","center"])),t.reduce(((e,t)=>`${e} ${t[0]}:${t[1]};`),"")})())},[a,f,m,o,i,s,r,c,l,u,d]}class ve extends te{constructor(e){super(),ee(this,e,we,Ce,s,{path:0,size:7,color:8,flip:9,rotate:10,spin:1,title:2})}}const ye=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,be=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(ye);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},$e=e=>"*"===e||"x"===e||"X"===e,Se=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Le=(e,t)=>{if($e(e)||$e(t))return 0;const[n,o]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Se(e),Se(t));return n>o?1:n{for(let n=0;n1)for(var n=1;n=1.5*n;return Math.round(e/n)+" "+o+(r?"s":"")}return Ke=function(a,c){c=c||{};var l=typeof a;if("string"===l&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===l&&isFinite(a))return c.long?function(r){var s=Math.abs(r);if(s>=o)return i(r,s,o,"day");if(s>=n)return i(r,s,n,"hour");if(s>=t)return i(r,s,t,"minute");if(s>=e)return i(r,s,e,"second");return r+" ms"}(a):function(r){var s=Math.abs(r);if(s>=o)return Math.round(r/o)+"d";if(s>=n)return Math.round(r/n)+"h";if(s>=t)return Math.round(r/t)+"m";if(s>=e)return Math.round(r/e)+"s";return r+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}var it,at=(nt||(nt=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(o++,"%c"===e&&(r=o))})),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"env"in ot&&(e=ot.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(tt||(tt=1,et=function(e){function t(e){let o,r,s,i=null;function a(...e){if(!a.enabled)return;const n=a,r=Number(new Date),s=r-(o||r);n.diff=s,n.prev=o,n.curr=r,o=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((o,r)=>{if("%%"===o)return"%";i++;const s=t.formatters[r];if("function"==typeof s){const t=e[i];o=s.call(n,t),e.splice(i,1),i--}return o})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(r!==t.namespaces&&(r=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e,t){let n=0,o=0,r=-1,s=0;for(;n"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(o(e,n))return!1;for(const n of t.names)if(o(e,n))return!0;return!1},t.humanize=st(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t>>2]>>>24-s%4*8&255;t[o+s>>>2]|=i<<24-(o+s)%4*8}else for(var a=0;a>>2]=n[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-r%4*8&255;o.push((s>>>4).toString(16)),o.push((15&s).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new c.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],r=0;r>>2]>>>24-r%4*8&255;o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new c.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},m=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,o=this._data,r=o.words,s=o.sigBytes,i=this.blockSize,a=s/(4*i),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,u=e.min(4*l,s);if(l){for(var d=0;d>>7)^(p<<14|p>>>18)^p>>>3,g=c[m-2],C=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[m]=h+c[m-7]+C+c[m-16]}var w=o&r^o&s^r&s,v=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),y=f+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&u^~l&d)+a[m]+c[m];f=d,d=u,u=l,l=i+y|0,i=s,s=r,r=o,o=y+(v+w)|0}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+i|0,n[4]=n[4]+l|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(o/4294967296),n[15+(r+64>>>9<<4)]=o,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),yt.SHA256)),pt.exports)),St={exports:{}};var Lt=(bt||(bt=1,St.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function o(e,t,o){for(var r=[],s=0,i=0;i>>6-i%4*2;r[s>>>2]|=a<<24-s%4*8,s++}return n.create(r,s)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,o=this._map;e.clamp();for(var r=[],s=0;s>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a>>6*(3-a)&63));var c=o.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var s=0;s{const o=await this.createConnection(e);return this.emit("Hello",o),this.identify(o,t,n)})(),new Promise(((e,t)=>{r.then((e=>{e.message&&t(e)})),o.then((e=>{t(e)}))}))])}catch(e){throw await this.disconnect(),e}}async disconnect(){if(!this.socket||this.socket.readyState===mt.CLOSED)return;const e=this.internalEventPromise("ConnectionClosed");this.socket.close(),await e}async reidentify(e){const t=this.internalEventPromise("op:2");return await this.message(3,e),t}async call(t,n){const o=e.generateMessageId(),r=this.internalEventPromise(`res:${o}`);await this.message(6,{requestId:o,requestType:t,requestData:n});const{requestStatus:s,responseData:i}=await r;if(!s.result)throw new Ht(s.code,s.comment);return i}async callBatch(t,n={}){const o=e.generateMessageId(),r=this.internalEventPromise(`res:${o}`);await this.message(8,{requestId:o,requests:t,...n});const{results:s}=await r;return s}cleanup(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket=void 0,this._identified=!1,this.internalListeners.removeAllListeners())}async createConnection(e){var t;const n=this.internalEventPromise("ConnectionOpened"),o=this.internalEventPromise("op:0");this.socket=new mt(e,this.protocol),this.socket.onopen=this.onOpen.bind(this),this.socket.onmessage=this.onMessage.bind(this),this.socket.onerror=this.onError.bind(this),this.socket.onclose=this.onClose.bind(this),await n;const r=null==(t=this.socket)?void 0:t.protocol;if(!r)throw new Ht(-1,"Server sent no subprotocol");if(r!==this.protocol)throw new Ht(-1,"Server sent an invalid subprotocol");return o}async identify({authentication:e,rpcVersion:t,...n},o,r={}){const s={rpcVersion:t,...r};e&&o&&(s.authentication=function(e,t,n){const o=Mt.stringify($t(n+e));return Mt.stringify($t(o+t))}(e.salt,e.challenge,o));const i=this.internalEventPromise("op:2");await this.message(1,s);const a=await i;return this._identified=!0,this.emit("Identified",a),{rpcVersion:t,...n,...a}}async message(e,t){if(!this.socket)throw new Error("Not connected");if(!this.identified&&1!==e)throw new Error("Socket not identified");const n=await this.encodeMessage({op:e,d:t});this.socket.send(n)}async internalEventPromise(e){return new Promise((t=>{this.internalListeners.once(e,t)}))}onOpen(e){kt("socket.open"),this.emit("ConnectionOpened"),this.internalListeners.emit("ConnectionOpened",e)}async onMessage(e){try{const{op:t,d:n}=await this.decodeMessage(e.data);if(kt("socket.message: %d %j",t,n),void 0===t||void 0===n)return;switch(t){case 5:{const{eventType:e,eventData:t}=n;return void this.emit(e,t)}case 7:case 9:{const{requestId:e}=n;return void this.internalListeners.emit(`res:${e}`,n)}default:this.internalListeners.emit(`op:${t}`,n)}}catch(e){kt("error handling message: %o",e)}}onError(e){kt("socket.error: %o",e);const t=new Ht(-1,e.message);this.emit("ConnectionError",t),this.internalListeners.emit("ConnectionError",t)}onClose(e){kt("socket.close: %s (%d)",e.reason,e.code);const t=new Ht(e.code,e.reason);this.emit("ConnectionClosed",t),this.internalListeners.emit("ConnectionClosed",t),this.cleanup()}};"undefined"!=typeof exports&&Object.defineProperty(exports,"__esModule",{value:!0});const _t=new class extends xt{protocol="obswebsocket.json";async encodeMessage(e){return JSON.stringify(e)}async decodeMessage(e){return JSON.parse(e)}};async function Nt(e,t){try{return await _t.call(e,t||{})}catch(t){return console.log("Error sending command",e," - error is:",t.message),{}}}function Ft(e,t,n){const o=e.slice();return o[12]=t[n],o}function Vt(e){let t,n,o,r,s=J(e[3]),i=[];for(let t=0;t{let e;i||(e=await Nt("GetCurrentProgramScene"),n(5,i=e.currentProgramSceneName||"")),e=await Nt("GetStudioModeEnabled"),e&&e.studioModeEnabled&&(n(0,s=!0),e=await Nt("GetCurrentPreviewScene"),n(6,a=e.currentPreviewSceneName||"")),e=await Nt("GetSceneTransitionList"),console.log("GetSceneTransitionList",e),n(3,u=e.transitions||[]),o=setInterval(f,1e3)})),d=()=>{clearInterval(o)},_().$$.on_destroy.push(d),_t.on("StudioModeStateChanged",(async e=>{console.log("StudioModeStateChanged",e.studioModeEnabled),n(0,s=e.studioModeEnabled),s&&n(6,a=i)})),_t.on("CurrentPreviewSceneChanged",(async e=>{console.log("CurrentPreviewSceneChanged",e.sceneName),n(6,a=e.sceneName)})),_t.on("CurrentProgramSceneChanged",(async e=>{console.log("CurrentProgramSceneChanged",e.sceneName),n(5,i=e.sceneName)})),_t.on("SceneNameChanged",(async e=>{e.oldSceneName===i&&n(5,i=e.sceneName),e.oldSceneName===a&&n(6,a=e.sceneName)})),_t.on("TransitionListChanged",(async e=>{console.log("TransitionListChanged",e),n(3,u=e.transitions||[])}));return e.$$set=e=>{"imageFormat"in e&&n(4,r=e.imageFormat)},e.$$.update=()=>{96&e.$$.dirty&&f()},[s,c,l,u,r,i,a,function(e){E[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},async e=>{await Nt("SetCurrentSceneTransition",{transitionName:e.transitionName}),await Nt("TriggerStudioModeTransition")},function(e){E[e?"unshift":"push"]((()=>{c=e,n(1,c)}))}]}_t.on("error",(e=>{console.error("Socket error:",e)}));class At extends te{constructor(e){super(),ee(this,e,Pt,It,s,{imageFormat:4})}}function Ot(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[4])||y(t,"src",n),y(t,"alt",e[0]),y(t,"class","thumbnail svelte-xcafbk")},m(e,n){d(e,t,n)},p(e,o){16&o&&!a(t.src,n=e[4])&&y(t,"src",n),1&o&&y(t,"alt",e[0])},d(e){e&&f(t)}}}function Bt(e){let t;return{c(){t=g(e[0])},m(e,n){d(e,t,n)},p(e,n){1&n&&b(t,e[0])},d(e){e&&f(t)}}}function Tt(t){let n,o,r,s,i,a=t[4]&&Ot(t),c="icon"!==t[1]&&Bt(t);return{c(){n=p("button"),a&&a.c(),o=C(),c&&c.c(),y(n,"style",r="icon"===t[1]?t[5]:""),y(n,"title",t[0]),y(n,"class","svelte-xcafbk"),k(n,"title","text"===t[1]),k(n,"program",t[2]),k(n,"preview",t[3]),k(n,"with-icon","icon"===t[1])},m(e,r){d(e,n,r),a&&a.m(n,null),u(n,o),c&&c.m(n,null),s||(i=v(n,"click",t[8]),s=!0)},p(e,[t]){e[4]?a?a.p(e,t):(a=Ot(e),a.c(),a.m(n,o)):a&&(a.d(1),a=null),"icon"!==e[1]?c?c.p(e,t):(c=Bt(e),c.c(),c.m(n,null)):c&&(c.d(1),c=null),34&t&&r!==(r="icon"===e[1]?e[5]:"")&&y(n,"style",r),1&t&&y(n,"title",e[0]),2&t&&k(n,"title","text"===e[1]),4&t&&k(n,"program",e[2]),8&t&&k(n,"preview",e[3]),2&t&&k(n,"with-icon","icon"===e[1])},i:e,o:e,d(e){e&&f(n),a&&a.d(),c&&c.d(),s=!1,i()}}}function Rt(e,t,n){let o,{name:r}=t,{buttonStyle:s="text"}=t,{icon:i="#ffffff"}=t,{isProgram:a=!1}=t,{isPreview:c=!1}=t,{img:l=""}=t;const u=F();return e.$$set=e=>{"name"in e&&n(0,r=e.name),"buttonStyle"in e&&n(1,s=e.buttonStyle),"icon"in e&&n(7,i=e.icon),"isProgram"in e&&n(2,a=e.isProgram),"isPreview"in e&&n(3,c=e.isPreview),"img"in e&&n(4,l=e.img)},e.$$.update=()=>{128&e.$$.dirty&&n(5,o=i.startsWith("#")?`background-color: ${i};`:`background-image: url(${i});`)},[r,s,a,c,l,o,u,i,()=>u("click")]}class jt extends te{constructor(e){super(),ee(this,e,Rt,Tt,s,{name:0,buttonStyle:1,icon:7,isProgram:2,isPreview:3,img:4})}}function zt(e,t,n){const o=e.slice();return o[11]=t[n],o}function Dt(e,t,n){const o=e.slice();return o[11]=t[n],o}function Wt(e){let t,n,o=J(e[6]),r=[];for(let t=0;tU(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e{i[l]=null})),q(),o=i[n],o?o.p(e,c):(o=i[n]=s[n](e),o.c()),Z(o,1),o.m(t,null)),(!r||16&c)&&k(t,"column",e[4]),(!r||8&c)&&k(t,"with-icon","icon"===e[3])},i(e){r||(Z(o),r=!0)},o(e){U(o),r=!1},d(e){e&&f(t),i[n].d()}}}function Jt(e,t,n){let{programScene:o={}}=t,{previewScene:r={}}=t,{scenes:s=[]}=t,{buttonStyle:i="text"}=t,{editable:a=!1}=t,c=[],l=!1;const u=JSON.parse(window.localStorage.getItem("sceneIcons")||"{}");return N((async function(){let e=await Nt("GetSceneList");console.log("GetSceneList",e),n(1,o=e.currentProgramSceneName||""),n(2,r=e.currentPreviewSceneName),n(0,s=e.scenes),e=await Nt("GetStudioModeEnabled"),e&&e.studioModeEnabled&&(l=!0,n(2,r=e.currentPreviewSceneName||""))})),_t.on("StudioModeStateChanged",(async e=>{console.log("StudioModeStateChanged",e.studioModeEnabled),l=e.studioModeEnabled,n(2,r=o)})),_t.on("SceneListChanged",(async e=>{console.log("SceneListChanged",e.scenes.length),n(0,s=e.scenes)})),_t.on("SceneCreated",(async e=>{console.log("SceneCreated",e)})),_t.on("SceneRemoved",(async e=>{console.log("SceneRemoved",e);for(let t=0;t{console.log("SceneNameChanged",e);for(let t=0;t{console.log("CurrentProgramSceneChanged",e),n(1,o=e.sceneName||"")})),_t.on("CurrentPreviewSceneChanged",(async e=>{console.log("CurrentPreviewSceneChanged",e),n(2,r=e.sceneName)})),e.$$set=e=>{"programScene"in e&&n(1,o=e.programScene),"previewScene"in e&&n(2,r=e.previewScene),"scenes"in e&&n(0,s=e.scenes),"buttonStyle"in e&&n(3,i=e.buttonStyle),"editable"in e&&n(4,a=e.editable)},e.$$.update=()=>{1&e.$$.dirty&&n(6,c=s.filter((e=>-1===e.sceneName.indexOf("(hidden)"))).reverse()),32&e.$$.dirty&&window.localStorage.setItem("sceneIcons",JSON.stringify(u))},[s,o,r,i,a,u,c,function(e){return async function(){l?await Nt("SetCurrentPreviewScene",{sceneName:e.sceneName}):await Nt("SetCurrentProgramScene",{sceneName:e.sceneName})}},function(e){Nt("SetSceneName",{sceneName:e.target.title,newSceneName:e.target.value})},function(e){n(5,u[e.target.title]=e.target.value,u)}]}class Yt extends te{constructor(e){super(),ee(this,e,Jt,Ut,s,{programScene:1,previewScene:2,scenes:0,buttonStyle:3,editable:4})}}function Xt(e,t,n){const o=e.slice();return o[11]=t[n],o}function Kt(e){let t,n,o,s;return n=new jt({props:{name:e[11].sourceName,isProgram:e[11].sceneItemEnabled,img:e[11].img,buttonStyle:e[0]}}),n.$on("click",(function(){r(e[2](e[11].sceneItemId))&&e[2](e[11].sceneItemId).apply(this,arguments)})),{c(){t=p("li"),Y(n.$$.fragment),o=C(),y(t,"class","svelte-1mfq7n9")},m(e,r){d(e,t,r),X(n,t,null),u(t,o),s=!0},p(t,o){e=t;const r={};2&o&&(r.name=e[11].sourceName),2&o&&(r.isProgram=e[11].sceneItemEnabled),2&o&&(r.img=e[11].img),1&o&&(r.buttonStyle=e[0]),n.$set(r)},i(e){s||(Z(n.$$.fragment,e),s=!0)},o(e){U(n.$$.fragment,e),s=!1},d(e){e&&f(t),K(n)}}}function Qt(e){let t,n,o,r,s,i,a=J(e[1]),c=[];for(let t=0;tU(c[e],1,1,(()=>{c[e]=null}));return{c(){t=p("ol");for(let e=0;esetTimeout(e,500*Math.random()+100))),t=await Nt("GetSourceScreenshot",{sourceName:e.sourceName,imageFormat:s,width:192,height:108}),t&&t.imageData)return t.imageData}return N((async function(){await u()})),_t.on("SceneItemEnableStateChanged",(async e=>{if(e.sceneName===r){const t=a[e.sceneItemId];n(1,i[t].sceneItemEnabled=e.sceneItemEnabled,i),i[t].sceneItemEnabled&&!i[t].img&&(n(1,i[t].img=await d(i[t]),i),l.has(i[t].sceneItemId)&&(n(1,i[t].img=await d(i[t]),i),await Nt("SetSceneItemEnabled",{sceneName:r,sceneItemId:i[t].sceneItemId,sceneItemEnabled:!1}),l.delete(i[t].sceneItemId)))}})),_t.on("SceneItemListReindexed",(async e=>{e.sceneName===r&&await u()})),_t.on("SceneItemCreated",(async e=>{e.sceneName===r&&await u()})),_t.on("SceneItemRemoved",(async e=>{e.sceneName===r&&await u()})),e.$$set=e=>{"buttonStyle"in e&&n(0,o=e.buttonStyle),"name"in e&&n(4,r=e.name),"imageFormat"in e&&n(5,s=e.imageFormat)},[o,i,function(e){return async function(){await Nt("SetSceneItemEnabled",{sceneName:r,sceneItemId:e,sceneItemEnabled:!0}),c!==e&&await Nt("SetSceneItemEnabled",{sceneName:r,sceneItemId:c,sceneItemEnabled:!1}),c=e}},async function(){for(let e=0;et[3].call(r))),y(n,"class","select"),S(n,"margin","0 .5rem .5rem 0")},m(e,o){d(e,n,o),u(n,r);for(let e=0;e{console.log("CurrentProfileChanged",e.profileName),n(1,r=e.profileName||"")})),_t.on("ProfileListChanged",(async e=>{console.log("ProfileListChanged",e.profiles.length),n(0,o=e.profiles||[])})),[o,r,async function(e){Nt("SetCurrentProfile",{profileName:e.target.value})},function(){r=M(this),n(1,r),n(0,o)}]}class an extends te{constructor(e){super(),ee(this,e,sn,rn,s,{})}}function cn(e,t,n){const o=e.slice();return o[4]=t[n],o}function ln(e){let t,n,o,r=e[4]+"";return{c(){t=p("option"),n=g(r),t.__value=o=e[4],$(t,t.__value)},m(e,o){d(e,t,o),u(t,n)},p(e,s){1&s&&r!==(r=e[4]+"")&&b(n,r),1&s&&o!==(o=e[4])&&(t.__value=o,$(t,t.__value))},d(e){e&&f(t)}}}function un(t){let n,r,s,i,a=J(t[0]),c=[];for(let e=0;et[3].call(r))),y(n,"class","select"),S(n,"margin","0 .5rem .5rem 0")},m(e,o){d(e,n,o),u(n,r);for(let e=0;e{console.log("CurrentSceneCollectionChanged",e.sceneCollectionName),n(1,r=e.sceneCollectionName||""),_t.emit("SceneListChanged",await Nt("GetSceneList"))})),_t.on("SceneCollectionListChanged",(async e=>{console.log("SceneCollectionListChanged",e.sceneCollections.length),n(0,o=e.sceneCollections||[])})),[o,r,async function(e){Nt("SetCurrentSceneCollection",{sceneCollectionName:e.target.value})},function(){r=M(this),n(1,r),n(0,o)}]}class fn extends te{constructor(e){super(),ee(this,e,dn,un,s,{})}}const{document:mn}=l;function pn(e,t,n){const o=e.slice();return o[40]=t[n],o}function hn(t){let n,o,r=(t[13]||"Disconnected")+"";return{c(){n=p("button"),o=g(r),y(n,"class","button is-danger"),n.disabled=!0},m(e,t){d(e,n,t),u(n,o)},p(e,t){8192&t[0]&&r!==(r=(e[13]||"Disconnected")+"")&&b(o,r)},i:e,o:e,d(e){e&&f(n)}}}function gn(e){let t,n,r,s,i,a,c,l,m,h,g,w,b,$,S,L,M,H,x,_,N,F,V,E,I,P,A,O,B,T,R,j,z,D,W,J,Q,ee,te,re,se,fe,me,pe,he,ge,Ce;function we(e,t){return e[3]&&e[3].stats?wn:Cn}let ye=we(e),be=ye(e);const $e=[yn,vn],Se=[];function Le(e,t){return e[3]&&e[3].streaming&&e[3].streaming.outputActive?0:1}r=Le(e),s=Se[r]=$e[r](e);const Me=[$n,bn],ke=[];function He(e,t){return e[3]&&e[3].recording&&e[3].recording.outputActive?0:1}a=He(e),c=ke[a]=Me[a](e);const xe=[kn,Mn],_e=[];function Ne(e,t){return e[6]?0:1}m=Ne(e),h=_e[m]=xe[m](e),$=new ve({props:{path:"M15,13H17V11H15M15,21H17V19H15M15,5H17V3H15M19,9H21V7H19M19,5H21V3H19M19,13H21V11H19M19,21H21V19H19M11,21H13V3H11M19,17H21V15H19M7,5H9V3H7M3,17H5V15H3M3,21H5V19H3M3,13H5V11H3M7,13H9V11H7M7,21H9V19H7M3,5H5V3H3M3,9H5V7H3V9Z"}}),H=new ve({props:{path:"M8,18H11V15H2V13H22V15H13V18H16L12,22L8,18M12,2L8,6H11V9H2V11H22V9H13V6H16L12,2Z"}}),F=new ve({props:{path:e[8]?ae:ie}}),P=new ve({props:{path:e[1]?de:ue}}),T=new ve({props:{path:e[7]?le:ce}});let Fe=e[12]&&Hn(e);W=new ve({props:{path:e[15]?ne:oe}});let Ve=e[12]&&xn(e);return ee=new an({}),re=new fn({}),pe=new ve({props:{path:"M21.4 7.5C22.2 8.3 22.2 9.6 21.4 10.3L18.6 13.1L10.8 5.3L13.6 2.5C14.4 1.7 15.7 1.7 16.4 2.5L18.2 4.3L21.2 1.3L22.6 2.7L19.6 5.7L21.4 7.5M15.6 13.3L14.2 11.9L11.4 14.7L9.3 12.6L12.1 9.8L10.7 8.4L7.9 11.2L6.4 9.8L3.6 12.6C2.8 13.4 2.8 14.7 3.6 15.4L5.4 17.2L1.4 21.2L2.8 22.6L6.8 18.6L8.6 20.4C9.4 21.2 10.7 21.2 11.4 20.4L14.2 17.6L12.8 16.2L15.6 13.3Z"}}),{c(){t=p("button"),be.c(),n=C(),s.c(),i=C(),c.c(),l=C(),h.c(),g=C(),w=p("button"),b=p("span"),Y($.$$.fragment),S=C(),L=p("button"),M=p("span"),Y(H.$$.fragment),x=C(),_=p("button"),N=p("span"),Y(F.$$.fragment),V=C(),E=p("button"),I=p("span"),Y(P.$$.fragment),A=C(),O=p("button"),B=p("span"),Y(T.$$.fragment),R=C(),Fe&&Fe.c(),j=C(),z=p("button"),D=p("span"),Y(W.$$.fragment),J=C(),Ve&&Ve.c(),Q=C(),Y(ee.$$.fragment),te=C(),Y(re.$$.fragment),se=C(),fe=p("button"),me=p("span"),Y(pe.$$.fragment),y(t,"class","button is-info is-light"),t.disabled=!0,y(b,"class","icon"),y(w,"class","button is-link"),y(w,"title","Toggle Studio Mode"),k(w,"is-light",!e[5]),y(M,"class","icon"),y(L,"class","button is-link"),y(L,"title","Show Scene on Top"),k(L,"is-light",!e[0]),y(N,"class","icon"),y(_,"class","button is-link"),y(_,"title","Edit Scenes"),k(_,"is-light",!e[8]),y(I,"class","icon"),y(E,"class","button is-link"),y(E,"title","Show Scenes as Icons"),k(E,"is-light",!e[1]),y(B,"class","icon"),y(O,"class","button is-link"),y(O,"title","Toggle Replay Buffer"),k(O,"is-light",!e[7]),k(O,"is-danger",e[12]),y(D,"class","icon"),y(z,"class","button is-link"),y(z,"title","Save Replay Buffer"),k(z,"is-light",!e[15]),y(me,"class","icon"),y(fe,"class","button is-danger is-light"),y(fe,"title","Disconnect")},m(o,s){d(o,t,s),be.m(t,null),d(o,n,s),Se[r].m(o,s),d(o,i,s),ke[a].m(o,s),d(o,l,s),_e[m].m(o,s),d(o,g,s),d(o,w,s),u(w,b),X($,b,null),d(o,S,s),d(o,L,s),u(L,M),X(H,M,null),d(o,x,s),d(o,_,s),u(_,N),X(F,N,null),d(o,V,s),d(o,E,s),u(E,I),X(P,I,null),d(o,A,s),d(o,O,s),u(O,B),X(T,B,null),u(O,R),Fe&&Fe.m(O,null),d(o,j,s),d(o,z,s),u(z,D),X(W,D,null),u(z,J),Ve&&Ve.m(z,null),d(o,Q,s),X(ee,o,s),d(o,te,s),X(re,o,s),d(o,se,s),d(o,fe,s),u(fe,me),X(pe,me,null),he=!0,ge||(Ce=[v(w,"click",e[18]),v(L,"click",e[21]),v(_,"click",e[32]),v(E,"click",e[33]),v(O,"click",e[19]),v(z,"click",e[34]),v(fe,"click",e[31])],ge=!0)},p(e,n){ye===(ye=we(e))&&be?be.p(e,n):(be.d(1),be=ye(e),be&&(be.c(),be.m(t,null)));let o=r;r=Le(e),r===o?Se[r].p(e,n):(G(),U(Se[o],1,1,(()=>{Se[o]=null})),q(),s=Se[r],s?s.p(e,n):(s=Se[r]=$e[r](e),s.c()),Z(s,1),s.m(i.parentNode,i));let u=a;a=He(e),a===u?ke[a].p(e,n):(G(),U(ke[u],1,1,(()=>{ke[u]=null})),q(),c=ke[a],c?c.p(e,n):(c=ke[a]=Me[a](e),c.c()),Z(c,1),c.m(l.parentNode,l));let d=m;m=Ne(e),m===d?_e[m].p(e,n):(G(),U(_e[d],1,1,(()=>{_e[d]=null})),q(),h=_e[m],h?h.p(e,n):(h=_e[m]=xe[m](e),h.c()),Z(h,1),h.m(g.parentNode,g)),(!he||32&n[0])&&k(w,"is-light",!e[5]),(!he||1&n[0])&&k(L,"is-light",!e[0]);const f={};256&n[0]&&(f.path=e[8]?ae:ie),F.$set(f),(!he||256&n[0])&&k(_,"is-light",!e[8]);const p={};2&n[0]&&(p.path=e[1]?de:ue),P.$set(p),(!he||2&n[0])&&k(E,"is-light",!e[1]);const C={};128&n[0]&&(C.path=e[7]?le:ce),T.$set(C),e[12]?Fe?Fe.p(e,n):(Fe=Hn(e),Fe.c(),Fe.m(O,null)):Fe&&(Fe.d(1),Fe=null),(!he||128&n[0])&&k(O,"is-light",!e[7]),(!he||4096&n[0])&&k(O,"is-danger",e[12]);const v={};32768&n[0]&&(v.path=e[15]?ne:oe),W.$set(v),e[12]?Ve?Ve.p(e,n):(Ve=xn(e),Ve.c(),Ve.m(z,null)):Ve&&(Ve.d(1),Ve=null),(!he||32768&n[0])&&k(z,"is-light",!e[15])},i(e){he||(Z(s),Z(c),Z(h),Z($.$$.fragment,e),Z(H.$$.fragment,e),Z(F.$$.fragment,e),Z(P.$$.fragment,e),Z(T.$$.fragment,e),Z(W.$$.fragment,e),Z(ee.$$.fragment,e),Z(re.$$.fragment,e),Z(pe.$$.fragment,e),he=!0)},o(e){U(s),U(c),U(h),U($.$$.fragment,e),U(H.$$.fragment,e),U(F.$$.fragment,e),U(P.$$.fragment,e),U(T.$$.fragment,e),U(W.$$.fragment,e),U(ee.$$.fragment,e),U(re.$$.fragment,e),U(pe.$$.fragment,e),he=!1},d(e){e&&(f(t),f(n),f(i),f(l),f(g),f(w),f(S),f(L),f(x),f(_),f(V),f(E),f(A),f(O),f(j),f(z),f(Q),f(te),f(se),f(fe)),be.d(),Se[r].d(e),ke[a].d(e),_e[m].d(e),K($),K(H),K(F),K(P),K(T),Fe&&Fe.d(),K(W),Ve&&Ve.d(),K(ee,e),K(re,e),K(pe),ge=!1,o(Ce)}}}function Cn(t){let n;return{c(){n=g("Connected")},m(e,t){d(e,n,t)},p:e,d(e){e&&f(n)}}}function wn(e){let t,n,o,r,s,i,a=Math.round(e[3].stats.activeFps)+"",c=Math.round(e[3].stats.cpuUsage)+"",l=e[3].stats.renderSkippedFrames+"";return{c(){t=g(a),n=g(" fps, "),o=g(c),r=g("% CPU, "),s=g(l),i=g(" skipped frames")},m(e,a){d(e,t,a),d(e,n,a),d(e,o,a),d(e,r,a),d(e,s,a),d(e,i,a)},p(e,n){8&n[0]&&a!==(a=Math.round(e[3].stats.activeFps)+"")&&b(t,a),8&n[0]&&c!==(c=Math.round(e[3].stats.cpuUsage)+"")&&b(o,c),8&n[0]&&l!==(l=e[3].stats.renderSkippedFrames+"")&&b(s,l)},d(e){e&&(f(t),f(n),f(o),f(r),f(s),f(i))}}}function vn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M4.93,4.93C3.12,6.74 2,9.24 2,12C2,14.76 3.12,17.26 4.93,19.07L6.34,17.66C4.89,16.22 4,14.22 4,12C4,9.79 4.89,7.78 6.34,6.34L4.93,4.93M19.07,4.93L17.66,6.34C19.11,7.78 20,9.79 20,12C20,14.22 19.11,16.22 17.66,17.66L19.07,19.07C20.88,17.26 22,14.76 22,12C22,9.24 20.88,6.74 19.07,4.93M7.76,7.76C6.67,8.85 6,10.35 6,12C6,13.65 6.67,15.15 7.76,16.24L9.17,14.83C8.45,14.11 8,13.11 8,12C8,10.89 8.45,9.89 9.17,9.17L7.76,7.76M16.24,7.76L14.83,9.17C15.55,9.89 16,10.89 16,12C16,13.11 15.55,14.11 14.83,14.83L16.24,16.24C17.33,15.15 18,13.65 18,12C18,10.35 17.33,8.85 16.24,7.76M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger is-light"),y(n,"title","Start Stream")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[22]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function yn(e){let t,n,o,r,s,i,a,c,l,m=On(e[3].streaming.outputDuration)+"";return o=new ve({props:{path:"M20.84 22.73L12.1 14C12.06 14 12.03 14 12 14C10.9 14 10 13.11 10 12C10 11.97 10 11.94 10 11.9L8.4 10.29C8.15 10.81 8 11.38 8 12C8 13.11 8.45 14.11 9.17 14.83L7.76 16.24C6.67 15.15 6 13.65 6 12C6 10.83 6.34 9.74 6.93 8.82L5.5 7.37C4.55 8.67 4 10.27 4 12C4 14.22 4.89 16.22 6.34 17.66L4.93 19.07C3.12 17.26 2 14.76 2 12C2 9.72 2.77 7.63 4.06 5.95L1.11 3L2.39 1.73L22.11 21.46L20.84 22.73M15.93 12.73L17.53 14.33C17.83 13.61 18 12.83 18 12C18 10.35 17.33 8.85 16.24 7.76L14.83 9.17C15.55 9.89 16 10.89 16 12C16 12.25 15.97 12.5 15.93 12.73M19.03 15.83L20.5 17.28C21.44 15.75 22 13.94 22 12C22 9.24 20.88 6.74 19.07 4.93L17.66 6.34C19.11 7.78 20 9.79 20 12C20 13.39 19.65 14.7 19.03 15.83Z"}}),{c(){t=p("button"),n=p("span"),Y(o.$$.fragment),r=C(),s=p("span"),i=g(m),y(n,"class","icon"),y(t,"class","button is-danger"),y(t,"title","Stop Stream")},m(f,m){d(f,t,m),u(t,n),X(o,n,null),u(t,r),u(t,s),u(s,i),a=!0,c||(l=v(t,"click",e[23]),c=!0)},p(e,t){(!a||8&t[0])&&m!==(m=On(e[3].streaming.outputDuration)+"")&&b(i,m)},i(e){a||(Z(o.$$.fragment,e),a=!0)},o(e){U(o.$$.fragment,e),a=!1},d(e){e&&f(t),K(o),c=!1,l()}}}function bn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M19,12C19,15.86 15.86,19 12,19C8.14,19 5,15.86 5,12C5,8.14 8.14,5 12,5C15.86,5 19,8.14 19,12Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger is-light"),y(n,"title","Start Recording")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[24]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function $n(e){let t,n,o,r,s,i,a,c,l,m,h,w,$=On(e[3].recording.outputDuration)+"";const S=[Ln,Sn],L=[];function M(e,t){return e[3].recording.outputPaused?0:1}return t=M(e),n=L[t]=S[t](e),i=new ve({props:{path:"M18,18H6V6H18V18Z"}}),{c(){n.c(),o=C(),r=p("button"),s=p("span"),Y(i.$$.fragment),a=C(),c=p("span"),l=g($),y(s,"class","icon"),y(r,"class","button is-danger"),y(r,"title","Stop Recording")},m(n,f){L[t].m(n,f),d(n,o,f),d(n,r,f),u(r,s),X(i,s,null),u(r,a),u(r,c),u(c,l),m=!0,h||(w=v(r,"click",e[25]),h=!0)},p(e,r){let s=t;t=M(e),t===s?L[t].p(e,r):(G(),U(L[s],1,1,(()=>{L[s]=null})),q(),n=L[t],n?n.p(e,r):(n=L[t]=S[t](e),n.c()),Z(n,1),n.m(o.parentNode,o)),(!m||8&r[0])&&$!==($=On(e[3].recording.outputDuration)+"")&&b(l,$)},i(e){m||(Z(n),Z(i.$$.fragment,e),m=!0)},o(e){U(n),U(i.$$.fragment,e),m=!1},d(e){e&&(f(o),f(r)),L[t].d(e),K(i),h=!1,w()}}}function Sn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M14,19H18V5H14M6,19H10V5H6V19Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-success"),y(n,"title","Pause Recording")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[28]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function Ln(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger"),y(n,"title","Resume Recording")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[29]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function Mn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger is-light"),y(n,"title","Start Virtual Webcam")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[26]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function kn(t){let n,o,r,s,i,a;return r=new ve({props:{path:"M1.2,4.47L2.5,3.2L20,20.72L18.73,22L16.73,20H4A2,2 0 0,1 2,18V6C2,5.78 2.04,5.57 2.1,5.37L1.2,4.47M7,4L9,2H15L17,4H20A2,2 0 0,1 22,6V18C22,18.6 21.74,19.13 21.32,19.5L16.33,14.5C16.76,13.77 17,12.91 17,12A5,5 0 0,0 12,7C11.09,7 10.23,7.24 9.5,7.67L5.82,4H7M7,12A5,5 0 0,0 12,17C12.5,17 13.03,16.92 13.5,16.77L11.72,15C10.29,14.85 9.15,13.71 9,12.28L7.23,10.5C7.08,10.97 7,11.5 7,12M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9Z"}}),{c(){n=p("button"),o=p("span"),Y(r.$$.fragment),y(o,"class","icon"),y(n,"class","button is-danger"),y(n,"title","Stop Virtual Webcam")},m(e,c){d(e,n,c),u(n,o),X(r,o,null),s=!0,i||(a=v(n,"click",t[27]),i=!0)},p:e,i(e){s||(Z(r.$$.fragment,e),s=!0)},o(e){U(r.$$.fragment,e),s=!1},d(e){e&&f(n),K(r),i=!1,a()}}}function Hn(e){let t,n;return{c(){t=p("span"),n=g(e[12])},m(e,o){d(e,t,o),u(t,n)},p(e,t){4096&t[0]&&b(n,e[12])},d(e){e&&f(t)}}}function xn(e){let t,n;return{c(){t=p("span"),n=g(e[12])},m(e,o){d(e,t,o),u(t,n)},p(e,t){4096&t[0]&&b(n,e[12])},d(e){e&&f(t)}}}function _n(t){let n,r,s,i,a,c,l,m,h,w,b,S,L,M,k,H,x,_,N,F,V,E,I,P,A,O,B,T="https:"===document.location.protocol&&function(){let t,n,o,r,s,i,a,c,l,m,h,C;return{c(){t=p("div"),n=g("You are checking this page on a secure HTTPS connection. That's great,\n but it means you can\n "),o=p("strong"),o.textContent="only",r=g("\n connect to WSS (secure websocket) addresses, for example OBS exposed with\n "),s=p("a"),s.textContent="ngrok",i=g("\n or\n "),a=p("a"),a.textContent="pagekite",c=g("\n . If you want to connect to a local OBS instance,\n "),l=p("strong"),m=p("a"),h=g("please click here to load the non-secure version of this page"),C=g("\n ."),y(s,"href","https://ngrok.com/"),y(a,"href","https://pagekite.net/"),y(m,"href","http://"+document.location.hostname+(document.location.port?":"+document.location.port:"")+document.location.pathname),y(t,"class","notification is-danger")},m(e,f){d(e,t,f),u(t,n),u(t,o),u(t,r),u(t,s),u(t,i),u(t,a),u(t,c),u(t,l),u(l,m),u(m,h),u(t,C)},p:e,d(e){e&&f(t)}}}();return{c(){n=p("h1"),n.innerHTML='Welcome to\n OBS-web\n - the easiest way to control\n OBS\n remotely!',r=C(),T&&T.c(),s=C(),i=p("p"),i.textContent='To get started, enter your OBS host:port below and click "connect".',a=C(),c=p("form"),l=p("div"),m=p("p"),h=p("input"),w=C(),b=p("input"),S=C(),L=p("p"),L.innerHTML='',M=C(),k=p("p"),H=g("Make sure that you use "),x=p("a"),x.textContent="OBS v28+",_=g("\n or install the\n "),N=p("a"),F=g("obs-websocket "),V=g(An),E=g(" plugin"),I=g("\n for v27. If you use an older version of OBS, see the\n "),P=p("a"),P.textContent="archived OBS-web v4",A=g(" page."),y(n,"class","subtitle"),y(h,"id","host"),y(h,"class","input"),y(h,"type","text"),y(h,"autocomplete",""),y(h,"placeholder","ws://localhost:4455"),y(b,"id","password"),y(b,"class","input"),y(b,"type","password"),y(b,"autocomplete","current-password"),y(b,"placeholder","password (leave empty if you have disabled authentication)"),y(m,"class","control is-expanded"),y(L,"class","control"),y(l,"class","field is-grouped"),y(x,"href","https://github.com/obsproject/obs-studio/releases"),y(N,"href","https://github.com/obsproject/obs-websocket/releases/tag/"+An),y(N,"target","_blank"),y(N,"rel","noreferrer"),y(P,"href","/v4/"),y(k,"class","help")},m(e,o){var f;d(e,n,o),d(e,r,o),T&&T.m(e,o),d(e,s,o),d(e,i,o),d(e,a,o),d(e,c,o),u(c,l),u(l,m),u(m,h),$(h,t[9]),u(m,w),u(m,b),$(b,t[10]),u(l,S),u(l,L),d(e,M,o),d(e,k,o),u(k,H),u(k,x),u(k,_),u(k,N),u(N,F),u(N,V),u(N,E),u(k,I),u(k,P),u(k,A),O||(B=[v(h,"input",t[36]),v(b,"input",t[37]),v(c,"submit",(f=t[30],function(e){return e.preventDefault(),f.call(this,e)}))],O=!0)},p(e,t){"https:"===document.location.protocol&&T.p(e,t),512&t[0]&&h.value!==e[9]&&$(h,e[9]),1024&t[0]&&b.value!==e[10]&&$(b,e[10])},i:e,o:e,d(e){e&&(f(n),f(r),f(s),f(i),f(a),f(c),f(M),f(k)),T&&T.d(e),O=!1,o(B)}}}function Nn(e){let t,n,o,r,s,i,a,c=e[0]&&Fn(e);function l(t){e[35](t)}let u={buttonStyle:e[1]?"icon":"text",editable:e[8]};void 0!==e[11]&&(u.scenes=e[11]),n=new Yt({props:u}),E.push((()=>function(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}(n,"scenes",l)));let p=!e[0]&&Vn(e),h=J(e[11]),g=[];for(let t=0;tU(g[e],1,1,(()=>{g[e]=null}));return{c(){c&&c.c(),t=C(),Y(n.$$.fragment),r=C(),p&&p.c(),s=C();for(let e=0;e{c=null})),q());const a={};var l;if(2&r[0]&&(a.buttonStyle=e[1]?"icon":"text"),256&r[0]&&(a.editable=e[8]),!o&&2048&r[0]&&(o=!0,a.scenes=e[11],l=()=>o=!1,P.push(l)),n.$set(a),e[0]?p&&(G(),U(p,1,1,(()=>{p=null})),q()):p?(p.p(e,r),1&r[0]&&Z(p,1)):(p=Vn(e),p.c(),Z(p,1),p.m(s.parentNode,s)),18432&r[0]){let t;for(h=J(e[11]),t=0;t0,r=o&&En(e);return{c(){r&&r.c(),t=w()},m(e,o){r&&r.m(e,o),d(e,t,o),n=!0},p(e,n){2048&n[0]&&(o=e[40].sceneName.indexOf("(switch)")>0),o?r?(r.p(e,n),2048&n[0]&&Z(r,1)):(r=En(e),r.c(),Z(r,1),r.m(t.parentNode,t)):r&&(G(),U(r,1,1,(()=>{r=null})),q())},i(e){n||(Z(r),n=!0)},o(e){U(r),n=!1},d(e){e&&f(t),r&&r.d(e)}}}function Pn(e){let t,n,o,r,s,i,a,c,l,m,h,g,w,b,$,S,L,M,H,x,_,N,F,V;const E=[gn,hn],I=[];function P(e,t){return e[2]?0:1}l=P(e),m=I[l]=E[l](e),b=new ve({props:{path:e[4]?se:re}});const A=[Nn,_n],O=[];function B(e,t){return e[2]?0:1}return M=B(e),H=O[M]=A[M](e),{c(){t=C(),n=p("nav"),o=p("div"),o.innerHTML='OBS-web ',r=C(),s=p("div"),i=p("div"),a=p("div"),c=p("div"),m.c(),h=C(),g=p("button"),w=p("span"),Y(b.$$.fragment),$=C(),S=p("section"),L=p("div"),H.c(),x=C(),_=p("footer"),_.innerHTML='

OBS-web\n by\n Niek van der Maas\n — see\n GitHub\n for source code.

',mn.title="OBS-web remote control",y(o,"class","navbar-brand"),y(w,"class","icon"),y(g,"class","button is-link"),y(g,"title","Toggle Fullscreen"),k(g,"is-light",!e[4]),y(c,"class","buttons"),y(a,"class","navbar-item"),y(i,"class","navbar-end"),y(s,"id","navmenu"),y(s,"class","navbar-menu"),y(n,"class","navbar is-primary"),y(n,"aria-label","main navigation"),y(L,"class","container"),y(S,"class","section"),y(_,"class","footer")},m(f,m){d(f,t,m),d(f,n,m),u(n,o),u(n,r),u(n,s),u(s,i),u(i,a),u(a,c),I[l].m(c,null),u(c,h),u(c,g),u(g,w),X(b,w,null),d(f,$,m),d(f,S,m),u(S,L),O[M].m(L,null),d(f,x,m),d(f,_,m),N=!0,F||(V=v(g,"click",e[17]),F=!0)},p(e,t){let n=l;l=P(e),l===n?I[l].p(e,t):(G(),U(I[n],1,1,(()=>{I[n]=null})),q(),m=I[l],m?m.p(e,t):(m=I[l]=E[l](e),m.c()),Z(m,1),m.m(c,h));const o={};16&t[0]&&(o.path=e[4]?se:re),b.$set(o),(!N||16&t[0])&&k(g,"is-light",!e[4]);let r=M;M=B(e),M===r?O[M].p(e,t):(G(),U(O[r],1,1,(()=>{O[r]=null})),q(),H=O[M],H?H.p(e,t):(H=O[M]=A[M](e),H.c()),Z(H,1),H.m(L,null))},i(e){N||(Z(m),Z(b.$$.fragment,e),Z(H),N=!0)},o(e){U(m),U(b.$$.fragment,e),U(H),N=!1},d(e){e&&(f(t),f(n),f($),f(S),f(x),f(_)),I[l].d(),K(b),O[M].d(),F=!1,V()}}}const An="5.0.1";function On(e){e=Math.round(e/1e3);const t=Math.floor(e/3600);e-=3600*t;const n=Math.floor(e/60);return e-=60*n,t>0?`${t}:${n<10?"0":""}${n}:${e<10?"0":""}${e}`:`${n<10?"0":""}${n}:${e<10?"0":""}${e}`}function Bn(e,t,n){let o;N((async()=>{if("serviceWorker"in navigator&&navigator.serviceWorker.register("/service-worker.js"),"wakeLock"in navigator)try{await navigator.wakeLock.request("screen"),document.addEventListener("visibilitychange",(async()=>{"visible"===document.visibilityState&&await navigator.wakeLock.request("screen")}))}catch(e){}const e=document.querySelector(".navbar-burger");e.addEventListener("click",(()=>{e.classList.toggle("is-active"),document.getElementById(e.dataset.target).classList.toggle("is-active")})),document.addEventListener("fullscreenchange",(()=>{n(4,s=document.fullscreenElement)})),document.addEventListener("webkitfullscreenchange",(()=>{n(4,s=document.webkitFullscreenElement)})),document.addEventListener("msfullscreenchange",(()=>{n(4,s=document.msFullscreenElement)})),""!==document.location.hash&&(n(9,l=document.location.hash.slice(1)),l.includes("#")&&n(9,[l,u]=l.split("#"),l,n(10,u)),await S()),window.sendCommand=Nt}));let r,s,i,a,c,l,u,d={},f=window.localStorage.getItem("isSceneOnTop")||!1,m=window.localStorage.getItem("isIconMode")||!1,p=!1,h=[],g="",C="",w="jpg",v=!1,y=!1;function b(e){n(12,g=e),setTimeout((()=>{n(12,g="")}),5e3)}async function $(){const e=await Nt("GetReplayBufferStatus");console.debug("GetReplayBufferStatus",e.outputActive),e.outputActive?(await Nt("SaveReplayBuffer"),n(16,y=!0),n(15,v=!0),setTimeout((()=>{n(15,v=!1),n(16,y=!1)}),2500)):b("Replay buffer is not enabled.")}async function S(){if(n(9,l=l||"ws://localhost:4455"),-1===l.indexOf("://")){const e="https:"===location.protocol||l.endsWith(":443");n(9,l=e?"wss://":"ws://"+l)}console.log("Connecting to:",l,"- using password:",u),await L();try{const{obsWebSocketVersion:e,negotiatedRpcVersion:t}=await _t.connect(l,u);console.log(`Connected to obs-websocket version ${e} (using RPC ${t})`)}catch(e){console.log(e),n(13,C=e.message)}}async function L(){await _t.disconnect(),clearInterval(r),n(2,o=!1),n(13,C="Disconnected")}_t.on("ConnectionClosed",(()=>{n(2,o=!1),window.history.pushState("",document.title,window.location.pathname+window.location.search),console.log("Connection closed")})),_t.on("Identified",(async()=>{console.log("Connected"),n(2,o=!0),document.location.hash=l;const e=await Nt("GetVersion"),t=e.obsWebSocketVersion||"";console.log("OBS-websocket version:",t),((e,t)=>{const n=be(e),o=be(t),r=n.pop(),s=o.pop(),i=Me(n,o);return 0!==i?i:r&&s?Me(r.split("."),s.split(".")):r||s?r?-1:1:0})(t,An)<0&&alert("You are running an outdated OBS-websocket (version "+t+"), please upgrade to the latest version for full compatibility."),e.supportedImageFormats.includes("webp")&&0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")&&n(14,w="webp"),r=setInterval((async()=>{const e=await Nt("GetStats"),t=await Nt("GetStreamStatus"),o=await Nt("GetRecordStatus");n(3,d={stats:e,streaming:t,recording:o})}),1e3),n(5,i=(await Nt("GetStudioModeEnabled")).studioModeEnabled||!1),n(6,a=(await Nt("GetVirtualCamStatus")).outputActive||!1)})),_t.on("ConnectionError",(async()=>{n(13,C="Please enter your password:"),document.getElementById("password").focus(),u?await S():n(2,o=!1)})),_t.on("VirtualcamStateChanged",(async e=>{console.log("VirtualcamStateChanged",e.outputActive),n(6,a=e&&e.outputActive)})),_t.on("StudioModeStateChanged",(async e=>{console.log("StudioModeStateChanged",e.studioModeEnabled),n(5,i=e&&e.studioModeEnabled)})),_t.on("ReplayBufferStateChanged",(async e=>{console.log("ReplayBufferStateChanged",e),n(7,c=e&&e.outputActive)}));return e.$$.update=()=>{1&e.$$.dirty[0]&&(f?window.localStorage.setItem("isSceneOnTop","true"):window.localStorage.removeItem("isSceneOnTop")),2&e.$$.dirty[0]&&(m?window.localStorage.setItem("isIconMode","true"):window.localStorage.removeItem("isIconMode"))},[f,m,o,d,s,i,a,c,p,l,u,h,g,C,w,v,y,function(){s?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.webkitRequestFullscreen?document.documentElement.webkitRequestFullscreen():document.documentElement.msRequestFullscreen&&document.documentElement.msRequestFullscreen()},async function(){await Nt("SetStudioModeEnabled",{studioModeEnabled:!i})},async function(){const e=await Nt("ToggleReplayBuffer");console.debug("ToggleReplayBuffer",e.outputActive),void 0===e.outputActive?b("Replay buffer is not enabled."):n(7,c=e.outputActive)},$,async function(){n(0,f=!f)},async function(){await Nt("StartStream")},async function(){await Nt("StopStream")},async function(){await Nt("StartRecord")},async function(){await Nt("StopRecord")},async function(){await Nt("StartVirtualCam")},async function(){await Nt("StopVirtualCam")},async function(){await Nt("PauseRecord")},async function(){await Nt("ResumeRecord")},S,L,()=>n(8,p=!p),()=>n(1,m=!m),()=>{y||$(),n(16,y=!y)},function(e){h=e,n(11,h)},function(){l=this.value,n(9,l)},function(){u=this.value,n(10,u)}]}return new class extends te{constructor(e){super(),ee(this,e,Bn,Pn,s,{},null,[-1,-1])}}({target:document.body})}(); diff --git a/index.html b/index.html index 06a0bf2..52c7989 100644 --- a/index.html +++ b/index.html @@ -8,9 +8,9 @@ OBS-web - + - +