@angular/material 21.0.0-next.8 → 21.0.0-rc.0

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 (204) hide show
  1. package/core/tokens/_classes.scss +1 -1
  2. package/core/tokens/m2/_md-sys-color.scss +17 -17
  3. package/fesm2022/_animation-chunk.mjs +10 -16
  4. package/fesm2022/_animation-chunk.mjs.map +1 -1
  5. package/fesm2022/_date-formats-chunk.mjs +68 -164
  6. package/fesm2022/_date-formats-chunk.mjs.map +1 -1
  7. package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
  8. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
  9. package/fesm2022/_error-options-chunk.mjs +56 -19
  10. package/fesm2022/_error-options-chunk.mjs.map +1 -1
  11. package/fesm2022/_error-state-chunk.mjs +24 -31
  12. package/fesm2022/_error-state-chunk.mjs.map +1 -1
  13. package/fesm2022/_form-field-chunk.mjs +1224 -1017
  14. package/fesm2022/_form-field-chunk.mjs.map +1 -1
  15. package/fesm2022/_icon-button-chunk.mjs +243 -187
  16. package/fesm2022/_icon-button-chunk.mjs.map +1 -1
  17. package/fesm2022/_icon-registry-chunk.mjs +350 -575
  18. package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
  19. package/fesm2022/_input-harness-chunk.mjs +56 -107
  20. package/fesm2022/_input-harness-chunk.mjs.map +1 -1
  21. package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
  22. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
  23. package/fesm2022/_internal-form-field-chunk.mjs +59 -19
  24. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
  25. package/fesm2022/_line-chunk.mjs +83 -43
  26. package/fesm2022/_line-chunk.mjs.map +1 -1
  27. package/fesm2022/_option-chunk.mjs +348 -311
  28. package/fesm2022/_option-chunk.mjs.map +1 -1
  29. package/fesm2022/_option-harness-chunk.mjs +23 -39
  30. package/fesm2022/_option-harness-chunk.mjs.map +1 -1
  31. package/fesm2022/_option-module-chunk.mjs +36 -10
  32. package/fesm2022/_option-module-chunk.mjs.map +1 -1
  33. package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
  34. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
  35. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
  36. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
  37. package/fesm2022/_public-api-chunk.mjs +71 -134
  38. package/fesm2022/_public-api-chunk.mjs.map +1 -1
  39. package/fesm2022/_ripple-chunk.mjs +504 -600
  40. package/fesm2022/_ripple-chunk.mjs.map +1 -1
  41. package/fesm2022/_ripple-loader-chunk.mjs +120 -138
  42. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
  43. package/fesm2022/_ripple-module-chunk.mjs +36 -10
  44. package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
  45. package/fesm2022/_structural-styles-chunk.mjs +37 -10
  46. package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
  47. package/fesm2022/_tooltip-chunk.mjs +810 -888
  48. package/fesm2022/_tooltip-chunk.mjs.map +1 -1
  49. package/fesm2022/autocomplete-testing.mjs +62 -86
  50. package/fesm2022/autocomplete-testing.mjs.map +1 -1
  51. package/fesm2022/autocomplete.mjs +965 -1126
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge-testing.mjs +38 -54
  54. package/fesm2022/badge-testing.mjs.map +1 -1
  55. package/fesm2022/badge.mjs +321 -272
  56. package/fesm2022/badge.mjs.map +1 -1
  57. package/fesm2022/bottom-sheet-testing.mjs +10 -24
  58. package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
  59. package/fesm2022/bottom-sheet.mjs +349 -344
  60. package/fesm2022/bottom-sheet.mjs.map +1 -1
  61. package/fesm2022/button-testing.mjs +60 -94
  62. package/fesm2022/button-testing.mjs.map +1 -1
  63. package/fesm2022/button-toggle-testing.mjs +76 -125
  64. package/fesm2022/button-toggle-testing.mjs.map +1 -1
  65. package/fesm2022/button-toggle.mjs +752 -662
  66. package/fesm2022/button-toggle.mjs.map +1 -1
  67. package/fesm2022/button.mjs +263 -158
  68. package/fesm2022/button.mjs.map +1 -1
  69. package/fesm2022/card-testing.mjs +19 -33
  70. package/fesm2022/card-testing.mjs.map +1 -1
  71. package/fesm2022/card.mjs +576 -272
  72. package/fesm2022/card.mjs.map +1 -1
  73. package/fesm2022/checkbox-testing.mjs +71 -123
  74. package/fesm2022/checkbox-testing.mjs.map +1 -1
  75. package/fesm2022/checkbox.mjs +515 -477
  76. package/fesm2022/checkbox.mjs.map +1 -1
  77. package/fesm2022/chips-testing.mjs +201 -350
  78. package/fesm2022/chips-testing.mjs.map +1 -1
  79. package/fesm2022/chips.mjs +2552 -2289
  80. package/fesm2022/chips.mjs.map +1 -1
  81. package/fesm2022/core-testing.mjs +14 -28
  82. package/fesm2022/core-testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +357 -328
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/datepicker-testing.mjs +15 -25
  86. package/fesm2022/datepicker-testing.mjs.map +1 -1
  87. package/fesm2022/datepicker.mjs +4826 -4563
  88. package/fesm2022/datepicker.mjs.map +1 -1
  89. package/fesm2022/dialog-testing.mjs +93 -129
  90. package/fesm2022/dialog-testing.mjs.map +1 -1
  91. package/fesm2022/dialog.mjs +810 -829
  92. package/fesm2022/dialog.mjs.map +1 -1
  93. package/fesm2022/divider-testing.mjs +10 -11
  94. package/fesm2022/divider-testing.mjs.map +1 -1
  95. package/fesm2022/divider.mjs +119 -43
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/expansion-testing.mjs +74 -130
  98. package/fesm2022/expansion-testing.mjs.map +1 -1
  99. package/fesm2022/expansion.mjs +703 -515
  100. package/fesm2022/expansion.mjs.map +1 -1
  101. package/fesm2022/form-field-testing-control.mjs +16 -33
  102. package/fesm2022/form-field-testing-control.mjs.map +1 -1
  103. package/fesm2022/form-field-testing.mjs +118 -179
  104. package/fesm2022/form-field-testing.mjs.map +1 -1
  105. package/fesm2022/form-field.mjs +36 -10
  106. package/fesm2022/form-field.mjs.map +1 -1
  107. package/fesm2022/grid-list-testing.mjs +65 -113
  108. package/fesm2022/grid-list-testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs +559 -494
  110. package/fesm2022/grid-list.mjs.map +1 -1
  111. package/fesm2022/icon-testing.mjs +148 -127
  112. package/fesm2022/icon-testing.mjs.map +1 -1
  113. package/fesm2022/icon.mjs +325 -351
  114. package/fesm2022/icon.mjs.map +1 -1
  115. package/fesm2022/input-testing.mjs +59 -99
  116. package/fesm2022/input-testing.mjs.map +1 -1
  117. package/fesm2022/input.mjs +457 -520
  118. package/fesm2022/input.mjs.map +1 -1
  119. package/fesm2022/list-testing.mjs +251 -434
  120. package/fesm2022/list-testing.mjs.map +1 -1
  121. package/fesm2022/list.mjs +1522 -1204
  122. package/fesm2022/list.mjs.map +1 -1
  123. package/fesm2022/material.mjs +0 -5
  124. package/fesm2022/material.mjs.map +1 -1
  125. package/fesm2022/menu-testing.mjs +159 -228
  126. package/fesm2022/menu-testing.mjs.map +1 -1
  127. package/fesm2022/menu.mjs +1338 -1343
  128. package/fesm2022/menu.mjs.map +1 -1
  129. package/fesm2022/paginator-testing.mjs +55 -79
  130. package/fesm2022/paginator-testing.mjs.map +1 -1
  131. package/fesm2022/paginator.mjs +381 -309
  132. package/fesm2022/paginator.mjs.map +1 -1
  133. package/fesm2022/progress-bar-testing.mjs +12 -21
  134. package/fesm2022/progress-bar-testing.mjs.map +1 -1
  135. package/fesm2022/progress-bar.mjs +224 -169
  136. package/fesm2022/progress-bar.mjs.map +1 -1
  137. package/fesm2022/progress-spinner-testing.mjs +13 -23
  138. package/fesm2022/progress-spinner-testing.mjs.map +1 -1
  139. package/fesm2022/progress-spinner.mjs +235 -160
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio-testing.mjs +133 -208
  142. package/fesm2022/radio-testing.mjs.map +1 -1
  143. package/fesm2022/radio.mjs +712 -679
  144. package/fesm2022/radio.mjs.map +1 -1
  145. package/fesm2022/select-testing.mjs +83 -117
  146. package/fesm2022/select-testing.mjs.map +1 -1
  147. package/fesm2022/select.mjs +1116 -1246
  148. package/fesm2022/select.mjs.map +1 -1
  149. package/fesm2022/sidenav-testing.mjs +54 -120
  150. package/fesm2022/sidenav-testing.mjs.map +1 -1
  151. package/fesm2022/sidenav.mjs +1078 -995
  152. package/fesm2022/sidenav.mjs.map +1 -1
  153. package/fesm2022/slide-toggle-testing.mjs +57 -92
  154. package/fesm2022/slide-toggle-testing.mjs.map +1 -1
  155. package/fesm2022/slide-toggle.mjs +369 -279
  156. package/fesm2022/slide-toggle.mjs.map +1 -1
  157. package/fesm2022/slider-testing.mjs +90 -138
  158. package/fesm2022/slider-testing.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +1651 -1716
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar-testing.mjs +40 -87
  162. package/fesm2022/snack-bar-testing.mjs.map +1 -1
  163. package/fesm2022/snack-bar.mjs +763 -714
  164. package/fesm2022/snack-bar.mjs.map +1 -1
  165. package/fesm2022/sort-testing.mjs +45 -66
  166. package/fesm2022/sort-testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs +419 -344
  168. package/fesm2022/sort.mjs.map +1 -1
  169. package/fesm2022/stepper-testing.mjs +78 -154
  170. package/fesm2022/stepper-testing.mjs.map +1 -1
  171. package/fesm2022/stepper.mjs +790 -498
  172. package/fesm2022/stepper.mjs.map +1 -1
  173. package/fesm2022/table-testing.mjs +125 -186
  174. package/fesm2022/table-testing.mjs.map +1 -1
  175. package/fesm2022/table.mjs +1026 -684
  176. package/fesm2022/table.mjs.map +1 -1
  177. package/fesm2022/tabs-testing.mjs +125 -197
  178. package/fesm2022/tabs-testing.mjs.map +1 -1
  179. package/fesm2022/tabs.mjs +2351 -2028
  180. package/fesm2022/tabs.mjs.map +1 -1
  181. package/fesm2022/timepicker-testing.mjs +113 -172
  182. package/fesm2022/timepicker-testing.mjs.map +1 -1
  183. package/fesm2022/timepicker.mjs +1019 -826
  184. package/fesm2022/timepicker.mjs.map +1 -1
  185. package/fesm2022/toolbar-testing.mjs +16 -27
  186. package/fesm2022/toolbar-testing.mjs.map +1 -1
  187. package/fesm2022/toolbar.mjs +163 -78
  188. package/fesm2022/toolbar.mjs.map +1 -1
  189. package/fesm2022/tooltip-testing.mjs +41 -52
  190. package/fesm2022/tooltip-testing.mjs.map +1 -1
  191. package/fesm2022/tooltip.mjs +36 -10
  192. package/fesm2022/tooltip.mjs.map +1 -1
  193. package/fesm2022/tree-testing.mjs +86 -162
  194. package/fesm2022/tree-testing.mjs.map +1 -1
  195. package/fesm2022/tree.mjs +638 -466
  196. package/fesm2022/tree.mjs.map +1 -1
  197. package/package.json +2 -2
  198. package/schematics/ng-add/index.js +1 -1
  199. package/types/expansion.d.ts +4 -2
  200. package/types/menu-testing.d.ts +2 -0
  201. package/types/select.d.ts +1 -1
  202. package/types/sort.d.ts +1 -1
  203. package/types/table-testing.d.ts +27 -1
  204. package/types/timepicker.d.ts +148 -128
@@ -1 +1 @@
1
- {"version":3,"file":"form-field-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/testing/error-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/testing/form-field-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n BaseHarnessFilters,\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of error harness instances. */\nexport interface ErrorHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp;\n}\n\n/** Harness for interacting with a `mat-error` in tests. */\nexport class MatErrorHarness extends ComponentHarness {\n static hostSelector = '.mat-mdc-form-field-error';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for an error with specific\n * attributes.\n * @param options Options for filtering which error instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatErrorHarness>(\n this: ComponentHarnessConstructor<T>,\n options: ErrorHarnessFilters = {},\n ): HarnessPredicate<T> {\n return MatErrorHarness._getErrorPredicate(this, options);\n }\n\n protected static _getErrorPredicate<T extends MatErrorHarness>(\n type: ComponentHarnessConstructor<T>,\n options: ErrorHarnessFilters,\n ): HarnessPredicate<T> {\n return new HarnessPredicate(type, options).addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n\n /** Gets a promise for the error's label text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n HarnessQuery,\n parallel,\n} from '@angular/cdk/testing';\nimport {ErrorHarnessFilters, MatErrorHarness} from './error-harness';\nimport {MatInputHarness} from '../../input/testing';\nimport {MatFormFieldControlHarness} from './control';\nimport {MatSelectHarness} from '../../select/testing';\nimport {MatDatepickerInputHarness, MatDateRangeInputHarness} from '../../datepicker/testing';\nimport {FormFieldHarnessFilters} from './form-field-harness-filters';\n\n/** Possible harnesses of controls which can be bound to a form-field. */\nexport type FormFieldControlHarness =\n | MatInputHarness\n | MatSelectHarness\n | MatDatepickerInputHarness\n | MatDateRangeInputHarness;\n\nexport class MatFormFieldHarness extends ComponentHarness {\n private _prefixContainer = this.locatorForOptional('.mat-mdc-form-field-text-prefix');\n private _suffixContainer = this.locatorForOptional('.mat-mdc-form-field-text-suffix');\n private _label = this.locatorForOptional('.mdc-floating-label');\n private _hints = this.locatorForAll('.mat-mdc-form-field-hint');\n private _inputControl = this.locatorForOptional(MatInputHarness);\n private _selectControl = this.locatorForOptional(MatSelectHarness);\n private _datepickerInputControl = this.locatorForOptional(MatDatepickerInputHarness);\n private _dateRangeInputControl = this.locatorForOptional(MatDateRangeInputHarness);\n private _textField = this.locatorFor('.mat-mdc-text-field-wrapper');\n private _errorHarness = MatErrorHarness;\n\n static hostSelector = '.mat-mdc-form-field';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a form field with specific\n * attributes.\n * @param options Options for filtering which form field instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatFormFieldHarness>(\n this: ComponentHarnessConstructor<T>,\n options: FormFieldHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('floatingLabelText', options.floatingLabelText, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.getLabel(), text),\n )\n .addOption(\n 'hasErrors',\n options.hasErrors,\n async (harness, hasErrors) => (await harness.hasErrors()) === hasErrors,\n )\n .addOption(\n 'isValid',\n options.isValid,\n async (harness, isValid) => (await harness.isControlValid()) === isValid,\n );\n }\n\n /** Gets the appearance of the form-field. */\n async getAppearance(): Promise<'fill' | 'outline'> {\n const textFieldEl = await this._textField();\n if (await textFieldEl.hasClass('mdc-text-field--outlined')) {\n return 'outline';\n }\n return 'fill';\n }\n\n /** Whether the form-field has a label. */\n async hasLabel(): Promise<boolean> {\n return (await this._label()) !== null;\n }\n\n /** Whether the label is currently floating. */\n async isLabelFloating(): Promise<boolean> {\n const labelEl = await this._label();\n return labelEl !== null ? await labelEl.hasClass('mdc-floating-label--float-above') : false;\n }\n\n /** Gets the label of the form-field. */\n async getLabel(): Promise<string | null> {\n const labelEl = await this._label();\n return labelEl ? labelEl.text() : null;\n }\n\n /** Whether the form-field has errors. */\n async hasErrors(): Promise<boolean> {\n return (await this.getTextErrors()).length > 0;\n }\n\n /** Whether the form-field is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-disabled');\n }\n\n /** Whether the form-field is currently autofilled. */\n async isAutofilled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-autofilled');\n }\n\n /**\n * Gets the harness of the control that is bound to the form-field. Only\n * default controls such as \"MatInputHarness\" and \"MatSelectHarness\" are\n * supported.\n */\n async getControl(): Promise<FormFieldControlHarness | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness type.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: ComponentHarnessConstructor<X>,\n ): Promise<X | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness predicate.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: HarnessPredicate<X>,\n ): Promise<X | null>;\n\n // Implementation of the \"getControl\" method overload signatures.\n async getControl<X extends MatFormFieldControlHarness>(type?: HarnessQuery<X>) {\n if (type) {\n return this.locatorForOptional(type)();\n }\n const [select, input, datepickerInput, dateRangeInput] = await parallel(() => [\n this._selectControl(),\n this._inputControl(),\n this._datepickerInputControl(),\n this._dateRangeInputControl(),\n ]);\n\n // Match the datepicker inputs first since they can also have a `MatInput`.\n return datepickerInput || dateRangeInput || select || input;\n }\n\n /** Gets the theme color of the form-field. */\n async getThemeColor(): Promise<'primary' | 'accent' | 'warn'> {\n const hostEl = await this.host();\n const [isAccent, isWarn] = await parallel(() => {\n return [hostEl.hasClass('mat-accent'), hostEl.hasClass('mat-warn')];\n });\n if (isAccent) {\n return 'accent';\n } else if (isWarn) {\n return 'warn';\n }\n return 'primary';\n }\n\n /** Gets error messages which are currently displayed in the form-field. */\n async getTextErrors(): Promise<string[]> {\n const errors = await this.getErrors();\n return parallel(() => errors.map(e => e.getText()));\n }\n\n /** Gets all of the error harnesses in the form field. */\n async getErrors(filter: ErrorHarnessFilters = {}): Promise<MatErrorHarness[]> {\n return this.locatorForAll(this._errorHarness.with(filter))();\n }\n\n /** Gets hint messages which are currently displayed in the form-field. */\n async getTextHints(): Promise<string[]> {\n const hints = await this._hints();\n return parallel(() => hints.map(e => e.text()));\n }\n\n /** Gets the text inside the prefix element. */\n async getPrefixText(): Promise<string> {\n const prefix = await this._prefixContainer();\n return prefix ? prefix.text() : '';\n }\n\n /** Gets the text inside the suffix element. */\n async getSuffixText(): Promise<string> {\n const suffix = await this._suffixContainer();\n return suffix ? suffix.text() : '';\n }\n\n /**\n * Whether the form control has been touched. Returns \"null\"\n * if no form control is set up.\n */\n async isControlTouched(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-touched');\n }\n\n /**\n * Whether the form control is dirty. Returns \"null\"\n * if no form control is set up.\n */\n async isControlDirty(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-dirty');\n }\n\n /**\n * Whether the form control is valid. Returns \"null\"\n * if no form control is set up.\n */\n async isControlValid(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-valid');\n }\n\n /**\n * Whether the form control is pending validation. Returns \"null\"\n * if no form control is set up.\n */\n async isControlPending(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-pending');\n }\n\n /** Checks whether the form-field control has set up a form control. */\n private async _hasFormControl(): Promise<boolean> {\n const hostEl = await this.host();\n // If no form \"NgControl\" is bound to the form-field control, the form-field\n // is not able to forward any control status classes. Therefore if either the\n // \"ng-touched\" or \"ng-untouched\" class is set, we know that it has a form control\n const [isTouched, isUntouched] = await parallel(() => [\n hostEl.hasClass('ng-touched'),\n hostEl.hasClass('ng-untouched'),\n ]);\n return isTouched || isUntouched;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAqBA;AACM,MAAO,eAAgB,SAAQ,gBAAgB,CAAA;AACnD,IAAA,OAAO,YAAY,GAAG,2BAA2B;AAEjD;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAET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AU,CAAC;;AAGjD;;;AAGG;AACH,IAAA,MAAM,cAAc,GAAA;QAClB,IAAI,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE;AACnC,YAAA,OAAO,IAAI;;AAEb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC;;AAGjD;;;AAGG;AACH,IAAA,MAAM,gBAAgB,GAAA;QACpB,IAAI,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE;AACnC,YAAA,OAAO,IAAI;;AAEb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC;;;AAI3C,IAAA,MAAM,eAAe,GAAA;AAC3B,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE;;;;QAIhC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,MAAM,QAAQ,CAAC,MAAM;AACpD,YAAA,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;AAC7B,YAAA,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;AAChC,SAAA,CAAC;QACF,OAAO,SAAS,IAAI,WAAW;;;;;;"}
1
+ {"version":3,"file":"form-field-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/testing/form-field-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n HarnessQuery,\n parallel,\n} from '@angular/cdk/testing';\nimport {ErrorHarnessFilters, MatErrorHarness} from './error-harness';\nimport {MatInputHarness} from '../../input/testing';\nimport {MatFormFieldControlHarness} from './control';\nimport {MatSelectHarness} from '../../select/testing';\nimport {MatDatepickerInputHarness, MatDateRangeInputHarness} from '../../datepicker/testing';\nimport {FormFieldHarnessFilters} from './form-field-harness-filters';\n\n/** Possible harnesses of controls which can be bound to a form-field. */\nexport type FormFieldControlHarness =\n | MatInputHarness\n | MatSelectHarness\n | MatDatepickerInputHarness\n | MatDateRangeInputHarness;\n\nexport class MatFormFieldHarness extends ComponentHarness {\n private _prefixContainer = this.locatorForOptional('.mat-mdc-form-field-text-prefix');\n private _suffixContainer = this.locatorForOptional('.mat-mdc-form-field-text-suffix');\n private _label = this.locatorForOptional('.mdc-floating-label');\n private _hints = this.locatorForAll('.mat-mdc-form-field-hint');\n private _inputControl = this.locatorForOptional(MatInputHarness);\n private _selectControl = this.locatorForOptional(MatSelectHarness);\n private _datepickerInputControl = this.locatorForOptional(MatDatepickerInputHarness);\n private _dateRangeInputControl = this.locatorForOptional(MatDateRangeInputHarness);\n private _textField = this.locatorFor('.mat-mdc-text-field-wrapper');\n private _errorHarness = MatErrorHarness;\n\n static hostSelector = '.mat-mdc-form-field';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a form field with specific\n * attributes.\n * @param options Options for filtering which form field instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatFormFieldHarness>(\n this: ComponentHarnessConstructor<T>,\n options: FormFieldHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('floatingLabelText', options.floatingLabelText, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.getLabel(), text),\n )\n .addOption(\n 'hasErrors',\n options.hasErrors,\n async (harness, hasErrors) => (await harness.hasErrors()) === hasErrors,\n )\n .addOption(\n 'isValid',\n options.isValid,\n async (harness, isValid) => (await harness.isControlValid()) === isValid,\n );\n }\n\n /** Gets the appearance of the form-field. */\n async getAppearance(): Promise<'fill' | 'outline'> {\n const textFieldEl = await this._textField();\n if (await textFieldEl.hasClass('mdc-text-field--outlined')) {\n return 'outline';\n }\n return 'fill';\n }\n\n /** Whether the form-field has a label. */\n async hasLabel(): Promise<boolean> {\n return (await this._label()) !== null;\n }\n\n /** Whether the label is currently floating. */\n async isLabelFloating(): Promise<boolean> {\n const labelEl = await this._label();\n return labelEl !== null ? await labelEl.hasClass('mdc-floating-label--float-above') : false;\n }\n\n /** Gets the label of the form-field. */\n async getLabel(): Promise<string | null> {\n const labelEl = await this._label();\n return labelEl ? labelEl.text() : null;\n }\n\n /** Whether the form-field has errors. */\n async hasErrors(): Promise<boolean> {\n return (await this.getTextErrors()).length > 0;\n }\n\n /** Whether the form-field is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-disabled');\n }\n\n /** Whether the form-field is currently autofilled. */\n async isAutofilled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-autofilled');\n }\n\n /**\n * Gets the harness of the control that is bound to the form-field. Only\n * default controls such as \"MatInputHarness\" and \"MatSelectHarness\" are\n * supported.\n */\n async getControl(): Promise<FormFieldControlHarness | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness type.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: ComponentHarnessConstructor<X>,\n ): Promise<X | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness predicate.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: HarnessPredicate<X>,\n ): Promise<X | null>;\n\n // Implementation of the \"getControl\" method overload signatures.\n async getControl<X extends MatFormFieldControlHarness>(type?: HarnessQuery<X>) {\n if (type) {\n return this.locatorForOptional(type)();\n }\n const [select, input, datepickerInput, dateRangeInput] = await parallel(() => [\n this._selectControl(),\n this._inputControl(),\n this._datepickerInputControl(),\n this._dateRangeInputControl(),\n ]);\n\n // Match the datepicker inputs first since they can also have a `MatInput`.\n return datepickerInput || dateRangeInput || select || input;\n }\n\n /** Gets the theme color of the form-field. */\n async getThemeColor(): Promise<'primary' | 'accent' | 'warn'> {\n const hostEl = await this.host();\n const [isAccent, isWarn] = await parallel(() => {\n return [hostEl.hasClass('mat-accent'), hostEl.hasClass('mat-warn')];\n });\n if (isAccent) {\n return 'accent';\n } else if (isWarn) {\n return 'warn';\n }\n return 'primary';\n }\n\n /** Gets error messages which are currently displayed in the form-field. */\n async getTextErrors(): Promise<string[]> {\n const errors = await this.getErrors();\n return parallel(() => errors.map(e => e.getText()));\n }\n\n /** Gets all of the error harnesses in the form field. */\n async getErrors(filter: ErrorHarnessFilters = {}): Promise<MatErrorHarness[]> {\n return this.locatorForAll(this._errorHarness.with(filter))();\n }\n\n /** Gets hint messages which are currently displayed in the form-field. */\n async getTextHints(): Promise<string[]> {\n const hints = await this._hints();\n return parallel(() => hints.map(e => e.text()));\n }\n\n /** Gets the text inside the prefix element. */\n async getPrefixText(): Promise<string> {\n const prefix = await this._prefixContainer();\n return prefix ? prefix.text() : '';\n }\n\n /** Gets the text inside the suffix element. */\n async getSuffixText(): Promise<string> {\n const suffix = await this._suffixContainer();\n return suffix ? suffix.text() : '';\n }\n\n /**\n * Whether the form control has been touched. Returns \"null\"\n * if no form control is set up.\n */\n async isControlTouched(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-touched');\n }\n\n /**\n * Whether the form control is dirty. Returns \"null\"\n * if no form control is set up.\n */\n async isControlDirty(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-dirty');\n }\n\n /**\n * Whether the form control is valid. Returns \"null\"\n * if no form control is set up.\n */\n async isControlValid(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-valid');\n }\n\n /**\n * Whether the form control is pending validation. Returns \"null\"\n * if no form control is set up.\n */\n async isControlPending(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-pending');\n }\n\n /** Checks whether the form-field control has set up a form control. */\n private async _hasFormControl(): Promise<boolean> {\n const hostEl = await this.host();\n // If no form \"NgControl\" is bound to the form-field control, the form-field\n // is not able to forward any control status classes. Therefore if either the\n // \"ng-touched\" or \"ng-untouched\" class is set, we know that it has a form control\n const [isTouched, isUntouched] = await parallel(() => [\n hostEl.hasClass('ng-touched'),\n hostEl.hasClass('ng-untouched'),\n ]);\n return isTouched || isUntouched;\n }\n}\n"],"names":["_prefixContainer","locatorForOptional","_suffixContainer","_hints","locatorForAll","MatDatepickerInputHarness","_dateRangeInputControl","MatDateRangeInputHarness","_textField","locatorFor","_errorHarness","hostSelector","with","options","HarnessPredicate","getAppearance","textFieldEl","hasClass","_label","isLabelFloating","labelEl","getLabel","hasErrors","getTextErrors","length","isDisabled","host","isAutofilled","getControl","type","select","datepickerInput","dateRangeInput","parallel","_selectControl","_inputControl","_datepickerInputControl","input","getThemeColor","isAccent","isWarn","hostEl","errors","getErrors","map","e","getText","filter","getTextHints"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BUA,EAAAA,gBAAA,QAAAC,kBAAA,CAAA,iCAAA,CAAA;EAEAC,gBACA,GAAA,IAEA,CAAAD,kBAEA,CACA,iCAAA,CAAA;kCAC+B,CAAA,qBAAA,CAAA;EAEvCE,MAAA,GAAA,IAAA,CAAAC,aAAsB,CAAA,0BAAqB,CAAA;;;yBA4BE,GAAA,IAAA,CAAAH,kBAAA,CAAAI,yBAAA,CAAA;AACvCC,EAAAA,sBAAa,GAAA,IAAA,CAAAL,kBAAA,CAAAM,wBAAA,CAAA;EACjBC,UAAA,GAAA,IAAoB,CAAAC,UAAM,CAAiB,6BAAA,CAAA;AACvCC,EAAAA;AACF,EAAA,OAAAC,eAAgB,qBAAA;SAU2BC,IAAAA,CAAAC,OAAA,GAAA,EAAA,EAAA;IAE7C,OAAAC,IAAAA,gBAAA,CAAAD,IAAAA,EAAAA,OAAA;;EAOA,MAAAE,aAGFA,GAAyC;qBAEhC,GAAA,MAAA,IAAY,CAAAP,UAAiB,EAAA;cACtCQ,WAAA,CAAAC,QAAA,CAAA,0BAAA,CAAA,EAAA;aA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,EAAA;aACT,MAAA;;IAEF,OAAA,SAAA;;QAIEjB,aAAA,GAAA;UAAAmB,SAAe,MAAA,IAAA,CAAAC,SAAA,EAAA;mBAC6D,CAAA,MAAAD,MAAA,CAAAE,GAAA,CAAAC,CAAA,IAAAA,CAAA,CAAAC,OAAA,EAAA,CAAA,CAAA;;;AAK1E,IAAA,OAAA,IAAA,CAAA1C,aAAA,CAAAM,IAAAA,CAAAA,aAAA,CAAAE,IAAA,CAAAmC,MAAA,CAAA,CAAA,EAAA;AACD;AAEHC,EAAAA,MAAAA,YAAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -15,17 +15,43 @@ import './_animation-chunk.mjs';
15
15
  import '@angular/cdk/layout';
16
16
 
17
17
  class MatFormFieldModule {
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
19
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatFormFieldModule, imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix], exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule] });
20
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatFormFieldModule, imports: [ObserversModule, MatFormField, BidiModule] });
18
+ static ɵfac = i0.ɵɵngDeclareFactory({
19
+ minVersion: "12.0.0",
20
+ version: "20.2.0-next.2",
21
+ ngImport: i0,
22
+ type: MatFormFieldModule,
23
+ deps: [],
24
+ target: i0.ɵɵFactoryTarget.NgModule
25
+ });
26
+ static ɵmod = i0.ɵɵngDeclareNgModule({
27
+ minVersion: "14.0.0",
28
+ version: "20.2.0-next.2",
29
+ ngImport: i0,
30
+ type: MatFormFieldModule,
31
+ imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
32
+ exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule]
33
+ });
34
+ static ɵinj = i0.ɵɵngDeclareInjector({
35
+ minVersion: "12.0.0",
36
+ version: "20.2.0-next.2",
37
+ ngImport: i0,
38
+ type: MatFormFieldModule,
39
+ imports: [ObserversModule, MatFormField, BidiModule]
40
+ });
21
41
  }
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatFormFieldModule, decorators: [{
23
- type: NgModule,
24
- args: [{
25
- imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
26
- exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule],
27
- }]
28
- }] });
42
+ i0.ɵɵngDeclareClassMetadata({
43
+ minVersion: "12.0.0",
44
+ version: "20.2.0-next.2",
45
+ ngImport: i0,
46
+ type: MatFormFieldModule,
47
+ decorators: [{
48
+ type: NgModule,
49
+ args: [{
50
+ imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
51
+ exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule]
52
+ }]
53
+ }]
54
+ });
29
55
 
30
56
  export { MatError, MatFormField, MatFormFieldModule, MatHint, MatLabel, MatPrefix, MatSuffix };
31
57
  //# sourceMappingURL=form-field.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-field.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/form-field-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {MatError} from './directives/error';\nimport {MatHint} from './directives/hint';\nimport {MatLabel} from './directives/label';\nimport {MatPrefix} from './directives/prefix';\nimport {MatSuffix} from './directives/suffix';\nimport {MatFormField} from './form-field';\n\n@NgModule({\n imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],\n exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule],\n})\nexport class MatFormFieldModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAsBa,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;+GAAlB,kBAAkB,EAAA,OAAA,EAAA,CAHnB,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAA,EAAA,OAAA,EAAA,CAChF,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAA,EAAA,CAAA;AAE1E,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAHnB,OAAA,EAAA,CAAA,eAAe,EAAE,YAAY,EACoC,UAAU,CAAA,EAAA,CAAA;;kGAE1E,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;AAC3F,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC;AACvF,iBAAA;;;;;"}
1
+ {"version":3,"file":"form-field.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/form-field-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {MatError} from './directives/error';\nimport {MatHint} from './directives/hint';\nimport {MatLabel} from './directives/label';\nimport {MatPrefix} from './directives/prefix';\nimport {MatSuffix} from './directives/suffix';\nimport {MatFormField} from './form-field';\n\n@NgModule({\n imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],\n exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule],\n})\nexport class MatFormFieldModule {}\n"],"names":["ɵmod","i0","ɵɵngDeclareNgModule","minVersion","version","ngImport","type","MatFormFieldModule","imports","ObserversModule","MatFormField","MatLabel","MatError","MatHint","MatPrefix","MatSuffix","exports","BidiModule","decorators"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBa,EAAA,OAAAA,IAAA,GAAAC,EAAA,CAAAC,mBAAA,CAAA;IAAAC,UAAA,EAAA,QAAA;IAAAC,OAAA,EAAA,eAAA;AAAAC,IAAAA,QAAA,EAAAJ,EAAA;AAAAK,IAAAA,IAAA,EAAAC,kBAAA;AAAAC,IAAAA,OAAA,EAAAC,CAAAA,eAAA,EAAAC,YAAA,EAAAC,QAAA,EAAAC,QAAA,EAAAC,OAAA,EAAAC,SAAA,EAAAC,SAAA,CAAA;AAAAC,IAAAA,OAAA,EAAAN,CAAAA,YAAA,EAAAC,QAAA,EAAAE,OAAA,EAAAD,QAAA,EAAAE,SAAA,EAAAC,SAAA,EAAAE,UAAA;AAAA,GAAA,CAAA;;;;;;;;;2BAJJ,CAAA;AAAAd,EAAAA,UAAA,EAAA,QAAA;EAAAC,OAAA,EAAA,eAAA;AAAAC,EAAAA,QAAA,EAAAJ,EAAA;AAAAK,EAAAA,IAAA,EAAAC,kBAAA;EAAAW,UAAA,EAAA,CAAA;;;;;;;;;;;"}
@@ -1,127 +1,79 @@
1
1
  import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness, parallel } from '@angular/cdk/testing';
2
2
  import { ɵTileCoordinator as _TileCoordinator } from './_public-api-chunk.mjs';
3
3
 
4
- /** Selectors for the various `mat-grid-tile` sections that may contain user content. */
5
4
  var MatGridTileSection;
6
5
  (function (MatGridTileSection) {
7
- MatGridTileSection["HEADER"] = ".mat-grid-tile-header";
8
- MatGridTileSection["FOOTER"] = ".mat-grid-tile-footer";
6
+ MatGridTileSection["HEADER"] = ".mat-grid-tile-header";
7
+ MatGridTileSection["FOOTER"] = ".mat-grid-tile-footer";
9
8
  })(MatGridTileSection || (MatGridTileSection = {}));
10
- /** Harness for interacting with a standard `MatGridTitle` in tests. */
11
9
  class MatGridTileHarness extends ContentContainerComponentHarness {
12
- /** The selector for the host element of a `MatGridTile` instance. */
13
- static hostSelector = '.mat-grid-tile';
14
- /**
15
- * Gets a `HarnessPredicate` that can be used to search for a `MatGridTileHarness`
16
- * that meets certain criteria.
17
- * @param options Options for filtering which dialog instances are considered a match.
18
- * @return a `HarnessPredicate` configured with the given options.
19
- */
20
- static with(options = {}) {
21
- return new HarnessPredicate(MatGridTileHarness, options)
22
- .addOption('headerText', options.headerText, (harness, pattern) => HarnessPredicate.stringMatches(harness.getHeaderText(), pattern))
23
- .addOption('footerText', options.footerText, (harness, pattern) => HarnessPredicate.stringMatches(harness.getFooterText(), pattern));
24
- }
25
- _header = this.locatorForOptional(MatGridTileSection.HEADER);
26
- _footer = this.locatorForOptional(MatGridTileSection.FOOTER);
27
- _avatar = this.locatorForOptional('.mat-grid-avatar');
28
- /** Gets the amount of rows that the grid-tile takes up. */
29
- async getRowspan() {
30
- return Number(await (await this.host()).getAttribute('rowspan'));
31
- }
32
- /** Gets the amount of columns that the grid-tile takes up. */
33
- async getColspan() {
34
- return Number(await (await this.host()).getAttribute('colspan'));
35
- }
36
- /** Whether the grid-tile has a header. */
37
- async hasHeader() {
38
- return (await this._header()) !== null;
39
- }
40
- /** Whether the grid-tile has a footer. */
41
- async hasFooter() {
42
- return (await this._footer()) !== null;
43
- }
44
- /** Whether the grid-tile has an avatar. */
45
- async hasAvatar() {
46
- return (await this._avatar()) !== null;
47
- }
48
- /** Gets the text of the header if present. */
49
- async getHeaderText() {
50
- // For performance reasons, we do not use "hasHeader" as
51
- // we would then need to query twice for the header.
52
- const headerEl = await this._header();
53
- return headerEl ? headerEl.text() : null;
54
- }
55
- /** Gets the text of the footer if present. */
56
- async getFooterText() {
57
- // For performance reasons, we do not use "hasFooter" as
58
- // we would then need to query twice for the footer.
59
- const headerEl = await this._footer();
60
- return headerEl ? headerEl.text() : null;
61
- }
10
+ static hostSelector = '.mat-grid-tile';
11
+ static with(options = {}) {
12
+ return new HarnessPredicate(MatGridTileHarness, options).addOption('headerText', options.headerText, (harness, pattern) => HarnessPredicate.stringMatches(harness.getHeaderText(), pattern)).addOption('footerText', options.footerText, (harness, pattern) => HarnessPredicate.stringMatches(harness.getFooterText(), pattern));
13
+ }
14
+ _header = this.locatorForOptional(MatGridTileSection.HEADER);
15
+ _footer = this.locatorForOptional(MatGridTileSection.FOOTER);
16
+ _avatar = this.locatorForOptional('.mat-grid-avatar');
17
+ async getRowspan() {
18
+ return Number(await (await this.host()).getAttribute('rowspan'));
19
+ }
20
+ async getColspan() {
21
+ return Number(await (await this.host()).getAttribute('colspan'));
22
+ }
23
+ async hasHeader() {
24
+ return (await this._header()) !== null;
25
+ }
26
+ async hasFooter() {
27
+ return (await this._footer()) !== null;
28
+ }
29
+ async hasAvatar() {
30
+ return (await this._avatar()) !== null;
31
+ }
32
+ async getHeaderText() {
33
+ const headerEl = await this._header();
34
+ return headerEl ? headerEl.text() : null;
35
+ }
36
+ async getFooterText() {
37
+ const headerEl = await this._footer();
38
+ return headerEl ? headerEl.text() : null;
39
+ }
62
40
  }
63
41
 
64
- /** Harness for interacting with a standard `MatGridList` in tests. */
65
42
  class MatGridListHarness extends ComponentHarness {
66
- /** The selector for the host element of a `MatGridList` instance. */
67
- static hostSelector = '.mat-grid-list';
68
- /**
69
- * Gets a `HarnessPredicate` that can be used to search for a `MatGridListHarness`
70
- * that meets certain criteria.
71
- * @param options Options for filtering which dialog instances are considered a match.
72
- * @return a `HarnessPredicate` configured with the given options.
73
- */
74
- static with(options = {}) {
75
- return new HarnessPredicate(MatGridListHarness, options);
76
- }
77
- /**
78
- * Tile coordinator that is used by the "MatGridList" for computing
79
- * positions of tiles. We leverage the coordinator to provide an API
80
- * for retrieving tiles based on visual tile positions.
81
- */
82
- _tileCoordinator = new _TileCoordinator();
83
- /** Gets all tiles of the grid-list. */
84
- async getTiles(filters = {}) {
85
- return await this.locatorForAll(MatGridTileHarness.with(filters))();
86
- }
87
- /** Gets the amount of columns of the grid-list. */
88
- async getColumns() {
89
- return Number(await (await this.host()).getAttribute('cols'));
90
- }
91
- /**
92
- * Gets a tile of the grid-list that is located at the given location.
93
- * @param row Zero-based row index.
94
- * @param column Zero-based column index.
95
- */
96
- async getTileAtPosition({ row, column, }) {
97
- const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);
98
- const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));
99
- const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({
100
- colspan,
101
- rowspan,
102
- }));
103
- // Update the tile coordinator to reflect the current column amount and
104
- // rendered tiles. We update upon every call of this method since we do not
105
- // know if tiles have been added, removed or updated (in terms of rowspan/colspan).
106
- this._tileCoordinator.update(columns, tiles);
107
- // The tile coordinator respects the colspan and rowspan for calculating the positions
108
- // of tiles, but it does not create multiple position entries if a tile spans over multiple
109
- // columns or rows. We want to provide an API where developers can retrieve a tile based on
110
- // any position that lies within the visual tile boundaries. For example: If a tile spans
111
- // over two columns, then the same tile should be returned for either column indices.
112
- for (let i = 0; i < this._tileCoordinator.positions.length; i++) {
113
- const position = this._tileCoordinator.positions[i];
114
- const { rowspan, colspan } = tiles[i];
115
- // Return the tile harness if the given position visually resolves to the tile.
116
- if (column >= position.col &&
117
- column <= position.col + colspan - 1 &&
118
- row >= position.row &&
119
- row <= position.row + rowspan - 1) {
120
- return tileHarnesses[i];
121
- }
122
- }
123
- throw Error('Could not find tile at given position.');
43
+ static hostSelector = '.mat-grid-list';
44
+ static with(options = {}) {
45
+ return new HarnessPredicate(MatGridListHarness, options);
46
+ }
47
+ _tileCoordinator = new _TileCoordinator();
48
+ async getTiles(filters = {}) {
49
+ return await this.locatorForAll(MatGridTileHarness.with(filters))();
50
+ }
51
+ async getColumns() {
52
+ return Number(await (await this.host()).getAttribute('cols'));
53
+ }
54
+ async getTileAtPosition({
55
+ row,
56
+ column
57
+ }) {
58
+ const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);
59
+ const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));
60
+ const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({
61
+ colspan,
62
+ rowspan
63
+ }));
64
+ this._tileCoordinator.update(columns, tiles);
65
+ for (let i = 0; i < this._tileCoordinator.positions.length; i++) {
66
+ const position = this._tileCoordinator.positions[i];
67
+ const {
68
+ rowspan,
69
+ colspan
70
+ } = tiles[i];
71
+ if (column >= position.col && column <= position.col + colspan - 1 && row >= position.row && row <= position.row + rowspan - 1) {
72
+ return tileHarnesses[i];
73
+ }
124
74
  }
75
+ throw Error('Could not find tile at given position.');
76
+ }
125
77
  }
126
78
 
127
79
  export { MatGridListHarness, MatGridTileHarness, MatGridTileSection };
@@ -1 +1 @@
1
- {"version":3,"file":"grid-list-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-tile-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-list-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {GridTileHarnessFilters} from './grid-list-harness-filters';\n\n/** Selectors for the various `mat-grid-tile` sections that may contain user content. */\nexport enum MatGridTileSection {\n HEADER = '.mat-grid-tile-header',\n FOOTER = '.mat-grid-tile-footer',\n}\n\n/** Harness for interacting with a standard `MatGridTitle` in tests. */\nexport class MatGridTileHarness extends ContentContainerComponentHarness<MatGridTileSection> {\n /** The selector for the host element of a `MatGridTile` instance. */\n static hostSelector = '.mat-grid-tile';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridTileHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridTileHarnessFilters = {}): HarnessPredicate<MatGridTileHarness> {\n return new HarnessPredicate(MatGridTileHarness, options)\n .addOption('headerText', options.headerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getHeaderText(), pattern),\n )\n .addOption('footerText', options.footerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getFooterText(), pattern),\n );\n }\n\n private _header = this.locatorForOptional(MatGridTileSection.HEADER);\n private _footer = this.locatorForOptional(MatGridTileSection.FOOTER);\n private _avatar = this.locatorForOptional('.mat-grid-avatar');\n\n /** Gets the amount of rows that the grid-tile takes up. */\n async getRowspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('rowspan'));\n }\n\n /** Gets the amount of columns that the grid-tile takes up. */\n async getColspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('colspan'));\n }\n\n /** Whether the grid-tile has a header. */\n async hasHeader(): Promise<boolean> {\n return (await this._header()) !== null;\n }\n\n /** Whether the grid-tile has a footer. */\n async hasFooter(): Promise<boolean> {\n return (await this._footer()) !== null;\n }\n\n /** Whether the grid-tile has an avatar. */\n async hasAvatar(): Promise<boolean> {\n return (await this._avatar()) !== null;\n }\n\n /** Gets the text of the header if present. */\n async getHeaderText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasHeader\" as\n // we would then need to query twice for the header.\n const headerEl = await this._header();\n return headerEl ? headerEl.text() : null;\n }\n\n /** Gets the text of the footer if present. */\n async getFooterText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasFooter\" as\n // we would then need to query twice for the footer.\n const headerEl = await this._footer();\n return headerEl ? headerEl.text() : null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {ɵTileCoordinator as TileCoordinator} from '../../grid-list';\nimport {GridListHarnessFilters, GridTileHarnessFilters} from './grid-list-harness-filters';\nimport {MatGridTileHarness} from './grid-tile-harness';\n\n/** Harness for interacting with a standard `MatGridList` in tests. */\nexport class MatGridListHarness extends ComponentHarness {\n /** The selector for the host element of a `MatGridList` instance. */\n static hostSelector = '.mat-grid-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridListHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridListHarnessFilters = {}): HarnessPredicate<MatGridListHarness> {\n return new HarnessPredicate(MatGridListHarness, options);\n }\n\n /**\n * Tile coordinator that is used by the \"MatGridList\" for computing\n * positions of tiles. We leverage the coordinator to provide an API\n * for retrieving tiles based on visual tile positions.\n */\n private _tileCoordinator = new TileCoordinator();\n\n /** Gets all tiles of the grid-list. */\n async getTiles(filters: GridTileHarnessFilters = {}): Promise<MatGridTileHarness[]> {\n return await this.locatorForAll(MatGridTileHarness.with(filters))();\n }\n\n /** Gets the amount of columns of the grid-list. */\n async getColumns(): Promise<number> {\n return Number(await (await this.host()).getAttribute('cols'));\n }\n\n /**\n * Gets a tile of the grid-list that is located at the given location.\n * @param row Zero-based row index.\n * @param column Zero-based column index.\n */\n async getTileAtPosition({\n row,\n column,\n }: {\n row: number;\n column: number;\n }): Promise<MatGridTileHarness> {\n const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);\n const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));\n const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({\n colspan,\n rowspan,\n }));\n // Update the tile coordinator to reflect the current column amount and\n // rendered tiles. We update upon every call of this method since we do not\n // know if tiles have been added, removed or updated (in terms of rowspan/colspan).\n this._tileCoordinator.update(columns, tiles);\n // The tile coordinator respects the colspan and rowspan for calculating the positions\n // of tiles, but it does not create multiple position entries if a tile spans over multiple\n // columns or rows. We want to provide an API where developers can retrieve a tile based on\n // any position that lies within the visual tile boundaries. For example: If a tile spans\n // over two columns, then the same tile should be returned for either column indices.\n for (let i = 0; i < this._tileCoordinator.positions.length; i++) {\n const position = this._tileCoordinator.positions[i];\n const {rowspan, colspan} = tiles[i];\n // Return the tile harness if the given position visually resolves to the tile.\n if (\n column >= position.col &&\n column <= position.col + colspan - 1 &&\n row >= position.row &&\n row <= position.row + rowspan - 1\n ) {\n return tileHarnesses[i];\n }\n }\n throw Error('Could not find tile at given position.');\n }\n}\n"],"names":["TileCoordinator"],"mappings":";;;AAWA;IACY;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,uBAAgC;AAChC,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,uBAAgC;AAClC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA;AAED;AACM,MAAO,kBAAmB,SAAQ,gCAAoD,CAAA;;AAE1F,I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AC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAC1F,MAAM,KAAK,GAAG,CAAC,MAAM,QAAQ,CAAC,MAAM,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM;YAC3E,OAAO;YACP,OAAO;AACR,SAAA,CAAC,CAAC;;;;QAIH,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;;;;;AAM5C,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;YACnD,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC,CAAC,CAAC;;AAEnC,YAAA,IACE,MAAM,IAAI,QAAQ,CAAC,GAAG;AACtB,gBAAA,MAAM,IAAI,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,CAAC;gBACpC,GAAG,IAAI,QAAQ,CAAC,GAAG;gBACnB,GAAG,IAAI,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,CAAC,EACjC;AACA,gBAAA,OAAO,aAAa,CAAC,CAAC,CAAC;;;AAG3B,QAAA,MAAM,KAAK,CAAC,wCAAwC,CAAC;;;;;;"}
1
+ {"version":3,"file":"grid-list-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-tile-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-list-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {GridTileHarnessFilters} from './grid-list-harness-filters';\n\n/** Selectors for the various `mat-grid-tile` sections that may contain user content. */\nexport enum MatGridTileSection {\n HEADER = '.mat-grid-tile-header',\n FOOTER = '.mat-grid-tile-footer',\n}\n\n/** Harness for interacting with a standard `MatGridTitle` in tests. */\nexport class MatGridTileHarness extends ContentContainerComponentHarness<MatGridTileSection> {\n /** The selector for the host element of a `MatGridTile` instance. */\n static hostSelector = '.mat-grid-tile';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridTileHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridTileHarnessFilters = {}): HarnessPredicate<MatGridTileHarness> {\n return new HarnessPredicate(MatGridTileHarness, options)\n .addOption('headerText', options.headerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getHeaderText(), pattern),\n )\n .addOption('footerText', options.footerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getFooterText(), pattern),\n );\n }\n\n private _header = this.locatorForOptional(MatGridTileSection.HEADER);\n private _footer = this.locatorForOptional(MatGridTileSection.FOOTER);\n private _avatar = this.locatorForOptional('.mat-grid-avatar');\n\n /** Gets the amount of rows that the grid-tile takes up. */\n async getRowspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('rowspan'));\n }\n\n /** Gets the amount of columns that the grid-tile takes up. */\n async getColspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('colspan'));\n }\n\n /** Whether the grid-tile has a header. */\n async hasHeader(): Promise<boolean> {\n return (await this._header()) !== null;\n }\n\n /** Whether the grid-tile has a footer. */\n async hasFooter(): Promise<boolean> {\n return (await this._footer()) !== null;\n }\n\n /** Whether the grid-tile has an avatar. */\n async hasAvatar(): Promise<boolean> {\n return (await this._avatar()) !== null;\n }\n\n /** Gets the text of the header if present. */\n async getHeaderText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasHeader\" as\n // we would then need to query twice for the header.\n const headerEl = await this._header();\n return headerEl ? headerEl.text() : null;\n }\n\n /** Gets the text of the footer if present. */\n async getFooterText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasFooter\" as\n // we would then need to query twice for the footer.\n const headerEl = await this._footer();\n return headerEl ? headerEl.text() : null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {ɵTileCoordinator as TileCoordinator} from '../../grid-list';\nimport {GridListHarnessFilters, GridTileHarnessFilters} from './grid-list-harness-filters';\nimport {MatGridTileHarness} from './grid-tile-harness';\n\n/** Harness for interacting with a standard `MatGridList` in tests. */\nexport class MatGridListHarness extends ComponentHarness {\n /** The selector for the host element of a `MatGridList` instance. */\n static hostSelector = '.mat-grid-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridListHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridListHarnessFilters = {}): HarnessPredicate<MatGridListHarness> {\n return new HarnessPredicate(MatGridListHarness, options);\n }\n\n /**\n * Tile coordinator that is used by the \"MatGridList\" for computing\n * positions of tiles. We leverage the coordinator to provide an API\n * for retrieving tiles based on visual tile positions.\n */\n private _tileCoordinator = new TileCoordinator();\n\n /** Gets all tiles of the grid-list. */\n async getTiles(filters: GridTileHarnessFilters = {}): Promise<MatGridTileHarness[]> {\n return await this.locatorForAll(MatGridTileHarness.with(filters))();\n }\n\n /** Gets the amount of columns of the grid-list. */\n async getColumns(): Promise<number> {\n return Number(await (await this.host()).getAttribute('cols'));\n }\n\n /**\n * Gets a tile of the grid-list that is located at the given location.\n * @param row Zero-based row index.\n * @param column Zero-based column index.\n */\n async getTileAtPosition({\n row,\n column,\n }: {\n row: number;\n column: number;\n }): Promise<MatGridTileHarness> {\n const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);\n const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));\n const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({\n colspan,\n rowspan,\n }));\n // Update the tile coordinator to reflect the current column amount and\n // rendered tiles. We update upon every call of this method since we do not\n // know if tiles have been added, removed or updated (in terms of rowspan/colspan).\n this._tileCoordinator.update(columns, tiles);\n // The tile coordinator respects the colspan and rowspan for calculating the positions\n // of tiles, but it does not create multiple position entries if a tile spans over multiple\n // columns or rows. We want to provide an API where developers can retrieve a tile based on\n // any position that lies within the visual tile boundaries. For example: If a tile spans\n // over two columns, then the same tile should be returned for either column indices.\n for (let i = 0; i < this._tileCoordinator.positions.length; i++) {\n const position = this._tileCoordinator.positions[i];\n const {rowspan, colspan} = tiles[i];\n // Return the tile harness if the given position visually resolves to the tile.\n if (\n column >= position.col &&\n column <= position.col + colspan - 1 &&\n row >= position.row &&\n row <= position.row + rowspan - 1\n ) {\n return tileHarnesses[i];\n }\n }\n throw Error('Could not find tile at given position.');\n }\n}\n"],"names":["MatGridTileSection","MatGridTileHarness","ContentContainerComponentHarness","locatorForOptional","FOOTER","getRowspan","Number","host","getAttribute","getColspan","hasHeader","hasFooter","_footer","hasAvatar","hostSelector","with","options","TileCoordinator","getTiles","filters","getTileAtPosition","row","column","_tileCoordinator","update","columns","tiles"],"mappings":";;;;;;;AAYYA,CAAAA,EAAAA,kBAAA,KAAAA,kBAAA,GAAA,EAAA,CAAA,CAAA;AAUVC,MAAAA,kBAAA,SAAAC,gCAAA,CAAA;;qBAWc,GAAa,EAAA,EAAA;;;;AAWzB,EAAA,OAAA,GAAA,IAAA,CAAAC,kBAAA,CAAAH,kBAAA,CAAAI,MAAA,CAAA;SACF,GAAA,IAAA,CAAAD,kBAAA,CAAA,kBAAA,CAAA;AAGAE,EAAAA,MAAAA,UAAAA,GAAgB;WAI0BC,MAAA,CAAA,MAAA,CAAA,MAAA,IAAA,CAAAC,IAAA,EAAAC,EAAAA,YAAA,CAAA,SAAA,CAAA,CAAA;;AAOjC,EAAA,MAAAC,UAAWA,GAAA;AACpB,IAAA,OAAAH,MAAA,CAAA,MAAA,CAAA,MAAA,IAAA,CAAAC,IAAA,IAAAC,YAAA,CAAA,SAAA,CAAA,CAAA;AAGA;AAEAE,EAAAA,MAAAA,SAAAA,GAAA;;;AAMEC,EAAAA,MAAAA,SAAAA;AACA,IAAA,OAAA,CAAA,MAAA,IAAA,CAAAC,OAAA,EAAA,MAAA,IAAA;;iBAKwDC,GAAA;;AAGxD;;;;;;;;;;;;AChEF,EAAA,OAAAC,YAAA,GAAA,gBAAA;EAYA,OAAAC,IAAAA,CAAAC,OAAA,GAAA,EAAA,EAAA;;;AAUA,EAAA,gBAAA,GAAA,IAAAC,gBAAA,EAAA;AAIE,EAAA,MAAAC,SAAAC,OAAA,GAAA,EAAA,EAAA;;;;;AAQF;yBAayEC,CAAA;IAAAC,GAAA;AAAAC,IAAAA;AAAA,GAAA,EAAA;;;;;;;AAmBnE,IAAA,IAAA,CAAAC,gBAAoB,CAAAC,MAAA,CAAAC,OAAG,EAAAC,KAAA,CAAA;;;;;;;;;;;;;;;;;"}