iobroker.admin 7.1.2 → 7.1.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.
- package/README.md +7 -4
- package/adminWww/asset-manifest.json +13 -13
- package/adminWww/index.html +1 -1
- package/adminWww/static/css/{3210.f6c8a5fc.chunk.css → 4684.f5525d8f.chunk.css} +2 -2
- package/adminWww/static/css/4684.f5525d8f.chunk.css.map +1 -0
- package/adminWww/static/js/2534.89c71e34.chunk.js +2 -0
- package/adminWww/static/js/2534.89c71e34.chunk.js.map +1 -0
- package/adminWww/static/js/4684.e5f7632b.chunk.js +2 -0
- package/adminWww/static/js/4684.e5f7632b.chunk.js.map +1 -0
- package/adminWww/static/js/5056.9247882b.chunk.js +3 -0
- package/adminWww/static/js/5056.9247882b.chunk.js.map +1 -0
- package/adminWww/static/js/{8038.ae8b7862.chunk.js → 8038.64137a64.chunk.js} +2 -2
- package/adminWww/static/js/8038.64137a64.chunk.js.map +1 -0
- package/adminWww/static/js/{main.423e60b6.js → main.d3fd9aec.js} +2 -2
- package/adminWww/static/js/{main.423e60b6.js.map → main.d3fd9aec.js.map} +1 -1
- package/io-package.json +14 -14
- package/package.json +4 -13
- package/adminWww/static/css/3210.f6c8a5fc.chunk.css.map +0 -1
- package/adminWww/static/js/2534.d8fd195b.chunk.js +0 -2
- package/adminWww/static/js/2534.d8fd195b.chunk.js.map +0 -1
- package/adminWww/static/js/3210.1be726e7.chunk.js +0 -2
- package/adminWww/static/js/3210.1be726e7.chunk.js.map +0 -1
- package/adminWww/static/js/6539.0a444811.chunk.js +0 -3
- package/adminWww/static/js/6539.0a444811.chunk.js.map +0 -1
- package/adminWww/static/js/8038.ae8b7862.chunk.js.map +0 -1
- /package/adminWww/static/js/{6539.0a444811.chunk.js.LICENSE.txt → 5056.9247882b.chunk.js.LICENSE.txt} +0 -0
package/README.md
CHANGED
|
@@ -86,6 +86,13 @@ The icons may not be reused in other projects without the proper flaticon licens
|
|
|
86
86
|
<!--
|
|
87
87
|
### **WORK IN PROGRESS**
|
|
88
88
|
-->
|
|
89
|
+
### 7.1.3 (2024-09-20)
|
|
90
|
+
* (@foxriver76) improve appearance and standardization of some warning messages
|
|
91
|
+
* (@foxriver76) indicate `alert` warnings by the badge color on the notification button
|
|
92
|
+
* (@foxriver76) allow to distinguish between alert notifications and others for host notifications
|
|
93
|
+
* (@foxriver76) do not automatically open the notification dialog without user interaction
|
|
94
|
+
* (@foxriver76) fixed logging as socket client is now throwing real errors
|
|
95
|
+
|
|
89
96
|
### 7.1.2 (2024-09-20)
|
|
90
97
|
* (@foxriver76) fixed host base settings dialog
|
|
91
98
|
|
|
@@ -102,10 +109,6 @@ The icons may not be reused in other projects without the proper flaticon licens
|
|
|
102
109
|
* (bluefox) Improvement for automatic tests
|
|
103
110
|
* (bluefox) Added the possibility to style the response text for `textSendTo` in JSON Config
|
|
104
111
|
|
|
105
|
-
### 7.0.24 (2024-08-16)
|
|
106
|
-
* (bluefox) Showed min/max limits by controlling the values
|
|
107
|
-
* (bluefox) Corrected style for tabs
|
|
108
|
-
|
|
109
112
|
## License
|
|
110
113
|
The MIT License (MIT)
|
|
111
114
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.js": "./static/js/main.
|
|
4
|
-
"static/css/
|
|
5
|
-
"static/js/
|
|
3
|
+
"main.js": "./static/js/main.d3fd9aec.js",
|
|
4
|
+
"static/css/4684.f5525d8f.chunk.css": "./static/css/4684.f5525d8f.chunk.css",
|
|
5
|
+
"static/js/4684.e5f7632b.chunk.js": "./static/js/4684.e5f7632b.chunk.js",
|
|
6
6
|
"static/js/9277.93172c76.chunk.js": "./static/js/9277.93172c76.chunk.js",
|
|
7
7
|
"static/js/1658.fc8a7917.chunk.js": "./static/js/1658.fc8a7917.chunk.js",
|
|
8
8
|
"static/js/4039.e87eb1ef.chunk.js": "./static/js/4039.e87eb1ef.chunk.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"static/js/3378.ab9d6e26.chunk.js": "./static/js/3378.ab9d6e26.chunk.js",
|
|
17
17
|
"static/js/5096.3a6e8bdb.chunk.js": "./static/js/5096.3a6e8bdb.chunk.js",
|
|
18
18
|
"static/js/179.2a274f5e.chunk.js": "./static/js/179.2a274f5e.chunk.js",
|
|
19
|
-
"static/js/2534.
|
|
19
|
+
"static/js/2534.89c71e34.chunk.js": "./static/js/2534.89c71e34.chunk.js",
|
|
20
20
|
"static/js/2544.047df092.chunk.js": "./static/js/2544.047df092.chunk.js",
|
|
21
21
|
"static/js/2816.f7bf6ba0.chunk.js": "./static/js/2816.f7bf6ba0.chunk.js",
|
|
22
22
|
"static/js/6552.0a447e18.chunk.js": "./static/js/6552.0a447e18.chunk.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"static/js/9534.2af54084.chunk.js": "./static/js/9534.2af54084.chunk.js",
|
|
25
25
|
"static/js/4579.014de1f1.chunk.js": "./static/js/4579.014de1f1.chunk.js",
|
|
26
26
|
"static/js/6938.af058182.chunk.js": "./static/js/6938.af058182.chunk.js",
|
|
27
|
-
"static/js/8038.
|
|
27
|
+
"static/js/8038.64137a64.chunk.js": "./static/js/8038.64137a64.chunk.js",
|
|
28
28
|
"static/js/9917.3662a807.chunk.js": "./static/js/9917.3662a807.chunk.js",
|
|
29
29
|
"static/js/9399.5852b7e7.chunk.js": "./static/js/9399.5852b7e7.chunk.js",
|
|
30
30
|
"static/js/1407.30677a91.chunk.js": "./static/js/1407.30677a91.chunk.js",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"static/js/5266.bdc72939.chunk.js": "./static/js/5266.bdc72939.chunk.js",
|
|
192
192
|
"static/js/1222.4bedf57f.chunk.js": "./static/js/1222.4bedf57f.chunk.js",
|
|
193
193
|
"static/js/1623.10f3f67f.chunk.js": "./static/js/1623.10f3f67f.chunk.js",
|
|
194
|
-
"static/js/
|
|
194
|
+
"static/js/5056.9247882b.chunk.js": "./static/js/5056.9247882b.chunk.js",
|
|
195
195
|
"static/js/5280.5ea130e1.chunk.js": "./static/js/5280.5ea130e1.chunk.js",
|
|
196
196
|
"static/js/3502.179f6eb0.chunk.js": "./static/js/3502.179f6eb0.chunk.js",
|
|
197
197
|
"static/js/8836.f29991d8.chunk.js": "./static/js/8836.f29991d8.chunk.js",
|
|
@@ -349,9 +349,9 @@
|
|
|
349
349
|
"static/media/Outdoor Blinds.svg": "./static/media/Outdoor Blinds.37b85a9c060a4af48da9.svg",
|
|
350
350
|
"static/media/Upstairs.svg": "./static/media/Upstairs.441813e54e0daca0882d.svg",
|
|
351
351
|
"static/media/filter.svg": "./static/media/filter.ddf40c28bbf1e138937e53be53e56274.svg",
|
|
352
|
-
"main.
|
|
353
|
-
"
|
|
354
|
-
"
|
|
352
|
+
"main.d3fd9aec.js.map": "./static/js/main.d3fd9aec.js.map",
|
|
353
|
+
"4684.f5525d8f.chunk.css.map": "./static/css/4684.f5525d8f.chunk.css.map",
|
|
354
|
+
"4684.e5f7632b.chunk.js.map": "./static/js/4684.e5f7632b.chunk.js.map",
|
|
355
355
|
"9277.93172c76.chunk.js.map": "./static/js/9277.93172c76.chunk.js.map",
|
|
356
356
|
"1658.fc8a7917.chunk.js.map": "./static/js/1658.fc8a7917.chunk.js.map",
|
|
357
357
|
"4039.e87eb1ef.chunk.js.map": "./static/js/4039.e87eb1ef.chunk.js.map",
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
"3378.ab9d6e26.chunk.js.map": "./static/js/3378.ab9d6e26.chunk.js.map",
|
|
366
366
|
"5096.3a6e8bdb.chunk.js.map": "./static/js/5096.3a6e8bdb.chunk.js.map",
|
|
367
367
|
"179.2a274f5e.chunk.js.map": "./static/js/179.2a274f5e.chunk.js.map",
|
|
368
|
-
"2534.
|
|
368
|
+
"2534.89c71e34.chunk.js.map": "./static/js/2534.89c71e34.chunk.js.map",
|
|
369
369
|
"2544.047df092.chunk.js.map": "./static/js/2544.047df092.chunk.js.map",
|
|
370
370
|
"2816.f7bf6ba0.chunk.js.map": "./static/js/2816.f7bf6ba0.chunk.js.map",
|
|
371
371
|
"6552.0a447e18.chunk.js.map": "./static/js/6552.0a447e18.chunk.js.map",
|
|
@@ -373,7 +373,7 @@
|
|
|
373
373
|
"9534.2af54084.chunk.js.map": "./static/js/9534.2af54084.chunk.js.map",
|
|
374
374
|
"4579.014de1f1.chunk.js.map": "./static/js/4579.014de1f1.chunk.js.map",
|
|
375
375
|
"6938.af058182.chunk.js.map": "./static/js/6938.af058182.chunk.js.map",
|
|
376
|
-
"8038.
|
|
376
|
+
"8038.64137a64.chunk.js.map": "./static/js/8038.64137a64.chunk.js.map",
|
|
377
377
|
"9917.3662a807.chunk.js.map": "./static/js/9917.3662a807.chunk.js.map",
|
|
378
378
|
"9399.5852b7e7.chunk.js.map": "./static/js/9399.5852b7e7.chunk.js.map",
|
|
379
379
|
"1407.30677a91.chunk.js.map": "./static/js/1407.30677a91.chunk.js.map",
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
"5266.bdc72939.chunk.js.map": "./static/js/5266.bdc72939.chunk.js.map",
|
|
399
399
|
"1222.4bedf57f.chunk.js.map": "./static/js/1222.4bedf57f.chunk.js.map",
|
|
400
400
|
"1623.10f3f67f.chunk.js.map": "./static/js/1623.10f3f67f.chunk.js.map",
|
|
401
|
-
"
|
|
401
|
+
"5056.9247882b.chunk.js.map": "./static/js/5056.9247882b.chunk.js.map",
|
|
402
402
|
"5280.5ea130e1.chunk.js.map": "./static/js/5280.5ea130e1.chunk.js.map",
|
|
403
403
|
"3502.179f6eb0.chunk.js.map": "./static/js/3502.179f6eb0.chunk.js.map",
|
|
404
404
|
"8836.f29991d8.chunk.js.map": "./static/js/8836.f29991d8.chunk.js.map",
|
|
@@ -408,6 +408,6 @@
|
|
|
408
408
|
"530.cb8dbcf9.chunk.js.map": "./static/js/530.cb8dbcf9.chunk.js.map"
|
|
409
409
|
},
|
|
410
410
|
"entrypoints": [
|
|
411
|
-
"static/js/main.
|
|
411
|
+
"static/js/main.d3fd9aec.js"
|
|
412
412
|
]
|
|
413
413
|
}
|
package/adminWww/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en" translate="no"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><meta name="theme-color" content="#000000"/><meta name="description" content="admin - ioBroker"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="stylesheet" href="./css/leaflet.css"/><link rel="manifest" href="./manifest.json" crossorigin="use-credentials"/><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./lib/js/socket.io.js"></script><script type="text/javascript" src="./lib/js/sparkline.js"></script><title>Admin</title><script>window.loginHideLogo="@@loginHideLogo@@",window.loginMotto="@@loginMotto@@",window.login="@@auth@@",window.loginLogo="@@loginLogo@@",window.loginLink="@@loginLink@@",window.loginTitle="@@loginTitle@@",window.loginBackgroundColor="@@loginBackgroundColor@@",window.loginBackgroundImage="@@loginBackgroundImage@@",window.vendorPrefix="@@vendorPrefix@@",window.disableDataReporting="@@disableDataReporting@@",window.loadingBackgroundColor="@@loadingBackgroundColor@@",window.loadingBackgroundImage="@@loadingBackgroundImage@@",window.loadingHideLogo="@@loadingHideLogo@@"</script><style>.root{background-color:rgba(255,255,255,.87);border-radius:10px}.unsupported{width:200px;background-color:#aaa;margin:auto;margin-top:3rem;padding:10px;line-height:25px;border-radius:4px;text-align:center}.leaflet-container{height:400px;width:100%}</style><script>setTimeout((()=>{const o=document.body;window.location.search.includes("?login")?(window.loginBackgroundColor&&-1===window.loginBackgroundColor.indexOf("loginBackgroundColor")&&(o.style.backgroundColor=window.loginBackgroundColor),window.loginBackgroundImage&&-1===window.loginBackgroundImage.indexOf("loginBackgroundImage")&&(o.style.backgroundImage="url("+window.loginBackgroundImage+")",o.style.backgroundSize="cover")):(window.loadingBackgroundColor&&-1===window.loadingBackgroundColor.indexOf("loadingBackgroundColor")&&(o.style.backgroundColor=window.loadingBackgroundColor),window.loadingBackgroundImage&&-1===window.loadingBackgroundImage.indexOf("loadingBackgroundImage")&&(o.style.backgroundImage="url("+window.loadingBackgroundImage+")",o.style.backgroundSize="cover"))}),0),window.addEventListener("load",(function o(n){window.removeEventListener("load",o,!1);if(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./)){const o=document.getElementById("root");o.classList.add("unsupported"),o.innerHTML="Browser is not supported. Please use Firefox or Chrome."}}),!1)</script><script defer="defer" src="static/js/main.
|
|
1
|
+
<!doctype html><html lang="en" translate="no"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><meta name="theme-color" content="#000000"/><meta name="description" content="admin - ioBroker"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="stylesheet" href="./css/leaflet.css"/><link rel="manifest" href="./manifest.json" crossorigin="use-credentials"/><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./lib/js/socket.io.js"></script><script type="text/javascript" src="./lib/js/sparkline.js"></script><title>Admin</title><script>window.loginHideLogo="@@loginHideLogo@@",window.loginMotto="@@loginMotto@@",window.login="@@auth@@",window.loginLogo="@@loginLogo@@",window.loginLink="@@loginLink@@",window.loginTitle="@@loginTitle@@",window.loginBackgroundColor="@@loginBackgroundColor@@",window.loginBackgroundImage="@@loginBackgroundImage@@",window.vendorPrefix="@@vendorPrefix@@",window.disableDataReporting="@@disableDataReporting@@",window.loadingBackgroundColor="@@loadingBackgroundColor@@",window.loadingBackgroundImage="@@loadingBackgroundImage@@",window.loadingHideLogo="@@loadingHideLogo@@"</script><style>.root{background-color:rgba(255,255,255,.87);border-radius:10px}.unsupported{width:200px;background-color:#aaa;margin:auto;margin-top:3rem;padding:10px;line-height:25px;border-radius:4px;text-align:center}.leaflet-container{height:400px;width:100%}</style><script>setTimeout((()=>{const o=document.body;window.location.search.includes("?login")?(window.loginBackgroundColor&&-1===window.loginBackgroundColor.indexOf("loginBackgroundColor")&&(o.style.backgroundColor=window.loginBackgroundColor),window.loginBackgroundImage&&-1===window.loginBackgroundImage.indexOf("loginBackgroundImage")&&(o.style.backgroundImage="url("+window.loginBackgroundImage+")",o.style.backgroundSize="cover")):(window.loadingBackgroundColor&&-1===window.loadingBackgroundColor.indexOf("loadingBackgroundColor")&&(o.style.backgroundColor=window.loadingBackgroundColor),window.loadingBackgroundImage&&-1===window.loadingBackgroundImage.indexOf("loadingBackgroundImage")&&(o.style.backgroundImage="url("+window.loadingBackgroundImage+")",o.style.backgroundSize="cover"))}),0),window.addEventListener("load",(function o(n){window.removeEventListener("load",o,!1);if(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./)){const o=document.getElementById("root");o.classList.add("unsupported"),o.innerHTML="Browser is not supported. Please use Firefox or Chrome."}}),!1)</script><script defer="defer" src="static/js/main.d3fd9aec.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(../../static/media/material.6467d9a24f234e8e8e07.woff2) format("woff2"),url(../../static/media/material.a4c124e2e5122e01c52b.woff) format("woff")}.leaflet-control-attribution .leaflet-control{display:none}::-webkit-scrollbar{background-color:#ccc;height:5px;width:5px}::-webkit-scrollbar-thumb{background-color:#575757;border-radius:5px}::-webkit-scrollbar-track{background-color:#ccc;border-radius:5px}*{box-sizing:inherit;scrollbar-color:#575757 #ccc;scrollbar-width:thin}body,html{height:100%}body,html{box-sizing:border-box}body{font-family:Segoe UI,Tahoma,Arial,Courier New,monospace;font-size:12px;font-weight:400;margin:0;overflow:hidden;padding:0}#root{height:inherit;width:inherit}.draggable-item{z-index:99999}.material-icons{word-wrap:normal;-moz-font-feature-settings:"liga";-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga";direction:ltr;display:inline-block;font-family:Material Icons;font-size:24px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}@keyframes updated{0%{background:#588042}to{background:#00000000}}.leaflet-control-attribution{display:none}:host,:root{--ol-background-color:#fff;--ol-accent-background-color:#f5f5f5;--ol-subtle-background-color:hsla(0,0%,50%,.25);--ol-partial-background-color:hsla(0,0%,100%,.75);--ol-foreground-color:#333;--ol-subtle-foreground-color:#666;--ol-brand-color:#0af}.ol-box{background-color:hsla(0,0%,100%,.75);background-color:var(--ol-partial-background-color);border:1.5px solid #fff;border:1.5px solid var(--ol-background-color);border-radius:2px;box-sizing:border-box}.ol-mouse-position{position:absolute;right:8px;top:8px}.ol-scale-line{background:hsla(0,0%,100%,.75);background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #666;border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:#333;color:var(--ol-foreground-color);font-size:10px;margin:1px;text-align:center;transition:all .25s;will-change:contents,width}.ol-scale-bar{bottom:8px;left:8px;position:absolute}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{background-color:#333;background-color:var(--ol-foreground-color);float:right;height:15px;width:1px;z-index:10}.ol-scale-step-text{bottom:-5px;font-size:10px;z-index:11}.ol-scale-step-text,.ol-scale-text{color:#333;color:var(--ol-foreground-color);position:absolute;text-shadow:-1.5px 0 hsla(0,0%,100%,.75),0 1.5px hsla(0,0%,100%,.75),1.5px 0 hsla(0,0%,100%,.75),0 -1.5px hsla(0,0%,100%,.75);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{bottom:25px;font-size:12px;text-align:center}.ol-scale-singlebar{border:1px solid #333;border:1px solid var(--ol-foreground-color);box-sizing:border-box;height:10px;position:relative;z-index:9}.ol-scale-singlebar-even{background-color:#666;background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:#fff;background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:grabbing}.ol-grab{cursor:move;cursor:grab}.ol-control{background-color:hsla(0,0%,50%,.25);background-color:var(--ol-subtle-background-color);border-radius:4px;position:absolute}.ol-zoom{left:.5em;top:.5em}.ol-rotate{right:.5em;top:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;transition:opacity .25s linear,visibility 0s linear .25s;visibility:hidden}.ol-zoom-extent{left:.5em;top:4.643em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{background-color:#fff;background-color:var(--ol-background-color);border:none;border-radius:2px;color:#666;color:var(--ol-subtle-foreground-color);display:block;font-size:inherit;font-weight:700;height:1.375em;line-height:.4em;margin:1px;padding:0;text-align:center;text-decoration:none;width:1.375em}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{color:#333;color:var(--ol-foreground-color);outline:1px solid #666;outline:1px solid var(--ol-subtle-foreground-color);text-decoration:none}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{align-items:center;bottom:.5em;display:flex;flex-flow:row-reverse;max-width:calc(100% - 1.3em);right:.5em;text-align:right}.ol-attribution a{color:#666;color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{color:#333;color:var(--ol-foreground-color);font-size:12px;margin:0;padding:1px .5em;text-shadow:0 0 2px #fff;text-shadow:0 0 2px var(--ol-background-color)}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:hsla(0,0%,100%,.75);background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{border-radius:4px 0 0;bottom:0;right:0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{height:200px;left:.5em;top:4.5em}.ol-zoomslider button{height:10px;position:relative}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{bottom:.5em;left:.5em}.ol-overviewmap.ol-uncollapsible{border-radius:0 4px 0 0;bottom:0;left:0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #666;border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:hsla(0,0%,50%,.25);background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted #666;border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}#diagSample{background:#fff}#diagSample,#tabs-system{overflow:auto}.m pre{font-family:monospace,monospace;font-size:1em}.drop-container{border:5px dashed transparent;height:calc(100% - 10px);left:0;margin-top:5px;position:absolute;top:0;width:100%}.drop-container:focus{outline:none}.drop-dop{background-color:#ffffff40;border:5px dashed #000000a0;z-index:100}.drop-container input{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1000}.tables{width:33.3%}.dialog-setting{height:100%!important;max-width:calc(100% - 64px)!important;transition:all .4s ease-out!important;width:100%!important}.dialogName{font-size:1.1rem!important;padding-right:10px;white-space:nowrap}.float_row{display:flex!important}tbody>.float_row:nth-of-type(odd){background-color:#00000008}.float_cell{display:table-cell}.grow_cell{flex-grow:100}.small_size{height:40px!important;max-height:40px!important;max-width:40px!important;min-height:40px!important;min-width:40px!important;width:40px!important}@media screen and (max-width:993px){.sendData-grid{height:calc(100% - 1rem)}#diagSample{height:calc(100% - 6rem)}.dialog-setting{height:100%!important;max-width:calc(100% - 64px)!important;width:100%!important}}@media (max-width:760px){.tables{width:50%}.dialog-setting{height:100%!important;max-width:calc(100% - 64px)!important;width:100%!important}.float_row{border-bottom:5px solid #00000029;display:flex!important;flex-direction:column;margin-bottom:30px}.float_cell{display:block!important;text-align:center!important;width:100%!important}}@media (max-width:540px){tables{width:100%}.dialog-setting{height:100%!important;margin:0!important;max-height:100%!important;max-width:100%!important;width:100%!important}.dialogName{font-size:.7rem!important}.float_row{border-bottom:5px solid #00000029;display:flex!important;flex-direction:column;margin-bottom:30px}.float_cell{display:block!important;width:100%!important}.float_cell,.xs-centered,.xs-centered input{text-align:center!important}}@media (max-width:420px){.tables{width:100%}.dialog-setting{height:100%!important;margin:0!important;max-height:100%!important;max-width:100%!important;width:100%!important}.dialogName{font-size:.7rem!important}.float_row{border-bottom:5px solid #00000029;display:flex!important;flex-direction:column;margin-bottom:30px}.float_cell{display:block!important;width:100%!important}.float_cell,.xs-centered,.xs-centered input{text-align:center!important}}
|
|
2
|
-
/*# sourceMappingURL=
|
|
1
|
+
@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(../../static/media/material.6467d9a24f234e8e8e07.woff2) format("woff2"),url(../../static/media/material.a4c124e2e5122e01c52b.woff) format("woff")}.leaflet-control-attribution .leaflet-control{display:none}::-webkit-scrollbar{background-color:#ccc;height:5px;width:5px}::-webkit-scrollbar-thumb{background-color:#575757;border-radius:5px}::-webkit-scrollbar-track{background-color:#ccc;border-radius:5px}*{box-sizing:inherit;scrollbar-color:#575757 #ccc;scrollbar-width:thin}body,html{height:100%}body,html{box-sizing:border-box}body{font-family:Segoe UI,Tahoma,Arial,Courier New,monospace;font-size:12px;font-weight:400;margin:0;overflow:hidden;padding:0}#root{height:inherit;width:inherit}.draggable-item{z-index:99999}.material-icons{word-wrap:normal;-moz-font-feature-settings:"liga";-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga";direction:ltr;display:inline-block;font-family:Material Icons;font-size:24px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}@keyframes updated{0%{background:#588042}to{background:#00000000}}.leaflet-control-attribution{display:none}:host,:root{--ol-background-color:#fff;--ol-accent-background-color:#f5f5f5;--ol-subtle-background-color:hsla(0,0%,50%,.25);--ol-partial-background-color:hsla(0,0%,100%,.75);--ol-foreground-color:#333;--ol-subtle-foreground-color:#666;--ol-brand-color:#0af}.ol-box{background-color:hsla(0,0%,100%,.75);background-color:var(--ol-partial-background-color);border:1.5px solid #fff;border:1.5px solid var(--ol-background-color);border-radius:2px;box-sizing:border-box}.ol-mouse-position{position:absolute;right:8px;top:8px}.ol-scale-line{background:hsla(0,0%,100%,.75);background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #666;border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:#333;color:var(--ol-foreground-color);font-size:10px;margin:1px;text-align:center;transition:all .25s;will-change:contents,width}.ol-scale-bar{bottom:8px;left:8px;position:absolute}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{background-color:#333;background-color:var(--ol-foreground-color);float:right;height:15px;width:1px;z-index:10}.ol-scale-step-text{bottom:-5px;font-size:10px;z-index:11}.ol-scale-step-text,.ol-scale-text{color:#333;color:var(--ol-foreground-color);position:absolute;text-shadow:-1.5px 0 hsla(0,0%,100%,.75),0 1.5px hsla(0,0%,100%,.75),1.5px 0 hsla(0,0%,100%,.75),0 -1.5px hsla(0,0%,100%,.75);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{bottom:25px;font-size:12px;text-align:center}.ol-scale-singlebar{border:1px solid #333;border:1px solid var(--ol-foreground-color);box-sizing:border-box;height:10px;position:relative;z-index:9}.ol-scale-singlebar-even{background-color:#666;background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:#fff;background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:grabbing}.ol-grab{cursor:move;cursor:grab}.ol-control{background-color:hsla(0,0%,50%,.25);background-color:var(--ol-subtle-background-color);border-radius:4px;position:absolute}.ol-zoom{left:.5em;top:.5em}.ol-rotate{right:.5em;top:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;transition:opacity .25s linear,visibility 0s linear .25s;visibility:hidden}.ol-zoom-extent{left:.5em;top:4.643em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{background-color:#fff;background-color:var(--ol-background-color);border:none;border-radius:2px;color:#666;color:var(--ol-subtle-foreground-color);display:block;font-size:inherit;font-weight:700;height:1.375em;line-height:.4em;margin:1px;padding:0;text-align:center;text-decoration:none;width:1.375em}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{color:#333;color:var(--ol-foreground-color);outline:1px solid #666;outline:1px solid var(--ol-subtle-foreground-color);text-decoration:none}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{align-items:center;bottom:.5em;display:flex;flex-flow:row-reverse;max-width:calc(100% - 1.3em);right:.5em;text-align:right}.ol-attribution a{color:#666;color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{color:#333;color:var(--ol-foreground-color);font-size:12px;margin:0;padding:1px .5em;text-shadow:0 0 2px #fff;text-shadow:0 0 2px var(--ol-background-color)}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:hsla(0,0%,100%,.75);background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{border-radius:4px 0 0;bottom:0;right:0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{height:200px;left:.5em;top:4.5em}.ol-zoomslider button{height:10px;position:relative}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{bottom:.5em;left:.5em}.ol-overviewmap.ol-uncollapsible{border-radius:0 4px 0 0;bottom:0;left:0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #666;border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:hsla(0,0%,50%,.25);background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted #666;border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.iom-info-box{align-items:center;border-radius:5px;border-style:solid;border-width:1px;display:flex;gap:8px;margin-bottom:8px;max-width:100%;padding:4px;white-space:preserve}#diagSample{background:#fff}#diagSample,#tabs-system{overflow:auto}.m pre{font-family:monospace,monospace;font-size:1em}.drop-container{border:5px dashed transparent;height:calc(100% - 10px);left:0;margin-top:5px;position:absolute;top:0;width:100%}.drop-container:focus{outline:none}.drop-dop{background-color:#ffffff40;border:5px dashed #000000a0;z-index:100}.drop-container input{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1000}.tables{width:33.3%}.dialog-setting{height:100%!important;max-width:calc(100% - 64px)!important;transition:all .4s ease-out!important;width:100%!important}.dialogName{font-size:1.1rem!important;padding-right:10px;white-space:nowrap}.float_row{display:flex!important}tbody>.float_row:nth-of-type(odd){background-color:#00000008}.float_cell{display:table-cell}.grow_cell{flex-grow:100}.small_size{height:40px!important;max-height:40px!important;max-width:40px!important;min-height:40px!important;min-width:40px!important;width:40px!important}@media screen and (max-width:993px){.sendData-grid{height:calc(100% - 1rem)}#diagSample{height:calc(100% - 6rem)}.dialog-setting{height:100%!important;max-width:calc(100% - 64px)!important;width:100%!important}}@media (max-width:760px){.tables{width:50%}.dialog-setting{height:100%!important;max-width:calc(100% - 64px)!important;width:100%!important}.float_row{border-bottom:5px solid #00000029;display:flex!important;flex-direction:column;margin-bottom:30px}.float_cell{display:block!important;text-align:center!important;width:100%!important}}@media (max-width:540px){tables{width:100%}.dialog-setting{height:100%!important;margin:0!important;max-height:100%!important;max-width:100%!important;width:100%!important}.dialogName{font-size:.7rem!important}.float_row{border-bottom:5px solid #00000029;display:flex!important;flex-direction:column;margin-bottom:30px}.float_cell{display:block!important;width:100%!important}.float_cell,.xs-centered,.xs-centered input{text-align:center!important}}@media (max-width:420px){.tables{width:100%}.dialog-setting{height:100%!important;margin:0!important;max-height:100%!important;max-width:100%!important;width:100%!important}.dialogName{font-size:.7rem!important}.float_row{border-bottom:5px solid #00000029;display:flex!important;flex-direction:column;margin-bottom:30px}.float_cell{display:block!important;width:100%!important}.float_cell,.xs-centered,.xs-centered input{text-align:center!important}}
|
|
2
|
+
/*# sourceMappingURL=4684.f5525d8f.chunk.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/css/4684.f5525d8f.chunk.css","mappings":"AAAA,WACI,0BAA6B,CAC7B,iBAAkB,CAClB,eAAgB,CAChB,yJAGJ,CAGA,8CACI,YACJ,CAEA,oBAGI,qBAAsB,CADtB,UAAW,CADX,SAGJ,CAEA,0BACI,wBAAyB,CACzB,iBACJ,CAEA,0BACI,qBAAsB,CACtB,iBACJ,CAEA,EACI,kBAAmB,CAEnB,4BAA6B,CAD7B,oBAEJ,CAEA,UAEI,WACJ,CAMA,UAHI,qBAWJ,CARA,KAGI,uDAAgE,CAChE,cAAe,CACf,eAAgB,CAJhB,QAAS,CAMT,eAAgB,CALhB,SAMJ,CAEA,MACI,cAAe,CACf,aACJ,CAEA,gBACI,aACJ,CAEA,gBAUI,gBAAiB,CAEjB,iCAAkC,CAClC,iCAAkC,CAClC,4BAA6B,CAH7B,aAAc,CAHd,oBAAqB,CAPrB,0BAA6B,CAG7B,cAAe,CADf,iBAAkB,CADlB,eAAmB,CAInB,qBAAsB,CADtB,aAAc,CAEd,mBAAoB,CAEpB,kBAMJ,CAEA,mBACI,GACI,kBACJ,CACA,GACI,oBACJ,CACJ,CAGA,6BACI,YACJ,CC7FA,YAEE,0BAA4B,CAC5B,oCAAqC,CACrC,+CAAuD,CACvD,iDAAwD,CACxD,0BAA8B,CAC9B,iCAAqC,CACrC,qBACF,CAEA,QAIE,oCAAoD,CAApD,mDAAoD,CADpD,uBAA8C,CAA9C,6CAA8C,CAD9C,iBAAkB,CADlB,qBAIF,CAEA,mBAGE,iBAAkB,CADlB,SAAU,CADV,OAGF,CAEA,eACE,8BAA8C,CAA9C,6CAA8C,CAC9C,iBAAkB,CAClB,UAAW,CACX,QAAS,CACT,WAAY,CACZ,iBACF,CAEA,qBACE,qBAAmD,CACnD,kDAAgB,CAAhB,eAAgB,CAChB,UAAiC,CAAjC,gCAAiC,CACjC,cAAe,CAEf,UAAW,CADX,iBAAkB,CAGlB,mBAAqB,CADrB,0BAEF,CAEA,cAEE,UAAW,CACX,QAAS,CAFT,iBAGF,CAEA,oBACE,YACF,CAEA,sBAGE,qBAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CAFZ,WAAY,CADZ,SAAU,CAIV,UACF,CAEA,oBAEE,WAAY,CACZ,cAAe,CACf,UAGF,CAEA,mCAJE,UAAiC,CAAjC,gCAAiC,CAJjC,iBAAkB,CAKlB,6HAA6L,CAA7L,yLAUF,CAPA,eAIE,WAAY,CAFZ,cAAe,CACf,iBAIF,CAEA,oBAKE,qBAA4C,CAA5C,2CAA4C,CAD5C,qBAAsB,CAFtB,WAAY,CADZ,iBAAkB,CAElB,SAGF,CAEA,yBACE,qBAAmD,CAAnD,kDACF,CAEA,wBACE,qBAA4C,CAA5C,2CACF,CAEA,gBACE,YACF,CAEA,8BAEE,0BAA2B,CAI3B,uCAAwC,CAHxC,wBAAyB,CACzB,qBAAsB,CACtB,gBAEF,CAEA,oBACE,SAAU,CACV,eACF,CAEA,aACE,wBACF,CAEA,eACE,6BAA8B,CAC9B,wBAAyB,CACzB,qBAAsB,CACtB,gBACF,CAEA,aAGE,eACF,CAEA,SACE,WAAY,CAGZ,WACF,CAEA,YAEE,mCAAmD,CAAnD,kDAAmD,CACnD,iBAAkB,CAFlB,iBAGF,CAEA,SAEE,SAAU,CADV,QAEF,CAEA,WAEE,UAAW,CADX,QAAS,CAET,mDACF,CAEA,qBACE,SAAU,CAEV,wDAA0D,CAD1D,iBAEF,CAEA,gBAEE,SAAU,CADV,WAEF,CAEA,gBACE,UAAW,CACX,QACF,CAEA,mBAYE,qBAA4C,CAA5C,2CAA4C,CAC5C,WAAY,CACZ,iBAAkB,CAVlB,UAAwC,CAAxC,uCAAwC,CAHxC,aAAc,CAMd,iBAAkB,CAFlB,eAAiB,CAIjB,cAAe,CAEf,gBAAiB,CATjB,UAAW,CACX,SAAU,CAKV,iBAAkB,CAFlB,oBAAqB,CAIrB,aAKF,CAEA,qCACE,WAAY,CACZ,SACF,CAEA,uBACE,iBACF,CAEA,YACE,aAAc,CACd,eAAmB,CACnB,qBACF,CAEA,6BACE,eACF,CAEA,0BACE,SACF,CAEA,kDAIE,UAAiC,CAAjC,gCAAiC,CADjC,sBAAoD,CAApD,mDAAoD,CADpD,oBAGF,CAEA,qBACE,yBACF,CAEA,sBACE,yBACF,CAEA,gBAOE,kBAAmB,CALnB,WAAY,CAGZ,YAAa,CACb,qBAAsB,CAFtB,4BAA6B,CAD7B,UAAW,CAFX,gBAOF,CAEA,kBACE,UAAwC,CAAxC,uCAAwC,CACxC,oBACF,CAEA,mBAGE,UAAiC,CAAjC,gCAAiC,CAEjC,cAAe,CAJf,QAAS,CACT,gBAAiB,CAEjB,wBAA+C,CAA/C,8CAEF,CAEA,mBACE,cAAe,CACf,eACF,CAEA,0CACE,WACF,CAEA,oBACE,cAAe,CACf,iBAAkB,CAClB,qBACF,CAEA,uBACE,aACF,CAEA,gCACE,YACF,CAEA,mCACE,8BAA8C,CAA9C,6CACF,CAEA,iCAGE,qBAAsB,CAFtB,QAAS,CACT,OAEF,CAEA,qCACE,gBAAiB,CACjB,gBACF,CAEA,wCACE,YACF,CAEA,eAGE,YAAa,CADb,SAAU,CADV,SAGF,CAEA,sBAEE,WAAY,CADZ,iBAEF,CAEA,yBACE,SACF,CAEA,gBAEE,WAAa,CADb,SAEF,CAEA,iCAGE,uBAAwB,CAFxB,QAAS,CACT,MAEF,CAEA,2DAEE,aACF,CAEA,oCACE,qBAAmD,CAAnD,kDAAmD,CACnD,YAAa,CACb,WACF,CAEA,0CACE,QAAS,CACT,MAAO,CACP,iBACF,CAEA,yFAEE,YACF,CAEA,mCACE,6BAA6C,CAA7C,4CACF,CAEA,oBACE,wBAAsD,CAAtD,qDACF,CAEA,0CACE,WACF,CAEA,mCACE,cACF,CCjWA,cAII,kBAAmB,CAInB,iBAAkB,CAFlB,kBAAmB,CADnB,gBAAiB,CAHjB,YAAa,CACb,OAAQ,CAMR,iBAAkB,CAClB,cAAe,CAHf,WAAY,CANZ,oBAUJ,CCXA,YACI,eACJ,CAEA,yBAEI,aACJ,CAEA,OACI,+BAAiC,CACjC,aACJ,CAEA,gBAKI,6BAA8B,CAE9B,wBAAyB,CAHzB,MAAO,CAEP,cAAe,CAJf,iBAAkB,CAClB,KAAM,CAFN,UAOJ,CAEA,sBACI,YACJ,CAEA,UACI,0BAA2B,CAC3B,2BAA4B,CAC5B,WACJ,CAEA,sBAEI,WAAY,CAGZ,MAAO,CAFP,iBAAkB,CAClB,KAAM,CAHN,UAAW,CAKX,YACJ,CAEA,QACI,WACJ,CAEA,gBAEI,qBAAuB,CACvB,qCAAuC,CAKvC,qCAAyC,CAPzC,oBAQJ,CAEA,YAEI,0BAA4B,CAC5B,kBAAmB,CAFnB,kBAGJ,CAEA,WACI,sBACJ,CAEA,kCACI,0BACJ,CAEA,YACI,kBACJ,CAEA,WACI,aACJ,CAEA,YAEI,qBAAuB,CAIvB,yBAA2B,CAD3B,wBAA0B,CAD1B,yBAA2B,CAD3B,wBAA0B,CAF1B,oBAMJ,CACA,oCACI,eACI,wBACJ,CAEA,YACI,wBACJ,CAEA,gBAEI,qBAAuB,CACvB,qCAAuC,CAFvC,oBAGJ,CACJ,CAEA,yBACI,QACI,SACJ,CAEA,gBAEI,qBAAuB,CACvB,qCAAuC,CAFvC,oBAGJ,CAEA,WAII,iCAAkC,CAHlC,sBAAwB,CACxB,qBAAsB,CACtB,kBAEJ,CAEA,YACI,uBAAyB,CAEzB,2BAA6B,CAD7B,oBAEJ,CACJ,CAEA,yBACI,OACI,UACJ,CAEA,gBAEI,qBAAuB,CAGvB,kBAAoB,CADpB,yBAA2B,CAD3B,wBAA0B,CAF1B,oBAKJ,CAEA,YACI,yBACJ,CAEA,WAII,iCAAkC,CAHlC,sBAAwB,CACxB,qBAAsB,CACtB,kBAEJ,CAEA,YACI,uBAAyB,CACzB,oBAEJ,CAMA,4CACI,2BACJ,CACJ,CAEA,yBACI,QACI,UACJ,CAEA,gBAEI,qBAAuB,CAGvB,kBAAoB,CADpB,yBAA2B,CAD3B,wBAA0B,CAF1B,oBAKJ,CAEA,YACI,yBACJ,CAEA,WAII,iCAAkC,CAHlC,sBAAwB,CACxB,qBAAsB,CACtB,kBAEJ,CAEA,YACI,uBAAyB,CACzB,oBAEJ,CAMA,4CACI,2BACJ,CACJ","sources":["index.css","../../../../node_modules/ol/ol.css","../../../../node_modules/@foxriver76/iob-component-lib/build/components/molecules/InfoBox/InfoBox.css","assets/css/style.css"],"sourcesContent":["@font-face {\n font-family: 'Material Icons';\n font-style: normal;\n font-weight: 400;\n src:\n url('./fonts/material.woff2') format('woff2'),\n url('./fonts/material.woff') format('woff');\n}\n\n/* hide link on maps */\n.leaflet-control-attribution .leaflet-control {\n display: none;\n}\n\n::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n background-color: #ccc;\n}\n\n::-webkit-scrollbar-thumb {\n background-color: #575757;\n border-radius: 5px;\n}\n\n::-webkit-scrollbar-track {\n background-color: #ccc;\n border-radius: 5px;\n}\n\n* {\n box-sizing: inherit;\n scrollbar-width: thin;\n scrollbar-color: #575757 #ccc;\n}\n\nhtml,\nbody {\n height: 100%;\n}\n\nhtml {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n padding: 0;\n font-family: 'Segoe UI', Tahoma, Arial, 'Courier New', monospace;\n font-size: 12px;\n font-weight: 400;\n box-sizing: border-box;\n overflow: hidden;\n}\n\n#root {\n height: inherit;\n width: inherit;\n}\n\n.draggable-item {\n z-index: 99999;\n}\n\n.material-icons {\n font-family: 'Material Icons';\n font-weight: normal;\n font-style: normal;\n font-size: 24px;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -moz-font-feature-settings: 'liga';\n -moz-osx-font-smoothing: grayscale;\n font-feature-settings: 'liga';\n}\n\n@keyframes updated {\n 0% {\n background: #588042ff;\n }\n 100% {\n background: #00000000;\n }\n}\n\n/* hide link on maps */\n.leaflet-control-attribution {\n display: none;\n}\n",":root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: \" \";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n",".iom-info-box {\n white-space: preserve;\n display: flex;\n gap: 8px;\n align-items: center;\n border-width: 1px;\n border-style: solid;\n padding: 4px;\n border-radius: 5px;\n margin-bottom: 8px;\n max-width: 100%;\n}","#diagSample {\n background: #fff;\n}\n\n#tabs-system,\n#diagSample {\n overflow: auto;\n}\n\n.m pre {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\n.drop-container {\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n border: 5px dashed transparent;\n margin-top: 5px;\n height: calc(100% - 10px);\n}\n\n.drop-container:focus {\n outline: none;\n}\n\n.drop-dop {\n background-color: #ffffff40;\n border: 5px dashed #000000a0;\n z-index: 100;\n}\n\n.drop-container input {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1000;\n}\n\n.tables {\n width: 33.3%;\n}\n\n.dialog-setting {\n width: 100% !important;\n height: 100% !important;\n max-width: calc(100% - 64px) !important;\n -webkit-transition: all 400ms ease-out !important;\n -moz-transition: all 400ms ease-out !important;\n -ms-transition: all 400ms ease-out !important;\n -o-transition: all 400ms ease-out !important;\n transition: all 400ms ease-out !important;\n}\n\n.dialogName {\n white-space: nowrap;\n font-size: 1.1rem !important;\n padding-right: 10px;\n}\n\n.float_row {\n display: flex !important;\n}\n\ntbody > .float_row:nth-of-type(2n + 1) {\n background-color: #00000008;\n}\n\n.float_cell {\n display: table-cell;\n}\n\n.grow_cell {\n flex-grow: 100;\n}\n\n.small_size {\n width: 40px !important;\n height: 40px !important;\n min-width: 40px !important;\n min-height: 40px !important;\n max-width: 40px !important;\n max-height: 40px !important;\n}\n@media screen and (max-width: 993px) {\n .sendData-grid {\n height: calc(100% - 1rem);\n }\n\n #diagSample {\n height: calc(100% - 6rem);\n }\n\n .dialog-setting {\n width: 100% !important;\n height: 100% !important;\n max-width: calc(100% - 64px) !important;\n }\n}\n\n@media (max-width: 760px) {\n .tables {\n width: 50%;\n }\n\n .dialog-setting {\n width: 100% !important;\n height: 100% !important;\n max-width: calc(100% - 64px) !important;\n }\n\n .float_row {\n display: flex !important;\n flex-direction: column;\n margin-bottom: 30px;\n border-bottom: 5px solid #00000029;\n }\n\n .float_cell {\n display: block !important;\n width: 100% !important;\n text-align: center !important;\n }\n}\n\n@media (max-width: 540px) {\n tables {\n width: 100%;\n }\n\n .dialog-setting {\n width: 100% !important;\n height: 100% !important;\n max-width: 100% !important;\n max-height: 100% !important;\n margin: 0 !important;\n }\n\n .dialogName {\n font-size: 0.7rem !important;\n }\n\n .float_row {\n display: flex !important;\n flex-direction: column;\n margin-bottom: 30px;\n border-bottom: 5px solid #00000029;\n }\n\n .float_cell {\n display: block !important;\n width: 100% !important;\n text-align: center !important;\n }\n\n .xs-centered {\n text-align: center !important;\n }\n\n .xs-centered input {\n text-align: center !important;\n }\n}\n\n@media (max-width: 420px) {\n .tables {\n width: 100%;\n }\n\n .dialog-setting {\n width: 100% !important;\n height: 100% !important;\n max-width: 100% !important;\n max-height: 100% !important;\n margin: 0 !important;\n }\n\n .dialogName {\n font-size: 0.7rem !important;\n }\n\n .float_row {\n display: flex !important;\n flex-direction: column;\n margin-bottom: 30px;\n border-bottom: 5px solid #00000029;\n }\n\n .float_cell {\n display: block !important;\n width: 100% !important;\n text-align: center !important;\n }\n\n .xs-centered {\n text-align: center !important;\n }\n\n .xs-centered input {\n text-align: center !important;\n }\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunksrc_rx=self.webpackChunksrc_rx||[]).push([[2534],{26104:(t,e,s)=>{s.d(e,{A:()=>i});s(29183);const i="./static/media/sentry.e732e10c5c1ceed0955b2fec6dab33f8.svg"},95712:(t,e,s)=>{s.d(e,{A:()=>l});var i=s(29183),o=s(89303),n=s(1373),a=s(99277);const r={button:{marginLeft:10,marginRight:10},icon:{marginRight:5}};const l=function(t){let{arrayItem:e,title:s,onClick:l,value:p,contained:d,buttonIcon:c,icons:h,t:u,translateSuffix:g,noTranslation:m}=t;const[x,y]=(0,i.useState)(null);return g=g||"",(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Tooltip,{title:s||"",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:(0,a.jsxs)(o.Button,{style:r.button,variant:d?"contained":"outlined",color:"primary",onClick:t=>y(t.currentTarget),children:[c||h&&(0,a.jsx)(n.A,{iconName:p,style:r.icon}),"number"===typeof p||m?p:u(p+g)]})}),(0,a.jsx)(o.Menu,{anchorEl:x,keepMounted:!0,open:Boolean(x),onClose:()=>y(null),children:e.map(((t,e)=>{let{name:s}=t;return(0,a.jsxs)(o.MenuItem,{selected:p||0===p?s===p:0===e,disabled:p||0===p?s===p:0===e,className:`tag-card-${s}`,style:{placeContent:"space-between"},value:s,onClick:()=>{l(s),y(null)},children:[h&&(0,a.jsx)(n.A,{iconName:s,style:r.icon}),"number"===typeof s||m?s:u(s+g)]},s)}))})]})}},1373:(t,e,s)=>{s.d(e,{A:()=>l});var i=s(29183),o=s(32075),n=s(99277);const a={},r={All:o.AllInclusive,messaging:o.Message,communication:o.WifiTethering,general:o.Apps,logic:o.VpnKey,alarm:o.NotificationsActive,"iot-systems":o.SystemUpdateAlt,"misc-data":o.EmojiSymbols,multimedia:o.PermMedia,network:o.SettingsEthernet,storage:o.Storage,visualization:o.Visibility,"climate-control":o.SettingsBrightness,"date-and-time":o.DateRange,energy:o.BatteryChargingFull,garden:o.FilterVintage,geoposition:o.LocationOn,hardware:o.Phonelink,health:o.Favorite,household:o.House,infrastructure:o.Apartment,lighting:o.EmojiObjects,protocols:o.DialerSip,utility:o.PhonelinkSetup,vehicle:o.AirportShuttle,"visualization-icons":o.BubbleChart,"visualization-widgets":o.Widgets,weather:o.Brightness6,metering:o.LinearScale};const l=function(t){let{iconName:e,className:s,adapter:l,socket:p,onClick:d,style:c}=t;const[h,u]=(0,i.useState)("");if((0,i.useEffect)((()=>{l&&p&&(a[l]instanceof Promise||(a[l]=p.getObject(`system.adapter.${l}`)),a[l].then((t=>{var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.icon)&&u(`../../adapter/${l}/${t.common.icon}`)})))}),[l,p]),l)return(0,n.jsx)("img",{onClick:t=>d&&d(t),src:h||"",className:s,style:c,alt:""});const g=r[e]||o.Help;return(0,n.jsx)(g,{className:s,style:c,onClick:t=>d&&d(t)})}},62534:(t,e,s)=>{s.r(e),s.d(e,{default:()=>xt});var i=s(29183),o=s.n(i),n=s(84929),a=s.n(n),r=s(89303),l=s(32075),p=s(25512),d=s(95712),c=s(26699),h=s(59718),u=s(99277);const g={smallAvatar:{width:24,height:24},listItem:t=>({mb:"2px",background:t.palette.background,"@media screen and (max-width: 400px)":{pl:"2px"}}),toVersion:t=>({color:"dark"===t.palette.mode?"#00dc00":"#008100",fontWeight:"bold",ml:"4px"}),updateDone:{background:"#5ef05e80",opacity:.7},minWidthCss:{"@media screen and (max-width: 400px)":{minWidth:32}},wrapperButton:{},typography:{paddingRight:30},versions:{minWidth:110,display:"inline-block"},closeButton:t=>({position:"absolute",right:8,top:8,color:t.palette.grey[500]}),languageButton:{position:"absolute",right:60,top:8},languageButtonActive:t=>({color:t.palette.primary.main}),versionHeader:t=>({background:"#4dabf5",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:"dark"===t.palette.mode?"black":"white"})};class m extends i.Component{constructor(t){super(t),this.updateAvailable=void 0,this.initialVersions=void 0,this.currentRef=void 0,this.current=void 0,this.updateAvailable=this.detectUpdates(),this.initialVersions={},this.updateAvailable.forEach((t=>this.initialVersions[t]=this.props.installed[t].version)),this.state={showNews:null},this.currentRef=o().createRef(),this.current=t.current,this.props.onUpdateSelected([...this.updateAvailable],this.updateAvailable)}static isUpdateAvailable(t){const{oldVersion:e,newVersion:s,name:i}=t;try{return a().gt(s,e)}catch{return console.warn(`Cannot compare "${s}" and "${e}" of adapter ${i}`),!1}}detectUpdates(){const t=[];return Object.keys(this.props.repository).forEach((e=>{const s=this.props.installed[e];"js-controller"!==e&&"admin"!==e&&s&&this.props.repository[e].version&&s.ignoreVersion!==this.props.repository[e].version&&m.isUpdateAvailable({oldVersion:s.version,newVersion:this.props.repository[e].version,name:e})&&((0,h.Q)(this.props.repository[e].messages,s.version,this.props.repository[e].version)?console.log(`Adapter ${e} is filtered out from update all functionality, because it has messages which need to be read before update`):t.push(e))})),t.sort(),t}getNews(t){const e=this.props.repository[t],s=this.props.installed[t],i=[];return s&&null!==e&&void 0!==e&&e.news&&Object.keys(e.news).forEach((t=>{try{a().gt(t,s.version)&&i.push({version:t,news:this.props.noTranslation?e.news[t].en:e.news[t][this.props.lang]||e.news[t].en})}catch{console.warn(`Cannot compare "${t}" and "${s.version}"`)}})),i}renderOneAdapter(t){const e=this.props.selected.includes(t);if((this.props.finished||this.props.inProcess)&&!e)return null;if(!this.props.installed[t])return null;const s=`.${this.props.installed[t].localIcon}`;return(0,u.jsxs)(r.ListItem,{dense:!0,sx:{"&.MuiListItem-root":c.Utils.getStyle(this.props.theme,g.listItem,this.props.updated.includes(t)&&g.updateDone)},ref:this.props.current===t?this.currentRef:null,secondaryAction:this.props.finished||this.props.inProcess?this.props.current===t&&!this.props.stopped&&!this.props.finished&&(0,u.jsx)(r.CircularProgress,{}):(0,u.jsx)(r.Checkbox,{edge:"end",checked:e,tabIndex:-1,disableRipple:!0,disabled:this.props.inProcess,onClick:()=>{const e=[...this.props.selected],s=e.indexOf(t);-1!==s?e.splice(s,1):(e.push(t),e.sort()),this.props.onUpdateSelected(e)}}),children:[(0,u.jsx)(r.ListItemIcon,{sx:g.minWidthCss,children:(0,u.jsx)(r.Avatar,{variant:"square",alt:t,src:s,style:g.smallAvatar})}),(0,u.jsx)(r.ListItemText,{primary:t,title:this.getNews(t).map((t=>`${t.version}: ${t.news}`)).join("\n"),secondary:(0,u.jsxs)("span",{children:[(0,u.jsxs)("div",{style:g.versions,children:[this.initialVersions[t]," \u2192",(0,u.jsx)(r.Box,{component:"span",sx:g.toVersion,children:this.props.repository[t].version})]}),(0,u.jsx)(r.IconButton,{title:c.I18n.t("Show change log"),onClick:()=>this.setState({showNews:{adapter:t,version:this.props.repository[t].version,fromVersion:this.initialVersions[t]}}),size:"small",children:(0,u.jsx)(l.Info,{})})]})})]},t)}getReactNews(t,e){const s=this.props.repository[t],i=this.props.installed[t];e=e||i.version;const o=[];return i&&null!==s&&void 0!==s&&s.news&&Object.keys(s.news).forEach((t=>{try{if(a().gt(t,e)&&s.news[t]){const e=(this.props.noTranslation?s.news[t].en||"":s.news[t][this.props.lang]||s.news[t].en||"").split("\n").map((t=>t.trim().replace(/^\*\s?/,"").replace(/<!--[^>]*->/g,"").replace(/<! -[^>]*->/g,"").trim())).filter((t=>!!t));o.push((0,u.jsxs)(r.Grid2,{children:[(0,u.jsx)(r.Typography,{sx:g.versionHeader,children:t}),e.map(((e,s)=>(0,u.jsx)(r.Typography,{component:"div",variant:"body2",children:`\u2022 ${e}`},`${t}-${s}`)))]},t))}}catch{console.warn(`Cannot compare "${t}" and "${e}"`)}})),o}renderShowNews(){if(this.state.showNews){const t=this.getReactNews(this.state.showNews.adapter,this.state.showNews.fromVersion),e=c.Utils.getStyle(this.props.theme,g.closeButton),s=c.Utils.getStyle(this.props.theme,g.languageButtonActive);return(0,u.jsxs)(r.Dialog,{onClose:()=>this.setState({showNews:null}),open:!0,children:[(0,u.jsx)(r.DialogTitle,{children:(0,u.jsxs)(r.Typography,{component:"h2",variant:"h6",sx:{"&.MuiTypography-root":g.typography},children:[(0,u.jsx)("div",{style:{width:"calc(100% - 60px)"},children:c.I18n.t('Update "%s" to v%s',this.state.showNews.adapter,this.state.showNews.version)}),(0,u.jsx)(r.IconButton,{size:"large",style:e,onClick:()=>this.setState({showNews:null}),children:(0,u.jsx)(l.Close,{})}),"en"!==c.I18n.getLanguage()&&this.props.toggleTranslation?(0,u.jsx)(r.IconButton,{size:"large",style:{...g.languageButton,...this.props.noTranslation?s:void 0},onClick:this.props.toggleTranslation,title:c.I18n.t("Disable/Enable translation"),children:(0,u.jsx)(l.Language,{})}):null]})}),(0,u.jsx)(r.DialogContent,{dividers:!0,children:(0,u.jsx)(r.Grid2,{container:!0,direction:"column",spacing:2,wrap:"nowrap",children:t.length?(0,u.jsxs)(r.Grid2,{children:[(0,u.jsx)(r.Typography,{variant:"h6",gutterBottom:!0,children:c.I18n.t("Change log")}),(0,u.jsx)(r.Grid2,{container:!0,spacing:2,direction:"column",wrap:"nowrap",children:t})]}):c.I18n.t("No change log available")})}),(0,u.jsx)(r.DialogActions,{style:g.wrapperButton,children:(0,u.jsx)(r.Button,{variant:"contained",onClick:()=>this.setState({showNews:null}),color:"grey",startIcon:(0,u.jsx)(l.Close,{}),children:c.I18n.t("Close")})})]})}return null}render(){return this.current!==this.props.current&&(this.current=this.props.current,setTimeout((()=>{var t;return null===(t=this.currentRef.current)||void 0===t?void 0:t.scrollIntoView()}),200)),(0,u.jsxs)(r.List,{style:g.root,children:[this.updateAvailable.map((t=>this.renderOneAdapter(t))),this.renderShowNews()]})}}const x=m;var y=s(89634);const v={dialogRoot:{height:"calc(100% - 64px)"},wrapperHead:{justifyContent:"space-between",display:"flex"},checkbox:{marginRight:10},appBar:t=>({flexWrap:"wrap",position:"sticky",bottom:-10,pl:1,background:"blue"===t.name?"#5d6467":"dark"===t.name?"#5b5b5b":"#FFF"}),container:{overflow:"hidden",height:"calc(100% - 48px)","@media screen and (max-width: 602px)":{height:"auto"}},content:{"@media screen and (max-width: 500px)":{p:1}},languageButton:{position:"absolute",right:73,top:11},languageButtonActive:t=>({color:t.palette.primary.main})};class f extends i.Component{constructor(t){super(t),this.updateAvailable=[],this.onAdapterFinished=void 0,this.processList=void 0,this.state={selected:[],inProcess:!1,finished:!1,current:"",updated:[],stopped:!1,debug:"true"===(window._localStorage||window.localStorage).getItem("AdaptersUpdaterDialog.debug"),stopOnError:"false"!==(window._localStorage||window.localStorage).getItem("AdaptersUpdaterDialog.stopOnError"),closeOnFinished:"true"===(window._localStorage||window.localStorage).getItem("AdaptersUpdaterDialog.closeOnFinished"),currentVersion:""},this.updateAvailable=[]}updateAdapter(t,e,s){this.onAdapterFinished=s,this.setState({current:t,currentVersion:e})}onStartUpdate(){this.setState({inProcess:!0},(()=>{this.props.onSetCommandRunning(!0),this.processList=[...this.state.selected].map((t=>{var e;return{adapter:t,version:null===(e=this.props.repository[t])||void 0===e?void 0:e.version}})),this.updateAdapters((()=>{this.setState({inProcess:!1,finished:!0},(()=>{this.props.onSetCommandRunning(!1),this.state.closeOnFinished&&this.props.onClose(!!this.state.updated.length)}))}))}))}updateAdapters(t){if(this.processList&&this.processList.length&&!this.state.stopped){const{adapter:e,version:s}=this.processList.shift();this.updateAdapter(e,s,(()=>{const s=[...this.state.updated];s.push(e),this.setState({updated:s},(()=>setTimeout((()=>this.updateAdapters(t)),200)))}))}else t&&t()}render(){const t=this.props.noTranslation?c.Utils.getStyle(this.props.theme,v.languageButtonActive):void 0;return(0,u.jsxs)(r.Dialog,{open:!0,maxWidth:"lg",fullWidth:!!this.state.current,onClose:()=>this.props.onClose(!!this.state.updated.length),"aria-labelledby":"update-dialog-title","aria-describedby":"update-dialog-description",sx:{"& .MuiPaper-root":v.dialogRoot},scroll:"paper",children:[(0,u.jsx)(r.DialogTitle,{id:"update-dialog-title",children:(0,u.jsxs)("div",{style:v.wrapperHead,children:[this.props.t("Update %s adapter(s)",this.state.selected.length),!this.state.finished&&!this.state.inProcess&&(0,u.jsx)(r.Tooltip,{title:this.props.t("Select/Unselect all"),slotProps:{popper:{sx:{pointerEvents:"none"}}},children:(0,u.jsx)(r.Checkbox,{checked:this.state.selected.length===this.updateAvailable.length,style:v.checkbox,tabIndex:-1,indeterminate:this.state.selected.length!==this.updateAvailable.length&&0!==this.state.selected.length,disableRipple:!0,onClick:()=>{let t=[];this.state.selected.length!==this.updateAvailable.length&&(t=[...this.updateAvailable]),this.setState({selected:t})}})}),"en"!==c.I18n.getLanguage()&&this.props.toggleTranslation?(0,u.jsx)(r.IconButton,{size:"large",style:{...v.languageButton,...t},onClick:()=>this.props.toggleTranslation(),title:c.I18n.t("Disable/Enable translation"),children:(0,u.jsx)(l.Language,{})}):null]})}),(0,u.jsxs)(r.DialogContent,{sx:{"&.MuiDialogContent-root":v.content},style:{height:"100%"},children:[(0,u.jsxs)(r.Grid2,{container:!0,direction:"row",sx:v.container,children:[(0,u.jsx)(r.Grid2,{style:{height:"100%",overflow:"hidden",width:this.state.current?250:"100%"},children:(0,u.jsx)("div",{style:{height:"100%",overflow:"auto"},children:(0,u.jsx)(x,{finished:this.state.finished,inProcess:this.state.inProcess,selected:this.state.selected,current:this.state.current,stopped:this.state.stopped,updated:this.state.updated,lang:this.props.lang,installed:this.props.installed,repository:this.props.repository,noTranslation:this.props.noTranslation,toggleTranslation:this.props.toggleTranslation,onUpdateSelected:(t,e)=>{e&&(this.updateAvailable=e),this.setState({selected:t})},theme:this.props.theme})})}),!!this.state.current&&(0,u.jsx)(r.Grid2,{style:{height:"100%",overflow:"hidden",width:"calc(100% - 260px)",minWidth:240},children:(0,u.jsx)(y.A,{noSpacing:!0,ready:!0,host:this.props.currentHost,socket:this.props.socket,t:this.props.t,cmd:`upgrade ${this.state.current}@${this.state.currentVersion}${this.state.debug?" --debug":""}`,onFinished:()=>this.onAdapterFinished(),errorFunc:()=>{this.state.stopOnError?(this.setState({stopped:!0,finished:!0}),this.onAdapterFinished=null,this.props.onSetCommandRunning(!1)):this.onAdapterFinished()}},this.state.current)})]}),(0,u.jsxs)(r.Toolbar,{variant:"dense",disableGutters:!0,sx:v.appBar,children:[(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{disabled:this.state.finished,checked:this.state.stopOnError,onChange:()=>{(window._localStorage||window.localStorage).setItem("AdaptersUpdaterDialog.stopOnError",this.state.stopOnError?"false":"true"),this.setState({stopOnError:!this.state.stopOnError})}}),label:this.props.t("Stop on error")}),(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{disabled:this.state.finished,checked:this.state.closeOnFinished,onChange:()=>{(window._localStorage||window.localStorage).setItem("AdaptersUpdaterDialog.closeOnFinished",this.state.closeOnFinished?"false":"true"),this.setState({closeOnFinished:!this.state.closeOnFinished})}}),label:this.props.t("Close on finished")}),(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{disabled:this.state.finished||this.state.inProcess,checked:this.state.debug,onChange:()=>{(window._localStorage||window.localStorage).setItem("AdaptersUpdaterDialog.debug",this.state.debug?"false":"true"),this.setState({debug:!this.state.debug})}}),label:this.props.t("Debug info")})]})]}),(0,u.jsxs)(r.DialogActions,{children:[(0,u.jsx)(r.Button,{id:"adapters-update-dialog-update",variant:"contained",disabled:this.state.stopped||this.state.inProcess||this.state.finished||!this.state.selected.length,onClick:()=>this.onStartUpdate(),color:"primary",autoFocus:!0,startIcon:(0,u.jsx)(l.Check,{}),children:this.props.t("Update")}),(0,u.jsx)(r.Button,{id:"adapters-update-dialog-cancel",variant:"contained",disabled:!this.state.inProcess,color:"grey",startIcon:(0,u.jsx)(l.Cancel,{}),onClick:()=>{this.setState({stopped:!0,finished:!0}),this.props.onSetCommandRunning(!1)},children:this.props.t("Cancel")}),(0,u.jsx)(r.Button,{id:"adapters-update-dialog-close",variant:"contained",onClick:()=>this.props.onClose(!!this.state.updated.length),disabled:this.state.inProcess&&!this.state.stopped,color:this.state.stopped?"error":"grey",startIcon:(0,u.jsx)(l.Close,{}),children:this.props.t("Close")})]})]})}}const b=f;var w=s(44373),j=s(73999),C=s(78884);function A(t){return{id:`github-install-dialog-tab-${t}`,"aria-controls":`github-install-dialog-panel-${t}`}}const S={root:t=>({backgroundColor:t.palette.background.paper,width:"100%",height:"100%"}),paper:{maxWidth:1e3},tabPaper:{padding:16},title:t=>({mt:"10px",p:1,ml:1,fontSize:18,color:t.palette.primary.main}),warningText:{color:"#f53939"},noteText:{marginTop:16},errorTextNoGit:{fontSize:13,color:"#ff1616"},listIcon:{width:24,height:24},listIconWithMargin:{width:24,height:24,marginRight:8},tabSelected:t=>({color:"dark"===t.palette.mode?t.palette.secondary.contrastText:"#222 !important"})};class T extends o().Component{constructor(t){super(t),this.state={autoCompleteValue:(window._localstorage||window.localStorage).getItem("App.autocomplete")||null,debug:"true"===(window._localstorage||window.localStorage).getItem("App.gitDebug"),url:(window._localstorage||window.localStorage).getItem("App.userUrl")||"",currentTab:(window._localstorage||window.localStorage).getItem("App.gitTab")||"npm"}}renderNpm(){return"npm"===this.state.currentTab?(0,u.jsxs)(r.Paper,{style:S.tabPaper,id:"github-install-dialog-panel-npm",children:[(0,u.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{checked:this.state.debug,onChange:t=>{(window._localstorage||window.localStorage).setItem("App.gitDebug",t.target.checked?"true":"false"),this.setState({debug:t.target.checked})}}),label:this.props.t("Debug outputs")})}),(0,u.jsxs)("div",{style:{display:"flex",alignItems:"flex-end"},children:[(0,u.jsx)(l.Sms,{style:{marginRight:10}}),(0,u.jsx)(r.Autocomplete,{fullWidth:!0,value:this.state.autoCompleteValue,onChange:(t,e)=>{(window._localstorage||window.localStorage).setItem("App.autocomplete",e),this.setState({autoCompleteValue:e})},options:this.getList(),getOptionLabel:t=>{var e;return null!==(e=null===t||void 0===t?void 0:t.name)&&void 0!==e?e:""},renderInput:t=>{var e;const s={...t};return s.InputProps=s.InputProps||{},s.InputProps.startAdornment=(0,u.jsx)(r.InputAdornment,{position:"start",children:(0,u.jsx)(c.Icon,{src:(null===(e=this.state.autoCompleteValue)||void 0===e?void 0:e.icon)||"",style:S.listIcon})}),(0,u.jsx)(r.TextField,{variant:"standard",...t,label:c.I18n.t("Select adapter")})},renderOption:(t,e)=>{var s;return(0,u.jsxs)(r.Box,{component:"li",sx:{"& > img":{mr:2,flexShrink:0}},...t,children:[(0,u.jsx)(c.Icon,{src:(null===e||void 0===e?void 0:e.icon)||"",style:S.listIconWithMargin}),null!==(s=null===e||void 0===e?void 0:e.name)&&void 0!==s?s:""]})}})]}),(0,u.jsx)("div",{style:{fontSize:24,fontWeight:"bold",marginTop:40},children:this.props.t("Warning!")}),(0,u.jsx)("div",{style:S.warningText,children:this.props.t("npm_warning","NPM","NPM")}),(0,u.jsx)("div",{style:S.noteText,children:this.props.t("github_note")})]}):null}renderGitHub(){return"GitHub"===this.state.currentTab?(0,u.jsxs)(r.Paper,{style:S.tabPaper,id:"github-install-dialog-panel-github",children:[(0,u.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{checked:this.state.debug,onChange:t=>{(window._localstorage||window.localStorage).setItem("App.gitDebug",t.target.checked?"true":"false"),this.setState({debug:t.target.checked})}}),label:this.props.t("Debug outputs")})}),(0,u.jsxs)("div",{style:{display:"flex",alignItems:"flex-end"},children:[(0,u.jsx)(l.Sms,{style:{marginRight:10}}),(0,u.jsx)(r.Autocomplete,{fullWidth:!0,value:this.state.autoCompleteValue,getOptionDisabled:t=>!(null===t||void 0===t||!t.nogit),renderOption:(t,e)=>{var s;return(0,u.jsxs)(r.Box,{component:"li",sx:{"& > img":{mr:2,flexShrink:0}},...t,children:[(0,u.jsx)(c.Icon,{src:(null===e||void 0===e?void 0:e.icon)||"",style:S.listIconWithMargin}),null!==(s=null===e||void 0===e?void 0:e.name)&&void 0!==s?s:"",(null===e||void 0===e?void 0:e.nogit)&&(0,u.jsx)("div",{style:S.errorTextNoGit,children:c.I18n.t("This adapter cannot be installed from git as must be built before installation.")})]})},onChange:(t,e)=>{(window._localstorage||window.localStorage).setItem("App.autocomplete",e),this.setState({autoCompleteValue:e})},options:this.getList(),getOptionLabel:t=>{var e;return null!==(e=null===t||void 0===t?void 0:t.name)&&void 0!==e?e:""},renderInput:t=>{var e;const s={...t};return s.InputProps=s.InputProps||{},s.InputProps.startAdornment=(0,u.jsx)(r.InputAdornment,{position:"start",children:(0,u.jsx)(c.Icon,{src:(null===(e=this.state.autoCompleteValue)||void 0===e?void 0:e.icon)||"",style:S.listIconWithMargin})}),(0,u.jsx)(r.TextField,{variant:"standard",...t,label:c.I18n.t("Select adapter")})}})]}),(0,u.jsx)("div",{style:{fontSize:24,fontWeight:"bold",marginTop:40},children:this.props.t("Warning!")}),(0,u.jsx)("div",{style:S.warningText,children:this.props.t("github_warning","GitHub","GitHub")}),(0,u.jsx)("div",{style:S.noteText,children:this.props.t("github_note")})]}):null}renderCustom(){return"URL"===this.state.currentTab?(0,u.jsxs)(r.Paper,{style:S.tabPaper,id:"github-install-dialog-panel-custom",children:[(0,u.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{checked:this.state.debug,onChange:t=>{(window._localstorage||window.localStorage).setItem("App.gitDebug",t.target.checked?"true":"false"),this.setState({debug:t.target.checked})}}),label:this.props.t("Debug outputs")})}),(0,u.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,u.jsx)(r.TextField,{variant:"standard",fullWidth:!0,label:this.props.t("URL"),helperText:this.props.t("URL or file path"),value:this.state.url,onChange:t=>{(window._localstorage||window.localStorage).setItem("App.userUrl",t.target.value),this.setState({url:t.target.value})},onKeyUp:t=>{"Enter"===t.key&&this.state.url&&(this.state.url.includes(".")?this.props.installFromUrl(this.state.url,this.state.debug,!0):this.props.installFromUrl(`iobroker.${this.state.url}`,this.state.debug,!0))},slotProps:{input:{endAdornment:this.state.url?(0,u.jsx)(r.InputAdornment,{position:"end",children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>this.setState({url:""}),children:(0,u.jsx)(l.Close,{})})}):null}}})}),(0,u.jsx)("div",{style:{fontSize:24,fontWeight:"bold",marginTop:40},children:this.props.t("Warning!")}),(0,u.jsx)("div",{style:S.warningText,children:this.props.t("github_warning","URL","URL")}),(0,u.jsx)("div",{style:S.noteText,children:this.props.t("github_note")})]}):null}getList(){const t=function(t){const e=[];for(let s=0;s<t.length;s++)"object"===typeof t[s]?t[s].forEach((t=>e.push(t))):e.push(t[s]);return e}(this.props.categories.map((t=>t.adapters)));return t.sort(),t.map(((e,s)=>{if(s&&t[s-1]===e)return null;const i=this.props.repository[e];if(null===i||void 0===i||!i.controller){const t=(i.extIcon||i.meta||i.readme||"").toString().split("/");let s=null===i||void 0===i?void 0:i.name;s||(s=i.titleLang,s=s&&"object"===typeof s?s[c.I18n.getLanguage()]||s.en:i.title||e);const o={value:`${e}/${t[3]}`,name:`${s} [${t[3]}]`,icon:i.extIcon||i.icon,nogit:!!i.nogit,title:e};return this.props.installed[s]&&"admin"!==s&&(o.icon=`/adapter/${e}/${i.icon.split("/admin/").pop()}`),o}return null})).filter((t=>t)).sort(((t,e)=>t.name<e.name?-1:t.name>e.name?1:0))}render(){var t;const e=()=>this.setState({autoCompleteValue:null,url:""});return(0,u.jsxs)(r.Dialog,{onClose:()=>this.props.onClose(),open:!0,sx:{"& .MuiDialog-paper":S.paper},children:[(0,u.jsx)(r.DialogContent,{dividers:!0,children:(0,u.jsxs)(r.Box,{component:"div",sx:S.root,children:[(0,u.jsx)(r.AppBar,{position:"static",color:"default",children:(0,u.jsxs)(r.Tabs,{value:this.state.currentTab,onChange:(t,e)=>{(window._localstorage||window.localStorage).setItem("App.gitTab",e),this.setState({currentTab:e})},variant:"fullWidth",indicatorColor:"secondary",children:[(0,u.jsx)(r.Tab,{label:this.props.t("From npm"),wrapped:!0,sx:{"&.Mui-selected":S.tabSelected},icon:(0,u.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEOSURBVGhD7dixCoJQGMVxDSOoodFACJSmaPQ5mpscfYUeo6WXCFx6gFanpsDRqMWhRYgGIbSWbxFBbdDThfNb9Iz/4XJF/aypbSBPZTEAjQFoDEBjAJryAS0+JXRdNwx578snz7WikFGrOWBk28soktGXm+elQSCjVosAx1nFsYy+XDeb9HCQUYuHGI0BaAxAUz6g23vgeToVWSajbGiaE9eVUdH+Hug24GJZ7ySRUTZdrxfHo4wKXmTqYAAaA9AYgMYANAagMQCNAWgMQGMAGgPQGIDGADTlA5r/jRqmOd/vZfzo7vt5msooG7vubLuVUfHY7V5hKKNWc8Cf4xlAYwAaA9AYgMYANAZgadoX+gw72Zvh2hIAAAAASUVORK5CYII=",alt:"npm",width:24,height:24}),...A("npm"),value:"npm"}),(0,u.jsx)(r.Tab,{label:this.props.t("From github"),wrapped:!0,sx:{"&.Mui-selected":S.tabSelected},icon:(0,u.jsx)(p.hL4,{style:{width:24,height:24},width:24,height:24}),...A("github"),value:"GitHub"}),(0,u.jsx)(r.Tab,{label:this.props.t("Custom"),wrapped:!0,sx:{"&.Mui-selected":S.tabSelected},icon:(0,u.jsx)(l.Language,{width:24,height:24}),...A("custom"),value:"URL"})]})}),(0,u.jsx)(r.Box,{component:"div",sx:S.title,children:this.props.t("Install or update the adapter from %s",this.state.currentTab||"npm")}),this.renderNpm(),this.renderGitHub(),this.renderCustom()]})}),(0,u.jsxs)(r.DialogActions,{children:[(0,u.jsx)(r.Button,{id:"github-install-dialog-ok",variant:"contained",disabled:("GitHub"===this.state.currentTab||"npm"===this.state.currentTab)&&!(null!==(t=this.state.autoCompleteValue)&&void 0!==t&&t.value)||"URL"===this.state.currentTab&&!this.state.url,autoFocus:!0,onClick:async()=>{if("GitHub"===this.state.currentTab){var t;const e=((null===(t=this.state.autoCompleteValue)||void 0===t?void 0:t.value)||"").split("/"),s=`${e[1]}/ioBroker.${e[0]}`;this.props.installFromUrl(s,this.state.debug,!0)}else if("URL"===this.state.currentTab)this.state.url.includes(".")?this.props.installFromUrl(this.state.url,this.state.debug,!0):this.props.installFromUrl(`iobroker.${this.state.url}`,this.state.debug,!0);else if("npm"===this.state.currentTab){var s;const t=((null===(s=this.state.autoCompleteValue)||void 0===s?void 0:s.value)||"").split("/")[0],e=t.includes(".")?t.split(".")[1]:t;try{await this.props.installFromUrl(`iobroker.${e}@latest`,this.state.debug,!0),this.props.upload(e)}catch(i){console.error(`Installation from url failed: ${i.message}`)}}this.props.onClose(),e()},color:"primary",startIcon:(0,u.jsx)(l.Check,{}),children:this.props.t("Install")}),(0,u.jsx)(r.Button,{id:"github-install-dialog-close",variant:"contained",onClick:()=>{this.props.onClose(),e()},color:"grey",startIcon:(0,u.jsx)(l.Close,{}),children:this.props.t("Close")})]})]})}}const I=T;var k=s(38969);const D={formControl:{marginTop:24,width:100},closeButton:t=>({position:"absolute",right:8,top:8,color:t.palette.grey[500]}),languageButton:{position:"absolute",right:60,top:8},languageButtonActive:t=>({color:t.palette.primary.main}),paper:{},typography:{pr:"30px"},messageText:{},messageColor_warn:{color:"#cb7642"},messageColor_error:{color:"#f5614d"},messageColor_info:{color:"#5abd29"},messageTitle_warn:t=>({background:"#cb7642",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:"dark"===t.palette.mode?"black":"white"}),messageTitle_error:t=>({background:"#f5614d",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:"dark"===t.palette.mode?"black":"white"}),messageTitle_info:t=>({background:"#5abd29",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:"dark"===t.palette.mode?"black":"white"}),deps:t=>({m:"10px",fontSize:16,color:"dark"===t.palette.mode?"#e70000":"#840101"})};class V extends i.Component{constructor(t){super(t),this.t=void 0,this.messages=null,this.lang=void 0,this.state={instanceNumbers:[]},this.t=t.t,this.lang=c.I18n.getLanguage(),this.messages=(0,h.Q)(t.adapterObject.messages,null,t.adapterObject.version,t.instances)}componentDidMount(){this.props.instancesWorker.getInstances().then((t=>{const e=Object.keys(t).filter((e=>{var s,i;return(null===(s=t[e])||void 0===s||null===(i=s.common)||void 0===i?void 0:i.name)===this.props.adapter})).map((t=>t.substring(t.lastIndexOf(".")+1)));this.setState({instanceNumbers:e})}))}getAvailableInstances(){const t=[];t.push((0,u.jsx)(r.MenuItem,{value:"auto",children:this.t("auto")},"auto"));for(let e=0;e<=10;e++)this.state.instanceNumbers.includes(e.toString())||t.push((0,u.jsx)(r.MenuItem,{value:e,children:e},e));return t}checkDependencies(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.dependencies;if(!t)return"";const e=[];for(const s of t)s.installedVersion?s.rightVersion||e.push(`${this.props.t("Invalid version of %s. Required %s. Current ",s.name,s.version)}${s.installedVersion}`):e.push(this.props.t('Latest available version of "%s" is required, but nothing installed. Please install first "%s" and then retry.',s.name,s.name));return e.length?e.map((t=>(0,u.jsx)("div",{children:t},t))):""}getText(t,e){return t&&"object"===typeof t?e?t.en:t[this.lang]||t.en:"object"===typeof t?"":t}renderOneMessage(t,e){return(0,u.jsxs)(r.Grid2,{children:[(0,u.jsx)(r.Typography,{sx:D[`messageTitle_${t.level||"warn"}`],children:this.getText(t.title,this.props.noTranslation)||""}),(0,u.jsx)(r.Typography,{component:"div",variant:"body2",style:D.messageText,children:this.getText(t.text,this.props.noTranslation)||""}),t.link?(0,u.jsx)(r.Button,{onClick:()=>{window.open(t.link,"_blank").focus()},startIcon:(0,u.jsx)(l.Public,{}),variant:"contained",color:"grey",children:this.getText(t.linkText,this.props.noTranslation)||this.props.t("More info")}):null]},e)}renderMessages(){return this.messages?(0,u.jsx)(r.Grid2,{container:!0,spacing:2,direction:"column",wrap:"nowrap",sx:{marginBottom:1},children:this.messages.map(((t,e)=>this.renderOneMessage(t,e)))}):null}render(){const t=this.checkDependencies();return(0,u.jsxs)(r.Dialog,{onClose:()=>{},open:!0,sx:{"& .MuiDialog-paper":D.paper},children:[(0,u.jsx)(r.DialogTitle,{children:(0,u.jsxs)(r.Typography,{component:"h2",variant:"h6",sx:{"&.MuiTypography-root":D.typography},children:[this.t("You are going to add new instance:")," ",this.props.adapter,(0,u.jsx)(r.IconButton,{size:"large",sx:D.closeButton,onClick:()=>this.props.onClose(!1),children:(0,u.jsx)(l.Close,{})}),this.messages&&"en"!==this.lang&&this.props.toggleTranslation?(0,u.jsx)(r.IconButton,{size:"large",style:c.Utils.getStyle(this.props.theme,D.languageButton,this.props.noTranslation&&D.languageButtonActive),onClick:this.props.toggleTranslation,title:c.I18n.t("Disable/Enable translation"),children:(0,u.jsx)(l.Language,{})}):null]})}),(0,u.jsxs)(r.DialogContent,{dividers:!0,children:[this.renderMessages(),!t&&this.props.expertMode?(0,u.jsxs)(r.Grid2,{container:!0,direction:"column",children:[(0,u.jsx)(k.A,{tooltip:this.t("Select host to add the instance"),expertMode:!0,socket:this.props.socket,hostsWorker:this.props.hostsWorker,currentHost:this.props.currentHost,setCurrentHost:(t,e)=>this.props.onHostChange(e.replace(/^system\.host\./,""))}),(0,u.jsxs)(r.FormControl,{variant:"standard",style:D.formControl,children:[(0,u.jsx)(r.InputLabel,{id:"instance-label",children:this.t("Instance")}),(0,u.jsx)(r.Select,{variant:"standard",labelId:"instance-label",value:this.props.currentInstance,onChange:this.props.onInstanceChange,children:this.getAvailableInstances()})]})]}):null,(0,u.jsx)(r.Box,{component:"div",sx:D.deps,children:t})]}),(0,u.jsxs)(r.DialogActions,{children:[(0,u.jsx)(r.Button,{id:"instance-add-dialog-ok",variant:"contained",autoFocus:!0,disabled:!!t,onClick:()=>this.props.onClose(!0),color:"primary",startIcon:(0,u.jsx)(l.Add,{}),children:this.t("Add")}),(0,u.jsx)(r.Button,{id:"instance-add-dialog-cancel",variant:"contained",onClick:()=>this.props.onClose(!1),color:"grey",startIcon:(0,u.jsx)(l.Close,{}),children:this.t("Close")})]})]})}}const R=V;var N=s(49549);function L(t){var e;if(!t)return"";let s=(null===(e=t.licenseInformation)||void 0===e?void 0:e.link)||t.licenseUrl;if(!s||!s.includes("/LICENSE")||!s.includes("raw.githubusercontent.com")){if(s=t.extIcon,!s){if(s=t.readme,!s)return console.error(`No extIcon for ${t.name}`),"";s=s.replace("github.com","raw.githubusercontent.com").replace("/blob/","/"),s.includes("/main")?s=`${s.split("/main")[0]}/main/LICENSE`:s.includes("/master")&&(s=`${s.split("/master")[0]}/master/LICENSE`)}if(s.includes("/main"))s=`${s.split("/main")[0]}/main/LICENSE`;else{if(!s.includes("/master"))return"";s=`${s.split("/master")[0]}/master/LICENSE`}}return s}class U extends i.Component{constructor(t){super(t),this.state={showDialog:!1,showLicenseDialog:null,addInstanceHostName:"",addInstanceId:"auto",addInstanceDialog:""}}renderLicenseDialog(t){return this.state.showLicenseDialog?(0,u.jsx)(N.A,{licenseType:this.state.showLicenseDialog.licenseType,url:this.state.showLicenseDialog.url,onClose:e=>{const s=e?this.state.showLicenseDialog:null;this.setState({showLicenseDialog:null,showDialog:!1},(()=>{s&&(s.upload?U.upload(s.adapterName,t):this.addInstance({adapterName:s.adapterName,context:t}).catch((t=>window.alert(`Cannot add instance: ${t}`))))}))}}):null}async addInstance(t){if(!t.customUrl){const e=t.context.repository[t.adapterName],s=(0,h.Q)(e.messages,null,e.version,t.context.compactInstances);if(!t.instance&&(t.context.expertMode||s))return void this.setState({addInstanceDialog:t.adapterName,showDialog:!0,addInstanceHostName:t.context.currentHost.replace(/^system\.host\./,""),addInstanceId:t.instance||"auto"});if(t.instance){const e=await t.context.instancesWorker.getInstances();if(e&&e[`system.adapter.${t.adapterName}.${t.instance}`])return void window.alert(t.context.t("Instance %s already exists",`${t.adapterName}.${t.instance}`))}}const e=(this.state.addInstanceHostName||t.context.currentHost).replace(/^system\.host\./,"");await new Promise(((s,i)=>{t.context.executeCommand(`${t.customUrl?"url":"add"} ${t.adapterName} ${t.instance?`${t.instance} `:""}--host ${e} ${t.debug||t.context.expertMode?"--debug":""}`,e,(t=>t?i(new Error(`The process returned an exit code of ${t}`)):s()))}))}static getDependencies(t,e){const s=e.repository[t],i=[];if(s){var o,n;s.dependencies&&!Array.isArray(s.dependencies)&&(s.dependencies=[s.dependencies]),s.globalDependencies&&!Array.isArray(s.globalDependencies)&&(s.globalDependencies=[s.globalDependencies]);const t=s.node;if(null!==(o=s.dependencies)&&void 0!==o&&o.length)for(const o of s.dependencies){const t={name:"",version:null,installed:!1,installedVersion:null,rightVersion:!1},s="string"!==typeof o,n=Object.keys(o);if(t.name=s?n?n[0]:null:o,t.version=s?o[t.name]:null,i&&t.name){const i=e.installed[t.name];t.installed=!!i,t.installedVersion=i?i.version:null;try{t.rightVersion=!!i&&(!s||a().satisfies(i.version,t.version,{includePrerelease:!0}))}catch{t.rightVersion=!0}}i.push(t)}if(null!==(n=s.globalDependencies)&&void 0!==n&&n.length)for(const o of s.globalDependencies){const t={name:"",version:null,installed:!1,installedVersion:null,rightVersion:!1},s="string"!==typeof o,n=Object.keys(o);if(t.name=s?n?n[0]:null:o,t.version=s?o[t.name]:null,i&&t.name){const i=e.installedGlobal[t.name];t.installed=!!i,t.installedVersion=i?i.version:null;try{t.rightVersion=!!i&&(!s||a().satisfies(i.version,t.version,{includePrerelease:!0}))}catch{t.rightVersion=!0}}i.push(t)}if(t){const s={name:"node",version:t,installed:!0,installedVersion:e.nodeJsVersion,rightVersion:!1};try{s.rightVersion=a().satisfies(e.nodeJsVersion,t)}catch{s.rightVersion=!0}i.push(s)}}return i}renderAddInstanceDialog(t){return this.state.addInstanceDialog?(0,u.jsx)(R,{adapter:this.state.addInstanceDialog,socket:t.socket,hostsWorker:t.hostsWorker,instancesWorker:t.instancesWorker,dependencies:U.getDependencies(this.state.addInstanceDialog,t),currentHost:`system.host.${this.state.addInstanceHostName}`,currentInstance:this.state.addInstanceId,t:t.t,onClose:e=>{const s=e?this.state.addInstanceDialog:"",i=e?this.state.addInstanceId:"";this.setState({addInstanceDialog:"",addInstanceId:"auto",showDialog:!1},(()=>{s&&this.addInstance({adapterName:s,instance:i,context:t})}))},onHostChange:t=>this.setState({addInstanceHostName:t.replace(/^system\.host\./,"")}),onInstanceChange:t=>this.setState({addInstanceId:t.target.value}),adapterObject:t.repository[this.state.addInstanceDialog],instances:t.compactInstances,toggleTranslation:t.toggleTranslation,noTranslation:t.noTranslation,expertMode:t.expertMode,theme:t.theme}):null}static upload(t,e){e.executeCommand(`upload ${t}${e.expertMode?" --debug":""}`)}onAddInstance(t,e){var s;const i=e.repository[t],o=L(i),n=(null===(s=i.licenseInformation)||void 0===s?void 0:s.license)||i.license;"MIT"===n?this.addInstance({adapterName:t,context:e}).catch((t=>window.alert(`Cannot add instance: ${t}`))):this.setState({showLicenseDialog:{url:o,adapterName:t,licenseType:n},showDialog:!0})}renderDialogs(t){return this.state.showDialog?(0,u.jsxs)(u.Fragment,{children:[this.renderAddInstanceDialog(t),this.renderLicenseDialog(t)]}):null}}var B=s(58693),O=s(61204),$=s(1373);const P={name:{flexWrap:"nowrap",width:300,marginTop:0},nameDiv:{display:"flex",alignItems:"center"},categoryName:{fontWeight:"bold",cursor:"pointer"},green:{color:B.A[500]},blue:{color:O.A[700]},category:{backgroundColor:"background.default"},marginRight5:{marginRight:5}};const M=function(t){const{installedCount:e,name:s,categoryName:i}=t;return(0,u.jsxs)(r.TableRow,{hover:!1,sx:P.category,children:[(0,u.jsx)(r.TableCell,{children:(0,u.jsx)(r.Grid2,{container:!0,spacing:1,alignItems:"center",style:P.name,children:(0,u.jsx)(r.Grid2,{component:"div",children:(0,u.jsx)(r.IconButton,{size:"small",onClick:t.onToggle,children:t.expanded?(0,u.jsx)(l.ExpandMore,{}):(0,u.jsx)(l.ChevronRight,{})})})})}),(0,u.jsx)(r.TableCell,{onClick:t.onToggle,children:(0,u.jsxs)("div",{style:{...P.nameDiv,...P.categoryName},children:[(0,u.jsx)($.A,{iconName:i,style:P.marginRight5}),s]})}),(0,u.jsxs)(r.TableCell,{colSpan:t.descHidden?5:6,children:[(0,u.jsx)(r.Typography,{component:"span",variant:"body2",style:P.green,children:e}),` ${t.t("of")} `,(0,u.jsx)(r.Typography,{component:"span",variant:"body2",style:P.blue,children:t.count}),` ${t.t("Adapters from this Group installed")}`]})]})};var F=s(96053),W=s(20501),E=s(90869);const H={rating:{marginBottom:20},listRating:{marginRight:8},listTime:{opacity:.5,fontStyle:"italic"},list:{},listOwn:t=>({backgroundColor:"colored"===t.name||"light"===t.name?"#16516e2e":t.palette.secondary.dark}),listTitle:t=>({backgroundColor:t.palette.primary.dark,pt:"4px",pb:"4px",mb:"4px",color:"#ffffff",textAlign:"center"}),languageFilter:{width:300},ratingTextControl:{width:"calc(100% - 138px)",marginRight:8},ratingLanguageControl:{width:130},noComments:{width:"100%",textAlign:"center",marginTop:16},commentCount:{marginTop:2,marginLeft:8,opacity:.8,fontSize:10,float:"right"},infoText:{textAlign:"left",fontSize:"14px"},infoTextContainer:{display:"flex",paddingBottom:"10px",alignItems:"center",gap:"10px"}},_=[{id:"en",title:"English"},{id:"de",title:"Deutsch"},{id:"ru",title:"\u0440\u0443\u0441\u0441\u043a\u0438\u0439"},{id:"pt",title:"Portugues"},{id:"nl",title:"Nederlands"},{id:"fr",title:"fran\xe7ais"},{id:"it",title:"Italiano"},{id:"es",title:"Espanol"},{id:"pl",title:"Polski"},{id:"uk",title:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"},{id:"zh-ch",title:"\u7b80\u4f53\u4e2d\u6587"}];class z extends i.Component{constructor(t){super(t),this.state={ratingNumber:0,ratingComment:"",votings:null,ratingLang:this.props.lang,filterLang:(window._localStorage||window.localStorage).getItem("app.commentLang")||this.props.lang,commentsByLanguage:{}}}componentDidMount(){fetch(`https://rating.iobroker.net/adapter/${this.props.adapter}?uuid=${this.props.uuid}`).then((t=>t.json())).then((t=>{(t=t||{}).rating=t.rating||{};const e=Object.keys(t.rating);e.sort(((e,s)=>t.rating[e].ts>t.rating[s].ts?-1:t.rating[e].ts<t.rating[s].ts?1:0));const s={};if(t.comments&&(t.comments.sort(((t,e)=>t.ts>e.ts?-1:t.ts<e.ts?1:0)),t.comments.forEach((t=>{s[t.lang]=s[t.lang]||0,s[t.lang]++}))),e.length){const i=t.rating[e[0]];this.setState({votings:t,ratingNumber:i?i.r:0,commentsByLanguage:s})}else this.setState({votings:t,commentsByLanguage:s})}))}setAdapterRating(t,e,s,i,o){return fetch("https://rating.iobroker.net/vote",{method:"POST",headers:{"Content-Type":"application/json"},redirect:"follow",body:JSON.stringify({uuid:this.props.uuid,adapter:t,version:e,rating:s,comment:i,lang:o})}).then((t=>t.json())).then((i=>(window.alert(`${this.props.t("Vote:")} ${t}@${e}=${s}`),delete i.adapter,i))).catch((t=>(window.alert(`Cannot vote: ${t}`),null)))}renderInfoText(){return(0,u.jsxs)("div",{style:H.infoTextContainer,children:[(0,u.jsx)(l.Info,{}),(0,u.jsx)(r.Typography,{style:H.infoText,children:this.props.t("use GitHub for issues")})]})}renderComments(){var t;if(null!==(t=this.state.votings)&&void 0!==t&&t.comments&&this.state.votings.comments.length){const t=this.state.votings.comments.find((t=>!(this.state.filterLang&&"_"!==this.state.filterLang&&t.lang!==this.state.filterLang)));return(0,u.jsxs)("div",{style:{width:"100%",textAlign:"left"},children:[(0,u.jsx)(r.Box,{component:"h3",sx:H.listTitle,children:this.props.t("Comments")}),(0,u.jsxs)(r.FormControl,{variant:"standard",style:H.languageFilter,children:[(0,u.jsx)(r.InputLabel,{children:this.props.t("Show comments in language")}),(0,u.jsxs)(r.Select,{variant:"standard",value:this.state.filterLang,onChange:t=>{(window._localStorage||window.localStorage).setItem("app.commentLang",t.target.value),this.setState({filterLang:t.target.value})},children:[(0,u.jsxs)(r.MenuItem,{value:"_",children:[this.props.t("All")," ",(0,u.jsx)("span",{style:H.commentCount,children:this.state.votings.comments.length})]}),_.map((t=>(0,u.jsxs)(r.MenuItem,{value:t.id,children:[t.title," ",this.state.commentsByLanguage[t.id]?(0,u.jsx)("span",{style:H.commentCount,children:this.state.commentsByLanguage[t.id]}):null]},t.id)))]})]}),(0,u.jsxs)(r.List,{style:H.list,dense:!0,disablePadding:!0,children:[t&&this.state.votings.comments.map(((t,e)=>this.state.filterLang&&"_"!==this.state.filterLang&&t.lang!==this.state.filterLang?null:t?(0,u.jsxs)(r.ListItem,{title:t.uuid?this.props.t("Your comment"):"",sx:{"&.MuiListItem-root":t.uuid?H.listOwn:void 0},dense:!0,children:[(0,u.jsx)(r.ListItemAvatar,{style:H.listRating,children:(0,u.jsx)(r.Rating,{readOnly:!0,defaultValue:t.rating,size:"small"})}),(0,u.jsx)(r.ListItemText,{primary:t.comment,secondary:`${new Date(t.ts).toLocaleString()} / v${t.version}`,sx:{"& .MuiListItemText-secondary":H.listTime}})]},e):null)),!t&&(0,u.jsx)("div",{style:H.noComments,children:this.props.t("No comments in selected language")})]})]})}return null}render(){var t,e,s;let i,o;if(this.state.votings){const t=this.state.votings.rating;o=Object.keys(t),o.sort(((e,s)=>t[e].ts>t[s].ts?-1:t[e].ts<t[s].ts?1:0)),o.length&&(i=t[o[0]])}return(0,u.jsxs)(r.Dialog,{open:!0,onClose:()=>this.props.onClose(),children:[(0,u.jsx)(r.DialogTitle,{children:`${this.props.t("Review")} ${this.props.adapter}${this.props.version?`@${this.props.version}`:""}`}),(0,u.jsxs)(r.DialogContent,{style:{textAlign:"center"},title:(null===(t=this.props.currentRating)||void 0===t?void 0:t.title)||"",children:[this.renderInfoText(),(0,u.jsx)(r.Rating,{style:H.rating,name:this.props.adapter,value:this.props.version?this.state.ratingNumber:null===(e=this.props.currentRating)||void 0===e||null===(s=e.rating)||void 0===s?void 0:s.r,size:"large",readOnly:!this.props.version,onChange:(t,e)=>this.setState({ratingNumber:e})}),this.props.version?(0,u.jsxs)("div",{style:{width:"100%",textAlign:"left"},children:[(0,u.jsx)(r.TextField,{variant:"standard",style:H.ratingTextControl,value:this.state.ratingComment,label:this.props.t("Comment to version"),helperText:this.props.t("Max length %s characters",200),onChange:t=>this.setState({ratingComment:t.target.value}),slotProps:{input:{endAdornment:this.state.ratingComment?(0,u.jsx)(r.InputAdornment,{position:"end",children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>this.setState({ratingComment:""}),children:(0,u.jsx)(l.Close,{})})}):null},htmlInput:{maxLength:200}}}),(0,u.jsxs)(r.FormControl,{variant:"standard",style:H.ratingLanguageControl,children:[(0,u.jsx)(r.InputLabel,{children:this.props.t("Language")}),(0,u.jsx)(r.Select,{variant:"standard",value:this.state.ratingLang,onChange:t=>this.setState({ratingLang:t.target.value}),children:_.map((t=>(0,u.jsx)(r.MenuItem,{value:t.id,children:t.title},t.id)))})]})]}):null,this.props.version?(0,u.jsx)("div",{style:{paddingTop:20,paddingBottom:16},children:this.props.t("Rate how good this version of the adapter works on your system. You can vote for every new version.")}):null,o&&i?(0,u.jsx)("div",{children:this.props.t("You voted for %s on %s",o[0],new Date(i.ts).toLocaleDateString())}):null,this.renderComments()]}),(0,u.jsxs)(r.DialogActions,{children:[this.props.version&&(0,u.jsx)(r.Button,{variant:"contained",autoFocus:!0,color:"primary",disabled:!this.state.ratingNumber||null===this.state.votings,onClick:()=>{var t;this.state.ratingNumber!==(null===(t=i)||void 0===t?void 0:t.r)||this.state.ratingComment?this.setAdapterRating(this.props.adapter,this.props.version,this.state.ratingNumber,this.state.ratingComment,this.state.ratingLang).then((t=>this.props.onClose(t))):this.props.onClose()},startIcon:(0,u.jsx)(l.HowToVote,{}),children:this.props.t("Rate")}),(0,u.jsx)(r.Button,{autoFocus:!this.props.version,variant:"contained",onClick:()=>this.props.onClose(),color:"grey",startIcon:(0,u.jsx)(l.Close,{}),children:this.props.t("Close")})]})]})}}const G=z,J={formControl:{marginTop:24},closeButton:t=>({position:"absolute",right:8,top:8,color:t.palette.grey[500]}),typography:{paddingRight:30}};class Y extends i.Component{constructor(t){super(t),this.t=void 0,this.state={deleteCustom:!1,deleteCustomSupported:!1},this.t=t.t}componentDidMount(){this.props.socket.checkFeatureSupported("DEL_INSTANCE_CUSTOM").then((t=>{if(t)return this.props.socket.getObject(`system.adapter.${this.props.adapter}`).then((t=>{null!==t&&void 0!==t&&t.common?t.common.supportCustoms&&this.setState({deleteCustomSupported:t.common.supportCustoms}):this.setState({deleteCustomSupported:!0})}))}))}render(){return(0,u.jsxs)(r.Dialog,{onClose:this.props.onClose,open:!0,children:[(0,u.jsx)(r.DialogTitle,{children:(0,u.jsxs)(r.Typography,{component:"h2",variant:"h6",sx:{"&.MuiTypography-root":J.typography},children:[this.t("Please confirm"),(0,u.jsx)(r.IconButton,{size:"large",sx:J.closeButton,onClick:this.props.onClose,children:(0,u.jsx)(l.Close,{})})]})}),(0,u.jsxs)(r.DialogContent,{dividers:!0,children:[(0,u.jsx)(r.Typography,{gutterBottom:!0,children:this.t("Are you sure you want to delete adapter %s?",this.props.adapter)}),this.state.deleteCustomSupported&&(0,u.jsx)(r.FormControlLabel,{control:(0,u.jsx)(r.Checkbox,{checked:this.state.deleteCustom,onChange:t=>this.setState({deleteCustom:t.target.checked})}),label:this.t("Delete all custom object settings of this adapter too")})]}),(0,u.jsxs)(r.DialogActions,{children:[(0,u.jsx)(r.Button,{id:"adapter-delete-dialog-ok",variant:"contained",autoFocus:!0,onClick:()=>{this.props.onClick(this.state.deleteCustom),this.props.onClose()},color:"primary",startIcon:(0,u.jsx)(l.Check,{}),children:this.t("Ok")}),(0,u.jsx)(r.Button,{id:"adapter-delete-dialog-cancel",variant:"contained",autoFocus:!0,onClick:()=>this.props.onClose(),color:"grey",startIcon:(0,u.jsx)(l.Close,{}),children:this.t("Close")})]})]})}}const Z=Y;var Q=s(12549),q=s(58648);class K extends o().Component{constructor(t){super(t),this.state={currentSavedPolicy:"none",policy:"none",repositories:[],supported:!0}}async componentDidMount(){await this.getConfiguredRepositories(),await this.getCurrentAutoUpgradeSetting()}async getConfiguredRepositories(){var t;const e=await this.props.socket.getObject("system.config");if(null===e||void 0===e||null===(t=e.common)||void 0===t||!t.adapterAutoUpgrade)return;const s=Object.entries(e.common.adapterAutoUpgrade.repositories).filter((t=>{let[,e]=t;return e})).map((t=>{let[e]=t;return e}));this.setState({repositories:s})}getAdapterId(){return`${this.props.hostId}.adapter.${this.props.adapter}`}async getCurrentAutoUpgradeSetting(){const t=await this.props.socket.getObject(this.getAdapterId());if(!t)return console.error("no adapter object existing"),void this.setState({supported:!1});this.setState({policy:t.common.automaticUpgrade||"none",currentSavedPolicy:t.common.automaticUpgrade||"none"})}async save(){const t=await this.props.socket.getObject(this.getAdapterId());if(!t)return console.error("no adapter object existing"),void this.setState({supported:!1});t.common.automaticUpgrade=this.state.policy,await this.props.socket.setObject(this.getAdapterId(),t),this.setState({currentSavedPolicy:this.state.policy})}render(){return(0,u.jsxs)(r.Dialog,{open:!0,maxWidth:"md",fullWidth:!0,children:[(0,u.jsx)(r.DialogTitle,{children:c.I18n.t("Auto upgrade policy for %s",this.props.adapter)}),(0,u.jsxs)(r.DialogContent,{style:{padding:"0 20px",overflow:"hidden"},children:[(0,u.jsx)(j.A,{value:!this.state.supported,children:(0,u.jsx)(r.Typography,{children:c.I18n.t("This feature is supported up from js-controller Kiera (Version 6)!")})}),(0,u.jsxs)(j.A,{value:this.state.supported,children:[(0,u.jsx)(r.Typography,{children:c.I18n.t("Allow only the following upgrades to be performed automatically:")}),(0,u.jsx)(r.Select,{variant:"standard",style:{marginTop:20,minWidth:150,marginBottom:8},value:this.state.policy,onChange:t=>this.setState({policy:t.target.value}),children:Q.LS.map((t=>(0,u.jsx)(r.MenuItem,{value:t,children:Q.bd[t]})))}),(0,u.jsx)(j.A,{value:this.state.repositories.includes("beta")&&"none"!==this.state.policy,children:(0,u.jsx)(q.InfoBox,{type:"warning",children:c.I18n.t("repo_update_hint")})}),(0,u.jsx)(j.A,{value:"major"===this.state.policy,children:(0,u.jsx)(q.InfoBox,{type:"warning",children:c.I18n.t("The current selected configuration will allow to automatically pull in incompatible changes of this adapter!")})})]})]}),(0,u.jsxs)(r.DialogActions,{children:[(0,u.jsx)(r.Button,{disabled:this.state.currentSavedPolicy===this.state.policy,color:"primary",variant:"contained",startIcon:(0,u.jsx)(c.IconCopy,{}),onClick:()=>this.save(),children:c.I18n.t("Save")}),(0,u.jsx)(r.Button,{variant:"contained",onClick:()=>{this.props.onClose()},color:"grey",startIcon:(0,u.jsx)(l.Close,{}),children:c.I18n.t("Close")})]})]})}}var X=s(26104);const tt={hidden:{display:"none"},buttonUpdate:{border:"1px solid",padding:"0px 7px",borderRadius:5,display:"flex",alignItems:"center",cursor:"pointer",transition:"background 0.5s","&:hover":{background:"#00800026"}},buttonUpdateIcon:{height:20,width:20,marginRight:10},classPoll:{color:"orange"},classPush:{color:"green"},classAssumption:{color:"red",transform:"rotate(90deg)"},marginLeft5:{marginLeft:5},ratingSet:{cursor:"pointer"},sentry:{width:21,height:21,objectFit:"fill",marginTop:3,filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)"},tooltip:{pointerEvents:"none"},wrongDependencies:{color:W.A[700]},updateAvailable:{color:B.A[700]},currentVersion:t=>({cursor:"pointer",mb:"6px",mr:"8px",mt:"4px","&:hover":{background:t.palette.primary.dark}}),header:t=>({fontWeight:"bold",background:t.palette.secondary.main,p:"10px"}),modalDialog:{height:"calc(100% - 64px)",overflowY:"hidden"},currentVersionText:t=>({color:"dark"===t.palette.mode?"#a3ffa3":"#009800",fontWeight:"bold"}),rating:{},containerVersion:{},containerSpecificVersion:{},versionWarn:{color:F.A[500]},cardContentFlexBetween:{},cardContentFlex:{}};class et extends U{constructor(t){super(t),this.installedVersion="",this.styles=void 0,Object.assign(this.state,{autoUpgradeDialogOpen:!1,showUpdateDialog:!1,adapterDeletionDialog:!1,adapterInstallSpecificVersion:"",showInstallVersion:!1,showSetRating:null})}static renderImage(t){const{style:e,alt:s,...i}=t,o=e.backgroundImage.substring(5,e.backgroundImage.length-2);return(0,u.jsx)("img",{...i,alt:s,src:o,onError:t=>{t.target&&(t.target.onerror=null,t.target.src="./img/no-image.png")}})}renderAddInstanceButton(){const t=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterInstall;return(0,u.jsx)(j.A,{value:t,children:(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Add instance"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"small",disabled:this.props.commandRunning,style:this.props.cached.rightOs?void 0:this.styles.hidden,onClick:this.props.cached.rightOs?()=>this.onAddInstance(this.props.adapterName,this.props.context):void 0,children:(0,u.jsx)(l.Add,{})})})})}renderAutoUpgradeButton(){return this.installedVersion?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Automatic Upgrade Policy"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>this.setState({autoUpgradeDialogOpen:!0,showDialog:!0}),children:(0,u.jsx)(l.KeyboardArrowUp,{})})}):null}renderReadmeButton(){const t=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterReadme;return(0,u.jsx)(j.A,{value:t,children:(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Readme"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>this.openInfoDialog(),children:(0,u.jsx)(l.Help,{})})})})}renderRating(){var t,e,s;const i=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterRating;if(this.props.context.isTileView&&(this.props.context.sortPopularFirst||this.props.context.sortRecentlyUpdated))return null;return this.props.context.repository[this.props.adapterName].stat&&!1!==i?(0,u.jsx)("div",{onClick:()=>this.setState({showSetRating:{version:this.installedVersion,rating:this.props.context.repository[this.props.adapterName].rating},showDialog:!0}),style:{...this.styles.rating,...this.styles.ratingSet},title:null===(t=this.props.context.repository[this.props.adapterName].rating)||void 0===t?void 0:t.title,children:(0,u.jsx)(r.Rating,{name:this.props.adapterName,precision:.5,size:"small",readOnly:!0,value:(null===(e=this.props.context.repository[this.props.adapterName].rating)||void 0===e||null===(s=e.rating)||void 0===s?void 0:s.r)||0})}):null}renderConnectionType(){var t;const e=null===(t=this.props.context.repository[this.props.adapterName])||void 0===t?void 0:t.connectionType;return"cloud"===e?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Adapter requires the specific cloud access for these devices/service"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.Cloud,{})}):"local"===e?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Adapter does not use the cloud for these devices/service"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.CloudOff,{})}):(0,u.jsx)(l.CloudOff,{opacity:0})}renderDataSource(){var t;const e=null===(t=this.props.context.repository[this.props.adapterName])||void 0===t?void 0:t.dataSource;return e?(0,u.jsx)("div",{style:this.styles.marginLeft5,children:"poll"===e?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("The device or service will be periodically asked"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.ArrowUpward,{style:this.styles.classPoll})}):"push"===e?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("The device or service delivers the new state actively"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.ArrowDownward,{style:this.styles.classPush})}):"assumption"===e?(0,u.jsx)(r.Tooltip,{slotProps:{popper:{sx:this.styles.tooltip}},title:this.props.context.t("Adapter cannot request the exactly device status and the status will be guessed on the last sent command"),children:(0,u.jsx)(l.Remove,{style:this.styles.classAssumption})}):null}):null}renderLicenseInfo(){var t,e,s;const i=this.props.context.repository[this.props.adapterName],o=L(i);return(0,u.jsx)(r.Link,{href:o,target:"_blank",rel:"noopener",sx:{color:"black","&:hover":{color:"black"}},children:"paid"===(null===(t=i.licenseInformation)||void 0===t?void 0:t.type)?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("The adapter requires a paid license."),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.MonetizationOn,{})}):"commercial"===(null===(e=i.licenseInformation)||void 0===e?void 0:e.type)?(0,u.jsx)(r.Tooltip,{slotProps:{popper:{sx:this.styles.tooltip}},title:this.props.context.t("The adapter requires a paid license for commercial use."),children:(0,u.jsx)(l.MonetizationOn,{opacity:.5})}):"limited"===(null===(s=i.licenseInformation)||void 0===s?void 0:s.type)?(0,u.jsx)(r.Tooltip,{slotProps:{popper:{sx:this.styles.tooltip}},title:this.props.context.t("The adapter has a limited functionality without a paid license."),children:(0,u.jsx)(l.MonetizationOn,{opacity:.5})}):(0,u.jsx)(l.MonetizationOn,{opacity:0})})}renderSentryInfo(){var t,e;return(null===(t=this.props.context.repository[this.props.adapterName])||void 0===t||null===(e=t.plugins)||void 0===e?void 0:e.sentry)?(0,u.jsx)("div",{style:this.styles.marginLeft5,children:(0,u.jsx)(r.Tooltip,{title:"sentry",slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.CardMedia,{style:this.styles.sentry,component:"img",image:X.A})})}):null}renderVersion(){const t=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterUpdate;return!this.props.commandRunning&&this.props.cached.updateAvailable&&!1!==t?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Update"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsxs)("div",{onClick:()=>this.setState({showUpdateDialog:!0,showDialog:!0}),style:{...this.styles.buttonUpdate,...this.props.cached.rightDependencies?this.styles.updateAvailable:void 0},children:[(0,u.jsx)(r.IconButton,{style:this.styles.buttonUpdateIcon,size:"small",children:(0,u.jsx)(l.Refresh,{})}),this.props.context.repository[this.props.adapterName].version]})}):(0,u.jsx)("span",{style:this.props.cached.rightDependencies?void 0:this.styles.wrongDependencies,children:this.props.context.repository[this.props.adapterName].version})}renderInstalledVersion(t){const e=this.props.context.installed[this.props.adapterName],s=null===e||void 0===e?void 0:e.installedFrom,{adapterName:i}=this.props;if(t){const t=null===e||void 0===e?void 0:e.enabled,o=null===e||void 0===e?void 0:e.count;return(0,u.jsxs)(r.Grid2,{container:!0,wrap:"nowrap",alignItems:"center",spacing:1,children:[this.installedVersion?(0,u.jsx)(r.Grid2,{children:this.installedVersion+(o?` (${o}${o!==t?"~":""})`:"")}):null,s&&!s.startsWith(`iobroker.${i}@`)&&(0,u.jsx)(r.Grid2,{container:!0,children:(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Non-NPM-Version: ")+s,slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.GitHub,{fontSize:"small",style:this.styles.versionWarn})})})]})}return this.installedVersion?(0,u.jsxs)(r.Typography,{component:"span",style:this.styles.cardContentFlexBetween,children:[(0,u.jsxs)("div",{children:[this.props.context.t("Installed version"),":"]}),(0,u.jsxs)("div",{style:this.styles.cardContentFlex,children:[s&&!s.startsWith(`iobroker.${i}@`)&&(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Non-NPM-Version: ")+s,slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(l.GitHub,{fontSize:"small",style:this.styles.versionWarn})}),this.installedVersion]})]}):null}renderUploadButton(){return this.props.context.expertMode&&this.installedVersion?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Upload"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"small",disabled:this.props.commandRunning,onClick:()=>this.onUpload(),children:(0,u.jsx)(l.Publish,{})})}):null}renderDeleteButton(){const t=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterDelete;return(0,u.jsx)(j.A,{value:!!this.installedVersion&&t,children:(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Delete adapter"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"small",disabled:this.props.commandRunning,onClick:()=>this.setState({adapterDeletionDialog:!0,showDialog:!0}),children:(0,u.jsx)(l.DeleteForever,{})})})})}renderInstallSpecificVersionButton(){const t=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterUpdate;return this.props.context.expertMode&&!1!==t&&this.installedVersion&&(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Install a specific version"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{disabled:this.props.commandRunning,size:"small",onClick:()=>this.setState({showInstallVersion:!0,showDialog:!0}),children:(0,u.jsx)(l.AddToPhotos,{})})})}renderRebuildButton(){return this.props.context.expertMode&&this.installedVersion?(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Rebuild"),children:(0,u.jsx)(r.IconButton,{size:"small",disabled:this.props.commandRunning,onClick:()=>this.rebuild(),children:(0,u.jsx)(l.Build,{})})}):null}renderAutoUpdateDialog(){return this.state.autoUpgradeDialogOpen?(0,u.jsx)(K,{onClose:()=>this.setState({autoUpgradeDialogOpen:!1,showDialog:!1}),adapter:this.props.adapterName,hostId:this.props.context.adminHost,socket:this.props.context.socket}):null}renderUpdateAdapterDialog(){var t;return this.state.showUpdateDialog?(this.installedVersion=null===(t=this.props.context.installed[this.props.adapterName])||void 0===t?void 0:t.version,(0,u.jsx)(h.A,{adapter:this.props.adapterName,adapterObject:this.props.context.repository[this.props.adapterName],t:this.props.context.t,dependencies:U.getDependencies(this.props.adapterName,this.props.context),rightDependencies:this.props.context.rightDependenciesFunc(this.props.adapterName),news:this.getNews(),toggleTranslation:this.props.context.toggleTranslation,noTranslation:this.props.context.noTranslation,installedVersion:this.installedVersion,onUpdate:t=>this.setState({showUpdateDialog:!1,showDialog:!1},(()=>this.update(t))),onIgnore:t=>this.setState({showUpdateDialog:!1,showDialog:!1},(()=>this.props.context.socket.getObject(`system.adapter.${this.props.adapterName}`).then((e=>{null!==e&&void 0!==e&&e.common?(e.common.ignoreVersion=t,this.props.context.socket.setObject(e._id,e).catch((t=>window.alert(`Cannot write object: ${t}`)))):window.alert(`Adapter "${this.props.adapterName}" does not exist!`)})).then((()=>this.props.context.removeUpdateAvailable(this.props.adapterName))))),onClose:()=>this.setState({showUpdateDialog:!1,showDialog:!1}),instances:this.props.context.compactInstances,theme:this.props.context.theme})):null}static formatNews(t){return(t||"").toString().split("\n").map((t=>t.trim().replace(/^\*+/,"").replace(/^-/,"").replace(/\*+$/,"").replace(/\r/g,"").trim())).filter((t=>t)).map(((t,e)=>(0,u.jsxs)("div",{style:{},children:[(0,u.jsx)("span",{children:"- "}),t]},e)))}renderAdapterInstallVersion(){return this.state.showInstallVersion?(0,u.jsx)(E.A,{title:this.props.context.t("Please select specific version of %s",this.props.adapterName),applyButton:!1,onClose:()=>this.setState({showInstallVersion:!1,adapterInstallSpecificVersion:"",showDialog:!1}),theme:this.props.context.theme,toggleTranslation:this.props.context.toggleTranslation,noTranslation:this.props.context.noTranslation,children:(0,u.jsxs)("div",{style:{height:"100%",overflowY:"hidden"},children:[(0,u.jsxs)("div",{style:this.styles.containerSpecificVersion,children:[(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,u.jsx)(r.TextField,{variant:"standard",style:{flexGrow:1},label:this.props.context.t("Enter version manually"),value:this.state.adapterInstallSpecificVersion,onChange:t=>this.setState({adapterInstallSpecificVersion:t.target.value}),slotProps:{input:{endAdornment:this.state.adapterInstallSpecificVersion?(0,u.jsx)(r.InputAdornment,{position:"end",children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>this.setState({adapterInstallSpecificVersion:""}),children:(0,u.jsx)(l.Close,{})})}):null}}}),(0,u.jsx)(r.Button,{color:"primary",variant:"contained",size:"small",disabled:!this.state.adapterInstallSpecificVersion,onClick:()=>{this.state.adapterInstallSpecificVersion&&(this.update(this.state.adapterInstallSpecificVersion),this.setState({showInstallVersion:!1,adapterInstallSpecificVersion:"",showDialog:!1}))},children:this.props.context.t("Install")})]}),(0,u.jsx)(r.Tooltip,{title:this.props.context.t("npmjs.com"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>{window.open(`https://www.npmjs.com/package/iobroker.${this.props.adapterName}?activeTab=versions`,this.props.adapterName).focus()},children:(0,u.jsx)(l.Link,{})})})]}),(0,u.jsx)(r.Box,{component:"div",sx:this.styles.header,children:this.props.context.t("Or select from the list")}),(0,u.jsx)("div",{style:{...this.styles.containerVersion,height:"calc(100% - 122px)",overflowY:"auto"},children:this.getNews(!0).map((t=>{let{version:e,news:s}=t;return(0,u.jsx)(r.Card,{variant:"outlined",sx:this.styles.currentVersion,onClick:()=>{this.update(e),this.setState({showInstallVersion:!1,showDialog:!1})},children:(0,u.jsxs)(r.CardContent,{children:[(0,u.jsxs)(r.Typography,{sx:c.Utils.getStyle(this.props.context.theme,this.installedVersion===e&&this.styles.currentVersionText,{fontSize:16,fontWeight:"bold"}),color:"text.secondary",gutterBottom:!0,children:[e,this.installedVersion===e?(0,u.jsx)(r.Box,{component:"span",sx:this.styles.currentVersionText,children:`(${this.props.context.t("current")})`}):""]}),(0,u.jsx)(r.Typography,{variant:"body2",style:{opacity:.7},children:et.formatNews(s)})]})},e)}))})]})}):null}renderSetRatingDialog(){return this.state.showSetRating?(0,u.jsx)(G,{t:this.props.context.t,lang:this.props.context.lang,version:this.state.showSetRating.version,adapter:this.props.adapterName,currentRating:this.state.showSetRating.rating,onClose:t=>{t&&this.props.context.updateRating(this.props.adapterName,t),this.setState({showSetRating:null,showDialog:!1})},uuid:this.props.context.uuid}):null}renderAdapterDeletionDialog(){return this.state.adapterDeletionDialog?(0,u.jsx)(Z,{adapter:this.props.adapterName,socket:this.props.context.socket,t:this.props.context.t,onClick:t=>this.delete(t),onClose:()=>this.setState({adapterDeletionDialog:!1,showDialog:!1})}):null}openInfoDialog(){var t;const e=null!==(t=this.props.context.repository[this.props.adapterName].docs)&&void 0!==t&&t[this.props.context.lang]?this.props.context.lang:"en";window.open(C.A.getDocsLinkForAdapter({lang:e,adapterName:this.props.adapterName}),"help")}getNews(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this.props.context.repository[this.props.adapterName],s=this.props.context.installed[this.props.adapterName],i=[];return s&&null!==e&&void 0!==e&&e.news&&Object.keys(e.news).forEach((o=>{try{if(a().gt(o,s.version)||t){let t;t="object"===typeof e.news[o]?this.props.context.noTranslation?e.news[o].en:e.news[o][this.props.context.lang]||e.news[o].en:e.news[o],i.push({version:o,news:t})}}catch{console.warn(`[ADAPTERS] Cannot compare "${o}" and "${s.version}" (${this.props.adapterName})`)}})),i}onUpload(){var t;const e=this.props.context.repository[this.props.adapterName],s=L(e),i=(null===(t=e.licenseInformation)||void 0===t?void 0:t.license)||e.license;"MIT"!==i?this.setState({showLicenseDialog:{url:s,upload:!0,adapterName:this.props.adapterName,licenseType:i},showDialog:!0}):U.upload(this.props.adapterName,this.props.context)}delete(t){this.props.context.executeCommand(`del ${this.props.adapterName}${t?" --custom":""}${this.props.context.expertMode?" --debug":""}`)}async update(t){"admin"===this.props.adapterName&&this.props.context.adminHost===this.props.context.currentHost&&await this.props.context.socket.checkFeatureSupported("ADAPTER_WEBSERVER_UPGRADE")?this.props.context.setAdminUpgradeTo(t):this.props.context.executeCommand(`upgrade ${this.props.adapterName}@${t}${this.props.context.expertMode?" --debug":""}`)}rebuild(){this.props.context.executeCommand(`rebuild ${this.props.adapterName}${this.props.context.expertMode?" --debug":""}`)}renderDialogs(){return this.state.showDialog?(0,u.jsxs)(u.Fragment,{children:[this.renderAddInstanceDialog(this.props.context),this.renderLicenseDialog(this.props.context),this.renderUpdateAdapterDialog(),this.renderAdapterInstallVersion(),this.renderSetRatingDialog(),this.renderAdapterDeletionDialog(),this.renderAutoUpdateDialog()]}):null}}const st={...tt,type:{color:"tile"},root:t=>({position:"relative",m:"10px",width:300,minHeight:200,background:t.palette.background.default,boxShadow:"0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:"0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)"}}),imageBlock:t=>({background:"dark"===t.palette.mode?"#848484":"#c0c0c0",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",color:"#000"}),img:{width:45,height:45,margin:"auto 0",position:"relative","&:after":{content:'""',position:"absolute",zIndex:2,top:0,left:0,width:"100%",height:"100%",background:'url("img/no-image.png") 100% 100% no-repeat',backgroundSize:"cover",backgroundColor:"#fff"}},installed:{background:"#77c7ff8c"},update:{background:"#10ff006b"},fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},greenText:t=>({color:t.palette.success.dark}),collapse:{height:"100%",backgroundColor:"silver",position:"absolute",width:"100%",zIndex:3,marginTop:"auto",bottom:0,justifyContent:"space-between",display:"flex",flexDirection:"column"},close:{width:20,height:20,opacity:.9,cursor:"pointer",position:"relative",marginLeft:"auto",mb:"10px",transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"rgba(0, 0, 0, 0.54)",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"rgba(0, 0, 0, 0.54)",transform:"rotate(-45deg)"}},footerBlock:t=>({background:t.palette.background.default,p:"10px",display:"flex",justifyContent:"space-between"}),versionDate:{alignSelf:"center"},adapter:t=>({width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",pl:1,pt:2,color:(t.palette.mode,"#333")}),adapterWithAgo:{width:"calc(100% - 145px)"},description:t=>({color:"dark"===t.palette.mode?"#222":"inherit"}),cardContent:{overflow:"auto"},cardContentDiv:{position:"sticky",right:0,top:0,background:"silver"},cardContentFlex:{display:"flex"},cardContentFlexBetween:{display:"flex",justifyContent:"space-between"},cardContent2:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},cardMargin10:{marginTop:10},availableVersion:{display:"flex",justifyContent:"space-between"},curdContentFlexCenter:{display:"flex",alignItems:"center"},versionWarn:{color:F.A[500],marginRight:5},rating:{marginTop:20}};const it=class extends et{constructor(t){super(t),this.styles=st,Object.assign(this.state,{openCollapse:!1})}renderInfoCard(){return(0,u.jsxs)("div",{style:this.styles.collapse,children:[(0,u.jsxs)(r.CardContent,{style:this.styles.cardContent,children:[(0,u.jsx)("div",{style:this.styles.cardContentDiv,children:(0,u.jsx)(r.Box,{component:"div",sx:this.styles.close,onClick:()=>this.setState({openCollapse:!this.state.openCollapse})})}),(0,u.jsx)(r.Typography,{gutterBottom:!0,component:"span",variant:"body2",sx:this.styles.description,children:this.props.cached.desc})]}),(0,u.jsxs)(r.Box,{component:"div",sx:this.styles.footerBlock,children:[this.renderAddInstanceButton(),(0,u.jsxs)("div",{style:this.styles.cardContentFlex,children:[this.renderAutoUpgradeButton(),this.renderReadmeButton(),this.renderUploadButton(),this.renderDeleteButton(),this.renderInstallSpecificVersionButton()]})]})]})}renderCardMedia(){const t=this.props.context.repository[this.props.adapterName],e=null===t||void 0===t?void 0:t.version;return(0,u.jsxs)(r.Box,{component:"div",sx:c.Utils.getStyle(this.props.context.theme,this.styles.imageBlock,this.installedVersion&&this.styles.installed,this.installedVersion&&e&&this.installedVersion!==e&&this.props.cached.updateAvailable&&this.styles.update),children:[(0,u.jsx)(r.CardMedia,{sx:this.styles.img,component:t=>et.renderImage(t),src:this.props.cached.image||"img/no-image.png",image:this.props.cached.image||"img/no-image.png"}),(0,u.jsx)(r.Box,{component:"div",sx:c.Utils.getStyle(this.props.context.theme,this.styles.adapter,(t.stat||this.props.context.sortRecentlyUpdated)&&this.styles.adapterWithAgo),children:this.props.adapterName}),this.props.context.sortPopularFirst?(0,u.jsx)("div",{style:this.styles.versionDate,children:t.stat}):null,this.props.context.sortRecentlyUpdated?(0,u.jsx)("div",{style:this.styles.versionDate,children:this.props.cached.daysAgoText}):null,this.props.context.sortPopularFirst||this.props.context.sortRecentlyUpdated?null:this.renderRating(),this.state.openCollapse?null:(0,u.jsx)(r.Tooltip,{title:this.props.context.t("Info"),slotProps:{popper:{sx:{pointerEvents:"none"}}},children:(0,u.jsx)(r.Fab,{onClick:()=>this.setState({openCollapse:!this.state.openCollapse}),style:this.styles.fab,color:"primary","aria-label":"add",children:(0,u.jsx)(l.MoreVert,{})})})]})}renderCardContent(){const t=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterUpdate,e=this.props.context.installed[this.props.adapterName];return(0,u.jsxs)(r.CardContent,{style:this.styles.cardContent2,children:[(0,u.jsx)(r.Typography,{gutterBottom:!0,variant:"h5",component:"h5",children:this.props.cached.title}),(0,u.jsxs)("div",{style:this.styles.cardContentFlex,children:[this.renderConnectionType(),this.renderDataSource(),(0,u.jsx)("div",{children:this.renderLicenseInfo()}),this.renderSentryInfo()]}),(0,u.jsxs)("div",{style:this.styles.cardMargin10,children:[null!==e&&void 0!==e&&e.count?(0,u.jsxs)(r.Typography,{component:"span",style:this.styles.cardContentFlexBetween,children:[(0,u.jsxs)("div",{children:[this.props.context.t("Installed instances"),":"]}),(0,u.jsx)("div",{children:e.count})]}):null,(0,u.jsx)(j.A,{value:t,children:(0,u.jsxs)(r.Typography,{component:"span",style:this.styles.availableVersion,children:[(0,u.jsx)("div",{children:this.props.context.t("Available version:")}),(0,u.jsx)(r.Box,{component:"div",sx:c.Utils.getStyle(this.props.context.theme,this.props.cached.updateAvailable&&this.styles.greenText,this.styles.curdContentFlexCenter),children:this.renderVersion()})]})}),this.renderInstalledVersion()]})]})}render(){var t;return this.installedVersion=null===(t=this.props.context.installed[this.props.adapterName])||void 0===t?void 0:t.version,(0,u.jsxs)(r.Card,{sx:this.styles.root,children:[this.state.openCollapse?this.renderInfoCard():null,this.renderCardMedia(),this.renderCardContent(),this.renderDialogs()]})}},ot={...tt,type:{color:"line"},smallAvatar:{width:32,height:32,marginLeft:4},paddingNone:{padding:"0 !important"},name:{flexWrap:"nowrap",width:300,marginTop:0},flex:{display:"flex"},nameCell:{paddingTop:"0 !important",paddingBottom:"0 !important"}};const nt=class extends et{constructor(){super(...arguments),this.styles=ot}render(){var t,e;const s=this.props.context.repository[this.props.adapterName],i=!s||s.allowAdapterRating;return this.installedVersion=null===(t=this.props.context.installed[this.props.adapterName])||void 0===t?void 0:t.version,(0,u.jsxs)(r.TableRow,{hover:!0,children:[(0,u.jsx)(r.TableCell,{}),(0,u.jsx)(r.TableCell,{children:(0,u.jsxs)(r.Grid2,{container:!0,spacing:1,alignItems:"center",style:this.styles.name,children:[(0,u.jsx)(r.Tooltip,{title:this.props.adapterName,slotProps:{popper:{sx:this.styles.tooltip}},children:(0,u.jsx)(r.Grid2,{style:this.styles.paddingNone,children:(0,u.jsx)(r.Avatar,{variant:"square",alt:this.props.cached.title,src:this.props.cached.image,style:this.styles.smallAvatar})})}),!1!==i?(0,u.jsxs)(r.Grid2,{style:this.styles.nameCell,children:[(0,u.jsx)("div",{children:this.props.cached.title}),this.renderRating()]}):(0,u.jsx)(r.Grid2,{children:this.props.cached.title})]})}),!this.props.context.descHidden&&(0,u.jsx)(r.TableCell,{title:this.props.cached.desc,style:{width:20,wordWrap:"break-word"},children:this.props.cached.desc}),(0,u.jsx)(r.TableCell,{children:(0,u.jsxs)("div",{style:this.styles.flex,children:[this.renderConnectionType(),this.renderDataSource(),(0,u.jsx)("div",{children:this.renderLicenseInfo()}),this.renderSentryInfo()]})}),(0,u.jsx)(r.TableCell,{children:this.renderInstalledVersion(!0)}),(0,u.jsx)(r.TableCell,{children:(0,u.jsx)(r.Grid2,{container:!0,alignItems:"center",children:this.renderVersion()})}),(0,u.jsx)(r.TableCell,{style:{fontSize:"smaller"},children:(null===s||void 0===s||null===(e=s.licenseInformation)||void 0===e?void 0:e.license)||(null===s||void 0===s?void 0:s.license)}),(0,u.jsxs)(r.TableCell,{children:[this.renderAddInstanceButton(),this.renderAutoUpgradeButton(),this.renderReadmeButton(),this.renderUploadButton(),this.renderDeleteButton(),this.renderInstallSpecificVersionButton(),this.renderRebuildButton()]}),this.renderDialogs()]})}},at={emptyBlock:50,name:300,connectionType:120,installed:120,available:120,update:40,license:80,install:246},rt=Object.keys(at).reduce(((t,e)=>t+at[e]),0),lt={container:{height:"100%",width:"100%"},containerNotFullHeight:{height:"calc(100% - 22px)"},containerFullHeight:{height:"100%"},table:{width:"100%",tableLayout:"fixed",minWidth:960,"& td":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pt:"2px",pb:"2px",pr:"4px",pl:"4px"},"& th":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pt:"2px",pb:"2px",pr:"4px",pl:"4px"}},name:{flexWrap:"nowrap",width:at.name},emptyBlock:{flexWrap:"nowrap",width:at.emptyBlock},description:{width:`calc(100% - ${rt+2}px)`},connectionType:{width:at.connectionType},installed:{width:at.installed},available:{width:at.available,paddingRight:6},update:{width:at.update,padding:0},license:{width:at.license},install:{width:at.install},notStableRepo:t=>({background:"dark"===t.palette.mode?"#8a7e00":"#fdee20",color:"#000",fontSize:14,padding:"2px 8px",borderRadius:"5px"}),viewModeDiv:{display:"flex",flexFlow:"wrap",overflow:"auto",justifyContent:"center"}};class pt extends i.Component{constructor(t){super(t),this.lastRenderCounter=-1,this.state={descWidth:t.descWidth,repoName:t.repoName,systemConfig:!!t.systemConfig,tableViewMode:t.tableViewMode,oneListView:t.oneListView,categoriesExpanded:JSON.stringify(t.categoriesExpanded),cachedAdapters:t.cachedAdapters?Object.keys(t.cachedAdapters).length:0,update:t.update,sortByName:t.sortByName,sortPopularFirst:t.sortPopularFirst,sortRecentlyUpdated:t.sortRecentlyUpdated,renderCounter:0,listOfVisibleAdapter:JSON.stringify(t.listOfVisibleAdapter),expertMode:t.context.expertMode,commandRunning:t.commandRunning}}getRow(t,e){const s=this.props.cachedAdapters[t];return s?(0,u.jsx)(nt,{context:e,adapterName:t,cached:s,commandRunning:this.state.commandRunning},`adapter-${t}`):null}getRows(t){if(!this.props.listOfVisibleAdapter)return(0,u.jsx)(r.TableRow,{children:(0,u.jsx)(r.TableCell,{colSpan:8,children:(0,u.jsx)(r.LinearProgress,{})})});let e=0,s=[];if(this.props.oneListView){for(let e=0;e<this.props.listOfVisibleAdapter.length;e++){var o;const i=this.props.listOfVisibleAdapter[e];s.length>50&&(null===(o=this.props.context.installed[i])||void 0===o||!o.version)||s.push(this.getRow(i,t))}e=s.length,e&&this.props.listOfVisibleAdapter.length>s.length&&s.push((0,u.jsx)(r.TableRow,{children:(0,u.jsx)(r.TableCell,{colSpan:8,style:{fontSize:20,padding:20,textAlign:"center"},children:this.props.context.t("Filter adapters to see others. There is %s more",this.props.listOfVisibleAdapter.length-s.length)})},"more"))}else s=this.props.categories.map((s=>{if(!s.adapters.find((t=>this.props.listOfVisibleAdapter.includes(t))))return null;const o=s.name,n=this.props.categoriesExpanded[o];return e++,(0,u.jsxs)(i.Fragment,{children:[(0,u.jsx)(M,{categoryName:o,count:s.count,expanded:n,installedCount:s.installed,name:s.translation,descHidden:t.descHidden,onToggle:()=>this.props.toggleCategory(o),t:this.props.context.t},`category-${o}1`),n&&s.adapters.map((s=>{const i=this.getRow(s,t);return i&&e++,i}))]},`category-${o} ${s.adapters.length}`)}));return e?s:this.props.update?null:(0,u.jsx)("tr",{children:(0,u.jsx)("td",{colSpan:4,style:{padding:16,fontSize:18,cursor:"pointer"},title:this.props.context.t("Click to clear all filters"),onClick:()=>this.props.clearAllFilters(),children:this.props.context.t("all items are filtered out")})})}getTiles(t){if(!this.props.listOfVisibleAdapter)return(0,u.jsx)(r.LinearProgress,{});if(!this.props.listOfVisibleAdapter.length)return this.props.update?null:(0,u.jsx)("div",{style:{margin:20,fontSize:26},title:this.props.context.t("Click to clear all filters"),onClick:()=>this.props.clearAllFilters(),children:this.props.context.t("all items are filtered out")});const e=[];for(let i=0;i<this.props.listOfVisibleAdapter.length;i++){var s;const o=this.props.listOfVisibleAdapter[i],n=this.props.cachedAdapters[o];e.length>50&&(null===(s=this.props.context.installed[o])||void 0===s||!s.version)||e.push((0,u.jsx)(it,{context:t,adapterName:o,cached:n,commandRunning:this.state.commandRunning},`adapter-${o}`))}return this.props.listOfVisibleAdapter.length>e.length&&(e.push((0,u.jsx)("div",{style:{flexBasis:"100%",height:0}},"newLine")),e.push((0,u.jsx)("div",{style:{fontSize:20,margin:20},children:this.props.context.t("Filter adapters to see others. There is %s more",this.props.listOfVisibleAdapter.length-e.length)},"more"))),e}renderTileView(t,e,s){return(0,u.jsxs)(u.Fragment,{children:[t?null:(0,u.jsx)(r.Box,{component:"div",sx:lt.notStableRepo,children:this.props.context.t('Active repo is "%s"',e)}),(0,u.jsx)("div",{style:lt.viewModeDiv,children:this.getTiles(s)})]})}renderTableView(t,e,s){return(0,u.jsxs)(c.TabContent,{children:[t?null:(0,u.jsx)(r.Box,{component:"div",sx:lt.notStableRepo,children:this.props.context.t('Active repo is "%s"',e)}),(0,u.jsx)(r.TableContainer,{style:{...lt.container,...t?lt.containerFullHeight:lt.containerNotFullHeight},children:(0,u.jsxs)(r.Table,{stickyHeader:!0,size:"small",sx:lt.table,children:[(0,u.jsx)(r.TableHead,{children:(0,u.jsxs)(r.TableRow,{children:[(0,u.jsx)(r.TableCell,{style:lt.emptyBlock}),(0,u.jsx)(r.TableCell,{style:lt.name,children:(0,u.jsx)(r.Typography,{children:this.props.context.t("Name")})}),!s.descHidden&&(0,u.jsx)(r.TableCell,{style:{...lt.description,width:this.props.descWidth},children:(0,u.jsx)(r.Typography,{children:this.props.context.t("Description")})}),(0,u.jsx)(r.TableCell,{style:lt.connectionType}),(0,u.jsx)(r.TableCell,{style:lt.installed,children:(0,u.jsx)(r.Typography,{children:this.props.context.t("Installed")})}),(0,u.jsx)(r.TableCell,{style:lt.available,children:(0,u.jsx)(r.Typography,{children:this.props.context.t("Available")})}),(0,u.jsx)(r.TableCell,{style:lt.license,children:(0,u.jsx)(r.Typography,{children:this.props.context.t("License")})}),(0,u.jsx)(r.TableCell,{style:{...lt.install,width:this.state.expertMode?246:178},children:(0,u.jsx)(r.Typography,{children:this.props.context.t("Install")})})]})}),(0,u.jsx)(r.TableBody,{children:this.getRows(s)})]})})]})}static getDerivedStateFromProps(t,e){let s=!1;t.descWidth!==e.descWidth&&(console.log("Render because of descWidth"),s=!0),t.repoName!==e.repoName&&(console.log("Render because of repoName"),s=!0),!!t.systemConfig!==e.systemConfig&&(console.log("Render because of systemConfig"),s=!0),t.tableViewMode!==e.tableViewMode&&(console.log("Render because of tableViewMode"),s=!0),t.oneListView!==e.oneListView&&(console.log("Render because of oneListView"),s=!0);const i=JSON.stringify(t.categoriesExpanded);i!==e.categoriesExpanded&&(console.log("Render because of categoriesExpanded"),s=!0);const o=t.cachedAdapters?Object.keys(t.cachedAdapters).length:0;o!==e.cachedAdapters&&(console.log(`Render because of cachedAdapters ${o} <> ${e.cachedAdapters}`),s=!0),t.update!==e.update&&(console.log("Render because of update"),s=!0),t.sortByName!==e.sortByName&&(console.log("Render because of sortByName"),s=!0),t.sortPopularFirst!==e.sortPopularFirst&&(console.log("Render because of sortPopularFirst"),s=!0),t.sortRecentlyUpdated!==e.sortRecentlyUpdated&&(console.log("Render because of sortRecentlyUpdated"),s=!0),t.context.expertMode!==e.expertMode&&(console.log("Render because of expertMode"),s=!0);const n=JSON.stringify(t.listOfVisibleAdapter);return n!==e.listOfVisibleAdapter&&(console.log("Render because of listOfVisibleAdapter"),s=!0),t.commandRunning!==e.commandRunning&&(console.log("Render because of commandRunning"),s=!0),s?{descWidth:t.descWidth,repoName:t.repoName,systemConfig:!!t.systemConfig,tableViewMode:t.tableViewMode,oneListView:t.oneListView,categoriesExpanded:i,cachedAdapters:o,update:t.update,sortByName:t.sortByName,sortPopularFirst:t.sortPopularFirst,sortRecentlyUpdated:t.sortRecentlyUpdated,listOfVisibleAdapter:n,renderCounter:e.renderCounter+1,expertMode:t.context.expertMode,commandRunning:t.commandRunning}:null}shouldComponentUpdate(t,e){return this.lastRenderCounter!==e.renderCounter&&(this.lastRenderCounter=e.renderCounter,!0)}render(){var t,e;return null!==(t=this.props.systemConfig)&&void 0!==t&&null!==(e=t.common)&&void 0!==e&&e.activeRepo?this.props.tableViewMode?this.renderTableView(this.props.stableRepo,this.props.repoName,this.props.context):this.renderTileView(this.props.stableRepo,this.props.repoName,this.props.context):(0,u.jsx)(r.LinearProgress,{})}}const dt=pt;class ct extends i.Component{constructor(t){super(t),this.updating=void 0,this.interval=void 0,this.startTimeout=void 0,this.textareaRef=void 0,this.link=void 0,this.oldVersion=void 0,this.state={response:null,error:null,starting:!0,upAgain:!1},this.updating=!1,this.textareaRef=o().createRef(),this.link=`${window.location.protocol}//${window.location.host}/`}setUpdating(t){this.updating!==t&&(this.updating=t,this.props.onUpdating(t))}async getWebserverParams(){const t=await this.props.socket.getObject(`system.adapter.${this.props.adminInstance}`);return{useHttps:t.native.secure,port:t.native.port,certPrivateName:t.native.certPrivate,certPublicName:t.native.certPublic}}async componentDidMount(){const{certPrivateName:t,certPublicName:e,port:s,useHttps:i}=await this.getWebserverParams();this.oldVersion=this.props.currentAdminVersion,await this.props.socket.upgradeAdapterWithWebserver(this.props.host,{version:this.props.version,adapterName:"admin",port:s,useHttps:i,certPublicName:e,certPrivateName:t}),this.setUpdating(!0),this.interval=setInterval((()=>this.checkStatus()),1e3),this.startTimeout=setTimeout((()=>{this.startTimeout=null,this.setState({starting:!1})}),1e4)}componentWillUnmount(){this.interval&&(clearInterval(this.interval),this.interval=null),this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkVersion(){try{const t=await fetch("./version"),e=await t.text();return e&&e.length<20&&e!==this.oldVersion?(this.interval&&(clearInterval(this.interval),this.interval=null),this.setState({response:{running:!1,success:!0,stderr:[],stdout:[c.I18n.t("Version updated to %s",e)]},upAgain:!0,error:null},(()=>this.setUpdating(!1))),!0):e===this.oldVersion}catch{return!1}}async checkStatus(){console.log(`Request update status from: ${this.link}`);try{const e=await fetch(this.link),s=await e.text();if(console.log(`Received status: ${s}`),s.startsWith("{")&&s.endsWith("}"))try{const t=JSON.parse(s);null!==t&&void 0!==t&&t.stderr&&(t.stderr=t.stderr.filter((t=>t.trim()))),t&&!t.running&&t.success&&t.stdout?(t.stdout.push(""),t.stdout.push("---------------------------------------------------"),t.stdout.push(c.I18n.t("%s was successfully updated to %s","admin",this.props.version))):null!==t&&void 0!==t&&t.stdout&&(t.stdout.unshift(""),t.stdout.unshift("---------------------------------------------------"),t.stdout.unshift(c.I18n.t("updating %s to %s...","admin",this.props.version))),this.setState({response:t,error:null},(()=>{t&&!t.running?(this.interval&&(clearInterval(this.interval),this.interval=null),this.waitForAdapterStart()):null!==t&&void 0!==t&&t.running&&this.setUpdating(!0),this.textareaRef.current&&setTimeout((()=>this.textareaRef.current.scrollTop=this.textareaRef.current.scrollHeight),100)}))}catch(t){console.error(`Cannot parse response: ${t}`),this.setState({error:s},(()=>this.setUpdating(!1)))}else await this.checkVersion()||console.error(`Response is not JSON: ${s}`)}catch(t){this.state.starting||this.setState({error:t.toString()},(()=>this.setUpdating(!1)))}}waitForAdapterStart(){this.interval=setInterval((async()=>{try{await fetch(this.link),clearInterval(this.interval),this.interval=null,this.setState({upAgain:!0})}catch{}}),1e3)}render(){var t,e,s,i,o;return(0,u.jsxs)(r.Dialog,{onClose:(t,e)=>{"escapeKeyDown"!==e&&"backdropClick"!==e&&this.props.onClose()},open:!0,maxWidth:"lg",fullWidth:!0,children:[(0,u.jsx)(r.DialogTitle,{children:c.I18n.t("Updating %s...","admin")}),(0,u.jsxs)(r.DialogContent,{style:{height:400,padding:"0 20px",overflow:"hidden"},children:[this.state.response&&!this.state.response.running||this.state.error?null:(0,u.jsx)(r.LinearProgress,{}),this.state.response||this.state.error?(0,u.jsx)("textarea",{ref:this.textareaRef,style:{width:"100%",height:"100%",resize:"none",background:"dark"===this.props.themeType?"#000":"#fff",color:"dark"===this.props.themeType?"#EEE":"#111",boxSizing:"border-box",fontFamily:"Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace",border:null!==(t=this.state.response)&&void 0!==t&&t.success?"2px solid green":this.state.error||this.state.response&&!this.state.response.running&&!this.state.response.success?"2px solid red":void 0},value:this.state.error?this.state.error:this.state.response.stderr&&this.state.response.stderr.length?this.state.response.stderr.join("\n"):this.state.response.stdout.join("\n"),readOnly:!0}):null]}),(0,u.jsx)(r.DialogActions,{children:(0,u.jsx)(r.Button,{variant:"contained",disabled:this.state.starting||!this.state.error&&!this.state.upAgain,onClick:()=>{var t;null!==(t=this.state.response)&&void 0!==t&&t.success&&window.location.reload(),this.props.onClose()},color:null!==(e=this.state.response)&&void 0!==e&&e.success?"primary":"grey",startIcon:null!==(s=this.state.response)&&void 0!==s&&s.success?(0,u.jsx)(l.Refresh,{}):(0,u.jsx)(l.Close,{}),children:null!==(i=this.state.response)&&void 0!==i&&i.success&&!this.state.upAgain?(0,u.jsx)(r.CircularProgress,{}):null!==(o=this.state.response)&&void 0!==o&&o.success?c.I18n.t("Reload"):c.I18n.t("Close")})})]})}}const ht=ct,ut={grow:{flexGrow:1},updateAllButton:t=>({position:"relative","& .admin-update-second-icon":{position:"absolute",top:15,left:15,opacity:.4,color:"dark"===t.palette.mode?"#aad5ff":"#007fff"}}),counters:{mr:"10px",minWidth:120,display:"flex","& div":{ml:"3px"}},infoAdapters:t=>({fontSize:10,color:"dark"===t.palette.mode?"#9c9c9c":"#333",cursor:"pointer"}),greenText:{color:"#00a005d1"},tooltip:{pointerEvents:"none"}},gt=[{name:"Description A-Z"},{name:"Name A-Z"},{name:"Popular first",notByList:!0},{name:"Recently updated",notByList:!0}];class mt extends U{constructor(t){super(t),this.inputRef=void 0,this.countRef=void 0,this.t=void 0,this.wordCache={},this.cache={listOfVisibleAdapter:null,adapters:null},this.listOfVisibleAdapterLength=0,this.allAdapters=0,this.installedAdapters=0,this.recentUpdatedAdapters=0,this.uuid="",this.buildCacheTimer=null,this.updateTimeout=null,this.typingTimer=null,this.hostsTimer=null,this.tempAdapters=null,this.tempInstalled=null,this.tempInstances=null,this.translate=(t,e,s)=>void 0!==e?this.props.t(t,e,s):(this.wordCache[t]||(this.wordCache[t]=this.props.t(t)),this.wordCache[t]),this.onAdaptersChanged=t=>{this.tempAdapters=this.tempAdapters||JSON.parse(JSON.stringify(this.state.adapters||{})),this.tempInstalled=this.tempInstalled||JSON.parse(JSON.stringify(this.state.installed||{})),this.tempInstances=this.tempInstances||JSON.parse(JSON.stringify(this.state.compactInstances||{})),t.forEach((t=>{if(!!t.id.match(/\.\d+$/))"deleted"!==t.type&&t.obj?this.tempInstances[t.id]={enabled:t.obj.common.enabled,icon:t.obj.common.icon,name:t.obj.common.name,adminTab:t.obj.common.adminTab,version:t.obj.common.version}:delete this.tempInstances[t.id];else if("deleted"!==t.type&&t.obj){const e=t.obj.common.name;this.tempInstalled[e]?Object.keys(this.tempInstalled[e]).forEach((s=>{void 0!==t.obj.common[s]&&"installedFrom"!==s&&(this.tempInstalled[e][s]=t.obj.common[s])})):this.tempInstalled[t.id.split(".").pop()]=JSON.parse(JSON.stringify(t.obj.common)),this.tempAdapters[t.id]=t.obj}else{const e=t.id.split(".");delete this.tempInstalled[e[2]],delete this.tempAdapters[t.id]}})),this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout((()=>{const t=this.tempAdapters;this.tempAdapters=null;const e=this.tempInstalled;this.tempInstalled=null;const s=this.tempInstances;this.tempInstances=null,this.analyseInstalled({adapters:t,installedLocal:e,cb:()=>this.calculateInfo(s)})}),300)},this.rightDependencies=t=>{const e=this.state.repository[t];let s=!0;if(e){const i=e.dependencies,o=e.node;if(i)if(i instanceof Array)i.forEach((t=>{const e="string"!==typeof t,i=Object.keys(t),o=e?i?i[0]:null:t;if(s&&o){const i=this.state.installed[o];try{s=!!i&&(!e||a().satisfies(i.version,t[o],{includePrerelease:!0}))}catch{s=!0}}}));else if("object"===typeof i){const t=i;Object.keys(t).forEach((e=>{if(e&&void 0!==t[e]&&s){const i=this.state.installed[e],o="string"===typeof t[e];try{s=!!i&&(!o||a().satisfies(i.version,t[e],{includePrerelease:!0}))}catch{s=!0}}}))}else console.error(`[ADAPTERS] Invalid dependencies for ${t}: ${JSON.stringify(i)}`);if(s&&o)try{s=a().satisfies(this.state.nodeJsVersion,o)}catch{s=!0}}return s},this.setAdminUpgradeTo=t=>this.setState({adminUpgradeTo:t}),Object.assign(this.state,{lastUpdate:0,repository:{},installed:{},installedGlobal:{},adapters:{},compactInstances:{},categories:[],hostData:null,compactRepositories:null,hostOs:"",nodeJsVersion:"",init:!1,update:!1,filterConnectionType:!1,search:(window._localStorage||window.localStorage).getItem("Adapter.search")||"",oneListView:!1,tableViewMode:!1,updateList:!1,installedList:0,categoriesTiles:"All",filterTiles:"Description A-Z",gitHubInstallDialog:!1,updateAvailable:[],filteredList:null,showUpdater:!1,descWidth:300,showStatistics:!1,readTimeoutMs:w.o.getReadTimeoutMs(),showSlowConnectionWarning:!1,currentHost:t.currentHost,forceUpdateAdapters:t.forceUpdateAdapters,triggerUpdate:t.triggerUpdate,ratings:null,categoriesExpanded:{},adminUpgradeTo:""}),this.inputRef=(0,i.createRef)(),this.countRef=(0,i.createRef)(),this.t=this.translate}renderSlowConnectionWarning(){return this.state.showSlowConnectionWarning?(0,u.jsx)(w.A,{readTimeoutMs:this.state.readTimeoutMs,t:this.t,onClose:t=>{t?this.setState({showSlowConnectionWarning:!1,readTimeoutMs:t},(()=>this.updateAll())):this.setState({showSlowConnectionWarning:!1})}}):null}async componentDidMount(){this.props.ready&&(await this.updateAll(),this.state.search&&this.filterAdapters(),this.props.adaptersWorker.registerHandler(this.onAdaptersChanged),this.props.instancesWorker.registerHandler(this.onAdaptersChanged))}async updateAll(t,e,s){await this.getAdapters(t,e,s),await this.getAdaptersInfo(t,s)}componentDidUpdate(){const t=this.getDescWidth();this.state.descWidth!==t&&this.setState({descWidth:t}),this.countRef.current&&(this.countRef.current.innerHTML=this.listOfVisibleAdapterLength.toString())}componentWillUnmount(){this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=null,this.buildCacheTimer&&(clearTimeout(this.buildCacheTimer),this.buildCacheTimer=null),this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),this.hostsTimer&&(clearTimeout(this.hostsTimer),this.hostsTimer=null),this.props.adaptersWorker.unregisterHandler(this.onAdaptersChanged),this.props.instancesWorker.unregisterHandler(this.onAdaptersChanged)}analyseInstalled(t){let{adapters:e,repository:s}=t;const{cb:i,installedLocal:o}=t;let{installedGlobal:n}=t;e=e||this.state.adapters;const a=o||this.state.installed;n=n||this.state.installedGlobal,s=s||this.state.repository;const r=[];Object.keys(a).forEach((t=>{if(a[t]){const e=a[t].version,i=s[t];i&&i.version!==e&&C.A.updateAvailable(e,i.version)&&!r.includes(t)&&r.push(t)}})),this.cache.listOfVisibleAdapter=null,this.setState({adapters:e,updateAvailable:r,installed:a,repository:s,installedGlobal:n},(()=>i&&i()))}async getInstalled(t){let e,s={};const i=await this.props.socket.getHosts(t);for(const n of i)try{const i=await this.props.socket.getState(`${n._id}.alive`);if(null!==i&&void 0!==i&&i.val){const i=await this.props.socket.getInstalled(n._id,t,this.state.readTimeoutMs);n._id===this.state.currentHost&&(e=i),s={...s,...i}}}catch(o){window.alert(`Cannot getInstalled from "${n._id}" (timeout ${this.state.readTimeoutMs}ms): ${o}`),o.toString().includes("timeout")&&this.setState({showSlowConnectionWarning:!0})}return{installedLocal:e,installedGlobal:s}}async getAdapters(t,e,s){console.log("[ADAPTERS] getAdapters");const i=this.state.currentHost;let o;t=t||this.props.adaptersWorker.isForceUpdate(),this.state.update||!t&&!s||this.setState({update:!0});try{o=await this.props.adaptersWorker.getAdapters(t)||{}}catch(l){window.alert(`Cannot getAdapters: ${l}`)}const{installedLocal:n,installedGlobal:a}=await this.getInstalled(t);let r;try{r=await this.props.socket.getRepository(i,{repo:this.props.systemConfig.common.activeRepo,update:e||s},t,this.state.readTimeoutMs)}catch(l){window.alert(`Cannot getRepository: ${l}`),l.toString().includes("timeout")&&this.setState({showSlowConnectionWarning:!0})}return this.analyseInstalled({adapters:o,installedLocal:n,repository:r,installedGlobal:a})}getWordVotes(t){if(1===t)return this.t("vote");if(t>=2&&t<=4)return this.t("votes2");if(t>=5&&t<=20)return this.t("votes");const e=t%10;return 1===e?this.t("vote21"):e>=2&&e<=4?this.t("votes2"):this.t("votes")}static getAdapterTitle(t,e,s){if(!e[t])return t;const i=e[t].titleLang||e[t].title;let o;return o="object"===typeof i?i[s]||i.en:i,o=((o||"").toString()||"").replace("ioBroker Visualisation - ",""),o.toLowerCase()}static sortAdapters(t,e,s,i,o,n,a){const r={};t.sort(((t,l)=>n?i[l].stat===i[t].stat?(r[t]=r[t]||mt.getAdapterTitle(t,i,e),r[l]=r[l]||mt.getAdapterTitle(l,i,e),r[t]>r[l]?1:r[t]<r[l]?-1:0):i[l].stat-i[t].stat:a?i[t]?i[l]?i[t].daysAgo===i[l].daysAgo?(r[t]=r[t]||mt.getAdapterTitle(t,i,e),r[l]=r[l]||mt.getAdapterTitle(l,i,e),r[t]>r[l]?1:r[t]<r[l]?-1:0):i[t].daysAgo-i[l].daysAgo:1:-1:s[t]&&s[l]?o?t>l?1:t<l?-1:0:(r[t]=r[t]||mt.getAdapterTitle(t,i,e),r[l]=r[l]||mt.getAdapterTitle(l,i,e),r[t]>r[l]?1:r[t]<r[l]?-1:0):s[t]?-1:s[l]?1:o?t>l?1:t<l?-1:0:(r[t]=r[t]||mt.getAdapterTitle(t,i,e),r[l]=r[l]||mt.getAdapterTitle(l,i,e),r[t]>r[l]?1:r[t]<r[l]?-1:0)))}calculateInfo(t,e,s,i){var o,n,a;s=s||this.state.hostData,e=e||this.state.ratings,t=t||this.state.compactInstances,null!==(o=i)&&void 0!==o&&o._id||(i=this.state.compactRepositories);const r=this.state.adapters,l=JSON.parse(JSON.stringify(this.state.installed)),p=JSON.parse(JSON.stringify(this.state.repository)),d=((null===(n=s)||void 0===n?void 0:n["Node.js"])||"").replace("v",""),c=(null===(a=s)||void 0===a?void 0:a.os)||"",h={},u=[];let g={};try{g=JSON.parse((window._localStorage||window.localStorage).getItem("Adapters.expandedCategories"))||{}}catch{}Object.keys(l).forEach((t=>{var e,s;const i=l[t];null!==(e=r[t])&&void 0!==e&&null!==(s=e.common)&&void 0!==s&&s.ignoreVersion&&(i.ignoreVersion=r[t].common.ignoreVersion),i.controller||"hosts"===t||p[t]||(p[t]=JSON.parse(JSON.stringify(i)),p[t].version=""),i.count=0,i.enabled=0})),Object.keys(t).forEach((e=>{const s=t[e].name;l[s]&&l[s].count++}));const m=Date.now();this.recentUpdatedAdapters=0,this.installedAdapters=0,Object.keys(p).forEach((t=>{var s,i;if("hosts"===t)return;if(t.startsWith("_"))return;const o=p[t];o.keywords&&(o.keywords=o.keywords.map((t=>t.toLowerCase())));const n=l[t];if(o.rating=null===(s=e)||void 0===s?void 0:s[t],null!==(i=o.rating)&&void 0!==i&&i.rating?o.rating.title=[`${this.t("Total rating:")} ${o.rating.rating.r} (${o.rating.rating.c} ${this.getWordVotes(o.rating.rating.c)})`,n&&n.version&&o.rating[n.version]?`${this.t("Rating for")} v${n.version}: ${o.rating[n.version].r} (${o.rating[n.version].c} ${this.getWordVotes(o.rating.rating.c)})`:""].filter((t=>t)).join("\n"):o.rating={title:this.t("No rating or too few data")},!o.controller){const e=o.type,s=l[t];Math.round((m-new Date(o.versionDate).getTime())/864e5)<=31&&this.recentUpdatedAdapters++,l[t]&&this.installedAdapters++,h[e]?(h[e].count++,h[e].adapters.push(t),s&&h[e].installed++):h[e]={name:e,translation:this.t(`${e}_group`),count:1,installed:s?1:0,adapters:[t]}}})),Object.keys(h).sort(((t,e)=>"general"===t&&"general"!==e?-1:"general"!==t&&"general"===e||h[t].translation>h[e].translation?1:h[t].translation<h[e].translation?-1:0)).forEach((t=>u.push(h[t])));const x="Name A-Z"===this.state.filterTiles;Object.keys(h).forEach((t=>mt.sortAdapters(h[t].adapters,this.props.lang,l,p,x)));let y=0;try{y=JSON.parse((window._localStorage||window.localStorage).getItem("Adapters.installedList")),!1===y&&(y=0)}catch{}const v="true"===(window._localStorage||window.localStorage).getItem("Adapters.list"),f="true"===(window._localStorage||window.localStorage).getItem("Adapters.viewMode"),b="true"===(window._localStorage||window.localStorage).getItem("Adapters.updateList"),w=(window._localStorage||window.localStorage).getItem("Adapters.categoriesTiles")||"All";let j=(window._localStorage||window.localStorage).getItem("Adapters.filterTiles")||"Description A-Z";return"A-Z"===j&&(j="Description A-Z"),this.allAdapters=Object.keys(p).length-1,this.cache.listOfVisibleAdapter=null,new Promise((o=>{this.setState({repository:p,installed:l,ratings:e,filterTiles:j,categoriesTiles:w,compactRepositories:i,installedList:y,compactInstances:t,updateList:b,tableViewMode:f,oneListView:v,lastUpdate:Date.now(),hostData:s,hostOs:c,nodeJsVersion:d,categories:u,categoriesExpanded:g,init:!0,update:!1},(()=>o()))}))}async getAdaptersInfo(t,e){if(this.state.currentHost&&Date.now()-this.state.lastUpdate>1e3){console.log("[ADAPTERS] getAdaptersInfo");const a=this.state.currentHost;let r;try{var s;this.state.update&&!e||await new Promise((t=>{this.setState({update:!0},(()=>t()))}));const n=await this.props.socket.getHostInfo(a,t,this.state.readTimeoutMs).catch((t=>{window.alert(`Cannot getHostInfo for "${a}": ${t}`),t.toString().includes("timeout")&&this.setState({showSlowConnectionWarning:!0})}));if(!1!==(null===(s=this.props.adminGuiConfig.admin.adapters)||void 0===s?void 0:s.allowAdapterRating)){var i;try{r=await this.props.socket.getRatings(t)}catch(o){window.alert(`Cannot read ratings: ${o}`)}this.uuid=(null===(i=r)||void 0===i?void 0:i.uuid)||null}else r=null;const l=await this.props.socket.getCompactInstances(t).catch((t=>(window.alert(`Cannot read countsOfInstances: ${t}`),{}))),p=await this.props.socket.getCompactSystemRepositories(t).catch((t=>(window.alert(`Cannot read getCompactSystemRepositories: ${t}`),{})));await this.calculateInfo(l||{},r,n,p)}catch(n){window.alert(`Cannot get adapters info: ${n}`)}}}toggleCategory(t){this.setState((e=>{const s=e.categoriesExpanded;return s[t]=!s[t],(window._localStorage||window.localStorage).setItem("Adapters.expandedCategories",JSON.stringify(s)),{categoriesExpanded:s}}))}rightOs(t){const e=this.state.repository[t];return null===e||void 0===e||!e.os||(Array.isArray(e.os)?!!e.os.find((t=>this.state.hostOs===t)):this.state.hostOs===e.os)}handleFilterChange(t){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((t=>{(window._localStorage||window.localStorage).setItem("Adapter.search",t||""),this.typingTimer=null,this.filterAdapters(t)}),300,t.target.value)}expandAll(){this.setState((t=>{const e=t.categories,s=t.categoriesExpanded;return e.forEach((t=>s[t.name]=!0)),(window._localStorage||window.localStorage).setItem("Adapters.expandedCategories",JSON.stringify(s)),{categoriesExpanded:s}}))}collapseAll(){const t={};(window._localStorage||window.localStorage).setItem("Adapters.expandedCategories",JSON.stringify(t)),this.setState({categoriesExpanded:t})}listTable(){const t=!this.state.oneListView;t&&this.expandAll(),(window._localStorage||window.localStorage).setItem("Adapters.list",t?"true":"false"),this.setState({oneListView:t})}changeViewMode(){this.cache.listOfVisibleAdapter=null;const t=!this.state.tableViewMode;let e=this.state.filterTiles;t&&"Description A-Z"!==e&&"Name A-Z"!==e&&(e="Description A-Z",(window._localStorage||window.localStorage).setItem("Adapters.filterTiles",e)),(window._localStorage||window.localStorage).setItem("Adapters.viewMode",t?"true":"false"),this.setState({tableViewMode:t,filterTiles:e})}changeUpdateList(){this.cache.listOfVisibleAdapter=null;const t=!this.state.updateList;(window._localStorage||window.localStorage).setItem("Adapters.updateList",t?"true":"false"),this.setState({updateList:t})}changeInstalledList(t){this.cache.listOfVisibleAdapter=null;let e=this.state.installedList?this.state.installedList<2?2:0:1;!e&&t&&(e=1),(window._localStorage||window.localStorage).setItem("Adapters.installedList",JSON.stringify(e)),this.setState({installedList:e})}changeFilterTiles(t){this.cache.listOfVisibleAdapter=null,(window._localStorage||window.localStorage).setItem("Adapters.filterTiles",t),this.setState({filterTiles:t})}changeCategoriesTiles(t){this.cache.listOfVisibleAdapter=null,(window._localStorage||window.localStorage).setItem("Adapters.categoriesTiles",t),this.setState({categoriesTiles:t})}filterAdapters(t){t=((t=void 0===t?this.state.search:t)||"").toLowerCase().trim();let e=[];t?this.state.categories.forEach((s=>s.adapters.forEach((s=>{const i=this.state.repository[s];if(!i)return;let o,n=i.titleLang||i.title;if("object"===typeof n&&(n=n[this.props.lang]||n.en),n=((n||"").toString()||"").replace("ioBroker Visualisation - ",""),o=i.desc?"string"===typeof i.desc?i.desc:i.desc[this.props.lang]||i.desc.en||"":"",s.includes(t))e.push(s);else if(n&&"string"===typeof n&&n.toLowerCase().includes(t))e.push(s);else if(o&&"string"===typeof o&&o.toLowerCase().includes(t))e.push(s);else{var a;null===(a=i.keywords)||void 0===a||a.forEach((i=>i.includes(t)&&e.push(s)))}})))):e=null,this.setState({filteredList:e,search:t},(()=>{this.cache.listOfVisibleAdapter=null,this.forceUpdate()}))}clearAllFilters(){(window._localStorage||window.localStorage).removeItem("Adapter.search"),(window._localStorage||window.localStorage).removeItem("Adapters.installedList"),(window._localStorage||window.localStorage).removeItem("Adapters.updateList"),this.inputRef.current&&(this.inputRef.current.value=""),this.setState({filteredList:null,updateList:!1,filterConnectionType:!1,installedList:0,search:""},(()=>this.filterAdapters()))}getContext(t){return{expertMode:this.props.expertMode,t:this.t,socket:this.props.socket,removeUpdateAvailable:t=>{const e=[...this.state.updateAvailable],s=e.indexOf(t);-1!==s&&(e.splice(s,1),this.setState({updateAvailable:e}))},toggleTranslation:this.props.toggleTranslation,noTranslation:this.props.noTranslation,rightDependenciesFunc:this.rightDependencies,lang:this.props.lang,uuid:this.uuid,themeType:this.props.themeType,theme:this.props.theme,onUpdating:this.props.onUpdating,repository:this.state.repository,installed:this.state.installed,installedGlobal:this.state.installedGlobal,compactInstances:this.state.compactInstances||{},adapters:this.state.adapters,nodeJsVersion:this.state.nodeJsVersion,currentHost:this.state.currentHost,adminHost:this.props.adminHost,adminInstance:this.props.adminInstance,instancesWorker:this.props.instancesWorker,hostsWorker:this.props.hostsWorker,executeCommand:this.props.executeCommand,categories:this.state.categories,descHidden:t,sortPopularFirst:!this.state.tableViewMode&&"Popular first"===this.state.filterTiles,sortRecentlyUpdated:!this.state.tableViewMode&&"Recently updated"===this.state.filterTiles,isTileView:!this.state.tableViewMode,updateRating:(t,e)=>{const s=JSON.parse(JSON.stringify(this.state.repository));Object.assign(s[t].rating,e),this.setState({repository:s})},setAdminUpgradeTo:this.setAdminUpgradeTo}}buildCache(t){this.cache.listOfVisibleAdapter=[],this.cache.adapters={};const e=Date.now(),s=this.t("0 %d days ago"),i=this.t("1 %d days ago"),o=this.t("2 %d days ago"),n=this.t("5 %d days ago");this.state.categories.filter((t=>this.state.tableViewMode||!this.state.categoriesTiles||"All"===this.state.categoriesTiles||t.name===this.state.categoriesTiles)).forEach((t=>t.adapters.forEach((t=>{const a=this.state.repository[t];if(a&&!a.controller){const l=a.connectionType?a.connectionType:"-",p=this.state.updateAvailable.includes(t),d=this.state.installed[t];let c=!this.state.filteredList||this.state.filteredList.includes(t);if(c&&this.state.filterConnectionType&&(c="local"===l),c&&this.state.updateList&&(c=p),c&&this.state.installedList&&(c=this.state.installedList<2?!(!d||!d.version):!(!d||!d.version||d.count)),c){var r;this.cache.listOfVisibleAdapter.push(t);const l=Math.round((e-new Date(a.versionDate).getTime())/864e4),p=Math.round(l/10),c=a.titleLang||a.title;let h,u;h=c&&"object"===typeof c?c[this.props.lang]||c.en:c||t,h=((h||"").toString()||"").replace("ioBroker Visualisation - ",""),u=a.desc?"string"===typeof a.desc?a.desc:a.desc[this.props.lang]||a.desc.en||"":"";const g=p%100<=10||p%100>=20?p%10:5;this.cache.adapters[t]={title:h,desc:u,image:d&&this.state.adapters[`system.adapter.${t}`]?`.${d.localIcon}`:a.extIcon,connectionType:a.connectionType?a.connectionType:"-",updateAvailable:this.state.updateAvailable.includes(t),rightDependencies:this.rightDependencies(t),rightOs:this.rightOs(t),sentry:!(null===(r=a.plugins)||void 0===r||!r.sentry),daysAgo:l,stat:a.stat||0,daysAgoText:p||0===p?0===p?s:1===g?i.replace("%d",p.toString()):2===g||3===g||4===g?o.replace("%d",p.toString()):n.replace("%d",p.toString()):""}}}})))),this.listOfVisibleAdapterLength=this.cache.listOfVisibleAdapter.length;const a="Name A-Z"===this.state.filterTiles;this.state.tableViewMode&&this.state.categories.forEach((t=>mt.sortAdapters(t.adapters,this.props.lang,this.state.installed,this.cache.adapters,a))),mt.sortAdapters(this.cache.listOfVisibleAdapter,this.props.lang,this.state.installed,this.cache.adapters,a,t.sortPopularFirst,t.sortRecentlyUpdated),console.log(`[ADAPTERS] ${(new Date).toISOString()} Update cache!`),this.forceUpdate()}getUpdater(){return this.state.showUpdater?(0,u.jsx)(b,{theme:this.props.theme,onSetCommandRunning:t=>this.props.onSetCommandRunning(t),t:this.props.t,currentHost:this.state.currentHost,lang:this.props.lang,installed:this.state.installed,repository:this.state.repository,toggleTranslation:this.props.toggleTranslation,noTranslation:this.props.noTranslation,onClose:t=>this.setState({showUpdater:!1},(()=>t&&this.updateAll(!0,!1))),socket:this.props.socket}):null}getDescWidth(){return this.props.menuOpened?document.body.scrollWidth-rt-180+13:this.props.menuClosed?document.body.scrollWidth-rt:document.body.scrollWidth-rt-50+13}getStatistics(){return this.state.showStatistics?(0,u.jsxs)(r.Dialog,{open:!0,onClose:()=>this.setState({showStatistics:!1}),children:[(0,u.jsx)(r.DialogTitle,{children:this.t("Statistics")}),(0,u.jsxs)(r.DialogContent,{style:{fontSize:16},children:[(0,u.jsxs)(r.Box,{component:"div",sx:ut.counters,children:[this.t("Total adapters"),":"," ",(0,u.jsx)("span",{style:{paddingLeft:6,fontWeight:"bold"},children:this.allAdapters})]}),(0,u.jsxs)(r.Box,{component:"div",sx:ut.counters,children:[this.t("Installed adapters"),":"," ",(0,u.jsx)("span",{style:{paddingLeft:6,fontWeight:"bold"},children:this.installedAdapters})]}),(0,u.jsxs)(r.Box,{component:"div",sx:ut.counters,children:[this.t("Last month updated adapters"),":"," ",(0,u.jsx)("span",{style:{paddingLeft:6,fontWeight:"bold"},children:this.recentUpdatedAdapters})]})]}),(0,u.jsx)(r.DialogActions,{children:(0,u.jsx)(r.Button,{variant:"contained",onClick:()=>this.setState({showStatistics:!1}),color:"primary",autoFocus:!0,startIcon:(0,u.jsx)(l.Close,{}),children:this.props.t("Close")})})]}):null}renderGitHubInstallDialog(t){return this.state.gitHubInstallDialog?(0,u.jsx)(I,{t:this.t,categories:this.state.categories,installed:this.state.installedGlobal,upload:t=>this.props.executeCommand(`upload ${t}${this.props.expertMode?" --debug":""}`),installFromUrl:(e,s,i)=>this.addInstance({adapterName:e,debug:s,customUrl:i,context:t}),repository:this.state.repository,onClose:()=>{this.setState({gitHubInstallDialog:!1})}}):null}renderHeader(){var t;let e=!this.props.commandRunning&&!!this.props.ready&&!!this.state.updateList&&this.state.updateAvailable.length>1;return e&&2===this.state.updateAvailable.length&&this.state.updateAvailable.includes("admin")&&(e=!1),(0,u.jsxs)(c.TabHeader,{children:[(0,u.jsx)(r.Tooltip,{title:this.t("Change view mode"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.changeViewMode(),children:this.state.tableViewMode?(0,u.jsx)(l.ViewModule,{}):(0,u.jsx)(l.ViewList,{})})}),(0,u.jsx)(r.Tooltip,{title:this.t("Check adapter for updates"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.updateAll(!0,!0),children:(0,u.jsx)(l.Refresh,{})})}),this.state.tableViewMode&&!this.state.oneListView&&(0,u.jsx)(r.Tooltip,{title:this.t("expand all"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.expandAll(),children:(0,u.jsx)(l.FolderOpen,{})})}),this.state.tableViewMode&&!this.state.oneListView&&(0,u.jsx)(r.Tooltip,{title:this.t("collapse all"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.collapseAll(),children:(0,u.jsx)(l.Folder,{})})}),this.state.tableViewMode&&(0,u.jsx)(r.Tooltip,{title:this.t("list"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.listTable(),children:(0,u.jsx)(l.List,{color:this.state.oneListView?"primary":"inherit"})})}),this.state.updateList?(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.changeInstalledList(!0),children:(0,u.jsx)(l.Star,{color:"primary",style:{opacity:.3,color:2===this.state.installedList?"red":void 0}})}):(0,u.jsx)(r.Tooltip,{slotProps:{popper:{sx:ut.tooltip}},title:this.t(this.state.installedList?1===this.state.installedList?"Showed only installed adapters":"Showed only installed adapters without instance.":"Show only installed"),children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.changeInstalledList(),children:(0,u.jsx)(l.Star,{style:2===this.state.installedList?{color:"red"}:null,color:1===this.state.installedList?"primary":"inherit"})})}),(0,u.jsx)(j.A,{config:this.props.adminGuiConfig.admin,name:"admin.adapters.filterUpdates",children:(0,u.jsx)(r.Tooltip,{title:this.t("Filter adapter with updates"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.changeUpdateList(),children:(0,u.jsx)(l.Update,{color:this.state.updateList?"primary":"inherit"})})})}),e&&(0,u.jsx)(r.Tooltip,{title:this.t("Update all adapters"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsxs)(r.IconButton,{size:"large",onClick:()=>this.setState({showUpdater:!0}),sx:ut.updateAllButton,children:[(0,u.jsx)(l.Update,{}),(0,u.jsx)(l.Update,{className:"admin-update-second-icon"})]})}),this.props.expertMode&&!1!==(null===(t=this.props.adminGuiConfig.admin)||void 0===t?void 0:t.adapters.gitHubInstall)&&(0,u.jsx)(r.Tooltip,{title:this.t("Install from custom URL"),slotProps:{popper:{sx:ut.tooltip}},children:(0,u.jsx)(r.IconButton,{size:"large",onClick:()=>this.setState({gitHubInstallDialog:!0}),children:(0,u.jsx)(p.hL4,{})})}),(0,u.jsx)("div",{style:ut.grow}),(0,u.jsx)(r.TextField,{variant:"standard",inputRef:this.inputRef,label:this.t("Filter by name"),defaultValue:this.state.search,onChange:t=>this.handleFilterChange(t),slotProps:{input:{endAdornment:this.state.search?(0,u.jsx)(r.InputAdornment,{position:"end",children:(0,u.jsx)(r.IconButton,{size:"small",onClick:()=>{(window._localStorage||window.localStorage).removeItem("Adapter.search"),this.inputRef.current.value="",this.setState({search:""},(()=>this.filterAdapters()))},children:(0,u.jsx)(l.Close,{})})}):null}}}),!this.state.tableViewMode&&(0,u.jsx)(d.A,{t:this.t,icons:!0,contained:"All"!==this.state.categoriesTiles,translateSuffix:"_group",arrayItem:[{name:"All"},...this.state.categories],onClick:t=>this.changeCategoriesTiles(t),value:this.state.categoriesTiles}),(0,u.jsx)(d.A,{t:this.t,arrayItem:this.state.tableViewMode?gt.filter((t=>!t.notByList)):gt,onClick:t=>this.changeFilterTiles(t),value:this.state.filterTiles}),(0,u.jsx)("div",{style:ut.grow}),(0,u.jsx)(j.A,{config:this.props.adminGuiConfig.admin,name:"admin.adapters.statistics",children:(0,u.jsxs)(r.Box,{component:"div",sx:c.Utils.getStyle(this.props.theme,ut.infoAdapters,{display:{sm:"none",md:"inline-block"}}),onClick:()=>this.setState({showStatistics:!0}),children:[(0,u.jsxs)(r.Box,{component:"div",sx:{...ut.counters,...ut.greenText},children:[this.t("Selected adapters"),(0,u.jsx)("div",{ref:this.countRef})]}),(0,u.jsxs)(r.Box,{component:"div",sx:ut.counters,children:[this.t("Total adapters"),":",(0,u.jsx)("div",{children:this.allAdapters})]}),(0,u.jsxs)(r.Box,{component:"div",sx:ut.counters,children:[this.t("Installed adapters"),":",(0,u.jsx)("div",{children:this.installedAdapters})]}),(0,u.jsxs)(r.Box,{component:"div",sx:ut.counters,children:[this.t("Last month updated adapters"),":",(0,u.jsx)("div",{children:this.recentUpdatedAdapters})]})]})})]})}renderWebserverUpgrade(){return this.state.adminUpgradeTo?(0,u.jsx)(ht,{socket:this.props.socket,themeType:this.props.themeType,host:this.props.adminHost,onClose:()=>{console.log("Close dialog"),this.setState({adminUpgradeTo:"",showDialog:!1})},version:this.state.adminUpgradeTo,adminInstance:this.props.adminInstance,onUpdating:t=>{this.props.onUpdating(t)},currentAdminVersion:this.props.currentAdminVersion}):null}render(){var t,e;if(!this.state.init)return(0,u.jsx)(r.LinearProgress,{});this.state.triggerUpdate!==this.props.triggerUpdate&&setTimeout((()=>{this.setState({triggerUpdate:this.props.triggerUpdate},(()=>this.updateAll(!0)))}),100),this.props.currentHost===this.state.currentHost&&this.props.forceUpdateAdapters===this.state.forceUpdateAdapters||(this.hostsTimer=this.hostsTimer||setTimeout((()=>{this.hostsTimer=null,this.setState({currentHost:this.props.currentHost,forceUpdateAdapters:this.props.forceUpdateAdapters},(()=>this.updateAll(!1,!1,!0)))}),200));let s=c.Utils.isStableRepository(this.props.systemConfig.common.activeRepo);const i=null===(t=this.state.compactRepositories)||void 0===t||null===(e=t.native)||void 0===e?void 0:e.repositories;if(i&&this.props.systemConfig.common.activeRepo)if(Array.isArray(this.props.systemConfig.common.activeRepo))s=!this.props.systemConfig.common.activeRepo.find((t=>{var e,s,o;return!t.toLowerCase().startsWith("stable")&&!(null!==(e=i[t])&&void 0!==e&&null!==(s=e.json)&&void 0!==s&&null!==(o=s._repoInfo)&&void 0!==o&&o.stable)}));else if("string"===typeof this.props.systemConfig.common.activeRepo){var o,n,a;s=!this.props.systemConfig.common.activeRepo.toLowerCase().startsWith("stable")&&!(null!==(o=i[this.props.systemConfig.common.activeRepo])&&void 0!==o&&null!==(n=o.json)&&void 0!==n&&null!==(a=n._repoInfo)&&void 0!==a&&a.stable)}let l;if(!s)if(l=Array.isArray(this.props.systemConfig.common.activeRepo)?this.props.systemConfig.common.activeRepo.join(", "):this.props.systemConfig.common.activeRepo,"string"===typeof this.props.systemConfig.common.activeRepo){var p,d;const t=i&&(null===(p=i[this.props.systemConfig.common.activeRepo])||void 0===p||null===(d=p.json)||void 0===d?void 0:d._repoInfo);null!==t&&void 0!==t&&t.name&&(l=t.name&&"object"===typeof t.name?t.name[this.props.lang]||t.name.en:t.name)}else this.props.systemConfig.common.activeRepo&&"string"!==typeof this.props.systemConfig.common.activeRepo&&(l=this.props.systemConfig.common.activeRepo.map((t=>{var e,s;const o=i&&(null===(e=i[t])||void 0===e||null===(s=e.json)||void 0===s?void 0:s._repoInfo);return null!==o&&void 0!==o&&o.name?o.name&&"object"===typeof o.name?o.name[this.props.lang]||o.name.en:o.name:t})).join(", "));const h=this.getContext(this.state.descWidth<50);return this.cache.listOfVisibleAdapter||(this.buildCacheTimer=this.buildCacheTimer||setTimeout((()=>{this.buildCacheTimer=null,this.buildCache(h)}),0)),(0,u.jsxs)(c.TabContainer,{children:[this.state.update&&(0,u.jsx)(r.Grid2,{children:(0,u.jsx)(r.LinearProgress,{})}),this.renderHeader(),(0,u.jsx)(dt,{stableRepo:s,repoName:l,context:h,systemConfig:this.props.systemConfig,tableViewMode:this.state.tableViewMode,oneListView:this.state.oneListView,update:this.state.update,cachedAdapters:this.cache.adapters,categories:this.state.categories,categoriesExpanded:this.state.categoriesExpanded,listOfVisibleAdapter:this.cache.listOfVisibleAdapter,toggleCategory:t=>this.toggleCategory(t),clearAllFilters:()=>this.clearAllFilters(),descWidth:this.state.descWidth,sortByName:"Name A-Z"===this.state.filterTiles,sortPopularFirst:h.sortPopularFirst,sortRecentlyUpdated:h.sortRecentlyUpdated,commandRunning:this.props.commandRunning}),this.getUpdater(),this.getStatistics(),this.renderSlowConnectionWarning(),this.renderGitHubInstallDialog(h),this.renderWebserverUpgrade(),this.renderDialogs(h)]})}}const xt=mt}}]);
|
|
2
|
+
//# sourceMappingURL=2534.89c71e34.chunk.js.map
|