{"version":3,"file":"talenra-ngx-base-counter-pipe.mjs","sources":["../../../projects/ngx-base/counter-pipe/src/counter-pipe/counter.pipe.ts","../../../projects/ngx-base/counter-pipe/talenra-ngx-base-counter-pipe.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Pipe \"counter\" formats numbers for output in counter badges as used in\n * app-sidenav. The counter value refers to a number of items a navigation\n * option includes (e.g. the number of unread messages).\n *\n * ```html\n * <span>{{ counter | counter: 100 }}</span>\n * ```\n *\n * @internal\n */\n@Pipe({\n  name: 'counter',\n})\nexport class CounterPipe implements PipeTransform {\n  // Max value displayed in counter badge.\n  // Values bigger than this value will be displayed as \"<max>+\"\n  // e.g. \"99+\" if max is 99 and input value is >99\n  private max = 9999;\n\n  // Template usage: `{{ myValue | counter }}``\n  // Usage with custom max: `{{ myValue | counter:99 }}`\n  transform(value: number, ...args: number[]): string {\n    const max = typeof args[0] === 'number' ? args[0] : this.max;\n    value = value || 0;\n    return value < 1 ? '' : value > max ? `${max}+` : value.toString();\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;;;;;;;;;AAUG;MAIU,WAAW,CAAA;AAHxB,IAAA,WAAA,GAAA;;;;QAOU,IAAG,CAAA,GAAA,GAAG,IAAI;AASnB;;;AALC,IAAA,SAAS,CAAC,KAAa,EAAE,GAAG,IAAc,EAAA;QACxC,MAAM,GAAG,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG;AAC5D,QAAA,KAAK,GAAG,KAAK,IAAI,CAAC;QAClB,OAAO,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,CAAG,EAAA,GAAG,CAAG,CAAA,CAAA,GAAG,KAAK,CAAC,QAAQ,EAAE;;8GAXzD,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,SAAS;AAChB,iBAAA;;;ACfD;;AAEG;;;;"}