@hmcts/opal-frontend-common 0.0.12 → 0.0.13
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.
|
@@ -26,9 +26,9 @@ class MojSortableTableHeaderSortIconDirective {
|
|
|
26
26
|
const icons = MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS;
|
|
27
27
|
switch (dir) {
|
|
28
28
|
case 'ascending':
|
|
29
|
-
return [icons.descending];
|
|
30
|
-
case 'descending':
|
|
31
29
|
return [icons.ascending];
|
|
30
|
+
case 'descending':
|
|
31
|
+
return [icons.descending];
|
|
32
32
|
default:
|
|
33
33
|
return icons.none;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs","sources":["../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/directive/constants/moj-sortable-table-header-sort-icons.constant.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/directive/moj-sortable-table-header-sort-icon.directive.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row-data/moj-sortable-table-row-data.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row-data/moj-sortable-table-row-data.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-status/moj-sortable-table-status.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-status/moj-sortable-table-status.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/hmcts-opal-frontend-common-components-moj-moj-sortable-table.ts"],"sourcesContent":["// Extracted from @ministryofjustice/frontend v5.1.2 sortable-table.mjs\nexport const MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS = {\n ascending: 'M6.5625 15.5L11 6.63125L15.4375 15.5H6.5625Z',\n descending: 'M15.4375 7L11 15.8687L6.5625 7L15.4375 7Z',\n none: ['M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z', 'M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z'],\n};\n","import { Directive, OnChanges, Input, ElementRef, Renderer2 } from '@angular/core';\nimport { MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS } from './constants/moj-sortable-table-header-sort-icons.constant';\n\n@Directive({\n selector: '[opalLibMojSortableTableHeaderSortIcon]',\n standalone: true,\n})\nexport class MojSortableTableHeaderSortIconDirective implements OnChanges {\n @Input('opalLibMojSortableTableHeaderSortIcon') sortDirection: 'ascending' | 'descending' | 'none' = 'none';\n\n constructor(\n private readonly el: ElementRef<SVGSVGElement>,\n private readonly renderer: Renderer2,\n ) {}\n\n /**\n * Returns the SVG path(s) for the sort icon based on the specified direction.\n *\n * @param dir - The sort direction, which can be 'ascending', 'descending', or 'none'.\n * @returns An array of SVG path strings corresponding to the given sort direction.\n */\n private getPathsForDirection(dir: 'ascending' | 'descending' | 'none'): string[] {\n const icons = MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS;\n switch (dir) {\n case 'ascending':\n return [icons.descending];\n case 'descending':\n return [icons.ascending];\n default:\n return icons.none;\n }\n }\n\n public ngOnChanges(): void {\n const svg = this.el.nativeElement;\n this.renderer.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');\n this.renderer.setAttribute(svg, 'fill', 'none');\n\n // Clear existing <path> children\n while (svg.firstChild) {\n svg.removeChild(svg.firstChild);\n }\n\n // Append new <path> elements based on sortDirection\n const paths = this.getPathsForDirection(this.sortDirection);\n paths.forEach((pathD) => {\n const path = this.renderer.createElement('path', 'svg');\n this.renderer.setAttribute(path, 'd', pathD);\n this.renderer.setAttribute(path, 'fill', 'currentColor');\n\n svg.appendChild(path);\n });\n }\n}\n","import { Component, HostBinding, ChangeDetectionStrategy, Output, EventEmitter, Input } from '@angular/core';\nimport { MojSortableTableHeaderSortIconDirective } from './directive/moj-sortable-table-header-sort-icon.directive';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-header, [opal-lib-moj-sortable-table-header]',\n templateUrl: './moj-sortable-table-header.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MojSortableTableHeaderSortIconDirective],\n})\nexport class MojSortableTableHeaderComponent {\n @Input() columnKey!: string;\n @Input() sortDirection: 'ascending' | 'descending' | 'none' = 'none';\n @Input() dataIndex: number = 0;\n\n @Output() sortChange = new EventEmitter<{ key: string; sortType: 'ascending' | 'descending' }>();\n\n @HostBinding('attr.aria-sort') get ariaSort(): string | null {\n return this.sortDirection;\n }\n\n @HostBinding('scope') hostScope = 'col';\n\n @HostBinding('class') get hostClass(): string {\n return 'govuk-table__header';\n }\n\n /**\n * Toggles the sort direction between 'ascending' and 'descending' for the table column.\n * Emits a sortChange event with the column key and the new sort direction.\n *\n * @public\n * @returns {void}\n */\n public toggleSort(): void {\n const newDirection = this.sortDirection === 'ascending' ? 'descending' : 'ascending';\n\n this.sortChange.emit({\n key: this.columnKey,\n sortType: newDirection,\n });\n }\n}\n","<button type=\"button\" (click)=\"toggleSort()\" [attr.data-index]=\"dataIndex\">\n <ng-content></ng-content>\n <svg\n [opalLibMojSortableTableHeaderSortIcon]=\"sortDirection\"\n width=\"22\"\n height=\"22\"\n focusable=\"false\"\n aria-hidden=\"true\"\n role=\"img\"\n vviewBox=\"0 0 22 22\"\n ></svg>\n</button>\n","import { Component, ChangeDetectionStrategy, HostBinding, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-row-data,[opal-lib-moj-sortable-table-row-data]',\n imports: [],\n templateUrl: './moj-sortable-table-row-data.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojSortableTableRowDataComponent {\n @Input({ required: true }) id!: string;\n\n @HostBinding('class') hostClass = 'govuk-table__cell';\n @HostBinding('id') get hostId() {\n return this.id;\n }\n}\n","<ng-content></ng-content>\n","import { Component, Input, ChangeDetectionStrategy, HostBinding } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-row,[opal-lib-moj-sortable-table-row]',\n imports: [],\n templateUrl: './moj-sortable-table-row.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojSortableTableRowComponent {\n @Input({ required: false }) public bodyRowClasses: string = '';\n @HostBinding('class') get hostClass() {\n return `govuk-table__row ${this.bodyRowClasses}`;\n }\n}\n","<ng-content></ng-content>\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-status',\n standalone: true,\n templateUrl: './moj-sortable-table-status.component.html',\n})\nexport class MojSortableTableStatusComponent {\n @Input({ required: false }) public columnTitle!: string;\n @Input({ required: false }) public sortDirection!: 'ascending' | 'descending' | 'none';\n}\n","<output aria-live=\"polite\" aria-atomic=\"true\" class=\"govuk-visually-hidden\">\n Sorted by {{ columnTitle }} ({{ sortDirection }})\n</output>\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table',\n\n templateUrl: './moj-sortable-table.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojSortableTableComponent {\n @Input({ required: false }) public tableClasses!: string;\n}\n","<table class=\"govuk-table {{ tableClasses }}\" data-module=\"moj-sortable-table\">\n <caption class=\"govuk-table__caption\">\n <ng-content select=\"[caption]\"></ng-content>\n </caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <ng-content select=\"[head]\"></ng-content>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <ng-content select=\"[row]\"></ng-content>\n <ng-content select=\"[results]\"></ng-content>\n </tbody>\n</table>\n<ng-content select=\"[status]\"></ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,oCAAoC,GAAG;AAClD,IAAA,SAAS,EAAE,8CAA8C;AACzD,IAAA,UAAU,EAAE,2CAA2C;AACvD,IAAA,IAAI,EAAE,CAAC,iDAAiD,EAAE,0DAA0D,CAAC;CACtH;;MCEY,uCAAuC,CAAA;AAI/B,IAAA,EAAA;AACA,IAAA,QAAA;IAJ6B,aAAa,GAAwC,MAAM;IAE3G,WACmB,CAAA,EAA6B,EAC7B,QAAmB,EAAA;QADnB,IAAE,CAAA,EAAA,GAAF,EAAE;QACF,IAAQ,CAAA,QAAA,GAAR,QAAQ;;AAG3B;;;;;AAKG;AACK,IAAA,oBAAoB,CAAC,GAAwC,EAAA;QACnE,MAAM,KAAK,GAAG,oCAAoC;QAClD,QAAQ,GAAG;AACT,YAAA,KAAK,WAAW;AACd,gBAAA,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;AAC3B,YAAA,KAAK,YAAY;AACf,gBAAA,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;AAC1B,YAAA;gBACE,OAAO,KAAK,CAAC,IAAI;;;IAIhB,WAAW,GAAA;AAChB,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa;QACjC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,4BAA4B,CAAC;QACtE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC;;AAG/C,QAAA,OAAO,GAAG,CAAC,UAAU,EAAE;AACrB,YAAA,GAAG,CA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AA,EAAA;8BAImB,WAAW,EAAA,CAAA;sBAA7C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACS,aAAa,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;MEDf,yBAAyB,CAAA;AACD,IAAA,YAAY;wGADpC,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,yBAAyB,iICRtC,2iBAeA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDPa,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBANrC,SAAS;+BACE,6BAA6B,EAAA,eAAA,EAGtB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2iBAAA,EAAA;8BAGZ,YAAY,EAAA,CAAA;sBAA9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AET5B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs","sources":["../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/directive/constants/moj-sortable-table-header-sort-icons.constant.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/directive/moj-sortable-table-header-sort-icon.directive.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row-data/moj-sortable-table-row-data.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row-data/moj-sortable-table-row-data.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-status/moj-sortable-table-status.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table-status/moj-sortable-table-status.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table.component.ts","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/moj-sortable-table.component.html","../../../projects/opal-frontend-common/components/moj/moj-sortable-table/hmcts-opal-frontend-common-components-moj-moj-sortable-table.ts"],"sourcesContent":["// Extracted from @ministryofjustice/frontend v5.1.2 sortable-table.mjs\nexport const MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS = {\n ascending: 'M6.5625 15.5L11 6.63125L15.4375 15.5H6.5625Z',\n descending: 'M15.4375 7L11 15.8687L6.5625 7L15.4375 7Z',\n none: ['M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z', 'M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z'],\n};\n","import { Directive, OnChanges, Input, ElementRef, Renderer2 } from '@angular/core';\nimport { MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS } from './constants/moj-sortable-table-header-sort-icons.constant';\n\n@Directive({\n selector: '[opalLibMojSortableTableHeaderSortIcon]',\n standalone: true,\n})\nexport class MojSortableTableHeaderSortIconDirective implements OnChanges {\n @Input('opalLibMojSortableTableHeaderSortIcon') sortDirection: 'ascending' | 'descending' | 'none' = 'none';\n\n constructor(\n private readonly el: ElementRef<SVGSVGElement>,\n private readonly renderer: Renderer2,\n ) {}\n\n /**\n * Returns the SVG path(s) for the sort icon based on the specified direction.\n *\n * @param dir - The sort direction, which can be 'ascending', 'descending', or 'none'.\n * @returns An array of SVG path strings corresponding to the given sort direction.\n */\n private getPathsForDirection(dir: 'ascending' | 'descending' | 'none'): string[] {\n const icons = MOJ_SORTABLE_TABLE_HEADER_SORT_ICONS;\n switch (dir) {\n case 'ascending':\n return [icons.ascending];\n case 'descending':\n return [icons.descending];\n default:\n return icons.none;\n }\n }\n\n public ngOnChanges(): void {\n const svg = this.el.nativeElement;\n this.renderer.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');\n this.renderer.setAttribute(svg, 'fill', 'none');\n\n // Clear existing <path> children\n while (svg.firstChild) {\n svg.removeChild(svg.firstChild);\n }\n\n // Append new <path> elements based on sortDirection\n const paths = this.getPathsForDirection(this.sortDirection);\n paths.forEach((pathD) => {\n const path = this.renderer.createElement('path', 'svg');\n this.renderer.setAttribute(path, 'd', pathD);\n this.renderer.setAttribute(path, 'fill', 'currentColor');\n\n svg.appendChild(path);\n });\n }\n}\n","import { Component, HostBinding, ChangeDetectionStrategy, Output, EventEmitter, Input } from '@angular/core';\nimport { MojSortableTableHeaderSortIconDirective } from './directive/moj-sortable-table-header-sort-icon.directive';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-header, [opal-lib-moj-sortable-table-header]',\n templateUrl: './moj-sortable-table-header.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MojSortableTableHeaderSortIconDirective],\n})\nexport class MojSortableTableHeaderComponent {\n @Input() columnKey!: string;\n @Input() sortDirection: 'ascending' | 'descending' | 'none' = 'none';\n @Input() dataIndex: number = 0;\n\n @Output() sortChange = new EventEmitter<{ key: string; sortType: 'ascending' | 'descending' }>();\n\n @HostBinding('attr.aria-sort') get ariaSort(): string | null {\n return this.sortDirection;\n }\n\n @HostBinding('scope') hostScope = 'col';\n\n @HostBinding('class') get hostClass(): string {\n return 'govuk-table__header';\n }\n\n /**\n * Toggles the sort direction between 'ascending' and 'descending' for the table column.\n * Emits a sortChange event with the column key and the new sort direction.\n *\n * @public\n * @returns {void}\n */\n public toggleSort(): void {\n const newDirection = this.sortDirection === 'ascending' ? 'descending' : 'ascending';\n\n this.sortChange.emit({\n key: this.columnKey,\n sortType: newDirection,\n });\n }\n}\n","<button type=\"button\" (click)=\"toggleSort()\" [attr.data-index]=\"dataIndex\">\n <ng-content></ng-content>\n <svg\n [opalLibMojSortableTableHeaderSortIcon]=\"sortDirection\"\n width=\"22\"\n height=\"22\"\n focusable=\"false\"\n aria-hidden=\"true\"\n role=\"img\"\n vviewBox=\"0 0 22 22\"\n ></svg>\n</button>\n","import { Component, ChangeDetectionStrategy, HostBinding, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-row-data,[opal-lib-moj-sortable-table-row-data]',\n imports: [],\n templateUrl: './moj-sortable-table-row-data.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojSortableTableRowDataComponent {\n @Input({ required: true }) id!: string;\n\n @HostBinding('class') hostClass = 'govuk-table__cell';\n @HostBinding('id') get hostId() {\n return this.id;\n }\n}\n","<ng-content></ng-content>\n","import { Component, Input, ChangeDetectionStrategy, HostBinding } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-row,[opal-lib-moj-sortable-table-row]',\n imports: [],\n templateUrl: './moj-sortable-table-row.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojSortableTableRowComponent {\n @Input({ required: false }) public bodyRowClasses: string = '';\n @HostBinding('class') get hostClass() {\n return `govuk-table__row ${this.bodyRowClasses}`;\n }\n}\n","<ng-content></ng-content>\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table-status',\n standalone: true,\n templateUrl: './moj-sortable-table-status.component.html',\n})\nexport class MojSortableTableStatusComponent {\n @Input({ required: false }) public columnTitle!: string;\n @Input({ required: false }) public sortDirection!: 'ascending' | 'descending' | 'none';\n}\n","<output aria-live=\"polite\" aria-atomic=\"true\" class=\"govuk-visually-hidden\">\n Sorted by {{ columnTitle }} ({{ sortDirection }})\n</output>\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-sortable-table',\n\n templateUrl: './moj-sortable-table.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojSortableTableComponent {\n @Input({ required: false }) public tableClasses!: string;\n}\n","<table class=\"govuk-table {{ tableClasses }}\" data-module=\"moj-sortable-table\">\n <caption class=\"govuk-table__caption\">\n <ng-content select=\"[caption]\"></ng-content>\n </caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <ng-content select=\"[head]\"></ng-content>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <ng-content select=\"[row]\"></ng-content>\n <ng-content select=\"[results]\"></ng-content>\n </tbody>\n</table>\n<ng-content select=\"[status]\"></ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,oCAAoC,GAAG;AAClD,IAAA,SAAS,EAAE,8CAA8C;AACzD,IAAA,UAAU,EAAE,2CAA2C;AACvD,IAAA,IAAI,EAAE,CAAC,iDAAiD,EAAE,0DAA0D,CAAC;CACtH;;MCEY,uCAAuC,CAAA;AAI/B,IAAA,EAAA;AACA,IAAA,QAAA;IAJ6B,aAAa,GAAwC,MAAM;IAE3G,WACmB,CAAA,EAA6B,EAC7B,QAAmB,EAAA;QADnB,IAAE,CAAA,EAAA,GAAF,EAAE;QACF,IAAQ,CAAA,QAAA,GAAR,QAAQ;;AAG3B;;;;;AAKG;AACK,IAAA,oBAAoB,CAAC,GAAwC,EAAA;QACnE,MAAM,KAAK,GAAG,oCAAoC;QAClD,QAAQ,GAAG;AACT,YAAA,KAAK,WAAW;AACd,gBAAA,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;AAC1B,YAAA,KAAK,YAAY;AACf,gBAAA,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;AAC3B,YAAA;gBACE,OAAO,KAAK,CAAC,IAAI;;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