UNPKG

@angular/platform-browser

Version:

Angular - library for using Angular in a web browser

1 lines 34.6 kB
{"version":3,"file":"_browser-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/browser/browser_adapter.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/browser/testability.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/dom/events/key_events.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/platform-browser/src/browser.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 ɵparseCookieValue as parseCookieValue,\n ɵsetRootDomAdapter as setRootDomAdapter,\n ɵDomAdapter as DomAdapter,\n} from '@angular/common';\n\n/**\n * A `DomAdapter` powered by full browser DOM APIs.\n *\n * @security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\nexport class BrowserDomAdapter extends DomAdapter {\n override readonly supportsDOMEvents: boolean = true;\n\n static makeCurrent() {\n setRootDomAdapter(new BrowserDomAdapter());\n }\n\n override onAndCancel(el: Node, evt: any, listener: any, options: any): Function {\n el.addEventListener(evt, listener, options);\n return () => {\n el.removeEventListener(evt, listener, options);\n };\n }\n override dispatchEvent(el: Node, evt: any) {\n el.dispatchEvent(evt);\n }\n override remove(node: Node): void {\n (node as Element | Text | Comment).remove();\n }\n override createElement(tagName: string, doc?: Document): HTMLElement {\n doc = doc || this.getDefaultDocument();\n return doc.createElement(tagName);\n }\n override createHtmlDocument(): Document {\n return document.implementation.createHTMLDocument('fakeTitle');\n }\n override getDefaultDocument(): Document {\n return document;\n }\n\n override isElementNode(node: Node): boolean {\n return node.nodeType === Node.ELEMENT_NODE;\n }\n\n override isShadowRoot(node: any): boolean {\n return node instanceof DocumentFragment;\n }\n\n /** @deprecated No longer being used in Ivy code. To be removed in version 14. */\n override getGlobalEventTarget(doc: Document, target: string): EventTarget | null {\n if (target === 'window') {\n return window;\n }\n if (target === 'document') {\n return doc;\n }\n if (target === 'body') {\n return doc.body;\n }\n return null;\n }\n override getBaseHref(doc: Document): string | null {\n const href = getBaseElementHref();\n return href == null ? null : relativePath(href);\n }\n override resetBaseElement(): void {\n baseElement = null;\n }\n override getUserAgent(): string {\n return window.navigator.userAgent;\n }\n override getCookie(name: string): string | null {\n return parseCookieValue(document.cookie, name);\n }\n}\n\nlet baseElement: HTMLElement | null = null;\nfunction getBaseElementHref(): string | null {\n baseElement = baseElement || document.head.querySelector('base');\n return baseElement ? baseElement.getAttribute('href') : null;\n}\n\nfunction relativePath(url: string): string {\n // The base URL doesn't really matter, we just need it so relative paths have something\n // to resolve against. In the browser `HTMLBaseElement.href` is always absolute.\n return new URL(url, document.baseURI).pathname;\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 {ɵgetDOM as getDOM} from '@angular/common';\nimport {\n GetTestability,\n Testability,\n TestabilityRegistry,\n ɵglobal as global,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nexport class BrowserGetTestability implements GetTestability {\n addToWindow(registry: TestabilityRegistry): void {\n global['getAngularTestability'] = (elem: any, findInAncestors: boolean = true) => {\n const testability = registry.findTestabilityInTree(elem, findInAncestors);\n if (testability == null) {\n throw new RuntimeError(\n RuntimeErrorCode.TESTABILITY_NOT_FOUND,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Could not find testability for element.',\n );\n }\n return testability;\n };\n\n global['getAllAngularTestabilities'] = () => registry.getAllTestabilities();\n\n global['getAllAngularRootElements'] = () => registry.getAllRootElements();\n\n const whenAllStable = (callback: () => void) => {\n const testabilities = global['getAllAngularTestabilities']() as Testability[];\n let count = testabilities.length;\n const decrement = function () {\n count--;\n if (count == 0) {\n callback();\n }\n };\n testabilities.forEach((testability) => {\n testability.whenStable(decrement);\n });\n };\n\n if (!global['frameworkStabilizers']) {\n global['frameworkStabilizers'] = [];\n }\n global['frameworkStabilizers'].push(whenAllStable);\n }\n\n findTestabilityInTree(\n registry: TestabilityRegistry,\n elem: any,\n findInAncestors: boolean,\n ): Testability | null {\n if (elem == null) {\n return null;\n }\n const t = registry.getTestability(elem);\n if (t != null) {\n return t;\n } else if (!findInAncestors) {\n return null;\n }\n if (getDOM().isShadowRoot(elem)) {\n return this.findTestabilityInTree(registry, (<any>elem).host, true);\n }\n return this.findTestabilityInTree(registry, elem.parentElement, true);\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 {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable, type ListenerOptions, NgZone} from '@angular/core';\n\nimport {EventManagerPlugin} from './event_manager_plugin';\n\n/**\n * Defines supported modifiers for key events.\n */\nconst MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];\n\n// The following values are here for cross-browser compatibility and to match the W3C standard\n// cf https://www.w3.org/TR/DOM-Level-3-Events-key/\nconst _keyMap: {[k: string]: string} = {\n '\\b': 'Backspace',\n '\\t': 'Tab',\n '\\x7F': 'Delete',\n '\\x1B': 'Escape',\n 'Del': 'Delete',\n 'Esc': 'Escape',\n 'Left': 'ArrowLeft',\n 'Right': 'ArrowRight',\n 'Up': 'ArrowUp',\n 'Down': 'ArrowDown',\n 'Menu': 'ContextMenu',\n 'Scroll': 'ScrollLock',\n 'Win': 'OS',\n};\n\n/**\n * Retrieves modifiers from key-event objects.\n */\nconst MODIFIER_KEY_GETTERS: {[key: string]: (event: KeyboardEvent) => boolean} = {\n 'alt': (event: KeyboardEvent) => event.altKey,\n 'control': (event: KeyboardEvent) => event.ctrlKey,\n 'meta': (event: KeyboardEvent) => event.metaKey,\n 'shift': (event: KeyboardEvent) => event.shiftKey,\n};\n\n/**\n * A browser plug-in that provides support for handling of key events in Angular.\n */\n@Injectable()\nexport class KeyEventsPlugin extends EventManagerPlugin {\n /**\n * Initializes an instance of the browser plug-in.\n * @param doc The document in which key events will be detected.\n */\n constructor(@Inject(DOCUMENT) doc: any) {\n super(doc);\n }\n\n /**\n * Reports whether a named key event is supported.\n * @param eventName The event name to query.\n * @return True if the named key event is supported.\n */\n override supports(eventName: string): boolean {\n return KeyEventsPlugin.parseEventName(eventName) != null;\n }\n\n /**\n * Registers a handler for a specific element and key event.\n * @param element The HTML element to receive event notifications.\n * @param eventName The name of the key event to listen for.\n * @param handler A function to call when the notification occurs. Receives the\n * event object as an argument.\n * @returns The key event that was registered.\n */\n override addEventListener(\n element: HTMLElement,\n eventName: string,\n handler: Function,\n options?: ListenerOptions,\n ): Function {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName)!;\n\n const outsideHandler = KeyEventsPlugin.eventCallback(\n parsedEvent['fullKey'],\n handler,\n this.manager.getZone(),\n );\n\n return this.manager.getZone().runOutsideAngular(() => {\n return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler, options);\n });\n }\n\n /**\n * Parses the user provided full keyboard event definition and normalizes it for\n * later internal use. It ensures the string is all lowercase, converts special\n * characters to a standard spelling, and orders all the values consistently.\n *\n * @param eventName The name of the key event to listen for.\n * @returns an object with the full, normalized string, and the dom event name\n * or null in the case when the event doesn't match a keyboard event.\n */\n static parseEventName(eventName: string): {fullKey: string; domEventName: string} | null {\n const parts: string[] = eventName.toLowerCase().split('.');\n\n const domEventName = parts.shift();\n if (parts.length === 0 || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n return null;\n }\n\n const key = KeyEventsPlugin._normalizeKey(parts.pop()!);\n\n let fullKey = '';\n let codeIX = parts.indexOf('code');\n if (codeIX > -1) {\n parts.splice(codeIX, 1);\n fullKey = 'code.';\n }\n MODIFIER_KEYS.forEach((modifierName) => {\n const index: number = parts.indexOf(modifierName);\n if (index > -1) {\n parts.splice(index, 1);\n fullKey += modifierName + '.';\n }\n });\n fullKey += key;\n\n if (parts.length != 0 || key.length === 0) {\n // returning null instead of throwing to let another plugin process the event\n return null;\n }\n\n // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming.\n // The code must remain in the `result['domEventName']` form.\n // return {domEventName, fullKey};\n const result: {fullKey: string; domEventName: string} = {} as any;\n result['domEventName'] = domEventName;\n result['fullKey'] = fullKey;\n return result;\n }\n\n /**\n * Determines whether the actual keys pressed match the configured key code string.\n * The `fullKeyCode` event is normalized in the `parseEventName` method when the\n * event is attached to the DOM during the `addEventListener` call. This is unseen\n * by the end user and is normalized for internal consistency and parsing.\n *\n * @param event The keyboard event.\n * @param fullKeyCode The normalized user defined expected key event string\n * @returns boolean.\n */\n static matchEventFullKeyCode(event: KeyboardEvent, fullKeyCode: string): boolean {\n let keycode = _keyMap[event.key] || event.key;\n let key = '';\n if (fullKeyCode.indexOf('code.') > -1) {\n keycode = event.code;\n key = 'code.';\n }\n // the keycode could be unidentified so we have to check here\n if (keycode == null || !keycode) return false;\n keycode = keycode.toLowerCase();\n if (keycode === ' ') {\n keycode = 'space'; // for readability\n } else if (keycode === '.') {\n keycode = 'dot'; // because '.' is used as a separator in event names\n }\n MODIFIER_KEYS.forEach((modifierName) => {\n if (modifierName !== keycode) {\n const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];\n if (modifierGetter(event)) {\n key += modifierName + '.';\n }\n }\n });\n key += keycode;\n return key === fullKeyCode;\n }\n\n /**\n * Configures a handler callback for a key event.\n * @param fullKey The event name that combines all simultaneous keystrokes.\n * @param handler The function that responds to the key event.\n * @param zone The zone in which the event occurred.\n * @returns A callback function.\n */\n static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function {\n return (event: KeyboardEvent) => {\n if (KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) {\n zone.runGuarded(() => handler(event));\n }\n };\n }\n\n /** @internal */\n static _normalizeKey(keyName: string): string {\n return keyName === 'esc' ? 'escape' : keyName;\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 {CommonModule, DOCUMENT, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common';\nimport {\n ApplicationConfig,\n ApplicationModule,\n ApplicationRef,\n createPlatformFactory,\n ErrorHandler,\n inject,\n InjectionToken,\n ɵINJECTOR_SCOPE as INJECTOR_SCOPE,\n ɵinternalCreateApplication as internalCreateApplication,\n NgModule,\n PLATFORM_ID,\n PLATFORM_INITIALIZER,\n platformCore,\n PlatformRef,\n Provider,\n RendererFactory2,\n ɵresolveComponentResources as resolveComponentResources,\n ɵRuntimeError as RuntimeError,\n ɵSHARED_STYLES_HOST as SHARED_STYLES_HOST,\n StaticProvider,\n NgZone,\n Testability,\n TestabilityRegistry,\n ɵTESTABILITY as TESTABILITY,\n ɵTESTABILITY_GETTER as TESTABILITY_GETTER,\n ɵUSE_PENDING_TASKS,\n Type,\n ɵsetDocument,\n} from '@angular/core';\n\nimport {BrowserDomAdapter} from './browser/browser_adapter';\nimport {BrowserGetTestability} from './browser/testability';\nimport {DomRendererFactory2} from './dom/dom_renderer';\nimport {DomEventsPlugin} from './dom/events/dom_events';\nimport {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';\nimport {KeyEventsPlugin} from './dom/events/key_events';\nimport {SharedStylesHost} from './dom/shared_styles_host';\nimport {RuntimeErrorCode} from './errors';\n\n/**\n * A context object that can be passed to `bootstrapApplication` to provide a pre-existing platform\n * injector.\n *\n * @publicApi\n */\nexport interface BootstrapContext {\n /**\n * A reference to a platform.\n */\n platformRef: PlatformRef;\n}\n\n/**\n * Bootstraps an instance of an Angular application and renders a standalone component as the\n * application's root component. More information about standalone components can be found in [this\n * guide](guide/components).\n *\n * @usageNotes\n * The root component passed into this function **must** be a standalone one\n *\n * ```angular-ts\n * @Component({\n * template: 'Hello world!'\n * })\n * class Root {}\n *\n * const appRef: ApplicationRef = await bootstrapApplication(Root);\n * ```\n *\n * You can add the list of providers that should be available in the application injector by\n * specifying the `providers` field in an object passed as the second argument:\n *\n * ```ts\n * await bootstrapApplication(Root, {\n * providers: [\n * {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}\n * ]\n * });\n * ```\n *\n * The `importProvidersFrom` helper method can be used to collect all providers from any\n * existing NgModule (and transitively from all NgModules that it imports):\n *\n * ```ts\n * await bootstrapApplication(Root, {\n * providers: [\n * importProvidersFrom(SomeNgModule)\n * ]\n * });\n * ```\n *\n * Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by\n * default. You can add [Testability](api/core/Testability) by getting the list of necessary\n * providers using `provideProtractorTestingSupport()` function and adding them into the `providers`\n * array, for example:\n *\n * ```ts\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(Root, {providers: [provideProtractorTestingSupport()]});\n * ```\n *\n * @param rootComponent A reference to a standalone component that should be rendered.\n * @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for\n * additional info.\n * @param context Optional context object that can be used to provide a pre-existing\n * platform injector. This is useful for advanced use-cases, for example, server-side\n * rendering, where the platform is created for each request.\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n *\n * @publicApi\n */\nexport async function bootstrapApplication(\n rootComponent: Type<unknown>,\n options?: ApplicationConfig,\n context?: BootstrapContext,\n): Promise<ApplicationRef> {\n const config = {\n rootComponent,\n ...createProvidersConfig(options, context),\n };\n\n if ((typeof ngJitMode === 'undefined' || ngJitMode) && typeof fetch === 'function') {\n await resolveJitResources();\n }\n\n return internalCreateApplication(config);\n}\n\n/**\n * Create an instance of an Angular application without bootstrapping any components. This is useful\n * for the situation where one wants to decouple application environment creation (a platform and\n * associated injectors) from rendering components on a screen. Components can be subsequently\n * bootstrapped on the returned `ApplicationRef`.\n *\n * @param options Extra configuration for the application environment, see `ApplicationConfig` for\n * additional info.\n * @param context Optional context object that can be used to provide a pre-existing\n * platform injector. This is useful for advanced use-cases, for example, server-side\n * rendering, where the platform is created for each request.\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n *\n * @publicApi\n */\nexport async function createApplication(\n options?: ApplicationConfig,\n context?: BootstrapContext,\n): Promise<ApplicationRef> {\n if ((typeof ngJitMode === 'undefined' || ngJitMode) && typeof fetch === 'function') {\n await resolveJitResources();\n }\n\n return internalCreateApplication(createProvidersConfig(options, context));\n}\n\nfunction createProvidersConfig(options?: ApplicationConfig, context?: BootstrapContext) {\n return {\n platformRef: context?.platformRef,\n appProviders: [...BROWSER_MODULE_PROVIDERS, ...(options?.providers ?? [])],\n platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS,\n };\n}\n\n/** Attempt to resolve component resources before bootstrapping in JIT mode. */\nasync function resolveJitResources(): Promise<void> {\n try {\n return await resolveComponentResources(fetch);\n } catch (error) {\n // Log, but don't block bootstrapping on error.\n // tslint:disable-next-line:no-console\n console.error(error);\n }\n}\n\n/**\n * Returns a set of providers required to setup [Testability](api/core/Testability) for an\n * application bootstrapped using the `bootstrapApplication` function. The set of providers is\n * needed to support testing an application with Protractor (which relies on the Testability APIs\n * to be present).\n *\n * @returns An array of providers required to setup Testability for an application and make it\n * available for testing using Protractor.\n *\n * @publicApi\n */\nexport function provideProtractorTestingSupport(\n options: {usePendingTasksForStability?: boolean} = {},\n): Provider[] {\n // Return a copy to prevent changes to the original array in case any in-place\n // alterations are performed to the `provideProtractorTestingSupport` call results in app\n // code.\n return [\n ...TESTABILITY_PROVIDERS,\n options?.usePendingTasksForStability !== undefined\n ? {provide: ɵUSE_PENDING_TASKS, useValue: options.usePendingTasksForStability ?? false}\n : [],\n ];\n}\n\nexport function initDomAdapter() {\n BrowserDomAdapter.makeCurrent();\n}\n\nexport function errorHandler(): ErrorHandler {\n return new ErrorHandler();\n}\n\nexport function _document(): any {\n // Tell ivy about the global document\n ɵsetDocument(document);\n return document;\n}\n\nconst INTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[] = [\n {provide: PLATFORM_ID, useValue: PLATFORM_BROWSER_ID},\n {provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true},\n {provide: DOCUMENT, useFactory: _document},\n];\n\n/**\n * A factory function that returns a `PlatformRef` instance associated with browser service\n * providers.\n *\n * @publicApi\n */\nexport const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef =\n createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n\n/**\n * Internal marker to signal whether providers from the `BrowserModule` are already present in DI.\n * This is needed to avoid loading `BrowserModule` providers twice. We can't rely on the\n * `BrowserModule` presence itself, since the standalone-based bootstrap just imports\n * `BrowserModule` providers without referencing the module itself.\n */\nconst BROWSER_MODULE_PROVIDERS_MARKER = new InjectionToken(\n typeof ngDevMode === 'undefined' || ngDevMode ? 'BrowserModule Providers Marker' : '',\n);\n\nconst TESTABILITY_PROVIDERS = [\n {\n provide: TESTABILITY_GETTER,\n useClass: BrowserGetTestability,\n },\n {\n provide: TESTABILITY,\n useClass: Testability,\n deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER],\n },\n {\n provide: Testability, // Also provide as `Testability` for backwards-compatibility.\n useClass: Testability,\n deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER],\n },\n];\n\nconst BROWSER_MODULE_PROVIDERS: Provider[] = [\n {provide: INJECTOR_SCOPE, useValue: 'root'},\n {provide: ErrorHandler, useFactory: errorHandler},\n {\n provide: EVENT_MANAGER_PLUGINS,\n useClass: DomEventsPlugin,\n multi: true,\n },\n {provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true},\n DomRendererFactory2,\n {provide: SHARED_STYLES_HOST, useClass: SharedStylesHost},\n // Only remains for backwards compatibility, should be removed once g3 no longer needs it.\n {provide: SharedStylesHost, useExisting: SHARED_STYLES_HOST},\n EventManager,\n {provide: RendererFactory2, useExisting: DomRendererFactory2},\n typeof ngDevMode === 'undefined' || ngDevMode\n ? {provide: BROWSER_MODULE_PROVIDERS_MARKER, useValue: true}\n : [],\n];\n\n/**\n * Exports required infrastructure for all Angular apps.\n * Included by default in all Angular apps created with the CLI\n * `new` command.\n * Re-exports `CommonModule` and `ApplicationModule`, making their\n * exports and providers available to all apps.\n *\n * @publicApi\n */\n@NgModule({\n providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],\n exports: [CommonModule, ApplicationModule],\n})\nexport class BrowserModule {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const providersAlreadyPresent = inject(BROWSER_MODULE_PROVIDERS_MARKER, {\n optional: true,\n skipSelf: true,\n });\n\n if (providersAlreadyPresent) {\n throw new RuntimeError(\n RuntimeErrorCode.BROWSER_MODULE_ALREADY_LOADED,\n `Providers from the \\`BrowserModule\\` have already been loaded. If you need access ` +\n `to common directives such as NgIf and NgFor, import the \\`CommonModule\\` instead.`,\n );\n }\n }\n }\n}\n"],"names":["DomAdapter","setRootDomAdapter","parseCookieValue","global","RuntimeError","getDOM","internalCreateApplication","resolveComponentResources","ɵUSE_PENDING_TASKS","ɵsetDocument","PLATFORM_BROWSER_ID","TESTABILITY_GETTER","TESTABILITY","INJECTOR_SCOPE","SHARED_STYLES_HOST"],"mappings":";;;;;;;;;;;AAoBM,MAAO,iBAAkB,SAAQA,WAAU,CAAA;AAC7B,EAAA,iBAAiB,GAAY,IAAI;AAEnD,EAAA,OAAO,WAAW,GAAA;AAChB,IAAAC,kBAAiB,CAAC,IAAI,iBAAiB,EAAE,CAAC;AAC5C,EAAA;EAES,WAAW,CAAC,EAAQ,EAAE,GAAQ,EAAE,QAAa,EAAE,OAAY,EAAA;IAClE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC;AAC3C,IAAA,OAAO,MAAK;MACV,EAAE,CAAC,mBAAmB,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAA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