iobroker.javascript 9.0.2 → 9.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{c as U,j as Q,o as Pe,a as YM,b as vM,d as bM,P as _}from"./createSvgIcon-BQT-7-GS.js";import{i as f,R as M}from"./iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js";import{i as j,S as cn,c as Ne,I as Oe,b as nt,L as ML,D as uN,C as lN,a5 as cL,a6 as Z,a7 as uL,a8 as lL,a9 as NL,aa as LL,P as QM,ab as gL,ac as jL,ad as yL,ae as TL,af as DL,ag as UM,ah as dL,ai as hL,aj as zL,ak as wL,al as CL,am as IL,an as pL,ao as AL,ap as mL,R as B,aq as OL,ar as EL,as as fL,at as $M,au as PM,av as xL,aw as WM,V as _L,ax as SL,ay as kL,az as YL,aA as BM,aB as vL,aC as bL,aD as QL,G as UL,a as Pi}from"./index-CuCs5aLs.js";import{c as ir,g as $L}from"./_commonjsHelpers-Cpj98o6Y.js";import{u as PL}from"./useTheme-DF6qfrtI.js";import"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";const un=U(Q.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),WL=U(Q.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),BL=U(Q.jsx("path",{d:"m10 17 5-5-5-5z"}),"ArrowRight"),JL=U(Q.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 11h-3v3.75c0 1.24-1.01 2.25-2.25 2.25S8.5 17.99 8.5 16.75s1.01-2.25 2.25-2.25c.46 0 .89.14 1.25.38V11h4zm-3-4V3.5L18.5 9z"}),"AudioFile"),RL=U([Q.jsx("path",{d:"M16.5 12h-9c-.55 0-1 .45-1 1v1h11v-1c0-.55-.45-1-1-1M7.25 8.5h4v2h-4zm5.5 0h4v2h-4z"},"0"),Q.jsx("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 15h-1.5v-1.5h-11V17H5v-3.83c0-.66.25-1.26.65-1.72V9c0-1.1.9-2 2-2H11c.37 0 .72.12 1 .32.28-.2.63-.32 1-.32h3.35c1.1 0 2 .9 2 2v2.45c.4.46.65 1.06.65 1.72z"},"1")],"BedroomParent"),FL=U(Q.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2"}),"Bookmark"),GL=U(Q.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2m0 15-5-2.18L7 18V5h10z"}),"BookmarkBorder"),HL=U(Q.jsx("path",{d:"M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 1.83-1.83c.39-.39 1.02-.39 1.41 0l2.34 2.34c.39.39.39 1.02 0 1.41z"}),"BorderColor"),VL=U(Q.jsx("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness4"),ZL=U(Q.jsx("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"}),"Brightness5"),ca=U(Q.jsx("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18V6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness6"),XL=U(Q.jsx("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4"}),"Brightness7"),KL=U(Q.jsx("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build"),qL=U(Q.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),ua=U(Q.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),eg=U(Q.jsx("path",{d:"m20.71 5.63-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42M6.92 19 5 17.08l8.06-8.06 1.92 1.92z"}),"Colorize"),tg=U(Q.jsx("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"Construction"),sg=U(Q.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),NN=U(Q.jsx("path",{d:"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3z"}),"CreateNewFolder"),ig=U(Q.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"Crop"),rg=U(Q.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),Kr=U(Q.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),og=U(Q.jsx("path",{d:"M18.41 5.8 17.2 4.59c-.78-.78-2.05-.78-2.83 0l-2.68 2.68L3 15.96V20h4.04l8.74-8.74 2.63-2.63c.79-.78.79-2.05 0-2.83M6.21 18H5v-1.21l8.66-8.66 1.21 1.21zM11 20l4-4h6v4z"}),"DriveFileRenameOutline"),mi=U(Q.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),ng=U(Q.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),ag=U(Q.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),Mg=U(Q.jsx("path",{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3"}),"FindInPage"),cg=U(Q.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen"),ug=U(Q.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z"}),"FolderSpecial"),lg=U(Q.jsx("path",{d:"M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-4.05 16.5-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13z"}),"FontDownload"),Ng=U(Q.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),Lg=U(Q.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),la=U(Q.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),LN=U(Q.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),gg=U(Q.jsx("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"}),"KeyboardReturn"),gN=U(Q.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),jg=U(Q.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),yg=U(Q.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),Tg=U(Q.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14h-2V9h-2V7h4z"}),"LooksOne"),Dg=U(Q.jsx("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote"),dg=U(Q.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),Na=U(Q.jsx("path",{d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonOutlined"),hg=U(Q.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Photo"),Sr=U(Q.jsx("path",{d:"M5 4v2h14V4zm0 10h4v6h6v-6h4l-7-7z"}),"Publish"),jN=U(Q.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),La=U(Q.jsx("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1s1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router"),zg=U(Q.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),ln=U(Q.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),kr=U(Q.jsx("path",{d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m7-7H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-1.75 9c0 .23-.02.46-.05.68l1.48 1.16c.13.11.17.3.08.45l-1.4 2.42c-.09.15-.27.21-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.26 1.85c-.03.17-.18.3-.35.3h-2.8c-.17 0-.32-.13-.35-.29l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.74.7c-.16.06-.34 0-.43-.15l-1.4-2.42c-.09-.15-.05-.34.08-.45l1.48-1.16c-.03-.23-.05-.46-.05-.69s.02-.46.05-.68l-1.48-1.16c-.13-.11-.17-.3-.08-.45l1.4-2.42c.09-.15.27-.21.43-.15l1.74.7c.36-.28.76-.51 1.18-.69l.26-1.85c.03-.17.18-.3.35-.3h2.8c.17 0 .32.13.35.29l.26 1.85c.43.18.82.41 1.18.69l1.74-.7c.16-.06.34 0 .43.15l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.16c.03.23.05.46.05.69"}),"SettingsApplications"),wg=U(Q.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),ga=U(Q.jsx("path",{d:"M11.99 2c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10m3.61 6.34c1.07 0 1.93.86 1.93 1.93s-.86 1.93-1.93 1.93-1.93-.86-1.93-1.93c-.01-1.07.86-1.93 1.93-1.93m-6-1.58c1.3 0 2.36 1.06 2.36 2.36s-1.06 2.36-2.36 2.36-2.36-1.06-2.36-2.36c0-1.31 1.05-2.36 2.36-2.36m0 9.13v3.75c-2.4-.75-4.3-2.6-5.14-4.96 1.05-1.12 3.67-1.69 5.14-1.69.53 0 1.2.08 1.9.22-1.64.87-1.9 2.02-1.9 2.68M11.99 20c-.27 0-.53-.01-.79-.04v-4.07c0-1.42 2.94-2.13 4.4-2.13 1.07 0 2.92.39 3.84 1.15-1.17 2.97-4.06 5.09-7.45 5.09"}),"SupervisedUserCircle"),Cg=U(Q.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),Ig=U(Q.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFileOutlined"),pg=U(Q.jsx("path",{d:"M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z"}),"VerticalAlignBottom"),Ag=U(Q.jsx("path",{d:"M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z"}),"VerticalAlignTop"),mg=U(Q.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),Og=U(Q.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn"),Eg=U(Q.jsx("path",{d:"M4 15h16v-2H4zm0 4h16v-2H4zm0-8h16V9H4zm0-6v2h16V5z"}),"ViewHeadline"),fg=U(Q.jsx("path",{d:"M14.67 5v6.5H9.33V5zm1 6.5H21V5h-5.33zm-1 7.5v-6.5H9.33V19zm1-6.5V19H21v-6.5zm-7.34 0H3V19h5.33zm0-1V5H3v6.5z"}),"ViewModule"),xg=U(Q.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),_g=U(Q.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),Qs=U(Q.jsx("path",{d:"m1 9 2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9m8 8 3 3 3-3c-1.65-1.66-4.34-1.66-6 0m-4-4 2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13"}),"Wifi"),rr=U(Q.jsx("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff"),Oo=11/23/100;function JM(s){const e={r:0,g:0,b:0};if(s.length===7)e.r=parseInt(s.substring(1,3),16),e.g=parseInt(s.substring(3,5),16),e.b=parseInt(s.substring(5,7),16);else if(s.length===4){const t=s[1],i=s[2],r=s[3];e.r=parseInt(t+t,16),e.g=parseInt(i+i,16),e.b=parseInt(r+r,16)}return e}function Sg(s){return`#${Math.round(s.r).toString(16)}${Math.round(s.g).toString(16)}${Math.round(s.b).toString(16)}`}function kg(s,e,t){const i=JM(s),r=JM(e);return i.r+=r.r*(.05+Oo*(t-1)),i.g+=r.g*(.05+Oo*(t-1)),i.b+=r.b*(.05+Oo*(t-1)),Sg(i)}function RM(s,e){const t={};for(let i=1;i<=24;i++)t[`elevation${i}`]={backgroundColor:kg(s,e,i)};return t}function Yg(s,e){var n,a,c,l,N,u,L,g,y,T,D;let t,i;s==="dark"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#272727"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[200],"&:hover":{color:Pe[100]}}},MuiPaper:RM("#121212","#fff")},t={name:s,palette:{mode:"dark",background:{paper:"#121212",default:"#121212"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):s==="blue"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#3399CC"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"dark",background:{paper:"#151d21",default:"#151d21"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):s==="colored"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#2a3135"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[200],"&:hover":{color:Pe[100]}}},MuiPaper:RM("#151d21","#fff")},t={name:s,palette:{mode:"light",primary:{main:"#3399CC"},secondary:{main:"#164477"},expert:"#96fc96"}}):s==="PT"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#0F99DE"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#0F99DE"},secondary:{main:"#88A536"},expert:"#BD1B24"}}):s==="DX"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#a9a9a9"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#F5F5F7"},secondary:{main:"#a9a9a9"},expert:"#BD1B24",text:{primary:"#007AFE",secondary:"#007AFE",disabled:"#007AFEAA"}}}):(i={MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#3399CC",dark:"#256c97",light:"#76d0fd"},secondary:{main:"#164477"},expert:"#14bb00"}}),t.toolbar={height:48},t.saveToolbar={background:(a=(n=t.palette)==null?void 0:n.primary)==null?void 0:a.main,button:{borderRadius:3,height:32}},t.palette&&(t.palette.grey={main:YM[300],dark:YM[400]});const r=vM(t),o=r.palette;return vM(r,{...e||void 0,components:{...i,MuiButton:{variants:[{props:{variant:"contained",color:"grey"},style:{backgroundColor:(c=o.grey)==null?void 0:c[300],color:o.getContrastText&&((l=o.grey)!=null&&l[300])?o.getContrastText(o.grey[300]):void 0}},{props:{variant:"outlined",color:"grey"},style:{color:(N=o.text)==null?void 0:N.primary,borderColor:o.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)","&.Mui-disabled":{border:`1px solid ${(u=o.action)==null?void 0:u.disabledBackground}`},"&:hover":{borderColor:o.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)",backgroundColor:bM(((L=o.text)==null?void 0:L.primary)||"",((g=o.action)==null?void 0:g.hoverOpacity)||.04)}}},{props:{variant:"text",color:"grey"},style:{color:(y=o.text)==null?void 0:y.primary,"&:hover":{backgroundColor:bM(((T=o.text)==null?void 0:T.primary)||"",((D=o.action)==null?void 0:D.hoverOpacity)||.04)}}}]},...(e==null?void 0:e.components)||void 0}})}function vg(){let s,e;const t=new Promise((i,r)=>{s=i,e=r});return t.resolve=s,t.reject=e,t}function Nn(s){return(s==null?void 0:s.rows.map(e=>e.value).filter(e=>!!e))??[]}function Tt(s){return s!=null&&s.startsWith("system.host.")||(s=`system.host.${s}`),s}function ui(s){return s!=null&&s.startsWith("system.host.")&&(s=s.substring(12)),s}function FM(s){return new Promise(e=>{setTimeout(e,s)})}function or(s){s=(s||"").toString();const e=s[0]==="*",t=s[s.length-1]==="*";return s=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"),(e?"":"^")+s+(t?"":"$")}var rt;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.CONNECTED=1]="CONNECTED",s[s.OBJECTS_LOADED=2]="OBJECTS_LOADED",s[s.READY=3]="READY"})(rt||(rt={}));var Ie;(function(s){s.PERMISSION_ERROR="permissionError",s.NOT_CONNECTED="notConnectedError",s.TIMEOUT="timeout",s.NOT_ADMIN="Allowed only in admin",s.NOT_SUPPORTED="Not supported"})(Ie||(Ie={}));const $3e=Ie.PERMISSION_ERROR;Ie.NOT_CONNECTED;const bg=["material","echarts","vis"];class ze{constructor(e){this.props=this.applyDefaultProps(e),this.connId=`${this.props.name?`${this.props.name}-`:""}${Math.round(Math.random()*1e6).toString().padStart(6,"0")}`,this.waitForSocketLib().then(()=>this.startSocket()).catch(t=>{alert(`Socket connection could not be initialized: ${t}`)})}applyDefaultProps(e){return{...e,protocol:e.protocol||window.location.protocol,host:e.host||window.location.hostname,port:e.port||(window.location.port==="3000"?8081:window.location.port),ioTimeout:Math.max(e.ioTimeout||2e4,2e4),cmdTimeout:Math.max(e.cmdTimeout||5e3,5e3),admin5only:e.admin5only||!1,autoSubscribes:e.autoSubscribes??[],autoSubscribeLog:e.autoSubscribeLog??!1,doNotLoadACL:e.doNotLoadACL??!0,doNotLoadAllObjects:e.doNotLoadAllObjects??!0}}props;connId;lastAccessToken=null;ignoreState="";connected=!1;subscribed=!1;firstConnect=!0;waitForRestart=!1;loaded=!1;simStates={};statesSubscribes={};filesSubscribes={};objectsSubscribes={};objects={};states={};acl=null;isSecure=!1;onReadyDone=!1;onConnectionHandlers=[];onLogHandlers=[];onCmdStdoutHandler;onCmdStderrHandler;onCmdExitHandler;onError(e){(this.props.onError??console.error)(e)}_socket;_waitForSocketPromise;_waitForFirstConnectionPromise=vg();_instanceSubscriptions={};_promises={};_authTimer=null;_refreshTimer=null;_systemConfig;get systemConfig(){return this._systemConfig}systemLang="en";static isWeb(){return window.socketUrl!==void 0}waitForSocketLib(){return this._waitForSocketPromise?this._waitForSocketPromise:(this._waitForSocketPromise=new Promise(async(e,t)=>{if(typeof window.io>"u"&&typeof window.iob>"u")if(typeof window.registerSocketOnLoad=="function")window.registerSocketOnLoad(()=>e());else{for(let i=1;i<=30;i++){if(window.io||window.iob)return e();await FM(100)}t(new Error("Socket library could not be loaded!"))}else e()}),this._waitForSocketPromise)}async startSocket(){if(this._socket)return;let e=this.props.host,t=this.props.port,i=(this.props.protocol||window.location.protocol).replace(":",""),r=window.location.pathname;if(window.location.hostname==="iobroker.net"||window.location.hostname==="iobroker.pro")r="";else{if(window.socketUrl){const a=new URL(window.socketUrl);e=a.hostname,t=a.port,i=a.protocol.replace(":","")}const n=r.lastIndexOf("/");if(n!==-1&&(r=r.substring(0,n+1)),ze.isWeb()){const a=r.split("/");a.length>2&&(a.pop(),a.pop(),bg.includes(a[a.length-1])&&a.pop(),r=a.join("/"),r.endsWith("/")||(r+="/"))}}const o=t?`${i}://${e}:${t}`:`${i}://${e}`;return this._socket=(window.io||window.iob).connect(o,{path:r.endsWith("/")?`${r}socket.io`:`${r}/socket.io`,query:"ws=true",name:this.props.name,timeout:this.props.ioTimeout,uuid:this.props.uuid,token:this.props.token}),this._socket.on("connect",n=>{window.addEventListener("storage",this.onAccessTokenUpdated);const a=ze.readTokens();if(a&&!a.owner){const c=Date.now();this.saveTokens({access_token:a.access_token,refresh_token:a.refresh_token,expires_in:Math.round((a.expires_in.getTime()-c)/1e3),refresh_token_expires_in:Math.round((a.refresh_token_expires_in.getTime()-c)/1e3),token_type:"Bearer"},a.stayLoggedIn)}this.onReadyDone=!1,n!==!0?(this.connected=!0,setTimeout(()=>this.getVersion().then(c=>{const[l,N,u]=c.version.split(".");parseInt(l,10)*1e4+parseInt(N,10)*100+parseInt(u,10)<40102?(this._authTimer=null,this.onPreConnect(!1,!1)):this._socket.emit("authenticate",(g,y)=>this.onPreConnect(g,y))}).catch(c=>this.onError({message:c.toString(),operation:"getVersion"})),500)):this._socket.emit("authenticate",(c,l)=>{this.onPreConnect(c,l)})}),this._socket.on("reconnect",()=>{var n,a;this.onReadyDone=!1,(a=(n=this.props).onProgress)==null||a.call(n,rt.READY),this.connected=!0,this.waitForRestart?window.location.reload():(this._subscribe(!0),this.onConnectionHandlers.forEach(c=>c(!0)))}),this._socket.on("disconnect",()=>{var n,a;this.onReadyDone=!1,this.connected=!1,this.subscribed=!1,(a=(n=this.props).onProgress)==null||a.call(n,rt.CONNECTING),this.onConnectionHandlers.forEach(c=>c(!1))}),this._socket.on("reauthenticate",()=>this.authenticate()),this._socket.on("log",n=>{var a,c;(c=(a=this.props).onLog)==null||c.call(a,n),this.onLogHandlers.forEach(l=>l(n))}),this._socket.on("error",n=>{let a;n==null?a="":typeof n.toString=="function"?a=n.toString():(a=JSON.stringify(n),console.error(`Received strange error: ${a}`)),a.includes("User not authorized")?this.authenticate():a.includes("websocket error")?(console.error(`Socket Error => reload: ${n}`),window.location.reload()):console.error(`Socket Error: ${n}`)}),this._socket.on("connect_error",n=>console.error(`Connect error: ${n}`)),this._socket.on("permissionError",n=>this.onError({message:"no permission",operation:n.operation,type:n.type,id:n.id||""})),this._socket.on("objectChange",(n,a)=>{setTimeout(()=>this.objectChange(n,a),0)}),this._socket.on("stateChange",(n,a)=>{setTimeout(()=>this.stateChange(n,a),0)}),this._socket.on("im",(n,a,c)=>{setTimeout(()=>this.instanceMessage(n,a,c),0)}),this._socket.on("fileChange",(n,a,c)=>{setTimeout(()=>this.fileChange(n,a,c),0)}),this._socket.on("cmdStdout",(n,a)=>{var c;(c=this.onCmdStdoutHandler)==null||c.call(this,n,a)}),this._socket.on("cmdStderr",(n,a)=>{var c;(c=this.onCmdStderrHandler)==null||c.call(this,n,a)}),this._socket.on("cmdExit",(n,a)=>{var c;(c=this.onCmdExitHandler)==null||c.call(this,n,a)}),Promise.resolve()}onPreConnect(e,t){var i,r;this._authTimer&&(clearTimeout(this._authTimer),this._authTimer=null),this.connected=!0,this.isSecure=t,this.waitForRestart?window.location.reload():(this.firstConnect?this.loadData().catch(o=>console.error(`Cannot load data: ${o}`)):(r=(i=this.props).onProgress)==null||r.call(i,rt.READY),this._subscribe(!0),this.onConnectionHandlers.forEach(o=>o(!0)),this.checkAccessTokenExpire()),this._waitForFirstConnectionPromise.resolve()}static readTokens(){let e=window.sessionStorage.getItem("iob_tokens");const t=!e;if(e||(e=window.localStorage.getItem("iob_tokens")),!e)return null;const[i,r,o,n,a]=e.split(";"),c=new Date(r);return c.getTime()<Date.now()?null:{refresh_token:i,refresh_token_expires_in:c,access_token:o,expires_in:new Date(n),owner:a,stayLoggedIn:t}}static saveTokensStatic(e,t,i){const r=`${e.refresh_token};${new Date(Date.now()+e.refresh_token_expires_in*1e3).toISOString()};${e.access_token};${new Date(Date.now()+e.expires_in*1e3).toISOString()}${i?`;${i}`:""}`;t?window.localStorage.setItem("iob_tokens",r):window.sessionStorage.setItem("iob_tokens",r)}saveTokens(e,t){ze.saveTokensStatic(e,t,this.connId)}static deleteTokensStatic(){window.localStorage.removeItem("iob_tokens"),window.sessionStorage.removeItem("iob_tokens")}deleteTokens(e,t){const i=ze.readTokens();i&&(t?ze.deleteTokensStatic():i.stayLoggedIn===e&&i.owner===this.connId&&(i.stayLoggedIn?window.localStorage.removeItem("iob_tokens"):window.sessionStorage.removeItem("iob_tokens")))}onAccessTokenUpdated=e=>{if(e.key==="iob_tokens"){const t=ze.readTokens();t&&(console.log(`Tab ${this.connId} received updated token: ${t.access_token}`),this.updateTokenExpiration(t.access_token))}};updateTokenExpiration(e){this.lastAccessToken!==e&&(this.lastAccessToken=e,this._socket.emit("updateTokenExpiration",e,(t,i)=>{t?(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token: ${t}`),window.location.reload()):i?console.log(`[UPDATE/${new Date().toISOString()}] server accepted new token: ${e}`):(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token`),window.location.reload())})),this.checkAccessTokenExpire()}refreshTokens(e,t){if(!e){console.log(`[REFRESH/${new Date().toISOString()}] No token structure found => reloading the page`),setTimeout(()=>window.location.reload(),500);return}t||!e.owner||e.owner===this.connId?(console.log(`[REFRESH/${new Date().toISOString()}] claim ownership of the token`),this.acquireTokenLock()?(console.log(`[REFRESH/${new Date().toISOString()}] refreshing token`),fetch("./oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=refresh_token&refresh_token=${e.refresh_token}&client_id=ioBroker&stayloggedin=${e.stayLoggedIn}`}).then(i=>{if(i.ok)return i.json();throw new Error("Cannot refresh access token")}).then(i=>{if(i.access_token)console.log(`[REFRESH/${new Date().toISOString()}] received new token: ${i.access_token}`),this.saveTokens(i,e.stayLoggedIn),this.releaseTokenLock(),this.updateTokenExpiration(i.access_token);else throw new Error("Cannot get access token")}).catch(i=>{console.warn(`[REFRESH/${new Date().toISOString()}] cannot refresh token: ${i}`),this.releaseTokenLock(),this.deleteTokens(e.stayLoggedIn),console.error(i),window.location.reload()})):(console.log(`[REFRESH/${new Date().toISOString()}] Someone else is updating the token, so wait for the next check`),this.checkAccessTokenExpire())):this.lastAccessToken!==e.access_token&&this.updateTokenExpiration(e.access_token)}acquireTokenLock(){const e=Date.now(),t=localStorage.getItem("iob_token_semaphore");if(t)try{const r=JSON.parse(t);if(e<r.expiry)return!1}catch{}const i={connId:this.connId,expiry:e+10*1e3};return localStorage.setItem("iob_token_semaphore",JSON.stringify(i)),!0}releaseTokenLock(){const e=localStorage.getItem("iob_token_semaphore");if(e)try{JSON.parse(e).connId===this.connId&&localStorage.removeItem("iob_token_semaphore")}catch{localStorage.removeItem("iob_token_semaphore")}}checkAccessTokenExpire(){if(this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null),this.isSecure){const e=ze.readTokens();if(e){const t=e.expires_in.getTime();if(t<Date.now()+3e4){const i=t<Date.now()+5500;console.log(`[TOKEN/${new Date().toISOString()}] Updating refresh token ${e.access_token}`),e.refresh_token?e.owner===this.connId||i?(e.owner===this.connId?console.log(`[TOKEN/${new Date().toISOString()}] We are the owner of the token`):console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will take ownership`),this.props.tokenTimeoutHandler?(console.log(`[TOKEN/${new Date().toISOString()}] Asking GUI if we should prolong the token`),this.props.tokenTimeoutHandler(t).then(r=>{r?(console.log(`[TOKEN/${new Date().toISOString()}] Token will be prolonged`),this.refreshTokens(e,i)):(console.log(`[TOKEN/${new Date().toISOString()}] Token will not be prolonged. Reloading the page`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))})):(console.log(`[TOKEN/${new Date().toISOString()}] No tokenTimeoutHandler defined. Prolonging the token`),this.refreshTokens(e,i))):this.lastAccessToken!==e.access_token?(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will inform the server about new token`),this.refreshTokens(e)):(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token and the token did not change. Check in 3 seconds if the owner updated the token`),this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},3e3)):(console.log(`[TOKEN/${new Date().toISOString()}] We do not have a refresh token, so we need to reauthenticate`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))}else this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},t-Date.now()-3e4>12e4?12e4:t-Date.now()-3e4)}}}static isCloud(){return window.location.hostname.includes("amazonaws.com")||window.location.hostname.includes("iobroker.in")?!0:typeof window.socketUrl>"u"?!1:window.socketUrl.includes("iobroker.in")||window.socketUrl.includes("amazonaws")}isConnected(){return this.connected}waitForFirstConnection(){return this._waitForFirstConnectionPromise}async getUserPermissions(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getUserPermissions",(i,r)=>{i?t(i):e(r||null)})}})}async loadData(){if(this.loaded)return;const e=10;for(let t=1;t<=e;t++){if(this.doLoadData().catch(i=>console.error(`Cannot load data: ${i}`)),this.loaded)return;await FM(ze.isCloud()?5e3:1e3)}}async doLoadData(){var e,t,i,r,o,n,a,c,l;if(!this.loaded){if(!this.props.doNotLoadACL)try{this.acl=await this.getUserPermissions()}catch(N){this.onError(`Cannot read user permissions: ${N}`);return}try{this.props.admin5only&&!ze.isWeb()&&(!window.vendorPrefix||window.vendorPrefix==="@@vendorPrefix@@")?this._systemConfig=await this.getCompactSystemConfig():this._systemConfig=await this.getSystemConfig()}catch(N){this.onError(`Cannot read system config: ${N}`);return}this._systemConfig&&(this.systemLang=(e=this._systemConfig.common)==null?void 0:e.language,this.systemLang||(this.systemLang=window.navigator.userLanguage||window.navigator.language,/^(en|de|ru|pt|nl|fr|it|es|pl|uk)-?/.test(this.systemLang)?this.systemLang=this.systemLang.substring(0,2):/^(en|de|ru|pt|nl|fr|it|es|pl|uk|zh-cn)$/.test(this.systemLang)||(this.systemLang="en"),this._systemConfig.common.language=this.systemLang)),(i=(t=this.props).onLanguage)==null||i.call(t,this.systemLang),this.loaded=!0,(o=(r=this.props).onProgress)==null||o.call(r,rt.CONNECTED),this.firstConnect=!1,this.props.doNotLoadAllObjects?this.props.admin5only?this.objects={}:this.objects={"system.config":this._systemConfig}:this.objects=await this.getObjects(),(a=(n=this.props).onProgress)==null||a.call(n,rt.READY),this.onReadyDone||(this.onReadyDone=!0,(l=(c=this.props).onReady)==null||l.call(c,this.objects))}}authenticate(){window.location.search.includes("&href=")?window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}${window.location.search}`:window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}?login&href=${encodeURIComponent(window.location.search+window.location.hash)}`}async subscribeState(...e){let t,i,r;e.length===3?[t,i,r]=e:([t,r]=e,i=!1);let o;if(Array.isArray(t)?o=t:o=[t],typeof r!="function")throw new Error("The state change handler must be a function!");const n=[];for(let a=0;a<o.length;a++){const c=o[a];this.statesSubscribes[c]?!this.statesSubscribes[c].cbs.includes(r)&&this.statesSubscribes[c].cbs.push(r):(this.statesSubscribes[c]={reg:new RegExp(or(c)),cbs:[r]},t!==this.ignoreState&&n.push(c))}if(this.connected)if(n.length&&this._socket.emit("subscribe",n),i){let a;for(let c=0;c<o.length;c++){try{a=await this.getBinaryState(o[c])}catch(l){console.error(`Cannot getBinaryState "${o[c]}": ${JSON.stringify(l)}`),a=void 0}a!=null&&r(o[c],a)}}else if(o.find(a=>a.includes("*"))){let a;for(let c=0;c<o.length;c++){try{a=await this.getForeignStates(o[c])}catch(l){console.error(`Cannot getForeignStates "${o[c]}": ${JSON.stringify(l)}`);return}if(a)for(const[l,N]of Object.entries(a)){const u=r(l,N);u instanceof Promise&&u.catch(L=>console.error(`Cannot call state change handler: ${L}`))}}}else try{const a=await(ze.isWeb()?this.getStates(o):this.getForeignStates(o));if(a)for(const[c,l]of Object.entries(a)){const N=r(c,l);N instanceof Promise&&N.catch(u=>console.error(`Cannot call state change handler: ${u}`))}}catch(a){console.error(`Cannot getState "${o.join(", ")}": ${a.message}`);return}}async subscribeStateAsync(e,t){return this.subscribeState(e,t)}unsubscribeState(e,t){var o;let i;Array.isArray(e)?i=e:i=[e];const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(this.statesSubscribes[a]){const c=this.statesSubscribes[a];if(t){const l=c.cbs.indexOf(t);l!==-1&&c.cbs.splice(l,1)}else c.cbs=[];(o=c.cbs)!=null&&o.length||(delete this.statesSubscribes[a],a!==this.ignoreState&&r.push(a))}}this.connected&&r.length&&this._socket.emit("unsubscribe",i)}subscribeObject(e,t){let i;if(Array.isArray(e)?i=e:i=[e],typeof t!="function")throw new Error("The object change handler must be a function!");const r=[];for(let o=0;o<i.length;o++){const n=i[o];this.objectsSubscribes[n]?!this.objectsSubscribes[n].cbs.includes(t)&&this.objectsSubscribes[n].cbs.push(t):(this.objectsSubscribes[n]={reg:new RegExp(or(n)),cbs:[t]},r.push(n))}return this.connected&&r.length&&this._socket.emit("subscribeObjects",r),Promise.resolve()}unsubscribeObject(e,t){var o;let i;Array.isArray(e)?i=e:i=[e];const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(this.objectsSubscribes[a]){const c=this.objectsSubscribes[a];if(t){const l=c.cbs.indexOf(t);l!==-1&&c.cbs.splice(l,1)}else c.cbs=[];(o=c.cbs)!=null&&o.length||(delete this.objectsSubscribes[a],r.push(a))}}return this.connected&&r.length&&this._socket.emit("unsubscribeObjects",r),Promise.resolve()}objectChange(e,t){var o,n;let i;this.objects[e]&&(i={_id:e,type:this.objects[e].type});let r=!1;t?(t._rev&&this.objects[e]&&(this.objects[e]._rev=t._rev),(!this.objects[e]||JSON.stringify(this.objects[e])!==JSON.stringify(t))&&(this.objects[e]=t,r=!0)):this.objects[e]&&(delete this.objects[e],r=!0);for(const[a,c]of Object.entries(this.objectsSubscribes))(a===e||c.reg.test(e))&&c.cbs.forEach(l=>{try{const N=l(e,t,i);N instanceof Promise&&N.catch(u=>console.error(`Cannot call object change handler: ${u}`))}catch(N){console.error(`Error by callback of objectChange: ${N}`)}});if(r){const a=(n=(o=this.props).onObjectChange)==null?void 0:n.call(o,e,t);a instanceof Promise&&a.catch(c=>console.error(`Cannot call object change handler: ${c}`))}}stateChange(e,t){for(const i of Object.values(this.statesSubscribes))if(i.reg.test(e))for(const r of i.cbs)try{const o=r(e,t??null);o instanceof Promise&&o.catch(n=>console.error(`Cannot call state change handler: ${n}`))}catch(o){console.error(`Error by callback of stateChanged: ${o}`)}}instanceMessage(e,t,i){var r;(r=this._instanceSubscriptions[t])==null||r.forEach(o=>{if(o.messageType===e){const n=o.callback(i,t,e);n instanceof Promise&&n.catch(a=>console.error(`Cannot call instance message handler: ${a}`))}})}fileChange(e,t,i){for(const r of Object.values(this.filesSubscribes))if(r.regId.test(e)&&r.regFilePattern.test(t))for(const o of r.cbs)try{o(e,t,i)}catch(n){console.error(`Error by callback of fileChange: ${n}`)}}async subscribeFiles(e,t,i){if(typeof i!="function")throw new Error("The state change handler must be a function!");let r;Array.isArray(t)?r=t:r=[t];const o=[];for(let n=0;n<r.length;n++){const a=r[n],c=`${e}$%$${a}`;this.filesSubscribes[c]?!this.filesSubscribes[c].cbs.includes(i)&&this.filesSubscribes[c].cbs.push(i):(this.filesSubscribes[c]={regId:new RegExp(or(e)),regFilePattern:new RegExp(or(a)),cbs:[i]},o.push(a))}return this.connected&&o.length&&this._socket.emit("subscribeFiles",e,o),Promise.resolve()}unsubscribeFiles(e,t,i){var n;let r;Array.isArray(t)?r=t:r=[t];const o=[];for(let a=0;a<r.length;a++){const c=r[a],l=`${e}$%$${c}`;if(this.filesSubscribes[l]){const N=this.filesSubscribes[l];if(i){const u=N.cbs.indexOf(i);u!==-1&&N.cbs.splice(u,1)}else N.cbs=[];(n=N.cbs)!=null&&n.length||(delete this.filesSubscribes[l],o.push(c))}}this.connected&&o.length&&this._socket.emit("unsubscribeFiles",e,o)}async request({cacheKey:e,forceUpdate:t,commandTimeout:i,onTimeout:r,requireAdmin:o,requireFeatures:n,executor:a}){if(o&&ze.isWeb())return Promise.reject(new Error(Ie.NOT_ADMIN));if(e&&!t&&e in this._promises)return this._promises[e];if(!this.connected)return Promise.reject(new Error(Ie.NOT_CONNECTED));if(n!=null&&n.length){for(const l of n)if(!await this.checkFeatureSupported(l))throw new Error(Ie.NOT_SUPPORTED)}const c=new Promise(async(l,N)=>{const u={elapsed:!1,clearTimeout:()=>{}};let L;i!==!1&&(L=setTimeout(()=>{u.elapsed=!0,r==null||r(),e&&this._promises[e]instanceof Promise&&delete this._promises[e],N(new Error(Ie.TIMEOUT))},i??this.props.cmdTimeout),u.clearTimeout=()=>{clearTimeout(L)});try{await a(l,N,u)}catch(g){e&&this._promises[e]instanceof Promise&&delete this._promises[e],N(new Error(g.toString()))}});return e&&(this._promises[e]=c),c}resetCache(e,t){t?Object.keys(this._promises).filter(i=>i.startsWith(e)).forEach(i=>{delete this._promises[i]}):delete this._promises[e]}getStates(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getStates",e,(r,o)=>{this.states=o??{},r?i(r):t(this.states)})}})}getState(e){return this.request({commandTimeout:!1,executor:(t,i)=>{if(e&&e===this.ignoreState){t(this.simStates[e]||{val:null,ack:!0});return}this._socket.emit("getState",e,(r,o)=>{r?i(r):t(o)})}})}getBinaryState(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getBinaryState",e,(r,o)=>{r?i(r):t(o)})}})}setBinaryState(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("setBinaryState",e,t,o=>{o?r(o):i()})}})}setState(e,t,i){return typeof i=="boolean"&&(t={val:t,ack:i}),this.request({commandTimeout:!1,executor:(r,o)=>{if(e&&e===this.ignoreState){let n;if(typeof i=="boolean"||typeof t=="object"&&t.val!==void 0?n=t:n={val:t,ack:!1,ts:Date.now(),lc:Date.now(),from:"system.adapter.vis.0"},this.simStates[e]=n,this.statesSubscribes[e])for(const a of this.statesSubscribes[e].cbs)try{const c=a(e,n);c instanceof Promise&&c.catch(l=>console.error(`Cannot call state change handler: ${l}`))}catch(c){console.error(`Error by callback of stateChanged: ${c}`)}r();return}this._socket.emit("setState",e,t,n=>{n?o(n):r()})}})}getObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{if(!e&&this.objects){i(this.objects);return}this._socket.emit(ze.isWeb()?"getObjects":"getAllObjects",(o,n)=>{var a,c;t||(c=(a=this.props).onProgress)==null||c.call(a,rt.OBJECTS_LOADED),o?r(o):(this.objects=n??{},i(this.objects))})}})}getObjectsById(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjects",e,(r,o)=>{r?i(r):t(o)})}})}_subscribe(e){var t,i;if(e&&!this.subscribed){this.subscribed=!0,(t=this.props.autoSubscribes)!=null&&t.length&&this._socket.emit("subscribeObjects",this.props.autoSubscribes);const r=Object.keys(this.objectsSubscribes);r.length&&this._socket.emit("subscribeObjects",r),Object.keys(this.objectsSubscribes).forEach(o=>this._socket.emit("subscribeObjects",o)),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!0),Object.keys(this.statesSubscribes).forEach(o=>this._socket.emit("subscribe",o)),Object.keys(this.filesSubscribes).forEach(o=>{const[n,a]=o.split("$%$");this._socket.emit("subscribeFiles",n,a)})}else if(!e&&this.subscribed){this.subscribed=!1,(i=this.props.autoSubscribes)!=null&&i.length&&this._socket.emit("unsubscribeObjects",this.props.autoSubscribes);const r=Object.keys(this.objectsSubscribes);r.length&&this._socket.emit("unsubscribeObjects",r),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!1),Object.keys(this.statesSubscribes).forEach(o=>this._socket.emit("unsubscribe",o)),Object.keys(this.filesSubscribes).forEach(o=>{const[n,a]=o.split("$%$");this._socket.emit("unsubscribeFiles",n,a)})}}requireLog(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("requireLog",e,r=>{r?i(r):t()})}})}delObject(e,t=!1){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("delObject",e,{maintenance:t},o=>{o?r(o):i()})}})}delObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("delObjects",e,{maintenance:t},o=>{o?r(o):i()})}})}setObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("setObject",e,t,o=>{o?r(o):i()})}})):Promise.reject(new Error("Null object is not allowed"))}getObject(e){return this.request({commandTimeout:!1,executor:(t,i)=>{if(e&&e===this.ignoreState){t({_id:this.ignoreState,type:"state",common:{name:"ignored state",type:"mixed"}});return}this._socket.emit("getObject",e,(r,o)=>{r?i(r):t(o)})}})}sendTo(e,t,i){return this.request({commandTimeout:!1,executor:r=>{this._socket.emit("sendTo",e,t,i,o=>{r(o)})}})}extendObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("extendObject",e,t,o=>{o?r(o):i()})}})):Promise.reject(new Error("Null object is not allowed"))}registerLogHandler(e){this.onLogHandlers.includes(e)||this.onLogHandlers.push(e)}unregisterLogHandler(e){const t=this.onLogHandlers.indexOf(e);t!==-1&&this.onLogHandlers.splice(t,1)}registerConnectionHandler(e){this.onConnectionHandlers.includes(e)||this.onConnectionHandlers.push(e)}unregisterConnectionHandler(e){const t=this.onConnectionHandlers.indexOf(e);t!==-1&&this.onConnectionHandlers.splice(t,1)}registerCmdStdoutHandler(e){this.onCmdStdoutHandler=e}unregisterCmdStdoutHandler(){this.onCmdStdoutHandler=void 0}registerCmdStderrHandler(e){this.onCmdStderrHandler=e}unregisterCmdStderrHandler(){this.onCmdStderrHandler=void 0}registerCmdExitHandler(e){this.onCmdExitHandler=e}unregisterCmdExitHandler(){this.onCmdExitHandler=void 0}getEnums(e,t){return this.request({cacheKey:`enums_${e||"all"}`,forceUpdate:t,commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getObjectView","system","enum",{startkey:`enum.${e||""}`,endkey:e?`enum.${e}.香`:"enum.香"},(o,n)=>{if(o)r(o);else{const a={};if(n)for(let c=0;c<n.rows.length;c++)e&&n.rows[c].id===`enum.${e}`||(a[n.rows[c].id]=n.rows[c].value);i(a)}})}})}getObjectView(e,t,i){return this.getObjectViewCustom("system",i,e,t)}getObjectViewSystem(e,t,i){return this.getObjectViewCustom("system",e,t,i)}getObjectViewCustom(e,t,i,r){return this.request({commandTimeout:!1,executor:(o,n)=>{i=i||"",r=r||"香",this._socket.emit("getObjectView",e,t,{startkey:i,endkey:r},(a,c)=>{if(a)n(a);else{const l={};if(c&&c.rows)for(let N=0;N<c.rows.length;N++)l[c.rows[N].id]=c.rows[N].value;o(l)}})}})}readMetaItems(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getObjectView","system","meta",{startkey:"",endkey:"香"},(i,r)=>{var o;i?t(i):e((o=r.rows)==null?void 0:o.map(n=>n.value).filter(n=>!!n))})}})}readDir(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("readDir",e,t,(o,n)=>{o?r(o):i(n)})}})}readFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit(i?"readFile64":"readFile",e,t,(n,a,c)=>{n?o(n):r({file:a,mimeType:c})})}})}writeFile64(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{if(typeof i=="string")this._socket.emit("writeFile",e,t,i,n=>{n?o(n):r()});else{const n=btoa(new Uint8Array(i).reduce((a,c)=>a+String.fromCharCode(c),""));this._socket.emit("writeFile64",e,t,n,a=>{a?o(a):r()})}}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFile",e,t,o=>{o?r(o):i()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFolder",e,t,o=>{o?r(o):i()})}})}rename(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("rename",e,t,i,n=>{n?o(n):r()})}})}renameFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("renameFile",e,t,i,n=>{n?o(n):r()})}})}cmdExec(e,t,i,r){return this.request({commandTimeout:r,executor:(o,n,a)=>{e=Tt(e),this._socket.emit("cmdExec",e,i,t,c=>{a.elapsed||(a.clearTimeout(),c?n(c):o())})}})}getSystemConfig(e){return this.request({cacheKey:"systemConfig",forceUpdate:e,commandTimeout:!1,executor:async t=>{let i=await this.getObject("system.config");i??={},i.common??={},i.native??={},t(i)}})}getCompactSystemConfig(e){return this.request({cacheKey:"systemConfigCommon",forceUpdate:e,commandTimeout:!1,requireAdmin:!0,executor:(t,i)=>{this._socket.emit("getCompactSystemConfig",(r,o)=>{r?i(r):(o??={},o.common??={},o.native??={},t(o))})}})}getForeignStates(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getForeignStates",e||"*",(r,o)=>{r?i(r):t(o??{})})}})}getForeignObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getForeignObjects",e||"*",t,(o,n)=>{o?r(o):i(n)})}})}setSystemConfig(e){return this.setObject("system.config",e)}getRawSocket(){return this._socket}getHistory(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getHistory",e,t,(o,n)=>{o?r(o):i(n)})}})}getHistoryEx(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getHistory",e,t,(o,n,a,c)=>{o?r(o):i({values:n,sessionId:c,step:a})})}})}getIpAddresses(e,t){return e=Tt(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObject(e);i((r==null?void 0:r.common.address)??[])}})}getVersion(e){return this.request({cacheKey:"version",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getVersion",(r,o,n)=>{r&&!o&&typeof r=="string"&&r.match(/\d+\.\d+\.\d+/)?t({version:r,serverName:"socketio"}):r?i(r):t({version:o,serverName:n})})}})}getWebServerName(){return this.request({cacheKey:"webName",commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getAdapterName",(i,r)=>{i?t(i):e(r)})}})}fileExists(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("fileExists",e,t,(o,n)=>{o?r(o):i(!!n)})}})}getCurrentUser(){return this.request({commandTimeout:!1,executor:e=>{this._socket.emit("authEnabled",(t,i)=>{e(i)})}})}getUuid(){return this.request({cacheKey:"uuid",commandTimeout:!1,executor:async e=>{var i;const t=await this.getObject("system.meta.uuid");e((i=t==null?void 0:t.native)==null?void 0:i.uuid)}})}checkFeatureSupported(e,t){return this.request({cacheKey:`supportedFeatures_${e}`,forceUpdate:t,commandTimeout:!1,executor:(i,r)=>{this._socket.emit("checkFeatureSupported",e,(o,n)=>{o?r(o):i(n)})}})}getAdapterInstances(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`instances_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=e?`system.adapter.${e}.`:"system.adapter.",o=`${r}香`,n=await this.getObjectViewSystem("instance",r,o),a=Object.values(n);i(e?a.filter(c=>c.common.name===e):a)}})}getAdapters(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`adapter_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObjectViewSystem("adapter",`system.adapter.${e||""}`,`system.adapter.${e||"香"}`),o=Object.values(r);i(e?o.filter(n=>n.common.name===e):o)}})}getGroups(e){return this.request({cacheKey:"groups",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","group",{startkey:"system.group.",endkey:"system.group.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}logout(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("logout",i=>{i?t(i):e(null)})}})}subscribeOnInstance(e,t,i,r){return this.request({commandTimeout:!1,executor:(o,n)=>{this._socket.emit("clientSubscribe",e,t,i,(a,c)=>{a?n(a):c&&(c.error?n(c.error):(e.startsWith("system.adapter.")||(e=`system.adapter.${e}`),this._instanceSubscriptions[e]=this._instanceSubscriptions[e]||[],this._instanceSubscriptions[e].find(l=>l.messageType===t&&l.callback===r)||this._instanceSubscriptions[e].push({messageType:t,callback:r}),o(c)))})}})}unsubscribeFromInstance(e,t,i){var n;e.startsWith("system.adapter.")||(e=`system.adapter.${e}`);let r;const o=[];do{r=!1;const a=(n=this._instanceSubscriptions[e])==null?void 0:n.findIndex(c=>(!t||c.messageType===t)&&(!i||c.callback===i));if(a!=null&&a!==-1){r=!0;const c=this._instanceSubscriptions[e][a].messageType;this._instanceSubscriptions[e].splice(a,1),this._instanceSubscriptions[e].length||delete this._instanceSubscriptions[e],this._instanceSubscriptions[e]&&this._instanceSubscriptions[e].find(N=>N.messageType===c)||o.push(this.request({commandTimeout:!1,executor:(N,u)=>{this._socket.emit("clientUnsubscribe",e,t,(L,g)=>L?u(L):N(g))}}))}}while(r&&(!i||!t));return o.length?Promise.all(o).then(a=>!!a.find(c=>c)):Promise.resolve(!1)}log(e,t){return e?this.request({commandTimeout:!1,executor:i=>(this._socket.emit("log",e,t),i(null))}):Promise.resolve(null)}setStateToIgnore(e){this.ignoreState=e}}function Qg(s,e){if(!e)return;let t;if(e.length<700&&(e.indexOf("/")!==-1||e.indexOf("\\")!==-1))if(s.toLowerCase().includes("private"))t="private";else if(e.toLowerCase().includes("private"))t="private";else if(s.toLowerCase().includes("public"))t="public";else if(e.toLowerCase().includes("public"))t="public";else if(s.toLowerCase().includes("chain"))t="chained";else if(e.toLowerCase().includes("chain"))t="chained";else return;else t=e.substring(0,26)==="-----BEGIN RSA PRIVATE KEY"||e.substring(0,22)==="-----BEGIN PRIVATE KEY"?"private":"public",t==="public"&&e.split("-----END CERTIFICATE-----").filter(r=>r.replace(/\r\n|\r|\n/,"").trim()).length>1&&(t="chained");return{name:s,type:t}}function Ug(s){var i,r,o,n;const e=[{name:"[IPv4] 0.0.0.0 - Listen on all IPs",address:"0.0.0.0",family:"ipv4"}],t=[{name:"[IPv6] :: - Listen on all IPs",address:"::",family:"ipv6"}];if((r=(i=s.native)==null?void 0:i.hardware)!=null&&r.networkInterfaces){const a=(n=(o=s.native)==null?void 0:o.hardware)==null?void 0:n.networkInterfaces;Object.keys(a).forEach(c=>{a[c].forEach(l=>{l.family!=="IPv6"?e.push({name:`[${l.family}] ${l.address} - ${c}`,address:l.address,family:"ipv4"}):t.push({name:`[${l.family}] ${l.address} - ${c}`,address:l.address,family:"ipv6"})})})}return{IPs4:e,IPs6:t}}class P3e extends ze{constructor(e){super(e)}request(e){return super.request({requireAdmin:!0,...e})}getCertificates(e){return this.request({cacheKey:"cert",forceUpdate:e,commandTimeout:!1,executor:async t=>{var r;const i=await this.getObject("system.certificates");(r=i==null?void 0:i.native)!=null&&r.certificates?t(Object.entries(i.native.certificates).map(([o,n])=>Qg(o,n)).filter(o=>!!o)):t([])}})}getLogs(e,t=200){return this.request({commandTimeout:!1,executor:i=>{this._socket.emit("sendToHost",e,"getLogs",t||200,r=>{i(r)})}})}upgradeAdapterWithWebserver(e,t){return this.request({commandTimeout:!1,executor:i=>{this._socket.emit("sendToHost",e,"upgradeAdapterWithWebserver",t,r=>{i(r)})}})}upgradeController(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("sendToHost",e,"upgradeController",{version:t,adminInstance:i},n=>{const a=n;a.error?o(a.error):r(a.result)})}})}updateLicenses(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("updateLicenses",e,t,(o,n)=>{o?r(o):i(n)})}})}upgradeOsPackages(e,t,i){return this.request({commandTimeout:!1,executor:r=>{this._socket.emit("sendToHost",e,"upgradeOsPackages",{packages:t,restart:!!i},o=>{r(o)})}})}getLogsFiles(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("readLogs",e,(r,o)=>{r&&i(r),t(o)})}})}delLogs(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("sendToHost",e,"delLogs",null,r=>{r&&i(r),t()})}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFile",e,t,o=>{o&&r(o),i()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFolder",e,t,o=>{o&&r(o),i()})}})}rename(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("rename",e,t,i,n=>{n&&o(n),r()})}})}renameFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("renameFile",e,t,i,n=>{n&&o(n),r()})}})}getHosts(e){return this.request({cacheKey:"hosts",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","host",{startkey:"system.host.",endkey:"system.host.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}getUsers(e){return this.request({cacheKey:"users",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","user",{startkey:"system.user.",endkey:"system.user.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}renameGroup(e,t,i){return this.request({commandTimeout:!1,executor:async r=>{const o=await this.getGroups(!0),n=o.filter(c=>c._id.startsWith(`${e}.`));for(const c of n){const l=c._id,N=t+c._id.substring(e.length);c._id=N,await this.setObject(N,c),await this.delObject(l)}const a=o.find(c=>c._id===e);if(a){const c=a._id;a._id=t,i!==void 0&&(a.common??={},a.common.name=i),await this.setObject(t,a),await this.delObject(c)}r()}})}getHostInfo(e,t,i){return e=Tt(e),this.request({cacheKey:`hostInfo_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("sendToHost",e,"getHostInfo",null,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getHostInfo"'):a?r(a):o('Cannot read "getHostInfo"'))})}})}getHostInfoShort(e,t,i){return e=Tt(e),this.request({cacheKey:`hostInfoShort_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("sendToHost",e,"getHostInfoShort",null,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getHostInfoShort"'):a?r(a):o('Cannot read "getHostInfoShort"'))})}})}getRepository(e,t,i,r){return this.request({cacheKey:`repository_${e}`,forceUpdate:i,commandTimeout:r,executor:(o,n,a)=>{this._socket.emit("sendToHost",e,"getRepository",t,c=>{a.elapsed||(a.clearTimeout(),c===Ie.PERMISSION_ERROR?n('May not read "getRepository"'):c?o(c):n('Cannot read "getRepository"'))})}})}getInstalled(e,t,i){return e=Tt(e),this.request({cacheKey:`installed_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("sendToHost",e,"getInstalled",null,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getInstalled"'):a?r(a):o('Cannot read "getInstalled"'))})}})}cmdExec(e,t,i,r){return this.request({commandTimeout:r,executor:(o,n,a)=>{e=Tt(e),this._socket.emit("cmdExec",e,i,t,c=>{a.elapsed||(a.clearTimeout(),c&&n(c),o())})}})}readBaseSettings(e){return e=ui(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(t,i,r)=>{this._socket.emit("sendToHost",e,"readBaseSettings",null,o=>{r.elapsed||(r.clearTimeout(),o===Ie.PERMISSION_ERROR?i('May not read "BaseSettings"'):o?o.error?i(new Error(o.error)):t(o):i('Cannot read "BaseSettings"'))})}})}writeBaseSettings(e,t){return e=ui(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"writeBaseSettings",t,n=>{o.elapsed||(o.clearTimeout(),n===Ie.PERMISSION_ERROR?r('May not write "BaseSettings"'):n?i(n):r('Cannot write "BaseSettings"'))})}})}restartController(e){return e=ui(e),this.request({executor:(t,i,r)=>{this._socket.emit("sendToHost",e,"restartController",null,()=>{r.elapsed||(r.clearTimeout(),t(!0))})}})}getDiagData(e,t){return e=ui(e),this.request({executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"getDiagData",t,n=>{o.elapsed||(o.clearTimeout(),i(n||null))})}})}changePassword(e,t){return this.request({executor:(i,r,o)=>{this._socket.emit("changePassword",e,t,n=>{o.elapsed||(o.clearTimeout(),n&&r(n),i())})}})}getIpAddresses(e,t){return e=Tt(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObject(e);i((r==null?void 0:r.common.address)??[])}})}getHostByIp(e,t){return e=ui(e),this.request({cacheKey:`rIPs_${e}`,forceUpdate:t,executor:(i,r,o)=>{this._socket.emit("getHostByIp",e,(n,a)=>{if(o.elapsed)return;o.clearTimeout();const{IPs4:c,IPs6:l}=Ug(a);i([...c,...l])})}})}encrypt(e){return this.request({executor:(t,i,r)=>{this._socket.emit("encrypt",e,(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}decrypt(e){return this.request({executor:(t,i,r)=>{this._socket.emit("decrypt",e,(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}chmodFile(e,t,i){return this.request({executor:(r,o,n)=>{this._socket.emit("chmodFile",e,t,i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}chownFile(e,t,i){return this.request({executor:(r,o,n)=>{this._socket.emit("chownFile",e,t,i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}getNotifications(e,t){return this.request({executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"getNotifications",{category:t},n=>{o.elapsed||(o.clearTimeout(),i(n))})}})}clearNotifications(e,t){return this.request({executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"clearNotifications",{category:t},n=>{o.elapsed||(o.clearTimeout(),i(n))})}})}getIsEasyModeStrict(){return this.request({executor:(e,t,i)=>{this._socket.emit("getIsEasyModeStrict",(r,o)=>{i.elapsed||(i.clearTimeout(),r&&t(r),e(!!o))})}})}getEasyMode(){return this.request({executor:(e,t,i)=>{this._socket.emit("getEasyMode",(r,o)=>{i.elapsed||(i.clearTimeout(),r?t(new Error(r)):e(o))})}})}getRatings(e){return this.request({executor:(t,i,r)=>{this._socket.emit("getRatings",!!e,(o,n)=>{r.elapsed||(r.clearTimeout(),o?i(new Error(o)):t(n))})}})}getCurrentSession(e){const t=new AbortController;return this.request({commandTimeout:e||5e3,onTimeout:()=>{t.abort()},executor:async(i,r,o)=>{try{const n=await fetch("./session",{signal:t.signal});if(o.elapsed)return;o.clearTimeout();const a=await n.json();i(a)}catch(n){r(`getCurrentSession: ${n}`)}}})}getCurrentInstance(){return this.request({cacheKey:"currentInstance",executor:(e,t,i)=>{this._socket.emit("getCurrentInstance",(r,o)=>{i.elapsed||(i.clearTimeout(),r?t(r):e(o))})}})}getAdapterInstances(e,t){let i;return typeof e=="boolean"?(t=e,i=""):i=e||"",this.request({cacheKey:`instances_${i}`,forceUpdate:t,executor:(r,o,n)=>{this._socket.emit("getAdapterInstances",i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}getAdapters(e,t){let i;return typeof e=="boolean"?(t=e,i=""):i=e||"",this.request({cacheKey:`adapter_${i}`,forceUpdate:t,executor:(r,o,n)=>{this._socket.emit("getAdapters",i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}getCompactAdapters(e){return this.request({cacheKey:"compactAdapters",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactAdapters",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}getAdaptersResetCache(e){e=e??"",this.resetCache(`adapter_${e}`),this.resetCache("compactAdapters")}getCompactInstances(e){return this.request({cacheKey:"compactInstances",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactInstances",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}getAdapterInstancesResetCache(e){e=e??"",this.resetCache(`instances_${e}`),this.resetCache("compactInstances")}getCompactInstalled(e,t,i){return e=Tt(e),this.request({cacheKey:`installedCompact_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("getCompactInstalled",e,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getCompactInstalled"'):a?r(a):o('Cannot read "getCompactInstalled"'))})}})}getInstalledResetCache(e){e?(this.resetCache(`installedCompact_${e}`),this.resetCache(`installed_${e}`)):(this.resetCache("installedCompact_",!0),this.resetCache("installed_",!0))}getCompactRepository(e,t,i){return e=Tt(e),this.request({cacheKey:`repositoryCompact_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("getCompactRepository",e,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getCompactRepository"'):a?r(a):o('Cannot read "getCompactRepository"'))})}})}getRepositoryResetCache(e){e?(this.resetCache(`repositoryCompact_${e}`),this.resetCache(`repository_${e}`)):(this.resetCache("repositoryCompact_",!0),this.resetCache("repository_",!0))}getCompactHosts(e){return this.request({cacheKey:"hostsCompact",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactHosts",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}getCompactSystemRepositories(e){return this.request({cacheKey:"repositoriesCompact",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactSystemRepositories",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}}const X=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xt="9.25.1",ie=globalThis;function qr(){return eo(ie),ie}function eo(s){const e=s.__SENTRY__=s.__SENTRY__||{};return e.version=e.version||Xt,e[Xt]=e[Xt]||{}}function to(s,e,t=ie){const i=t.__SENTRY__=t.__SENTRY__||{},r=i[Xt]=i[Xt]||{};return r[s]||(r[s]=e())}const yN=Object.prototype.toString;function ja(s){switch(yN.call(s)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return bt(s,Error)}}function Vs(s,e){return yN.call(s)===`[object ${e}]`}function TN(s){return Vs(s,"ErrorEvent")}function GM(s){return Vs(s,"DOMError")}function $g(s){return Vs(s,"DOMException")}function ht(s){return Vs(s,"String")}function ya(s){return typeof s=="object"&&s!==null&&"__sentry_template_string__"in s&&"__sentry_template_values__"in s}function Ta(s){return s===null||ya(s)||typeof s!="object"&&typeof s!="function"}function _i(s){return Vs(s,"Object")}function so(s){return typeof Event<"u"&&bt(s,Event)}function Pg(s){return typeof Element<"u"&&bt(s,Element)}function Wg(s){return Vs(s,"RegExp")}function io(s){return!!(s!=null&&s.then&&typeof s.then=="function")}function Bg(s){return _i(s)&&"nativeEvent"in s&&"preventDefault"in s&&"stopPropagation"in s}function bt(s,e){try{return s instanceof e}catch{return!1}}function DN(s){return!!(typeof s=="object"&&s!==null&&(s.__isVue||s._isVue))}function Jg(s){return typeof Request<"u"&&bt(s,Request)}const Da=ie,Rg=80;function dN(s,e={}){if(!s)return"<unknown>";try{let t=s;const i=5,r=[];let o=0,n=0;const a=" > ",c=a.length;let l;const N=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||Rg;for(;t&&o++<i&&(l=Fg(t,N),!(l==="html"||o>1&&n+r.length*c+l.length>=u));)r.push(l),n+=l.length,t=t.parentNode;return r.reverse().join(a)}catch{return"<unknown>"}}function Fg(s,e){const t=s,i=[];if(!(t!=null&&t.tagName))return"";if(Da.HTMLElement&&t instanceof HTMLElement&&t.dataset){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}i.push(t.tagName.toLowerCase());const r=e!=null&&e.length?e.filter(n=>t.getAttribute(n)).map(n=>[n,t.getAttribute(n)]):null;if(r!=null&&r.length)r.forEach(n=>{i.push(`[${n[0]}="${n[1]}"]`)});else{t.id&&i.push(`#${t.id}`);const n=t.className;if(n&&ht(n)){const a=n.split(/\s+/);for(const c of a)i.push(`.${c}`)}}const o=["aria-label","type","name","title","alt"];for(const n of o){const a=t.getAttribute(n);a&&i.push(`[${n}="${a}"]`)}return i.join("")}function da(){try{return Da.document.location.href}catch{return""}}function Gg(s){if(!Da.HTMLElement)return null;let e=s;const t=5;for(let i=0;i<t;i++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const Hg="Sentry Logger ",Ln=["debug","info","warn","error","log","assert","trace"],Yr={};function Zs(s){if(!("console"in ie))return s();const e=ie.console,t={},i=Object.keys(Yr);i.forEach(r=>{const o=Yr[r];t[r]=e[r],e[r]=o});try{return s()}finally{i.forEach(r=>{e[r]=t[r]})}}function Vg(){let s=!1;const e={enable:()=>{s=!0},disable:()=>{s=!1},isEnabled:()=>s};return X?Ln.forEach(t=>{e[t]=(...i)=>{s&&Zs(()=>{ie.console[t](`${Hg}[${t}]:`,...i)})}}):Ln.forEach(t=>{e[t]=()=>{}}),e}const R=to("logger",Vg);function vr(s,e=0){return typeof s!="string"||e===0||s.length<=e?s:`${s.slice(0,e)}...`}function HM(s,e){if(!Array.isArray(s))return"";const t=[];for(let i=0;i<s.length;i++){const r=s[i];try{DN(r)?t.push("[VueViewModel]"):t.push(String(r))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function Zg(s,e,t=!1){return ht(s)?Wg(e)?e.test(s):ht(e)?t?s===e:s.includes(e):!1:!1}function ro(s,e=[],t=!1){return e.some(i=>Zg(s,i,t))}function Ue(s,e,t){if(!(e in s))return;const i=s[e];if(typeof i!="function")return;const r=t(i);typeof r=="function"&&hN(r,i);try{s[e]=r}catch{X&&R.log(`Failed to replace method "${e}" in object`,s)}}function Kt(s,e,t){try{Object.defineProperty(s,e,{value:t,writable:!0,configurable:!0})}catch{X&&R.log(`Failed to add non-enumerable property "${e}" to object`,s)}}function hN(s,e){try{const t=e.prototype||{};s.prototype=e.prototype=t,Kt(s,"__sentry_original__",e)}catch{}}function ha(s){return s.__sentry_original__}function zN(s){if(ja(s))return{message:s.message,name:s.name,stack:s.stack,...ZM(s)};if(so(s)){const e={type:s.type,target:VM(s.target),currentTarget:VM(s.currentTarget),...ZM(s)};return typeof CustomEvent<"u"&&bt(s,CustomEvent)&&(e.detail=s.detail),e}else return s}function VM(s){try{return Pg(s)?dN(s):Object.prototype.toString.call(s)}catch{return"<unknown>"}}function ZM(s){if(typeof s=="object"&&s!==null){const e={};for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t]);return e}else return{}}function Xg(s,e=40){const t=Object.keys(zN(s));t.sort();const i=t[0];if(!i)return"[object has no keys]";if(i.length>=e)return vr(i,e);for(let r=t.length;r>0;r--){const o=t.slice(0,r).join(", ");if(!(o.length>e))return r===t.length?o:vr(o,e)}return""}function Kg(){const s=ie;return s.crypto||s.msCrypto}function Je(s=Kg()){let e=()=>Math.random()*16;try{if(s!=null&&s.randomUUID)return s.randomUUID().replace(/-/g,"");s!=null&&s.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return s.getRandomValues(t),t[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,t=>(t^(e()&15)>>t/4).toString(16))}function wN(s){var e,t;return(t=(e=s.exception)==null?void 0:e.values)==null?void 0:t[0]}function Vt(s){const{message:e,event_id:t}=s;if(e)return e;const i=wN(s);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||t||"<unknown>":t||"<unknown>"}function gn(s,e,t){const i=s.exception=s.exception||{},r=i.values=i.values||[],o=r[0]=r[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function Rs(s,e){const t=wN(s);if(!t)return;const i={type:"generic",handled:!0},r=t.mechanism;if(t.mechanism={...i,...r,...e},e&&"data"in e){const o={...r==null?void 0:r.data,...e.data};t.mechanism.data=o}}function XM(s){if(qg(s))return!0;try{Kt(s,"__sentry_captured__",!0)}catch{}return!1}function qg(s){try{return s.__sentry_captured__}catch{}}const CN=1e3;function Wi(){return Date.now()/CN}function ej(){const{performance:s}=ie;if(!(s!=null&&s.now))return Wi;const e=Date.now()-s.now(),t=s.timeOrigin==null?e:s.timeOrigin;return()=>(t+s.now())/CN}const zt=ej();function tj(s){const e=zt(),t={sid:Je(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>ij(t)};return s&&Fs(t,s),t}function Fs(s,e={}){if(e.user&&(!s.ipAddress&&e.user.ip_address&&(s.ipAddress=e.user.ip_address),!s.did&&!e.did&&(s.did=e.user.id||e.user.email||e.user.username)),s.timestamp=e.timestamp||zt(),e.abnormal_mechanism&&(s.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(s.ignoreDuration=e.ignoreDuration),e.sid&&(s.sid=e.sid.length===32?e.sid:Je()),e.init!==void 0&&(s.init=e.init),!s.did&&e.did&&(s.did=`${e.did}`),typeof e.started=="number"&&(s.started=e.started),s.ignoreDuration)s.duration=void 0;else if(typeof e.duration=="number")s.duration=e.duration;else{const t=s.timestamp-s.started;s.duration=t>=0?t:0}e.release&&(s.release=e.release),e.environment&&(s.environment=e.environment),!s.ipAddress&&e.ipAddress&&(s.ipAddress=e.ipAddress),!s.userAgent&&e.userAgent&&(s.userAgent=e.userAgent),typeof e.errors=="number"&&(s.errors=e.errors),e.status&&(s.status=e.status)}function sj(s,e){let t={};s.status==="ok"&&(t={status:"exited"}),Fs(s,t)}function ij(s){return{sid:`${s.sid}`,init:s.init,started:new Date(s.started*1e3).toISOString(),timestamp:new Date(s.timestamp*1e3).toISOString(),status:s.status,errors:s.errors,did:typeof s.did=="number"||typeof s.did=="string"?`${s.did}`:void 0,duration:s.duration,abnormal_mechanism:s.abnormal_mechanism,attrs:{release:s.release,environment:s.environment,ip_address:s.ipAddress,user_agent:s.userAgent}}}function Bi(s,e,t=2){if(!e||typeof e!="object"||t<=0)return e;if(s&&Object.keys(e).length===0)return s;const i={...s};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=Bi(i[r],e[r],t-1));return i}const jn="_sentrySpan";function KM(s,e){e?Kt(s,jn,e):delete s[jn]}function qM(s){return s[jn]}function ec(){return Je()}function IN(){return Je().substring(16)}const rj=100;class wt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ec(),sampleRand:Math.random()}}clone(){const e=new wt;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,KM(e,qM(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Fs(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t=typeof e=="function"?e(this):e,i=t instanceof wt?t.getScopeData():_i(t)?e:void 0,{tags:r,extra:o,user:n,contexts:a,level:c,fingerprint:l=[],propagationContext:N}=i||{};return this._tags={...this._tags,...r},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},n&&Object.keys(n).length&&(this._user=n),c&&(this._level=c),l.length&&(this._fingerprint=l),N&&(this._propagationContext=N),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,KM(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ec(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){var o;const i=typeof t=="number"?t:rj;if(i<=0)return this;const r={timestamp:Wi(),...e,message:e.message?vr(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>i&&(this._breadcrumbs=this._breadcrumbs.slice(-i),(o=this._client)==null||o.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qM(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Bi(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const i=(t==null?void 0:t.event_id)||Je();if(!this._client)return R.warn("No client configured on scope - will not capture exception!"),i;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:i},this),i}captureMessage(e,t,i){const r=(i==null?void 0:i.event_id)||Je();if(!this._client)return R.warn("No client configured on scope - will not capture message!"),r;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...i,event_id:r},this),r}captureEvent(e,t){const i=(t==null?void 0:t.event_id)||Je();return this._client?(this._client.captureEvent(e,{...t,event_id:i},this),i):(R.warn("No client configured on scope - will not capture event!"),i)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function oj(){return to("defaultCurrentScope",()=>new wt)}function nj(){return to("defaultIsolationScope",()=>new wt)}class aj{constructor(e,t){let i;e?i=e:i=new wt;let r;t?r=t:r=new wt,this._stack=[{scope:i}],this._isolationScope=r}withScope(e){const t=this._pushScope();let i;try{i=e(t)}catch(r){throw this._popScope(),r}return io(i)?i.then(r=>(this._popScope(),r),r=>{throw this._popScope(),r}):(this._popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Gs(){const s=qr(),e=eo(s);return e.stack=e.stack||new aj(oj(),nj())}function Mj(s){return Gs().withScope(s)}function cj(s,e){const t=Gs();return t.withScope(()=>(t.getStackTop().scope=s,e(s)))}function tc(s){return Gs().withScope(()=>s(Gs().getIsolationScope()))}function uj(){return{withIsolationScope:tc,withScope:Mj,withSetScope:cj,withSetIsolationScope:(s,e)=>tc(e),getCurrentScope:()=>Gs().getScope(),getIsolationScope:()=>Gs().getIsolationScope()}}function za(s){const e=eo(s);return e.acs?e.acs:uj()}function Ct(){const s=qr();return za(s).getCurrentScope()}function Ji(){const s=qr();return za(s).getIsolationScope()}function lj(){return to("globalScope",()=>new wt)}function Nj(...s){const e=qr(),t=za(e);if(s.length===2){const[i,r]=s;return i?t.withSetScope(i,r):t.withScope(r)}return t.withScope(s[0])}function Ee(){return Ct().getClient()}function Lj(s){const e=s.getPropagationContext(),{traceId:t,parentSpanId:i,propagationSpanId:r}=e,o={trace_id:t,span_id:r||IN()};return i&&(o.parent_span_id=i),o}const gj="sentry.source",jj="sentry.sample_rate",yj="sentry.previous_trace_sample_rate",Tj="sentry.op",Dj="sentry.origin",pN="sentry.profile_id",AN="sentry.exclusive_time",dj=0,hj=1,zj="_sentryScope",wj="_sentryIsolationScope";function mN(s){return{scope:s[zj],isolationScope:s[wj]}}function Cj(s){if(typeof s=="boolean")return Number(s);const e=typeof s=="string"?parseFloat(s):s;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Ij="sentry-",pj=/^sentry-/;function Aj(s){const e=mj(s);if(!e)return;const t=Object.entries(e).reduce((i,[r,o])=>{if(r.match(pj)){const n=r.slice(Ij.length);i[n]=o}return i},{});if(Object.keys(t).length>0)return t}function mj(s){if(!(!s||!ht(s)&&!Array.isArray(s)))return Array.isArray(s)?s.reduce((e,t)=>{const i=sc(t);return Object.entries(i).forEach(([r,o])=>{e[r]=o}),e},{}):sc(s)}function sc(s){return s.split(",").map(e=>e.split("=").map(t=>{try{return decodeURIComponent(t.trim())}catch{return}})).reduce((e,[t,i])=>(t&&i&&(e[t]=i),e),{})}const ON=1;let ic=!1;function Oj(s){const{spanId:e,traceId:t,isRemote:i}=s.spanContext(),r=i?e:wa(s).parent_span_id,o=mN(s).scope,n=i?(o==null?void 0:o.getPropagationContext().propagationSpanId)||IN():e;return{parent_span_id:r,span_id:n,trace_id:t}}function Ej(s){if(s&&s.length>0)return s.map(({context:{spanId:e,traceId:t,traceFlags:i,...r},attributes:o})=>({span_id:e,trace_id:t,sampled:i===ON,attributes:o,...r}))}function rc(s){return typeof s=="number"?oc(s):Array.isArray(s)?s[0]+s[1]/1e9:s instanceof Date?oc(s.getTime()):zt()}function oc(s){return s>9999999999?s/1e3:s}function wa(s){var i;if(xj(s))return s.getSpanJSON();const{spanId:e,traceId:t}=s.spanContext();if(fj(s)){const{attributes:r,startTime:o,name:n,endTime:a,status:c,links:l}=s,N="parentSpanId"in s?s.parentSpanId:"parentSpanContext"in s?(i=s.parentSpanContext)==null?void 0:i.spanId:void 0;return{span_id:e,trace_id:t,data:r,description:n,parent_span_id:N,start_timestamp:rc(o),timestamp:rc(a)||void 0,status:Sj(c),op:r[Tj],origin:r[Dj],links:Ej(l)}}return{span_id:e,trace_id:t,start_timestamp:0,data:{}}}function fj(s){const e=s;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function xj(s){return typeof s.getSpanJSON=="function"}function _j(s){const{traceFlags:e}=s.spanContext();return e===ON}function Sj(s){if(!(!s||s.code===dj))return s.code===hj?"ok":s.message||"unknown_error"}const kj="_sentryRootSpan";function EN(s){return s[kj]||s}function nc(){ic||(Zs(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),ic=!0)}const fN=50,qt="?",ac=/\(error: (.*)\)/,Mc=/captureMessage|captureException/;function xN(...s){const e=s.sort((t,i)=>t[0]-i[0]).map(t=>t[1]);return(t,i=0,r=0)=>{const o=[],n=t.split(`
1
+ import{c as U,j as Q,o as Pe,a as YM,b as vM,d as bM,P as _}from"./createSvgIcon-BQT-7-GS.js";import{i as f,R as M}from"./iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js";import{i as j,S as cn,c as Ne,I as Oe,b as nt,L as ML,D as uN,C as lN,a5 as cL,a6 as Z,a7 as uL,a8 as lL,a9 as NL,aa as LL,P as QM,ab as gL,ac as jL,ad as yL,ae as TL,af as DL,ag as UM,ah as dL,ai as hL,aj as zL,ak as wL,al as CL,am as IL,an as pL,ao as AL,ap as mL,R as B,aq as OL,ar as EL,as as fL,at as $M,au as PM,av as xL,aw as WM,V as _L,ax as SL,ay as kL,az as YL,aA as BM,aB as vL,aC as bL,aD as QL,G as UL,a as Pi}from"./index-CuCs5aLs.js";import{c as ir,g as $L}from"./_commonjsHelpers-Cpj98o6Y.js";import{u as PL}from"./useTheme-DF6qfrtI.js";import"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";const un=U(Q.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),WL=U(Q.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),BL=U(Q.jsx("path",{d:"m10 17 5-5-5-5z"}),"ArrowRight"),JL=U(Q.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 11h-3v3.75c0 1.24-1.01 2.25-2.25 2.25S8.5 17.99 8.5 16.75s1.01-2.25 2.25-2.25c.46 0 .89.14 1.25.38V11h4zm-3-4V3.5L18.5 9z"}),"AudioFile"),RL=U([Q.jsx("path",{d:"M16.5 12h-9c-.55 0-1 .45-1 1v1h11v-1c0-.55-.45-1-1-1M7.25 8.5h4v2h-4zm5.5 0h4v2h-4z"},"0"),Q.jsx("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 15h-1.5v-1.5h-11V17H5v-3.83c0-.66.25-1.26.65-1.72V9c0-1.1.9-2 2-2H11c.37 0 .72.12 1 .32.28-.2.63-.32 1-.32h3.35c1.1 0 2 .9 2 2v2.45c.4.46.65 1.06.65 1.72z"},"1")],"BedroomParent"),FL=U(Q.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2"}),"Bookmark"),GL=U(Q.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2m0 15-5-2.18L7 18V5h10z"}),"BookmarkBorder"),HL=U(Q.jsx("path",{d:"M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 1.83-1.83c.39-.39 1.02-.39 1.41 0l2.34 2.34c.39.39.39 1.02 0 1.41z"}),"BorderColor"),VL=U(Q.jsx("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness4"),ZL=U(Q.jsx("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"}),"Brightness5"),ca=U(Q.jsx("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18V6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness6"),XL=U(Q.jsx("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4"}),"Brightness7"),KL=U(Q.jsx("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build"),qL=U(Q.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),ua=U(Q.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),eg=U(Q.jsx("path",{d:"m20.71 5.63-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42M6.92 19 5 17.08l8.06-8.06 1.92 1.92z"}),"Colorize"),tg=U(Q.jsx("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"Construction"),sg=U(Q.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),NN=U(Q.jsx("path",{d:"M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3z"}),"CreateNewFolder"),ig=U(Q.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"Crop"),rg=U(Q.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),Kr=U(Q.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),og=U(Q.jsx("path",{d:"M18.41 5.8 17.2 4.59c-.78-.78-2.05-.78-2.83 0l-2.68 2.68L3 15.96V20h4.04l8.74-8.74 2.63-2.63c.79-.78.79-2.05 0-2.83M6.21 18H5v-1.21l8.66-8.66 1.21 1.21zM11 20l4-4h6v4z"}),"DriveFileRenameOutline"),mi=U(Q.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),ng=U(Q.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),ag=U(Q.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),Mg=U(Q.jsx("path",{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3"}),"FindInPage"),cg=U(Q.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen"),ug=U(Q.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z"}),"FolderSpecial"),lg=U(Q.jsx("path",{d:"M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-4.05 16.5-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13z"}),"FontDownload"),Ng=U(Q.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),Lg=U(Q.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),la=U(Q.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),LN=U(Q.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),gg=U(Q.jsx("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"}),"KeyboardReturn"),gN=U(Q.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),jg=U(Q.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),yg=U(Q.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),Tg=U(Q.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14h-2V9h-2V7h4z"}),"LooksOne"),Dg=U(Q.jsx("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote"),dg=U(Q.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),Na=U(Q.jsx("path",{d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonOutlined"),hg=U(Q.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Photo"),Sr=U(Q.jsx("path",{d:"M5 4v2h14V4zm0 10h4v6h6v-6h4l-7-7z"}),"Publish"),jN=U(Q.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),La=U(Q.jsx("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1s1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router"),zg=U(Q.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),ln=U(Q.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),kr=U(Q.jsx("path",{d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m7-7H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-1.75 9c0 .23-.02.46-.05.68l1.48 1.16c.13.11.17.3.08.45l-1.4 2.42c-.09.15-.27.21-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.26 1.85c-.03.17-.18.3-.35.3h-2.8c-.17 0-.32-.13-.35-.29l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.74.7c-.16.06-.34 0-.43-.15l-1.4-2.42c-.09-.15-.05-.34.08-.45l1.48-1.16c-.03-.23-.05-.46-.05-.69s.02-.46.05-.68l-1.48-1.16c-.13-.11-.17-.3-.08-.45l1.4-2.42c.09-.15.27-.21.43-.15l1.74.7c.36-.28.76-.51 1.18-.69l.26-1.85c.03-.17.18-.3.35-.3h2.8c.17 0 .32.13.35.29l.26 1.85c.43.18.82.41 1.18.69l1.74-.7c.16-.06.34 0 .43.15l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.16c.03.23.05.46.05.69"}),"SettingsApplications"),wg=U(Q.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),ga=U(Q.jsx("path",{d:"M11.99 2c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10m3.61 6.34c1.07 0 1.93.86 1.93 1.93s-.86 1.93-1.93 1.93-1.93-.86-1.93-1.93c-.01-1.07.86-1.93 1.93-1.93m-6-1.58c1.3 0 2.36 1.06 2.36 2.36s-1.06 2.36-2.36 2.36-2.36-1.06-2.36-2.36c0-1.31 1.05-2.36 2.36-2.36m0 9.13v3.75c-2.4-.75-4.3-2.6-5.14-4.96 1.05-1.12 3.67-1.69 5.14-1.69.53 0 1.2.08 1.9.22-1.64.87-1.9 2.02-1.9 2.68M11.99 20c-.27 0-.53-.01-.79-.04v-4.07c0-1.42 2.94-2.13 4.4-2.13 1.07 0 2.92.39 3.84 1.15-1.17 2.97-4.06 5.09-7.45 5.09"}),"SupervisedUserCircle"),Cg=U(Q.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),Ig=U(Q.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFileOutlined"),pg=U(Q.jsx("path",{d:"M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z"}),"VerticalAlignBottom"),Ag=U(Q.jsx("path",{d:"M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z"}),"VerticalAlignTop"),mg=U(Q.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),Og=U(Q.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn"),Eg=U(Q.jsx("path",{d:"M4 15h16v-2H4zm0 4h16v-2H4zm0-8h16V9H4zm0-6v2h16V5z"}),"ViewHeadline"),fg=U(Q.jsx("path",{d:"M14.67 5v6.5H9.33V5zm1 6.5H21V5h-5.33zm-1 7.5v-6.5H9.33V19zm1-6.5V19H21v-6.5zm-7.34 0H3V19h5.33zm0-1V5H3v6.5z"}),"ViewModule"),xg=U(Q.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),_g=U(Q.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),Qs=U(Q.jsx("path",{d:"m1 9 2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9m8 8 3 3 3-3c-1.65-1.66-4.34-1.66-6 0m-4-4 2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13"}),"Wifi"),rr=U(Q.jsx("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff"),Oo=11/23/100;function JM(s){const e={r:0,g:0,b:0};if(s.length===7)e.r=parseInt(s.substring(1,3),16),e.g=parseInt(s.substring(3,5),16),e.b=parseInt(s.substring(5,7),16);else if(s.length===4){const t=s[1],i=s[2],r=s[3];e.r=parseInt(t+t,16),e.g=parseInt(i+i,16),e.b=parseInt(r+r,16)}return e}function Sg(s){return`#${Math.round(s.r).toString(16)}${Math.round(s.g).toString(16)}${Math.round(s.b).toString(16)}`}function kg(s,e,t){const i=JM(s),r=JM(e);return i.r+=r.r*(.05+Oo*(t-1)),i.g+=r.g*(.05+Oo*(t-1)),i.b+=r.b*(.05+Oo*(t-1)),Sg(i)}function RM(s,e){const t={};for(let i=1;i<=24;i++)t[`elevation${i}`]={backgroundColor:kg(s,e,i)};return t}function Yg(s,e){var n,a,c,l,N,u,L,g,y,T,D;let t,i;s==="dark"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#272727"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[200],"&:hover":{color:Pe[100]}}},MuiPaper:RM("#121212","#fff")},t={name:s,palette:{mode:"dark",background:{paper:"#121212",default:"#121212"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):s==="blue"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#3399CC"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"dark",background:{paper:"#151d21",default:"#151d21"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):s==="colored"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#2a3135"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[200],"&:hover":{color:Pe[100]}}},MuiPaper:RM("#151d21","#fff")},t={name:s,palette:{mode:"light",primary:{main:"#3399CC"},secondary:{main:"#164477"},expert:"#96fc96"}}):s==="PT"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#0F99DE"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#0F99DE"},secondary:{main:"#88A536"},expert:"#BD1B24"}}):s==="DX"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#a9a9a9"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#F5F5F7"},secondary:{main:"#a9a9a9"},expert:"#BD1B24",text:{primary:"#007AFE",secondary:"#007AFE",disabled:"#007AFEAA"}}}):(i={MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#3399CC",dark:"#256c97",light:"#76d0fd"},secondary:{main:"#164477"},expert:"#14bb00"}}),t.toolbar={height:48},t.saveToolbar={background:(a=(n=t.palette)==null?void 0:n.primary)==null?void 0:a.main,button:{borderRadius:3,height:32}},t.palette&&(t.palette.grey={main:YM[300],dark:YM[400]});const r=vM(t),o=r.palette;return vM(r,{...e||void 0,components:{...i,MuiButton:{variants:[{props:{variant:"contained",color:"grey"},style:{backgroundColor:(c=o.grey)==null?void 0:c[300],color:o.getContrastText&&((l=o.grey)!=null&&l[300])?o.getContrastText(o.grey[300]):void 0}},{props:{variant:"outlined",color:"grey"},style:{color:(N=o.text)==null?void 0:N.primary,borderColor:o.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)","&.Mui-disabled":{border:`1px solid ${(u=o.action)==null?void 0:u.disabledBackground}`},"&:hover":{borderColor:o.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)",backgroundColor:bM(((L=o.text)==null?void 0:L.primary)||"",((g=o.action)==null?void 0:g.hoverOpacity)||.04)}}},{props:{variant:"text",color:"grey"},style:{color:(y=o.text)==null?void 0:y.primary,"&:hover":{backgroundColor:bM(((T=o.text)==null?void 0:T.primary)||"",((D=o.action)==null?void 0:D.hoverOpacity)||.04)}}}]},...(e==null?void 0:e.components)||void 0}})}function vg(){let s,e;const t=new Promise((i,r)=>{s=i,e=r});return t.resolve=s,t.reject=e,t}function Nn(s){return(s==null?void 0:s.rows.map(e=>e.value).filter(e=>!!e))??[]}function Tt(s){return s!=null&&s.startsWith("system.host.")||(s=`system.host.${s}`),s}function ui(s){return s!=null&&s.startsWith("system.host.")&&(s=s.substring(12)),s}function FM(s){return new Promise(e=>{setTimeout(e,s)})}function or(s){s=(s||"").toString();const e=s[0]==="*",t=s[s.length-1]==="*";return s=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"),(e?"":"^")+s+(t?"":"$")}var rt;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.CONNECTED=1]="CONNECTED",s[s.OBJECTS_LOADED=2]="OBJECTS_LOADED",s[s.READY=3]="READY"})(rt||(rt={}));var Ie;(function(s){s.PERMISSION_ERROR="permissionError",s.NOT_CONNECTED="notConnectedError",s.TIMEOUT="timeout",s.NOT_ADMIN="Allowed only in admin",s.NOT_SUPPORTED="Not supported"})(Ie||(Ie={}));const $3e=Ie.PERMISSION_ERROR;Ie.NOT_CONNECTED;const bg=["material","echarts","vis"];class ze{constructor(e){this.props=this.applyDefaultProps(e),this.connId=`${this.props.name?`${this.props.name}-`:""}${Math.round(Math.random()*1e6).toString().padStart(6,"0")}`,this.waitForSocketLib().then(()=>this.startSocket()).catch(t=>{alert(`Socket connection could not be initialized: ${t}`)})}applyDefaultProps(e){return{...e,protocol:e.protocol||window.location.protocol,host:e.host||window.location.hostname,port:e.port||(window.location.port==="3000"?8081:window.location.port),ioTimeout:Math.max(e.ioTimeout||2e4,2e4),cmdTimeout:Math.max(e.cmdTimeout||5e3,5e3),admin5only:e.admin5only||!1,autoSubscribes:e.autoSubscribes??[],autoSubscribeLog:e.autoSubscribeLog??!1,doNotLoadACL:e.doNotLoadACL??!0,doNotLoadAllObjects:e.doNotLoadAllObjects??!0}}props;connId;lastAccessToken=null;ignoreState="";connected=!1;subscribed=!1;firstConnect=!0;waitForRestart=!1;loaded=!1;simStates={};statesSubscribes={};filesSubscribes={};objectsSubscribes={};objects={};states={};acl=null;isSecure=!1;onReadyDone=!1;onConnectionHandlers=[];onLogHandlers=[];onCmdStdoutHandler;onCmdStderrHandler;onCmdExitHandler;onError(e){(this.props.onError??console.error)(e)}_socket;_waitForSocketPromise;_waitForFirstConnectionPromise=vg();_instanceSubscriptions={};_promises={};_authTimer=null;_refreshTimer=null;_systemConfig;get systemConfig(){return this._systemConfig}systemLang="en";static isWeb(){return window.socketUrl!==void 0}waitForSocketLib(){return this._waitForSocketPromise?this._waitForSocketPromise:(this._waitForSocketPromise=new Promise(async(e,t)=>{if(typeof window.io>"u"&&typeof window.iob>"u")if(typeof window.registerSocketOnLoad=="function")window.registerSocketOnLoad(()=>e());else{for(let i=1;i<=30;i++){if(window.io||window.iob)return e();await FM(100)}t(new Error("Socket library could not be loaded!"))}else e()}),this._waitForSocketPromise)}async startSocket(){if(this._socket)return;let e=this.props.host,t=this.props.port,i=(this.props.protocol||window.location.protocol).replace(":",""),r=window.location.pathname;if(window.location.hostname==="iobroker.net"||window.location.hostname==="iobroker.pro")r="";else{if(window.socketUrl){const a=new URL(window.socketUrl);e=a.hostname,t=a.port,i=a.protocol.replace(":","")}const n=r.lastIndexOf("/");if(n!==-1&&(r=r.substring(0,n+1)),ze.isWeb()){const a=r.split("/");a.length>2&&(a.pop(),a.pop(),bg.includes(a[a.length-1])&&a.pop(),r=a.join("/"),r.endsWith("/")||(r+="/"))}}const o=t?`${i}://${e}:${t}`:`${i}://${e}`;return this._socket=(window.io||window.iob).connect(o,{path:r.endsWith("/")?`${r}socket.io`:`${r}/socket.io`,query:"ws=true",name:this.props.name,timeout:this.props.ioTimeout,uuid:this.props.uuid,token:this.props.token}),this._socket.on("connect",n=>{window.addEventListener("storage",this.onAccessTokenUpdated);const a=ze.readTokens();if(a&&!a.owner){const c=Date.now();this.saveTokens({access_token:a.access_token,refresh_token:a.refresh_token,expires_in:Math.round((a.expires_in.getTime()-c)/1e3),refresh_token_expires_in:Math.round((a.refresh_token_expires_in.getTime()-c)/1e3),token_type:"Bearer"},a.stayLoggedIn)}this.onReadyDone=!1,n!==!0?(this.connected=!0,setTimeout(()=>this.getVersion().then(c=>{const[l,N,u]=c.version.split(".");parseInt(l,10)*1e4+parseInt(N,10)*100+parseInt(u,10)<40102?(this._authTimer=null,this.onPreConnect(!1,!1)):this._socket.emit("authenticate",(g,y)=>this.onPreConnect(g,y))}).catch(c=>this.onError({message:c.toString(),operation:"getVersion"})),500)):this._socket.emit("authenticate",(c,l)=>{this.onPreConnect(c,l)})}),this._socket.on("reconnect",()=>{var n,a;this.onReadyDone=!1,(a=(n=this.props).onProgress)==null||a.call(n,rt.READY),this.connected=!0,this.waitForRestart?window.location.reload():(this._subscribe(!0),this.onConnectionHandlers.forEach(c=>c(!0)))}),this._socket.on("disconnect",()=>{var n,a;this.onReadyDone=!1,this.connected=!1,this.subscribed=!1,(a=(n=this.props).onProgress)==null||a.call(n,rt.CONNECTING),this.onConnectionHandlers.forEach(c=>c(!1))}),this._socket.on("reauthenticate",()=>this.authenticate()),this._socket.on("log",n=>{var a,c;(c=(a=this.props).onLog)==null||c.call(a,n),this.onLogHandlers.forEach(l=>l(n))}),this._socket.on("error",n=>{let a;n==null?a="":typeof n.toString=="function"?a=n.toString():(a=JSON.stringify(n),console.error(`Received strange error: ${a}`)),a.includes("User not authorized")?this.authenticate():a.includes("websocket error")?(console.error(`Socket Error => reload: ${n}`),window.location.reload()):console.error(`Socket Error: ${n}`)}),this._socket.on("connect_error",n=>console.error(`Connect error: ${n}`)),this._socket.on("permissionError",n=>this.onError({message:"no permission",operation:n.operation,type:n.type,id:n.id||""})),this._socket.on("objectChange",(n,a)=>{setTimeout(()=>this.objectChange(n,a),0)}),this._socket.on("stateChange",(n,a)=>{setTimeout(()=>this.stateChange(n,a),0)}),this._socket.on("im",(n,a,c)=>{setTimeout(()=>this.instanceMessage(n,a,c),0)}),this._socket.on("fileChange",(n,a,c)=>{setTimeout(()=>this.fileChange(n,a,c),0)}),this._socket.on("cmdStdout",(n,a)=>{var c;(c=this.onCmdStdoutHandler)==null||c.call(this,n,a)}),this._socket.on("cmdStderr",(n,a)=>{var c;(c=this.onCmdStderrHandler)==null||c.call(this,n,a)}),this._socket.on("cmdExit",(n,a)=>{var c;(c=this.onCmdExitHandler)==null||c.call(this,n,a)}),Promise.resolve()}onPreConnect(e,t){var i,r;this._authTimer&&(clearTimeout(this._authTimer),this._authTimer=null),this.connected=!0,this.isSecure=t,this.waitForRestart?window.location.reload():(this.firstConnect?this.loadData().catch(o=>console.error(`Cannot load data: ${o}`)):(r=(i=this.props).onProgress)==null||r.call(i,rt.READY),this._subscribe(!0),this.onConnectionHandlers.forEach(o=>o(!0)),this.checkAccessTokenExpire()),this._waitForFirstConnectionPromise.resolve()}static readTokens(){let e=window.sessionStorage.getItem("iob_tokens");const t=!e;if(e||(e=window.localStorage.getItem("iob_tokens")),!e)return null;const[i,r,o,n,a]=e.split(";"),c=new Date(r);return c.getTime()<Date.now()?null:{refresh_token:i,refresh_token_expires_in:c,access_token:o,expires_in:new Date(n),owner:a,stayLoggedIn:t}}static saveTokensStatic(e,t,i){const r=`${e.refresh_token};${new Date(Date.now()+e.refresh_token_expires_in*1e3).toISOString()};${e.access_token};${new Date(Date.now()+e.expires_in*1e3).toISOString()}${i?`;${i}`:""}`;t?window.localStorage.setItem("iob_tokens",r):window.sessionStorage.setItem("iob_tokens",r)}saveTokens(e,t){ze.saveTokensStatic(e,t,this.connId)}static deleteTokensStatic(){window.localStorage.removeItem("iob_tokens"),window.sessionStorage.removeItem("iob_tokens")}deleteTokens(e,t){const i=ze.readTokens();i&&(t?ze.deleteTokensStatic():i.stayLoggedIn===e&&i.owner===this.connId&&(i.stayLoggedIn?window.localStorage.removeItem("iob_tokens"):window.sessionStorage.removeItem("iob_tokens")))}onAccessTokenUpdated=e=>{if(e.key==="iob_tokens"){const t=ze.readTokens();t&&(console.log(`Tab ${this.connId} received updated token: ${t.access_token}`),this.updateTokenExpiration(t.access_token))}};updateTokenExpiration(e){this.lastAccessToken!==e&&(this.lastAccessToken=e,this._socket.emit("updateTokenExpiration",e,(t,i)=>{t?(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token: ${t}`),window.location.reload()):i?console.log(`[UPDATE/${new Date().toISOString()}] server accepted new token: ${e}`):(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token`),window.location.reload())})),this.checkAccessTokenExpire()}refreshTokens(e,t){if(!e){console.log(`[REFRESH/${new Date().toISOString()}] No token structure found => reloading the page`),setTimeout(()=>window.location.reload(),500);return}t||!e.owner||e.owner===this.connId?(console.log(`[REFRESH/${new Date().toISOString()}] claim ownership of the token`),this.acquireTokenLock()?(console.log(`[REFRESH/${new Date().toISOString()}] refreshing token`),fetch("./oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=refresh_token&refresh_token=${e.refresh_token}&client_id=ioBroker&stayloggedin=${e.stayLoggedIn}`}).then(i=>{if(i.ok)return i.json();throw new Error("Cannot refresh access token")}).then(i=>{if(i.access_token)console.log(`[REFRESH/${new Date().toISOString()}] received new token: ${i.access_token}`),this.saveTokens(i,e.stayLoggedIn),this.releaseTokenLock(),this.updateTokenExpiration(i.access_token);else throw new Error("Cannot get access token")}).catch(i=>{console.warn(`[REFRESH/${new Date().toISOString()}] cannot refresh token: ${i}`),this.releaseTokenLock(),this.deleteTokens(e.stayLoggedIn),console.error(i),window.location.reload()})):(console.log(`[REFRESH/${new Date().toISOString()}] Someone else is updating the token, so wait for the next check`),this.checkAccessTokenExpire())):this.lastAccessToken!==e.access_token&&this.updateTokenExpiration(e.access_token)}acquireTokenLock(){const e=Date.now(),t=localStorage.getItem("iob_token_semaphore");if(t)try{const r=JSON.parse(t);if(e<r.expiry)return!1}catch{}const i={connId:this.connId,expiry:e+10*1e3};return localStorage.setItem("iob_token_semaphore",JSON.stringify(i)),!0}releaseTokenLock(){const e=localStorage.getItem("iob_token_semaphore");if(e)try{JSON.parse(e).connId===this.connId&&localStorage.removeItem("iob_token_semaphore")}catch{localStorage.removeItem("iob_token_semaphore")}}checkAccessTokenExpire(){if(this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null),this.isSecure){const e=ze.readTokens();if(e){const t=e.expires_in.getTime();if(t<Date.now()+3e4){const i=t<Date.now()+5500;console.log(`[TOKEN/${new Date().toISOString()}] Updating refresh token ${e.access_token}`),e.refresh_token?e.owner===this.connId||i?(e.owner===this.connId?console.log(`[TOKEN/${new Date().toISOString()}] We are the owner of the token`):console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will take ownership`),this.props.tokenTimeoutHandler?(console.log(`[TOKEN/${new Date().toISOString()}] Asking GUI if we should prolong the token`),this.props.tokenTimeoutHandler(t).then(r=>{r?(console.log(`[TOKEN/${new Date().toISOString()}] Token will be prolonged`),this.refreshTokens(e,i)):(console.log(`[TOKEN/${new Date().toISOString()}] Token will not be prolonged. Reloading the page`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))})):(console.log(`[TOKEN/${new Date().toISOString()}] No tokenTimeoutHandler defined. Prolonging the token`),this.refreshTokens(e,i))):this.lastAccessToken!==e.access_token?(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will inform the server about new token`),this.refreshTokens(e)):(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token and the token did not change. Check in 3 seconds if the owner updated the token`),this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},3e3)):(console.log(`[TOKEN/${new Date().toISOString()}] We do not have a refresh token, so we need to reauthenticate`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))}else this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},t-Date.now()-3e4>12e4?12e4:t-Date.now()-3e4)}}}static isCloud(){return window.location.hostname.includes("amazonaws.com")||window.location.hostname.includes("iobroker.in")?!0:typeof window.socketUrl>"u"?!1:window.socketUrl.includes("iobroker.in")||window.socketUrl.includes("amazonaws")}isConnected(){return this.connected}waitForFirstConnection(){return this._waitForFirstConnectionPromise}async getUserPermissions(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getUserPermissions",(i,r)=>{i?t(i):e(r||null)})}})}async loadData(){if(this.loaded)return;const e=10;for(let t=1;t<=e;t++){if(this.doLoadData().catch(i=>console.error(`Cannot load data: ${i}`)),this.loaded)return;await FM(ze.isCloud()?5e3:1e3)}}async doLoadData(){var e,t,i,r,o,n,a,c,l;if(!this.loaded){if(!this.props.doNotLoadACL)try{this.acl=await this.getUserPermissions()}catch(N){this.onError(`Cannot read user permissions: ${N}`);return}try{this.props.admin5only&&!ze.isWeb()&&(!window.vendorPrefix||window.vendorPrefix==="@@vendorPrefix@@")?this._systemConfig=await this.getCompactSystemConfig():this._systemConfig=await this.getSystemConfig()}catch(N){this.onError(`Cannot read system config: ${N}`);return}this._systemConfig&&(this.systemLang=(e=this._systemConfig.common)==null?void 0:e.language,this.systemLang||(this.systemLang=window.navigator.userLanguage||window.navigator.language,/^(en|de|ru|pt|nl|fr|it|es|pl|uk)-?/.test(this.systemLang)?this.systemLang=this.systemLang.substring(0,2):/^(en|de|ru|pt|nl|fr|it|es|pl|uk|zh-cn)$/.test(this.systemLang)||(this.systemLang="en"),this._systemConfig.common.language=this.systemLang)),(i=(t=this.props).onLanguage)==null||i.call(t,this.systemLang),this.loaded=!0,(o=(r=this.props).onProgress)==null||o.call(r,rt.CONNECTED),this.firstConnect=!1,this.props.doNotLoadAllObjects?this.props.admin5only?this.objects={}:this.objects={"system.config":this._systemConfig}:this.objects=await this.getObjects(),(a=(n=this.props).onProgress)==null||a.call(n,rt.READY),this.onReadyDone||(this.onReadyDone=!0,(l=(c=this.props).onReady)==null||l.call(c,this.objects))}}authenticate(){window.location.search.includes("&href=")?window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}${window.location.search}`:window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}?login&href=${encodeURIComponent(window.location.search+window.location.hash)}`}async subscribeState(...e){let t,i,r;e.length===3?[t,i,r]=e:([t,r]=e,i=!1);let o;if(Array.isArray(t)?o=t:o=[t],typeof r!="function")throw new Error("The state change handler must be a function!");const n=[];for(let a=0;a<o.length;a++){const c=o[a];this.statesSubscribes[c]?!this.statesSubscribes[c].cbs.includes(r)&&this.statesSubscribes[c].cbs.push(r):(this.statesSubscribes[c]={reg:new RegExp(or(c)),cbs:[r]},t!==this.ignoreState&&n.push(c))}if(this.connected)if(n.length&&this._socket.emit("subscribe",n),i){let a;for(let c=0;c<o.length;c++){try{a=await this.getBinaryState(o[c])}catch(l){console.error(`Cannot getBinaryState "${o[c]}": ${JSON.stringify(l)}`),a=void 0}a!=null&&r(o[c],a)}}else if(o.find(a=>a.includes("*"))){let a;for(let c=0;c<o.length;c++){try{a=await this.getForeignStates(o[c])}catch(l){console.error(`Cannot getForeignStates "${o[c]}": ${JSON.stringify(l)}`);return}if(a)for(const[l,N]of Object.entries(a)){const u=r(l,N);u instanceof Promise&&u.catch(L=>console.error(`Cannot call state change handler: ${L}`))}}}else try{const a=await(ze.isWeb()?this.getStates(o):this.getForeignStates(o));if(a)for(const[c,l]of Object.entries(a)){const N=r(c,l);N instanceof Promise&&N.catch(u=>console.error(`Cannot call state change handler: ${u}`))}}catch(a){console.error(`Cannot getState "${o.join(", ")}": ${a.message}`);return}}async subscribeStateAsync(e,t){return this.subscribeState(e,t)}unsubscribeState(e,t){var o;let i;Array.isArray(e)?i=e:i=[e];const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(this.statesSubscribes[a]){const c=this.statesSubscribes[a];if(t){const l=c.cbs.indexOf(t);l!==-1&&c.cbs.splice(l,1)}else c.cbs=[];(o=c.cbs)!=null&&o.length||(delete this.statesSubscribes[a],a!==this.ignoreState&&r.push(a))}}this.connected&&r.length&&this._socket.emit("unsubscribe",i)}subscribeObject(e,t){let i;if(Array.isArray(e)?i=e:i=[e],typeof t!="function")throw new Error("The object change handler must be a function!");const r=[];for(let o=0;o<i.length;o++){const n=i[o];this.objectsSubscribes[n]?!this.objectsSubscribes[n].cbs.includes(t)&&this.objectsSubscribes[n].cbs.push(t):(this.objectsSubscribes[n]={reg:new RegExp(or(n)),cbs:[t]},r.push(n))}return this.connected&&r.length&&this._socket.emit("subscribeObjects",r),Promise.resolve()}unsubscribeObject(e,t){var o;let i;Array.isArray(e)?i=e:i=[e];const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(this.objectsSubscribes[a]){const c=this.objectsSubscribes[a];if(t){const l=c.cbs.indexOf(t);l!==-1&&c.cbs.splice(l,1)}else c.cbs=[];(o=c.cbs)!=null&&o.length||(delete this.objectsSubscribes[a],r.push(a))}}return this.connected&&r.length&&this._socket.emit("unsubscribeObjects",r),Promise.resolve()}objectChange(e,t){var o,n;let i;this.objects[e]&&(i={_id:e,type:this.objects[e].type});let r=!1;t?(t._rev&&this.objects[e]&&(this.objects[e]._rev=t._rev),(!this.objects[e]||JSON.stringify(this.objects[e])!==JSON.stringify(t))&&(this.objects[e]=t,r=!0)):this.objects[e]&&(delete this.objects[e],r=!0);for(const[a,c]of Object.entries(this.objectsSubscribes))(a===e||c.reg.test(e))&&c.cbs.forEach(l=>{try{const N=l(e,t,i);N instanceof Promise&&N.catch(u=>console.error(`Cannot call object change handler: ${u}`))}catch(N){console.error(`Error by callback of objectChange: ${N}`)}});if(r){const a=(n=(o=this.props).onObjectChange)==null?void 0:n.call(o,e,t);a instanceof Promise&&a.catch(c=>console.error(`Cannot call object change handler: ${c}`))}}stateChange(e,t){for(const i of Object.values(this.statesSubscribes))if(i.reg.test(e))for(const r of i.cbs)try{const o=r(e,t??null);o instanceof Promise&&o.catch(n=>console.error(`Cannot call state change handler: ${n}`))}catch(o){console.error(`Error by callback of stateChanged: ${o}`)}}instanceMessage(e,t,i){var r;(r=this._instanceSubscriptions[t])==null||r.forEach(o=>{if(o.messageType===e){const n=o.callback(i,t,e);n instanceof Promise&&n.catch(a=>console.error(`Cannot call instance message handler: ${a}`))}})}fileChange(e,t,i){for(const r of Object.values(this.filesSubscribes))if(r.regId.test(e)&&r.regFilePattern.test(t))for(const o of r.cbs)try{o(e,t,i)}catch(n){console.error(`Error by callback of fileChange: ${n}`)}}async subscribeFiles(e,t,i){if(typeof i!="function")throw new Error("The state change handler must be a function!");let r;Array.isArray(t)?r=t:r=[t];const o=[];for(let n=0;n<r.length;n++){const a=r[n],c=`${e}$%$${a}`;this.filesSubscribes[c]?!this.filesSubscribes[c].cbs.includes(i)&&this.filesSubscribes[c].cbs.push(i):(this.filesSubscribes[c]={regId:new RegExp(or(e)),regFilePattern:new RegExp(or(a)),cbs:[i]},o.push(a))}return this.connected&&o.length&&this._socket.emit("subscribeFiles",e,o),Promise.resolve()}unsubscribeFiles(e,t,i){var n;let r;Array.isArray(t)?r=t:r=[t];const o=[];for(let a=0;a<r.length;a++){const c=r[a],l=`${e}$%$${c}`;if(this.filesSubscribes[l]){const N=this.filesSubscribes[l];if(i){const u=N.cbs.indexOf(i);u!==-1&&N.cbs.splice(u,1)}else N.cbs=[];(n=N.cbs)!=null&&n.length||(delete this.filesSubscribes[l],o.push(c))}}this.connected&&o.length&&this._socket.emit("unsubscribeFiles",e,o)}async request({cacheKey:e,forceUpdate:t,commandTimeout:i,onTimeout:r,requireAdmin:o,requireFeatures:n,executor:a}){if(o&&ze.isWeb())return Promise.reject(new Error(Ie.NOT_ADMIN));if(e&&!t&&e in this._promises)return this._promises[e];if(!this.connected)return Promise.reject(new Error(Ie.NOT_CONNECTED));if(n!=null&&n.length){for(const l of n)if(!await this.checkFeatureSupported(l))throw new Error(Ie.NOT_SUPPORTED)}const c=new Promise(async(l,N)=>{const u={elapsed:!1,clearTimeout:()=>{}};let L;i!==!1&&(L=setTimeout(()=>{u.elapsed=!0,r==null||r(),e&&this._promises[e]instanceof Promise&&delete this._promises[e],N(new Error(Ie.TIMEOUT))},i??this.props.cmdTimeout),u.clearTimeout=()=>{clearTimeout(L)});try{await a(l,N,u)}catch(g){e&&this._promises[e]instanceof Promise&&delete this._promises[e],N(new Error(g.toString()))}});return e&&(this._promises[e]=c),c}resetCache(e,t){t?Object.keys(this._promises).filter(i=>i.startsWith(e)).forEach(i=>{delete this._promises[i]}):delete this._promises[e]}getStates(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getStates",e,(r,o)=>{this.states=o??{},r?i(r):t(this.states)})}})}getState(e){return this.request({commandTimeout:!1,executor:(t,i)=>{if(e&&e===this.ignoreState){t(this.simStates[e]||{val:null,ack:!0});return}this._socket.emit("getState",e,(r,o)=>{r?i(r):t(o)})}})}getBinaryState(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getBinaryState",e,(r,o)=>{r?i(r):t(o)})}})}setBinaryState(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("setBinaryState",e,t,o=>{o?r(o):i()})}})}setState(e,t,i){return typeof i=="boolean"&&(t={val:t,ack:i}),this.request({commandTimeout:!1,executor:(r,o)=>{if(e&&e===this.ignoreState){let n;if(typeof i=="boolean"||typeof t=="object"&&t.val!==void 0?n=t:n={val:t,ack:!1,ts:Date.now(),lc:Date.now(),from:"system.adapter.vis.0"},this.simStates[e]=n,this.statesSubscribes[e])for(const a of this.statesSubscribes[e].cbs)try{const c=a(e,n);c instanceof Promise&&c.catch(l=>console.error(`Cannot call state change handler: ${l}`))}catch(c){console.error(`Error by callback of stateChanged: ${c}`)}r();return}this._socket.emit("setState",e,t,n=>{n?o(n):r()})}})}getObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{if(!e&&this.objects){i(this.objects);return}this._socket.emit(ze.isWeb()?"getObjects":"getAllObjects",(o,n)=>{var a,c;t||(c=(a=this.props).onProgress)==null||c.call(a,rt.OBJECTS_LOADED),o?r(o):(this.objects=n??{},i(this.objects))})}})}getObjectsById(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjects",e,(r,o)=>{r?i(r):t(o)})}})}_subscribe(e){var t,i;if(e&&!this.subscribed){this.subscribed=!0,(t=this.props.autoSubscribes)!=null&&t.length&&this._socket.emit("subscribeObjects",this.props.autoSubscribes);const r=Object.keys(this.objectsSubscribes);r.length&&this._socket.emit("subscribeObjects",r),Object.keys(this.objectsSubscribes).forEach(o=>this._socket.emit("subscribeObjects",o)),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!0),Object.keys(this.statesSubscribes).forEach(o=>this._socket.emit("subscribe",o)),Object.keys(this.filesSubscribes).forEach(o=>{const[n,a]=o.split("$%$");this._socket.emit("subscribeFiles",n,a)})}else if(!e&&this.subscribed){this.subscribed=!1,(i=this.props.autoSubscribes)!=null&&i.length&&this._socket.emit("unsubscribeObjects",this.props.autoSubscribes);const r=Object.keys(this.objectsSubscribes);r.length&&this._socket.emit("unsubscribeObjects",r),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!1),Object.keys(this.statesSubscribes).forEach(o=>this._socket.emit("unsubscribe",o)),Object.keys(this.filesSubscribes).forEach(o=>{const[n,a]=o.split("$%$");this._socket.emit("unsubscribeFiles",n,a)})}}requireLog(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("requireLog",e,r=>{r?i(r):t()})}})}delObject(e,t=!1){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("delObject",e,{maintenance:t},o=>{o?r(o):i()})}})}delObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("delObjects",e,{maintenance:t},o=>{o?r(o):i()})}})}setObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("setObject",e,t,o=>{o?r(o):i()})}})):Promise.reject(new Error("Null object is not allowed"))}getObject(e){return this.request({commandTimeout:!1,executor:(t,i)=>{if(e&&e===this.ignoreState){t({_id:this.ignoreState,type:"state",common:{name:"ignored state",type:"mixed"}});return}this._socket.emit("getObject",e,(r,o)=>{r?i(r):t(o)})}})}sendTo(e,t,i){return this.request({commandTimeout:!1,executor:r=>{this._socket.emit("sendTo",e,t,i,o=>{r(o)})}})}extendObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("extendObject",e,t,o=>{o?r(o):i()})}})):Promise.reject(new Error("Null object is not allowed"))}registerLogHandler(e){this.onLogHandlers.includes(e)||this.onLogHandlers.push(e)}unregisterLogHandler(e){const t=this.onLogHandlers.indexOf(e);t!==-1&&this.onLogHandlers.splice(t,1)}registerConnectionHandler(e){this.onConnectionHandlers.includes(e)||this.onConnectionHandlers.push(e)}unregisterConnectionHandler(e){const t=this.onConnectionHandlers.indexOf(e);t!==-1&&this.onConnectionHandlers.splice(t,1)}registerCmdStdoutHandler(e){this.onCmdStdoutHandler=e}unregisterCmdStdoutHandler(){this.onCmdStdoutHandler=void 0}registerCmdStderrHandler(e){this.onCmdStderrHandler=e}unregisterCmdStderrHandler(){this.onCmdStderrHandler=void 0}registerCmdExitHandler(e){this.onCmdExitHandler=e}unregisterCmdExitHandler(){this.onCmdExitHandler=void 0}getEnums(e,t){return this.request({cacheKey:`enums_${e||"all"}`,forceUpdate:t,commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getObjectView","system","enum",{startkey:`enum.${e||""}`,endkey:e?`enum.${e}.香`:"enum.香"},(o,n)=>{if(o)r(o);else{const a={};if(n)for(let c=0;c<n.rows.length;c++)e&&n.rows[c].id===`enum.${e}`||(a[n.rows[c].id]=n.rows[c].value);i(a)}})}})}getObjectView(e,t,i){return this.getObjectViewCustom("system",i,e,t)}getObjectViewSystem(e,t,i){return this.getObjectViewCustom("system",e,t,i)}getObjectViewCustom(e,t,i,r){return this.request({commandTimeout:!1,executor:(o,n)=>{i=i||"",r=r||"香",this._socket.emit("getObjectView",e,t,{startkey:i,endkey:r},(a,c)=>{if(a)n(a);else{const l={};if(c&&c.rows)for(let N=0;N<c.rows.length;N++)l[c.rows[N].id]=c.rows[N].value;o(l)}})}})}readMetaItems(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getObjectView","system","meta",{startkey:"",endkey:"香"},(i,r)=>{var o;i?t(i):e((o=r.rows)==null?void 0:o.map(n=>n.value).filter(n=>!!n))})}})}readDir(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("readDir",e,t,(o,n)=>{o?r(o):i(n)})}})}readFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit(i?"readFile64":"readFile",e,t,(n,a,c)=>{n?o(n):r({file:a,mimeType:c})})}})}writeFile64(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{if(typeof i=="string")this._socket.emit("writeFile",e,t,i,n=>{n?o(n):r()});else{const n=btoa(new Uint8Array(i).reduce((a,c)=>a+String.fromCharCode(c),""));this._socket.emit("writeFile64",e,t,n,a=>{a?o(a):r()})}}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFile",e,t,o=>{o?r(o):i()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFolder",e,t,o=>{o?r(o):i()})}})}rename(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("rename",e,t,i,n=>{n?o(n):r()})}})}renameFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("renameFile",e,t,i,n=>{n?o(n):r()})}})}cmdExec(e,t,i,r){return this.request({commandTimeout:r,executor:(o,n,a)=>{e=Tt(e),this._socket.emit("cmdExec",e,i,t,c=>{a.elapsed||(a.clearTimeout(),c?n(c):o())})}})}getSystemConfig(e){return this.request({cacheKey:"systemConfig",forceUpdate:e,commandTimeout:!1,executor:async t=>{let i=await this.getObject("system.config");i??={},i.common??={},i.native??={},t(i)}})}getCompactSystemConfig(e){return this.request({cacheKey:"systemConfigCommon",forceUpdate:e,commandTimeout:!1,requireAdmin:!0,executor:(t,i)=>{this._socket.emit("getCompactSystemConfig",(r,o)=>{r?i(r):(o??={},o.common??={},o.native??={},t(o))})}})}getForeignStates(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getForeignStates",e||"*",(r,o)=>{r?i(r):t(o??{})})}})}getForeignObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getForeignObjects",e||"*",t,(o,n)=>{o?r(o):i(n)})}})}setSystemConfig(e){return this.setObject("system.config",e)}getRawSocket(){return this._socket}getHistory(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getHistory",e,t,(o,n)=>{o?r(o):i(n)})}})}getHistoryEx(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getHistory",e,t,(o,n,a,c)=>{o?r(o):i({values:n,sessionId:c,step:a})})}})}getIpAddresses(e,t){return e=Tt(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObject(e);i((r==null?void 0:r.common.address)??[])}})}getVersion(e){return this.request({cacheKey:"version",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getVersion",(r,o,n)=>{r&&!o&&typeof r=="string"&&r.match(/\d+\.\d+\.\d+/)?t({version:r,serverName:"socketio"}):r?i(r):t({version:o,serverName:n})})}})}getWebServerName(){return this.request({cacheKey:"webName",commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getAdapterName",(i,r)=>{i?t(i):e(r)})}})}fileExists(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("fileExists",e,t,(o,n)=>{o?r(o):i(!!n)})}})}getCurrentUser(){return this.request({commandTimeout:!1,executor:e=>{this._socket.emit("authEnabled",(t,i)=>{e(i)})}})}getUuid(){return this.request({cacheKey:"uuid",commandTimeout:!1,executor:async e=>{var i;const t=await this.getObject("system.meta.uuid");e((i=t==null?void 0:t.native)==null?void 0:i.uuid)}})}checkFeatureSupported(e,t){return this.request({cacheKey:`supportedFeatures_${e}`,forceUpdate:t,commandTimeout:!1,executor:(i,r)=>{this._socket.emit("checkFeatureSupported",e,(o,n)=>{o?r(o):i(n)})}})}getAdapterInstances(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`instances_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=e?`system.adapter.${e}.`:"system.adapter.",o=`${r}香`,n=await this.getObjectViewSystem("instance",r,o),a=Object.values(n);i(e?a.filter(c=>c.common.name===e):a)}})}getAdapters(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`adapter_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObjectViewSystem("adapter",`system.adapter.${e||""}`,`system.adapter.${e||"香"}`),o=Object.values(r);i(e?o.filter(n=>n.common.name===e):o)}})}getGroups(e){return this.request({cacheKey:"groups",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","group",{startkey:"system.group.",endkey:"system.group.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}logout(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("logout",i=>{i?t(i):e(null)})}})}subscribeOnInstance(e,t,i,r){return this.request({commandTimeout:!1,executor:(o,n)=>{this._socket.emit("clientSubscribe",e,t,i,(a,c)=>{a?n(a):c&&(c.error?n(c.error):(e.startsWith("system.adapter.")||(e=`system.adapter.${e}`),this._instanceSubscriptions[e]=this._instanceSubscriptions[e]||[],this._instanceSubscriptions[e].find(l=>l.messageType===t&&l.callback===r)||this._instanceSubscriptions[e].push({messageType:t,callback:r}),o(c)))})}})}unsubscribeFromInstance(e,t,i){var n;e.startsWith("system.adapter.")||(e=`system.adapter.${e}`);let r;const o=[];do{r=!1;const a=(n=this._instanceSubscriptions[e])==null?void 0:n.findIndex(c=>(!t||c.messageType===t)&&(!i||c.callback===i));if(a!=null&&a!==-1){r=!0;const c=this._instanceSubscriptions[e][a].messageType;this._instanceSubscriptions[e].splice(a,1),this._instanceSubscriptions[e].length||delete this._instanceSubscriptions[e],this._instanceSubscriptions[e]&&this._instanceSubscriptions[e].find(N=>N.messageType===c)||o.push(this.request({commandTimeout:!1,executor:(N,u)=>{this._socket.emit("clientUnsubscribe",e,t,(L,g)=>L?u(L):N(g))}}))}}while(r&&(!i||!t));return o.length?Promise.all(o).then(a=>!!a.find(c=>c)):Promise.resolve(!1)}log(e,t){return e?this.request({commandTimeout:!1,executor:i=>(this._socket.emit("log",e,t),i(null))}):Promise.resolve(null)}setStateToIgnore(e){this.ignoreState=e}}function Qg(s,e){if(!e)return;let t;if(e.length<700&&(e.indexOf("/")!==-1||e.indexOf("\\")!==-1))if(s.toLowerCase().includes("private"))t="private";else if(e.toLowerCase().includes("private"))t="private";else if(s.toLowerCase().includes("public"))t="public";else if(e.toLowerCase().includes("public"))t="public";else if(s.toLowerCase().includes("chain"))t="chained";else if(e.toLowerCase().includes("chain"))t="chained";else return;else t=e.substring(0,26)==="-----BEGIN RSA PRIVATE KEY"||e.substring(0,22)==="-----BEGIN PRIVATE KEY"?"private":"public",t==="public"&&e.split("-----END CERTIFICATE-----").filter(r=>r.replace(/\r\n|\r|\n/,"").trim()).length>1&&(t="chained");return{name:s,type:t}}function Ug(s){var i,r,o,n;const e=[{name:"[IPv4] 0.0.0.0 - Listen on all IPs",address:"0.0.0.0",family:"ipv4"}],t=[{name:"[IPv6] :: - Listen on all IPs",address:"::",family:"ipv6"}];if((r=(i=s.native)==null?void 0:i.hardware)!=null&&r.networkInterfaces){const a=(n=(o=s.native)==null?void 0:o.hardware)==null?void 0:n.networkInterfaces;Object.keys(a).forEach(c=>{a[c].forEach(l=>{l.family!=="IPv6"?e.push({name:`[${l.family}] ${l.address} - ${c}`,address:l.address,family:"ipv4"}):t.push({name:`[${l.family}] ${l.address} - ${c}`,address:l.address,family:"ipv6"})})})}return{IPs4:e,IPs6:t}}class P3e extends ze{constructor(e){super(e)}request(e){return super.request({requireAdmin:!0,...e})}getCertificates(e){return this.request({cacheKey:"cert",forceUpdate:e,commandTimeout:!1,executor:async t=>{var r;const i=await this.getObject("system.certificates");(r=i==null?void 0:i.native)!=null&&r.certificates?t(Object.entries(i.native.certificates).map(([o,n])=>Qg(o,n)).filter(o=>!!o)):t([])}})}getLogs(e,t=200){return this.request({commandTimeout:!1,executor:i=>{this._socket.emit("sendToHost",e,"getLogs",t||200,r=>{i(r)})}})}upgradeAdapterWithWebserver(e,t){return this.request({commandTimeout:!1,executor:i=>{this._socket.emit("sendToHost",e,"upgradeAdapterWithWebserver",t,r=>{i(r)})}})}upgradeController(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("sendToHost",e,"upgradeController",{version:t,adminInstance:i},n=>{const a=n;a.error?o(a.error):r(a.result)})}})}updateLicenses(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("updateLicenses",e,t,(o,n)=>{o?r(o):i(n)})}})}upgradeOsPackages(e,t,i){return this.request({commandTimeout:!1,executor:r=>{this._socket.emit("sendToHost",e,"upgradeOsPackages",{packages:t,restart:!!i},o=>{r(o)})}})}getLogsFiles(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("readLogs",e,(r,o)=>{r&&i(r),t(o)})}})}delLogs(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("sendToHost",e,"delLogs",null,r=>{r&&i(r),t()})}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFile",e,t,o=>{o&&r(o),i()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFolder",e,t,o=>{o&&r(o),i()})}})}rename(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("rename",e,t,i,n=>{n&&o(n),r()})}})}renameFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("renameFile",e,t,i,n=>{n&&o(n),r()})}})}getHosts(e){return this.request({cacheKey:"hosts",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","host",{startkey:"system.host.",endkey:"system.host.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}getUsers(e){return this.request({cacheKey:"users",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","user",{startkey:"system.user.",endkey:"system.user.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}renameGroup(e,t,i){return this.request({commandTimeout:!1,executor:async r=>{const o=await this.getGroups(!0),n=o.filter(c=>c._id.startsWith(`${e}.`));for(const c of n){const l=c._id,N=t+c._id.substring(e.length);c._id=N,await this.setObject(N,c),await this.delObject(l)}const a=o.find(c=>c._id===e);if(a){const c=a._id;a._id=t,i!==void 0&&(a.common??={},a.common.name=i),await this.setObject(t,a),await this.delObject(c)}r()}})}getHostInfo(e,t,i){return e=Tt(e),this.request({cacheKey:`hostInfo_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("sendToHost",e,"getHostInfo",null,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getHostInfo"'):a?r(a):o('Cannot read "getHostInfo"'))})}})}getHostInfoShort(e,t,i){return e=Tt(e),this.request({cacheKey:`hostInfoShort_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("sendToHost",e,"getHostInfoShort",null,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getHostInfoShort"'):a?r(a):o('Cannot read "getHostInfoShort"'))})}})}getRepository(e,t,i,r){return this.request({cacheKey:`repository_${e}`,forceUpdate:i,commandTimeout:r,executor:(o,n,a)=>{this._socket.emit("sendToHost",e,"getRepository",t,c=>{a.elapsed||(a.clearTimeout(),c===Ie.PERMISSION_ERROR?n('May not read "getRepository"'):c?o(c):n('Cannot read "getRepository"'))})}})}getInstalled(e,t,i){return e=Tt(e),this.request({cacheKey:`installed_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("sendToHost",e,"getInstalled",null,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getInstalled"'):a?r(a):o('Cannot read "getInstalled"'))})}})}cmdExec(e,t,i,r){return this.request({commandTimeout:r,executor:(o,n,a)=>{e=Tt(e),this._socket.emit("cmdExec",e,i,t,c=>{a.elapsed||(a.clearTimeout(),c&&n(c),o())})}})}readBaseSettings(e){return e=ui(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(t,i,r)=>{this._socket.emit("sendToHost",e,"readBaseSettings",null,o=>{r.elapsed||(r.clearTimeout(),o===Ie.PERMISSION_ERROR?i('May not read "BaseSettings"'):o?o.error?i(new Error(o.error)):t(o):i('Cannot read "BaseSettings"'))})}})}writeBaseSettings(e,t){return e=ui(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"writeBaseSettings",t,n=>{o.elapsed||(o.clearTimeout(),n===Ie.PERMISSION_ERROR?r('May not write "BaseSettings"'):n?i(n):r('Cannot write "BaseSettings"'))})}})}restartController(e){return e=ui(e),this.request({executor:(t,i,r)=>{this._socket.emit("sendToHost",e,"restartController",null,()=>{r.elapsed||(r.clearTimeout(),t(!0))})}})}getDiagData(e,t){return e=ui(e),this.request({executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"getDiagData",t,n=>{o.elapsed||(o.clearTimeout(),i(n||null))})}})}changePassword(e,t){return this.request({executor:(i,r,o)=>{this._socket.emit("changePassword",e,t,n=>{o.elapsed||(o.clearTimeout(),n&&r(n),i())})}})}getIpAddresses(e,t){return e=Tt(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObject(e);i((r==null?void 0:r.common.address)??[])}})}getHostByIp(e,t){return e=ui(e),this.request({cacheKey:`rIPs_${e}`,forceUpdate:t,executor:(i,r,o)=>{this._socket.emit("getHostByIp",e,(n,a)=>{if(o.elapsed)return;o.clearTimeout();const{IPs4:c,IPs6:l}=Ug(a);i([...c,...l])})}})}encrypt(e){return this.request({executor:(t,i,r)=>{this._socket.emit("encrypt",e,(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}decrypt(e){return this.request({executor:(t,i,r)=>{this._socket.emit("decrypt",e,(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}chmodFile(e,t,i){return this.request({executor:(r,o,n)=>{this._socket.emit("chmodFile",e,t,i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}chownFile(e,t,i){return this.request({executor:(r,o,n)=>{this._socket.emit("chownFile",e,t,i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}getNotifications(e,t){return this.request({executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"getNotifications",{category:t},n=>{o.elapsed||(o.clearTimeout(),i(n))})}})}clearNotifications(e,t){return this.request({executor:(i,r,o)=>{this._socket.emit("sendToHost",e,"clearNotifications",{category:t},n=>{o.elapsed||(o.clearTimeout(),i(n))})}})}getIsEasyModeStrict(){return this.request({executor:(e,t,i)=>{this._socket.emit("getIsEasyModeStrict",(r,o)=>{i.elapsed||(i.clearTimeout(),r&&t(r),e(!!o))})}})}getEasyMode(){return this.request({executor:(e,t,i)=>{this._socket.emit("getEasyMode",(r,o)=>{i.elapsed||(i.clearTimeout(),r?t(new Error(r)):e(o))})}})}getRatings(e){return this.request({executor:(t,i,r)=>{this._socket.emit("getRatings",!!e,(o,n)=>{r.elapsed||(r.clearTimeout(),o?i(new Error(o)):t(n))})}})}getCurrentSession(e){const t=new AbortController;return this.request({commandTimeout:e||5e3,onTimeout:()=>{t.abort()},executor:async(i,r,o)=>{try{const n=await fetch("./session",{signal:t.signal});if(o.elapsed)return;o.clearTimeout();const a=await n.json();i(a)}catch(n){r(`getCurrentSession: ${n}`)}}})}getCurrentInstance(){return this.request({cacheKey:"currentInstance",executor:(e,t,i)=>{this._socket.emit("getCurrentInstance",(r,o)=>{i.elapsed||(i.clearTimeout(),r?t(r):e(o))})}})}getAdapterInstances(e,t){let i;return typeof e=="boolean"?(t=e,i=""):i=e||"",this.request({cacheKey:`instances_${i}`,forceUpdate:t,executor:(r,o,n)=>{this._socket.emit("getAdapterInstances",i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}getAdapters(e,t){let i;return typeof e=="boolean"?(t=e,i=""):i=e||"",this.request({cacheKey:`adapter_${i}`,forceUpdate:t,executor:(r,o,n)=>{this._socket.emit("getAdapters",i,(a,c)=>{n.elapsed||(n.clearTimeout(),a&&o(a),r(c))})}})}getCompactAdapters(e){return this.request({cacheKey:"compactAdapters",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactAdapters",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}getAdaptersResetCache(e){e=e??"",this.resetCache(`adapter_${e}`),this.resetCache("compactAdapters")}getCompactInstances(e){return this.request({cacheKey:"compactInstances",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactInstances",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}getAdapterInstancesResetCache(e){e=e??"",this.resetCache(`instances_${e}`),this.resetCache("compactInstances")}getCompactInstalled(e,t,i){return e=Tt(e),this.request({cacheKey:`installedCompact_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("getCompactInstalled",e,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getCompactInstalled"'):a?r(a):o('Cannot read "getCompactInstalled"'))})}})}getInstalledResetCache(e){e?(this.resetCache(`installedCompact_${e}`),this.resetCache(`installed_${e}`)):(this.resetCache("installedCompact_",!0),this.resetCache("installed_",!0))}getCompactRepository(e,t,i){return e=Tt(e),this.request({cacheKey:`repositoryCompact_${e}`,forceUpdate:t,commandTimeout:i,executor:(r,o,n)=>{this._socket.emit("getCompactRepository",e,a=>{n.elapsed||(n.clearTimeout(),a===Ie.PERMISSION_ERROR?o('May not read "getCompactRepository"'):a?r(a):o('Cannot read "getCompactRepository"'))})}})}getRepositoryResetCache(e){e?(this.resetCache(`repositoryCompact_${e}`),this.resetCache(`repository_${e}`)):(this.resetCache("repositoryCompact_",!0),this.resetCache("repository_",!0))}getCompactHosts(e){return this.request({cacheKey:"hostsCompact",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactHosts",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}getCompactSystemRepositories(e){return this.request({cacheKey:"repositoriesCompact",forceUpdate:e,executor:(t,i,r)=>{this._socket.emit("getCompactSystemRepositories",(o,n)=>{r.elapsed||(r.clearTimeout(),o&&i(o),t(n))})}})}}const X=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xt="9.28.1",ie=globalThis;function qr(){return eo(ie),ie}function eo(s){const e=s.__SENTRY__=s.__SENTRY__||{};return e.version=e.version||Xt,e[Xt]=e[Xt]||{}}function to(s,e,t=ie){const i=t.__SENTRY__=t.__SENTRY__||{},r=i[Xt]=i[Xt]||{};return r[s]||(r[s]=e())}const yN=Object.prototype.toString;function ja(s){switch(yN.call(s)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return bt(s,Error)}}function Vs(s,e){return yN.call(s)===`[object ${e}]`}function TN(s){return Vs(s,"ErrorEvent")}function GM(s){return Vs(s,"DOMError")}function $g(s){return Vs(s,"DOMException")}function ht(s){return Vs(s,"String")}function ya(s){return typeof s=="object"&&s!==null&&"__sentry_template_string__"in s&&"__sentry_template_values__"in s}function Ta(s){return s===null||ya(s)||typeof s!="object"&&typeof s!="function"}function _i(s){return Vs(s,"Object")}function so(s){return typeof Event<"u"&&bt(s,Event)}function Pg(s){return typeof Element<"u"&&bt(s,Element)}function Wg(s){return Vs(s,"RegExp")}function io(s){return!!(s!=null&&s.then&&typeof s.then=="function")}function Bg(s){return _i(s)&&"nativeEvent"in s&&"preventDefault"in s&&"stopPropagation"in s}function bt(s,e){try{return s instanceof e}catch{return!1}}function DN(s){return!!(typeof s=="object"&&s!==null&&(s.__isVue||s._isVue))}function Jg(s){return typeof Request<"u"&&bt(s,Request)}const Da=ie,Rg=80;function dN(s,e={}){if(!s)return"<unknown>";try{let t=s;const i=5,r=[];let o=0,n=0;const a=" > ",c=a.length;let l;const N=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||Rg;for(;t&&o++<i&&(l=Fg(t,N),!(l==="html"||o>1&&n+r.length*c+l.length>=u));)r.push(l),n+=l.length,t=t.parentNode;return r.reverse().join(a)}catch{return"<unknown>"}}function Fg(s,e){const t=s,i=[];if(!(t!=null&&t.tagName))return"";if(Da.HTMLElement&&t instanceof HTMLElement&&t.dataset){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}i.push(t.tagName.toLowerCase());const r=e!=null&&e.length?e.filter(n=>t.getAttribute(n)).map(n=>[n,t.getAttribute(n)]):null;if(r!=null&&r.length)r.forEach(n=>{i.push(`[${n[0]}="${n[1]}"]`)});else{t.id&&i.push(`#${t.id}`);const n=t.className;if(n&&ht(n)){const a=n.split(/\s+/);for(const c of a)i.push(`.${c}`)}}const o=["aria-label","type","name","title","alt"];for(const n of o){const a=t.getAttribute(n);a&&i.push(`[${n}="${a}"]`)}return i.join("")}function da(){try{return Da.document.location.href}catch{return""}}function Gg(s){if(!Da.HTMLElement)return null;let e=s;const t=5;for(let i=0;i<t;i++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const Hg="Sentry Logger ",Ln=["debug","info","warn","error","log","assert","trace"],Yr={};function Zs(s){if(!("console"in ie))return s();const e=ie.console,t={},i=Object.keys(Yr);i.forEach(r=>{const o=Yr[r];t[r]=e[r],e[r]=o});try{return s()}finally{i.forEach(r=>{e[r]=t[r]})}}function Vg(){let s=!1;const e={enable:()=>{s=!0},disable:()=>{s=!1},isEnabled:()=>s};return X?Ln.forEach(t=>{e[t]=(...i)=>{s&&Zs(()=>{ie.console[t](`${Hg}[${t}]:`,...i)})}}):Ln.forEach(t=>{e[t]=()=>{}}),e}const R=to("logger",Vg);function vr(s,e=0){return typeof s!="string"||e===0||s.length<=e?s:`${s.slice(0,e)}...`}function HM(s,e){if(!Array.isArray(s))return"";const t=[];for(let i=0;i<s.length;i++){const r=s[i];try{DN(r)?t.push("[VueViewModel]"):t.push(String(r))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function Zg(s,e,t=!1){return ht(s)?Wg(e)?e.test(s):ht(e)?t?s===e:s.includes(e):!1:!1}function ro(s,e=[],t=!1){return e.some(i=>Zg(s,i,t))}function Ue(s,e,t){if(!(e in s))return;const i=s[e];if(typeof i!="function")return;const r=t(i);typeof r=="function"&&hN(r,i);try{s[e]=r}catch{X&&R.log(`Failed to replace method "${e}" in object`,s)}}function Kt(s,e,t){try{Object.defineProperty(s,e,{value:t,writable:!0,configurable:!0})}catch{X&&R.log(`Failed to add non-enumerable property "${e}" to object`,s)}}function hN(s,e){try{const t=e.prototype||{};s.prototype=e.prototype=t,Kt(s,"__sentry_original__",e)}catch{}}function ha(s){return s.__sentry_original__}function zN(s){if(ja(s))return{message:s.message,name:s.name,stack:s.stack,...ZM(s)};if(so(s)){const e={type:s.type,target:VM(s.target),currentTarget:VM(s.currentTarget),...ZM(s)};return typeof CustomEvent<"u"&&bt(s,CustomEvent)&&(e.detail=s.detail),e}else return s}function VM(s){try{return Pg(s)?dN(s):Object.prototype.toString.call(s)}catch{return"<unknown>"}}function ZM(s){if(typeof s=="object"&&s!==null){const e={};for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t]);return e}else return{}}function Xg(s,e=40){const t=Object.keys(zN(s));t.sort();const i=t[0];if(!i)return"[object has no keys]";if(i.length>=e)return vr(i,e);for(let r=t.length;r>0;r--){const o=t.slice(0,r).join(", ");if(!(o.length>e))return r===t.length?o:vr(o,e)}return""}function Kg(){const s=ie;return s.crypto||s.msCrypto}function Je(s=Kg()){let e=()=>Math.random()*16;try{if(s!=null&&s.randomUUID)return s.randomUUID().replace(/-/g,"");s!=null&&s.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return s.getRandomValues(t),t[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,t=>(t^(e()&15)>>t/4).toString(16))}function wN(s){var e,t;return(t=(e=s.exception)==null?void 0:e.values)==null?void 0:t[0]}function Vt(s){const{message:e,event_id:t}=s;if(e)return e;const i=wN(s);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||t||"<unknown>":t||"<unknown>"}function gn(s,e,t){const i=s.exception=s.exception||{},r=i.values=i.values||[],o=r[0]=r[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function Rs(s,e){const t=wN(s);if(!t)return;const i={type:"generic",handled:!0},r=t.mechanism;if(t.mechanism={...i,...r,...e},e&&"data"in e){const o={...r==null?void 0:r.data,...e.data};t.mechanism.data=o}}function XM(s){if(qg(s))return!0;try{Kt(s,"__sentry_captured__",!0)}catch{}return!1}function qg(s){try{return s.__sentry_captured__}catch{}}const CN=1e3;function Wi(){return Date.now()/CN}function ej(){const{performance:s}=ie;if(!(s!=null&&s.now))return Wi;const e=Date.now()-s.now(),t=s.timeOrigin==null?e:s.timeOrigin;return()=>(t+s.now())/CN}const zt=ej();function tj(s){const e=zt(),t={sid:Je(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>ij(t)};return s&&Fs(t,s),t}function Fs(s,e={}){if(e.user&&(!s.ipAddress&&e.user.ip_address&&(s.ipAddress=e.user.ip_address),!s.did&&!e.did&&(s.did=e.user.id||e.user.email||e.user.username)),s.timestamp=e.timestamp||zt(),e.abnormal_mechanism&&(s.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(s.ignoreDuration=e.ignoreDuration),e.sid&&(s.sid=e.sid.length===32?e.sid:Je()),e.init!==void 0&&(s.init=e.init),!s.did&&e.did&&(s.did=`${e.did}`),typeof e.started=="number"&&(s.started=e.started),s.ignoreDuration)s.duration=void 0;else if(typeof e.duration=="number")s.duration=e.duration;else{const t=s.timestamp-s.started;s.duration=t>=0?t:0}e.release&&(s.release=e.release),e.environment&&(s.environment=e.environment),!s.ipAddress&&e.ipAddress&&(s.ipAddress=e.ipAddress),!s.userAgent&&e.userAgent&&(s.userAgent=e.userAgent),typeof e.errors=="number"&&(s.errors=e.errors),e.status&&(s.status=e.status)}function sj(s,e){let t={};s.status==="ok"&&(t={status:"exited"}),Fs(s,t)}function ij(s){return{sid:`${s.sid}`,init:s.init,started:new Date(s.started*1e3).toISOString(),timestamp:new Date(s.timestamp*1e3).toISOString(),status:s.status,errors:s.errors,did:typeof s.did=="number"||typeof s.did=="string"?`${s.did}`:void 0,duration:s.duration,abnormal_mechanism:s.abnormal_mechanism,attrs:{release:s.release,environment:s.environment,ip_address:s.ipAddress,user_agent:s.userAgent}}}function Bi(s,e,t=2){if(!e||typeof e!="object"||t<=0)return e;if(s&&Object.keys(e).length===0)return s;const i={...s};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=Bi(i[r],e[r],t-1));return i}const jn="_sentrySpan";function KM(s,e){e?Kt(s,jn,e):delete s[jn]}function qM(s){return s[jn]}function ec(){return Je()}function IN(){return Je().substring(16)}const rj=100;class wt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ec(),sampleRand:Math.random()}}clone(){const e=new wt;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,KM(e,qM(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Fs(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t=typeof e=="function"?e(this):e,i=t instanceof wt?t.getScopeData():_i(t)?e:void 0,{tags:r,extra:o,user:n,contexts:a,level:c,fingerprint:l=[],propagationContext:N}=i||{};return this._tags={...this._tags,...r},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},n&&Object.keys(n).length&&(this._user=n),c&&(this._level=c),l.length&&(this._fingerprint=l),N&&(this._propagationContext=N),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,KM(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ec(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){var o;const i=typeof t=="number"?t:rj;if(i<=0)return this;const r={timestamp:Wi(),...e,message:e.message?vr(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>i&&(this._breadcrumbs=this._breadcrumbs.slice(-i),(o=this._client)==null||o.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qM(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Bi(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const i=(t==null?void 0:t.event_id)||Je();if(!this._client)return R.warn("No client configured on scope - will not capture exception!"),i;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:i},this),i}captureMessage(e,t,i){const r=(i==null?void 0:i.event_id)||Je();if(!this._client)return R.warn("No client configured on scope - will not capture message!"),r;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...i,event_id:r},this),r}captureEvent(e,t){const i=(t==null?void 0:t.event_id)||Je();return this._client?(this._client.captureEvent(e,{...t,event_id:i},this),i):(R.warn("No client configured on scope - will not capture event!"),i)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function oj(){return to("defaultCurrentScope",()=>new wt)}function nj(){return to("defaultIsolationScope",()=>new wt)}class aj{constructor(e,t){let i;e?i=e:i=new wt;let r;t?r=t:r=new wt,this._stack=[{scope:i}],this._isolationScope=r}withScope(e){const t=this._pushScope();let i;try{i=e(t)}catch(r){throw this._popScope(),r}return io(i)?i.then(r=>(this._popScope(),r),r=>{throw this._popScope(),r}):(this._popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Gs(){const s=qr(),e=eo(s);return e.stack=e.stack||new aj(oj(),nj())}function Mj(s){return Gs().withScope(s)}function cj(s,e){const t=Gs();return t.withScope(()=>(t.getStackTop().scope=s,e(s)))}function tc(s){return Gs().withScope(()=>s(Gs().getIsolationScope()))}function uj(){return{withIsolationScope:tc,withScope:Mj,withSetScope:cj,withSetIsolationScope:(s,e)=>tc(e),getCurrentScope:()=>Gs().getScope(),getIsolationScope:()=>Gs().getIsolationScope()}}function za(s){const e=eo(s);return e.acs?e.acs:uj()}function Ct(){const s=qr();return za(s).getCurrentScope()}function Ji(){const s=qr();return za(s).getIsolationScope()}function lj(){return to("globalScope",()=>new wt)}function Nj(...s){const e=qr(),t=za(e);if(s.length===2){const[i,r]=s;return i?t.withSetScope(i,r):t.withScope(r)}return t.withScope(s[0])}function Ee(){return Ct().getClient()}function Lj(s){const e=s.getPropagationContext(),{traceId:t,parentSpanId:i,propagationSpanId:r}=e,o={trace_id:t,span_id:r||IN()};return i&&(o.parent_span_id=i),o}const gj="sentry.source",jj="sentry.sample_rate",yj="sentry.previous_trace_sample_rate",Tj="sentry.op",Dj="sentry.origin",pN="sentry.profile_id",AN="sentry.exclusive_time",dj=0,hj=1,zj="_sentryScope",wj="_sentryIsolationScope";function mN(s){return{scope:s[zj],isolationScope:s[wj]}}function Cj(s){if(typeof s=="boolean")return Number(s);const e=typeof s=="string"?parseFloat(s):s;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Ij="sentry-",pj=/^sentry-/;function Aj(s){const e=mj(s);if(!e)return;const t=Object.entries(e).reduce((i,[r,o])=>{if(r.match(pj)){const n=r.slice(Ij.length);i[n]=o}return i},{});if(Object.keys(t).length>0)return t}function mj(s){if(!(!s||!ht(s)&&!Array.isArray(s)))return Array.isArray(s)?s.reduce((e,t)=>{const i=sc(t);return Object.entries(i).forEach(([r,o])=>{e[r]=o}),e},{}):sc(s)}function sc(s){return s.split(",").map(e=>e.split("=").map(t=>{try{return decodeURIComponent(t.trim())}catch{return}})).reduce((e,[t,i])=>(t&&i&&(e[t]=i),e),{})}const ON=1;let ic=!1;function Oj(s){const{spanId:e,traceId:t,isRemote:i}=s.spanContext(),r=i?e:wa(s).parent_span_id,o=mN(s).scope,n=i?(o==null?void 0:o.getPropagationContext().propagationSpanId)||IN():e;return{parent_span_id:r,span_id:n,trace_id:t}}function Ej(s){if(s&&s.length>0)return s.map(({context:{spanId:e,traceId:t,traceFlags:i,...r},attributes:o})=>({span_id:e,trace_id:t,sampled:i===ON,attributes:o,...r}))}function rc(s){return typeof s=="number"?oc(s):Array.isArray(s)?s[0]+s[1]/1e9:s instanceof Date?oc(s.getTime()):zt()}function oc(s){return s>9999999999?s/1e3:s}function wa(s){var i;if(xj(s))return s.getSpanJSON();const{spanId:e,traceId:t}=s.spanContext();if(fj(s)){const{attributes:r,startTime:o,name:n,endTime:a,status:c,links:l}=s,N="parentSpanId"in s?s.parentSpanId:"parentSpanContext"in s?(i=s.parentSpanContext)==null?void 0:i.spanId:void 0;return{span_id:e,trace_id:t,data:r,description:n,parent_span_id:N,start_timestamp:rc(o),timestamp:rc(a)||void 0,status:Sj(c),op:r[Tj],origin:r[Dj],links:Ej(l)}}return{span_id:e,trace_id:t,start_timestamp:0,data:{}}}function fj(s){const e=s;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function xj(s){return typeof s.getSpanJSON=="function"}function _j(s){const{traceFlags:e}=s.spanContext();return e===ON}function Sj(s){if(!(!s||s.code===dj))return s.code===hj?"ok":s.message||"unknown_error"}const kj="_sentryRootSpan";function EN(s){return s[kj]||s}function nc(){ic||(Zs(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),ic=!0)}const fN=50,qt="?",ac=/\(error: (.*)\)/,Mc=/captureMessage|captureException/;function xN(...s){const e=s.sort((t,i)=>t[0]-i[0]).map(t=>t[1]);return(t,i=0,r=0)=>{const o=[],n=t.split(`
2
2
  `);for(let a=i;a<n.length;a++){const c=n[a];if(c.length>1024)continue;const l=ac.test(c)?c.replace(ac,"$1"):c;if(!l.match(/\S*Error: /)){for(const N of e){const u=N(l);if(u){o.push(u);break}}if(o.length>=fN+r)break}}return vj(o.slice(r))}}function Yj(s){return Array.isArray(s)?xN(...s):s}function vj(s){if(!s.length)return[];const e=Array.from(s);return/sentryWrapped/.test(nr(e).function||"")&&e.pop(),e.reverse(),Mc.test(nr(e).function||"")&&(e.pop(),Mc.test(nr(e).function||"")&&e.pop()),e.slice(0,fN).map(t=>({...t,filename:t.filename||nr(e).filename,function:t.function||qt}))}function nr(s){return s[s.length-1]||{}}const Eo="<anonymous>";function Qt(s){try{return!s||typeof s!="function"?Eo:s.name||Eo}catch{return Eo}}function cc(s){const e=s.exception;if(e){const t=[];try{return e.values.forEach(i=>{i.stacktrace.frames&&t.push(...i.stacktrace.frames)}),t}catch{return}}}const Ar={},uc={};function rs(s,e){Ar[s]=Ar[s]||[],Ar[s].push(e)}function os(s,e){if(!uc[s]){uc[s]=!0;try{e()}catch(t){X&&R.error(`Error while instrumenting ${s}`,t)}}}function Ke(s,e){const t=s&&Ar[s];if(t)for(const i of t)try{i(e)}catch(r){X&&R.error(`Error while triggering instrumentation handler.
3
3
  Type: ${s}
4
4
  Name: ${Qt(i)}