From c934899022bb0b736f48ca0a3d7a00aaf8fb820a Mon Sep 17 00:00:00 2001 From: Filipe Esch Date: Mon, 14 Jun 2021 16:06:47 +0100 Subject: [PATCH] feat: changes how to serve client app files --- .github/workflows/build.yml | 5 ++ samples/KafkaFlow.Sample.Dashboard/Startup.cs | 1 - .../ApplicationBuilderExtensions.cs | 24 +++++- .../ClientApp/dist/index.html | 5 +- .../ClientApp/dist/main.js | 21 +++--- .../ClientApp/src/app/callback.pipe.ts | 2 +- .../ClientApp/src/app/consumer.service.ts | 16 ++-- .../src/app/consumer/consumer.component.html | 10 +-- .../src/app/consumer/consumer.component.ts | 44 ++++++++--- .../src/app/home/home.component.html | 2 +- .../ClientApp/src/app/home/home.component.ts | 32 +------- .../ClientApp/src/index.html | 5 +- .../KafkaFlow.Admin.Dashboard.csproj | 8 +- .../Properties/launchSettings.json | 26 ------- .../ServeClientFilesMiddleware.cs | 74 ------------------- .../ServiceCollectionExtensions.cs | 21 ------ .../Adapters/ConsumerResponseAdapter.cs | 58 +++++---------- .../TelemetryConsumerResponseAdapter.cs | 31 ++++++++ .../Contracts/ConsumerResponse.cs | 2 +- .../Contracts/PartitionAssignment.cs | 2 +- .../Contracts/TelemetryConsumerResponse.cs | 41 ++++++++++ .../Contracts/TelemetryGroupResponse.cs | 21 ++++++ .../Controllers/GroupsController.cs | 6 +- .../Controllers/TelemetryController.cs | 52 +++++++++++++ .../ClusterConfigurationBuilderExtensions.cs | 16 ++-- src/KafkaFlow.Admin/TelemetryScheduler.cs | 68 +++++++++-------- 26 files changed, 309 insertions(+), 284 deletions(-) delete mode 100644 src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json delete mode 100644 src/KafkaFlow.Admin.Dashboard/ServeClientFilesMiddleware.cs delete mode 100644 src/KafkaFlow.Admin.Dashboard/ServiceCollectionExtensions.cs create mode 100644 src/KafkaFlow.Admin.WebApi/Adapters/TelemetryConsumerResponseAdapter.cs create mode 100644 src/KafkaFlow.Admin.WebApi/Contracts/TelemetryConsumerResponse.cs create mode 100644 src/KafkaFlow.Admin.WebApi/Contracts/TelemetryGroupResponse.cs create mode 100644 src/KafkaFlow.Admin.WebApi/Controllers/TelemetryController.cs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37d694201..491b446d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,11 @@ jobs: with: dotnet-version: 3.1.403 + - name: Use Node 14.x + uses: actions/setup-node@v1 + with: + node-version: '14.x' + - name: Build run: dotnet build ./src/KafkaFlow.sln -c Release diff --git a/samples/KafkaFlow.Sample.Dashboard/Startup.cs b/samples/KafkaFlow.Sample.Dashboard/Startup.cs index acdb97cfd..ead047113 100644 --- a/samples/KafkaFlow.Sample.Dashboard/Startup.cs +++ b/samples/KafkaFlow.Sample.Dashboard/Startup.cs @@ -31,7 +31,6 @@ public void ConfigureServices(IServiceCollection services) ); services - .AddKafkaFlowDashboard() .AddControllers(); } diff --git a/src/KafkaFlow.Admin.Dashboard/ApplicationBuilderExtensions.cs b/src/KafkaFlow.Admin.Dashboard/ApplicationBuilderExtensions.cs index 5eb312047..c29f1c0e8 100644 --- a/src/KafkaFlow.Admin.Dashboard/ApplicationBuilderExtensions.cs +++ b/src/KafkaFlow.Admin.Dashboard/ApplicationBuilderExtensions.cs @@ -1,6 +1,9 @@ namespace KafkaFlow.Admin.Dashboard { + using System.Reflection; using Microsoft.AspNetCore.Builder; + using Microsoft.AspNetCore.Http; + using Microsoft.Extensions.FileProviders; /// /// Extension methods over IApplicationBuilder @@ -14,8 +17,25 @@ public static class ApplicationBuilderExtensions /// public static IApplicationBuilder UseKafkaFlowDashboard(this IApplicationBuilder app) { - app - .UseMiddleware(); + app.Map( + "/kafka-flow", + builder => + { + var provider = new ManifestEmbeddedFileProvider( + Assembly.GetAssembly(typeof(ApplicationBuilderExtensions)), + "ClientApp/dist"); + + builder.UseStaticFiles(new StaticFileOptions { FileProvider = provider }); + + builder.Run( + async context => + { + if (context.Request.Path == "/" || context.Request.Path == string.Empty) + { + await context.Response.SendFileAsync(provider.GetFileInfo("index.html")); + } + }); + }); return app; } diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/index.html b/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/index.html index b619f7fa3..8eccc3a13 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/index.html +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/index.html @@ -6,9 +6,8 @@ - - - + + diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/main.js b/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/main.js index a65ecd836..2f9241fba 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/main.js +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/dist/main.js @@ -1432,7 +1432,7 @@ const yg={provide:Df,useExisting:rt(()=>_g),multi:!0};let _g=(()=>{class t exten * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */const Cg=new Bn("config"),Sg=new Bn("NEW_CONFIG"),xg=new Bn("INITIAL_CONFIG"),Eg={suffix:"",prefix:"",thousandSeparator:" ",decimalMarker:".",clearIfNotMatch:!1,showTemplate:!1,showMaskTyped:!1,placeHolderCharacter:"_",dropSpecialCharacters:!0,hiddenInput:void 0,shownMaskExpression:"",separatorLimit:"",allowNegativeNumbers:!1,validation:!0,specialCharacters:["-","/","(",")",".",":"," ","+",",","@","[","]",'"',"'"],leadZeroDateTime:!1,patterns:{0:{pattern:new RegExp("\\d")},9:{pattern:new RegExp("\\d"),optional:!0},X:{pattern:new RegExp("\\d"),symbol:"*"},A:{pattern:new RegExp("[a-zA-Z0-9]")},S:{pattern:new RegExp("[a-zA-Z]")},d:{pattern:new RegExp("\\d")},m:{pattern:new RegExp("\\d")},M:{pattern:new RegExp("\\d")},H:{pattern:new RegExp("\\d")},h:{pattern:new RegExp("\\d")},s:{pattern:new RegExp("\\d")}}};let kg=(()=>{class t{constructor(t){this._config=t,this.maskExpression="",this.actualValue="",this.shownMaskExpression="",this._formatWithSeparators=(t,e,n,r)=>{const s=t.split(n),i=s.length>1?`${n}${s[1]}`:"";let o=s[0];const a=this.separatorLimit.replace(/\s/g,"");a&&+a&&(o="-"===o[0]?`-${o.slice(1,o.length).slice(0,a.length)}`:o.slice(0,a.length));const l=/(\d+)(\d{3})/;for(;e&&l.test(o);)o=o.replace(l,"$1"+e+"$2");return void 0===r?o+i:0===r?o:o+i.substr(0,r+1)},this.percentage=t=>Number(t)>=0&&Number(t)<=100,this.getPrecision=t=>{const e=t.split(".");return e.length>1?Number(e[e.length-1]):1/0},this.checkAndRemoveSuffix=t=>{var e,n,r;for(let s=(null===(e=this.suffix)||void 0===e?void 0:e.length)-1;s>=0;s--){const e=this.suffix.substr(s,null===(n=this.suffix)||void 0===n?void 0:n.length);if(t.includes(e)&&(s-1<0||!t.includes(this.suffix.substr(s-1,null===(r=this.suffix)||void 0===r?void 0:r.length))))return t.replace(e,"")}return t},this.checkInputPrecision=(t,e,n)=>{if(e<1/0){const r=new RegExp(this._charToRegExpExpression(n)+`\\d{${e}}.*$`),s=t.match(r);s&&s[0].length-1>e&&(t=t.substring(0,t.length-(s[0].length-1-e))),0===e&&t.endsWith(n)&&(t=t.substring(0,t.length-1))}return t},this._shift=new Set,this.clearIfNotMatch=this._config.clearIfNotMatch,this.dropSpecialCharacters=this._config.dropSpecialCharacters,this.maskSpecialCharacters=this._config.specialCharacters,this.maskAvailablePatterns=this._config.patterns,this.prefix=this._config.prefix,this.suffix=this._config.suffix,this.thousandSeparator=this._config.thousandSeparator,this.decimalMarker=this._config.decimalMarker,this.hiddenInput=this._config.hiddenInput,this.showMaskTyped=this._config.showMaskTyped,this.placeHolderCharacter=this._config.placeHolderCharacter,this.validation=this._config.validation,this.separatorLimit=this._config.separatorLimit,this.allowNegativeNumbers=this._config.allowNegativeNumbers,this.leadZeroDateTime=this._config.leadZeroDateTime}applyMaskWithPattern(t,e){const[n,r]=e;return this.customPattern=r,this.applyMask(t,n)}applyMask(t,e,n=0,r=!1,s=!1,i=(()=>{})){if(null==t||void 0===e)return"";let o=0,a="",l=!1,c=!1,u=1,h=!1;t.slice(0,this.prefix.length)===this.prefix&&(t=t.slice(this.prefix.length,t.length)),this.suffix&&(null==t?void 0:t.length)>0&&(t=this.checkAndRemoveSuffix(t));const d=t.toString().split("");"IP"===e&&(this.ipError=!!(d.filter(t=>"."===t).length<3&&d.length<7),e="099.099.099.099");const p=[];for(let _=0;_11?"00.000.000/0000-00":"000.000.000-00"),e.startsWith("percent")){if(t.match("[a-z]|[A-Z]")||t.match(/[-!$%^&*()_+|~=`{}\[\]:";'<>?,\/.]/)){t=this._stripToDecimal(t);const n=this.getPrecision(e);t=this.checkInputPrecision(t,n,this.decimalMarker)}if(t.indexOf(".")>0&&!this.percentage(t.substring(0,t.indexOf(".")))){const e=t.substring(0,t.indexOf(".")-1);t=`${e}${t.substring(t.indexOf("."),t.length)}`}a=this.percentage(t)?t:t.substring(0,t.length-1)}else if(e.startsWith("separator")){(t.match("[w\u0430-\u044f\u0410-\u042f]")||t.match("[\u0401\u0451\u0410-\u044f]")||t.match("[a-z]|[A-Z]")||t.match(/[-@#!$%\\^&*()_\xa3\xac'+|~=`{}\[\]:";<>.?\/]/)||t.match("[^A-Za-z0-9,]"))&&(t=this._stripToDecimal(t)),t=t.length>1&&"0"===t[0]&&t[1]!==this.decimalMarker?t.slice(1,t.length):t;const r=this._charToRegExpExpression(this.thousandSeparator),s=this._charToRegExpExpression(this.decimalMarker),i='@#!$%^&*()_+|~=`{}\\[\\]:\\s,\\.";<>?\\/'.replace(r,"").replace(s,""),o=new RegExp("["+i+"]");t.match(o)&&(t=t.substring(0,t.length-1));const l=this.getPrecision(e),h=(t=this.checkInputPrecision(t,l,this.decimalMarker)).replace(new RegExp(r,"g"),"");a=this._formatWithSeparators(h,this.thousandSeparator,this.decimalMarker,l);const d=a.indexOf(",")-t.indexOf(","),p=a.length-t.length;if(p>0&&","!==a[n]){c=!0;let t=0;do{this._shift.add(n+t),t++}while(t0&&!(a.indexOf(",")>=n&&n>3)||!(a.indexOf(".")>=n&&n>3)&&p<=0?(this._shift.clear(),c=!0,u=p,this._shift.add(n+=p)):this._shift.clear()}else for(let _=0,b=d[0];_2){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}if("h"===e[o]&&"2"===a&&Number(b)>3){o+=1,_--;continue}if("m"===e[o]&&Number(b)>5){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}if("s"===e[o]&&Number(b)>5){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}const n=31;if("d"===e[o]&&(Number(b)>3&&this.leadZeroDateTime||Number(t.slice(o,o+2))>n||"/"===t[o+1])){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}if("M"===e[o]){const r=12,s=0===o&&(Number(b)>2||Number(t.slice(o,o+2))>r||"/"===t[o+1]),i=t.slice(o-3,o-1).includes("/")&&("/"===t[o-2]&&Number(t.slice(o-1,o+1))>r&&"/"!==t[o]||"/"===t[o]||"/"===t[o-3]&&Number(t.slice(o-2,o))>r&&"/"!==t[o-1]||"/"===t[o-1]),l=Number(t.slice(o-3,o-1))<=n&&!t.slice(o-3,o-1).includes("/")&&"/"===t[o-1]&&(Number(t.slice(o,o+2))>r||"/"===t[o+1]),c=Number(t.slice(o-3,o-1))>n&&!t.slice(o-3,o-1).includes("/")&&!t.slice(o-2,o).includes("/")&&Number(t.slice(o-2,o))>r,u=Number(t.slice(o-3,o-1))<=n&&!t.slice(o-3,o-1).includes("/")&&"/"!==t[o-1]&&Number(t.slice(o-1,o+1))>r;if(Number(b)>1&&this.leadZeroDateTime||s||i||l||c||u){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}}a+=b,o++}else-1!==this.maskSpecialCharacters.indexOf(e[o])?(a+=e[o],o++,this._shiftStep(e,o,d.length),_--):this.maskSpecialCharacters.indexOf(b)>-1&&this.maskAvailablePatterns[e[o]]&&this.maskAvailablePatterns[e[o]].optional?(d[o]&&"099.099.099.099"!==e&&"000.000.000-00"!==e&&"00.000.000/0000-00"!==e&&(a+=d[o]),o++,_--):"*"===this.maskExpression[o+1]&&this._findSpecialChar(this.maskExpression[o+2])&&this._findSpecialChar(b)===this.maskExpression[o+2]&&l||"?"===this.maskExpression[o+1]&&this._findSpecialChar(this.maskExpression[o+2])&&this._findSpecialChar(b)===this.maskExpression[o+2]&&l?(o+=3,a+=b):this.showMaskTyped&&this.maskSpecialCharacters.indexOf(b)<0&&b!==this.placeHolderCharacter&&(h=!0);a.length+1===e.length&&-1!==this.maskSpecialCharacters.indexOf(e[e.length-1])&&(a+=e[e.length-1]);let f=n+1;for(;this._shift.has(f);)u++,f++;let g=r?o:this._shift.has(n)?u:0;h&&g--,i(g,c),u<0&&this._shift.clear();let m=!1;s&&(m=d.every(t=>this.maskSpecialCharacters.includes(t)));let y=`${this.prefix}${m?"":a}${this.suffix}`;return 0===a.length&&(y=`${this.prefix}${a}`),y}_findSpecialChar(t){return this.maskSpecialCharacters.find(e=>e===t)}_checkSymbolMask(t,e){return this.maskAvailablePatterns=this.customPattern?this.customPattern:this.maskAvailablePatterns,this.maskAvailablePatterns[e]&&this.maskAvailablePatterns[e].pattern&&this.maskAvailablePatterns[e].pattern.test(t)}_stripToDecimal(t){return t.split("").filter((t,e)=>t.match("^-?\\d")||t.match("\\s")||"."===t||","===t||"-"===t&&0===e&&this.allowNegativeNumbers).join("")}_charToRegExpExpression(t){if(t){const e="[\\^$.|?*+()";return" "===t?"\\s":e.indexOf(t)>=0?"\\"+t:t}return t}_shiftStep(t,e,n){const r=/[*?]/g.test(t.slice(0,e))?n:e;this._shift.add(r+this.prefix.length||0)}}return t.\u0275fac=function(e){return new(e||t)(lr(Cg))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),Tg=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:Sg,useValue:e},{provide:xg,useValue:Eg},{provide:Cg,useFactory:Ag,deps:[xg,Sg]},kg]}}static forChild(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})();function Ag(t,e){return Object.assign(Object.assign({},t),e instanceof Function?e():e)}const Og="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Og.KeyboardEvent||(Og.KeyboardEvent=function(t,e){});const Rg=[];let Ig=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[Cf.forRoot(Rg)],Cf]}),t})(),Pg=(()=>{class t{constructor(){this.title="dashboard"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=$t({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(t,e){1&t&&Hi(0,"router-outlet")},directives:[df],encapsulation:2}),t})();class Dg extends h{constructor(t,e){super()}schedule(t,e=0){return this}}class Ng extends Dg{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n,r=!1;try{this.work(t)}catch(s){r=!0,n=!!s&&s||new Error(s)}if(r)return this.unsubscribe(),n}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}let Mg=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class jg extends Mg{constructor(t,e=Mg.now){super(t,()=>jg.delegate&&jg.delegate!==this?jg.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return jg.delegate&&jg.delegate!==this?jg.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const Vg=new jg(Ng);function Fg(t){return!l(t)&&t-parseFloat(t)+1>=0}function Ug(t){const{subscriber:e,counter:n,period:r}=t;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)} + */const Cg=new Bn("config"),Sg=new Bn("NEW_CONFIG"),xg=new Bn("INITIAL_CONFIG"),Eg={suffix:"",prefix:"",thousandSeparator:" ",decimalMarker:".",clearIfNotMatch:!1,showTemplate:!1,showMaskTyped:!1,placeHolderCharacter:"_",dropSpecialCharacters:!0,hiddenInput:void 0,shownMaskExpression:"",separatorLimit:"",allowNegativeNumbers:!1,validation:!0,specialCharacters:["-","/","(",")",".",":"," ","+",",","@","[","]",'"',"'"],leadZeroDateTime:!1,patterns:{0:{pattern:new RegExp("\\d")},9:{pattern:new RegExp("\\d"),optional:!0},X:{pattern:new RegExp("\\d"),symbol:"*"},A:{pattern:new RegExp("[a-zA-Z0-9]")},S:{pattern:new RegExp("[a-zA-Z]")},d:{pattern:new RegExp("\\d")},m:{pattern:new RegExp("\\d")},M:{pattern:new RegExp("\\d")},H:{pattern:new RegExp("\\d")},h:{pattern:new RegExp("\\d")},s:{pattern:new RegExp("\\d")}}};let kg=(()=>{class t{constructor(t){this._config=t,this.maskExpression="",this.actualValue="",this.shownMaskExpression="",this._formatWithSeparators=(t,e,n,r)=>{const s=t.split(n),i=s.length>1?`${n}${s[1]}`:"";let o=s[0];const a=this.separatorLimit.replace(/\s/g,"");a&&+a&&(o="-"===o[0]?`-${o.slice(1,o.length).slice(0,a.length)}`:o.slice(0,a.length));const l=/(\d+)(\d{3})/;for(;e&&l.test(o);)o=o.replace(l,"$1"+e+"$2");return void 0===r?o+i:0===r?o:o+i.substr(0,r+1)},this.percentage=t=>Number(t)>=0&&Number(t)<=100,this.getPrecision=t=>{const e=t.split(".");return e.length>1?Number(e[e.length-1]):1/0},this.checkAndRemoveSuffix=t=>{var e,n,r;for(let s=(null===(e=this.suffix)||void 0===e?void 0:e.length)-1;s>=0;s--){const e=this.suffix.substr(s,null===(n=this.suffix)||void 0===n?void 0:n.length);if(t.includes(e)&&(s-1<0||!t.includes(this.suffix.substr(s-1,null===(r=this.suffix)||void 0===r?void 0:r.length))))return t.replace(e,"")}return t},this.checkInputPrecision=(t,e,n)=>{if(e<1/0){const r=new RegExp(this._charToRegExpExpression(n)+`\\d{${e}}.*$`),s=t.match(r);s&&s[0].length-1>e&&(t=t.substring(0,t.length-(s[0].length-1-e))),0===e&&t.endsWith(n)&&(t=t.substring(0,t.length-1))}return t},this._shift=new Set,this.clearIfNotMatch=this._config.clearIfNotMatch,this.dropSpecialCharacters=this._config.dropSpecialCharacters,this.maskSpecialCharacters=this._config.specialCharacters,this.maskAvailablePatterns=this._config.patterns,this.prefix=this._config.prefix,this.suffix=this._config.suffix,this.thousandSeparator=this._config.thousandSeparator,this.decimalMarker=this._config.decimalMarker,this.hiddenInput=this._config.hiddenInput,this.showMaskTyped=this._config.showMaskTyped,this.placeHolderCharacter=this._config.placeHolderCharacter,this.validation=this._config.validation,this.separatorLimit=this._config.separatorLimit,this.allowNegativeNumbers=this._config.allowNegativeNumbers,this.leadZeroDateTime=this._config.leadZeroDateTime}applyMaskWithPattern(t,e){const[n,r]=e;return this.customPattern=r,this.applyMask(t,n)}applyMask(t,e,n=0,r=!1,s=!1,i=(()=>{})){if(null==t||void 0===e)return"";let o=0,a="",l=!1,c=!1,u=1,h=!1;t.slice(0,this.prefix.length)===this.prefix&&(t=t.slice(this.prefix.length,t.length)),this.suffix&&(null==t?void 0:t.length)>0&&(t=this.checkAndRemoveSuffix(t));const d=t.toString().split("");"IP"===e&&(this.ipError=!!(d.filter(t=>"."===t).length<3&&d.length<7),e="099.099.099.099");const p=[];for(let _=0;_11?"00.000.000/0000-00":"000.000.000-00"),e.startsWith("percent")){if(t.match("[a-z]|[A-Z]")||t.match(/[-!$%^&*()_+|~=`{}\[\]:";'<>?,\/.]/)){t=this._stripToDecimal(t);const n=this.getPrecision(e);t=this.checkInputPrecision(t,n,this.decimalMarker)}if(t.indexOf(".")>0&&!this.percentage(t.substring(0,t.indexOf(".")))){const e=t.substring(0,t.indexOf(".")-1);t=`${e}${t.substring(t.indexOf("."),t.length)}`}a=this.percentage(t)?t:t.substring(0,t.length-1)}else if(e.startsWith("separator")){(t.match("[w\u0430-\u044f\u0410-\u042f]")||t.match("[\u0401\u0451\u0410-\u044f]")||t.match("[a-z]|[A-Z]")||t.match(/[-@#!$%\\^&*()_\xa3\xac'+|~=`{}\[\]:";<>.?\/]/)||t.match("[^A-Za-z0-9,]"))&&(t=this._stripToDecimal(t)),t=t.length>1&&"0"===t[0]&&t[1]!==this.decimalMarker?t.slice(1,t.length):t;const r=this._charToRegExpExpression(this.thousandSeparator),s=this._charToRegExpExpression(this.decimalMarker),i='@#!$%^&*()_+|~=`{}\\[\\]:\\s,\\.";<>?\\/'.replace(r,"").replace(s,""),o=new RegExp("["+i+"]");t.match(o)&&(t=t.substring(0,t.length-1));const l=this.getPrecision(e),h=(t=this.checkInputPrecision(t,l,this.decimalMarker)).replace(new RegExp(r,"g"),"");a=this._formatWithSeparators(h,this.thousandSeparator,this.decimalMarker,l);const d=a.indexOf(",")-t.indexOf(","),p=a.length-t.length;if(p>0&&","!==a[n]){c=!0;let t=0;do{this._shift.add(n+t),t++}while(t0&&!(a.indexOf(",")>=n&&n>3)||!(a.indexOf(".")>=n&&n>3)&&p<=0?(this._shift.clear(),c=!0,u=p,this._shift.add(n+=p)):this._shift.clear()}else for(let _=0,b=d[0];_2){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}if("h"===e[o]&&"2"===a&&Number(b)>3){o+=1,_--;continue}if("m"===e[o]&&Number(b)>5){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}if("s"===e[o]&&Number(b)>5){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}const n=31;if("d"===e[o]&&(Number(b)>3&&this.leadZeroDateTime||Number(t.slice(o,o+2))>n||"/"===t[o+1])){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}if("M"===e[o]){const r=12,s=0===o&&(Number(b)>2||Number(t.slice(o,o+2))>r||"/"===t[o+1]),i=t.slice(o-3,o-1).includes("/")&&("/"===t[o-2]&&Number(t.slice(o-1,o+1))>r&&"/"!==t[o]||"/"===t[o]||"/"===t[o-3]&&Number(t.slice(o-2,o))>r&&"/"!==t[o-1]||"/"===t[o-1]),l=Number(t.slice(o-3,o-1))<=n&&!t.slice(o-3,o-1).includes("/")&&"/"===t[o-1]&&(Number(t.slice(o,o+2))>r||"/"===t[o+1]),c=Number(t.slice(o-3,o-1))>n&&!t.slice(o-3,o-1).includes("/")&&!t.slice(o-2,o).includes("/")&&Number(t.slice(o-2,o))>r,u=Number(t.slice(o-3,o-1))<=n&&!t.slice(o-3,o-1).includes("/")&&"/"!==t[o-1]&&Number(t.slice(o-1,o+1))>r;if(Number(b)>1&&this.leadZeroDateTime||s||i||l||c||u){o+=1,this._shiftStep(e,o,d.length),_--,this.leadZeroDateTime&&(a+="0");continue}}a+=b,o++}else-1!==this.maskSpecialCharacters.indexOf(e[o])?(a+=e[o],o++,this._shiftStep(e,o,d.length),_--):this.maskSpecialCharacters.indexOf(b)>-1&&this.maskAvailablePatterns[e[o]]&&this.maskAvailablePatterns[e[o]].optional?(d[o]&&"099.099.099.099"!==e&&"000.000.000-00"!==e&&"00.000.000/0000-00"!==e&&(a+=d[o]),o++,_--):"*"===this.maskExpression[o+1]&&this._findSpecialChar(this.maskExpression[o+2])&&this._findSpecialChar(b)===this.maskExpression[o+2]&&l||"?"===this.maskExpression[o+1]&&this._findSpecialChar(this.maskExpression[o+2])&&this._findSpecialChar(b)===this.maskExpression[o+2]&&l?(o+=3,a+=b):this.showMaskTyped&&this.maskSpecialCharacters.indexOf(b)<0&&b!==this.placeHolderCharacter&&(h=!0);a.length+1===e.length&&-1!==this.maskSpecialCharacters.indexOf(e[e.length-1])&&(a+=e[e.length-1]);let f=n+1;for(;this._shift.has(f);)u++,f++;let g=r?o:this._shift.has(n)?u:0;h&&g--,i(g,c),u<0&&this._shift.clear();let m=!1;s&&(m=d.every(t=>this.maskSpecialCharacters.includes(t)));let y=`${this.prefix}${m?"":a}${this.suffix}`;return 0===a.length&&(y=`${this.prefix}${a}`),y}_findSpecialChar(t){return this.maskSpecialCharacters.find(e=>e===t)}_checkSymbolMask(t,e){return this.maskAvailablePatterns=this.customPattern?this.customPattern:this.maskAvailablePatterns,this.maskAvailablePatterns[e]&&this.maskAvailablePatterns[e].pattern&&this.maskAvailablePatterns[e].pattern.test(t)}_stripToDecimal(t){return t.split("").filter((t,e)=>t.match("^-?\\d")||t.match("\\s")||"."===t||","===t||"-"===t&&0===e&&this.allowNegativeNumbers).join("")}_charToRegExpExpression(t){if(t){const e="[\\^$.|?*+()";return" "===t?"\\s":e.indexOf(t)>=0?"\\"+t:t}return t}_shiftStep(t,e,n){const r=/[*?]/g.test(t.slice(0,e))?n:e;this._shift.add(r+this.prefix.length||0)}}return t.\u0275fac=function(e){return new(e||t)(lr(Cg))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),Tg=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[{provide:Sg,useValue:e},{provide:xg,useValue:Eg},{provide:Cg,useFactory:Ag,deps:[xg,Sg]},kg]}}static forChild(){return{ngModule:t}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})();function Ag(t,e){return Object.assign(Object.assign({},t),e instanceof Function?e():e)}const Og="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Og.KeyboardEvent||(Og.KeyboardEvent=function(t,e){});const Rg=[];let Ig=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[Cf.forRoot(Rg)],Cf]}),t})(),Pg=(()=>{class t{constructor(){this.title="dashboard"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=$t({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(t,e){1&t&&Hi(0,"router-outlet")},directives:[df],encapsulation:2}),t})();function Dg(t,e,n,s){return r(n)&&(s=n,n=void 0),s?Dg(t,e,n).pipe(k(t=>l(t)?s(...t):s(t))):new _(r=>{Ng(t,e,function(t){r.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},r,n)})}function Ng(t,e,n,r,s){let i;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const r=t;t.addEventListener(e,n,s),i=()=>r.removeEventListener(e,n,s)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const r=t;t.on(e,n),i=()=>r.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const r=t;t.addListener(e,n),i=()=>r.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let i=0,o=t.length;i{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class Fg extends Vg{constructor(t,e=Vg.now){super(t,()=>Fg.delegate&&Fg.delegate!==this?Fg.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return Fg.delegate&&Fg.delegate!==this?Fg.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const Ug=new Fg(jg);function Lg(t){return!l(t)&&t-parseFloat(t)+1>=0}function Hg(t){const{index:e,period:n,subscriber:r}=t;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}class $g{call(t,e){return e.subscribe(new zg(t))}}class zg extends Zu{constructor(t){super(t),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(t){this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(let n=0;nthis.index}hasCompleted(){return this.array.length===this.index}}class Yg extends F{constructor(t,e,n){super(t),this.parent=e,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[I](){return this}next(){const t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(t){this.buffer.push(t),this.parent.checkIterators()}subscribe(){return U(this.observable,new V(this))}}function Qg(t){return e=>e.lift(new Kg(t))}class Kg{constructor(t){this.notifier=t}call(t,e){const n=new Jg(t),r=U(this.notifier,new V(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n}}class Jg extends F{constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Xg(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new tm(t,n))}}class tm{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new em(t,this.observables,this.project))}}class em extends Zu{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const r=e.length;this.values=new Array(r);for(let s=0;s0){const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function nm(t,e){if(1&t){const t=$i();Ui(0,"button",1),Wi("click",function(){return Pe(t),Zi().close()}),Ui(1,"span",2),mo(2,"\xd7"),Li(),Li()}}const rm=["*"],sm=["dialog"];function im(t){return null!=t}function om(t){return(t||document.body).getBoundingClientRect()}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const am={animation:!0,transitionTimerDelayMs:5};let lm=(()=>{class t{constructor(){this.animation=am.animation}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=ut({factory:function(){return new t},token:t,providedIn:"root"}),t})();const cm=()=>{},{transitionTimerDelayMs:um}=am,hm=new Map,dm=(t,e,n,r)=>{let s=r.context||{};const i=hm.get(e);if(i)switch(r.runningTransition){case"continue":return nh;case"stop":t.run(()=>i.transition$.complete()),s=Object.assign(i.context,s),hm.delete(e)}const o=n(e,r.animation,s)||cm;if(!r.animation||"none"===window.getComputedStyle(e).transitionProperty)return t.run(()=>o()),qu(void 0).pipe(function(t){return e=>new _(n=>e.subscribe(e=>t.run(()=>n.next(e)),e=>t.run(()=>n.error(e)),()=>t.run(()=>n.complete())))}(t));const a=new S,c=new S,u=a.pipe(function(...t){return e=>eh(e,qu(...t))}(!0));hm.set(e,{transition$:a,complete:()=>{c.next(),c.complete()},context:s});const h=function(t){const{transitionDelay:e,transitionDuration:n}=window.getComputedStyle(t);return 1e3*(parseFloat(e)+parseFloat(n))}(e);return t.runOutsideAngular(()=>{const n=Dg(e,"transitionend").pipe(Qg(u),gh(({target:t})=>t===e));(function(...t){if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return B(t,void 0).lift(new $g)})(function(t=0,e,n){let r=-1;return Lg(e)?r=Number(e)<1?1:Number(e):E(e)&&(n=e),E(n)||(n=Ug),new _(e=>{const s=Lg(t)?t:+t-n.now();return n.schedule(Hg,s,{index:0,period:r,subscriber:e})})}(h+um).pipe(Qg(u)),n,c).pipe(Qg(u)).subscribe(()=>{hm.delete(e),t.run(()=>{o(),a.next(),a.complete()})})}),a.asObservable()};let pm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),fm=(()=>{class t{constructor(t){this._ngbConfig=t,this.dismissible=!0,this.type="warning"}get animation(){return void 0===this._animation?this._ngbConfig.animation:this._animation}set animation(t){this._animation=t}}return t.\u0275fac=function(e){return new(e||t)(lr(lm))},t.\u0275prov=ut({factory:function(){return new t(lr(lm))},token:t,providedIn:"root"}),t})();const gm=({classList:t})=>{t.remove("show")};let mm=(()=>{class t{constructor(t,e,n,r){this._renderer=e,this._element=n,this._zone=r,this.closed=new Wa,this.dismissible=t.dismissible,this.type=t.type,this.animation=t.animation}close(){const t=dm(this._zone,this._element.nativeElement,gm,{animation:this.animation,runningTransition:"continue"});return t.subscribe(()=>this.closed.emit()),t}ngOnChanges(t){const e=t.type;e&&!e.firstChange&&(this._renderer.removeClass(this._element.nativeElement,`alert-${e.previousValue}`),this._renderer.addClass(this._element.nativeElement,`alert-${e.currentValue}`))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,`alert-${this.type}`)}}return t.\u0275fac=function(e){return new(e||t)(ji(fm),ji(Wo),ji($o),ji(Ol))},t.\u0275cmp=$t({type:t,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert","show"],hostVars:4,hostBindings:function(t,e){2&t&&so("fade",e.animation)("alert-dismissible",e.dismissible)},inputs:{dismissible:"dismissible",type:"type",animation:"animation"},outputs:{closed:"closed"},exportAs:["ngbAlert"],features:[le],ngContentSelectors:rm,decls:2,vars:1,consts:function(){let t;return t=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,[["type","button","class","close","aria-label",t,3,"click",4,"ngIf"],["type","button","aria-label",t,1,"close",3,"click"],["aria-hidden","true"]]},template:function(t,e){1&t&&(Qi(),Ki(0),Ni(1,nm,3,0,"button",0)),2&t&&(cs(1),Vi("ngIf",e.dismissible))},directives:[uu],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),t})(),ym=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),_m=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})(),bm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),vm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})();var wm=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown",t}({});"undefined"!=typeof navigator&&navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));const Cm=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function Sm(t){const e=Array.from(t.querySelectorAll(Cm)).filter(t=>-1!==t.tabIndex);return[e[0],e[e.length-1]]}new class{getAllStyles(t){return window.getComputedStyle(t)}getStyle(t,e){return this.getAllStyles(t)[e]}isStaticPositioned(t){return"static"===(this.getStyle(t,"position")||"static")}offsetParent(t){let e=t.offsetParent||document.documentElement;for(;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement}position(t,e=!0){let n,r={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const e=this.offsetParent(t);n=this.offset(t,!1),e!==document.documentElement&&(r=this.offset(e,!1)),r.top+=e.clientTop,r.left+=e.clientLeft}return n.top-=r.top,n.bottom-=r.top,n.left-=r.left,n.right-=r.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(t,e=!0){const n=t.getBoundingClientRect(),r=window.pageYOffset-document.documentElement.clientTop,s=window.pageXOffset-document.documentElement.clientLeft;let i={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+r,bottom:n.bottom+r,left:n.left+s,right:n.right+s};return e&&(i.height=Math.round(i.height),i.width=Math.round(i.width),i.top=Math.round(i.top),i.bottom=Math.round(i.bottom),i.left=Math.round(i.left),i.right=Math.round(i.right)),i}positionElements(t,e,n,r){const[s="top",i="center"]=n.split("-"),o=r?this.offset(t,!1):this.position(t,!1),a=this.getAllStyles(e),l=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),u=parseFloat(a.marginLeft),h=parseFloat(a.marginRight);let d=0,p=0;switch(s){case"top":d=o.top-(e.offsetHeight+l+c);break;case"bottom":d=o.top+o.height;break;case"left":p=o.left-(e.offsetWidth+u+h);break;case"right":p=o.left+o.width}switch(i){case"top":d=o.top;break;case"bottom":d=o.top+o.height-e.offsetHeight;break;case"left":p=o.left;break;case"right":p=o.left+o.width-e.offsetWidth;break;case"center":"top"===s||"bottom"===s?p=o.left+o.width/2-e.offsetWidth/2:d=o.top+o.height/2-e.offsetHeight/2}e.style.transform=`translate(${Math.round(p)}px, ${Math.round(d)}px)`;const f=e.getBoundingClientRect(),g=document.documentElement,m=window.innerHeight||g.clientHeight,y=window.innerWidth||g.clientWidth;return f.left>=0&&f.top>=0&&f.right<=y&&f.bottom<=m}},new Date(1882,10,12),new Date(2174,10,25);let xm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu,wg]]}),t})(),Em=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Zt({type:t,selectors:[["",8,"navbar"]]}),t})(),km=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})(),Tm=(()=>{class t{constructor(t){this._ngbConfig=t,this.backdrop=!0,this.keyboard=!0}get animation(){return void 0===this._animation?this._ngbConfig.animation:this._animation}set animation(t){this._animation=t}}return t.\u0275fac=function(e){return new(e||t)(lr(lm))},t.\u0275prov=ut({factory:function(){return new t(lr(lm))},token:t,providedIn:"root"}),t})();class Am{constructor(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}}const Om=()=>{};let Rm=(()=>{class t{constructor(t){this._document=t}compensate(){const t=this._getWidth();return this._isPresent(t)?this._adjustBody(t):Om}_adjustBody(t){const e=this._document.body,n=e.style.paddingRight,r=parseFloat(window.getComputedStyle(e)["padding-right"]);return e.style["padding-right"]=`${r+t}px`,()=>e.style["padding-right"]=n}_isPresent(t){const e=this._document.body.getBoundingClientRect();return window.innerWidth-(e.left+e.right)>=t-.1*t}_getWidth(){const t=this._document.createElement("div");t.className="modal-scrollbar-measure";const e=this._document.body;e.appendChild(t);const n=t.getBoundingClientRect().width-t.clientWidth;return e.removeChild(t),n}}return t.\u0275fac=function(e){return new(e||t)(lr(ac))},t.\u0275prov=ut({factory:function(){return new t(lr(ac))},token:t,providedIn:"root"}),t})(),Im=(()=>{class t{constructor(t,e){this._el=t,this._zone=e}ngOnInit(){this._zone.onStable.asObservable().pipe(ch(1)).subscribe(()=>{dm(this._zone,this._el.nativeElement,(t,e)=>{e&&om(t),t.classList.add("show")},{animation:this.animation,runningTransition:"continue"})})}hide(){return dm(this._zone,this._el.nativeElement,({classList:t})=>t.remove("show"),{animation:this.animation,runningTransition:"stop"})}}return t.\u0275fac=function(e){return new(e||t)(ji($o),ji(Ol))},t.\u0275cmp=$t({type:t,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:6,hostBindings:function(t,e){2&t&&(io("modal-backdrop"+(e.backdropClass?" "+e.backdropClass:"")),so("show",!e.animation)("fade",e.animation))},inputs:{animation:"animation",backdropClass:"backdropClass"},decls:0,vars:0,template:function(t,e){},encapsulation:2}),t})();class Pm{close(t){}dismiss(t){}}class Dm{constructor(t,e,n,r){this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,this._beforeDismiss=r,this._closed=new S,this._dismissed=new S,this._hidden=new S,t.instance.dismissEvent.subscribe(t=>{this.dismiss(t)}),this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}get closed(){return this._closed.asObservable().pipe(Qg(this._hidden))}get dismissed(){return this._dismissed.asObservable().pipe(Qg(this._hidden))}get hidden(){return this._hidden.asObservable()}get shown(){return this._windowCmptRef.instance.shown.asObservable()}close(t){this._windowCmptRef&&(this._closed.next(t),this._resolve(t),this._removeModalElements())}_dismiss(t){this._dismissed.next(t),this._reject(t),this._removeModalElements()}dismiss(t){if(this._windowCmptRef)if(this._beforeDismiss){const e=this._beforeDismiss();e&&e.then?e.then(e=>{!1!==e&&this._dismiss(t)},()=>{}):!1!==e&&this._dismiss(t)}else this._dismiss(t)}_removeModalElements(){const t=this._windowCmptRef.instance.hide(),e=this._backdropCmptRef?this._backdropCmptRef.instance.hide():qu(void 0);t.subscribe(()=>{const{nativeElement:t}=this._windowCmptRef.location;t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._contentRef=null}),e.subscribe(()=>{if(this._backdropCmptRef){const{nativeElement:t}=this._backdropCmptRef.location;t.parentNode.removeChild(t),this._backdropCmptRef.destroy(),this._backdropCmptRef=null}}),Bg(t,e).subscribe(()=>{this._hidden.next(),this._hidden.complete()})}}var Nm=function(t){return t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC",t}({});let Mm=(()=>{class t{constructor(t,e,n){this._document=t,this._elRef=e,this._zone=n,this._closed$=new S,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new Wa,this.shown=new S,this.hidden=new S}dismiss(t){this.dismissEvent.emit(t)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){this._show()}ngOnDestroy(){this._disableEventHandling()}hide(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"stop"},n=Bg(dm(this._zone,t,()=>t.classList.remove("show"),e),dm(this._zone,this._dialogEl.nativeElement,()=>{},e));return n.subscribe(()=>{this.hidden.next(),this.hidden.complete()}),this._disableEventHandling(),this._restoreFocus(),n}_show(){const t={animation:this.animation,runningTransition:"continue"};Bg(dm(this._zone,this._elRef.nativeElement,(t,e)=>{e&&om(t),t.classList.add("show")},t),dm(this._zone,this._dialogEl.nativeElement,()=>{},t)).subscribe(()=>{this.shown.next(),this.shown.complete()}),this._enableEventHandling(),this._setFocus()}_enableEventHandling(){const{nativeElement:t}=this._elRef;this._zone.runOutsideAngular(()=>{Dg(t,"keydown").pipe(Qg(this._closed$),gh(t=>t.which===wm.Escape)).subscribe(t=>{this.keyboard?requestAnimationFrame(()=>{t.defaultPrevented||this._zone.run(()=>this.dismiss(Nm.ESC))}):"static"===this.backdrop&&this._bumpBackdrop()});let e=!1;Dg(this._dialogEl.nativeElement,"mousedown").pipe(Qg(this._closed$),Nh(()=>e=!1),ih(()=>Dg(t,"mouseup").pipe(Qg(this._closed$),ch(1))),gh(({target:e})=>t===e)).subscribe(()=>{e=!0}),Dg(t,"click").pipe(Qg(this._closed$)).subscribe(({target:n})=>{t===n&&("static"===this.backdrop?this._bumpBackdrop():!0!==this.backdrop||e||this._zone.run(()=>this.dismiss(Nm.BACKDROP_CLICK))),e=!1})})}_disableEventHandling(){this._closed$.next()}_setFocus(){const{nativeElement:t}=this._elRef;if(!t.contains(document.activeElement)){const e=t.querySelector("[ngbAutofocus]"),n=Sm(t)[0];(e||n||t).focus()}}_restoreFocus(){const t=this._document.body,e=this._elWithFocus;let n;n=e&&e.focus&&t.contains(e)?e:t,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null})}_bumpBackdrop(){"static"===this.backdrop&&dm(this._zone,this._elRef.nativeElement,({classList:t})=>(t.add("modal-static"),()=>t.remove("modal-static")),{animation:this.animation,runningTransition:"continue"})}}return t.\u0275fac=function(e){return new(e||t)(ji(ac),ji($o),ji(Ol))},t.\u0275cmp=$t({type:t,selectors:[["ngb-modal-window"]],viewQuery:function(t,e){if(1&t&&sl(sm,3),2&t){let t;rl(t=il())&&(e._dialogEl=t.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:7,hostBindings:function(t,e){2&t&&(Di("aria-modal",!0)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),io("modal d-block"+(e.windowClass?" "+e.windowClass:"")),so("fade",e.animation))},inputs:{backdrop:"backdrop",keyboard:"keyboard",animation:"animation",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass",modalDialogClass:"modalDialogClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:rm,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(t,e){1&t&&(Qi(),Ui(0,"div",0,1),Ui(2,"div",2),Ki(3),Li(),Li()),2&t&&io("modal-dialog"+(e.size?" modal-"+e.size:"")+(e.centered?" modal-dialog-centered":"")+(e.scrollable?" modal-dialog-scrollable":"")+(e.modalDialogClass?" "+e.modalDialogClass:""))},styles:["ngb-modal-window .component-host-scrollable{display:flex;flex-direction:column;overflow:hidden}"],encapsulation:2}),t})(),jm=(()=>{class t{constructor(t,e,n,r,s,i){this._applicationRef=t,this._injector=e,this._document=n,this._scrollBar=r,this._rendererFactory=s,this._ngZone=i,this._activeWindowCmptHasChanged=new S,this._ariaHiddenValues=new Map,this._backdropAttributes=["animation","backdropClass"],this._modalRefs=[],this._windowAttributes=["animation","ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new Wa,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const t=this._windowCmpts[this._windowCmpts.length-1];((t,e,n,r=!1)=>{this._ngZone.runOutsideAngular(()=>{const t=Dg(e,"focusin").pipe(Qg(n),k(t=>t.target));Dg(e,"keydown").pipe(Qg(n),gh(t=>t.which===wm.Tab),Xg(t)).subscribe(([t,n])=>{const[r,s]=Sm(e);n!==r&&n!==e||!t.shiftKey||(s.focus(),t.preventDefault()),n!==s||t.shiftKey||(r.focus(),t.preventDefault())}),r&&Dg(e,"click").pipe(Qg(n),Xg(t),k(t=>t[1])).subscribe(t=>t.focus())})})(0,t.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(t.location.nativeElement)}})}open(t,e,n,r){const s=r.container instanceof HTMLElement?r.container:im(r.container)?this._document.querySelector(r.container):this._document.body,i=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(i.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!s)throw new Error(`The specified modal container "${r.container||"body"}" was not found in the DOM.`);const l=new Pm,c=this._getContentRef(t,r.injector||e,n,l,r);let u=!1!==r.backdrop?this._attachBackdrop(t,s):void 0,h=this._attachWindowComponent(t,s,c),d=new Dm(h,c,u,r.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(h),d.result.then(o,o),d.result.then(a,a),l.close=t=>{d.close(t)},l.dismiss=t=>{d.dismiss(t)},this._applyWindowOptions(h.instance,r),1===this._modalRefs.length&&i.addClass(this._document.body,"modal-open"),u&&u.instance&&this._applyBackdropOptions(u.instance,r),d}get activeInstances(){return this._activeInstances}dismissAll(t){this._modalRefs.forEach(e=>e.dismiss(t))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(t,e){let n=t.resolveComponentFactory(Im).create(this._injector);return this._applicationRef.attachView(n.hostView),e.appendChild(n.location.nativeElement),n}_attachWindowComponent(t,e,n){let r=t.resolveComponentFactory(Mm).create(this._injector,n.nodes);return this._applicationRef.attachView(r.hostView),e.appendChild(r.location.nativeElement),r}_applyWindowOptions(t,e){this._windowAttributes.forEach(n=>{im(e[n])&&(t[n]=e[n])})}_applyBackdropOptions(t,e){this._backdropAttributes.forEach(n=>{im(e[n])&&(t[n]=e[n])})}_getContentRef(t,e,n,r,s){return n?n instanceof ba?this._createFromTemplateRef(n,r):"string"==typeof n?this._createFromString(n):this._createFromComponent(t,e,n,r,s):new Am([])}_createFromTemplateRef(t,e){const n=t.createEmbeddedView({$implicit:e,close(t){e.close(t)},dismiss(t){e.dismiss(t)}});return this._applicationRef.attachView(n),new Am([n.rootNodes],n)}_createFromString(t){const e=this._document.createTextNode(`${t}`);return new Am([[e]])}_createFromComponent(t,e,n,r,s){const i=t.resolveComponentFactory(n),o=_i.create({providers:[{provide:Pm,useValue:r}],parent:e}),a=i.create(o),l=a.location.nativeElement;return s.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(a.hostView),new Am([[l]],a.hostView,a)}_setAriaHidden(t){const e=t.parentElement;e&&t!==this._document.body&&(Array.from(e.children).forEach(e=>{e!==t&&"SCRIPT"!==e.nodeName&&(this._ariaHiddenValues.set(e,e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),this._setAriaHidden(e))}_revertAriaHidden(){this._ariaHiddenValues.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(t){const e=()=>{const e=this._modalRefs.indexOf(t);e>-1&&(this._modalRefs.splice(e,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(t),this._activeInstances.emit(this._modalRefs),t.result.then(e,e)}_registerWindowCmpt(t){this._windowCmpts.push(t),this._activeWindowCmptHasChanged.next(),t.onDestroy(()=>{const e=this._windowCmpts.indexOf(t);e>-1&&(this._windowCmpts.splice(e,1),this._activeWindowCmptHasChanged.next())})}}return t.\u0275fac=function(e){return new(e||t)(lr(Yl),lr(_i),lr(ac),lr(Rm),lr(Bo),lr(Ol))},t.\u0275prov=ut({factory:function(){return new t(lr(Yl),lr(ni),lr(ac),lr(Rm),lr(Bo),lr(Ol))},token:t,providedIn:"root"}),t})(),Vm=(()=>{class t{constructor(t,e,n,r){this._moduleCFR=t,this._injector=e,this._modalStack=n,this._config=r}open(t,e={}){const n=Object.assign(Object.assign(Object.assign({},this._config),{animation:this._config.animation}),e);return this._modalStack.open(this._moduleCFR,this._injector,t,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(t){this._modalStack.dismissAll(t)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return t.\u0275fac=function(e){return new(e||t)(lr(Fo),lr(_i),lr(jm),lr(Tm))},t.\u0275prov=ut({factory:function(){return new t(lr(Fo),lr(ni),lr(jm),lr(Tm))},token:t,providedIn:"root"}),t})(),Fm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({providers:[Vm]}),t})(),Um=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Lm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Hm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),$m=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),zm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Bm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Wm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),qm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})();new Bn("live announcer delay",{providedIn:"root",factory:function(){return 100}});let Gm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})();const Zm=[pm,ym,_m,bm,vm,xm,km,Fm,Um,Lm,Hm,$m,zm,Bm,Wm,qm,Gm];let Ym=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[Zm,pm,ym,_m,bm,vm,xm,km,Fm,Um,Lm,Hm,$m,zm,Bm,Wm,qm,Gm]}),t})();function Qm(t){const{subscriber:e,counter:n,period:r}=t;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}class Km{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new Jm(t,this.dueTime,this.scheduler))}}class Jm extends f{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Xm,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Xm(t){t.debouncedNext()}let ty=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}save(){this.activeModal.close(this.rewindDate)}}return t.\u0275fac=function(e){return new(e||t)(ji(Pm))},t.\u0275cmp=$t({type:t,selectors:[["app-rewind-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:3,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["for","rewindDate"],[1,"input-group"],["id","rewindDate","placeholder","yyyy-mm-dd hh:MM:ss","type","datetime-local",1,"form-control",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Rewind consumers offset"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"label",6),mo(9,"Select the datetime to rewind all the partition-offsets of consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' "),Li(),Ui(16,"div",7),Ui(17,"input",8),Wi("ngModelChange",function(t){return e.rewindDate=t}),Li(),Li(),Li(),Li(),Ui(18,"div",9),Ui(19,"button",10),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"Cancel"),Li(),Ui(21,"button",11),Wi("click",function(){return e.save()}),mo(22,"OK"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""),cs(3),Vi("ngModel",e.rewindDate))},directives:[jf,Kf,mg],encapsulation:2}),t})(),ey=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){this.oldWorkersCount=this.workersCount}save(){this.activeModal.close(this.workersCount)}}return t.\u0275fac=function(e){return new(e||t)(ji(Pm))},t.\u0275cmp=$t({type:t,selectors:[["app-workers-count-modal"]],inputs:{workersCount:"workersCount",groupId:"groupId",consumerName:"consumerName"},decls:28,vars:4,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["for","oldWorkersCount"],[1,"input-group","mb-2"],["id","oldWorkersCount","type","number","readonly","",1,"form-control",3,"ngModel","ngModelChange"],["for","workersCount"],[1,"input-group"],["id","workersCount","type","number",1,"form-control",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Consumer workers running"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"label"),mo(9,"Update the number of workers in consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),Li(),Ui(15,"label",6),mo(16,"Current Value"),Li(),Ui(17,"div",7),Ui(18,"input",8),Wi("ngModelChange",function(t){return e.oldWorkersCount=t}),Li(),Li(),Ui(19,"label",9),mo(20,"New Value"),Li(),Ui(21,"div",10),Ui(22,"input",11),Wi("ngModelChange",function(t){return e.workersCount=t}),Li(),Li(),Li(),Li(),Ui(23,"div",12),Ui(24,"button",13),Wi("click",function(){return e.activeModal.dismiss()}),mo(25,"Cancel"),Li(),Ui(26,"button",14),Wi("click",function(){return e.save()}),mo(27,"OK"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,"'"),cs(4),Vi("ngModel",e.oldWorkersCount),cs(4),Vi("ngModel",e.workersCount))},directives:[_g,jf,Kf,mg],encapsulation:2}),t})(),ny=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(Pm))},t.\u0275cmp=$t({type:t,selectors:[["app-reset-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Reset consumers offset"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Reset the offset you generate a huge lag to consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"'. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),ry=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(Pm))},t.\u0275cmp=$t({type:t,selectors:[["app-pause-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Pause consumers"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Pause the consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' will interrupt the kafka data processing and, probably, generate lag. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),sy=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(Pm))},t.\u0275cmp=$t({type:t,selectors:[["app-resume-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Resume consumers"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Resume the consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' will restart to process the messages. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),iy=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(Pm))},t.\u0275cmp=$t({type:t,selectors:[["app-restart-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Restart consumers"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Restart the consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' will can generate a temporary instability in your system. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(); /** * @license Angular v11.2.11 * (c) 2010-2021 Google LLC. https://angular.io/ @@ -1444,49 +1444,50 @@ const yg={provide:Df,useExisting:rt(()=>_g),multi:!0};let _g=(()=>{class t exten * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */class Lg{}class Hg{} + */ +class oy{}class ay{} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */class $g{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),r=n.toLowerCase(),s=t.slice(e+1).trim();this.maybeSetNormalizedName(n,r),this.headers.has(r)?this.headers.get(r).push(s):this.headers.set(r,[s])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const r=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(r,n),this.maybeSetNormalizedName(e,r))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof $g?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new $g;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof $g?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const r=("a"===t.op?this.headers.get(e):void 0)||[];r.push(...n),this.headers.set(e,r);break;case"d":const s=t.value;if(s){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===s.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}} + */class ly{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),r=n.toLowerCase(),s=t.slice(e+1).trim();this.maybeSetNormalizedName(n,r),this.headers.has(r)?this.headers.get(r).push(s):this.headers.set(r,[s])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const r=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(r,n),this.maybeSetNormalizedName(e,r))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof ly?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new ly;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof ly?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const r=("a"===t.op?this.headers.get(e):void 0)||[];r.push(...n),this.headers.set(e,r);break;case"d":const s=t.value;if(s){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===s.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */class zg{encodeKey(t){return Bg(t)}encodeValue(t){return Bg(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}function Bg(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class Wg{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new zg,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(t=>{const r=t.indexOf("="),[s,i]=-1==r?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,r)),e.decodeValue(t.slice(r+1))],o=n.get(s)||[];o.push(i),n.set(s,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(n=>{const r=t[n];Array.isArray(r)?r.forEach(t=>{e.push({param:n,value:t,op:"a"})}):e.push({param:n,value:r,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Wg({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(t.value),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(t.value);-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}} + */class cy{encodeKey(t){return uy(t)}encodeValue(t){return uy(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}function uy(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class hy{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new cy,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(t=>{const r=t.indexOf("="),[s,i]=-1==r?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,r)),e.decodeValue(t.slice(r+1))],o=n.get(s)||[];o.push(i),n.set(s,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){const e=[];return Object.keys(t).forEach(n=>{const r=t[n];Array.isArray(r)?r.forEach(t=>{e.push({param:n,value:t,op:"a"})}):e.push({param:n,value:r,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new hy({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(t.value),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(t.value);-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */function qg(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Gg(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Zg(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Yg{constructor(t,e,n,r){let s;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==n?n:null,s=r):s=n,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.params&&(this.params=s.params)),this.headers||(this.headers=new $g),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),a)),t.setParams&&(l=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),l)),new Yg(e,n,s,{params:l,headers:a,reportProgress:o,responseType:r,withCredentials:i})}} + */function dy(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function py(t){return"undefined"!=typeof Blob&&t instanceof Blob}function fy(t){return"undefined"!=typeof FormData&&t instanceof FormData}class gy{constructor(t,e,n,r){let s;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==n?n:null,s=r):s=n,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.params&&(this.params=s.params)),this.headers||(this.headers=new ly),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),a)),t.setParams&&(l=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),l)),new gy(e,n,s,{params:l,headers:a,reportProgress:o,responseType:r,withCredentials:i})}} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */var Qg=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({});class Kg{constructor(t,e=200,n="OK"){this.headers=t.headers||new $g,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class Jg extends Kg{constructor(t={}){super(t),this.type=Qg.ResponseHeader}clone(t={}){return new Jg({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Xg extends Kg{constructor(t={}){super(t),this.type=Qg.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new Xg({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class tm extends Kg{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}} + */var my=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({});class yy{constructor(t,e=200,n="OK"){this.headers=t.headers||new ly,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class _y extends yy{constructor(t={}){super(t),this.type=my.ResponseHeader}clone(t={}){return new _y({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class by extends yy{constructor(t={}){super(t),this.type=my.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new by({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class vy extends yy{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */function em(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let nm=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let r;if(t instanceof Yg)r=t;else{let s,i;s=n.headers instanceof $g?n.headers:new $g(n.headers),n.params&&(i=n.params instanceof Wg?n.params:new Wg({fromObject:n.params})),r=new Yg(t,e,void 0!==n.body?n.body:null,{headers:s,params:i,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const s=qu(r).pipe(wh(t=>this.handler.handle(t)));if(t instanceof Yg||"events"===n.observe)return s;const i=s.pipe(gh(t=>t instanceof Xg));switch(n.observe||"body"){case"body":switch(r.responseType){case"arraybuffer":return i.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return i.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return i.pipe(k(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return i.pipe(k(t=>t.body))}case"response":return i;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Wg).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,em(n,e))}post(t,e,n={}){return this.request("POST",t,em(n,e))}put(t,e,n={}){return this.request("PUT",t,em(n,e))}}return t.\u0275fac=function(e){return new(e||t)(lr(Lg))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(); + */function wy(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let Cy=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let r;if(t instanceof gy)r=t;else{let s,i;s=n.headers instanceof ly?n.headers:new ly(n.headers),n.params&&(i=n.params instanceof hy?n.params:new hy({fromObject:n.params})),r=new gy(t,e,void 0!==n.body?n.body:null,{headers:s,params:i,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const s=qu(r).pipe(wh(t=>this.handler.handle(t)));if(t instanceof gy||"events"===n.observe)return s;const i=s.pipe(gh(t=>t instanceof by));switch(n.observe||"body"){case"body":switch(r.responseType){case"arraybuffer":return i.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return i.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return i.pipe(k(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return i.pipe(k(t=>t.body))}case"response":return i;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new hy).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,wy(n,e))}post(t,e,n={}){return this.request("POST",t,wy(n,e))}put(t,e,n={}){return this.request("PUT",t,wy(n,e))}}return t.\u0275fac=function(e){return new(e||t)(lr(oy))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license - */class rm{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const sm=new Bn("HTTP_INTERCEPTORS");let im=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(); + */class Sy{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const xy=new Bn("HTTP_INTERCEPTORS");let Ey=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(); /** * @license * Copyright Google LLC All Rights Reserved. @@ -1501,7 +1502,7 @@ const yg={provide:Df,useExisting:rt(()=>_g),multi:!0};let _g=(()=>{class t exten * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -const om=/^\)\]\}',?\n/;class am{}let lm=(()=>{class t{constructor(){}build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),cm=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new _(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const r=t.serializeBody();let s=null;const i=()=>{if(null!==s)return s;const e=1223===n.status?204:n.status,r=n.statusText||"OK",i=new $g(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return s=new Jg({headers:i,status:e,statusText:r,url:o}),s},o=()=>{let{headers:r,status:s,statusText:o,url:a}=i(),l=null;204!==s&&(l=void 0===n.response?n.responseText:n.response),0===s&&(s=l?200:0);let c=s>=200&&s<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(om,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new Xg({body:l,headers:r,status:s,statusText:o,url:a||void 0})),e.complete()):e.error(new tm({error:l,headers:r,status:s,statusText:o,url:a||void 0}))},a=t=>{const{url:r}=i(),s=new tm({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:r||void 0});e.error(s)};let l=!1;const c=r=>{l||(e.next(i()),l=!0);let s={type:Qg.DownloadProgress,loaded:r.loaded};r.lengthComputable&&(s.total=r.total),"text"===t.responseType&&n.responseText&&(s.partialText=n.responseText),e.next(s)},u=t=>{let n={type:Qg.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),t.reportProgress&&(n.addEventListener("progress",c),null!==r&&n.upload&&n.upload.addEventListener("progress",u)),n.send(r),e.next({type:Qg.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),t.reportProgress&&(n.removeEventListener("progress",c),null!==r&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(lr(am))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(); +const ky=/^\)\]\}',?\n/;class Ty{}let Ay=(()=>{class t{constructor(){}build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),Oy=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new _(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const r=t.serializeBody();let s=null;const i=()=>{if(null!==s)return s;const e=1223===n.status?204:n.status,r=n.statusText||"OK",i=new ly(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return s=new _y({headers:i,status:e,statusText:r,url:o}),s},o=()=>{let{headers:r,status:s,statusText:o,url:a}=i(),l=null;204!==s&&(l=void 0===n.response?n.responseText:n.response),0===s&&(s=l?200:0);let c=s>=200&&s<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(ky,"");try{l=""!==l?JSON.parse(l):null}catch(u){l=t,c&&(c=!1,l={error:u,text:l})}}c?(e.next(new by({body:l,headers:r,status:s,statusText:o,url:a||void 0})),e.complete()):e.error(new vy({error:l,headers:r,status:s,statusText:o,url:a||void 0}))},a=t=>{const{url:r}=i(),s=new vy({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:r||void 0});e.error(s)};let l=!1;const c=r=>{l||(e.next(i()),l=!0);let s={type:my.DownloadProgress,loaded:r.loaded};r.lengthComputable&&(s.total=r.total),"text"===t.responseType&&n.responseText&&(s.partialText=n.responseText),e.next(s)},u=t=>{let n={type:my.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),t.reportProgress&&(n.addEventListener("progress",c),null!==r&&n.upload&&n.upload.addEventListener("progress",u)),n.send(r),e.next({type:my.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),t.reportProgress&&(n.removeEventListener("progress",c),null!==r&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(lr(Ty))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(); /** * @license * Copyright Google LLC All Rights Reserved. @@ -1509,7 +1510,7 @@ const om=/^\)\]\}',?\n/;class am{}let lm=(()=>{class t{constructor(){}build(){re * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -const um=new Bn("XSRF_COOKIE_NAME"),hm=new Bn("XSRF_HEADER_NAME");class dm{}let pm=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=iu(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(lr(ac),lr(fl),lr(um))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),fm=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const r=this.tokenService.getToken();return null===r||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,r)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(lr(dm),lr(hm))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),gm=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(sm,[]);this.chain=t.reduceRight((t,e)=>new rm(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(lr(Hg),lr(_i))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),mm=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:fm,useClass:im}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:um,useValue:e.cookieName}:[],e.headerName?{provide:hm,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({providers:[fm,{provide:sm,useExisting:fm,multi:!0},{provide:dm,useClass:pm},{provide:um,useValue:"XSRF-TOKEN"},{provide:hm,useValue:"X-XSRF-TOKEN"}]}),t})(),ym=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({providers:[nm,{provide:Lg,useClass:gm},cm,{provide:Hg,useExisting:cm},lm,{provide:am,useExisting:lm}],imports:[[mm.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})(),_m=(()=>{class t{constructor(t){this.http=t,this.accessPointUrl="/kafka-flow/",this.headers=new $g({"Content-Type":"application/json; charset=utf-8"})}get(){return this.http.get(this.accessPointUrl+"groups",{headers:this.headers})}updateWorkersCount(t,e,n){return this.http.post(this.accessPointUrl+`groups/${t}/consumers/${e}/change-worker-count`,{workersCount:n},{headers:this.headers})}resetOffset(t,e){return this.http.post(this.accessPointUrl+`groups/${t}/consumers/${e}/reset-offsets`,{confirm:!0},{headers:this.headers})}pause(t,e){return this.http.post(this.accessPointUrl+`groups/${t}/consumers/${e}/pause`,null,{headers:this.headers})}restart(t,e){return this.http.post(this.accessPointUrl+`groups/${t}/consumers/${e}/restart`,null,{headers:this.headers})}resume(t,e){return this.http.post(this.accessPointUrl+`groups/${t}/consumers/${e}/resume`,null,{headers:this.headers})}rewindOffset(t,e,n){return this.http.post(this.accessPointUrl+`groups/${t}/consumers/${e}/rewind-offsets-to-date`,{date:new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString()},{headers:this.headers})}}return t.\u0275fac=function(e){return new(e||t)(lr(nm))},t.\u0275prov=ut({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function bm(t,e,n,s){return r(n)&&(s=n,n=void 0),s?bm(t,e,n).pipe(k(t=>l(t)?s(...t):s(t))):new _(r=>{vm(t,e,function(t){r.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},r,n)})}function vm(t,e,n,r,s){let i;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const r=t;t.addEventListener(e,n,s),i=()=>r.removeEventListener(e,n,s)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const r=t;t.on(e,n),i=()=>r.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const r=t;t.addListener(e,n),i=()=>r.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let i=0,o=t.length;ithis.index}hasCompleted(){return this.array.length===this.index}}class Om extends F{constructor(t,e,n){super(t),this.parent=e,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[I](){return this}next(){const t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(t){this.buffer.push(t),this.parent.checkIterators()}subscribe(){return U(this.observable,new V(this))}}function Rm(t){return e=>e.lift(new Im(t))}class Im{constructor(t){this.notifier=t}call(t,e){const n=new Pm(t),r=U(this.notifier,new V(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n}}class Pm extends F{constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Dm(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new Nm(t,n))}}class Nm{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new Mm(t,this.observables,this.project))}}class Mm extends Zu{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const r=e.length;this.values=new Array(r);for(let s=0;s0){const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function jm(t,e){if(1&t){const t=$i();Ui(0,"button",1),Wi("click",function(){return Pe(t),Zi().close()}),Ui(1,"span",2),mo(2,"\xd7"),Li(),Li()}}const Vm=["*"],Fm=["dialog"];function Um(t){return null!=t}function Lm(t){return(t||document.body).getBoundingClientRect()}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const Hm={animation:!0,transitionTimerDelayMs:5};let $m=(()=>{class t{constructor(){this.animation=Hm.animation}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=ut({factory:function(){return new t},token:t,providedIn:"root"}),t})();const zm=()=>{},{transitionTimerDelayMs:Bm}=Hm,Wm=new Map,qm=(t,e,n,r)=>{let s=r.context||{};const i=Wm.get(e);if(i)switch(r.runningTransition){case"continue":return nh;case"stop":t.run(()=>i.transition$.complete()),s=Object.assign(i.context,s),Wm.delete(e)}const o=n(e,r.animation,s)||zm;if(!r.animation||"none"===window.getComputedStyle(e).transitionProperty)return t.run(()=>o()),qu(void 0).pipe(function(t){return e=>new _(n=>e.subscribe(e=>t.run(()=>n.next(e)),e=>t.run(()=>n.error(e)),()=>t.run(()=>n.complete())))}(t));const a=new S,c=new S,u=a.pipe(function(...t){return e=>eh(e,qu(...t))}(!0));Wm.set(e,{transition$:a,complete:()=>{c.next(),c.complete()},context:s});const h=function(t){const{transitionDelay:e,transitionDuration:n}=window.getComputedStyle(t);return 1e3*(parseFloat(e)+parseFloat(n))}(e);return t.runOutsideAngular(()=>{const n=bm(e,"transitionend").pipe(Rm(u),gh(({target:t})=>t===e));(function(...t){if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return B(t,void 0).lift(new Cm)})(function(t=0,e,n){let r=-1;return Fg(e)?r=Number(e)<1?1:Number(e):E(e)&&(n=e),E(n)||(n=Vg),new _(e=>{const s=Fg(t)?t:+t-n.now();return n.schedule(wm,s,{index:0,period:r,subscriber:e})})}(h+Bm).pipe(Rm(u)),n,c).pipe(Rm(u)).subscribe(()=>{Wm.delete(e),t.run(()=>{o(),a.next(),a.complete()})})}),a.asObservable()};let Gm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Zm=(()=>{class t{constructor(t){this._ngbConfig=t,this.dismissible=!0,this.type="warning"}get animation(){return void 0===this._animation?this._ngbConfig.animation:this._animation}set animation(t){this._animation=t}}return t.\u0275fac=function(e){return new(e||t)(lr($m))},t.\u0275prov=ut({factory:function(){return new t(lr($m))},token:t,providedIn:"root"}),t})();const Ym=({classList:t})=>{t.remove("show")};let Qm=(()=>{class t{constructor(t,e,n,r){this._renderer=e,this._element=n,this._zone=r,this.closed=new Wa,this.dismissible=t.dismissible,this.type=t.type,this.animation=t.animation}close(){const t=qm(this._zone,this._element.nativeElement,Ym,{animation:this.animation,runningTransition:"continue"});return t.subscribe(()=>this.closed.emit()),t}ngOnChanges(t){const e=t.type;e&&!e.firstChange&&(this._renderer.removeClass(this._element.nativeElement,`alert-${e.previousValue}`),this._renderer.addClass(this._element.nativeElement,`alert-${e.currentValue}`))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,`alert-${this.type}`)}}return t.\u0275fac=function(e){return new(e||t)(ji(Zm),ji(Wo),ji($o),ji(Ol))},t.\u0275cmp=$t({type:t,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert","show"],hostVars:4,hostBindings:function(t,e){2&t&&so("fade",e.animation)("alert-dismissible",e.dismissible)},inputs:{dismissible:"dismissible",type:"type",animation:"animation"},outputs:{closed:"closed"},exportAs:["ngbAlert"],features:[le],ngContentSelectors:Vm,decls:2,vars:1,consts:function(){let t;return t=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,[["type","button","class","close","aria-label",t,3,"click",4,"ngIf"],["type","button","aria-label",t,1,"close",3,"click"],["aria-hidden","true"]]},template:function(t,e){1&t&&(Qi(),Ki(0),Ni(1,jm,3,0,"button",0)),2&t&&(cs(1),Vi("ngIf",e.dismissible))},directives:[uu],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),t})(),Km=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Jm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})(),Xm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),ty=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})();var ey=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown",t}({});"undefined"!=typeof navigator&&navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));const ny=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function ry(t){const e=Array.from(t.querySelectorAll(ny)).filter(t=>-1!==t.tabIndex);return[e[0],e[e.length-1]]}new class{getAllStyles(t){return window.getComputedStyle(t)}getStyle(t,e){return this.getAllStyles(t)[e]}isStaticPositioned(t){return"static"===(this.getStyle(t,"position")||"static")}offsetParent(t){let e=t.offsetParent||document.documentElement;for(;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement}position(t,e=!0){let n,r={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const e=this.offsetParent(t);n=this.offset(t,!1),e!==document.documentElement&&(r=this.offset(e,!1)),r.top+=e.clientTop,r.left+=e.clientLeft}return n.top-=r.top,n.bottom-=r.top,n.left-=r.left,n.right-=r.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(t,e=!0){const n=t.getBoundingClientRect(),r=window.pageYOffset-document.documentElement.clientTop,s=window.pageXOffset-document.documentElement.clientLeft;let i={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+r,bottom:n.bottom+r,left:n.left+s,right:n.right+s};return e&&(i.height=Math.round(i.height),i.width=Math.round(i.width),i.top=Math.round(i.top),i.bottom=Math.round(i.bottom),i.left=Math.round(i.left),i.right=Math.round(i.right)),i}positionElements(t,e,n,r){const[s="top",i="center"]=n.split("-"),o=r?this.offset(t,!1):this.position(t,!1),a=this.getAllStyles(e),l=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),u=parseFloat(a.marginLeft),h=parseFloat(a.marginRight);let d=0,p=0;switch(s){case"top":d=o.top-(e.offsetHeight+l+c);break;case"bottom":d=o.top+o.height;break;case"left":p=o.left-(e.offsetWidth+u+h);break;case"right":p=o.left+o.width}switch(i){case"top":d=o.top;break;case"bottom":d=o.top+o.height-e.offsetHeight;break;case"left":p=o.left;break;case"right":p=o.left+o.width-e.offsetWidth;break;case"center":"top"===s||"bottom"===s?p=o.left+o.width/2-e.offsetWidth/2:d=o.top+o.height/2-e.offsetHeight/2}e.style.transform=`translate(${Math.round(p)}px, ${Math.round(d)}px)`;const f=e.getBoundingClientRect(),g=document.documentElement,m=window.innerHeight||g.clientHeight,y=window.innerWidth||g.clientWidth;return f.left>=0&&f.top>=0&&f.right<=y&&f.bottom<=m}},new Date(1882,10,12),new Date(2174,10,25);let sy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu,wg]]}),t})(),iy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Zt({type:t,selectors:[["",8,"navbar"]]}),t})(),oy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})(),ay=(()=>{class t{constructor(t){this._ngbConfig=t,this.backdrop=!0,this.keyboard=!0}get animation(){return void 0===this._animation?this._ngbConfig.animation:this._animation}set animation(t){this._animation=t}}return t.\u0275fac=function(e){return new(e||t)(lr($m))},t.\u0275prov=ut({factory:function(){return new t(lr($m))},token:t,providedIn:"root"}),t})();class ly{constructor(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}}const cy=()=>{};let uy=(()=>{class t{constructor(t){this._document=t}compensate(){const t=this._getWidth();return this._isPresent(t)?this._adjustBody(t):cy}_adjustBody(t){const e=this._document.body,n=e.style.paddingRight,r=parseFloat(window.getComputedStyle(e)["padding-right"]);return e.style["padding-right"]=`${r+t}px`,()=>e.style["padding-right"]=n}_isPresent(t){const e=this._document.body.getBoundingClientRect();return window.innerWidth-(e.left+e.right)>=t-.1*t}_getWidth(){const t=this._document.createElement("div");t.className="modal-scrollbar-measure";const e=this._document.body;e.appendChild(t);const n=t.getBoundingClientRect().width-t.clientWidth;return e.removeChild(t),n}}return t.\u0275fac=function(e){return new(e||t)(lr(ac))},t.\u0275prov=ut({factory:function(){return new t(lr(ac))},token:t,providedIn:"root"}),t})(),hy=(()=>{class t{constructor(t,e){this._el=t,this._zone=e}ngOnInit(){this._zone.onStable.asObservable().pipe(ch(1)).subscribe(()=>{qm(this._zone,this._el.nativeElement,(t,e)=>{e&&Lm(t),t.classList.add("show")},{animation:this.animation,runningTransition:"continue"})})}hide(){return qm(this._zone,this._el.nativeElement,({classList:t})=>t.remove("show"),{animation:this.animation,runningTransition:"stop"})}}return t.\u0275fac=function(e){return new(e||t)(ji($o),ji(Ol))},t.\u0275cmp=$t({type:t,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:6,hostBindings:function(t,e){2&t&&(io("modal-backdrop"+(e.backdropClass?" "+e.backdropClass:"")),so("show",!e.animation)("fade",e.animation))},inputs:{animation:"animation",backdropClass:"backdropClass"},decls:0,vars:0,template:function(t,e){},encapsulation:2}),t})();class dy{close(t){}dismiss(t){}}class py{constructor(t,e,n,r){this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,this._beforeDismiss=r,this._closed=new S,this._dismissed=new S,this._hidden=new S,t.instance.dismissEvent.subscribe(t=>{this.dismiss(t)}),this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}get closed(){return this._closed.asObservable().pipe(Rm(this._hidden))}get dismissed(){return this._dismissed.asObservable().pipe(Rm(this._hidden))}get hidden(){return this._hidden.asObservable()}get shown(){return this._windowCmptRef.instance.shown.asObservable()}close(t){this._windowCmptRef&&(this._closed.next(t),this._resolve(t),this._removeModalElements())}_dismiss(t){this._dismissed.next(t),this._reject(t),this._removeModalElements()}dismiss(t){if(this._windowCmptRef)if(this._beforeDismiss){const e=this._beforeDismiss();e&&e.then?e.then(e=>{!1!==e&&this._dismiss(t)},()=>{}):!1!==e&&this._dismiss(t)}else this._dismiss(t)}_removeModalElements(){const t=this._windowCmptRef.instance.hide(),e=this._backdropCmptRef?this._backdropCmptRef.instance.hide():qu(void 0);t.subscribe(()=>{const{nativeElement:t}=this._windowCmptRef.location;t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._contentRef=null}),e.subscribe(()=>{if(this._backdropCmptRef){const{nativeElement:t}=this._backdropCmptRef.location;t.parentNode.removeChild(t),this._backdropCmptRef.destroy(),this._backdropCmptRef=null}}),xm(t,e).subscribe(()=>{this._hidden.next(),this._hidden.complete()})}}var fy=function(t){return t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC",t}({});let gy=(()=>{class t{constructor(t,e,n){this._document=t,this._elRef=e,this._zone=n,this._closed$=new S,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new Wa,this.shown=new S,this.hidden=new S}dismiss(t){this.dismissEvent.emit(t)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){this._show()}ngOnDestroy(){this._disableEventHandling()}hide(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"stop"},n=xm(qm(this._zone,t,()=>t.classList.remove("show"),e),qm(this._zone,this._dialogEl.nativeElement,()=>{},e));return n.subscribe(()=>{this.hidden.next(),this.hidden.complete()}),this._disableEventHandling(),this._restoreFocus(),n}_show(){const t={animation:this.animation,runningTransition:"continue"};xm(qm(this._zone,this._elRef.nativeElement,(t,e)=>{e&&Lm(t),t.classList.add("show")},t),qm(this._zone,this._dialogEl.nativeElement,()=>{},t)).subscribe(()=>{this.shown.next(),this.shown.complete()}),this._enableEventHandling(),this._setFocus()}_enableEventHandling(){const{nativeElement:t}=this._elRef;this._zone.runOutsideAngular(()=>{bm(t,"keydown").pipe(Rm(this._closed$),gh(t=>t.which===ey.Escape)).subscribe(t=>{this.keyboard?requestAnimationFrame(()=>{t.defaultPrevented||this._zone.run(()=>this.dismiss(fy.ESC))}):"static"===this.backdrop&&this._bumpBackdrop()});let e=!1;bm(this._dialogEl.nativeElement,"mousedown").pipe(Rm(this._closed$),Nh(()=>e=!1),ih(()=>bm(t,"mouseup").pipe(Rm(this._closed$),ch(1))),gh(({target:e})=>t===e)).subscribe(()=>{e=!0}),bm(t,"click").pipe(Rm(this._closed$)).subscribe(({target:n})=>{t===n&&("static"===this.backdrop?this._bumpBackdrop():!0!==this.backdrop||e||this._zone.run(()=>this.dismiss(fy.BACKDROP_CLICK))),e=!1})})}_disableEventHandling(){this._closed$.next()}_setFocus(){const{nativeElement:t}=this._elRef;if(!t.contains(document.activeElement)){const e=t.querySelector("[ngbAutofocus]"),n=ry(t)[0];(e||n||t).focus()}}_restoreFocus(){const t=this._document.body,e=this._elWithFocus;let n;n=e&&e.focus&&t.contains(e)?e:t,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null})}_bumpBackdrop(){"static"===this.backdrop&&qm(this._zone,this._elRef.nativeElement,({classList:t})=>(t.add("modal-static"),()=>t.remove("modal-static")),{animation:this.animation,runningTransition:"continue"})}}return t.\u0275fac=function(e){return new(e||t)(ji(ac),ji($o),ji(Ol))},t.\u0275cmp=$t({type:t,selectors:[["ngb-modal-window"]],viewQuery:function(t,e){if(1&t&&sl(Fm,3),2&t){let t;rl(t=il())&&(e._dialogEl=t.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:7,hostBindings:function(t,e){2&t&&(Di("aria-modal",!0)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),io("modal d-block"+(e.windowClass?" "+e.windowClass:"")),so("fade",e.animation))},inputs:{backdrop:"backdrop",keyboard:"keyboard",animation:"animation",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass",modalDialogClass:"modalDialogClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:Vm,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(t,e){1&t&&(Qi(),Ui(0,"div",0,1),Ui(2,"div",2),Ki(3),Li(),Li()),2&t&&io("modal-dialog"+(e.size?" modal-"+e.size:"")+(e.centered?" modal-dialog-centered":"")+(e.scrollable?" modal-dialog-scrollable":"")+(e.modalDialogClass?" "+e.modalDialogClass:""))},styles:["ngb-modal-window .component-host-scrollable{display:flex;flex-direction:column;overflow:hidden}"],encapsulation:2}),t})(),my=(()=>{class t{constructor(t,e,n,r,s,i){this._applicationRef=t,this._injector=e,this._document=n,this._scrollBar=r,this._rendererFactory=s,this._ngZone=i,this._activeWindowCmptHasChanged=new S,this._ariaHiddenValues=new Map,this._backdropAttributes=["animation","backdropClass"],this._modalRefs=[],this._windowAttributes=["animation","ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new Wa,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const t=this._windowCmpts[this._windowCmpts.length-1];((t,e,n,r=!1)=>{this._ngZone.runOutsideAngular(()=>{const t=bm(e,"focusin").pipe(Rm(n),k(t=>t.target));bm(e,"keydown").pipe(Rm(n),gh(t=>t.which===ey.Tab),Dm(t)).subscribe(([t,n])=>{const[r,s]=ry(e);n!==r&&n!==e||!t.shiftKey||(s.focus(),t.preventDefault()),n!==s||t.shiftKey||(r.focus(),t.preventDefault())}),r&&bm(e,"click").pipe(Rm(n),Dm(t),k(t=>t[1])).subscribe(t=>t.focus())})})(0,t.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(t.location.nativeElement)}})}open(t,e,n,r){const s=r.container instanceof HTMLElement?r.container:Um(r.container)?this._document.querySelector(r.container):this._document.body,i=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(i.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!s)throw new Error(`The specified modal container "${r.container||"body"}" was not found in the DOM.`);const l=new dy,c=this._getContentRef(t,r.injector||e,n,l,r);let u=!1!==r.backdrop?this._attachBackdrop(t,s):void 0,h=this._attachWindowComponent(t,s,c),d=new py(h,c,u,r.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(h),d.result.then(o,o),d.result.then(a,a),l.close=t=>{d.close(t)},l.dismiss=t=>{d.dismiss(t)},this._applyWindowOptions(h.instance,r),1===this._modalRefs.length&&i.addClass(this._document.body,"modal-open"),u&&u.instance&&this._applyBackdropOptions(u.instance,r),d}get activeInstances(){return this._activeInstances}dismissAll(t){this._modalRefs.forEach(e=>e.dismiss(t))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(t,e){let n=t.resolveComponentFactory(hy).create(this._injector);return this._applicationRef.attachView(n.hostView),e.appendChild(n.location.nativeElement),n}_attachWindowComponent(t,e,n){let r=t.resolveComponentFactory(gy).create(this._injector,n.nodes);return this._applicationRef.attachView(r.hostView),e.appendChild(r.location.nativeElement),r}_applyWindowOptions(t,e){this._windowAttributes.forEach(n=>{Um(e[n])&&(t[n]=e[n])})}_applyBackdropOptions(t,e){this._backdropAttributes.forEach(n=>{Um(e[n])&&(t[n]=e[n])})}_getContentRef(t,e,n,r,s){return n?n instanceof ba?this._createFromTemplateRef(n,r):"string"==typeof n?this._createFromString(n):this._createFromComponent(t,e,n,r,s):new ly([])}_createFromTemplateRef(t,e){const n=t.createEmbeddedView({$implicit:e,close(t){e.close(t)},dismiss(t){e.dismiss(t)}});return this._applicationRef.attachView(n),new ly([n.rootNodes],n)}_createFromString(t){const e=this._document.createTextNode(`${t}`);return new ly([[e]])}_createFromComponent(t,e,n,r,s){const i=t.resolveComponentFactory(n),o=_i.create({providers:[{provide:dy,useValue:r}],parent:e}),a=i.create(o),l=a.location.nativeElement;return s.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(a.hostView),new ly([[l]],a.hostView,a)}_setAriaHidden(t){const e=t.parentElement;e&&t!==this._document.body&&(Array.from(e.children).forEach(e=>{e!==t&&"SCRIPT"!==e.nodeName&&(this._ariaHiddenValues.set(e,e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),this._setAriaHidden(e))}_revertAriaHidden(){this._ariaHiddenValues.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(t){const e=()=>{const e=this._modalRefs.indexOf(t);e>-1&&(this._modalRefs.splice(e,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(t),this._activeInstances.emit(this._modalRefs),t.result.then(e,e)}_registerWindowCmpt(t){this._windowCmpts.push(t),this._activeWindowCmptHasChanged.next(),t.onDestroy(()=>{const e=this._windowCmpts.indexOf(t);e>-1&&(this._windowCmpts.splice(e,1),this._activeWindowCmptHasChanged.next())})}}return t.\u0275fac=function(e){return new(e||t)(lr(Yl),lr(_i),lr(ac),lr(uy),lr(Bo),lr(Ol))},t.\u0275prov=ut({factory:function(){return new t(lr(Yl),lr(ni),lr(ac),lr(uy),lr(Bo),lr(Ol))},token:t,providedIn:"root"}),t})(),yy=(()=>{class t{constructor(t,e,n,r){this._moduleCFR=t,this._injector=e,this._modalStack=n,this._config=r}open(t,e={}){const n=Object.assign(Object.assign(Object.assign({},this._config),{animation:this._config.animation}),e);return this._modalStack.open(this._moduleCFR,this._injector,t,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(t){this._modalStack.dismissAll(t)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return t.\u0275fac=function(e){return new(e||t)(lr(Fo),lr(_i),lr(my),lr(ay))},t.\u0275prov=ut({factory:function(){return new t(lr(Fo),lr(ni),lr(my),lr(ay))},token:t,providedIn:"root"}),t})(),_y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({providers:[yy]}),t})(),by=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),vy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),wy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Cy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Sy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),xy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),Ey=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})(),ky=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({}),t})();new Bn("live announcer delay",{providedIn:"root",factory:function(){return 100}});let Ty=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[[fu]]}),t})();const Ay=[Gm,Km,Jm,Xm,ty,sy,oy,_y,by,vy,wy,Cy,Sy,xy,Ey,ky,Ty];let Oy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({imports:[Ay,Gm,Km,Jm,Xm,ty,sy,oy,_y,by,vy,wy,Cy,Sy,xy,Ey,ky,Ty]}),t})();class Ry{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new Iy(t,this.dueTime,this.scheduler))}}class Iy extends f{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Py,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Py(t){t.debouncedNext()}let Dy=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}save(){this.activeModal.close(this.rewindDate)}}return t.\u0275fac=function(e){return new(e||t)(ji(dy))},t.\u0275cmp=$t({type:t,selectors:[["app-rewind-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:3,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["for","rewindDate"],[1,"input-group"],["id","rewindDate","placeholder","yyyy-mm-dd hh:MM:ss","type","datetime-local",1,"form-control",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Rewind consumers offset"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"label",6),mo(9,"Select the datetime to rewind all the partition-offsets of consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' "),Li(),Ui(16,"div",7),Ui(17,"input",8),Wi("ngModelChange",function(t){return e.rewindDate=t}),Li(),Li(),Li(),Li(),Ui(18,"div",9),Ui(19,"button",10),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"Cancel"),Li(),Ui(21,"button",11),Wi("click",function(){return e.save()}),mo(22,"OK"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""),cs(3),Vi("ngModel",e.rewindDate))},directives:[jf,Kf,mg],encapsulation:2}),t})(),Ny=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){this.oldWorkersCount=this.workersCount}save(){this.activeModal.close(this.workersCount)}}return t.\u0275fac=function(e){return new(e||t)(ji(dy))},t.\u0275cmp=$t({type:t,selectors:[["app-workers-count-modal"]],inputs:{workersCount:"workersCount",groupId:"groupId",consumerName:"consumerName"},decls:28,vars:4,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],["for","oldWorkersCount"],[1,"input-group","mb-2"],["id","oldWorkersCount","type","number","readonly","",1,"form-control",3,"ngModel","ngModelChange"],["for","workersCount"],[1,"input-group"],["id","workersCount","type","number",1,"form-control",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Consumer workers running"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"label"),mo(9,"Update the number of workers in consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),Li(),Ui(15,"label",6),mo(16,"Current Value"),Li(),Ui(17,"div",7),Ui(18,"input",8),Wi("ngModelChange",function(t){return e.oldWorkersCount=t}),Li(),Li(),Ui(19,"label",9),mo(20,"New Value"),Li(),Ui(21,"div",10),Ui(22,"input",11),Wi("ngModelChange",function(t){return e.workersCount=t}),Li(),Li(),Li(),Li(),Ui(23,"div",12),Ui(24,"button",13),Wi("click",function(){return e.activeModal.dismiss()}),mo(25,"Cancel"),Li(),Ui(26,"button",14),Wi("click",function(){return e.save()}),mo(27,"OK"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,"'"),cs(4),Vi("ngModel",e.oldWorkersCount),cs(4),Vi("ngModel",e.workersCount))},directives:[_g,jf,Kf,mg],encapsulation:2}),t})(),My=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(dy))},t.\u0275cmp=$t({type:t,selectors:[["app-reset-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Reset consumers offset"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Reset the offset you generate a huge lag to consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"'. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),jy=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(dy))},t.\u0275cmp=$t({type:t,selectors:[["app-pause-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Pause consumers"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Pause the consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' will interrupt the kafka data processing and, probably, generate lag. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),Vy=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(dy))},t.\u0275cmp=$t({type:t,selectors:[["app-resume-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Resume consumers"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Resume the consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' will restart to process the messages. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),Fy=(()=>{class t{constructor(t){this.activeModal=t}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(dy))},t.\u0275cmp=$t({type:t,selectors:[["app-restart-modal"]],inputs:{groupId:"groupId",consumerName:"consumerName"},decls:23,vars:2,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"form-group"],[1,"mt-3"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-dark",3,"click"],["type","button",1,"btn","btn-success",3,"click"]],template:function(t,e){1&t&&(Ui(0,"div",0),Ui(1,"h4",1),mo(2,"Restart consumers"),Li(),Ui(3,"button",2),Wi("click",function(){return e.activeModal.dismiss()}),Ui(4,"span",3),mo(5,"\xd7"),Li(),Li(),Li(),Ui(6,"div",4),Ui(7,"div",5),Ui(8,"span"),mo(9,"Restart the consumers "),Ui(10,"b"),mo(11),Li(),mo(12," from group id "),Ui(13,"b"),mo(14),Li(),mo(15,"' will can generate a temporary instability in your system. "),Li(),Ui(16,"h5",6),mo(17,"Are you really sure about it?"),Li(),Li(),Li(),Ui(18,"div",7),Ui(19,"button",8),Wi("click",function(){return e.activeModal.dismiss()}),mo(20,"No, cancel"),Li(),Ui(21,"button",9),Wi("click",function(){return e.activeModal.close()}),mo(22,"Yes"),Li(),Li()),2&t&&(cs(11),_o("'",e.consumerName,"'"),cs(3),_o("'",e.groupId,""))},encapsulation:2}),t})(),Uy=(()=>{class t{transform(t,e){return t&&e?t.filter(t=>e(t)):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Yt({name:"callback",type:t,pure:!1}),t})(),Ly=(()=>{class t{transform(t,e){if(!t)return null;const n=t.reduce((t,n)=>(t[n[e]]?t[n[e]].push(n):t[n[e]]=[n],t),{});return Object.keys(n).map(t=>({key:t,value:n[t]}))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Yt({name:"groupBy",type:t,pure:!0}),t})(),Hy=(()=>{class t{transform(t,e,n="asc"){return"asc"!=(n=n.toLowerCase())&&"desc"!=n?t:Array.isArray(t)?(t.sort((t,r)=>t[e]r[e]?"asc"==n?1:-1:0),t):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Yt({name:"sort",type:t,pure:!0}),t})();const $y=["successAlert"];function zy(t,e){if(1&t){const t=$i();Ui(0,"ngb-alert",2,3),Wi("closed",function(){return Pe(t),Zi().successMessage=""}),Ui(2,"div",4),Ui(3,"b"),mo(4,"Success! "),Li(),Ui(5,"span",4),mo(6),Li(),Li(),Li()}if(2&t){const t=Zi();cs(6),yo(t.successMessage)}}function By(t,e){if(1&t){const t=$i();Ui(0,"button",18),Wi("click",function(){Pe(t);const e=Zi().$implicit,n=Zi().$implicit;return Zi().openResumeModal(n.groupId,e.consumerName)}),mo(1,"Resume"),Li()}}function Wy(t,e){if(1&t){const t=$i();Ui(0,"button",19),Wi("click",function(){Pe(t);const e=Zi().$implicit,n=Zi().$implicit;return Zi().openPauseModal(n.groupId,e.consumerName)}),mo(1,"Pause"),Li()}}function qy(t,e){1&t&&Hi(0,"div")}function Gy(t,e){1&t&&(Ui(0,"span"),mo(1,"-"),Li())}function Zy(t,e){1&t&&(Ui(0,"span",27),mo(1,"Paused"),Li())}function Yy(t,e){if(1&t&&(Ui(0,"tr"),Ui(1,"td",23),mo(2),Li(),Ui(3,"td",23),mo(4),Li(),Ui(5,"td",23),Ni(6,qy,1,0,"div",24),Ni(7,Gy,2,0,"ng-template",null,25,al),Ni(9,Zy,2,0,"ng-template",null,26,al),Li(),Ui(11,"td",23),Ui(12,"span",9),mo(13),$a(14,"date"),Li(),Li(),Li()),2&t){const t=Mi(8),e=Mi(10),n=Zi().$implicit;cs(2),yo(n.hostName),cs(2),yo(n.pausedPartitions),cs(2),Vi("ngIf",n.isLost)("ngIfThen",t)("ngIfElse",e),cs(6),Vi("ngClass",n.isLost?"text-secondary":"text-success"),cs(1),yo(za(14,7,n.lastUpdate,"medium"))}}function Qy(t,e){1&t&&Hi(0,"div")}function Ky(t,e){1&t&&(Ui(0,"span"),mo(1,"-"),Li())}function Jy(t,e){1&t&&(Ui(0,"span",28),mo(1,"Running"),Li())}function Xy(t,e){if(1&t&&(Ui(0,"tr"),Ui(1,"td",23),mo(2),Li(),Ui(3,"td",23),mo(4),Li(),Ui(5,"td",23),Ni(6,Qy,1,0,"div",24),Ni(7,Ky,2,0,"ng-template",null,25,al),Ni(9,Jy,2,0,"ng-template",null,26,al),Li(),Ui(11,"td",23),Ui(12,"span",9),mo(13),$a(14,"date"),Li(),Li(),Li()),2&t){const t=Mi(8),e=Mi(10),n=Zi().$implicit;cs(2),yo(n.hostName),cs(2),yo(n.runningPartitions),cs(2),Vi("ngIf",n.isLost)("ngIfThen",t)("ngIfElse",e),cs(6),Vi("ngClass",n.isLost?"text-secondary":"text-success"),cs(1),yo(za(14,7,n.lastUpdate,"medium"))}}function t_(t,e){if(1&t&&(Ni(0,Yy,15,10,"ng-template",22),Ni(1,Xy,15,10,"ng-template",22)),2&t){const t=e.$implicit;Vi("ngIf",(null==t.pausedPartitions?null:t.pausedPartitions.length)>0),cs(1),Vi("ngIf",(null==t.runningPartitions?null:t.runningPartitions.length)>0)}}function e_(t,e){if(1&t&&(Ui(0,"p",20),mo(1),Li(),Ui(2,"table",21),Ui(3,"thead"),Ui(4,"tr"),Ui(5,"th"),mo(6,"Hostname - consumer instance"),Li(),Ui(7,"th"),mo(8,"Partitions"),Li(),Ui(9,"th"),mo(10,"Status"),Li(),Ui(11,"th"),mo(12,"LastUpdate"),Li(),Li(),Li(),Ui(13,"tbody"),Ni(14,t_,2,2,"ng-template",17),$a(15,"sort"),Li(),Li()),2&t){const t=e.$implicit;cs(1),_o("Topic: ",t.key,""),cs(13),Vi("ngForOf",za(15,2,t.value,"hostName"))}}const n_=function(t,e,n){return{"text-success":t,"text-warning":e,"text-danger":n}};function r_(t,e){if(1&t){const t=$i();Ui(0,"div"),Ui(1,"h4"),mo(2),Li(),Ui(3,"h4"),mo(4,"Status: "),Ui(5,"span",9),mo(6),Li(),Li(),Ui(7,"h4"),mo(8),Li(),Ui(9,"div",10),Ni(10,By,2,0,"button",11),Ni(11,Wy,2,0,"button",12),Ui(12,"button",13),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openRestartModal(r.groupId,n.consumerName)}),mo(13,"Restart"),Li(),Ui(14,"button",14),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openRewindModal(r.groupId,n.consumerName)}),mo(15,"Rewind Offset"),Li(),Ui(16,"button",15),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openResetModal(r.groupId,n.consumerName)}),mo(17,"Reset Offset"),Li(),Ui(18,"button",16),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openWorkersCountModal(r.groupId,n.consumerName,n.workersCount)}),mo(19,"Update number of workers"),Li(),Li(),Ni(20,e_,16,5,"ng-template",17),$a(21,"groupBy"),Hi(22,"hr"),Li()}if(2&t){const t=e.$implicit;cs(2),_o("Consumer: ",t.consumerName,""),cs(3),Vi("ngClass",(n=10,r=n_,s="Running"==t.status,i="Paused"==t.status,o="Not Running"==t.status,function(t,e,n,r,s,i,o,a){const l=e+n;return function(t,e,n,r,s){const i=Pi(t,e,n,r);return Ii(t,e+2,s)||i}(t,l,s,i,o)?Ri(t,l+3,a?r.call(a,s,i,o):r(s,i,o)):Ha(t,l+3)}(Re(),Le(),n,r,s,i,o,a))),cs(1),yo(t.status),cs(2),_o("Workers: ",t.workersCount,""),cs(2),Vi("ngIf","Paused"==t.status),cs(1),Vi("ngIf","Running"==t.status),cs(9),Vi("ngForOf",za(21,7,t.partitionAssignments,"topic"))}var n,r,s,i,o,a}function s_(t,e){if(1&t&&(Ui(0,"div",5),Ui(1,"div",6),Ui(2,"div",7),Ui(3,"h3"),mo(4),Li(),Ni(5,r_,23,14,"div",8),Li(),Li(),Li()),2&t){const t=e.$implicit;cs(4),_o("Group Id: ",t.groupId,""),cs(1),Vi("ngForOf",t.consumers)}}let i_=(()=>{class t{constructor(t,e){this.modalService=t,this.consumerService=e,this.groups=[],this.successSubject=new S,this.delayMs=1e3,this.successMessage=""}removeReadonly(t){return!(1==t.consumers.length&&1==t.consumers[0].isReadonly)}openWorkersCountModal(t,e,n){const r=this.modalService.open(Ny);r.componentInstance.groupId=t,r.componentInstance.consumerName=e,r.componentInstance.workersCount=n,r.result.then(n=>{this.consumerService.updateWorkersCount(t,e,n).subscribe({next:t=>this.successSubject.next("The number of workers was updated successfully")})})}openResetModal(t,e){const n=this.modalService.open(My);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.resetOffset(t,e).subscribe(t=>this.successSubject.next("The partition-offsets of your consumer were reseted successfully"))})}openPauseModal(t,e){const n=this.modalService.open(jy);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.pause(t,e).subscribe(t=>this.successSubject.next("Your consumer was paused successfully"))})}openRestartModal(t,e){const n=this.modalService.open(Fy);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.restart(t,e).subscribe(t=>this.successSubject.next("Your consumer was restarted successfully"))})}openResumeModal(t,e){const n=this.modalService.open(Vy);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.resume(t,e).subscribe(t=>this.successSubject.next("Your consumer was resumed successfully"))})}openRewindModal(t,e){const n=this.modalService.open(Dy);n.componentInstance.consumerName=e,n.componentInstance.groupId=t,n.result.then(n=>{this.consumerService.rewindOffset(t,e,new Date(n)).subscribe(t=>this.successSubject.next("The partition-offset of your consumer were rewinded successfully"))})}ngOnInit(){this.successSubject.subscribe(t=>this.successMessage=t),this.successSubject.pipe(function(t,e=Vg){return n=>n.lift(new Ry(t,e))}(5e3)).subscribe(()=>{var t;null===(t=this.successAlert)||void 0===t||t.close()})}}return t.\u0275fac=function(e){return new(e||t)(ji(yy),ji(_m))},t.\u0275cmp=$t({type:t,selectors:[["app-consumer"]],viewQuery:function(t,e){if(1&t&&sl($y,1),2&t){let t;rl(t=il())&&(e.successAlert=t.first)}},inputs:{groups:"groups"},decls:3,vars:5,consts:[["type","success",3,"closed",4,"ngIf"],["class","container",4,"ngFor","ngForOf"],["type","success",3,"closed"],["successAlert",""],[1,"text-center"],[1,"container"],[1,"card","my-3"],[1,"card-body"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"mt-3","mb-3"],["class","btn btn-outline-success","type","button",3,"click",4,"ngIf"],["class","btn btn-outline-warning ml-2","type","button",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-danger","ml-2",3,"click"],["type","button",1,"btn","btn-outline-info","ml-2",3,"click"],["type","button",1,"btn","btn-outline-secondary","ml-2",3,"click"],["type","button",1,"btn","btn-outline-success","ml-2",3,"click"],["ngFor","",3,"ngForOf"],["type","button",1,"btn","btn-outline-success",3,"click"],["type","button",1,"btn","btn-outline-warning","ml-2",3,"click"],[1,"mb-0","font-weight-bold"],[1,"table","table-striped","table-hover","mt-1"],[3,"ngIf"],[1,"text-left"],[4,"ngIf","ngIfThen","ngIfElse"],["consumer_lost",""],["consumer_on",""],[1,"font-weight-bold","text-warning"],[1,"font-weight-bold","text-success"]],template:function(t,e){1&t&&(Ni(0,zy,7,1,"ngb-alert",0),Ni(1,s_,6,2,"div",1),$a(2,"callback")),2&t&&(Vi("ngIf",e.successMessage),cs(1),Vi("ngForOf",za(2,2,e.groups,e.removeReadonly)))},directives:[uu,lu,Qm,ou],pipes:[Uy,Ly,Hy,pu],encapsulation:2}),t})(),o_=(()=>{class t{constructor(t){this.consumerService=t,this.groups=[],function(t=0,e=Vg){return(!Fg(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=Vg),new _(n=>(n.add(e.schedule(Ug,t,{subscriber:n,counter:0,period:t})),n))}(1e3).subscribe(e=>t.get().subscribe(t=>this.groups=this.buildCalculatedProperties(t)))}buildCalculatedProperties(t){var e=this;return t.forEach(function(t){t.consumers.forEach(function(t){t.status=t.partitionAssignments.some(function(t){var n;return(null===(n=t.runningPartitions)||void 0===n?void 0:n.length)>0&&e.isActive(t.lastUpdate)})?"Running":t.partitionAssignments.some(function(t){var n;return(null===(n=t.pausedPartitions)||void 0===n?void 0:n.length)>0&&e.isActive(t.lastUpdate)})?"Paused":"Not Running",t.partitionAssignments.forEach(function(t){t.isLost=!e.isActive(t.lastUpdate)})})}),t}isActive(t){return Math.abs(((new Date).getTime()-new Date(t).getTime())/1e3)<5}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)(ji(_m))},t.\u0275cmp=$t({type:t,selectors:[["app-home"]],decls:12,vars:1,consts:[[1,"navbar","navbar-expand-lg","navbar-light","bg-light"],[1,"container-fluid"],["href","#",1,"navbar-brand"],["type","button","data-bs-toggle","collapse","data-bs-target","#navbarSupportedContent","aria-controls","navbarSupportedContent","aria-expanded","false","aria-label","Toggle navigation",1,"navbar-toggler"],[1,"navbar-toggler-icon"],["id","navbarSupportedContent",1,"collapse","navbar-collapse"],[1,"navbar-nav","me-auto","mb-2","mb-lg-0"],[1,"nav-item"],["aria-current","page","href","#",1,"nav-link","active"],[3,"groups"]],template:function(t,e){1&t&&(Ui(0,"nav",0),Ui(1,"div",1),Ui(2,"a",2),mo(3,"KafkaFlow - Dashboard"),Li(),Ui(4,"button",3),Hi(5,"span",4),Li(),Ui(6,"div",5),Ui(7,"ul",6),Ui(8,"li",7),Ui(9,"a",8),mo(10,"Consumers"),Li(),Li(),Li(),Li(),Li(),Li(),Hi(11,"app-consumer",9)),2&t&&(cs(11),Vi("groups",e.groups))},directives:[iy,i_],encapsulation:2}),t})();class a_{constructor(t,e){this.count=t,this.source=e}call(t,e){return e.subscribe(new l_(t,this.count,this.source))}}class l_ extends f{constructor(t,e,n){super(t),this.count=e,this.source=n}error(t){if(!this.isStopped){const{source:e,count:n}=this;if(0===n)return super.error(t);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}}}class c_{intercept(t,e){return e.handle(t).pipe(function(t=-1){return e=>e.lift(new a_(t,e))}(1),_h(t=>{let e="";return e=t.error instanceof ErrorEvent?`Error: ${t.error.message}`:`Error Code: ${t.status}\nMessage: ${t.message}`,console.error(e),function(t,e){return new _(e=>e.error(t))}(e)}))}}const u_={validation:!1},h_=[{path:"",component:o_}];let d_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t,bootstrap:[Pg]}),t.\u0275inj=ht({providers:[_m,{provide:sm,useClass:c_,multi:!0}],imports:[[Wu,Ig,Cf.forRoot(h_),ym,wg,Oy,Tg.forRoot(u_)],Cf]}),t})();(function(){if($l)throw new Error("Cannot enable prod mode after platform setup.");Hl=!1} +const Ry=new Bn("XSRF_COOKIE_NAME"),Iy=new Bn("XSRF_HEADER_NAME");class Py{}let Dy=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=iu(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(lr(ac),lr(fl),lr(Ry))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),Ny=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const r=this.tokenService.getToken();return null===r||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,r)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(lr(Py),lr(Iy))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),My=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(xy,[]);this.chain=t.reduceRight((t,e)=>new Sy(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(lr(ay),lr(_i))},t.\u0275prov=ut({token:t,factory:t.\u0275fac}),t})(),jy=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:Ny,useClass:Ey}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:Ry,useValue:e.cookieName}:[],e.headerName?{provide:Iy,useValue:e.headerName}:[]]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({providers:[Ny,{provide:xy,useExisting:Ny,multi:!0},{provide:Py,useClass:Dy},{provide:Ry,useValue:"XSRF-TOKEN"},{provide:Iy,useValue:"X-XSRF-TOKEN"}]}),t})(),Vy=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t}),t.\u0275inj=ht({providers:[Cy,{provide:oy,useClass:My},Oy,{provide:ay,useExisting:Oy},Ay,{provide:Ty,useExisting:Ay}],imports:[[jy.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})(),Fy=(()=>{class t{constructor(t){this.http=t,this.accessPointUrl="/kafka-flow",this.headers=new ly({"Content-Type":"application/json; charset=utf-8"})}get(){return this.http.get(this.accessPointUrl+"/telemetry",{headers:this.headers})}updateWorkersCount(t,e,n){return this.http.post(this.accessPointUrl+`/groups/${t}/consumers/${e}/change-worker-count`,{workersCount:n},{headers:this.headers})}resetOffset(t,e){return this.http.post(this.accessPointUrl+`/groups/${t}/consumers/${e}/reset-offsets`,{confirm:!0},{headers:this.headers})}pause(t,e){return this.http.post(this.accessPointUrl+`/groups/${t}/consumers/${e}/pause`,null,{headers:this.headers})}restart(t,e){return this.http.post(this.accessPointUrl+`/groups/${t}/consumers/${e}/restart`,null,{headers:this.headers})}resume(t,e){return this.http.post(this.accessPointUrl+`/groups/${t}/consumers/${e}/resume`,null,{headers:this.headers})}rewindOffset(t,e,n){return this.http.post(this.accessPointUrl+`/groups/${t}/consumers/${e}/rewind-offsets-to-date`,{date:new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString()},{headers:this.headers})}}return t.\u0275fac=function(e){return new(e||t)(lr(Cy))},t.\u0275prov=ut({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),Uy=(()=>{class t{transform(t,e){return t&&e?t.filter(t=>e(t)):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Yt({name:"callback",type:t,pure:!1}),t})(),Ly=(()=>{class t{transform(t,e){if(!t)return null;const n=t.reduce((t,n)=>(t[n[e]]?t[n[e]].push(n):t[n[e]]=[n],t),{});return Object.keys(n).map(t=>({key:t,value:n[t]}))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Yt({name:"groupBy",type:t,pure:!0}),t})(),Hy=(()=>{class t{transform(t,e,n="asc"){return"asc"!=(n=n.toLowerCase())&&"desc"!=n?t:Array.isArray(t)?(t.sort((t,r)=>t[e]r[e]?"asc"==n?1:-1:0),t):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Yt({name:"sort",type:t,pure:!0}),t})();const $y=["successAlert"];function zy(t,e){if(1&t){const t=$i();Ui(0,"ngb-alert",2,3),Wi("closed",function(){return Pe(t),Zi().successMessage=""}),Ui(2,"div",4),Ui(3,"b"),mo(4,"Success! "),Li(),Ui(5,"span",4),mo(6),Li(),Li(),Li()}if(2&t){const t=Zi();cs(6),yo(t.successMessage)}}function By(t,e){if(1&t){const t=$i();Ui(0,"button",18),Wi("click",function(){Pe(t);const e=Zi().$implicit,n=Zi().$implicit;return Zi().openResumeModal(n.groupId,e.consumerName)}),mo(1,"Resume"),Li()}}function Wy(t,e){if(1&t){const t=$i();Ui(0,"button",19),Wi("click",function(){Pe(t);const e=Zi().$implicit,n=Zi().$implicit;return Zi().openPauseModal(n.groupId,e.consumerName)}),mo(1,"Pause"),Li()}}function qy(t,e){1&t&&Hi(0,"div")}function Gy(t,e){1&t&&(Ui(0,"span"),mo(1,"-"),Li())}function Zy(t,e){1&t&&(Ui(0,"span",27),mo(1,"Paused"),Li())}function Yy(t,e){if(1&t&&(Ui(0,"tr"),Ui(1,"td",23),mo(2),Li(),Ui(3,"td",23),mo(4),Li(),Ui(5,"td",23),Ni(6,qy,1,0,"div",24),Ni(7,Gy,2,0,"ng-template",null,25,al),Ni(9,Zy,2,0,"ng-template",null,26,al),Li(),Ui(11,"td",23),Ui(12,"span",9),mo(13),$a(14,"date"),Li(),Li(),Li()),2&t){const t=Mi(8),e=Mi(10),n=Zi().$implicit;cs(2),yo(n.instanceName),cs(2),yo(n.pausedPartitions),cs(2),Vi("ngIf",n.isLost)("ngIfThen",t)("ngIfElse",e),cs(6),Vi("ngClass",n.isLost?"text-secondary":"text-success"),cs(1),yo(za(14,7,n.lastUpdate,"medium"))}}function Qy(t,e){1&t&&Hi(0,"div")}function Ky(t,e){1&t&&(Ui(0,"span"),mo(1,"-"),Li())}function Jy(t,e){1&t&&(Ui(0,"span",28),mo(1,"Running"),Li())}function Xy(t,e){if(1&t&&(Ui(0,"tr"),Ui(1,"td",23),mo(2),Li(),Ui(3,"td",23),mo(4),Li(),Ui(5,"td",23),Ni(6,Qy,1,0,"div",24),Ni(7,Ky,2,0,"ng-template",null,25,al),Ni(9,Jy,2,0,"ng-template",null,26,al),Li(),Ui(11,"td",23),Ui(12,"span",9),mo(13),$a(14,"date"),Li(),Li(),Li()),2&t){const t=Mi(8),e=Mi(10),n=Zi().$implicit;cs(2),yo(n.hostName),cs(2),yo(n.runningPartitions),cs(2),Vi("ngIf",n.isLost)("ngIfThen",t)("ngIfElse",e),cs(6),Vi("ngClass",n.isLost?"text-secondary":"text-success"),cs(1),yo(za(14,7,n.lastUpdate,"medium"))}}function t_(t,e){if(1&t&&(Ni(0,Yy,15,10,"ng-template",22),Ni(1,Xy,15,10,"ng-template",22)),2&t){const t=e.$implicit;Vi("ngIf",(null==t.pausedPartitions?null:t.pausedPartitions.length)>0),cs(1),Vi("ngIf",(null==t.runningPartitions?null:t.runningPartitions.length)>0)}}function e_(t,e){if(1&t&&(Ui(0,"p",20),mo(1),Li(),Ui(2,"table",21),Ui(3,"thead"),Ui(4,"tr"),Ui(5,"th"),mo(6,"Hostname - consumer instance"),Li(),Ui(7,"th"),mo(8,"Partitions"),Li(),Ui(9,"th"),mo(10,"Status"),Li(),Ui(11,"th"),mo(12,"LastUpdate"),Li(),Li(),Li(),Ui(13,"tbody"),Ni(14,t_,2,2,"ng-template",17),$a(15,"sort"),Li(),Li()),2&t){const t=e.$implicit;cs(1),_o("Topic: ",t.key,""),cs(13),Vi("ngForOf",za(15,2,t.value,"instanceName"))}}const n_=function(t,e,n){return{"text-success":t,"text-warning":e,"text-danger":n}};function r_(t,e){if(1&t){const t=$i();Ui(0,"div"),Ui(1,"h4"),mo(2),Li(),Ui(3,"h4"),mo(4,"Status: "),Ui(5,"span",9),mo(6),Li(),Li(),Ui(7,"h4"),mo(8),Li(),Ui(9,"div",10),Ni(10,By,2,0,"button",11),Ni(11,Wy,2,0,"button",12),Ui(12,"button",13),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openRestartModal(r.groupId,n.consumerName)}),mo(13,"Restart"),Li(),Ui(14,"button",14),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openRewindModal(r.groupId,n.consumerName)}),mo(15,"Rewind Offset"),Li(),Ui(16,"button",15),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openResetModal(r.groupId,n.consumerName)}),mo(17,"Reset Offset"),Li(),Ui(18,"button",16),Wi("click",function(){Pe(t);const n=e.$implicit,r=Zi().$implicit;return Zi().openWorkersCountModal(r.groupId,n.consumerName,n.workersCount)}),mo(19,"Update number of workers"),Li(),Li(),Ni(20,e_,16,5,"ng-template",17),$a(21,"groupBy"),Hi(22,"hr"),Li()}if(2&t){const t=e.$implicit;cs(2),_o("Consumer: ",t.consumerName,""),cs(3),Vi("ngClass",(n=10,r=n_,s="Running"==t.status,i="Paused"==t.status,o="Not Running"==t.status,function(t,e,n,r,s,i,o,a){const l=e+n;return function(t,e,n,r,s){const i=Pi(t,e,n,r);return Ii(t,e+2,s)||i}(t,l,s,i,o)?Ri(t,l+3,a?r.call(a,s,i,o):r(s,i,o)):Ha(t,l+3)}(Re(),Le(),n,r,s,i,o,a))),cs(1),yo(t.status),cs(2),_o("Workers: ",t.workersCount,""),cs(2),Vi("ngIf","Paused"==t.status),cs(1),Vi("ngIf","Running"==t.status),cs(9),Vi("ngForOf",za(21,7,t.partitionAssignments,"topic"))}var n,r,s,i,o,a}function s_(t,e){if(1&t&&(Ui(0,"div",5),Ui(1,"div",6),Ui(2,"div",7),Ui(3,"h3"),mo(4),Li(),Ni(5,r_,23,14,"div",8),Li(),Li(),Li()),2&t){const t=e.$implicit;cs(4),_o("Group Id: ",t.groupId,""),cs(1),Vi("ngForOf",t.consumers)}}let i_=(()=>{class t{constructor(t,e){this.modalService=t,this.consumerService=e,this.groups=[],this.successSubject=new S,this.delayMs=1e3,this.successMessage="",function(t=0,e=Ug){return(!Lg(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=Ug),new _(n=>(n.add(e.schedule(Qm,t,{subscriber:n,counter:0,period:t})),n))}(1e3).subscribe(t=>e.get().subscribe(t=>this.groups=this.enrichGroups(t)))}enrichGroups(t){var e=this;return t.forEach(function(t){t.consumers.forEach(function(t){t.status=t.partitionAssignments.some(t=>{var n;return(null===(n=t.runningPartitions)||void 0===n?void 0:n.length)>0&&e.isActive(t.lastUpdate)})?"Running":t.partitionAssignments.some(t=>{var n;return(null===(n=t.pausedPartitions)||void 0===n?void 0:n.length)>0&&e.isActive(t.lastUpdate)})?"Paused":"Not Running",t.partitionAssignments.forEach(t=>t.isLost=!e.isActive(t.lastUpdate))})}),t}isActive(t){return Math.abs(((new Date).getTime()-new Date(t).getTime())/1e3)<5}removeReadonly(t){return!(1==t.consumers[0].managementDisabled)}openWorkersCountModal(t,e,n){const r=this.modalService.open(ey);r.componentInstance.groupId=t,r.componentInstance.consumerName=e,r.componentInstance.workersCount=n,r.result.then(n=>{this.consumerService.updateWorkersCount(t,e,n).subscribe({next:t=>this.successSubject.next("The number of workers was updated successfully")})})}openResetModal(t,e){const n=this.modalService.open(ny);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.resetOffset(t,e).subscribe(t=>this.successSubject.next("The partition-offsets of your consumer were reseted successfully"))})}openPauseModal(t,e){const n=this.modalService.open(ry);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.pause(t,e).subscribe(t=>this.successSubject.next("Your consumer was paused successfully"))})}openRestartModal(t,e){const n=this.modalService.open(iy);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.restart(t,e).subscribe(t=>this.successSubject.next("Your consumer was restarted successfully"))})}openResumeModal(t,e){const n=this.modalService.open(sy);n.componentInstance.groupId=t,n.componentInstance.consumerName=e,n.result.then(n=>{this.consumerService.resume(t,e).subscribe(t=>this.successSubject.next("Your consumer was resumed successfully"))})}openRewindModal(t,e){const n=this.modalService.open(ty);n.componentInstance.consumerName=e,n.componentInstance.groupId=t,n.result.then(n=>{this.consumerService.rewindOffset(t,e,new Date(n)).subscribe(t=>this.successSubject.next("The partition-offset of your consumer were rewinded successfully"))})}ngOnInit(){this.successSubject.subscribe(t=>this.successMessage=t),this.successSubject.pipe(function(t,e=Ug){return n=>n.lift(new Km(t,e))}(5e3)).subscribe(()=>{var t;null===(t=this.successAlert)||void 0===t||t.close()})}}return t.\u0275fac=function(e){return new(e||t)(ji(Vm),ji(Fy))},t.\u0275cmp=$t({type:t,selectors:[["app-consumer"]],viewQuery:function(t,e){if(1&t&&sl($y,1),2&t){let t;rl(t=il())&&(e.successAlert=t.first)}},decls:3,vars:5,consts:[["type","success",3,"closed",4,"ngIf"],["class","container",4,"ngFor","ngForOf"],["type","success",3,"closed"],["successAlert",""],[1,"text-center"],[1,"container"],[1,"card","my-3"],[1,"card-body"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"mt-3","mb-3"],["class","btn btn-outline-success","type","button",3,"click",4,"ngIf"],["class","btn btn-outline-warning ml-2","type","button",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-danger","ml-2",3,"click"],["type","button",1,"btn","btn-outline-info","ml-2",3,"click"],["type","button",1,"btn","btn-outline-secondary","ml-2",3,"click"],["type","button",1,"btn","btn-outline-success","ml-2",3,"click"],["ngFor","",3,"ngForOf"],["type","button",1,"btn","btn-outline-success",3,"click"],["type","button",1,"btn","btn-outline-warning","ml-2",3,"click"],[1,"mb-0","font-weight-bold"],[1,"table","table-striped","table-hover","mt-1"],[3,"ngIf"],[1,"text-left"],[4,"ngIf","ngIfThen","ngIfElse"],["consumer_lost",""],["consumer_on",""],[1,"font-weight-bold","text-warning"],[1,"font-weight-bold","text-success"]],template:function(t,e){1&t&&(Ni(0,zy,7,1,"ngb-alert",0),Ni(1,s_,6,2,"div",1),$a(2,"callback")),2&t&&(Vi("ngIf",e.successMessage),cs(1),Vi("ngForOf",za(2,2,e.enrichGroups(e.groups),e.removeReadonly)))},directives:[uu,lu,mm,ou],pipes:[Uy,Ly,Hy,pu],encapsulation:2}),t})(),o_=(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=$t({type:t,selectors:[["app-home"]],decls:12,vars:0,consts:[[1,"navbar","navbar-expand-lg","navbar-light","bg-light"],[1,"container-fluid"],["href","#",1,"navbar-brand"],["type","button","data-bs-toggle","collapse","data-bs-target","#navbarSupportedContent","aria-controls","navbarSupportedContent","aria-expanded","false","aria-label","Toggle navigation",1,"navbar-toggler"],[1,"navbar-toggler-icon"],["id","navbarSupportedContent",1,"collapse","navbar-collapse"],[1,"navbar-nav","me-auto","mb-2","mb-lg-0"],[1,"nav-item"],["aria-current","page","href","#",1,"nav-link","active"]],template:function(t,e){1&t&&(Ui(0,"nav",0),Ui(1,"div",1),Ui(2,"a",2),mo(3,"KafkaFlow - Dashboard"),Li(),Ui(4,"button",3),Hi(5,"span",4),Li(),Ui(6,"div",5),Ui(7,"ul",6),Ui(8,"li",7),Ui(9,"a",8),mo(10,"Consumers"),Li(),Li(),Li(),Li(),Li(),Li(),Hi(11,"app-consumer"))},directives:[Em,i_],encapsulation:2}),t})();class a_{constructor(t,e){this.count=t,this.source=e}call(t,e){return e.subscribe(new l_(t,this.count,this.source))}}class l_ extends f{constructor(t,e,n){super(t),this.count=e,this.source=n}error(t){if(!this.isStopped){const{source:e,count:n}=this;if(0===n)return super.error(t);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}}}class c_{intercept(t,e){return e.handle(t).pipe(function(t=-1){return e=>e.lift(new a_(t,e))}(1),_h(t=>{let e="";return e=t.error instanceof ErrorEvent?`Error: ${t.error.message}`:`Error Code: ${t.status}\nMessage: ${t.message}`,console.error(e),function(t,e){return new _(e=>e.error(t))}(e)}))}}const u_={validation:!1},h_=[{path:"",component:o_}];let d_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=qt({type:t,bootstrap:[Pg]}),t.\u0275inj=ht({providers:[Fy,{provide:xy,useClass:c_,multi:!0}],imports:[[Wu,Ig,Cf.forRoot(h_),Vy,wg,Ym,Tg.forRoot(u_)],Cf]}),t})();(function(){if($l)throw new Error("Cannot enable prod mode after platform setup.");Hl=!1} /** * @license * Copyright Google LLC All Rights Reserved. diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/callback.pipe.ts b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/callback.pipe.ts index 81284f132..1a30424c5 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/callback.pipe.ts +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/callback.pipe.ts @@ -9,6 +9,6 @@ export class CallbackPipe implements PipeTransform { if (!items || !callback) { return items; } - return items.filter(item => callback(item)); + return items.filter((item: any) => callback(item)); } } diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer.service.ts b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer.service.ts index 529f25759..d5c2f3c87 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer.service.ts +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer.service.ts @@ -7,54 +7,54 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; export class ConsumerService { private headers: HttpHeaders; - private accessPointUrl: string = '/kafka-flow/'; + private accessPointUrl: string = '/kafka-flow'; constructor(private http: HttpClient) { this.headers = new HttpHeaders({'Content-Type': 'application/json; charset=utf-8'}); } public get() { - return this.http.get(this.accessPointUrl + 'groups', {headers: this.headers}); + return this.http.get(this.accessPointUrl + '/telemetry', {headers: this.headers}); } public updateWorkersCount(groupId: string, consumerName: string, workersCount: number) { return this.http.post( - this.accessPointUrl +`groups/${groupId}/consumers/${consumerName}/change-worker-count`, + this.accessPointUrl +`/groups/${groupId}/consumers/${consumerName}/change-worker-count`, { workersCount: workersCount }, {headers: this.headers}); } public resetOffset(groupId: string, consumerName: string) { return this.http.post( - this.accessPointUrl +`groups/${groupId}/consumers/${consumerName}/reset-offsets`, + this.accessPointUrl +`/groups/${groupId}/consumers/${consumerName}/reset-offsets`, { confirm: true }, {headers: this.headers}); } public pause(groupId: string, consumerName: string) { return this.http.post( - this.accessPointUrl +`groups/${groupId}/consumers/${consumerName}/pause`, + this.accessPointUrl +`/groups/${groupId}/consumers/${consumerName}/pause`, null, {headers: this.headers}); } public restart(groupId: string, consumerName: string) { return this.http.post( - this.accessPointUrl +`groups/${groupId}/consumers/${consumerName}/restart`, + this.accessPointUrl +`/groups/${groupId}/consumers/${consumerName}/restart`, null, {headers: this.headers}); } public resume(groupId: string, consumerName: string) { return this.http.post( - this.accessPointUrl +`groups/${groupId}/consumers/${consumerName}/resume`, + this.accessPointUrl +`/groups/${groupId}/consumers/${consumerName}/resume`, null, {headers: this.headers}); } public rewindOffset(groupId: string, consumerName: string, date: Date) { return this.http.post( - this.accessPointUrl +`groups/${groupId}/consumers/${consumerName}/rewind-offsets-to-date`, + this.accessPointUrl +`/groups/${groupId}/consumers/${consumerName}/rewind-offsets-to-date`, { date: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString() }, {headers: this.headers}); } diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.html b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.html index 9363582be..1d7490353 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.html +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.html @@ -1,7 +1,7 @@
Success! {{successMessage}}
-
+

Group Id: {{ group.groupId }}

@@ -27,7 +27,7 @@

Workers: {{consumer.workersCount}}

- + @@ -36,10 +36,10 @@

Workers: {{consumer.workersCount}}

- + - + - +
Hostname - consumer instanceConsumer instance Partitions Status
{{partitionAssignment.hostName}}{{partitionAssignment.instanceName}} {{partitionAssignment.pausedPartitions}} @@ -57,7 +57,7 @@

Workers: {{consumer.workersCount}}

{{partitionAssignment.hostName}}{{partitionAssignment.instanceName}} {{partitionAssignment.runningPartitions}} diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.ts b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.ts index f3ffe1b81..af93acea3 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.ts +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/consumer/consumer.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { ConsumerService } from '../consumer.service' -import { Subject } from 'rxjs'; +import {interval, Subject} from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { NgbModal, NgbAlert } from '@ng-bootstrap/ng-bootstrap'; import { RewindModalComponent } from '../shared/rewind-modal/rewind-modal.component'; @@ -15,16 +15,40 @@ import { RestartModalComponent } from '../shared/restart-modal/restart-modal.com templateUrl: './consumer.component.html' }) export class ConsumerComponent implements OnInit { - @Input() groups: Array = []; + public groups: Array = []; @ViewChild('successAlert', { static: false }) successAlert: NgbAlert | undefined; private successSubject = new Subject(); private delayMs = 1000; successMessage = ''; - constructor(private modalService: NgbModal, private consumerService: ConsumerService) { } + constructor(private modalService: NgbModal, private consumerService: ConsumerService) { + interval(1000).subscribe(_ => consumerService.get().subscribe((data: any) => this.groups = this.enrichGroups(data))); + } + + enrichGroups(groups: any) { + var self = this; + groups.forEach(function (g: any) { + g.consumers.forEach(function (c: any) { + c.status = + c.partitionAssignments.some((pa: any) => pa.runningPartitions?.length > 0 && self.isActive(pa.lastUpdate)) ? + "Running" : + c.partitionAssignments.some((pa: any) => pa.pausedPartitions?.length > 0 && self.isActive(pa.lastUpdate)) ? + "Paused" : + "Not Running"; + c.partitionAssignments.forEach( (pa: any) => pa.isLost = !self.isActive(pa.lastUpdate) + ) + }) + }); + + return groups; + } + + isActive(date: string) { + return Math.abs((new Date().getTime() - new Date(date).getTime())/1000) < 5; + } removeReadonly(group: any) { - return !(group.consumers.length == 1 && group.consumers[0].managementDisabled==1); + return !(group.consumers[0].managementDisabled==1); } openWorkersCountModal(groupId: string, consumerName: string, workersCount: number) { @@ -32,7 +56,7 @@ export class ConsumerComponent implements OnInit { modalRef.componentInstance.groupId = groupId; modalRef.componentInstance.consumerName = consumerName; modalRef.componentInstance.workersCount = workersCount; - modalRef.result.then((result) => { + modalRef.result.then((result: number) => { this.consumerService .updateWorkersCount(groupId, consumerName, result) .subscribe({ next: _ => this.successSubject.next("The number of workers was updated successfully") }) @@ -43,7 +67,7 @@ export class ConsumerComponent implements OnInit { const modalRef = this.modalService.open(ResetModalComponent); modalRef.componentInstance.groupId = groupId; modalRef.componentInstance.consumerName = consumerName; - modalRef.result.then((result) => { + modalRef.result.then((_: any) => { this.consumerService .resetOffset(groupId, consumerName) .subscribe(_ => this.successSubject.next("The partition-offsets of your consumer were reseted successfully")); @@ -54,7 +78,7 @@ export class ConsumerComponent implements OnInit { const modalRef = this.modalService.open(PauseModalComponent); modalRef.componentInstance.groupId = groupId; modalRef.componentInstance.consumerName = consumerName; - modalRef.result.then((result) => { + modalRef.result.then((_: any) => { this.consumerService .pause(groupId, consumerName) .subscribe(_ => this.successSubject.next("Your consumer was paused successfully")); @@ -65,7 +89,7 @@ export class ConsumerComponent implements OnInit { const modalRef = this.modalService.open(RestartModalComponent); modalRef.componentInstance.groupId = groupId; modalRef.componentInstance.consumerName = consumerName; - modalRef.result.then((result) => { + modalRef.result.then((_: any) => { this.consumerService .restart(groupId, consumerName) .subscribe(_ =>this.successSubject.next("Your consumer was restarted successfully")); @@ -76,7 +100,7 @@ export class ConsumerComponent implements OnInit { const modalRef = this.modalService.open(ResumeModalComponent); modalRef.componentInstance.groupId = groupId; modalRef.componentInstance.consumerName = consumerName; - modalRef.result.then((result) => { + modalRef.result.then((_: any) => { this.consumerService .resume(groupId, consumerName) .subscribe(_ => this.successSubject.next("Your consumer was resumed successfully")); @@ -87,7 +111,7 @@ export class ConsumerComponent implements OnInit { const modalRef = this.modalService.open(RewindModalComponent); modalRef.componentInstance.consumerName = consumerName; modalRef.componentInstance.groupId = groupId; - modalRef.result.then((result) => { + modalRef.result.then((result: string) => { this.consumerService .rewindOffset(groupId, consumerName, new Date(result)) .subscribe(_ => this.successSubject.next("The partition-offset of your consumer were rewinded successfully")); diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.html b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.html index c6433fd9d..a546d00b8 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.html +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.html @@ -23,4 +23,4 @@ - + diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.ts b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.ts index ae8b700fe..8292e20f2 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.ts +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.ts @@ -1,41 +1,13 @@ import { Component, OnInit } from '@angular/core'; -import { ConsumerService } from '../consumer.service' -import {interval} from "rxjs"; @Component({ selector: 'app-home', templateUrl: './home.component.html' }) export class HomeComponent implements OnInit { - public groups: Array = []; - constructor (private consumerService: ConsumerService) { - interval(1000).subscribe(_ => consumerService.get().subscribe((data: any) => this.groups = this.buildCalculatedProperties(data))); + constructor () { } - buildCalculatedProperties(groups: any) { - var self = this; - groups.forEach(function (g: any) { - g.consumers.forEach(function (c: any) { - c.status = - c.partitionAssignments.some(function (pa: any){ return pa.runningPartitions?.length > 0 && self.isActive(pa.lastUpdate);}) ? - "Running" : - c.partitionAssignments.some(function (pa: any){ return pa.pausedPartitions?.length > 0 && self.isActive(pa.lastUpdate);}) ? - "Paused" : - "Not Running"; - c.partitionAssignments.forEach(function (pa: any) { - pa.isLost = !self.isActive(pa.lastUpdate); - }) - }) - }); - - return groups; - } - - isActive(date: string) { - return Math.abs((new Date().getTime() - new Date(date).getTime())/1000) < 5; - } - - ngOnInit(): void { - } + ngOnInit(): void { } } diff --git a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/index.html b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/index.html index f4923a527..c458fe7f1 100644 --- a/src/KafkaFlow.Admin.Dashboard/ClientApp/src/index.html +++ b/src/KafkaFlow.Admin.Dashboard/ClientApp/src/index.html @@ -6,9 +6,8 @@ - - - + + diff --git a/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj b/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj index b91216253..2c9edf8d6 100644 --- a/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj +++ b/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj @@ -5,7 +5,9 @@ true Latest true - Library + Library + true + ClientApp\node_modules\** @@ -13,5 +15,9 @@ + + + + diff --git a/src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json b/src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json deleted file mode 100644 index 3c813cfa6..000000000 --- a/src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:13464" - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "KafkaFlow.Admin.Dashboard": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "https://localhost:5002;http://localhost:5003", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/src/KafkaFlow.Admin.Dashboard/ServeClientFilesMiddleware.cs b/src/KafkaFlow.Admin.Dashboard/ServeClientFilesMiddleware.cs deleted file mode 100644 index f4256c5b8..000000000 --- a/src/KafkaFlow.Admin.Dashboard/ServeClientFilesMiddleware.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace KafkaFlow.Admin.Dashboard -{ - using System; - using System.IO; - using System.Linq; - using System.Net; - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Microsoft.Extensions.Primitives; - - internal class ServeClientFilesMiddleware : IMiddleware - { - private const string DashboardUrlPrefix = "/kafka-flow"; - - private readonly string[] homeUrls = - { - DashboardUrlPrefix, - DashboardUrlPrefix + "/", - DashboardUrlPrefix + "/index.html", - }; - - public async Task InvokeAsync(HttpContext context, RequestDelegate next) - { - var requestUrl = context.Request.Path.Value.ToLower(); - - if (!requestUrl.StartsWith(DashboardUrlPrefix)) - { - await next(context); - return; - } - - var fileName = this.IsHomeUrl(requestUrl) ? - "index.html" : - Path.GetFileName(requestUrl); - - await this.RespondResourceFileAsync(context, fileName); - } - - private static StringValues ResolveContentType(string resourceName) - { - return Path.GetExtension(resourceName) switch - { - ".js" => "text/javascript", - ".css" => "text/css", - ".html" => "text/html", - _ => throw new NotSupportedException("MIME type not supported") - }; - } - - private async Task RespondResourceFileAsync(HttpContext context, string fileName) - { - var assembly = this.GetType().Assembly; - - var resourceName = assembly.GetManifestResourceNames().FirstOrDefault(x => x.EndsWith(fileName)); - - if (resourceName is null) - { - context.Response.StatusCode = (int) HttpStatusCode.NotFound; - await context.Response.WriteAsync(string.Empty); - return; - } - - var resourceStream = assembly.GetManifestResourceStream(resourceName); - - context.Response.Headers["Content-Type"] = ResolveContentType(resourceName); - await resourceStream.CopyToAsync(context.Response.Body); - } - - private bool IsHomeUrl(string url) - { - return this.homeUrls.Any(home => home == url); - } - } -} diff --git a/src/KafkaFlow.Admin.Dashboard/ServiceCollectionExtensions.cs b/src/KafkaFlow.Admin.Dashboard/ServiceCollectionExtensions.cs deleted file mode 100644 index ae7f0e96a..000000000 --- a/src/KafkaFlow.Admin.Dashboard/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace KafkaFlow.Admin.Dashboard -{ - using Microsoft.Extensions.DependencyInjection; - - /// - /// Extension methods over IServiceCollection - /// - public static class ServiceCollectionExtensions - { - /// - /// Configures a KafkaFlow Dashboard - /// - /// Instance of - /// - public static IServiceCollection AddKafkaFlowDashboard(this IServiceCollection services) - { - return services - .AddSingleton(); - } - } -} diff --git a/src/KafkaFlow.Admin.WebApi/Adapters/ConsumerResponseAdapter.cs b/src/KafkaFlow.Admin.WebApi/Adapters/ConsumerResponseAdapter.cs index 195d7115e..1bafcaf21 100644 --- a/src/KafkaFlow.Admin.WebApi/Adapters/ConsumerResponseAdapter.cs +++ b/src/KafkaFlow.Admin.WebApi/Adapters/ConsumerResponseAdapter.cs @@ -1,67 +1,43 @@ namespace KafkaFlow.Admin.WebApi.Adapters { using System; - using System.Collections.Generic; using System.Linq; - using KafkaFlow.Admin.Messages; using KafkaFlow.Admin.WebApi.Contracts; using KafkaFlow.Consumers; internal static class ConsumerResponseAdapter { - internal static ConsumerResponse Adapt(this IMessageConsumer consumer, ITelemetryStorage storage) + internal static ConsumerResponse Adapt(this IMessageConsumer consumer) { - var consumerResponse = new ConsumerResponse() + return new ConsumerResponse { Subscription = consumer.Subscription, ConsumerName = consumer.ConsumerName, GroupId = consumer.GroupId, - FlowStatus = consumer.FlowStatus ?? ConsumerFlowStatus.NotRunning, + FlowStatus = consumer.FlowStatus?.ToString() ?? ConsumerFlowStatus.NotRunning.ToString(), MemberId = consumer.MemberId, WorkersCount = consumer.WorkersCount, ClientInstanceName = consumer.ClientInstanceName, ManagementDisabled = consumer.ManagementDisabled, - }; - - var cachedMetrics = storage.Get(consumer.GroupId, consumer.ConsumerName); - - consumerResponse.PartitionAssignments = cachedMetrics.Any() ? - cachedMetrics.Select(m => m.Adapt()) : - GetLocalInfo(consumer); - - return consumerResponse; - } - - private static IEnumerable GetLocalInfo(IMessageConsumer consumer) - { - return consumer.PausedPartitions - .GroupBy(c => c.Topic) - .Select(c => new PartitionAssignment() - { - Topic = c.Key, - HostName = Environment.MachineName, - PausedPartitions = c.Select(x => x.Partition.Value), - LastUpdate = DateTime.Now, - }) - .Union(consumer.RunningPartitions + PartitionAssignments = consumer.PausedPartitions .GroupBy(c => c.Topic) .Select(c => new PartitionAssignment() { Topic = c.Key, - HostName = Environment.MachineName, - RunningPartitions = c.Select(x => x.Partition.Value), + InstanceName = Environment.MachineName, + PausedPartitions = c.Select(x => x.Partition.Value), LastUpdate = DateTime.Now, - })); - } - - private static PartitionAssignment Adapt(this ConsumerMetric consumer) => - new() - { - Topic = consumer.Topic, - HostName = consumer.InstanceName, - PausedPartitions = consumer.PausedPartitions, - RunningPartitions = consumer.RunningPartitions, - LastUpdate = consumer.SentAt, + }) + .Union(consumer.RunningPartitions + .GroupBy(c => c.Topic) + .Select(c => new PartitionAssignment() + { + Topic = c.Key, + InstanceName = Environment.MachineName, + RunningPartitions = c.Select(x => x.Partition.Value), + LastUpdate = DateTime.Now, + })), }; + } } } diff --git a/src/KafkaFlow.Admin.WebApi/Adapters/TelemetryConsumerResponseAdapter.cs b/src/KafkaFlow.Admin.WebApi/Adapters/TelemetryConsumerResponseAdapter.cs new file mode 100644 index 000000000..1e7da8a2d --- /dev/null +++ b/src/KafkaFlow.Admin.WebApi/Adapters/TelemetryConsumerResponseAdapter.cs @@ -0,0 +1,31 @@ +namespace KafkaFlow.Admin.WebApi.Adapters +{ + using System.Linq; + using KafkaFlow.Admin.WebApi.Contracts; + using KafkaFlow.Consumers; + + internal static class TelemetryConsumerResponseAdapter + { + internal static TelemetryConsumerResponse Adapt(this IMessageConsumer consumer, ITelemetryStorage storage) + { + var metrics = storage.Get(consumer.GroupId, consumer.ConsumerName); + + return new TelemetryConsumerResponse() + { + ConsumerName = consumer.ConsumerName, + GroupId = consumer.GroupId, + FlowStatus = consumer.FlowStatus?.ToString() ?? ConsumerFlowStatus.NotRunning.ToString(), + WorkersCount = consumer.WorkersCount, + ManagementDisabled = consumer.ManagementDisabled, + PartitionAssignments = metrics.Select(m => new PartitionAssignment() + { + Topic = m.Topic, + InstanceName = m.InstanceName, + PausedPartitions = m.PausedPartitions, + RunningPartitions = m.RunningPartitions, + LastUpdate = m.SentAt, + }), + }; + } + } +} diff --git a/src/KafkaFlow.Admin.WebApi/Contracts/ConsumerResponse.cs b/src/KafkaFlow.Admin.WebApi/Contracts/ConsumerResponse.cs index 9b2e4a81a..caca7e475 100644 --- a/src/KafkaFlow.Admin.WebApi/Contracts/ConsumerResponse.cs +++ b/src/KafkaFlow.Admin.WebApi/Contracts/ConsumerResponse.cs @@ -58,6 +58,6 @@ public class ConsumerResponse /// /// Gets or sets the current consumer flow status /// - public ConsumerFlowStatus FlowStatus { get; set; } + public string FlowStatus { get; set; } } } diff --git a/src/KafkaFlow.Admin.WebApi/Contracts/PartitionAssignment.cs b/src/KafkaFlow.Admin.WebApi/Contracts/PartitionAssignment.cs index b99144840..430bdeea4 100644 --- a/src/KafkaFlow.Admin.WebApi/Contracts/PartitionAssignment.cs +++ b/src/KafkaFlow.Admin.WebApi/Contracts/PartitionAssignment.cs @@ -16,7 +16,7 @@ public class PartitionAssignment /// /// Gets or sets the host name /// - public string HostName { get; set; } + public string InstanceName { get; set; } /// /// Gets or sets the list of running partitions diff --git a/src/KafkaFlow.Admin.WebApi/Contracts/TelemetryConsumerResponse.cs b/src/KafkaFlow.Admin.WebApi/Contracts/TelemetryConsumerResponse.cs new file mode 100644 index 000000000..dc06a89fb --- /dev/null +++ b/src/KafkaFlow.Admin.WebApi/Contracts/TelemetryConsumerResponse.cs @@ -0,0 +1,41 @@ +namespace KafkaFlow.Admin.WebApi.Contracts +{ + using System.Collections.Generic; + using KafkaFlow.Consumers; + + /// + /// The response of the telemetry consumers + /// + public class TelemetryConsumerResponse + { + /// + /// Gets or sets the consumer´s name + /// + public string ConsumerName { get; set; } + + /// + /// Gets or sets a value indicating whether the consumer is able to be manageable or not + /// + public bool ManagementDisabled { get; set; } + + /// + /// Gets or sets the group id + /// + public string GroupId { get; set; } + + /// + /// Gets or sets the current number of workers allocated by the consumer + /// + public int WorkersCount { get; set; } + + /// + /// Gets or sets all the consumer partition assignments (data received from metrics events) + /// + public IEnumerable PartitionAssignments { get; set; } + + /// + /// Gets or sets the current consumer flow status + /// + public string FlowStatus { get; set; } + } +} diff --git a/src/KafkaFlow.Admin.WebApi/Contracts/TelemetryGroupResponse.cs b/src/KafkaFlow.Admin.WebApi/Contracts/TelemetryGroupResponse.cs new file mode 100644 index 000000000..6f2dd49b9 --- /dev/null +++ b/src/KafkaFlow.Admin.WebApi/Contracts/TelemetryGroupResponse.cs @@ -0,0 +1,21 @@ +namespace KafkaFlow.Admin.WebApi.Contracts +{ + using System.Collections.Generic; + using KafkaFlow.Consumers; + + /// + /// The response of the telemetry consumer groups + /// + public class TelemetryGroupResponse + { + /// + /// Gets or sets the consumer group id + /// + public string GroupId { get; set; } + + /// + /// Gets or sets the consumers collection + /// + public IEnumerable Consumers { get; set; } + } +} diff --git a/src/KafkaFlow.Admin.WebApi/Controllers/GroupsController.cs b/src/KafkaFlow.Admin.WebApi/Controllers/GroupsController.cs index 5710cb359..dd7c7af7d 100644 --- a/src/KafkaFlow.Admin.WebApi/Controllers/GroupsController.cs +++ b/src/KafkaFlow.Admin.WebApi/Controllers/GroupsController.cs @@ -18,7 +18,6 @@ public class GroupsController : ControllerBase { private readonly IConsumerAccessor consumers; private readonly IAdminProducer adminProducer; - private readonly ITelemetryStorage storage; /// /// Initializes a new instance of the class. @@ -26,11 +25,10 @@ public class GroupsController : ControllerBase /// The accessor class that provides access to the consumers /// The producer to publish admin messages /// The cache interface to get metric data - public GroupsController(IConsumerAccessor consumers, IAdminProducer adminProducer, ITelemetryStorage storage) + public GroupsController(IConsumerAccessor consumers, IAdminProducer adminProducer) { this.consumers = consumers; this.adminProducer = adminProducer; - this.storage = storage; } /// @@ -48,7 +46,7 @@ public IActionResult Get() x => new GroupResponse { GroupId = x.First().GroupId, - Consumers = x.Select(y => y.Adapt(this.storage)), + Consumers = x.Select(y => y.Adapt()), })); } diff --git a/src/KafkaFlow.Admin.WebApi/Controllers/TelemetryController.cs b/src/KafkaFlow.Admin.WebApi/Controllers/TelemetryController.cs new file mode 100644 index 000000000..426730bc1 --- /dev/null +++ b/src/KafkaFlow.Admin.WebApi/Controllers/TelemetryController.cs @@ -0,0 +1,52 @@ +namespace KafkaFlow.Admin.WebApi.Controllers +{ + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using KafkaFlow.Admin.Messages; + using KafkaFlow.Admin.WebApi.Adapters; + using KafkaFlow.Admin.WebApi.Contracts; + using KafkaFlow.Consumers; + using Microsoft.AspNetCore.Mvc; + + /// + /// Groups controller + /// + [Route("kafka-flow/telemetry")] + [ApiController] + public class TelemetryController : ControllerBase + { + private readonly IConsumerAccessor consumers; + private readonly ITelemetryStorage storage; + + /// + /// Initializes a new instance of the class. + /// + /// The accessor class that provides access to the consumers + /// The cache interface to get metric data + public TelemetryController(IConsumerAccessor consumers, ITelemetryStorage storage) + { + this.consumers = consumers; + this.storage = storage; + } + + /// + /// Get telemetry data from all the consumer groups + /// + /// A list of consumer groups + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + public IActionResult Get() + { + return this.Ok( + this.consumers.All + .GroupBy(x => x.GroupId) + .Select( + x => new TelemetryGroupResponse + { + GroupId = x.First().GroupId, + Consumers = x.Select(y => y.Adapt(this.storage)), + })); + } + } +} diff --git a/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs b/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs index 85018a1d0..f6516bc38 100644 --- a/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs +++ b/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs @@ -1,14 +1,10 @@ namespace KafkaFlow { using System; - using System.Linq; using System.Reflection; using KafkaFlow.Admin; using KafkaFlow.Admin.Handlers; - using KafkaFlow.Admin.Messages; using KafkaFlow.Configuration; - using KafkaFlow.Consumers; - using KafkaFlow.Producers; using KafkaFlow.Serializer; using KafkaFlow.TypedHandler; using Microsoft.Extensions.Caching.Memory; @@ -30,10 +26,8 @@ public static IClusterConfigurationBuilder EnableAdminMessages( string adminTopic, string adminConsumerGroup) { - cluster.DependencyConfigurator.AddSingleton(); - - cluster.DependencyConfigurator.AddSingleton(); - cluster.DependencyConfigurator.AddSingleton(); + cluster.DependencyConfigurator + .AddSingleton(); return cluster .AddProducer( @@ -80,8 +74,10 @@ public static IClusterConfigurationBuilder EnableTelemetry( string topicName, string consumerGroup) { - cluster.DependencyConfigurator.AddSingleton(); - cluster.DependencyConfigurator.AddSingleton(); + cluster.DependencyConfigurator + .AddSingleton() + .AddSingleton() + .AddSingleton(); var groupId = $"{consumerGroup}-{Environment.MachineName}-{Convert.ToBase64String(Guid.NewGuid().ToByteArray())}"; var name = $"telemetry-{Convert.ToBase64String(Guid.NewGuid().ToByteArray())}"; diff --git a/src/KafkaFlow.Admin/TelemetryScheduler.cs b/src/KafkaFlow.Admin/TelemetryScheduler.cs index 0ab76b9ad..3631fc7d8 100644 --- a/src/KafkaFlow.Admin/TelemetryScheduler.cs +++ b/src/KafkaFlow.Admin/TelemetryScheduler.cs @@ -25,40 +25,18 @@ public void Start(string key, string topicName) var consumers = this.dependencyResolver .Resolve() .All - .Where(c => !c.ManagementDisabled && - c.ClusterName.Equals(this.dependencyResolver - .Resolve()[key] - .ClusterName)); + .Where( + c => !c.ManagementDisabled && + c.ClusterName.Equals( + this.dependencyResolver + .Resolve()[key] + .ClusterName)) + .ToList(); var producer = this.dependencyResolver.Resolve().GetProducer(key); this.timers[key] = new Timer( - _ => - { - producer.BatchProduceAsync( - consumers.SelectMany(c => c.Assignment.Select(a => - new BatchProduceItem( - topicName, - Guid.NewGuid(), - new ConsumerMetric() - { - ConsumerName = c.ConsumerName, - Topic = a.Topic, - GroupId = c.GroupId, - InstanceName = $"{Environment.MachineName}-{c.MemberId}", - PausedPartitions = c.PausedPartitions - .Where(p => p.Topic == a.Topic) - .Select(p => p.Partition.Value), - RunningPartitions = c.RunningPartitions - .Where(p => p.Topic == a.Topic) - .Select(p => p.Partition.Value), - SentAt = DateTime.Now, - }, - null))) - .ToList()) - .GetAwaiter() - .GetResult(); - }, + _ => ProduceTelemetry(topicName, consumers, producer), null, TimeSpan.Zero, TimeSpan.FromSeconds(1)); @@ -72,5 +50,33 @@ public void Stop(string key) this.timers.Remove(key); } } + + private static void ProduceTelemetry( + string topicName, + IReadOnlyCollection consumers, + IMessageProducer producer) + { + var items = consumers.SelectMany( + c => c.Assignment.Select( + a => new ConsumerMetric() + { + ConsumerName = c.ConsumerName, + Topic = a.Topic, + GroupId = c.GroupId, + InstanceName = $"{Environment.MachineName}-{c.MemberId}", + PausedPartitions = c.PausedPartitions + .Where(p => p.Topic == a.Topic) + .Select(p => p.Partition.Value), + RunningPartitions = c.RunningPartitions + .Where(p => p.Topic == a.Topic) + .Select(p => p.Partition.Value), + SentAt = DateTime.Now, + })); + + foreach (var item in items) + { + producer.Produce(topicName, Guid.NewGuid().ToByteArray(), item); + } + } } -} \ No newline at end of file +}