Ignore:
Timestamp:
10/16/21 18:10:51 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
eed0bf8
Parents:
6a3a178
Message:

adding new components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/@angular/material/fesm2015/badge.js.map

    r6a3a178 rfa375fe  
    1 {"version":3,"file":"badge.js","sources":["../../../../../../src/material/badge/badge.ts","../../../../../../src/material/badge/badge-module.ts","../../../../../../src/material/badge/public-api.ts","../../../../../../src/material/badge/index.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.io/license\n */\n\nimport {AriaDescriber} from '@angular/cdk/a11y';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n  Directive,\n  ElementRef,\n  Inject,\n  Input,\n  NgZone,\n  OnDestroy,\n  OnInit,\n  Optional,\n  Renderer2,\n} from '@angular/core';\nimport {CanDisable, mixinDisabled, ThemePalette} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\nlet nextId = 0;\n\n// Boilerplate for applying mixins to MatBadge.\n/** @docs-private */\nconst _MatBadgeBase = mixinDisabled(class {});\n\n/** Allowed position options for matBadgePosition */\nexport type MatBadgePosition =\n    'above after' | 'above before' | 'below before' | 'below after' |\n    'before' | 'after' | 'above' | 'below';\n\n/** Allowed size options for matBadgeSize */\nexport type MatBadgeSize = 'small' | 'medium' | 'large';\n\nconst BADGE_CONTENT_CLASS = 'mat-badge-content';\n\n/** Directive to display a text badge. */\n@Directive({\n  selector: '[matBadge]',\n  inputs: ['disabled: matBadgeDisabled'],\n  host: {\n    'class': 'mat-badge',\n    '[class.mat-badge-overlap]': 'overlap',\n    '[class.mat-badge-above]': 'isAbove()',\n    '[class.mat-badge-below]': '!isAbove()',\n    '[class.mat-badge-before]': '!isAfter()',\n    '[class.mat-badge-after]': 'isAfter()',\n    '[class.mat-badge-small]': 'size === \"small\"',\n    '[class.mat-badge-medium]': 'size === \"medium\"',\n    '[class.mat-badge-large]': 'size === \"large\"',\n    '[class.mat-badge-hidden]': 'hidden || !content',\n    '[class.mat-badge-disabled]': 'disabled',\n  },\n})\nexport class MatBadge extends _MatBadgeBase implements OnInit, OnDestroy, CanDisable {\n  /** The color of the badge. Can be `primary`, `accent`, or `warn`. */\n  @Input('matBadgeColor')\n  get color(): ThemePalette { return this._color; }\n  set color(value: ThemePalette) {\n    this._setColor(value);\n    this._color = value;\n  }\n  private _color: ThemePalette = 'primary';\n\n  /** Whether the badge should overlap its contents or not */\n  @Input('matBadgeOverlap')\n  get overlap(): boolean { return this._overlap; }\n  set overlap(val: boolean) {\n    this._overlap = coerceBooleanProperty(val);\n  }\n  private _overlap: boolean = true;\n\n  /**\n   * Position the badge should reside.\n   * Accepts any combination of 'above'|'below' and 'before'|'after'\n   */\n  @Input('matBadgePosition') position: MatBadgePosition = 'above after';\n\n  /** The content for the badge */\n  @Input('matBadge')\n  get content(): string | number | undefined | null {\n    return this._content;\n  }\n  set content(newContent: string | number | undefined | null) {\n    this._updateRenderedContent(newContent);\n  }\n  private _content: string | number | undefined | null;\n\n  /** Message used to describe the decorated element via aria-describedby */\n  @Input('matBadgeDescription')\n  get description(): string { return this._description; }\n  set description(newDescription: string) {\n    this._updateHostAriaDescription(newDescription);\n  }\n  private _description: string;\n\n  /** Size of the badge. Can be 'small', 'medium', or 'large'. */\n  @Input('matBadgeSize') size: MatBadgeSize = 'medium';\n\n  /** Whether the badge is hidden. */\n  @Input('matBadgeHidden')\n  get hidden(): boolean { return this._hidden; }\n  set hidden(val: boolean) {\n    this._hidden = coerceBooleanProperty(val);\n  }\n  private _hidden: boolean;\n\n  /** Unique id for the badge */\n  _id: number = nextId++;\n\n  /** Visible badge element. */\n  private _badgeElement: HTMLElement | undefined;\n\n  /** Whether the OnInit lifecycle hook has run yet */\n  private _isInitialized = false;\n\n  constructor(\n      private _ngZone: NgZone,\n      private _elementRef: ElementRef<HTMLElement>,\n      private _ariaDescriber: AriaDescriber,\n      private _renderer: Renderer2,\n      @Optional() @Inject(ANIMATION_MODULE_TYPE) private _animationMode?: string) {\n      super();\n\n      if (typeof ngDevMode === 'undefined' || ngDevMode) {\n        const nativeElement = _elementRef.nativeElement;\n        if (nativeElement.nodeType !== nativeElement.ELEMENT_NODE) {\n          throw Error('matBadge must be attached to an element node.');\n        }\n      }\n    }\n\n  /** Whether the badge is above the host or not */\n  isAbove(): boolean {\n    return this.position.indexOf('below') === -1;\n  }\n\n  /** Whether the badge is after the host or not */\n  isAfter(): boolean {\n    return this.position.indexOf('before') === -1;\n  }\n\n  /**\n   * Gets the element into which the badge's content is being rendered. Undefined if the element\n   * hasn't been created (e.g. if the badge doesn't have content).\n   */\n  getBadgeElement(): HTMLElement | undefined {\n    return this._badgeElement;\n  }\n\n  ngOnInit() {\n    // We may have server-side rendered badge that we need to clear.\n    // We need to do this in ngOnInit because the full content of the component\n    // on which the badge is attached won't necessarily be in the DOM until this point.\n    this._clearExistingBadges();\n\n    if (this.content && !this._badgeElement) {\n      this._badgeElement = this._createBadgeElement();\n      this._updateRenderedContent(this.content);\n    }\n\n    this._isInitialized = true;\n  }\n\n  ngOnDestroy() {\n    // ViewEngine only: when creating a badge through the Renderer, Angular remembers its index.\n    // We have to destroy it ourselves, otherwise it'll be retained in memory.\n    if (this._renderer.destroyNode) {\n      this._renderer.destroyNode(this._badgeElement);\n    }\n\n    this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this.description);\n  }\n\n  /** Creates the badge element */\n  private _createBadgeElement(): HTMLElement {\n    const badgeElement = this._renderer.createElement('span');\n    const activeClass = 'mat-badge-active';\n\n    badgeElement.setAttribute('id', `mat-badge-content-${this._id}`);\n\n    // The badge is aria-hidden because we don't want it to appear in the page's navigation\n    // flow. Instead, we use the badge to describe the decorated element with aria-describedby.\n    badgeElement.setAttribute('aria-hidden', 'true');\n    badgeElement.classList.add(BADGE_CONTENT_CLASS);\n\n    if (this._animationMode === 'NoopAnimations') {\n      badgeElement.classList.add('_mat-animation-noopable');\n    }\n\n    this._elementRef.nativeElement.appendChild(badgeElement);\n\n    // animate in after insertion\n    if (typeof requestAnimationFrame === 'function' && this._animationMode !== 'NoopAnimations') {\n      this._ngZone.runOutsideAngular(() => {\n        requestAnimationFrame(() => {\n          badgeElement.classList.add(activeClass);\n        });\n      });\n    } else {\n      badgeElement.classList.add(activeClass);\n    }\n\n    return badgeElement;\n  }\n\n  /** Update the text content of the badge element in the DOM, creating the element if necessary. */\n  private _updateRenderedContent(newContent: string | number | undefined | null): void {\n    const newContentNormalized: string = `${newContent ?? ''}`.trim();\n\n    // Don't create the badge element if the directive isn't initialized because we want to\n    // append the badge element to the *end* of the host element's content for backwards\n    // compatibility.\n    if (this._isInitialized && newContentNormalized && !this._badgeElement) {\n      this._badgeElement = this._createBadgeElement();\n    }\n\n    if (this._badgeElement) {\n      this._badgeElement.textContent = newContentNormalized;\n    }\n\n    this._content = newContentNormalized;\n  }\n\n  /** Updates the host element's aria description via AriaDescriber. */\n  private _updateHostAriaDescription(newDescription: string): void {\n    this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this.description);\n    if (newDescription) {\n      this._ariaDescriber.describe(this._elementRef.nativeElement, newDescription);\n    }\n    this._description = newDescription;\n  }\n\n  /** Adds css theme class given the color to the component host */\n  private _setColor(colorPalette: ThemePalette) {\n    const classList = this._elementRef.nativeElement.classList;\n    classList.remove(`mat-badge-${this._color}`);\n    if (colorPalette) {\n      classList.add(`mat-badge-${colorPalette}`);\n    }\n  }\n\n  /** Clears any existing badges that might be left over from server-side rendering. */\n  private _clearExistingBadges() {\n    // Only check direct children of this host element in order to avoid deleting\n    // any badges that might exist in descendant elements.\n    const badges =\n        this._elementRef.nativeElement.querySelectorAll(`:scope > .${BADGE_CONTENT_CLASS}`);\n    for (const badgeElement of Array.from(badges)) {\n      if (badgeElement !== this._badgeElement) {\n        badgeElement.remove();\n      }\n    }\n  }\n\n  static ngAcceptInputType_disabled: BooleanInput;\n  static ngAcceptInputType_hidden: BooleanInput;\n  static ngAcceptInputType_overlap: BooleanInput;\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.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {MatBadge} from './badge';\n\n\n@NgModule({\n  imports: [\n    A11yModule,\n    MatCommonModule\n  ],\n  exports: [MatBadge, MatCommonModule],\n  declarations: [MatBadge],\n})\nexport class MatBadgeModule {}\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.io/license\n */\n\nexport * from './badge-module';\nexport * from './badge';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAyBA,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;AACA;AACA,MAAM,aAAa,GAAG,aAAa,CAAC;CAAQ,CAAC,CAAC;AAU9C,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEhD;MAkBa,QAAS,SAAQ,aAAa;IA8DzC,YACY,OAAe,EACf,WAAoC,EACpC,cAA6B,EAC7B,SAAoB,EACuB,cAAuB;QAC1E,KAAK,EAAE,CAAC;QALA,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAyB;QACpC,mBAAc,GAAd,cAAc,CAAe;QAC7B,cAAS,GAAT,SAAS,CAAW;QACuB,mBAAc,GAAd,cAAc,CAAS;QA3DtE,WAAM,GAAiB,SAAS,CAAC;QAQjC,aAAQ,GAAY,IAAI,CAAC;;;;;QAMN,aAAQ,GAAqB,aAAa,CAAC;;QAqB/C,SAAI,GAAiB,QAAQ,CAAC;;QAWrD,QAAG,GAAW,MAAM,EAAE,CAAC;;QAMf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V,eAAe;iBAChB;gBACD,OAAO,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;gBACpC,YAAY,EAAE,CAAC,QAAQ,CAAC;aACzB;;;ACrBD;;;;;;;;ACAA;;;;;;"}
     1{"version":3,"file":"badge.js","sources":["../../../../../../src/material/badge/badge.ts","../../../../../../src/material/badge/badge-module.ts","../../../../../../src/material/badge/public-api.ts","../../../../../../src/material/badge/index.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.io/license\n */\n\nimport {AriaDescriber} from '@angular/cdk/a11y';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n  Directive,\n  ElementRef,\n  Inject,\n  Input,\n  NgZone,\n  OnChanges,\n  OnDestroy,\n  Optional,\n  Renderer2,\n  SimpleChanges,\n} from '@angular/core';\nimport {CanDisable, mixinDisabled, ThemePalette} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\nlet nextId = 0;\n\n// Boilerplate for applying mixins to MatBadge.\n/** @docs-private */\nconst _MatBadgeBase = mixinDisabled(class {});\n\n/** Allowed position options for matBadgePosition */\nexport type MatBadgePosition =\n    'above after' | 'above before' | 'below before' | 'below after' |\n    'before' | 'after' | 'above' | 'below';\n\n/** Allowed size options for matBadgeSize */\nexport type MatBadgeSize = 'small' | 'medium' | 'large';\n\n/** Directive to display a text badge. */\n@Directive({\n  selector: '[matBadge]',\n  inputs: ['disabled: matBadgeDisabled'],\n  host: {\n    'class': 'mat-badge',\n    '[class.mat-badge-overlap]': 'overlap',\n    '[class.mat-badge-above]': 'isAbove()',\n    '[class.mat-badge-below]': '!isAbove()',\n    '[class.mat-badge-before]': '!isAfter()',\n    '[class.mat-badge-after]': 'isAfter()',\n    '[class.mat-badge-small]': 'size === \"small\"',\n    '[class.mat-badge-medium]': 'size === \"medium\"',\n    '[class.mat-badge-large]': 'size === \"large\"',\n    '[class.mat-badge-hidden]': 'hidden || !_hasContent',\n    '[class.mat-badge-disabled]': 'disabled',\n  },\n})\nexport class MatBadge extends _MatBadgeBase implements OnDestroy, OnChanges, CanDisable {\n  /** Whether the badge has any content. */\n  _hasContent = false;\n\n  /** The color of the badge. Can be `primary`, `accent`, or `warn`. */\n  @Input('matBadgeColor')\n  get color(): ThemePalette { return this._color; }\n  set color(value: ThemePalette) {\n    this._setColor(value);\n    this._color = value;\n  }\n  private _color: ThemePalette = 'primary';\n\n  /** Whether the badge should overlap its contents or not */\n  @Input('matBadgeOverlap')\n  get overlap(): boolean { return this._overlap; }\n  set overlap(val: boolean) {\n    this._overlap = coerceBooleanProperty(val);\n  }\n  private _overlap: boolean = true;\n\n  /**\n   * Position the badge should reside.\n   * Accepts any combination of 'above'|'below' and 'before'|'after'\n   */\n  @Input('matBadgePosition') position: MatBadgePosition = 'above after';\n\n  /** The content for the badge */\n  @Input('matBadge') content: string | number | undefined | null;\n\n  /** Message used to describe the decorated element via aria-describedby */\n  @Input('matBadgeDescription')\n  get description(): string { return this._description; }\n  set description(newDescription: string) {\n    if (newDescription !== this._description) {\n      const badgeElement = this._badgeElement;\n      this._updateHostAriaDescription(newDescription, this._description);\n      this._description = newDescription;\n\n      if (badgeElement) {\n        newDescription ? badgeElement.setAttribute('aria-label', newDescription) :\n            badgeElement.removeAttribute('aria-label');\n      }\n    }\n  }\n  private _description: string;\n\n  /** Size of the badge. Can be 'small', 'medium', or 'large'. */\n  @Input('matBadgeSize') size: MatBadgeSize = 'medium';\n\n  /** Whether the badge is hidden. */\n  @Input('matBadgeHidden')\n  get hidden(): boolean { return this._hidden; }\n  set hidden(val: boolean) {\n    this._hidden = coerceBooleanProperty(val);\n  }\n  private _hidden: boolean;\n\n  /** Unique id for the badge */\n  _id: number = nextId++;\n\n  private _badgeElement: HTMLElement | undefined;\n\n  constructor(\n      private _ngZone: NgZone,\n      private _elementRef: ElementRef<HTMLElement>,\n      private _ariaDescriber: AriaDescriber,\n      private _renderer: Renderer2,\n      @Optional() @Inject(ANIMATION_MODULE_TYPE) private _animationMode?: string) {\n      super();\n\n      if (typeof ngDevMode === 'undefined' || ngDevMode) {\n        const nativeElement = _elementRef.nativeElement;\n        if (nativeElement.nodeType !== nativeElement.ELEMENT_NODE) {\n          throw Error('matBadge must be attached to an element node.');\n        }\n      }\n    }\n\n  /** Whether the badge is above the host or not */\n  isAbove(): boolean {\n    return this.position.indexOf('below') === -1;\n  }\n\n  /** Whether the badge is after the host or not */\n  isAfter(): boolean {\n    return this.position.indexOf('before') === -1;\n  }\n\n  ngOnChanges(changes: SimpleChanges) {\n    const contentChange = changes['content'];\n\n    if (contentChange) {\n      const value = contentChange.currentValue;\n      this._hasContent = value != null && `${value}`.trim().length > 0;\n      this._updateTextContent();\n    }\n  }\n\n  ngOnDestroy() {\n    const badgeElement = this._badgeElement;\n\n    if (badgeElement) {\n      if (this.description) {\n        this._ariaDescriber.removeDescription(badgeElement, this.description);\n      }\n\n      // When creating a badge through the Renderer, Angular will keep it in an index.\n      // We have to destroy it ourselves, otherwise it'll be retained in memory.\n      if (this._renderer.destroyNode) {\n        this._renderer.destroyNode(badgeElement);\n      }\n    }\n  }\n\n  /**\n   * Gets the element into which the badge's content is being rendered.\n   * Undefined if the element hasn't been created (e.g. if the badge doesn't have content).\n   */\n  getBadgeElement(): HTMLElement | undefined {\n    return this._badgeElement;\n  }\n\n  /** Injects a span element into the DOM with the content. */\n  private _updateTextContent(): HTMLSpanElement {\n    if (!this._badgeElement) {\n      this._badgeElement = this._createBadgeElement();\n    } else {\n      this._badgeElement.textContent = this._stringifyContent();\n    }\n    return this._badgeElement;\n  }\n\n  /** Creates the badge element */\n  private _createBadgeElement(): HTMLElement {\n    const badgeElement = this._renderer.createElement('span');\n    const activeClass = 'mat-badge-active';\n    const contentClass = 'mat-badge-content';\n\n    // Clear any existing badges which may have persisted from a server-side render.\n    this._clearExistingBadges(contentClass);\n    badgeElement.setAttribute('id', `mat-badge-content-${this._id}`);\n    badgeElement.classList.add(contentClass);\n    badgeElement.textContent = this._stringifyContent();\n\n    if (this._animationMode === 'NoopAnimations') {\n      badgeElement.classList.add('_mat-animation-noopable');\n    }\n\n    if (this.description) {\n      badgeElement.setAttribute('aria-label', this.description);\n    }\n\n    this._elementRef.nativeElement.appendChild(badgeElement);\n\n    // animate in after insertion\n    if (typeof requestAnimationFrame === 'function' && this._animationMode !== 'NoopAnimations') {\n      this._ngZone.runOutsideAngular(() => {\n        requestAnimationFrame(() => {\n          badgeElement.classList.add(activeClass);\n        });\n      });\n    } else {\n      badgeElement.classList.add(activeClass);\n    }\n\n    return badgeElement;\n  }\n\n  /** Sets the aria-label property on the element */\n  private _updateHostAriaDescription(newDescription: string, oldDescription: string): void {\n    // ensure content available before setting label\n    const content = this._updateTextContent();\n\n    if (oldDescription) {\n      this._ariaDescriber.removeDescription(content, oldDescription);\n    }\n\n    if (newDescription) {\n      this._ariaDescriber.describe(content, newDescription);\n    }\n  }\n\n  /** Adds css theme class given the color to the component host */\n  private _setColor(colorPalette: ThemePalette) {\n    if (colorPalette !== this._color) {\n      const classList = this._elementRef.nativeElement.classList;\n      if (this._color) {\n        classList.remove(`mat-badge-${this._color}`);\n      }\n      if (colorPalette) {\n        classList.add(`mat-badge-${colorPalette}`);\n      }\n    }\n  }\n\n  /** Clears any existing badges that might be left over from server-side rendering. */\n  private _clearExistingBadges(cssClass: string) {\n    const element = this._elementRef.nativeElement;\n    let childCount = element.children.length;\n\n    // Use a reverse while, because we'll be removing elements from the list as we're iterating.\n    while (childCount--) {\n      const currentChild = element.children[childCount];\n\n      if (currentChild.classList.contains(cssClass)) {\n        element.removeChild(currentChild);\n      }\n    }\n  }\n\n  /** Gets the string representation of the badge content. */\n  private _stringifyContent(): string {\n    // Convert null and undefined to an empty string which is consistent\n    // with how Angular handles them in inside template interpolations.\n    const content = this.content;\n    return content == null ? '' : `${content}`;\n  }\n\n  static ngAcceptInputType_disabled: BooleanInput;\n  static ngAcceptInputType_hidden: BooleanInput;\n  static ngAcceptInputType_overlap: BooleanInput;\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.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {MatBadge} from './badge';\n\n\n@NgModule({\n  imports: [\n    A11yModule,\n    MatCommonModule\n  ],\n  exports: [MatBadge, MatCommonModule],\n  declarations: [MatBadge],\n})\nexport class MatBadgeModule {}\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.io/license\n */\n\nexport * from './badge-module';\nexport * from './badge';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AA0BA,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;AACA;AACA,MAAM,aAAa,GAAG,aAAa,CAAC;CAAQ,CAAC,CAAC;AAU9C;MAkBa,QAAS,SAAQ,aAAa;IA+DzC,YACY,OAAe,EACf,WAAoC,EACpC,cAA6B,EAC7B,SAAoB,EACuB,cAAuB;QAC1E,KAAK,EAAE,CAAC;QALA,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAyB;QACpC,mBAAc,GAAd,cAAc,CAAe;QAC7B,cAAS,GAAT,SAAS,CAAW;QACuB,mBAAc,GAAd,cAAc,CAAS;;QAlE9E,gBAAW,GAAG,KAAK,CAAC;QASZ,WAAM,GAAiB,SAAS,CAAC;QAQjC,aAAQ,GAAY,IAAI,CAAC;;;;;QAMN,aAAQ,GAAqB,aAAa,CAAC;;QAuB/C,SAAI,GAAiB,QAAQ,CAAC;;QAWrD,QAAG,GAAW,MAAM,EAAE,CAAC;QAYnB,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE;YAC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