@bravobit/bb-foundation 0.16.3 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/esm2020/auth/lib/auth.interceptor.mjs +3 -3
  2. package/esm2020/auth/lib/auth.module.mjs +4 -4
  3. package/esm2020/auth/lib/auth.service.mjs +3 -3
  4. package/esm2020/auth/lib/directives/authenticated.directive.mjs +3 -3
  5. package/esm2020/auth/lib/directives/permission.directive.mjs +3 -3
  6. package/esm2020/auth/lib/directives/role.directive.mjs +3 -3
  7. package/esm2020/auth/lib/guards/anonymous.guard.mjs +3 -3
  8. package/esm2020/auth/lib/guards/authenticated.guard.mjs +3 -3
  9. package/esm2020/auth/lib/helpers/mapper.helper.mjs +3 -3
  10. package/esm2020/auth/lib/permissions.service.mjs +3 -3
  11. package/esm2020/collections/lib/collections.module.mjs +4 -4
  12. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +4 -4
  13. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +3 -3
  14. package/esm2020/collections/lib/components/collections.directive.mjs +12 -12
  15. package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +3 -3
  16. package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +3 -3
  17. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +4 -4
  18. package/esm2020/controls/lib/controls.module.mjs +4 -4
  19. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +3 -3
  20. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +3 -3
  21. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +3 -3
  22. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +4 -4
  23. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +3 -3
  24. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +3 -3
  25. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +3 -3
  26. package/esm2020/dashboard/lib/dashboard.module.mjs +4 -4
  27. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
  28. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +3 -3
  29. package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +3 -3
  30. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +3 -3
  31. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +3 -3
  32. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +3 -3
  33. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +3 -3
  34. package/esm2020/dialog/lib/dialog.insertion.mjs +3 -3
  35. package/esm2020/dialog/lib/dialog.module.mjs +4 -4
  36. package/esm2020/dialog/lib/dialog.service.mjs +3 -3
  37. package/esm2020/elements/lib/avatar/avatar.component.mjs +3 -3
  38. package/esm2020/elements/lib/button/button.component.mjs +6 -6
  39. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +3 -3
  40. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +3 -3
  41. package/esm2020/elements/lib/directives/addon.directive.mjs +6 -6
  42. package/esm2020/elements/lib/directives/autosize.directive.mjs +3 -3
  43. package/esm2020/elements/lib/directives/focus-trap.directive.mjs +3 -3
  44. package/esm2020/elements/lib/directives/focus.directive.mjs +3 -3
  45. package/esm2020/elements/lib/directives/form-submit.directive.mjs +3 -3
  46. package/esm2020/elements/lib/directives/input.directive.mjs +6 -6
  47. package/esm2020/elements/lib/directives/template.directive.mjs +3 -3
  48. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +6 -6
  49. package/esm2020/elements/lib/elements.module.mjs +4 -4
  50. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +6 -6
  51. package/esm2020/elements/lib/form-control/form-control.component.mjs +4 -4
  52. package/esm2020/elements/lib/form-error/form-error.component.mjs +3 -3
  53. package/esm2020/elements/lib/form-group/form-group.component.mjs +3 -3
  54. package/esm2020/elements/lib/icon/icon.component.mjs +3 -3
  55. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +3 -3
  56. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +3 -3
  57. package/esm2020/elements/lib/pipes/file-size.pipe.mjs +3 -3
  58. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +3 -3
  59. package/esm2020/elements/lib/spinner/spinner.component.mjs +3 -3
  60. package/esm2020/elements/lib/tag/tag.component.mjs +3 -3
  61. package/esm2020/http/lib/http.module.mjs +4 -4
  62. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +3 -3
  63. package/esm2020/http/lib/interceptors/error.interceptor.mjs +3 -3
  64. package/esm2020/lib/core/services/clipboard.service.mjs +3 -3
  65. package/esm2020/lib/core/services/exif.service.mjs +3 -3
  66. package/esm2020/lib/core/services/file-loader.service.mjs +3 -3
  67. package/esm2020/lib/core/services/image-converter.service.mjs +3 -3
  68. package/esm2020/lib/core/services/languages.service.mjs +3 -3
  69. package/esm2020/lib/core/services/network.service.mjs +3 -3
  70. package/esm2020/lib/core/services/patch.service.mjs +3 -3
  71. package/esm2020/lib/core/services/platform.service.mjs +3 -3
  72. package/esm2020/localize/lib/interfaces/config.interfaces.mjs +1 -1
  73. package/esm2020/localize/lib/localize.module.mjs +9 -6
  74. package/esm2020/localize/lib/localize.pipe.mjs +3 -3
  75. package/esm2020/localize/lib/localize.service.mjs +25 -22
  76. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +3 -3
  77. package/esm2020/localize/lib/views/localize-template-or-string.directive.mjs +3 -3
  78. package/esm2020/localize/lib/views/localize-template.directive.mjs +3 -3
  79. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +3 -3
  80. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +3 -3
  81. package/esm2020/notifications/lib/notifications.module.mjs +4 -4
  82. package/esm2020/notifications/lib/notifications.service.mjs +3 -3
  83. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +3 -3
  84. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +3 -3
  85. package/esm2020/recaptcha/lib/recaptcha.module.mjs +4 -4
  86. package/esm2020/storage/lib/storage.service.mjs +3 -3
  87. package/esm2020/table/lib/components/table/table.component.mjs +9 -9
  88. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +3 -3
  89. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +3 -3
  90. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +5 -5
  91. package/esm2020/table/lib/table.module.mjs +4 -4
  92. package/fesm2015/bravobit-bb-foundation-auth.mjs +31 -31
  93. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -1
  94. package/fesm2015/bravobit-bb-foundation-collections.mjs +23 -23
  95. package/fesm2015/bravobit-bb-foundation-collections.mjs.map +1 -1
  96. package/fesm2015/bravobit-bb-foundation-controls.mjs +14 -14
  97. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
  98. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +26 -26
  99. package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  100. package/fesm2015/bravobit-bb-foundation-dialog.mjs +31 -31
  101. package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -1
  102. package/fesm2015/bravobit-bb-foundation-elements.mjs +88 -88
  103. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
  104. package/fesm2015/bravobit-bb-foundation-http.mjs +10 -10
  105. package/fesm2015/bravobit-bb-foundation-http.mjs.map +1 -1
  106. package/fesm2015/bravobit-bb-foundation-localize.mjs +48 -41
  107. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -1
  108. package/fesm2015/bravobit-bb-foundation-notifications.mjs +13 -13
  109. package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -1
  110. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +10 -10
  111. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  112. package/fesm2015/bravobit-bb-foundation-rxjs.mjs.map +1 -1
  113. package/fesm2015/bravobit-bb-foundation-storage.mjs +3 -3
  114. package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -1
  115. package/fesm2015/bravobit-bb-foundation-table.mjs +24 -24
  116. package/fesm2015/bravobit-bb-foundation-table.mjs.map +1 -1
  117. package/fesm2015/bravobit-bb-foundation.mjs +24 -24
  118. package/fesm2015/bravobit-bb-foundation.mjs.map +1 -1
  119. package/fesm2020/bravobit-bb-foundation-auth.mjs +31 -31
  120. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -1
  121. package/fesm2020/bravobit-bb-foundation-collections.mjs +23 -23
  122. package/fesm2020/bravobit-bb-foundation-collections.mjs.map +1 -1
  123. package/fesm2020/bravobit-bb-foundation-controls.mjs +14 -14
  124. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
  125. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +26 -26
  126. package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  127. package/fesm2020/bravobit-bb-foundation-dialog.mjs +31 -31
  128. package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -1
  129. package/fesm2020/bravobit-bb-foundation-elements.mjs +88 -88
  130. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
  131. package/fesm2020/bravobit-bb-foundation-http.mjs +10 -10
  132. package/fesm2020/bravobit-bb-foundation-http.mjs.map +1 -1
  133. package/fesm2020/bravobit-bb-foundation-localize.mjs +44 -38
  134. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -1
  135. package/fesm2020/bravobit-bb-foundation-notifications.mjs +13 -13
  136. package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -1
  137. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +10 -10
  138. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  139. package/fesm2020/bravobit-bb-foundation-rxjs.mjs.map +1 -1
  140. package/fesm2020/bravobit-bb-foundation-storage.mjs +3 -3
  141. package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -1
  142. package/fesm2020/bravobit-bb-foundation-table.mjs +24 -24
  143. package/fesm2020/bravobit-bb-foundation-table.mjs.map +1 -1
  144. package/fesm2020/bravobit-bb-foundation.mjs +24 -24
  145. package/fesm2020/bravobit-bb-foundation.mjs.map +1 -1
  146. package/localize/lib/interfaces/config.interfaces.d.ts +1 -0
  147. package/localize/lib/localize.service.d.ts +3 -2
  148. package/package.json +5 -5
@@ -97,9 +97,9 @@ class BaseUrlInterceptor {
97
97
  return null;
98
98
  }
99
99
  }
100
- BaseUrlInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BaseUrlInterceptor, deps: [{ token: HttpConfig }], target: i0.ɵɵFactoryTarget.Injectable });
101
- BaseUrlInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BaseUrlInterceptor });
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BaseUrlInterceptor, decorators: [{
100
+ BaseUrlInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BaseUrlInterceptor, deps: [{ token: HttpConfig }], target: i0.ɵɵFactoryTarget.Injectable });
101
+ BaseUrlInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BaseUrlInterceptor });
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BaseUrlInterceptor, decorators: [{
103
103
  type: Injectable
104
104
  }], ctorParameters: function () { return [{ type: HttpConfig }]; } });
105
105
 
@@ -123,9 +123,9 @@ class ErrorInterceptor {
123
123
  }));
124
124
  }
125
125
  }
126
- ErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ErrorInterceptor, deps: [{ token: HttpConfig }], target: i0.ɵɵFactoryTarget.Injectable });
127
- ErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ErrorInterceptor });
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ErrorInterceptor, decorators: [{
126
+ ErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ErrorInterceptor, deps: [{ token: HttpConfig }], target: i0.ɵɵFactoryTarget.Injectable });
127
+ ErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ErrorInterceptor });
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: ErrorInterceptor, decorators: [{
129
129
  type: Injectable
130
130
  }], ctorParameters: function () { return [{ type: HttpConfig }]; } });
131
131
 
@@ -148,10 +148,10 @@ class HttpModule {
148
148
  };
149
149
  }
150
150
  }
151
- HttpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: HttpModule, deps: [{ token: HttpModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
152
- HttpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: HttpModule, imports: [HttpClientModule] });
153
- HttpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: HttpModule, imports: [[HttpClientModule]] });
154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: HttpModule, decorators: [{
151
+ HttpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: HttpModule, deps: [{ token: HttpModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
152
+ HttpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: HttpModule, imports: [HttpClientModule] });
153
+ HttpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: HttpModule, imports: [[HttpClientModule]] });
154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: HttpModule, decorators: [{
155
155
  type: NgModule,
156
156
  args: [{
157
157
  imports: [HttpClientModule]
@@ -1 +1 @@
1
- {"version":3,"file":"bravobit-bb-foundation-http.mjs","sources":["../../../projects/bb-foundation/http/src/lib/classes/http.config.ts","../../../projects/bb-foundation/http/src/lib/classes/http.error.ts","../../../projects/bb-foundation/http/src/lib/interceptors/base-url.interceptor.ts","../../../projects/bb-foundation/http/src/lib/interceptors/error.interceptor.ts","../../../projects/bb-foundation/http/src/lib/http.module.ts","../../../projects/bb-foundation/http/src/bravobit-bb-foundation-http.ts"],"sourcesContent":["import {HttpConfigAliases, HttpConfigData, HttpConfigUrl} from '../http.interfaces';\nimport {isDevMode} from '@angular/core';\n\nexport class HttpConfig {\n\n readonly aliases: HttpConfigAliases;\n readonly prefix: string;\n readonly defaultAlias: string;\n readonly disableErrorParsing: boolean;\n\n constructor(data: HttpConfigData) {\n // Get the data from the config.\n this.prefix = data?.alias?.prefix ?? '$';\n this.disableErrorParsing = data?.disableErrorParsing ?? false;\n\n // Parse the aliases.\n const standardAlias = data?.alias?.standard ?? 'api';\n this.aliases = this.parseAliases(data?.url, standardAlias);\n\n // Get the default alias.\n const firstAvailableAlias = Object.keys(this.aliases ?? {})?.[0];\n this.defaultAlias = `${this.prefix}${firstAvailableAlias}`;\n }\n\n private parseAliases = (value: HttpConfigUrl, standardAlias: string) => {\n if (typeof value === 'string') {\n value = {[standardAlias]: value};\n }\n\n if (isDevMode()) {\n const stringRegex = /^[a-zA-Z]+$/;\n for (const alias in value) {\n if (value.hasOwnProperty(alias) && !stringRegex.test(alias)) {\n console?.warn?.(`[HttpModule]: Invalid HTTP-alias in HttpConfig named \"${alias}\"; only latin characters should be used.`);\n }\n }\n }\n\n return value;\n };\n\n}","import {HttpErrorResponse} from '@angular/common/http';\n\nexport class HttpError extends HttpErrorResponse {\n\n constructor(error: HttpErrorResponse) {\n super(error);\n }\n\n get<T = any>(token: string, delimiter: string = '.') {\n const error = this.error ?? {};\n return (token ?? '')\n .split(delimiter)\n .reduce((previous, current) => previous?.[current] ? previous?.[current] : null, error) as T;\n }\n\n has(token: string, delimiter: string = '.') {\n return !!this.get(token, delimiter);\n }\n\n includes<T = any>(token: string, value: T) {\n const array = this.get<T[]>(token);\n return (array ?? []).includes(value);\n }\n\n}\n","import {HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\nimport {HttpConfigAliases} from '../http.interfaces';\nimport {Injectable, isDevMode} from '@angular/core';\nimport {HttpConfig} from '../classes/http.config';\n\n@Injectable()\nexport class BaseUrlInterceptor implements HttpInterceptor {\n\n // Aliases.\n private readonly _aliases: HttpConfigAliases = this._config?.aliases;\n private readonly _prefix: string = this._config?.prefix;\n private readonly _extractRegex: RegExp = new RegExp(`\\\\${this._prefix}[a-zA-Z]+`);\n\n constructor(private _config: HttpConfig) {\n }\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler) {\n const url = this.getUrlBasedOnAlias(request.url);\n const modified = request.clone({url});\n\n return next.handle(modified);\n }\n\n private getUrlBasedOnAlias(url: string) {\n const matches = this._extractRegex.exec(url);\n if (!matches) {\n return url;\n }\n\n return matches.reduce((previous, current) => {\n const alias = this.getAlias(current);\n if (!alias) {\n return previous;\n }\n\n return previous.replace(current, alias);\n }, url);\n }\n\n private getAlias(value: string) {\n const alias = value.replace(this._prefix, '');\n const fetched = this._aliases?.[alias] ?? null;\n if (fetched) {\n return fetched;\n }\n\n if (isDevMode()) {\n const available = Object.keys(this._aliases)\n .map(item => `\\$${item}`)\n .join(', ');\n console?.warn?.(`[HttpModule]: Used an invalid HTTP-alias named \"${value}\", skipped parsing; Available aliases is one of (${available}).`);\n }\n\n return null;\n }\n\n}\n","import {HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\nimport {HttpConfig} from '../classes/http.config';\nimport {HttpError} from '../classes/http.error';\nimport {catchError} from 'rxjs/operators';\nimport {Injectable} from '@angular/core';\nimport {throwError} from 'rxjs';\n\n@Injectable()\nexport class ErrorInterceptor implements HttpInterceptor {\n\n // State.\n private readonly _disabled = this._config?.disableErrorParsing ?? false;\n\n constructor(private _config: HttpConfig) {\n }\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler) {\n return next.handle(request).pipe(\n catchError(error => {\n // If we have a matching http error response\n // re-map it with our custom class (if not disabled).\n if (!this._disabled && error instanceof HttpErrorResponse) {\n const parsed = new HttpError(error);\n return throwError(parsed);\n }\n\n // We did not match anything, just re-trow the error.\n return throwError(error);\n })\n );\n }\n\n}\n","import {InjectionToken, ModuleWithProviders, NgModule, Optional, SkipSelf} from '@angular/core';\nimport {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';\nimport {BaseUrlInterceptor} from './interceptors/base-url.interceptor';\nimport {ErrorInterceptor} from './interceptors/error.interceptor';\nimport {HttpConfigData} from './http.interfaces';\nimport {HttpConfig} from './classes/http.config';\n\n@NgModule({\n imports: [HttpClientModule]\n})\nexport class HttpModule {\n\n constructor(@Optional() @SkipSelf() private _parent?: HttpModule) {\n if (this._parent) {\n throw new Error('HttpModule is already loaded; Import it in the core module only.');\n }\n }\n\n static forRoot(config: HttpConfigData): ModuleWithProviders<HttpModule> {\n return {\n ngModule: HttpModule,\n providers: [\n {provide: HTTP_CONFIGURATION_DATA, useValue: config},\n {provide: HttpConfig, useFactory: createHttpConfig, deps: [HTTP_CONFIGURATION_DATA]},\n {provide: HTTP_INTERCEPTORS, useClass: BaseUrlInterceptor, multi: true},\n {provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true}\n ]\n };\n }\n\n}\n\nexport const HTTP_CONFIGURATION_DATA = new InjectionToken<HttpConfigData>('HTTP_CONFIGURATION_DATA');\n\nexport function createHttpConfig(data: HttpConfigData) {\n return new HttpConfig(data);\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAGa,UAAU;IAOnB,YAAY,IAAoB;;QAcxB,iBAAY,GAAG,CAAC,KAAoB,EAAE,aAAqB;;YAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC3B,KAAK,GAAG,EAAC,CAAC,aAAa,GAAG,KAAK,EAAC,CAAC;aACpC;YAED,IAAI,SAAS,EAAE,EAAE;gBACb,MAAM,WAAW,GAAG,aAAa,CAAC;gBAClC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;oBACvB,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;wBACzD,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,+CAAb,OAAO,EAAS,yDAAyD,KAAK,0CAA0C,CAAC,CAAC;qBAC7H;iBACJ;aACJ;YAED,OAAO,KAAK,CAAC;SAChB,CAAC;;QA3BE,IAAI,CAAC,MAAM,GAAG,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,MAAM,mCAAI,GAAG,CAAC;QACzC,IAAI,CAAC,mBAAmB,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,mBAAmB,mCAAI,KAAK,CAAC;;QAG9D,MAAM,aAAa,GAAG,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,Q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OAAO;YACH,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE;gBACP,EAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,EAAC;gBACpD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,uBAAuB,CAAC,EAAC;gBACpF,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAC;gBACvE,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAC;aACxE;SACJ,CAAC;KACL;;uGAlBQ,UAAU,kBAEmC,UAAU;wGAFvD,UAAU,YAFT,gBAAgB;wGAEjB,UAAU,YAFV,CAAC,gBAAgB,CAAC;2FAElB,UAAU;kBAHtB,QAAQ;mBAAC;oBACN,OAAO,EAAE,CAAC,gBAAgB,CAAC;iBAC9B;;wBAGyD,UAAU;8BAAnD,QAAQ;;8BAAI,QAAQ;;;MAoBxB,uBAAuB,GAAG,IAAI,cAAc,CAAiB,yBAAyB,EAAE;SAErF,gBAAgB,CAAC,IAAoB;IACjD,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC;;ACpCA;;;;;;"}
1
+ {"version":3,"file":"bravobit-bb-foundation-http.mjs","sources":["../../../projects/bb-foundation/http/src/lib/classes/http.config.ts","../../../projects/bb-foundation/http/src/lib/classes/http.error.ts","../../../projects/bb-foundation/http/src/lib/interceptors/base-url.interceptor.ts","../../../projects/bb-foundation/http/src/lib/interceptors/error.interceptor.ts","../../../projects/bb-foundation/http/src/lib/http.module.ts","../../../projects/bb-foundation/http/src/bravobit-bb-foundation-http.ts"],"sourcesContent":["import {HttpConfigAliases, HttpConfigData, HttpConfigUrl} from '../http.interfaces';\nimport {isDevMode} from '@angular/core';\n\nexport class HttpConfig {\n\n readonly aliases: HttpConfigAliases;\n readonly prefix: string;\n readonly defaultAlias: string;\n readonly disableErrorParsing: boolean;\n\n constructor(data: HttpConfigData) {\n // Get the data from the config.\n this.prefix = data?.alias?.prefix ?? '$';\n this.disableErrorParsing = data?.disableErrorParsing ?? false;\n\n // Parse the aliases.\n const standardAlias = data?.alias?.standard ?? 'api';\n this.aliases = this.parseAliases(data?.url, standardAlias);\n\n // Get the default alias.\n const firstAvailableAlias = Object.keys(this.aliases ?? {})?.[0];\n this.defaultAlias = `${this.prefix}${firstAvailableAlias}`;\n }\n\n private parseAliases = (value: HttpConfigUrl, standardAlias: string) => {\n if (typeof value === 'string') {\n value = {[standardAlias]: value};\n }\n\n if (isDevMode()) {\n const stringRegex = /^[a-zA-Z]+$/;\n for (const alias in value) {\n if (value.hasOwnProperty(alias) && !stringRegex.test(alias)) {\n console?.warn?.(`[HttpModule]: Invalid HTTP-alias in HttpConfig named \"${alias}\"; only latin characters should be used.`);\n }\n }\n }\n\n return value;\n };\n\n}","import {HttpErrorResponse} from '@angular/common/http';\n\nexport class HttpError extends HttpErrorResponse {\n\n constructor(error: HttpErrorResponse) {\n super(error);\n }\n\n get<T = any>(token: string, delimiter: string = '.') {\n const error = this.error ?? {};\n return (token ?? '')\n .split(delimiter)\n .reduce((previous, current) => previous?.[current] ? previous?.[current] : null, error) as T;\n }\n\n has(token: string, delimiter: string = '.') {\n return !!this.get(token, delimiter);\n }\n\n includes<T = any>(token: string, value: T) {\n const array = this.get<T[]>(token);\n return (array ?? []).includes(value);\n }\n\n}\n","import {HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\nimport {HttpConfigAliases} from '../http.interfaces';\nimport {Injectable, isDevMode} from '@angular/core';\nimport {HttpConfig} from '../classes/http.config';\n\n@Injectable()\nexport class BaseUrlInterceptor implements HttpInterceptor {\n\n // Aliases.\n private readonly _aliases: HttpConfigAliases = this._config?.aliases;\n private readonly _prefix: string = this._config?.prefix;\n private readonly _extractRegex: RegExp = new RegExp(`\\\\${this._prefix}[a-zA-Z]+`);\n\n constructor(private _config: HttpConfig) {\n }\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler) {\n const url = this.getUrlBasedOnAlias(request.url);\n const modified = request.clone({url});\n\n return next.handle(modified);\n }\n\n private getUrlBasedOnAlias(url: string) {\n const matches = this._extractRegex.exec(url);\n if (!matches) {\n return url;\n }\n\n return matches.reduce((previous, current) => {\n const alias = this.getAlias(current);\n if (!alias) {\n return previous;\n }\n\n return previous.replace(current, alias);\n }, url);\n }\n\n private getAlias(value: string) {\n const alias = value.replace(this._prefix, '');\n const fetched = this._aliases?.[alias] ?? null;\n if (fetched) {\n return fetched;\n }\n\n if (isDevMode()) {\n const available = Object.keys(this._aliases)\n .map(item => `\\$${item}`)\n .join(', ');\n console?.warn?.(`[HttpModule]: Used an invalid HTTP-alias named \"${value}\", skipped parsing; Available aliases is one of (${available}).`);\n }\n\n return null;\n }\n\n}\n","import {HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\nimport {HttpConfig} from '../classes/http.config';\nimport {HttpError} from '../classes/http.error';\nimport {catchError} from 'rxjs/operators';\nimport {Injectable} from '@angular/core';\nimport {throwError} from 'rxjs';\n\n@Injectable()\nexport class ErrorInterceptor implements HttpInterceptor {\n\n // State.\n private readonly _disabled = this._config?.disableErrorParsing ?? false;\n\n constructor(private _config: HttpConfig) {\n }\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler) {\n return next.handle(request).pipe(\n catchError(error => {\n // If we have a matching http error response\n // re-map it with our custom class (if not disabled).\n if (!this._disabled && error instanceof HttpErrorResponse) {\n const parsed = new HttpError(error);\n return throwError(parsed);\n }\n\n // We did not match anything, just re-trow the error.\n return throwError(error);\n })\n );\n }\n\n}\n","import {InjectionToken, ModuleWithProviders, NgModule, Optional, SkipSelf} from '@angular/core';\nimport {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';\nimport {BaseUrlInterceptor} from './interceptors/base-url.interceptor';\nimport {ErrorInterceptor} from './interceptors/error.interceptor';\nimport {HttpConfigData} from './http.interfaces';\nimport {HttpConfig} from './classes/http.config';\n\n@NgModule({\n imports: [HttpClientModule]\n})\nexport class HttpModule {\n\n constructor(@Optional() @SkipSelf() private _parent?: HttpModule) {\n if (this._parent) {\n throw new Error('HttpModule is already loaded; Import it in the core module only.');\n }\n }\n\n static forRoot(config: HttpConfigData): ModuleWithProviders<HttpModule> {\n return {\n ngModule: HttpModule,\n providers: [\n {provide: HTTP_CONFIGURATION_DATA, useValue: config},\n {provide: HttpConfig, useFactory: createHttpConfig, deps: [HTTP_CONFIGURATION_DATA]},\n {provide: HTTP_INTERCEPTORS, useClass: BaseUrlInterceptor, multi: true},\n {provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true}\n ]\n };\n }\n\n}\n\nexport const HTTP_CONFIGURATION_DATA = new InjectionToken<HttpConfigData>('HTTP_CONFIGURATION_DATA');\n\nexport function createHttpConfig(data: HttpConfigData) {\n return new HttpConfig(data);\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.HttpConfig"],"mappings":";;;;;;MAGa,UAAU,CAAA;AAOnB,IAAA,WAAA,CAAY,IAAoB,EAAA;;QAcxB,IAAA,CAAA,YAAY,GAAG,CAAC,KAAoB,EAAE,aAAqB,KAAI;;AACnE,YAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC3B,KAAK,GAAG,EAAC,CAAC,aAAa,GAAG,KAAK,EAAC,CAAC;AACpC,aAAA;YAED,IAAI,SAAS,EAAE,EAAE;gBACb,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,gBAAA,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;AACvB,oBAAA,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AACzD,wBAAA,CAAA,EAAA,GAAA,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,KAAA,CAAA,GAAA,KAAA,C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A;AAFvD,UAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,YAFT,gBAAgB,CAAA,EAAA,CAAA,CAAA;wGAEjB,UAAU,EAAA,OAAA,EAAA,CAFV,CAAC,gBAAgB,CAAC,CAAA,EAAA,CAAA,CAAA;2FAElB,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,gBAAgB,CAAC;iBAC9B,CAAA;;wBAGyD,UAAU,EAAA,UAAA,EAAA,CAAA;8BAAnD,QAAQ;;8BAAI,QAAQ;;;MAoBxB,uBAAuB,GAAG,IAAI,cAAc,CAAiB,yBAAyB,EAAE;AAE/F,SAAU,gBAAgB,CAAC,IAAoB,EAAA;AACjD,IAAA,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAChC;;ACpCA;;AAEG;;;;"}
@@ -209,9 +209,9 @@ class BbLocalizeTemplate {
209
209
  this.name = null;
210
210
  }
211
211
  }
212
- BbLocalizeTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplate, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
213
- BbLocalizeTemplate.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbLocalizeTemplate, selector: "[bbLocalizeTemplate]", inputs: { name: ["bbLocalizeTemplate", "name"] }, ngImport: i0 });
214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplate, decorators: [{
212
+ BbLocalizeTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalizeTemplate, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
213
+ BbLocalizeTemplate.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.5", type: BbLocalizeTemplate, selector: "[bbLocalizeTemplate]", inputs: { name: ["bbLocalizeTemplate", "name"] }, ngImport: i0 });
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalizeTemplate, decorators: [{
215
215
  type: Directive,
216
216
  args: [{
217
217
  selector: '[bbLocalizeTemplate]'
@@ -236,9 +236,9 @@ class BbLocalizeTemplateOrString {
236
236
  this._viewContainerRef.createEmbeddedView(template);
237
237
  }
238
238
  }
239
- BbLocalizeTemplateOrString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplateOrString, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
240
- BbLocalizeTemplateOrString.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: { bbLocalizeTemplateOrString: "bbLocalizeTemplateOrString" }, ngImport: i0 });
241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeTemplateOrString, decorators: [{
239
+ BbLocalizeTemplateOrString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalizeTemplateOrString, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
240
+ BbLocalizeTemplateOrString.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.5", type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: { bbLocalizeTemplateOrString: "bbLocalizeTemplateOrString" }, ngImport: i0 });
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalizeTemplateOrString, decorators: [{
242
242
  type: Directive,
243
243
  args: [{
244
244
  selector: '[bbLocalizeTemplateOrString]'
@@ -315,9 +315,9 @@ class BbLocalizeString {
315
315
  ];
316
316
  }
317
317
  }
318
- BbLocalizeString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeString, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
319
- BbLocalizeString.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: BbLocalizeString, selector: "bb-localize-string", inputs: { substitutions: "substitutions", value: "value" }, host: { classAttribute: "bb-localize-string" }, queries: [{ propertyName: "items", predicate: BbLocalizeTemplate }], ngImport: i0, template: "<ng-container *ngFor=\"let component of components\">\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\n</ng-container>\n", styles: [".bb-localize-string{display:inline}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: ["bbLocalizeTemplateOrString"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalizeString, decorators: [{
318
+ BbLocalizeString.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalizeString, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
319
+ BbLocalizeString.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.5", type: BbLocalizeString, selector: "bb-localize-string", inputs: { substitutions: "substitutions", value: "value" }, host: { classAttribute: "bb-localize-string" }, queries: [{ propertyName: "items", predicate: BbLocalizeTemplate }], ngImport: i0, template: "<ng-container *ngFor=\"let component of components\">\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\n</ng-container>\n", styles: [".bb-localize-string{display:inline}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BbLocalizeTemplateOrString, selector: "[bbLocalizeTemplateOrString]", inputs: ["bbLocalizeTemplateOrString"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalizeString, decorators: [{
321
321
  type: Component,
322
322
  args: [{ selector: 'bb-localize-string', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, host: {
323
323
  'class': 'bb-localize-string'
@@ -537,6 +537,30 @@ class Localize {
537
537
  get locale() {
538
538
  return this._currentDictionary.locale;
539
539
  }
540
+ load(dictionary) {
541
+ var _a, _b, _c, _d;
542
+ return __awaiter(this, void 0, void 0, function* () {
543
+ const data = ((_a = this._state) === null || _a === void 0 ? void 0 : _a.hasKey(dictionary.stateKey))
544
+ ? (_b = this._state) === null || _b === void 0 ? void 0 : _b.get(dictionary.stateKey, {})
545
+ : null;
546
+ // Try to load the dictionary data.
547
+ const loaded = yield dictionary.load(data);
548
+ // Verify the data was loaded.
549
+ if (!loaded) {
550
+ throw new Error(`Localize: Could not correctly fetch the data from: "${dictionary.id}"`);
551
+ }
552
+ if (!this._platform.isBrowser && this._state) {
553
+ (_c = this._state) === null || _c === void 0 ? void 0 : _c.set(dictionary === null || dictionary === void 0 ? void 0 : dictionary.stateKey, (_d = dictionary === null || dictionary === void 0 ? void 0 : dictionary.data) !== null && _d !== void 0 ? _d : {});
554
+ }
555
+ // Combine the extra dictionary data.
556
+ (this._extras || []).forEach(extraDictionary => dictionary.combine(extraDictionary));
557
+ // Return the dictionary.
558
+ return dictionary;
559
+ });
560
+ }
561
+ set(dictionary) {
562
+ this._currentDictionary = dictionary;
563
+ }
540
564
  initialize() {
541
565
  return () => __awaiter(this, void 0, void 0, function* () { return this.load(this._currentDictionary); });
542
566
  }
@@ -667,27 +691,6 @@ class Localize {
667
691
  return this._dictionaries.find(item => item.supportedLanguages.includes(languageCode));
668
692
  }).filter(item => !!item).find((_, index) => index === 0);
669
693
  }
670
- load(dictionary) {
671
- var _a, _b, _c, _d;
672
- return __awaiter(this, void 0, void 0, function* () {
673
- const data = ((_a = this._state) === null || _a === void 0 ? void 0 : _a.hasKey(dictionary.stateKey))
674
- ? (_b = this._state) === null || _b === void 0 ? void 0 : _b.get(dictionary.stateKey, {})
675
- : null;
676
- // Try to load the dictionary data.
677
- const loaded = yield dictionary.load(data);
678
- // Verify the data was loaded.
679
- if (!loaded) {
680
- throw new Error(`Localize: Could not correctly fetch the data from: "${dictionary.id}"`);
681
- }
682
- if (!this._platform.isBrowser && this._state) {
683
- (_c = this._state) === null || _c === void 0 ? void 0 : _c.set(dictionary === null || dictionary === void 0 ? void 0 : dictionary.stateKey, (_d = dictionary === null || dictionary === void 0 ? void 0 : dictionary.data) !== null && _d !== void 0 ? _d : {});
684
- }
685
- // Combine the extra dictionary data.
686
- (this._extras || []).forEach(extraDictionary => dictionary.combine(extraDictionary));
687
- // Return the dictionary.
688
- return dictionary;
689
- });
690
- }
691
694
  renderDocumentLanguage() {
692
695
  var _a, _b, _c, _d, _e;
693
696
  const element = (_a = this._document) === null || _a === void 0 ? void 0 : _a.documentElement;
@@ -697,9 +700,9 @@ class Localize {
697
700
  element.lang = (_d = (_c = (_b = this._currentDictionary) === null || _b === void 0 ? void 0 : _b.supportedLanguages) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : (_e = this._currentDictionary) === null || _e === void 0 ? void 0 : _e.locale;
698
701
  }
699
702
  }
700
- Localize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: Localize, deps: [{ token: i1$1.HttpClient }, { token: i2.Storage }, { token: i3.Platform }, { token: i3.Languages }, { token: i4.TransferState, optional: true }, { token: LocalizeConfig, optional: true }, { token: LocalizeMissingHandler }, { token: DOCUMENT, optional: true }, { token: LOCATION, optional: true }, { token: BASE_URL, optional: true }, { token: LOCALIZE_FUNCTION, optional: true }, { token: LOCALIZE_EXTRA_DICTIONARY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
701
- Localize.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: Localize });
702
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: Localize, decorators: [{
703
+ Localize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: Localize, deps: [{ token: i1$1.HttpClient }, { token: i2.Storage }, { token: i3.Platform }, { token: i3.Languages }, { token: i4.TransferState, optional: true }, { token: LocalizeConfig, optional: true }, { token: LocalizeMissingHandler }, { token: DOCUMENT, optional: true }, { token: LOCATION, optional: true }, { token: BASE_URL, optional: true }, { token: LOCALIZE_FUNCTION, optional: true }, { token: LOCALIZE_EXTRA_DICTIONARY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
704
+ Localize.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: Localize });
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: Localize, decorators: [{
703
706
  type: Injectable
704
707
  }], ctorParameters: function () {
705
708
  return [{ type: i1$1.HttpClient }, { type: i2.Storage }, { type: i3.Platform }, { type: i3.Languages }, { type: i4.TransferState, decorators: [{
@@ -769,9 +772,9 @@ class BbLocalize {
769
772
  return Object.assign(Object.assign({}, params), options);
770
773
  }
771
774
  }
772
- BbLocalize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalize, deps: [{ token: Localize, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
773
- BbLocalize.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalize, name: "bbLocalize" });
774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BbLocalize, decorators: [{
775
+ BbLocalize.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalize, deps: [{ token: Localize, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
776
+ BbLocalize.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalize, name: "bbLocalize" });
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BbLocalize, decorators: [{
775
778
  type: Pipe,
776
779
  args: [{
777
780
  name: 'bbLocalize'
@@ -784,11 +787,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
784
787
 
785
788
  class LocalizeModule {
786
789
  static forRoot(config) {
790
+ var _a;
791
+ const automatic = (_a = config === null || config === void 0 ? void 0 : config.automatic) !== null && _a !== void 0 ? _a : true;
787
792
  return {
788
793
  ngModule: LocalizeModule,
789
794
  providers: [
790
795
  // Angular providers.
791
- { provide: APP_INITIALIZER, deps: [Localize], useFactory: initializeLocale, multi: true },
796
+ ...(automatic
797
+ ? [{ provide: APP_INITIALIZER, deps: [Localize], useFactory: initializeLocale, multi: true }]
798
+ : []),
792
799
  { provide: LOCALE_ID, deps: [Localize], useFactory: getLocale },
793
800
  // Config provider.
794
801
  { provide: LocalizeConfig, useValue: config },
@@ -804,15 +811,15 @@ class LocalizeModule {
804
811
  };
805
812
  }
806
813
  }
807
- LocalizeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
808
- LocalizeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, declarations: [BbLocalize,
814
+ LocalizeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LocalizeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
815
+ LocalizeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LocalizeModule, declarations: [BbLocalize,
809
816
  BbLocalizeString,
810
817
  BbLocalizeTemplate,
811
818
  BbLocalizeTemplateOrString], imports: [CommonModule, HttpClientModule], exports: [BbLocalize,
812
819
  BbLocalizeString,
813
820
  BbLocalizeTemplate] });
814
- LocalizeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, imports: [[CommonModule, HttpClientModule]] });
815
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: LocalizeModule, decorators: [{
821
+ LocalizeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LocalizeModule, imports: [[CommonModule, HttpClientModule]] });
822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LocalizeModule, decorators: [{
816
823
  type: NgModule,
817
824
  args: [{
818
825
  imports: [CommonModule, HttpClientModule],
@@ -1 +1 @@
1
- {"version":3,"file":"bravobit-bb-foundation-localize.mjs","sources":["../../../projects/bb-foundation/localize/src/lib/interfaces/config.interfaces.ts","../../../projects/bb-foundation/localize/src/lib/interfaces/functions.interfaces.ts","../../../projects/bb-foundation/localize/src/lib/interfaces/dictionary.interfaces.ts","../../../projects/bb-foundation/localize/src/lib/functions/lowercase.function.ts","../../../projects/bb-foundation/localize/src/lib/functions/uppercase.function.ts","../../../projects/bb-foundation/localize/src/lib/functions/date.function.ts","../../../projects/bb-foundation/localize/src/lib/localizations/english.localization.ts","../../../projects/bb-foundation/localize/src/lib/localizations/dutch.localization.ts","../../../projects/bb-foundation/localize/src/lib/handlers/missing.handler.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-template.directive.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-template-or-string.directive.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-string/localize-string.component.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-string/localize-string.component.html","../../../projects/bb-foundation/localize/src/lib/localize.dictionary.ts","../../../projects/bb-foundation/localize/src/lib/localize.service.ts","../../../projects/bb-foundation/localize/src/lib/localize.pipe.ts","../../../projects/bb-foundation/localize/src/lib/localize.module.ts","../../../projects/bb-foundation/localize/src/bravobit-bb-foundation-localize.ts"],"sourcesContent":["import {LocalizeDictionaryParams} from './dictionary.interfaces';\n\n//\n// The configuration that can be passed when\n// the user initializes the localize module.\n//\n\nexport class LocalizeConfig {\n dictionary: LocalizeDictionaryParams[] = [];\n substitutions?: {\n references?: string[];\n interpolation?: string[];\n };\n}\n","import {InjectionToken} from '@angular/core';\n\n//\n// This is the interface that handles the localize functions.\n// every localize function needs to conform to this interface.\n// The interface allows the user to transform a token into\n// another value.\n//\n\nexport interface LocalizeFunction {\n\n keyword(): string;\n\n transform(value: string, locale?: string): string;\n\n}\n\n//\n// This is the interface that handles the map\n// of all the localize functions.\n//\n\nexport interface LocalizeFunctionMap {\n [keyword: string]: LocalizeFunction;\n}\n\n//\n// This is the injection token that will be injected\n// into the service so that the all localize functions\n// can retrieved and used.\n//\n\nexport const LOCALIZE_FUNCTION\n : InjectionToken<LocalizeFunction[]>\n = new InjectionToken('localize_function');\n","import {InjectionToken} from '@angular/core';\n\n//\n// This interface represents the data that\n// the user can pass to define a dictionary.\n//\n\nexport interface LocalizeDictionaryParams {\n id: string;\n data?: string | object;\n locale?: string;\n supportedLanguages?: string[];\n}\n\n//\n// The extra dictionary data that can be passed.\n//\n\nexport type LocalizeExtraDictionary = {\n locale: string;\n data: object;\n};\n\n//\n// This is the injection token that will be injected\n// into the service so that the all extra dictionaries\n// can retrieved and used.\n//\n\nexport const LOCALIZE_EXTRA_DICTIONARY\n : InjectionToken<LocalizeExtraDictionary[]>\n = new InjectionToken('localize_extra_dictionary');\n","import {LocalizeFunction} from '../interfaces/functions.interfaces';\n\n//\n// This function transform the value\n// to a lowercase variant of the value.\n//\n\nexport class LocalizeLowercaseFunction implements LocalizeFunction {\n\n keyword() {\n return 'lowercase';\n }\n\n transform(value: string) {\n return (value || '').toLowerCase();\n }\n\n}\n","import {LocalizeFunction} from '../interfaces/functions.interfaces';\n\n//\n// This function transform the value\n// to a uppercase variant of the value.\n//\n\nexport class LocalizeUppercaseFunction implements LocalizeFunction {\n\n keyword() {\n return 'uppercase';\n }\n\n transform(value: string) {\n return (value || '').toUpperCase();\n }\n\n}\n","import {LocalizeFunction} from '../interfaces/functions.interfaces';\nimport {formatDate} from '@angular/common';\n\n//\n// This function transform the value\n// to a localized date.\n//\n\nexport class LocalizeDateFunction implements LocalizeFunction {\n\n keyword() {\n return 'date';\n }\n\n transform(value: string, locale?: string) {\n const date = new Date(value);\n\n if (date.toString() === 'Invalid Date') {\n return '?';\n }\n\n return formatDate(date, 'longDate', locale);\n }\n\n}\n","import {LOCALIZE_EXTRA_DICTIONARY} from '../interfaces/dictionary.interfaces';\n\nexport const LOCALIZATION_EXTRA_ENGLISH = {\n provide: LOCALIZE_EXTRA_DICTIONARY,\n useValue: {\n locale: 'en-US',\n data: {\n 'form-control-errors': {\n 'unknown': 'The field has an unknown error.',\n 'required': 'This field is required.',\n 'pattern': 'Invalid format.',\n 'email': 'The field does not match a valid email address.',\n 'emailTaken': 'The e-mail is already taken.',\n 'passwordMatch': 'The passwords don\\'t match.',\n 'confirm': 'The field does not match.',\n 'fullNumber': 'The field should be a full number.',\n 'min': 'Minimum amount should be {{min}}.',\n 'max': 'Maximum amount should be {{max}}.',\n 'invalidFileType': 'The file type is not allowed.',\n 'maxFileSize': 'The file has exceed the maximum amount of {{maxSize}}.',\n 'minDate': 'The first accepted date is {{date|date}}.',\n 'maxDate': 'The last accepted date is {{date|date}}.',\n 'invalidDate': 'The field contains an invalid date.',\n 'minlength': 'Expected a minimum of {{requiredLength}} characters but got {{actualLength}} characters.',\n 'maxlength': 'Expected a maximum of {{requiredLength}} characters but got {{actualLength}} characters.'\n },\n 'tables': {\n 'search': 'Search...',\n 'loading': 'Loading...',\n 'empty': 'There is nothing to find here.',\n 'page': 'page',\n 'error_datasource': 'No data source was provided.',\n 'error_unauthorized': 'You need to be authenticated to view this data.',\n 'error_forbidden': 'You do not have access to view this data.',\n 'error_not_found': 'The data was not found.',\n 'error_server': 'A server error occurred while fetching data from the server.',\n 'error_down': 'It looks like the server is down.',\n 'error_unknown': 'A unknown error occurred.'\n },\n 'file-picker': {\n 'choose': 'Choose file',\n 'remove': 'Remove file',\n 'drop': 'or drag and drop file here'\n },\n 'times': {\n 'tomorrow_at': 'Tomorrow at {{date}}',\n 'today_at': 'Today at {{date}}',\n 'yesterday_at': 'Yesterday at {{date}}'\n }\n }\n },\n multi: true\n};\n","import {LOCALIZE_EXTRA_DICTIONARY} from '../interfaces/dictionary.interfaces';\n\nexport const LOCALIZATION_EXTRA_DUTCH = {\n provide: LOCALIZE_EXTRA_DICTIONARY,\n useValue: {\n locale: 'nl-NL',\n data: {\n 'form-control-errors': {\n 'unknown': 'Het veld heeft een onbekende fout.',\n 'required': 'Dit veld is verplicht.',\n 'pattern': 'Ongeldig formaat.',\n 'email': 'Het veld komt niet overeen met een geldig e-mailadres.',\n 'emailTaken': 'Het e-mailadres is al bezet.',\n 'passwordMatch': 'De wachtwoorden komen niet overeen.',\n 'confirm': 'Het veld komt niet overeen.',\n 'fullNumber': 'Het veld moet een volledig getal zijn.',\n 'min': 'Minimum hoeveelheid moet {{min}} zijn.',\n 'max': 'Maximum hoeveelheid moet {{max}} zijn.',\n 'invalidFileType': 'Het type bestand is niet toegestaan.',\n 'maxFileSize': 'Het bestand heeft de maximum hoeveelheid van {{maxSize}} overschreden.',\n 'minDate': 'De eerst mogelijke datum is {{date|date}}.',\n 'maxDate': 'De laatst mogelijke datum is {{date|date}}.',\n 'invalidDate': 'Het veld bevat een ongeldige datum.',\n 'minlength': 'Verwachtte minimaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.',\n 'maxlength': 'Verwachtte maximaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.'\n },\n 'tables': {\n 'search': 'Zoeken...',\n 'loading': 'Aan het laden...',\n 'empty': 'Er is hier niets te vinden.',\n 'page': 'pagina',\n 'error_datasource': 'Er is geen gegevensbron verstrekt.',\n 'error_unauthorized': 'U moet ingelogd zijn om deze gegevens te bekijken.',\n 'error_forbidden': 'U hebt geen toegang om deze gegevens te bekijken.',\n 'error_not_found': 'De gegevens zijn niet gevonden.',\n 'error_server': 'Er is een serverfout opgetreden bij het ophalen van gegevens van de server.',\n 'error_down': 'Het lijkt erop dat de server down is.',\n 'error_unknown': 'Er is een onbekende fout opgetreden bij het ophalen van gegevens van de server.'\n },\n 'file-picker': {\n 'choose': 'Kies bestand',\n 'remove': 'Verwijder bestand',\n 'drop': 'of sleep het bestand hiernaartoe'\n },\n 'times': {\n 'tomorrow_at': 'Morgen om {{date}}',\n 'today_at': 'Vandaag om {{date}}',\n 'yesterday_at': 'Gisteren om {{date}}'\n }\n }\n },\n multi: true\n};\n","import {LocalizeHandlerProtocol} from '../interfaces/handlers.interfaces';\nimport {LocalizeParams} from '../interfaces/options.interfaces';\n\nexport class LocalizeMissingHandler implements LocalizeHandlerProtocol {\n\n handle(params: LocalizeParams) {\n // Log to the console when the token was not found\n // if the user did not mark it as optional.\n if (!params.optional) {\n this.log(`Localize: The token with name: \"${params.token}\" was not found.`);\n }\n\n // Return the default token back.\n return params.token;\n }\n\n private log = (message: string) => {\n console && console.warn && console.warn(message);\n };\n\n}\n","import {Directive, Input, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[bbLocalizeTemplate]'\n})\nexport class BbLocalizeTemplate {\n\n // Inputs.\n @Input('bbLocalizeTemplate') name: string | null = null;\n\n constructor(public templateRef: TemplateRef<any>) {\n }\n\n}\n","import {Directive, Input, TemplateRef, ViewContainerRef} from '@angular/core';\n\n@Directive({\n selector: '[bbLocalizeTemplateOrString]'\n})\nexport class BbLocalizeTemplateOrString {\n\n @Input() set bbLocalizeTemplateOrString(content: string | TemplateRef<any>) {\n // Get the template.\n const template = content instanceof TemplateRef\n ? content\n : this._templateRef;\n\n // Clear the view container ref and create the view.\n this._viewContainerRef.clear();\n this._viewContainerRef.createEmbeddedView(template);\n }\n\n constructor(private _templateRef: TemplateRef<any>,\n private _viewContainerRef: ViewContainerRef) {\n }\n\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Input,\n OnDestroy,\n QueryList,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport {BbLocalizeTemplate} from '../localize-template.directive';\nimport {startWith} from 'rxjs/operators';\nimport {Subscription} from 'rxjs';\n\n@Component({\n selector: 'bb-localize-string',\n templateUrl: './localize-string.component.html',\n styleUrls: ['./localize-string.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n preserveWhitespaces: false,\n host: {\n 'class': 'bb-localize-string'\n }\n})\nexport class BbLocalizeString implements AfterViewInit, OnDestroy {\n\n // Content children.\n @ContentChildren(BbLocalizeTemplate) items?: QueryList<BbLocalizeTemplate>;\n\n // Inputs.\n @Input() substitutions: [string, string] = ['[', ']'];\n\n // Data.\n components: (string | TemplateRef<any>)[] = [];\n\n // Subscriptions.\n private _subscription = new Subscription();\n\n // State.\n private _value: string | null = null;\n\n @Input()\n set value(value: string | null) {\n this._value = value;\n this.revalidate();\n }\n\n get value() {\n return this._value;\n }\n\n constructor(private _changeDetection: ChangeDetectorRef) {\n }\n\n ngAfterViewInit() {\n this.observeItemChanges();\n }\n\n ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n\n private observeItemChanges() {\n const subscription = this.items.changes.pipe(\n startWith(0)\n ).subscribe(() => this.revalidate());\n\n this._subscription.add(subscription);\n }\n\n private revalidate() {\n const items = this.items?.toArray() ?? [];\n if (items.length <= 0) {\n return;\n }\n\n this.setComponents(items);\n }\n\n private setComponents(items: BbLocalizeTemplate[]) {\n const [start, end] = this.substitutions;\n\n const templates = items.reduce((previous, current) => {\n const template = current?.templateRef ?? null;\n const name = current?.name ?? null;\n if (!template || !name) {\n return previous;\n }\n\n return {...previous, [`${start}${name}${end}`]: template};\n }, {});\n\n this.components = this.getStringComponents(this._value)\n .map(component => templates?.[component] ?? component ?? null)\n .filter(item => !!item);\n\n this._changeDetection.detectChanges();\n }\n\n private getStringComponents(value: string) {\n const [start, end] = this.getSubstitutions();\n const regex = new RegExp(`(${start}[a-zA-Z]+${end})`, 'g');\n return value.split(regex);\n }\n\n private getSubstitutions() {\n const [start, end] = this.substitutions;\n const escape = /[.*+?^${}()|[\\]\\\\]/g;\n\n return [\n start.replace(escape, '\\\\$&'),\n end.replace(escape, '\\\\$&')\n ];\n }\n\n}\n","<ng-container *ngFor=\"let component of components\">\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\n</ng-container>\n","import {LocalizeDictionaryParams, LocalizeExtraDictionary} from './interfaces/dictionary.interfaces';\nimport {makeStateKey, StateKey} from '@angular/platform-browser';\nimport {USE_AUTHORIZATION} from '@bravobit/bb-foundation/auth';\nimport {HttpClient, HttpContext} from '@angular/common/http';\nimport {firstValueFrom} from 'rxjs';\n\nexport class LocalizeDictionary {\n\n // Readonly data.\n private readonly _id: string;\n private readonly _locale: string;\n private readonly _supportedLanguages: string[];\n private readonly _http: HttpClient;\n\n readonly stateKey: StateKey<object>;\n\n // Dictionary data.\n private _data: object = {};\n private _url: string | null = null;\n\n constructor({id, data, locale, supportedLanguages}: LocalizeDictionaryParams, baseUrl: string, http: HttpClient) {\n this._id = id;\n this._locale = locale || 'en-US';\n this._supportedLanguages = supportedLanguages || [];\n this._http = http;\n this.stateKey = makeStateKey(`locale:${this._id}`);\n\n // Set the correct variable to the url or data.\n if (typeof data === 'string') {\n this._url = this.getUrl(data, baseUrl);\n } else {\n this._data = data;\n }\n }\n\n get id() {\n return this._id;\n }\n\n get locale() {\n return this._locale;\n }\n\n get supportedLanguages() {\n return this._supportedLanguages;\n }\n\n get data() {\n return this._data;\n }\n\n async load(data?: object | null) {\n // Check if data was passed.\n if (data) {\n this.setData(data);\n return true;\n }\n\n // If the url was not set the data was already loaded\n // return true because it was successful.\n if (!this._url) {\n return true;\n }\n\n try {\n // Try to load the data via a HTTP request.\n const context = new HttpContext().set(USE_AUTHORIZATION, false);\n const result$ = this._http.get<object>(this._url, {context});\n const result = await firstValueFrom(result$);\n\n // Set the data.\n this.setData(result);\n\n // Return true because it succeeded.\n return true;\n } catch {\n // Return false because it failed.\n return false;\n }\n }\n\n combine(extraDictionary: LocalizeExtraDictionary, mode: 'prepend' | 'append' = 'prepend') {\n // Validate that the locale matches.\n if (extraDictionary.locale !== this._locale) {\n return;\n }\n\n // Extract the extra data.\n const extraData = extraDictionary.data || {};\n\n // If the selected mode is prepend\n // add the data in front.\n if (mode === 'prepend') {\n this._data = {...extraData, ...this._data};\n return;\n }\n\n // If the selected mode is append\n // add the data in the back.\n this._data = {...this._data, ...extraData};\n }\n\n search(token: string) {\n // Check if the token is present in the\n // data, if so return it.\n if (this._data[token]) {\n return this._data[token];\n }\n\n // Values might be nested in objects this means we need\n // to split them on the dot and search them recursively\n // in the data.\n const value = (token || '')\n .split('.')\n .filter(value => !!value)\n .reduce(this.recursiveSearchValue, this._data);\n\n // Check if the value is a string\n // if this is true it can be returned.\n if (typeof value === 'string') {\n return value;\n }\n\n // This means the translation was incorrect.\n return null;\n }\n\n private setData(data: object) {\n this._data = data ?? {};\n this._url = null;\n }\n\n private getUrl(value: string, baseUrl: string) {\n const isAbsolute = this.isAbsoluteUrl(value);\n if (isAbsolute || !baseUrl) {\n return value;\n }\n\n return [baseUrl, value].join('/');\n }\n\n private isAbsoluteUrl = (url: string) => {\n if (url.indexOf('//') === 0) {\n return true;\n }\n\n if (url.indexOf('://') === -1) {\n return false;\n }\n\n if (url.indexOf('.') === -1) {\n return false;\n }\n\n if (url.indexOf('/') === -1) {\n return false;\n }\n\n if (url.indexOf(':') > url.indexOf('/')) {\n return false;\n }\n\n return url.indexOf('://') < url.indexOf('.');\n };\n\n private recursiveSearchValue = (data, value) => {\n if (typeof data === 'undefined' || typeof data === 'string') {\n return undefined;\n }\n\n return data[value];\n };\n\n}\n","import {LOCALIZE_FUNCTION, LocalizeFunction, LocalizeFunctionMap} from './interfaces/functions.interfaces';\nimport {LOCALIZE_EXTRA_DICTIONARY, LocalizeExtraDictionary} from './interfaces/dictionary.interfaces';\nimport {LocalizeOptionsData, LocalizeParams} from './interfaces/options.interfaces';\nimport {BASE_URL, Languages, LOCATION, Platform} from '@bravobit/bb-foundation';\nimport {LocalizeMissingHandler} from './handlers/missing.handler';\nimport {LocalizeConfig} from './interfaces/config.interfaces';\nimport {Inject, Injectable, Optional} from '@angular/core';\nimport {LocalizeDictionary} from './localize.dictionary';\nimport {Storage} from '@bravobit/bb-foundation/storage';\nimport {TransferState} from '@angular/platform-browser';\nimport {HttpClient} from '@angular/common/http';\nimport {DOCUMENT} from '@angular/common';\n\n@Injectable()\nexport class Localize {\n\n // Readonly data.\n private readonly _dictionaries: LocalizeDictionary[];\n private readonly _currentDictionary: LocalizeDictionary;\n private readonly _functionMiddleware: LocalizeFunctionMap;\n private readonly _storageToken: string = 'bb-language-dictionary-id';\n\n constructor(private _http: HttpClient,\n private _storage: Storage,\n private _platform: Platform,\n private _languages: Languages,\n @Optional() private _state: TransferState,\n @Optional() private _config: LocalizeConfig,\n private _missingHandler: LocalizeMissingHandler,\n @Optional() @Inject(DOCUMENT) private _document?: any,\n @Optional() @Inject(LOCATION) private _location?: any,\n @Optional() @Inject(BASE_URL) private _baseUrl?: string,\n @Optional() @Inject(LOCALIZE_FUNCTION) private _functions?: LocalizeFunction[],\n @Optional() @Inject(LOCALIZE_EXTRA_DICTIONARY) private _extras?: LocalizeExtraDictionary[]) {\n // Check if at least one language was passed in the config.\n if (this._config.dictionary.length < 1) {\n throw new Error('Localize: one or more languages should be supplied.');\n }\n\n // Gather the dictionaries.\n this._dictionaries = this._config.dictionary.map(item => {\n return new LocalizeDictionary(item, this._baseUrl, this._http);\n });\n\n // Save the best matching current dictionary.\n this._currentDictionary = this.retrieveBestMatchingDictionary();\n\n // Gather all the localize functions.\n this._functionMiddleware = this._functions.reduce((previous, current) => {\n previous[current.keyword()] = current;\n return previous;\n }, {});\n\n this.renderDocumentLanguage();\n }\n\n get dictionaries() {\n return this._dictionaries;\n }\n\n get current() {\n return this._currentDictionary;\n }\n\n get locale() {\n return this._currentDictionary.locale;\n }\n\n initialize() {\n return async () => this.load(this._currentDictionary);\n }\n\n change(id: string, reload: boolean = true) {\n // Try to fetch the dictionary.\n const dictionary = this._dictionaries.find(item => item.id === id);\n\n // Validate the dictionary exists.\n if (!dictionary) {\n throw new Error(`Localize: Could not find dictionary with id: \"${id}\"`);\n }\n\n // Save the language in the storage.\n this._storage.cookie.set<string>(this._storageToken, dictionary.id, {});\n\n // Just quit if we don't need to reload.\n if (!reload) {\n return;\n }\n\n // We need to reload the application for the translations.\n return this.reload();\n }\n\n clear(reload: boolean = true) {\n // Remove the language in the local storage.\n this._storage.cookie.remove(this._storageToken);\n\n // Just quit if we don't need to reload.\n if (!reload) {\n return;\n }\n\n // We need to reload the application for the translations.\n return this.reload();\n }\n\n translate(tokenOrParams: string | LocalizeParams) {\n // 1. Convert to the params.\n const params = this.convertToParams(tokenOrParams);\n\n // 2. Try to find the translation in the dictionary.\n const searchResult = this._currentDictionary.search(params.token);\n\n // 3. Verify the translation was found.\n if (!searchResult) {\n return this._missingHandler.handle(params);\n }\n\n // 4. Find references in the translation that need to be translated as well.\n const processResult = this.findReferencesInTranslation(searchResult);\n\n // 5. Parse the interpolation data.\n return this.parseInterpolationData(processResult, params.data);\n }\n\n private parseInterpolationData(value: string, data: LocalizeOptionsData) {\n // Get the interpolation substitutions.\n const substitutions = this.getSubstitutions('interpolation', ['{{', '}}']);\n\n // Get all matches in the value.\n const matches = this.getMatches(value, substitutions);\n\n // Replace all matches with the parsed value.\n return matches.reduce((previous, current) => {\n // Try to parse the token.\n const interpolatedToken = this.interpolateFunctionData(current.token, data);\n\n // Replace the match with the parsed token.\n return previous.replace(current.match, interpolatedToken);\n }, `${value}`);\n }\n\n private interpolateFunctionData(value: string, interpolationData: LocalizeOptionsData) {\n // Get the token and the methods by splitting\n // on the pipe symbol.\n const [token, ...methods] = value.split('|').map(item => item.trim());\n\n // Get the value for the token from\n // the interpolation data.\n const interpolationValue = interpolationData[token] || token;\n\n // Loop through all the middleware methods and try to\n // conform the string to the given parameters.\n return methods.reduce((string, middlewareName) => {\n // Try to retrieve the middleware from the collection.\n const middleware = this._functionMiddleware[middlewareName];\n\n // If the middleware is missing return an error\n // so that the user knows it was not found.\n if (!middleware) {\n return string;\n }\n\n // Execute the middleware function with the string.\n return middleware.transform(string, this.locale);\n }, `${interpolationValue}`);\n }\n\n private findReferencesInTranslation(value: string) {\n // Get the reference substitutions.\n const substitutions = this.getSubstitutions('references', ['#(', ')']);\n\n // Get all matches in the value.\n const matches = this.getMatches(value, substitutions);\n\n // Replace all matches with the translated value.\n return matches.reduce((previous, current) => {\n // Try to translate the token.\n const translatedToken = this.translate(current.token);\n\n // Replace the match with the translated token.\n return previous.replace(current.match, translatedToken);\n }, value);\n }\n\n private getSubstitutions(type: string, defaultValue: string[]) {\n const substitutions = (this._config\n && this._config.substitutions\n && this._config.substitutions[type]);\n\n // Get the substitutions.\n const value = (!substitutions || substitutions.length !== 2)\n ? defaultValue\n : substitutions;\n\n // Escape both substitutions so that they\n // can be used.\n const escape = /[.*+?^${}()|[\\]\\\\]/g;\n const start = value[0].replace(escape, '\\\\$&');\n const end = value[1].replace(escape, '\\\\$&');\n\n // Return the substitutions.\n return {start, end};\n }\n\n private retrieveBestMatchingDictionary() {\n // Get the dictionary based on storage.\n const storageDictionary = this.getDictionaryFromStorage();\n\n // Get the dictionary based on the supported language.\n const browserDictionary = this.getBestBrowserMatchDictionary();\n\n // Get the dictionary based on the first index.\n const firstDictionary = this._dictionaries[0];\n\n // Return the best matching dictionary.\n return storageDictionary || browserDictionary || firstDictionary;\n }\n\n private getDictionaryFromStorage() {\n // Get dictionary id from the storage..\n const dictionaryId = this._storage.cookie.get<string>(this._storageToken);\n\n // Return the dictionary based on the storage dictionary id.\n return this._dictionaries.find(item => item.id === dictionaryId);\n }\n\n private getBestBrowserMatchDictionary() {\n // Loop through all browser languages and return the\n // best matching dictionary.\n return this._languages.all.map(({code, region}) => {\n const languageCode = [code, region].filter(data => !!data).join('-');\n\n return this._dictionaries.find(item => item.supportedLanguages.includes(languageCode));\n }).filter(item => !!item).find((_, index) => index === 0);\n }\n\n private convertToParams = (tokenOrParams: string | LocalizeParams) => {\n if (typeof tokenOrParams !== 'string') {\n // Destruct the params from the object.\n const {token, optional, data} = tokenOrParams;\n\n // Make sure all parameters are valid\n // by type safe adding them.\n return {token: token, optional: optional || false, data: data || {}};\n }\n\n // If the parameter is a string fill in the blanks.\n return {token: tokenOrParams, optional: false, data: {}};\n };\n\n private async load(dictionary: LocalizeDictionary) {\n const data = this._state?.hasKey(dictionary.stateKey)\n ? this._state?.get(dictionary.stateKey, {})\n : null;\n\n // Try to load the dictionary data.\n const loaded = await dictionary.load(data);\n\n // Verify the data was loaded.\n if (!loaded) {\n throw new Error(`Localize: Could not correctly fetch the data from: \"${dictionary.id}\"`);\n }\n\n if (!this._platform.isBrowser && this._state) {\n this._state?.set<object>(dictionary?.stateKey, dictionary?.data ?? {});\n }\n\n // Combine the extra dictionary data.\n (this._extras || []).forEach(extraDictionary => dictionary.combine(extraDictionary));\n\n // Return the dictionary.\n return dictionary;\n }\n\n private renderDocumentLanguage() {\n const element = this._document?.documentElement;\n if (!element) {\n return;\n }\n\n element.lang = this._currentDictionary?.supportedLanguages?.[0] ?? this._currentDictionary?.locale;\n }\n\n private getMatches = (value: string, substitutions: { start: string, end: string }) => {\n // Get the matching substitutions.\n const {start, end} = substitutions;\n\n // Compose a regex that will find the matches.\n const regex = new RegExp(`${start}([^${end}]+)${end}`, 'g');\n\n // Execute the regex to find matches.\n let match = regex.exec(value);\n const matches = [];\n\n while (match !== null) {\n // Push a new match.\n matches.push({\n match: match[0],\n token: match[1]\n });\n\n // Try to find more matches.\n match = regex.exec(value);\n }\n\n // Return the processed value.\n return matches.filter(item => !!item);\n };\n\n private reload = () => this._location?.reload();\n\n}\n","import {LocalizeOptions, LocalizeParams} from './interfaces/options.interfaces';\nimport {Optional, Pipe, PipeTransform} from '@angular/core';\nimport {Localize} from './localize.service';\n\n@Pipe({\n name: 'bbLocalize'\n})\nexport class BbLocalize implements PipeTransform {\n\n constructor(@Optional() private _localize: Localize) {\n }\n\n transform(tokenOrParams: string | LocalizeParams, args?: LocalizeOptions) {\n // Validate that the localize service\n // exists in the pipe.\n if (!this._localize) {\n return tokenOrParams;\n }\n\n // Combine the params with the options\n // to form the localize params.\n const params = this.combineParamsWithOptions(tokenOrParams, args);\n\n // Try to localize the value.\n return this._localize.translate(params);\n }\n\n private combineParamsWithOptions(tokenOrParams: string | LocalizeParams, args?: LocalizeOptions) {\n // Gather the extras.\n const extras = args || {};\n\n // Loop through all the keys to find the set options.\n const options = Object.keys(extras).reduce((previous, current) => {\n if (typeof extras[current] === 'undefined') {\n return previous;\n }\n\n previous[current] = extras[current];\n return previous;\n }, {});\n\n // Convert the string token to a params object.\n const params = typeof tokenOrParams === 'string'\n ? {token: tokenOrParams, optional: false, data: {}}\n : tokenOrParams;\n\n // Return the combined params and options.\n return {...params, ...options};\n }\n\n}\n","import {BbLocalizeTemplateOrString} from './views/localize-template-or-string.directive';\nimport {APP_INITIALIZER, LOCALE_ID, ModuleWithProviders, NgModule} from '@angular/core';\nimport {BbLocalizeString} from './views/localize-string/localize-string.component';\nimport {LocalizeLowercaseFunction} from './functions/lowercase.function';\nimport {LocalizeUppercaseFunction} from './functions/uppercase.function';\nimport {BbLocalizeTemplate} from './views/localize-template.directive';\nimport {LOCALIZE_FUNCTION} from './interfaces/functions.interfaces';\nimport {LocalizeMissingHandler} from './handlers/missing.handler';\nimport {LocalizeDateFunction} from './functions/date.function';\nimport {LocalizeConfig} from './interfaces/config.interfaces';\nimport {HttpClientModule} from '@angular/common/http';\nimport {CommonModule} from '@angular/common';\nimport {Localize} from './localize.service';\nimport {BbLocalize} from './localize.pipe';\n\n@NgModule({\n imports: [CommonModule, HttpClientModule],\n declarations: [\n BbLocalize,\n BbLocalizeString,\n BbLocalizeTemplate,\n BbLocalizeTemplateOrString\n ],\n exports: [\n BbLocalize,\n BbLocalizeString,\n BbLocalizeTemplate\n ]\n})\nexport class LocalizeModule {\n\n static forRoot(config: LocalizeConfig): ModuleWithProviders<LocalizeModule> {\n return {\n ngModule: LocalizeModule,\n providers: [\n // Angular providers.\n {provide: APP_INITIALIZER, deps: [Localize], useFactory: initializeLocale, multi: true},\n {provide: LOCALE_ID, deps: [Localize], useFactory: getLocale},\n // Config provider.\n {provide: LocalizeConfig, useValue: config},\n // Function providers.\n {provide: LOCALIZE_FUNCTION, useClass: LocalizeLowercaseFunction, multi: true},\n {provide: LOCALIZE_FUNCTION, useClass: LocalizeUppercaseFunction, multi: true},\n {provide: LOCALIZE_FUNCTION, useClass: LocalizeDateFunction, multi: true},\n // Handler providers.\n {provide: LocalizeMissingHandler, useClass: LocalizeMissingHandler},\n // Service providers.\n Localize\n ]\n };\n }\n\n}\n\nexport function initializeLocale(localize: Localize) {\n return localize.initialize();\n}\n\nexport function getLocale(localize: Localize) {\n return localize.locale;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;MAEa,cAAc;IAA3B;QACI,eAAU,GAA+B,EAAE,CAAC;KAK/C;;;ACaD;AACA;AACA;AACA;AACA;MAEa,iBAAiB,GAExB,IAAI,cAAc,CAAC,mBAAmB;;ACX5C;AACA;AACA;AACA;AACA;MAEa,yBAAyB,GAEhC,IAAI,cAAc,CAAC,2BAA2B;;AC7BpD;AACA;AACA;AACA;MAEa,yBAAyB;IAElC,OAAO;QACH,OAAO,WAAW,CAAC;KACtB;IAED,SAAS,CAAC,KAAa;QACnB,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;KACtC;;;ACbL;AACA;AACA;AACA;MAEa,yBAAyB;IAElC,OAAO;QACH,OAAO,WAAW,CAAC;KACtB;IAED,SAAS,CAAC,KAAa;QACnB,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;KACtC;;;ACZL;AACA;AACA;AACA;MAEa,oBAAoB;IAE7B,OAAO;QACH,OAAO,MAAM,CAAC;KACjB;IAED,SAAS,CAAC,KAAa,EAAE,MAAe;QACpC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,cAAc,EAAE;YACpC,OAAO,GAAG,CAAC;SACd;QAED,OAAO,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;KAC/C;;;MCpBQ,0BAA0B,GAAG;IACtC,OAAO,EAAE,yBAAyB;IAClC,QAAQ,EAAE;QACN,MAAM,EAAE,OAAO;QACf,IAAI,EAAE;YACF,qBAAqB,EAAE;gBACnB,SAAS,EAAE,iCAAiC;gBAC5C,UAAU,EAAE,yBAAyB;gBACrC,SAAS,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ces/config.interfaces.ts","../../../projects/bb-foundation/localize/src/lib/interfaces/functions.interfaces.ts","../../../projects/bb-foundation/localize/src/lib/interfaces/dictionary.interfaces.ts","../../../projects/bb-foundation/localize/src/lib/functions/lowercase.function.ts","../../../projects/bb-foundation/localize/src/lib/functions/uppercase.function.ts","../../../projects/bb-foundation/localize/src/lib/functions/date.function.ts","../../../projects/bb-foundation/localize/src/lib/localizations/english.localization.ts","../../../projects/bb-foundation/localize/src/lib/localizations/dutch.localization.ts","../../../projects/bb-foundation/localize/src/lib/handlers/missing.handler.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-template.directive.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-template-or-string.directive.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-string/localize-string.component.ts","../../../projects/bb-foundation/localize/src/lib/views/localize-string/localize-string.component.html","../../../projects/bb-foundation/localize/src/lib/localize.dictionary.ts","../../../projects/bb-foundation/localize/src/lib/localize.service.ts","../../../projects/bb-foundation/localize/src/lib/localize.pipe.ts","../../../projects/bb-foundation/localize/src/lib/localize.module.ts","../../../projects/bb-foundation/localize/src/bravobit-bb-foundation-localize.ts"],"sourcesContent":["import {LocalizeDictionaryParams} from './dictionary.interfaces';\n\n//\n// The configuration that can be passed when\n// the user initializes the localize module.\n//\n\nexport class LocalizeConfig {\n dictionary: LocalizeDictionaryParams[] = [];\n automatic?: boolean;\n substitutions?: {\n references?: string[];\n interpolation?: string[];\n };\n}\n","import {InjectionToken} from '@angular/core';\n\n//\n// This is the interface that handles the localize functions.\n// every localize function needs to conform to this interface.\n// The interface allows the user to transform a token into\n// another value.\n//\n\nexport interface LocalizeFunction {\n\n keyword(): string;\n\n transform(value: string, locale?: string): string;\n\n}\n\n//\n// This is the interface that handles the map\n// of all the localize functions.\n//\n\nexport interface LocalizeFunctionMap {\n [keyword: string]: LocalizeFunction;\n}\n\n//\n// This is the injection token that will be injected\n// into the service so that the all localize functions\n// can retrieved and used.\n//\n\nexport const LOCALIZE_FUNCTION\n : InjectionToken<LocalizeFunction[]>\n = new InjectionToken('localize_function');\n","import {InjectionToken} from '@angular/core';\n\n//\n// This interface represents the data that\n// the user can pass to define a dictionary.\n//\n\nexport interface LocalizeDictionaryParams {\n id: string;\n data?: string | object;\n locale?: string;\n supportedLanguages?: string[];\n}\n\n//\n// The extra dictionary data that can be passed.\n//\n\nexport type LocalizeExtraDictionary = {\n locale: string;\n data: object;\n};\n\n//\n// This is the injection token that will be injected\n// into the service so that the all extra dictionaries\n// can retrieved and used.\n//\n\nexport const LOCALIZE_EXTRA_DICTIONARY\n : InjectionToken<LocalizeExtraDictionary[]>\n = new InjectionToken('localize_extra_dictionary');\n","import {LocalizeFunction} from '../interfaces/functions.interfaces';\n\n//\n// This function transform the value\n// to a lowercase variant of the value.\n//\n\nexport class LocalizeLowercaseFunction implements LocalizeFunction {\n\n keyword() {\n return 'lowercase';\n }\n\n transform(value: string) {\n return (value || '').toLowerCase();\n }\n\n}\n","import {LocalizeFunction} from '../interfaces/functions.interfaces';\n\n//\n// This function transform the value\n// to a uppercase variant of the value.\n//\n\nexport class LocalizeUppercaseFunction implements LocalizeFunction {\n\n keyword() {\n return 'uppercase';\n }\n\n transform(value: string) {\n return (value || '').toUpperCase();\n }\n\n}\n","import {LocalizeFunction} from '../interfaces/functions.interfaces';\nimport {formatDate} from '@angular/common';\n\n//\n// This function transform the value\n// to a localized date.\n//\n\nexport class LocalizeDateFunction implements LocalizeFunction {\n\n keyword() {\n return 'date';\n }\n\n transform(value: string, locale?: string) {\n const date = new Date(value);\n\n if (date.toString() === 'Invalid Date') {\n return '?';\n }\n\n return formatDate(date, 'longDate', locale);\n }\n\n}\n","import {LOCALIZE_EXTRA_DICTIONARY} from '../interfaces/dictionary.interfaces';\n\nexport const LOCALIZATION_EXTRA_ENGLISH = {\n provide: LOCALIZE_EXTRA_DICTIONARY,\n useValue: {\n locale: 'en-US',\n data: {\n 'form-control-errors': {\n 'unknown': 'The field has an unknown error.',\n 'required': 'This field is required.',\n 'pattern': 'Invalid format.',\n 'email': 'The field does not match a valid email address.',\n 'emailTaken': 'The e-mail is already taken.',\n 'passwordMatch': 'The passwords don\\'t match.',\n 'confirm': 'The field does not match.',\n 'fullNumber': 'The field should be a full number.',\n 'min': 'Minimum amount should be {{min}}.',\n 'max': 'Maximum amount should be {{max}}.',\n 'invalidFileType': 'The file type is not allowed.',\n 'maxFileSize': 'The file has exceed the maximum amount of {{maxSize}}.',\n 'minDate': 'The first accepted date is {{date|date}}.',\n 'maxDate': 'The last accepted date is {{date|date}}.',\n 'invalidDate': 'The field contains an invalid date.',\n 'minlength': 'Expected a minimum of {{requiredLength}} characters but got {{actualLength}} characters.',\n 'maxlength': 'Expected a maximum of {{requiredLength}} characters but got {{actualLength}} characters.'\n },\n 'tables': {\n 'search': 'Search...',\n 'loading': 'Loading...',\n 'empty': 'There is nothing to find here.',\n 'page': 'page',\n 'error_datasource': 'No data source was provided.',\n 'error_unauthorized': 'You need to be authenticated to view this data.',\n 'error_forbidden': 'You do not have access to view this data.',\n 'error_not_found': 'The data was not found.',\n 'error_server': 'A server error occurred while fetching data from the server.',\n 'error_down': 'It looks like the server is down.',\n 'error_unknown': 'A unknown error occurred.'\n },\n 'file-picker': {\n 'choose': 'Choose file',\n 'remove': 'Remove file',\n 'drop': 'or drag and drop file here'\n },\n 'times': {\n 'tomorrow_at': 'Tomorrow at {{date}}',\n 'today_at': 'Today at {{date}}',\n 'yesterday_at': 'Yesterday at {{date}}'\n }\n }\n },\n multi: true\n};\n","import {LOCALIZE_EXTRA_DICTIONARY} from '../interfaces/dictionary.interfaces';\n\nexport const LOCALIZATION_EXTRA_DUTCH = {\n provide: LOCALIZE_EXTRA_DICTIONARY,\n useValue: {\n locale: 'nl-NL',\n data: {\n 'form-control-errors': {\n 'unknown': 'Het veld heeft een onbekende fout.',\n 'required': 'Dit veld is verplicht.',\n 'pattern': 'Ongeldig formaat.',\n 'email': 'Het veld komt niet overeen met een geldig e-mailadres.',\n 'emailTaken': 'Het e-mailadres is al bezet.',\n 'passwordMatch': 'De wachtwoorden komen niet overeen.',\n 'confirm': 'Het veld komt niet overeen.',\n 'fullNumber': 'Het veld moet een volledig getal zijn.',\n 'min': 'Minimum hoeveelheid moet {{min}} zijn.',\n 'max': 'Maximum hoeveelheid moet {{max}} zijn.',\n 'invalidFileType': 'Het type bestand is niet toegestaan.',\n 'maxFileSize': 'Het bestand heeft de maximum hoeveelheid van {{maxSize}} overschreden.',\n 'minDate': 'De eerst mogelijke datum is {{date|date}}.',\n 'maxDate': 'De laatst mogelijke datum is {{date|date}}.',\n 'invalidDate': 'Het veld bevat een ongeldige datum.',\n 'minlength': 'Verwachtte minimaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.',\n 'maxlength': 'Verwachtte maximaal {{requiredLength}} tekens, maar kreeg {{actualLength}} tekens.'\n },\n 'tables': {\n 'search': 'Zoeken...',\n 'loading': 'Aan het laden...',\n 'empty': 'Er is hier niets te vinden.',\n 'page': 'pagina',\n 'error_datasource': 'Er is geen gegevensbron verstrekt.',\n 'error_unauthorized': 'U moet ingelogd zijn om deze gegevens te bekijken.',\n 'error_forbidden': 'U hebt geen toegang om deze gegevens te bekijken.',\n 'error_not_found': 'De gegevens zijn niet gevonden.',\n 'error_server': 'Er is een serverfout opgetreden bij het ophalen van gegevens van de server.',\n 'error_down': 'Het lijkt erop dat de server down is.',\n 'error_unknown': 'Er is een onbekende fout opgetreden bij het ophalen van gegevens van de server.'\n },\n 'file-picker': {\n 'choose': 'Kies bestand',\n 'remove': 'Verwijder bestand',\n 'drop': 'of sleep het bestand hiernaartoe'\n },\n 'times': {\n 'tomorrow_at': 'Morgen om {{date}}',\n 'today_at': 'Vandaag om {{date}}',\n 'yesterday_at': 'Gisteren om {{date}}'\n }\n }\n },\n multi: true\n};\n","import {LocalizeHandlerProtocol} from '../interfaces/handlers.interfaces';\nimport {LocalizeParams} from '../interfaces/options.interfaces';\n\nexport class LocalizeMissingHandler implements LocalizeHandlerProtocol {\n\n handle(params: LocalizeParams) {\n // Log to the console when the token was not found\n // if the user did not mark it as optional.\n if (!params.optional) {\n this.log(`Localize: The token with name: \"${params.token}\" was not found.`);\n }\n\n // Return the default token back.\n return params.token;\n }\n\n private log = (message: string) => {\n console && console.warn && console.warn(message);\n };\n\n}\n","import {Directive, Input, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[bbLocalizeTemplate]'\n})\nexport class BbLocalizeTemplate {\n\n // Inputs.\n @Input('bbLocalizeTemplate') name: string | null = null;\n\n constructor(public templateRef: TemplateRef<any>) {\n }\n\n}\n","import {Directive, Input, TemplateRef, ViewContainerRef} from '@angular/core';\n\n@Directive({\n selector: '[bbLocalizeTemplateOrString]'\n})\nexport class BbLocalizeTemplateOrString {\n\n @Input() set bbLocalizeTemplateOrString(content: string | TemplateRef<any>) {\n // Get the template.\n const template = content instanceof TemplateRef\n ? content\n : this._templateRef;\n\n // Clear the view container ref and create the view.\n this._viewContainerRef.clear();\n this._viewContainerRef.createEmbeddedView(template);\n }\n\n constructor(private _templateRef: TemplateRef<any>,\n private _viewContainerRef: ViewContainerRef) {\n }\n\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Input,\n OnDestroy,\n QueryList,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport {BbLocalizeTemplate} from '../localize-template.directive';\nimport {startWith} from 'rxjs/operators';\nimport {Subscription} from 'rxjs';\n\n@Component({\n selector: 'bb-localize-string',\n templateUrl: './localize-string.component.html',\n styleUrls: ['./localize-string.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n preserveWhitespaces: false,\n host: {\n 'class': 'bb-localize-string'\n }\n})\nexport class BbLocalizeString implements AfterViewInit, OnDestroy {\n\n // Content children.\n @ContentChildren(BbLocalizeTemplate) items?: QueryList<BbLocalizeTemplate>;\n\n // Inputs.\n @Input() substitutions: [string, string] = ['[', ']'];\n\n // Data.\n components: (string | TemplateRef<any>)[] = [];\n\n // Subscriptions.\n private _subscription = new Subscription();\n\n // State.\n private _value: string | null = null;\n\n @Input()\n set value(value: string | null) {\n this._value = value;\n this.revalidate();\n }\n\n get value() {\n return this._value;\n }\n\n constructor(private _changeDetection: ChangeDetectorRef) {\n }\n\n ngAfterViewInit() {\n this.observeItemChanges();\n }\n\n ngOnDestroy() {\n this._subscription?.unsubscribe();\n }\n\n private observeItemChanges() {\n const subscription = this.items.changes.pipe(\n startWith(0)\n ).subscribe(() => this.revalidate());\n\n this._subscription.add(subscription);\n }\n\n private revalidate() {\n const items = this.items?.toArray() ?? [];\n if (items.length <= 0) {\n return;\n }\n\n this.setComponents(items);\n }\n\n private setComponents(items: BbLocalizeTemplate[]) {\n const [start, end] = this.substitutions;\n\n const templates = items.reduce((previous, current) => {\n const template = current?.templateRef ?? null;\n const name = current?.name ?? null;\n if (!template || !name) {\n return previous;\n }\n\n return {...previous, [`${start}${name}${end}`]: template};\n }, {});\n\n this.components = this.getStringComponents(this._value)\n .map(component => templates?.[component] ?? component ?? null)\n .filter(item => !!item);\n\n this._changeDetection.detectChanges();\n }\n\n private getStringComponents(value: string) {\n const [start, end] = this.getSubstitutions();\n const regex = new RegExp(`(${start}[a-zA-Z]+${end})`, 'g');\n return value.split(regex);\n }\n\n private getSubstitutions() {\n const [start, end] = this.substitutions;\n const escape = /[.*+?^${}()|[\\]\\\\]/g;\n\n return [\n start.replace(escape, '\\\\$&'),\n end.replace(escape, '\\\\$&')\n ];\n }\n\n}\n","<ng-container *ngFor=\"let component of components\">\n <ng-template [bbLocalizeTemplateOrString]=\"component\">{{ component }}</ng-template>\n</ng-container>\n","import {LocalizeDictionaryParams, LocalizeExtraDictionary} from './interfaces/dictionary.interfaces';\nimport {makeStateKey, StateKey} from '@angular/platform-browser';\nimport {USE_AUTHORIZATION} from '@bravobit/bb-foundation/auth';\nimport {HttpClient, HttpContext} from '@angular/common/http';\nimport {firstValueFrom} from 'rxjs';\n\nexport class LocalizeDictionary {\n\n // Readonly data.\n private readonly _id: string;\n private readonly _locale: string;\n private readonly _supportedLanguages: string[];\n private readonly _http: HttpClient;\n\n readonly stateKey: StateKey<object>;\n\n // Dictionary data.\n private _data: object = {};\n private _url: string | null = null;\n\n constructor({id, data, locale, supportedLanguages}: LocalizeDictionaryParams, baseUrl: string, http: HttpClient) {\n this._id = id;\n this._locale = locale || 'en-US';\n this._supportedLanguages = supportedLanguages || [];\n this._http = http;\n this.stateKey = makeStateKey(`locale:${this._id}`);\n\n // Set the correct variable to the url or data.\n if (typeof data === 'string') {\n this._url = this.getUrl(data, baseUrl);\n } else {\n this._data = data;\n }\n }\n\n get id() {\n return this._id;\n }\n\n get locale() {\n return this._locale;\n }\n\n get supportedLanguages() {\n return this._supportedLanguages;\n }\n\n get data() {\n return this._data;\n }\n\n async load(data?: object | null) {\n // Check if data was passed.\n if (data) {\n this.setData(data);\n return true;\n }\n\n // If the url was not set the data was already loaded\n // return true because it was successful.\n if (!this._url) {\n return true;\n }\n\n try {\n // Try to load the data via a HTTP request.\n const context = new HttpContext().set(USE_AUTHORIZATION, false);\n const result$ = this._http.get<object>(this._url, {context});\n const result = await firstValueFrom(result$);\n\n // Set the data.\n this.setData(result);\n\n // Return true because it succeeded.\n return true;\n } catch {\n // Return false because it failed.\n return false;\n }\n }\n\n combine(extraDictionary: LocalizeExtraDictionary, mode: 'prepend' | 'append' = 'prepend') {\n // Validate that the locale matches.\n if (extraDictionary.locale !== this._locale) {\n return;\n }\n\n // Extract the extra data.\n const extraData = extraDictionary.data || {};\n\n // If the selected mode is prepend\n // add the data in front.\n if (mode === 'prepend') {\n this._data = {...extraData, ...this._data};\n return;\n }\n\n // If the selected mode is append\n // add the data in the back.\n this._data = {...this._data, ...extraData};\n }\n\n search(token: string) {\n // Check if the token is present in the\n // data, if so return it.\n if (this._data[token]) {\n return this._data[token];\n }\n\n // Values might be nested in objects this means we need\n // to split them on the dot and search them recursively\n // in the data.\n const value = (token || '')\n .split('.')\n .filter(value => !!value)\n .reduce(this.recursiveSearchValue, this._data);\n\n // Check if the value is a string\n // if this is true it can be returned.\n if (typeof value === 'string') {\n return value;\n }\n\n // This means the translation was incorrect.\n return null;\n }\n\n private setData(data: object) {\n this._data = data ?? {};\n this._url = null;\n }\n\n private getUrl(value: string, baseUrl: string) {\n const isAbsolute = this.isAbsoluteUrl(value);\n if (isAbsolute || !baseUrl) {\n return value;\n }\n\n return [baseUrl, value].join('/');\n }\n\n private isAbsoluteUrl = (url: string) => {\n if (url.indexOf('//') === 0) {\n return true;\n }\n\n if (url.indexOf('://') === -1) {\n return false;\n }\n\n if (url.indexOf('.') === -1) {\n return false;\n }\n\n if (url.indexOf('/') === -1) {\n return false;\n }\n\n if (url.indexOf(':') > url.indexOf('/')) {\n return false;\n }\n\n return url.indexOf('://') < url.indexOf('.');\n };\n\n private recursiveSearchValue = (data, value) => {\n if (typeof data === 'undefined' || typeof data === 'string') {\n return undefined;\n }\n\n return data[value];\n };\n\n}\n","import {LOCALIZE_FUNCTION, LocalizeFunction, LocalizeFunctionMap} from './interfaces/functions.interfaces';\nimport {LOCALIZE_EXTRA_DICTIONARY, LocalizeExtraDictionary} from './interfaces/dictionary.interfaces';\nimport {LocalizeOptionsData, LocalizeParams} from './interfaces/options.interfaces';\nimport {BASE_URL, Languages, LOCATION, Platform} from '@bravobit/bb-foundation';\nimport {LocalizeMissingHandler} from './handlers/missing.handler';\nimport {LocalizeConfig} from './interfaces/config.interfaces';\nimport {Inject, Injectable, Optional} from '@angular/core';\nimport {LocalizeDictionary} from './localize.dictionary';\nimport {Storage} from '@bravobit/bb-foundation/storage';\nimport {TransferState} from '@angular/platform-browser';\nimport {HttpClient} from '@angular/common/http';\nimport {DOCUMENT} from '@angular/common';\n\n@Injectable()\nexport class Localize {\n\n // Readonly data.\n private readonly _dictionaries: LocalizeDictionary[];\n private readonly _functionMiddleware: LocalizeFunctionMap;\n private readonly _storageToken: string = 'bb-language-dictionary-id';\n\n private _currentDictionary: LocalizeDictionary;\n\n constructor(private _http: HttpClient,\n private _storage: Storage,\n private _platform: Platform,\n private _languages: Languages,\n @Optional() private _state: TransferState,\n @Optional() private _config: LocalizeConfig,\n private _missingHandler: LocalizeMissingHandler,\n @Optional() @Inject(DOCUMENT) private _document?: any,\n @Optional() @Inject(LOCATION) private _location?: any,\n @Optional() @Inject(BASE_URL) private _baseUrl?: string,\n @Optional() @Inject(LOCALIZE_FUNCTION) private _functions?: LocalizeFunction[],\n @Optional() @Inject(LOCALIZE_EXTRA_DICTIONARY) private _extras?: LocalizeExtraDictionary[]) {\n // Check if at least one language was passed in the config.\n if (this._config.dictionary.length < 1) {\n throw new Error('Localize: one or more languages should be supplied.');\n }\n\n // Gather the dictionaries.\n this._dictionaries = this._config.dictionary.map(item => {\n return new LocalizeDictionary(item, this._baseUrl, this._http);\n });\n\n // Save the best matching current dictionary.\n this._currentDictionary = this.retrieveBestMatchingDictionary();\n\n // Gather all the localize functions.\n this._functionMiddleware = this._functions.reduce((previous, current) => {\n previous[current.keyword()] = current;\n return previous;\n }, {});\n\n this.renderDocumentLanguage();\n }\n\n get dictionaries() {\n return this._dictionaries;\n }\n\n get current() {\n return this._currentDictionary;\n }\n\n get locale() {\n return this._currentDictionary.locale;\n }\n\n async load(dictionary: LocalizeDictionary) {\n const data = this._state?.hasKey(dictionary.stateKey)\n ? this._state?.get(dictionary.stateKey, {})\n : null;\n\n // Try to load the dictionary data.\n const loaded = await dictionary.load(data);\n\n // Verify the data was loaded.\n if (!loaded) {\n throw new Error(`Localize: Could not correctly fetch the data from: \"${dictionary.id}\"`);\n }\n\n if (!this._platform.isBrowser && this._state) {\n this._state?.set<object>(dictionary?.stateKey, dictionary?.data ?? {});\n }\n\n // Combine the extra dictionary data.\n (this._extras || []).forEach(extraDictionary => dictionary.combine(extraDictionary));\n\n // Return the dictionary.\n return dictionary;\n }\n\n set(dictionary: LocalizeDictionary) {\n this._currentDictionary = dictionary;\n }\n\n initialize() {\n return async () => this.load(this._currentDictionary);\n }\n\n change(id: string, reload: boolean = true) {\n // Try to fetch the dictionary.\n const dictionary = this._dictionaries.find(item => item.id === id);\n\n // Validate the dictionary exists.\n if (!dictionary) {\n throw new Error(`Localize: Could not find dictionary with id: \"${id}\"`);\n }\n\n // Save the language in the storage.\n this._storage.cookie.set<string>(this._storageToken, dictionary.id, {});\n\n // Just quit if we don't need to reload.\n if (!reload) {\n return;\n }\n\n // We need to reload the application for the translations.\n return this.reload();\n }\n\n clear(reload: boolean = true) {\n // Remove the language in the local storage.\n this._storage.cookie.remove(this._storageToken);\n\n // Just quit if we don't need to reload.\n if (!reload) {\n return;\n }\n\n // We need to reload the application for the translations.\n return this.reload();\n }\n\n translate(tokenOrParams: string | LocalizeParams) {\n // 1. Convert to the params.\n const params = this.convertToParams(tokenOrParams);\n\n // 2. Try to find the translation in the dictionary.\n const searchResult = this._currentDictionary.search(params.token);\n\n // 3. Verify the translation was found.\n if (!searchResult) {\n return this._missingHandler.handle(params);\n }\n\n // 4. Find references in the translation that need to be translated as well.\n const processResult = this.findReferencesInTranslation(searchResult);\n\n // 5. Parse the interpolation data.\n return this.parseInterpolationData(processResult, params.data);\n }\n\n private parseInterpolationData(value: string, data: LocalizeOptionsData) {\n // Get the interpolation substitutions.\n const substitutions = this.getSubstitutions('interpolation', ['{{', '}}']);\n\n // Get all matches in the value.\n const matches = this.getMatches(value, substitutions);\n\n // Replace all matches with the parsed value.\n return matches.reduce((previous, current) => {\n // Try to parse the token.\n const interpolatedToken = this.interpolateFunctionData(current.token, data);\n\n // Replace the match with the parsed token.\n return previous.replace(current.match, interpolatedToken);\n }, `${value}`);\n }\n\n private interpolateFunctionData(value: string, interpolationData: LocalizeOptionsData) {\n // Get the token and the methods by splitting\n // on the pipe symbol.\n const [token, ...methods] = value.split('|').map(item => item.trim());\n\n // Get the value for the token from\n // the interpolation data.\n const interpolationValue = interpolationData[token] || token;\n\n // Loop through all the middleware methods and try to\n // conform the string to the given parameters.\n return methods.reduce((string, middlewareName) => {\n // Try to retrieve the middleware from the collection.\n const middleware = this._functionMiddleware[middlewareName];\n\n // If the middleware is missing return an error\n // so that the user knows it was not found.\n if (!middleware) {\n return string;\n }\n\n // Execute the middleware function with the string.\n return middleware.transform(string, this.locale);\n }, `${interpolationValue}`);\n }\n\n private findReferencesInTranslation(value: string) {\n // Get the reference substitutions.\n const substitutions = this.getSubstitutions('references', ['#(', ')']);\n\n // Get all matches in the value.\n const matches = this.getMatches(value, substitutions);\n\n // Replace all matches with the translated value.\n return matches.reduce((previous, current) => {\n // Try to translate the token.\n const translatedToken = this.translate(current.token);\n\n // Replace the match with the translated token.\n return previous.replace(current.match, translatedToken);\n }, value);\n }\n\n private getSubstitutions(type: string, defaultValue: string[]) {\n const substitutions = (this._config\n && this._config.substitutions\n && this._config.substitutions[type]);\n\n // Get the substitutions.\n const value = (!substitutions || substitutions.length !== 2)\n ? defaultValue\n : substitutions;\n\n // Escape both substitutions so that they\n // can be used.\n const escape = /[.*+?^${}()|[\\]\\\\]/g;\n const start = value[0].replace(escape, '\\\\$&');\n const end = value[1].replace(escape, '\\\\$&');\n\n // Return the substitutions.\n return {start, end};\n }\n\n private retrieveBestMatchingDictionary() {\n // Get the dictionary based on storage.\n const storageDictionary = this.getDictionaryFromStorage();\n\n // Get the dictionary based on the supported language.\n const browserDictionary = this.getBestBrowserMatchDictionary();\n\n // Get the dictionary based on the first index.\n const firstDictionary = this._dictionaries[0];\n\n // Return the best matching dictionary.\n return storageDictionary || browserDictionary || firstDictionary;\n }\n\n private getDictionaryFromStorage() {\n // Get dictionary id from the storage..\n const dictionaryId = this._storage.cookie.get<string>(this._storageToken);\n\n // Return the dictionary based on the storage dictionary id.\n return this._dictionaries.find(item => item.id === dictionaryId);\n }\n\n private getBestBrowserMatchDictionary() {\n // Loop through all browser languages and return the\n // best matching dictionary.\n return this._languages.all.map(({code, region}) => {\n const languageCode = [code, region].filter(data => !!data).join('-');\n\n return this._dictionaries.find(item => item.supportedLanguages.includes(languageCode));\n }).filter(item => !!item).find((_, index) => index === 0);\n }\n\n private convertToParams = (tokenOrParams: string | LocalizeParams) => {\n if (typeof tokenOrParams !== 'string') {\n // Destruct the params from the object.\n const {token, optional, data} = tokenOrParams;\n\n // Make sure all parameters are valid\n // by type safe adding them.\n return {token: token, optional: optional || false, data: data || {}};\n }\n\n // If the parameter is a string fill in the blanks.\n return {token: tokenOrParams, optional: false, data: {}};\n };\n\n private renderDocumentLanguage() {\n const element = this._document?.documentElement;\n if (!element) {\n return;\n }\n\n element.lang = this._currentDictionary?.supportedLanguages?.[0] ?? this._currentDictionary?.locale;\n }\n\n private getMatches = (value: string, substitutions: { start: string, end: string }) => {\n // Get the matching substitutions.\n const {start, end} = substitutions;\n\n // Compose a regex that will find the matches.\n const regex = new RegExp(`${start}([^${end}]+)${end}`, 'g');\n\n // Execute the regex to find matches.\n let match = regex.exec(value);\n const matches = [];\n\n while (match !== null) {\n // Push a new match.\n matches.push({\n match: match[0],\n token: match[1]\n });\n\n // Try to find more matches.\n match = regex.exec(value);\n }\n\n // Return the processed value.\n return matches.filter(item => !!item);\n };\n\n private reload = () => this._location?.reload();\n\n}\n","import {LocalizeOptions, LocalizeParams} from './interfaces/options.interfaces';\nimport {Optional, Pipe, PipeTransform} from '@angular/core';\nimport {Localize} from './localize.service';\n\n@Pipe({\n name: 'bbLocalize'\n})\nexport class BbLocalize implements PipeTransform {\n\n constructor(@Optional() private _localize: Localize) {\n }\n\n transform(tokenOrParams: string | LocalizeParams, args?: LocalizeOptions) {\n // Validate that the localize service\n // exists in the pipe.\n if (!this._localize) {\n return tokenOrParams;\n }\n\n // Combine the params with the options\n // to form the localize params.\n const params = this.combineParamsWithOptions(tokenOrParams, args);\n\n // Try to localize the value.\n return this._localize.translate(params);\n }\n\n private combineParamsWithOptions(tokenOrParams: string | LocalizeParams, args?: LocalizeOptions) {\n // Gather the extras.\n const extras = args || {};\n\n // Loop through all the keys to find the set options.\n const options = Object.keys(extras).reduce((previous, current) => {\n if (typeof extras[current] === 'undefined') {\n return previous;\n }\n\n previous[current] = extras[current];\n return previous;\n }, {});\n\n // Convert the string token to a params object.\n const params = typeof tokenOrParams === 'string'\n ? {token: tokenOrParams, optional: false, data: {}}\n : tokenOrParams;\n\n // Return the combined params and options.\n return {...params, ...options};\n }\n\n}\n","import {BbLocalizeTemplateOrString} from './views/localize-template-or-string.directive';\nimport {APP_INITIALIZER, LOCALE_ID, ModuleWithProviders, NgModule} from '@angular/core';\nimport {BbLocalizeString} from './views/localize-string/localize-string.component';\nimport {LocalizeLowercaseFunction} from './functions/lowercase.function';\nimport {LocalizeUppercaseFunction} from './functions/uppercase.function';\nimport {BbLocalizeTemplate} from './views/localize-template.directive';\nimport {LOCALIZE_FUNCTION} from './interfaces/functions.interfaces';\nimport {LocalizeMissingHandler} from './handlers/missing.handler';\nimport {LocalizeDateFunction} from './functions/date.function';\nimport {LocalizeConfig} from './interfaces/config.interfaces';\nimport {HttpClientModule} from '@angular/common/http';\nimport {CommonModule} from '@angular/common';\nimport {Localize} from './localize.service';\nimport {BbLocalize} from './localize.pipe';\n\n@NgModule({\n imports: [CommonModule, HttpClientModule],\n declarations: [\n BbLocalize,\n BbLocalizeString,\n BbLocalizeTemplate,\n BbLocalizeTemplateOrString\n ],\n exports: [\n BbLocalize,\n BbLocalizeString,\n BbLocalizeTemplate\n ]\n})\nexport class LocalizeModule {\n\n static forRoot(config: LocalizeConfig): ModuleWithProviders<LocalizeModule> {\n const automatic = config?.automatic ?? true;\n return {\n ngModule: LocalizeModule,\n providers: [\n // Angular providers.\n ...(automatic\n ? [{provide: APP_INITIALIZER, deps: [Localize], useFactory: initializeLocale, multi: true}]\n : []),\n {provide: LOCALE_ID, deps: [Localize], useFactory: getLocale},\n // Config provider.\n {provide: LocalizeConfig, useValue: config},\n // Function providers.\n {provide: LOCALIZE_FUNCTION, useClass: LocalizeLowercaseFunction, multi: true},\n {provide: LOCALIZE_FUNCTION, useClass: LocalizeUppercaseFunction, multi: true},\n {provide: LOCALIZE_FUNCTION, useClass: LocalizeDateFunction, multi: true},\n // Handler providers.\n {provide: LocalizeMissingHandler, useClass: LocalizeMissingHandler},\n // Service providers.\n Localize\n ]\n };\n }\n\n}\n\nexport function initializeLocale(localize: Localize) {\n return localize.initialize();\n}\n\nexport function getLocale(localize: Localize) {\n return localize.locale;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.BbLocalizeTemplateOrString","i1","i5.LocalizeConfig","i6.LocalizeMissingHandler","i1.Localize"],"mappings":";;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;MAEa,cAAc,CAAA;AAA3B,IAAA,WAAA,GAAA;AACI,QAAA,IAAU,CAAA,UAAA,GAA+B,EAAE,CAAC;KAM/C;AAAA;;ACYD;AACA;AACA;AACA;AACA;MAEa,iBAAiB,GAExB,IAAI,cAAc,CAAC,mBAAmB;;ACX5C;AACA;AACA;AACA;AACA;MAEa,yBAAyB,GAEhC,IAAI,cAAc,CAAC,2BAA2B;;AC7BpD;AACA;AACA;AACA;MAEa,yBAAyB,CAAA;IAElC,OAAO,GAAA;AACH,QAAA,OAAO,WAAW,CAAC;KACtB;AAED,IAAA,SAAS,CAAC,KAAa,EAAA;QACnB,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;KACtC;AAEJ;;ACfD;AACA;AACA;AACA;MAEa,yBAAyB,CAAA;IAElC,OAAO,GAAA;AACH,QAAA,OAAO,WAAW,CAAC;KACtB;AAED,IAAA,SAAS,CAAC,KAAa,EAAA;QACnB,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;KACtC;AAEJ;;ACdD;AACA;AACA;AACA;MAEa,oBAAoB,CAAA;IAE7B,OAAO,GAAA;AACH,QAAA,OAAO,MAAM,CAAC;KACjB;IAED,SAAS,CAAC,KAAa,EAAE,MAAe,EAAA;AACpC,QAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;A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