{"version":3,"file":"rxap-data-source-directive.mjs","sources":["../../../../../packages/angular/data-source/directive/src/lib/data-source-collection.directive.ts","../../../../../packages/angular/data-source/directive/src/lib/data-source.directive.ts","../../../../../packages/angular/data-source/directive/src/index.ts","../../../../../packages/angular/data-source/directive/src/rxap-data-source-directive.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport {\n  AfterViewInit,\n  ChangeDetectorRef,\n  Directive,\n  DoCheck,\n  EmbeddedViewRef,\n  EventEmitter,\n  Inject,\n  INJECTOR,\n  Input,\n  isDevMode,\n  IterableChangeRecord,\n  IterableChanges,\n  IterableDiffer,\n  IterableDiffers,\n  NgZone,\n  OnChanges,\n  OnDestroy,\n  Output,\n  SimpleChanges,\n  TemplateRef,\n  TrackByFunction,\n  ViewContainerRef,\n} from '@angular/core';\nimport {\n  BaseDataSource,\n  BaseDataSourceViewer,\n  DataSourceLoader,\n} from '@rxap/data-source';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport {\n  Observable,\n  Subscription,\n} from 'rxjs';\nimport {\n  filter,\n  take,\n  tap,\n} from 'rxjs/operators';\n\nexport class DataSourceCollectionTemplateContext<Data> {\n  constructor(\n    public $implicit: Data,\n    public connection$: Observable<Data[]>,\n    public index: number,\n    public count: number,\n  ) {\n  }\n\n  get first(): boolean {\n    return this.index === 0;\n  }\n\n  get last(): boolean {\n    return this.index === this.count - 1;\n  }\n\n  get even(): boolean {\n    return this.index % 2 === 0;\n  }\n\n  get odd(): boolean {\n    return !this.even;\n  }\n}\n\nfunction getTypeName(type: any): string {\n  return type['name'] || typeof type;\n}\n\nclass RecordViewTuple<T> {\n  constructor(\n    public record: any,\n    public view: EmbeddedViewRef<DataSourceCollectionTemplateContext<T>>,\n  ) {\n  }\n}\n\nexport interface DataSourceCollectionErrorTemplateContext {\n  $implicit: unknown | null;\n  refresh: () => void;\n}\n\n@Directive({\n  selector: '[rxapDataSourceCollection]',\n  standalone: true,\n})\nexport class DataSourceCollectionDirective<Data = any>\n  implements OnChanges, OnDestroy, AfterViewInit, DoCheck {\n  // eslint-disable-next-line @angular-eslint/no-input-rename\n  @Input({\n    required: true,\n    alias: 'rxapDataSourceCollectionFrom',\n  })\n  public dataSourceOrIdOrToken!: IdOrInstanceOrToken<BaseDataSource<Data[]>>;\n  @Input('rxapDataSourceCollectionViewer')\n  public viewer: BaseDataSourceViewer = { id: '[rxapDataSourceCollection]' };\n  public dataSource: BaseDataSource<Data[]> | null = null;\n  // eslint-disable-next-line @angular-eslint/no-input-rename\n  @Input('rxapDataSourceCollectionEmpty')\n  public emptyTemplate?: TemplateRef<void>;\n  @Input('rxapDataSourceCollectionErrorTemplate')\n  public errorTemplate?: TemplateRef<DataSourceCollectionErrorTemplateContext>;\n  @Output()\n  public loaded = new EventEmitter();\n  @Output()\n  // eslint-disable-next-line @angular-eslint/no-output-native\n  public error = new EventEmitter();\n  public connection$: Observable<Data[]> | null = null;\n  protected readonly subscription = new Subscription();\n  protected embeddedErrorViewRef?: EmbeddedViewRef<DataSourceCollectionErrorTemplateContext>;\n  private _differ: IterableDiffer<Data> | null = null;\n  private _trackByFn!: TrackByFunction<Data>;\n  private _dirty = true;\n  /**\n   * Idecates that the data source returned a empty collection\n   *\n   * true - is empty\n   * false - is NOT empty\n   * null - unknown\n   *\n   * @private\n   */\n  private _empty: boolean | null = null;\n  /**\n   * Holds the empty template view ref.\n   *\n   * Is used to determine if a empty template is added to the\n   * view. And used to destruct the empty template if the data source\n   * changes from empty to not empty.\n   *\n   * @private\n   */\n  private _emptyTemplateViewRef: EmbeddedViewRef<void> | null = null;\n  private _dataSourceLoadingSubscription: Subscription | null = null;\n\n  constructor(\n    @Inject(DataSourceLoader)\n    private readonly dataSourceLoader: DataSourceLoader,\n    @Inject(TemplateRef)\n    private readonly template: TemplateRef<\n      DataSourceCollectionTemplateContext<Data>\n    >,\n    @Inject(ViewContainerRef)\n    private readonly viewContainerRef: ViewContainerRef,\n    @Inject(INJECTOR)\n    private readonly injector: Injector,\n    @Inject(IterableDiffers)\n    private readonly differs: IterableDiffers,\n    @Inject(ChangeDetectorRef)\n    private readonly cdr: ChangeDetectorRef,\n    @Inject(NgZone)\n    private readonly zone: NgZone,\n  ) {\n  }\n\n  /**\n   * A function that defines how to track changes for items in the iterable.\n   *\n   * When items are added, moved, or removed in the iterable,\n   * the directive must re-render the appropriate DOM nodes.\n   * To minimize churn in the DOM, only nodes that have changed\n   * are re-rendered.\n   *\n   * By default, the change detector assumes that\n   * the object instance identifies the node in the iterable.\n   * When this function is supplied, the directive uses\n   * the result of calling this function to identify the item node,\n   * rather than the identity of the object itself.\n   *\n   * The function receives two inputs,\n   * the iteration index and the node object ID.\n   */\n  @Input()\n  set rxapDataSourceCollectionTrackBy(fn: TrackByFunction<Data>) {\n    if (isDevMode() && fn != null && typeof fn !== 'function') {\n      // TODO(vicb): use a log service once there is a public one available\n      if (<any>console && <any>console.warn) {\n        console.warn(\n          `trackBy must be a function, but received ${ JSON.stringify(fn) }. ` +\n          `See https://angular.io/api/common/NgForOf#change-propagation for more information.`,\n        );\n      }\n    }\n    this._trackByFn = fn;\n  }\n\n  get ngForTrackBy(): TrackByFunction<Data> {\n    return this._trackByFn;\n  }\n\n  /**\n   * Holds the data that should be displayed\n   * @private\n   */\n  private _data: Data[] | null = null;\n\n  protected set data(data: Data[]) {\n    this._data = data;\n    this._dirty = true;\n  }\n\n  /**\n   * Asserts the correct type of the context for the template that `NgForOf` will render.\n   *\n   * The presence of this method is a signal to the Ivy template type-check compiler that the\n   * `NgForOf` structural directive renders its template with a specific context type.\n   */\n  static ngTemplateContextGuard<T>(\n    dir: DataSourceCollectionDirective<T>,\n    ctx: any,\n  ): ctx is DataSourceCollectionTemplateContext<T> {\n    return true;\n  }\n\n  // TODO : handel that case: a new data source instance is provided and an open connection to the old data source exists.\n  public ngOnChanges(changes: SimpleChanges) {\n    const dataSourceOrIdOrTokenChange = changes['dataSourceOrIdOrToken'];\n    if (dataSourceOrIdOrTokenChange) {\n      this.dataSource = this.loadDataSource();\n      // Dont connect to the data source on the first change.\n      // Else the parent/sibling components are not initialized\n      // and the parameters from the parent/sibling components can not\n      // be used in the connect logic.\n      // Example: The PaginationDataSource required the pageSize, but the pageSize\n      // in the MatPaginator will be set after the ngOnChanges logic is called.\n      // So the initial pageSize is undefined.\n      if (!dataSourceOrIdOrTokenChange.firstChange) {\n        this.connect();\n      }\n    }\n  }\n\n  public ngAfterViewInit() {\n    this.connect();\n  }\n\n  public ngOnDestroy(): void {\n    this._differ = null;\n    this._empty = null;\n    this.viewContainerRef.clear();\n    this.dataSource?.disconnect(this.viewer);\n    this.subscription.unsubscribe();\n    this._dataSourceLoadingSubscription?.unsubscribe();\n  }\n\n  /**\n   * Applies the changes when needed.\n   */\n  public ngDoCheck(): void {\n    if (this._empty === true) {\n      this.viewContainerRef.clear();\n      this._differ = null;\n\n      // attaches the empty template if the data source is empty\n      if (this.emptyTemplate) {\n        this._emptyTemplateViewRef = this.viewContainerRef.createEmbeddedView(\n          this.emptyTemplate,\n        );\n      }\n    } else if (this._empty === false) {\n      // detach and destroy the empty template if the data source is not\n      // empty any more\n      if (this._emptyTemplateViewRef) {\n        this._emptyTemplateViewRef.detach();\n        this._emptyTemplateViewRef.destroy();\n        this._emptyTemplateViewRef = null;\n      }\n\n      if (this._data) {\n        this._dirty = false;\n        // React on ngForOf changes only once all inputs have been initialized\n        const value = this._data;\n        if (!this._differ && value) {\n          try {\n            this._differ = this.differs.find(value).create(this.ngForTrackBy);\n          } catch {\n            throw new Error(\n              `Cannot find a differ supporting object '${ value }' of type '${ getTypeName(\n                value,\n              ) }'. NgFor only supports binding to Iterables such as Arrays.`,\n            );\n          }\n        }\n      }\n      if (this._differ) {\n        const changes = this._differ.diff(this._data);\n        if (changes) {\n          this.applyChanges(changes);\n        }\n      }\n    }\n  }\n\n  public embedErrorTemplate(error: unknown | null) {\n    if (!this.errorTemplate) {\n      if (isDevMode()) {\n        console.log('Skip error template embedding. ErrorTemplate is not defined');\n      }\n      return;\n    }\n    const context = {\n      $implicit: error,\n      // eslint-disable-next-line @typescript-eslint/no-empty-function\n      refresh: this.dataSource?.refresh.bind(this.dataSource) ?? (() => {\n      }),\n    };\n    this.embeddedErrorViewRef?.destroy();\n    this.viewContainerRef.clear();\n    this.embeddedErrorViewRef = this.viewContainerRef.createEmbeddedView(\n      this.errorTemplate,\n      context,\n    );\n    this.cdr.detectChanges();\n  }\n\n  protected connect() {\n    if (this.dataSource) {\n      this.connection$ = this.dataSource.connect(this.viewer);\n      this.zone.onStable\n          .pipe(\n            take(1),\n            tap(() => {\n              this.zone.run(() => {\n                this.subscription.add(\n                  this.connection$!.pipe(\n                    tap({\n                      next: (response) => {\n                        this._empty = response.length === 0;\n                        this._data = response;\n                        this.cdr.detectChanges();\n                      },\n                      error: (error) => {\n                        this.error.emit(error);\n                        console.error(\n                          `Connection failure in ${ this.dataSource!.constructor.name }: ${ error.message }`,\n                          error,\n                        );\n                        this.embedErrorTemplate(error);\n                      },\n                    }),\n                  ).subscribe(),\n                );\n              });\n            }),\n          )\n          .subscribe();\n    } else {\n      throw new Error(\n        'Can not connect to the data source. The data source is not loaded!',\n      );\n    }\n  }\n\n  protected applyChanges(changes: IterableChanges<Data>) {\n    const insertTuples: RecordViewTuple<Data>[] = [];\n    changes.forEachOperation(\n      (\n        item: IterableChangeRecord<any>,\n        adjustedPreviousIndex: number | null,\n        currentIndex: number | null,\n      ) => {\n        if (item.previousIndex == null) {\n          // NgForOf is never \"null\" or \"undefined\" here because the differ detected\n          // that a new item needs to be inserted from the iterable. This implies that\n          // there is an iterable value for \"_ngForOf\".\n          const view = this.viewContainerRef.createEmbeddedView(\n            this.template,\n            new DataSourceCollectionTemplateContext<Data>(\n              null!,\n              this.connection$!,\n              -1,\n              -1,\n            ),\n            currentIndex === null ? undefined : currentIndex,\n          );\n          const tuple = new RecordViewTuple<Data>(item, view);\n          insertTuples.push(tuple);\n        } else if (currentIndex == null) {\n          this.viewContainerRef.remove(\n            adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex,\n          );\n        } else if (adjustedPreviousIndex !== null) {\n          const view = this.viewContainerRef.get(adjustedPreviousIndex)!;\n          this.viewContainerRef.move(view, currentIndex);\n          const tuple = new RecordViewTuple(\n            item,\n            <EmbeddedViewRef<DataSourceCollectionTemplateContext<Data>>>view,\n          );\n          insertTuples.push(tuple);\n        }\n      },\n    );\n\n    for (let i = 0; i < insertTuples.length; i++) {\n      this.perViewChange(insertTuples[i].view, insertTuples[i].record);\n    }\n\n    for (let i = 0,\n           ilen = this.viewContainerRef.length; i < ilen; i++) {\n      const viewRef = <\n        EmbeddedViewRef<DataSourceCollectionTemplateContext<Data>>\n        >this.viewContainerRef.get(i);\n      viewRef.context.index = i;\n      viewRef.context.count = ilen;\n      viewRef.context.connection$ = this.connection$!;\n    }\n\n    changes.forEachIdentityChange((record: any) => {\n      const viewRef = <\n        EmbeddedViewRef<DataSourceCollectionTemplateContext<Data>>\n        >this.viewContainerRef.get(record.currentIndex);\n      viewRef.context.$implicit = record.item;\n    });\n  }\n\n  protected loadDataSource(): BaseDataSource<Data[]> | null {\n    let dataSource: BaseDataSource | null = null;\n    if (typeof this.dataSourceOrIdOrToken === 'string') {\n      dataSource = this.dataSourceLoader.load<BaseDataSource<Data[]>>(\n        this.dataSourceOrIdOrToken,\n        undefined,\n        this.injector,\n      );\n    } else if (this.dataSourceOrIdOrToken instanceof BaseDataSource) {\n      dataSource = this.dataSourceOrIdOrToken;\n    } else if (this.dataSourceOrIdOrToken !== null) {\n      dataSource = this.injector.get<BaseDataSource<Data[]>>(\n        this.dataSourceOrIdOrToken,\n      );\n    }\n    this._dataSourceLoadingSubscription?.unsubscribe();\n    this._dataSourceLoadingSubscription =\n      dataSource?.loading$.pipe(filter(Boolean)).subscribe(this.loaded) ?? null;\n    return dataSource;\n  }\n\n  private perViewChange(\n    view: EmbeddedViewRef<DataSourceCollectionTemplateContext<Data>>,\n    record: IterableChangeRecord<any>,\n  ) {\n    view.context.$implicit = record.item;\n  }\n\n}\n\n\n","import type { Injector } from '@angular/core';\nimport {\n  AfterViewInit,\n  ChangeDetectorRef,\n  Directive,\n  EmbeddedViewRef,\n  EventEmitter,\n  Inject,\n  INJECTOR,\n  Input,\n  isDevMode,\n  NgZone,\n  OnChanges,\n  OnDestroy,\n  Output,\n  SimpleChanges,\n  TemplateRef,\n  ViewContainerRef,\n} from '@angular/core';\nimport {\n  BaseDataSource,\n  BaseDataSourceViewer,\n  DataSourceLoader,\n} from '@rxap/data-source';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { noop } from '@rxap/utilities';\nimport {\n  Observable,\n  Subscription,\n} from 'rxjs';\nimport {\n  distinctUntilChanged,\n  filter,\n  take,\n  tap,\n} from 'rxjs/operators';\n\nexport interface DataSourceTemplateContext<Data> {\n  $implicit: Data;\n  connection$: Observable<Data>;\n}\n\nexport interface DataSourceErrorTemplateContext {\n  $implicit: unknown | null;\n  refresh: () => void;\n}\n\n@Directive({\n  selector: '[rxapDataSource]',\n  exportAs: 'rxapDataSource',\n  standalone: true,\n})\nexport class DataSourceDirective<Data = any>\n  implements OnDestroy, OnChanges, AfterViewInit {\n\n  /**\n   * Asserts the correct type of the context for the template that `NgForOf` will render.\n   *\n   * The presence of this method is a signal to the Ivy template type-check compiler that the\n   * `NgForOf` structural directive renders its template with a specific context type.\n   */\n  static ngTemplateContextGuard<T>(\n    dir: DataSourceDirective<T>,\n    ctx: any,\n  ): ctx is DataSourceTemplateContext<T> {\n    return true;\n  }\n\n  // eslint-disable-next-line @angular-eslint/no-input-rename\n  @Input({\n    required: true,\n    alias: 'rxapDataSourceFrom',\n  })\n  public dataSourceOrIdOrToken!: IdOrInstanceOrToken<BaseDataSource<Data>>;\n  @Input('rxapDataSourceViewer')\n  public viewer!: BaseDataSourceViewer;\n  @Input('rxapDataSourceErrorTemplate')\n  public errorTemplate?: TemplateRef<DataSourceErrorTemplateContext>;\n  @Output()\n  public embedded = new EventEmitter<Data>();\n  @Output()\n  public loaded = new EventEmitter();\n  @Output()\n  // eslint-disable-next-line @angular-eslint/no-output-native\n  public error = new EventEmitter();\n  public dataSource: BaseDataSource<Data> | null = null;\n  public connection$!: Observable<Data>;\n  @Input('rxapDataSourceTrackBy')\n  public trackBy?: (data: Data) => any;\n  /**\n   * @deprecated removed\n   * @protected\n   */\n  protected readonly subscription = new Subscription();\n  protected embeddedViewRef: EmbeddedViewRef<DataSourceTemplateContext<Data>> | null = null;\n  protected embeddedErrorViewRef: EmbeddedViewRef<DataSourceErrorTemplateContext> | null = null;\n  private _dataSourceLoadingSubscription: Subscription | null = null;\n  private _dataSourceConnectionSubscription: Subscription | null = null;\n\n  constructor(\n    private readonly dataSourceLoader: DataSourceLoader,\n    private readonly template: TemplateRef<DataSourceTemplateContext<Data>>,\n    private readonly viewContainerRef: ViewContainerRef,\n    @Inject(INJECTOR)\n    private readonly injector: Injector,\n    private readonly cdr: ChangeDetectorRef,\n    private readonly zone: NgZone,\n  ) {\n    this.viewer = this;\n  }\n\n  public ngOnChanges(changes: SimpleChanges) {\n    const dataSourceOrIdOrTokenChange = changes['dataSourceOrIdOrToken'];\n    if (dataSourceOrIdOrTokenChange) {\n      this.dataSource = this.loadDataSource();\n      // Dont connect to the data source on the first change.\n      // Else the parent/sibling components are not initialized\n      // and the parameters from the parent/sibling components can not\n      // be used in the connect logic.\n      // Example: The PaginationDataSource required the pageSize, but the pageSize\n      // in the MatPaginator will be set after the ngOnChanges logic is called.\n      // So the initial pageSize is undefined.\n      if (!dataSourceOrIdOrTokenChange.firstChange) {\n        this.connect();\n      }\n    }\n  }\n\n  public ngAfterViewInit() {\n    this.connect();\n  }\n\n  public embedErrorTemplate(error: unknown | null) {\n    if (!this.errorTemplate) {\n      if (isDevMode()) {\n        console.log('Skip error template embedding. ErrorTemplate is not defined');\n      }\n      return;\n    }\n    const context = {\n      $implicit: error,\n      // eslint-disable-next-line @typescript-eslint/no-empty-function\n      refresh: this.dataSource?.refresh.bind(this.dataSource) ?? noop,\n    };\n\n    this.embeddedViewRef?.destroy();\n    this.embeddedViewRef = null;\n\n    this.embeddedErrorViewRef?.destroy();\n    this.embeddedErrorViewRef = this.viewContainerRef.createEmbeddedView(\n      this.errorTemplate,\n      context,\n    );\n    this.cdr.detectChanges();\n  }\n\n  public embedTemplate(response: any) {\n    this.embeddedErrorViewRef?.destroy();\n    this.embeddedErrorViewRef = null;\n    const context = {\n      $implicit: response,\n      connection$: this.connection$,\n    };\n    if (this.embeddedViewRef && !this.hasChanged(this.embeddedViewRef.context.$implicit, response)) {\n      this.embeddedViewRef.context = context;\n    } else {\n      this.embeddedViewRef?.destroy();\n      this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(\n        this.template,\n        context,\n      );\n    }\n    this.embedded.emit(response);\n    this.cdr.detectChanges();\n  }\n\n  public ngOnDestroy(): void {\n    this.dataSource?.disconnect(this.viewer);\n    this.subscription.unsubscribe();\n    this._dataSourceConnectionSubscription?.unsubscribe();\n    this._dataSourceLoadingSubscription?.unsubscribe();\n  }\n\n  protected loadDataSource(): BaseDataSource<Data> | null {\n    let dataSource: BaseDataSource | null = null;\n    if (typeof this.dataSourceOrIdOrToken === 'string') {\n      dataSource = this.dataSourceLoader.load<BaseDataSource<Data>>(\n        this.dataSourceOrIdOrToken,\n        undefined,\n        this.injector,\n      );\n    } else if (this.dataSourceOrIdOrToken instanceof BaseDataSource) {\n      dataSource = this.dataSourceOrIdOrToken;\n    } else if (this.dataSourceOrIdOrToken !== null) {\n      dataSource = this.injector.get<BaseDataSource<Data>>(\n        this.dataSourceOrIdOrToken,\n      );\n    }\n    this._dataSourceLoadingSubscription?.unsubscribe();\n    this._dataSourceLoadingSubscription =\n      dataSource?.loading$.pipe(filter(Boolean)).subscribe(this.loaded) ?? null;\n    return dataSource;\n  }\n\n  protected connect() {\n    if (this.dataSource) {\n      this.dataSource.hasError$.pipe(\n        distinctUntilChanged(),\n        tap(hasError => {\n          if (hasError) {\n            this.embedErrorTemplate(null);\n          } else {\n            this.embeddedErrorViewRef?.destroy();\n            this.embeddedErrorViewRef = null;\n          }\n        }),\n      ).subscribe();\n      this.connection$ = this.dataSource.connect(this.viewer);\n      this.zone.onStable\n        .pipe(\n          take(1),\n          tap(() => {\n            this.zone.run(() => {\n              this._dataSourceConnectionSubscription?.unsubscribe();\n              this._dataSourceConnectionSubscription = this.connection$\n                .pipe(\n                  tap({\n                    next: (response) => {\n                      this.embedTemplate(response);\n                    },\n                    error: (error) => {\n                      this.error.emit(error);\n                      console.error(\n                        `Connection failure in ${ this.dataSource!.constructor.name }: ${ error.message }`,\n                        error,\n                      );\n                      this.embedErrorTemplate(error);\n                    },\n                  }),\n                )\n                .subscribe();\n            });\n          }),\n        )\n        .subscribe();\n    }\n  }\n\n  private hasChanged(last: Data, current: Data): boolean {\n    const lastKey = this.trackBy ? this.trackBy(last) : last;\n    const currentKey = this.trackBy ? this.trackBy(current) : current;\n    return lastKey !== currentKey;\n  }\n}\n\n\n","// region \nexport * from './lib/data-source-collection.directive';\nexport * from './lib/data-source.directive';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAyCa,mCAAmC,CAAA;AAC9C,IAAA,WAAA,CACS,SAAe,EACf,WAA+B,EAC/B,KAAa,EACb,KAAa,EAAA;QAHb,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,IAAK,CAAA,KAAA,GAAL,KAAK;QACL,IAAK,CAAA,KAAA,GAAL,KAAK;;AAId,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,KAAK,KAAK,CAAC;;AAGzB,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC;;AAGtC,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;;AAG7B,IAAA,IAAI,GAAG,GAAA;AACL,QA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