homebridge-config-ui-x 4.78.2-beta.11 → 4.78.2-beta.13
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/CHANGELOG.md +8 -6
- package/package.json +1 -1
- package/public/assets/hap-icons/doorbell.svg +17 -0
- package/public/{chunk-QNO5NO6N.js → chunk-3PIFFC2Y.js} +1 -1
- package/public/{chunk-IYXKWWOZ.js → chunk-3WTVSYGI.js} +1 -1
- package/public/{chunk-3E4EMFC3.js → chunk-45K6YVYO.js} +1 -1
- package/public/{chunk-G6BCH4I7.js → chunk-4YQWZ3VE.js} +1 -1
- package/public/{chunk-GIX5JDE6.js → chunk-7BUCG6U5.js} +1 -1
- package/public/{chunk-WAALYA6G.js → chunk-7XNTKQP4.js} +1 -1
- package/public/{chunk-4HPGM6HS.js → chunk-7XTULOMX.js} +1 -1
- package/public/{chunk-5S7TFWYQ.js → chunk-APTNRLSD.js} +1 -1
- package/public/{chunk-5PJBGU6S.js → chunk-B75XR7AB.js} +1 -1
- package/public/{chunk-PSS4REOR.js → chunk-BMN2K5ZD.js} +1 -1
- package/public/{chunk-OXPPMN4H.js → chunk-C2QFAQA7.js} +1 -1
- package/public/{chunk-G7ASN2CT.js → chunk-CFNXSUI4.js} +1 -1
- package/public/{chunk-2IN45KD3.js → chunk-DON5QRSR.js} +1 -1
- package/public/{chunk-2YGYR6L5.js → chunk-EBD6KV7T.js} +1 -1
- package/public/{chunk-BDWOWDNP.js → chunk-F57UVA2Z.js} +1 -1
- package/public/{chunk-PKTXUGFE.js → chunk-GKEAZ6ZU.js} +1 -1
- package/public/{chunk-7DIUENPE.js → chunk-GKQXGP3P.js} +1 -1
- package/public/{chunk-GBYRC5LK.js → chunk-GWY43OZ7.js} +1 -1
- package/public/{chunk-X54RYJVH.js → chunk-IDHAO4KH.js} +1 -1
- package/public/{chunk-TFUWAEXV.js → chunk-IHAJEZP3.js} +1 -1
- package/public/{chunk-J7CZIM5Y.js → chunk-IJ2NROJY.js} +1 -1
- package/public/{chunk-FV2LDU2Z.js → chunk-JJV27QWA.js} +1 -1
- package/public/{chunk-XCMFVJ2O.js → chunk-KBJE64LC.js} +1 -1
- package/public/{chunk-SF7MGKLR.js → chunk-KGLTWKXZ.js} +1 -1
- package/public/{chunk-7AR3IBWZ.js → chunk-KSHLYX7Y.js} +1 -1
- package/public/{chunk-UDTPL4YX.js → chunk-LEMAMMD2.js} +1 -1
- package/public/{chunk-YCQ4FEJS.js → chunk-LNUVGJNE.js} +1 -1
- package/public/{chunk-BNSPASKE.js → chunk-LUSJRM6A.js} +1 -1
- package/public/{chunk-CSHGXNQ4.js → chunk-M466EH2E.js} +1 -1
- package/public/{chunk-C2NDMLCJ.js → chunk-NBT37UYZ.js} +1 -1
- package/public/{chunk-GI5ZD4YL.js → chunk-NIEQGZSP.js} +1 -1
- package/public/{chunk-ZGJ4EXWD.js → chunk-PRHQGQ7E.js} +1 -1
- package/public/{chunk-JWTBJ52B.js → chunk-QO433P63.js} +1 -1
- package/public/{chunk-4W3A6DIF.js → chunk-QOGMJZDE.js} +1 -1
- package/public/chunk-RKFQ2MWC.js +1 -0
- package/public/{chunk-BBWTONF5.js → chunk-RLDMEEUB.js} +1 -1
- package/public/{chunk-COJO762B.js → chunk-RWALFCVO.js} +1 -1
- package/public/{chunk-J7UVIPMF.js → chunk-RWU6JLRL.js} +1 -1
- package/public/{chunk-U6LTV5BY.js → chunk-SRN6KCKN.js} +1 -1
- package/public/{chunk-EXIBAO7N.js → chunk-V3LYJ22T.js} +1 -1
- package/public/{chunk-XQ3JJREI.js → chunk-VQUMUINX.js} +1 -1
- package/public/chunk-XTFZO7WM.js +1 -0
- package/public/{chunk-5R56LWCQ.js → chunk-YBXEOSR6.js} +1 -1
- package/public/chunk-ZWSUUJX7.js +12 -0
- package/public/index.html +1 -1
- package/public/main-YN7PNHK4.js +1 -0
- package/public/chunk-4NFI6L2Y.js +0 -12
- package/public/chunk-736HBW22.js +0 -1
- package/public/chunk-G4FGZERA.js +0 -1
- package/public/main-WNDNVTGA.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `homebridge-config-ui-x` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
-
## v4.79.0 (2025-07-
|
|
5
|
+
## v4.79.0 (2025-07-09)
|
|
6
6
|
|
|
7
7
|
### ⚠️ Upcoming Deprecations:
|
|
8
8
|
|
|
@@ -28,18 +28,20 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file.
|
|
|
28
28
|
- show colour temp values in mired and kelvin
|
|
29
29
|
- add saturation control to lightbulb control modal
|
|
30
30
|
- add transparency to slider handles in accessory control modals
|
|
31
|
-
- allow applying a custom service to an accessory's service
|
|
32
|
-
- change between `Switch`, `Outlet`, `Lightbulb`, `Fan`, `Television`, `Valve`, `AirPurifier`, `Heater`, `Cooler`, `Humidifier`, `Dehumidifier` for these accessory types
|
|
33
|
-
- change between `Door`, `Window`, `WindowCovering` for these accessory types
|
|
34
|
-
- this can be set in the accessory info modal, more options to come in the future
|
|
35
31
|
- obtain hb/ui changelog from the most recent github tag
|
|
36
32
|
- add plugin support button and modal
|
|
37
33
|
- add plugin search button, hide bar by default
|
|
38
34
|
- add tab in plugins showing plugin analytics in `iframe`
|
|
35
|
+
- allow applying a custom service to an accessory's service
|
|
36
|
+
- change between `Switch`, `Outlet`, `Lightbulb`, `Fan`, `Television`, `Valve`, `AirPurifier`, `Heater`, `Cooler`, `Humidifier`, `Dehumidifier` for these accessory types
|
|
37
|
+
- change between `Door`, `Window`, `WindowCovering` for these accessory types
|
|
38
|
+
- this can be set in the accessory info modal, more options to come in the future
|
|
39
|
+
- custom service changing - add more to group one
|
|
39
40
|
- add option to show `npm` version with node version
|
|
40
41
|
- this can be enabled in the update info widget settings by clicking the spanner icon in the top right corner of the widget on hover (from a desktop, when in unlocked mode)
|
|
41
42
|
- add control modal for smart speaker accessories
|
|
42
|
-
-
|
|
43
|
+
- prevent accessory control modal open when loading
|
|
44
|
+
- add control modal for doorbell accessories
|
|
43
45
|
|
|
44
46
|
### Other Changes
|
|
45
47
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-config-ui-x",
|
|
3
3
|
"displayName": "Homebridge UI",
|
|
4
|
-
"version": "4.78.2-beta.
|
|
4
|
+
"version": "4.78.2-beta.13",
|
|
5
5
|
"description": "A web based management, configuration and control platform for Homebridge.",
|
|
6
6
|
"author": "oznu <dev@oz.nu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="32px"
|
|
3
|
+
height="32px"
|
|
4
|
+
viewBox="0 0 32 32"
|
|
5
|
+
version="1.1"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
8
|
+
>
|
|
9
|
+
<g>
|
|
10
|
+
<title>doorbell</title>
|
|
11
|
+
<!-- Doorbell outer casing (maximum reasonable size) -->
|
|
12
|
+
<rect x="6" y="1" width="18" height="30" rx="3" stroke="#7F7F7F" fill="none" stroke-width="2.0" />
|
|
13
|
+
|
|
14
|
+
<!-- Doorbell button -->
|
|
15
|
+
<circle cx="15" cy="16" r="5" stroke="#7F7F7F" stroke-width="2.0" fill="#1976d2" fill-opacity="0.3" />
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-IDHAO4KH.js";import{g as i}from"./chunk-X7PVYZAE.js";import"./chunk-LNUVGJNE.js";import"./chunk-APTNRLSD.js";import"./chunk-LXXELGX4.js";import"./chunk-SRP6QX5M.js";import{ha as o,nb as r}from"./chunk-SKZUTSHE.js";var a=[{path:"",loadComponent:()=>import("./chunk-GKQXGP3P.js").then(t=>t.SetupWizardComponent)}],u=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({imports:[i.forChild(a),i]})}return t})();var l=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({providers:[n],imports:[u]})}return t})();export{l as SetupWizardModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-LEMAMMD2.js";import"./chunk-YBXEOSR6.js";import{g as r}from"./chunk-X7PVYZAE.js";import"./chunk-LNUVGJNE.js";import"./chunk-APTNRLSD.js";import"./chunk-LXXELGX4.js";import"./chunk-SRP6QX5M.js";import{ha as o,nb as e}from"./chunk-SKZUTSHE.js";var c=[{path:"",loadComponent:()=>import("./chunk-KGLTWKXZ.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as k}from"./chunk-CF2ZN7LY.js";import"./chunk-T252YJXA.js";import{d as P}from"./chunk-X7PVYZAE.js";import{b as I}from"./chunk-
|
|
1
|
+
import{t as k}from"./chunk-CF2ZN7LY.js";import"./chunk-T252YJXA.js";import{d as P}from"./chunk-X7PVYZAE.js";import{b as I}from"./chunk-LNUVGJNE.js";import{k as $,n as O}from"./chunk-APTNRLSD.js";import{a as y,b as T}from"./chunk-LXXELGX4.js";import"./chunk-SRP6QX5M.js";import{Bc as a,Cc as s,Ib as f,Jb as v,Ob as h,Pb as o,Qb as r,Rb as C,Vb as w,Yb as m,Zb as b,ab as i,kc as l,la as c,lc as S,mb as g,mc as d,ra as u,sa as _}from"./chunk-SKZUTSHE.js";function E(t,x){if(t&1){let n=w();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function H(t,x){if(t&1){let n=w();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function B(t,x){if(t&1){let n=w();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(O);$router=c(P);$settings=c(I);$toastr=c($);$translate=c(y);canShutdownRestartHost=this.$settings.env.canShutdownRestartHost;runningInDocker=this.$settings.env.runningInDocker;restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=g({type:t,selectors:[["ng-component"]],decls:19,vars:15,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),C(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),f(16,E,4,3,"p",5),f(17,H,4,3,"p",5),f(18,B,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),h("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),v(e.canShutdownRestartHost?16:-1),i(),v(e.canShutdownRestartHost?17:-1),i(),v(e.runningInDocker?18:-1))},dependencies:[k,T],encapsulation:2})}return t})();export{G as PowerOptionsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Se}from"./chunk-F3ERQJVG.js";import{l as ke,n as Q}from"./chunk-GIX5JDE6.js";import{a as H}from"./chunk-UQYCFN3T.js";import"./chunk-GDFV4BMO.js";import{a as Be}from"./chunk-NGNQPAAK.js";import"./chunk-QDCKP2LU.js";import"./chunk-J7CZIM5Y.js";import"./chunk-UD6SVFW2.js";import"./chunk-7EQ4BJZB.js";import"./chunk-EGCUYKRH.js";import{a as ye}from"./chunk-TQNKRJOX.js";import{g as _e,h as Ce,i as he,j as be,k as ve,l as xe,m as $,n as O,t as U}from"./chunk-CF2ZN7LY.js";import{A as fe,c as le,e as re,f as se,g as de,j as pe,m as ce,p as ue,q as me,z as ge}from"./chunk-T252YJXA.js";import{a as W}from"./chunk-4W3A6DIF.js";import"./chunk-5R56LWCQ.js";import{a as we,d as Pe}from"./chunk-X7PVYZAE.js";import{b as G}from"./chunk-YCQ4FEJS.js";import{k as R,n as L}from"./chunk-5S7TFWYQ.js";import{a as q,b as B}from"./chunk-LXXELGX4.js";import"./chunk-SRP6QX5M.js";import{Bc as r,Cc as s,Dc as E,Hb as y,Ib as m,Jb as g,Lb as j,Mb as F,Nb as z,Ob as C,Pb as a,Qb as l,Rb as d,Vb as w,Xa as N,Ya as T,Yb as _,Za as Z,Zb as f,ab as n,bc as ee,cc as ie,cd as M,dc as te,fd as ae,h as k,jc as J,jd as oe,kc as c,la as P,lc as h,mb as S,mc as b,ra as v,sa as x,uc as K,w as D,xc as V,yc as I,zc as ne}from"./chunk-SKZUTSHE.js";var Ne=t=>({pluginName:t});function He(t,p){t&1&&(a(0,"ul",7)(1,"li"),c(2),r(3,"translate"),l(),a(4,"li"),c(5),r(6,"translate"),l()()),t&2&&(n(2),h(s(3,2,"plugins.manage.confirm_disable_accessory_1")),n(3),h(s(6,4,"plugins.manage.confirm_disable_accessory_2")))}function Ae(t,p){t&1&&(a(0,"ul",7)(1,"li"),c(2),r(3,"translate"),l(),a(4,"li"),c(5),r(6,"translate"),l()()),t&2&&(n(2),h(s(3,2,"plugins.manage.confirm_disable_platform_1")),n(3),h(s(6,4,"plugins.manage.confirm_disable_platform_2")))}var Ie=(()=>{class t{$activeModal=P($);pluginName;isConfigured=!1;isConfiguredDynamicPlatform=!1;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(){this.$activeModal.close()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{pluginName:"pluginName",isConfigured:"isConfigured",isConfiguredDynamicPlatform:"isConfiguredDynamicPlatform"},decls:26,vars:22,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"mb-3","text-center"],[1,"fas","fa-fw","fa-circle-pause","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","warning",1,"mb-0",3,"dismissible"],[1,"w-100","text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),c(3),l(),a(4,"button",3),r(5,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(6,"div",4)(7,"div",5),d(8,"i",6),l(),m(9,He,7,6,"ul",7),m(10,Ae,7,6,"ul",7),a(11,"ngb-alert",8)(12,"p",9),c(13),r(14,"translate"),l()()(),a(15,"div",10)(16,"div",11)(17,"button",12),r(18,"translate"),_("click",function(){return i.dismissModal()}),c(19),r(20,"translate"),l()(),d(21,"div",13),a(22,"div",14)(23,"button",15),_("click",function(){return i.closeModal()}),c(24),r(25,"translate"),l()()()()),o&2&&(n(3),h(i.pluginName),n(),y("aria-label",s(5,9,"form.button_close")),n(5),g(i.isConfigured&&!i.isConfiguredDynamicPlatform?9:-1),n(),g(i.isConfigured&&i.isConfiguredDynamicPlatform?10:-1),n(),C("dismissible",!1),n(2),h(E(14,11,"plugins.manage.confirm_disable",V(20,Ne,i.pluginName))),n(4),y("aria-label",s(18,14,"form.button_close")),n(2),b(" ",s(20,16,"form.button_close")," "),n(5),b(" ",s(25,18,"plugins.manage.disable")," "))},dependencies:[_e,B],encapsulation:2})}return t})();var je=t=>({author:t});function Fe(t,p){if(t&1&&(a(0,"li",9),d(1,"i",15),a(2,"a",16),c(3),l()()),t&2){let e=p.$implicit,o=f();n(),C("ngClass",o.getIconClass(e.type)),n(),C("href",e.url,T),n(),h(e.url)}}var Te=(()=>{class t{$activeModal=P($);plugin;fundingOptions;ngOnInit(){this.plugin.funding||this.$activeModal.close(),this.plugin.name==="homebridge-config-ui-x"&&(this.plugin.author="oznu"),Array.isArray(this.plugin.funding)?this.fundingOptions=this.plugin.funding.map(e=>{if(typeof e=="string")return{type:"other",url:e};if(typeof e=="object")return{type:e.type||"other",url:e.url}}):typeof this.plugin.funding=="string"?this.fundingOptions=[{type:"other",url:this.plugin.funding}]:typeof this.plugin.funding=="object"&&(this.fundingOptions=[{type:this.plugin.funding.type||"other",url:this.plugin.funding.url}])}getIconClass(e){switch(e.toLowerCase()){case"paypal":return"fab fa-fw fa-paypal";case"github":return"fab fa-fw fa-github";case"patreon":return"fab fa-fw fa-patreon";case"kofi":case"ko-fi":return"fas fa-fw fa-coffee";default:return"fas fa-fw fa-link"}}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:28,vars:21,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","pink-text","mb-3"],[1,"fas","fa-fw","fa-heart",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"],[1,"me-2","primary-text","fa-fw","fa-xl",3,"ngClass"],["target","_blank","rel","noopener noreferrer",1,"text-break-all",3,"href"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),c(3),r(4,"translate"),l(),a(5,"button",3),r(6,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(7,"div",4)(8,"div",5),d(9,"i",6),l(),a(10,"ul",7)(11,"li"),c(12),r(13,"translate"),l(),a(14,"li"),c(15),r(16,"translate"),l()(),a(17,"ul",8),F(18,Fe,4,3,"li",9,j),l()(),a(20,"div",10),d(21,"div",11),a(22,"div",12)(23,"button",13),r(24,"translate"),_("click",function(){return i.dismissModal()}),c(25),r(26,"translate"),l()(),d(27,"div",14),l()()),o&2&&(n(3),h(E(4,6,"plugins.donate.tile_donate_to",V(19,je,"@"+i.plugin.author))),n(2),y("aria-label",s(6,9,"form.button_close")),n(7),h(s(13,11,"plugins.donate.message_1")),n(3),h(s(16,13,"plugins.donate.message_2")),n(3),z(i.fundingOptions),n(5),y("aria-label",s(24,15,"form.button_close")),n(2),b(" ",s(26,17,"form.button_close")," "))},dependencies:[M,B],styles:[".text-break-all[_ngcontent-%COMP%]{word-break:break-all}"]})}return t})();var ze=(t,p)=>({"orange-text":t,"grey-text":p}),X=t=>({opacity:t}),Oe=(t,p)=>({"green-text":t,"grey-text":p}),Ue=(t,p)=>({"purple-text":t,"grey-text":p}),qe=(t,p)=>({scopedLink:t,verifiedLink:p});function Re(t,p){t&1&&(a(0,"h6",18),c(1),r(2,"translate"),l(),a(3,"p",19),c(4),r(5,"translate"),l(),a(6,"p",19),c(7),r(8,"translate"),l()),t&2&&(n(),h(s(2,3,"plugins.manage.scoped_subtitle")),n(3),h(s(5,5,"plugins.manage.scoped_message")),n(3),h(s(8,7,"plugins.manage.verified_message")))}function Le(t,p){t&1&&(a(0,"h6",18),c(1),r(2,"translate"),l(),a(3,"p",19),c(4),r(5,"translate"),l()),t&2&&(n(),h(s(2,2,"plugins.manage.verified_subtitle")),n(3),h(s(5,4,"plugins.manage.verified_message")))}function Ge(t,p){t&1&&(a(0,"h6",18),c(1),r(2,"translate"),l(),a(3,"p",19),c(4),r(5,"translate"),l()),t&2&&(n(),h(s(2,2,"plugins.manage.unverified_subtitle")),n(3),h(s(5,4,"plugins.manage.unverified_message")))}function We(t,p){if(t&1){let e=w();a(0,"button",20),_("click",function(){v(e);let i=f();return x(i.dismissModal())}),c(1),r(2,"translate"),l()}t&2&&(n(),b(" ",s(2,1,"form.button_close")," "))}function Qe(t,p){if(t&1){let e=w();a(0,"button",20),_("click",function(){v(e);let i=f();return x(i.dismissModal())}),c(1),r(2,"translate"),l()}t&2&&(n(),b(" ",s(2,1,"form.button_close")," "))}function Je(t,p){if(t&1&&(a(0,"a",17),c(1),r(2,"translate"),d(3,"i",21),l()),t&2){let e=f();C("href",e.plugin.links.homepage||e.plugin.links.npm,T),n(),b(" ",s(2,2,"plugins.button_homepage")," ")}}var Ve=(()=>{class t{$activeModal=P($);plugin;defaultIcon="assets/hb-icon.png";linkScoped='<a href="https://github.com/homebridge/plugins/wiki/Scoped-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';linkVerified='<a href="https://github.com/homebridge/plugins/wiki/Verified-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';ngOnInit(){this.plugin.icon||(this.plugin.icon=this.defaultIcon)}handleIconError(){this.plugin.icon=this.defaultIcon}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:32,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],["alt","Plugin Icon",1,"mb-3","plugin-icon-card",3,"error","src"],[1,"mb-1"],[1,"grey-text","mb-0","font-monospace"],[1,"grey-text","mb-1","font-monospace"],[1,"mb-3"],[1,"fas","fa-fw","fa-shield-alt","mb-3",2,"font-size","48px",3,"ngClass","ngStyle"],[1,"mb-0","grey-text",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[1,"mb-2"],[1,"mb-1","grey-text"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),c(3),r(4,"translate"),l(),a(5,"button",3),r(6,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(7,"div",4)(8,"img",5),_("error",function(){return i.handleIconError()}),l(),a(9,"h4",6),c(10),l(),a(11,"p",7),c(12),l(),a(13,"p",8),c(14),l(),a(15,"p",9),c(16),l(),d(17,"i",10)(18,"i",10)(19,"i",10),m(20,Re,9,9),m(21,Le,6,6),m(22,Ge,6,6),d(23,"p",11),r(24,"translate"),l(),a(25,"div",12)(26,"div",13),m(27,We,3,3,"button",14),l(),a(28,"div",15),m(29,Qe,3,3,"button",14),l(),a(30,"div",16),m(31,Je,4,4,"a",17),l()()()),o&2&&(n(3),h(s(4,20,"plugins.manage.information")),n(2),y("aria-label",s(6,22,"form.button_close")),n(3),C("src",i.plugin.icon,T),n(2),h(i.plugin.displayName),n(2),h(i.plugin.name),n(2),b("@",i.plugin.author),n(2),h(i.plugin.description),n(),C("ngClass",I(27,ze,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin,i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin))("ngStyle",V(30,X,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?1:.25)),n(),C("ngClass",I(32,Oe,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),i.plugin.isHbScoped||!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin))("ngStyle",V(35,X,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?1:.25)),n(),C("ngClass",I(37,Ue,i.plugin.isHbScoped,!i.plugin.isHbScoped))("ngStyle",V(40,X,i.plugin.isHbScoped?1:.25)),n(),g(i.plugin.isHbScoped?20:-1),n(),g(!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?21:-1),n(),g(!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?22:-1),n(),C("innerHTML",E(24,24,"plugins.manage.more_info",I(42,qe,i.linkScoped,i.linkVerified)),N),n(4),g(i.plugin.links.homepage||i.plugin.links.npm?27:-1),n(2),g(!i.plugin.links.homepage&&!i.plugin.links.npm?29:-1),n(2),g(i.plugin.links.homepage||i.plugin.links.npm?31:-1))},dependencies:[B,M,ae],styles:[".plugin-icon[_ngcontent-%COMP%]{height:75px;width:75px;border-radius:15px;border:1px solid #222222}"]})}return t})();var Ke=(t,p,e)=>({"purple-text":t,"green-text":p,"orange-text":e}),Xe=(t,p)=>({"fa-bridge-circle-exclamation orange-text":t,"fa-bridge-circle-xmark red-text":p});function Ye(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.checkAndUpdatePlugin())}),d(3,"i",24),l()}t&2&&(C("ngbTooltip",s(1,2,"plugins.button_update")),y("aria-label",s(2,4,"plugins.button_update")))}function Ze(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.switchToScoped())}),d(3,"i",25),l()}t&2&&(C("ngbTooltip",s(1,2,"plugins.manage.scoped.switch")),y("aria-label",s(2,4,"plugins.manage.scoped.switch")))}function ei(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.openSettings())}),d(3,"i",26),l()}t&2&&(C("ngbTooltip",s(1,2,"plugins.button_set_up")),y("aria-label",s(2,4,"plugins.button_set_up")))}function ii(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.openBridgeSettings())}),d(3,"i",27),l()}t&2&&(C("ngbTooltip",s(1,2,"child_bridge.setup")),y("aria-label",s(2,4,"child_bridge.setup")))}function ti(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.openBridgeSettings())}),d(3,"i",28),l()}t&2&&(C("ngbTooltip",s(1,2,"child_bridge.bridge_connect")),y("aria-label",s(2,4,"child_bridge.bridge_connect")))}function ni(t,p){if(t&1&&d(0,"i",12),t&2){let e=f();C("ngClass",I(1,Xe,e.childBridgeStatus==="pending",e.childBridgeStatus==="down"))}}function ai(t,p){if(t&1){let e=w();a(0,"a",14),_("click",function(){v(e);let i=f();return x(i.openFundingModal(i.plugin))}),d(1,"i",29),a(2,"span",16),c(3),l()()}if(t&2){let e=f();n(3),b("@",e.plugin.author)}}function oi(t,p){if(t&1&&(a(0,"span",16),d(1,"i",30),c(2),l()),t&2){let e=f();n(2),b("@",e.plugin.author," ")}}function li(t,p){if(t&1&&(a(0,"span"),c(1),r(2,"date"),l()),t&2){let e=f(2);n(),b("(",E(2,1,e.plugin.lastUpdated,"yyyy-MM-dd"),")")}}function ri(t,p){if(t&1&&(a(0,"span"),d(1,"i",31),a(2,"span",16),c(3),m(4,li,3,4,"span"),l()()),t&2){let e=f();n(3),b("v",e.plugin.latestVersion," "),n(),g(e.plugin.lastUpdated?4:-1)}}function si(t,p){if(t&1&&(d(0,"i",32),c(1)),t&2){let e=f();n(),b("v",e.plugin.installedVersion," ")}}function di(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),_("click",function(){v(e);let i=f();return x(i.doChildBridgeAction("restart"))}),d(2,"i",33),l()}if(t&2){let e=f();C("ngbTooltip",s(1,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart"))}}function pi(t,p){if(t&1){let e=w();a(0,"a",34),_("click",function(){v(e);let i=f();return x(i.enablePlugin(i.plugin))}),d(1,"i",35),r(2,"translate"),l()}t&2&&(n(),C("ngbTooltip",s(2,1,"plugins.status_disabled")))}function ci(t,p){if(t&1){let e=w();a(0,"a",36),_("click",function(){v(e);let i=f();return x(i.installAlternateVersion())}),d(1,"i",37),l()}}function ui(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.viewPluginLog())}),d(1,"i",46),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.plugin_logs")," "))}function mi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.installAlternateVersion())}),d(1,"i",47),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.manage_version")," "))}function gi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openJsonEditor())}),d(1,"i",48),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.json_config")," "))}function fi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.disablePlugin(i.plugin))}),d(1,"i",49),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.disable")," "))}function _i(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.enablePlugin(i.plugin))}),d(1,"i",50),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.enable")," "))}function Ci(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.uninstallPlugin())}),d(1,"i",51),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.button_uninstall")," "))}function hi(t,p){t&1&&d(0,"div",44)}function bi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.doChildBridgeAction("restart"))}),d(1,"i",53),c(2),r(3,"translate"),l()}if(t&2){let e=f(3);n(2),b(" ",s(3,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart")," ")}}function vi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.doChildBridgeAction("stop"))}),d(1,"i",54),c(2),r(3,"translate"),l()}if(t&2){let e=f(3);n(2),b(" ",s(3,1,e.setChildBridges.length>1?"child_bridge.stop_plural":"child_bridge.stop")," ")}}function xi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.doChildBridgeAction("start"))}),d(1,"i",55),c(2),r(3,"translate"),l()}if(t&2){let e=f(3);n(2),b(" ",s(3,1,e.setChildBridges.length>1?"child_bridge.start_plural":"child_bridge.start")," ")}}function wi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.resetChildBridges())}),d(1,"i",56),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"child_bridge.reset_accessories")," "))}function Pi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openBridgeSettings())}),d(1,"i",52),c(2),r(3,"translate"),l(),m(4,bi,4,3,"button",43),m(5,vi,4,3,"button",43),m(6,xi,4,3,"button",43),m(7,wi,4,3,"button",43)}if(t&2){let e=f(2);n(2),b(" ",s(3,5,"child_bridge.bridge_settings")," "),n(2),g(e.childBridgeRestartInProgress?-1:4),n(),g(e.allChildBridgesStopped?-1:5),n(),g(e.allChildBridgesStopped?6:-1),n(),g(e.serviceMode?7:-1)}}function yi(t,p){t&1&&d(0,"div",44)}function Si(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openBridgeSettings())}),d(1,"i",57),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"child_bridge.setup")," "))}function Bi(t,p){t&1&&d(0,"div",44)}function ki(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openBridgeSettings())}),d(1,"i",57),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"child_bridge.setup")," "))}function Ii(t,p){t&1&&d(0,"div",44)}function Ti(t,p){if(t&1&&(a(0,"a",45),d(1,"i",58),c(2),r(3,"translate"),l()),t&2){let e=f(2);C("href",e.plugin.links.bugs,T),n(2),b(" ",s(3,2,"support.links.issue")," ")}}function Vi(t,p){if(t&1){let e=w();a(0,"span",22)(1,"a",38),d(2,"i",39),l(),a(3,"div",40)(4,"button",41),_("click",function(){v(e);let i=f();return x(i.openSettings())}),d(5,"i",42),c(6),r(7,"translate"),l(),m(8,ui,4,3,"button",43),m(9,mi,4,3,"button",43),m(10,gi,4,3,"button",43),m(11,fi,4,3,"button",43),m(12,_i,4,3,"button",43),m(13,Ci,4,3,"button",43),m(14,hi,1,0,"div",44),m(15,Pi,8,7),m(16,yi,1,0,"div",44),m(17,Si,4,3,"button",43),m(18,Bi,1,0,"div",44),m(19,ki,4,3,"button",43),m(20,Ii,1,0,"div",44),m(21,Ti,4,4,"a",45),l()()}if(t&2){let e=f();n(),y("aria-label","Plugin Actions Dropdown"),n(5),b(" ",s(7,16,"plugins.button_settings")," "),n(2),g(e.plugin.isConfigured&&!e.plugin.disabled?8:-1),n(),g(e.plugin.publicPackage?9:-1),n(),g(!e.isMobile&&e.plugin.name!=="homebridge-config-ui-x"?10:-1),n(),g(e.plugin.name!=="homebridge-config-ui-x"&&!e.plugin.disabled?11:-1),n(),g(e.plugin.name!=="homebridge-config-ui-x"&&e.plugin.disabled?12:-1),n(),g(e.plugin.name!=="homebridge-config-ui-x"?13:-1),n(),g(!e.plugin.disabled&&e.plugin.isConfigured&&e.plugin.hasChildBridges&&e.plugin.installedVersion&&e.plugin.name!=="homebridge-config-ui-x"?14:-1),n(),g(e.plugin.hasChildBridges&&!e.plugin.disabled?15:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?16:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?17:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?18:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?19:-1),n(),g(e.plugin.links!=null&&e.plugin.links.bugs?20:-1),n(),g(e.plugin.links!=null&&e.plugin.links.bugs?21:-1)}}var Ee=(()=>{class t{$api=P(L);$md=P(Be);$modal=P(O);$plugin=P(Q);$settings=P(G);$toastr=P(R);$translate=P(q);$ws=P(W);io;plugin;hasChildBridges=!1;hasUnpairedChildBridges=!1;allChildBridgesStopped=!1;childBridgeStatus="pending";childBridgeRestartInProgress=!1;defaultIcon="assets/hb-icon.png";isMobile;setChildBridges=[];hb2Status="unknown";serviceMode=this.$settings.env.serviceMode;set childBridges(e){this.hasChildBridges=e.length>0,this.hasUnpairedChildBridges=e.filter(u=>u.paired===!1).length>0,this.allChildBridgesStopped=e.filter(u=>u.manuallyStopped===!0).length===e.length,this.hasChildBridges&&(e.some(u=>u.status==="down")?this.childBridgeStatus="down":e.some(u=>u.status==="pending")?this.childBridgeStatus="pending":e.some(u=>u.status==="ok")&&(this.childBridgeStatus="ok")),this.setChildBridges=e;let o=this.$settings.env.homebridgeVersion.split(".")[0],i=this.plugin.engines?.homebridge?.split("||").map(u=>u.trim())||[];this.hb2Status=o==="2"?"hide":i.some(u=>u.startsWith("^2")||u.startsWith(">=2"))?"supported":this.hb2Status}ngOnInit(){this.isMobile=this.$md.detect.mobile(),this.io=this.$ws.getExistingNamespace("child-bridges"),this.isMobile&&this.plugin.displayName.toLowerCase().startsWith("homebridge ")&&(this.plugin.displayName=this.plugin.displayName.replace(/^homebridge /i,"")),this.plugin.icon||(this.plugin.icon=this.defaultIcon)}openFundingModal(e){let o=this.$modal.open(Te,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}pluginInfoModal(e){let o=this.$modal.open(Ve,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}disablePlugin(e){let o=this.$modal.open(Ie,{size:"lg",backdrop:"static"});o.componentInstance.pluginName=e.displayName,o.componentInstance.isConfigured=e.isConfigured,o.componentInstance.isConfiguredDynamicPlatform=e.isConfiguredDynamicPlatform,o.result.then(()=>k(this,null,function*(){try{yield D(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/disable`,{})),e.disabled=!0,this.hasChildBridges&&this.doChildBridgeAction("stop"),this.$modal.open(H,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.disable.error"),this.$translate.instant("toast.title_error"))}}))}enablePlugin(e){let o=this.$modal.open(ye,{size:"lg",backdrop:"static"});o.componentInstance.title=e.name,o.componentInstance.message=this.$translate.instant("plugins.manage.confirm_enable",{pluginName:e.displayName}),o.componentInstance.confirmButtonLabel=this.$translate.instant("plugins.manage.enable"),o.componentInstance.faIconClass="fa-circle-play primary-text",o.result.then(()=>k(this,null,function*(){try{yield D(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/enable`,{})),e.disabled=!1,this.hasChildBridges&&(yield this.doChildBridgeAction("start")),this.$modal.open(H,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.enable.error"),this.$translate.instant("toast.title_error"))}}))}viewPluginLog(){let e=this.$modal.open(ke,{size:"xl",backdrop:"static"});e.componentInstance.plugin=this.plugin}doChildBridgeAction(e){return k(this,null,function*(){this.childBridgeRestartInProgress=!0;try{for(let o of this.setChildBridges)yield D(this.io.request(`${e}-child-bridge`,o.username))}catch(o){console.error(o),this.$toastr.error(this.$translate.instant("plugins.bridge.action_error",{action:e}),this.$translate.instant("toast.title_error")),this.childBridgeRestartInProgress=!1}finally{setTimeout(()=>{this.childBridgeRestartInProgress=!1},e==="restart"?12e3:e==="stop"?6e3:1e3)}})}handleIconError(){this.plugin.icon=this.defaultIcon}checkAndUpdatePlugin(){this.$plugin.checkAndUpdatePlugin(this.plugin,this.plugin.latestVersion)}openSettings(){this.$plugin.settings(this.plugin)}openBridgeSettings(){this.$plugin.bridgeSettings(this.plugin)}switchToScoped(){this.$plugin.switchToScoped(this.plugin)}installAlternateVersion(){this.$plugin.installAlternateVersion(this.plugin)}openJsonEditor(){this.$plugin.jsonEditor(this.plugin)}uninstallPlugin(){this.$plugin.uninstallPlugin(this.plugin,this.setChildBridges)}resetChildBridges(){this.$plugin.resetChildBridges(this.setChildBridges)}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["app-plugin-card"]],inputs:{plugin:"plugin",childBridges:"childBridges"},decls:35,vars:23,consts:[[1,"card","card-body","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","me-3","align-items-center","justify-content-between"],["alt","Plugin Icon",1,"plugin-icon-card","mb-3",3,"error","src"],[1,"d-flex","flex-column","justify-content-between",2,"min-width","calc(100% - 80px)"],[1,"d-flex","flex-row","align-items-end"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"card-title","mb-2","text-truncate"],[1,"ms-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"ngbTooltip"],[1,"fas","fa-fw","fa-spinner","fa-pulse","fa-lg","grey-text","ms-3",3,"hidden"],[1,"fas","fa-fw","fa-lg","ms-3",3,"ngClass"],[1,"card-text","mb-2","text-truncate"],["href","javascript:void(0)",1,"card-link",3,"click"],[1,"fas","fa-fw","fa-shield-alt","fa-lg","me-1",3,"ngClass"],[1,"grey-text"],[1,"card-text","mb-2"],["href","javascript:void(0)",1,"card-link"],[1,"card-text","mb-0","grey-text"],["href","javascript:void(0)",1,"card-link","red-text"],["href","javascript:void(0)"],["ngbDropdown","","placement","left",1,"d-inline-block","ms-3","mt-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"click","ngbTooltip"],[1,"far","fa-fw","fa-arrow-alt-circle-up","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-arrow-right-arrow-left","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-sliders","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-bridge","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-qrcode","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1","pink-text"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1",2,"opacity","0.5"],[1,"far","fa-fw","fa-circle-dot","fa-lg","me-1"],[1,"far","fa-fw","fa-circle-check","fa-lg","me-1"],[1,"fas","fa-fw","fa-lg","fa-power-off","ms-3"],["href","javascript:void(0)",1,"card-link","red-text",3,"click"],["container","body","openDelay","150","triggers","hover",1,"far","fa-fw","fa-pause-circle","fa-lg",3,"ngbTooltip"],["href","javascript:void(0)",3,"click"],[1,"far","fa-fw","fa-arrow-alt-circle-down","fa-lg"],["href","javascript:void(0)","ngbDropdownToggle","",1,"card-link","text-decoration-none","mt-auto",2,"outline","none"],[1,"fa-solid","fa-fw","fa-ellipsis-v","fa-lg"],["ngbDropdownMenu","","aria-labelledby","Plugin Actions Dropdown"],["ngbDropdownItem","",3,"click"],[1,"fas","fa-fw","fa-sliders"],["ngbDropdownItem",""],[1,"dropdown-divider"],["ngbDropdownItem","","rel","noopener noreferrer","target","_blank",3,"href"],[1,"fas","fa-fw","fa-wave-square"],[1,"fas","fa-fw","fa-code-compare"],[1,"fas","fa-fw","fa-code"],[1,"far","fa-fw","fa-circle-pause"],[1,"far","fa-fw","fa-circle-play"],[1,"fas","fa-fw","fa-trash"],[1,"fas","fa-fw","fa-bridge"],[1,"fa-fw","icon-button","fas","fa-fw","fa-power-off"],[1,"fas","fa-fw","fa-stop"],[1,"fas","fa-fw","fa-play"],[1,"fas","fa-fw","fa-broom"],[1,"icon-button","fas","fa-fw","fa-bridge"],[1,"icon-button","fa","fa-fw","fa-question-circle-o"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),_("error",function(){return i.handleIconError()}),l()(),a(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"h5",8),c(9),l(),a(10,"div",9),m(11,Ye,4,6,"a",10),m(12,Ze,4,6,"a",10),m(13,ei,4,6,"a",10),m(14,ii,4,6,"a",10),m(15,ti,4,6,"a",10),d(16,"i",11),m(17,ni,1,4,"i",12),l()(),a(18,"p",13)(19,"a",14),_("click",function(){return i.pluginInfoModal(i.plugin)}),d(20,"i",15),a(21,"span",16),c(22),l()()(),a(23,"p",17),m(24,ai,4,1,"a",18),m(25,oi,3,1,"span",16),l(),a(26,"div",7)(27,"p",19),m(28,ri,5,2,"span"),m(29,si,2,1),l(),a(30,"div",9),m(31,di,3,3,"a",10),m(32,pi,3,3,"a",20),m(33,ci,2,0,"a",21),m(34,Vi,22,18,"span",22),l()()()()()()()),o&2&&(n(3),C("src",i.plugin.icon,T),n(6),h(i.plugin.displayName),n(2),g(i.plugin.installedVersion&&i.plugin.updateAvailable&&!i.childBridgeRestartInProgress?11:-1),n(),g(i.plugin.installedVersion&&(i.plugin.newHbScope==null?null:i.plugin.newHbScope.switch)===i.plugin.installedVersion&&!i.childBridgeRestartInProgress?12:-1),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&!i.plugin.isConfigured&&!i.childBridgeRestartInProgress&&!i.plugin.disabled?13:-1),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&!i.plugin.hasChildBridges&&!i.plugin.disabled&&i.plugin.recommendChildBridge&&!i.childBridgeRestartInProgress?14:-1),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&i.hasUnpairedChildBridges&&i.childBridgeStatus==="ok"&&!i.plugin.disabled?15:-1),n(),C("hidden",!i.childBridgeRestartInProgress),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&!i.hasUnpairedChildBridges&&i.childBridgeStatus!=="ok"&&!i.plugin.disabled?17:-1),n(3),C("ngClass",ne(19,Ke,i.plugin.isHbScoped,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),!i.plugin.isHbScoped&&!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin)),n(2),h(i.plugin.name),n(2),g((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?24:-1),n(),g((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?-1:25),n(3),g(i.plugin.publicPackage&&!i.plugin.installedVersion?28:-1),n(),g(i.plugin.installedVersion?29:-1),n(2),g(!i.plugin.disabled&&i.plugin.hasChildBridges&&i.childBridgeStatus==="ok"?31:-1),n(),g(i.plugin.installedVersion&&i.plugin.disabled?32:-1),n(),g(i.plugin.publicPackage&&!i.plugin.installedVersion?33:-1),n(),g(i.plugin.installedVersion?34:-1))},dependencies:[U,M,xe,ve,be,he,Ce,oe,B],encapsulation:2})}return t})();var Me=(()=>{class t{$activeModal=P($);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],decls:27,vars:21,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"mb-0"],[3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),r(5,"translate"),l(),a(6,"button",3),r(7,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(8,"div",4)(9,"div",5),d(10,"i",6),l(),a(11,"ul",7),d(12,"li",8),r(13,"translate"),d(14,"li",8),r(15,"translate"),d(16,"li",8),r(17,"translate"),d(18,"li",8),r(19,"translate"),l()(),a(20,"div",9),d(21,"div",10),a(22,"div",11)(23,"button",12),_("click",function(){return i.dismissModal()}),c(24),r(25,"translate"),l()(),d(26,"div",13),l()()()),o&2&&(n(4),h(s(5,7,"support.title")),n(2),y("aria-label",s(7,9,"form.button_close")),n(6),C("innerHTML",s(13,11,"plugins.support.list_1"),N),n(2),C("innerHTML",s(15,13,"plugins.support.list_2"),N),n(2),C("innerHTML",s(17,15,"plugins.support.list_3"),N),n(2),C("innerHTML",s(19,17,"plugins.support.list_4"),N),n(6),b(" ",s(25,19,"form.button_close")," "))},dependencies:[B],encapsulation:2})}return t})();var Ei=["searchInput"],Mi=(t,p)=>({"fa-magnifying-glass":t,"fa-exclamation-circle":p});function $i(t,p){t&1&&d(0,"app-spinner")}function Di(t,p){if(t&1){let e=w();a(0,"a",15),_("click",function(){v(e);let i=f(3);return x(i.onClearSearch())}),d(1,"i",16),l()}}function Ni(t,p){if(t&1){let e=w();a(0,"div",9)(1,"div",11)(2,"form",12),_("ngSubmit",function(){v(e);let i=f(2);return x(i.onSubmit(i.form))}),d(3,"input",13,0),r(5,"translate"),m(6,Di,2,0,"a",14),l()()()}if(t&2){let e=f(2);n(2),C("formGroup",e.form),n(),C("placeholder",s(5,3,"plugins.placeholder_search_plugin")),n(3),g(e.showExitButton?6:-1)}}function Hi(t,p){if(t&1&&(a(0,"div",17),d(1,"app-plugin-card",19),l()),t&2){let e=p.$implicit,o=f(3);n(),C("plugin",e)("childBridges",o.getPluginChildBridges(e))}}function Ai(t,p){if(t&1&&(a(0,"div",18),d(1,"i",20),a(2,"p"),c(3),r(4,"translate"),l()()),t&2){let e=f(3);n(),C("ngClass",I(4,Mi,!e.showExitButton,e.showExitButton)),n(2),h(s(4,2,e.showExitButton?"plugins.placeholder_search_none":"plugins.placeholder_search_first"))}}function ji(t,p){if(t&1&&(a(0,"div",10),F(1,Hi,2,2,"div",17,j),m(3,Ai,5,7,"div",18),l()),t&2){let e=f(2);n(),z(e.installedPlugins),n(2),g(e.installedPlugins.length===0&&!e.loading&&!e.mainError?3:-1)}}function Fi(t,p){if(t&1&&(m(0,Ni,7,5,"div",9),m(1,ji,4,1,"div",10)),t&2){let e=f();g(e.showSearchBar?0:-1),n(),g(e.loading?-1:1)}}function zi(t,p){t&1&&(a(0,"div",21)(1,"div",22)(2,"code"),c(3,"https://developers.homebridge.io/analytics "),a(4,"a",23),d(5,"i",24),l()()(),a(6,"div",25),c(7),r(8,"translate"),l()(),d(9,"iframe",26)),t&2&&(n(7),h(s(8,1,"plugins.stats_note")))}var Yt=(()=>{class t{searchInput;$api=P(L);$modal=P(O);$plugin=P(Q);$router=P(Pe);$settings=P(G);$toastr=P(R);$translate=P(q);$ws=P(W);isSearchMode=!1;io;navigationSubscription;mainError=!1;loading=!0;tab="main";installedPlugins=[];childBridges=[];showSearchBar=!1;showExitButton=!1;form=new de({query:new pe("")});ngOnInit(){return k(this,null,function*(){this.io=this.$ws.connectToNamespace("child-bridges"),this.io.connected.subscribe(()=>k(this,null,function*(){this.getChildBridgeMetadata(),this.io.socket.emit("monitor-child-bridge-status"),yield this.loadInstalledPlugins(),this.installedPlugins.length||this.showSearch();let{action:e,plugin:o}=this.$router.parseUrl(this.$router.url).queryParams;if(e){let i=this.installedPlugins.find(u=>u.name===o);switch(e){case"just-installed":{i&&(i.isConfigured?this.$modal.open(H,{size:"lg",backdrop:"static"}):this.$plugin.settings(i));break}case"open-manage-version":{i&&this.$plugin.installAlternateVersion(i);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}})),this.io.socket.on("child-bridge-status-update",e=>{let o=this.childBridges.find(i=>i.username===e.username);o?Object.assign(o,e):this.childBridges.push(e)}),this.navigationSubscription=this.$router.events.subscribe(e=>{e instanceof we&&this.loadInstalledPlugins()})})}search(){this.installedPlugins=[],this.loading=!0,this.showExitButton=!0,this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({next:e=>{let o=new Set;this.installedPlugins=e.reduce((i,u)=>{if(u.name==="homebridge-config-ui-x"||o.has(u.name))return i;if(u.newHbScope){let Y=u.newHbScope.to,$e=e.some(De=>De.name===Y);(u.installedVersion||!$e)&&(o.add(Y),i.push(u))}else i.push(u);return i},[]),this.appendMetaInfo(),this.loading=!1},error:e=>{this.loading=!1,this.isSearchMode=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error")),this.loadInstalledPlugins()}})}onClearSearch(){this.loadInstalledPlugins()}onSubmit({value:e}){e.query.length?(this.isSearchMode=!0,this.search()):this.isSearchMode&&(this.isSearchMode=!1,this.loadInstalledPlugins())}showSearch(){this.showSearchBar?(this.showSearchBar=!1,this.isSearchMode&&(this.isSearchMode=!1,this.form.setValue({query:""}),this.loadInstalledPlugins())):(window.document.querySelector("body").classList.remove("bg-black"),this.tab="main",this.showSearchBar=!0,setTimeout(()=>this.searchInput.nativeElement.focus(),0))}showStats(){this.tab==="stats"?(window.document.querySelector("body").classList.remove("bg-black"),this.tab="main"):(window.document.querySelector("body").classList.add("bg-black"),this.tab="stats",this.showSearchBar=!1)}openSupport(){this.$modal.open(Me,{size:"lg",backdrop:"static"})}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.navigationSubscription&&this.navigationSubscription.unsubscribe(),this.io.end()}getPluginChildBridges(e){return this.childBridges.filter(o=>o.plugin===e.name)}loadInstalledPlugins(){return k(this,null,function*(){this.form.setValue({query:""}),this.showExitButton=!1,this.installedPlugins=[],this.loading=!0,this.mainError=!1;try{let e=yield D(this.$api.get("/plugins"));this.installedPlugins=e.filter(i=>i.name!=="homebridge-config-ui-x"),yield this.appendMetaInfo();let o=this.installedPlugins.sort((i,u)=>i.updateAvailable!==u.updateAvailable?i.updateAvailable?-1:1:i.newHbScope&&!u.newHbScope?-1:i.disabled!==u.disabled?i.disabled?1:-1:i.isConfigured!==u.isConfigured?i.isConfigured?1:-1:i.hasChildBridgesUnpaired!==u.hasChildBridgesUnpaired?i.hasChildBridgesUnpaired?-1:1:i.hasChildBridges!==u.hasChildBridges&&this.$settings.env.recommendChildBridges?i.hasChildBridges?1:-1:i.name.localeCompare(u.name));return this.loading=!1,o}catch(e){console.error(e),this.loading=!1,this.mainError=!0,this.$toastr.error(this.$translate.instant("plugins.toast_failed_to_load_plugins"),this.$translate.instant("toast.title_error"))}})}appendMetaInfo(){return k(this,null,function*(){yield Promise.all(this.installedPlugins.filter(e=>e.installedVersion).map(e=>k(this,null,function*(){try{let o=yield D(this.$api.get(`/config-editor/plugin/${encodeURIComponent(e.name)}`));e.isConfigured=o.length>0,e.isConfiguredDynamicPlatform=e.isConfigured&&Object.prototype.hasOwnProperty.call(o[0],"platform"),e.recommendChildBridge=e.isConfiguredDynamicPlatform&&this.$settings.env.recommendChildBridges&&this.$settings.env.serviceMode&&!["homebridge","homebridge-config-ui-x"].includes(e.name),e.hasChildBridges=e.isConfigured&&o.some(u=>u._bridge&&u._bridge.username);let i=this.getPluginChildBridges(e);e.hasChildBridgesUnpaired=i.some(u=>!u.paired),this.$settings.env.plugins?.hideUpdatesFor?.includes(e.name)&&(e.updateAvailable=!1)}catch{e.isConfigured=!0,e.hasChildBridges=!0}})))})}getChildBridgeMetadata(){this.io.request("get-homebridge-child-bridge-status").subscribe(e=>{this.childBridges=e})}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],viewQuery:function(o,i){if(o&1&&ee(Ei,5),o&2){let u;ie(u=te())&&(i.searchInput=u.first)}},decls:20,vars:26,consts:[["searchInput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","ngbTooltip"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2","d-none","d-md-inline-block",3,"click","ngbTooltip"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"row"],[1,"d-flex","flex-wrap","justify-content-between"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","formControlName","query",1,"hb-npm-search",3,"placeholder"],["href","javascript:void(0)",1,"hb-npm-search-clear"],["href","javascript:void(0)",1,"hb-npm-search-clear",3,"click"],[1,"far","fa-fw","fa-times-circle"],[1,"hb-plugin-space-between"],[1,"alert","alert-info","mt-4","text-center","w-100"],[3,"plugin","childBridges"],[1,"fas","fa-fw","primary-text","my-3",2,"font-size","75px",3,"ngClass"],[1,"w-100","py-3","hb-stats-header","text-white","text-center"],[1,"mb-2"],["href","https://developers.homebridge.io/analytics","target","_blank"],[1,"fa","fa-fw","fa-external-link"],[1,"small","grey-text"],["src",Z`https://developers.homebridge.io/analytics/`,"sandbox","allow-scripts allow-same-origin allow-popups","referrerpolicy","no-referrer",1,"hb-stats"]],template:function(o,i){o&1&&(m(0,$i,1,0,"app-spinner"),a(1,"div",1)(2,"div",2)(3,"h3",3),c(4),r(5,"translate"),l()(),a(6,"div",4)(7,"button",5),r(8,"translate"),r(9,"translate"),_("click",function(){return i.showSearch()}),d(10,"i"),l(),a(11,"button",6),r(12,"translate"),r(13,"translate"),_("click",function(){return i.showStats()}),d(14,"i"),l(),a(15,"button",7),r(16,"translate"),_("click",function(){return i.openSupport()}),d(17,"i",8),l()()(),m(18,Fi,2,2)(19,zi,10,3)),o&2&&(g(i.loading?0:-1),n(4),h(s(5,14,"menu.label_plugins")),n(3),C("ngbTooltip",s(8,16,"plugins.search")),y("aria-label",s(9,18,"plugins.search")),n(3),J(K("fas fa-fw",i.showSearchBar?" primary-text":""," fa-search")),n(),C("ngbTooltip",s(12,20,"plugins.stats")),y("aria-label",s(13,22,"plugins.stats")),n(3),J(K("fas fa-fw",i.tab==="stats"?" primary-text":""," fa-sliders")),n(),y("aria-label",s(16,24,"support.title")),n(3),g(i.tab==="main"?18:i.tab==="stats"?19:-1))},dependencies:[Se,ge,ce,le,re,se,fe,ue,me,Ee,B,M,U],styles:[".hb-npm-search[_ngcontent-%COMP%]{outline:none;box-sizing:inherit!important;background-color:inherit;height:50px!important;width:100%;border-width:.5px;padding:10px;margin-bottom:15px}@media (hover: hover){.hb-npm-search[_ngcontent-%COMP%]:hover{border:1px solid #000000}}.hb-npm-search[_ngcontent-%COMP%]:focus{border:1px solid #000000;box-shadow:0 1px #000}.hb-npm-search-clear[_ngcontent-%COMP%]{position:absolute;right:25px;font-size:35px;color:#d0d0d0;line-height:50px;cursor:pointer}.hb-plugin-space-between[_ngcontent-%COMP%]{box-sizing:border-box;width:calc(50% - 6.6666666667px)}@media only screen and (max-width: 991px){.hb-plugin-space-between[_ngcontent-%COMP%]{width:100%}}.hb-stats-header[_ngcontent-%COMP%]{background:#242424;border-top-left-radius:.5rem;border-top-right-radius:.5rem}.hb-stats-header[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{border:1px solid grey;border-radius:5px;padding:5px;font-size:.8rem;color:#d3d3d3}.hb-stats[_ngcontent-%COMP%]{height:calc(100% - 121px);width:100%;overflow:hidden;border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}@media (max-width: 767px){.hb-stats[_ngcontent-%COMP%]{height:calc(100% - 60px)}}"]})}return t})();export{Yt as PluginsComponent};
|
|
1
|
+
import{a as Se}from"./chunk-F3ERQJVG.js";import{l as ke,n as Q}from"./chunk-7BUCG6U5.js";import{a as H}from"./chunk-UQYCFN3T.js";import"./chunk-GDFV4BMO.js";import{a as Be}from"./chunk-NGNQPAAK.js";import"./chunk-QDCKP2LU.js";import"./chunk-IJ2NROJY.js";import"./chunk-UD6SVFW2.js";import"./chunk-7EQ4BJZB.js";import"./chunk-EGCUYKRH.js";import{a as ye}from"./chunk-TQNKRJOX.js";import{g as _e,h as Ce,i as he,j as be,k as ve,l as xe,m as $,n as O,t as U}from"./chunk-CF2ZN7LY.js";import{A as fe,c as le,e as re,f as se,g as de,j as pe,m as ce,p as ue,q as me,z as ge}from"./chunk-T252YJXA.js";import{a as W}from"./chunk-QOGMJZDE.js";import"./chunk-YBXEOSR6.js";import{a as we,d as Pe}from"./chunk-X7PVYZAE.js";import{b as G}from"./chunk-LNUVGJNE.js";import{k as R,n as L}from"./chunk-APTNRLSD.js";import{a as q,b as B}from"./chunk-LXXELGX4.js";import"./chunk-SRP6QX5M.js";import{Bc as r,Cc as s,Dc as E,Hb as y,Ib as m,Jb as g,Lb as j,Mb as F,Nb as z,Ob as C,Pb as a,Qb as l,Rb as d,Vb as w,Xa as N,Ya as T,Yb as _,Za as Z,Zb as f,ab as n,bc as ee,cc as ie,cd as M,dc as te,fd as ae,h as k,jc as J,jd as oe,kc as c,la as P,lc as h,mb as S,mc as b,ra as v,sa as x,uc as K,w as D,xc as V,yc as I,zc as ne}from"./chunk-SKZUTSHE.js";var Ne=t=>({pluginName:t});function He(t,p){t&1&&(a(0,"ul",7)(1,"li"),c(2),r(3,"translate"),l(),a(4,"li"),c(5),r(6,"translate"),l()()),t&2&&(n(2),h(s(3,2,"plugins.manage.confirm_disable_accessory_1")),n(3),h(s(6,4,"plugins.manage.confirm_disable_accessory_2")))}function Ae(t,p){t&1&&(a(0,"ul",7)(1,"li"),c(2),r(3,"translate"),l(),a(4,"li"),c(5),r(6,"translate"),l()()),t&2&&(n(2),h(s(3,2,"plugins.manage.confirm_disable_platform_1")),n(3),h(s(6,4,"plugins.manage.confirm_disable_platform_2")))}var Ie=(()=>{class t{$activeModal=P($);pluginName;isConfigured=!1;isConfiguredDynamicPlatform=!1;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(){this.$activeModal.close()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{pluginName:"pluginName",isConfigured:"isConfigured",isConfiguredDynamicPlatform:"isConfiguredDynamicPlatform"},decls:26,vars:22,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"mb-3","text-center"],[1,"fas","fa-fw","fa-circle-pause","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","warning",1,"mb-0",3,"dismissible"],[1,"w-100","text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),c(3),l(),a(4,"button",3),r(5,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(6,"div",4)(7,"div",5),d(8,"i",6),l(),m(9,He,7,6,"ul",7),m(10,Ae,7,6,"ul",7),a(11,"ngb-alert",8)(12,"p",9),c(13),r(14,"translate"),l()()(),a(15,"div",10)(16,"div",11)(17,"button",12),r(18,"translate"),_("click",function(){return i.dismissModal()}),c(19),r(20,"translate"),l()(),d(21,"div",13),a(22,"div",14)(23,"button",15),_("click",function(){return i.closeModal()}),c(24),r(25,"translate"),l()()()()),o&2&&(n(3),h(i.pluginName),n(),y("aria-label",s(5,9,"form.button_close")),n(5),g(i.isConfigured&&!i.isConfiguredDynamicPlatform?9:-1),n(),g(i.isConfigured&&i.isConfiguredDynamicPlatform?10:-1),n(),C("dismissible",!1),n(2),h(E(14,11,"plugins.manage.confirm_disable",V(20,Ne,i.pluginName))),n(4),y("aria-label",s(18,14,"form.button_close")),n(2),b(" ",s(20,16,"form.button_close")," "),n(5),b(" ",s(25,18,"plugins.manage.disable")," "))},dependencies:[_e,B],encapsulation:2})}return t})();var je=t=>({author:t});function Fe(t,p){if(t&1&&(a(0,"li",9),d(1,"i",15),a(2,"a",16),c(3),l()()),t&2){let e=p.$implicit,o=f();n(),C("ngClass",o.getIconClass(e.type)),n(),C("href",e.url,T),n(),h(e.url)}}var Te=(()=>{class t{$activeModal=P($);plugin;fundingOptions;ngOnInit(){this.plugin.funding||this.$activeModal.close(),this.plugin.name==="homebridge-config-ui-x"&&(this.plugin.author="oznu"),Array.isArray(this.plugin.funding)?this.fundingOptions=this.plugin.funding.map(e=>{if(typeof e=="string")return{type:"other",url:e};if(typeof e=="object")return{type:e.type||"other",url:e.url}}):typeof this.plugin.funding=="string"?this.fundingOptions=[{type:"other",url:this.plugin.funding}]:typeof this.plugin.funding=="object"&&(this.fundingOptions=[{type:this.plugin.funding.type||"other",url:this.plugin.funding.url}])}getIconClass(e){switch(e.toLowerCase()){case"paypal":return"fab fa-fw fa-paypal";case"github":return"fab fa-fw fa-github";case"patreon":return"fab fa-fw fa-patreon";case"kofi":case"ko-fi":return"fas fa-fw fa-coffee";default:return"fas fa-fw fa-link"}}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:28,vars:21,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","pink-text","mb-3"],[1,"fas","fa-fw","fa-heart",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"],[1,"me-2","primary-text","fa-fw","fa-xl",3,"ngClass"],["target","_blank","rel","noopener noreferrer",1,"text-break-all",3,"href"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),c(3),r(4,"translate"),l(),a(5,"button",3),r(6,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(7,"div",4)(8,"div",5),d(9,"i",6),l(),a(10,"ul",7)(11,"li"),c(12),r(13,"translate"),l(),a(14,"li"),c(15),r(16,"translate"),l()(),a(17,"ul",8),F(18,Fe,4,3,"li",9,j),l()(),a(20,"div",10),d(21,"div",11),a(22,"div",12)(23,"button",13),r(24,"translate"),_("click",function(){return i.dismissModal()}),c(25),r(26,"translate"),l()(),d(27,"div",14),l()()),o&2&&(n(3),h(E(4,6,"plugins.donate.tile_donate_to",V(19,je,"@"+i.plugin.author))),n(2),y("aria-label",s(6,9,"form.button_close")),n(7),h(s(13,11,"plugins.donate.message_1")),n(3),h(s(16,13,"plugins.donate.message_2")),n(3),z(i.fundingOptions),n(5),y("aria-label",s(24,15,"form.button_close")),n(2),b(" ",s(26,17,"form.button_close")," "))},dependencies:[M,B],styles:[".text-break-all[_ngcontent-%COMP%]{word-break:break-all}"]})}return t})();var ze=(t,p)=>({"orange-text":t,"grey-text":p}),X=t=>({opacity:t}),Oe=(t,p)=>({"green-text":t,"grey-text":p}),Ue=(t,p)=>({"purple-text":t,"grey-text":p}),qe=(t,p)=>({scopedLink:t,verifiedLink:p});function Re(t,p){t&1&&(a(0,"h6",18),c(1),r(2,"translate"),l(),a(3,"p",19),c(4),r(5,"translate"),l(),a(6,"p",19),c(7),r(8,"translate"),l()),t&2&&(n(),h(s(2,3,"plugins.manage.scoped_subtitle")),n(3),h(s(5,5,"plugins.manage.scoped_message")),n(3),h(s(8,7,"plugins.manage.verified_message")))}function Le(t,p){t&1&&(a(0,"h6",18),c(1),r(2,"translate"),l(),a(3,"p",19),c(4),r(5,"translate"),l()),t&2&&(n(),h(s(2,2,"plugins.manage.verified_subtitle")),n(3),h(s(5,4,"plugins.manage.verified_message")))}function Ge(t,p){t&1&&(a(0,"h6",18),c(1),r(2,"translate"),l(),a(3,"p",19),c(4),r(5,"translate"),l()),t&2&&(n(),h(s(2,2,"plugins.manage.unverified_subtitle")),n(3),h(s(5,4,"plugins.manage.unverified_message")))}function We(t,p){if(t&1){let e=w();a(0,"button",20),_("click",function(){v(e);let i=f();return x(i.dismissModal())}),c(1),r(2,"translate"),l()}t&2&&(n(),b(" ",s(2,1,"form.button_close")," "))}function Qe(t,p){if(t&1){let e=w();a(0,"button",20),_("click",function(){v(e);let i=f();return x(i.dismissModal())}),c(1),r(2,"translate"),l()}t&2&&(n(),b(" ",s(2,1,"form.button_close")," "))}function Je(t,p){if(t&1&&(a(0,"a",17),c(1),r(2,"translate"),d(3,"i",21),l()),t&2){let e=f();C("href",e.plugin.links.homepage||e.plugin.links.npm,T),n(),b(" ",s(2,2,"plugins.button_homepage")," ")}}var Ve=(()=>{class t{$activeModal=P($);plugin;defaultIcon="assets/hb-icon.png";linkScoped='<a href="https://github.com/homebridge/plugins/wiki/Scoped-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';linkVerified='<a href="https://github.com/homebridge/plugins/wiki/Verified-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';ngOnInit(){this.plugin.icon||(this.plugin.icon=this.defaultIcon)}handleIconError(){this.plugin.icon=this.defaultIcon}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:32,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],["alt","Plugin Icon",1,"mb-3","plugin-icon-card",3,"error","src"],[1,"mb-1"],[1,"grey-text","mb-0","font-monospace"],[1,"grey-text","mb-1","font-monospace"],[1,"mb-3"],[1,"fas","fa-fw","fa-shield-alt","mb-3",2,"font-size","48px",3,"ngClass","ngStyle"],[1,"mb-0","grey-text",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[1,"mb-2"],[1,"mb-1","grey-text"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),c(3),r(4,"translate"),l(),a(5,"button",3),r(6,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(7,"div",4)(8,"img",5),_("error",function(){return i.handleIconError()}),l(),a(9,"h4",6),c(10),l(),a(11,"p",7),c(12),l(),a(13,"p",8),c(14),l(),a(15,"p",9),c(16),l(),d(17,"i",10)(18,"i",10)(19,"i",10),m(20,Re,9,9),m(21,Le,6,6),m(22,Ge,6,6),d(23,"p",11),r(24,"translate"),l(),a(25,"div",12)(26,"div",13),m(27,We,3,3,"button",14),l(),a(28,"div",15),m(29,Qe,3,3,"button",14),l(),a(30,"div",16),m(31,Je,4,4,"a",17),l()()()),o&2&&(n(3),h(s(4,20,"plugins.manage.information")),n(2),y("aria-label",s(6,22,"form.button_close")),n(3),C("src",i.plugin.icon,T),n(2),h(i.plugin.displayName),n(2),h(i.plugin.name),n(2),b("@",i.plugin.author),n(2),h(i.plugin.description),n(),C("ngClass",I(27,ze,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin,i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin))("ngStyle",V(30,X,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?1:.25)),n(),C("ngClass",I(32,Oe,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),i.plugin.isHbScoped||!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin))("ngStyle",V(35,X,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?1:.25)),n(),C("ngClass",I(37,Ue,i.plugin.isHbScoped,!i.plugin.isHbScoped))("ngStyle",V(40,X,i.plugin.isHbScoped?1:.25)),n(),g(i.plugin.isHbScoped?20:-1),n(),g(!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?21:-1),n(),g(!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?22:-1),n(),C("innerHTML",E(24,24,"plugins.manage.more_info",I(42,qe,i.linkScoped,i.linkVerified)),N),n(4),g(i.plugin.links.homepage||i.plugin.links.npm?27:-1),n(2),g(!i.plugin.links.homepage&&!i.plugin.links.npm?29:-1),n(2),g(i.plugin.links.homepage||i.plugin.links.npm?31:-1))},dependencies:[B,M,ae],styles:[".plugin-icon[_ngcontent-%COMP%]{height:75px;width:75px;border-radius:15px;border:1px solid #222222}"]})}return t})();var Ke=(t,p,e)=>({"purple-text":t,"green-text":p,"orange-text":e}),Xe=(t,p)=>({"fa-bridge-circle-exclamation orange-text":t,"fa-bridge-circle-xmark red-text":p});function Ye(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.checkAndUpdatePlugin())}),d(3,"i",24),l()}t&2&&(C("ngbTooltip",s(1,2,"plugins.button_update")),y("aria-label",s(2,4,"plugins.button_update")))}function Ze(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.switchToScoped())}),d(3,"i",25),l()}t&2&&(C("ngbTooltip",s(1,2,"plugins.manage.scoped.switch")),y("aria-label",s(2,4,"plugins.manage.scoped.switch")))}function ei(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.openSettings())}),d(3,"i",26),l()}t&2&&(C("ngbTooltip",s(1,2,"plugins.button_set_up")),y("aria-label",s(2,4,"plugins.button_set_up")))}function ii(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.openBridgeSettings())}),d(3,"i",27),l()}t&2&&(C("ngbTooltip",s(1,2,"child_bridge.setup")),y("aria-label",s(2,4,"child_bridge.setup")))}function ti(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),r(2,"translate"),_("click",function(){v(e);let i=f();return x(i.openBridgeSettings())}),d(3,"i",28),l()}t&2&&(C("ngbTooltip",s(1,2,"child_bridge.bridge_connect")),y("aria-label",s(2,4,"child_bridge.bridge_connect")))}function ni(t,p){if(t&1&&d(0,"i",12),t&2){let e=f();C("ngClass",I(1,Xe,e.childBridgeStatus==="pending",e.childBridgeStatus==="down"))}}function ai(t,p){if(t&1){let e=w();a(0,"a",14),_("click",function(){v(e);let i=f();return x(i.openFundingModal(i.plugin))}),d(1,"i",29),a(2,"span",16),c(3),l()()}if(t&2){let e=f();n(3),b("@",e.plugin.author)}}function oi(t,p){if(t&1&&(a(0,"span",16),d(1,"i",30),c(2),l()),t&2){let e=f();n(2),b("@",e.plugin.author," ")}}function li(t,p){if(t&1&&(a(0,"span"),c(1),r(2,"date"),l()),t&2){let e=f(2);n(),b("(",E(2,1,e.plugin.lastUpdated,"yyyy-MM-dd"),")")}}function ri(t,p){if(t&1&&(a(0,"span"),d(1,"i",31),a(2,"span",16),c(3),m(4,li,3,4,"span"),l()()),t&2){let e=f();n(3),b("v",e.plugin.latestVersion," "),n(),g(e.plugin.lastUpdated?4:-1)}}function si(t,p){if(t&1&&(d(0,"i",32),c(1)),t&2){let e=f();n(),b("v",e.plugin.installedVersion," ")}}function di(t,p){if(t&1){let e=w();a(0,"a",23),r(1,"translate"),_("click",function(){v(e);let i=f();return x(i.doChildBridgeAction("restart"))}),d(2,"i",33),l()}if(t&2){let e=f();C("ngbTooltip",s(1,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart"))}}function pi(t,p){if(t&1){let e=w();a(0,"a",34),_("click",function(){v(e);let i=f();return x(i.enablePlugin(i.plugin))}),d(1,"i",35),r(2,"translate"),l()}t&2&&(n(),C("ngbTooltip",s(2,1,"plugins.status_disabled")))}function ci(t,p){if(t&1){let e=w();a(0,"a",36),_("click",function(){v(e);let i=f();return x(i.installAlternateVersion())}),d(1,"i",37),l()}}function ui(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.viewPluginLog())}),d(1,"i",46),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.plugin_logs")," "))}function mi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.installAlternateVersion())}),d(1,"i",47),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.manage_version")," "))}function gi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openJsonEditor())}),d(1,"i",48),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.json_config")," "))}function fi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.disablePlugin(i.plugin))}),d(1,"i",49),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.disable")," "))}function _i(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.enablePlugin(i.plugin))}),d(1,"i",50),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.manage.enable")," "))}function Ci(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.uninstallPlugin())}),d(1,"i",51),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"plugins.button_uninstall")," "))}function hi(t,p){t&1&&d(0,"div",44)}function bi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.doChildBridgeAction("restart"))}),d(1,"i",53),c(2),r(3,"translate"),l()}if(t&2){let e=f(3);n(2),b(" ",s(3,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart")," ")}}function vi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.doChildBridgeAction("stop"))}),d(1,"i",54),c(2),r(3,"translate"),l()}if(t&2){let e=f(3);n(2),b(" ",s(3,1,e.setChildBridges.length>1?"child_bridge.stop_plural":"child_bridge.stop")," ")}}function xi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.doChildBridgeAction("start"))}),d(1,"i",55),c(2),r(3,"translate"),l()}if(t&2){let e=f(3);n(2),b(" ",s(3,1,e.setChildBridges.length>1?"child_bridge.start_plural":"child_bridge.start")," ")}}function wi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(3);return x(i.resetChildBridges())}),d(1,"i",56),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"child_bridge.reset_accessories")," "))}function Pi(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openBridgeSettings())}),d(1,"i",52),c(2),r(3,"translate"),l(),m(4,bi,4,3,"button",43),m(5,vi,4,3,"button",43),m(6,xi,4,3,"button",43),m(7,wi,4,3,"button",43)}if(t&2){let e=f(2);n(2),b(" ",s(3,5,"child_bridge.bridge_settings")," "),n(2),g(e.childBridgeRestartInProgress?-1:4),n(),g(e.allChildBridgesStopped?-1:5),n(),g(e.allChildBridgesStopped?6:-1),n(),g(e.serviceMode?7:-1)}}function yi(t,p){t&1&&d(0,"div",44)}function Si(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openBridgeSettings())}),d(1,"i",57),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"child_bridge.setup")," "))}function Bi(t,p){t&1&&d(0,"div",44)}function ki(t,p){if(t&1){let e=w();a(0,"button",41),_("click",function(){v(e);let i=f(2);return x(i.openBridgeSettings())}),d(1,"i",57),c(2),r(3,"translate"),l()}t&2&&(n(2),b(" ",s(3,1,"child_bridge.setup")," "))}function Ii(t,p){t&1&&d(0,"div",44)}function Ti(t,p){if(t&1&&(a(0,"a",45),d(1,"i",58),c(2),r(3,"translate"),l()),t&2){let e=f(2);C("href",e.plugin.links.bugs,T),n(2),b(" ",s(3,2,"support.links.issue")," ")}}function Vi(t,p){if(t&1){let e=w();a(0,"span",22)(1,"a",38),d(2,"i",39),l(),a(3,"div",40)(4,"button",41),_("click",function(){v(e);let i=f();return x(i.openSettings())}),d(5,"i",42),c(6),r(7,"translate"),l(),m(8,ui,4,3,"button",43),m(9,mi,4,3,"button",43),m(10,gi,4,3,"button",43),m(11,fi,4,3,"button",43),m(12,_i,4,3,"button",43),m(13,Ci,4,3,"button",43),m(14,hi,1,0,"div",44),m(15,Pi,8,7),m(16,yi,1,0,"div",44),m(17,Si,4,3,"button",43),m(18,Bi,1,0,"div",44),m(19,ki,4,3,"button",43),m(20,Ii,1,0,"div",44),m(21,Ti,4,4,"a",45),l()()}if(t&2){let e=f();n(),y("aria-label","Plugin Actions Dropdown"),n(5),b(" ",s(7,16,"plugins.button_settings")," "),n(2),g(e.plugin.isConfigured&&!e.plugin.disabled?8:-1),n(),g(e.plugin.publicPackage?9:-1),n(),g(!e.isMobile&&e.plugin.name!=="homebridge-config-ui-x"?10:-1),n(),g(e.plugin.name!=="homebridge-config-ui-x"&&!e.plugin.disabled?11:-1),n(),g(e.plugin.name!=="homebridge-config-ui-x"&&e.plugin.disabled?12:-1),n(),g(e.plugin.name!=="homebridge-config-ui-x"?13:-1),n(),g(!e.plugin.disabled&&e.plugin.isConfigured&&e.plugin.hasChildBridges&&e.plugin.installedVersion&&e.plugin.name!=="homebridge-config-ui-x"?14:-1),n(),g(e.plugin.hasChildBridges&&!e.plugin.disabled?15:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?16:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?17:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?18:-1),n(),g(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?19:-1),n(),g(e.plugin.links!=null&&e.plugin.links.bugs?20:-1),n(),g(e.plugin.links!=null&&e.plugin.links.bugs?21:-1)}}var Ee=(()=>{class t{$api=P(L);$md=P(Be);$modal=P(O);$plugin=P(Q);$settings=P(G);$toastr=P(R);$translate=P(q);$ws=P(W);io;plugin;hasChildBridges=!1;hasUnpairedChildBridges=!1;allChildBridgesStopped=!1;childBridgeStatus="pending";childBridgeRestartInProgress=!1;defaultIcon="assets/hb-icon.png";isMobile;setChildBridges=[];hb2Status="unknown";serviceMode=this.$settings.env.serviceMode;set childBridges(e){this.hasChildBridges=e.length>0,this.hasUnpairedChildBridges=e.filter(u=>u.paired===!1).length>0,this.allChildBridgesStopped=e.filter(u=>u.manuallyStopped===!0).length===e.length,this.hasChildBridges&&(e.some(u=>u.status==="down")?this.childBridgeStatus="down":e.some(u=>u.status==="pending")?this.childBridgeStatus="pending":e.some(u=>u.status==="ok")&&(this.childBridgeStatus="ok")),this.setChildBridges=e;let o=this.$settings.env.homebridgeVersion.split(".")[0],i=this.plugin.engines?.homebridge?.split("||").map(u=>u.trim())||[];this.hb2Status=o==="2"?"hide":i.some(u=>u.startsWith("^2")||u.startsWith(">=2"))?"supported":this.hb2Status}ngOnInit(){this.isMobile=this.$md.detect.mobile(),this.io=this.$ws.getExistingNamespace("child-bridges"),this.isMobile&&this.plugin.displayName.toLowerCase().startsWith("homebridge ")&&(this.plugin.displayName=this.plugin.displayName.replace(/^homebridge /i,"")),this.plugin.icon||(this.plugin.icon=this.defaultIcon)}openFundingModal(e){let o=this.$modal.open(Te,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}pluginInfoModal(e){let o=this.$modal.open(Ve,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}disablePlugin(e){let o=this.$modal.open(Ie,{size:"lg",backdrop:"static"});o.componentInstance.pluginName=e.displayName,o.componentInstance.isConfigured=e.isConfigured,o.componentInstance.isConfiguredDynamicPlatform=e.isConfiguredDynamicPlatform,o.result.then(()=>k(this,null,function*(){try{yield D(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/disable`,{})),e.disabled=!0,this.hasChildBridges&&this.doChildBridgeAction("stop"),this.$modal.open(H,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.disable.error"),this.$translate.instant("toast.title_error"))}}))}enablePlugin(e){let o=this.$modal.open(ye,{size:"lg",backdrop:"static"});o.componentInstance.title=e.name,o.componentInstance.message=this.$translate.instant("plugins.manage.confirm_enable",{pluginName:e.displayName}),o.componentInstance.confirmButtonLabel=this.$translate.instant("plugins.manage.enable"),o.componentInstance.faIconClass="fa-circle-play primary-text",o.result.then(()=>k(this,null,function*(){try{yield D(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/enable`,{})),e.disabled=!1,this.hasChildBridges&&(yield this.doChildBridgeAction("start")),this.$modal.open(H,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.enable.error"),this.$translate.instant("toast.title_error"))}}))}viewPluginLog(){let e=this.$modal.open(ke,{size:"xl",backdrop:"static"});e.componentInstance.plugin=this.plugin}doChildBridgeAction(e){return k(this,null,function*(){this.childBridgeRestartInProgress=!0;try{for(let o of this.setChildBridges)yield D(this.io.request(`${e}-child-bridge`,o.username))}catch(o){console.error(o),this.$toastr.error(this.$translate.instant("plugins.bridge.action_error",{action:e}),this.$translate.instant("toast.title_error")),this.childBridgeRestartInProgress=!1}finally{setTimeout(()=>{this.childBridgeRestartInProgress=!1},e==="restart"?12e3:e==="stop"?6e3:1e3)}})}handleIconError(){this.plugin.icon=this.defaultIcon}checkAndUpdatePlugin(){this.$plugin.checkAndUpdatePlugin(this.plugin,this.plugin.latestVersion)}openSettings(){this.$plugin.settings(this.plugin)}openBridgeSettings(){this.$plugin.bridgeSettings(this.plugin)}switchToScoped(){this.$plugin.switchToScoped(this.plugin)}installAlternateVersion(){this.$plugin.installAlternateVersion(this.plugin)}openJsonEditor(){this.$plugin.jsonEditor(this.plugin)}uninstallPlugin(){this.$plugin.uninstallPlugin(this.plugin,this.setChildBridges)}resetChildBridges(){this.$plugin.resetChildBridges(this.setChildBridges)}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["app-plugin-card"]],inputs:{plugin:"plugin",childBridges:"childBridges"},decls:35,vars:23,consts:[[1,"card","card-body","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","me-3","align-items-center","justify-content-between"],["alt","Plugin Icon",1,"plugin-icon-card","mb-3",3,"error","src"],[1,"d-flex","flex-column","justify-content-between",2,"min-width","calc(100% - 80px)"],[1,"d-flex","flex-row","align-items-end"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"card-title","mb-2","text-truncate"],[1,"ms-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"ngbTooltip"],[1,"fas","fa-fw","fa-spinner","fa-pulse","fa-lg","grey-text","ms-3",3,"hidden"],[1,"fas","fa-fw","fa-lg","ms-3",3,"ngClass"],[1,"card-text","mb-2","text-truncate"],["href","javascript:void(0)",1,"card-link",3,"click"],[1,"fas","fa-fw","fa-shield-alt","fa-lg","me-1",3,"ngClass"],[1,"grey-text"],[1,"card-text","mb-2"],["href","javascript:void(0)",1,"card-link"],[1,"card-text","mb-0","grey-text"],["href","javascript:void(0)",1,"card-link","red-text"],["href","javascript:void(0)"],["ngbDropdown","","placement","left",1,"d-inline-block","ms-3","mt-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"click","ngbTooltip"],[1,"far","fa-fw","fa-arrow-alt-circle-up","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-arrow-right-arrow-left","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-sliders","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-bridge","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-qrcode","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1","pink-text"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1",2,"opacity","0.5"],[1,"far","fa-fw","fa-circle-dot","fa-lg","me-1"],[1,"far","fa-fw","fa-circle-check","fa-lg","me-1"],[1,"fas","fa-fw","fa-lg","fa-power-off","ms-3"],["href","javascript:void(0)",1,"card-link","red-text",3,"click"],["container","body","openDelay","150","triggers","hover",1,"far","fa-fw","fa-pause-circle","fa-lg",3,"ngbTooltip"],["href","javascript:void(0)",3,"click"],[1,"far","fa-fw","fa-arrow-alt-circle-down","fa-lg"],["href","javascript:void(0)","ngbDropdownToggle","",1,"card-link","text-decoration-none","mt-auto",2,"outline","none"],[1,"fa-solid","fa-fw","fa-ellipsis-v","fa-lg"],["ngbDropdownMenu","","aria-labelledby","Plugin Actions Dropdown"],["ngbDropdownItem","",3,"click"],[1,"fas","fa-fw","fa-sliders"],["ngbDropdownItem",""],[1,"dropdown-divider"],["ngbDropdownItem","","rel","noopener noreferrer","target","_blank",3,"href"],[1,"fas","fa-fw","fa-wave-square"],[1,"fas","fa-fw","fa-code-compare"],[1,"fas","fa-fw","fa-code"],[1,"far","fa-fw","fa-circle-pause"],[1,"far","fa-fw","fa-circle-play"],[1,"fas","fa-fw","fa-trash"],[1,"fas","fa-fw","fa-bridge"],[1,"fa-fw","icon-button","fas","fa-fw","fa-power-off"],[1,"fas","fa-fw","fa-stop"],[1,"fas","fa-fw","fa-play"],[1,"fas","fa-fw","fa-broom"],[1,"icon-button","fas","fa-fw","fa-bridge"],[1,"icon-button","fa","fa-fw","fa-question-circle-o"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),_("error",function(){return i.handleIconError()}),l()(),a(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"h5",8),c(9),l(),a(10,"div",9),m(11,Ye,4,6,"a",10),m(12,Ze,4,6,"a",10),m(13,ei,4,6,"a",10),m(14,ii,4,6,"a",10),m(15,ti,4,6,"a",10),d(16,"i",11),m(17,ni,1,4,"i",12),l()(),a(18,"p",13)(19,"a",14),_("click",function(){return i.pluginInfoModal(i.plugin)}),d(20,"i",15),a(21,"span",16),c(22),l()()(),a(23,"p",17),m(24,ai,4,1,"a",18),m(25,oi,3,1,"span",16),l(),a(26,"div",7)(27,"p",19),m(28,ri,5,2,"span"),m(29,si,2,1),l(),a(30,"div",9),m(31,di,3,3,"a",10),m(32,pi,3,3,"a",20),m(33,ci,2,0,"a",21),m(34,Vi,22,18,"span",22),l()()()()()()()),o&2&&(n(3),C("src",i.plugin.icon,T),n(6),h(i.plugin.displayName),n(2),g(i.plugin.installedVersion&&i.plugin.updateAvailable&&!i.childBridgeRestartInProgress?11:-1),n(),g(i.plugin.installedVersion&&(i.plugin.newHbScope==null?null:i.plugin.newHbScope.switch)===i.plugin.installedVersion&&!i.childBridgeRestartInProgress?12:-1),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&!i.plugin.isConfigured&&!i.childBridgeRestartInProgress&&!i.plugin.disabled?13:-1),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&!i.plugin.hasChildBridges&&!i.plugin.disabled&&i.plugin.recommendChildBridge&&!i.childBridgeRestartInProgress?14:-1),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&i.hasUnpairedChildBridges&&i.childBridgeStatus==="ok"&&!i.plugin.disabled?15:-1),n(),C("hidden",!i.childBridgeRestartInProgress),n(),g(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&!i.hasUnpairedChildBridges&&i.childBridgeStatus!=="ok"&&!i.plugin.disabled?17:-1),n(3),C("ngClass",ne(19,Ke,i.plugin.isHbScoped,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),!i.plugin.isHbScoped&&!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin)),n(2),h(i.plugin.name),n(2),g((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?24:-1),n(),g((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?-1:25),n(3),g(i.plugin.publicPackage&&!i.plugin.installedVersion?28:-1),n(),g(i.plugin.installedVersion?29:-1),n(2),g(!i.plugin.disabled&&i.plugin.hasChildBridges&&i.childBridgeStatus==="ok"?31:-1),n(),g(i.plugin.installedVersion&&i.plugin.disabled?32:-1),n(),g(i.plugin.publicPackage&&!i.plugin.installedVersion?33:-1),n(),g(i.plugin.installedVersion?34:-1))},dependencies:[U,M,xe,ve,be,he,Ce,oe,B],encapsulation:2})}return t})();var Me=(()=>{class t{$activeModal=P($);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],decls:27,vars:21,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fa","fa-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"mb-0"],[3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),r(5,"translate"),l(),a(6,"button",3),r(7,"translate"),_("click",function(){return i.dismissModal()}),l()(),a(8,"div",4)(9,"div",5),d(10,"i",6),l(),a(11,"ul",7),d(12,"li",8),r(13,"translate"),d(14,"li",8),r(15,"translate"),d(16,"li",8),r(17,"translate"),d(18,"li",8),r(19,"translate"),l()(),a(20,"div",9),d(21,"div",10),a(22,"div",11)(23,"button",12),_("click",function(){return i.dismissModal()}),c(24),r(25,"translate"),l()(),d(26,"div",13),l()()()),o&2&&(n(4),h(s(5,7,"support.title")),n(2),y("aria-label",s(7,9,"form.button_close")),n(6),C("innerHTML",s(13,11,"plugins.support.list_1"),N),n(2),C("innerHTML",s(15,13,"plugins.support.list_2"),N),n(2),C("innerHTML",s(17,15,"plugins.support.list_3"),N),n(2),C("innerHTML",s(19,17,"plugins.support.list_4"),N),n(6),b(" ",s(25,19,"form.button_close")," "))},dependencies:[B],encapsulation:2})}return t})();var Ei=["searchInput"],Mi=(t,p)=>({"fa-magnifying-glass":t,"fa-exclamation-circle":p});function $i(t,p){t&1&&d(0,"app-spinner")}function Di(t,p){if(t&1){let e=w();a(0,"a",15),_("click",function(){v(e);let i=f(3);return x(i.onClearSearch())}),d(1,"i",16),l()}}function Ni(t,p){if(t&1){let e=w();a(0,"div",9)(1,"div",11)(2,"form",12),_("ngSubmit",function(){v(e);let i=f(2);return x(i.onSubmit(i.form))}),d(3,"input",13,0),r(5,"translate"),m(6,Di,2,0,"a",14),l()()()}if(t&2){let e=f(2);n(2),C("formGroup",e.form),n(),C("placeholder",s(5,3,"plugins.placeholder_search_plugin")),n(3),g(e.showExitButton?6:-1)}}function Hi(t,p){if(t&1&&(a(0,"div",17),d(1,"app-plugin-card",19),l()),t&2){let e=p.$implicit,o=f(3);n(),C("plugin",e)("childBridges",o.getPluginChildBridges(e))}}function Ai(t,p){if(t&1&&(a(0,"div",18),d(1,"i",20),a(2,"p"),c(3),r(4,"translate"),l()()),t&2){let e=f(3);n(),C("ngClass",I(4,Mi,!e.showExitButton,e.showExitButton)),n(2),h(s(4,2,e.showExitButton?"plugins.placeholder_search_none":"plugins.placeholder_search_first"))}}function ji(t,p){if(t&1&&(a(0,"div",10),F(1,Hi,2,2,"div",17,j),m(3,Ai,5,7,"div",18),l()),t&2){let e=f(2);n(),z(e.installedPlugins),n(2),g(e.installedPlugins.length===0&&!e.loading&&!e.mainError?3:-1)}}function Fi(t,p){if(t&1&&(m(0,Ni,7,5,"div",9),m(1,ji,4,1,"div",10)),t&2){let e=f();g(e.showSearchBar?0:-1),n(),g(e.loading?-1:1)}}function zi(t,p){t&1&&(a(0,"div",21)(1,"div",22)(2,"code"),c(3,"https://developers.homebridge.io/analytics "),a(4,"a",23),d(5,"i",24),l()()(),a(6,"div",25),c(7),r(8,"translate"),l()(),d(9,"iframe",26)),t&2&&(n(7),h(s(8,1,"plugins.stats_note")))}var Yt=(()=>{class t{searchInput;$api=P(L);$modal=P(O);$plugin=P(Q);$router=P(Pe);$settings=P(G);$toastr=P(R);$translate=P(q);$ws=P(W);isSearchMode=!1;io;navigationSubscription;mainError=!1;loading=!0;tab="main";installedPlugins=[];childBridges=[];showSearchBar=!1;showExitButton=!1;form=new de({query:new pe("")});ngOnInit(){return k(this,null,function*(){this.io=this.$ws.connectToNamespace("child-bridges"),this.io.connected.subscribe(()=>k(this,null,function*(){this.getChildBridgeMetadata(),this.io.socket.emit("monitor-child-bridge-status"),yield this.loadInstalledPlugins(),this.installedPlugins.length||this.showSearch();let{action:e,plugin:o}=this.$router.parseUrl(this.$router.url).queryParams;if(e){let i=this.installedPlugins.find(u=>u.name===o);switch(e){case"just-installed":{i&&(i.isConfigured?this.$modal.open(H,{size:"lg",backdrop:"static"}):this.$plugin.settings(i));break}case"open-manage-version":{i&&this.$plugin.installAlternateVersion(i);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}})),this.io.socket.on("child-bridge-status-update",e=>{let o=this.childBridges.find(i=>i.username===e.username);o?Object.assign(o,e):this.childBridges.push(e)}),this.navigationSubscription=this.$router.events.subscribe(e=>{e instanceof we&&this.loadInstalledPlugins()})})}search(){this.installedPlugins=[],this.loading=!0,this.showExitButton=!0,this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({next:e=>{let o=new Set;this.installedPlugins=e.reduce((i,u)=>{if(u.name==="homebridge-config-ui-x"||o.has(u.name))return i;if(u.newHbScope){let Y=u.newHbScope.to,$e=e.some(De=>De.name===Y);(u.installedVersion||!$e)&&(o.add(Y),i.push(u))}else i.push(u);return i},[]),this.appendMetaInfo(),this.loading=!1},error:e=>{this.loading=!1,this.isSearchMode=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error")),this.loadInstalledPlugins()}})}onClearSearch(){this.loadInstalledPlugins()}onSubmit({value:e}){e.query.length?(this.isSearchMode=!0,this.search()):this.isSearchMode&&(this.isSearchMode=!1,this.loadInstalledPlugins())}showSearch(){this.showSearchBar?(this.showSearchBar=!1,this.isSearchMode&&(this.isSearchMode=!1,this.form.setValue({query:""}),this.loadInstalledPlugins())):(window.document.querySelector("body").classList.remove("bg-black"),this.tab="main",this.showSearchBar=!0,setTimeout(()=>this.searchInput.nativeElement.focus(),0))}showStats(){this.tab==="stats"?(window.document.querySelector("body").classList.remove("bg-black"),this.tab="main"):(window.document.querySelector("body").classList.add("bg-black"),this.tab="stats",this.showSearchBar=!1)}openSupport(){this.$modal.open(Me,{size:"lg",backdrop:"static"})}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.navigationSubscription&&this.navigationSubscription.unsubscribe(),this.io.end()}getPluginChildBridges(e){return this.childBridges.filter(o=>o.plugin===e.name)}loadInstalledPlugins(){return k(this,null,function*(){this.form.setValue({query:""}),this.showExitButton=!1,this.installedPlugins=[],this.loading=!0,this.mainError=!1;try{let e=yield D(this.$api.get("/plugins"));this.installedPlugins=e.filter(i=>i.name!=="homebridge-config-ui-x"),yield this.appendMetaInfo();let o=this.installedPlugins.sort((i,u)=>i.updateAvailable!==u.updateAvailable?i.updateAvailable?-1:1:i.newHbScope&&!u.newHbScope?-1:i.disabled!==u.disabled?i.disabled?1:-1:i.isConfigured!==u.isConfigured?i.isConfigured?1:-1:i.hasChildBridgesUnpaired!==u.hasChildBridgesUnpaired?i.hasChildBridgesUnpaired?-1:1:i.hasChildBridges!==u.hasChildBridges&&this.$settings.env.recommendChildBridges?i.hasChildBridges?1:-1:i.name.localeCompare(u.name));return this.loading=!1,o}catch(e){console.error(e),this.loading=!1,this.mainError=!0,this.$toastr.error(this.$translate.instant("plugins.toast_failed_to_load_plugins"),this.$translate.instant("toast.title_error"))}})}appendMetaInfo(){return k(this,null,function*(){yield Promise.all(this.installedPlugins.filter(e=>e.installedVersion).map(e=>k(this,null,function*(){try{let o=yield D(this.$api.get(`/config-editor/plugin/${encodeURIComponent(e.name)}`));e.isConfigured=o.length>0,e.isConfiguredDynamicPlatform=e.isConfigured&&Object.prototype.hasOwnProperty.call(o[0],"platform"),e.recommendChildBridge=e.isConfiguredDynamicPlatform&&this.$settings.env.recommendChildBridges&&this.$settings.env.serviceMode&&!["homebridge","homebridge-config-ui-x"].includes(e.name),e.hasChildBridges=e.isConfigured&&o.some(u=>u._bridge&&u._bridge.username);let i=this.getPluginChildBridges(e);e.hasChildBridgesUnpaired=i.some(u=>!u.paired),this.$settings.env.plugins?.hideUpdatesFor?.includes(e.name)&&(e.updateAvailable=!1)}catch{e.isConfigured=!0,e.hasChildBridges=!0}})))})}getChildBridgeMetadata(){this.io.request("get-homebridge-child-bridge-status").subscribe(e=>{this.childBridges=e})}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],viewQuery:function(o,i){if(o&1&&ee(Ei,5),o&2){let u;ie(u=te())&&(i.searchInput=u.first)}},decls:20,vars:26,consts:[["searchInput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","ngbTooltip"],["type","button","container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","me-2","d-none","d-md-inline-block",3,"click","ngbTooltip"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"row"],[1,"d-flex","flex-wrap","justify-content-between"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","formControlName","query",1,"hb-npm-search",3,"placeholder"],["href","javascript:void(0)",1,"hb-npm-search-clear"],["href","javascript:void(0)",1,"hb-npm-search-clear",3,"click"],[1,"far","fa-fw","fa-times-circle"],[1,"hb-plugin-space-between"],[1,"alert","alert-info","mt-4","text-center","w-100"],[3,"plugin","childBridges"],[1,"fas","fa-fw","primary-text","my-3",2,"font-size","75px",3,"ngClass"],[1,"w-100","py-3","hb-stats-header","text-white","text-center"],[1,"mb-2"],["href","https://developers.homebridge.io/analytics","target","_blank"],[1,"fa","fa-fw","fa-external-link"],[1,"small","grey-text"],["src",Z`https://developers.homebridge.io/analytics/`,"sandbox","allow-scripts allow-same-origin allow-popups","referrerpolicy","no-referrer",1,"hb-stats"]],template:function(o,i){o&1&&(m(0,$i,1,0,"app-spinner"),a(1,"div",1)(2,"div",2)(3,"h3",3),c(4),r(5,"translate"),l()(),a(6,"div",4)(7,"button",5),r(8,"translate"),r(9,"translate"),_("click",function(){return i.showSearch()}),d(10,"i"),l(),a(11,"button",6),r(12,"translate"),r(13,"translate"),_("click",function(){return i.showStats()}),d(14,"i"),l(),a(15,"button",7),r(16,"translate"),_("click",function(){return i.openSupport()}),d(17,"i",8),l()()(),m(18,Fi,2,2)(19,zi,10,3)),o&2&&(g(i.loading?0:-1),n(4),h(s(5,14,"menu.label_plugins")),n(3),C("ngbTooltip",s(8,16,"plugins.search")),y("aria-label",s(9,18,"plugins.search")),n(3),J(K("fas fa-fw",i.showSearchBar?" primary-text":""," fa-search")),n(),C("ngbTooltip",s(12,20,"plugins.stats")),y("aria-label",s(13,22,"plugins.stats")),n(3),J(K("fas fa-fw",i.tab==="stats"?" primary-text":""," fa-sliders")),n(),y("aria-label",s(16,24,"support.title")),n(3),g(i.tab==="main"?18:i.tab==="stats"?19:-1))},dependencies:[Se,ge,ce,le,re,se,fe,ue,me,Ee,B,M,U],styles:[".hb-npm-search[_ngcontent-%COMP%]{outline:none;box-sizing:inherit!important;background-color:inherit;height:50px!important;width:100%;border-width:.5px;padding:10px;margin-bottom:15px}@media (hover: hover){.hb-npm-search[_ngcontent-%COMP%]:hover{border:1px solid #000000}}.hb-npm-search[_ngcontent-%COMP%]:focus{border:1px solid #000000;box-shadow:0 1px #000}.hb-npm-search-clear[_ngcontent-%COMP%]{position:absolute;right:25px;font-size:35px;color:#d0d0d0;line-height:50px;cursor:pointer}.hb-plugin-space-between[_ngcontent-%COMP%]{box-sizing:border-box;width:calc(50% - 6.6666666667px)}@media only screen and (max-width: 991px){.hb-plugin-space-between[_ngcontent-%COMP%]{width:100%}}.hb-stats-header[_ngcontent-%COMP%]{background:#242424;border-top-left-radius:.5rem;border-top-right-radius:.5rem}.hb-stats-header[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{border:1px solid grey;border-radius:5px;padding:5px;font-size:.8rem;color:#d3d3d3}.hb-stats[_ngcontent-%COMP%]{height:calc(100% - 121px);width:100%;overflow:hidden;border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}@media (max-width: 767px){.hb-stats[_ngcontent-%COMP%]{height:calc(100% - 60px)}}"]})}return t})();export{Yt as PluginsComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as pu,b as ib}from"./chunk-UQYCFN3T.js";import{a as M1}from"./chunk-GDFV4BMO.js";import{a as N1}from"./chunk-NGNQPAAK.js";import{a as Jr,b as Xr}from"./chunk-QDCKP2LU.js";import{a as L1,b as ff}from"./chunk-J7CZIM5Y.js";import{a as V1,b as R1}from"./chunk-UD6SVFW2.js";import{a as q1}from"./chunk-7EQ4BJZB.js";import{a as Ds}from"./chunk-EGCUYKRH.js";import{a as j1}from"./chunk-TQNKRJOX.js";import{a as zr,b as Ur,c as Hr,d as Wr,e as Kr,f as Gr,g as Qi,m as Ae,n as it,o as $1,p as k1,q as T1,r as P1,s as O1,t as en}from"./chunk-CF2ZN7LY.js";import{A as nf,a as y1,b as Ju,c as Yi,e as vt,f as v1,h as B1,i as x1,j as w1,k as S1,l as Xu,m as I1,o as Yu,r as Zi,s as xi,t as wi,y as A1,z as uu}from"./chunk-T252YJXA.js";import{a as Qu}from"./chunk-4W3A6DIF.js";import{d as cu}from"./chunk-X7PVYZAE.js";import{b as Re}from"./chunk-YCQ4FEJS.js";import{k as _e,m as Zu,n as be}from"./chunk-5S7TFWYQ.js";import{a as Ee,b as $e}from"./chunk-LXXELGX4.js";import{e as _1}from"./chunk-SRP6QX5M.js";import{$a as d1,Ac as Xi,Bc as y,Ca as zu,Cc as B,D as o1,Da as l1,Dc as He,Fa as Uu,Hb as G,Ib as w,Jb as S,Kc as gt,Lb as nt,Lc as U,M as Ki,Mb as ft,Mc as Gu,Nb as rt,Ob as b,Oc as b1,Pb as c,Qb as p,Rb as x,Sb as m1,Tb as F1,Vb as H,Xa as me,Yb as M,Z as rs,Zb as C,a as X,aa as uf,ab as l,b as xe,bc as os,cc as as,cd as Ut,dc as ss,dd as Bi,e as F,ec as Hu,ed as bt,fa as a1,fb as qr,fc as Wu,g as Ue,ga as Ot,gb as vu,gc as C1,h as K,ha as Gi,hc as eu,ib as _i,ic as Ku,ja as s1,jc as Z,k as i1,ka as D1,kc as E,la as I,lc as R,ld as Lr,mb as Y,mc as q,n as Pt,nb as Ji,nc as yi,o as fs,ob as Bu,oc as Rr,pb as c1,q as n1,ra as j,rc as Pe,sa as N,sb as se,sc as Oe,tc as Me,td as E1,ub as p1,uc as h1,v as f1,vb as Vr,vc as g1,w as ae,wc as Ie,x as r1,xc as tu,yc as vi,za as Nr,zc as zt}from"./chunk-SKZUTSHE.js";var af=F(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.regexpCode=ge.getEsmExportName=ge.getProperty=ge.safeStringify=ge.stringify=ge.strConcat=ge.addCodeArg=ge.str=ge._=ge.nil=ge._Code=ge.Name=ge.IDENTIFIER=ge._CodeOrName=void 0;var rf=class{};ge._CodeOrName=rf;ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Si=class extends rf{constructor(u){if(super(),!ge.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ge.Name=Si;var Ht=class extends rf{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof Si&&(t[i.str]=(t[i.str]||0)+1),t),{})}};ge._Code=Ht;ge.nil=new Ht("");function z1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ds(t,u[i]),t.push(e[++i]);return new Ht(t)}ge._=z1;var ls=new Ht("+");function U1(e,...u){let t=[of(e[0])],i=0;for(;i<u.length;)t.push(ls),ds(t,u[i]),t.push(ls,of(e[++i]));return fb(t),new Ht(t)}ge.str=U1;function ds(e,u){u instanceof Ht?e.push(...u._items):u instanceof Si?e.push(u):e.push(ab(u))}ge.addCodeArg=ds;function fb(e){let u=1;for(;u<e.length-1;){if(e[u]===ls){let t=rb(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function rb(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof Si||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof Si))return`"${e}${u.slice(1)}`}function ob(e,u){return u.emptyStr()?e:e.emptyStr()?u:U1`${e}${u}`}ge.strConcat=ob;function ab(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:of(Array.isArray(e)?e.join(","):e)}function sb(e){return new Ht(of(e))}ge.stringify=sb;function of(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ge.safeStringify=of;function Db(e){return typeof e=="string"&&ge.IDENTIFIER.test(e)?new Ht(`.${e}`):z1`[${e}]`}ge.getProperty=Db;function lb(e){if(typeof e=="string"&&ge.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ge.getEsmExportName=lb;function db(e){return new Ht(e.toString())}ge.regexpCode=db});var ms=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=af(),cs=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var cb=(0,Bt._)`\n`,ps=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=xe(X({},u),{_n:u.lines?cb:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new cs(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=ps});var ee=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.or=De.and=De.not=De.CodeGen=De.operators=De.varKinds=De.ValueScopeName=De.ValueScope=De.Scope=De.Name=De.regexpCode=De.stringify=De.getProperty=De.nil=De.strConcat=De.str=De._=void 0;var Fe=af(),iu=ms(),ei=af();Object.defineProperty(De,"_",{enumerable:!0,get:function(){return ei._}});Object.defineProperty(De,"str",{enumerable:!0,get:function(){return ei.str}});Object.defineProperty(De,"strConcat",{enumerable:!0,get:function(){return ei.strConcat}});Object.defineProperty(De,"nil",{enumerable:!0,get:function(){return ei.nil}});Object.defineProperty(De,"getProperty",{enumerable:!0,get:function(){return ei.getProperty}});Object.defineProperty(De,"stringify",{enumerable:!0,get:function(){return ei.stringify}});Object.defineProperty(De,"regexpCode",{enumerable:!0,get:function(){return ei.regexpCode}});Object.defineProperty(De,"Name",{enumerable:!0,get:function(){return ei.Name}});var no=ms();Object.defineProperty(De,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(De,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(De,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(De,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});De.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var xu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},Fs=class extends xu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=un(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends xu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=un(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Cs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},hs=class extends xu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},gs=class extends xu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},bs=class extends xu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},Es=class extends xu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=un(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},sf=class extends xu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(pb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>Ii(u,t.names),{})}},wu=class extends sf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},_s=class extends sf{},ys=(()=>{class e extends wu{}return e.kind="else",e})(),eo=(()=>{class e extends wu{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new ys(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(J1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=un(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&Ii(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends wu{}return e.kind="for",e})(),vs=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=un(this.iteration,u,t),this}get names(){return Ii(super.names,this.iteration.names)}},Bs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=un(this.iterable,u,t),this}get names(){return Ii(super.names,this.iterable.names)}},H1=(()=>{class e extends wu{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),W1=(()=>{class e extends sf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),xs=class extends wu{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&Ii(u,this.catch.names),this.finally&&Ii(u,this.finally.names),u}},K1=(()=>{class e extends wu{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),G1=(()=>{class e extends wu{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),ws=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=xe(X({},t),{_n:t.lines?`
|
|
1
|
+
import{a as pu,b as ib}from"./chunk-UQYCFN3T.js";import{a as M1}from"./chunk-GDFV4BMO.js";import{a as N1}from"./chunk-NGNQPAAK.js";import{a as Jr,b as Xr}from"./chunk-QDCKP2LU.js";import{a as L1,b as ff}from"./chunk-IJ2NROJY.js";import{a as V1,b as R1}from"./chunk-UD6SVFW2.js";import{a as q1}from"./chunk-7EQ4BJZB.js";import{a as Ds}from"./chunk-EGCUYKRH.js";import{a as j1}from"./chunk-TQNKRJOX.js";import{a as zr,b as Ur,c as Hr,d as Wr,e as Kr,f as Gr,g as Qi,m as Ae,n as it,o as $1,p as k1,q as T1,r as P1,s as O1,t as en}from"./chunk-CF2ZN7LY.js";import{A as nf,a as y1,b as Ju,c as Yi,e as vt,f as v1,h as B1,i as x1,j as w1,k as S1,l as Xu,m as I1,o as Yu,r as Zi,s as xi,t as wi,y as A1,z as uu}from"./chunk-T252YJXA.js";import{a as Qu}from"./chunk-QOGMJZDE.js";import{d as cu}from"./chunk-X7PVYZAE.js";import{b as Re}from"./chunk-LNUVGJNE.js";import{k as _e,m as Zu,n as be}from"./chunk-APTNRLSD.js";import{a as Ee,b as $e}from"./chunk-LXXELGX4.js";import{e as _1}from"./chunk-SRP6QX5M.js";import{$a as d1,Ac as Xi,Bc as y,Ca as zu,Cc as B,D as o1,Da as l1,Dc as He,Fa as Uu,Hb as G,Ib as w,Jb as S,Kc as gt,Lb as nt,Lc as U,M as Ki,Mb as ft,Mc as Gu,Nb as rt,Ob as b,Oc as b1,Pb as c,Qb as p,Rb as x,Sb as m1,Tb as F1,Vb as H,Xa as me,Yb as M,Z as rs,Zb as C,a as X,aa as uf,ab as l,b as xe,bc as os,cc as as,cd as Ut,dc as ss,dd as Bi,e as F,ec as Hu,ed as bt,fa as a1,fb as qr,fc as Wu,g as Ue,ga as Ot,gb as vu,gc as C1,h as K,ha as Gi,hc as eu,ib as _i,ic as Ku,ja as s1,jc as Z,k as i1,ka as D1,kc as E,la as I,lc as R,ld as Lr,mb as Y,mc as q,n as Pt,nb as Ji,nc as yi,o as fs,ob as Bu,oc as Rr,pb as c1,q as n1,ra as j,rc as Pe,sa as N,sb as se,sc as Oe,tc as Me,td as E1,ub as p1,uc as h1,v as f1,vb as Vr,vc as g1,w as ae,wc as Ie,x as r1,xc as tu,yc as vi,za as Nr,zc as zt}from"./chunk-SKZUTSHE.js";var af=F(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.regexpCode=ge.getEsmExportName=ge.getProperty=ge.safeStringify=ge.stringify=ge.strConcat=ge.addCodeArg=ge.str=ge._=ge.nil=ge._Code=ge.Name=ge.IDENTIFIER=ge._CodeOrName=void 0;var rf=class{};ge._CodeOrName=rf;ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Si=class extends rf{constructor(u){if(super(),!ge.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ge.Name=Si;var Ht=class extends rf{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof Si&&(t[i.str]=(t[i.str]||0)+1),t),{})}};ge._Code=Ht;ge.nil=new Ht("");function z1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ds(t,u[i]),t.push(e[++i]);return new Ht(t)}ge._=z1;var ls=new Ht("+");function U1(e,...u){let t=[of(e[0])],i=0;for(;i<u.length;)t.push(ls),ds(t,u[i]),t.push(ls,of(e[++i]));return fb(t),new Ht(t)}ge.str=U1;function ds(e,u){u instanceof Ht?e.push(...u._items):u instanceof Si?e.push(u):e.push(ab(u))}ge.addCodeArg=ds;function fb(e){let u=1;for(;u<e.length-1;){if(e[u]===ls){let t=rb(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function rb(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof Si||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof Si))return`"${e}${u.slice(1)}`}function ob(e,u){return u.emptyStr()?e:e.emptyStr()?u:U1`${e}${u}`}ge.strConcat=ob;function ab(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:of(Array.isArray(e)?e.join(","):e)}function sb(e){return new Ht(of(e))}ge.stringify=sb;function of(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ge.safeStringify=of;function Db(e){return typeof e=="string"&&ge.IDENTIFIER.test(e)?new Ht(`.${e}`):z1`[${e}]`}ge.getProperty=Db;function lb(e){if(typeof e=="string"&&ge.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ge.getEsmExportName=lb;function db(e){return new Ht(e.toString())}ge.regexpCode=db});var ms=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=af(),cs=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var cb=(0,Bt._)`\n`,ps=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=xe(X({},u),{_n:u.lines?cb:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new cs(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=ps});var ee=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.or=De.and=De.not=De.CodeGen=De.operators=De.varKinds=De.ValueScopeName=De.ValueScope=De.Scope=De.Name=De.regexpCode=De.stringify=De.getProperty=De.nil=De.strConcat=De.str=De._=void 0;var Fe=af(),iu=ms(),ei=af();Object.defineProperty(De,"_",{enumerable:!0,get:function(){return ei._}});Object.defineProperty(De,"str",{enumerable:!0,get:function(){return ei.str}});Object.defineProperty(De,"strConcat",{enumerable:!0,get:function(){return ei.strConcat}});Object.defineProperty(De,"nil",{enumerable:!0,get:function(){return ei.nil}});Object.defineProperty(De,"getProperty",{enumerable:!0,get:function(){return ei.getProperty}});Object.defineProperty(De,"stringify",{enumerable:!0,get:function(){return ei.stringify}});Object.defineProperty(De,"regexpCode",{enumerable:!0,get:function(){return ei.regexpCode}});Object.defineProperty(De,"Name",{enumerable:!0,get:function(){return ei.Name}});var no=ms();Object.defineProperty(De,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(De,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(De,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(De,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});De.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var xu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},Fs=class extends xu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=un(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends xu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=un(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Cs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},hs=class extends xu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},gs=class extends xu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},bs=class extends xu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},Es=class extends xu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=un(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},sf=class extends xu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(pb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>Ii(u,t.names),{})}},wu=class extends sf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},_s=class extends sf{},ys=(()=>{class e extends wu{}return e.kind="else",e})(),eo=(()=>{class e extends wu{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new ys(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(J1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=un(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&Ii(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends wu{}return e.kind="for",e})(),vs=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=un(this.iteration,u,t),this}get names(){return Ii(super.names,this.iteration.names)}},Bs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=un(this.iterable,u,t),this}get names(){return Ii(super.names,this.iterable.names)}},H1=(()=>{class e extends wu{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),W1=(()=>{class e extends sf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),xs=class extends wu{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&Ii(u,this.catch.names),this.finally&&Ii(u,this.finally.names),u}},K1=(()=>{class e extends wu{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),G1=(()=>{class e extends wu{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),ws=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=xe(X({},t),{_n:t.lines?`
|
|
2
2
|
`:""}),this._extScope=u,this._scope=new iu.Scope({parent:u}),this._nodes=[new _s]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,t){let i=this._extScope.value(u,t);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(u,t){return this._extScope.getValue(u,t)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,t,i,n){let f=this._scope.toName(t);return i!==void 0&&n&&(this._constants[f.str]=i),this._leafNode(new Fs(u,f,i)),f}const(u,t,i){return this._def(iu.varKinds.const,u,t,i)}let(u,t,i){return this._def(iu.varKinds.let,u,t,i)}var(u,t,i){return this._def(iu.varKinds.var,u,t,i)}assign(u,t,i){return this._leafNode(new to(u,t,i))}add(u,t){return this._leafNode(new Cs(u,De.operators.ADD,t))}code(u){return typeof u=="function"?u():u!==Fe.nil&&this._leafNode(new Es(u)),this}object(...u){let t=["{"];for(let[i,n]of u)t.length>1&&t.push(","),t.push(i),(i!==n||this.opts.es5)&&(t.push(":"),(0,Fe.addCodeArg)(t,n));return t.push("}"),new Fe._Code(t)}if(u,t,i){if(this._blockNode(new eo(u)),t&&i)this.code(t).else().code(i).endIf();else if(t)this.code(t).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new eo(u))}else(){return this._elseNode(new ys)}endIf(){return this._endBlockNode(eo,ys)}_for(u,t){return this._blockNode(u),t&&this.code(t).endFor(),this}for(u,t){return this._for(new vs(u),t)}forRange(u,t,i,n,f=this.opts.es5?iu.varKinds.var:iu.varKinds.let){let r=this._scope.toName(u);return this._for(new Bs(f,r,t,i),()=>n(r))}forOf(u,t,i,n=iu.varKinds.const){let f=this._scope.toName(u);if(this.opts.es5){let r=t instanceof Fe.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Fe._)`${r}.length`,o=>{this.var(f,(0,Fe._)`${r}[${o}]`),i(f)})}return this._for(new uo("of",n,f,t),()=>i(f))}forIn(u,t,i,n=this.opts.es5?iu.varKinds.var:iu.varKinds.const){if(this.opts.ownProperties)return this.forOf(u,(0,Fe._)`Object.keys(${t})`,i);let f=this._scope.toName(u);return this._for(new uo("in",n,f,t),()=>i(f))}endFor(){return this._endBlockNode(fo)}label(u){return this._leafNode(new hs(u))}break(u){return this._leafNode(new gs(u))}return(u){let t=new W1;if(this._blockNode(t),this.code(u),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(W1)}try(u,t,i){if(!t&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new xs;if(this._blockNode(n),this.code(u),t){let f=this.name("e");this._currNode=n.catch=new K1(f),t(f)}return i&&(this._currNode=n.finally=new G1,this.code(i)),this._endBlockNode(K1,G1)}throw(u){return this._leafNode(new bs(u))}block(u,t){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(t),this}endBlock(u){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-t;if(i<0||u!==void 0&&i!==u)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${u} expected`);return this._nodes.length=t,this}func(u,t=Fe.nil,i,n){return this._blockNode(new H1(u,t,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(H1)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,t){let i=this._currNode;if(i instanceof u||t&&i instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${u.kind}/${t.kind}`:u.kind}"`)}_elseNode(u){let t=this._currNode;if(!(t instanceof eo))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=u,this}get _root(){return this._nodes[0]}get _currNode(){let u=this._nodes;return u[u.length-1]}set _currNode(u){let t=this._nodes;t[t.length-1]=u}};De.CodeGen=ws;function Ii(e,u){for(let t in u)e[t]=(e[t]||0)+(u[t]||0);return e}function io(e,u){return u instanceof Fe._CodeOrName?Ii(e,u.names):e}function un(e,u,t){if(e instanceof Fe.Name)return i(e);if(!n(e))return e;return new Fe._Code(e._items.reduce((f,r)=>(r instanceof Fe.Name&&(r=i(r)),r instanceof Fe._Code?f.push(...r._items):f.push(r),f),[]));function i(f){let r=t[f.str];return r===void 0||u[f.str]!==1?f:(delete u[f.str],r)}function n(f){return f instanceof Fe._Code&&f._items.some(r=>r instanceof Fe.Name&&u[r.str]===1&&t[r.str]!==void 0)}}function pb(e,u){for(let t in u)e[t]=(e[t]||0)-(u[t]||0)}function J1(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Fe._)`!${Ss(e)}`}De.not=J1;var mb=X1(De.operators.AND);function Fb(...e){return e.reduce(mb)}De.and=Fb;var Cb=X1(De.operators.OR);function hb(...e){return e.reduce(Cb)}De.or=hb;function X1(e){return(u,t)=>u===Fe.nil?t:t===Fe.nil?u:(0,Fe._)`${Ss(u)} ${e} ${Ss(t)}`}function Ss(e){return e instanceof Fe.Name?e:(0,Fe._)`(${e})`}});var de=F(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.checkStrictMode=le.getErrorPath=le.Type=le.useFunc=le.setEvaluated=le.evaluatedPropsToName=le.mergeEvaluated=le.eachItem=le.unescapeJsonPointer=le.escapeJsonPointer=le.escapeFragment=le.unescapeFragment=le.schemaRefOrVal=le.schemaHasRulesButRef=le.schemaHasRules=le.checkUnknownRules=le.alwaysValidSchema=le.toHash=void 0;var we=ee(),gb=af();function bb(e){let u={};for(let t of e)u[t]=!0;return u}le.toHash=bb;function Eb(e,u){return typeof u=="boolean"?u:Object.keys(u).length===0?!0:(Q1(e,u),!ed(u,e.self.RULES.all))}le.alwaysValidSchema=Eb;function Q1(e,u=e.schema){let{opts:t,self:i}=e;if(!t.strictSchema||typeof u=="boolean")return;let n=i.RULES.keywords;for(let f in u)n[f]||id(e,`unknown keyword: "${f}"`)}le.checkUnknownRules=Q1;function ed(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(u[t])return!0;return!1}le.schemaHasRules=ed;function _b(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&u.all[t])return!0;return!1}le.schemaHasRulesButRef=_b;function yb({topSchemaRef:e,schemaPath:u},t,i,n){if(!n){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,we._)`${t}`}return(0,we._)`${e}${u}${(0,we.getProperty)(i)}`}le.schemaRefOrVal=yb;function vb(e){return td(decodeURIComponent(e))}le.unescapeFragment=vb;function Bb(e){return encodeURIComponent(As(e))}le.escapeFragment=Bb;function As(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}le.escapeJsonPointer=As;function td(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}le.unescapeJsonPointer=td;function xb(e,u){if(Array.isArray(e))for(let t of e)u(t);else u(e)}le.eachItem=xb;function Y1({mergeNames:e,mergeToName:u,mergeValues:t,resultToName:i}){return(n,f,r,o)=>{let a=r===void 0?f:r instanceof we.Name?(f instanceof we.Name?e(n,f,r):u(n,f,r),r):f instanceof we.Name?(u(n,r,f),f):t(f,r);return o===we.Name&&!(a instanceof we.Name)?i(n,a):a}}le.mergeEvaluated={props:Y1({mergeNames:(e,u,t)=>e.if((0,we._)`${t} !== true && ${u} !== undefined`,()=>{e.if((0,we._)`${u} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,we._)`${t} || {}`).code((0,we._)`Object.assign(${t}, ${u})`))}),mergeToName:(e,u,t)=>e.if((0,we._)`${t} !== true`,()=>{u===!0?e.assign(t,!0):(e.assign(t,(0,we._)`${t} || {}`),$s(e,t,u))}),mergeValues:(e,u)=>e===!0?!0:X(X({},e),u),resultToName:ud}),items:Y1({mergeNames:(e,u,t)=>e.if((0,we._)`${t} !== true && ${u} !== undefined`,()=>e.assign(t,(0,we._)`${u} === true ? true : ${t} > ${u} ? ${t} : ${u}`)),mergeToName:(e,u,t)=>e.if((0,we._)`${t} !== true`,()=>e.assign(t,u===!0?!0:(0,we._)`${t} > ${u} ? ${t} : ${u}`)),mergeValues:(e,u)=>e===!0?!0:Math.max(e,u),resultToName:(e,u)=>e.var("items",u)})};function ud(e,u){if(u===!0)return e.var("props",!0);let t=e.var("props",(0,we._)`{}`);return u!==void 0&&$s(e,t,u),t}le.evaluatedPropsToName=ud;function $s(e,u,t){Object.keys(t).forEach(i=>e.assign((0,we._)`${u}${(0,we.getProperty)(i)}`,!0))}le.setEvaluated=$s;var Z1={};function wb(e,u){return e.scopeValue("func",{ref:u,code:Z1[u.code]||(Z1[u.code]=new gb._Code(u.code))})}le.useFunc=wb;var Is=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(Is||(le.Type=Is={}));function Sb(e,u,t){if(e instanceof we.Name){let i=u===Is.Num;return t?i?(0,we._)`"[" + ${e} + "]"`:(0,we._)`"['" + ${e} + "']"`:i?(0,we._)`"/" + ${e}`:(0,we._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,we.getProperty)(e).toString():"/"+As(e)}le.getErrorPath=Sb;function id(e,u,t=e.opts.strictSchema){if(t){if(u=`strict mode: ${u}`,t===!0)throw new Error(u);e.self.logger.warn(u)}}le.checkStrictMode=id});var Wt=F(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var lt=ee(),Ib={data:new lt.Name("data"),valCxt:new lt.Name("valCxt"),instancePath:new lt.Name("instancePath"),parentData:new lt.Name("parentData"),parentDataProperty:new lt.Name("parentDataProperty"),rootData:new lt.Name("rootData"),dynamicAnchors:new lt.Name("dynamicAnchors"),vErrors:new lt.Name("vErrors"),errors:new lt.Name("errors"),this:new lt.Name("this"),self:new lt.Name("self"),scope:new lt.Name("scope"),json:new lt.Name("json"),jsonPos:new lt.Name("jsonPos"),jsonLen:new lt.Name("jsonLen"),jsonPart:new lt.Name("jsonPart")};ks.default=Ib});var Df=F(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.extendErrors=dt.resetErrorsCount=dt.reportExtraError=dt.reportError=dt.keyword$DataError=dt.keywordError=void 0;var he=ee(),ro=de(),Et=Wt();dt.keywordError={message:({keyword:e})=>(0,he.str)`must pass "${e}" keyword validation`};dt.keyword$DataError={message:({keyword:e,schemaType:u})=>u?(0,he.str)`"${e}" keyword must be ${u} ($data)`:(0,he.str)`"${e}" keyword is invalid ($data)`};function Ab(e,u=dt.keywordError,t,i){let{it:n}=e,{gen:f,compositeRule:r,allErrors:o}=n,a=rd(e,u,t);i??(r||o)?nd(f,a):fd(n,(0,he._)`[${a}]`)}dt.reportError=Ab;function $b(e,u=dt.keywordError,t){let{it:i}=e,{gen:n,compositeRule:f,allErrors:r}=i,o=rd(e,u,t);nd(n,o),f||r||fd(i,Et.default.vErrors)}dt.reportExtraError=$b;function kb(e,u){e.assign(Et.default.errors,u),e.if((0,he._)`${Et.default.vErrors} !== null`,()=>e.if(u,()=>e.assign((0,he._)`${Et.default.vErrors}.length`,u),()=>e.assign(Et.default.vErrors,null)))}dt.resetErrorsCount=kb;function Tb({gen:e,keyword:u,schemaValue:t,data:i,errsCount:n,it:f}){if(n===void 0)throw new Error("ajv implementation error");let r=e.name("err");e.forRange("i",n,Et.default.errors,o=>{e.const(r,(0,he._)`${Et.default.vErrors}[${o}]`),e.if((0,he._)`${r}.instancePath === undefined`,()=>e.assign((0,he._)`${r}.instancePath`,(0,he.strConcat)(Et.default.instancePath,f.errorPath))),e.assign((0,he._)`${r}.schemaPath`,(0,he.str)`${f.errSchemaPath}/${u}`),f.opts.verbose&&(e.assign((0,he._)`${r}.schema`,t),e.assign((0,he._)`${r}.data`,i))})}dt.extendErrors=Tb;function nd(e,u){let t=e.const("err",u);e.if((0,he._)`${Et.default.vErrors} === null`,()=>e.assign(Et.default.vErrors,(0,he._)`[${t}]`),(0,he._)`${Et.default.vErrors}.push(${t})`),e.code((0,he._)`${Et.default.errors}++`)}function fd(e,u){let{gen:t,validateName:i,schemaEnv:n}=e;n.$async?t.throw((0,he._)`new ${e.ValidationError}(${u})`):(t.assign((0,he._)`${i}.errors`,u),t.return(!1))}var Ai={keyword:new he.Name("keyword"),schemaPath:new he.Name("schemaPath"),params:new he.Name("params"),propertyName:new he.Name("propertyName"),message:new he.Name("message"),schema:new he.Name("schema"),parentSchema:new he.Name("parentSchema")};function rd(e,u,t){let{createErrors:i}=e.it;return i===!1?(0,he._)`{}`:Pb(e,u,t)}function Pb(e,u,t={}){let{gen:i,it:n}=e,f=[Ob(n,t),Mb(e,t)];return jb(e,u,f),i.object(...f)}function Ob({errorPath:e},{instancePath:u}){let t=u?(0,he.str)`${e}${(0,ro.getErrorPath)(u,ro.Type.Str)}`:e;return[Et.default.instancePath,(0,he.strConcat)(Et.default.instancePath,t)]}function Mb({keyword:e,it:{errSchemaPath:u}},{schemaPath:t,parentSchema:i}){let n=i?u:(0,he.str)`${u}/${e}`;return t&&(n=(0,he.str)`${n}${(0,ro.getErrorPath)(t,ro.Type.Str)}`),[Ai.schemaPath,n]}function jb(e,{params:u,message:t},i){let{keyword:n,data:f,schemaValue:r,it:o}=e,{opts:a,propertyName:s,topSchemaRef:D,schemaPath:d}=o;i.push([Ai.keyword,n],[Ai.params,typeof u=="function"?u(e):u||(0,he._)`{}`]),a.messages&&i.push([Ai.message,typeof t=="function"?t(e):t]),a.verbose&&i.push([Ai.schema,r],[Ai.parentSchema,(0,he._)`${D}${d}`],[Et.default.data,f]),s&&i.push([Ai.propertyName,s])}});var ad=F(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.boolOrEmptySchema=nn.topBoolOrEmptySchema=void 0;var Nb=Df(),qb=ee(),Vb=Wt(),Rb={message:"boolean schema is false"};function Lb(e){let{gen:u,schema:t,validateName:i}=e;t===!1?od(e,!1):typeof t=="object"&&t.$async===!0?u.return(Vb.default.data):(u.assign((0,qb._)`${i}.errors`,null),u.return(!0))}nn.topBoolOrEmptySchema=Lb;function zb(e,u){let{gen:t,schema:i}=e;i===!1?(t.var(u,!1),od(e)):t.var(u,!0)}nn.boolOrEmptySchema=zb;function od(e,u){let{gen:t,data:i}=e,n={gen:t,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Nb.reportError)(n,Rb,void 0,u)}});var Ts=F(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.getRules=fn.isJSONType=void 0;var Ub=["string","number","integer","boolean","null","object","array"],Hb=new Set(Ub);function Wb(e){return typeof e=="string"&&Hb.has(e)}fn.isJSONType=Wb;function Kb(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:xe(X({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}fn.getRules=Kb});var Ps=F(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.shouldUseRule=ti.shouldUseGroup=ti.schemaHasRulesForType=void 0;function Gb({schema:e,self:u},t){let i=u.RULES.types[t];return i&&i!==!0&&sd(e,i)}ti.schemaHasRulesForType=Gb;function sd(e,u){return u.rules.some(t=>Dd(e,t))}ti.shouldUseGroup=sd;function Dd(e,u){var t;return e[u.keyword]!==void 0||((t=u.definition.implements)===null||t===void 0?void 0:t.some(i=>e[i]!==void 0))}ti.shouldUseRule=Dd});var lf=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.reportTypeError=ct.checkDataTypes=ct.checkDataType=ct.coerceAndCheckDataType=ct.getJSONTypes=ct.getSchemaTypes=ct.DataType=void 0;var Jb=Ts(),Xb=Ps(),Yb=Df(),re=ee(),ld=de(),rn=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(rn||(ct.DataType=rn={}));function Zb(e){let u=dd(e.type);if(u.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!u.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&u.push("null")}return u}ct.getSchemaTypes=Zb;function dd(e){let u=Array.isArray(e)?e:e?[e]:[];if(u.every(Jb.isJSONType))return u;throw new Error("type must be JSONType or JSONType[]: "+u.join(","))}ct.getJSONTypes=dd;function Qb(e,u){let{gen:t,data:i,opts:n}=e,f=eE(u,n.coerceTypes),r=u.length>0&&!(f.length===0&&u.length===1&&(0,Xb.schemaHasRulesForType)(e,u[0]));if(r){let o=Ms(u,i,n.strictNumbers,rn.Wrong);t.if(o,()=>{f.length?tE(e,u,f):js(e)})}return r}ct.coerceAndCheckDataType=Qb;var cd=new Set(["string","number","integer","boolean","null"]);function eE(e,u){return u?e.filter(t=>cd.has(t)||u==="array"&&t==="array"):[]}function tE(e,u,t){let{gen:i,data:n,opts:f}=e,r=i.let("dataType",(0,re._)`typeof ${n}`),o=i.let("coerced",(0,re._)`undefined`);f.coerceTypes==="array"&&i.if((0,re._)`${r} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,re._)`${n}[0]`).assign(r,(0,re._)`typeof ${n}`).if(Ms(u,n,f.strictNumbers),()=>i.assign(o,n))),i.if((0,re._)`${o} !== undefined`);for(let s of t)(cd.has(s)||s==="array"&&f.coerceTypes==="array")&&a(s);i.else(),js(e),i.endIf(),i.if((0,re._)`${o} !== undefined`,()=>{i.assign(n,o),uE(e,o)});function a(s){switch(s){case"string":i.elseIf((0,re._)`${r} == "number" || ${r} == "boolean"`).assign(o,(0,re._)`"" + ${n}`).elseIf((0,re._)`${n} === null`).assign(o,(0,re._)`""`);return;case"number":i.elseIf((0,re._)`${r} == "boolean" || ${n} === null
|
|
3
3
|
|| (${r} == "string" && ${n} && ${n} == +${n})`).assign(o,(0,re._)`+${n}`);return;case"integer":i.elseIf((0,re._)`${r} === "boolean" || ${n} === null
|
|
4
4
|
|| (${r} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(o,(0,re._)`+${n}`);return;case"boolean":i.elseIf((0,re._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(o,!1).elseIf((0,re._)`${n} === "true" || ${n} === 1`).assign(o,!0);return;case"null":i.elseIf((0,re._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(o,null);return;case"array":i.elseIf((0,re._)`${r} === "string" || ${r} === "number"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-QOGMJZDE.js";import"./chunk-YBXEOSR6.js";import{d as w}from"./chunk-X7PVYZAE.js";import{b}from"./chunk-LNUVGJNE.js";import{k,n as S}from"./chunk-APTNRLSD.js";import{a as $,b as T}from"./chunk-LXXELGX4.js";import"./chunk-SRP6QX5M.js";import{Bc as c,Cc as m,Dc as C,Ib as d,Jb as f,Ob as g,Pb as r,Qb as i,Rb as l,Xa as x,Zb as h,ab as n,kc as s,la as a,lc as o,mb as _,xc as y}from"./chunk-SKZUTSHE.js";var I=t=>({command:t});function D(t,u){if(t&1&&(r(0,"div",7),s(1),i()),t&2){let e=h();n(),o(e.error)}}function R(t,u){t&1&&(r(0,"p",9),s(1),c(2,"translate"),i(),r(3,"div",10)(4,"div",11),l(5,"i",12),i()()),t&2&&(n(),o(m(2,1,"restart.please_wait_while_server_restarts")))}function B(t,u){if(t&1&&(r(0,"div",8)(1,"p"),s(2),c(3,"translate"),i(),l(4,"p",13),c(5,"translate"),i()),t&2){let e=h();n(2),o(m(3,2,"platform.docker.server_long_time")),n(2),g("innerHTML",C(5,4,"platform.docker.run_with_restart",y(7,I,e.command)),x)}}var U=(()=>{class t{$api=a(S);$router=a(w);$settings=a(b);$toastr=a(k);$translate=a($);$ws=a(E);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=_({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(p,v){p&1&&(r(0,"div",0)(1,"h3",1),s(2),c(3,"translate"),i()(),r(4,"div",2)(5,"div",3),l(6,"i",4),i(),r(7,"div",5)(8,"h4",6),s(9),c(10,"translate"),i(),d(11,D,2,1,"div",7)(12,R,6,3),d(13,B,6,9,"div",8),i()()),p&2&&(n(2),o(m(3,4,"menu.restart.title")),n(7),o(m(10,6,"platform.docker.title_restarting")),n(2),f(v.error?11:12),n(2),f(v.timeout?13:-1))},dependencies:[T],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{U as ContainerRestartComponent};
|