homebridge-config-ui-x 5.4.2-beta.37 → 5.4.2-beta.39

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.
Files changed (77) hide show
  1. package/dist/core/spa/spa.filter.js +3 -2
  2. package/dist/core/spa/spa.filter.js.map +1 -1
  3. package/package.json +2 -2
  4. package/public/{chunk-WDLO2LKE.js → chunk-3D6N65J4.js} +1 -1
  5. package/public/{chunk-DBFJEIJS.js → chunk-3UBUXOXE.js} +1 -1
  6. package/public/{chunk-ZZ3PNQCV.js → chunk-4HJOARLT.js} +1 -1
  7. package/public/{chunk-VID4VJYB.js → chunk-4LSEOPOZ.js} +1 -1
  8. package/public/chunk-52C7AQHF.js +1 -0
  9. package/public/{chunk-GZTSZV57.js → chunk-5X4DSSFX.js} +1 -1
  10. package/public/{chunk-I5TETZ3I.js → chunk-5YEYAEII.js} +1 -1
  11. package/public/{chunk-LXFVNKLD.js → chunk-6DTD6NF3.js} +1 -1
  12. package/public/{chunk-4AMA2I7S.js → chunk-7A5X27PD.js} +1 -1
  13. package/public/{chunk-SKNY42PA.js → chunk-7GLWRKU3.js} +1 -1
  14. package/public/{chunk-4C4YI6E7.js → chunk-A5RJD2NI.js} +1 -1
  15. package/public/{chunk-SGN6BUCA.js → chunk-A7SU4MHQ.js} +1 -1
  16. package/public/{chunk-YOAZTJFX.js → chunk-AACIDDLQ.js} +1 -1
  17. package/public/{chunk-TJBMXIMS.js → chunk-ALCBZAYU.js} +1 -1
  18. package/public/{chunk-2QWVRCJT.js → chunk-APLWY5NX.js} +1 -1
  19. package/public/{chunk-7DPEZVCW.js → chunk-ATQX7UAD.js} +1 -1
  20. package/public/{chunk-UGKYL4GC.js → chunk-ATSXA6JC.js} +1 -1
  21. package/public/{chunk-VONVM67K.js → chunk-AWGNNB2D.js} +1 -1
  22. package/public/{chunk-J3XG7P63.js → chunk-CENZI3S3.js} +1 -1
  23. package/public/{chunk-LLGX7H2E.js → chunk-CTIB22NA.js} +1 -1
  24. package/public/{chunk-YP7VO76N.js → chunk-CWRKEWVF.js} +1 -1
  25. package/public/{chunk-74ETBIBO.js → chunk-D2HNCCB6.js} +1 -1
  26. package/public/{chunk-D53WL7UT.js → chunk-ELWS32DY.js} +1 -1
  27. package/public/{chunk-7XG67XSY.js → chunk-EOXVJQVC.js} +1 -1
  28. package/public/{chunk-XOF4NGP2.js → chunk-ER7B4SJX.js} +1 -1
  29. package/public/{chunk-ENIRIFAZ.js → chunk-F7JJKIRH.js} +1 -1
  30. package/public/{chunk-WWWGF75T.js → chunk-FXWHB456.js} +1 -1
  31. package/public/{chunk-PDYEJROE.js → chunk-G4LZU4IV.js} +1 -1
  32. package/public/{chunk-M5IQIUAS.js → chunk-HPKM7IIM.js} +1 -1
  33. package/public/{chunk-KT4VIVBF.js → chunk-HQBRFFPL.js} +1 -1
  34. package/public/{chunk-VYQ356YN.js → chunk-IL6JW6PB.js} +1 -1
  35. package/public/{chunk-M4JP7A5D.js → chunk-JFVIVTPN.js} +1 -1
  36. package/public/{chunk-F7ZV2JBO.js → chunk-KCLLEPG3.js} +1 -1
  37. package/public/{chunk-XVR5PO5K.js → chunk-L67VNHG3.js} +1 -1
  38. package/public/{chunk-ICMMGBDN.js → chunk-L6A3JX4G.js} +1 -1
  39. package/public/chunk-LUEG67ZC.js +1 -0
  40. package/public/{chunk-ECQJTOVP.js → chunk-NHATITBP.js} +1 -1
  41. package/public/{chunk-4O73JKMD.js → chunk-O2LPJIGL.js} +1 -1
  42. package/public/{chunk-3QYCAQXA.js → chunk-O5JN3MGQ.js} +1 -1
  43. package/public/{chunk-VMKJBULC.js → chunk-P26NLHMF.js} +1 -1
  44. package/public/{chunk-FH4R4DUJ.js → chunk-P3OBPI52.js} +1 -1
  45. package/public/{chunk-V2XN5VIX.js → chunk-PRNMO4E2.js} +4 -4
  46. package/public/{chunk-2M4EMVZU.js → chunk-QB3FSNZ6.js} +1 -1
  47. package/public/{chunk-4UU3RZEP.js → chunk-QTUF3RXY.js} +1 -1
  48. package/public/{chunk-2AA6JX5R.js → chunk-R5MI5QFX.js} +1 -1
  49. package/public/{chunk-GKQKFOED.js → chunk-R7VTFW66.js} +1 -1
  50. package/public/{chunk-P325ISRZ.js → chunk-RVTLTH36.js} +1 -1
  51. package/public/{chunk-N3PLAD2S.js → chunk-S7DYBWZB.js} +1 -1
  52. package/public/{chunk-FB6JMBLA.js → chunk-SWEKN3LU.js} +1 -1
  53. package/public/{chunk-FSYVLNWZ.js → chunk-SY5A3FXC.js} +1 -1
  54. package/public/{chunk-DSZHROF5.js → chunk-T5BB33VY.js} +1 -1
  55. package/public/{chunk-X7YPEFXQ.js → chunk-T746DKPC.js} +1 -1
  56. package/public/{chunk-RID3MVAU.js → chunk-TC6W6G4K.js} +1 -1
  57. package/public/{chunk-P5YAXACP.js → chunk-TUAZNIXQ.js} +1 -1
  58. package/public/{chunk-GI7GTPWF.js → chunk-TWX3KTUB.js} +1 -1
  59. package/public/{chunk-5IYSHGW6.js → chunk-UHBBWEYF.js} +1 -1
  60. package/public/{chunk-TQON4PEW.js → chunk-UZNQPAX6.js} +1 -1
  61. package/public/{chunk-APVR3TMK.js → chunk-WWTLM3TS.js} +1 -1
  62. package/public/chunk-X7MOL36P.js +1 -0
  63. package/public/{chunk-LHCF3MMU.js → chunk-XXWZHGPF.js} +1 -1
  64. package/public/{chunk-WKP5AQIC.js → chunk-YOZL5FMO.js} +1 -1
  65. package/public/{chunk-7JR3FPKB.js → chunk-YXBZAUAD.js} +1 -1
  66. package/public/{chunk-NZ7MYPJZ.js → chunk-Z5NTLQ63.js} +1 -1
  67. package/public/{chunk-XCE4GMMC.js → chunk-Z5ZROBPW.js} +1 -1
  68. package/public/{chunk-MBGUT2JJ.js → chunk-ZFMH535N.js} +1 -1
  69. package/public/{chunk-2T23YUFT.js → chunk-ZLMFFYBI.js} +1 -1
  70. package/public/{chunk-YMAWYUA6.js → chunk-ZX7APSEP.js} +1 -1
  71. package/public/index.html +2 -2
  72. package/public/{main-73FN4QK2.js → main-RGXEDQLJ.js} +1 -1
  73. package/public/styles-643WFJRY.css +1 -0
  74. package/public/chunk-A7RLQSPX.js +0 -1
  75. package/public/chunk-RW6BV4KL.js +0 -1
  76. package/public/chunk-VVSMN6BE.js +0 -1
  77. package/public/styles-AUT3PDLG.css +0 -1
@@ -1 +1 @@
1
- import{m as I}from"./chunk-LXFVNKLD.js";import{l as H}from"./chunk-YP7VO76N.js";import{Db as B,Eb as p,Ga as r,Hb as f,Ib as m,La as i,Ub as v,Vb as u,Wa as L,Wb as k,Xb as E,dc as g,ja as M,kb as x,lb as d,mb as c,mc as C,nc as b,oa as T,pa as y,vb as o,wb as a,xb as s}from"./chunk-V2XN5VIX.js";function S(t,_){if(t&1&&s(0,"i",14),t&2){let e=m();v(g("fas fa-fw ",e.faIconClass," mb-3"))}}function z(t,_){if(t&1&&s(0,"p",7),t&2){let e=m();p("innerHTML",e.message2,r)}}function h(t,_){if(t&1&&s(0,"p",7),t&2){let e=m();p("innerHTML",e.message3,r)}}function P(t,_){if(t&1){let e=B();o(0,"button",15),f("click",function(){T(e);let n=m();return y(n.closeModal())}),u(1),a()}if(t&2){let e=m();v(g("btn ",e.confirmButtonClass||"btn-primary")),i(),E(" ",e.confirmButtonLabel," ")}}var N=(()=>{class t{$activeModal=M(I);title;message;message2;message3;confirmButtonLabel;confirmButtonClass;faIconClass;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(){this.$activeModal.close()}static \u0275fac=function(l){return new(l||t)};static \u0275cmp=L({type:t,selectors:[["ng-component"]],inputs:{title:"title",message:"message",message2:"message2",message3:"message3",confirmButtonLabel:"confirmButtonLabel",confirmButtonClass:"confirmButtonClass",faIconClass:"faIconClass"},decls:20,vars:15,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-0","text-center",3,"innerHTML"],[1,"mt-2","mb-0","text-center",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",3,"class"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",3,"click"]],template:function(l,n){l&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),u(3),a(),o(4,"button",3),C(5,"translate"),f("click",function(){return n.dismissModal()}),a()(),o(6,"div",4),d(7,S,1,3,"i",5),s(8,"p",6),d(9,z,1,1,"p",7),d(10,h,1,1,"p",7),a(),o(11,"div",8)(12,"div",9)(13,"button",10),C(14,"translate"),f("click",function(){return n.dismissModal()}),u(15),C(16,"translate"),a()(),s(17,"div",11),o(18,"div",12),d(19,P,2,4,"button",13),a()()()),l&2&&(i(3),k(n.title),i(),x("aria-label",b(5,9,"form.button_close")),i(3),c(n.faIconClass?7:-1),i(),p("innerHTML",n.message,r),i(),c(n.message2?9:-1),i(),c(n.message3?10:-1),i(3),x("aria-label",b(14,11,"form.button_cancel")),i(2),E(" ",b(16,13,"form.button_cancel")," "),i(4),c(n.confirmButtonLabel?19:-1))},dependencies:[H],encapsulation:2})}return t})();export{N as a};
1
+ import{m as I}from"./chunk-6DTD6NF3.js";import{l as H}from"./chunk-CWRKEWVF.js";import{Db as B,Eb as p,Ga as r,Hb as f,Ib as m,La as i,Ub as v,Vb as u,Wa as L,Wb as k,Xb as E,dc as g,ja as M,kb as x,lb as d,mb as c,mc as C,nc as b,oa as T,pa as y,vb as o,wb as a,xb as s}from"./chunk-PRNMO4E2.js";function S(t,_){if(t&1&&s(0,"i",14),t&2){let e=m();v(g("fas fa-fw ",e.faIconClass," mb-3"))}}function z(t,_){if(t&1&&s(0,"p",7),t&2){let e=m();p("innerHTML",e.message2,r)}}function h(t,_){if(t&1&&s(0,"p",7),t&2){let e=m();p("innerHTML",e.message3,r)}}function P(t,_){if(t&1){let e=B();o(0,"button",15),f("click",function(){T(e);let n=m();return y(n.closeModal())}),u(1),a()}if(t&2){let e=m();v(g("btn ",e.confirmButtonClass||"btn-primary")),i(),E(" ",e.confirmButtonLabel," ")}}var N=(()=>{class t{$activeModal=M(I);title;message;message2;message3;confirmButtonLabel;confirmButtonClass;faIconClass;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(){this.$activeModal.close()}static \u0275fac=function(l){return new(l||t)};static \u0275cmp=L({type:t,selectors:[["ng-component"]],inputs:{title:"title",message:"message",message2:"message2",message3:"message3",confirmButtonLabel:"confirmButtonLabel",confirmButtonClass:"confirmButtonClass",faIconClass:"faIconClass"},decls:20,vars:15,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-0","text-center",3,"innerHTML"],[1,"mt-2","mb-0","text-center",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",3,"class"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",3,"click"]],template:function(l,n){l&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),u(3),a(),o(4,"button",3),C(5,"translate"),f("click",function(){return n.dismissModal()}),a()(),o(6,"div",4),d(7,S,1,3,"i",5),s(8,"p",6),d(9,z,1,1,"p",7),d(10,h,1,1,"p",7),a(),o(11,"div",8)(12,"div",9)(13,"button",10),C(14,"translate"),f("click",function(){return n.dismissModal()}),u(15),C(16,"translate"),a()(),s(17,"div",11),o(18,"div",12),d(19,P,2,4,"button",13),a()()()),l&2&&(i(3),k(n.title),i(),x("aria-label",b(5,9,"form.button_close")),i(3),c(n.faIconClass?7:-1),i(),p("innerHTML",n.message,r),i(),c(n.message2?9:-1),i(),c(n.message3?10:-1),i(3),x("aria-label",b(14,11,"form.button_cancel")),i(2),E(" ",b(16,13,"form.button_cancel")," "),i(4),c(n.confirmButtonLabel?19:-1))},dependencies:[H],encapsulation:2})}return t})();export{N as a};
@@ -1,4 +1,4 @@
1
- import{a as z,b,c as k}from"./chunk-YOAZTJFX.js";import{a as u}from"./chunk-TQON4PEW.js";import{q as f}from"./chunk-YP7VO76N.js";import{M as t,ea as p,g as n,h as c,ja as a,n as h}from"./chunk-V2XN5VIX.js";var d=n(z(),1),l=n(b(),1),m=n(k(),1);var v=(()=>{class o{$ws=a(u);$api=a(f);io;fitAddon;webLinksAddon;resize;elementResize;dataDisposable=null;isInitializing=!1;hasUserTyped=!1;term;destroyTerminal(){this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.io&&this.io.end(),this.term&&(this.term.dispose(),this.term=null),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.isInitializing=!1,this.hasUserTyped=!1}destroyPersistentSession(){this.destroyTerminal(),this.$api.post("/platform-tools/terminal/destroy-persistent-session",{}).subscribe({error:s=>console.error("Failed to destroy persistent session:",s)})}detachTerminal(){this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.term&&this.term.dispose(),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.isInitializing=!1}hasActiveSession(){return this.io&&this.io.socket&&this.io.socket.connected}checkBackendPersistentSession(){return c(this,null,function*(){try{return(yield this.$api.get("/platform-tools/terminal/has-persistent-session").toPromise()).hasPersistentSession}catch(s){return console.error("Failed to check backend persistent session:",s),!1}})}hasUserTypedInSession(){return this.hasUserTyped}isTerminalReady(){return this.term&&!this.isInitializing}reconnectTerminal(s,e={},r){if(this.isInitializing)return!1;this.isInitializing=!0,this.elementResize=r,this.io&&this.io.socket&&this.io.socket.connected?(this.term=new m.Terminal(e),this.fitAddon=new d.FitAddon,this.webLinksAddon=new l.WebLinksAddon,setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.resize=new h,this.term.open(s.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.socket.removeAllListeners("stdout"),this.io.socket.removeAllListeners("process-exit"),this.io.socket.on("stdout",i=>{this.term.write(i)}),this.io.socket.on("process-exit",()=>{this.startSession()}),this.dataDisposable&&this.dataDisposable.dispose(),this.dataDisposable=this.term.onData(i=>{this.hasUserTyped=!0,this.io.socket.emit("stdin",i)}),this.term.onResize(i=>{this.resize.next(i)}),this.resize.pipe(t(500)).subscribe(i=>{this.io.socket.emit("resize",i)}),this.elementResize&&this.elementResize.pipe(t(100)).subscribe({next:()=>{this.fitAddon.fit()}}),this.io.socket.emit("start-session",{cols:this.term.cols,rows:this.term.rows}),this.isInitializing=!1):this.startTerminal(s,e,r)}startTerminal(s,e={},r){return this.isInitializing?!1:(this.isInitializing=!0,this.elementResize=r,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new m.Terminal(e),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new d.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new h,this.term.open(s.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(t(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
1
+ import{a as z,b,c as k}from"./chunk-AACIDDLQ.js";import{a as u}from"./chunk-UZNQPAX6.js";import{q as f}from"./chunk-CWRKEWVF.js";import{M as t,ea as p,g as n,h as c,ja as a,n as h}from"./chunk-PRNMO4E2.js";var d=n(z(),1),l=n(b(),1),m=n(k(),1);var v=(()=>{class o{$ws=a(u);$api=a(f);io;fitAddon;webLinksAddon;resize;elementResize;dataDisposable=null;isInitializing=!1;hasUserTyped=!1;term;destroyTerminal(){this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.io&&this.io.end(),this.term&&(this.term.dispose(),this.term=null),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.isInitializing=!1,this.hasUserTyped=!1}destroyPersistentSession(){this.destroyTerminal(),this.$api.post("/platform-tools/terminal/destroy-persistent-session",{}).subscribe({error:s=>console.error("Failed to destroy persistent session:",s)})}detachTerminal(){this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.term&&this.term.dispose(),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.isInitializing=!1}hasActiveSession(){return this.io&&this.io.socket&&this.io.socket.connected}checkBackendPersistentSession(){return c(this,null,function*(){try{return(yield this.$api.get("/platform-tools/terminal/has-persistent-session").toPromise()).hasPersistentSession}catch(s){return console.error("Failed to check backend persistent session:",s),!1}})}hasUserTypedInSession(){return this.hasUserTyped}isTerminalReady(){return this.term&&!this.isInitializing}reconnectTerminal(s,e={},r){if(this.isInitializing)return!1;this.isInitializing=!0,this.elementResize=r,this.io&&this.io.socket&&this.io.socket.connected?(this.term=new m.Terminal(e),this.fitAddon=new d.FitAddon,this.webLinksAddon=new l.WebLinksAddon,setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.resize=new h,this.term.open(s.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.socket.removeAllListeners("stdout"),this.io.socket.removeAllListeners("process-exit"),this.io.socket.on("stdout",i=>{this.term.write(i)}),this.io.socket.on("process-exit",()=>{this.startSession()}),this.dataDisposable&&this.dataDisposable.dispose(),this.dataDisposable=this.term.onData(i=>{this.hasUserTyped=!0,this.io.socket.emit("stdin",i)}),this.term.onResize(i=>{this.resize.next(i)}),this.resize.pipe(t(500)).subscribe(i=>{this.io.socket.emit("resize",i)}),this.elementResize&&this.elementResize.pipe(t(100)).subscribe({next:()=>{this.fitAddon.fit()}}),this.io.socket.emit("start-session",{cols:this.term.cols,rows:this.term.rows}),this.isInitializing=!1):this.startTerminal(s,e,r)}startTerminal(s,e={},r){return this.isInitializing?!1:(this.isInitializing=!0,this.elementResize=r,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new m.Terminal(e),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new d.FitAddon,this.webLinksAddon=new l.WebLinksAddon,this.resize=new h,this.term.open(s.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(t(200)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
2
2
  \r
3
3
  \rTerminal disconnected. Is the server running?
4
4
  \r
@@ -1,4 +1,4 @@
1
- import{a as xt}from"./chunk-7XG67XSY.js";import{b as M,e as vt,f as $t,g as jt,h as kt}from"./chunk-LHCF3MMU.js";import{a as bt,b as _t}from"./chunk-ECQJTOVP.js";import{a as Ct}from"./chunk-I5TETZ3I.js";import{a as Rt}from"./chunk-KT4VIVBF.js";import{m as ut,n as ht,t as I}from"./chunk-LXFVNKLD.js";import{B as mt,C as ft,c as ct,e as pt,l as gt}from"./chunk-F7ZV2JBO.js";import{b as yt,d as H}from"./chunk-YMAWYUA6.js";import{b as wt}from"./chunk-SKNY42PA.js";import{k as R,l as j,n as O,q as N}from"./chunk-YP7VO76N.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 u,ob as et,oc as G,pa as h,pb as it,qb as nt,rb as f,sb as a,tb as d,ub as g,w as S}from"./chunk-V2XN5VIX.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=u(t).$implicit,n=p(2);return h(n.restore(i.id))}),g(12,"i",26),d(),a(13,"button",27),r(14,"translate"),r(15,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(n.download(i.id))}),g(16,"i",28),d(),a(17,"button",23),r(18,"translate"),r(19,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(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(){u(t);let i=p();return h(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(ut);$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-fw","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-fw","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-fw","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","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","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(){u(t);let i=p();return h(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(){u(t);let i=p();return h(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(){u(t);let i=p();return h(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){u(t);let n=p();return h(n.onEditorInit(i))})("keydown.control.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())})("keydown.meta.s",function(i){u(t);let n=p();return i.preventDefault(),h(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){u(t);let n=p();return h(n.onInitDiffEditor(i))})("keydown.control.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())})("keydown.meta.s",function(i){u(t);let n=p();return i.preventDefault(),h(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){u(t);let n=p();return rt(n.homebridgeConfig,i)||(n.homebridgeConfig=i),h(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(ht);$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-EOXVJQVC.js";import{b as M,e as vt,f as $t,g as jt,h as kt}from"./chunk-XXWZHGPF.js";import{a as bt,b as _t}from"./chunk-NHATITBP.js";import{a as Ct}from"./chunk-5YEYAEII.js";import{a as Rt}from"./chunk-HQBRFFPL.js";import{m as ut,n as ht,t as I}from"./chunk-6DTD6NF3.js";import{B as mt,C as ft,c as ct,e as pt,l as gt}from"./chunk-KCLLEPG3.js";import{b as yt,d as H}from"./chunk-ZX7APSEP.js";import{b as wt}from"./chunk-7GLWRKU3.js";import{k as R,l as j,n as O,q as N}from"./chunk-CWRKEWVF.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 u,ob as et,oc as G,pa as h,pb as it,qb as nt,rb as f,sb as a,tb as d,ub as g,w as S}from"./chunk-PRNMO4E2.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=u(t).$implicit,n=p(2);return h(n.restore(i.id))}),g(12,"i",26),d(),a(13,"button",27),r(14,"translate"),r(15,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(n.download(i.id))}),g(16,"i",28),d(),a(17,"button",23),r(18,"translate"),r(19,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(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(){u(t);let i=p();return h(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(ut);$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-fw","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-fw","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-fw","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","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","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(){u(t);let i=p();return h(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(){u(t);let i=p();return h(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(){u(t);let i=p();return h(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){u(t);let n=p();return h(n.onEditorInit(i))})("keydown.control.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())})("keydown.meta.s",function(i){u(t);let n=p();return i.preventDefault(),h(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){u(t);let n=p();return h(n.onInitDiffEditor(i))})("keydown.control.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())})("keydown.meta.s",function(i){u(t);let n=p();return i.preventDefault(),h(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){u(t);let n=p();return rt(n.homebridgeConfig,i)||(n.homebridgeConfig=i),h(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(ht);$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(`
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).
@@ -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-GI7GTPWF.js";import{b as D}from"./chunk-74ETBIBO.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-V2XN5VIX.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(`
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-TWX3KTUB.js";import{b as D}from"./chunk-D2HNCCB6.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-PRNMO4E2.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};
@@ -1,4 +1,4 @@
1
- import{a as Zv}from"./chunk-FH4R4DUJ.js";import{a as Tp,c as Lv,d as Gv,e as Jv,f as dn,g as mR,h as Pp}from"./chunk-LHCF3MMU.js";import{a as Fv}from"./chunk-ECQJTOVP.js";import{a as $v}from"./chunk-I5TETZ3I.js";import{a as Yv}from"./chunk-J3XG7P63.js";import{a as Vv,b as qv,c as Kv}from"./chunk-YOAZTJFX.js";import{a as Pa}from"./chunk-KT4VIVBF.js";import{a as Wv}from"./chunk-SGN6BUCA.js";import{a as dd,b as pd}from"./chunk-ZZ3PNQCV.js";import{a as ud,b as gd}from"./chunk-74ETBIBO.js";import{a as Ov}from"./chunk-DSZHROF5.js";import{a as od,b as rd,c as nd,d as ad,e as ld,f as cd,g as cn,m as zt,n as Di,o as Bv,p as Ev,q as Mv,r as Uv,s as Rv,t as Ko}from"./chunk-LXFVNKLD.js";import{A as Dv,B as Cs,C as Ta,a as xv,b as Fo,c as wr,e as li,f as Iv,h as Tv,i as Pv,j as zv,k as Av,l as cs,m as jv,o as Nv,p as Oo,s as ln,t as Vo,u as Ip,v as qo}from"./chunk-F7ZV2JBO.js";import{a as Lo}from"./chunk-TQON4PEW.js";import{d as Os}from"./chunk-YMAWYUA6.js";import{b as jt}from"./chunk-SKNY42PA.js";import{k as nt,l as At,n as at,p as $o,q as tt}from"./chunk-YP7VO76N.js";import{$ as Ca,$c as Cv,Ac as id,Ba as rn,D as pv,Db as ae,Ga as Ve,Gb as Q,Hb as ed,Ib as C,Ka as bv,Kc as Ni,La as m,Lc as Ro,M as sn,Mb as Sp,Mc as ai,Nb as Cp,Ob as xp,Pa as Yc,Pb as Bo,Qa as co,Qb as Eo,Rb as wv,Sa as br,Sb as Hs,Tb as Fs,Tc as sd,Ub as fe,Vb as A,Wa as we,Wb as le,Xa as nn,Xb as ie,Xc as Sv,Y as Hp,Ya as yr,Yb as Mo,Za as yv,Zb as td,a as be,ab as Ie,ac as dt,b as Xe,bb as vv,bc as ut,c as lv,cb as Jc,cc as gt,da as mv,dc as kv,e as w,ea as vi,ec as Hv,fa as on,fc as pt,g as ct,gc as Ss,h as he,ha as hv,hc as vr,ia as _v,ic as Si,ja as V,jc as an,k as cv,kb as pe,lb as R,mb as F,mc as N,n as Yi,nc as M,o as kp,oa as J,ob as wi,oc as Et,pa as Z,pb as ki,q as dv,qb as Hi,rb as I,sb as y,tb as b,ub as E,v as uv,vb as Zc,vc as Ci,w as Ue,wa as Wc,wb as Qc,wc as re,x as gv,xb as Xc,xc as Uo,ya as Do,yb as xa,za as fv,zb as Ia}from"./chunk-V2XN5VIX.js";var rw=w(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.formatNames=qs.fastFormats=qs.fullFormats=void 0;function Vs(e,i){return{validate:e,compare:i}}qs.fullFormats={date:Vs(tw,Np),time:Vs(Ap(!0),Dp),"date-time":Vs(Qv(!0),sw),"iso-time":Vs(Ap(),iw),"iso-date-time":Vs(Qv(),ow),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:vR,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:IR,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:wR,int32:{type:"number",validate:SR},int64:{type:"number",validate:CR},float:{type:"number",validate:ew},double:{type:"number",validate:ew},password:!0,binary:!0};qs.fastFormats=Xe(be({},qs.fullFormats),{date:Vs(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Np),time:Vs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Dp),"date-time":Vs(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sw),"iso-time":Vs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,iw),"iso-date-time":Vs(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ow),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});qs.formatNames=Object.keys(qs.fullFormats);function hR(e){return e%4===0&&(e%100!==0||e%400===0)}var _R=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,fR=[0,31,28,31,30,31,30,31,31,30,31,30,31];function tw(e){let i=_R.exec(e);if(!i)return!1;let t=+i[1],s=+i[2],o=+i[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&hR(t)?29:fR[s])}function Np(e,i){if(e&&i)return e>i?1:e<i?-1:0}var zp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ap(e){return function(t){let s=zp.exec(t);if(!s)return!1;let o=+s[1],n=+s[2],l=+s[3],c=s[4],u=s[5]==="-"?-1:1,p=+(s[6]||0),h=+(s[7]||0);if(p>23||h>59||e&&!c)return!1;if(o<=23&&n<=59&&l<60)return!0;let f=n-h*u,S=o-p*u-(f<0?1:0);return(S===23||S===-1)&&(f===59||f===-1)&&l<61}}function Dp(e,i){if(!(e&&i))return;let t=new Date("2020-01-01T"+e).valueOf(),s=new Date("2020-01-01T"+i).valueOf();if(t&&s)return t-s}function iw(e,i){if(!(e&&i))return;let t=zp.exec(e),s=zp.exec(i);if(t&&s)return e=t[1]+t[2]+t[3],i=s[1]+s[2]+s[3],e>i?1:e<i?-1:0}var jp=/t|\s/i;function Qv(e){let i=Ap(e);return function(s){let o=s.split(jp);return o.length===2&&tw(o[0])&&i(o[1])}}function sw(e,i){if(!(e&&i))return;let t=new Date(e).valueOf(),s=new Date(i).valueOf();if(t&&s)return t-s}function ow(e,i){if(!(e&&i))return;let[t,s]=e.split(jp),[o,n]=i.split(jp),l=Np(t,o);if(l!==void 0)return l||Dp(s,n)}var bR=/\/|:/,yR=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function vR(e){return bR.test(e)&&yR.test(e)}var Xv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function wR(e){return Xv.lastIndex=0,Xv.test(e)}var kR=-(2**31),HR=2**31-1;function SR(e){return Number.isInteger(e)&&e<=HR&&e>=kR}function CR(e){return Number.isInteger(e)}function ew(){return!0}var xR=/[^\\]\\Z/;function IR(e){if(xR.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var ja=w(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.regexpCode=et.getEsmExportName=et.getProperty=et.safeStringify=et.stringify=et.strConcat=et.addCodeArg=et.str=et._=et.nil=et._Code=et.Name=et.IDENTIFIER=et._CodeOrName=void 0;var za=class{};et._CodeOrName=za;et.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var kr=class extends za{constructor(i){if(super(),!et.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};et.Name=kr;var ds=class extends za{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,s)=>`${t}${s}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,s)=>(s instanceof kr&&(t[s.str]=(t[s.str]||0)+1),t),{})}};et._Code=ds;et.nil=new ds("");function nw(e,...i){let t=[e[0]],s=0;for(;s<i.length;)Ep(t,i[s]),t.push(e[++s]);return new ds(t)}et._=nw;var Bp=new ds("+");function aw(e,...i){let t=[Aa(e[0])],s=0;for(;s<i.length;)t.push(Bp),Ep(t,i[s]),t.push(Bp,Aa(e[++s]));return TR(t),new ds(t)}et.str=aw;function Ep(e,i){i instanceof ds?e.push(...i._items):i instanceof kr?e.push(i):e.push(AR(i))}et.addCodeArg=Ep;function TR(e){let i=1;for(;i<e.length-1;){if(e[i]===Bp){let t=PR(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function PR(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof kr||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof kr))return`"${e}${i.slice(1)}`}function zR(e,i){return i.emptyStr()?e:e.emptyStr()?i:aw`${e}${i}`}et.strConcat=zR;function AR(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Aa(Array.isArray(e)?e.join(","):e)}function jR(e){return new ds(Aa(e))}et.stringify=jR;function Aa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}et.safeStringify=Aa;function NR(e){return typeof e=="string"&&et.IDENTIFIER.test(e)?new ds(`.${e}`):nw`[${e}]`}et.getProperty=NR;function DR(e){if(typeof e=="string"&&et.IDENTIFIER.test(e))return new ds(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}et.getEsmExportName=DR;function BR(e){return new ds(e.toString())}et.regexpCode=BR});var Rp=w(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ValueScope=Ei.ValueScopeName=Ei.Scope=Ei.varKinds=Ei.UsedValueState=void 0;var Bi=ja(),Mp=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},md=(function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e})(md||(Ei.UsedValueState=md={}));Ei.varKinds={const:new Bi.Name("const"),let:new Bi.Name("let"),var:new Bi.Name("var")};var hd=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof Bi.Name?i:this.name(i)}name(i){return new Bi.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,s;if(!((s=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||s===void 0)&&s.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};Ei.Scope=hd;var _d=class extends Bi.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:s}){this.value=i,this.scopePath=(0,Bi._)`.${new Bi.Name(t)}[${s}]`}};Ei.ValueScopeName=_d;var ER=(0,Bi._)`\n`,Up=class extends hd{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=Xe(be({},i),{_n:i.lines?ER:Bi.nil})}get(){return this._scope}name(i){return new _d(i,this._newName(i))}value(i,t){var s;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(i),{prefix:n}=o,l=(s=t.key)!==null&&s!==void 0?s:t.ref,c=this._values[n];if(c){let h=c.get(l);if(h)return h}else c=this._values[n]=new Map;c.set(l,o);let u=this._scope[n]||(this._scope[n]=[]),p=u.length;return u[p]=t.ref,o.setValue(t,{property:n,itemIndex:p}),o}getValue(i,t){let s=this._values[i];if(s)return s.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,Bi._)`${i}${s.scopePath}`})}scopeCode(i=this._values,t,s){return this._reduceValues(i,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},t,s)}_reduceValues(i,t,s={},o){let n=Bi.nil;for(let l in i){let c=i[l];if(!c)continue;let u=s[l]=s[l]||new Map;c.forEach(p=>{if(u.has(p))return;u.set(p,md.Started);let h=t(p);if(h){let f=this.opts.es5?Ei.varKinds.var:Ei.varKinds.const;n=(0,Bi._)`${n}${f} ${p} = ${h};${this.opts._n}`}else if(h=o?.(p))n=(0,Bi._)`${n}${h}${this.opts._n}`;else throw new Mp(p);u.set(p,md.Completed)})}return n}};Ei.ValueScope=Up});var ke=w(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.or=Oe.and=Oe.not=Oe.CodeGen=Oe.operators=Oe.varKinds=Oe.ValueScopeName=Oe.ValueScope=Oe.Scope=Oe.Name=Oe.regexpCode=Oe.stringify=Oe.getProperty=Oe.nil=Oe.strConcat=Oe.str=Oe._=void 0;var Je=ja(),xs=Rp(),Go=ja();Object.defineProperty(Oe,"_",{enumerable:!0,get:function(){return Go._}});Object.defineProperty(Oe,"str",{enumerable:!0,get:function(){return Go.str}});Object.defineProperty(Oe,"strConcat",{enumerable:!0,get:function(){return Go.strConcat}});Object.defineProperty(Oe,"nil",{enumerable:!0,get:function(){return Go.nil}});Object.defineProperty(Oe,"getProperty",{enumerable:!0,get:function(){return Go.getProperty}});Object.defineProperty(Oe,"stringify",{enumerable:!0,get:function(){return Go.stringify}});Object.defineProperty(Oe,"regexpCode",{enumerable:!0,get:function(){return Go.regexpCode}});Object.defineProperty(Oe,"Name",{enumerable:!0,get:function(){return Go.Name}});var wd=Rp();Object.defineProperty(Oe,"Scope",{enumerable:!0,get:function(){return wd.Scope}});Object.defineProperty(Oe,"ValueScope",{enumerable:!0,get:function(){return wd.ValueScope}});Object.defineProperty(Oe,"ValueScopeName",{enumerable:!0,get:function(){return wd.ValueScopeName}});Object.defineProperty(Oe,"varKinds",{enumerable:!0,get:function(){return wd.varKinds}});Oe.operators={GT:new Je._Code(">"),GTE:new Je._Code(">="),LT:new Je._Code("<"),LTE:new Je._Code("<="),EQ:new Je._Code("==="),NEQ:new Je._Code("!=="),NOT:new Je._Code("!"),OR:new Je._Code("||"),AND:new Je._Code("&&"),ADD:new Je._Code("+")};var uo=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},Fp=class extends uo{constructor(i,t,s){super(),this.varKind=i,this.name=t,this.rhs=s}render({es5:i,_n:t}){let s=i?xs.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${o};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=gn(this.rhs,i,t)),this}get names(){return this.rhs instanceof Je._CodeOrName?this.rhs.names:{}}},bd=class extends uo{constructor(i,t,s){super(),this.lhs=i,this.rhs=t,this.sideEffects=s}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof Je.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=gn(this.rhs,i,t),this}get names(){let i=this.lhs instanceof Je.Name?{}:be({},this.lhs.names);return vd(i,this.rhs)}},Op=class extends bd{constructor(i,t,s,o){super(i,s,o),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},Vp=class extends uo{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},qp=class extends uo{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},Kp=class extends uo{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},$p=class extends uo{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=gn(this.code,i,t),this}get names(){return this.code instanceof Je._CodeOrName?this.code.names:{}}},Na=class extends uo{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,s)=>t+s.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let s=i[t].optimizeNodes();Array.isArray(s)?i.splice(t,1,...s):s?i[t]=s:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:s}=this,o=s.length;for(;o--;){let n=s[o];n.optimizeNames(i,t)||(MR(i,n.names),s.splice(o,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>Hr(i,t.names),{})}},go=class extends Na{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},Lp=class extends Na{},Gp=(()=>{class e extends go{}return e.kind="else",e})(),fd=(()=>{class e extends go{constructor(t,s){super(s),this.condition=t}render(t){let s=`if(${this.condition})`+super.render(t);return this.else&&(s+="else "+this.else.render(t)),s}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let s=this.else;if(s){let o=s.optimizeNodes();s=this.else=Array.isArray(o)?new Gp(o):o}if(s)return t===!1?s instanceof e?s:s.nodes:this.nodes.length?this:new e(gw(t),s instanceof e?[s]:s.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,s){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(t,s),!!(super.optimizeNames(t,s)||this.else))return this.condition=gn(this.condition,t,s),this}get names(){let t=super.names;return vd(t,this.condition),this.else&&Hr(t,this.else.names),t}}return e.kind="if",e})(),kd=(()=>{class e extends go{}return e.kind="for",e})(),Wp=class extends kd{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=gn(this.iteration,i,t),this}get names(){return Hr(super.names,this.iteration.names)}},Yp=class extends kd{constructor(i,t,s,o){super(),this.varKind=i,this.name=t,this.from=s,this.to=o}render(i){let t=i.es5?xs.varKinds.var:this.varKind,{name:s,from:o,to:n}=this;return`for(${t} ${s}=${o}; ${s}<${n}; ${s}++)`+super.render(i)}get names(){let i=vd(super.names,this.from);return vd(i,this.to)}},yd=class extends kd{constructor(i,t,s,o){super(),this.loop=i,this.varKind=t,this.name=s,this.iterable=o}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=gn(this.iterable,i,t),this}get names(){return Hr(super.names,this.iterable.names)}},lw=(()=>{class e extends go{constructor(t,s,o){super(),this.name=t,this.args=s,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),cw=(()=>{class e extends Na{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Jp=class extends go{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var s,o;return super.optimizeNames(i,t),(s=this.catch)===null||s===void 0||s.optimizeNames(i,t),(o=this.finally)===null||o===void 0||o.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&Hr(i,this.catch.names),this.finally&&Hr(i,this.finally.names),i}},dw=(()=>{class e extends go{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),uw=(()=>{class e extends go{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),Zp=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Xe(be({},t),{_n:t.lines?`
1
+ import{a as Zv}from"./chunk-P3OBPI52.js";import{a as Tp,c as Lv,d as Gv,e as Jv,f as dn,g as mR,h as Pp}from"./chunk-XXWZHGPF.js";import{a as Fv}from"./chunk-NHATITBP.js";import{a as $v}from"./chunk-5YEYAEII.js";import{a as Yv}from"./chunk-CENZI3S3.js";import{a as Vv,b as qv,c as Kv}from"./chunk-AACIDDLQ.js";import{a as Pa}from"./chunk-HQBRFFPL.js";import{a as Wv}from"./chunk-A7SU4MHQ.js";import{a as dd,b as pd}from"./chunk-4HJOARLT.js";import{a as ud,b as gd}from"./chunk-D2HNCCB6.js";import{a as Ov}from"./chunk-T5BB33VY.js";import{a as od,b as rd,c as nd,d as ad,e as ld,f as cd,g as cn,m as zt,n as Di,o as Bv,p as Ev,q as Mv,r as Uv,s as Rv,t as Ko}from"./chunk-6DTD6NF3.js";import{A as Dv,B as Cs,C as Ta,a as xv,b as Fo,c as wr,e as li,f as Iv,h as Tv,i as Pv,j as zv,k as Av,l as cs,m as jv,o as Nv,p as Oo,s as ln,t as Vo,u as Ip,v as qo}from"./chunk-KCLLEPG3.js";import{a as Lo}from"./chunk-UZNQPAX6.js";import{d as Os}from"./chunk-ZX7APSEP.js";import{b as jt}from"./chunk-7GLWRKU3.js";import{k as nt,l as At,n as at,p as $o,q as tt}from"./chunk-CWRKEWVF.js";import{$ as Ca,$c as Cv,Ac as id,Ba as rn,D as pv,Db as ae,Ga as Ve,Gb as Q,Hb as ed,Ib as C,Ka as bv,Kc as Ni,La as m,Lc as Ro,M as sn,Mb as Sp,Mc as ai,Nb as Cp,Ob as xp,Pa as Yc,Pb as Bo,Qa as co,Qb as Eo,Rb as wv,Sa as br,Sb as Hs,Tb as Fs,Tc as sd,Ub as fe,Vb as A,Wa as we,Wb as le,Xa as nn,Xb as ie,Xc as Sv,Y as Hp,Ya as yr,Yb as Mo,Za as yv,Zb as td,a as be,ab as Ie,ac as dt,b as Xe,bb as vv,bc as ut,c as lv,cb as Jc,cc as gt,da as mv,dc as kv,e as w,ea as vi,ec as Hv,fa as on,fc as pt,g as ct,gc as Ss,h as he,ha as hv,hc as vr,ia as _v,ic as Si,ja as V,jc as an,k as cv,kb as pe,lb as R,mb as F,mc as N,n as Yi,nc as M,o as kp,oa as J,ob as wi,oc as Et,pa as Z,pb as ki,q as dv,qb as Hi,rb as I,sb as y,tb as b,ub as E,v as uv,vb as Zc,vc as Ci,w as Ue,wa as Wc,wb as Qc,wc as re,x as gv,xb as Xc,xc as Uo,ya as Do,yb as xa,za as fv,zb as Ia}from"./chunk-PRNMO4E2.js";var rw=w(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.formatNames=qs.fastFormats=qs.fullFormats=void 0;function Vs(e,i){return{validate:e,compare:i}}qs.fullFormats={date:Vs(tw,Np),time:Vs(Ap(!0),Dp),"date-time":Vs(Qv(!0),sw),"iso-time":Vs(Ap(),iw),"iso-date-time":Vs(Qv(),ow),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:vR,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:IR,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:wR,int32:{type:"number",validate:SR},int64:{type:"number",validate:CR},float:{type:"number",validate:ew},double:{type:"number",validate:ew},password:!0,binary:!0};qs.fastFormats=Xe(be({},qs.fullFormats),{date:Vs(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Np),time:Vs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Dp),"date-time":Vs(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sw),"iso-time":Vs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,iw),"iso-date-time":Vs(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ow),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});qs.formatNames=Object.keys(qs.fullFormats);function hR(e){return e%4===0&&(e%100!==0||e%400===0)}var _R=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,fR=[0,31,28,31,30,31,30,31,31,30,31,30,31];function tw(e){let i=_R.exec(e);if(!i)return!1;let t=+i[1],s=+i[2],o=+i[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&hR(t)?29:fR[s])}function Np(e,i){if(e&&i)return e>i?1:e<i?-1:0}var zp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ap(e){return function(t){let s=zp.exec(t);if(!s)return!1;let o=+s[1],n=+s[2],l=+s[3],c=s[4],u=s[5]==="-"?-1:1,p=+(s[6]||0),h=+(s[7]||0);if(p>23||h>59||e&&!c)return!1;if(o<=23&&n<=59&&l<60)return!0;let f=n-h*u,S=o-p*u-(f<0?1:0);return(S===23||S===-1)&&(f===59||f===-1)&&l<61}}function Dp(e,i){if(!(e&&i))return;let t=new Date("2020-01-01T"+e).valueOf(),s=new Date("2020-01-01T"+i).valueOf();if(t&&s)return t-s}function iw(e,i){if(!(e&&i))return;let t=zp.exec(e),s=zp.exec(i);if(t&&s)return e=t[1]+t[2]+t[3],i=s[1]+s[2]+s[3],e>i?1:e<i?-1:0}var jp=/t|\s/i;function Qv(e){let i=Ap(e);return function(s){let o=s.split(jp);return o.length===2&&tw(o[0])&&i(o[1])}}function sw(e,i){if(!(e&&i))return;let t=new Date(e).valueOf(),s=new Date(i).valueOf();if(t&&s)return t-s}function ow(e,i){if(!(e&&i))return;let[t,s]=e.split(jp),[o,n]=i.split(jp),l=Np(t,o);if(l!==void 0)return l||Dp(s,n)}var bR=/\/|:/,yR=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function vR(e){return bR.test(e)&&yR.test(e)}var Xv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function wR(e){return Xv.lastIndex=0,Xv.test(e)}var kR=-(2**31),HR=2**31-1;function SR(e){return Number.isInteger(e)&&e<=HR&&e>=kR}function CR(e){return Number.isInteger(e)}function ew(){return!0}var xR=/[^\\]\\Z/;function IR(e){if(xR.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var ja=w(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.regexpCode=et.getEsmExportName=et.getProperty=et.safeStringify=et.stringify=et.strConcat=et.addCodeArg=et.str=et._=et.nil=et._Code=et.Name=et.IDENTIFIER=et._CodeOrName=void 0;var za=class{};et._CodeOrName=za;et.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var kr=class extends za{constructor(i){if(super(),!et.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};et.Name=kr;var ds=class extends za{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,s)=>`${t}${s}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,s)=>(s instanceof kr&&(t[s.str]=(t[s.str]||0)+1),t),{})}};et._Code=ds;et.nil=new ds("");function nw(e,...i){let t=[e[0]],s=0;for(;s<i.length;)Ep(t,i[s]),t.push(e[++s]);return new ds(t)}et._=nw;var Bp=new ds("+");function aw(e,...i){let t=[Aa(e[0])],s=0;for(;s<i.length;)t.push(Bp),Ep(t,i[s]),t.push(Bp,Aa(e[++s]));return TR(t),new ds(t)}et.str=aw;function Ep(e,i){i instanceof ds?e.push(...i._items):i instanceof kr?e.push(i):e.push(AR(i))}et.addCodeArg=Ep;function TR(e){let i=1;for(;i<e.length-1;){if(e[i]===Bp){let t=PR(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function PR(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof kr||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof kr))return`"${e}${i.slice(1)}`}function zR(e,i){return i.emptyStr()?e:e.emptyStr()?i:aw`${e}${i}`}et.strConcat=zR;function AR(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Aa(Array.isArray(e)?e.join(","):e)}function jR(e){return new ds(Aa(e))}et.stringify=jR;function Aa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}et.safeStringify=Aa;function NR(e){return typeof e=="string"&&et.IDENTIFIER.test(e)?new ds(`.${e}`):nw`[${e}]`}et.getProperty=NR;function DR(e){if(typeof e=="string"&&et.IDENTIFIER.test(e))return new ds(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}et.getEsmExportName=DR;function BR(e){return new ds(e.toString())}et.regexpCode=BR});var Rp=w(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ValueScope=Ei.ValueScopeName=Ei.Scope=Ei.varKinds=Ei.UsedValueState=void 0;var Bi=ja(),Mp=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},md=(function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e})(md||(Ei.UsedValueState=md={}));Ei.varKinds={const:new Bi.Name("const"),let:new Bi.Name("let"),var:new Bi.Name("var")};var hd=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof Bi.Name?i:this.name(i)}name(i){return new Bi.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,s;if(!((s=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||s===void 0)&&s.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};Ei.Scope=hd;var _d=class extends Bi.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:s}){this.value=i,this.scopePath=(0,Bi._)`.${new Bi.Name(t)}[${s}]`}};Ei.ValueScopeName=_d;var ER=(0,Bi._)`\n`,Up=class extends hd{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=Xe(be({},i),{_n:i.lines?ER:Bi.nil})}get(){return this._scope}name(i){return new _d(i,this._newName(i))}value(i,t){var s;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(i),{prefix:n}=o,l=(s=t.key)!==null&&s!==void 0?s:t.ref,c=this._values[n];if(c){let h=c.get(l);if(h)return h}else c=this._values[n]=new Map;c.set(l,o);let u=this._scope[n]||(this._scope[n]=[]),p=u.length;return u[p]=t.ref,o.setValue(t,{property:n,itemIndex:p}),o}getValue(i,t){let s=this._values[i];if(s)return s.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,Bi._)`${i}${s.scopePath}`})}scopeCode(i=this._values,t,s){return this._reduceValues(i,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},t,s)}_reduceValues(i,t,s={},o){let n=Bi.nil;for(let l in i){let c=i[l];if(!c)continue;let u=s[l]=s[l]||new Map;c.forEach(p=>{if(u.has(p))return;u.set(p,md.Started);let h=t(p);if(h){let f=this.opts.es5?Ei.varKinds.var:Ei.varKinds.const;n=(0,Bi._)`${n}${f} ${p} = ${h};${this.opts._n}`}else if(h=o?.(p))n=(0,Bi._)`${n}${h}${this.opts._n}`;else throw new Mp(p);u.set(p,md.Completed)})}return n}};Ei.ValueScope=Up});var ke=w(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.or=Oe.and=Oe.not=Oe.CodeGen=Oe.operators=Oe.varKinds=Oe.ValueScopeName=Oe.ValueScope=Oe.Scope=Oe.Name=Oe.regexpCode=Oe.stringify=Oe.getProperty=Oe.nil=Oe.strConcat=Oe.str=Oe._=void 0;var Je=ja(),xs=Rp(),Go=ja();Object.defineProperty(Oe,"_",{enumerable:!0,get:function(){return Go._}});Object.defineProperty(Oe,"str",{enumerable:!0,get:function(){return Go.str}});Object.defineProperty(Oe,"strConcat",{enumerable:!0,get:function(){return Go.strConcat}});Object.defineProperty(Oe,"nil",{enumerable:!0,get:function(){return Go.nil}});Object.defineProperty(Oe,"getProperty",{enumerable:!0,get:function(){return Go.getProperty}});Object.defineProperty(Oe,"stringify",{enumerable:!0,get:function(){return Go.stringify}});Object.defineProperty(Oe,"regexpCode",{enumerable:!0,get:function(){return Go.regexpCode}});Object.defineProperty(Oe,"Name",{enumerable:!0,get:function(){return Go.Name}});var wd=Rp();Object.defineProperty(Oe,"Scope",{enumerable:!0,get:function(){return wd.Scope}});Object.defineProperty(Oe,"ValueScope",{enumerable:!0,get:function(){return wd.ValueScope}});Object.defineProperty(Oe,"ValueScopeName",{enumerable:!0,get:function(){return wd.ValueScopeName}});Object.defineProperty(Oe,"varKinds",{enumerable:!0,get:function(){return wd.varKinds}});Oe.operators={GT:new Je._Code(">"),GTE:new Je._Code(">="),LT:new Je._Code("<"),LTE:new Je._Code("<="),EQ:new Je._Code("==="),NEQ:new Je._Code("!=="),NOT:new Je._Code("!"),OR:new Je._Code("||"),AND:new Je._Code("&&"),ADD:new Je._Code("+")};var uo=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},Fp=class extends uo{constructor(i,t,s){super(),this.varKind=i,this.name=t,this.rhs=s}render({es5:i,_n:t}){let s=i?xs.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${o};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=gn(this.rhs,i,t)),this}get names(){return this.rhs instanceof Je._CodeOrName?this.rhs.names:{}}},bd=class extends uo{constructor(i,t,s){super(),this.lhs=i,this.rhs=t,this.sideEffects=s}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof Je.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=gn(this.rhs,i,t),this}get names(){let i=this.lhs instanceof Je.Name?{}:be({},this.lhs.names);return vd(i,this.rhs)}},Op=class extends bd{constructor(i,t,s,o){super(i,s,o),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},Vp=class extends uo{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},qp=class extends uo{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},Kp=class extends uo{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},$p=class extends uo{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=gn(this.code,i,t),this}get names(){return this.code instanceof Je._CodeOrName?this.code.names:{}}},Na=class extends uo{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,s)=>t+s.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let s=i[t].optimizeNodes();Array.isArray(s)?i.splice(t,1,...s):s?i[t]=s:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:s}=this,o=s.length;for(;o--;){let n=s[o];n.optimizeNames(i,t)||(MR(i,n.names),s.splice(o,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>Hr(i,t.names),{})}},go=class extends Na{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},Lp=class extends Na{},Gp=(()=>{class e extends go{}return e.kind="else",e})(),fd=(()=>{class e extends go{constructor(t,s){super(s),this.condition=t}render(t){let s=`if(${this.condition})`+super.render(t);return this.else&&(s+="else "+this.else.render(t)),s}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let s=this.else;if(s){let o=s.optimizeNodes();s=this.else=Array.isArray(o)?new Gp(o):o}if(s)return t===!1?s instanceof e?s:s.nodes:this.nodes.length?this:new e(gw(t),s instanceof e?[s]:s.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,s){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(t,s),!!(super.optimizeNames(t,s)||this.else))return this.condition=gn(this.condition,t,s),this}get names(){let t=super.names;return vd(t,this.condition),this.else&&Hr(t,this.else.names),t}}return e.kind="if",e})(),kd=(()=>{class e extends go{}return e.kind="for",e})(),Wp=class extends kd{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=gn(this.iteration,i,t),this}get names(){return Hr(super.names,this.iteration.names)}},Yp=class extends kd{constructor(i,t,s,o){super(),this.varKind=i,this.name=t,this.from=s,this.to=o}render(i){let t=i.es5?xs.varKinds.var:this.varKind,{name:s,from:o,to:n}=this;return`for(${t} ${s}=${o}; ${s}<${n}; ${s}++)`+super.render(i)}get names(){let i=vd(super.names,this.from);return vd(i,this.to)}},yd=class extends kd{constructor(i,t,s,o){super(),this.loop=i,this.varKind=t,this.name=s,this.iterable=o}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=gn(this.iterable,i,t),this}get names(){return Hr(super.names,this.iterable.names)}},lw=(()=>{class e extends go{constructor(t,s,o){super(),this.name=t,this.args=s,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),cw=(()=>{class e extends Na{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Jp=class extends go{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var s,o;return super.optimizeNames(i,t),(s=this.catch)===null||s===void 0||s.optimizeNames(i,t),(o=this.finally)===null||o===void 0||o.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&Hr(i,this.catch.names),this.finally&&Hr(i,this.finally.names),i}},dw=(()=>{class e extends go{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),uw=(()=>{class e extends go{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),Zp=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Xe(be({},t),{_n:t.lines?`
2
2
  `:""}),this._extScope=i,this._scope=new xs.Scope({parent:i}),this._nodes=[new Lp]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,t){let s=this._extScope.value(i,t);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(i,t){return this._extScope.getValue(i,t)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,t,s,o){let n=this._scope.toName(t);return s!==void 0&&o&&(this._constants[n.str]=s),this._leafNode(new Fp(i,n,s)),n}const(i,t,s){return this._def(xs.varKinds.const,i,t,s)}let(i,t,s){return this._def(xs.varKinds.let,i,t,s)}var(i,t,s){return this._def(xs.varKinds.var,i,t,s)}assign(i,t,s){return this._leafNode(new bd(i,t,s))}add(i,t){return this._leafNode(new Op(i,Oe.operators.ADD,t))}code(i){return typeof i=="function"?i():i!==Je.nil&&this._leafNode(new $p(i)),this}object(...i){let t=["{"];for(let[s,o]of i)t.length>1&&t.push(","),t.push(s),(s!==o||this.opts.es5)&&(t.push(":"),(0,Je.addCodeArg)(t,o));return t.push("}"),new Je._Code(t)}if(i,t,s){if(this._blockNode(new fd(i)),t&&s)this.code(t).else().code(s).endIf();else if(t)this.code(t).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new fd(i))}else(){return this._elseNode(new Gp)}endIf(){return this._endBlockNode(fd,Gp)}_for(i,t){return this._blockNode(i),t&&this.code(t).endFor(),this}for(i,t){return this._for(new Wp(i),t)}forRange(i,t,s,o,n=this.opts.es5?xs.varKinds.var:xs.varKinds.let){let l=this._scope.toName(i);return this._for(new Yp(n,l,t,s),()=>o(l))}forOf(i,t,s,o=xs.varKinds.const){let n=this._scope.toName(i);if(this.opts.es5){let l=t instanceof Je.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Je._)`${l}.length`,c=>{this.var(n,(0,Je._)`${l}[${c}]`),s(n)})}return this._for(new yd("of",o,n,t),()=>s(n))}forIn(i,t,s,o=this.opts.es5?xs.varKinds.var:xs.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,(0,Je._)`Object.keys(${t})`,s);let n=this._scope.toName(i);return this._for(new yd("in",o,n,t),()=>s(n))}endFor(){return this._endBlockNode(kd)}label(i){return this._leafNode(new Vp(i))}break(i){return this._leafNode(new qp(i))}return(i){let t=new cw;if(this._blockNode(t),this.code(i),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(cw)}try(i,t,s){if(!t&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Jp;if(this._blockNode(o),this.code(i),t){let n=this.name("e");this._currNode=o.catch=new dw(n),t(n)}return s&&(this._currNode=o.finally=new uw,this.code(s)),this._endBlockNode(dw,uw)}throw(i){return this._leafNode(new Kp(i))}block(i,t){return this._blockStarts.push(this._nodes.length),i&&this.code(i).endBlock(t),this}endBlock(i){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-t;if(s<0||i!==void 0&&s!==i)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${i} expected`);return this._nodes.length=t,this}func(i,t=Je.nil,s,o){return this._blockNode(new lw(i,t,s)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(lw)}optimize(i=1){for(;i-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,t){let s=this._currNode;if(s instanceof i||t&&s instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${i.kind}/${t.kind}`:i.kind}"`)}_elseNode(i){let t=this._currNode;if(!(t instanceof fd))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=i,this}get _root(){return this._nodes[0]}get _currNode(){let i=this._nodes;return i[i.length-1]}set _currNode(i){let t=this._nodes;t[t.length-1]=i}};Oe.CodeGen=Zp;function Hr(e,i){for(let t in i)e[t]=(e[t]||0)+(i[t]||0);return e}function vd(e,i){return i instanceof Je._CodeOrName?Hr(e,i.names):e}function gn(e,i,t){if(e instanceof Je.Name)return s(e);if(!o(e))return e;return new Je._Code(e._items.reduce((n,l)=>(l instanceof Je.Name&&(l=s(l)),l instanceof Je._Code?n.push(...l._items):n.push(l),n),[]));function s(n){let l=t[n.str];return l===void 0||i[n.str]!==1?n:(delete i[n.str],l)}function o(n){return n instanceof Je._Code&&n._items.some(l=>l instanceof Je.Name&&i[l.str]===1&&t[l.str]!==void 0)}}function MR(e,i){for(let t in i)e[t]=(e[t]||0)-(i[t]||0)}function gw(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Je._)`!${Qp(e)}`}Oe.not=gw;var UR=pw(Oe.operators.AND);function RR(...e){return e.reduce(UR)}Oe.and=RR;var FR=pw(Oe.operators.OR);function OR(...e){return e.reduce(FR)}Oe.or=OR;function pw(e){return(i,t)=>i===Je.nil?t:t===Je.nil?i:(0,Je._)`${Qp(i)} ${e} ${Qp(t)}`}function Qp(e){return e instanceof Je.Name?e:(0,Je._)`(${e})`}});var $e=w(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.checkStrictMode=qe.getErrorPath=qe.Type=qe.useFunc=qe.setEvaluated=qe.evaluatedPropsToName=qe.mergeEvaluated=qe.eachItem=qe.unescapeJsonPointer=qe.escapeJsonPointer=qe.escapeFragment=qe.unescapeFragment=qe.schemaRefOrVal=qe.schemaHasRulesButRef=qe.schemaHasRules=qe.checkUnknownRules=qe.alwaysValidSchema=qe.toHash=void 0;var ft=ke(),VR=ja();function qR(e){let i={};for(let t of e)i[t]=!0;return i}qe.toHash=qR;function KR(e,i){return typeof i=="boolean"?i:Object.keys(i).length===0?!0:(_w(e,i),!fw(i,e.self.RULES.all))}qe.alwaysValidSchema=KR;function _w(e,i=e.schema){let{opts:t,self:s}=e;if(!t.strictSchema||typeof i=="boolean")return;let o=s.RULES.keywords;for(let n in i)o[n]||vw(e,`unknown keyword: "${n}"`)}qe.checkUnknownRules=_w;function fw(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(i[t])return!0;return!1}qe.schemaHasRules=fw;function $R(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&i.all[t])return!0;return!1}qe.schemaHasRulesButRef=$R;function LR({topSchemaRef:e,schemaPath:i},t,s,o){if(!o){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,ft._)`${t}`}return(0,ft._)`${e}${i}${(0,ft.getProperty)(s)}`}qe.schemaRefOrVal=LR;function GR(e){return bw(decodeURIComponent(e))}qe.unescapeFragment=GR;function WR(e){return encodeURIComponent(em(e))}qe.escapeFragment=WR;function em(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}qe.escapeJsonPointer=em;function bw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}qe.unescapeJsonPointer=bw;function YR(e,i){if(Array.isArray(e))for(let t of e)i(t);else i(e)}qe.eachItem=YR;function mw({mergeNames:e,mergeToName:i,mergeValues:t,resultToName:s}){return(o,n,l,c)=>{let u=l===void 0?n:l instanceof ft.Name?(n instanceof ft.Name?e(o,n,l):i(o,n,l),l):n instanceof ft.Name?(i(o,l,n),n):t(n,l);return c===ft.Name&&!(u instanceof ft.Name)?s(o,u):u}}qe.mergeEvaluated={props:mw({mergeNames:(e,i,t)=>e.if((0,ft._)`${t} !== true && ${i} !== undefined`,()=>{e.if((0,ft._)`${i} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,ft._)`${t} || {}`).code((0,ft._)`Object.assign(${t}, ${i})`))}),mergeToName:(e,i,t)=>e.if((0,ft._)`${t} !== true`,()=>{i===!0?e.assign(t,!0):(e.assign(t,(0,ft._)`${t} || {}`),tm(e,t,i))}),mergeValues:(e,i)=>e===!0?!0:be(be({},e),i),resultToName:yw}),items:mw({mergeNames:(e,i,t)=>e.if((0,ft._)`${t} !== true && ${i} !== undefined`,()=>e.assign(t,(0,ft._)`${i} === true ? true : ${t} > ${i} ? ${t} : ${i}`)),mergeToName:(e,i,t)=>e.if((0,ft._)`${t} !== true`,()=>e.assign(t,i===!0?!0:(0,ft._)`${t} > ${i} ? ${t} : ${i}`)),mergeValues:(e,i)=>e===!0?!0:Math.max(e,i),resultToName:(e,i)=>e.var("items",i)})};function yw(e,i){if(i===!0)return e.var("props",!0);let t=e.var("props",(0,ft._)`{}`);return i!==void 0&&tm(e,t,i),t}qe.evaluatedPropsToName=yw;function tm(e,i,t){Object.keys(t).forEach(s=>e.assign((0,ft._)`${i}${(0,ft.getProperty)(s)}`,!0))}qe.setEvaluated=tm;var hw={};function JR(e,i){return e.scopeValue("func",{ref:i,code:hw[i.code]||(hw[i.code]=new VR._Code(i.code))})}qe.useFunc=JR;var Xp=(function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e})(Xp||(qe.Type=Xp={}));function ZR(e,i,t){if(e instanceof ft.Name){let s=i===Xp.Num;return t?s?(0,ft._)`"[" + ${e} + "]"`:(0,ft._)`"['" + ${e} + "']"`:s?(0,ft._)`"/" + ${e}`:(0,ft._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,ft.getProperty)(e).toString():"/"+em(e)}qe.getErrorPath=ZR;function vw(e,i,t=e.opts.strictSchema){if(t){if(i=`strict mode: ${i}`,t===!0)throw new Error(i);e.self.logger.warn(i)}}qe.checkStrictMode=vw});var us=w(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var ci=ke(),QR={data:new ci.Name("data"),valCxt:new ci.Name("valCxt"),instancePath:new ci.Name("instancePath"),parentData:new ci.Name("parentData"),parentDataProperty:new ci.Name("parentDataProperty"),rootData:new ci.Name("rootData"),dynamicAnchors:new ci.Name("dynamicAnchors"),vErrors:new ci.Name("vErrors"),errors:new ci.Name("errors"),this:new ci.Name("this"),self:new ci.Name("self"),scope:new ci.Name("scope"),json:new ci.Name("json"),jsonPos:new ci.Name("jsonPos"),jsonLen:new ci.Name("jsonLen"),jsonPart:new ci.Name("jsonPart")};im.default=QR});var Da=w(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.extendErrors=di.resetErrorsCount=di.reportExtraError=di.reportError=di.keyword$DataError=di.keywordError=void 0;var Qe=ke(),Hd=$e(),xi=us();di.keywordError={message:({keyword:e})=>(0,Qe.str)`must pass "${e}" keyword validation`};di.keyword$DataError={message:({keyword:e,schemaType:i})=>i?(0,Qe.str)`"${e}" keyword must be ${i} ($data)`:(0,Qe.str)`"${e}" keyword is invalid ($data)`};function XR(e,i=di.keywordError,t,s){let{it:o}=e,{gen:n,compositeRule:l,allErrors:c}=o,u=Hw(e,i,t);s??(l||c)?ww(n,u):kw(o,(0,Qe._)`[${u}]`)}di.reportError=XR;function eF(e,i=di.keywordError,t){let{it:s}=e,{gen:o,compositeRule:n,allErrors:l}=s,c=Hw(e,i,t);ww(o,c),n||l||kw(s,xi.default.vErrors)}di.reportExtraError=eF;function tF(e,i){e.assign(xi.default.errors,i),e.if((0,Qe._)`${xi.default.vErrors} !== null`,()=>e.if(i,()=>e.assign((0,Qe._)`${xi.default.vErrors}.length`,i),()=>e.assign(xi.default.vErrors,null)))}di.resetErrorsCount=tF;function iF({gen:e,keyword:i,schemaValue:t,data:s,errsCount:o,it:n}){if(o===void 0)throw new Error("ajv implementation error");let l=e.name("err");e.forRange("i",o,xi.default.errors,c=>{e.const(l,(0,Qe._)`${xi.default.vErrors}[${c}]`),e.if((0,Qe._)`${l}.instancePath === undefined`,()=>e.assign((0,Qe._)`${l}.instancePath`,(0,Qe.strConcat)(xi.default.instancePath,n.errorPath))),e.assign((0,Qe._)`${l}.schemaPath`,(0,Qe.str)`${n.errSchemaPath}/${i}`),n.opts.verbose&&(e.assign((0,Qe._)`${l}.schema`,t),e.assign((0,Qe._)`${l}.data`,s))})}di.extendErrors=iF;function ww(e,i){let t=e.const("err",i);e.if((0,Qe._)`${xi.default.vErrors} === null`,()=>e.assign(xi.default.vErrors,(0,Qe._)`[${t}]`),(0,Qe._)`${xi.default.vErrors}.push(${t})`),e.code((0,Qe._)`${xi.default.errors}++`)}function kw(e,i){let{gen:t,validateName:s,schemaEnv:o}=e;o.$async?t.throw((0,Qe._)`new ${e.ValidationError}(${i})`):(t.assign((0,Qe._)`${s}.errors`,i),t.return(!1))}var Sr={keyword:new Qe.Name("keyword"),schemaPath:new Qe.Name("schemaPath"),params:new Qe.Name("params"),propertyName:new Qe.Name("propertyName"),message:new Qe.Name("message"),schema:new Qe.Name("schema"),parentSchema:new Qe.Name("parentSchema")};function Hw(e,i,t){let{createErrors:s}=e.it;return s===!1?(0,Qe._)`{}`:sF(e,i,t)}function sF(e,i,t={}){let{gen:s,it:o}=e,n=[oF(o,t),rF(e,t)];return nF(e,i,n),s.object(...n)}function oF({errorPath:e},{instancePath:i}){let t=i?(0,Qe.str)`${e}${(0,Hd.getErrorPath)(i,Hd.Type.Str)}`:e;return[xi.default.instancePath,(0,Qe.strConcat)(xi.default.instancePath,t)]}function rF({keyword:e,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:s}){let o=s?i:(0,Qe.str)`${i}/${e}`;return t&&(o=(0,Qe.str)`${o}${(0,Hd.getErrorPath)(t,Hd.Type.Str)}`),[Sr.schemaPath,o]}function nF(e,{params:i,message:t},s){let{keyword:o,data:n,schemaValue:l,it:c}=e,{opts:u,propertyName:p,topSchemaRef:h,schemaPath:f}=c;s.push([Sr.keyword,o],[Sr.params,typeof i=="function"?i(e):i||(0,Qe._)`{}`]),u.messages&&s.push([Sr.message,typeof t=="function"?t(e):t]),u.verbose&&s.push([Sr.schema,l],[Sr.parentSchema,(0,Qe._)`${h}${f}`],[xi.default.data,n]),p&&s.push([Sr.propertyName,p])}});var Cw=w(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.boolOrEmptySchema=pn.topBoolOrEmptySchema=void 0;var aF=Da(),lF=ke(),cF=us(),dF={message:"boolean schema is false"};function uF(e){let{gen:i,schema:t,validateName:s}=e;t===!1?Sw(e,!1):typeof t=="object"&&t.$async===!0?i.return(cF.default.data):(i.assign((0,lF._)`${s}.errors`,null),i.return(!0))}pn.topBoolOrEmptySchema=uF;function gF(e,i){let{gen:t,schema:s}=e;s===!1?(t.var(i,!1),Sw(e)):t.var(i,!0)}pn.boolOrEmptySchema=gF;function Sw(e,i){let{gen:t,data:s}=e,o={gen:t,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,aF.reportError)(o,dF,void 0,i)}});var sm=w(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.getRules=mn.isJSONType=void 0;var pF=["string","number","integer","boolean","null","object","array"],mF=new Set(pF);function hF(e){return typeof e=="string"&&mF.has(e)}mn.isJSONType=hF;function _F(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:Xe(be({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}mn.getRules=_F});var om=w(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.shouldUseRule=Wo.shouldUseGroup=Wo.schemaHasRulesForType=void 0;function fF({schema:e,self:i},t){let s=i.RULES.types[t];return s&&s!==!0&&xw(e,s)}Wo.schemaHasRulesForType=fF;function xw(e,i){return i.rules.some(t=>Iw(e,t))}Wo.shouldUseGroup=xw;function Iw(e,i){var t;return e[i.keyword]!==void 0||((t=i.definition.implements)===null||t===void 0?void 0:t.some(s=>e[s]!==void 0))}Wo.shouldUseRule=Iw});var Ba=w(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.reportTypeError=ui.checkDataTypes=ui.checkDataType=ui.coerceAndCheckDataType=ui.getJSONTypes=ui.getSchemaTypes=ui.DataType=void 0;var bF=sm(),yF=om(),vF=Da(),Ee=ke(),Tw=$e(),hn=(function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e})(hn||(ui.DataType=hn={}));function wF(e){let i=Pw(e.type);if(i.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&i.push("null")}return i}ui.getSchemaTypes=wF;function Pw(e){let i=Array.isArray(e)?e:e?[e]:[];if(i.every(bF.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}ui.getJSONTypes=Pw;function kF(e,i){let{gen:t,data:s,opts:o}=e,n=HF(i,o.coerceTypes),l=i.length>0&&!(n.length===0&&i.length===1&&(0,yF.schemaHasRulesForType)(e,i[0]));if(l){let c=nm(i,s,o.strictNumbers,hn.Wrong);t.if(c,()=>{n.length?SF(e,i,n):am(e)})}return l}ui.coerceAndCheckDataType=kF;var zw=new Set(["string","number","integer","boolean","null"]);function HF(e,i){return i?e.filter(t=>zw.has(t)||i==="array"&&t==="array"):[]}function SF(e,i,t){let{gen:s,data:o,opts:n}=e,l=s.let("dataType",(0,Ee._)`typeof ${o}`),c=s.let("coerced",(0,Ee._)`undefined`);n.coerceTypes==="array"&&s.if((0,Ee._)`${l} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>s.assign(o,(0,Ee._)`${o}[0]`).assign(l,(0,Ee._)`typeof ${o}`).if(nm(i,o,n.strictNumbers),()=>s.assign(c,o))),s.if((0,Ee._)`${c} !== undefined`);for(let p of t)(zw.has(p)||p==="array"&&n.coerceTypes==="array")&&u(p);s.else(),am(e),s.endIf(),s.if((0,Ee._)`${c} !== undefined`,()=>{s.assign(o,c),CF(e,c)});function u(p){switch(p){case"string":s.elseIf((0,Ee._)`${l} == "number" || ${l} == "boolean"`).assign(c,(0,Ee._)`"" + ${o}`).elseIf((0,Ee._)`${o} === null`).assign(c,(0,Ee._)`""`);return;case"number":s.elseIf((0,Ee._)`${l} == "boolean" || ${o} === null
3
3
  || (${l} == "string" && ${o} && ${o} == +${o})`).assign(c,(0,Ee._)`+${o}`);return;case"integer":s.elseIf((0,Ee._)`${l} === "boolean" || ${o} === null
4
4
  || (${l} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(c,(0,Ee._)`+${o}`);return;case"boolean":s.elseIf((0,Ee._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(c,!1).elseIf((0,Ee._)`${o} === "true" || ${o} === 1`).assign(c,!0);return;case"null":s.elseIf((0,Ee._)`${o} === "" || ${o} === 0 || ${o} === false`),s.assign(c,null);return;case"array":s.elseIf((0,Ee._)`${l} === "string" || ${l} === "number"
@@ -1 +1 @@
1
- import{m as J}from"./chunk-LXFVNKLD.js";import{B as H,e as O,l as W,s as z,t as q,v as G}from"./chunk-F7ZV2JBO.js";import{d as Y}from"./chunk-YMAWYUA6.js";import{k as K,l as Q,n as X,q as Z}from"./chunk-YP7VO76N.js";import{Db as B,Gb as b,Ib as d,Kc as j,La as s,Vb as c,Wa as D,Wb as g,Xb as h,Yb as V,a as T,ac as F,b as R,bc as U,cc as L,h as M,hc as N,ic as P,ja as y,kb as A,lb as _,mb as u,mc as m,nc as p,oa as f,ob as k,pa as v,pb as E,qb as $,rb as C,sb as o,tb as a,ub as w,w as S}from"./chunk-V2XN5VIX.js";var te=(t,l)=>({"btn-danger":t,"btn-elegant":l}),ie=(t,l,e)=>({"fa-trash":t,"fa-undo":l,"fa-spinner fa-pulse":e});function ne(t,l){t&1&&(o(0,"div",12),w(1,"i",13),a(),o(2,"p",14),c(3),m(4,"translate"),a()),t&2&&(s(3),g(p(4,1,"reset.no_accessories")))}function se(t,l){if(t&1&&(o(0,"option",24),c(1),a()),t&2){let e=l.$implicit;C("value",e._id),s(),V("",e.name," (",e._username,")")}}function oe(t,l){if(t&1){let e=B();o(0,"li",20),c(1),m(2,"translate"),a(),o(3,"li",18)(4,"label",21),c(5),m(6,"translate"),a(),o(7,"div",22)(8,"select",23),L("ngModelChange",function(i){f(e);let r=d(2);return U(r.selectedBridge,i)||(r.selectedBridge=i),v(i)}),b("change",function(i){f(e);let r=d(2);return v(r.onBridgeChange(i.target.value))}),E(9,se,2,3,"option",24,k),a()()()}if(t&2){let e=d(2);s(),g(p(2,3,"form.label.changes_kept")),s(4),g(p(6,5,"reset.accessory_ind.bridge")),s(3),F("ngModel",e.selectedBridge),s(),$(e.pairings)}}function ae(t,l){if(t&1&&(o(0,"li",18)(1,"label",25),c(2),m(3,"translate"),a(),o(4,"div",26),c(5),a()()),t&2){let e=d(2);s(2),g(p(3,2,"reset.accessory_ind.bridge")),s(3),h(" ",e.getCurrentlySelectedBridge()," ")}}function re(t,l){if(t&1){let e=B();o(0,"li",19)(1,"span"),c(2),w(3,"br"),o(4,"small")(5,"span",27),c(6),a()()(),o(7,"button",28),m(8,"translate"),b("click",function(){let i=f(e).$implicit,r=d(2);return v(r.toggleList(i.UUID,i.$cacheFile))}),w(9,"i",29),a()()}if(t&2){let e=l.$implicit,n=d(2);s(2),h(" ",e.displayName),s(4),g(e.UUID),s(),C("disabled",n.clicked)("ngClass",N(8,te,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),A("aria-label",p(8,6,"form.button_delete")),s(2),C("ngClass",P(11,ie,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function le(t,l){if(t&1&&(o(0,"div",12),w(1,"i",15),a(),o(2,"ul",16)(3,"li"),c(4),m(5,"translate"),a(),o(6,"li"),c(7),m(8,"translate"),a(),o(9,"li"),c(10),m(11,"translate"),a()(),o(12,"ul",17),_(13,oe,11,7),_(14,ae,6,4,"li",18),E(15,re,10,15,"li",19,k),a()),t&2){let e=d();s(4),g(p(5,5,"reset.accessory_ind.list_1")),s(3),g(p(8,7,"reset.accessory_ind.list_2")),s(3),g(p(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),$(e.selectedBridgeAccessories)}}function ce(t,l){if(t&1){let e=B();o(0,"button",30),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}if(t&2){let e=d();C("disabled",e.clicked),s(),h(" ",p(2,2,"form.button_close")," ")}}function de(t,l){if(t&1){let e=B();o(0,"button",31),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}t&2&&(s(),h(" ",p(2,1,"form.button_close")," "))}function me(t,l){if(t&1&&c(0),t&2){let e=d(3);h(" (",e.toDelete.length,") ")}}function pe(t,l){if(t&1&&(c(0),m(1,"translate"),_(2,me,1,1)),t&2){let e=d(2);h(" ",p(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function _e(t,l){t&1&&w(0,"i",33)}function ue(t,l){if(t&1){let e=B();o(0,"button",32),b("click",function(){f(e);let i=d();return v(i.removeAccessories())}),_(1,pe,3,4),_(2,_e,1,0,"i",33),a()}if(t&2){let e=d();C("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var ke=(()=>{class t{$activeModal=y(J);$api=y(Z);$router=y(Y);$toastr=y(X);$translate=y(K);selectedBridge="";pairings=[];clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];ngOnInit(){this.loadCachedAccessories()}onBridgeChange(e){this.selectedBridge=e,this.selectedBridgeAccessories=this.pairings.find(n=>n._id===this.selectedBridge)?.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e||i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return M(this,null,function*(){try{let[e,n]=yield Promise.all([S(this.$api.get("/server/cached-accessories")),S(this.$api.get("/server/pairings"))]),i=new Map(n.map(r=>[r._id,R(T({},r),{accessories:[]})]));e.sort((r,x)=>r.displayName.localeCompare(x.displayName)).forEach(r=>{let x=n.find(ee=>ee._main),I=r.$cacheFile?.split(".")?.[1]||x._id;(!this.selectedBridge||this.selectedBridge===I)&&(i.has(I)||i.set(I,{_id:I,_username:I.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),i.get(I).accessories.push(r))}),this.pairings=Array.from(i.values()).filter(r=>r.accessories.length>0).sort((r,x)=>r._main&&!x._main?-1:!r._main&&x._main?1:r.name.localeCompare(x.name)),this.selectedBridge=this.selectedBridge||this.pairings[0]?._id,this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},decls:17,vars:12,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,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"font-monospace","grey-text"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,i){n&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),m(4,"translate"),a(),o(5,"button",3),m(6,"translate"),b("click",function(){return i.dismissModal()}),a()(),o(7,"div",4),_(8,ne,5,3),_(9,le,17,11),a(),o(10,"div",5)(11,"div",6),_(12,ce,3,4,"button",7),a(),o(13,"div",8),_(14,de,3,3,"button",9),a(),o(15,"div",10),_(16,ue,3,3,"button",11),a()()()),n&2&&(s(3),g(p(4,8,"reset.accessory_ind.title")),s(2),C("disabled",i.clicked),A("aria-label",p(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[j,H,q,G,z,O,W,Q],encapsulation:2})}return t})();export{ke as a};
1
+ import{m as J}from"./chunk-6DTD6NF3.js";import{B as H,e as O,l as W,s as z,t as q,v as G}from"./chunk-KCLLEPG3.js";import{d as Y}from"./chunk-ZX7APSEP.js";import{k as K,l as Q,n as X,q as Z}from"./chunk-CWRKEWVF.js";import{Db as B,Gb as b,Ib as d,Kc as j,La as s,Vb as c,Wa as D,Wb as g,Xb as h,Yb as V,a as T,ac as F,b as R,bc as U,cc as L,h as M,hc as N,ic as P,ja as y,kb as A,lb as _,mb as u,mc as m,nc as p,oa as f,ob as k,pa as v,pb as E,qb as $,rb as C,sb as o,tb as a,ub as w,w as S}from"./chunk-PRNMO4E2.js";var te=(t,l)=>({"btn-danger":t,"btn-elegant":l}),ie=(t,l,e)=>({"fa-trash":t,"fa-undo":l,"fa-spinner fa-pulse":e});function ne(t,l){t&1&&(o(0,"div",12),w(1,"i",13),a(),o(2,"p",14),c(3),m(4,"translate"),a()),t&2&&(s(3),g(p(4,1,"reset.no_accessories")))}function se(t,l){if(t&1&&(o(0,"option",24),c(1),a()),t&2){let e=l.$implicit;C("value",e._id),s(),V("",e.name," (",e._username,")")}}function oe(t,l){if(t&1){let e=B();o(0,"li",20),c(1),m(2,"translate"),a(),o(3,"li",18)(4,"label",21),c(5),m(6,"translate"),a(),o(7,"div",22)(8,"select",23),L("ngModelChange",function(i){f(e);let r=d(2);return U(r.selectedBridge,i)||(r.selectedBridge=i),v(i)}),b("change",function(i){f(e);let r=d(2);return v(r.onBridgeChange(i.target.value))}),E(9,se,2,3,"option",24,k),a()()()}if(t&2){let e=d(2);s(),g(p(2,3,"form.label.changes_kept")),s(4),g(p(6,5,"reset.accessory_ind.bridge")),s(3),F("ngModel",e.selectedBridge),s(),$(e.pairings)}}function ae(t,l){if(t&1&&(o(0,"li",18)(1,"label",25),c(2),m(3,"translate"),a(),o(4,"div",26),c(5),a()()),t&2){let e=d(2);s(2),g(p(3,2,"reset.accessory_ind.bridge")),s(3),h(" ",e.getCurrentlySelectedBridge()," ")}}function re(t,l){if(t&1){let e=B();o(0,"li",19)(1,"span"),c(2),w(3,"br"),o(4,"small")(5,"span",27),c(6),a()()(),o(7,"button",28),m(8,"translate"),b("click",function(){let i=f(e).$implicit,r=d(2);return v(r.toggleList(i.UUID,i.$cacheFile))}),w(9,"i",29),a()()}if(t&2){let e=l.$implicit,n=d(2);s(2),h(" ",e.displayName),s(4),g(e.UUID),s(),C("disabled",n.clicked)("ngClass",N(8,te,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),A("aria-label",p(8,6,"form.button_delete")),s(2),C("ngClass",P(11,ie,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function le(t,l){if(t&1&&(o(0,"div",12),w(1,"i",15),a(),o(2,"ul",16)(3,"li"),c(4),m(5,"translate"),a(),o(6,"li"),c(7),m(8,"translate"),a(),o(9,"li"),c(10),m(11,"translate"),a()(),o(12,"ul",17),_(13,oe,11,7),_(14,ae,6,4,"li",18),E(15,re,10,15,"li",19,k),a()),t&2){let e=d();s(4),g(p(5,5,"reset.accessory_ind.list_1")),s(3),g(p(8,7,"reset.accessory_ind.list_2")),s(3),g(p(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),$(e.selectedBridgeAccessories)}}function ce(t,l){if(t&1){let e=B();o(0,"button",30),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}if(t&2){let e=d();C("disabled",e.clicked),s(),h(" ",p(2,2,"form.button_close")," ")}}function de(t,l){if(t&1){let e=B();o(0,"button",31),b("click",function(){f(e);let i=d();return v(i.dismissModal())}),c(1),m(2,"translate"),a()}t&2&&(s(),h(" ",p(2,1,"form.button_close")," "))}function me(t,l){if(t&1&&c(0),t&2){let e=d(3);h(" (",e.toDelete.length,") ")}}function pe(t,l){if(t&1&&(c(0),m(1,"translate"),_(2,me,1,1)),t&2){let e=d(2);h(" ",p(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function _e(t,l){t&1&&w(0,"i",33)}function ue(t,l){if(t&1){let e=B();o(0,"button",32),b("click",function(){f(e);let i=d();return v(i.removeAccessories())}),_(1,pe,3,4),_(2,_e,1,0,"i",33),a()}if(t&2){let e=d();C("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var ke=(()=>{class t{$activeModal=y(J);$api=y(Z);$router=y(Y);$toastr=y(X);$translate=y(K);selectedBridge="";pairings=[];clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];ngOnInit(){this.loadCachedAccessories()}onBridgeChange(e){this.selectedBridge=e,this.selectedBridgeAccessories=this.pairings.find(n=>n._id===this.selectedBridge)?.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e||i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return M(this,null,function*(){try{let[e,n]=yield Promise.all([S(this.$api.get("/server/cached-accessories")),S(this.$api.get("/server/pairings"))]),i=new Map(n.map(r=>[r._id,R(T({},r),{accessories:[]})]));e.sort((r,x)=>r.displayName.localeCompare(x.displayName)).forEach(r=>{let x=n.find(ee=>ee._main),I=r.$cacheFile?.split(".")?.[1]||x._id;(!this.selectedBridge||this.selectedBridge===I)&&(i.has(I)||i.set(I,{_id:I,_username:I.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),i.get(I).accessories.push(r))}),this.pairings=Array.from(i.values()).filter(r=>r.accessories.length>0).sort((r,x)=>r._main&&!x._main?-1:!r._main&&x._main?1:r.name.localeCompare(x.name)),this.selectedBridge=this.selectedBridge||this.pairings[0]?._id,this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},decls:17,vars:12,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,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"font-monospace","grey-text"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(n,i){n&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),m(4,"translate"),a(),o(5,"button",3),m(6,"translate"),b("click",function(){return i.dismissModal()}),a()(),o(7,"div",4),_(8,ne,5,3),_(9,le,17,11),a(),o(10,"div",5)(11,"div",6),_(12,ce,3,4,"button",7),a(),o(13,"div",8),_(14,de,3,3,"button",9),a(),o(15,"div",10),_(16,ue,3,3,"button",11),a()()()),n&2&&(s(3),g(p(4,8,"reset.accessory_ind.title")),s(2),C("disabled",i.clicked),A("aria-label",p(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[j,H,q,G,z,O,W,Q],encapsulation:2})}return t})();export{ke as a};