{"version":3,"file":"rxjs-core.mjs","sources":["../../../projects/rxjs-core/src/lib/devtools/log-to-redux-devtools-extension.ts","../../../projects/rxjs-core/src/lib/operators/cache.ts","../../../projects/rxjs-core/src/lib/operators/debounce-map.ts","../../../projects/rxjs-core/src/lib/operators/delay-on-microtask-queue.ts","../../../projects/rxjs-core/src/lib/operators/distinct-until-keys-changed.ts","../../../projects/rxjs-core/src/lib/create-operator-function.ts","../../../projects/rxjs-core/src/lib/operators/filter-behavior.ts","../../../projects/rxjs-core/src/lib/operators/log-values.ts","../../../projects/rxjs-core/src/lib/operators/map-and-cache-elements.ts","../../../projects/rxjs-core/src/lib/operators/map-and-cache-array-elements.ts","../../../projects/rxjs-core/src/lib/operators/map-and-cache-object-elements.ts","../../../projects/rxjs-core/src/lib/operators/map-to-latest-from.ts","../../../projects/rxjs-core/src/lib/operators/skip-after.ts","../../../projects/rxjs-core/src/lib/operators/with-history.ts","../../../projects/rxjs-core/src/lib/is-page-visible.ts","../../../projects/rxjs-core/src/lib/keep-wake-lock.ts","../../../projects/rxjs-core/src/lib/subscription-manager.ts","../../../projects/rxjs-core/src/public-api.ts","../../../projects/rxjs-core/src/rxjs-core.ts"],"sourcesContent":["import { Observable, Subscription } from 'rxjs';\nimport { EnhancerOptions } from './enhancer-options';\n\nexport interface Connection {\n  send: (action: any, state: any) => void;\n}\n\nexport interface Extension {\n  connect: (options?: EnhancerOptions) => Connection;\n}\n\ndeclare global {\n  interface Window {\n    __REDUX_DEVTOOLS_EXTENSION__?: Extension;\n  }\n}\n\n/**\n * Log the values emitted from any observable to the [redux devtools extension](https://github.com/reduxjs/redux-devtools).\n *\n * @param options These are passed along to the extension as is. See its documentation [here](https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md).\n */\nexport function logToReduxDevtoolsExtension(\n  observable: Observable<any>,\n  options?: EnhancerOptions,\n): Subscription {\n  const extension = window.__REDUX_DEVTOOLS_EXTENSION__;\n  if (!extension) {\n    return new Subscription();\n  }\n\n  const connection = extension.connect(options);\n  return observable.subscribe((value) => {\n    connection.send({}, value);\n  });\n}\n","import {\n  MonoTypeOperatorFunction,\n  Observable,\n  ReplaySubject,\n  Subscription,\n} from 'rxjs';\n\n/**\n * 1. Caches the last value emitted to give to new subscribers (without running any upstream pipe operators)\n * 2. Manages all subscribers directly, without passing subscriptions up the stream.\n *\n * This is very similar to `shareReplay(1)`, except that once all subscribers unsubscribe this also unsubscribes from the upstream observable.\n *\n * ```ts\n * const source = new BehaviorSubject(1000);\n * const result = source.pipe(expensiveComputation(), cache());\n * source.subscribe(); // expensiveComputation(1000) runs\n * source.subscribe(); // the cached result is used\n * source.next(2000); // expensiveComputation(2000) runs once, emitted to both subscribers\n * ```\n */\nexport function cache<T>(): MonoTypeOperatorFunction<T> {\n  return (source: Observable<T>): Observable<T> => {\n    let middleMan: ReplaySubject<T> | undefined;\n    let upstreamSubscription: Subscription;\n    return new Observable<T>((subscriber) => {\n      if (!middleMan) {\n        middleMan = new ReplaySubject<T>(1);\n        upstreamSubscription = source.subscribe(middleMan);\n      }\n\n      const subscription = middleMan.subscribe(subscriber);\n\n      // teardown logic\n      return (): void => {\n        subscription.unsubscribe();\n        if (!middleMan!.observed) {\n          upstreamSubscription.unsubscribe();\n          middleMan = undefined;\n        }\n      };\n    });\n  };\n}\n","import { Deferred } from '@s-libs/js-core';\nimport { bindKey, flow } from '@s-libs/micro-dash';\nimport { debounce, from, Observable, OperatorFunction } from 'rxjs';\nimport { finalize, switchMap } from 'rxjs/operators';\n\n/**\n * It's like {@linkcode https://rxjs-dev.firebaseapp.com/api/operators/exhaustMap exhaustMap}, except it debounces upstream emissions until the previous result completes.\n *\n * ```\n * source:                     -0-1-2-------3-|\n *                              i--B-|\n *                                   i--B-|\n *                                          i--B-|\n * debounceMap((i) => i--B-|): -0--B-2--B---3--B-|\n */\nexport function debounceMap<UpstreamType, DownstreamType>(\n  map: (\n    input: UpstreamType,\n  ) => Observable<DownstreamType> | PromiseLike<DownstreamType>,\n): OperatorFunction<UpstreamType, DownstreamType> {\n  let lastOperationComplete = Promise.resolve();\n  return flow(\n    debounce<UpstreamType>(async () => lastOperationComplete),\n    switchMap((value) => {\n      const deferred = new Deferred<void>();\n      lastOperationComplete = deferred.promise;\n      return from(map(value)).pipe(finalize(bindKey(deferred, 'resolve')));\n    }),\n  );\n}\n","import { asapScheduler, MonoTypeOperatorFunction } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\n/**\n * Delays the emission of items from the source Observable using the microtask queue.\n */\nexport function delayOnMicrotaskQueue<T>(): MonoTypeOperatorFunction<T> {\n  return delay<T>(0, asapScheduler);\n}\n","import { isSetEqual } from '@s-libs/js-core';\nimport { keys } from '@s-libs/micro-dash';\nimport { MonoTypeOperatorFunction } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\n/**\n * Allows items through whose keys are distinct from the previous item.\n *\n * ```\n * source:                     |-{a:1,b:2}--{a:2,b:3}--{a:2,c:3}--{b:3}--{b:4}-|\n * distinctUntilKeysChanged(): |-{a:1,b:2}-------------{a:2,c:3}--{b:3}--------|\n * ```\n */\nexport function distinctUntilKeysChanged<\n  T extends object,\n>(): MonoTypeOperatorFunction<T> {\n  let lastKeySet: Set<string | keyof T> | undefined;\n  return filter((value) => {\n    const keySet = new Set(keys(value));\n    if (lastKeySet && isSetEqual(keySet, lastKeySet)) {\n      return false;\n    }\n\n    lastKeySet = keySet;\n    return true;\n  });\n}\n","import { Observable, Observer, OperatorFunction, Subscription } from 'rxjs';\n\n/**\n * Use this to create a complex pipeable operator. It is usually a better style to compose existing operators than to create a brand new one, but when you need full control, this can reduce some boilerplate.\n *\n * The supplied `subscriber` will act as a simple pass-through of all values, errors, and completion to `destination`. Modify it for your needs.\n *\n * A simple example, recreating the \"map\" operator:\n * ```ts\n * function map<I, O>(fn: (input: I) => O) {\n *   return createOperatorFunction<I, O>(\n *     (subscriber, destination) => {\n *       subscriber.next = (value) => {\n *         destination.next(fn(value));\n *       };\n *     },\n *   );\n * }\n * ```\n *\n * For a more complex example, check the source of `skipAfter`.\n */\nexport function createOperatorFunction<\n  SourceType,\n  DestinationType = SourceType,\n>(\n  modifySubscriber: (\n    subscriber: SubscriberCompat<SourceType>,\n    destination: Observer<DestinationType>,\n  ) => void,\n): OperatorFunction<SourceType, DestinationType> {\n  return (source: Observable<SourceType>): Observable<DestinationType> =>\n    new Observable<DestinationType>((destination) => {\n      const subscriber = new SubscriberCompat<SourceType>(\n        destination as Observer<any>,\n      );\n      modifySubscriber(subscriber, destination);\n      return source.subscribe(subscriber);\n    });\n}\n\n/**\n * RxJS deprecated all the ways to create their `Subscriber` class. This recreates the parts of its functionality we surfaced.\n */\nexport class SubscriberCompat<T> extends Subscription implements Observer<T> {\n  constructor(private destination: Observer<unknown>) {\n    super();\n  }\n\n  next(value: T): void {\n    this.destination.next(value);\n  }\n\n  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- just following the `Observer` interface\n  error(err: any): void {\n    try {\n      this.destination.error(err);\n    } finally {\n      this.unsubscribe();\n    }\n  }\n\n  complete(): void {\n    try {\n      this.destination.complete();\n    } finally {\n      this.unsubscribe();\n    }\n  }\n}\n","import { Predicate } from '@angular/core';\nimport { MonoTypeOperatorFunction } from 'rxjs';\nimport { createOperatorFunction } from '../create-operator-function';\n\n/**\n * Works like `filter()`, but always lets through the first emission for each new subscriber. This makes it suitable for subscribers that expect the observable to behave like a `BehaviorSubject`, where the first emission is processed synchronously during the call to `subscribe()`.\n *\n * ```\n * source:                   |-false--true--false--true--false--true-|\n * filterBehavior(identity): |-false--true---------true---------true-|\n * filterBehavior(identity):        |-true---------true---------true-|\n * filterBehavior(identity):              |-false--true---------true-|\n * ```\n */\nexport function filterBehavior<T>(\n  predicate: Predicate<T>,\n): MonoTypeOperatorFunction<T> {\n  return createOperatorFunction<T>((subscriber, destination) => {\n    let firstValue = true;\n    subscriber.next = (value): void => {\n      if (firstValue) {\n        destination.next(value);\n        firstValue = false;\n        return;\n      }\n\n      try {\n        if (predicate(value)) {\n          destination.next(value);\n        }\n      } catch (ex) {\n        destination.error(ex);\n      }\n    };\n  });\n}\n","import { MonoTypeOperatorFunction } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n/**\n * Logs values, errors and completion to the console, and passes them all along unchanged.\n *\n * ```ts\n * of(1, 2).pipe(logValues()).subscribe();\n * // prints using console.log:\n * // [value] 1\n * // [value] 2\n * // [complete]\n *\n * of(1, 2).pipe(logValues(\"my number\", \"debug\")).subscribe();\n * // prints using console.debug:\n * // [value] my number 1\n * // [value] my number 2\n * // [complete] my number\n *\n * throwError(\"boo\").pipe(logValues(\"pipe says\", \"warn\")).subscribe();\n * // prints using console.warn:\n * // [error] pipe says boo\n * ```\n */\nexport function logValues<T>(\n  prefix?: string,\n  level: 'debug' | 'error' | 'info' | 'log' | 'trace' | 'warn' = 'log',\n): MonoTypeOperatorFunction<T> {\n  return tap<T>({\n    next: makeLogFn('[value]'),\n    error: makeLogFn('[error]'),\n    complete: makeLogFn('[complete]'),\n  });\n\n  function makeLogFn(...prefixes: string[]): (value?: any) => void {\n    if (prefix !== undefined) {\n      prefixes.push(prefix);\n    }\n    return (...values: any[]): void => {\n      console[level](...prefixes, ...values);\n    };\n  }\n}\n","import { map as _map } from '@s-libs/micro-dash';\nimport { OperatorFunction } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\ntype BuildDownstreamItem<UpstreamType, DownstreamType> = (\n  upstreamItem: UpstreamType,\n  key: keyof any,\n) => DownstreamType;\n\nexport function mapAndCacheElements<UpstreamType, DownstreamType>(\n  buildCacheKey: (upstreamItem: UpstreamType, key: keyof any) => any,\n  buildDownstreamItem: BuildDownstreamItem<UpstreamType, DownstreamType>,\n): OperatorFunction<UpstreamType | null | undefined, DownstreamType[]> {\n  let cache = new Map<any, DownstreamType>();\n\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n  return map((upstreamItems: any) => {\n    const nextCache = new Map<any, DownstreamType>();\n\n    const downstreamItems = _map(upstreamItems, (upstreamItem, key) => {\n      const cacheKey = buildCacheKey(upstreamItem, key);\n\n      let downstreamItem: DownstreamType;\n      if (cache.has(cacheKey)) {\n        downstreamItem = cache.get(cacheKey)!;\n      } else if (nextCache.has(cacheKey)) {\n        downstreamItem = nextCache.get(cacheKey)!;\n      } else {\n        downstreamItem = buildDownstreamItem(upstreamItem, key);\n      }\n\n      nextCache.set(cacheKey, downstreamItem);\n      return downstreamItem;\n    });\n\n    cache = nextCache;\n    return downstreamItems;\n  });\n}\n","import { OperatorFunction } from 'rxjs';\nimport { mapAndCacheElements } from './map-and-cache-elements';\n\ntype ArrayIteratee<I, O> = (item: I, index: number) => O;\n\n/**\n * Applies `buildDownstreamItem` to each item in the upstream array and emits the result. Each downstream item is cached using the key generated by `buildCacheKey` so that the next emission contains references to the matching objects from the previous emission, without running `buildDownstreamItem` again. The cache is only held between successive emissions.\n *\n * This is useful e.g. when using the result in an `*ngFor` expression of an angular template, to prevent angular from rebuilding the inner component and to allow `OnPush` optimizations in the inner component.\n *\n * If multiple items in an upstream array have the same cache key, it will only call `buildDownstreamItem` once.\n *\n * ```ts\n * const mapWithCaching = mapAndCacheArrayElements(\n *   (item) => item,\n *   (item) => item + 1\n * )\n * ```\n * ```\n * source:         -[1, 2]---[1, 2, 3]---[2]--|\n * mapWithCaching: -[2, 3]---[2, 3, 4]---[3]--|\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\nexport const mapAndCacheArrayElements = mapAndCacheElements as <\n  UpstreamType,\n  DownstreamType,\n>(\n  buildCacheKey: ArrayIteratee<UpstreamType, any>,\n  buildDownstreamItem: ArrayIteratee<UpstreamType, DownstreamType>,\n) => OperatorFunction<UpstreamType[] | null | undefined, DownstreamType[]>;\n","import { OperatorFunction } from 'rxjs';\nimport { mapAndCacheElements } from './map-and-cache-elements';\n\ntype ObjectIteratee<T, O> = <K extends keyof T>(\n  item: T[K],\n  key: number extends keyof T ? string : K,\n) => O;\n\n/**\n * Applies `buildDownstreamItem` to each item in the upstream object and emits an array containing the results. Each downstream item is cached using the key generated by `buildCacheKey` so that the next emission contains references to the matching objects from the previous emission, without running `buildDownstreamItem` again. The cache is only held between successive emissions.\n *\n * This is useful e.g. when using the result in an `*ngFor` expression of an angular template, to prevent angular from rebuilding the inner component and to allow `OnPush` optimizations in the inner component.\n *\n * If multiple items in an upstream object have the same cache key, it will only call `buildDownstreamItem` once.\n *\n * ```ts\n * const mapWithCaching = mapAndCacheObjectElements(\n *   (item, key) => key,\n *   (item, key) => item + 1\n * )\n * ```\n * ```\n * source:         -{ a: 1, b: 2 }---{ a: 1, b: 2, c: 3 }---{ b: 2 }--|\n * mapWithCaching: -[2, 3]-----------[2, 3, 4]--------------[3]--|\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\nexport const mapAndCacheObjectElements = mapAndCacheElements as <\n  UpstreamType,\n  DownstreamType = UpstreamType[keyof UpstreamType],\n>(\n  buildCacheKey: ObjectIteratee<UpstreamType, any>,\n  buildDownstreamItem: ObjectIteratee<UpstreamType, DownstreamType>,\n) => OperatorFunction<UpstreamType | null | undefined, DownstreamType[]>;\n","import { flow } from '@s-libs/micro-dash';\nimport { Observable, OperatorFunction } from 'rxjs';\nimport { map, withLatestFrom } from 'rxjs/operators';\n\n/**\n * Emits the latest value of the given Observable every time the source Observable emits a value.\n *\n * ```\n * source:               -1---2--3------4-|\n * inner:                ---a------b--c---|\n * mapToLastFrom(inner): -----a--a------c-|\n * ```\n */\nexport function mapToLatestFrom<T>(\n  inner$: Observable<T>,\n): OperatorFunction<any, T> {\n  return flow(\n    withLatestFrom(inner$),\n    map(([_, inner]) => inner),\n  );\n}\n","import { bindKey } from '@s-libs/micro-dash';\nimport { MonoTypeOperatorFunction, Observable } from 'rxjs';\nimport { createOperatorFunction } from '../create-operator-function';\n\n/**\n * Causes the next value in the pipe to be skipped after `skip$` emits a value. For example:\n *\n * ```\n * source: -1-----2-----3-----4-----5-|\n * skip$:  ----0----------0-0----------\n *\n * result: -1-----------3-----------5-|\n * ```\n * ```ts\n * const source = new Subject();\n * const skip$ = new Subject();\n * const result = source.pipe(skipAfter(skip$));\n *\n * source.next(1); // result emits `1`\n *\n * skip$.next();\n * source.next(2); // result does not emit\n * source.next(3); // result emits `3`\n *\n * skip$.next();\n * skip$.next();\n * source.next(4); // result does not emit\n * source.next(5); // result emits `5`\n * ```\n */\nexport function skipAfter<T>(\n  skip$: Observable<any>,\n): MonoTypeOperatorFunction<T> {\n  return createOperatorFunction<T>((subscriber, destination) => {\n    let skipNext = false;\n    subscriber.add(\n      skip$.subscribe({\n        next: () => {\n          skipNext = true;\n        },\n        error: bindKey(destination, 'error'),\n      }),\n    );\n    subscriber.next = (value): void => {\n      if (skipNext) {\n        skipNext = false;\n      } else {\n        destination.next(value);\n      }\n    };\n  });\n}\n","import { OperatorFunction } from 'rxjs';\nimport { scan } from 'rxjs/operators';\n\n/**\n * Emits the upstream value as the first element in an array, followed by the last `count` values in reverse chronological order.\n *\n * ```\n * source:         -1----2------3--------4--------5--------|\n * withHistory(2): -[1]--[2,1]--[3,2,1]--[4,3,2]--[5,4,3]--|\n * withHistory(0): -[1]--[2]----[3]------[4]------[5]------|\n * ```\n */\n\nexport function withHistory<T>(count: 0): OperatorFunction<T, [T]>;\nexport function withHistory<T>(count: 1): OperatorFunction<T, [T, T?]>;\nexport function withHistory<T>(count: 2): OperatorFunction<T, [T, T?, T?]>;\nexport function withHistory<T>(count: 3): OperatorFunction<T, [T, T?, T?, T?]>;\nexport function withHistory<T>(\n  count: 4,\n): OperatorFunction<T, [T, T?, T?, T?, T?]>;\nexport function withHistory<T>(count: number): OperatorFunction<T, [T, ...T[]]>;\n\nexport function withHistory<T>(count: number): OperatorFunction<T, T[]> {\n  return scan<T, T[]>((buf, value) => [value, ...buf.slice(0, count)], []);\n}\n","import { distinctUntilChanged, fromEvent, Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\n\n/**\n * Creates an observable that emits when the [page visibility]{@link https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API} changes. It also emits the current visibility immediately upon subscription.\n *\n * ```ts\n * isPageVisible$().subscribe((isVisible) => {\n *   if (isVisible) {\n *     console.log('Page is visible');\n *   } else {\n *     console.log('Page is hidden');\n *   }\n * });\n * ```\n *\n * Note that for Angular projects, there is a harness available to help with tests that use this function in `@s-libs/ng-dev`.\n */\nexport function isPageVisible$(): Observable<boolean> {\n  return fromEvent(document, 'visibilitychange').pipe(\n    startWith(undefined),\n    map(() => document.visibilityState === 'visible'),\n    distinctUntilChanged(),\n  );\n}\n","import { isTruthy } from '@s-libs/js-core';\nimport { Observable } from 'rxjs';\nimport { filter, finalize, switchMap } from 'rxjs/operators';\nimport { isPageVisible$ } from './is-page-visible';\n\nexport interface WakeLockSentinel {\n  release: () => Promise<void>;\n}\n\nexport interface WakeLock {\n  request: (type: 'screen') => Promise<WakeLockSentinel>;\n}\n\nexport interface ExtendedNavigator {\n  wakeLock?: WakeLock;\n}\n\n/**\n * Subscribe to the returned observable to acquire a [wake lock]{@link https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API}. The wake lock will be re-acquired whenever the page is visible automatically. Unsubscribe to release it.\n *\n * There are no guarantees about what or when the returned observable emits.\n */\nexport function keepWakeLock$(): Observable<unknown> {\n  let sentinel: WakeLockSentinel | undefined;\n  const nav = navigator as ExtendedNavigator;\n  return isPageVisible$().pipe(\n    filter(isTruthy),\n    switchMap(async () => {\n      try {\n        sentinel = await nav.wakeLock?.request('screen');\n      } catch {\n        // can happen when e.g. the battery is low\n      }\n    }),\n    finalize(() => {\n      // eslint-disable-next-line @typescript-eslint/no-floating-promises\n      sentinel?.release();\n    }),\n  );\n}\n","import { Constructor } from '@s-libs/js-core';\nimport { Observable, Subscription, Unsubscribable } from 'rxjs';\n\n/**\n * Mixes in {@link SubscriptionManager} as an additional superclass.\n *\n * ```ts\n * class MySubclass extends mixInSubscriptionManager(MyOtherSuperclass) {\n *   subscribeAndManage(observable: Observable<any>) {\n *     this.subscribeTo(observable);\n *   }\n * }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type,@typescript-eslint/explicit-module-boundary-types\nexport function mixInSubscriptionManager<B extends Constructor>(Base: B) {\n  return class extends Base implements Unsubscribable {\n    #subscriptions = new Subscription();\n\n    // eslint-disable-next-line @typescript-eslint/max-params\n    subscribeTo<T>(\n      observable: Observable<T>,\n      next?: (value: T) => void,\n      error?: (error: any) => void,\n      complete?: () => void,\n    ): void {\n      this.#subscriptions.add(\n        observable.subscribe({\n          next: next?.bind(this),\n          error: error?.bind(this),\n          complete: complete?.bind(this),\n        }),\n      );\n    }\n\n    manage(subscription: Subscription): void {\n      this.#subscriptions.add(subscription);\n    }\n\n    unsubscribe(): void {\n      this.#subscriptions.unsubscribe();\n      this.#subscriptions = new Subscription();\n    }\n  };\n}\n\n/**\n * Tracks all subscriptions to easily unsubscribe from them all during cleanup. Also binds callbacks to `this` for convenient use as a superclass, e.g.:\n *\n * ```ts\n * class EventLogger extends SubscriptionManager {\n *   constructor(private prefix: string, event$: Observable<string>) {\n *     super();\n *\n *     // you can pass in an instance method here and it will be bound to `this`\n *     this.subscribeTo(event$, this.log);\n *   }\n *\n *   log(event: string) {\n *     // even though this is used as a callback, you can still use `this`\n *     console.log(this.prefix + event);\n *   }\n * }\n * ```\n */\nexport class SubscriptionManager extends mixInSubscriptionManager(Object) {}\n","/*\n * Public API Surface of rxjs-core\n */\n\nexport * from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["_map"],"mappings":";;;;;AAiBA;;;;AAIG;AACG,SAAU,2BAA2B,CACzC,UAA2B,EAC3B,OAAyB,EAAA;AAEzB,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,4BAA4B;IACrD,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,YAAY,EAAE;IAC3B;IAEA,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;AAC7C,IA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