UNPKG

iobroker.zwave2

Version:
7 lines (6 loc) 37 kB
import{B as Ee,Fa as Ae,Ga as dr,J as $,Ja as J,W as de,a as z,b as M,c as L,e as V,f as G,g as lr,j as ur,oa as cr,u as Oe,ua as We,va as Le}from"./chunk-QC74SDCH.js";var fr=z((Q,ke)=>{(function(t,e){typeof Q=="object"&&typeof ke!="undefined"?e(Q,L()):typeof define=="function"&&define.amd?define(["exports","react"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t.ReactErrorBoundary={},t.React))})(Q,function(t,e){"use strict";function r(m){if(m&&m.__esModule)return m;var w=Object.create(null);return m&&Object.keys(m).forEach(function(g){if(g!=="default"){var p=Object.getOwnPropertyDescriptor(m,g);Object.defineProperty(w,g,p.get?p:{enumerable:!0,get:function(){return m[g]}})}}),w.default=m,Object.freeze(w)}var n=r(e);function o(m,w){return o=Object.setPrototypeOf||function(p,i){return p.__proto__=i,p},o(m,w)}function s(m,w){m.prototype=Object.create(w.prototype),m.prototype.constructor=m,o(m,w)}var d=function(w,g){return w===void 0&&(w=[]),g===void 0&&(g=[]),w.length!==g.length||w.some(function(p,i){return!Object.is(p,g[i])})},u={error:null},v=function(m){s(w,m);function w(){for(var p,i=arguments.length,c=new Array(i),h=0;h<i;h++)c[h]=arguments[h];return p=m.call.apply(m,[this].concat(c))||this,p.state=u,p.resetErrorBoundary=function(){for(var y,S=arguments.length,a=new Array(S),l=0;l<S;l++)a[l]=arguments[l];p.props.onReset==null||(y=p.props).onReset.apply(y,a),p.reset()},p}w.getDerivedStateFromError=function(i){return{error:i}};var g=w.prototype;return g.reset=function(){this.setState(u)},g.componentDidCatch=function(i,c){var h,y;(h=(y=this.props).onError)==null||h.call(y,i,c)},g.componentDidUpdate=function(i,c){var h=this.state.error,y=this.props.resetKeys;if(h!==null&&c.error!==null&&d(i.resetKeys,y)){var S,a;(S=(a=this.props).onResetKeysChange)==null||S.call(a,i.resetKeys,y),this.reset()}},g.render=function(){var i=this.state.error,c=this.props,h=c.fallbackRender,y=c.FallbackComponent,S=c.fallback;if(i!==null){var a={error:i,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(S))return S;if(typeof h=="function")return h(a);if(y)return n.createElement(y,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},w}(n.Component);function b(m,w){var g=function(c){return n.createElement(v,w,n.createElement(m,c))},p=m.displayName||m.name||"Unknown";return g.displayName="withErrorBoundary("+p+")",g}function C(m){var w=n.useState(null),g=w[0],p=w[1];if(m!=null)throw m;if(g!=null)throw g;return p}t.ErrorBoundary=v,t.useErrorHandler=C,t.withErrorBoundary=b,Object.defineProperty(t,"__esModule",{value:!0})})});var Ne=z(ee=>{"use strict";var hr=V(),mr=G();Object.defineProperty(ee,"__esModule",{value:!0});ee.default=void 0;var gr=mr(L()),pr=hr($()),vr=(0,pr.default)(gr.createElement("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"}),"CloudDownload");ee.default=vr});var Fe=z(te=>{"use strict";var wr=V(),br=G();Object.defineProperty(te,"__esModule",{value:!0});te.default=void 0;var yr=br(L()),Sr=wr($()),Ir=(0,Sr.default)(yr.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");te.default=Ir});var Pe=z(re=>{"use strict";var _r=V(),Cr=G();Object.defineProperty(re,"__esModule",{value:!0});re.default=void 0;var xr=Cr(L()),Tr=_r($()),zr=(0,Tr.default)(xr.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");re.default=zr});var De=z(ne=>{"use strict";var Rr=V(),Mr=G();Object.defineProperty(ne,"__esModule",{value:!0});ne.default=void 0;var Or=Mr(L()),Er=Rr($()),Wr=(0,Er.default)(Or.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}),"Pause");ne.default=Wr});var He=z(ie=>{"use strict";var Lr=V(),Ar=G();Object.defineProperty(ie,"__esModule",{value:!0});ie.default=void 0;var kr=Ar(L()),Nr=Lr($()),Fr=(0,Nr.default)(kr.createElement("path",{d:"M8 5v14l11-7z"}),"PlayArrow");ie.default=Fr});var Ke=z((ci,$e)=>{"use strict";var Ue=function(){function t(e,r){var n=[],o=!0,s=!1,d=void 0;try{for(var u=e[Symbol.iterator](),v;!(o=(v=u.next()).done)&&(n.push(v.value),!(r&&n.length===r));o=!0);}catch(b){s=!0,d=b}finally{try{!o&&u.return&&u.return()}finally{if(s)throw d}}return n}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ge=function(){function t(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function F(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}else return Array.from(t)}function pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var P=Object,fe=["black","red","green","yellow","blue","magenta","cyan","lightGray","","default"],he=["darkGray","lightRed","lightGreen","lightYellow","lightBlue","lightMagenta","lightCyan","white",""],me=["","bright","dim","italic","underline","","","inverse"],Pr={red:"lightRed",green:"lightGreen",yellow:"lightYellow",blue:"lightBlue",magenta:"lightMagenta",cyan:"lightCyan",black:"darkGray",lightGray:"white"},Dr={0:"style",2:"unstyle",3:"color",9:"colorLight",4:"bgColor",10:"bgColorLight"},Hr={color:fe,colorLight:he,bgColor:fe,bgColorLight:he,style:me,unstyle:me},Ve=function(e){for(var r in e)e[r]||delete e[r];return P.keys(e).length===0?void 0:e},oe=function(){function t(e,r,n){pe(this,t),this.background=e,this.name=r,this.brightness=n}return ge(t,[{key:"defaultBrightness",value:function(r){return new t(this.background,this.name,this.brightness||r)}},{key:"css",value:function(r){var n=r?this.inverse:this,o=n.brightness===R.bright&&Pr[n.name]||n.name,s=n.background?"background:":"color:",d=K.rgb[o],u=this.brightness===R.dim?.5:1;return d?s+"rgba("+[].concat(F(d),[u]).join(",")+");":!n.background&&u<1?"color:rgba(0,0,0,0.5);":""}},{key:"inverse",get:function(){return new t(!this.background,this.name||(this.background?"black":"white"),this.brightness)}},{key:"clean",get:function(){return Ve({name:this.name==="default"?"":this.name,bright:this.brightness===R.bright,dim:this.brightness===R.dim})}}]),t}(),R=function(){function t(e){pe(this,t),e!==void 0&&(this.value=Number(e))}return ge(t,[{key:"type",get:function(){return Dr[Math.floor(this.value/10)]}},{key:"subtype",get:function(){return Hr[this.type][this.value%10]}},{key:"str",get:function(){return this.value?"\x1B["+this.value+"m":""}},{key:"isBrightness",get:function(){return this.value===t.noBrightness||this.value===t.bright||this.value===t.dim}}],[{key:"str",value:function(r){return new t(r).str}}]),t}();P.assign(R,{reset:0,bright:1,dim:2,inverse:7,noBrightness:22,noItalic:23,noUnderline:24,noInverse:27,noColor:39,noBgColor:49});var Br=function(e,r,n){return e.split(r).join(n)},qr=function(e){return e.replace(/(\u001b\[(1|2)m)/g,"\x1B[22m$1")},jr=function(e){return e.replace(/\u001b\[22m(\u001b\[(1|2)m)/g,"$1")},Ur=function(e,r,n){var o=R.str(r),s=R.str(n);return String(e).split(` `).map(function(d){return qr(o+Br(jr(d),s,o)+s)}).join(` `)},Be=function(e,r){return e+r.charAt(0).toUpperCase()+r.slice(1)},Ge=function(){return[].concat(F(fe.map(function(t,e){return t?[[t,30+e,R.noColor],[Be("bg",t),40+e,R.noBgColor]]:[]})),F(he.map(function(t,e){return t?[[t,90+e,R.noColor],[Be("bg",t),100+e,R.noBgColor]]:[]})),F(["","BrightRed","BrightGreen","BrightYellow","BrightBlue","BrightMagenta","BrightCyan"].map(function(t,e){return t?[["bg"+t,100+e,R.noBgColor]]:[]})),F(me.map(function(t,e){return t?[[t,e,t==="bright"||t==="dim"?R.noBrightness:20+e]]:[]}))).reduce(function(t,e){return t.concat(e)})}(),Vr=function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return Ge.reduce(function(n,o){var s=Ue(o,3),d=s[0],u=s[1],v=s[2];return P.defineProperty(n,d,{get:function(){return t(function(C){return r(Ur(C,u,v))})}})},e)},N=0,qe=1,je=2;function Gr(t){for(var e=N,r="",n="",o="",s=[],d=[],u=0,v=t.length;u<v;u++){var b=t[u];switch(r+=b,e){case N:b==="\x1B"?(e=qe,r=b):n+=b;break;case qe:b==="["?(e=je,o="",s=[]):(e=N,n+=r);break;case je:if(b>="0"&&b<="9")o+=b;else if(b===";")s.push(new R(o)),o="";else if(b==="m"){o=o||"0",s.push(new R(o));var C=!0,m=!1,w=void 0;try{for(var g=s[Symbol.iterator](),p;!(C=(p=g.next()).done);C=!0){var i=p.value;d.push({text:n,code:i}),n=""}}catch(c){m=!0,w=c}finally{try{!C&&g.return&&g.return()}finally{if(m)throw w}}e=N}else e=N,n+=r}}return e!==N&&(n+=r),n&&d.push({text:n,code:new R}),d}var K=function(){function t(e){pe(this,t),this.spans=e?Gr(e):[]}return ge(t,[{key:Symbol.iterator,value:function(){return this.spans[Symbol.iterator]()}},{key:"str",get:function(){return this.spans.reduce(function(r,n){return r+n.text+n.code.str},"")}},{key:"parsed",get:function(){var r=void 0,n=void 0,o=void 0,s=void 0;function d(){r=new oe,n=new oe(!0),o=void 0,s=new Set}return d(),P.assign(new t,{spans:this.spans.map(function(u){var v=u.code,b=s.has("inverse"),C=s.has("underline")?"text-decoration: underline;":"",m=s.has("italic")?"font-style: italic;":"",w=o===R.bright?"font-weight: bold;":"",g=r.defaultBrightness(o),p=P.assign({css:w+m+C+g.css(b)+n.css(b)},Ve({bold:!!w,color:g.clean,bgColor:n.clean}),u),i=!0,c=!1,h=void 0;try{for(var y=s[Symbol.iterator](),S;!(i=(S=y.next()).done);i=!0){var a=S.value;p[a]=!0}}catch(l){c=!0,h=l}finally{try{!i&&y.return&&y.return()}finally{if(c)throw h}}if(v.isBrightness)o=v.value;else if(u.code.value!==void 0)if(u.code.value===R.reset)d();else switch(u.code.type){case"color":case"colorLight":r=new oe(!1,v.subtype);break;case"bgColor":case"bgColorLight":n=new oe(!0,v.subtype);break;case"style":s.add(v.subtype);break;case"unstyle":s.delete(v.subtype);break}return p}).filter(function(u){return u.text.length>0})})}},{key:"asChromeConsoleLogArguments",get:function(){var r=this.parsed.spans;return[r.map(function(n){return"%c"+n.text}).join("")].concat(F(r.map(function(n){return n.css})))}},{key:"browserConsoleArguments",get:function(){return this.asChromeConsoleLogArguments}}],[{key:"parse",value:function(r){return new t(r).parsed}},{key:"strip",value:function(r){return r.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")}},{key:"isEscaped",value:function(r){return r=String(r),t.strip(r)!==r}},{key:"nice",get:function(){return t.names.forEach(function(r){r in String.prototype||P.defineProperty(String.prototype,r,{get:function(){return t[r](this)}})}),t}},{key:"ansicolor",get:function(){return t}}]),t}();Vr(K,function(t){return t});K.names=Ge.map(function(t){var e=Ue(t,1),r=e[0];return r});K.rgb={black:[0,0,0],darkGray:[100,100,100],lightGray:[200,200,200],white:[255,255,255],red:[204,0,0],lightRed:[255,51,0],green:[0,204,0],lightGreen:[51,204,51],yellow:[204,102,0],lightYellow:[255,153,51],blue:[0,0,255],lightBlue:[26,140,255],magenta:[204,0,204],lightMagenta:[255,0,255],cyan:[0,153,255],lightCyan:[0,204,255]};$e.exports=K});var se=z((co,Ye)=>{function $r(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}Ye.exports=$r});var Xe=z((fo,Ze)=>{var Kr=typeof global=="object"&&global&&global.Object===Object&&global;Ze.exports=Kr});var ve=z((ho,Je)=>{var Yr=Xe(),Zr=typeof self=="object"&&self&&self.Object===Object&&self,Xr=Yr||Zr||Function("return this")();Je.exports=Xr});var et=z((mo,Qe)=>{var Jr=ve(),Qr=function(){return Jr.Date.now()};Qe.exports=Qr});var rt=z((go,tt)=>{var en=/\s/;function tn(t){for(var e=t.length;e--&&en.test(t.charAt(e)););return e}tt.exports=tn});var it=z((po,nt)=>{var rn=rt(),nn=/^\s+/;function on(t){return t&&t.slice(0,rn(t)+1).replace(nn,"")}nt.exports=on});var we=z((vo,ot)=>{var an=ve(),sn=an.Symbol;ot.exports=sn});var ut=z((wo,lt)=>{var at=we(),st=Object.prototype,ln=st.hasOwnProperty,un=st.toString,X=at?at.toStringTag:void 0;function cn(t){var e=ln.call(t,X),r=t[X];try{t[X]=void 0;var n=!0}catch(s){}var o=un.call(t);return n&&(e?t[X]=r:delete t[X]),o}lt.exports=cn});var dt=z((bo,ct)=>{var dn=Object.prototype,fn=dn.toString;function hn(t){return fn.call(t)}ct.exports=hn});var gt=z((yo,mt)=>{var ft=we(),mn=ut(),gn=dt(),pn="[object Null]",vn="[object Undefined]",ht=ft?ft.toStringTag:void 0;function wn(t){return t==null?t===void 0?vn:pn:ht&&ht in Object(t)?mn(t):gn(t)}mt.exports=wn});var vt=z((So,pt)=>{function bn(t){return t!=null&&typeof t=="object"}pt.exports=bn});var bt=z((Io,wt)=>{var yn=gt(),Sn=vt(),In="[object Symbol]";function _n(t){return typeof t=="symbol"||Sn(t)&&yn(t)==In}wt.exports=_n});var _t=z((_o,It)=>{var Cn=it(),yt=se(),xn=bt(),St=0/0,Tn=/^[-+]0x[0-9a-f]+$/i,zn=/^0b[01]+$/i,Rn=/^0o[0-7]+$/i,Mn=parseInt;function On(t){if(typeof t=="number")return t;if(xn(t))return St;if(yt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=yt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Cn(t);var r=zn.test(t);return r||Rn.test(t)?Mn(t.slice(2),r?2:8):Tn.test(t)?St:+t}It.exports=On});var Tt=z((Co,xt)=>{var En=se(),be=et(),Ct=_t(),Wn="Expected a function",Ln=Math.max,An=Math.min;function kn(t,e,r){var n,o,s,d,u,v,b=0,C=!1,m=!1,w=!0;if(typeof t!="function")throw new TypeError(Wn);e=Ct(e)||0,En(r)&&(C=!!r.leading,m="maxWait"in r,s=m?Ln(Ct(r.maxWait)||0,e):s,w="trailing"in r?!!r.trailing:w);function g(f){var _=n,x=o;return n=o=void 0,b=f,d=t.apply(x,_),d}function p(f){return b=f,u=setTimeout(h,e),C?g(f):d}function i(f){var _=f-v,x=f-b,O=e-_;return m?An(O,s-x):O}function c(f){var _=f-v,x=f-b;return v===void 0||_>=e||_<0||m&&x>=s}function h(){var f=be();if(c(f))return y(f);u=setTimeout(h,i(f))}function y(f){return u=void 0,w&&n?g(f):(n=o=void 0,d)}function S(){u!==void 0&&clearTimeout(u),b=0,n=v=o=u=void 0}function a(){return u===void 0?d:y(be())}function l(){var f=be(),_=c(f);if(n=arguments,o=this,v=f,_){if(u===void 0)return p(v);if(m)return clearTimeout(u),u=setTimeout(h,e),g(v)}return u===void 0&&(u=setTimeout(h,e)),d}return l.cancel=S,l.flush=a,l}xt.exports=kn});var Rt=z((xo,zt)=>{var Nn=Tt(),Fn=se(),Pn="Expected a function";function Dn(t,e,r){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(Pn);return Fn(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Nn(t,e,{leading:n,maxWait:e,trailing:o})}zt.exports=Dn});var A=M(ur());var q=M(cr()),Vt=M(Ne()),Gt=M(dr()),$t=M(Fe()),Kt=M(Pe()),Yt=M(De()),Zt=M(He());var I=M(Ke(),1),di=I.default.nice,fi=I.default.parse,hi=I.default.strip,mi=I.default.ansicolor,gi=I.default.black,pi=I.default.bgBlack,vi=I.default.red,wi=I.default.bgRed,bi=I.default.green,yi=I.default.bgGreen,Si=I.default.yellow,Ii=I.default.bgYellow,_i=I.default.blue,Ci=I.default.bgBlue,xi=I.default.magenta,Ti=I.default.bgMagenta,zi=I.default.cyan,Ri=I.default.bgCyan,Mi=I.default.lightGray,Oi=I.default.bgLightGray,Ei=I.default.bgDefault,Wi=I.default.darkGray,Li=I.default.bgDarkGray,Ai=I.default.lightRed,ki=I.default.bgLightRed,Ni=I.default.lightGreen,Fi=I.default.bgLightGreen,Pi=I.default.lightYellow,Di=I.default.bgLightYellow,Hi=I.default.lightBlue,Bi=I.default.bgLightBlue,qi=I.default.lightMagenta,ji=I.default.bgLightMagenta,Ui=I.default.lightCyan,Vi=I.default.bgLightCyan,Gi=I.default.white,$i=I.default.bgWhite,Ki=I.default.bgBrightRed,Yi=I.default.bgBrightGreen,Zi=I.default.bgBrightYellow,Xi=I.default.bgBrightBlue,Ji=I.default.bgBrightMagenta,Qi=I.default.bgBrightCyan,eo=I.default.bright,to=I.default.dim,ro=I.default.italic,no=I.default.underline,io=I.default.inverse,oo=I.default.names,ao=I.default.rgb,Y=I.default;var Xt=M(lr());function Z(t,e){return Z=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},Z(t,e)}function ae(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Jt=M(Rt()),E=M(L());var le=M(L()),Hn=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Bn=function(){function t(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),qn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},jn=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Mt=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Un=function(){function t(e,r){var n=[],o=!0,s=!1,d=void 0;try{for(var u=e[Symbol.iterator](),v;!(o=(v=u.next()).done)&&(n.push(v.value),!(r&&n.length===r));o=!0);}catch(b){s=!0,d=b}finally{try{!o&&u.return&&u.return()}finally{if(s)throw d}}return n}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),W=void 0;typeof window!="undefined"?W=window:typeof self!="undefined"?W=self:W=global;var Ie=null,_e=null,Ot=20,ye=W.clearTimeout,Et=W.setTimeout,Se=W.cancelAnimationFrame||W.mozCancelAnimationFrame||W.webkitCancelAnimationFrame,Wt=W.requestAnimationFrame||W.mozRequestAnimationFrame||W.webkitRequestAnimationFrame;Se==null||Wt==null?(Ie=ye,_e=function(e){return Et(e,Ot)}):(Ie=function(e){var r=Un(e,2),n=r[0],o=r[1];Se(n),ye(o)},_e=function(e){var r=Wt(function(){ye(n),e()}),n=Et(function(){Se(r),e()},Ot);return[r,n]});function Vn(t){var e=void 0,r=void 0,n=void 0,o=void 0,s=void 0,d=void 0,u=void 0,v=typeof document!="undefined"&&document.attachEvent;if(!v){d=function(a){var l=a.__resizeTriggers__,f=l.firstElementChild,_=l.lastElementChild,x=f.firstElementChild;_.scrollLeft=_.scrollWidth,_.scrollTop=_.scrollHeight,x.style.width=f.offsetWidth+1+"px",x.style.height=f.offsetHeight+1+"px",f.scrollLeft=f.scrollWidth,f.scrollTop=f.scrollHeight},s=function(a){return a.offsetWidth!==a.__resizeLast__.width||a.offsetHeight!==a.__resizeLast__.height},u=function(a){if(!(a.target.className&&typeof a.target.className.indexOf=="function"&&a.target.className.indexOf("contract-trigger")<0&&a.target.className.indexOf("expand-trigger")<0)){var l=this;d(this),this.__resizeRAF__&&Ie(this.__resizeRAF__),this.__resizeRAF__=_e(function(){s(l)&&(l.__resizeLast__.width=l.offsetWidth,l.__resizeLast__.height=l.offsetHeight,l.__resizeListeners__.forEach(function(x){x.call(l,a)}))})}};var b=!1,C="";n="animationstart";var m="Webkit Moz O ms".split(" "),w="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),g="";{var p=document.createElement("fakeelement");if(p.style.animationName!==void 0&&(b=!0),b===!1){for(var i=0;i<m.length;i++)if(p.style[m[i]+"AnimationName"]!==void 0){g=m[i],C="-"+g.toLowerCase()+"-",n=w[i],b=!0;break}}}r="resizeanim",e="@"+C+"keyframes "+r+" { from { opacity: 0; } to { opacity: 0; } } ",o=C+"animation: 1ms "+r+"; "}var c=function(a){if(!a.getElementById("detectElementResize")){var l=(e||"")+".resize-triggers { "+(o||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',f=a.head||a.getElementsByTagName("head")[0],_=a.createElement("style");_.id="detectElementResize",_.type="text/css",t!=null&&_.setAttribute("nonce",t),_.styleSheet?_.styleSheet.cssText=l:_.appendChild(a.createTextNode(l)),f.appendChild(_)}},h=function(a,l){if(v)a.attachEvent("onresize",l);else{if(!a.__resizeTriggers__){var f=a.ownerDocument,_=W.getComputedStyle(a);_&&_.position==="static"&&(a.style.position="relative"),c(f),a.__resizeLast__={},a.__resizeListeners__=[],(a.__resizeTriggers__=f.createElement("div")).className="resize-triggers";var x=f.createElement("div");x.className="expand-trigger",x.appendChild(f.createElement("div"));var O=f.createElement("div");O.className="contract-trigger",a.__resizeTriggers__.appendChild(x),a.__resizeTriggers__.appendChild(O),a.appendChild(a.__resizeTriggers__),d(a),a.addEventListener("scroll",u,!0),n&&(a.__resizeTriggers__.__animationListener__=function(k){k.animationName===r&&d(a)},a.__resizeTriggers__.addEventListener(n,a.__resizeTriggers__.__animationListener__))}a.__resizeListeners__.push(l)}},y=function(a,l){if(v)a.detachEvent("onresize",l);else if(a.__resizeListeners__.splice(a.__resizeListeners__.indexOf(l),1),!a.__resizeListeners__.length){a.removeEventListener("scroll",u,!0),a.__resizeTriggers__.__animationListener__&&(a.__resizeTriggers__.removeEventListener(n,a.__resizeTriggers__.__animationListener__),a.__resizeTriggers__.__animationListener__=null);try{a.__resizeTriggers__=!a.removeChild(a.__resizeTriggers__)}catch(f){}}};return{addResizeListener:h,removeResizeListener:y}}var Lt=function(t){jn(e,t);function e(){var r,n,o,s;Hn(this,e);for(var d=arguments.length,u=Array(d),v=0;v<d;v++)u[v]=arguments[v];return s=(n=(o=Mt(this,(r=e.__proto__||Object.getPrototypeOf(e)).call.apply(r,[this].concat(u))),o),o.state={height:o.props.defaultHeight||0,width:o.props.defaultWidth||0},o._onResize=function(){var b=o.props,C=b.disableHeight,m=b.disableWidth,w=b.onResize;if(o._parentNode){var g=o._parentNode.offsetHeight||0,p=o._parentNode.offsetWidth||0,i=window.getComputedStyle(o._parentNode)||{},c=parseInt(i.paddingLeft,10)||0,h=parseInt(i.paddingRight,10)||0,y=parseInt(i.paddingTop,10)||0,S=parseInt(i.paddingBottom,10)||0,a=g-y-S,l=p-c-h;(!C&&o.state.height!==a||!m&&o.state.width!==l)&&(o.setState({height:g-y-S,width:p-c-h}),w({height:g,width:p}))}},o._setRef=function(b){o._autoSizer=b},n),Mt(o,s)}return Bn(e,[{key:"componentDidMount",value:function(){var n=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=Vn(n),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var n=this.props,o=n.children,s=n.className,d=n.disableHeight,u=n.disableWidth,v=n.style,b=this.state,C=b.height,m=b.width,w={overflow:"visible"},g={},p=!1;return d||(C===0&&(p=!0),w.height=0,g.height=C),u||(m===0&&(p=!0),w.width=0,g.width=m),(0,le.createElement)("div",{className:s,ref:this._setRef,style:qn({},w,v)},!p&&o(g))}}]),e}(le.PureComponent);Lt.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}};var At=Lt;function Ce(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Z(t,e)}var kt=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Gn(t,e){return!!(t===e||kt(t)&&kt(e))}function $n(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!Gn(t[r],e[r]))return!1;return!0}function Kn(t,e){e===void 0&&(e=$n);var r,n=[],o,s=!1;function d(){for(var u=[],v=0;v<arguments.length;v++)u[v]=arguments[v];return s&&r===this&&e(u,n)||(o=t.apply(this,u),s=!0,r=this,n=u),o}return d}var ue=Kn;var B=M(L());var Yn=typeof performance=="object"&&typeof performance.now=="function",Nt=Yn?function(){return performance.now()}:function(){return Date.now()};function Ft(t){cancelAnimationFrame(t.id)}function Zn(t,e){var r=Nt();function n(){Nt()-r>=e?t.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var xe=-1;function Pt(t){if(t===void 0&&(t=!1),xe===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),xe=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return xe}var D=null;function Dt(t){if(t===void 0&&(t=!1),D===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?D="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?D="negative":D="positive-ascending"),document.body.removeChild(e),D}return D}var Xn=150,Jn=function(e,r){return e};function Qn(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,o=t.getItemSize,s=t.getOffsetForIndexAndAlignment,d=t.getStartIndexForOffset,u=t.getStopIndexForStartIndex,v=t.initInstanceProps,b=t.shouldResetStyleCacheOnItemSizeChange,C=t.validateProps;return e=function(m){Ce(w,m);function w(p){var i;return i=m.call(this,p)||this,i._instanceProps=v(i.props,ae(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:ae(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=ue(function(c,h,y,S){return i.props.onItemsRendered({overscanStartIndex:c,overscanStopIndex:h,visibleStartIndex:y,visibleStopIndex:S})}),i._callOnScroll=void 0,i._callOnScroll=ue(function(c,h,y){return i.props.onScroll({scrollDirection:c,scrollOffset:h,scrollUpdateWasRequested:y})}),i._getItemStyle=void 0,i._getItemStyle=function(c){var h=i.props,y=h.direction,S=h.itemSize,a=h.layout,l=i._getItemStyleCache(b&&S,b&&a,b&&y),f;if(l.hasOwnProperty(c))f=l[c];else{var _=r(i.props,c,i._instanceProps),x=o(i.props,c,i._instanceProps),O=y==="horizontal"||a==="horizontal",j=y==="rtl",k=O?_:0;l[c]=f={position:"absolute",left:j?void 0:k,right:j?k:void 0,top:O?0:_,height:O?"100%":x,width:O?x:"100%"}}return f},i._getItemStyleCache=void 0,i._getItemStyleCache=ue(function(c,h,y){return{}}),i._onScrollHorizontal=function(c){var h=c.currentTarget,y=h.clientWidth,S=h.scrollLeft,a=h.scrollWidth;i.setState(function(l){if(l.scrollOffset===S)return null;var f=i.props.direction,_=S;if(f==="rtl")switch(Dt()){case"negative":_=-S;break;case"positive-descending":_=a-y-S;break}return _=Math.max(0,Math.min(_,a-y)),{isScrolling:!0,scrollDirection:l.scrollOffset<S?"forward":"backward",scrollOffset:_,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(c){var h=c.currentTarget,y=h.clientHeight,S=h.scrollHeight,a=h.scrollTop;i.setState(function(l){if(l.scrollOffset===a)return null;var f=Math.max(0,Math.min(a,S-y));return{isScrolling:!0,scrollDirection:l.scrollOffset<f?"forward":"backward",scrollOffset:f,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(c){var h=i.props.outerRef;i._outerRef=c,typeof h=="function"?h(c):h!=null&&typeof h=="object"&&h.hasOwnProperty("current")&&(h.current=c)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&Ft(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=Zn(i._resetIsScrolling,Xn)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}w.getDerivedStateFromProps=function(i,c){return ei(i,c),C(i),null};var g=w.prototype;return g.scrollTo=function(i){i=Math.max(0,i),this.setState(function(c){return c.scrollOffset===i?null:{scrollDirection:c.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(i,c){c===void 0&&(c="auto");var h=this.props,y=h.itemCount,S=h.layout,a=this.state.scrollOffset;i=Math.max(0,Math.min(i,y-1));var l=0;if(this._outerRef){var f=this._outerRef;S==="vertical"?l=f.scrollWidth>f.clientWidth?Pt():0:l=f.scrollHeight>f.clientHeight?Pt():0}this.scrollTo(s(this.props,i,c,a,this._instanceProps,l))},g.componentDidMount=function(){var i=this.props,c=i.direction,h=i.initialScrollOffset,y=i.layout;if(typeof h=="number"&&this._outerRef!=null){var S=this._outerRef;c==="horizontal"||y==="horizontal"?S.scrollLeft=h:S.scrollTop=h}this._callPropsCallbacks()},g.componentDidUpdate=function(){var i=this.props,c=i.direction,h=i.layout,y=this.state,S=y.scrollOffset,a=y.scrollUpdateWasRequested;if(a&&this._outerRef!=null){var l=this._outerRef;if(c==="horizontal"||h==="horizontal")if(c==="rtl")switch(Dt()){case"negative":l.scrollLeft=-S;break;case"positive-ascending":l.scrollLeft=S;break;default:var f=l.clientWidth,_=l.scrollWidth;l.scrollLeft=_-f-S;break}else l.scrollLeft=S;else l.scrollTop=S}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Ft(this._resetIsScrollingTimeoutId)},g.render=function(){var i=this.props,c=i.children,h=i.className,y=i.direction,S=i.height,a=i.innerRef,l=i.innerElementType,f=i.innerTagName,_=i.itemCount,x=i.itemData,O=i.itemKey,j=O===void 0?Jn:O,k=i.layout,er=i.outerElementType,tr=i.outerTagName,rr=i.style,nr=i.useIsScrolling,ir=i.width,Te=this.state.isScrolling,ce=y==="horizontal"||k==="horizontal",or=ce?this._onScrollHorizontal:this._onScrollVertical,ze=this._getRangeToRender(),ar=ze[0],sr=ze[1],Re=[];if(_>0)for(var U=ar;U<=sr;U++)Re.push((0,B.createElement)(c,{data:x,key:j(U,x),index:U,isScrolling:nr?Te:void 0,style:this._getItemStyle(U)}));var Me=n(this.props,this._instanceProps);return(0,B.createElement)(er||tr||"div",{className:h,onScroll:or,ref:this._outerRefSetter,style:Oe({position:"relative",height:S,width:ir,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:y},rr)},(0,B.createElement)(l||f||"div",{children:Re,ref:a,style:{height:ce?"100%":Me,pointerEvents:Te?"none":void 0,width:ce?Me:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var c=this._getRangeToRender(),h=c[0],y=c[1],S=c[2],a=c[3];this._callOnItemsRendered(h,y,S,a)}}if(typeof this.props.onScroll=="function"){var l=this.state,f=l.scrollDirection,_=l.scrollOffset,x=l.scrollUpdateWasRequested;this._callOnScroll(f,_,x)}},g._getRangeToRender=function(){var i=this.props,c=i.itemCount,h=i.overscanCount,y=this.state,S=y.isScrolling,a=y.scrollDirection,l=y.scrollOffset;if(c===0)return[0,0,0,0];var f=d(this.props,l,this._instanceProps),_=u(this.props,f,l,this._instanceProps),x=!S||a==="backward"?Math.max(1,h):1,O=!S||a==="forward"?Math.max(1,h):1;return[Math.max(0,f-x),Math.max(0,Math.min(c-1,_+O)),f,_]},w}(B.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var ei=function(e,r){var n=e.children,o=e.direction,s=e.height,d=e.layout,u=e.innerTagName,v=e.outerTagName,b=e.width,C=r.instance;if(!1){var m;switch(o){case"horizontal":case"vertical":case"ltr":case"rtl":default:}switch(d){case"horizontal":case"vertical":default:}}},ti=50,H=function(e,r,n){var o=e,s=o.itemSize,d=n.itemMetadataMap,u=n.lastMeasuredIndex;if(r>u){var v=0;if(u>=0){var b=d[u];v=b.offset+b.size}for(var C=u+1;C<=r;C++){var m=s(C);d[C]={offset:v,size:m},v+=m}n.lastMeasuredIndex=r}return d[r]},ri=function(e,r,n){var o=r.itemMetadataMap,s=r.lastMeasuredIndex,d=s>0?o[s].offset:0;return d>=n?Bt(e,r,s,0,n):ni(e,r,Math.max(0,s),n)},Bt=function(e,r,n,o,s){for(;o<=n;){var d=o+Math.floor((n-o)/2),u=H(e,d,r).offset;if(u===s)return d;u<s?o=d+1:u>s&&(n=d-1)}return o>0?o-1:0},ni=function(e,r,n,o){for(var s=e.itemCount,d=1;n<s&&H(e,n,r).offset<o;)n+=d,d*=2;return Bt(e,r,Math.min(n,s-1),Math.floor(n/2),o)},Ht=function(e,r){var n=e.itemCount,o=r.itemMetadataMap,s=r.estimatedItemSize,d=r.lastMeasuredIndex,u=0;if(d>=n&&(d=n-1),d>=0){var v=o[d];u=v.offset+v.size}var b=n-d-1,C=b*s;return u+C},qt=Qn({getItemOffset:function(e,r,n){return H(e,r,n).offset},getItemSize:function(e,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Ht,getOffsetForIndexAndAlignment:function(e,r,n,o,s,d){var u=e.direction,v=e.height,b=e.layout,C=e.width,m=u==="horizontal"||b==="horizontal",w=m?C:v,g=H(e,r,s),p=Ht(e,s),i=Math.max(0,Math.min(p-w,g.offset)),c=Math.max(0,g.offset-w+g.size+d);switch(n==="smart"&&(o>=c-w&&o<=i+w?n="auto":n="center"),n){case"start":return i;case"end":return c;case"center":return Math.round(c+(i-c)/2);case"auto":default:return o>=c&&o<=i?o:o<c?c:i}},getStartIndexForOffset:function(e,r,n){return ri(e,n,r)},getStopIndexForStartIndex:function(e,r,n,o){for(var s=e.direction,d=e.height,u=e.itemCount,v=e.layout,b=e.width,C=s==="horizontal"||v==="horizontal",m=C?b:d,w=H(e,r,o),g=n+m,p=w.offset+w.size,i=r;i<u-1&&p<g;)i++,p+=H(e,i,o).size;return i},initInstanceProps:function(e,r){var n=e,o=n.estimatedItemSize,s={itemMetadataMap:{},estimatedItemSize:o||ti,lastMeasuredIndex:-1};return r.resetAfterIndex=function(d,u){u===void 0&&(u=!0),s.lastMeasuredIndex=Math.min(s.lastMeasuredIndex,d-1),r._getItemStyleCache(-1),u&&r.forceUpdate()},s},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var r=e.itemSize}});var jt=M(L());function Ut(t){let e=J();(0,jt.useEffect)(()=>(e.addPushCallback(t),()=>{e.removePushCallback(t)}),[e,t])}var T=M(Ae()),Qt=18,ii=Ee(t=>({root:{display:"flex",height:"100%",flexFlow:"column nowrap",alignItems:"stretch",gap:t.spacing(2)},root_window:{padding:t.spacing(2)},buttons:{flex:"0 1 auto",display:"flex",gap:t.spacing(1)},code:{display:"block",flex:1,background:"#1e1e1e",color:"#cccccc",fontSize:"14px",lineHeight:`${Qt}px`,padding:t.spacing(2,0),"& pre":{margin:0,padding:t.spacing(0,2),fontFamily:'"Fira Code", "Consolas", "Lucida Console", monospace'}}}));Y.rgb.blue=[36,114,200];Y.rgb.cyan=[17,168,205];Y.rgb.green=[13,188,121];var Ko=()=>{let t=ii(),e=J(),{translate:r}=Le(),{instance:n}=We(),o=(0,E.useRef)(null),[s,d]=(0,E.useState)([]),u=l=>{d(f=>[...f,l])},v=l=>s[l].split(` `).length*Qt;function b({index:l,style:f}){let _=s[l];return(0,T.jsx)("pre",{style:f,dangerouslySetInnerHTML:{__html:_}})}let[C,m]=(0,E.useState)(!1),[w,g]=(0,E.useState)(!0),p=(0,Jt.default)(()=>{var l;(l=o.current)==null||l.scrollToItem(s.length-1,"end")},100);(0,E.useEffect)(()=>{w&&s.length>0&&p()},[s.length,w]);let i=(0,E.useCallback)(l=>{if(l.type==="log"){let _=Y.parse(l.info.message).spans.map(x=>`<span style="${x.css.replace(/^background:/,"color:#1e1e1e;background:")}">${x.text}</span>`);u(_.join(""))}},[d]);Ut(i);let c=(0,E.useCallback)(()=>{C||e.subscribeLogs().then(()=>{u(r("Subscribed to logs...")),m(!0)})},[e,C]),h=(0,E.useCallback)(()=>{!C||e.unsubscribeLogs().then(()=>{u(r("Unsubscribed logs...")),m(!1)})},[e,C]);(0,E.useEffect)(()=>(c(),h),[]);let y=(0,E.useCallback)(()=>{let l=document.createElement("a"),f=s.join(` `).replace(/\<.*?\>/g,""),_=new Blob([f],{type:"text/plain"});l.href=URL.createObjectURL(_),l.download=`zwave_${new Date().toISOString().replace("T","_").replace(/[:\.]/g,"-").replace("Z","")}.log`,document.body.appendChild(l),l.click()},[s]),S=(0,E.useCallback)(()=>{window.open("log_window.html",`zwave_log_${n}`,"innerWidth=1040,innerHeight=600")},[]),a=window.name.startsWith("zwave_log_");return(0,T.jsxs)("div",{className:(0,Xt.default)(t.root,a&&t.root_window),children:[(0,T.jsxs)("div",{className:t.buttons,children:[(0,T.jsxs)(de,{variant:"contained",color:"primary",children:[(0,T.jsx)(q.default,{title:r("Start logging"),children:(0,T.jsx)(A.default,{disabled:C,onClick:c,children:(0,T.jsx)(Zt.default,{})})}),(0,T.jsx)(q.default,{title:r("Pause logging"),children:(0,T.jsx)(A.default,{disabled:!C,onClick:h,children:(0,T.jsx)(Yt.default,{})})})]}),(0,T.jsxs)(de,{variant:"contained",color:"primary",children:[(0,T.jsx)(q.default,{title:r("Auto-scroll to bottom"),children:(0,T.jsx)(A.default,{disabled:w,onClick:()=>g(!0),children:(0,T.jsx)(Gt.default,{})})}),(0,T.jsx)(q.default,{title:r("Pause auto-scrolling"),children:(0,T.jsx)(A.default,{disabled:!w,onClick:()=>g(!1),children:(0,T.jsx)(Kt.default,{})})})]}),(0,T.jsx)(A.default,{variant:"contained",color:"primary",onClick:y,startIcon:(0,T.jsx)(Vt.default,{}),children:r("Download logs")}),!a&&(0,T.jsx)(q.default,{title:r("Open log in new window"),children:(0,T.jsx)(A.default,{variant:"contained",color:"primary",style:{marginLeft:"auto"},onClick:S,children:(0,T.jsx)($t.default,{})})})]}),(0,T.jsx)("code",{className:t.code,children:(0,T.jsx)(At,{children:({height:l,width:f})=>(0,T.jsx)(qt,{itemCount:s.length,itemSize:v,width:f,height:l,ref:o,children:b})})})]})};export{fr as a,Pe as b,Ut as c,Ko as d}; //# sourceMappingURL=chunk-J724PBLX.js.map