@cccteam/ccc-lib 0.0.17 → 0.0.19

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 (78) hide show
  1. package/fesm2022/{cccteam-ccc-lib-src-auth-authentication-guard.mjs → cccteam-ccc-lib-auth-authentication-guard.mjs} +3 -3
  2. package/fesm2022/cccteam-ccc-lib-auth-authentication-guard.mjs.map +1 -0
  3. package/fesm2022/{cccteam-ccc-lib-src-auth-authorization-guard.mjs → cccteam-ccc-lib-auth-authorization-guard.mjs} +2 -2
  4. package/fesm2022/cccteam-ccc-lib-auth-authorization-guard.mjs.map +1 -0
  5. package/fesm2022/{cccteam-ccc-lib-src-auth-forms.mjs → cccteam-ccc-lib-auth-forms.mjs} +3 -3
  6. package/fesm2022/cccteam-ccc-lib-auth-forms.mjs.map +1 -0
  7. package/fesm2022/{cccteam-ccc-lib-src-auth-has-permission.mjs → cccteam-ccc-lib-auth-has-permission.mjs} +2 -2
  8. package/fesm2022/cccteam-ccc-lib-auth-has-permission.mjs.map +1 -0
  9. package/fesm2022/{cccteam-ccc-lib-src-auth-service.mjs → cccteam-ccc-lib-auth-service.mjs} +3 -3
  10. package/fesm2022/cccteam-ccc-lib-auth-service.mjs.map +1 -0
  11. package/fesm2022/{cccteam-ccc-lib-src-ccc-camel-case-to-title.mjs → cccteam-ccc-lib-ccc-camel-case-to-title.mjs} +1 -1
  12. package/fesm2022/cccteam-ccc-lib-ccc-camel-case-to-title.mjs.map +1 -0
  13. package/fesm2022/{cccteam-ccc-lib-src-ccc-grid.mjs → cccteam-ccc-lib-ccc-grid.mjs} +2 -2
  14. package/fesm2022/cccteam-ccc-lib-ccc-grid.mjs.map +1 -0
  15. package/fesm2022/{cccteam-ccc-lib-src-ccc-resource.mjs → cccteam-ccc-lib-ccc-resource.mjs} +32 -35
  16. package/fesm2022/cccteam-ccc-lib-ccc-resource.mjs.map +1 -0
  17. package/fesm2022/{cccteam-ccc-lib-src-forms.mjs → cccteam-ccc-lib-forms.mjs} +1 -1
  18. package/fesm2022/cccteam-ccc-lib-forms.mjs.map +1 -0
  19. package/fesm2022/cccteam-ccc-lib-internal-types.mjs +6 -0
  20. package/fesm2022/cccteam-ccc-lib-internal-types.mjs.map +1 -0
  21. package/fesm2022/{cccteam-ccc-lib-src-types.mjs → cccteam-ccc-lib-types.mjs} +14 -8
  22. package/fesm2022/cccteam-ccc-lib-types.mjs.map +1 -0
  23. package/fesm2022/{cccteam-ccc-lib-src-ui-alert.mjs → cccteam-ccc-lib-ui-alert.mjs} +2 -2
  24. package/fesm2022/cccteam-ccc-lib-ui-alert.mjs.map +1 -0
  25. package/fesm2022/{cccteam-ccc-lib-src-ui-core-service.mjs → cccteam-ccc-lib-ui-core-service.mjs} +2 -2
  26. package/fesm2022/cccteam-ccc-lib-ui-core-service.mjs.map +1 -0
  27. package/fesm2022/{cccteam-ccc-lib-src-ui-idle-service.mjs → cccteam-ccc-lib-ui-idle-service.mjs} +6 -6
  28. package/fesm2022/cccteam-ccc-lib-ui-idle-service.mjs.map +1 -0
  29. package/fesm2022/{cccteam-ccc-lib-src-ui-interceptor.mjs → cccteam-ccc-lib-ui-interceptor.mjs} +5 -5
  30. package/fesm2022/cccteam-ccc-lib-ui-interceptor.mjs.map +1 -0
  31. package/fesm2022/{cccteam-ccc-lib-src-ui-notification-service.mjs → cccteam-ccc-lib-ui-notification-service.mjs} +1 -1
  32. package/fesm2022/cccteam-ccc-lib-ui-notification-service.mjs.map +1 -0
  33. package/fesm2022/{cccteam-ccc-lib-src-ui-sidenav.mjs → cccteam-ccc-lib-ui-sidenav.mjs} +3 -3
  34. package/fesm2022/cccteam-ccc-lib-ui-sidenav.mjs.map +1 -0
  35. package/fesm2022/{cccteam-ccc-lib-src-util-request-options.mjs → cccteam-ccc-lib-util-request-options.mjs} +1 -1
  36. package/fesm2022/cccteam-ccc-lib-util-request-options.mjs.map +1 -0
  37. package/fesm2022/cccteam-ccc-lib.mjs +3 -4438
  38. package/fesm2022/cccteam-ccc-lib.mjs.map +1 -1
  39. package/package.json +55 -55
  40. package/types/{cccteam-ccc-lib-src-auth-forms.d.ts → cccteam-ccc-lib-auth-forms.d.ts} +2 -2
  41. package/types/{cccteam-ccc-lib-src-auth-has-permission.d.ts → cccteam-ccc-lib-auth-has-permission.d.ts} +1 -1
  42. package/types/{cccteam-ccc-lib-src-auth-service.d.ts → cccteam-ccc-lib-auth-service.d.ts} +1 -1
  43. package/types/{cccteam-ccc-lib-src-ccc-grid.d.ts → cccteam-ccc-lib-ccc-grid.d.ts} +1 -1
  44. package/types/{cccteam-ccc-lib-src-ccc-resource.d.ts → cccteam-ccc-lib-ccc-resource.d.ts} +35 -35
  45. package/types/cccteam-ccc-lib-internal-types.d.ts +1 -0
  46. package/types/{cccteam-ccc-lib-src-types.d.ts → cccteam-ccc-lib-types.d.ts} +14 -7
  47. package/types/{cccteam-ccc-lib-src-ui-alert.d.ts → cccteam-ccc-lib-ui-alert.d.ts} +2 -2
  48. package/types/{cccteam-ccc-lib-src-ui-core-service.d.ts → cccteam-ccc-lib-ui-core-service.d.ts} +2 -2
  49. package/types/{cccteam-ccc-lib-src-ui-notification-service.d.ts → cccteam-ccc-lib-ui-notification-service.d.ts} +1 -1
  50. package/types/{cccteam-ccc-lib-src-ui-sidenav.d.ts → cccteam-ccc-lib-ui-sidenav.d.ts} +2 -2
  51. package/types/cccteam-ccc-lib.d.ts +2 -1881
  52. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +0 -1
  53. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +0 -1
  54. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +0 -1
  55. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +0 -1
  56. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +0 -1
  57. package/fesm2022/cccteam-ccc-lib-src-ccc-camel-case-to-title.mjs.map +0 -1
  58. package/fesm2022/cccteam-ccc-lib-src-ccc-grid.mjs.map +0 -1
  59. package/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs.map +0 -1
  60. package/fesm2022/cccteam-ccc-lib-src-forms.mjs.map +0 -1
  61. package/fesm2022/cccteam-ccc-lib-src-internal-types.mjs +0 -6
  62. package/fesm2022/cccteam-ccc-lib-src-internal-types.mjs.map +0 -1
  63. package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +0 -1
  64. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +0 -1
  65. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs.map +0 -1
  66. package/fesm2022/cccteam-ccc-lib-src-ui-idle-service.mjs.map +0 -1
  67. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +0 -1
  68. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +0 -1
  69. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +0 -1
  70. package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs.map +0 -1
  71. package/types/cccteam-ccc-lib-src-internal-types.d.ts +0 -1
  72. /package/types/{cccteam-ccc-lib-src-auth-authentication-guard.d.ts → cccteam-ccc-lib-auth-authentication-guard.d.ts} +0 -0
  73. /package/types/{cccteam-ccc-lib-src-auth-authorization-guard.d.ts → cccteam-ccc-lib-auth-authorization-guard.d.ts} +0 -0
  74. /package/types/{cccteam-ccc-lib-src-ccc-camel-case-to-title.d.ts → cccteam-ccc-lib-ccc-camel-case-to-title.d.ts} +0 -0
  75. /package/types/{cccteam-ccc-lib-src-forms.d.ts → cccteam-ccc-lib-forms.d.ts} +0 -0
  76. /package/types/{cccteam-ccc-lib-src-ui-idle-service.d.ts → cccteam-ccc-lib-ui-idle-service.d.ts} +0 -0
  77. /package/types/{cccteam-ccc-lib-src-ui-interceptor.d.ts → cccteam-ccc-lib-ui-interceptor.d.ts} +0 -0
  78. /package/types/{cccteam-ccc-lib-src-util-request-options.d.ts → cccteam-ccc-lib-util-request-options.d.ts} +0 -0
@@ -76,4 +76,4 @@ function cleanStringForm(control) {
76
76
  */
77
77
 
78
78
  export { cleanStringForm, sparseData, sparseFormData };
79
- //# sourceMappingURL=cccteam-ccc-lib-src-forms.mjs.map
79
+ //# sourceMappingURL=cccteam-ccc-lib-forms.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-forms.mjs","sources":["../../../projects/ccc-lib/forms/index.ts","../../../projects/ccc-lib/forms/cccteam-ccc-lib-forms.ts"],"sourcesContent":["import { AbstractControl, FormArray, FormGroup } from '@angular/forms';\nimport { isEqual } from 'lodash-es';\n\n/**\n * Compares two objects and returns a sparse object containing only the differing key-value pairs\n * @param data - object to compare\n * @param compareData - object to compare against\n * @returns Partial<T>\n * @example sparseData<UserCreate>(this.user, initUser)\n */\nexport function sparseData<T extends Record<string, unknown>>(data: T, compareData: T): Partial<T> {\n const sparseData: Partial<T> = {};\n\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n if (!isEqual(data[key], compareData[key])) {\n sparseData[key] = data[key];\n }\n }\n }\n\n return sparseData;\n}\n\n/**\n * Iterates through a form group's controls and returns a sparse object with only the changed values.\n * @param form - The form group to iterate through\n * @param compareData - The object to compare the form's values to\n * @returns - A sparse object with only the changed values\n * @example sparseFormData<UserCreate>(this.userForm, initUser)\n */\nexport function sparseFormData<T>(form: FormGroup, compareData: T): T {\n const sparseFormData: T = {} as T;\n for (const key in form.controls) {\n if (Object.prototype.hasOwnProperty.call(form.controls, key)) {\n const control = form.controls[key];\n const controlValue = control.value;\n const compareValue = compareData[key as keyof T];\n if (controlValue !== compareValue) {\n sparseFormData[key as keyof T] = controlValue as T[keyof T];\n }\n }\n }\n return sparseFormData;\n}\n\n/**\n * Recursively cleans a FormGroup or FormArray, removing controls with empty string values.\n * Similar to sparseFormData, but doesn't compare to an initial state\n * @param control - The FormGroup or FormArray to clean.\n * @returns A cleaned object with non-empty values.\n */\nexport function cleanStringForm<T>(control: AbstractControl): T | undefined {\n if (control instanceof FormGroup) {\n const cleanedGroup: Record<string, unknown> = {};\n for (const key of Object.keys(control.controls)) {\n const childControl = control.get(key);\n if (childControl) {\n const cleanedValue = cleanStringForm(childControl);\n if (cleanedValue !== undefined && cleanedValue !== null && cleanedValue !== '') {\n cleanedGroup[key] = cleanedValue;\n }\n }\n }\n return cleanedGroup as T;\n } else if (control instanceof FormArray) {\n const cleanedArray = control.controls\n .map((childControl) => cleanStringForm(childControl))\n .filter((item) => item !== undefined && item !== null && item !== '');\n return cleanedArray as unknown as T;\n } else {\n return control.value !== '' ? control.value : undefined;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;;;;;;AAMG;AACG,SAAU,UAAU,CAAoC,IAAO,EAAE,WAAc,EAAA;IACnF,MAAM,UAAU,GAAe,EAAE;AAEjC,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACtB,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;AACnD,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE;gBACzC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;YAC7B;QACF;IACF;AAEA,IAAA,OAAO,UAAU;AACnB;AAEA;;;;;;AAMG;AACG,SAAU,cAAc,CAAI,IAAe,EAAE,WAAc,EAAA;IAC/D,MAAM,cAAc,GAAM,EAAO;AACjC,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE;AAC/B,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE;YAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;AA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ccteam/ccc-lib/types';
2
+
3
+ /**
4
+ * Generated bundle index. Do not edit.
5
+ */
6
+ //# sourceMappingURL=cccteam-ccc-lib-internal-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-internal-types.mjs","sources":["../../../projects/ccc-lib/internal-types/cccteam-ccc-lib-internal-types.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;AAEG"}
@@ -1,7 +1,6 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
+ import { input, Directive, InjectionToken } from '@angular/core';
2
3
 
3
- // Shared types and constants used across the ccc-resource module
4
- // This file exists to break circular dependencies between types and ccc-resource
5
4
  const defaultEmptyFieldValue = '-';
6
5
 
7
6
  function actionButtonConfig(config) {
@@ -224,6 +223,16 @@ function rootConfig(config) {
224
223
  ...config,
225
224
  };
226
225
  }
226
+ class CustomConfigComponent {
227
+ uuid = input(undefined, { ...(ngDevMode ? { debugName: "uuid" } : {}) });
228
+ parentData = input(undefined, { ...(ngDevMode ? { debugName: "parentData" } : {}) });
229
+ config = input(undefined, { ...(ngDevMode ? { debugName: "config" } : {}) });
230
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: CustomConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
231
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.2", type: CustomConfigComponent, isStandalone: true, inputs: { uuid: { classPropertyName: "uuid", publicName: "uuid", isSignal: true, isRequired: false, transformFunction: null }, parentData: { classPropertyName: "parentData", publicName: "parentData", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
232
+ }
233
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: CustomConfigComponent, decorators: [{
234
+ type: Directive
235
+ }], propDecorators: { uuid: [{ type: i0.Input, args: [{ isSignal: true, alias: "uuid", required: false }] }], parentData: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentData", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }] } });
227
236
  function componentConfig(config) {
228
237
  return {
229
238
  ...componentConfigDefaults,
@@ -367,9 +376,6 @@ var AlertLevel;
367
376
  const ReadPermission = 'Read';
368
377
  const UpdatePermission = 'Update';
369
378
 
370
- // Meta interfaces for resources and methods
371
- // This file exists to break circular dependencies between types and ccc-resource
372
-
373
379
  /**
374
380
  * The base URL for API requests (e.g., 'https://api.example.com/').
375
381
  */
@@ -427,5 +433,5 @@ function createResourceValidator(validator) {
427
433
  * Generated bundle index. Do not edit.
428
434
  */
429
435
 
430
- export { API_URL, AVAILABLE_DOMAINS, AVAILABLE_PERMISSIONS, AlertLevel, BASE_URL, FRONTEND_LOGIN_PATH, IDLE_KEEPALIVE_DURATION, IDLE_SESSION_DURATION, IDLE_WARNING_DURATION, METHOD_META, PERMISSION_REQUIRED, RESOURCE_META, ReadPermission, SESSION_PATH, UpdatePermission, actionButtonConfig, actionButtonConfigDefaults, additionalResourceConfig, additionalResourceConfigDefaults, arrayConfig, arrayConfigDefaults, componentConfig, componentConfigDefaults, computedDisplayField, computedDisplayFieldElementDefaults, createResourceValidator, defaultEmptyFieldValue, enumeratedConfig, enumeratedConfigDefaults, field, fieldElementDefaults, fieldSort, fieldSortDefaults, foreignKeyDefault, foreignKeyDefaultDefaults, listViewConfig, listViewConfigDefaults, multiColumnConfig, multiColumnConfigDefaults, nullBooleanConfig, nullBooleanConfigDefaults, padding, paddingElementDefaults, requiredIf, rootConfig, rootConfigDefaults, rpcConfig, rpcConfigDefaults, section, sectionElementDefaults, singleColumnConfig, singleColumnConfigDefaults, staticDefault, staticDefaultDefaults, switchParams, switchParamsDefaults, validatorsPresent, viewConfig, viewConfigDefaults };
431
- //# sourceMappingURL=cccteam-ccc-lib-src-types.mjs.map
436
+ export { API_URL, AVAILABLE_DOMAINS, AVAILABLE_PERMISSIONS, AlertLevel, BASE_URL, CustomConfigComponent, FRONTEND_LOGIN_PATH, IDLE_KEEPALIVE_DURATION, IDLE_SESSION_DURATION, IDLE_WARNING_DURATION, METHOD_META, PERMISSION_REQUIRED, RESOURCE_META, ReadPermission, SESSION_PATH, UpdatePermission, actionButtonConfig, actionButtonConfigDefaults, additionalResourceConfig, additionalResourceConfigDefaults, arrayConfig, arrayConfigDefaults, componentConfig, componentConfigDefaults, computedDisplayField, computedDisplayFieldElementDefaults, createResourceValidator, defaultEmptyFieldValue, enumeratedConfig, enumeratedConfigDefaults, field, fieldElementDefaults, fieldSort, fieldSortDefaults, foreignKeyDefault, foreignKeyDefaultDefaults, listViewConfig, listViewConfigDefaults, multiColumnConfig, multiColumnConfigDefaults, nullBooleanConfig, nullBooleanConfigDefaults, padding, paddingElementDefaults, requiredIf, rootConfig, rootConfigDefaults, rpcConfig, rpcConfigDefaults, section, sectionElementDefaults, singleColumnConfig, singleColumnConfigDefaults, staticDefault, staticDefaultDefaults, switchParams, switchParamsDefaults, validatorsPresent, viewConfig, viewConfigDefaults };
437
+ //# sourceMappingURL=cccteam-ccc-lib-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-types.mjs","sources":["../../../projects/ccc-lib/types/resource-types.ts","../../../projects/ccc-lib/types/configs.ts","../../../projects/ccc-lib/types/notification-message.ts","../../../projects/ccc-lib/types/permissions.ts","../../../projects/ccc-lib/types/tokens.ts","../../../projects/ccc-lib/types/validators.ts","../../../projects/ccc-lib/types/cccteam-ccc-lib-types.ts"],"sourcesContent":["export const defaultEmptyFieldValue = '-';\n\nexport type NullBoolean = null | true | false;\n\nexport type ConcatFn = 'space-concat' | 'hyphen-concat' | 'space-hyphen-concat' | 'hyphen-space-concat';\n","import { Directive, input, Type } from '@angular/core';\nimport { TooltipPosition } from '@angular/material/tooltip';\nimport { FieldName, Method, Resource } from './permissions';\nimport { ConcatFn, defaultEmptyFieldValue, NullBoolean } from './resource-types';\nimport { ResourceValidatorFn } from './validators';\n\nexport interface FieldPointer {\n field: FieldName;\n}\n\nexport interface MenuItem {\n label: string;\n route?: string[];\n children?: MenuItem[];\n}\n\nexport interface RouteResourceData {\n config: RootConfig;\n}\n\nexport type DataType = string | number | number[] | string[] | boolean | undefined | Date;\nexport type RecordData = Record<string, DataType | null>;\n\nexport type RPCDataType = string | number | string[] | number[] | boolean | Date;\nexport type RPCRecordData = Record<string, RPCDataType>;\nexport type RpcMethod = Record<string, DataType>;\n\nexport type ParentResourceConfig = ListViewConfig | ViewConfig | ArrayConfig;\nexport type ChildResourceConfig = ListViewConfig | ViewConfig | ComponentConfig | ArrayConfig;\n\nexport type ActionType = 'function' | 'link';\n\nexport type ListConcatFn =\n | 'space-concat'\n | 'hyphen-concat'\n | 'space-hyphen-concat'\n | 'hyphen-space-concat'\n | 'no-space-concat';\nexport type ConfigType = ChildResourceConfig;\nexport type FormatType = 'simpleSlashDateFormat';\nexport type RPCPlacement = 'inline' | 'end';\n\nexport type ColumnConfig = SingleColumnConfig | MultiColumnConfig;\n\nexport interface ActionButtonConfig {\n label: string;\n icon: string;\n action?: (resource: { id: string }) => void;\n viewRoute?: string;\n actionType?: ActionType;\n color?: string;\n disabledLabel?: string;\n}\nexport interface ActionButtonConfigOptions {\n label: string;\n icon: string;\n action?: (resource: { id: string }) => void;\n viewRoute?: string;\n actionType?: ActionType;\n color?: string;\n disabledLabel?: string;\n}\n\nexport function actionButtonConfig(config: ActionButtonConfigOptions): ActionButtonConfig {\n return {\n ...actionButtonConfigDefaults,\n ...config,\n } satisfies ActionButtonConfig;\n}\n\nexport const actionButtonConfigDefaults = {\n label: '',\n icon: '',\n actionType: 'function' as ActionType,\n color: '',\n disabledLabel: '',\n} satisfies ActionButtonConfig;\n\nexport interface SingleColumnConfig {\n id: FieldName;\n header?: string;\n width?: number;\n resizable?: boolean;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n valueGetter?: (data: any) => string;\n valueFormatter?: (data: any) => string;\n tooltipPosition?: TooltipPosition;\n viewRoute?: Resource;\n buttonConfig?: ActionButtonConfig;\n actionType?: ActionType;\n formatType?: FormatType | string;\n hidden?: boolean;\n emptyDataValue?: DataType;\n filterable?: boolean;\n hideHeader?: boolean;\n}\nexport interface SingleColumnConfigOptions {\n id: FieldName;\n header?: string;\n width?: number;\n resizable?: boolean;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n valueGetter?: (data: any) => string;\n valueFormatter?: (data: any) => string;\n tooltipPosition?: TooltipPosition;\n viewRoute?: Resource;\n buttonConfig?: ActionButtonConfig;\n actionType?: ActionType;\n formatType?: FormatType | string;\n hidden?: boolean;\n emptyDataValue?: DataType;\n filterable?: boolean;\n hideHeader?: boolean;\n}\n\nexport function singleColumnConfig(config: SingleColumnConfigOptions): SingleColumnConfig {\n return {\n ...singleColumnConfigDefaults,\n ...config,\n } satisfies SingleColumnConfig;\n}\n\nexport const singleColumnConfigDefaults = {\n id: '' as FieldName,\n header: '',\n resizable: true,\n actionType: 'function' as ActionType,\n hidden: false,\n filterable: true,\n hideHeader: false,\n} satisfies SingleColumnConfig;\n\nexport interface MultiColumnConfig extends SingleColumnConfig {\n // todo: additionalIds name is not clear. the id provided is fetched from a different resource, such as a typeId\n additionalIds: AdditionalResourceConfig[];\n concatFn: ListConcatFn;\n}\nexport interface MultiColumnConfigOptions extends SingleColumnConfigOptions {\n additionalIds: AdditionalResourceConfig[];\n concatFn: ListConcatFn;\n}\n\nexport function multiColumnConfig(config: MultiColumnConfigOptions): MultiColumnConfig {\n return {\n ...multiColumnConfigDefaults,\n ...config,\n } satisfies MultiColumnConfig;\n}\n\nexport const multiColumnConfigDefaults = {\n ...singleColumnConfigDefaults,\n additionalIds: [] as AdditionalResourceConfig[],\n concatFn: 'hyphen-concat' as ListConcatFn,\n} satisfies MultiColumnConfig;\n\nexport interface AdditionalResourceConfig {\n resource?: Resource;\n id: FieldName;\n field?: FieldName;\n hidden?: boolean;\n}\nexport interface AdditionalResourceConfigOptions {\n id: FieldName;\n resource?: Resource;\n field?: FieldName;\n hidden?: boolean;\n}\n\nexport function additionalResourceConfig(config: AdditionalResourceConfigOptions): AdditionalResourceConfig {\n return {\n ...additionalResourceConfigDefaults,\n ...config,\n } satisfies AdditionalResourceConfig;\n}\n\nexport const additionalResourceConfigDefaults = {\n id: '' as FieldName,\n resource: '' as Resource,\n field: '' as FieldName,\n hidden: false,\n} satisfies AdditionalResourceConfig;\n\nexport interface FieldSort {\n field: FieldName;\n direction: 'asc' | 'desc';\n}\nexport interface FieldSortOptions {\n field: FieldName;\n direction?: 'asc' | 'desc';\n}\n\nexport function fieldSort(config: FieldSortOptions): FieldSort {\n return {\n ...fieldSortDefaults,\n ...config,\n } satisfies FieldSort;\n}\n\nexport const fieldSortDefaults = {\n field: '' as FieldName,\n direction: 'asc' as 'asc' | 'desc',\n} satisfies FieldSort;\n\nexport interface EnumeratedConfigOptions {\n // primaryResource comes from the metadata\n overrideResource?: Resource;\n /* A function to filter the list of enumerated options.\n * The `parentResource` argument contains the data of the resource that this enumerated field is part of.\n * It will be an object with the current form values, which can be empty during resource creation.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter?: (resource: any) => string;\n /**\n * Set disableCacheForFilterPii to `true` to promote the GET to a POST when PII is used in the filter\n * POST requests cannot be cached\n */\n disableCacheForFilterPii?: boolean;\n /**\n * Specifies which resource data to pass to the filter function:\n * - 'rootResource': Pass in the root resource data\n * - 'parentResource': Pass in the parent resource data\n * @default 'parentResource'\n */\n filterType?: FilterType;\n sorts?: FieldSort[];\n listDisplay?: FieldName[];\n viewDisplay: FieldName[];\n viewConcatFn?: ConcatFn;\n listConcatFn?: ConcatFn;\n viewDetails?: boolean;\n searchable?: boolean;\n}\n\ntype FilterType = 'parentResource' | 'rootResource';\nexport interface EnumeratedConfig {\n overrideResource: Resource;\n filter: (resource: any) => string;\n disableCacheForFilterPii: boolean;\n filterType: FilterType;\n sorts: FieldSort[];\n listDisplay: FieldName[];\n viewDisplay: FieldName[];\n viewConcatFn: ConcatFn;\n listConcatFn: ConcatFn;\n viewDetails: boolean;\n searchable: boolean;\n}\nexport function enumeratedConfig(config: EnumeratedConfigOptions): EnumeratedConfig {\n return {\n ...enumeratedConfigDefaults,\n ...config,\n } satisfies EnumeratedConfig;\n}\nexport const enumeratedConfigDefaults = {\n overrideResource: '' as Resource,\n filter: (): string => '',\n disableCacheForFilterPii: false,\n filterType: 'parentResource' as FilterType,\n sorts: [] as FieldSort[],\n listDisplay: [] as FieldName[],\n viewDisplay: [] as FieldName[],\n viewConcatFn: 'hyphen-concat' as ConcatFn,\n listConcatFn: 'hyphen-concat' as ConcatFn,\n viewDetails: false,\n searchable: false,\n};\n\nexport type FieldDefault = ForeignKeyDefault | StaticDefault | null;\n\nexport interface NullBooleanConfigOptions {\n displayValues?: Record<'null' | 'true' | 'false', { label: string; value: NullBoolean }>;\n}\nexport interface NullBooleanConfig {\n /** This property maps the three possible values for this\n * nullboolean field with the display values users will see\n * on the screen for each\n */\n displayValues: Record<'null' | 'true' | 'false', { label: string; value: NullBoolean }>;\n}\nexport function nullBooleanConfig(config: NullBooleanConfigOptions): NullBooleanConfig {\n return {\n ...nullBooleanConfigDefaults,\n ...config,\n } satisfies NullBooleanConfig;\n}\nconst defaultBooleanDisplay = Object.freeze({\n null: {\n label: defaultEmptyFieldValue,\n value: null,\n },\n true: {\n label: 'Yes',\n value: true,\n },\n false: {\n label: 'No',\n value: false,\n },\n});\n\nexport const nullBooleanConfigDefaults = {\n displayValues: defaultBooleanDisplay,\n};\n\nexport interface ForeignKeyDefaultOptions {\n parentId: FieldName;\n}\nexport interface ForeignKeyDefault {\n type: 'foreignKey';\n parentId: FieldName;\n}\nexport function foreignKeyDefault(config: ForeignKeyDefaultOptions): ForeignKeyDefault {\n return {\n ...foreignKeyDefaultDefaults,\n ...config,\n } satisfies ForeignKeyDefault;\n}\nexport const foreignKeyDefaultDefaults = {\n type: 'foreignKey',\n parentId: '' as FieldName,\n} satisfies ForeignKeyDefault;\n\nexport interface StaticDefault {\n type: 'static';\n value: string | boolean;\n}\nexport interface staticDefaultOptions {\n value: string | boolean;\n}\nexport function staticDefault(config: staticDefaultOptions): StaticDefault {\n return {\n ...staticDefaultDefaults,\n ...config,\n } satisfies StaticDefault;\n}\nexport const staticDefaultDefaults = {\n type: 'static',\n value: '',\n} satisfies StaticDefault;\n\nexport type Affix = string | remoteData | parentData;\n\ninterface remoteData {\n resource: Resource;\n id: FieldName;\n field: FieldName;\n}\n\ninterface parentData {\n field: FieldName;\n}\n\nexport type ConfigElement = FieldElement | SectionElement | ComputedDisplayFieldElement | PaddingElement;\n\nexport type ColSize = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport interface ComputedDisplayFieldElementOptions {\n label?: string;\n class?: string;\n cols?: ColSize;\n calculatedValue?: (data: any) => string;\n shouldRender?: ((data: any) => boolean) | boolean;\n}\nexport interface ComputedDisplayFieldElement {\n type: 'computedDisplayField';\n label: string;\n class: string;\n cols: ColSize;\n calculatedValue: (data: any) => string;\n shouldRender: ((data: any) => boolean) | boolean;\n}\nexport function computedDisplayField(config: ComputedDisplayFieldElementOptions): ComputedDisplayFieldElement {\n return {\n ...computedDisplayFieldElementDefaults,\n ...config,\n } satisfies ComputedDisplayFieldElement;\n}\nexport const computedDisplayFieldElementDefaults = {\n type: 'computedDisplayField',\n label: '',\n class: '',\n cols: 6,\n calculatedValue: (): string => '',\n shouldRender: true,\n} satisfies ComputedDisplayFieldElement;\n\nexport interface PaddingElementOptions {\n cols?: ColSize;\n shouldRender?: ((data: any) => boolean) | boolean;\n}\nexport interface PaddingElement {\n type: 'padding';\n cols: ColSize;\n /** Determines whether the padding is shown\n */\n shouldRender: ((data: any) => boolean) | boolean;\n}\nexport function padding(config?: PaddingElementOptions): PaddingElement {\n return {\n ...paddingElementDefaults,\n ...config,\n } satisfies PaddingElement;\n}\nexport const paddingElementDefaults = {\n type: 'padding',\n cols: 12,\n shouldRender: true,\n} satisfies PaddingElement;\n\nexport interface SectionElementOptions {\n label?: string;\n class?: string;\n cols?: ColSize;\n shouldRender?: ((data: any) => boolean) | boolean;\n nullAllChildrenIfConditionallyHidden?: boolean;\n children?: ConfigElement[];\n}\nexport interface SectionElement {\n type: 'section';\n label: string;\n class: string;\n cols: ColSize;\n /**\n * shouldRender is used to determine if the section should be\n * displayed to users.\n * When assigning shouldRender a function, the first argument\n * is the current state of the resource being displayed\n * Hides the layout AND all of its children\n */\n shouldRender: ((data: any) => boolean) | boolean;\n /** If shouldRender is NOT a function, this property does nothing\n * If shouldRender is a function, this property\n * sets children's values to null if shouldRender hides it (returns false)\n * within the resource-layout.component\n */\n nullAllChildrenIfConditionallyHidden: boolean;\n children: ConfigElement[];\n}\nexport function section(config: SectionElementOptions): SectionElement {\n return {\n ...sectionElementDefaults,\n ...config,\n } satisfies SectionElement;\n}\nexport const sectionElementDefaults = {\n type: 'section',\n label: '',\n class: '',\n cols: 12,\n shouldRender: true,\n nullAllChildrenIfConditionallyHidden: false,\n children: [],\n} satisfies SectionElement;\n\nexport interface FieldElementOptions {\n name: FieldName;\n label?: string;\n cols?: ColSize;\n class?: string;\n enumeratedConfig?: EnumeratedConfig;\n default?: FieldDefault;\n nullBooleanConfig?: NullBooleanConfig;\n validators?: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];\n readOnly?: boolean;\n prefixes?: Affix[];\n suffixes?: Affix[];\n shouldRender?: ((data: any) => boolean) | boolean;\n nullIfConditionallyHidden?: boolean;\n}\nexport interface FieldElement {\n type: 'field';\n name: string;\n label: string;\n cols: ColSize;\n class: string;\n enumeratedConfig: EnumeratedConfig;\n default: FieldDefault;\n nullBooleanConfig: NullBooleanConfig;\n /**\n * A list of validators that must pass to allow a field to be submitted.\n * Utilize existing validators in the resourceValidators object, and\n * add any new or custom validators to it\n */\n validators: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];\n readOnly: boolean;\n prefixes: Affix[];\n suffixes: Affix[];\n /**\n * shouldRender is used to determine if the element should be\n * displayed to users.\n * When assigning shouldRender a function, the first argument\n * is the current state of the resource being displayed\n */\n shouldRender: ((data: any) => boolean) | boolean;\n /** If shouldRender is NOT a function, this property does nothing\n * If shouldRender is a function, this property\n * determines whether the form control associated\n * with this config element should have its value\n * set to null if shouldRender hides it (returns false)\n */\n nullIfConditionallyHidden: boolean;\n}\n\nexport function field(config: FieldElementOptions): FieldElement {\n return {\n ...fieldElementDefaults,\n ...config,\n } satisfies FieldElement;\n}\nexport const fieldElementDefaults = {\n type: 'field',\n name: '',\n label: '',\n cols: 6,\n class: '',\n enumeratedConfig: { ...enumeratedConfigDefaults },\n default: null,\n validators: [],\n nullBooleanConfig: { ...nullBooleanConfigDefaults },\n readOnly: false,\n prefixes: [],\n suffixes: [],\n shouldRender: true,\n nullIfConditionallyHidden: false,\n} satisfies FieldElement;\n\n/**\n * RouteData is used to define the route for a config\n * route: the route for the config\n * hasViewRoute: when true, a route will be created for route/:uuid\n */\nexport interface RootRouteData {\n route?: string;\n hasViewRoute?: boolean;\n}\n\nexport interface RPCConfigOptions {\n label: string;\n afterMethodRedirect?: string;\n conditions: {\n field: FieldName;\n matchValues: string[];\n }[];\n methodBodyTemplate?: any;\n successMessage?: string;\n elements?: ConfigElement[];\n placement?: RPCPlacement;\n method: Method;\n customComponent?: ComponentConfig;\n refreshResources?: Resource[];\n defaultModalWidth?: string;\n shouldRender?: () => boolean;\n}\nexport interface RPCConfig {\n label: string;\n afterMethodRedirect: string | string[];\n conditions: {\n field: FieldName;\n matchValues: string[];\n }[];\n methodBodyTemplate: any;\n method: Method;\n successMessage: string;\n elements: ConfigElement[];\n placement: RPCPlacement;\n customComponent: ComponentConfig;\n refreshResources: Resource[];\n defaultModalWidth: string;\n shouldRender: () => boolean;\n}\nexport function rpcConfig(config: RPCConfigOptions): RPCConfig {\n return {\n ...rpcConfigDefaults,\n ...config,\n } satisfies RPCConfig;\n}\nexport const rpcConfigDefaults = {\n label: '',\n afterMethodRedirect: '',\n conditions: [] as {\n field: FieldName;\n matchValues: string[];\n }[],\n methodBodyTemplate: {} as any,\n successMessage: '',\n elements: [] as ConfigElement[],\n placement: 'end' as RPCPlacement,\n method: '' as Method,\n customComponent: {} as ComponentConfig,\n refreshResources: [] as Resource[],\n defaultModalWidth: '',\n shouldRender: (): boolean => true,\n} satisfies RPCConfig;\n\nexport interface RPCBaseFormData {\n elements: FieldElement[];\n label: string;\n method: Method;\n}\n\n// Config is the base type that all configurations should start with\nexport interface RootConfigOptions {\n routeData?: RootRouteData;\n nav?: {\n navItem: MenuItem;\n group?: string;\n };\n parentConfig: ParentResourceConfig;\n relatedConfigs?: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n}\nexport interface RootConfig {\n routeData: RootRouteData;\n nav: {\n navItem: MenuItem;\n group?: string;\n };\n parentConfig: ParentResourceConfig;\n relatedConfigs: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n}\nexport const rootConfigDefaults = {\n routeData: {} as RootRouteData,\n nav: {\n navItem: {} as MenuItem,\n },\n parentConfig: {} as ParentResourceConfig,\n relatedConfigs: [] as ChildResourceConfig[],\n rpcConfigs: [] as RPCConfig[],\n} satisfies RootConfig;\n\nexport function rootConfig(config: RootConfigOptions): RootConfig {\n return {\n ...rootConfigDefaults,\n ...config,\n } satisfies RootConfig;\n}\n\n// Base type config is the base type for all resource configurations\nexport interface BaseConfigOptions {\n title?: string;\n createTitle?: string;\n createButtonLabel?: string;\n primaryResource: Resource;\n parentClass?: string;\n fieldClass?: string;\n elements: ConfigElement[];\n createConfig?: ConfigType;\n parentRelation?: {\n parentKey: FieldName;\n childKey: FieldName;\n };\n showBackButton?: boolean;\n createNavigation?: string[];\n}\nexport interface BaseConfig {\n title: string;\n createTitle: string;\n createButtonLabel: string;\n primaryResource: Resource;\n parentClass: string;\n fieldClass: string;\n elements: ConfigElement[];\n createConfig: ConfigType;\n parentRelation: {\n parentKey: FieldName;\n childKey: FieldName;\n };\n showBackButton: boolean;\n createNavigation: string[];\n}\n\n@Directive()\nexport abstract class CustomConfigComponent {\n uuid = input<string>();\n parentData = input<RecordData>();\n config = input<ComponentConfig>();\n}\n\n// Available param types for a component config\nexport type ConfigParam = SwitchConfigParam;\n\n// Custom component config renders a custom component and supplies params to it\nexport interface ComponentConfigOptions {\n // todo: it's weird that we have a primary resource here. Would be nice to remove but this adds a null check to all other configs\n primaryResource: Resource;\n component: Type<CustomConfigComponent> | 'SwitchResolver';\n params?: ConfigParam;\n relatedConfig?: ParentResourceConfig[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ComponentConfig {\n type: 'Component';\n primaryResource: Resource;\n component: Type<CustomConfigComponent> | 'SwitchResolver';\n params: ConfigParam;\n relatedConfig: ParentResourceConfig[];\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport function componentConfig(config: ComponentConfigOptions): ComponentConfig {\n return {\n ...componentConfigDefaults,\n ...config,\n } satisfies ComponentConfig;\n}\nexport const componentConfigDefaults = {\n type: 'Component',\n primaryResource: '' as Resource,\n component: 'SwitchResolver',\n params: {\n cases: [],\n } satisfies ConfigParam,\n relatedConfig: [] as ParentResourceConfig[],\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ComponentConfig;\n\n// A switch is a component type that allows for conditional rendering of child components based on the value of a parent field\n// When parentData[c.parentField] equals c.caseId render the caseConfig with parentData[c.childId] as the uuid\nexport interface switchCase {\n caseId: string;\n parentField: string;\n childId: string;\n config: ChildResourceConfig;\n}\nexport interface SwitchConfigParamOptions {\n cases: switchCase[];\n}\nexport interface SwitchConfigParam {\n cases: switchCase[];\n}\nexport function switchParams(config: SwitchConfigParamOptions): SwitchConfigParam {\n return {\n ...switchParamsDefaults,\n ...config,\n } satisfies SwitchConfigParam;\n}\nexport const switchParamsDefaults = {\n cases: [] as switchCase[],\n} satisfies SwitchConfigParam;\n\nexport interface ListViewConfigOptions extends BaseConfigOptions {\n showViewButton?: boolean;\n loadCreatedResource?: boolean;\n collapsible?: boolean;\n overrideResource?: Resource;\n searchable?: boolean;\n enableRowExpansion?: boolean;\n rowExpansionConfig?: ChildResourceConfig;\n requireSearchToDisplayResults?: boolean;\n listColumns: ColumnConfig[];\n relatedConfigs?: ChildResourceConfig[];\n viewResource?: Resource | string;\n actionType?: ActionType;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter?: (parentResource: any) => string;\n disableCacheForFilterPii?: boolean;\n rpcConfigs?: RPCConfig[];\n sorts?: FieldSort[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ListViewConfig extends BaseConfig {\n type: 'ListView';\n showViewButton: boolean;\n loadCreatedResource: boolean;\n collapsible: boolean;\n overrideResource: Resource;\n searchable: boolean;\n enableRowExpansion: boolean;\n rowExpansionConfig: ChildResourceConfig;\n requireSearchToDisplayResults: boolean;\n listColumns: ColumnConfig[];\n relatedConfigs: ChildResourceConfig[];\n viewResource: Resource | string;\n actionType: ActionType;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter: (parentResource: any) => string;\n disableCacheForFilterPii: boolean;\n rpcConfigs?: RPCConfig[];\n sorts: FieldSort[];\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\n\nexport function listViewConfig(config: ListViewConfigOptions): ListViewConfig {\n return {\n ...listViewConfigDefaults,\n ...config,\n } satisfies ListViewConfig;\n}\nexport const listViewConfigDefaults = {\n title: '',\n primaryResource: '' as Resource,\n type: 'ListView',\n createTitle: '',\n createButtonLabel: 'Create',\n loadCreatedResource: false,\n showViewButton: true,\n collapsible: false,\n listColumns: [],\n elements: [],\n parentClass: '',\n fieldClass: '',\n createConfig: {} as ListViewConfig,\n createNavigation: [],\n relatedConfigs: [],\n parentRelation: {\n parentKey: '' as FieldName,\n childKey: '' as FieldName,\n },\n overrideResource: '' as Resource,\n searchable: false,\n enableRowExpansion: false,\n rowExpansionConfig: {} as ChildResourceConfig,\n requireSearchToDisplayResults: false,\n showBackButton: true,\n filter: (): string => '',\n disableCacheForFilterPii: false,\n sorts: [] as FieldSort[],\n viewResource: '' as Resource,\n actionType: 'function' as ActionType,\n rpcConfigs: [],\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ListViewConfig;\n\nexport type ViewType = 'OneToOne' | 'OneToMany';\n\nexport interface ViewConfigOptions extends BaseConfigOptions {\n collapsible?: boolean;\n connectorResource?: Resource;\n relatedConfigs?: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ViewConfig extends BaseConfig {\n type: 'View';\n collapsible: boolean;\n // todo: remove this comment once full documentation has been added. Populate this value when a database view resource is used to connect the ViewConfig's parent resource to its primary resource\n connectorResource: Resource;\n rpcConfigs?: RPCConfig[];\n relatedConfigs: ChildResourceConfig[];\n /** A set of functions that allows for\n * conditional display of non-RPC\n * actions based on the pristine state of the resource\n * (if such a state is applicable. Creation for example won't\n * have such data)\n * This is separate from ABAC control which takes\n * precedence and is based on a user's attributes\n */\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\n\nexport function viewConfig(config: ViewConfigOptions): ViewConfig {\n return {\n ...viewConfigDefaults,\n ...config,\n } satisfies ViewConfig;\n}\nexport const viewConfigDefaults = {\n title: '',\n primaryResource: '' as Resource,\n type: 'View',\n createTitle: '',\n createButtonLabel: 'Create',\n parentClass: '',\n fieldClass: '',\n elements: [],\n collapsible: true,\n connectorResource: '' as Resource,\n relatedConfigs: [],\n createConfig: {} as ViewConfig,\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n createNavigation: [],\n parentRelation: {\n parentKey: '' as FieldName,\n childKey: '' as FieldName,\n },\n showBackButton: true,\n rpcConfigs: [],\n} satisfies ViewConfig;\n\nexport interface arrayConfigOptions {\n iteratedConfig: ChildResourceConfig;\n viewType?: ViewType;\n collapsible?: boolean;\n createConfig?: ConfigType;\n connectorResource?: Resource;\n connectorField?: FieldName;\n primaryResource: Resource;\n listFilter: (parentResource: any) => string;\n disableCacheForFilterPii?: boolean;\n sorts?: FieldSort[];\n title?: string;\n createButtonLabel?: string;\n limit?: number;\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ArrayConfig {\n type: 'Array';\n iteratedConfig: ChildResourceConfig;\n viewType: ViewType;\n collapsible: boolean;\n createConfig: ConfigType;\n connectorResource: Resource;\n connectorField: FieldName;\n primaryResource: Resource;\n listFilter: (parentResource: any) => string;\n disableCacheForFilterPii: boolean;\n sorts: FieldSort[];\n title: string;\n createButtonLabel: string;\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n limit: number;\n}\nexport function arrayConfig(config: arrayConfigOptions): ArrayConfig {\n return {\n ...arrayConfigDefaults,\n ...config,\n } satisfies ArrayConfig;\n}\nexport const arrayConfigDefaults = {\n type: 'Array',\n iteratedConfig: {} as ChildResourceConfig,\n viewType: 'OneToMany' as ViewType,\n collapsible: true,\n createConfig: {} as ViewConfig,\n connectorResource: '' as Resource,\n connectorField: '' as FieldName,\n primaryResource: '' as Resource,\n listFilter: (): string => '',\n disableCacheForFilterPii: false,\n sorts: [] as FieldSort[],\n title: '',\n createButtonLabel: 'Create',\n limit: Infinity,\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ArrayConfig;\n","export enum AlertLevel {\n ERROR = 'warn',\n INFO = 'accent',\n SUCCESS = 'success',\n}\n\nexport interface CreateNotificationMessage {\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n\nexport interface NotificationMessage {\n id: number;\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n","type Brand<K, T> = K & { __brand: T };\n\nexport type Permission = Brand<string, 'Permission'>;\nexport type Resource = Brand<string, 'Resource'>;\nexport type Domain = Brand<string, 'Domain'>;\nexport type FieldName = Brand<string, 'FieldName'>;\nexport type Method = Brand<string, 'Method'>;\nexport type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;\n\nexport interface PermissionScope {\n resource: Resource;\n permission: Permission;\n domain: Domain;\n}\n\nexport const ReadPermission = 'Read' as Permission;\nexport const UpdatePermission = 'Update' as Permission;\n","import { InjectionToken } from '@angular/core';\nimport { Domain, Permission, Resource } from './permissions';\nimport { MethodMeta, ResourceMeta } from './resource-meta';\n\n/**\n * The base URL for API requests (e.g., 'https://api.example.com/').\n */\nexport const BASE_URL = new InjectionToken<string>('BASE_URL');\n\n/**\n * The path to the frontend login page (e.g., '/login').\n */\nexport const FRONTEND_LOGIN_PATH = new InjectionToken<string>('FRONTEND_LOGIN_PATH');\n\n/**\n * The path to the session endpoint (e.g., 'user/session').\n */\nexport const SESSION_PATH = new InjectionToken<string>('SESSION_PATH');\n\n/**\n * The base URL for API requests (e.g., '/api').\n */\nexport const API_URL = new InjectionToken<string>('API_URL');\n\nexport const PERMISSION_REQUIRED = new InjectionToken<(resource: Resource, permission: Permission) => boolean>(\n 'PERMISSION_REQUIRED',\n);\n\nexport const AVAILABLE_PERMISSIONS = new InjectionToken<{\n Create: Permission;\n Delete: Permission;\n List: Permission;\n Read: Permission;\n Update: Permission;\n}>('AVAILABLE_PERMISSIONS');\nexport const AVAILABLE_DOMAINS = new InjectionToken<Record<string, Domain>[]>('AVAILABLE_DOMAINS');\n\nexport const RESOURCE_META = new InjectionToken<(resource: Resource) => ResourceMeta>('RESOURCE_META');\nexport const METHOD_META = new InjectionToken<(method: string) => MethodMeta>('METHOD_META');\n\nexport const IDLE_SESSION_DURATION = new InjectionToken<number>('IDLE_SESSION_DURATION');\nexport const IDLE_WARNING_DURATION = new InjectionToken<number>('IDLE_WARNING_DURATION');\nexport const IDLE_KEEPALIVE_DURATION = new InjectionToken<number>('IDLE_KEEPALIVE_DURATION');\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport const validatorsPresent = (\n control: AbstractControl<unknown, unknown>,\n validators: ValidatorFn[],\n previousValidatorCount: number,\n): boolean => {\n if (validators.length === previousValidatorCount) {\n return true;\n }\n\n let hasAllValidators = true;\n for (const validator of validators) {\n if (!control.hasValidator(validator)) {\n hasAllValidators = false;\n break;\n }\n }\n return hasAllValidators;\n};\n\nexport const requiredIf = (predicate: () => boolean, validator: ValidatorFn) => {\n return (formControl: AbstractControl): ValidationErrors | null => {\n if (!formControl.parent) {\n return null;\n }\n if (predicate()) {\n return validator(formControl);\n }\n return null;\n };\n};\n\ndeclare const __singletonValidatorBrand: unique symbol;\nexport type ResourceValidatorFn = ValidatorFn & {\n readonly [__singletonValidatorBrand]: true;\n};\nexport function createResourceValidator(validator: ValidatorFn): ResourceValidatorFn {\n return validator as ResourceValidatorFn;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAO,MAAM,sBAAsB,GAAG;;AC+DhC,SAAU,kBAAkB,CAAC,MAAiC,EAAA;IAClE,OAAO;AACL,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACmB;AAChC;AAEO,MAAM,0BAA0B,GAAG;AACxC,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,UAAU,EAAE,UAAwB;AACpC,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,aAAa,EAAE,EAAE;;AAwCb,SAAU,kBAAkB,CAAC,MAAiC,EAAA;IAClE,OAAO;AACL,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACmB;AAChC;AAEO,MAAM,0BAA0B,GAAG;AACxC,IAAA,EAAE,EAAE,EAAe;AACnB,IAAA,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IAAI,cAAc,CAA2B,mBAAmB;MAEpF,aAAa,GAAG,IAAI,cAAc,CAAuC,eAAe;MACxF,WAAW,GAAG,IAAI,cAAc,CAAiC,aAAa;MAE9E,qBAAqB,GAAG,IAAI,cAAc,CAAS,uBAAuB;MAC1E,qBAAqB,GAAG,IAAI,cAAc,CAAS,uBAAuB;MAC1E,uBAAuB,GAAG,IAAI,cAAc,CAAS,yBAAyB;;ACxCpF,MAAM,iBAAiB,GAAG,CAC/B,OAA0C,EAC1C,UAAyB,EACzB,sBAA8B,KACnB;AACX,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,sBAAsB,EAAE;AAChD,QAAA,OAAO,IAAI;IACb;IAEA,IAAI,gBAAgB,GAAG,IAAI;AAC3B,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;YACpC,gBAAgB,GAAG,KAAK;YACxB;QACF;IACF;AACA,IAAA,OAAO,gBAAgB;AACzB;MAEa,UAAU,GAAG,CAAC,SAAwB,EAAE,SAAsB,KAAI;IAC7E,OAAO,CAAC,WAA4B,KAA6B;AAC/D,QAAA,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;AACvB,YAAA,OAAO,IAAI;QACb;QACA,IAAI,SAAS,EAAE,EAAE;AACf,YAAA,OAAO,SAAS,CAAC,WAAW,CAAC;QAC/B;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAMM,SAAU,uBAAuB,CAAC,SAAsB,EAAA;AAC5D,IAAA,OAAO,SAAgC;AACzC;;ACvCA;;AAEG;;;;"}
@@ -8,7 +8,7 @@ import * as i1 from '@angular/material/icon';
8
8
  import { MatIconModule } from '@angular/material/icon';
9
9
  import * as i4 from '@angular/router';
10
10
  import { RouterModule } from '@angular/router';
11
- import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
11
+ import { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';
12
12
 
13
13
  class AlertComponent {
14
14
  error;
@@ -45,4 +45,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
45
45
  */
46
46
 
47
47
  export { AlertComponent };
48
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-alert.mjs.map
48
+ //# sourceMappingURL=cccteam-ccc-lib-ui-alert.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-ui-alert.mjs","sources":["../../../projects/ccc-lib/ui-alert/alert.component.ts","../../../projects/ccc-lib/ui-alert/alert.component.html","../../../projects/ccc-lib/ui-alert/cccteam-ccc-lib-ui-alert.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { RouterModule } from '@angular/router';\nimport { NotificationMessage } from '@cccteam/ccc-lib/types';\nimport { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';\n\n@Component({\n selector: 'ccc-alert',\n templateUrl: './alert.component.html',\n styleUrls: ['./alert.component.scss'],\n imports: [MatIconModule, MatButtonModule, CommonModule, RouterModule],\n})\nexport class AlertComponent implements OnInit {\n @Input({ required: true }) error!: NotificationMessage;\n @Output() dismiss = new EventEmitter();\n\n errors = inject(NotificationService);\n ngOnInit(): void {\n if (this.error.duration === undefined) {\n this.error.duration = 30000;\n }\n\n setTimeout(() => {\n this.dismissAlert();\n }, this.error.duration);\n }\n\n dismissAlert(): void {\n if (this.error.id !== undefined) {\n this.errors.dismissGlobalNotification(this.error);\n }\n }\n}\n","<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button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AA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAEzD,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;+BACE,WAAW,EAAA,OAAA,EAGZ,CAAC,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,mZAAA,EAAA,MAAA,EAAA,CAAA,wiBAAA,CAAA,EAAA;;sBAGpE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB;;;AEhBH;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, signal, computed, Injectable } from '@angular/core';
3
- import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
3
+ import { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';
4
4
 
5
5
  class UiCoreService {
6
6
  notifications = inject(NotificationService);
@@ -38,4 +38,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
38
38
  */
39
39
 
40
40
  export { UiCoreService };
41
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-core-service.mjs.map
41
+ //# sourceMappingURL=cccteam-ccc-lib-ui-core-service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-ui-core-service.mjs","sources":["../../../projects/ccc-lib/ui-core-service/ui-core.service.ts","../../../projects/ccc-lib/ui-core-service/cccteam-ccc-lib-ui-core-service.ts"],"sourcesContent":["import { computed, inject, Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage } from '@cccteam/ccc-lib/types';\nimport { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UiCoreService {\n notifications = inject(NotificationService);\n loadingSignal = signal([] as string[]);\n sidenavOpened = signal(true);\n currentSidenavIdentifier = signal('');\n\n private loading = this.loadingSignal.asReadonly();\n isLoading = computed(() => this.loading().length > 0);\n\n publishError(message: CreateNotificationMessage): void {\n this.notifications.addGlobalNotification(message);\n }\n\n beginActivity(process: string): void {\n if (!this.loading().includes(process)) {\n this.loadingSignal.update((current) => [...current, process]);\n }\n }\n\n endActivity(process: string): void {\n this.loadingSignal.update((current) => current.filter((p) => p !== process));\n }\n\n toggleSidenav(): void {\n this.sidenavOpened.update((opened) => !opened);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,aAAa,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAC3C,IAAA,aAAa,GAAG,MAAM,CAAC,EAAc,2DAAC;AACtC,IAAA,aAAa,GAAG,MAAM,CAAC,IAAI,2DAAC;AAC5B,IAAA,wBAAwB,GAAG,MAAM,CAAC,EAAE,sEAAC;AAE7B,IAAA,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;AACjD,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,uDAAC;AAErD,IAAA,YAAY,CAAC,OAAkC,EAAA;AAC7C,QAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,OAAO,CAAC;IACnD;AAEA,IAAA,aAAa,CAAC,OAAe,EAAA;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACrC,YAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/D;IACF;AAEA,IAAA,WAAW,CAAC,OAAe,EAAA;QACzB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,CAAC;IAC9E;IAEA,aAAa,GAAA;AACX,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC;IAChD;uGAzBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
2
2
  import { inject, signal, computed, Injectable } from '@angular/core';
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { Router } from '@angular/router';
5
- import { AuthService } from '@cccteam/ccc-lib/src/auth-service';
6
- import { IDLE_SESSION_DURATION, IDLE_WARNING_DURATION, IDLE_KEEPALIVE_DURATION, AlertLevel } from '@cccteam/ccc-lib/src/types';
7
- import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
8
- import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
5
+ import { AuthService } from '@cccteam/ccc-lib/auth-service';
6
+ import { IDLE_SESSION_DURATION, IDLE_WARNING_DURATION, IDLE_KEEPALIVE_DURATION, AlertLevel } from '@cccteam/ccc-lib/types';
7
+ import { UiCoreService } from '@cccteam/ccc-lib/ui-core-service';
8
+ import { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';
9
9
  import { interval } from 'rxjs';
10
10
 
11
11
  class IdleService {
@@ -20,7 +20,7 @@ class IdleService {
20
20
  warningThreshold = this.sessionDuration - this.warningDuration;
21
21
  isActive = signal(false, { ...(ngDevMode ? { debugName: "isActive" } : {}) });
22
22
  lastActivityTimestamp = signal(0, { ...(ngDevMode ? { debugName: "lastActivityTimestamp" } : {}) });
23
- tick = signal(Date.now(), { ...(ngDevMode ? { debugName: "tick" } : {}) }); // A signal to represent the current time
23
+ tick = signal(Date.now(), { ...(ngDevMode ? { debugName: "tick" } : {}) });
24
24
  secondsIdle = computed(() => {
25
25
  if (!this.isActive() || this.lastActivityTimestamp() === 0) {
26
26
  return 0;
@@ -154,4 +154,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
154
154
  */
155
155
 
156
156
  export { IdleService };
157
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-idle-service.mjs.map
157
+ //# sourceMappingURL=cccteam-ccc-lib-ui-idle-service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-ui-idle-service.mjs","sources":["../../../projects/ccc-lib/ui-idle-service/idle.service.ts","../../../projects/ccc-lib/ui-idle-service/cccteam-ccc-lib-ui-idle-service.ts"],"sourcesContent":["import { computed, inject, Injectable, OnDestroy, signal, WritableSignal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Router } from '@angular/router';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport {\n AlertLevel,\n IDLE_KEEPALIVE_DURATION,\n IDLE_SESSION_DURATION,\n IDLE_WARNING_DURATION,\n} from '@cccteam/ccc-lib/types';\nimport { UiCoreService } from '@cccteam/ccc-lib/ui-core-service';\nimport { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';\nimport { interval, Subscription } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IdleService implements OnDestroy {\n private auth = inject(AuthService);\n private core = inject(UiCoreService);\n private router = inject(Router);\n private notifications = inject(NotificationService);\n\n private readonly sessionDuration = inject(IDLE_SESSION_DURATION);\n private readonly warningDuration = inject(IDLE_WARNING_DURATION);\n private readonly keepAliveDuration = inject(IDLE_KEEPALIVE_DURATION);\n private readonly idleCheckFrequency = 1000;\n private readonly warningThreshold = this.sessionDuration - this.warningDuration;\n\n public readonly isActive = signal(false);\n private lastActivityTimestamp: WritableSignal<number> = signal(0);\n private tick = signal(Date.now());\n\n public readonly secondsIdle = computed(() => {\n if (!this.isActive() || this.lastActivityTimestamp() === 0) {\n return 0;\n }\n // Depends on tick() to force re-evaluation as time passes\n return Math.floor((this.tick() - this.lastActivityTimestamp()) / 1000);\n });\n\n public readonly isWarning = computed(() => this.secondsIdle() >= this.warningThreshold);\n public readonly countdown = computed(() => {\n if (!this.isWarning()) {\n return 0;\n }\n const remaining = this.sessionDuration - this.secondsIdle();\n return Math.max(0, remaining);\n });\n\n private alertId: number | undefined;\n private mainTickerSubscription: Subscription | undefined;\n\n private readonly activityEvents = ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart', 'click'];\n\n constructor() {\n interval(this.keepAliveDuration * 1000)\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.checkSession());\n }\n\n ngOnDestroy(): void {\n this.stop();\n }\n\n /**\n * Starts the idle monitoring service.\n */\n start(): void {\n if (this.isActive()) {\n return;\n }\n this.isActive.set(true);\n this.lastActivityTimestamp.set(Date.now());\n this.addActivityListeners();\n this.startMainTicker();\n }\n\n /**\n * Stops the idle monitoring service and cleans up timers and alerts.\n */\n stop(): void {\n this.isActive.set(false);\n this.mainTickerSubscription?.unsubscribe();\n this.removeActivityListeners();\n this.dismissWarningAlert();\n }\n\n /**\n * Logs out the user due to inactivity and stops the service.\n */\n logoutAndStop(): void {\n this.stop();\n\n this.router.navigate([this.auth.loginRoute()]);\n this.core.publishError({\n message: 'You have been logged out due to inactivity.',\n level: AlertLevel.INFO,\n link: '',\n });\n }\n\n private startMainTicker(): void {\n this.mainTickerSubscription = interval(this.idleCheckFrequency).subscribe(() => {\n this.tick.set(Date.now());\n\n if (this.secondsIdle() >= this.sessionDuration) {\n this.logoutAndStop();\n return;\n }\n\n if (this.isWarning()) {\n this.showOrUpdateWarningAlert(this.countdown());\n } else {\n this.dismissWarningAlert();\n }\n });\n }\n\n private checkSession(): void {\n if (this.auth.authenticated()) {\n this.auth.checkUserSession().subscribe({\n next: () => {\n if (!this.auth.authenticated()) {\n this.logoutAndStop();\n }\n },\n });\n }\n }\n\n setLastActivity(): void {\n this.lastActivityTimestamp.set(Date.now());\n }\n boundActivity = this.setLastActivity.bind(this);\n\n private addActivityListeners(): void {\n this.activityEvents.forEach((event) => {\n document.addEventListener(event, this.boundActivity, true);\n });\n }\n\n private removeActivityListeners(): void {\n this.activityEvents.forEach((event) => {\n document.removeEventListener(event, this.boundActivity, true);\n });\n }\n\n private showOrUpdateWarningAlert(countdown: number): void {\n const message = `You will be logged out in ${countdown} seconds due to inactivity.`;\n if (this.alertId !== undefined) {\n this.notifications.updateNotification({ id: this.alertId, level: AlertLevel.INFO, link: '', message });\n } else {\n this.alertId = this.notifications.addGlobalNotification({\n message,\n level: AlertLevel.INFO,\n link: '',\n });\n }\n }\n\n private dismissWarningAlert(): void {\n if (this.alertId !== undefined) {\n this.notifications.dismissGlobalNotificationById(this.alertId);\n this.alertId = undefined;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings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WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, NgZone, Injectable } from '@angular/core';
3
3
  import { Router } from '@angular/router';
4
- import { AuthService } from '@cccteam/ccc-lib/src/auth-service';
5
- import { BASE_URL, AlertLevel } from '@cccteam/ccc-lib/src/types';
6
- import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
7
- import { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/src/util-request-options';
4
+ import { AuthService } from '@cccteam/ccc-lib/auth-service';
5
+ import { BASE_URL, AlertLevel } from '@cccteam/ccc-lib/types';
6
+ import { UiCoreService } from '@cccteam/ccc-lib/ui-core-service';
7
+ import { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/util-request-options';
8
8
  import { catchError, throwError, finalize } from 'rxjs';
9
9
 
10
10
  class ApiInterceptor {
@@ -47,4 +47,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
47
47
  */
48
48
 
49
49
  export { ApiInterceptor };
50
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-interceptor.mjs.map
50
+ //# sourceMappingURL=cccteam-ccc-lib-ui-interceptor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-ui-interceptor.mjs","sources":["../../../projects/ccc-lib/ui-interceptor/api.interceptor.ts","../../../projects/ccc-lib/ui-interceptor/cccteam-ccc-lib-ui-interceptor.ts"],"sourcesContent":["import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { inject, Injectable, NgZone } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport { AlertLevel, BASE_URL } from '@cccteam/ccc-lib/types';\nimport { UiCoreService } from '@cccteam/ccc-lib/ui-core-service';\nimport { CUSTOM_HTTP_REQUEST_OPTIONS } from '@cccteam/ccc-lib/util-request-options';\nimport { catchError, finalize, Observable, throwError } from 'rxjs';\n\n@Injectable()\nexport class ApiInterceptor implements HttpInterceptor {\n private ui = inject(UiCoreService);\n private auth = inject(AuthService);\n private router = inject(Router);\n private ngZone = inject(NgZone);\n private baseUrl = inject(BASE_URL);\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n this.ui.beginActivity(request.method + ' ' + request.url);\n\n return next.handle(request).pipe(\n catchError((error: HttpErrorResponse): Observable<HttpEvent<unknown>> => {\n if (error.status === 401) {\n this.ngZone.run(() => {\n this.auth.redirectUrl.set(this.baseUrl + this.router.url);\n this.router.navigate([this.auth.loginRoute()]);\n });\n }\n if (!request.context.get(CUSTOM_HTTP_REQUEST_OPTIONS).suppressGlobalError) {\n const message = error.error?.message ?? error.message ?? error.error;\n this.ui.publishError({\n message: message,\n level: AlertLevel.ERROR,\n link: '',\n });\n }\n\n return throwError(() => error);\n }),\n finalize(() => {\n this.ui.endActivity(request.method + ' ' + request.url);\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAUa,cAAc,CAAA;AACjB,IAAA,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;AAC1B,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC;IAElC,SAAS,CAAC,OAA6B,EAAE,IAAiB,EAAA;AACxD,QAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,GAAG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;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACTD;;AAEG;;;;"}
@@ -60,4 +60,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
60
60
  */
61
61
 
62
62
  export { NotificationService };
63
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-notification-service.mjs.map
63
+ //# sourceMappingURL=cccteam-ccc-lib-ui-notification-service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-ui-notification-service.mjs","sources":["../../../projects/ccc-lib/ui-notification-service/notification.service.ts","../../../projects/ccc-lib/ui-notification-service/cccteam-ccc-lib-ui-notification-service.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage, NotificationMessage } from '@cccteam/ccc-lib/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n private notificationId = signal(0);\n private _notifications = signal<NotificationMessage[]>([]);\n notifications = this._notifications.asReadonly();\n\n /**\n * Adds a new global notification.\n * @param notification The notification message to add.\n * @returns The unique ID assigned to the notification.\n */\n addGlobalNotification(notification: CreateNotificationMessage): number {\n this.notificationId.update((id) => id + 1);\n const newNotification: NotificationMessage = {\n ...notification,\n id: this.notificationId(),\n };\n const existingNotification = this._notifications().find((n) => n.message === newNotification.message);\n if (existingNotification) {\n this.updateNotification({ ...existingNotification, ...newNotification });\n return existingNotification.id;\n }\n this._notifications.update((current) => [...current, newNotification]);\n return newNotification.id;\n }\n\n /**\n * Dismisses a global notification by its ID.\n * @param notificationId The ID of the notification to dismiss.\n */\n dismissGlobalNotificationById(notificationId: number): void {\n this._notifications.update((current) => current.filter((notification) => notification.id !== notificationId));\n }\n\n /**\n * Dismisses a specific global notification.\n * @param notification The notification to dismiss.\n */\n dismissGlobalNotification(notification: NotificationMessage): void {\n this.dismissGlobalNotificationById(notification.id);\n }\n\n /**\n * Updates an existing notification.\n * @param updatedNotification The notification with updated information.\n */\n updateNotification(updatedNotification: NotificationMessage): void {\n this._notifications.update((current) =>\n current.map((notification) =>\n notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification,\n ),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,mBAAmB,CAAA;AACtB,IAAA,cAAc,GAAG,MAAM,CAAC,CAAC,4DAAC;AAC1B,IAAA,cAAc,GAAG,MAAM,CAAwB,EAAE,4DAAC;AAC1D,IAAA,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;AAEhD;;;;AAIG;AACH,IAAA,qBAAqB,CAAC,YAAuC,EAAA;AAC3D,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1C,QAAA,MAAM,eAAe,GAAwB;AAC3C,YAAA,GAAG,YAAY;AACf,YAAA,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE;SAC1B;QACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,KAAK,eAAe,CAAC,OAAO,CAAC;QACrG,IAAI,oBAAoB,EAAE;YACxB,IAAI,CAAC,kBAAkB,CAAC,EAAE,GAAG,oBAAoB,EAAE,GAAG,eAAe,EAAE,CAAC;YACxE,OAAO,oBAAoB,CAAC,EAAE;QAChC;AACA,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,GAAG,OAAO,EAAE,eAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,EAAE;IAC3B;AAEA;;;AAGG;AACH,IAAA,6BAA6B,CAAC,cAAsB,EAAA;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC;IAC/G;AAEA;;;AAGG;AACH,IAAA,yBAAyB,CAAC,YAAiC,EAAA;AACzD,QAAA,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAAC,EAAE,CAAC;IACrD;AAEA;;;AAGG;AACH,IAAA,kBAAkB,CAAC,mBAAwC,EAAA;AACzD,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KACjC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,KACvB,YAAY,CAAC,EAAE,KAAK,mBAAmB,CAAC,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,mBAAmB,EAAE,GAAG,YAAY,CACxG,CACF;IACH;uGAnDW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
@@ -9,8 +9,8 @@ import { MatIconModule } from '@angular/material/icon';
9
9
  import { MatSidenavModule } from '@angular/material/sidenav';
10
10
  import * as i2 from '@angular/router';
11
11
  import { RouterModule } from '@angular/router';
12
- import { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';
13
- import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
12
+ import { HasPermissionDirective } from '@cccteam/ccc-lib/auth-has-permission';
13
+ import { UiCoreService } from '@cccteam/ccc-lib/ui-core-service';
14
14
 
15
15
  class SidenavComponent {
16
16
  ui = inject(UiCoreService);
@@ -57,4 +57,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
57
57
  */
58
58
 
59
59
  export { SidenavComponent };
60
- //# sourceMappingURL=cccteam-ccc-lib-src-ui-sidenav.mjs.map
60
+ //# sourceMappingURL=cccteam-ccc-lib-ui-sidenav.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-ui-sidenav.mjs","sources":["../../../projects/ccc-lib/ui-sidenav/sidenav.component.ts","../../../projects/ccc-lib/ui-sidenav/sidenav.component.html","../../../projects/ccc-lib/ui-sidenav/cccteam-ccc-lib-ui-sidenav.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, inject, Input, Signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSidenavModule } from '@angular/material/sidenav';\nimport { RouterModule } from '@angular/router';\n\nimport { HasPermissionDirective } from '@cccteam/ccc-lib/auth-has-permission';\nimport { PermissionScope } from '@cccteam/ccc-lib/types';\nimport { UiCoreService } from '@cccteam/ccc-lib/ui-core-service';\n\nexport interface NavItem {\n type: 'link' | 'header' | 'expandable';\n routerLink?: string[];\n label: string;\n icon?: string;\n permission?: PermissionScope;\n children?: NavItem[];\n isExpanded?: boolean;\n attentionCount?: Signal<number>;\n}\n\nexport type NavGroups = Record<string, NavItem[]>;\n\n@Component({\n selector: 'ccc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n imports: [\n MatIconModule,\n RouterModule,\n CommonModule,\n MatExpansionModule,\n MatButtonModule,\n MatSidenavModule,\n HasPermissionDirective,\n ],\n})\nexport class SidenavComponent {\n ui = inject(UiCoreService);\n\n @Input() navGroups?: NavGroups;\n currentNav = computed(() => {\n return this.updateNavItems(this.ui.currentSidenavIdentifier());\n });\n\n /**\n * Updates the currentNav based on the identifier\n * @param identifier\n * @returns NavItem[]\n * @memberof SidenavComponent\n */\n updateNavItems(identifier: string): NavItem[] {\n if (!this.navGroups) {\n return [];\n }\n if (!this.navGroups[identifier]) {\n // pick the first one if the identifier is not found so we don't break the UI\n identifier = Object.keys(this.navGroups)[0];\n }\n return this.navGroups[identifier];\n }\n}\n","<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav(); track navItem) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAuCa,gBAAgB,CAAA;AAC3B,IAAA,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;AAEjB,IAAA,SAAS;AAClB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,wBAAwB,EAAE,CAAC;AAChE,IAAA,CAAC,wDAAC;AAEF;;;;;AAKG;AACH,IAAA,cAAc,CAAC,UAAkB,EAAA;AAC/B,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,OAAO,EAAE;QACX;QACA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;;AAE/B,YAAA,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC7C;AACA,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;IACnC;uGAvBW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECvC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A;;2FAGb,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAd5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,OAAA,EAGd;wBACP,aAAa;wBACb,YAAY;wBACZ,YAAY;wBACZ,kBAAkB;wBAClB,eAAe;wBACf,gBAAgB;wBAChB,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,wuEAAA,EAAA,MAAA,EAAA,CAAA,slCAAA,CAAA,EAAA;;sBAKA;;;AE1CH;;AAEG;;;;"}
@@ -16,4 +16,4 @@ function errorOptions(suppressGlobalError) {
16
16
  */
17
17
 
18
18
  export { CUSTOM_HTTP_REQUEST_OPTIONS, errorOptions };
19
- //# sourceMappingURL=cccteam-ccc-lib-src-util-request-options.mjs.map
19
+ //# sourceMappingURL=cccteam-ccc-lib-util-request-options.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cccteam-ccc-lib-util-request-options.mjs","sources":["../../../projects/ccc-lib/util-request-options/request-options.ts","../../../projects/ccc-lib/util-request-options/cccteam-ccc-lib-util-request-options.ts"],"sourcesContent":["import { HttpContext, HttpContextToken } from '@angular/common/http';\n\nexport interface CustomHttpRequestOptions {\n suppressGlobalError: boolean;\n}\n\nexport const CUSTOM_HTTP_REQUEST_OPTIONS = new HttpContextToken<CustomHttpRequestOptions>(() => ({\n suppressGlobalError: false,\n}));\n\nexport function errorOptions(suppressGlobalError: boolean | undefined): { context: HttpContext } {\n return {\n context: new HttpContext().set(CUSTOM_HTTP_REQUEST_OPTIONS, {\n suppressGlobalError: suppressGlobalError ?? false,\n }),\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAMO,MAAM,2BAA2B,GAAG,IAAI,gBAAgB,CAA2B,OAAO;AAC/F,IAAA,mBAAmB,EAAE,KAAK;AAC3B,CAAA,CAAC;AAEI,SAAU,YAAY,CAAC,mBAAwC,EAAA;IACnE,OAAO;QACL,OAAO,EAAE,IAAI,WAAW,EAAE,CAAC,GAAG,CAAC,2BAA2B,EAAE;YAC1D,mBAAmB,EAAE,mBAAmB,IAAI,KAAK;SAClD,CAAC;KACH;AACH;;AChBA;;AAEG;;;;"}