homebridge-config-ui-x 5.6.2-beta.2 → 5.6.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -0
- package/dist/modules/server/server.controller.js +0 -1
- package/dist/modules/server/server.controller.js.map +1 -1
- package/package.json +5 -5
- package/public/{chunk-WR5TGG72.js → chunk-2AKQTDK2.js} +1 -1
- package/public/chunk-2EXPOLE6.js +1 -0
- package/public/{chunk-IW6DT2SE.js → chunk-36W6YTL5.js} +2 -2
- package/public/{chunk-ZB7TQGBZ.js → chunk-3F5BIND2.js} +1 -1
- package/public/{chunk-5SWVVJSC.js → chunk-3GHYGIKS.js} +1 -1
- package/public/{chunk-BDTKGTOE.js → chunk-4SBLGP5S.js} +1 -1
- package/public/{chunk-RQKVW2ZC.js → chunk-546OL3I5.js} +1 -1
- package/public/{chunk-UIQOZHHM.js → chunk-55Q6EZGV.js} +1 -1
- package/public/{chunk-C6C3NP6I.js → chunk-57USPN63.js} +1 -1
- package/public/chunk-5HTOQ66O.js +1 -0
- package/public/{chunk-EB7E45SR.js → chunk-5U6QEGMI.js} +1 -1
- package/public/{chunk-Y5HOKHBZ.js → chunk-72ARQWTQ.js} +1 -1
- package/public/chunk-7VJ7U6KC.js +1 -0
- package/public/{chunk-ZPG7UZ7W.js → chunk-A36BWWK3.js} +1 -1
- package/public/{chunk-RSBMRMAW.js → chunk-AA4REKSK.js} +1 -1
- package/public/{chunk-OJQXN3QX.js → chunk-AGEX2BP6.js} +1 -1
- package/public/chunk-ARORIS5Y.js +1 -0
- package/public/chunk-AYY2VA7S.js +1 -0
- package/public/{chunk-WKFLDFR6.js → chunk-B3WZBAWL.js} +1 -1
- package/public/{chunk-2FUA6DPF.js → chunk-BOFQVJNK.js} +1 -1
- package/public/chunk-BYLMWAKC.js +1 -0
- package/public/{chunk-LTPFSY7M.js → chunk-DJERPV5R.js} +1 -1
- package/public/{chunk-AFWEHAAR.js → chunk-DVZ3YL7I.js} +1 -1
- package/public/{chunk-RGEY72RU.js → chunk-E762XFMI.js} +1 -1
- package/public/{chunk-JUWNIIQD.js → chunk-EDO563GI.js} +1 -1
- package/public/{chunk-PTNHSUBI.js → chunk-HIPMWDXV.js} +1 -1
- package/public/{chunk-IN3J6C7O.js → chunk-HOXTULXI.js} +1 -1
- package/public/{chunk-PBVR4TJQ.js → chunk-J743S3EV.js} +1 -1
- package/public/{chunk-RICW3V5D.js → chunk-JF53BTNR.js} +1 -1
- package/public/{chunk-OOIVZDCG.js → chunk-JUVYAPCW.js} +1 -1
- package/public/{chunk-NRZKPX6L.js → chunk-JXYRZXHD.js} +1 -1
- package/public/{chunk-B4KF62VC.js → chunk-KT5YSOXO.js} +1 -1
- package/public/{chunk-VX4IHYYQ.js → chunk-N3CNSNVN.js} +1 -1
- package/public/chunk-O3NFPA75.js +1 -0
- package/public/{chunk-OMEIYK6R.js → chunk-OA6WLAM2.js} +1 -1
- package/public/{chunk-NFRK43GL.js → chunk-OVARMF6W.js} +2 -2
- package/public/{chunk-ESIPDXUL.js → chunk-QDMF6BOL.js} +1 -1
- package/public/{chunk-ICDOBRQN.js → chunk-QO4FJH55.js} +1 -1
- package/public/{chunk-R6V2O5RO.js → chunk-RM6ZRRFA.js} +1 -1
- package/public/{chunk-H2GZVBSI.js → chunk-SO446G3M.js} +1 -1
- package/public/{chunk-ZZUUTANK.js → chunk-SOOM4MXN.js} +1 -1
- package/public/{chunk-FD5UNC3T.js → chunk-U7F7IBMH.js} +1 -1
- package/public/{chunk-GHUPITEM.js → chunk-V6PG2WY3.js} +1 -1
- package/public/{chunk-AXNZKZGU.js → chunk-VW52SC3D.js} +1 -1
- package/public/chunk-WSDYJWQD.js +1 -0
- package/public/{chunk-Y4NVDTD6.js → chunk-WXWGOW2V.js} +1 -1
- package/public/chunk-X3WPXPQW.js +1 -0
- package/public/{chunk-PCBKUYD2.js → chunk-YNCF23QK.js} +1 -1
- package/public/{chunk-ECKD2Q3W.js → chunk-YO25OOIG.js} +1 -1
- package/public/{chunk-SDW7ATDJ.js → chunk-Z23NNQSY.js} +1 -1
- package/public/{chunk-FFMVREJO.js → chunk-ZPVJRQ5M.js} +1 -1
- package/public/{chunk-VIEDDNZ4.js → chunk-ZZ3RKEVV.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-KP5N7IBR.js → main-YNYFOLF2.js} +1 -1
- package/public/chunk-5HU6AHKM.js +0 -1
- package/public/chunk-5ZZ7J4SL.js +0 -1
- package/public/chunk-DDPZULEU.js +0 -1
- package/public/chunk-DEBBH3A3.js +0 -1
- package/public/chunk-FUZA2OVQ.js +0 -1
- package/public/chunk-KKZJALOM.js +0 -1
- package/public/chunk-TXTVM2G5.js +0 -1
- package/public/chunk-VY7CS3VD.js +0 -1
- package/public/chunk-XGRVEK24.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r}from"./chunk-6LB7WDKS.js";import{Xa as e,fa as t}from"./chunk-WWMJUVLA.js";var m=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{g as r}from"./chunk-6LB7WDKS.js";import{Xa as e,fa as t}from"./chunk-WWMJUVLA.js";var m=[{path:"",loadComponent:()=>import("./chunk-2EXPOLE6.js").then(o=>o.PowerOptionsComponent)}],n=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[r.forChild(m),r]})}return o})();var d=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[n]})}return o})();export{d as PowerOptionsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l}from"./chunk-3ZU7ZAMP.js";import{l as c}from"./chunk-
|
|
1
|
+
import{g as l}from"./chunk-3ZU7ZAMP.js";import{l as c}from"./chunk-O3NFPA75.js";import{Ga as i,Wa as r,hc as s,mc as a,oc as m,rb as o,ub as p}from"./chunk-WWMJUVLA.js";var f=(e,d)=>({github:e,discord:d}),k=(()=>{class e{linkGithub='<a href="https://github.com/homebridge/homebridge-config-ui-x/issues/new?template=feature-request.yml" target="_blank" rel="noopener noreferrer">GitHub</a>';linkDiscord='<a href="https://discord.gg/kqNCe2D" target="_blank" rel="noopener noreferrer">Discord</a>';static \u0275fac=function(t){return new(t||e)};static \u0275cmp=r({type:e,selectors:[["app-support-banner"]],decls:2,vars:8,consts:[["type","info",1,"mt-3","mb-0","grey-text","small",3,"dismissible","innerHtml"]],template:function(t,n){t&1&&(p(0,"ngb-alert",0),a(1,"translate")),t&2&&o("dismissible",!1)("innerHtml",m(1,2,"common.phrases.support",s(5,f,n.linkGithub,n.linkDiscord)),i)},dependencies:[l,c],encapsulation:2})}return e})();export{k as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as ne,P as oe,a as ue,b as R,c as te,d as b,e as S,f as ie,g as E,h as T,i as W,j as N}from"./chunk-
|
|
1
|
+
import{M as ne,P as oe,a as ue,b as R,c as te,d as b,e as S,f as ie,g as E,h as T,i as W,j as N}from"./chunk-VW52SC3D.js";import{b as D}from"./chunk-2XYBM4MH.js";import{Ac as L,Db as U,Ga as I,Gb as X,Ib as u,La as d,Mc as ee,Tb as F,Tc as A,Ub as _,Vb as w,Wa as O,Wb as Y,Xa as C,a as P,ab as v,b as $,ea as M,fa as y,g as pe,ha as J,ia as G,ja as f,kb as q,n as V,oa as K,pa as Q,rb as a,sb as p,tb as c,ub as g,wc as k,ya as H,yc as Z}from"./chunk-WWMJUVLA.js";var h=pe(ue(),1);function ce(i,n){if(i&1){let s=U();p(0,"button",6),X("click",function(){K(s);let o=u();return Q(o.removeItem())}),p(1,"span",7),w(2,"\xD7"),c(),p(3,"span"),w(4,"Close"),c()()}if(i&2){let s=u();_(s.widgetStyles().__remove_item__),d(3),_(s.widgetStyles().__screen_reader__)}}function me(i,n){if(i&1&&g(0,"p",8),i&2){let s=u(2);_(s.widgetStyles().__help_block__),a("innerHTML",s.options==null?null:s.options.helpBlock,I)}}function he(i,n){if(i&1&&(p(0,"div"),v(1,me,1,3,"p",3),c()),i&2){let s=u();d(),a("ngIf",s.options==null?null:s.options.helpBlock)}}function fe(i,n){if(i&1&&g(0,"label",8),i&2){let s,t=u();_((t.options==null?null:t.options.labelHtmlClass)||""),F("sr-only",t.options==null?null:t.options.notitle),a("innerHTML",t.options==null?null:t.options.title,I),q("for","control"+((s=t.layoutNode())==null?null:s._id))}}function ge(i,n){if(i&1&&(p(0,"p")(1,"strong"),w(2,"*"),c(),w(3," = required fields "),c()),i&2){let s=u();d(),_(s.widgetStyles().__required_asterisk__)}}function _e(i,n){if(i&1&&g(0,"span",8),i&2){let s=u();_(s.widgetStyles().__field_addon_left__),a("innerHTML",s.options==null?null:s.options.fieldAddonLeft,I)}}function be(i,n){if(i&1&&g(0,"span",8),i&2){let s=u();_(s.widgetStyles().__field_addon_right__),a("innerHTML",s.options==null?null:s.options.fieldAddonRight,I)}}function ye(i,n){if(i&1&&g(0,"span",9),i&2){let s=u();F("glyphicon-ok",(s.options==null?null:s.options.enableSuccessState)&&!(s.formControl!=null&&s.formControl.errors))("glyphicon-remove",(s.options==null?null:s.options.enableErrorState)&&(s.formControl==null?null:s.formControl.errors))}}function Ce(i,n){if(i&1&&g(0,"p",8),i&2){let s=u(2);_(s.widgetStyles().__help_block__),a("innerHTML",s.options==null?null:s.options.helpBlock,I)}}function ve(i,n){if(i&1&&(p(0,"div"),v(1,Ce,1,3,"p",3),c()),i&2){let s=u();d(),a("ngIf",s.options==null?null:s.options.helpBlock)}}function ke(i,n){if(i&1&&(p(0,"div"),w(1,"debug: "),p(2,"pre"),w(3),c()()),i&2){let s=u();d(3),Y(s.debugOutput)}}var j=(()=>{let n=class n{constructor(){this.frameworkThemeSubject=new V,this.frameworkTheme$=this.frameworkThemeSubject.asObservable()}requestThemeChange(t){this.frameworkThemeSubject.next(t),this.activeRequestedTheme=t}getActiveRequestedTheme(){return this.activeRequestedTheme}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=M({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),B=(()=>{let n=class n{applyCssClasses(t,o,e){let r=this.widgetStyles()[t];(!r||h.default.isEmpty(r))&&(r=this.widgetStyles().default),Object.keys(r).forEach(l=>{let m=r[l];m.length&&(o[l]=b(o[l],m)),e&&(o[l]=b(o[l],e))})}flattenWidgetStyles(t){var o={};let e=["__themes__"];return Object.keys(t).forEach(r=>{let l=t[r];if(e.indexOf(r)>=0){o[r]=l;return}h.default.isArray(l)&&(o[r]=l.join(" ")),h.default.isObject(l)&&(o[r]=o[r]||{},Object.keys(l).forEach(m=>{let x=l[m];h.default.isArray(x)?o[r][m]=x.join(" "):o[r][m]=x})),h.default.isString(l)&&(o[r]=l)}),o}constructor(){this.changeDetector=f(L),this.jsf=f(S),this.jsfFLService=f(T),this.cssFWService=f(j),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.layoutNode=k(void 0),this.layoutIndex=k(void 0),this.dataIndex=k(void 0),this.widgetStyles=Z(void 0),this.defaultStyling={array:{},default:{fieldHtmlClass:"cssfw-form-control"},__themes__:[{name:"notheme",text:"None"}],__remove_item__:"cssfw-remove-item",__array_item_nonref__:{htmlClass:"cssfw-array-item-nonref"},__active__:{activeClass:"cssfw-active"},__array__:{htmlClass:"cssfw-array"},__control_label__:{labelHtmlClass:"cssfw-control-label"},__form_group__:{htmlClass:"cssfw-form-group"},__field_addon_left__:"cssfw-addon-left",__field_addon_right__:"cssfw-addon-right",__help_block__:"cssfw-help-block",__required_asterisk__:"cssfw-required-astersisk",__screen_reader__:"cssfw-screen-reader"};let t=this.cssFWService,e=this.jsfFLService.activeFramework.config||{};this.widgetStyles.set(Object.assign(this.defaultStyling,e.widgetstyles));let r=this.widgetStyles().__themes__[0],l=t.activeRequestedTheme||r.name;this.theme=this.options?.theme||l,this.frameworkThemeSubs=t.frameworkTheme$.subscribe(m=>{this.theme=m})}ngOnDestroy(){this.frameworkThemeSubs.unsubscribe(),this.frameworkThemeSubs=null}get showRemoveButton(){let t=this.layoutNode();return!this.options.removable||this.options.readonly||t.type==="$ref"?!1:t.recursiveReference?!0:!t.arrayItem||!this.parentArray||this.parentArray.items.length-1<=this.parentArray.options.minItems?!1:t.arrayItemType==="list"?!0:this.layoutIndex()[this.layoutIndex().length-1]===this.parentArray.items.length-2}ngOnInit(){this.initializeFramework();let t=this.layoutNode();t.arrayItem&&t.type!=="$ref"&&(this.parentArray=this.jsf.getParentNode(this),this.parentArray&&(this.isOrderable=t.arrayItemType==="list"&&!this.options.readonly&&this.parentArray.options.orderable))}ngOnChanges(){this.frameworkInitialized||this.initializeFramework()}initializeFramework(){let t=this.layoutNode();if(t){if(this.options=(0,h.cloneDeep)(t.options),this.widgetLayoutNode=$(P({},t),{options:(0,h.cloneDeep)(t.options)}),this.widgetOptions=this.widgetLayoutNode.options,this.formControl=this.jsf.getFormControl(this),this.options.isInputWidget=te(t.type,["button","checkbox","checkboxes-inline","checkboxes","color","date","datetime-local","datetime","email","file","hidden","image","integer","month","number","password","radio","radiobuttons","radios-inline","radios","range","reset","search","select","submit","tel","text","textarea","time","url","week"]),this.options.title=this.setTitle(),this.options.htmlClass=b(this.options.htmlClass,"schema-form-"+t.type),t.type==="array"?this.options.htmlClass=b(this.options.htmlClass,this.widgetStyles().__array__.htmlClass):t.arrayItem&&t.type!=="$ref"?this.options.htmlClass=b(this.options.htmlClass,this.widgetStyles().__array_item_nonref__.htmlClass):this.options.htmlClass=b(this.options.htmlClass,this.widgetStyles().__form_group__.htmlClass),this.widgetOptions.htmlClass="",this.options.labelHtmlClass=b(this.options.labelHtmlClass,this.widgetStyles().__control_label__.labelHtmlClass),this.widgetOptions.activeClass=b(this.widgetOptions.activeClass,this.widgetStyles().__active__.activeClass),this.options.fieldAddonLeft=this.options.fieldAddonLeft||this.options.prepend,this.options.fieldAddonRight=this.options.fieldAddonRight||this.options.append,this.options.title&&t.type!=="tab"&&!this.options.notitle&&this.options.required&&!this.options.title.includes("*")){let o=this.widgetStyles().__required_asterisk__||"text-danger";this.options.title+=` <strong class="${o}">*</strong>`}if(t.type=="optionfieldset"&&(this.options.messageLocation="top"),this.applyCssClasses(t.type,this.widgetOptions,this.options.style),this.formControl&&(this.updateHelpBlock(this.formControl.status),this.formControl.statusChanges.subscribe(o=>this.updateHelpBlock(o)),this.options.debug)){let o=[];this.debugOutput=(0,h.map)(o,e=>JSON.stringify(e,null,2)).join(`
|
|
2
2
|
`)}this.frameworkInitialized=!0}}updateHelpBlock(t){this.options.helpBlock=t==="INVALID"&&this.options.enableErrorState&&this.formControl.errors&&(this.formControl.dirty||this.options.feedbackOnRender)?this.jsf.formatErrors(this.formControl.errors,this.options.validationMessages):this.options.description||this.options.help||null}setTitle(){switch(this.layoutNode().type){case"button":case"checkbox":case"section":case"help":case"msg":case"submit":case"message":case"tabarray":case"tabs":case"$ref":return null;case"advancedfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Advanced options",null;case"authfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Authentication settings",null;case"fieldset":return this.widgetOptions.title=this.options.title,null;case"array":return this.widgetOptions.title=this.options.title,null;default:return this.widgetOptions.title=null,this.jsf.setItemTitle(this)}}removeItem(){this.jsf.removeItem(this)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=O({type:n,selectors:[["css-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"],widgetStyles:[1,"widgetStyles"]},outputs:{widgetStyles:"widgetStylesChange"},standalone:!1,features:[H],decls:12,vars:24,consts:[["type","button",3,"class","click",4,"ngIf"],[4,"ngIf"],[3,"class","sr-only","innerHTML",4,"ngIf"],[3,"class","innerHTML",4,"ngIf"],[3,"layoutNode","dataIndex","layoutIndex"],["aria-hidden","true","class","form-control-feedback glyphicon",3,"glyphicon-ok","glyphicon-remove",4,"ngIf"],["type","button",3,"click"],["aria-hidden","true"],[3,"innerHTML"],["aria-hidden","true",1,"form-control-feedback","glyphicon"]],template:function(o,e){if(o&1&&(p(0,"div"),v(1,ce,5,4,"button",0)(2,he,2,1,"div",1)(3,fe,1,6,"label",2)(4,ge,4,2,"p",1),p(5,"div"),v(6,_e,1,3,"span",3),g(7,"select-widget-widget",4),v(8,be,1,3,"span",3),c(),v(9,ye,1,4,"span",5)(10,ve,2,1,"div",1),c(),v(11,ke,4,1,"div",1)),o&2){let r,l,m,x;_((e.options==null?null:e.options.htmlClass)||""),F("has-feedback",(e.options==null?null:e.options.feedback)&&(e.options==null?null:e.options.isInputWidget)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-error",(e.options==null?null:e.options.enableErrorState)&&(e.formControl==null?null:e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-success",(e.options==null?null:e.options.enableSuccessState)&&!(e.formControl!=null&&e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender))),q("data-bs-theme",e.theme)("data-theme",e.theme),d(),a("ngIf",e.showRemoveButton),d(),a("ngIf",(e.options==null?null:e.options.messageLocation)==="top"&&((r=e.layoutNode())==null?null:r.type)!=="array"),d(),a("ngIf",(e.options==null?null:e.options.title)&&((l=e.layoutNode())==null?null:l.type)!=="tab"&&((l=e.layoutNode())==null?null:l.type)!=="array"),d(),a("ngIf",((m=e.layoutNode())==null?null:m.type)==="submit"&&(e.jsf==null||e.jsf.formOptions==null?null:e.jsf.formOptions.fieldsRequired)),d(),F("input-group",(e.options==null?null:e.options.fieldAddonLeft)||(e.options==null?null:e.options.fieldAddonRight)),d(),a("ngIf",e.options==null?null:e.options.fieldAddonLeft),d(),a("layoutNode",e.widgetLayoutNode)("dataIndex",e.dataIndex())("layoutIndex",e.layoutIndex()),d(),a("ngIf",e.options==null?null:e.options.fieldAddonRight),d(),a("ngIf",(e.options==null?null:e.options.feedback)&&(e.options==null?null:e.options.isInputWidget)&&!(e.options!=null&&e.options.fieldAddonRight)&&!e.layoutNode().arrayItem&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender))),d(),a("ngIf",(e.options==null?null:e.options.messageLocation)!=="top"&&((x=e.layoutNode())==null?null:x.type)!=="array"),d(),a("ngIf",e.debug&&e.debugOutput)}},dependencies:[ie,ee],styles:[`:host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.checkbox-inline,.checkbox-inline+.checkbox-inline,.checkbox-inline+.radio-inline,.radio-inline,.radio-inline+.radio-inline,.radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}.checkbox-inline:last-child,.radio-inline:last-child{margin-right:0}.ng-invalid.ng-touched{border:1px solid #f44336}
|
|
3
3
|
`],encapsulation:2});let i=n;return i})(),we=new J("CSS_FRAMEWORK_CFG"),se;(function(i){class n{}i.csscategories=n})(se||(se={}));var le=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=C({type:n}),n.\u0275inj=y({providers:[S,T,E,j],imports:[N,A,W]});let i=n;return i})(),re=(()=>{let n=class n extends R{constructor(t){super(),this.cssFWService=f(j),this.name="css",this.framework=B,this.name=t.name,this.text=t.text||this.name,this.stylesheets=t.stylesheets,this.scripts=t.scripts,this.config=t,this.widgets=t.widgets}getActiveTheme(){let t=this.cssFWService.getActiveRequestedTheme(),o=this.config?.widgetstyles?.__themes__,e=o&&o[0];if(t&&(e={name:t,text:t},o)){let r=o.filter(l=>l.name==t);e=r&&r[0]||e}return e}requestThemeChange(t){this.cssFWService.requestThemeChange(t)}registerTheme(t,o=!0){let r=(this.config?.widgetstyles?.__themes__||[]).filter(l=>t.name==l.name);if(r&&r[0]){if(o)return r[0].text=t.text,!0;if(!o)return!1}if(!r||r.length==0){let l=this.config;return l.widgetstyles=this.config.widgetstyles||{},l.widgetstyles.__themes__=l.widgetstyles.__themes__||[],l.widgetstyles.__themes__.push(t),!0}}unregisterTheme(t){let o=this.config?.widgetstyles?.__themes__,e=-1;return o&&(o.forEach((r,l)=>{t==r.name&&(e=l)}),e>=0)?(o.splice(e,1),!0):!1}getConfig(){return this.config}};n.\u0275fac=function(o){return new(o||n)(G(we))},n.\u0275prov=M({token:n,factory:n.\u0275fac});let i=n;return i})();var Ie=(()=>{let n=class n{constructor(){this.changeDetector=f(L),this.jsf=f(S),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.layoutNode=k(void 0),this.layoutIndex=k(void 0),this.dataIndex=k(void 0)}ngOnInit(){}ngOnChanges(){}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=O({type:n,selectors:[["bootstrap-5-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[H],decls:2,vars:3,consts:[[3,"layoutNode","layoutIndex","dataIndex"]],template:function(o,e){o&1&&(p(0,"div"),g(1,"css-framework",0),c()),o&2&&(d(),a("layoutNode",e.layoutNode())("layoutIndex",e.layoutIndex())("dataIndex",e.dataIndex()))},dependencies:[B],styles:[`:host ::ng-deep .list-group-item .list-group-item-hb .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.input-group .form-control:first-child,.input-group-text:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text:first-child{border-right:0}.input-group .form-control:last-child,.input-group-text:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text:last-child{border-left:0}.input-group .form-control:not(:first-child):not(:last-child),.input-group-text:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.btn-close>span:first-child{display:none}
|
|
4
4
|
`],encapsulation:2});let i=n;return i})(),Se={name:"bootstrap-5",text:"Bootstrap 5",scripts:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"],stylesheets:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"],widgetstyles:{__themes__:[{name:"bootstrap5_default",text:"Bootstrap5 default"},{name:"dark",text:"Dark"},{name:"light",text:"Light"}],$ref:{fieldHtmlClass:"btn btn-primary"},__array_item_nonref__:{htmlClass:"list-group-item list-group-item-hb"},__form_group__:{htmlClass:"form-group"},__control_label__:{labelHtmlClass:"control-label"},__active__:{activeClass:"active"},__required_asterisk__:"text-danger",__screen_reader__:"visually-hidden",__remove_item__:"btn-close float-end",__help_block__:"help-block grey-text small",__field_addon_left__:"input-group-text",__field_addon_right__:"input-group-text","alt-date":{},"alt-datetime":{},__array__:{htmlClass:"list-group list-group-hb"},array:{},authfieldset:{},advancedfieldset:{},button:{fieldHtmlClass:"btn btn-sm btn-primary"},checkbox:{fieldHtmlClass:"form-check-input"},checkboxes:{fieldHtmlClass:"form-check-input"},checkboxbuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},"checkboxes-inline":{htmlClass:"form-check-input",itemLabelHtmlClass:"form-check-inline"},date:{},"datetime-local":{},fieldset:{},integer:{},number:{},optionfieldset:{},password:{},radiobuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},radio:{fieldHtmlClass:"form-check-input"},radios:{fieldHtmlClass:"form-check-input"},"radios-inline":{htmlClass:"form-check form-check-inline",itemLabelHtmlClass:"form-check-label"},range:{},section:{},selectfieldset:{},select:{fieldHtmlClass:"form-select"},submit:{fieldHtmlClass:"btn btn-primary"},text:{},tabs:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},tabarray:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},"one-of":{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},textarea:{},default:{fieldHtmlClass:"form-control"}}},Me=(()=>{let n=class n extends re{constructor(){let t=f(j);super(Se),this.framework=Ie,this.cssFWService=t}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=M({token:n,factory:n.\u0275fac});let i=n;return i})(),ae=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=C({type:n}),n.\u0275inj=y({providers:[S,T,E,{provide:R,useClass:Me,multi:!0}],imports:[N,A,W,le,N]});let i=n;return i})();var de=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=C({type:i});static \u0275inj=y({providers:[ne],imports:[ae,D]})}return i})();var it=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=C({type:i});static \u0275inj=y({providers:[oe],imports:[D,de]})}return i})();export{it as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$c as zt,Ac as Kt,B as at,C as lt,D as Pt,Db as Tt,Fa as Ht,Fb as $t,Ga as gt,Gb as V,Ib as f,L as Mt,La as a,Mc as Ct,Na as Bt,O as P,Qa as L,Sb as $,Ub as v,Vb as b,Wa as mt,X as ut,Xa as vt,Xb as x,Za as Vt,_ as ct,a as c,ab as N,b as F,cb as bt,e as ne,ea as d,fa as ht,ha as Y,ia as S,id as qt,ja as u,jb as W,ka as Nt,kb as H,n as p,oa as dt,pa as ft,r as k,rb as h,sa as J,sb as g,t as D,ta as pt,tb as m,ub as B,wa as M,x as ot,yb as _t,za as Q,zb as yt}from"./chunk-WWMJUVLA.js";var Xt=ne((Li,Ne)=>{Ne.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.6.2-beta.3",description:"A web based management, configuration and control platform for Homebridge.",author:"oznu <dev@oz.nu>",license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/oznu"},{type:"paypal",url:"https://paypal.me/oznu"}],repository:{type:"git",url:"git+https://github.com/homebridge/homebridge-config-ui-x.git"},bugs:{url:"https://github.com/homebridge/homebridge-config-ui-x/issues"},keywords:["homebridge-plugin","ui","gui","web","homebridge","homebridge-config-ui-x","ui-x","config-ui-x","homebridge-x","homebridge server","homebridge ui","homebridge-ui","homebridge gui","homebridge-gui","web interface","config ui","management","config editor","linux","macOS","osx","windows","raspberry pi","accessory control","smart home","hb-service"],main:"./dist/index.js",bin:{"hb-service":"dist/bin/hb-service.js"},engines:{node:"^20.19.0 || ^22.12.0 || ^24.0.0",homebridge:"^1.8.0 || ^2.0.0-alpha.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"13.0.1","@fastify/multipart":"9.2.1","@fastify/static":"8.2.0","@homebridge/hap-client":"3.1.2","@homebridge/node-pty-prebuilt-multiarch":"0.13.1","@nestjs/axios":"4.0.1","@nestjs/common":"11.1.6","@nestjs/core":"11.1.6","@nestjs/jwt":"11.0.0","@nestjs/passport":"11.0.5","@nestjs/platform-fastify":"11.1.6","@nestjs/platform-socket.io":"11.1.6","@nestjs/swagger":"11.2.0","@nestjs/websockets":"11.1.6",axios:"1.12.2","bash-color":"0.0.4","bonjour-service":"^1.3.0","class-transformer":"0.5.1","class-validator":"0.14.2",commander:"14.0.1",dayjs:"1.11.18",fastify:"5.6.0","fs-extra":"^11.3.2",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"9.0.0",otplib:"12.0.1","p-limit":"7.1.1",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.2",semver:"7.7.2",systeminformation:"5.27.10",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^5.3.0","@nestjs/testing":"^11.1.6","@prettier/plugin-xml":"^3.4.2","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.20","@types/node":"^24.5.0","@types/node-schedule":"^2.1.8","@types/passport-jwt":"^4.0.1","@types/semver":"^7.7.1","@types/tail":"^2.2.3","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.11","@vitest/coverage-v8":"^3.2.4",concurrently:"^9.2.1","eslint-plugin-format":"^1.0.1","form-data":"^4.0.4",nodemon:"^3.1.10",rimraf:"^6.0.1","ts-loader":"^9.5.4","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.9.2","unplugin-swc":"^1.5.7",vitest:"^3.2.4"},overrides:{"@homebridge/hap-client":{axios:"1.12.2"},"@nestjs/platform-fastify":{fastify:"5.6.0"}},maintainers:[{email:"bwp91@icloud.com",name:"bwp91"},{email:"dev@oz.nu",name:"oznu"},{email:"northern.man1@gmail.com",name:"northernman"},{email:"mail@anderl-bauer.de",name:"supereg"},{email:"khaos.tian@gmail.com",name:"khaost"},{email:"erik.baauw@xs4all.nl",name:"ebaauw"},{email:"donavan.becker@icloud.com",name:"donavanbecker"},{email:"dustin.greif@gmail.com",name:"dustin.greif"},{email:"nfarina@gmail.com",name:"nfarina"}],scarfSettings:{enabled:!1}}});var y=(function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e})(y||{}),se="*";function Lt(e,n){return{type:y.Trigger,name:e,definitions:n,options:{}}}function X(e,n=null){return{type:y.Animate,styles:n,timings:e}}function He(e,n=null){return{type:y.Sequence,steps:e,options:n}}function K(e){return{type:y.Style,styles:e,offset:null}}function z(e,n,t){return{type:y.State,name:e,styles:n,options:t}}function tt(e,n,t=null){return{type:y.Transition,expr:e,animation:n,options:t}}var wt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(n=0,t=0){this.totalTime=n+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(n){this._position=this.totalTime?n*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Dt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(n){this.players=n;let t=0,i=0,s=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++i==r&&this._onDestroy()}),o.onStart(()=>{++s==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,l)=>Math.max(o,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this.players.forEach(n=>n.init())}onStart(n){this._onStartFns.push(n)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(n=>n()),this._onStartFns=[])}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(n=>n.play())}pause(){this.players.forEach(n=>n.pause())}restart(){this.players.forEach(n=>n.restart())}finish(){this._onFinish(),this.players.forEach(n=>n.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(n=>n.destroy()),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this.players.forEach(n=>n.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(n){let t=n*this.totalTime;this.players.forEach(i=>{let s=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(s)})}getPosition(){let n=this.players.reduce((t,i)=>t===null||i.totalTime>t.totalTime?i:t,null);return n!=null?n.getPosition():0}beforeDestroy(){this.players.forEach(n=>{n.beforeDestroy&&n.beforeDestroy()})}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},re="!";var G=class{},le=(()=>{class e{handle(t){return t.key}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),O=class{},ue=(()=>{class e extends O{compile(t,i){return t}compileTranslations(t,i){return t}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),E=class{},ce=(()=>{class e extends E{getTranslation(t){return k({})}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function et(e,n){if(e===n)return!0;if(e===null||n===null)return!1;if(e!==e&&n!==n)return!0;let t=typeof e,i=typeof n,s;if(t==i&&t=="object")if(Array.isArray(e)){if(!Array.isArray(n))return!1;if((s=e.length)==n.length){for(let r=0;r<s;r++)if(!et(e[r],n[r]))return!1;return!0}}else{if(Array.isArray(n))return!1;if(_(e)&&_(n)){let r=Object.create(null);for(let o in e){if(!et(e[o],n[o]))return!1;r[o]=!0}for(let o in n)if(!(o in r)&&typeof n[o]<"u")return!1;return!0}}return!1}function T(e){return typeof e<"u"&&e!==null}function Zt(e){return e!==void 0}function _(e){return Z(e)&&!I(e)&&e!==null}function Z(e){return typeof e=="object"&&e!==null}function I(e){return Array.isArray(e)}function it(e){return typeof e=="string"}function he(e){return typeof e=="function"}function nt(e){if(I(e))return e.map(n=>nt(n));if(_(e)){let n={};return Object.keys(e).forEach(t=>{n[t]=nt(e[t])}),n}else return e}function St(e,n){if(!Z(e))return nt(n);let t=nt(e);return Z(t)&&Z(n)&&Object.keys(n).forEach(i=>{_(n[i])?i in e?t[i]=St(e[i],n[i]):Object.assign(t,{[i]:n[i]}):Object.assign(t,{[i]:n[i]})}),t}function Ut(e,n){let t=n.split(".");n="";do{n+=t.shift();let i=!t.length;if(T(e)){if(_(e)&&Zt(e[n])&&(_(e[n])||I(e[n])||i)){e=e[n],n="";continue}if(I(e)){let s=parseInt(n,10);if(Zt(e[s])&&(_(e[s])||I(e[s])||i)){e=e[s],n="";continue}}}if(i){e=void 0;continue}n+="."}while(t.length);return e}function de(e,n,t){return St(e,fe(n,t))}function fe(e,n){return e.split(".").reduceRight((t,i)=>({[i]:t}),n)}var A=class{},pe=(()=>{class e extends A{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(t,i){if(it(t))return this.interpolateString(t,i);if(he(t))return this.interpolateFunction(t,i)}interpolateFunction(t,i){return t(i)}interpolateString(t,i){return i?t.replace(this.templateMatcher,(s,r)=>{let o=this.getInterpolationReplacement(i,r);return o!==void 0?o:s}):t}getInterpolationReplacement(t,i){return this.formatValue(Ut(t,i))}formatValue(t){if(it(t))return t;if(typeof t=="number"||typeof t=="boolean")return t.toString();if(t===null)return"null";if(I(t))return t.join(", ");if(Z(t))return typeof t.toString=="function"&&t.toString!==Object.prototype.toString?t.toString():JSON.stringify(t)}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),xt=(()=>{class e{_onTranslationChange=new p;_onLangChange=new p;_onFallbackLangChange=new p;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(t){return this.translations[t]}setTranslations(t,i,s){this.translations[t]=s&&this.hasTranslationFor(t)?St(this.translations[t],i):i,this.addLanguages([t]),this._onTranslationChange.next({lang:t,translations:this.getTranslations(t)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(t,i=!0){this.fallbackLang=t,i&&this._onFallbackLangChange.next({lang:t,translations:this.translations[t]})}setCurrentLang(t,i=!0){this.currentLang=t,i&&this._onLangChange.next({lang:t,translations:this.translations[t]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(t){this.languages=Array.from(new Set([...this.languages,...t]))}hasTranslationFor(t){return typeof this.translations[t]<"u"}deleteTranslations(t){delete this.translations[t]}getTranslation(t){let i=this.getValue(this.currentLang,t);return i===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(i=this.getValue(this.fallbackLang,t)),i}getValue(t,i){return Ut(this.getTranslations(t),i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),It=new Y("TRANSLATE_CONFIG"),q=e=>D(e)?e:k(e);var Ft=(()=>{class e{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=u(E);compiler=u(O);parser=u(A);missingTranslationHandler=u(G);store=u(xt);extend=!1;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onFallbackLangChange(){return this.store.onFallbackLangChange}get onDefaultLangChange(){return this.store.onFallbackLangChange}constructor(){let t=c({extend:!1,fallbackLang:null},u(It,{optional:!0}));t.lang&&this.use(t.lang),t.fallbackLang&&this.setFallbackLang(t.fallbackLang),t.extend&&(this.extend=!0)}setFallbackLang(t){this.getFallbackLang()||this.store.setFallbackLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.store.setFallbackLang(t)},error:()=>{}}),i):(this.store.setFallbackLang(t),k(this.store.getTranslations(t)))}use(t){this.lastUseLanguage=t,this.getCurrentLang()||this.store.setCurrentLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.changeLang(t)},error:()=>{}}),i):(this.changeLang(t),k(this.store.getTranslations(t)))}loadOrExtendLanguage(t){if(!this.store.hasTranslationFor(t)||this.extend)return this._translationRequests[t]=this._translationRequests[t]||this.loadAndCompileTranslations(t),this._translationRequests[t]}changeLang(t){t===this.lastUseLanguage&&this.store.setCurrentLang(t)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(t){this.pending=!0;let i=this.currentLoader.getTranslation(t).pipe(ut(1),P(1));return this.loadingTranslations=i.pipe(ot(s=>this.compiler.compileTranslations(s,t)),ut(1),P(1)),this.loadingTranslations.subscribe({next:s=>{this.store.setTranslations(t,s,this.extend),this.pending=!1},error:s=>{this.pending=!1}}),i}setTranslation(t,i,s=!1){let r=this.compiler.compileTranslations(i,t);this.store.setTranslations(t,r,s||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(t){this.store.addLanguages(t)}getParsedResultForKey(t,i){let s=this.getTextToInterpolate(t);if(T(s))return this.runInterpolation(s,i);let r=this.missingTranslationHandler.handle(c({key:t,translateService:this},i!==void 0&&{interpolateParams:i}));return r!==void 0?r:t}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(t){return this.store.getTranslation(t)}runInterpolation(t,i){if(T(t))return I(t)?this.runInterpolationOnArray(t,i):_(t)?this.runInterpolationOnDict(t,i):this.parser.interpolate(t,i)}runInterpolationOnArray(t,i){return t.map(s=>this.runInterpolation(s,i))}runInterpolationOnDict(t,i){let s={};for(let r in t){let o=this.runInterpolation(t[r],i);o!==void 0&&(s[r]=o)}return s}getParsedResult(t,i){return t instanceof Array?this.getParsedResultForArray(t,i):this.getParsedResultForKey(t,i)}getParsedResultForArray(t,i){let s={},r=!1;for(let l of t)s[l]=this.getParsedResultForKey(l,i),r=r||D(s[l]);if(!r)return s;let o=t.map(l=>q(s[l]));return Pt(o).pipe(ot(l=>{let C={};return l.forEach((U,w)=>{C[t[w]]=U}),C}))}get(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(Mt(()=>q(this.getParsedResult(t,i)))):q(this.getParsedResult(t,i))}getStreamOnTranslationChange(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return at(lt(()=>this.get(t,i)),this.onTranslationChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}stream(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" required');return at(lt(()=>this.get(t,i)),this.onLangChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}instant(t,i){if(!T(t)||t.length===0)throw new Error('Parameter "key" is required and cannot be empty');let s=this.getParsedResult(t,i);return D(s)?Array.isArray(t)?t.reduce((r,o)=>(r[o]=o,r),{}):t:s}set(t,i,s=this.getCurrentLang()){this.store.setTranslations(s,de(this.store.getTranslations(s),t,it(i)?this.compiler.compile(i,s):this.compiler.compileTranslations(i,s)),!1)}reloadLang(t){return this.resetLang(t),this.loadAndCompileTranslations(t)}resetLang(t){delete this._translationRequests[t],this.store.deleteTranslations(t)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let t=this.getBrowserCultureLang();return t?t.split(/[-_]/)[0]:void 0}static getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}getBrowserLang(){return e.getBrowserLang()}getBrowserCultureLang(){return e.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(t){return this.setFallbackLang(t)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();var Ye=(()=>{class e{translate=u(Ft);_ref=u(Kt);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(t,i,s){let r=o=>{this.value=o!==void 0?o:t,this.lastKey=t,this._ref.markForCheck()};if(s){let o=this.translate.getParsedResult(t,i);D(o)?o.subscribe(r):r(o)}this.translate.get(t,i).subscribe(r)}transform(t,...i){if(!t||!t.length)return t;if(et(t,this.lastKey)&&et(i,this.lastParams))return this.value;let s;if(T(i[0])&&i.length)if(it(i[0])&&i[0].length){let r=i[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{s=JSON.parse(r)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${i[0]}`)}}else _(i[0])&&(s=i[0]);return this.lastKey=t,this.lastParams=i,this.updateValue(t,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(r=>{(this.lastKey&&r.lang===this.translate.getCurrentLang()||r.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(r=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onFallbackLangChange<"u"&&(this.onFallbackLangChange.unsubscribe(),this.onFallbackLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=Vt({name:"translate",type:e,pure:!1});static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function ge(e){return{provide:E,useClass:e}}function me(e){return{provide:O,useClass:e}}function ve(e){return{provide:A,useClass:e}}function be(e){return{provide:G,useClass:e}}function Je(e={}){return _e(c({compiler:me(ue),parser:ve(pe),loader:ge(ce),missingTranslationHandler:be(le)},e),!0)}function _e(e={},n){let t=[];e.loader&&t.push(e.loader),e.compiler&&t.push(e.compiler),e.parser&&t.push(e.parser),e.missingTranslationHandler&&t.push(e.missingTranslationHandler),n&&t.push(xt),(e.useDefaultLang||e.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),e.useDefaultLang===!0&&e.defaultLanguage&&(e.fallbackLang=e.defaultLanguage));let i={fallbackLang:e.fallbackLang??null,lang:e.lang,extend:e.extend??!1};return t.push({provide:It,useValue:i}),t.push({provide:Ft,useClass:Ft,deps:[xt,E,O,A,G,It]}),t}var Yt=["toast-component",""];function ye(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Te(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Ce(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Te,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function we(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function De(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Le(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}function xe(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Ie(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Fe(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Ie,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function Se(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function Oe(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Ee(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}var Ot=class{_attachedHost;component;viewContainerRef;injector;constructor(n,t){this.component=n,this.injector=t}attach(n,t){return this._attachedHost=n,n.attach(this,t)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},Et=class{_attachedPortal;_disposeFn;attach(n,t){return this._attachedPortal=n,this.attachComponentPortal(n,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},At=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new p;_activate=new p;_manualClose=new p;_resetTimeout=new p;_countDuplicate=new p;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,t){n&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},j=class{toastId;config;message;title;toastType;toastRef;_onTap=new p;_onAction=new p;constructor(n,t,i,s,r,o){this.toastId=n,this.config=t,this.message=i,this.title=s,this.toastType=r,this.toastRef=o,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},Jt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Qt=new Y("ToastConfig"),jt=class extends Et{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,t,i){super(),this._hostDomElement=n,this._componentFactoryResolver=t,this._appRef=i}attachComponentPortal(n,t){let i=this._componentFactoryResolver.resolveComponentFactory(n.component),s;return s=i.create(n.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ae=(()=>{class e{_document=u(pt);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Rt=class{_portalHost;constructor(n){this._portalHost=n}attach(n,t=!0){return this._portalHost.attach(n,t)}detach(){return this._portalHost.detach()}},je=(()=>{class e{_overlayContainer=u(Ae);_componentFactoryResolver=u(Bt);_appRef=u(W);_document=u(pt);_paneElements=new Map;create(t,i){return this._createOverlayRef(this.getPaneElement(t,i))}getPaneElement(t="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[t]||(this._paneElements.get(i)[t]=this._createPaneElement(t,i)),this._paneElements.get(i)[t]}_createPaneElement(t,i){let s=this._document.createElement("div");return s.id="toast-container",s.classList.add(t),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(t){return new jt(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new Rt(this._createPortalHost(t))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Wt=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,i,s,r,o){this.overlay=i,this._injector=s,this.sanitizer=r,this.ngZone=o,this.toastrConfig=c(c({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=c(c({},t.default.iconClasses),t.config.iconClasses))}show(t,i,s={},r=""){return this._preBuildNotification(r,t,i,this.applyConfig(s))}success(t,i,s={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}error(t,i,s={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}info(t,i,s={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}warning(t,i,s={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}clear(t){for(let i of this.toasts)if(t!==void 0){if(i.toastId===t){i.toastRef.manualClose();return}}else i.toastRef.manualClose()}remove(t){let i=this._findToast(t);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let s=this.toasts[this.currentlyActive].toastRef;s.isInactive()||(this.currentlyActive=this.currentlyActive+1,s.activate())}return!0}findDuplicate(t="",i="",s,r){let{includeTitleDuplicates:o}=this.toastrConfig;for(let l of this.toasts){let C=o&&l.title===t;if((!o||C)&&l.message===i)return l.toastRef.onDuplicate(s,r),l}return null}applyConfig(t={}){return c(c({},this.toastrConfig),t)}_findToast(t){for(let i=0;i<this.toasts.length;i++)if(this.toasts[i].toastId===t)return{index:i,activeToast:this.toasts[i]};return null}_preBuildNotification(t,i,s,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,i,s,r)):this._buildNotification(t,i,s,r)}_buildNotification(t,i,s,r){if(!r.toastComponent)throw new Error("toastComponent required");let o=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&o!==null)return o;this.previousToastMessage=i;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let C=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let U=i;i&&r.enableHtml&&(U=this.sanitizer.sanitize(Ht.HTML,i));let w=new At(C),st=new j(this.index,r,U,s,t,w),te=[{provide:j,useValue:st}],ee=J.create({providers:te,parent:this._injector}),ie=new Ot(r.toastComponent,ee),kt=C.attach(ie,r.newestOnTop);w.componentInstance=kt.instance;let rt={toastId:this.index,title:s||"",message:i||"",toastRef:w,onShown:w.afterActivate(),onHidden:w.afterClosed(),onTap:st.onTap(),onAction:st.onAction(),portal:kt};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{rt.toastRef.activate()})),this.toasts.push(rt),rt}static \u0275fac=function(i){return new(i||e)(S(Qt),S(je),S(J),S(qt),S(bt))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Re=(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state=M({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>F(c({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>F(c({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>F(c({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),i)):this.timeout=setTimeout(()=>t(),i)}outsideInterval(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),i)):this.intervalId=setInterval(()=>t(),i)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(i){return new(i||e)(L(Wt),L(j),L(bt))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&($t("@flyInOut",s._state),v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){i&1&&N(0,ye,3,0,"button",0)(1,Ce,3,5,"div",1)(2,we,1,3,"div",2)(3,De,2,4,"div",3)(4,Le,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,data:{animation:[Lt("flyInOut",[z("inactive",K({opacity:0})),z("active",K({opacity:1})),z("removed",K({opacity:0})),tt("inactive => active",X("{{ easeTime }}ms {{ easing }}")),tt("active => removed",X("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})(),ke=F(c({},Jt),{toastComponent:Re}),Pe=(e={})=>Nt([{provide:Qt,useValue:{default:ke,config:e}}]),Ti=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[Pe(t)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=vt({type:e});static \u0275inj=ht({})}return e})();var Me=(()=>{class e{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=M("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.appRef=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(i){return new(i||e)(L(Wt),L(j),L(W))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&(v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){i&1&&N(0,xe,3,0,"button",0)(1,Fe,3,5,"div",1)(2,Se,1,3,"div",2)(3,Oe,2,4,"div",3)(4,Ee,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,changeDetection:0})}return e})(),Ci=F(c({},Jt),{toastComponent:Me});var R={serverTarget:Xt().version,production:!0,socket:"",api:{base:(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/";return n.endsWith("/")?`${n}api`:`${n}/api`})(),socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/",t=n.endsWith("/")?`${n}api`:`${n}/api`;return`${window.location.protocol}//${document.location.host}${t}/auth/login`})()]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Ei=(()=>{class e{$http=u(zt);get(t,i){return this.$http.get(`${R.api.base}${t}`,i)}post(t,i,s){return this.$http.post(`${R.api.base}${t}`,i,s)}put(t,i,s){return this.$http.put(`${R.api.base}${t}`,i,s)}patch(t,i,s){return this.$http.patch(`${R.api.base}${t}`,i,s)}delete(t,i){return this.$http.delete(`${R.api.base}${t}`,i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{y as a,se as b,Lt as c,X as d,He as e,K as f,tt as g,wt as h,Dt as i,re as j,Ft as k,Ye as l,Je as m,Wt as n,Ti as o,R as p,Ei as q};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-NR4KD4TZ.js";import{a as z}from"./chunk-WIZAF6OS.js";import{B as $,c as E,e as y,l as k}from"./chunk-MCPFJTIS.js";import{b as D}from"./chunk-6LB7WDKS.js";import{b as O}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-NR4KD4TZ.js";import{a as z}from"./chunk-WIZAF6OS.js";import{B as $,c as E,e as y,l as k}from"./chunk-MCPFJTIS.js";import{b as D}from"./chunk-6LB7WDKS.js";import{b as O}from"./chunk-DVZ3YL7I.js";import{k as T,n as I,q as H}from"./chunk-O3NFPA75.js";import{Db as g,Gb as _,Ib as a,La as p,Vb as v,Wa as x,ac as b,bc as M,cc as V,h as S,ja as r,lb as m,mb as u,oa as l,pa as c,rb as f,sb as d,tb as s,ub as w,w as C}from"./chunk-WWMJUVLA.js";function A(i,h){i&1&&w(0,"i",6)}function L(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();d(0,"ngx-monaco-editor",10),_("onInit",function(e){l(t);let o=a();return c(o.onEditorInit(e))})("keydown.control.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())})("keydown.meta.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())}),s()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();d(0,"textarea",11),V("ngModelChange",function(e){l(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),c(e)}),v(1," "),s()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(z);$route=r(D);$settings=r(O);$toastr=r(I);$translate=r(T);lastHeight;visualViewPortEventCallback;startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light"},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
|
|
2
2
|
`)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
|
|
3
3
|
|
|
4
4
|
${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:4,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","font-monospace"],[1,"col-6","text-end"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-spinner","fa-pulse"],[1,"fas","fa-floppy-disk"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),s()(),d(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),m(7,A,1,0,"i",6)(8,L,1,0,"i",7),s()()(),m(9,F,1,2,"ngx-monaco-editor",8),m(10,W,2,1,"textarea",9),s()),n&2&&(p(6),f("disabled",e.saveInProgress),p(),u(e.saveInProgress?7:8),p(2),u(e.isMobile?-1:9),p(),u(e.isMobile?10:-1))},dependencies:[P,$,E,y,k],encapsulation:2})}return i})();export{tt as StartupScriptComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as xt}from"./chunk-7CNAISDX.js";import{b as M,e as vt,f as $t,g as jt,h as kt}from"./chunk-Y5HOKHBZ.js";import{a as bt,b as _t}from"./chunk-NR4KD4TZ.js";import{a as Ct}from"./chunk-WIZAF6OS.js";import{a as Rt}from"./chunk-BU6Y5VTM.js";import{m as ht,n as ut,t as I}from"./chunk-3ZU7ZAMP.js";import{B as mt,C as ft,c as ct,e as pt,l as gt}from"./chunk-MCPFJTIS.js";import{b as yt,d as H}from"./chunk-6LB7WDKS.js";import{b as wt}from"./chunk-AFWEHAAR.js";import{k as R,l as j,n as O,q as N}from"./chunk-DEBBH3A3.js";import{Db as E,Gb as b,Ib as p,Kc as lt,La as s,Pa as tt,Rc as dt,Tb as ot,Vb as _,Wa as D,Wb as T,Xb as P,a as L,ac as st,b as W,bc as rt,cc as at,d as X,g as Z,h as $,hc as K,ja as m,kb as C,lb as k,mb as x,mc as r,nc as l,oa as h,ob as et,oc as G,pa as u,pb as it,qb as nt,rb as f,sb as a,tb as d,ub as g,w as S}from"./chunk-WWMJUVLA.js";var Mt=Z(jt(),1);var Et=Z(Rt(),1);var St=(o,y)=>({"fa-trash":o,"fa-cog fa-spin":y});function Ht(o,y){o&1&&(a(0,"div",13),g(1,"i",20),d())}function Nt(o,y){if(o&1){let t=E();a(0,"li",9)(1,"span"),_(2),r(3,"date"),g(4,"br"),a(5,"span",21),_(6),r(7,"date"),d()(),a(8,"span",22)(9,"button",25),r(10,"translate"),r(11,"translate"),b("click",function(){let i=h(t).$implicit,n=p(2);return u(n.restore(i.id))}),g(12,"i",26),d(),a(13,"button",27),r(14,"translate"),r(15,"translate"),b("click",function(){let i=h(t).$implicit,n=p(2);return u(n.download(i.id))}),g(16,"i",28),d(),a(17,"button",23),r(18,"translate"),r(19,"translate"),b("click",function(){let i=h(t).$implicit,n=p(2);return u(n.delete(i.id))}),g(20,"i",24),d()()()}if(o&2){let t=y.$implicit,e=p(2);s(2),P(" ",G(3,15,t.timestamp,"mediumDate")),s(4),T(G(7,18,t.timestamp,"shortTime")),s(3),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),C("aria-label",l(11,23,"config.restore.copy_to_editor")),s(4),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),C("aria-label",l(15,27,"form.button_download")),s(4),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),C("aria-label",l(19,31,"form.button_delete")),s(3),f("ngClass",K(33,St,t.id!==e.deleting,t.id===e.deleting))}}function Ut(o,y){if(o&1){let t=E();a(0,"ul",14),it(1,Nt,21,36,"li",9,et),a(3,"li",9)(4,"span"),_(5),r(6,"translate"),g(7,"br"),a(8,"span",21),_(9),r(10,"translate"),d()(),a(11,"span",22)(12,"button",23),r(13,"translate"),r(14,"translate"),b("click",function(){h(t);let i=p();return u(i.deleteAllBackups())}),g(15,"i",24),d()()()()}if(o&2){let t=p();s(),nt(t.backupList),s(4),P(" ",l(6,7,"form.button_delete_all")),s(4),P(" ",l(10,9,"common.labels.no_confirmation")," "),s(3),f("disabled",t.clicked||t.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),C("aria-label",l(14,13,"form.button_delete")),s(3),f("ngClass",K(15,St,t.deleting!=="all",t.deleting==="all"))}}var Tt=(()=>{class o{$activeModal=m(ht);$api=m(N);$router=m(H);$toastr=m(O);$translate=m(R);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return $(this,null,function*(){try{let t=yield S(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=t}catch(t){this.loading=!1,console.error(t),this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(t){return this.$activeModal.close(t)}download(t){return $(this,null,function*(){this.clicked=!0;try{let e=yield S(this.$api.get(`/config-editor/backups/${t}`)),i=JSON.stringify(e,null,4),n=new Blob([i],{type:"application/json"}),v=`config-backup-${t}.json`;(0,Et.saveAs)(n,v),this.clicked=!1}catch(e){this.clicked=!1,this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e)}})}downloadCurrentConfig(){let t=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,e=document.createElement("a");e.setAttribute("href",t),e.setAttribute("download","config.json"),document.body.appendChild(e),e.click(),e.remove()}delete(t){return $(this,null,function*(){this.deleting=t;try{yield S(this.$api.delete(`/config-editor/backups/${t}`)),yield this.getConfigBackups(),this.deleting=null}catch(e){this.deleting=null,this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e)}})}deleteAllBackups(){return $(this,null,function*(){this.deleting="all";try{yield S(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(t){this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"]),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=D({type:o,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-download"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),r(4,"translate"),d(),a(5,"button",3),r(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),g(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),r(13,"translate"),d(),a(14,"li"),_(15),r(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),r(22,"translate"),d(),g(23,"br"),a(24,"small",10),_(25),r(26,"translate"),d()(),a(27,"button",11),r(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),g(29,"i",12),d()()(),k(30,Ht,2,0,"div",13)(31,Ut,16,18,"ul",14),d(),a(32,"div",15),g(33,"div",16),a(34,"div",17)(35,"button",18),r(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),r(38,"translate"),d()(),g(39,"div",19),d()()),e&2&&(s(3),T(l(4,13,"config.restore.title")),s(2),f("disabled",i.clicked||i.deleting),C("aria-label",l(6,15,"form.button_close")),s(7),T(l(13,17,"config.restore.help_1")),s(3),T(l(16,19,"config.restore.help_2")),s(6),T(l(22,21,"form.button_download")),s(4),T(l(26,23,"config.restore.download")),s(2),f("disabled",i.clicked||i.deleting),C("aria-label",l(28,25,"backup.backup_now")),s(3),x(i.loading?30:i.backupList.length?31:-1),s(5),f("disabled",i.clicked||i.deleting),C("aria-label",l(36,27,"form.button_close")),s(2),P(" ",l(38,29,"form.button_close")," "))},dependencies:[I,lt,ft,dt,j],encapsulation:2})}return o})();function Ft(o,y){if(o&1){let t=E();a(0,"button",13),r(1,"translate"),r(2,"translate"),b("click",function(){h(t);let i=p();return u(i.onCancelRestore())}),g(3,"i",14),d()}if(o&2){let t=p();f("disabled",t.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),C("aria-label",l(2,6,"form.button_cancel"))}}function qt(o,y){if(o&1){let t=E();a(0,"button",15),r(1,"translate"),r(2,"translate"),b("click",function(){h(t);let i=p();return u(i.onRestore())}),g(3,"i",16),d()}o&2&&(f("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),C("aria-label",l(2,5,"form.button_restore")))}function zt(o,y){if(o&1){let t=E();a(0,"button",15),r(1,"translate"),r(2,"translate"),b("click",function(){h(t);let i=p();return u(i.toggleSideBySide())}),g(3,"i",17),d()}if(o&2){let t=p();f("openDelay",150)("ngbTooltip",l(1,7,t.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),C("aria-label",l(2,9,t.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),s(3),ot("fa-columns",!t.renderSideBySide)("fa-bars",t.renderSideBySide)}}function Jt(o,y){o&1&&g(0,"i",8)}function Lt(o,y){o&1&&g(0,"i",9)}function Wt(o,y){if(o&1){let t=E();a(0,"ngx-monaco-editor",18),b("onInit",function(i){h(t);let n=p();return u(n.onEditorInit(i))})("keydown.control.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())})("keydown.meta.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())}),d()}if(o&2){let t=p();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function Kt(o,y){if(o&1){let t=E();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){h(t);let n=p();return u(n.onInitDiffEditor(i))})("keydown.control.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())})("keydown.meta.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())}),d()}if(o&2){let t=p();f("options",t.editorOptions)("originalModel",t.diffOriginalModel)("modifiedModel",t.diffModifiedModel)}}function Gt(o,y){if(o&1){let t=E();a(0,"textarea",20),at("ngModelChange",function(i){h(t);let n=p();return rt(n.homebridgeConfig,i)||(n.homebridgeConfig=i),u(i)}),_(1," "),d()}if(o&2){let t=p();st("ngModel",t.homebridgeConfig)}}var Me=(()=>{class o{$api=m(N);$md=m(Ct);$modal=m(ut);$monacoEditor=m(xt);$renderer=m(tt);$route=m(yt);$router=m(H);$settings=m(wt);$toastr=m(O);$translate=m(R);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let t=document.querySelector(".content");this.$renderer.setStyle(t,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:e}=this.$router.parseUrl(this.$router.url).queryParams;if(e){switch(e){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}}onEditorInit(t){window.editor=t,this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(t){this.monacoEditor=t.getModifiedEditor(),this.updateDiffModels(),window.editor=t}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let t=window.editor.getOriginalEditor(),e=window.editor.getModifiedEditor();if(t&&e){let i=t.getModel(),n=e.getModel();i&&i.setValue(this.originalConfig||""),n&&n.setValue(this.homebridgeConfig||"{}")}}}onSave(){return $(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let e=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of e)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let t=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(t,null,4),typeof t.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(t.bridge.username)?t.accessories&&!Array.isArray(t.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):t.platforms&&!Array.isArray(t.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):t.platforms&&Array.isArray(t.platforms)&&!this.validateSection(t.platforms,"platform")||t.accessories&&Array.isArray(t.accessories)&&!this.validateSection(t.accessories,"accessory")||t.plugins&&Array.isArray(t.plugins)&&!this.validatePlugins(t.plugins,"plugins")||t.disabledPlugins&&Array.isArray(t.disabledPlugins)&&!this.validatePlugins(t.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(t),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(t=!1){let e=this.$modal.open(Tt,{size:"lg",backdrop:"static"});e.componentInstance.currentConfig=this.homebridgeConfig,e.componentInstance.fromSettings=t,e.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:n=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(n,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:n=>{console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=W(L({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let t=document.querySelector(".content");this.$renderer.removeStyle(t,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let e=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),n=window.monaco.editor.getModel(e);n&&n.dispose();let v=window.monaco.editor.getModel(i);v&&v.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(t,e){for(let i of t){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[e])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[e]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(t,e){for(let i of t)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:e}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(t){this.monacoEditor&&(t=JSON.stringify(t,null,4).split(`
|
|
1
|
+
import{a as xt}from"./chunk-7CNAISDX.js";import{b as M,e as vt,f as $t,g as jt,h as kt}from"./chunk-72ARQWTQ.js";import{a as bt,b as _t}from"./chunk-NR4KD4TZ.js";import{a as Ct}from"./chunk-WIZAF6OS.js";import{a as Rt}from"./chunk-BU6Y5VTM.js";import{m as ht,n as ut,t as I}from"./chunk-3ZU7ZAMP.js";import{B as mt,C as ft,c as ct,e as pt,l as gt}from"./chunk-MCPFJTIS.js";import{b as yt,d as H}from"./chunk-6LB7WDKS.js";import{b as wt}from"./chunk-DVZ3YL7I.js";import{k as R,l as j,n as O,q as N}from"./chunk-O3NFPA75.js";import{Db as E,Gb as b,Ib as p,Kc as lt,La as o,Pa as tt,Rc as dt,Tb as st,Vb as _,Wa as D,Wb as T,Xb as P,a as L,ac as ot,b as W,bc as rt,cc as at,d as X,g as Z,h as $,hc as K,ja as m,kb as C,lb as k,mb as x,mc as r,nc as l,oa as h,ob as et,oc as G,pa as u,pb as it,qb as nt,rb as f,sb as a,tb as d,ub as g,w as S}from"./chunk-WWMJUVLA.js";var Mt=Z(jt(),1);var Et=Z(Rt(),1);var St=(s,y)=>({"fa-trash":s,"fa-cog fa-spin":y});function Ht(s,y){s&1&&(a(0,"div",13),g(1,"i",20),d())}function Nt(s,y){if(s&1){let t=E();a(0,"li",9)(1,"span"),_(2),r(3,"date"),g(4,"br"),a(5,"span",21),_(6),r(7,"date"),d()(),a(8,"span",22)(9,"button",25),r(10,"translate"),r(11,"translate"),b("click",function(){let i=h(t).$implicit,n=p(2);return u(n.restore(i.id))}),g(12,"i",26),d(),a(13,"button",27),r(14,"translate"),r(15,"translate"),b("click",function(){let i=h(t).$implicit,n=p(2);return u(n.download(i.id))}),g(16,"i",28),d(),a(17,"button",23),r(18,"translate"),r(19,"translate"),b("click",function(){let i=h(t).$implicit,n=p(2);return u(n.delete(i.id))}),g(20,"i",24),d()()()}if(s&2){let t=y.$implicit,e=p(2);o(2),P(" ",G(3,15,t.timestamp,"mediumDate")),o(4),T(G(7,18,t.timestamp,"shortTime")),o(3),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),C("aria-label",l(11,23,"config.restore.copy_to_editor")),o(4),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),C("aria-label",l(15,27,"form.button_download")),o(4),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),C("aria-label",l(19,31,"form.button_delete")),o(3),f("ngClass",K(33,St,t.id!==e.deleting,t.id===e.deleting))}}function Ut(s,y){if(s&1){let t=E();a(0,"ul",14),it(1,Nt,21,36,"li",9,et),a(3,"li",9)(4,"span"),_(5),r(6,"translate"),g(7,"br"),a(8,"span",21),_(9),r(10,"translate"),d()(),a(11,"span",22)(12,"button",23),r(13,"translate"),r(14,"translate"),b("click",function(){h(t);let i=p();return u(i.deleteAllBackups())}),g(15,"i",24),d()()()()}if(s&2){let t=p();o(),nt(t.backupList),o(4),P(" ",l(6,7,"form.button_delete_all")),o(4),P(" ",l(10,9,"common.labels.no_confirmation")," "),o(3),f("disabled",t.clicked||t.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),C("aria-label",l(14,13,"form.button_delete")),o(3),f("ngClass",K(15,St,t.deleting!=="all",t.deleting==="all"))}}var Tt=(()=>{class s{$activeModal=m(ht);$api=m(N);$router=m(H);$toastr=m(O);$translate=m(R);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return $(this,null,function*(){try{let t=yield S(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=t}catch(t){this.loading=!1,console.error(t),this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(t){return this.$activeModal.close(t)}download(t){return $(this,null,function*(){this.clicked=!0;try{let e=yield S(this.$api.get(`/config-editor/backups/${t}`)),i=JSON.stringify(e,null,4),n=new Blob([i],{type:"application/json"}),v=`config-backup-${t}.json`;(0,Et.saveAs)(n,v),this.clicked=!1}catch(e){this.clicked=!1,this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e)}})}downloadCurrentConfig(){let t=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,e=document.createElement("a");e.setAttribute("href",t),e.setAttribute("download","config.json"),document.body.appendChild(e),e.click(),e.remove()}delete(t){return $(this,null,function*(){this.deleting=t;try{yield S(this.$api.delete(`/config-editor/backups/${t}`)),yield this.getConfigBackups(),this.deleting=null}catch(e){this.deleting=null,this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e)}})}deleteAllBackups(){return $(this,null,function*(){this.deleting="all";try{yield S(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(t){this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"]),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-download"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),r(4,"translate"),d(),a(5,"button",3),r(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),g(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),r(13,"translate"),d(),a(14,"li"),_(15),r(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),r(22,"translate"),d(),g(23,"br"),a(24,"small",10),_(25),r(26,"translate"),d()(),a(27,"button",11),r(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),g(29,"i",12),d()()(),k(30,Ht,2,0,"div",13)(31,Ut,16,18,"ul",14),d(),a(32,"div",15),g(33,"div",16),a(34,"div",17)(35,"button",18),r(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),r(38,"translate"),d()(),g(39,"div",19),d()()),e&2&&(o(3),T(l(4,13,"config.restore.title")),o(2),f("disabled",i.clicked||i.deleting),C("aria-label",l(6,15,"form.button_close")),o(7),T(l(13,17,"config.restore.help_1")),o(3),T(l(16,19,"config.restore.help_2")),o(6),T(l(22,21,"form.button_download")),o(4),T(l(26,23,"config.restore.download")),o(2),f("disabled",i.clicked||i.deleting),C("aria-label",l(28,25,"backup.backup_now")),o(3),x(i.loading?30:i.backupList.length?31:-1),o(5),f("disabled",i.clicked||i.deleting),C("aria-label",l(36,27,"form.button_close")),o(2),P(" ",l(38,29,"form.button_close")," "))},dependencies:[I,lt,ft,dt,j],encapsulation:2})}return s})();function Ft(s,y){if(s&1){let t=E();a(0,"button",13),r(1,"translate"),r(2,"translate"),b("click",function(){h(t);let i=p();return u(i.onCancelRestore())}),g(3,"i",14),d()}if(s&2){let t=p();f("disabled",t.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),C("aria-label",l(2,6,"form.button_cancel"))}}function qt(s,y){if(s&1){let t=E();a(0,"button",15),r(1,"translate"),r(2,"translate"),b("click",function(){h(t);let i=p();return u(i.onRestore())}),g(3,"i",16),d()}s&2&&(f("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),C("aria-label",l(2,5,"form.button_restore")))}function zt(s,y){if(s&1){let t=E();a(0,"button",15),r(1,"translate"),r(2,"translate"),b("click",function(){h(t);let i=p();return u(i.toggleSideBySide())}),g(3,"i",17),d()}if(s&2){let t=p();f("openDelay",150)("ngbTooltip",l(1,7,t.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),C("aria-label",l(2,9,t.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),o(3),st("fa-columns",!t.renderSideBySide)("fa-bars",t.renderSideBySide)}}function Jt(s,y){s&1&&g(0,"i",8)}function Lt(s,y){s&1&&g(0,"i",9)}function Wt(s,y){if(s&1){let t=E();a(0,"ngx-monaco-editor",18),b("onInit",function(i){h(t);let n=p();return u(n.onEditorInit(i))})("keydown.control.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())})("keydown.meta.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())}),d()}if(s&2){let t=p();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function Kt(s,y){if(s&1){let t=E();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){h(t);let n=p();return u(n.onInitDiffEditor(i))})("keydown.control.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())})("keydown.meta.s",function(i){h(t);let n=p();return i.preventDefault(),u(n.onSave())}),d()}if(s&2){let t=p();f("options",t.editorOptions)("originalModel",t.diffOriginalModel)("modifiedModel",t.diffModifiedModel)}}function Gt(s,y){if(s&1){let t=E();a(0,"textarea",20),at("ngModelChange",function(i){h(t);let n=p();return rt(n.homebridgeConfig,i)||(n.homebridgeConfig=i),u(i)}),_(1," "),d()}if(s&2){let t=p();ot("ngModel",t.homebridgeConfig)}}var Me=(()=>{class s{$api=m(N);$md=m(Ct);$modal=m(ut);$monacoEditor=m(xt);$renderer=m(tt);$route=m(yt);$router=m(H);$settings=m(wt);$toastr=m(O);$translate=m(R);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){let t=this.$translate.instant("menu.config_json_editor");this.$settings.setPageTitle(t),this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(n=>{this.homebridgeConfig=n.config,this.latestSavedConfig=JSON.parse(n.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:i}=this.$router.parseUrl(this.$router.url).queryParams;if(i){switch(i){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}}onEditorInit(t){window.editor=t,this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(t){this.monacoEditor=t.getModifiedEditor(),this.updateDiffModels(),window.editor=t}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let t=window.editor.getOriginalEditor(),e=window.editor.getModifiedEditor();if(t&&e){let i=t.getModel(),n=e.getModel();i&&i.setValue(this.originalConfig||""),n&&n.setValue(this.homebridgeConfig||"{}")}}}onSave(){return $(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let e=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of e)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let t=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(t,null,4),typeof t.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(t.bridge.username)?t.accessories&&!Array.isArray(t.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):t.platforms&&!Array.isArray(t.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):t.platforms&&Array.isArray(t.platforms)&&!this.validateSection(t.platforms,"platform")||t.accessories&&Array.isArray(t.accessories)&&!this.validateSection(t.accessories,"accessory")||t.plugins&&Array.isArray(t.plugins)&&!this.validatePlugins(t.plugins,"plugins")||t.disabledPlugins&&Array.isArray(t.disabledPlugins)&&!this.validatePlugins(t.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(t),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(t=!1){let e=this.$modal.open(Tt,{size:"lg",backdrop:"static"});e.componentInstance.currentConfig=this.homebridgeConfig,e.componentInstance.fromSettings=t,e.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:n=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(n,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:n=>{console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=W(L({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let t=document.querySelector(".content");this.$renderer.removeStyle(t,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let e=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),n=window.monaco.editor.getModel(e);n&&n.dispose();let v=window.monaco.editor.getModel(i);v&&v.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(t,e){for(let i of t){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[e])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[e]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(t,e){for(let i of t)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:e}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(t){this.monacoEditor&&(t=JSON.stringify(t,null,4).split(`
|
|
2
2
|
`).map(e=>` ${e}`).join(`
|
|
3
3
|
`),setTimeout(()=>{let e=this.monacoEditor.getModel().findMatches(t);if(e.length){let i=e[0].range,n=new monaco.Range(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:n,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(i=>i.uri==="http://homebridge/config.json"))return;let t=monaco.Uri.parse("a://homebridge/config.json"),e=kt(this.$translate);window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[t.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",title:this.$translate.instant("settings.name"),description:`The Homebridge instance name.
|
|
4
4
|
This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",title:this.$translate.instant("accessories.bridge_username"),description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
|
|
@@ -16,4 +16,4 @@ Separate each plugin config block using a comma.`,items:{type:"object",required:
|
|
|
16
16
|
Remove this array to enable all plugins.`,items:{type:"string",title:this.$translate.instant("accessories.plugin"),description:`The full plugin npm package name.
|
|
17
17
|
Example: homebridge-dummy.`},default:["homebridge-config-ui-x"]},disabledPlugins:{type:"array",description:`An array of plugins that should be disabled.
|
|
18
18
|
Requires Homebridge v1.3 or later.`,items:{type:"string",title:this.$translate.instant("accessories.plugin"),description:`The full plugin npm package name.
|
|
19
|
-
Example: homebridge-dummy.`},default:[]}}}}]}),this.monacoEditorModel.uri=monaco.Uri.parse("a://homebridge/config.json")}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}saveConfig(t){return $(this,null,function*(){try{let e=yield S(this.$api.post("/config-editor",t));this.homebridgeConfig=JSON.stringify(e,null,4),yield this.detectSavesChangesForRestart()}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}validateArraysEqual(t,e){if(t.length!==e.length)return!1;let i=[...t].sort(),n=[...e].sort();return i.every((v,w)=>v===n[w])}removePlatformsAndAccessories(t){let v=t,{accessories:e,platforms:i}=v;return X(v,["accessories","platforms"])}removeEmptyBridges(t){return t.filter(e=>e._bridge&&Object.keys(e._bridge).length>0).map(e=>e._bridge)}validateBridgesEqual(t,e){return t.length!==e.length?!1:t.every(i=>e.some(n=>M(i,n)))}detectConfigPlatformChanges(){try{let t=this.latestSavedConfig,e=JSON.parse(this.homebridgeConfig),i=(t.platforms||[]).find(B=>B.platform==="config"),n=(e.platforms||[]).find(B=>B.platform==="config"),v=i?.webroot||"",w=n?.webroot||"";return v!==w&&(w=w?`/${w}`.replace(/\/+/g,"/").replace(/\/$/,""):"",w==="/"&&(w=""),this.$settings.setItem("webroot",w),n&&(w&&this.$settings.originalWebroot!==globalThis.webroot.errorCode?n.webroot=w:delete n.webroot,this.homebridgeConfig=JSON.stringify(e,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig))),!i&&n||i&&!n?!0:!i&&!n?!1:!M(i,n)}catch(t){return console.error("Error detecting config platform changes:",t),!1}}detectSavesChangesForRestart(){return $(this,null,function*(){let t=yield this.determineRestartType();if(t==="full"){let e=this.detectConfigPlatformChanges();yield this.performFullRestart(e)}else t==="child"&&(yield this.performChildBridgeRestart());this.latestSavedConfig=JSON.parse(this.homebridgeConfig)})}determineRestartType(){return $(this,null,function*(){if(this.hbPendingRestart)return"full";let t=this.latestSavedConfig,e=JSON.stringify(t,null,4),i=JSON.parse(this.homebridgeConfig),n=this.homebridgeConfig;if(e===n&&!this.childBridgesToRestart.length)return this.$toastr.info(this.$translate.instant("config.no_restart"),this.$translate.instant("config.config_saved")),"none";if(!this.validateArraysEqual(Object.keys(t),Object.keys(i))||[...i.platforms||[],...i.accessories||[]].every(c=>!c._bridge||!Object.keys(c._bridge).length))return"full";let w=this.removePlatformsAndAccessories(t),B=this.removePlatformsAndAccessories(i);if(!M(w,B))return"full";let U=t.platforms||[],F=i.platforms||[],Bt=U.map(c=>c.platform),At=F.map(c=>c.platform);if(!this.validateArraysEqual(Bt,At))return"full";let q=t.accessories||[],z=i.accessories||[],Pt=q.map(c=>c.accessory),Vt=z.map(c=>c.accessory);if(!this.validateArraysEqual(Pt,Vt)||!this.validateBridgesEqual(this.removeEmptyBridges(U),this.removeEmptyBridges(F))||!this.validateBridgesEqual(this.removeEmptyBridges(q),this.removeEmptyBridges(z)))return"full";let Y=U.filter(c=>!M(c,F.find(A=>A.platform===c.platform))),Dt=q.filter(c=>!M(c,z.find(A=>A.accessory===c.accessory))),Q=[...Y,...Dt];if(Y.some(c=>c.platform==="config")||Q.some(c=>c.platform==="config"?!1:!c._bridge||Object.keys(c._bridge).length===0))return"full";try{let c=yield S(this.$api.get("/status/homebridge/child-bridges"));return Q.forEach(A=>{let It=A._bridge.username.toUpperCase(),V=c.find(({username:J})=>J===It);if(V)this.childBridgesToRestart.some(J=>J.username===V.username)||this.childBridgesToRestart.push({name:V.name,username:V.username});else return"full"}),"child"}catch(c){return console.error("Error fetching child bridges:",c),"full"}})}performChildBridgeRestart(){return $(this,null,function*(){let t=this.$modal.open(vt,{size:"lg",backdrop:"static"});t.componentInstance.bridges=this.childBridgesToRestart;try{yield t.result,this.childBridgesToRestart=[]}catch{}})}performFullRestart(t){return $(this,null,function*(){t&&(yield S(this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{})));let e=this.$modal.open($t,{size:"lg",backdrop:"static"});try{yield e.result,this.hbPendingRestart=!1,this.childBridgesToRestart=[]}catch{this.hbPendingRestart=!0}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let e=Mt.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(e,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),e}}static \u0275fac=function(e){return new(e||
|
|
19
|
+
Example: homebridge-dummy.`},default:[]}}}}]}),this.monacoEditorModel.uri=monaco.Uri.parse("a://homebridge/config.json")}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}saveConfig(t){return $(this,null,function*(){try{let e=yield S(this.$api.post("/config-editor",t));this.homebridgeConfig=JSON.stringify(e,null,4),yield this.detectSavesChangesForRestart()}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}validateArraysEqual(t,e){if(t.length!==e.length)return!1;let i=[...t].sort(),n=[...e].sort();return i.every((v,w)=>v===n[w])}removePlatformsAndAccessories(t){let v=t,{accessories:e,platforms:i}=v;return X(v,["accessories","platforms"])}removeEmptyBridges(t){return t.filter(e=>e._bridge&&Object.keys(e._bridge).length>0).map(e=>e._bridge)}validateBridgesEqual(t,e){return t.length!==e.length?!1:t.every(i=>e.some(n=>M(i,n)))}detectConfigPlatformChanges(){try{let t=this.latestSavedConfig,e=JSON.parse(this.homebridgeConfig),i=(t.platforms||[]).find(B=>B.platform==="config"),n=(e.platforms||[]).find(B=>B.platform==="config"),v=i?.webroot||"",w=n?.webroot||"";return v!==w&&(w=w?`/${w}`.replace(/\/+/g,"/").replace(/\/$/,""):"",w==="/"&&(w=""),this.$settings.setItem("webroot",w),n&&(w&&this.$settings.originalWebroot!==globalThis.webroot.errorCode?n.webroot=w:delete n.webroot,this.homebridgeConfig=JSON.stringify(e,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig))),!i&&n||i&&!n?!0:!i&&!n?!1:!M(i,n)}catch(t){return console.error("Error detecting config platform changes:",t),!1}}detectSavesChangesForRestart(){return $(this,null,function*(){let t=yield this.determineRestartType();if(t==="full"){let e=this.detectConfigPlatformChanges();yield this.performFullRestart(e)}else t==="child"&&(yield this.performChildBridgeRestart());this.latestSavedConfig=JSON.parse(this.homebridgeConfig)})}determineRestartType(){return $(this,null,function*(){if(this.hbPendingRestart)return"full";let t=this.latestSavedConfig,e=JSON.stringify(t,null,4),i=JSON.parse(this.homebridgeConfig),n=this.homebridgeConfig;if(e===n&&!this.childBridgesToRestart.length)return this.$toastr.info(this.$translate.instant("config.no_restart"),this.$translate.instant("config.config_saved")),"none";if(!this.validateArraysEqual(Object.keys(t),Object.keys(i))||[...i.platforms||[],...i.accessories||[]].every(c=>!c._bridge||!Object.keys(c._bridge).length))return"full";let w=this.removePlatformsAndAccessories(t),B=this.removePlatformsAndAccessories(i);if(!M(w,B))return"full";let U=t.platforms||[],F=i.platforms||[],Bt=U.map(c=>c.platform),At=F.map(c=>c.platform);if(!this.validateArraysEqual(Bt,At))return"full";let q=t.accessories||[],z=i.accessories||[],Pt=q.map(c=>c.accessory),Vt=z.map(c=>c.accessory);if(!this.validateArraysEqual(Pt,Vt)||!this.validateBridgesEqual(this.removeEmptyBridges(U),this.removeEmptyBridges(F))||!this.validateBridgesEqual(this.removeEmptyBridges(q),this.removeEmptyBridges(z)))return"full";let Y=U.filter(c=>!M(c,F.find(A=>A.platform===c.platform))),Dt=q.filter(c=>!M(c,z.find(A=>A.accessory===c.accessory))),Q=[...Y,...Dt];if(Y.some(c=>c.platform==="config")||Q.some(c=>c.platform==="config"?!1:!c._bridge||Object.keys(c._bridge).length===0))return"full";try{let c=yield S(this.$api.get("/status/homebridge/child-bridges"));return Q.forEach(A=>{let It=A._bridge.username.toUpperCase(),V=c.find(({username:J})=>J===It);if(V)this.childBridgesToRestart.some(J=>J.username===V.username)||this.childBridgesToRestart.push({name:V.name,username:V.username});else return"full"}),"child"}catch(c){return console.error("Error fetching child bridges:",c),"full"}})}performChildBridgeRestart(){return $(this,null,function*(){let t=this.$modal.open(vt,{size:"lg",backdrop:"static"});t.componentInstance.bridges=this.childBridgesToRestart;try{yield t.result,this.childBridgesToRestart=[]}catch{}})}performFullRestart(t){return $(this,null,function*(){t&&(yield S(this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{})));let e=this.$modal.open($t,{size:"lg",backdrop:"static"});try{yield e.result,this.hbPendingRestart=!1,this.childBridgesToRestart=[]}catch{this.hbPendingRestart=!0}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let e=Mt.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(e,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),e}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["ng-component"]],decls:18,vars:19,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"disabled","openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-floppy-disk"],[1,"fas","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModel"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-times"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-history"],[1,"fas"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),_(4),r(5,"translate"),d()(),a(6,"div",4),k(7,Ft,4,8,"button",5),k(8,qt,4,7,"button",6),k(9,zt,4,11,"button",6),a(10,"button",7),r(11,"translate"),r(12,"translate"),b("click",function(){return i.onSave()}),k(13,Jt,1,0,"i",8),k(14,Lt,1,0,"i",9),d()()(),k(15,Wt,1,2,"ngx-monaco-editor",10),k(16,Kt,1,3,"ngx-monaco-diff-editor",11),k(17,Gt,2,1,"textarea",12),d()),e&2&&(o(4),T(l(5,13,"menu.config_json_editor")),o(3),x(i.originalConfig?7:-1),o(),x(i.originalConfig?-1:8),o(),x(!i.isMobile&&i.originalConfig?9:-1),o(),f("disabled",i.saveInProgress)("openDelay",150)("ngbTooltip",l(11,15,"form.button_save")),C("aria-label",l(12,17,"form.button_save")),o(3),x(i.saveInProgress?-1:13),o(),x(i.saveInProgress?14:-1),o(),x(!i.isMobile&&!i.originalConfig?15:-1),o(),x(!i.isMobile&&i.originalConfig?16:-1),o(),x(i.isMobile?17:-1))},dependencies:[I,bt,_t,mt,ct,pt,gt,j],encapsulation:2})}return s})();export{Me as ConfigEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as D}from"./chunk-
|
|
1
|
+
import{b as D}from"./chunk-DVZ3YL7I.js";import{p as h,q as S}from"./chunk-O3NFPA75.js";import{C as T,Xa as E,ad as j,ea as d,fa as y,h as a,ha as v,ia as l,ja as p,r as f,ta as I,w as c,x as k,z as w}from"./chunk-WWMJUVLA.js";var g=new v("JWT_OPTIONS"),m=(()=>{class o{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let r=0,s,n,x=0;n=e.charAt(x++);~n&&(s=r%4?s*64+n:n,r++%4)?i+=String.fromCharCode(255&s>>(-2*r&6)):0)n=t.indexOf(n);return i}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let i=this.urlBase64Decode(t[1]);if(!i)throw new Error("Cannot decode the token.");return JSON.parse(i)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let i=new Date(0);return i.setUTCSeconds(t.exp),i}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(i=>this._isTokenExpired(i,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let i=this.getTokenExpirationDate(e);return t=t||0,i===null?!1:!(i.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return o.\u0275fac=function(e){return new(e||o)(l(g))},o.\u0275prov=d({token:o,factory:o.\u0275fac}),o})(),$=o=>o instanceof Promise?T(()=>o):f(o),b=(()=>{class o{constructor(e,t,i){this.jwtHelper=t,this.document=i,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let i=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(r=>typeof r=="string"?r===i:r instanceof RegExp?r.test(i):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(i=>{if(typeof i=="string"){let r=new URL(i,this.document.location.origin);return r.hostname===t.hostname&&r.pathname===t.pathname}return i instanceof RegExp?i.test(e.url):!1})>-1}handleInterception(e,t,i){let r=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=f(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):f(!0)),e?s.pipe(k(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${r}${e}`}})),w(n=>i.handle(n))):i.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let i=this.tokenGetter(e);return $(i).pipe(w(r=>this.handleInterception(r,e,t)))}}return o.\u0275fac=function(e){return new(e||o)(l(g),l(m),l(I))},o.\u0275prov=d({token:o,factory:o.\u0275fac}),o})(),U=(()=>{class o{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:o,providers:[{provide:j,useClass:b,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return o.\u0275fac=function(e){return new(e||o)(l(o,12))},o.\u0275mod=E({type:o}),o.\u0275inj=y({}),o})();var X=(()=>{class o{$api=p(S);$jwtHelper=p(m);$settings=p(D);token;user={};logoutTimer;lastRefreshTime=Date.now();isRefreshing=!1;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield c(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(h.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield c(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(h.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,clearTimeout(this.logoutTimer),window.localStorage.removeItem(h.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield c(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(h.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield c(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(h.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let e=this.$settings.sessionTimeout*1e3;e<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),e))}}checkAndRefreshIfNeeded(){return a(this,null,function*(){if(!this.$settings.formAuth||!this.$settings.sessionTimeoutInactivityBased||!this.token||!this.isLoggedIn()||this.isRefreshing)return;let t=Date.now()-this.lastRefreshTime,r=this.$settings.sessionTimeout*1e3*.7;if(t>r)try{yield this.refreshSession()}catch(s){console.error("Failed to refresh session:",s)}})}refreshSession(){return a(this,null,function*(){if(!this.isRefreshing){this.isRefreshing=!0;try{let e=yield c(this.$api.post("/auth/refresh",{}));e.access_token&&(this.token=e.access_token,window.localStorage.setItem(h.jwt.tokenKey,e.access_token),this.lastRefreshTime=Date.now(),this.setLogoutTimer())}finally{this.isRefreshing=!1}}})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=d({token:o,factory:o.\u0275fac})}return o})();export{U as a,X as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-WXWGOW2V.js";import{a as m}from"./chunk-E762XFMI.js";import{n as s}from"./chunk-3ZU7ZAMP.js";import{b as o}from"./chunk-DVZ3YL7I.js";import{k as i}from"./chunk-O3NFPA75.js";import{ea as r,ja as n}from"./chunk-WWMJUVLA.js";var I=(()=>{class e{$terminal=n(l);$settings=n(o);$modal=n(s);$translate=n(i);handleBeforeUnload(t){if(!this.$settings.env.terminal?.persistence&&!this.$settings.env.terminal?.hideWarning&&this.$terminal.hasActiveSession()&&this.$terminal.hasUserTypedInSession()){let a=this.$translate.instant("platform.terminal.terminate_unload");return t.preventDefault(),t.returnValue=a,a}}canDeactivate(){if(this.$settings.env.terminal?.persistence||this.$settings.env.terminal?.hideWarning||!this.$terminal.hasActiveSession()||!this.$terminal.hasUserTypedInSession())return!0;let t=this.$modal.open(m,{size:"lg",backdrop:"static"});return t.componentInstance.title=this.$translate.instant("platform.terminal.terminate_title"),t.componentInstance.message=this.$translate.instant("platform.terminal.terminate_message_1"),t.componentInstance.message2=this.$translate.instant("platform.terminal.terminate_message_2"),t.componentInstance.message3=this.$translate.instant("common.phrases.are_you_sure"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_continue"),t.componentInstance.confirmButtonClass="btn-primary",t.componentInstance.faIconClass="fas fa-exclamation-triangle text-warning",t.result.then(()=>!0).catch(()=>!1)}static \u0275fac=function(a){return new(a||e)};static \u0275prov=r({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{I as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as G,C as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,q as z,r as D,y as H,z as A}from"./chunk-MCPFJTIS.js";import{b as K}from"./chunk-
|
|
1
|
+
import{B as G,C as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,q as z,r as D,y as H,z as A}from"./chunk-MCPFJTIS.js";import{b as K}from"./chunk-QDMF6BOL.js";import{d as U}from"./chunk-6LB7WDKS.js";import{b as J}from"./chunk-DVZ3YL7I.js";import{l as j,p as W}from"./chunk-O3NFPA75.js";import{Ac as L,Ga as x,Gb as E,Ib as M,Kc as N,La as i,M as I,Nc as V,Pb as v,Qb as F,Vb as g,Wa as k,Wb as h,Xb as R,Xc as P,gc as f,h as y,ja as p,lb as u,mb as c,mc as l,nc as d,rb as m,sb as r,tb as a,ub as s,w as S,xc as b}from"./chunk-WWMJUVLA.js";var Y=["password"],Z=["username"],ee=["otp"],te=e=>({background:e}),ie=e=>({anim:e}),X=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let n=M();i(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",f(8,X,n.form.controls.username.dirty&&n.form.controls.username.errors)),i(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",f(10,X,n.form.controls.password.dirty&&n.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(i(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_credentials")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_code")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{$auth=p(K);$cdr=p(L);$router=p(U);$settings=p(J);targetRoute;validNonAdminRoutes=["/accessories","/plugins","/logs","/support"];passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;form;ngOnInit(){this.form=new T({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(n=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==n.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.$cdr.detectChanges()}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let n=this.passwordInput()?.nativeElement.value;n&&n!==this.form.get("password").value&&this.form.controls.password.setValue(n);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),!this.$auth.user.admin&&!this.validNonAdminRoutes.includes(this.targetRoute)&&(this.targetRoute="/"),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let n=`${W.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${n}') center/cover`}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=k({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(v(t.passwordInput,Y,5),v(t.usernameInput,Z,5),v(t.otpInput,ee,5)),o&2&&F(3)},decls:15,vars:18,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","login-card","d-flex","py-4","flex-column"],["ngSrc","assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-2",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),E("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),g(5),l(6,"translate"),a(),u(7,ne,12,12),u(8,oe,6,3,"div",8),u(9,ae,9,6,"div",9),u(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),g(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",f(14,te,t.backgroundStyle))("ngClass",f(16,ie,!t.backgroundStyle)),i(3),m("formGroup",t.form),i(2),h(d(6,10,"setup.welcome_to_homebridge")),i(2),c(t.twoFactorCodeRequired?-1:7),i(),c(t.twoFactorCodeRequired?8:-1),i(),c(t.invalidCredentials?9:-1),i(),c(t.invalid2faCode?10:-1),i(2),m("disabled",t.form.invalid),i(),R(" ",d(14,12,"form.button_continue")," "))},dependencies:[V,G,q,$,B,O,H,A,Q,z,D,N,P,j],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return e})();export{_e as LoginComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as i}from"./chunk-6LB7WDKS.js";import{Xa as e,fa as t}from"./chunk-WWMJUVLA.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-
|
|
1
|
+
import{g as i}from"./chunk-6LB7WDKS.js";import{Xa as e,fa as t}from"./chunk-WWMJUVLA.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-HIPMWDXV.js").then(o=>o.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-2AKQTDK2.js").then(o=>o.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-55Q6EZGV.js").then(o=>o.TerminalModule)}],l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(d),i]})}return o})();var p=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[l]})}return o})();export{p as PlatformToolsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as H}from"./chunk-Y276Q4AC.js";import{a as L,b as S}from"./chunk-2XYBM4MH.js";import{m as T}from"./chunk-3ZU7ZAMP.js";import{l as B}from"./chunk-
|
|
1
|
+
import{b as H}from"./chunk-Y276Q4AC.js";import{a as L,b as S}from"./chunk-2XYBM4MH.js";import{m as T}from"./chunk-3ZU7ZAMP.js";import{l as B}from"./chunk-O3NFPA75.js";import{Db as k,Ga as f,Gb as b,Ha as O,Ib as d,La as o,Ub as y,Vb as u,Wa as v,Wb as I,Xb as M,dc as w,ja as h,kb as C,lb as r,mb as l,mc as g,nc as _,oa as x,pa as P,rb as p,sb as i,tb as a,ub as m}from"./chunk-WWMJUVLA.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(w("fas ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,f)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,f)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),u(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),u(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),u(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,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"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[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"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),u(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),I(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,f),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as i}from"./chunk-6LB7WDKS.js";import{Xa as r,fa as o}from"./chunk-WWMJUVLA.js";var m=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{g as i}from"./chunk-6LB7WDKS.js";import{Xa as r,fa as o}from"./chunk-WWMJUVLA.js";var m=[{path:"",loadComponent:()=>import("./chunk-WSDYJWQD.js").then(t=>t.SupportComponent)}],n=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({imports:[i.forChild(m),i]})}return t})();var s=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({imports:[n]})}return t})();export{s as SupportModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-EDO563GI.js";import"./chunk-BOFQVJNK.js";import"./chunk-AA4REKSK.js";import"./chunk-2XYBM4MH.js";import"./chunk-3ZU7ZAMP.js";import"./chunk-MCPFJTIS.js";import"./chunk-ZPVJRQ5M.js";import"./chunk-QDMF6BOL.js";import{g as i}from"./chunk-6LB7WDKS.js";import"./chunk-DVZ3YL7I.js";import"./chunk-O3NFPA75.js";import{Xa as t,fa as e}from"./chunk-WWMJUVLA.js";var u=[{path:"",loadComponent:()=>import("./chunk-BYLMWAKC.js").then(o=>o.AccessoriesComponent)}],c=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[i.forChild(u),i]})}return o})();var l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[s,c]})}return o})();export{l as AccessoriesModule};
|