coer-elements 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/components/coer-grid/index.d.ts +1 -0
  2. package/components/index.d.ts +13 -0
  3. package/components/lib/coer-button/coer-button.component.d.ts +1 -1
  4. package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +28 -0
  5. package/components/lib/coer-filebox/coer-filebox.component.d.ts +33 -0
  6. package/components/lib/coer-form/coer-form.component.d.ts +33 -0
  7. package/components/lib/coer-grid/coer-grid.component.d.ts +53 -0
  8. package/components/lib/coer-grid/coer-grid.extension.d.ts +105 -0
  9. package/components/lib/coer-grid/coer-grid.templates.d.ts +9 -0
  10. package/components/lib/coer-modal/coer-modal.component.d.ts +38 -0
  11. package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +56 -0
  12. package/components/lib/coer-page-title/coer-page-title.component.d.ts +12 -0
  13. package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +75 -0
  14. package/components/lib/coer-switch/coer-switch.component.d.ts +31 -0
  15. package/components/lib/coer-tab/coer-tab.component.d.ts +35 -0
  16. package/components/lib/coer-textarea/coer-textarea.component.d.ts +51 -0
  17. package/components/lib/coer-textbox/coer-textbox.component.d.ts +57 -0
  18. package/components/lib/components.module.d.ts +24 -5
  19. package/directives/index.d.ts +3 -0
  20. package/directives/lib/coer-ref.directive.d.ts +14 -0
  21. package/directives/lib/directives.module.d.ts +8 -0
  22. package/directives/lib/life-cycle.directive.d.ts +14 -0
  23. package/esm2022/components/coer-grid/index.mjs +2 -0
  24. package/esm2022/components/index.mjs +14 -1
  25. package/esm2022/components/lib/coer-button/coer-button.component.mjs +2 -2
  26. package/esm2022/components/lib/coer-checkbox/coer-checkbox.component.mjs +84 -0
  27. package/esm2022/components/lib/coer-filebox/coer-filebox.component.mjs +104 -0
  28. package/esm2022/components/lib/coer-form/coer-form.component.mjs +102 -0
  29. package/esm2022/components/lib/coer-grid/coer-grid.component.mjs +515 -0
  30. package/esm2022/components/lib/coer-grid/coer-grid.extension.mjs +412 -0
  31. package/esm2022/components/lib/coer-grid/coer-grid.templates.mjs +30 -0
  32. package/esm2022/components/lib/coer-modal/coer-modal.component.mjs +108 -0
  33. package/esm2022/components/lib/coer-numberbox/coer-numberbox.component.mjs +260 -0
  34. package/esm2022/components/lib/coer-page-title/coer-page-title.component.mjs +44 -0
  35. package/esm2022/components/lib/coer-selectbox/coer-selectbox.component.mjs +339 -0
  36. package/esm2022/components/lib/coer-switch/coer-switch.component.mjs +94 -0
  37. package/esm2022/components/lib/coer-tab/coer-tab.component.mjs +116 -0
  38. package/esm2022/components/lib/coer-textarea/coer-textarea.component.mjs +157 -0
  39. package/esm2022/components/lib/coer-textbox/coer-textbox.component.mjs +196 -0
  40. package/esm2022/components/lib/components.module.mjs +93 -57
  41. package/esm2022/directives/index.mjs +4 -0
  42. package/esm2022/directives/lib/coer-ref.directive.mjs +23 -0
  43. package/esm2022/directives/lib/directives.module.mjs +25 -0
  44. package/esm2022/directives/lib/life-cycle.directive.mjs +29 -0
  45. package/esm2022/interfaces/coer-filebox/index.mjs +3 -0
  46. package/esm2022/interfaces/coer-grid/index.mjs +21 -0
  47. package/esm2022/interfaces/index.mjs +1 -3
  48. package/esm2022/interfaces/lib/coer-filebox/file-image.interface.mjs +2 -0
  49. package/esm2022/interfaces/lib/coer-filebox/file.interface.mjs +2 -0
  50. package/esm2022/interfaces/lib/coer-grid/grid-button-by-row.interface.mjs +2 -0
  51. package/esm2022/interfaces/lib/coer-grid/grid-checkbox.interface.mjs +2 -0
  52. package/esm2022/interfaces/lib/coer-grid/grid-coer-numberbox.interface.mjs +2 -0
  53. package/esm2022/interfaces/lib/coer-grid/grid-coer-selectbox.interface.mjs +2 -0
  54. package/esm2022/interfaces/lib/coer-grid/grid-coer-switch.interface.mjs +2 -0
  55. package/esm2022/interfaces/lib/coer-grid/grid-coer-textbox.interface.mjs +2 -0
  56. package/esm2022/interfaces/lib/coer-grid/grid-column.interface.mjs +2 -0
  57. package/esm2022/interfaces/lib/coer-grid/grid-data-source.interface.mjs +2 -0
  58. package/esm2022/interfaces/lib/coer-grid/grid-header-button.interface.mjs +2 -0
  59. package/esm2022/interfaces/lib/coer-grid/grid-header-export-button.interface.mjs +2 -0
  60. package/esm2022/interfaces/lib/coer-grid/grid-header.interface.mjs +2 -0
  61. package/esm2022/interfaces/lib/coer-grid/grid-import.interface.mjs +2 -0
  62. package/esm2022/interfaces/lib/coer-grid/grid-input-checkbox.interface.mjs +2 -0
  63. package/esm2022/interfaces/lib/coer-grid/grid-input-switch-change.interface.mjs +2 -0
  64. package/esm2022/interfaces/lib/coer-grid/grid-input-textbox.interface.mjs +2 -0
  65. package/esm2022/interfaces/lib/coer-grid/grid-item.interface.mjs +2 -0
  66. package/esm2022/interfaces/lib/coer-grid/grid-keyup-enter.interface.mjs +2 -0
  67. package/esm2022/interfaces/lib/coer-grid/grid-length.interface.mjs +2 -0
  68. package/esm2022/interfaces/lib/coer-grid/grid-search.interface.mjs +2 -0
  69. package/esm2022/interfaces/lib/coer-grid/grid-sort.interface.mjs +2 -0
  70. package/esm2022/interfaces/lib/coer-menu/menu-option-selected.interface.mjs +2 -0
  71. package/esm2022/interfaces/lib/coer-menu/menu.interface.mjs +2 -0
  72. package/esm2022/interfaces/lib/page-title/breadcrumb.interface.mjs +2 -0
  73. package/esm2022/interfaces/lib/page-title/go-back.interface.mjs +2 -0
  74. package/esm2022/interfaces/page-title/index.mjs +3 -0
  75. package/esm2022/pipes/index.mjs +5 -0
  76. package/esm2022/pipes/lib/html.pipe.mjs +18 -0
  77. package/esm2022/pipes/lib/no-image.pipe.mjs +23 -0
  78. package/esm2022/pipes/lib/numeric-format.pipe.mjs +15 -0
  79. package/esm2022/pipes/lib/pipes.module.mjs +31 -0
  80. package/esm2022/public_api.mjs +3 -1
  81. package/esm2022/signals/lib/breakpoint.signal.mjs +2 -2
  82. package/esm2022/signals/lib/is-loading.signal.mjs +2 -2
  83. package/esm2022/signals/lib/is-modal-open.signal.mjs +2 -2
  84. package/esm2022/tools/index.mjs +3 -2
  85. package/esm2022/tools/lib/breadcrumbs.class.mjs +2 -2
  86. package/esm2022/tools/lib/date-time.class.mjs +14 -7
  87. package/esm2022/tools/lib/files.class.mjs +2 -2
  88. package/esm2022/tools/lib/menu.class.mjs +23 -0
  89. package/esm2022/tools/lib/page.class.mjs +6 -6
  90. package/esm2022/tools/lib/screen.class.mjs +9 -1
  91. package/esm2022/tools/lib/source.class.mjs +3 -3
  92. package/esm2022/tools/lib/tools.mjs +220 -0
  93. package/fesm2022/coer-elements.mjs +3296 -603
  94. package/fesm2022/coer-elements.mjs.map +1 -1
  95. package/interfaces/coer-filebox/index.d.ts +2 -0
  96. package/interfaces/coer-grid/index.d.ts +20 -0
  97. package/interfaces/index.d.ts +0 -2
  98. package/interfaces/lib/coer-filebox/file-image.interface.d.ts +14 -0
  99. package/interfaces/lib/coer-filebox/file.interface.d.ts +5 -0
  100. package/interfaces/lib/coer-grid/grid-button-by-row.interface.d.ts +6 -0
  101. package/interfaces/lib/coer-grid/grid-checkbox.interface.d.ts +5 -0
  102. package/interfaces/lib/coer-grid/grid-coer-numberbox.interface.d.ts +12 -0
  103. package/interfaces/lib/coer-grid/grid-coer-selectbox.interface.d.ts +9 -0
  104. package/interfaces/lib/coer-grid/grid-coer-switch.interface.d.ts +6 -0
  105. package/interfaces/lib/coer-grid/grid-coer-textbox.interface.d.ts +11 -0
  106. package/interfaces/lib/coer-grid/grid-column.interface.d.ts +22 -0
  107. package/interfaces/lib/coer-grid/grid-data-source.interface.d.ts +6 -0
  108. package/interfaces/lib/coer-grid/grid-header-button.interface.d.ts +8 -0
  109. package/interfaces/lib/coer-grid/grid-header-export-button.interface.d.ts +10 -0
  110. package/interfaces/lib/coer-grid/grid-header.interface.d.ts +5 -0
  111. package/interfaces/lib/coer-grid/grid-import.interface.d.ts +4 -0
  112. package/interfaces/lib/coer-grid/grid-input-checkbox.interface.d.ts +5 -0
  113. package/interfaces/lib/coer-grid/grid-input-switch-change.interface.d.ts +5 -0
  114. package/interfaces/lib/coer-grid/grid-input-textbox.interface.d.ts +5 -0
  115. package/interfaces/lib/coer-grid/grid-item.interface.d.ts +5 -0
  116. package/interfaces/lib/coer-grid/grid-keyup-enter.interface.d.ts +6 -0
  117. package/interfaces/lib/coer-grid/grid-length.interface.d.ts +5 -0
  118. package/interfaces/lib/coer-grid/grid-search.interface.d.ts +4 -0
  119. package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +5 -0
  120. package/interfaces/lib/coer-menu/menu-option-selected.interface.d.ts +9 -0
  121. package/interfaces/lib/coer-menu/menu.interface.d.ts +6 -0
  122. package/interfaces/page-title/index.d.ts +2 -0
  123. package/package.json +1 -1
  124. package/pipes/index.d.ts +4 -0
  125. package/pipes/lib/html.pipe.d.ts +10 -0
  126. package/pipes/lib/no-image.pipe.d.ts +7 -0
  127. package/pipes/lib/numeric-format.pipe.d.ts +7 -0
  128. package/pipes/lib/pipes.module.d.ts +9 -0
  129. package/public_api.d.ts +2 -0
  130. package/signals/lib/is-loading.signal.d.ts +1 -1
  131. package/signals/lib/is-modal-open.signal.d.ts +1 -1
  132. package/src/images/no-image.png +0 -0
  133. package/src/images/no-user.png +0 -0
  134. package/src/interfaces/coer-filebox/index.ts +2 -0
  135. package/src/interfaces/coer-grid/index.ts +20 -0
  136. package/src/interfaces/coer-menu/index.ts +3 -0
  137. package/src/interfaces/index.ts +1 -3
  138. package/src/interfaces/lib/coer-filebox/file-image.interface.ts +14 -0
  139. package/src/interfaces/lib/coer-filebox/file.interface.ts +5 -0
  140. package/src/interfaces/lib/coer-grid/grid-button-by-row.interface.ts +7 -0
  141. package/src/interfaces/lib/coer-grid/grid-checkbox.interface.ts +5 -0
  142. package/src/interfaces/lib/coer-grid/grid-coer-numberbox.interface.ts +12 -0
  143. package/src/interfaces/lib/coer-grid/grid-coer-selectbox.interface.ts +9 -0
  144. package/src/interfaces/lib/coer-grid/grid-coer-switch.interface.ts +6 -0
  145. package/src/interfaces/lib/coer-grid/grid-coer-textbox.interface.ts +11 -0
  146. package/src/interfaces/lib/coer-grid/grid-column.interface.ts +23 -0
  147. package/src/interfaces/lib/coer-grid/grid-data-source.interface.ts +6 -0
  148. package/src/interfaces/lib/coer-grid/grid-header-button.interface.ts +8 -0
  149. package/src/interfaces/lib/coer-grid/grid-header-export-button.interface.ts +10 -0
  150. package/src/interfaces/lib/coer-grid/grid-header.interface.ts +5 -0
  151. package/src/interfaces/lib/coer-grid/grid-import.interface.ts +4 -0
  152. package/src/interfaces/lib/coer-grid/grid-input-checkbox.interface.ts +5 -0
  153. package/src/interfaces/lib/coer-grid/grid-input-switch-change.interface.ts +5 -0
  154. package/src/interfaces/lib/coer-grid/grid-input-textbox.interface.ts +5 -0
  155. package/src/interfaces/lib/coer-grid/grid-item.interface.ts +5 -0
  156. package/src/interfaces/lib/coer-grid/grid-keyup-enter.interface.ts +6 -0
  157. package/src/interfaces/lib/coer-grid/grid-length.interface.ts +5 -0
  158. package/src/interfaces/lib/coer-grid/grid-search.interface.ts +4 -0
  159. package/src/interfaces/lib/coer-grid/grid-sort.interface.ts +5 -0
  160. package/src/interfaces/lib/coer-menu/menu-option-selected.interface.ts +10 -0
  161. package/src/interfaces/lib/coer-menu/menu-selected.interface.ts +11 -0
  162. package/src/interfaces/lib/coer-menu/menu.interface.ts +6 -0
  163. package/src/interfaces/page-title/index.ts +2 -0
  164. package/tools/index.d.ts +2 -1
  165. package/tools/lib/breadcrumbs.class.d.ts +1 -1
  166. package/tools/lib/date-time.class.d.ts +4 -2
  167. package/tools/lib/menu.class.d.ts +8 -0
  168. package/tools/lib/page.class.d.ts +4 -3
  169. package/tools/lib/screen.class.d.ts +3 -1
  170. package/tools/lib/source.class.d.ts +1 -1
  171. package/tools/lib/{generi-tools.d.ts → tools.d.ts} +7 -5
  172. package/esm2022/interfaces/lib/breadcrumb.interface.mjs +0 -2
  173. package/esm2022/interfaces/lib/go-back.interface.mjs +0 -2
  174. package/esm2022/tools/lib/generi-tools.mjs +0 -199
  175. /package/interfaces/lib/{breadcrumb.interface.d.ts → page-title/breadcrumb.interface.d.ts} +0 -0
  176. /package/interfaces/lib/{go-back.interface.d.ts → page-title/go-back.interface.d.ts} +0 -0
  177. /package/src/interfaces/lib/{breadcrumb.interface.ts → page-title/breadcrumb.interface.ts} +0 -0
  178. /package/src/interfaces/lib/{go-back.interface.ts → page-title/go-back.interface.ts} +0 -0
  179. /package/src/styles/{coer-elements.scss → index.scss} +0 -0
@@ -0,0 +1,104 @@
1
+ import { Component, computed, inject, Input, input, output, viewChild } from '@angular/core';
2
+ import { CoerAlert } from '../../lib/coer-alert/coer-alert.component';
3
+ import { Files } from '../../../tools/lib/files.class';
4
+ import { Tools } from '../../../tools/lib/tools';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/common";
7
+ import * as i2 from "../coer-modal/coer-modal.component";
8
+ import * as i3 from "../../../pipes/lib/no-image.pipe";
9
+ export class CoerFilebox {
10
+ constructor() {
11
+ //Injections
12
+ this.alert = inject(CoerAlert);
13
+ this.IsNull = Tools.IsNull;
14
+ this.IsNotNull = Tools.IsNotNull;
15
+ //Elements
16
+ this.inputFileImage = viewChild.required('inputFileImage');
17
+ this.modal = viewChild.required('modal');
18
+ //Variables
19
+ this.base64 = '';
20
+ this._image = null;
21
+ this.imageExtensions = ['png', 'jpeg', 'jpg', 'gif', 'svg'];
22
+ //Inputs
23
+ this.type = input('image');
24
+ this.multiple = input(false);
25
+ this.isLoading = input(false);
26
+ this.isDisabled = input(false);
27
+ //Outputs
28
+ this.onSelected = output();
29
+ this.onDeleteImage = output();
30
+ //computed
31
+ this._isEnable = computed(() => {
32
+ return !this.isLoading() && !this.isDisabled();
33
+ });
34
+ /** */
35
+ this.GetExtensionFile = (fileName) => {
36
+ if (fileName.includes('.')) {
37
+ let worlds = fileName.split('.');
38
+ if (worlds.length > 0) {
39
+ let extension = worlds.pop();
40
+ extension = extension.trim();
41
+ extension = extension.toLowerCase();
42
+ if (extension.length > 0)
43
+ return extension;
44
+ }
45
+ }
46
+ this.alert.Warning('The file extension could not be recognized', 'Files');
47
+ return null;
48
+ };
49
+ }
50
+ set image(value) {
51
+ this._image = Tools.IsNotNull(value) ? value : null;
52
+ if (Tools.IsNotNull(value)) {
53
+ if (value?.value?.name) {
54
+ Files.ConvertToBase64(value?.value).then(base64 => {
55
+ return this.base64 = base64;
56
+ });
57
+ }
58
+ else
59
+ this.base64 = value?.value;
60
+ }
61
+ }
62
+ /** */
63
+ async UploadImages(event) {
64
+ const selectedFiles = Array.from(event.target.files);
65
+ const files = [];
66
+ let extension = null;
67
+ for (const file of selectedFiles) {
68
+ extension = this.GetExtensionFile(file.name) || '';
69
+ if (this.imageExtensions.includes(extension)) {
70
+ files.push({
71
+ file: file,
72
+ extension: extension,
73
+ base64: await Files.ConvertToBase64(file)
74
+ });
75
+ }
76
+ else
77
+ this.alert.Warning(`<b>.${extension}</b> extension not allowed`, 'Files');
78
+ }
79
+ //Response
80
+ this.inputFileImage().nativeElement.value = null;
81
+ this.onSelected.emit([...files]);
82
+ }
83
+ /** */
84
+ DeleteImage(event) {
85
+ event.stopPropagation();
86
+ if (this._isEnable()) {
87
+ this.onDeleteImage.emit();
88
+ }
89
+ }
90
+ /** */
91
+ ExpandImage(event) {
92
+ event.stopPropagation();
93
+ this.modal().Open();
94
+ }
95
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerFilebox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
96
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CoerFilebox, selector: "coer-filebox", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onSelected: "onSelected", onDeleteImage: "onDeleteImage" }, viewQueries: [{ propertyName: "inputFileImage", first: true, predicate: ["inputFileImage"], descendants: true, isSignal: true }, { propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"coer-filebox\">\r\n @if(type() == 'image') {\r\n <figure (click)=\"_isEnable() ? inputFileImage.click() : null\"\r\n [ngClass]=\"{ 'dashed': IsNull(_image?.value) }\"\r\n [ngStyle]=\"{\r\n 'margin-top': _image?.marginTop || '',\r\n 'margin-right': _image?.marginRight || '',\r\n 'margin-bottom': _image?.marginBottom || '',\r\n 'margin-left': _image?.marginLeft || ''\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"loading\">\r\n <i class=\"spinner-border\"></i>\r\n </div>\r\n\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <img [src]=\"base64 | noImage\"\r\n [ngStyle]=\"{\r\n 'width': _image?.width || '',\r\n 'max-width': _image?.maxWidth || '',\r\n 'height': _image?.height || '',\r\n 'max-height': _image?.maxHeight || '210px'\r\n }\">\r\n\r\n <input #inputFileImage\r\n type=\"file\"\r\n accept=\"image/png, image/jpeg, image/gif, image/svg+xml\"\r\n (change)=\"UploadImages($event)\"\r\n [multiple]=\"multiple()\">\r\n\r\n @if(_isEnable() && IsNotNull(_image) && IsNotNull(_image!.value)) {\r\n <div class=\"icon-container\">\r\n @if(IsNull(_image?.allowDelete) || _image!.allowDelete) {\r\n <i class=\"fa-solid fa-trash-can\" (click)=\"DeleteImage($event)\"></i>\r\n }\r\n\r\n @if(IsNull(_image?.allowExpand) || _image!.allowExpand) {\r\n <i class=\"fa-solid fa-expand\" (click)=\"ExpandImage($event)\"></i>\r\n }\r\n </div>\r\n }\r\n </figure>\r\n }\r\n\r\n <!-- Modal -->\r\n <coer-modal #modal [title]=\"_image?.name || ''\" height=\"90vh\" width=\"full\">\r\n <div class=\"modal-image\" [ngStyle]=\"{ 'background-image': 'url(' + base64 + ')' }\"></div>\r\n </coer-modal>\r\n</div>", styles: ["div.coer-filebox .text-blue{color:#0d6efd!important}div.coer-filebox .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-filebox .background-blue{background-color:#0d6efd!important}div.coer-filebox .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-filebox .border-blue{border-color:#0d6efd!important}div.coer-filebox .text-gray{color:#6c757d!important}div.coer-filebox .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-filebox .background-gray{background-color:#6c757d!important}div.coer-filebox .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-filebox .border-gray{border-color:#6c757d!important}div.coer-filebox .text-green{color:#198754!important}div.coer-filebox .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-filebox .background-green{background-color:#198754!important}div.coer-filebox .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-filebox .border-green{border-color:#198754!important}div.coer-filebox .text-yellow{color:#ffc107!important}div.coer-filebox .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-filebox .background-yellow{background-color:#ffc107!important}div.coer-filebox .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-filebox .border-yellow{border-color:#ffc107!important}div.coer-filebox .text-red{color:#dc3545!important}div.coer-filebox .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-filebox .background-red{background-color:#dc3545!important}div.coer-filebox .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-filebox .border-red{border-color:#dc3545!important}div.coer-filebox .text-white{color:#f5f5f5!important}div.coer-filebox .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-filebox .background-white{background-color:#f5f5f5!important}div.coer-filebox .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-filebox .border-white{border-color:#f5f5f5!important}div.coer-filebox .text-black{color:#252525!important}div.coer-filebox .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-filebox .background-black{background-color:#252525!important}div.coer-filebox .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-filebox .border-black{border-color:#252525!important}div.coer-filebox .text-orange{color:#fd6031!important}div.coer-filebox .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-filebox .background-orange{background-color:#fd6031!important}div.coer-filebox .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-filebox .border-orange{border-color:#fd6031!important}div.coer-filebox figure{position:relative;display:flex;align-items:center;justify-content:center;border-radius:3px;overflow:hidden;cursor:pointer;min-height:210px;z-index:1}div.coer-filebox .dashed{border:1px dashed #6c757d;background-color:transparent}div.coer-filebox div.loading{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:25px;background-color:#bbbbbb83!important;flex-direction:column!important;gap:10px!important;cursor:default!important}div.coer-filebox div.loading span.fa-fade{position:relative!important;top:50px!important}div.coer-filebox div.loading i.spinner-border{color:#fd6031!important;width:70px!important;height:70px!important;font-size:20px!important;position:absolute!important}div.coer-filebox span.placeholder{width:calc(100% + 32px)!important;height:100%!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-filebox div.icon-container{position:absolute;bottom:5px;right:5px;z-index:2;display:flex;align-items:center;justify-content:flex-end;gap:7px}div.coer-filebox div.icon-container i{color:#6c757d;font-size:20px}div.coer-filebox div.icon-container i:hover{zoom:1.1}div.coer-filebox div.modal-image{width:100%;height:100%;border-bottom-left-radius:5px;border-bottom-right-radius:5px;background-size:contain;background-repeat:no-repeat;background-position:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.CoerModal, selector: "coer-modal", inputs: ["id", "title", "icon", "showCloseButton", "width", "height", "maxHeight"], outputs: ["onOpen", "onClose"] }, { kind: "pipe", type: i3.NoImagePipe, name: "noImage" }] }); }
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerFilebox, decorators: [{
99
+ type: Component,
100
+ args: [{ selector: 'coer-filebox', template: "<div class=\"coer-filebox\">\r\n @if(type() == 'image') {\r\n <figure (click)=\"_isEnable() ? inputFileImage.click() : null\"\r\n [ngClass]=\"{ 'dashed': IsNull(_image?.value) }\"\r\n [ngStyle]=\"{\r\n 'margin-top': _image?.marginTop || '',\r\n 'margin-right': _image?.marginRight || '',\r\n 'margin-bottom': _image?.marginBottom || '',\r\n 'margin-left': _image?.marginLeft || ''\r\n }\">\r\n\r\n @if(isLoading()) {\r\n <div class=\"loading\">\r\n <i class=\"spinner-border\"></i>\r\n </div>\r\n\r\n <div class=\"placeholder-glow\">\r\n <span class=\"placeholder\"></span>\r\n </div>\r\n }\r\n\r\n <img [src]=\"base64 | noImage\"\r\n [ngStyle]=\"{\r\n 'width': _image?.width || '',\r\n 'max-width': _image?.maxWidth || '',\r\n 'height': _image?.height || '',\r\n 'max-height': _image?.maxHeight || '210px'\r\n }\">\r\n\r\n <input #inputFileImage\r\n type=\"file\"\r\n accept=\"image/png, image/jpeg, image/gif, image/svg+xml\"\r\n (change)=\"UploadImages($event)\"\r\n [multiple]=\"multiple()\">\r\n\r\n @if(_isEnable() && IsNotNull(_image) && IsNotNull(_image!.value)) {\r\n <div class=\"icon-container\">\r\n @if(IsNull(_image?.allowDelete) || _image!.allowDelete) {\r\n <i class=\"fa-solid fa-trash-can\" (click)=\"DeleteImage($event)\"></i>\r\n }\r\n\r\n @if(IsNull(_image?.allowExpand) || _image!.allowExpand) {\r\n <i class=\"fa-solid fa-expand\" (click)=\"ExpandImage($event)\"></i>\r\n }\r\n </div>\r\n }\r\n </figure>\r\n }\r\n\r\n <!-- Modal -->\r\n <coer-modal #modal [title]=\"_image?.name || ''\" height=\"90vh\" width=\"full\">\r\n <div class=\"modal-image\" [ngStyle]=\"{ 'background-image': 'url(' + base64 + ')' }\"></div>\r\n </coer-modal>\r\n</div>", styles: ["div.coer-filebox .text-blue{color:#0d6efd!important}div.coer-filebox .text-blue-bold{color:#0d6efd!important;font-weight:700!important}div.coer-filebox .background-blue{background-color:#0d6efd!important}div.coer-filebox .background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}div.coer-filebox .border-blue{border-color:#0d6efd!important}div.coer-filebox .text-gray{color:#6c757d!important}div.coer-filebox .text-gray-bold{color:#6c757d!important;font-weight:700!important}div.coer-filebox .background-gray{background-color:#6c757d!important}div.coer-filebox .background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}div.coer-filebox .border-gray{border-color:#6c757d!important}div.coer-filebox .text-green{color:#198754!important}div.coer-filebox .text-green-bold{color:#198754!important;font-weight:700!important}div.coer-filebox .background-green{background-color:#198754!important}div.coer-filebox .background-border-green{background-color:#198754!important;border-color:#198754!important}div.coer-filebox .border-green{border-color:#198754!important}div.coer-filebox .text-yellow{color:#ffc107!important}div.coer-filebox .text-yellow-bold{color:#ffc107!important;font-weight:700!important}div.coer-filebox .background-yellow{background-color:#ffc107!important}div.coer-filebox .background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}div.coer-filebox .border-yellow{border-color:#ffc107!important}div.coer-filebox .text-red{color:#dc3545!important}div.coer-filebox .text-red-bold{color:#dc3545!important;font-weight:700!important}div.coer-filebox .background-red{background-color:#dc3545!important}div.coer-filebox .background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}div.coer-filebox .border-red{border-color:#dc3545!important}div.coer-filebox .text-white{color:#f5f5f5!important}div.coer-filebox .text-white-bold{color:#f5f5f5!important;font-weight:700!important}div.coer-filebox .background-white{background-color:#f5f5f5!important}div.coer-filebox .background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}div.coer-filebox .border-white{border-color:#f5f5f5!important}div.coer-filebox .text-black{color:#252525!important}div.coer-filebox .text-black-bold{color:#252525!important;font-weight:700!important}div.coer-filebox .background-black{background-color:#252525!important}div.coer-filebox .background-border-black{background-color:#252525!important;border-color:#252525!important}div.coer-filebox .border-black{border-color:#252525!important}div.coer-filebox .text-orange{color:#fd6031!important}div.coer-filebox .text-orange-bold{color:#fd6031!important;font-weight:700!important}div.coer-filebox .background-orange{background-color:#fd6031!important}div.coer-filebox .background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}div.coer-filebox .border-orange{border-color:#fd6031!important}div.coer-filebox figure{position:relative;display:flex;align-items:center;justify-content:center;border-radius:3px;overflow:hidden;cursor:pointer;min-height:210px;z-index:1}div.coer-filebox .dashed{border:1px dashed #6c757d;background-color:transparent}div.coer-filebox div.loading{position:absolute;display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:25px;background-color:#bbbbbb83!important;flex-direction:column!important;gap:10px!important;cursor:default!important}div.coer-filebox div.loading span.fa-fade{position:relative!important;top:50px!important}div.coer-filebox div.loading i.spinner-border{color:#fd6031!important;width:70px!important;height:70px!important;font-size:20px!important;position:absolute!important}div.coer-filebox span.placeholder{width:calc(100% + 32px)!important;height:100%!important;position:absolute!important;z-index:1!important;top:0!important;left:-16px!important;cursor:wait!important}div.coer-filebox div.icon-container{position:absolute;bottom:5px;right:5px;z-index:2;display:flex;align-items:center;justify-content:flex-end;gap:7px}div.coer-filebox div.icon-container i{color:#6c757d;font-size:20px}div.coer-filebox div.icon-container i:hover{zoom:1.1}div.coer-filebox div.modal-image{width:100%;height:100%;border-bottom-left-radius:5px;border-bottom-right-radius:5px;background-size:contain;background-repeat:no-repeat;background-position:center}\n"] }]
101
+ }], propDecorators: { image: [{
102
+ type: Input
103
+ }] } });
104
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29lci1maWxlYm94LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4u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bigpO1xyXG4gICAgICAgIHRoaXMubW9kYWwoKS5PcGVuKCk7XHJcbiAgICB9XHJcbn0iLCI8ZGl2IGNsYXNzPVwiY29lci1maWxlYm94XCI+XHJcbiAgICBAaWYodHlwZSgpID09ICdpbWFnZScpIHtcclxuICAgICAgICA8ZmlndXJlIChjbGljayk9XCJfaXNFbmFibGUoKSA/IGlucHV0RmlsZUltYWdlLmNsaWNrKCkgOiBudWxsXCJcclxuICAgICAgICAgICAgW25nQ2xhc3NdPVwieyAnZGFzaGVkJzogSXNOdWxsKF9pbWFnZT8udmFsdWUpIH1cIlxyXG4gICAgICAgICAgICBbbmdTdHlsZV09XCJ7XHJcbiAgICAgICAgICAgICAgICAnbWFyZ2luLXRvcCc6IF9pbWFnZT8ubWFyZ2luVG9wIHx8ICcnLFxyXG4gICAgICAgICAgICAgICAgJ21hcmdpbi1yaWdodCc6IF9pbWFnZT8ubWFyZ2luUmlnaHQgfHwgJycsXHJcbiAgICAgICAgICAgICAgICAnbWFyZ2luLWJvdHRvbSc6IF9pbWFnZT8ubWFyZ2luQm90dG9tIHx8ICcnLFxyXG4gICAgICAgICAgICAgICAgJ21hcmdpbi1sZWZ0JzogX2ltYWdlPy5tYXJnaW5MZWZ0IHx8ICcnXHJcbiAgICAgICAgICAgIH1cIj5cclxuXHJcbiAgICAgICAgICAgIEBpZihpc0xvYWRpbmcoKSkge1xyXG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImxvYWRpbmdcIj5cclxuICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cInNwaW5uZXItYm9yZGVyXCI+PC9pPlxyXG4gICAgICAgICAgICAgICAgPC9kaXY+XHJcblxyXG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBsYWNlaG9sZGVyLWdsb3dcIj5cclxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInBsYWNlaG9sZGVyXCI+PC9zcGFuPlxyXG4gICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIDxpbWcgW3NyY109XCJiYXNlNjQgfCBub0ltYWdlXCJcclxuICAgICAgICAgICAgICAgIFtuZ1N0eWxlXT1cIntcclxuICAgICAgICAgICAgICAgICAgICAnd2lkdGgnOiBfaW1hZ2U/LndpZHRoIHx8ICcnLFxyXG4gICAgICAgICAgICAgICAgICAgICdtYXgtd2lkdGgnOiBfaW1hZ2U/Lm1heFdpZHRoIHx8ICcnLFxyXG4gICAgICAgICAgICAgICAgICAgICdoZWlnaHQnOiBfaW1hZ2U/LmhlaWdodCB8fCAnJyxcclxuICAgICAgICAgICAgICAgICAgICAnbWF4LWhlaWdodCc6IF9pbWFnZT8ubWF4SGVpZ2h0IHx8ICcyMTBweCdcclxuICAgICAgICAgICAgICAgIH1cIj5cclxuXHJcbiAgICAgICAgICAgIDxpbnB1dCAjaW5wdXRGaWxlSW1hZ2VcclxuICAgICAgICAgICAgICAgIHR5cGU9XCJmaWxlXCJcclxuICAgICAgICAgICAgICAgIGFjY2VwdD1cImltYWdlL3BuZywgaW1hZ2UvanBlZywgaW1hZ2UvZ2lmLCBpbWFnZS9zdmcreG1sXCJcclxuICAgICAgICAgICAgICAgIChjaGFuZ2UpPVwiVXBsb2FkSW1hZ2VzKCRldmVudClcIlxyXG4gICAgICAgICAgICAgICAgW211bHRpcGxlXT1cIm11bHRpcGxlKClcIj5cclxuXHJcbiAgICAgICAgICAgIEBpZihfaXNFbmFibGUoKSAmJiBJc05vdE51bGwoX2ltYWdlKSAmJiBJc05vdE51bGwoX2ltYWdlIS52YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJpY29uLWNvbnRhaW5lclwiPlxyXG4gICAgICAgICAgICAgICAgICAgIEBpZihJc051bGwoX2ltYWdlPy5hbGxvd0RlbGV0ZSkgfHwgX2ltYWdlIS5hbGxvd0RlbGV0ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA8aSBjbGFzcz1cImZhLXNvbGlkIGZhLXRyYXNoLWNhblwiIChjbGljayk9XCJEZWxldGVJbWFnZSgkZXZlbnQpXCI+PC9pPlxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgQGlmKElzTnVsbChfaW1hZ2U/LmFsbG93RXhwYW5kKSB8fCBfaW1hZ2UhLmFsbG93RXhwYW5kKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxpIGNsYXNzPVwiZmEtc29saWQgZmEtZXhwYW5kXCIgKGNsaWNrKT1cIkV4cGFuZEltYWdlKCRldmVudClcIj48L2k+XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICA8L2ZpZ3VyZT5cclxuICAgIH1cclxuXHJcbiAgICA8IS0tIE1vZGFsIC0tPlxyXG4gICAgPGNvZXItbW9kYWwgI21vZGFsIFt0aXRsZV09XCJfaW1hZ2U/Lm5hbWUgfHwgJydcIiBoZWlnaHQ9XCI5MHZoXCIgd2lkdGg9XCJmdWxsXCI+XHJcbiAgICAgICAgPGRpdiBjbGFzcz1cIm1vZGFsLWltYWdlXCIgW25nU3R5bGVdPVwieyAnYmFja2dyb3VuZC1pbWFnZSc6ICd1cmwoJyArIGJhc2U2NCArICcpJyB9XCI+PC9kaXY+XHJcbiAgICA8L2NvZXItbW9kYWw+XHJcbjwvZGl2PiJdfQ==
@@ -0,0 +1,102 @@
1
+ import { Component, inject, input } from '@angular/core';
2
+ import { CoerAlert } from '../../lib/coer-alert/coer-alert.component';
3
+ import { Tools } from '../../../tools/lib/tools';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@angular/forms";
6
+ export class CoerForm {
7
+ constructor() {
8
+ //Injection
9
+ this.alert = inject(CoerAlert);
10
+ this.formGroup = input.required();
11
+ this.isLoading = input(false);
12
+ this.isDisabled = input(false);
13
+ /** */
14
+ this.IsInvalidControl = (formControlName) => {
15
+ return Tools.IsNotNull(this.formGroup().get(formControlName))
16
+ ? (this.formGroup().get(formControlName).touched && this.formGroup().get(formControlName).invalid)
17
+ : true;
18
+ };
19
+ }
20
+ get _isDisabled() {
21
+ return this.isLoading() || this.isDisabled();
22
+ }
23
+ /** */
24
+ TouchForm() {
25
+ this.formGroup().markAllAsTouched();
26
+ }
27
+ /** */
28
+ SetControlValue(formControlName, value) {
29
+ if (Tools.IsNotNull(this.formGroup().get(formControlName))) {
30
+ this.formGroup().get(formControlName).setValue(value);
31
+ }
32
+ else {
33
+ this.alert.Warning(`${formControlName} Control`, 'Not Found');
34
+ }
35
+ }
36
+ /** */
37
+ GetControlValue(formControlName) {
38
+ return Tools.IsNotNull(this.formGroup().get(formControlName))
39
+ ? this.formGroup().get(formControlName).value
40
+ : null;
41
+ }
42
+ /** Get form value */
43
+ GetValue() {
44
+ return Tools.BreakReference(this.formGroup().value);
45
+ }
46
+ /** */
47
+ Reset(properties = null) {
48
+ if (Tools.IsNull(properties))
49
+ this.formGroup().reset();
50
+ else
51
+ this.formGroup().reset(properties);
52
+ }
53
+ /**
54
+ * Mark all controls as touched.
55
+ * If form is invalid emit a warning and focus first invalid control.
56
+ */
57
+ IsValid() {
58
+ this.TouchForm();
59
+ if (this.formGroup().invalid) {
60
+ this.alert.Warning('Please complete the required fields', 'Instructions', 'fa-solid fa-list-check');
61
+ this.Focus();
62
+ }
63
+ return {
64
+ isValid: this.formGroup().valid,
65
+ formValue: this.GetValue()
66
+ };
67
+ }
68
+ /** Focus the especified control or first invalid control */
69
+ Focus(formControl = null) {
70
+ const formControlCollection = new Map();
71
+ const formControlErrorCollection = new Map();
72
+ for (const property of Tools.GetObjectProperties(this.formGroup().controls)) {
73
+ formControlErrorCollection.set(property, this.formGroup().controls[property].errors);
74
+ const htmlElement = document.querySelector(`[formcontrolname='${property}'] input`);
75
+ if (Tools.IsNotNull(htmlElement))
76
+ formControlCollection.set(property, htmlElement);
77
+ }
78
+ if (formControlCollection.size > 0) {
79
+ if (Tools.IsNull(formControl)) {
80
+ for (const [property, error] of formControlErrorCollection) {
81
+ if (Tools.IsNotNull(error)) {
82
+ formControl = property;
83
+ break;
84
+ }
85
+ }
86
+ if (Tools.IsNull(formControl)) {
87
+ formControl = Array.from(formControlCollection.keys())[0];
88
+ }
89
+ }
90
+ const element = formControlCollection.get(formControl);
91
+ if (Tools.IsNotNull(element))
92
+ element.focus();
93
+ }
94
+ }
95
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
96
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: CoerForm, selector: "coer-form", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\" autocomplete=\"off\" class=\"coer-form\">\r\n <fieldset [disabled]=\"_isDisabled\">\r\n <ng-content></ng-content>\r\n </fieldset>\r\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, decorators: [{
99
+ type: Component,
100
+ args: [{ selector: 'coer-form', template: "<form [formGroup]=\"formGroup()\" autocomplete=\"off\" class=\"coer-form\">\r\n <fieldset [disabled]=\"_isDisabled\">\r\n <ng-content></ng-content>\r\n </fieldset>\r\n</form>" }]
101
+ }] });
102
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29lci1mb3JtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvZXItZWxlbWVudHMvc3JjL2NvbXBvbmVudHMvbGliL2NvZXItZm9ybS9jb2VyLWZvcm0uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvY29tcG9uZW50cy9saWIvY29lci1mb3JtL2NvZXItZm9ybS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFekQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLDJDQUEyQyxDQUFDO0FBQ3RFLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQzs7O0FBT2pELE1BQU0sT0FBTyxRQUFRO0lBTHJCO1FBT0ksV0FBVztRQUNILFVBQUssR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUM7UUFFM0IsY0FBUyxHQUFHLEtBQUssQ0FBQyxRQUFRLEVBQWEsQ0FBQztRQUN4QyxjQUFTLEdBQUcsS0FBSyxDQUFVLEtBQUssQ0FBQyxDQUFDO1FBQ2xDLGVBQVUsR0FBRyxLQUFLLENBQVUsS0FBSyxDQUFDLENBQUM7UUFjMUMsTUFBTTtRQUNDLHFCQUFnQixHQUFHLENBQUMsZUFBdUIsRUFBVyxFQUFFO1lBQzNELE9BQU8sS0FBSyxD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AgICBmb3JtQ29udHJvbCA9IHByb3BlcnR5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgaWYoVG9vbHMuSXNOdWxsKGZvcm1Db250cm9sKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGZvcm1Db250cm9sID0gQXJyYXkuZnJvbShmb3JtQ29udHJvbENvbGxlY3Rpb24ua2V5cygpKVswXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgY29uc3QgZWxlbWVudDogYW55ID0gZm9ybUNvbnRyb2xDb2xsZWN0aW9uLmdldChmb3JtQ29udHJvbCEpO1xyXG4gICAgICAgICAgICBpZihUb29scy5Jc05vdE51bGwoZWxlbWVudCkpIGVsZW1lbnQuZm9jdXMoKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iLCI8Zm9ybSBbZm9ybUdyb3VwXT1cImZvcm1Hcm91cCgpXCIgYXV0b2NvbXBsZXRlPVwib2ZmXCIgY2xhc3M9XCJjb2VyLWZvcm1cIj5cclxuICAgIDxmaWVsZHNldCBbZGlzYWJsZWRdPVwiX2lzRGlzYWJsZWRcIj5cclxuICAgICAgICA8bmctY29udGVudD48L25nLWNvbnRlbnQ+XHJcbiAgICA8L2ZpZWxkc2V0PlxyXG48L2Zvcm0+Il19